Index: leahi.pro =================================================================== diff -u -r213b9fed4fc569eb85a0647bde9869a3c82c0db3 -r5ed84841f5852381b2e36328c0aeca7bc97b9c03 --- leahi.pro (.../leahi.pro) (revision 213b9fed4fc569eb85a0647bde9869a3c82c0db3) +++ leahi.pro (.../leahi.pro) (revision 5ed84841f5852381b2e36328c0aeca7bc97b9c03) @@ -613,6 +613,7 @@ sources/model/td/data/treatmentlog/MTreatmentLogEventData.cpp \ sources/model/td/data/treatmentlog/MTreatmentLogAvrgeData.cpp \ \ # ---------- Models - TD - Adjustment + sources/model/td/adjustment/MAdjustPowerOff.h \ \ # ---------- Models - TD - Adjustment - In-Treatment sources/model/td/adjustment/treatment/MTreatmentAdjustBloodPrimeResponse.cpp \ sources/model/td/adjustment/treatment/MTreatmentAdjustBloodFlowRateResponse.cpp \ @@ -657,6 +658,8 @@ \ # ---------- Models - Data - States sources/model/hd/data/pretreatment/MPreTreatmentStatesData.cpp \ sources/model/hd/data/posttreatment/MPostTreatmentStatesData.cpp \ + \ # ---------- Models - TD - Adjustment + sources/model/td/adjustment/MAdjustPowerOff.cpp \ \ # ---------- Models - TD - Adjustment - Settings sources/model/td/adjustment/settings/MAdjustTDDateTimeResponse.cpp \ sources/model/td/adjustment/settings/MTDInstitutionalRecordResponse.cpp \ Index: sources/canbus/MessageGlobals.h =================================================================== diff -u -rd95ed86d997208024ec79422e350a86a2c52fd85 -r5ed84841f5852381b2e36328c0aeca7bc97b9c03 --- sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision d95ed86d997208024ec79422e350a86a2c52fd85) +++ sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision 5ed84841f5852381b2e36328c0aeca7bc97b9c03) @@ -49,7 +49,7 @@ // but if the model still needs more the model will fail. // so it is better to keep them next to each other to make sure they are in sync. // ---- - {Gui::GuiActionType::ID_ShuttingDown , 0 }, + {Gui::GuiActionType::ID_PowerOff , 0 * 4 }, // 0 parameters {Gui::GuiActionType::ID_TDCheckIn , 0 }, //// ----- @LEAHIZED // Generic Confirm Index: sources/canbus/MessageInterpreter.cpp =================================================================== diff -u -rd95ed86d997208024ec79422e350a86a2c52fd85 -r5ed84841f5852381b2e36328c0aeca7bc97b9c03 --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision d95ed86d997208024ec79422e350a86a2c52fd85) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 5ed84841f5852381b2e36328c0aeca7bc97b9c03) @@ -219,6 +219,7 @@ // RO Water case Gui::GuiActionType::ID_DuetRoWaterModeUIi : INTERPRET_TRANSMIT_MESSAGE(DuetRoWaterModeUIiData ); break; // Power Off +// case Gui::GuiActionType::ID_PowerOff : INTERPRET_TRSMT_MT_MESSAGE(AdjustPowerOffRequestData ); break; // POST case Gui::GuiActionType::ID_UIPostFinalResultData : INTERPRET_TRANSMIT_MESSAGE(AdjustUIPostFinalResultRequestData ); break; // Settings @@ -462,8 +463,7 @@ // ----- Events case Gui::GuiActionType::ID_Acknow : ok = true; /* TODO : implement notify<>() */ break; - case Gui::GuiActionType::ID_ShuttingDown : ok = true; LOG_APPED("HD,ShuttingDown"); /* TODO : implement notify<>() */ break; - + case Gui::GuiActionType::ID_PowerOff : ok = notify(vMessage, vData, Gui::GuiActionType::ID_PowerOff ); break; case Gui::GuiActionType::ID_DuetConfirmTDi : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DuetConfirmTDi ); break; // ----- POST Index: sources/gui/GuiGlobals.h =================================================================== diff -u -rd95ed86d997208024ec79422e350a86a2c52fd85 -r5ed84841f5852381b2e36328c0aeca7bc97b9c03 --- sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision d95ed86d997208024ec79422e350a86a2c52fd85) +++ sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 5ed84841f5852381b2e36328c0aeca7bc97b9c03) @@ -127,7 +127,7 @@ ID_PostTreatmentStates = 0x770F, // 119 //// ----- @CRAPIZED: had to change to avoid duplication // ----- - ID_ShuttingDown = 0x0E0F, // 35 //// ----- @CRAPIZED: had to change to avoid duplication + ID_PowerOff = 0x2200, // 34 //// ----- @LEAHIZED ID_TreatmentTime = 0x3B00, // 59 //// ----- @LEAHIZED ID_BloodFlow = 0x1100, // 17 //// ----- @LEAHIZED ID_DialysateInletFlow = 0x0800, Index: sources/gui/qml/PowerItem.qml =================================================================== diff -u -r16028b057650dab9f5a2f27eaba5c9618c29dd9a -r5ed84841f5852381b2e36328c0aeca7bc97b9c03 --- sources/gui/qml/PowerItem.qml (.../PowerItem.qml) (revision 16028b057650dab9f5a2f27eaba5c9618c29dd9a) +++ sources/gui/qml/PowerItem.qml (.../PowerItem.qml) (revision 5ed84841f5852381b2e36328c0aeca7bc97b9c03) @@ -89,18 +89,18 @@ } // ---- Connections - Connections { target: _GuiView - function onDidActionReceive( vAction, vData ) { - switch(vAction) { - case GuiActions.ID_ShuttingDown: - _autoHideInfo.showDialog ( - qsTr("System is shutting down"), - 5000 // if any error happens and shutdown is not successful then after 5 seconds dialog hides. - ) - break; - } - } - } +// Connections { target: _GuiView +// function onDidActionReceive( vAction, vData ) { +// switch(vAction) { +// case GuiActions.ID_ShuttingDown: +// _autoHideInfo.showDialog ( +// qsTr("System is shutting down"), +// 5000 // if any error happens and shutdown is not successful then after 5 seconds dialog hides. +// ) +// break; +// } +// } +// } Connections { target: vConfirm function onIsRejectChanged ( vValue ) { _powerOffDialog.footerUpdate() @@ -112,6 +112,13 @@ else close () } + function onPowerOffTriggered ( vValue ) { + _autoHideInfo.showDialog ( + qsTr("System is shutting down"), + 5000 // if any error happens and shutdown is not successful then after 5 seconds dialog hides. + ) + } + function onAdjustmentTriggered ( vValue ) { // DEBUG: // console.debug('\n' + Index: sources/model/MModel.h =================================================================== diff -u -rd95ed86d997208024ec79422e350a86a2c52fd85 -r5ed84841f5852381b2e36328c0aeca7bc97b9c03 --- sources/model/MModel.h (.../MModel.h) (revision d95ed86d997208024ec79422e350a86a2c52fd85) +++ sources/model/MModel.h (.../MModel.h) (revision 5ed84841f5852381b2e36328c0aeca7bc97b9c03) @@ -22,6 +22,7 @@ // models #include "MSettings.h" +#include "MAdjustPowerOff.h" #include "MAlarmStatusData.h" #include "MAlarmTriggered.h" #include "MAlarmCleared.h" @@ -365,6 +366,7 @@ REGISTER_METATYPE( OutletFlowData ) \ REGISTER_METATYPE( TreatmentTimeData ) \ REGISTER_METATYPE( PressureOcclusionData ) \ + REGISTER_METATYPE( PowerOffData ) \ REGISTER_METATYPE( TreatmentRangesData ) \ REGISTER_METATYPE( TreatmentSalineData ) \ REGISTER_METATYPE( TreatmentVitalsData ) \ @@ -602,6 +604,7 @@ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, OutletFlowData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, TreatmentTimeData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, PressureOcclusionData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, PowerOffData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, TreatmentRangesData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, TreatmentSalineData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, TreatmentVitalsData ) \ @@ -850,6 +853,7 @@ ACTION_RECEIVE_BRIDGE_DEFINITION( OutletFlowData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( TreatmentTimeData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( PressureOcclusionData ) \ + ACTION_RECEIVE_BRIDGE_DEFINITION( PowerOffData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( TreatmentRangesData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( TreatmentSalineData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( TreatmentVitalsData ) \ @@ -1230,6 +1234,7 @@ ACTION_RECEIVE_SIGNAL( OutletFlowData ) \ ACTION_RECEIVE_SIGNAL( TreatmentTimeData ) \ ACTION_RECEIVE_SIGNAL( PressureOcclusionData ) \ + ACTION_RECEIVE_SIGNAL( PowerOffData ) \ ACTION_RECEIVE_SIGNAL( TreatmentRangesData ) \ ACTION_RECEIVE_SIGNAL( TreatmentSalineData ) \ ACTION_RECEIVE_SIGNAL( TreatmentVitalsData ) \ Index: sources/model/hd/adjustment/treatment/MTreatmentAdjustRequests.h =================================================================== diff -u -rd95ed86d997208024ec79422e350a86a2c52fd85 -r5ed84841f5852381b2e36328c0aeca7bc97b9c03 --- sources/model/hd/adjustment/treatment/MTreatmentAdjustRequests.h (.../MTreatmentAdjustRequests.h) (revision d95ed86d997208024ec79422e350a86a2c52fd85) +++ sources/model/hd/adjustment/treatment/MTreatmentAdjustRequests.h (.../MTreatmentAdjustRequests.h) (revision 5ed84841f5852381b2e36328c0aeca7bc97b9c03) @@ -27,6 +27,13 @@ namespace Model { /*! + * Simple request models + * These are models to send the request for the doAdjustment + * The the only reason thy have been defined to help overloading the adjustment methods + * Otherwise the parameters are so tiny models. + */ + +/*! * \brief The MDuetConfirmUIr class * \details The confirm response model * Fisheye: Tag d95ed86d997208024ec79422e350a86a2c52fd85 refers to a dead (removed) revision in file `sources/model/td/adjustment/MAdjustPowerOff.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag d95ed86d997208024ec79422e350a86a2c52fd85 refers to a dead (removed) revision in file `sources/model/td/adjustment/MAdjustPowerOff.h'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/view/confirm/VConfirm.cpp =================================================================== diff -u -rd95ed86d997208024ec79422e350a86a2c52fd85 -r5ed84841f5852381b2e36328c0aeca7bc97b9c03 --- sources/view/confirm/VConfirm.cpp (.../VConfirm.cpp) (revision d95ed86d997208024ec79422e350a86a2c52fd85) +++ sources/view/confirm/VConfirm.cpp (.../VConfirm.cpp) (revision 5ed84841f5852381b2e36328c0aeca7bc97b9c03) @@ -26,8 +26,8 @@ */ void View::VConfirm::initConnections() { ACTION_VIEW_CONNECTION(DuetConfirmTDiData ); + ACTION_VIEW_CONNECTION(PowerOffData ); ACTION_VIEW_CONNECTION(SettingsData ); - ADJUST_VIEW_CONNECTION(DuetConfirmUIrData ); } @@ -109,6 +109,13 @@ // DEBUG: qDebug() << _id << _command << adjustment_Reason() << _title << _message << _isReject; } +void View::VConfirm::onActionReceive(const PowerOffData &) +{ + // *** 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. *** + powerOff ( true ); +} + /*! * \brief View::VConfirm::doConfirm * \details the invocable slot to send user's Confirmation Index: sources/view/confirm/VConfirm.h =================================================================== diff -u -rd95ed86d997208024ec79422e350a86a2c52fd85 -r5ed84841f5852381b2e36328c0aeca7bc97b9c03 --- sources/view/confirm/VConfirm.h (.../VConfirm.h) (revision d95ed86d997208024ec79422e350a86a2c52fd85) +++ sources/view/confirm/VConfirm.h (.../VConfirm.h) (revision 5ed84841f5852381b2e36328c0aeca7bc97b9c03) @@ -20,6 +20,7 @@ #include "main.h" // Doxygen : do not remove #include "VAdjustmentResponseBase.h" #include "MDuetConfirmTDi.h" +#include "MAdjustPowerOff.h" #include "MSettings.h" namespace View { @@ -55,6 +56,7 @@ // 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) + TRIGGER ( bool , powerOff , 0) PROPERTY(quint32 , id , 0) PROPERTY(quint32 , command , 0) @@ -75,6 +77,7 @@ VIEW_DEC_CLASS (VConfirm ) VIEW_DEC_SLOT (DuetConfirmTDiData ) + VIEW_DEC_SLOT (PowerOffData ) VIEW_DEC_SLOT (SettingsData ) public slots: