Index: leahi.pro =================================================================== diff -u -r49dadacdb78d6e7a7e52bf405a4a3c9308f874e0 -r914308e6f87b8074bff379371379d238e7781ed3 --- leahi.pro (.../leahi.pro) (revision 49dadacdb78d6e7a7e52bf405a4a3c9308f874e0) +++ leahi.pro (.../leahi.pro) (revision 914308e6f87b8074bff379371379d238e7781ed3) @@ -175,6 +175,8 @@ sources/model/td/adjustment/settings/MAdjustTDVersionsRequest.h \ sources/model/td/adjustment/settings/MAdjustTDVersionsResponse.h \ sources/model/td/adjustment/treatment/MTreatmentAdjustBolusVolumeResponse.h \ + sources/model/td/adjustment/treatment/MTreatmentAdjustDurationConfirmResponse.h \ + sources/model/td/adjustment/treatment/MTreatmentAdjustDurationEditResponse.h \ sources/model/td/adjustment/treatment/MTreatmentAdjustVitalsResponse.h \ sources/model/td/data/MTDAirBubbleData.h \ sources/model/td/data/MTDAirPumpData.h \ @@ -236,6 +238,8 @@ sources/view/td/data/VTDEjectorData.h \ sources/view/td/data/VTDOpModeData.h \ \ # ---------- Views - TD - Adjustment - In-Treatment + sources/view/td/adjustment/treatment/VTreatmentAdjustmentDurationConfirm.h \ + sources/view/td/adjustment/treatment/VTreatmentAdjustmentDurationEdit.h \ sources/view/td/adjustment/treatment/VTreatmentAdjustmentBolusVolume.h \ sources/view/td/adjustment/treatment/VTreatmentAdjustmentSaline.h \ sources/view/td/adjustment/treatment/VTreatmentAdjustmentVitals.h \ @@ -287,7 +291,6 @@ sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustStartTreatmentResponse.h \ \ # ---------- Models - HD - Adjustment - In-Treatment sources/model/hd/adjustment/treatment/MTreatmentAdjustRequests.h \ - sources/model/hd/adjustment/treatment/MTreatmentAdjustDurationResponse.h \ sources/model/hd/adjustment/treatment/MTreatmentAdjustBloodDialysateResponse.h \ sources/model/hd/adjustment/treatment/MTreatmentAdjustHeparinResponse.h \ sources/model/hd/adjustment/treatment/MTreatmentAdjustPressuresLimitsResponse.h \ @@ -405,7 +408,6 @@ sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentPatientConnectionConfirm.h \ sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentStartTreatment.h \ \ # ---------- Views - HD - Adjustment - In-Treatment - sources/view/hd/adjustment/treatment/VTreatmentAdjustmentDuration.h \ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentFlows.h \ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentHeparin.h \ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentPressuresLimits.h \ @@ -507,6 +509,8 @@ sources/model/td/adjustment/settings/MAdjustTDVersionsRequest.cpp \ sources/model/td/adjustment/settings/MAdjustTDVersionsResponse.cpp \ sources/model/td/adjustment/treatment/MTreatmentAdjustBolusVolumeResponse.cpp \ + sources/model/td/adjustment/treatment/MTreatmentAdjustDurationConfirmResponse.cpp \ + sources/model/td/adjustment/treatment/MTreatmentAdjustDurationEditResponse.cpp \ sources/model/td/adjustment/treatment/MTreatmentAdjustVitalsResponse.cpp \ sources/model/td/data/MTDAirBubbleData.cpp \ sources/model/td/data/MTDAirPumpData.cpp \ @@ -603,7 +607,6 @@ sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustPatientConnectionConfirmResponse.cpp \ sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustStartTreatmentResponse.cpp \ \ # ---------- Models - HD - Adjustment - In-Treatment - sources/model/hd/adjustment/treatment/MTreatmentAdjustDurationResponse.cpp \ sources/model/hd/adjustment/treatment/MTreatmentAdjustBloodDialysateResponse.cpp \ sources/model/hd/adjustment/treatment/MTreatmentAdjustHeparinResponse.cpp \ sources/model/hd/adjustment/treatment/MTreatmentAdjustPressuresLimitsResponse.cpp \ @@ -683,6 +686,8 @@ sources/view/td/data/VTDEjectorData.cpp \ sources/view/td/data/VTDOpModeData.cpp \ \ # ---------- Views - TD - Adjustment - In-Treatment + sources/view/td/adjustment/treatment/VTreatmentAdjustmentDurationConfirm.cpp \ + sources/view/td/adjustment/treatment/VTreatmentAdjustmentDurationEdit.cpp \ sources/view/td/adjustment/treatment/VTreatmentAdjustmentBolusVolume.cpp \ sources/view/td/adjustment/treatment/VTreatmentAdjustmentSaline.cpp \ sources/view/td/adjustment/treatment/VTreatmentAdjustmentVitals.cpp \ @@ -725,7 +730,6 @@ sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentPatientConnectionConfirm.cpp \ sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentStartTreatment.cpp \ \ # ---------- Views - HD - Adjustment - In-Treatment - sources/view/hd/adjustment/treatment/VTreatmentAdjustmentDuration.cpp \ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentFlows.cpp \ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentHeparin.cpp \ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentPressuresLimits.cpp \ Index: sources/canbus/MessageDispatcher.cpp =================================================================== diff -u -r49dadacdb78d6e7a7e52bf405a4a3c9308f874e0 -r914308e6f87b8074bff379371379d238e7781ed3 --- sources/canbus/MessageDispatcher.cpp (.../MessageDispatcher.cpp) (revision 49dadacdb78d6e7a7e52bf405a4a3c9308f874e0) +++ sources/canbus/MessageDispatcher.cpp (.../MessageDispatcher.cpp) (revision 914308e6f87b8074bff379371379d238e7781ed3) @@ -239,19 +239,32 @@ /*! * \brief MessageDispatcher::onAdjustment - * \details This method transmits the treatment duration Adjustment Denali message. + * \details This method transmits the treatment duration adjustment edit message. * \param vData - Data model contains treatment duration adjustment value in minutes * \return void */ -void MessageDispatcher::onAdjustment(const AdjustDurationRequestData &vData) +void MessageDispatcher::onAdjustment(const AdjustDurationEditRequestData &vData) { QVariantList mData; mData += vData.duration; - onActionTransmit(GuiActionType::ID_AdjustDurationReq, mData); + onActionTransmit(GuiActionType::ID_AdjustDurationEditReq, mData); } /*! * \brief MessageDispatcher::onAdjustment + * \details This method transmits the treatment duration adjustment confirm message. + * \param vData - Data model contains treatment duration adjustment value in minutes + * \return void + */ +void MessageDispatcher::onAdjustment(const AdjustDurationConfirmRequestData &vData) +{ + QVariantList mData; + mData += vData.duration; + onActionTransmit(GuiActionType::ID_AdjustDurationConfirmReq, mData); +} + +/*! + * \brief MessageDispatcher::onAdjustment * \details This method transmits the Ultrafiltration State Adjustment Denali message. * \param vData - Data model contains treatment ultrafiltration state adjustment * \return void Index: sources/canbus/MessageDispatcher.h =================================================================== diff -u -r49dadacdb78d6e7a7e52bf405a4a3c9308f874e0 -r914308e6f87b8074bff379371379d238e7781ed3 --- sources/canbus/MessageDispatcher.h (.../MessageDispatcher.h) (revision 49dadacdb78d6e7a7e52bf405a4a3c9308f874e0) +++ sources/canbus/MessageDispatcher.h (.../MessageDispatcher.h) (revision 914308e6f87b8074bff379371379d238e7781ed3) @@ -131,7 +131,8 @@ // In-Treatment GuiActionType::ID_AdjustBloodDialysateReq , GuiActionType::ID_AdjustBolusVolumeReq , - GuiActionType::ID_AdjustDurationReq , + GuiActionType::ID_AdjustDurationEditReq , + GuiActionType::ID_AdjustDurationConfirmReq , GuiActionType::ID_AdjustUltrafiltrationStateReq , GuiActionType::ID_AdjustUltrafiltrationEditReq , GuiActionType::ID_AdjustUltrafiltrationConfirmReq , Index: sources/canbus/MessageGlobals.h =================================================================== diff -u -r49dadacdb78d6e7a7e52bf405a4a3c9308f874e0 -r914308e6f87b8074bff379371379d238e7781ed3 --- sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision 49dadacdb78d6e7a7e52bf405a4a3c9308f874e0) +++ sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision 914308e6f87b8074bff379371379d238e7781ed3) @@ -158,8 +158,10 @@ {Gui::GuiActionType::ID_AdjustBolusVolumeRsp , 3 * 4 }, // 3 parameters each 4bytes // ---- - {Gui::GuiActionType::ID_AdjustDurationReq , 1 * 4 }, // 1 parameter each 4bytes - {Gui::GuiActionType::ID_AdjustDurationRsp , 4 * 4 }, // 4 parameters each 4bytes + {Gui::GuiActionType::ID_AdjustDurationEditReq , 1 * 4 }, // 1 parameter each 4bytes + {Gui::GuiActionType::ID_AdjustDurationEditRsp , 5 * 4 }, // 4 parameters each 4bytes + {Gui::GuiActionType::ID_AdjustDurationConfirmReq , 1 * 4 }, // 1 parameter each 4bytes + {Gui::GuiActionType::ID_AdjustDurationConfirmRsp , 5 * 4 }, // 4 parameters each 4bytes // ---- {Gui::GuiActionType::ID_AdjustUltrafiltrationStateReq , 1 * 4 }, // 1 parameter each 4bytes Index: sources/canbus/MessageInterpreter.cpp =================================================================== diff -u -r49dadacdb78d6e7a7e52bf405a4a3c9308f874e0 -r914308e6f87b8074bff379371379d238e7781ed3 --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 49dadacdb78d6e7a7e52bf405a4a3c9308f874e0) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 914308e6f87b8074bff379371379d238e7781ed3) @@ -246,7 +246,8 @@ case Gui::GuiActionType::ID_AdjustStartTreatmentReq : INTERPRET_TRSMT_MT_MESSAGE(AdjustStartTreatmentRequestData ); break; // in-treatment case Gui::GuiActionType::ID_AdjustBolusVolumeReq : INTERPRET_TRANSMIT_MESSAGE(AdjustBolusVolumeRequestData ); break; - case Gui::GuiActionType::ID_AdjustDurationReq : INTERPRET_TRANSMIT_MESSAGE(AdjustDurationRequestData ); break; + case Gui::GuiActionType::ID_AdjustDurationEditReq : INTERPRET_TRANSMIT_MESSAGE(AdjustDurationEditRequestData ); break; + case Gui::GuiActionType::ID_AdjustDurationConfirmReq : INTERPRET_TRANSMIT_MESSAGE(AdjustDurationConfirmRequestData ); break; case Gui::GuiActionType::ID_AdjustBloodDialysateReq : INTERPRET_TRANSMIT_MESSAGE(AdjustBloodDialysateRequestData ); break; case Gui::GuiActionType::ID_AdjustPressuresLimitsReq : INTERPRET_TRANSMIT_MESSAGE(AdjustPressuresLimitsRequestData ); break; case Gui::GuiActionType::ID_AdjustSalineReq : INTERPRET_TRANSMIT_MESSAGE(AdjustSalineRequestData ); break; @@ -524,7 +525,8 @@ 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_AdjustDurationRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustDurationRsp ); 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_AdjustBolusVolumeRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustBolusVolumeRsp ); break; case Gui::GuiActionType::ID_AdjustBloodDialysateRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustBloodDialysateRsp ); break; case Gui::GuiActionType::ID_AdjustPressuresLimitsRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustPressuresLimitsRsp ); break; Index: sources/gui/GuiGlobals.cpp =================================================================== diff -u -r9048646630717f980a852df54349805ba63773e0 -r914308e6f87b8074bff379371379d238e7781ed3 --- sources/gui/GuiGlobals.cpp (.../GuiGlobals.cpp) (revision 9048646630717f980a852df54349805ba63773e0) +++ sources/gui/GuiGlobals.cpp (.../GuiGlobals.cpp) (revision 914308e6f87b8074bff379371379d238e7781ed3) @@ -127,7 +127,8 @@ // ----- #include "VTreatmentCreate.h" // ----- In-Treatment Adjustments -#include "VTreatmentAdjustmentDuration.h" +#include "VTreatmentAdjustmentDurationEdit.h" +#include "VTreatmentAdjustmentDurationConfirm.h" #include "VTreatmentAdjustmentFlows.h" #include "VTreatmentAdjustmentUltrafiltrationState.h" #include "VTreatmentAdjustmentUltrafiltrationEdit.h" Index: sources/gui/GuiGlobals.h =================================================================== diff -u -r49dadacdb78d6e7a7e52bf405a4a3c9308f874e0 -r914308e6f87b8074bff379371379d238e7781ed3 --- sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 49dadacdb78d6e7a7e52bf405a4a3c9308f874e0) +++ sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 914308e6f87b8074bff379371379d238e7781ed3) @@ -237,8 +237,10 @@ ID_TreatmentParametersSetPointData = 0x4F00, // 79 //// ----- @LEAHIZED // In-Treatment Adjustables - ID_AdjustDurationReq = 0x160F, // 22 //// ----- @CRAPIZED: had to change to avoid duplication - ID_AdjustDurationRsp = 0x1B00, // 27 + ID_AdjustDurationEditReq = 0x8300, // 124 //// ----- @LEAHIZED + ID_AdjustDurationEditRsp = 0x8400, // 125 //// ----- @LEAHIZED + ID_AdjustDurationConfirmReq = 0x8500, // 126 //// ----- @LEAHIZED + ID_AdjustDurationConfirmRsp = 0x8600, // 127 //// ----- @LEAHIZED ID_AdjustBloodDialysateReq = 0x1700, // 23 ID_AdjustBloodDialysateRsp = 0x1800, // 24 Index: sources/gui/qml/main.qml =================================================================== diff -u -r49dadacdb78d6e7a7e52bf405a4a3c9308f874e0 -r914308e6f87b8074bff379371379d238e7781ed3 --- sources/gui/qml/main.qml (.../main.qml) (revision 49dadacdb78d6e7a7e52bf405a4a3c9308f874e0) +++ sources/gui/qml/main.qml (.../main.qml) (revision 914308e6f87b8074bff379371379d238e7781ed3) @@ -118,7 +118,8 @@ import VFPBoostPump 0.1 // In-Treatment - Adjustemnt import VTreatmentAdjustmentBolusVolume 0.1 -import VTreatmentAdjustmentDuration 0.1 +import VTreatmentAdjustmentDurationEdit 0.1 +import VTreatmentAdjustmentDurationConfirm 0.1 import VTreatmentAdjustmentFlows 0.1 import VTreatmentAdjustmentUltrafiltrationState 0.1 import VTreatmentAdjustmentUltrafiltrationEdit 0.1 @@ -268,7 +269,8 @@ VPreTreatmentAdjustmentStartTreatment { id: vPreTreatmentAdjustmentStartTreatment } // --- - VTreatmentAdjustmentDuration { id: vTreatmentAdjustmentDuration } + VTreatmentAdjustmentDurationEdit { id: vTreatmentAdjustmentDurationEdit } + VTreatmentAdjustmentDurationConfirm { id: vTreatmentAdjustmentDurationConfirm } VTreatmentAdjustmentFlows { id: vTreatmentAdjustmentFlows } VTreatmentCreate { id: vTreatmentCreate } Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentDuration.qml =================================================================== diff -u -rd5e9940fa96373f6cc118dfa9761d95f361689a5 -r914308e6f87b8074bff379371379d238e7781ed3 --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentDuration.qml (.../TreatmentAdjustmentDuration.qml) (revision d5e9940fa96373f6cc118dfa9761d95f361689a5) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentDuration.qml (.../TreatmentAdjustmentDuration.qml) (revision 914308e6f87b8074bff379371379d238e7781ed3) @@ -62,12 +62,13 @@ StackView.onActivating : { _root.titleText = qsTr("Edit Treatment Duration") _root.notificationText = "" + reset() } - onContinueClicked : function(vDuration) { - // send duration to TD and wait. + onContinueClicked : function(vNewTreatmentDuration) { + // send new duration to TD and wait // if accepted moves to confirm screen, otherwise show error in notification - // vTreatmentAdjustmentDurationEdit.doAdjustment(vDuration) + vTreatmentAdjustmentDurationEdit.doAdjustment(vNewTreatmentDuration) } } Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentDurationEdit.qml =================================================================== diff -u -rd5e9940fa96373f6cc118dfa9761d95f361689a5 -r914308e6f87b8074bff379371379d238e7781ed3 --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentDurationEdit.qml (.../TreatmentAdjustmentDurationEdit.qml) (revision d5e9940fa96373f6cc118dfa9761d95f361689a5) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentDurationEdit.qml (.../TreatmentAdjustmentDurationEdit.qml) (revision 914308e6f87b8074bff379371379d238e7781ed3) @@ -30,10 +30,23 @@ Item { id: _root objectName: "_TreatmentAdjustmentDurationEdit" - signal continueClicked(int vDuration) + QtObject { id: _private + objectName: "_private" + readonly property int ufMultiplier : Math.pow(10, Variables.ultrafiltrationPrecision) + readonly property real ufVolumeRes : calculatePrecisionValue( vTreatmentRanges.ultrafiltrationVolumeRes, ufMultiplier ) + readonly property real ufSetVolume : calculatePrecisionValue( vTreatmentUltrafiltration.setVolume , ufMultiplier ) + readonly property real ufVolumeRemoved : calculatePrecisionValue( vTreatmentUltrafiltration.volumeRemoved , ufMultiplier ) + readonly property int treatmentTimeTotal : vTreatmentTime.time_Total + function calculatePrecisionValue(value, multiplier) { + return Math.round(value * multiplier) / multiplier + } + } + + signal continueClicked(int vNewTreatmentDuration) + function reset() { - _newTreatmentDuration.value = vTreatmentTime.time_Total + _newTreatmentDuration.value = _private.treatmentTimeTotal } component LabelUnitText: LabelUnitContainer { id: _labelUnitText @@ -74,14 +87,14 @@ objectName : "_ufVolumeRemoved" text : qsTr("UF Volume Removed") unitText : Variables.unitVolume - valueText : "-- --" + valueText : _private.ufVolumeRemoved } LabelUnitText { id: _timeElapsed objectName : "_timeElapsed" text : qsTr("Time Elapsed") unitText : Variables.unitTextDuration - valueText : "-- --" + valueText : vTreatmentTime.time_Elapsed } } @@ -93,14 +106,14 @@ objectName : "_ufVolumeGoal" text : qsTr("UF Volume Goal") unitText : Variables.unitVolume - valueText : "-- --" + valueText : _private.ufSetVolume } LabelUnitText { id: _treatmentDuration objectName : "_treatmentDuration" text : qsTr("Treatment Duration") unitText : Variables.unitTextDuration - valueText : "-- --" + valueText : vTreatmentTime.time_Total } } } @@ -131,10 +144,12 @@ titleFontPixelSize : Fonts.fontPixelContainerTitleSmall unitText : Variables.unitTextDuration unitFontPixelSize : Fonts.fontPixelContainerUnitSmall - minimum : vTreatmentRanges.treatmentRanges_Duration_Min - maximum : vTreatmentRanges.treatmentRanges_Duration_Max - // value : { value = _private.treatmentDuration } // set without binding + isActive : true + minimum : Math.ceil(vTreatmentTime.time_Elapsed / step) * step + maximum : Math.floor(vTreatmentRanges.treatmentRanges_Duration_Max / step) * step + step : vTreatmentRanges.treatmentDurationRes + onDidChange : function(vValue) { value = vValue } onMinimumChanged: { if (value < minimum) { value = minimum @@ -161,6 +176,7 @@ font.weight : Font.Medium } isDefault : true + enabled : _newTreatmentDuration.value !== _private.treatmentTimeTotal onClicked : { _root.continueClicked(_newTreatmentDuration.value) Index: sources/model/MModel.h =================================================================== diff -u -r49dadacdb78d6e7a7e52bf405a4a3c9308f874e0 -r914308e6f87b8074bff379371379d238e7781ed3 --- sources/model/MModel.h (.../MModel.h) (revision 49dadacdb78d6e7a7e52bf405a4a3c9308f874e0) +++ sources/model/MModel.h (.../MModel.h) (revision 914308e6f87b8074bff379371379d238e7781ed3) @@ -146,7 +146,8 @@ // Treatment #include "MTreatmentAdjustRequests.h" #include "MTreatmentAdjustBolusVolumeResponse.h" -#include "MTreatmentAdjustDurationResponse.h" +#include "MTreatmentAdjustDurationEditResponse.h" +#include "MTreatmentAdjustDurationConfirmResponse.h" #include "MTreatmentAdjustBloodDialysateResponse.h" #include "MTreatmentAdjustUltrafiltrationStateResponse.h" #include "MTreatmentAdjustUltrafiltrationEditResponse.h" @@ -448,7 +449,8 @@ REGISTER_METATYPE( AlarmActiveListRequestData ) \ REGISTER_METATYPE( AdjustBloodDialysateRequestData ) \ REGISTER_METATYPE( AdjustBolusVolumeRequestData ) \ - REGISTER_METATYPE( AdjustDurationRequestData ) \ + REGISTER_METATYPE( AdjustDurationEditRequestData ) \ + REGISTER_METATYPE( AdjustDurationConfirmRequestData ) \ REGISTER_METATYPE( AdjustUltrafiltrationStateRequestData ) \ REGISTER_METATYPE( AdjustUltrafiltrationEditRequestData ) \ REGISTER_METATYPE( AdjustUltrafiltrationConfirmRequestData ) \ @@ -489,7 +491,8 @@ \ REGISTER_METATYPE( AdjustBloodDialysateResponseData ) \ REGISTER_METATYPE( AdjustBolusVolumeResponseData ) \ - REGISTER_METATYPE( AdjustDurationResponseData ) \ + REGISTER_METATYPE( AdjustDurationEditResponseData ) \ + REGISTER_METATYPE( AdjustDurationConfirmResponseData ) \ REGISTER_METATYPE( AdjustUltrafiltrationStateResponseData ) \ REGISTER_METATYPE( AdjustUltrafiltrationEditResponseData ) \ REGISTER_METATYPE( AdjustUltrafiltrationConfirmResponseData ) \ @@ -647,7 +650,8 @@ \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustBloodDialysateResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustBolusVolumeResponseData ) \ - ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustDurationResponseData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustDurationEditResponseData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustDurationConfirmResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustUltrafiltrationStateResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustUltrafiltrationEditResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustUltrafiltrationConfirmResponseData ) \ @@ -687,7 +691,8 @@ \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustBloodDialysateRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustBolusVolumeRequestData ) \ - ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustDurationRequestData ) \ + ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustDurationEditRequestData ) \ + ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustDurationConfirmRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustUltrafiltrationStateRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustUltrafiltrationEditRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustUltrafiltrationConfirmRequestData ) \ @@ -869,7 +874,8 @@ \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustBloodDialysateResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustBolusVolumeResponseData ) \ - ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustDurationResponseData ) \ + ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustDurationEditResponseData ) \ + ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustDurationConfirmResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustUltrafiltrationStateResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustUltrafiltrationEditResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustUltrafiltrationConfirmResponseData ) \ @@ -933,7 +939,8 @@ \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustBloodDialysateRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustBolusVolumeRequestData ) \ - ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustDurationRequestData ) \ + ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustDurationEditRequestData ) \ + ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustDurationConfirmRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustUltrafiltrationStateRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustUltrafiltrationEditRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustUltrafiltrationConfirmRequestData ) \ @@ -995,7 +1002,8 @@ \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustBloodDialysateRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustBolusVolumeRequestData ) \ - ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustDurationRequestData ) \ + ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustDurationEditRequestData ) \ + ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustDurationConfirmRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustUltrafiltrationStateRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustUltrafiltrationEditRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustUltrafiltrationConfirmRequestData ) \ @@ -1057,7 +1065,8 @@ \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustBloodDialysateRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustBolusVolumeRequestData ) \ - ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustDurationRequestData ) \ + ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustDurationEditRequestData ) \ + ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustDurationConfirmRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustUltrafiltrationStateRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustUltrafiltrationEditRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustUltrafiltrationConfirmRequestData ) \ @@ -1200,7 +1209,8 @@ \ ACTION_RECEIVE_SIGNAL( AdjustBloodDialysateResponseData ) \ ACTION_RECEIVE_SIGNAL( AdjustBolusVolumeResponseData ) \ - ACTION_RECEIVE_SIGNAL( AdjustDurationResponseData ) \ + ACTION_RECEIVE_SIGNAL( AdjustDurationEditResponseData ) \ + ACTION_RECEIVE_SIGNAL( AdjustDurationConfirmResponseData ) \ ACTION_RECEIVE_SIGNAL( AdjustUltrafiltrationStateResponseData ) \ ACTION_RECEIVE_SIGNAL( AdjustUltrafiltrationEditResponseData ) \ ACTION_RECEIVE_SIGNAL( AdjustUltrafiltrationConfirmResponseData ) \ Fisheye: Tag 914308e6f87b8074bff379371379d238e7781ed3 refers to a dead (removed) revision in file `sources/model/hd/adjustment/treatment/MTreatmentAdjustDurationResponse.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 914308e6f87b8074bff379371379d238e7781ed3 refers to a dead (removed) revision in file `sources/model/hd/adjustment/treatment/MTreatmentAdjustDurationResponse.h'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/model/hd/adjustment/treatment/MTreatmentAdjustRequests.h =================================================================== diff -u -r49dadacdb78d6e7a7e52bf405a4a3c9308f874e0 -r914308e6f87b8074bff379371379d238e7781ed3 --- sources/model/hd/adjustment/treatment/MTreatmentAdjustRequests.h (.../MTreatmentAdjustRequests.h) (revision 49dadacdb78d6e7a7e52bf405a4a3c9308f874e0) +++ sources/model/hd/adjustment/treatment/MTreatmentAdjustRequests.h (.../MTreatmentAdjustRequests.h) (revision 914308e6f87b8074bff379371379d238e7781ed3) @@ -117,30 +117,54 @@ }; /*! - * \brief The MAdjustDurationReq class + * \brief The MAdjustDurationEditReq class * \details The treatment duration change request model * * | MSG | CAN ID | Type | Ack | Src | Dst | Description | * |:----:|:------:|:------:|:---:|:---:|:---:|:-----------: | - * |0x1600| 0x100 | Req | Y | UI | HD | Treatment Duration Change Request | + * |0x8300| 0x100 | Req | Y | UI | HD | Treatment Duration Edit Request | * * | Payload || * | || * | #1:(U32) | \ref duration | * */ -class MAdjustDurationReq : public MModel { +class MAdjustDurationEditReq : public MModel { public: quint32 duration = 0; QString toString() { return toString({duration}); } static QString toString(const QVariantList &vParameters) { - return MModel::toString("AdjustDuration", vParameters); + return MModel::toString("AdjustDurationEdit", vParameters); } }; /*! + * \brief The MAdjustDurationConfirmReq class + * \details The treatment duration change request model + * + * | MSG | CAN ID | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:------:|:---:|:---:|:---:|:-----------: | + * |0x8500| 0x100 | Req | Y | UI | HD | Treatment Duration Confirm Request | + * + * | Payload || + * | || + * | #1:(U32) | \ref duration | + * + */ +class MAdjustDurationConfirmReq : public MModel { +public: + quint32 duration = 0; + QString toString() { + return toString({duration}); + } + static QString toString(const QVariantList &vParameters) { + return MModel::toString("AdjustDurationConfirm", vParameters); + } +}; + +/*! * \brief The MAdjustUltrafiltrationStateReq class * \details The ultrafiltration pause/resume request model * @@ -499,7 +523,8 @@ typedef Model:: MDuetConfirmUIr DuetConfirmUIrData; typedef Model:: MAdjustPowerOffReq AdjustPowerOffRequestData; typedef Model:: MAdjustBloodDialysateReq AdjustBloodDialysateRequestData; -typedef Model:: MAdjustDurationReq AdjustDurationRequestData; +typedef Model:: MAdjustDurationEditReq AdjustDurationEditRequestData; +typedef Model:: MAdjustDurationConfirmReq AdjustDurationConfirmRequestData; typedef Model:: MAdjustUltrafiltrationStateReq AdjustUltrafiltrationStateRequestData; typedef Model:: MAdjustUltrafiltrationEditReq AdjustUltrafiltrationEditRequestData; typedef Model::MAdjustUltrafiltrationConfirmReq AdjustUltrafiltrationConfirmRequestData; Index: sources/model/td/adjustment/treatment/MTreatmentAdjustDurationConfirmResponse.cpp =================================================================== diff -u --- sources/model/td/adjustment/treatment/MTreatmentAdjustDurationConfirmResponse.cpp (revision 0) +++ sources/model/td/adjustment/treatment/MTreatmentAdjustDurationConfirmResponse.cpp (revision 914308e6f87b8074bff379371379d238e7781ed3) @@ -0,0 +1,66 @@ +/*! + * + * Copyright (c) 2021-2025 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 MTreatmentAdjustDurationConfirmResponse.cpp + * \author (last) Stephen Quong + * \date (last) 17-Nov-2025 + * \author (original) Stephen Quong + * \date (original) 17-Nov-2025 + * + */ +#include "MTreatmentAdjustDurationConfirmResponse.h" + +using namespace Model; + +QString MAdjustDurationConfirmResponse::toString() const { + return QString(stringPrefix + ",%1,%2,%3,%4,%5") + .arg(_data.mAccepted .value) + .arg(_data.mReason .value) + .arg(_data.mDuration .value) + .arg(_data.mUFVolume .value) + .arg(_data.mUFRate .value); +} + +void MAdjustDurationConfirmResponse::toVariantList(QVariantList &vData) const { + vData += _data.mAccepted .value; + vData += _data.mReason .value; + vData += _data.mDuration .value; + vData += _data.mUFVolume .value; + vData += _data.mUFRate .value; +} + +bool MAdjustDurationConfirmResponse::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; + if ( ! GetValue(vByteArray, index, _data.mDuration )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mUFVolume )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mUFRate )) goto lError; + + return true ; + +lError: + if(vIndex) { *vIndex = index; } + + return false ; + +} + +/*! + * \brief MAdjustDurationConfirmResponse::data + * \details Provides model's Data from the received messages data values + * \return Data + */ +AdjustDurationConfirmResponseData MAdjustDurationConfirmResponse::data() const { + Data data; + data.mAccepted = _data.mAccepted .value; + data.mReason = _data.mReason .value; + data.mDuration = _data.mDuration .value; + data.mUFVolume = _data.mUFVolume .value; + data.mUFRate = _data.mUFRate .value; + return data; +} Index: sources/model/td/adjustment/treatment/MTreatmentAdjustDurationConfirmResponse.h =================================================================== diff -u --- sources/model/td/adjustment/treatment/MTreatmentAdjustDurationConfirmResponse.h (revision 0) +++ sources/model/td/adjustment/treatment/MTreatmentAdjustDurationConfirmResponse.h (revision 914308e6f87b8074bff379371379d238e7781ed3) @@ -0,0 +1,92 @@ +/*! + * + * Copyright (c) 2021-2025 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 MTreatmentAdjustDurationConfirmResponse.h + * \author (last) Stephen Quong + * \date (last) 17-Nov-2025 + * \author (original) Stephen Quong + * \date (original) 17-Nov-2025 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +/*! + * \brief The MAdjustDurationConfirmResponse class + * \details The UF vol. change confirmation response model + * + * | MSG | CAN ID | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:------:|:---:|:---:|:---:|:-----------: | + * |0x8600| 0x040 | Rsp | Y | HD | UI | Treatment Duration Confirmation Response | + * + * | Payload || + * | || + * | #1:(U32) | \ref Data::mAccepted | + * | #2:(U32) | \ref Data::mReason | + * | | | + * | #4:(U32) | \ref Data::mDuration | + * | #3:(F32) | \ref Data::mUFVolume | + * | #5:(F32) | \ref Data::mUFRate | + * + * \sa Data + * + *

