Index: leahi.pro =================================================================== diff -u -r07fa2cd47bf538e89c48fc7d425674f20afc9f2a -r09fc72d1410ab86f8de7b00dd7de4ea5612cf470 --- leahi.pro (.../leahi.pro) (revision 07fa2cd47bf538e89c48fc7d425674f20afc9f2a) +++ leahi.pro (.../leahi.pro) (revision 09fc72d1410ab86f8de7b00dd7de4ea5612cf470) @@ -206,6 +206,7 @@ \ # ---------- Models - TD - Data //// ----- @LEAHIZED sources/model/td/data/MTDOpModeData.h \ \ # ---------- Models - TD - Adjustment - In-Treatment //// ----- @LEAHIZED + sources/model/td/adjustment/treatment/MTreatmentAdjustBloodPrimeResponse.h \ sources/model/td/adjustment/treatment/MTreatmentAdjustBloodFlowRateResponse.h \ sources/model/td/adjustment/treatment/MTreatmentAdjustBolusVolumeResponse.h \ sources/model/td/adjustment/treatment/MTreatmentAdjustDialysateFlowRateResponse.h \ @@ -249,6 +250,7 @@ sources/view/td/data/VTreatmentRanges.h \ \ # ---------- Views - TD - Adjustment - In-Treatment sources/view/td/adjustment/treatment/VTreatmentAdjustmentBloodFlowRate.h \ + sources/view/td/adjustment/treatment/VTreatmentAdjustmentBloodPrime.h \ sources/view/td/adjustment/treatment/VTreatmentAdjustmentBolusVolume.h \ sources/view/td/adjustment/treatment/VTreatmentAdjustmentDialysateFlowRate.h \ sources/view/td/adjustment/treatment/VTreatmentAdjustmentDialysateTemperature.h \ @@ -573,6 +575,7 @@ \ # ---------- Models - TD - Data - States sources/model/td/data/MTDOpModeData.cpp \ \ # ---------- Models - TD - Adjustment - In-Treatment + sources/model/td/adjustment/treatment/MTreatmentAdjustBloodPrimeResponse.cpp \ sources/model/td/adjustment/treatment/MTreatmentAdjustBloodFlowRateResponse.cpp \ sources/model/td/adjustment/treatment/MTreatmentAdjustBolusVolumeResponse.cpp \ sources/model/td/adjustment/treatment/MTreatmentAdjustDialysateFlowRateResponse.cpp \ @@ -713,6 +716,7 @@ sources/view/td/data/VTreatmentRanges.cpp \ \ # ---------- Views - TD - Adjustment - In-Treatment sources/view/td/adjustment/treatment/VTreatmentAdjustmentBloodFlowRate.cpp \ + sources/view/td/adjustment/treatment/VTreatmentAdjustmentBloodPrime.cpp \ sources/view/td/adjustment/treatment/VTreatmentAdjustmentBolusVolume.cpp \ sources/view/td/adjustment/treatment/VTreatmentAdjustmentDialysateFlowRate.cpp \ sources/view/td/adjustment/treatment/VTreatmentAdjustmentDialysateTemperature.cpp \ Index: sources/canbus/MessageDispatcher.cpp =================================================================== diff -u -rc9764bd0ad823c5c1725d7c7f556290c2c459d4d -r09fc72d1410ab86f8de7b00dd7de4ea5612cf470 --- sources/canbus/MessageDispatcher.cpp (.../MessageDispatcher.cpp) (revision c9764bd0ad823c5c1725d7c7f556290c2c459d4d) +++ sources/canbus/MessageDispatcher.cpp (.../MessageDispatcher.cpp) (revision 09fc72d1410ab86f8de7b00dd7de4ea5612cf470) @@ -224,6 +224,19 @@ /*! * \brief MessageDispatcher::onAdjustment + * \details This method transmits the Blood Prime Command message. + * \param vData - Data model contains Blood Prime Command + * \return void + */ +void MessageDispatcher::onAdjustment(const AdjustBloodPrimeRequestData &vData) +{ + QVariantList mData; + mData += vData.command; + onActionTransmit(GuiActionType::ID_AdjustBloodPrimeReq, mData); +} + +/*! + * \brief MessageDispatcher::onAdjustment * \details This method transmits the Blood/Dialysate Adjustment Denali message. * \param vData - Data model contains Blood Flow Rate and Dialysate Flow Rate Index: sources/canbus/MessageGlobals.h =================================================================== diff -u -rc9764bd0ad823c5c1725d7c7f556290c2c459d4d -r09fc72d1410ab86f8de7b00dd7de4ea5612cf470 --- sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision c9764bd0ad823c5c1725d7c7f556290c2c459d4d) +++ sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision 09fc72d1410ab86f8de7b00dd7de4ea5612cf470) @@ -149,6 +149,10 @@ {Gui::GuiActionType::ID_TreatmentRanges , 6 * 4 }, // 6 parameters each 4bytes // ---- + {Gui::GuiActionType::ID_AdjustBloodPrimeReq , 1 * 4 }, // 1 parameters each 4bytes + {Gui::GuiActionType::ID_AdjustBloodPrimeRsp , 2 * 4 }, // 2 parameters each 4bytes + + // ---- {Gui::GuiActionType::ID_AdjustBloodDialysateReq , 2 * 4 }, // 2 parameters each 4bytes {Gui::GuiActionType::ID_AdjustBloodDialysateRsp , 4 * 4 }, // 4 parameters each 4bytes Index: sources/canbus/MessageInterpreter.cpp =================================================================== diff -u -rc9764bd0ad823c5c1725d7c7f556290c2c459d4d -r09fc72d1410ab86f8de7b00dd7de4ea5612cf470 --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision c9764bd0ad823c5c1725d7c7f556290c2c459d4d) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 09fc72d1410ab86f8de7b00dd7de4ea5612cf470) @@ -248,6 +248,7 @@ case Gui::GuiActionType::ID_AdjustPatientConnectionConfirmReq : INTERPRET_TRSMT_MT_MESSAGE(AdjustPatientConnectionConfirmRequestData ); break; case Gui::GuiActionType::ID_AdjustStartTreatmentReq : INTERPRET_TRSMT_MT_MESSAGE(AdjustStartTreatmentRequestData ); break; // in-treatment + case Gui::GuiActionType::ID_AdjustBloodPrimeReq : INTERPRET_TRANSMIT_MESSAGE(AdjustBloodPrimeRequestData ); break; case Gui::GuiActionType::ID_AdjustBolusVolumeReq : INTERPRET_TRANSMIT_MESSAGE(AdjustBolusVolumeRequestData ); break; case Gui::GuiActionType::ID_AdjustDurationEditReq : INTERPRET_TRANSMIT_MESSAGE(AdjustDurationEditRequestData ); break; case Gui::GuiActionType::ID_AdjustDurationConfirmReq : INTERPRET_TRANSMIT_MESSAGE(AdjustDurationConfirmRequestData ); break; @@ -538,6 +539,7 @@ case Gui::GuiActionType::ID_Ultrafiltration : ok = notify(vMessage, vData, Gui::GuiActionType::ID_Ultrafiltration ); break; case Gui::GuiActionType::ID_TreatmentParametersSetPointData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_TreatmentParametersSetPointData ); break; // ----- In-Treatment Adjust + case Gui::GuiActionType::ID_AdjustBloodPrimeRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustBloodPrimeRsp ); break; case Gui::GuiActionType::ID_AdjustDurationEditRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustDurationEditRsp ); break; case Gui::GuiActionType::ID_AdjustDurationConfirmRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustDurationConfirmRsp ); break; case Gui::GuiActionType::ID_AdjustSetPointsRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustSetPointsRsp ); break; Index: sources/gui/GuiGlobals.cpp =================================================================== diff -u -rc9764bd0ad823c5c1725d7c7f556290c2c459d4d -r09fc72d1410ab86f8de7b00dd7de4ea5612cf470 --- sources/gui/GuiGlobals.cpp (.../GuiGlobals.cpp) (revision c9764bd0ad823c5c1725d7c7f556290c2c459d4d) +++ sources/gui/GuiGlobals.cpp (.../GuiGlobals.cpp) (revision 09fc72d1410ab86f8de7b00dd7de4ea5612cf470) @@ -129,6 +129,7 @@ // ----- #include "VTreatmentCreate.h" // ----- In-Treatment Adjustments +#include "VTreatmentAdjustmentBloodPrime.h" #include "VTreatmentAdjustmentDurationEdit.h" #include "VTreatmentAdjustmentDurationConfirm.h" #include "VTreatmentAdjustmentFlows.h" Index: sources/gui/GuiGlobals.h =================================================================== diff -u -r32a7b4d52315019d125c6c7b728bf0d215919c0f -r09fc72d1410ab86f8de7b00dd7de4ea5612cf470 --- sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 32a7b4d52315019d125c6c7b728bf0d215919c0f) +++ sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 09fc72d1410ab86f8de7b00dd7de4ea5612cf470) @@ -236,6 +236,10 @@ ID_TDTemperatureData = 0x5300, // 83 //// ----- TODO: Payload subject to change given FW implementation ID_TreatmentParametersSetPointData = 0x4F00, // 79 //// ----- @LEAHIZED + // Blood Prime + ID_AdjustBloodPrimeReq = 0x9800, // 152 + ID_AdjustBloodPrimeRsp = 0x9900, // 153 + // In-Treatment Adjustables ID_AdjustPressuresLimitsReq = 0x7200, // 114 //// ----- @LEAHIZED ID_AdjustPressuresLimitsRsp = 0x7300, // 115 //// ----- @LEAHIZED @@ -475,6 +479,7 @@ typedef GuiActions::Requested_Treatment_Recirc_User_Actions GuiRecirculateCommands; // Blood Prime typedef GuiActions::Blood_Prime_States GuiBloodPrimeStates; + typedef GuiActions::Requested_Blood_Prime_User_Actions GuiBloodPrimeCommands; // Treatment End typedef GuiActions::Treatment_End_States GuiTreatmentEndStates; typedef GuiActions::Requested_Treatment_End_User_Actions GuiTreatmentEndCommands; Index: sources/gui/qml/main.qml =================================================================== diff -u -rc9764bd0ad823c5c1725d7c7f556290c2c459d4d -r09fc72d1410ab86f8de7b00dd7de4ea5612cf470 --- sources/gui/qml/main.qml (.../main.qml) (revision c9764bd0ad823c5c1725d7c7f556290c2c459d4d) +++ sources/gui/qml/main.qml (.../main.qml) (revision 09fc72d1410ab86f8de7b00dd7de4ea5612cf470) @@ -122,6 +122,7 @@ import VFPTemperature 0.1 import VFPBoostPump 0.1 // In-Treatment - Adjustemnt +import VTreatmentAdjustmentBloodPrime 0.1 import VTreatmentAdjustmentBolusVolume 0.1 import VTreatmentAdjustmentDurationEdit 0.1 import VTreatmentAdjustmentDurationConfirm 0.1 @@ -293,6 +294,7 @@ VTreatmentCreate { id: vTreatmentCreate } VTreatmentRanges { id: vTreatmentRanges } + VTreatmentAdjustmentBloodPrime { id: vTreatmentAdjustmentBloodPrime } VTreatmentAdjustmentBolusVolume { id: vTreatmentAdjustmentBolusVolume } VTreatmentAdjustmentSaline { id: vTreatmentAdjustmentSaline } VTreatmentAdjustmentVitals { id: vTreatmentAdjustmentVitals } Index: sources/gui/qml/pages/endtreatment/rinseback/EndTreatmentRinseback.qml =================================================================== diff -u -r07fa2cd47bf538e89c48fc7d425674f20afc9f2a -r09fc72d1410ab86f8de7b00dd7de4ea5612cf470 --- sources/gui/qml/pages/endtreatment/rinseback/EndTreatmentRinseback.qml (.../EndTreatmentRinseback.qml) (revision 07fa2cd47bf538e89c48fc7d425674f20afc9f2a) +++ sources/gui/qml/pages/endtreatment/rinseback/EndTreatmentRinseback.qml (.../EndTreatmentRinseback.qml) (revision 09fc72d1410ab86f8de7b00dd7de4ea5612cf470) @@ -90,11 +90,7 @@ anchors { top : _deliveredVolumeText.bottom bottom : undefined -<<<<<<< Updated upstream - topMargin : _timeoutText.anchors.bottomMargin -======= topMargin : _timeout.anchors.bottomMargin ->>>>>>> Stashed changes } visible : vTDTreatmentStates.rbPaused height : 25 Index: sources/gui/qml/pages/treatment/TreatmentBloodPrime.qml =================================================================== diff -u -r77ba0083b790f7c1c851c60ecaeaa4f2e7eff7a8 -r09fc72d1410ab86f8de7b00dd7de4ea5612cf470 --- sources/gui/qml/pages/treatment/TreatmentBloodPrime.qml (.../TreatmentBloodPrime.qml) (revision 77ba0083b790f7c1c851c60ecaeaa4f2e7eff7a8) +++ sources/gui/qml/pages/treatment/TreatmentBloodPrime.qml (.../TreatmentBloodPrime.qml) (revision 09fc72d1410ab86f8de7b00dd7de4ea5612cf470) @@ -28,62 +28,189 @@ ScreenItem { id: _root objectName: "_TreatmentBloodPrime" - Text { id: _title - anchors { - top: parent.top - topMargin: 65 - horizontalCenter: parent.horizontalCenter + property alias notification: _notification + + signal decreaseClicked () + signal increaseClicked () + signal pauseClicked () + + Connections { target: vTreatmentAdjustmentBloodFlowRate + function onAdjustmentTriggered ( vValue ) { + if (vTreatmentAdjustmentBloodFlowRate.adjustment_Accepted) { + _notification.text = "" + } + else { + _notification.text = vTreatmentAdjustmentBloodFlowRate.text() + } } - color: Colors.textMain - text: qsTr("Blood Priming") - font.pixelSize: Fonts.fontPixelTitle } - ProgressCircle { id: _circle - diameter: 335 - anchors.centerIn: parent - minimum : 0 - maximum : vTreatmentBloodPrime.target - value : vTreatmentBloodPrime.current - - Text { id: _textVolume - anchors.centerIn: parent - color: Colors.textMain - text: vTreatmentBloodPrime.current.toFixed(0) + " " + qsTr(Variables.unitTextFluid) - font.pixelSize: 76 - font.weight: Font.ExtraLight + Column { id: _contentColumn + objectName : "_contentColumn" + anchors { + top : parent.top + topMargin : Variables.defaultMargin + horizontalCenter : parent.horizontalCenter } + spacing : Variables.defaultMargin * 2 - Text { id: _labelRate - anchors { - top: parent.bottom - topMargin: 20 - horizontalCenter: parent.horizontalCenter + ProgressCircle { id: _volumeProgress + objectName : "_volumeProgress" + anchors.horizontalCenter : parent.horizontalCenter + thickness : 35 + circleShadowColor : Colors.mainTreatmentLighterBlue + circleFillColor : Colors.mainTreatmentDarkerBlue + minimum : 0 + maximum : vTreatmentBloodPrime.target + value : vTreatmentBloodPrime.current + + Text { id: _volumeText + objectName : "_volumeText" + anchors.centerIn: parent + height : contentHeight + font { + pixelSize : 76 + weight : Font.Light + } + color : Colors.textMain + text : vTreatmentBloodPrime.current.toFixed(0) + " " + qsTr(Variables.unitTextFluid) } - color: Colors.textMain - text: vTreatmentBloodFlow.setFlowRate.toFixed(0) + " " + qsTr(Variables.unitTextFlowRate) - font.pixelSize: 23 } - } - TreatmentPressures { id: _pressuresTouchArea - // maybe now it makes sense for the ranges to be displayed - // arterialLowerBound : 0 // requested to hide the bounds - // arterialUpperBound : 0 // requested to hide the bounds - // venousLowerBound : 0 // requested to hide the bounds - // venousUpperBound : 0 // requested to hide the bounds + Row { id: _bottomContentRow + objectName : "_bottomContentRow" + anchors.horizontalCenter : parent.horizontalCenter + spacing : Variables.defaultMargin -// isTouchable : false -// x : Variables.screenGridLeftColumnX -// y : Variables.screenGridRow1Y -// width : Variables.screenGridAreaWidth -// height : Variables.screenGridAreaHeightRow1 - } - Line { x: 0; y: Variables.screenGridRow1LineY; length: Variables.screenGridLineLength } + TreatmentSection { id: _flowRateSection + objectName : "_flowRateSection" + anchors.verticalCenter : parent.verticalCenter + width : 420 + height : 420 + header.title : qsTr("Blood Flow Rate" ) + header.showEdit : false + header { + title : qsTr("Rinseback Flow Rate") + showEdit : false + } - onVisibleChanged: { - if (visible) { - _mainMenu.hidden = true + RangedValue { id: _bloodFlowRangedValue + objectName : "_bloodFlowRangedValue" + precision : Variables.bloodFlowPrecision + rawMin : vTreatmentRanges.bloodFlowRateMin + rawMax : vTreatmentRanges.bloodFlowRateMax + rawStep : vTreatmentRanges.bloodFlowRateRes + rawValue : vTreatmentParametersSetPoint.bloodFlow + } + + Item { id: _flowRateContentArea + objectName : "_flowRateContentArea" + anchors { + top : _flowRateSection.header.bottom + bottom : _pauseButton.top + left : parent.left + right : parent.right + margins : Variables.defaultMargin + } + + Text { id: _flowRateValue + objectName : "_flowRateValue" + anchors.centerIn : parent + width : 200 + height : Variables.defaultButtonHeight + font { + pixelSize : Fonts.fontPixelVitals + weight : Font.Medium + } + color : Colors.textTextRectLabel + horizontalAlignment : Text.AlignHCenter + verticalAlignment : Text.AlignVCenter + text : _bloodFlowRangedValue.value + } + + Text { id: _flowRateUnit + objectName : "_flowRateUnit" + anchors { + top : _flowRateValue.bottom + topMargin : Variables.defaultMargin + horizontalCenter : _flowRateValue.horizontalCenter + } + width : contentWidth + height : contentHeight + font { + pixelSize : Fonts.fontPixelContainerUnit + weight : Font.Thin + } + color : Colors.offWhite + horizontalAlignment : Text.AlignHCenter + verticalAlignment : Text.AlignVCenter + text : Variables.unitTextFlowRate + } + + ArrowButton { id: _decrementFlowRateButton + objectName : "_decrementFlowRateButton" + anchors { + left : parent.left + leftMargin : Variables.defaultMargin * 3 + verticalCenter : _flowRateValue.verticalCenter + } + leftArrow : true + enabled : _bloodFlowRangedValue.canDecrement + + onClicked : { _root.decreaseClicked() } + } + + ArrowButton { id: _incrementFlowRateButton + objectName : "_incrementFlowRateButton" + anchors { + right : parent.right + rightMargin : _decrementFlowRateButton.anchors.leftMargin + verticalCenter : _flowRateValue.verticalCenter + } + rightArrow : true + enabled : _bloodFlowRangedValue.canIncrement + + onClicked : { _root.increaseClicked() } + } + } + + TouchRect { id: _pauseButton + objectName: "_pauseButton" + anchors { + bottom : parent.bottom + horizontalCenter: parent.horizontalCenter + margins : Variables.defaultMargin * 1.5 + } + width : Variables.defaultButtonWidth + height : Variables.defaultButtonHeight + text { + text : qsTr("Pause Blood Prime") + font.weight : Font.Medium + } + isDefault : true + enabled : true + + onClicked : { _root.pauseClicked() } + } + } + + TreatmentSaline { id: _treatmentSaline + objectName : "_treatmentSaline" + anchors.verticalCenter : parent.verticalCenter + width : 285 + height : _flowRateSection.height + header.showEdit : false + } + + TreatmentPressures { id: _treatmentPressures + objectName : "_treatmentPressures" + anchors.verticalCenter : parent.verticalCenter + width : 750 + height : _flowRateSection.height + header.showEdit : false + } } } + + NotificationBarSmall { id: _notification } } Index: sources/gui/qml/pages/treatment/TreatmentStack.qml =================================================================== diff -u -r07fa2cd47bf538e89c48fc7d425674f20afc9f2a -r09fc72d1410ab86f8de7b00dd7de4ea5612cf470 --- sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 07fa2cd47bf538e89c48fc7d425674f20afc9f2a) +++ sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 09fc72d1410ab86f8de7b00dd7de4ea5612cf470) @@ -75,12 +75,21 @@ // Components TreatmentBloodPrime { id: _treatmentBloodPrime - StackView.onActivating : { - _headerBar.titleText = qsTr("Blood Priming") + StackView.onActivating : { _headerBar.titleText = qsTr("Blood Priming") } + StackView.onDeactivating : { _headerBar.titleText = "" } + onDecreaseClicked : { vTreatmentAdjustmentBloodPrime.doDecrease () } + onIncreaseClicked : { vTreatmentAdjustmentBloodPrime.doIncrease () } + onPauseClicked : { vTreatmentAdjustmentBloodPrime.doPause () } + } + Connections { target: vTreatmentAdjustmentBloodPrime + function onAdjustmentTriggered ( vValue ) { + if (vTreatmentAdjustmentBloodPrime.adjustment_Accepted) { + _treatmentBloodPrime.notification.text = "" + } + else { + _treatmentBloodPrime.notification.text = vTreatmentAdjustmentBloodPrime.text() + } } - StackView.onDeactivating : { - _headerBar.titleText = "" - } } TreatmentHome { id: _treatmentHome } Index: sources/model/MModel.h =================================================================== diff -u -rc9764bd0ad823c5c1725d7c7f556290c2c459d4d -r09fc72d1410ab86f8de7b00dd7de4ea5612cf470 --- sources/model/MModel.h (.../MModel.h) (revision c9764bd0ad823c5c1725d7c7f556290c2c459d4d) +++ sources/model/MModel.h (.../MModel.h) (revision 09fc72d1410ab86f8de7b00dd7de4ea5612cf470) @@ -147,6 +147,7 @@ // Treatment #include "MTreatmentAdjustRequests.h" +#include "MTreatmentAdjustBloodPrimeResponse.h" #include "MTreatmentAdjustBolusVolumeResponse.h" #include "MTreatmentAdjustDurationEditResponse.h" #include "MTreatmentAdjustDurationConfirmResponse.h" @@ -454,6 +455,7 @@ REGISTER_METATYPE( AlarmSilenceRequestData ) \ REGISTER_METATYPE( AlarmUserActionRequestData ) \ REGISTER_METATYPE( AlarmActiveListRequestData ) \ + REGISTER_METATYPE( AdjustBloodPrimeRequestData ) \ REGISTER_METATYPE( AdjustBloodDialysateRequestData ) \ REGISTER_METATYPE( AdjustBolusVolumeRequestData ) \ REGISTER_METATYPE( AdjustDurationEditRequestData ) \ @@ -500,6 +502,7 @@ REGISTER_METATYPE( AdjustDisinfectStartResponseData ) \ REGISTER_METATYPE( AdjustDGCleaningUsageResponseData ) \ \ + REGISTER_METATYPE( AdjustBloodPrimeResponseData ) \ REGISTER_METATYPE( AdjustBloodDialysateResponseData ) \ REGISTER_METATYPE( AdjustBolusVolumeResponseData ) \ REGISTER_METATYPE( AdjustDurationEditResponseData ) \ @@ -668,6 +671,7 @@ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustDisinfectStartResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustDGCleaningUsageResponseData ) \ \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustBloodPrimeResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustBloodDialysateResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustBolusVolumeResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustDurationEditResponseData ) \ @@ -715,6 +719,7 @@ /* POST */ \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustUIPostFinalResultRequestData ) \ \ + ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustBloodPrimeRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustBloodDialysateRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustBolusVolumeRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustDurationEditRequestData ) \ @@ -904,6 +909,7 @@ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustDisinfectStartResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustDGCleaningUsageResponseData ) \ \ + ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustBloodPrimeResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustBloodDialysateResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustBolusVolumeResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustDurationEditResponseData ) \ @@ -975,6 +981,7 @@ /* DG Cleaning Usage */ \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustDGCleaningUsageRequestData ) \ \ + ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustBloodPrimeRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustBloodDialysateRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustBolusVolumeRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustDurationEditRequestData ) \ @@ -1045,6 +1052,7 @@ /* DG Cleaning Usage */ \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustDGCleaningUsageRequestData ) \ \ + ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustBloodPrimeRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustBloodDialysateRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustBolusVolumeRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustDurationEditRequestData ) \ @@ -1115,6 +1123,7 @@ /* DG Cleaning Usage */ \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustDGCleaningUsageRequestData ) \ \ + ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustBloodPrimeRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustBloodDialysateRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustBolusVolumeRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustDurationEditRequestData ) \ @@ -1265,6 +1274,7 @@ ACTION_RECEIVE_SIGNAL( AdjustDisinfectStartResponseData ) \ ACTION_RECEIVE_SIGNAL( AdjustDGCleaningUsageResponseData ) \ \ + ACTION_RECEIVE_SIGNAL( AdjustBloodPrimeResponseData ) \ ACTION_RECEIVE_SIGNAL( AdjustBloodDialysateResponseData ) \ ACTION_RECEIVE_SIGNAL( AdjustBolusVolumeResponseData ) \ ACTION_RECEIVE_SIGNAL( AdjustDurationEditResponseData ) \ Index: sources/model/hd/adjustment/treatment/MTreatmentAdjustRequests.h =================================================================== diff -u -rc9764bd0ad823c5c1725d7c7f556290c2c459d4d -r09fc72d1410ab86f8de7b00dd7de4ea5612cf470 --- sources/model/hd/adjustment/treatment/MTreatmentAdjustRequests.h (.../MTreatmentAdjustRequests.h) (revision c9764bd0ad823c5c1725d7c7f556290c2c459d4d) +++ sources/model/hd/adjustment/treatment/MTreatmentAdjustRequests.h (.../MTreatmentAdjustRequests.h) (revision 09fc72d1410ab86f8de7b00dd7de4ea5612cf470) @@ -431,6 +431,34 @@ }; /*! + * \brief The MAdjustBloodPrimeReq class + * \details The model to request Blood Prime command + * + * | MSG | CAN ID | Type | Ack | Src | Dest | Description | + * |:----:|:------:|:----:|:---:|:---:|:----:|:---------------: | + * |0x9800| 0x100 | Req | Y | UI | TD | BloodPrime Request | + * + * | Payload || + * | || + * | #1:(U32) | \ref command | + * + * \sa State + * \sa MTreatmentBloodPrime : BloodPrime Data + * \sa MAdjustBloodPrimeResponse : BloodPrime Command Response + * + */ +class MAdjustBloodPrimeReq : public MModel { +public: + GuiBloodPrimeCommands command; + QString toString() { + return toString({command}); + } + static QString toString(const QVariantList &vParameters) { + return MModel::toString("AdjustBloodPrime", vParameters); + } +}; + +/*! * \brief The MAdjustPressuresLimitsReq class * \details The model to request the pressures limits adjustment * @@ -643,6 +671,7 @@ typedef Model:: MAdjustRinsebackReq AdjustRinsebackRequestData; typedef Model:: MAdjustRecirculateReq AdjustRecirculateRequestData; typedef Model:: MAdjustTreatmentEndReq AdjustTreatmentEndRequestData; +typedef Model:: MAdjustBloodPrimeReq AdjustBloodPrimeRequestData; typedef Model:: MAdjustPressuresLimitsReq AdjustPressuresLimitsRequestData; typedef Model:: MAdjustBolusVolumeReq AdjustBolusVolumeRequestData; // Alarms Index: sources/model/td/adjustment/treatment/MTreatmentAdjustBloodPrimeResponse.cpp =================================================================== diff -u --- sources/model/td/adjustment/treatment/MTreatmentAdjustBloodPrimeResponse.cpp (revision 0) +++ sources/model/td/adjustment/treatment/MTreatmentAdjustBloodPrimeResponse.cpp (revision 09fc72d1410ab86f8de7b00dd7de4ea5612cf470) @@ -0,0 +1,49 @@ +/*! + * + * Copyright (c) 2021-2024 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 MTreatmentAdjustBloodPrimeResponse.cpp + * \author (last) Behrouz NematiPour + * \date (last) 11-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 11-Apr-2021 + * + */ +#include "MTreatmentAdjustBloodPrimeResponse.h" + +using namespace Model; + +QVariantList MAdjustBloodPrimeResponse::parameters() const { + return { + _data.mAccepted.value, + _data.mReason .value, + }; +} + +bool MAdjustBloodPrimeResponse::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if ( ! GetValue(vByteArray, index, _data.mAccepted )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mReason )) goto lError; + + return true ; + +lError: + if(vIndex) { *vIndex = index; } + + return false ; +} + +/*! + * \brief MAdjustBloodPrimeResponse::data + * \details Provides model's Data from the received messages data values + * \return Data + */ +AdjustBloodPrimeResponseData MAdjustBloodPrimeResponse::data() const { + Data data; + data.mAccepted = _data.mAccepted.value; + data.mReason = _data.mReason .value; + return data; +} Index: sources/model/td/adjustment/treatment/MTreatmentAdjustBloodPrimeResponse.h =================================================================== diff -u --- sources/model/td/adjustment/treatment/MTreatmentAdjustBloodPrimeResponse.h (revision 0) +++ sources/model/td/adjustment/treatment/MTreatmentAdjustBloodPrimeResponse.h (revision 09fc72d1410ab86f8de7b00dd7de4ea5612cf470) @@ -0,0 +1,84 @@ +/*! + * + * Copyright (c) 2021-2024 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 MTreatmentAdjustBloodPrimeResponse.h + * \author (last) Behrouz NematiPour + * \date (last) 11-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 11-Apr-2021 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "MAbstract.h" +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +/*! + * \brief The MAdjustBloodPrimeResponse class + * \details The BloodPrime adjustment response model + * + * | MSG | CAN ID | Type | Ack | Src | Dest | Description | + * |:----:|:------:|:----:|:---:|:---:|:----:|:----------------: | + * |0x9900| 0x020 | Rsp | Y | TD | UI | BloodPrime Response | + * + * | Payload || + * | || + * | #1:(U32) | \ref Data::mAccepted | + * | #2:(U32) | \ref Data::mReason | + * + * \sa Data + * \sa MAdjustBloodPrimeReq : BloodPrime Request + * \sa MTreatmentBloodPrime : BloodPrime Data + * + *

