Index: denali.pro =================================================================== diff -u -recb2c280db303fbf2321b484572c092ae2c55cce -ra51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1 --- denali.pro (.../denali.pro) (revision ecb2c280db303fbf2321b484572c092ae2c55cce) +++ denali.pro (.../denali.pro) (revision a51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1) @@ -52,7 +52,11 @@ common/HDDefs.h \ common/MsgDefs.h \ \ # Main + sources/VTreatmentBegin.h \ sources/main.h \ + sources/model/MEndTreatmentResponse.h \ + sources/model/MStartTreatmentResponse.h \ + sources/model/hd/data/MPrimingData.h \ sources/model/MTreatmentParameters.h \ sources/model/MTreatmentParametersResp.h \ sources/storage/filesaver.h \ @@ -113,13 +117,14 @@ sources/gui/guiview.h \ sources/gui/guicontroller.h \ \ # ---------- Views ---------- - sources/view/VCreateTreatment.h \ + sources/view/VTreatmentCreate.h \ sources/view/VEventSpy.h \ sources/view/hd/data/VHDTreatmentStatesData.h \ sources/view/vview.h \ sources/view/vpoweroff.h \ \ # ---------- Views - Alarm sources/view/valarmstatus.h \ + sources/view/VPriming.h \ \ # ---------- Views - HD - Adjustment - In-Treatment sources/view/vtreatmentadjustmentresponsebase.h \ sources/view/vtreatmentadjustmentduration.h \ @@ -163,6 +168,10 @@ \ # common \ # Main main.cpp \ + sources/VTreatmentBegin.cpp \ + sources/model/MEndTreatmentResponse.cpp \ + sources/model/MStartTreatmentResponse.cpp \ + sources/model/hd/data/MPrimingData.cpp \ sources/model/MTreatmentParameters.cpp \ sources/model/MTreatmentParametersResp.cpp \ sources/storage/filesaver.cpp \ @@ -219,11 +228,12 @@ sources/gui/guiglobals.cpp \ sources/gui/guiview.cpp \ sources/gui/guicontroller.cpp \ - sources/view/VCreateTreatment.cpp \ \ # ---------- Views ---------- + sources/view/VTreatmentCreate.cpp \ sources/view/VEventSpy.cpp \ sources/view/hd/data/VHDTreatmentStatesData.cpp \ sources/view/vpoweroff.cpp \ + sources/view/VPriming.cpp \ \ # ---------- Views - Alarm sources/view/valarmstatus.cpp \ \ # ---------- Views - HD - Adjustment - In-Treatment Index: denali.pro.user =================================================================== diff -u -r7edcaf054062754370e0abd165f17ca9941b7d07 -ra51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1 --- denali.pro.user (.../denali.pro.user) (revision 7edcaf054062754370e0abd165f17ca9941b7d07) +++ denali.pro.user (.../denali.pro.user) (revision a51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1) @@ -1,6 +1,6 @@ - + EnvironmentId @@ -1185,7 +1185,7 @@ false true - /home/denali/Projects/tmp/build/denali-Desktop_Qt_5_12_5_GCC_64bit-Release + /home/denali/Projects/tmp/build/denali-Desktop_Qt_5_12_5_GCC_64bit-Debug 1 @@ -1196,7 +1196,7 @@ Qt 5.12.5 (iMX8) Qt 5.12.5 (iMX8) {5d6458ef-f917-4aef-a092-c77bbe106149} - 0 + 1 0 0 Index: sources/canbus/messageglobals.h =================================================================== diff -u -r7edcaf054062754370e0abd165f17ca9941b7d07 -ra51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1 --- sources/canbus/messageglobals.h (.../messageglobals.h) (revision 7edcaf054062754370e0abd165f17ca9941b7d07) +++ sources/canbus/messageglobals.h (.../messageglobals.h) (revision a51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1) @@ -1,16 +1,16 @@ /*! - * + * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. - * + * * \file messageglobals.h * \author (last) Behrouz NematiPour * \date (last) 20-Aug-2020 * \author (original) Behrouz NematiPour * \date (original) 06-Dec-2019 - * + * */ #pragma once @@ -74,10 +74,15 @@ {Gui::GuiActionType::ID_AlarmStatus , 4 * 4 + 2 }, // 4 parameters each 4bytes + 1 parameter 2bytes {Gui::GuiActionType::ID_AlarmTriggered , 1 * 4 }, // 1 parameter each 4bytes {Gui::GuiActionType::ID_AlarmCleared , 1 * 4 }, // 1 parameter each 4bytes - {Gui::GuiActionType::ID_AlarmSilenceReq , 5 * 4 }, // 5 parameters each 4bytes - {Gui::GuiActionType::ID_AlarmSilenceRsp , 5 * 4 }, // 5 parameters each 4bytes + {Gui::GuiActionType::ID_AlarmSilenceReq , 1 * 4 }, // 1 parameters each 4bytes // ---- + {Gui::GuiActionType::ID_StartTreatmentReq , 1 * 4 }, // 1 parameters each 4bytes + {Gui::GuiActionType::ID_StartTreatmentRsp , 2 * 4 }, // 2 parameters each 4bytes + {Gui::GuiActionType::ID_ConfirmTreatmentReq , 0 }, + {Gui::GuiActionType::ID_EndTreatmentReq , 0 }, + + // ---- {Gui::GuiActionType::ID_TreatmentRanges , 6 * 4 }, // 6 parameters each 4bytes {Gui::GuiActionType::ID_TreatmentStates , 3 * 4 }, // 3 parameters each 4bytes @@ -105,6 +110,8 @@ {Gui::GuiActionType::ID_AdjustUltrafiltrationConfirmRsp , 5 * 4 }, // ---- + {Gui::GuiActionType::ID_PrimingData , 3 * 4 }, // 3 parameters each 4bytes + // ---- {Gui::GuiActionType::ID_AdjustSalineReq , 1 * 4 }, // 1 parameter each 4bytes {Gui::GuiActionType::ID_AdjustSalineRsp , 3 * 4 }, // 3 parameters each 4bytes Index: sources/canbus/messageinterpreter.cpp =================================================================== diff -u -r5387db3e9735f3bbf768906858dbcd725cf23528 -ra51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1 --- sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision 5387db3e9735f3bbf768906858dbcd725cf23528) +++ sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision a51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1) @@ -144,9 +144,9 @@ QString mActionIdHexString = Format::toHexString(vMessage.actionId, false, eLenMessageIDDigits); QString logMessage = tr("Unhandled Message ID (HD)") + '\n' + QString("%1 # %2 %3") - .arg(int(vMessage.can_id), 3, 16, QChar('0')) - .arg(mActionIdHexString) - .arg(QString(vMessage.data.toHex('.'))); + .arg(int(vMessage.can_id), 3, 16, QChar('0')) + .arg(mActionIdHexString) + .arg(QString(vMessage.data.toHex('.'))); LOG_DEBUG(logMessage); } @@ -187,87 +187,112 @@ vPayload.clear(); int count = vData.length(); + LOG_EVENT(QString("%0").arg(vActionId)); + switch (vActionId) { // notice we are in transmit mode - case Gui::GuiActionType::ID_Acknow: // len: 0, can have zero len - break; // No data, Just registered + case Gui::GuiActionType::ID_Acknow: // len: 0, can have zero len + break; // No data, Just registered + case Gui::GuiActionType::ID_KeepAlive: // len: 255, can have any len + { + if ( count ) { // this message has a variable length + vPayload = Format::fromVariant(vData[0]); + } + LOG_EVENT(mSenderID + QString("CheckIn")); + } break; - case Gui::GuiActionType::ID_KeepAlive: // len: 255, can have any len - if ( count ) { // this message has a variable length - vPayload = Format::fromVariant(vData[0]); - } - LOG_EVENT(mSenderID + QString("CheckIn")); - break; + case Gui::GuiActionType::ID_RawData: // len: 255, can have any len + { + if ( count ) { // this message has a variable length + vPayload = Format::fromVariant(vData[0]); + } + LOG_EVENT(mSenderID + QString("RawData")); - case Gui::GuiActionType::ID_RawData: // len: 255, can have any len - if ( count ) { // this message has a variable length - vPayload = Format::fromVariant(vData[0]); - } - LOG_EVENT(mSenderID + QString("RawData")); - break; + } break; - case Gui::GuiActionType::ID_PowerOff: - if ( ! count ) { logInvalidLength(vActionId); return false; } - vPayload += Format::fromVariant(vData); - LOG_EVENT(AdjustPowerOffRequestData::toString(vData)); - break; + case Gui::GuiActionType::ID_PowerOff: + { + if ( ! count ) { logInvalidLength(vActionId); return false; } + vPayload += Format::fromVariant(vData); + LOG_EVENT(AdjustPowerOffRequestData::toString(vData)); - case Gui::GuiActionType::ID_AdjustBloodDialysateReq: - if ( ! count ) { logInvalidLength(vActionId); return false; } - vPayload = Format::fromVariant(vData); - LOG_EVENT(AdjustBloodDialysateRequestData::toString(vData)); - break; + } break; - case Gui::GuiActionType::ID_AdjustDurationReq: - if ( ! count ) { logInvalidLength(vActionId); return false; } - vPayload = Format::fromVariant(vData); - LOG_EVENT(AdjustDurationRequestData::toString(vData)); - break; + case Gui::GuiActionType::ID_AdjustBloodDialysateReq: + { + if ( ! count ) { logInvalidLength(vActionId); return false; } + vPayload = Format::fromVariant(vData); + LOG_EVENT(AdjustBloodDialysateRequestData::toString(vData)); + } break; - case Gui::GuiActionType::ID_AdjustUltrafiltrationStateReq: - if ( ! count ) { logInvalidLength(vActionId); return false; } - vPayload = Format::fromVariant(vData); - LOG_EVENT(AdjustUltrafiltrationStateRequestData::toString(vData)); - break; + case Gui::GuiActionType::ID_AdjustDurationReq: + { + if ( ! count ) { logInvalidLength(vActionId); return false; } + vPayload = Format::fromVariant(vData); + LOG_EVENT(AdjustDurationRequestData::toString(vData)); + } break; - case Gui::GuiActionType::ID_AdjustUltrafiltrationEditReq: - if ( ! count ) { logInvalidLength(vActionId); return false; } - vPayload = Format::fromVariant(vData); - LOG_EVENT(AdjustUltrafiltrationEditRequestData::toString(vData)); - break; + case Gui::GuiActionType::ID_AdjustUltrafiltrationStateReq: { + if ( ! count ) { logInvalidLength(vActionId); return false; } + vPayload = Format::fromVariant(vData); + LOG_EVENT(AdjustUltrafiltrationStateRequestData::toString(vData)); + } break; - case Gui::GuiActionType::ID_AdjustUltrafiltrationConfirmReq: - if ( ! count ) { logInvalidLength(vActionId); return false; } - vPayload = Format::fromVariant(vData); - LOG_EVENT(AdjustUltrafiltrationConfirmRequestData::toString(vData)); - break; + case Gui::GuiActionType::ID_AdjustUltrafiltrationEditReq: { + if ( ! count ) { logInvalidLength(vActionId); return false; } + vPayload = Format::fromVariant(vData); + LOG_EVENT(AdjustUltrafiltrationEditRequestData::toString(vData)); + } break; - case Gui::GuiActionType::ID_AdjustSalineReq: - if ( ! count ) { logInvalidLength(vActionId); return false; } - vPayload = Format::fromVariant(vData); - LOG_EVENT(AdjustSalineRequestData::toString(vData)); - break; + case Gui::GuiActionType::ID_AdjustUltrafiltrationConfirmReq: { + if ( ! count ) { logInvalidLength(vActionId); return false; } + vPayload = Format::fromVariant(vData); + LOG_EVENT(AdjustUltrafiltrationConfirmRequestData::toString(vData)); + } break; - case Gui::GuiActionType::ID_AlarmSilenceReq: - if ( ! count ) { logInvalidLength(vActionId); return false; } - vPayload = Format::fromVariant(vData); - LOG_EVENT(AlarmSilenceRequestData::toString(vData)); - break; + case Gui::GuiActionType::ID_AdjustSalineReq: { + if ( ! count ) { logInvalidLength(vActionId); return false; } + vPayload = Format::fromVariant(vData); + LOG_EVENT(AdjustSalineRequestData::toString(vData)); + } break; - case Gui::GuiActionType::ID_CreateTreatmentReq: { - if ( ! count ) { logInvalidLength(vActionId); return false; } - vPayload = Format::fromVariant(vData); - MAdjustTreatmentParametersRequest params; - params.fromVariantList(vData); - LOG_EVENT(params.toString()); - } break; + case Gui::GuiActionType::ID_AlarmSilenceReq: { + if ( ! count ) { logInvalidLength(vActionId); return false; } + vPayload = Format::fromVariant(vData); + LOG_EVENT(AlarmSilenceRequestData::toString(vData)); + } break; - default: { - QString mActionIdHexString = Format::toHexString(vActionId); - LOG_DEBUG(mSenderID + tr("Unknown transmit Message with ID '%1'").arg(mActionIdHexString)); - ok = false; - } break; + case Gui::GuiActionType::ID_StartTreatmentReq: { + if ( ! count ) { logInvalidLength(vActionId); return false; } + vPayload = Format::fromVariant(vData); + LOG_EVENT(StartTreatmentRequestData::toString(vData)); + } break; + case Gui::GuiActionType::ID_ConfirmTreatmentReq: { + if ( count != 0 ) { logInvalidLength(vActionId); return false; } + vPayload = Format::fromVariant(vData); + LOG_EVENT(ConfirmTreatmentRequestData::toString(vData)); + } break; + + case Gui::GuiActionType::ID_EndTreatmentReq: { + if ( count != 0 ) { logInvalidLength(vActionId); return false; } + vPayload = Format::fromVariant(vData); + LOG_EVENT(EndTreatmentRequestData::toString(vData)); + } break; + + case Gui::GuiActionType::ID_CreateTreatmentReq: { + if ( ! count ) { logInvalidLength(vActionId); return false; } + vPayload = Format::fromVariant(vData); + MAdjustTreatmentParametersRequest params; + params.fromVariantList(vData); + LOG_EVENT(params.toString()); + } break; + + default: { + QString mActionIdHexString = Format::toHexString(vActionId); + LOG_DEBUG(mSenderID + tr("Unknown transmit Message with ID '%1'").arg(mActionIdHexString)); + ok = false; + } break; } return ok; } @@ -334,6 +359,7 @@ case Gui::GuiActionType::ID_TreatmentRanges : ok = notify(vMessage, vData, Gui::GuiActionType::ID_TreatmentRanges ); break; case Gui::GuiActionType::ID_PressureOcclusion : ok = notify(vMessage, vData, Gui::GuiActionType::ID_PressureOcclusion ); break; case Gui::GuiActionType::ID_TreatmentStates : ok = notify(vMessage, vData, Gui::GuiActionType::ID_TreatmentStates ); break; + case Gui::GuiActionType::ID_PrimingData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_PrimingData ); break; case Gui::GuiActionType::ID_Saline : ok = notify(vMessage, vData, Gui::GuiActionType::ID_Saline ); break; // ----- Events @@ -360,10 +386,12 @@ case Gui::GuiActionType::ID_AdjustUltrafiltrationConfirmRsp : ok = adjustUltrafiltrationConfirm (vMessage, vData); break; // TODO : implement notify<>() case Gui::GuiActionType::ID_CreateTreatmentRsp : ok = createTreatmentRespData (vMessage, vData); break; - // unhandles messages: these will only be logged as received message + case Gui::GuiActionType::ID_StartTreatmentRsp : ok = notify (vMessage, vData, Gui::GuiActionType::ID_StartTreatmentRsp ); break; + case Gui::GuiActionType::ID_EndTreatmentRsp : ok = notify (vMessage, vData, Gui::GuiActionType::ID_EndTreatmentRsp ); break; + // unhandles messages: these will only be logged as received message // there has nothing been defined for these messages. - default : printUnhandled (vMessage ); break; + default : printUnhandled (vMessage ); break; } return ok; Index: sources/gui/qml/components/TopMenuBarCreateTreatment.qml =================================================================== diff -u -r7a4f59af7287d30e8790e6b580327684d4e02e55 -ra51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1 --- sources/gui/qml/components/TopMenuBarCreateTreatment.qml (.../TopMenuBarCreateTreatment.qml) (revision 7a4f59af7287d30e8790e6b580327684d4e02e55) +++ sources/gui/qml/components/TopMenuBarCreateTreatment.qml (.../TopMenuBarCreateTreatment.qml) (revision a51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1) @@ -26,15 +26,15 @@ color: Colors.backgroundMainMenu property var step: "CREATE"; property int spacing: 5 - signal backClicked() + signal clickedBack() BackButton { id : _backButton width: parent.width / 10 anchors.verticalCenter: parent.verticalCenter anchors.top: parent.top anchors.left: parent.left anchors.margins: _root.height / 4 - onClicked: backClicked() + onClicked: _root.clickedBack() } Rectangle { @@ -49,39 +49,36 @@ } - RowLayout { + Row { anchors.centerIn: parent - Layout.alignment: Qt.AlignVCenter spacing: 5 CircleWithText { id: _create text: "CREATE" state: "active" } - Line { - length: 100 - color: Colors.createTreatmentInactive + ProgressLine { id: _confirm_line + anchors.verticalCenter: _create.verticalCenter + } CircleWithText { id: _confirm text: "CONFIRM" } - Line { - length: 100 - color: Colors.createTreatmentInactive + ProgressLine { id: _priming_line + anchors.verticalCenter: _create.verticalCenter } CircleWithText { id: _prime text: "PRIME" } - Line { - id: _prime_line - length: 100 - color: Colors.createTreatmentInactive + ProgressLine { id: _begin_line + anchors.verticalCenter: _create.verticalCenter + } CircleWithText { id: _begin @@ -95,31 +92,43 @@ states: [ State { name: "create" - PropertyChanges { target: _create; state: "active" } - PropertyChanges { target: _confirm; state: "inactive" } - PropertyChanges { target: _prime; state: "inactive" } - PropertyChanges { target: _begin; state: "inactive" } + PropertyChanges { target: _create; state: "active" } + PropertyChanges { target: _confirm; state: "inactive" } + PropertyChanges { target: _confirm_line; state: "inactive" } + PropertyChanges { target: _prime; state: "inactive" } + PropertyChanges { target: _priming_line; state: "inactive" } + PropertyChanges { target: _begin; state: "inactive" } + PropertyChanges { target: _begin_line; state: "inactive" } }, State { name: "confirm" - PropertyChanges { target: _create; state: "inactive" } - PropertyChanges { target: _confirm; state: "active" } - PropertyChanges { target: _prime; state: "inactive" } - PropertyChanges { target: _begin; state: "inactive" } + PropertyChanges { target: _create; state: "active" } + PropertyChanges { target: _confirm; state: "active" } + PropertyChanges { target: _confirm_line; state: "active" } + PropertyChanges { target: _prime; state: "inactive" } + PropertyChanges { target: _priming_line; state: "inactive" } + PropertyChanges { target: _begin; state: "inactive" } + PropertyChanges { target: _begin_line; state: "inactive" } }, State { name: "prime" - PropertyChanges { target: _create; state: "inactive" } - PropertyChanges { target: _confirm; state: "inactive" } - PropertyChanges { target: _prime; state: "active" } - PropertyChanges { target: _begin; state: "inactive" } + PropertyChanges { target: _create; state: "active" } + PropertyChanges { target: _confirm; state: "active" } + PropertyChanges { target: _confirm_line; state: "active" } + PropertyChanges { target: _prime; state: "active" } + PropertyChanges { target: _priming_line; state: "active" } + PropertyChanges { target: _begin; state: "inactive" } + PropertyChanges { target: _begin_line; state: "inactive" } }, State { name: "begin" - PropertyChanges { target: _create; state: "inactive" } - PropertyChanges { target: _confirm; state: "inactive" } - PropertyChanges { target: _prime; state: "inactive" } - PropertyChanges { target: _begin; state: "active" } + PropertyChanges { target: _create; state: "active" } + PropertyChanges { target: _confirm; state: "active" } + PropertyChanges { target: _confirm_line; state: "active" } + PropertyChanges { target: _prime; state: "active" } + PropertyChanges { target: _priming_line; state: "active" } + PropertyChanges { target: _begin; state: "active" } + PropertyChanges { target: _begin_line; state: "active" } } ] Index: sources/gui/qml/main.qml =================================================================== diff -u -r7edcaf054062754370e0abd165f17ca9941b7d07 -ra51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1 --- sources/gui/qml/main.qml (.../main.qml) (revision 7edcaf054062754370e0abd165f17ca9941b7d07) +++ sources/gui/qml/main.qml (.../main.qml) (revision a51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1) @@ -38,7 +38,7 @@ import VTreatmentAdjustmentUltrafiltrationEdit 0.1; import VTreatmentAdjustmentUltrafiltrationConfirm 0.1; -import VCreateTreatment 0.1; +import VTreatmentCreate 0.1; import VDGDrainPump 0.1; import VDGHeaters 0.1; import VDGLoadCellReadings 0.1; @@ -48,6 +48,8 @@ import VDGReservoir 0.1; import VDGTemperatures 0.1; import VDGValvesStates 0.1; +import VPriming 0.1; +import VTreatmentBegin 0.1; // Qml imports import "qrc:/globals" @@ -126,7 +128,9 @@ VTreatmentAdjustmentUltrafiltrationState { id: vTreatmentAdjustmentUltrafiltrationState } VTreatmentAdjustmentUltrafiltrationEdit { id: vTreatmentAdjustmentUltrafiltrationEdit } VTreatmentAdjustmentUltrafiltrationConfirm { id: vTreatmentAdjustmentUltrafiltrationConfirm } - VCreateTreatment { id: vCreateTreatment } + VTreatmentCreate { id: vTreatmentCreate } + VPriming { id: vPriming } + VTreatmentBegin { id: vTreatmentBegin } // ----- Follow the below Z order ----- // 1 - Screens Index: sources/gui/qml/pages/treatment/TreatmentBegin.qml =================================================================== diff -u -r810e4b12507feba688c3ea2ab045040214661298 -ra51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1 --- sources/gui/qml/pages/treatment/TreatmentBegin.qml (.../TreatmentBegin.qml) (revision 810e4b12507feba688c3ea2ab045040214661298) +++ sources/gui/qml/pages/treatment/TreatmentBegin.qml (.../TreatmentBegin.qml) (revision a51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1) @@ -29,16 +29,16 @@ * which is the default screen in the "Manager" stack */ ScreenItem { id: _root - signal backClicked() - signal startClicked() + signal clickedBack() + signal clickedStart() backgroundRect.color: Colors.backgroundMainMenu TopMenuBarCreateTreatment { id: _topMenuBar anchors.top: parent.top anchors.left: parent.left width: parent.width - onBackClicked: { - _root.backClicked(); + onClickedBack: { + _root.clickedBack(); } state: "begin" @@ -68,11 +68,26 @@ font.pixelSize: Fonts.fontPixelTitle } + SliderCreateTreatment { + id: _ultrafiltration + objectName: "_ultrafiltration" + sliderObjectName: objectName + "Slider" + selectedValueObjectName: objectName + "Value" + text: "Ultrafiltration Volume" + units: qsTr(" mL") + min: vTreatmentBegin.ufVolumeMin + max: vTreatmentBegin.ufVolumeMax + step: vTreatmentBegin.ufVolumeRes + onSliderChanged: { + vTreatmentBegin.ufVolume = value; + } + } + TouchRect { id : _continueRect anchors.horizontalCenter: parent.horizontalCenter text.text: qsTr("START") button.onClicked: { - _root.startClicked() + _root.clickedStart() } } } Index: sources/gui/qml/pages/treatment/TreatmentConfirm.qml =================================================================== diff -u -r810e4b12507feba688c3ea2ab045040214661298 -ra51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1 --- sources/gui/qml/pages/treatment/TreatmentConfirm.qml (.../TreatmentConfirm.qml) (revision 810e4b12507feba688c3ea2ab045040214661298) +++ sources/gui/qml/pages/treatment/TreatmentConfirm.qml (.../TreatmentConfirm.qml) (revision a51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1) @@ -31,15 +31,15 @@ ScreenItem { id: _root objectName: "TreatmentConfirm" backgroundRect.color: Colors.backgroundMainMenu - signal backClicked() - signal confirmClicked() + signal clickedBack() + signal clickedConfirm() TopMenuBarCreateTreatment { id: _topMenuBar anchors.top: parent.top anchors.left: parent.left width: parent.width - onBackClicked: { - _root.backClicked(); + onClickedBack: { + _root.clickedBack(); } state: "confirm" } @@ -67,15 +67,27 @@ color: Colors.textMain font.pixelSize: Fonts.fontPixelTitle } + // insert the treatment information table here + ConfirmTreatmentTable { + anchors.horizontalCenter: parent.horizontalCenter + } + TouchRect { id : _continueRect objectName: "_continueRect" anchors.horizontalCenter: parent.horizontalCenter text.text: qsTr("CONFIRM TREATMENT") button.onClicked: { - _root.confirmClicked() + _root.clickedConfirm() } } + + Rectangle { + id: _spacer + height: 75 + width: parent.width + color: "transparent" + } } } Index: sources/gui/qml/pages/treatment/TreatmentCreate.qml =================================================================== diff -u -r2c35a3fa17eef76c7a47578974b928c03f67c83d -ra51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1 --- sources/gui/qml/pages/treatment/TreatmentCreate.qml (.../TreatmentCreate.qml) (revision 2c35a3fa17eef76c7a47578974b928c03f67c83d) +++ sources/gui/qml/pages/treatment/TreatmentCreate.qml (.../TreatmentCreate.qml) (revision a51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1) @@ -29,17 +29,16 @@ */ ScreenItem { id: _root objectName: "TreatmentCreate"; // SquishQt testability - signal backClicked() - signal continueClicked() + signal clickedBack() + signal clickedContinue() backgroundRect.color: Colors.backgroundMainMenu TopMenuBarCreateTreatment { id: _topMenuBar anchors.top: parent.top anchors.left: parent.left width: parent.width - onBackClicked: { - _root.backClicked(); - + onClickedBack: { + _root.clickedBack(); } } @@ -83,10 +82,11 @@ selectedValueObjectName: objectName + "Value" text: "Blood Flow Rate" units: qsTr(" mL/min") - min: vCreateTreatment.bloodFlowRateMin - max: vCreateTreatment.bloodFlowRateMax + min: vTreatmentCreate.bloodFlowRateMin + max: vTreatmentCreate.bloodFlowRateMax + step: vTreatmentCreate.bloodFlowRateRes onSliderChanged: { - vCreateTreatment.bloodFlowRate = value; + vTreatmentCreate.bloodFlowRate = value; } } @@ -97,10 +97,11 @@ selectedValueObjectName: objectName + "Value" text: "Dialysate Flow Rate" units: qsTr(" mL/min") - min: vCreateTreatment.dialysateFlowRateMin - max: vCreateTreatment.dialysateFlowRateMax + min: vTreatmentCreate.dialysateFlowRateMin + max: vTreatmentCreate.dialysateFlowRateMax + step: vTreatmentCreate.dialysateFlowRateRes onSliderChanged: { - vCreateTreatment.dialysateFlowRate = value; + vTreatmentCreate.dialysateFlowRate = value; } } @@ -111,10 +112,11 @@ selectedValueObjectName: objectName + "Value" text: "Duration" units: qsTr(" min") - min: vCreateTreatment.durationMin - max: vCreateTreatment.durationMax + min: vTreatmentCreate.durationMin + max: vTreatmentCreate.durationMax + step: vTreatmentCreate.durationRes onSliderChanged: { - vCreateTreatment.duration = value; + vTreatmentCreate.duration = value; } } @@ -125,10 +127,12 @@ selectedValueObjectName: objectName + "Value" text: "Heparin Dispensing Rate" units: qsTr(" mL/hr") - min: vCreateTreatment.heparinDispensingRateMin - max: vCreateTreatment.heparinDispensingRateMax + min: vTreatmentCreate.heparinDispensingRateMin + max: vTreatmentCreate.heparinDispensingRateMax + step: vTreatmentCreate.heparinDispensingRateRes + onSliderChanged: { - vCreateTreatment.heparinDispensingRate = value; + vTreatmentCreate.heparinDispensingRate = value; } } @@ -139,10 +143,11 @@ selectedValueObjectName: objectName + "Value" text: "Heparin Bolus Volume" units: qsTr(" mL") - min: vCreateTreatment.heparinBolusVolumeMin - max: vCreateTreatment.heparinBolusVolumeMax + min: vTreatmentCreate.heparinBolusVolumeMin + max: vTreatmentCreate.heparinBolusVolumeMax + step: vTreatmentCreate.heparinBolusVolumeRes onSliderChanged: { - vCreateTreatment.heparinBolusVolume = value; + vTreatmentCreate.heparinBolusVolume = value; } } @@ -153,30 +158,34 @@ selectedValueObjectName: objectName + "Value" text: "Heparin Stop Time" units: qsTr(" min") - min: vCreateTreatment.heparinStopTimeMin - max: vCreateTreatment.heparinStopTimeMax + min: vTreatmentCreate.heparinStopTimeMin + max: vTreatmentCreate.heparinStopTimeMax + step: vTreatmentCreate.heparinStopTimeRes onSliderChanged: { - vCreateTreatment.heparinStopTime = value; + vTreatmentCreate.heparinStopTime = value; } } - RectSelectCreateTreatment { + SliderCreateTreatment { id: _salineBolus objectName: "_salineBolusRect" - name: "Saline Bolus" - buttonNames: vCreateTreatment.salineBolusOptions - onButtonClicked: { - vCreateTreatment.salineBolusVolume = selectedIndex; + text: "Saline Bolus" + units: qsTr(" min") + min: vTreatmentCreate.salineBolusVolumeMin + max: vTreatmentCreate.salineBolusVolumeMax + step: vTreatmentCreate.salineBolusVolumeRes + onSliderChanged: { + vTreatmentCreate.salineBolusVolume = value; } } RectSelectCreateTreatment { id: _acidConcentrate objectName: "_acidConcentrateRect" name: "Acid Concentrate" - buttonNames: vCreateTreatment.acidConcentrateOptions; + buttonNames: vTreatmentCreate.acidConcentrateOptions; onButtonClicked: { - vCreateTreatment.acidConcentrate = selectedIndex; + vTreatmentCreate.acidConcentrate = selectedIndex; } } @@ -186,9 +195,9 @@ name: "Bicarbonate Concentrate" numRows: 1 numCols: 2 - buttonNames: vCreateTreatment.bicarbonateConcentrateOptions; + buttonNames: vTreatmentCreate.bicarbonateConcentrateOptions; onButtonClicked: { - vCreateTreatment.bicarbonateConcentrate = selectedIndex; + vTreatmentCreate.bicarbonateConcentrate = selectedIndex; } } @@ -198,9 +207,9 @@ name: "Dialyzer Type" numRows: 3 numCols: 2 - buttonNames: vCreateTreatment.dialyzerTypeOptions; + buttonNames: vTreatmentCreate.dialyzerTypeOptions; onButtonClicked: { - vCreateTreatment.dialyzerType = selectedIndex; + vTreatmentCreate.dialyzerType = selectedIndex; } } @@ -211,11 +220,11 @@ selectedValueObjectName: objectName + "Value" text: "Dialysate Temperature" units: qsTr(" C") - step: 0.1 - min: vCreateTreatment.dialysateTempMin - max: vCreateTreatment.dialysateTempMax + min: vTreatmentCreate.dialysateTempMin + max: vTreatmentCreate.dialysateTempMax + step: vTreatmentCreate.dialysateTempRes onSliderChanged: { - vCreateTreatment.dialysateTemp = value; + vTreatmentCreate.dialysateTemp = value; } } @@ -239,17 +248,19 @@ lowUnits: " mmHg" highTitle: "High" highUnits: " mmHg" - lowMin: vCreateTreatment.arterialPressureLimitLowMin - lowMax: vCreateTreatment.arterialPressureLimitLowMax - highMin: vCreateTreatment.arterialPressureLimitHighMin - highMax: vCreateTreatment.arterialPressureLimitHighMax - lowValue: vCreateTreatment.arterialPressureLimitLowMin - highValue: vCreateTreatment.arterialPressureLimitHighMin + lowMin: vTreatmentCreate.arterialPressureLimitLowMin + lowMax: vTreatmentCreate.arterialPressureLimitLowMax + highMin: vTreatmentCreate.arterialPressureLimitHighMin + highMax: vTreatmentCreate.arterialPressureLimitHighMax + lowValue: vTreatmentCreate.arterialPressureLimitLowMin + highValue: vTreatmentCreate.arterialPressureLimitHighMin + lowStep: vTreatmentCreate.arterialPressureLimitLowRes + highStep: vTreatmentCreate.arterialPressureLimitHighRes onLowSliderChanged: { - vCreateTreatment.arterialPressureLimitLow = lowValue + vTreatmentCreate.arterialPressureLimitLow = lowValue } onHighSliderChanged: { - vCreateTreatment.arterialPressureLimitHigh = highValue + vTreatmentCreate.arterialPressureLimitHigh = highValue } } @@ -274,17 +285,19 @@ lowUnits: " mmHg" highTitle: "High" highUnits: " mmHg" - lowMin: vCreateTreatment.venousPressureLimitLowMin - lowMax: vCreateTreatment.venousPressureLimitLowMax - highMin: vCreateTreatment.venousPressureLimitHighMin - highMax: vCreateTreatment.venousPressureLimitHighMax - lowValue: vCreateTreatment.venousPressureLimitLowMin - highValue: vCreateTreatment.venousPressureLimitHighMin + lowMin: vTreatmentCreate.venousPressureLimitLowMin + lowMax: vTreatmentCreate.venousPressureLimitLowMax + highMin: vTreatmentCreate.venousPressureLimitHighMin + highMax: vTreatmentCreate.venousPressureLimitHighMax + lowValue: vTreatmentCreate.venousPressureLimitLowMin + highValue: vTreatmentCreate.venousPressureLimitHighMin + lowStep: vTreatmentCreate.venousPressureLimitLowRes + highStep: vTreatmentCreate.venousPressureLimitHighRes onLowSliderChanged: { - vCreateTreatment.venousPressureLimitLow = lowValue + vTreatmentCreate.venousPressureLimitLow = lowValue } onHighSliderChanged: { - vCreateTreatment.venousPressureLimitHigh = highValue + vTreatmentCreate.venousPressureLimitHigh = highValue } } @@ -295,12 +308,12 @@ selectedValueObjectName: objectName + "Value" text: "Blood Pressure Measurement Interval" units: qsTr(" min") - min: vCreateTreatment.bloodPressureMeasureIntervalMin - max: vCreateTreatment.bloodPressureMeasureIntervalMax - step: 1 + min: vTreatmentCreate.bloodPressureMeasureIntervalMin + max: vTreatmentCreate.bloodPressureMeasureIntervalMax + step: vTreatmentCreate.bloodPressureMeasureIntervalRes stepSnap: true onSliderChanged: { - vCreateTreatment.bloodPressureMeasureInterval = value + vTreatmentCreate.bloodPressureMeasureInterval = value } } @@ -311,12 +324,12 @@ selectedValueObjectName: objectName + "Value" text: "Rinseback Flow Rate" units: qsTr(" mL/min") - min: vCreateTreatment.rinsebackFlowRateMin - max: vCreateTreatment.rinsebackFlowRateMax - step: 1 + min: vTreatmentCreate.rinsebackFlowRateMin + max: vTreatmentCreate.rinsebackFlowRateMax + step: vTreatmentCreate.rinsebackFlowRateRes stepSnap: true onSliderChanged: { - vCreateTreatment.rinsebackFlowRate = value + vTreatmentCreate.rinsebackFlowRate = value } } @@ -328,9 +341,9 @@ borderColor: Colors.createTreatmentNotReady textColor: Colors.createTrTextNotReady button.onClicked: { - vCreateTreatment.saveTreatmentProfile = false; - if (vCreateTreatment.continueEnabled) { - _root.continueClicked() + vTreatmentCreate.saveTreatmentProfile = false; + if (vTreatmentCreate.continueEnabled) { + _root.clickedContinue() } } @@ -346,6 +359,13 @@ } } } + + Rectangle { + id: _spacer + height: 75 + width: parent.width + color: "transparent" + } } } @@ -386,9 +406,9 @@ } } - Connections { target: vCreateTreatment + Connections { target: vTreatmentCreate onContinueEnabledChanged: { - if (vCreateTreatment.continueEnabled) { + if (vTreatmentCreate.continueEnabled) { _continueRect.toggleEnabled(true) } else { _continueRect.toggleEnabled(false) @@ -406,7 +426,7 @@ _heparinBolusVolume.isActive = false; _heparinStopTime.isActive = false; - _salineBolus.setActive(false); + _salineBolus.isActive = false; _acidConcentrate.setActive(false); _bicarbonateConcentrate.setActive(false); _dialyzerType.setActive(false); @@ -510,5 +530,63 @@ console.debug("Rinseback flow rate validation failed: " + reason) _rinsebackFlowRate.setValid(false) } + + onScrollToParameter: { + let prefix = "data."; + let contentYMargin = 80; + let newContentY = 0; + + if (parameter === prefix+"bloodFlowRate") { + newContentY = _bloodFlowRate.mapToItem(_bloodFlowRate.parent, 0, 0).y; + } + else if (parameter === prefix+"dialysateFlowRate") { + newContentY = _dialysateFlowRate.mapToItem(_dialysateFlowRate.parent, 0, 0).y; + } + else if (parameter === prefix+"duration") { + newContentY = _duration.mapToItem(_duration.parent, 0, 0).y; + } + else if (parameter === prefix+"heparinDispensingRate") { + newContentY = _heparinDispensingRate.mapToItem(_heparinDispensingRate.parent, 0, 0).y; + } + else if (parameter === prefix+"heparinBolusVolume") { + newContentY = _heparinBolusVolume.mapToItem(_heparinBolusVolume.parent, 0, 0).y; + } + else if (parameter === prefix+"heparinStopTime") { + newContentY = _heparinStopTime.mapToItem(_heparinStopTime.parent, 0, 0).y; + } + else if (parameter === prefix+"salineBolus") { + newContentY = _salineBolus.mapToItem(_salineBolus.parent, 0, 0).y; + } + else if (parameter === prefix+"acidConcentrate") { + newContentY = _acidConcentrate.mapToItem(_acidConcentrate.parent, 0, 0).y; + } + else if (parameter === prefix+"bicarbonateConcentrate") { + newContentY = _bicarbonateConcentrate.mapToItem(_bicarbonateConcentrate.parent, 0, 0).y; + } + else if (parameter === prefix+"dialyzerType") { + newContentY = _dialyzerType.mapToItem(_dialyzerType.parent, 0, 0).y; + } + else if (parameter === prefix+"dialysateTemp") { + newContentY = _dialysateTemperature.mapToItem(_dialysateTemperature.parent, 0, 0).y; + } + else if (parameter === prefix+"arterialPressureLimitLow" || + parameter === prefix+"arterialPressureLimitHigh") { + newContentY = _arterialPressureLimits.mapToItem(_arterialPressureLimits.parent, 0, 0).y; + } + else if (parameter === prefix+"venousPressureLimitLow" || + parameter === prefix+"venousPressureLimitHigh") { + newContentY = _venousPressureLimits.mapToItem(_venousPressureLimits.parent, 0, 0).y; + } + else if (parameter === prefix+"bloodPressureMeasureInterval") { + newContentY = _bloodPressureMeasurementInterval.mapToItem(_bloodPressureMeasurementInterval.parent, 0, 0).y; + } + else if (parameter === prefix+"rinsebackFlowRate") { + newContentY = _rinsebackFlowRate.mapToItem(_rinsebackFlowRate.parent, 0, 0).y; + } + else { + return; + } + _flickable.contentY = newContentY - contentYMargin; + } } } Index: sources/gui/qml/pages/treatment/TreatmentPrime.qml =================================================================== diff -u -rf463d5a69bb97d84de2c835984619ac18c574da2 -ra51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1 --- sources/gui/qml/pages/treatment/TreatmentPrime.qml (.../TreatmentPrime.qml) (revision f463d5a69bb97d84de2c835984619ac18c574da2) +++ sources/gui/qml/pages/treatment/TreatmentPrime.qml (.../TreatmentPrime.qml) (revision a51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1) @@ -29,16 +29,16 @@ * which is the default screen in the "Manager" stack */ ScreenItem { id: _root - signal backClicked() - signal continueClicked() + signal clickedBack() + signal clickedContinue() backgroundRect.color: Colors.backgroundMainMenu TopMenuBarCreateTreatment { id: _topMenuBar anchors.top: parent.top anchors.left: parent.left width: parent.width - onBackClicked: { - _root.backClicked(); + onClickedBack: { + _root.clickedBack(); } state: "prime" @@ -58,21 +58,70 @@ Column { id: _column spacing: Variables.cTreatmentSpacing - anchors.horizontalCenter: parent.horizontalCenter; - anchors.fill: parent; + anchors.horizontalCenter: parent.horizontalCenter + anchors.fill: parent Text { id: _titleText - anchors.horizontalCenter: parent.horizontalCenter; + anchors.horizontalCenter: parent.horizontalCenter text: qsTr("Priming") color: Colors.textMain font.pixelSize: Fonts.fontPixelTitle } + ProgressCircle { id: _circle + anchors.horizontalCenter: parent.horizontalCenter + minimum: 0 + maximum: vPriming.secondsTotal + diameter: 100 + + value: vPriming.secondsTotal - vPriming.secondsRemaining + + PrimingTimer { id: _timeText + anchors.centerIn: parent + seconds : vPriming.secondsRemaining + + } + } + + Rectangle { + anchors.horizontalCenter: parent.horizontalCenter + color: "transparent" + height: 400 + + + } + + GridLayout { + id: _grid + rows: vPriming.primingStates.length + columns: 1 + anchors.horizontalCenter: parent.horizontalCenter + + Repeater { + model: vPriming.primingStates + Text { + color: "white" + text: vPriming.primingStates[index]; + } + } + } + TouchRect { id : _continueRect anchors.horizontalCenter: parent.horizontalCenter - text.text: qsTr("CONTINUE TO TREATMENT") + text.text: vPriming.continueBtnText + enabled: vPriming.continueEnabled + onEnabledChanged: { + if (enabled) { + borderColor = Colors.primingReady + textColor = Colors.primingReady + } else { + borderColor = Colors.primingNotReady + textColor = Colors.primingNotReady + } + } + button.onClicked: { - _root.continueClicked() + _root.clickedContinue() } } } Index: sources/model/MModel.h =================================================================== diff -u -r5387db3e9735f3bbf768906858dbcd725cf23528 -ra51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1 --- sources/model/MModel.h (.../MModel.h) (revision 5387db3e9735f3bbf768906858dbcd725cf23528) +++ sources/model/MModel.h (.../MModel.h) (revision a51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1) @@ -53,6 +53,9 @@ #include "MTreatmentAdjustUltrafiltrationStateResponse.h" #include "MTreatmentAdjustUltrafiltrationEditResponse.h" #include "MTreatmentAdjustUltrafiltrationConfirmResponse.h" +#include "MPrimingData.h" +#include "MStartTreatmentResponse.h" +#include "MEndTreatmentResponse.h" #include "MTreatmentAdjustSalineResponse.h" /*! @@ -148,15 +151,24 @@ \ REGISTER_METATYPE( HDDebugTextData ) \ REGISTER_METATYPE( DGDebugTextData ) \ + REGISTER_METATYPE( PrimingData ) \ + \ /* Request */ \ + REGISTER_METATYPE( StartTreatmentRequestData ) \ + REGISTER_METATYPE( ConfirmTreatmentRequestData ) \ + REGISTER_METATYPE( EndTreatmentRequestData ) \ + \ REGISTER_METATYPE( AdjustBloodDialysateRequestData ) \ REGISTER_METATYPE( AdjustDurationRequestData ) \ REGISTER_METATYPE( AdjustUltrafiltrationStateRequestData ) \ REGISTER_METATYPE( AdjustUltrafiltrationEditRequestData ) \ REGISTER_METATYPE( AdjustUltrafiltrationConfirmRequestData ) \ REGISTER_METATYPE( AdjustSalineRequestData ) \ REGISTER_METATYPE( AdjustTreatmentParametersRequestData ) \ - /* Response */ \ + /* Response */ \ + REGISTER_METATYPE( StartTreatmentResponseData ) \ + REGISTER_METATYPE( EndTreatmentResponseData ) \ + \ REGISTER_METATYPE( AdjustBloodDialysateResponseData ) \ REGISTER_METATYPE( AdjustDurationResponseData ) \ REGISTER_METATYPE( AdjustUltrafiltrationStateResponseData ) \ @@ -192,20 +204,26 @@ \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, HDDebugTextData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, DGDebugTextData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, PrimingData ) \ /* Response */ \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustUltrafiltrationStateResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustBloodDialysateResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustDurationResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustUltrafiltrationEditResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustUltrafiltrationConfirmResponseData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, StartTreatmentResponseData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, EndTreatmentResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustSalineResponseData ) -// /* Request */ ---------------------------------------------------------// +//===============================================================================// #define ADJUST_TRANSMT_MODEL_BRIDGE_CONNECTIONS(vSOURCE) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustBloodDialysateRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustDurationRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustUltrafiltrationStateRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustUltrafiltrationEditRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustUltrafiltrationConfirmRequestData ) \ + ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, StartTreatmentRequestData ) \ + ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, ConfirmTreatmentRequestData ) \ + ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, EndTreatmentRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustSalineRequestData ) //===============================================================================// #define ACTION_RECEIVE_MODEL_BRIDGE_DEFINITIONS \ @@ -235,12 +253,15 @@ \ ACTION_RECEIVE_BRIDGE_DEFINITION( HDDebugTextData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( DGDebugTextData ) \ + ACTION_RECEIVE_BRIDGE_DEFINITION( PrimingData ) \ /* Response */ \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustUltrafiltrationStateResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustBloodDialysateResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustDurationResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustUltrafiltrationEditResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustUltrafiltrationConfirmResponseData ) \ + ACTION_RECEIVE_BRIDGE_DEFINITION( StartTreatmentResponseData ) \ + ACTION_RECEIVE_BRIDGE_DEFINITION( EndTreatmentResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustSalineResponseData ) // /* Request */ ---------------------------------------------------------// #define ADJUST_TRANSMT_MODEL_BRIDGE_DEFINITIONS \ @@ -249,6 +270,9 @@ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustUltrafiltrationStateRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustUltrafiltrationEditRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustUltrafiltrationConfirmRequestData ) \ + ADJUST_TRANSMT_BRIDGE_DEFINITION( StartTreatmentRequestData ) \ + ADJUST_TRANSMT_BRIDGE_DEFINITION( ConfirmTreatmentRequestData ) \ + ADJUST_TRANSMT_BRIDGE_DEFINITION( EndTreatmentRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustSalineRequestData ) // /* Request */ ----------------------- NoEmit --------------------------// #define ADJUST_TRANSMT_MODEL_BRIDGE_DEFINITIONS_NOEMIT \ @@ -257,6 +281,9 @@ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustUltrafiltrationStateRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustUltrafiltrationEditRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustUltrafiltrationConfirmRequestData ) \ + ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( StartTreatmentRequestData ) \ + ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( ConfirmTreatmentRequestData ) \ + ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( EndTreatmentRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustSalineRequestData ) // /* Request */ ----------------------- public --------------------------// #define ADJUST_TRANSMT_MODEL_BRIDGE_DEFINITIONS_PUBLIC \ @@ -265,6 +292,9 @@ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustUltrafiltrationStateRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustUltrafiltrationEditRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustUltrafiltrationConfirmRequestData ) \ + ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( StartTreatmentRequestData ) \ + ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( ConfirmTreatmentRequestData ) \ + ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( EndTreatmentRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustSalineRequestData ) //===============================================================================// #define ACTION_RECEIVE_SIGNALS \ @@ -294,7 +324,11 @@ \ ACTION_RECEIVE_SIGNAL( HDDebugTextData ) \ ACTION_RECEIVE_SIGNAL( DGDebugTextData ) \ - /* Response */ \ + ACTION_RECEIVE_SIGNAL( PrimingData ) \ + /* Response */ \ + ACTION_RECEIVE_SIGNAL( StartTreatmentResponseData ) \ + ACTION_RECEIVE_SIGNAL( EndTreatmentResponseData ) \ + \ ACTION_RECEIVE_SIGNAL( AdjustUltrafiltrationStateResponseData ) \ ACTION_RECEIVE_SIGNAL( AdjustBloodDialysateResponseData ) \ ACTION_RECEIVE_SIGNAL( AdjustDurationResponseData ) \ Index: sources/model/MTreatmentParameters.h =================================================================== diff -u -r5387db3e9735f3bbf768906858dbcd725cf23528 -ra51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1 --- sources/model/MTreatmentParameters.h (.../MTreatmentParameters.h) (revision 5387db3e9735f3bbf768906858dbcd725cf23528) +++ sources/model/MTreatmentParameters.h (.../MTreatmentParameters.h) (revision a51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1) @@ -18,18 +18,18 @@ quint32 bloodFlowRate = 0; // mL/min quint32 dialysateFlowRate = 0; // mL/min quint32 duration = 0; // minutes - quint32 heparinDispensingRate = 0; // mL/hr - quint32 heparinBolusVolume = 0; // mL + float heparinDispensingRate = 0; // mL/hr + float heparinBolusVolume = 0; // mL quint32 heparinStopTime = 0; // min quint32 salineBolus = 0; // mL quint32 acidConcentrate = 0; // quint32 bicarbonateConcentrate = 0; // quint32 dialyzerType = 0; // - quint32 dialysateTemp = 0; // Celsius - qint32 arterialPressureLimitLow = 0; // mmHg - qint32 arterialPressureLimitHigh = 0; // mmHg - qint32 venousPressureLimitLow = 0; // mmHg - qint32 venousPressureLimitHigh = 0; // mmHg + float dialysateTemp = 0; // Celsius + qint32 arterialPressureLimitLow = 0; // mmHg + qint32 arterialPressureLimitHigh = 0; // mmHg + qint32 venousPressureLimitLow = 0; // mmHg + qint32 venousPressureLimitHigh = 0; // mmHg quint32 bloodPressureMeasureInterval = 0; // minutes quint32 rinsebackFlowRate = 0; // mL/min }; Index: sources/model/MTreatmentParametersResp.cpp =================================================================== diff -u -r5387db3e9735f3bbf768906858dbcd725cf23528 -ra51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1 --- sources/model/MTreatmentParametersResp.cpp (.../MTreatmentParametersResp.cpp) (revision 5387db3e9735f3bbf768906858dbcd725cf23528) +++ sources/model/MTreatmentParametersResp.cpp (.../MTreatmentParametersResp.cpp) (revision a51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1) @@ -10,24 +10,25 @@ */ void MTreatmentParametersResponse::toVariantList(QVariantList &list) const { + list += _data.requestValid.value; list += _data.bloodFlowRate.value; list += _data.dialysateFlowRate.value; list += _data.duration.value; - list += _data.heparinDispensingRate.value; - list += _data.heparinBolusVolume.value; list += _data.heparinStopTime.value; list += _data.salineBolus.value; list += _data.acidConcentrate.value; list += _data.bicarbonateConcentrate.value; list += _data.dialyzerType.value; - list += _data.dialysateTemp.value; + list += _data.bloodPressureMeasureInterval.value; + list += _data.rinsebackFlowRate.value; list += _data.arterialPressureLimitLow.value; list += _data.arterialPressureLimitHigh.value; list += _data.venousPressureLimitLow.value; list += _data.venousPressureLimitHigh.value; - list += _data.bloodPressureMeasureInterval.value; - list += _data.rinsebackFlowRate.value; + list += _data.heparinDispensingRate.value; + list += _data.heparinBolusVolume.value; + list += _data.dialysateTemp.value; } @@ -39,24 +40,26 @@ qDebug() << "Invalid QVariant List in " << __FUNCTION__; return data; } + data.requestValid = list[0].toUInt(); data.bloodFlowRate = list[1].toUInt(); data.dialysateFlowRate = list[2].toUInt(); data.duration = list[3].toUInt(); - data.heparinDispensingRate = list[4].toUInt(); - data.heparinBolusVolume = list[5].toUInt(); - data.heparinStopTime = list[6].toUInt(); - data.salineBolus = list[7].toUInt(); - data.acidConcentrate = list[8].toUInt(); - data.bicarbonateConcentrate = list[9].toUInt(); - data.dialyzerType = list[10].toUInt(); - data.dialysateTemp = list[11].toUInt(); - data.arterialPressureLimitLow = list[12].toUInt(); - data.arterialPressureLimitHigh = list[13].toUInt(); - data.venousPressureLimitLow = list[14].toUInt(); - data.venousPressureLimitHigh = list[15].toUInt(); - data.bloodPressureMeasureInterval = list[16].toUInt(); - data.rinsebackFlowRate = list[17].toUInt(); + data.heparinStopTime = list[4].toUInt(); + data.salineBolus = list[5].toUInt(); + data.acidConcentrate = list[6].toUInt(); + data.bicarbonateConcentrate = list[7].toUInt(); + data.dialyzerType = list[8].toUInt(); + data.bloodPressureMeasureInterval = list[9].toUInt(); + data.rinsebackFlowRate = list[10].toUInt(); + data.arterialPressureLimitLow = list[11].toUInt(); + data.arterialPressureLimitHigh = list[12].toUInt(); + data.venousPressureLimitLow = list[13].toUInt(); + data.venousPressureLimitHigh = list[14].toUInt(); + data.heparinDispensingRate = list[15].toUInt(); + data.heparinBolusVolume = list[16].toUInt(); + data.dialysateTemp = list[17].toUInt(); + return data; } @@ -66,20 +69,20 @@ if (GetValue(vByteArray, index, _data.bloodFlowRate )) if (GetValue(vByteArray, index, _data.dialysateFlowRate )) if (GetValue(vByteArray, index, _data.duration )) - if (GetValue(vByteArray, index, _data.heparinDispensingRate )) - if (GetValue(vByteArray, index, _data.heparinBolusVolume )) if (GetValue(vByteArray, index, _data.heparinStopTime )) if (GetValue(vByteArray, index, _data.salineBolus )) if (GetValue(vByteArray, index, _data.acidConcentrate )) if (GetValue(vByteArray, index, _data.bicarbonateConcentrate )) if (GetValue(vByteArray, index, _data.dialyzerType )) - if (GetValue(vByteArray, index, _data.dialysateTemp )) + if (GetValue(vByteArray, index, _data.bloodPressureMeasureInterval )) + if (GetValue(vByteArray, index, _data.rinsebackFlowRate )) if (GetValue(vByteArray, index, _data.arterialPressureLimitLow )) if (GetValue(vByteArray, index, _data.arterialPressureLimitHigh )) if (GetValue(vByteArray, index, _data.venousPressureLimitLow )) if (GetValue(vByteArray, index, _data.venousPressureLimitHigh )) - if (GetValue(vByteArray, index, _data.bloodPressureMeasureInterval )) - if (GetValue(vByteArray, index, _data.rinsebackFlowRate )) + if (GetValue(vByteArray, index, _data.heparinDispensingRate )) + if (GetValue(vByteArray, index, _data.heparinBolusVolume )) + if (GetValue(vByteArray, index, _data.dialysateTemp )) return true; else { if(vIndex) *vIndex = index; return false; } else { if(vIndex) *vIndex = index; return false; } Index: sources/storage/filehandler.cpp =================================================================== diff -u -r90d4b8ed818464463083ac39d28d80958bb2c1d9 -ra51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1 --- sources/storage/filehandler.cpp (.../filehandler.cpp) (revision 90d4b8ed818464463083ac39d28d80958bb2c1d9) +++ sources/storage/filehandler.cpp (.../filehandler.cpp) (revision a51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1) @@ -46,7 +46,7 @@ // coco end count = 0; mCritical = vMessage; - QTextStream err(stderr); + QTextStream err(stderr); err << "FS" << " " << QDate::currentDate().toString("yyyy_MM_dd") << " " << QTime::currentTime().toString("HH:mm:ss" ) << " " Index: sources/storage/filehandler.h =================================================================== diff -u -r90d4b8ed818464463083ac39d28d80958bb2c1d9 -ra51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1 --- sources/storage/filehandler.h (.../filehandler.h) (revision 90d4b8ed818464463083ac39d28d80958bb2c1d9) +++ sources/storage/filehandler.h (.../filehandler.h) (revision a51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1) @@ -1,16 +1,16 @@ /*! - * + * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. - * + * * \file filehandler.h * \author (last) Behrouz NematiPour * \date (last) 25-Aug-2020 * \author (original) Behrouz NematiPour * \date (original) 24-Sep-2019 - * + * */ #pragma once Index: sources/storage/storageglobals.h =================================================================== diff -u -r7edcaf054062754370e0abd165f17ca9941b7d07 -ra51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1 --- sources/storage/storageglobals.h (.../storageglobals.h) (revision 7edcaf054062754370e0abd165f17ca9941b7d07) +++ sources/storage/storageglobals.h (.../storageglobals.h) (revision a51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1) @@ -1,16 +1,16 @@ /*! - * + * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. - * + * * \file storageglobals.h * \author (last) Behrouz NematiPour * \date (last) 30-Jul-2020 * \author (original) Behrouz NematiPour * \date (original) 02-Jan-2020 - * + * */ #pragma once Index: sources/view/VTreatmentCreate.cpp =================================================================== diff -u -r074b32b5cc08f41f2d9ce0d021f2151b76bba5ad -ra51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1 --- sources/view/VTreatmentCreate.cpp (.../VTreatmentCreate.cpp) (revision 074b32b5cc08f41f2d9ce0d021f2151b76bba5ad) +++ sources/view/VTreatmentCreate.cpp (.../VTreatmentCreate.cpp) (revision a51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1) @@ -32,7 +32,6 @@ this, SLOT(onStartTreatmentResponse(StartTreatmentResponseData))); loadTreatmentParameterRanges(); - } /** @@ -54,74 +53,43 @@ { QJsonValue value = obj.value(key); - if (key == GET_VARIABLE_NAME(bloodFlowRateMin)) - _bloodFlowRateMin = value.toInt(); - else if (key == GET_VARIABLE_NAME(bloodFlowRateMax)) - _bloodFlowRateMax = value.toInt(); - else if (key == GET_VARIABLE_NAME(dialysateFlowRateMin)) - _dialysateFlowRateMin = value.toInt(); - else if (key == GET_VARIABLE_NAME(dialysateFlowRateMax)) - _dialysateFlowRateMax = value.toInt(); - else if (key == GET_VARIABLE_NAME(durationMin)) - _durationMin = value.toInt(); - else if (key == GET_VARIABLE_NAME(durationMax)) - _durationMax = value.toInt(); - else if (key == GET_VARIABLE_NAME(heparinDispensingRateMin)) - _heparinDispensingRateMin = value.toInt(); - else if (key == GET_VARIABLE_NAME(heparinDispensingRateMax)) - _heparinDispensingRateMax = value.toInt(); - else if (key == GET_VARIABLE_NAME(heparinBolusVolumeMin)) - _heparinBolusVolumeMin = value.toInt(); - else if (key == GET_VARIABLE_NAME(heparinBolusVolumeMax)) - _heparinBolusVolumeMax = value.toInt(); - else if (key == GET_VARIABLE_NAME(heparinStopTimeMin)) - _heparinStopTimeMin = value.toInt(); - else if (key == GET_VARIABLE_NAME(heparinStopTimeMax)) - _heparinStopTimeMax = value.toInt(); - else if (key == GET_VARIABLE_NAME(salineBolusVolumeMin)) - _salineBolusVolumeMin = value.toInt(); - else if (key == GET_VARIABLE_NAME(salineBolusVolumeMax)) - _salineBolusVolumeMax = value.toInt(); - //options - else if (key == GET_VARIABLE_NAME(acidConcentrateOptions)) - _acidConcentrateOptions = jsonArrayToStringList(value.toArray()); - else if (key == GET_VARIABLE_NAME(bicarbonateConcentrateOptions)) - _bicarbonateConcentrateOptions = jsonArrayToStringList(value.toArray()); - else if (key == GET_VARIABLE_NAME(dialyzerTypeOptions)) - _dialyzerTypeOptions = jsonArrayToStringList(value.toArray()); + if (key == GET_VARIABLE_NAME(bloodFlowRateMin)) _bloodFlowRateMin = value.toInt(); + else if (key == GET_VARIABLE_NAME(bloodFlowRateMax)) _bloodFlowRateMax = value.toInt(); + else if (key == GET_VARIABLE_NAME(dialysateFlowRateMin)) _dialysateFlowRateMin = value.toInt(); + else if (key == GET_VARIABLE_NAME(dialysateFlowRateMax)) _dialysateFlowRateMax = value.toInt(); + else if (key == GET_VARIABLE_NAME(durationMin)) _durationMin = value.toInt(); + else if (key == GET_VARIABLE_NAME(durationMax)) _durationMax = value.toInt(); + else if (key == GET_VARIABLE_NAME(heparinDispensingRateMin)) _heparinDispensingRateMin = value.toInt(); + else if (key == GET_VARIABLE_NAME(heparinDispensingRateMax)) _heparinDispensingRateMax = value.toInt(); + else if (key == GET_VARIABLE_NAME(heparinBolusVolumeMin)) _heparinBolusVolumeMin = value.toInt(); + else if (key == GET_VARIABLE_NAME(heparinBolusVolumeMax)) _heparinBolusVolumeMax = value.toInt(); + else if (key == GET_VARIABLE_NAME(heparinStopTimeMin)) _heparinStopTimeMin = value.toInt(); + else if (key == GET_VARIABLE_NAME(heparinStopTimeMax)) _heparinStopTimeMax = value.toInt(); + else if (key == GET_VARIABLE_NAME(salineBolusVolumeMin)) _salineBolusVolumeMin = value.toInt(); + else if (key == GET_VARIABLE_NAME(salineBolusVolumeMax)) _salineBolusVolumeMax = value.toInt(); + // options + else if (key == GET_VARIABLE_NAME(acidConcentrateOptions)) _acidConcentrateOptions = jsonArrayToStringList(value.toArray()); + else if (key == GET_VARIABLE_NAME(bicarbonateConcentrateOptions)) _bicarbonateConcentrateOptions = jsonArrayToStringList(value.toArray()); + else if (key == GET_VARIABLE_NAME(dialyzerTypeOptions)) _dialyzerTypeOptions = jsonArrayToStringList(value.toArray()); - else if (key == GET_VARIABLE_NAME(dialysateTempMin)) - _dialysateTempMin = value.toInt(); - else if (key == GET_VARIABLE_NAME(dialysateTempMax)) - _dialysateTempMax = value.toInt(); + else if (key == GET_VARIABLE_NAME(dialysateTempMin)) _dialysateTempMin = value.toInt(); + else if (key == GET_VARIABLE_NAME(dialysateTempMax)) _dialysateTempMax = value.toInt(); // arterial - else if (key == GET_VARIABLE_NAME(arterialPressureLimitLowMin)) - _arterialPressureLimitLowMin = value.toInt(); - else if (key == GET_VARIABLE_NAME(arterialPressureLimitLowMax)) - _arterialPressureLimitLowMax = value.toInt(); - else if (key == GET_VARIABLE_NAME(arterialPressureLimitHighMin)) - _arterialPressureLimitHighMin = value.toInt(); - else if (key == GET_VARIABLE_NAME(arterialPressureLimitHighMax)) - _arterialPressureLimitHighMax = value.toInt(); - //venous - else if (key == GET_VARIABLE_NAME(venousPressureLimitLowMin)) - _venousPressureLimitLowMin = value.toInt(); - else if (key == GET_VARIABLE_NAME(venousPressureLimitLowMax)) - _venousPressureLimitLowMax = value.toInt(); - else if (key == GET_VARIABLE_NAME(venousPressureLimitHighMin)) - _venousPressureLimitHighMin = value.toInt(); - else if (key == GET_VARIABLE_NAME(venousPressureLimitHighMax)) - _venousPressureLimitHighMax = value.toInt(); + else if (key == GET_VARIABLE_NAME(arterialPressureLimitLowMin)) _arterialPressureLimitLowMin = value.toInt(); + else if (key == GET_VARIABLE_NAME(arterialPressureLimitLowMax)) _arterialPressureLimitLowMax = value.toInt(); + else if (key == GET_VARIABLE_NAME(arterialPressureLimitHighMin)) _arterialPressureLimitHighMin = value.toInt(); + else if (key == GET_VARIABLE_NAME(arterialPressureLimitHighMax)) _arterialPressureLimitHighMax = value.toInt(); + // venous + else if (key == GET_VARIABLE_NAME(venousPressureLimitLowMin)) _venousPressureLimitLowMin = value.toInt(); + else if (key == GET_VARIABLE_NAME(venousPressureLimitLowMax)) _venousPressureLimitLowMax = value.toInt(); + else if (key == GET_VARIABLE_NAME(venousPressureLimitHighMin)) _venousPressureLimitHighMin = value.toInt(); + else if (key == GET_VARIABLE_NAME(venousPressureLimitHighMax)) _venousPressureLimitHighMax = value.toInt(); - else if (key == GET_VARIABLE_NAME(bloodPressureMeasureIntervalMin)) - _bloodPressureMeasureIntervalMin = value.toInt(); - else if (key == GET_VARIABLE_NAME(bloodPressureMeasureIntervalMax)) - _bloodPressureMeasureIntervalMax = value.toInt(); + else if (key == GET_VARIABLE_NAME(bloodPressureMeasureIntervalMin)) _bloodPressureMeasureIntervalMin = value.toInt(); + else if (key == GET_VARIABLE_NAME(bloodPressureMeasureIntervalMax)) _bloodPressureMeasureIntervalMax = value.toInt(); - else if (key == GET_VARIABLE_NAME(rinsebackFlowRateMin)) - _rinsebackFlowRateMin = value.toInt(); - else if (key == GET_VARIABLE_NAME(rinsebackFlowRateMax)) - _rinsebackFlowRateMax = value.toInt(); + else if (key == GET_VARIABLE_NAME(rinsebackFlowRateMin)) _rinsebackFlowRateMin = value.toInt(); + else if (key == GET_VARIABLE_NAME(rinsebackFlowRateMax)) _rinsebackFlowRateMax = value.toInt(); else { qDebug() << "Invalid treatment parameter range: " << key; @@ -277,8 +245,8 @@ if (actionType != GuiActionType::ID_CreateTreatmentRsp) return false; - Model::TreatmentParametersResp response; - TreatmentParametersRespData data = response.fromVariantList(messageData); + Model::MTreatmentParametersResponse response; + AdjustTreatmentParametersResponseData data = response.fromVariantList(messageData); bool success = true; if (data.bloodFlowRate != Gui::GuiRequestReasons::REQUEST_REJECT_REASON_NONE) { @@ -377,7 +345,6 @@ goToNextPage(true); return success; - } /** @@ -505,7 +472,6 @@ // no FW response required goToNextPage(true); - } /** @@ -526,7 +492,6 @@ QString filename = QString("%0treatment%1.json").arg(dir).arg(i); _FileSaver.concurrentSave(filename, document.toJson(), false); return filename; - } /** @@ -620,10 +585,10 @@ /** * \brief VCreateTreatment::validate * Validates the create new treatment input. - * \param vData - the selected TreatmentData + * \param vData - the selected TreatmentParametersData * \return true on success, false otherwise. */ -bool VTreatmentCreate::validate(const TreatmentData &vData) +bool VTreatmentCreate::validate(const AdjustTreatmentParametersRequestData &vData) { bool success = true; @@ -787,7 +752,6 @@ } return success; - } /** @@ -803,7 +767,6 @@ return false; else return true; - } /** @@ -816,7 +779,6 @@ continueEnabled(validate(treatmentData)); emit continueEnabledChanged(continueEnabled()); - } /*! Index: sources/view/VTreatmentCreate.h =================================================================== diff -u -r074b32b5cc08f41f2d9ce0d021f2151b76bba5ad -ra51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1 --- sources/view/VTreatmentCreate.h (.../VTreatmentCreate.h) (revision 074b32b5cc08f41f2d9ce0d021f2151b76bba5ad) +++ sources/view/VTreatmentCreate.h (.../VTreatmentCreate.h) (revision a51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1) @@ -10,8 +10,8 @@ #include // Project -#include "mtreatmentparameters.h" -#include "mtreatmentparametersresp.h" +#include "MTreatmentParameters.h" +#include "MTreatmentParametersResp.h" #include "guicontroller.h" #include "storageglobals.h" #include "filesaver.h" @@ -27,6 +27,29 @@ namespace View { +/*! + * \brief The VCreateTreatment class + * + * The Create Treatment View manages the treatment parameter selection entry and validation. + * + * The Create Treatment View manages data display and translation between the user interface + * and treatment parameter and treatment parameter response models. + * + * Upon HD messaging with confirmation of the current parameter selection, + * the Create Treatment View segues to the Create Treatment confirmation screen. + * + * Upon HD messaging with a list of one or more invalid parameters, the Create Treatment View + * will signal the invalid parameters to the GUI so the user can make adjustments. + * + * The Create Treatment View replicates the validation function used by FW to mitigate + * incompatible parameter selection situations. + * + * When a user modifies treatment parameters: + * - The treatment parameters model is populated with the data + * - The data is validated for correctness and compatibility + * - The continue button is enabled upon success so FW can validate the parameter selection + * + */ class VTreatmentCreate : public QObject { Q_OBJECT @@ -71,8 +94,8 @@ PROPERTY(bool, continueEnabled, false) PROPERTY(bool, saveTreatmentProfile, false) - TreatmentData treatmentData; - bool validate(const TreatmentData &vData); + AdjustTreatmentParametersRequestData treatmentData; + bool validate(const AdjustTreatmentParametersRequestData &vData); QString saveNewTreatment(const QJsonObject &obj, const QString &dir = Treatment_Profiles_Dir); QString getParameterRangesDataCSV(); bool saveTreatmentRangesCSV(const QString &filename); @@ -114,7 +137,6 @@ void onFinishedSaveNewTreatment(bool result); signals: - void didCreateTreatment(const TreatmentData &data); void showCreate(); void showConfirm(); void showPrime(); Index: sources/view/vview.h =================================================================== diff -u -r7edcaf054062754370e0abd165f17ca9941b7d07 -ra51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1 --- sources/view/vview.h (.../vview.h) (revision 7edcaf054062754370e0abd165f17ca9941b7d07) +++ sources/view/vview.h (.../vview.h) (revision a51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1) @@ -1,16 +1,16 @@ /*! - * + * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. - * + * * \file vview.h * \author (last) Behrouz NematiPour * \date (last) 13-Aug-2020 * \author (original) Behrouz NematiPour * \date (original) 10-Mar-2020 - * + * */ #pragma once @@ -121,7 +121,9 @@ REGISTER_TYPE( VTreatmentAdjustmentUltrafiltrationState ) \ REGISTER_TYPE( VTreatmentAdjustmentUltrafiltrationEdit ) \ REGISTER_TYPE( VTreatmentAdjustmentUltrafiltrationConfirm ) \ - REGISTER_TYPE( VCreateTreatment ) \ - REGISTER_TYPE( VTreatmentAdjustmentSaline ) \ + REGISTER_TYPE( VTreatmentCreate ) \ + REGISTER_TYPE( VPriming ) \ + REGISTER_TYPE( VTreatmentBegin ) \ + REGISTER_TYPE( VTreatmentAdjustmentSaline ) //--------------------------------------------------------------------------------// Index: unittests/tst_models.cpp =================================================================== diff -u -r5387db3e9735f3bbf768906858dbcd725cf23528 -ra51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1 --- unittests/tst_models.cpp (.../tst_models.cpp) (revision 5387db3e9735f3bbf768906858dbcd725cf23528) +++ unittests/tst_models.cpp (.../tst_models.cpp) (revision a51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1) @@ -917,7 +917,7 @@ void tst_models::tst_MOutletFlowData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B")); + QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B")); QTest::newRow("mRefUFVol ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mRefUFVol ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mRefUFVol ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); @@ -983,7 +983,7 @@ void tst_models::tst_MBloodFlowData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B")); + QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B")); QTest::newRow("mFlowSetPoint ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mFlowSetPoint ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mFlowSetPoint ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); @@ -1049,7 +1049,7 @@ void tst_models::tst_MDialysateFlowData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B")); + QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B")); QTest::newRow("mFlowSetPoint ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mFlowSetPoint ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mFlowSetPoint ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); @@ -1161,7 +1161,7 @@ void tst_models::tst_MPressureOcclusionData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); + QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); QTest::newRow("mArterialPressure ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mArterialPressure ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mArterialPressure ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); @@ -1574,7 +1574,6 @@ void tst_models::tst_MTreatmentSalineBolusData() { Model::MTreatmentSaline mData; - QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); @@ -1706,6 +1705,8 @@ } } } + + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MSalineBolusResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MSalineBolusResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // Index: unittests/tst_views.cpp =================================================================== diff -u -r90d4b8ed818464463083ac39d28d80958bb2c1d9 -ra51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1 --- unittests/tst_views.cpp (.../tst_views.cpp) (revision 90d4b8ed818464463083ac39d28d80958bb2c1d9) +++ unittests/tst_views.cpp (.../tst_views.cpp) (revision a51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1) @@ -1,16 +1,16 @@ /*! - * + * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. - * + * * \file tst_views.cpp * \author (last) Behrouz NemaiPour * \date (last) 23-Jun-2020 * \author (original) Behrouz NematiPour * \date (original) 21-Apr-2020 - * + * */ #include "tst_views.h" @@ -76,7 +76,7 @@ { for (int i = 0; i < 18; ++i) { - View::VCreateTreatment view; + View::VTreatmentCreate view; if (i != 0) view.set_bloodFlowRate(view.bloodFlowRateMax()); if (i != 1) view.set_dialysateFlowRate(view.dialysateFlowRateMax()); if (i != 2) view.set_duration(view.durationMax()); @@ -153,7 +153,7 @@ * Simulates a user selection of valid parameters * \param view VCreateTreatment object to be set with valid parameters */ -void tst_views::VCreateTreatment_simulate_valid_parameters(View::VCreateTreatment &view) +void tst_views::VCreateTreatment_simulate_valid_parameters(View::VTreatmentCreate &view) { view.set_bloodFlowRate(view.bloodFlowRateMax()); view.set_dialysateFlowRate(view.dialysateFlowRateMax()); @@ -238,7 +238,7 @@ */ void tst_views::VCreateTreatment_validation_ranges() { - View::VCreateTreatment view; + View::VTreatmentCreate view; // adjust quint32 minimums view.bloodFlowRateMin(1); @@ -345,7 +345,7 @@ void tst_views::VCreateTreatment_check_init() { - View::VCreateTreatment view; + View::VTreatmentCreate view; quint32 val = 150; view.bloodFlowRateMin(val); ++val; view.bloodFlowRateMin(val); view.bloodFlowRateMin(val); @@ -522,7 +522,7 @@ void tst_views::VCreateTreatment_save_csv() { - View::VCreateTreatment view; + View::VTreatmentCreate view; QString csvData = view.getParameterRangesDataCSV(); QString filename = QString("/tmp/out_%0.csv").arg(QDateTime::currentDateTime().toString(datetimeFormat)); @@ -543,7 +543,7 @@ */ void tst_views::VCreateTreatment_save() { - View::VCreateTreatment view; + View::VTreatmentCreate view; QJsonObject objectWritten { {"bloodFlowRate", QString::number(view.treatmentData.bloodFlowRate)}, @@ -587,7 +587,7 @@ */ void tst_views::VCreateTreatment_enums() { - View::VCreateTreatment view; + View::VTreatmentCreate view; GuiRequestReasons reason = GuiRequestReasons::REQUEST_REJECT_REASON_NONE; QCOMPARE(view.enumToString(reason), "REQUEST_REJECT_REASON_NONE"); @@ -603,7 +603,7 @@ */ void tst_views::VCreateTreatment_json() { - View::VCreateTreatment view; + View::VTreatmentCreate view; QJsonArray arr; QStringList list; @@ -635,7 +635,7 @@ */ void tst_views::VCreateTreatment_fw_validation_response() { - View::VCreateTreatment view; + View::VTreatmentCreate view; GuiActionType action = GuiActionType::ID_CreateTreatmentRsp; for (int i = 0; i < 18; ++i) @@ -684,7 +684,7 @@ view.onFinishedSaveNewTreatment(true); view.onFinishedSaveNewTreatment(false); view.onFinishedPrime(); - view.onStart(); + view.onStartTreatment(); QCOMPARE(view.treatmentData.bloodFlowRate, dataBackup.bloodFlowRate); QCOMPARE(view.treatmentData.dialysateFlowRate, dataBackup.dialysateFlowRate); @@ -712,7 +712,7 @@ */ void tst_views::VCreateTreatment_load_parameter_ranges() { - View::VCreateTreatment view; + View::VTreatmentCreate view; QJsonObject obj;