Logging info

+ * | || + * | || + * | typeText | Event | + * | unitText | HD | + * | infoText | AdjustUFConfirm | + * + */ +class MAdjustDurationConfirmResponse { + + // friends + friend class ::tst_models; + +public: + QString stringPrefix = "AdjustDurationConfirm"; + struct Data { + bool mAccepted = 0; /*!< Accepted value of type quint32 extracted out */ + quint32 mReason = 0; /*!< Reason value of type quint32 extracted out */ + + quint32 mDuration = 0; /*!< duration value of type quint32 extracted out */ + float mUFVolume = 0; /*!< UF volume value of type float extracted out */ + float mUFRate = 0; /*!< UF rate value of type float extracted out */ + }; + +protected: + struct _Data { + Types::U32 mAccepted ; + Types::U32 mReason ; + + Types::U32 mDuration ; + Types::F32 mUFVolume ; + Types::F32 mUFRate ; + } _data; + +public: + MAdjustDurationConfirmResponse () { } + + QString toString ( ) const ; + void toVariantList ( QVariantList &vData ) const ; + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr); + + Data data() const; +}; +} + +typedef Model::MAdjustDurationConfirmResponse::Data AdjustDurationConfirmResponseData; Index: sources/model/td/adjustment/treatment/MTreatmentAdjustDurationEditResponse.cpp =================================================================== diff -u --- sources/model/td/adjustment/treatment/MTreatmentAdjustDurationEditResponse.cpp (revision 0) +++ sources/model/td/adjustment/treatment/MTreatmentAdjustDurationEditResponse.cpp (revision 914308e6f87b8074bff379371379d238e7781ed3) @@ -0,0 +1,58 @@ +/*! + * + * 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 MTreatmentAdjustDurationEditResponse.cpp + * \author (last) Behrouz NematiPour + * \date (last) 11-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 11-Apr-2021 + * + */ +#include "MTreatmentAdjustDurationEditResponse.h" + +using namespace Model; + +QVariantList MAdjustDurationEditResponse::parameters() const { + return { + _data.mAccepted.value, + _data.mReason .value, + _data.mDuration.value, + _data.mUFVolume.value, + _data.mUFRate .value + }; +} + +bool MAdjustDurationEditResponse::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; + if ( ! GetValue(vByteArray, index, _data.mDuration )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mUFVolume )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mUFRate )) goto lError; + + return true ; + +lError: + if(vIndex) { *vIndex = index; } + + return false ; +} + +/*! + * \brief MAdjustDurationEditResponse::data + * \details Provides model's Data from the received messages data values + * \return Data + */ +AdjustDurationEditResponseData MAdjustDurationEditResponse::data() const { + Data data; + data.mAccepted = _data.mAccepted.value; + data.mReason = _data.mReason .value; + data.mDuration = _data.mDuration.value; + data.mUFVolume = _data.mUFVolume.value; + data.mUFRate = _data.mUFRate .value; + return data; +} Index: sources/model/td/adjustment/treatment/MTreatmentAdjustDurationEditResponse.h =================================================================== diff -u --- sources/model/td/adjustment/treatment/MTreatmentAdjustDurationEditResponse.h (revision 0) +++ sources/model/td/adjustment/treatment/MTreatmentAdjustDurationEditResponse.h (revision 914308e6f87b8074bff379371379d238e7781ed3) @@ -0,0 +1,93 @@ +/*! + * + * 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 MTreatmentAdjustDurationEditResponse.h + * \author (last) Behrouz NematiPour + * \date (last) 11-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 11-Apr-2021 + * + */ +#pragma once + +// Qt +#include +#include + +// Project +#include "MAbstract.h" +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +/*! + * \brief The MAdjustDurationEditResponse class + * \details The treatment duration change response model + * + * | MSG | CAN ID | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:------:|:---:|:---:|:---:|:-----------: | + * |0x8400| 0x020 | Rsp | Y | HD | UI | Treatment Duration Edit Response | + * + * | Payload || + * | || + * | #1:(U32) | \ref Data::mAccepted | + * | #2:(U32) | \ref Data::mReason | + * | #3:(U32) | \ref Data::mDuration | + * | #4:(F32) | \ref Data::mUFVolume | + * | #4:(F32) | \ref Data::mUFRate | + * + * \sa Data + * + *

Logging info

+ * | || + * | || + * | typeText | Event | + * | unitText | HD | + * | infoText | AdjustDuration | + * + */ +class MAdjustDurationEditResponse : public MAbstract { + + // friends + friend class ::tst_models; + + QVariantList parameters() const override; + + struct { + + Types::U32 mAccepted ; + Types::U32 mReason ; + Types::U32 mDuration ; + Types::F32 mUFVolume ; + Types::F32 mUFRate ; + } _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("AdjustDurationEdit") ; } + + struct Data { + bool mAccepted = 0; /*!< Accepted value of type quint32 extracted out */ + quint32 mReason = 0; /*!< Reason value of type quint32 extracted out */ + quint32 mDuration = 0; /*!< Duration value of type quint32 extracted out */ + float mUFVolume = 0; /*!< UF Volume value of type float extracted out */ + float mUFRate = 0; /*!< UF Rate value of type float extracted out */ + }; + + MAdjustDurationEditResponse () { } + + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; + Data data ( ) const ; +}; +} + +typedef Model::MAdjustDurationEditResponse::Data AdjustDurationEditResponseData; Fisheye: Tag 914308e6f87b8074bff379371379d238e7781ed3 refers to a dead (removed) revision in file `sources/view/hd/adjustment/treatment/VTreatmentAdjustmentDuration.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 914308e6f87b8074bff379371379d238e7781ed3 refers to a dead (removed) revision in file `sources/view/hd/adjustment/treatment/VTreatmentAdjustmentDuration.h'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/view/td/adjustment/treatment/VTreatmentAdjustmentDurationConfirm.cpp =================================================================== diff -u --- sources/view/td/adjustment/treatment/VTreatmentAdjustmentDurationConfirm.cpp (revision 0) +++ sources/view/td/adjustment/treatment/VTreatmentAdjustmentDurationConfirm.cpp (revision 914308e6f87b8074bff379371379d238e7781ed3) @@ -0,0 +1,50 @@ +/*! + * + * Copyright (c) 2021-2025 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 VTreatmentAdjustmentDurationConfirm.cpp + * \author (last) Stephen Quong + * \date (last) 17-Nov-2025 + * \author (original) Stephen Quong + * \date (original) 17-Nov-2025 + * + */ +#include "VTreatmentAdjustmentDurationConfirm.h" + +#include +#include + +// Project +#include "GuiController.h" + +VIEW_DEF_CLASS_ADJUSTMENT(VTreatmentAdjustmentDurationConfirm) + +/*! + * \brief Function called during startup to register this class with the QMetaObject system + */ +static void qRegister() +{ + qmlRegisterType("VTreatmentAdjustmentDurationConfirm", 0, 1, "VTreatmentAdjustmentDurationConfirm"); +} +Q_COREAPP_STARTUP_FUNCTION(qRegister) + +void VTreatmentAdjustmentDurationConfirm::initConnections() { + ACTION_VIEW_CONNECTION(AdjustDurationConfirmResponseData); + ADJUST_VIEW_CONNECTION( AdjustDurationConfirmRequestData); +} + +void VTreatmentAdjustmentDurationConfirm::onActionReceive(const AdjustDurationConfirmResponseData &vData) +{ + adjustment_Accepted ( vData.mAccepted ); + adjustment_Reason ( vData.mReason ); + duration ( vData.mDuration ); + ufVolume ( vData.mUFVolume / 1000 ); // mL => L + ufRate ( vData.mUFRate ); + + // *** 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 ); +} Index: sources/view/td/adjustment/treatment/VTreatmentAdjustmentDurationConfirm.h =================================================================== diff -u --- sources/view/td/adjustment/treatment/VTreatmentAdjustmentDurationConfirm.h (revision 0) +++ sources/view/td/adjustment/treatment/VTreatmentAdjustmentDurationConfirm.h (revision 914308e6f87b8074bff379371379d238e7781ed3) @@ -0,0 +1,73 @@ +/*! + * + * Copyright (c) 2021-2025 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 VTreatmentAdjustmentDurationConfirm.h + * \author (last) Stephen Quong + * \date (last) 17-Nov-2025 + * \author (original) Stephen Quong + * \date (original) 17-Nov-2025 + * + */ +#pragma once + +#include + +// Project +#include "main.h" // Doxygen : do not remove +#include "VAdjustmentResponseBase.h" +#include "MTreatmentAdjustDurationConfirmResponse.h" + +namespace View { + +/*! + * \brief The VTreatmentAdjustmentDurationConfirm class + * \details View for Model's Data representation. + * + * \sa Model::MAdjustDurationResponse + * + */ +class VTreatmentAdjustmentDurationConfirm : public VAdjustmentResponseBase +{ + Q_OBJECT + + // friends + friend class ::tst_views; + + AdjustDurationConfirmRequestData _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) + + // Treatment Duration data + READONLY( quint32 , duration , 0) + READONLY( float , ufVolume , 0) + READONLY( float , ufRate , 0) + + VIEW_DEC_CLASS_ADJUSTMENT(VTreatmentAdjustmentDurationConfirm, AdjustDurationConfirmResponseData) + + // ----- Adjust Duration +public slots: + /*! + * \brief doAdjustment + * \details the invocable slot to adjust the treatment duration + * \param vDuration - treatment duration + */ + void doAdjustment(quint32 vDuration) { + _data.duration = vDuration; + emit didAdjustment(_data); + } + +signals: + /*! + * \brief didAdjustment + * \details the notification signal to adjust the treatment duration + * \param vData - data model for the duration adjustment request + */ + void didAdjustment(const AdjustDurationConfirmRequestData &vData); +}; +} Index: sources/view/td/adjustment/treatment/VTreatmentAdjustmentDurationEdit.cpp =================================================================== diff -u --- sources/view/td/adjustment/treatment/VTreatmentAdjustmentDurationEdit.cpp (revision 0) +++ sources/view/td/adjustment/treatment/VTreatmentAdjustmentDurationEdit.cpp (revision 914308e6f87b8074bff379371379d238e7781ed3) @@ -0,0 +1,50 @@ +/*! + * + * 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 VTreatmentAdjustmentDurationEdit.cpp + * \author (last) Behrouz NematiPour + * \date (last) 11-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 11-Apr-2021 + * + */ +#include "VTreatmentAdjustmentDurationEdit.h" + +#include +#include + +// Project +#include "GuiController.h" + +VIEW_DEF_CLASS_ADJUSTMENT(VTreatmentAdjustmentDurationEdit) + +/*! + * \brief Function called during startup to register this class with the QMetaObject system + */ +static void qRegister() +{ + qmlRegisterType("VTreatmentAdjustmentDurationEdit", 0, 1, "VTreatmentAdjustmentDurationEdit"); +} +Q_COREAPP_STARTUP_FUNCTION(qRegister) + +void VTreatmentAdjustmentDurationEdit::initConnections() { + ACTION_VIEW_CONNECTION(AdjustDurationEditResponseData); + ADJUST_VIEW_CONNECTION( AdjustDurationEditRequestData); +} + +void VTreatmentAdjustmentDurationEdit::onActionReceive(const AdjustDurationEditResponseData &vData) +{ + adjustment_Accepted ( vData.mAccepted ); + adjustment_Reason ( vData.mReason ); + duration ( vData.mDuration ); + ufVolume ( vData.mUFVolume / 1000 ); // mL => L + ufRate ( vData.mUFRate ); + + // *** 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 ); +} Index: sources/view/td/adjustment/treatment/VTreatmentAdjustmentDurationEdit.h =================================================================== diff -u --- sources/view/td/adjustment/treatment/VTreatmentAdjustmentDurationEdit.h (revision 0) +++ sources/view/td/adjustment/treatment/VTreatmentAdjustmentDurationEdit.h (revision 914308e6f87b8074bff379371379d238e7781ed3) @@ -0,0 +1,73 @@ +/*! + * + * 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 VTreatmentAdjustmentDurationEdit.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 "MTreatmentAdjustDurationEditResponse.h" + +namespace View { + +/*! + * \brief The VTreatmentAdjustmentDurationEdit class + * \details View for Model's Data representation. + * + * \sa Model::MAdjustDurationResponse + * + */ +class VTreatmentAdjustmentDurationEdit : public VAdjustmentResponseBase +{ + Q_OBJECT + + // friends + friend class ::tst_views; + + AdjustDurationEditRequestData _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) + + // Treatment Duration data + READONLY( quint32 , duration , 0) + READONLY( float , ufVolume , 0) + READONLY( float , ufRate , 0) + + VIEW_DEC_CLASS_ADJUSTMENT(VTreatmentAdjustmentDurationEdit, AdjustDurationEditResponseData) + + // ----- Adjust Duration +public slots: + /*! + * \brief doAdjustment + * \details the invocable slot to adjust the treatment duration + * \param vDuration - treatment duration + */ + void doAdjustment(quint32 vDuration) { + _data.duration = vDuration; + emit didAdjustment(_data); + } + +signals: + /*! + * \brief didAdjustment + * \details the notification signal to adjust the treatment duration + * \param vData - data model for the duration adjustment request + */ + void didAdjustment(const AdjustDurationEditRequestData &vData); +}; +}