Logging info

+ * | || + * | || + * | typeText | Event | + * | unitText | TD | + * | infoText | AdjustBloodPrime | + * + */ +class MAdjustBloodPrimeResponse : public MAbstract { + + // friends + friend class ::tst_models; + + QVariantList parameters() const override; + + struct { + Types::U32 mAccepted; + Types::U32 mReason ; + } _data; + +public: + + Type_Enum typeText () const override { return Type_Enum::eEvent ; } + Unit_Enum unitText () const override { return Unit_Enum::eTD ; } + QString infoText () const override { return QString("AdjustBloodPrime") ; } + + struct Data { + bool mAccepted = 0; /*!< Accepted value of type quint32 extracted out */ + quint32 mReason = 0; /*!< Reason value of type quint32 extracted out */ + }; + + MAdjustBloodPrimeResponse () { } + + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; + Data data ( ) const ; +}; +} + +typedef Model::MAdjustBloodPrimeResponse::Data AdjustBloodPrimeResponseData; Index: sources/storage/Logger.cpp =================================================================== diff -u -rd862dfcd402206e33b314c458e41c13b684a4565 -r09fc72d1410ab86f8de7b00dd7de4ea5612cf470 --- sources/storage/Logger.cpp (.../Logger.cpp) (revision d862dfcd402206e33b314c458e41c13b684a4565) +++ sources/storage/Logger.cpp (.../Logger.cpp) (revision 09fc72d1410ab86f8de7b00dd7de4ea5612cf470) @@ -557,7 +557,6 @@ _logFileNameTime = QDateTime::currentDateTime().time().toString(_fileTimeFormat); } break; - case GuiTDOpModes::MODE_TPAR: case GuiTDOpModes::MODE_PRET: case GuiTDOpModes::MODE_TREA: case GuiTDOpModes::MODE_POST: Index: sources/view/VView.h =================================================================== diff -u -rc9764bd0ad823c5c1725d7c7f556290c2c459d4d -r09fc72d1410ab86f8de7b00dd7de4ea5612cf470 --- sources/view/VView.h (.../VView.h) (revision c9764bd0ad823c5c1725d7c7f556290c2c459d4d) +++ sources/view/VView.h (.../VView.h) (revision 09fc72d1410ab86f8de7b00dd7de4ea5612cf470) @@ -222,6 +222,7 @@ REGISTER_TYPE( VPreTreatmentAdjustmentPatientConnectionConfirm ) \ REGISTER_TYPE( VPreTreatmentAdjustmentStartTreatment ) \ /* In-Treatment */ \ + REGISTER_TYPE( VTreatmentAdjustmentBloodPrime ) \ REGISTER_TYPE( VTreatmentAdjustmentFlows ) \ REGISTER_TYPE( VTreatmentAdjustmentUltrafiltrationState ) \ REGISTER_TYPE( VTreatmentAdjustmentUltrafiltrationEdit ) \ Index: sources/view/td/adjustment/treatment/VTreatmentAdjustmentBloodPrime.cpp =================================================================== diff -u --- sources/view/td/adjustment/treatment/VTreatmentAdjustmentBloodPrime.cpp (revision 0) +++ sources/view/td/adjustment/treatment/VTreatmentAdjustmentBloodPrime.cpp (revision 09fc72d1410ab86f8de7b00dd7de4ea5612cf470) @@ -0,0 +1,46 @@ +/*! + * + * Copyright (c) 2021-2024 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 VTreatmentAdjustmentBloodPrime.cpp + * \author (last) Behrouz NematiPour + * \date (last) 11-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 11-Apr-2021 + * + */ +#include "VTreatmentAdjustmentBloodPrime.h" + +// Project +#include "GuiController.h" + +VIEW_DEF_CLASS_ADJUSTMENT(VTreatmentAdjustmentBloodPrime) + +void VTreatmentAdjustmentBloodPrime::initConnections() { + ACTION_VIEW_CONNECTION(AdjustBloodPrimeResponseData); + ADJUST_VIEW_CONNECTION(AdjustBloodPrimeRequestData ); +} + +void VTreatmentAdjustmentBloodPrime::onActionReceive(const AdjustBloodPrimeResponseData &vData) +{ + adjustment_Accepted ( vData.mAccepted ); + adjustment_Reason ( vData.mReason ); + + // *** has to be the last to let the information to be set and then emit the signal *** + // *** otherwise will use the previous values before being set. *** + adjustment ( true ); +} + +/*! + * \brief View::VTreatmentAdjustmentBloodPrime::adjustment + * \details the invocable slot to send blood prime command + * \param vCommand - the blood prime command + */ +void View::VTreatmentAdjustmentBloodPrime::adjustment(const GuiBloodPrimeCommands &vCommand) +{ + _data.command = vCommand; + emit didAdjustment(_data); // notify the controllers to do the adjustment +} Index: sources/view/td/adjustment/treatment/VTreatmentAdjustmentBloodPrime.h =================================================================== diff -u --- sources/view/td/adjustment/treatment/VTreatmentAdjustmentBloodPrime.h (revision 0) +++ sources/view/td/adjustment/treatment/VTreatmentAdjustmentBloodPrime.h (revision 09fc72d1410ab86f8de7b00dd7de4ea5612cf470) @@ -0,0 +1,65 @@ +/*! + * + * Copyright (c) 2021-2024 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 VTreatmentAdjustmentBloodPrime.h + * \author (last) Behrouz NematiPour + * \date (last) 18-Apr-2022 + * \author (original) Behrouz NematiPour + * \date (original) 11-Apr-2021 + * + */ +#pragma once + +#include + +// Project +#include "main.h" // Doxygen : do not remove +#include "VAdjustmentResponseBase.h" +#include "MTreatmentAdjustBloodPrimeResponse.h" + +namespace View { + +/*! + * \brief The VTreatmentAdjustmentBloodPrime class + * \details View for Model's Data representation. + * + * \sa Model::MAdjustBloodPrimeResponse + * + */ +class VTreatmentAdjustmentBloodPrime : public VAdjustmentResponseBase +{ + Q_OBJECT + + // friends + friend class ::tst_views; + + AdjustBloodPrimeRequestData _data; + + // The property adjustment_Triggered has to be always true + // and to always trigger the change event to work as a notifier for GUI + TRIGGER( bool , adjustment , 0 ) + + VIEW_DEC_CLASS_ADJUSTMENT(VTreatmentAdjustmentBloodPrime, AdjustBloodPrimeResponseData) + +// ---------- Start/Stop BloodPrime +private: + void adjustment (const GuiBloodPrimeCommands &vCommand); + +public slots: + void doDecrease () { adjustment( GuiBloodPrimeCommands::REQUESTED_USER_ACTION_BLOOD_PRIME_DECREASE_RATE ); } + void doIncrease () { adjustment( GuiBloodPrimeCommands::REQUESTED_USER_ACTION_BLOOD_PRIME_INCREASE_RATE ); } + void doPause () { adjustment( GuiBloodPrimeCommands::REQUESTED_USER_ACTION_BLOOD_PRIME_PAUSE ); } + +signals: + /*! + * \brief didAdjustment + * \details the notification signal to adjust the BloodPrime bolus state + * \param vData - data model for the duration adjustment request + */ + void didAdjustment(const AdjustBloodPrimeRequestData &vData); +}; +} Index: sources/view/td/data/VTDOpModeData.cpp =================================================================== diff -u -rf2e4eba6e85c5d36537be782926f23cc9dc01037 -r09fc72d1410ab86f8de7b00dd7de4ea5612cf470 --- sources/view/td/data/VTDOpModeData.cpp (.../VTDOpModeData.cpp) (revision f2e4eba6e85c5d36537be782926f23cc9dc01037) +++ sources/view/td/data/VTDOpModeData.cpp (.../VTDOpModeData.cpp) (revision 09fc72d1410ab86f8de7b00dd7de4ea5612cf470) @@ -28,7 +28,6 @@ service ( vData.mOpMode == GuiTDOpModes ::MODE_SERV ); init ( vData.mOpMode == GuiTDOpModes ::MODE_INIT ); standby ( vData.mOpMode == GuiTDOpModes ::MODE_STAN ); - validateParameters ( vData.mOpMode == GuiTDOpModes ::MODE_TPAR ); preTreatment ( vData.mOpMode == GuiTDOpModes ::MODE_PRET ); inTreatment ( vData.mOpMode == GuiTDOpModes ::MODE_TREA ); postTreatment ( vData.mOpMode == GuiTDOpModes ::MODE_POST );