Index: SDDs/Power_Control.png =================================================================== diff -u -r27d80f36e863ae58963420607cf6e23c0318ccb1 -re255d4633b338f4f46c3a2fad5a62f982ebfcd18 Binary files differ Index: SDDs/Power_Control.puml =================================================================== diff -u -r27d80f36e863ae58963420607cf6e23c0318ccb1 -re255d4633b338f4f46c3a2fad5a62f982ebfcd18 --- SDDs/Power_Control.puml (.../Power_Control.puml) (revision 27d80f36e863ae58963420607cf6e23c0318ccb1) +++ SDDs/Power_Control.puml (.../Power_Control.puml) (revision e255d4633b338f4f46c3a2fad5a62f982ebfcd18) @@ -26,50 +26,72 @@ ' SCL: User scrolls a flip-able area == Power Off Sequence == - US -> TD: TCH: Press Hard Button - Power - TD -> SW: MSG: [xB5: #3] Confirm Request \ - \n\t(U32) mId=0 (Shutdown) \ - \n\t(U32) mCommand=0 (GENERIC_CONFIRM_CMD_REQUEST_OPEN) \ - \n\t(U32) mReason - SW -> UI: ACT: Power Off Request - UI -> US: ACT: Display Confirm shutdown dialog - US -> UI: TCH: Press Shutdown or Cancel - UI -> SW: ACT: Shutdown confirm response - SW -> TD: MSG: [xB6: #2] Response \ - \n\t(U32) mId=0 (Shutdown) \ - \n\t(U32) mConfirm=0(cancel)/1 (shutdown) + US -> TD: TCH: Press Hard Power Button - alt mConfirm=1 (shutdown) - TD -> TD: ACT: Shutdown System ⟲ (May take a few seconds) - TD -> SW: MSG: [x22: #0] Power Off Warning - SW -> UI: ACT: Power Off Warning - UI -> US: ACT: Display auto-close dialog (5 seconds)\ - \n\tNotiy user system is shutting down - else #Pink mConfirm=0(cancel) + alt Accepted TD -> SW: MSG: [xB5: #3] Confirm Request \ - \n\t(U32) mId=0 (Shutdown) \ - \n\t(U32) mCommand=0 (GENERIC_CONFIRM_CMD_ACCEPT_CLOSE) \ - \n\t(U32) mReason - SW -> UI: ACT: Confirm Request close dialog - UI -> US: ACT: Close Dialog + \n\t(U32) mId=0 (Shutdown) \ + \n\t(U32) mCommand=0 (GENERIC_CONFIRM_CMD_REQUEST_OPEN) \ + \n\t(U32) mReason=0 + SW -> UI: ACT: Power Off Request + UI -> US: ACT: Display Confirm shutdown dialog + + alt User Presses Cancel + US -> UI: TCH: Press Cancel + UI -> SW: ACT: Shutdown confirm response + SW -> TD: MSG: [xB6: #2] Response \ + \n\t(U32) mId=0 (Shutdown) \ + \n\t(U32) mConfirm=0(cancel) + TD -> SW: MSG: [xB5: #3] Confirm Request \ + \n\t(U32) mId=0 (Shutdown) \ + \n\t(U32) mCommand=3 (GENERIC_CONFIRM_CMD_ACCEPT_CLOSE) \ + \n\t(U32) mReason=0 + SW -> UI: ACT: Confirm Request close dialog + UI -> US: ACT: Close Dialog + else #LightBlue User Presses Shutdown + US -> UI: TCH: Press Shutdown + UI -> SW: ACT: Shutdown confirm response + SW -> TD: MSG: [xB6: #2] Response \ + \n\t(U32) mId=0 (Shutdown) \ + \n\t(U32) mConfirm=1 (shutdown) + alt Accepted + TD -> SW: MSG: [xB5: #3] Confirm Request \ + \n\t(U32) mId=0 (Shutdown) \ + \n\t(U32) mCommand=3 (GENERIC_CONFIRM_CMD_ACCEPT_CLOSE) \ + \n\t(U32) mReason=0 + SW -> UI: ACT: Confirm Request close dialog + UI -> US: ACT: Close Dialog + TD -> SW: MSG: [x22: #0] Power Off Warning + TD -> TD: ACT: Shutdown System ⟲ (May take a ~2 seconds) + SW -> UI: ACT: Power Off Warning + UI -> US: ACT: Display auto-close dialog (5 seconds)\ + \n\tNotify user system is shutting down + else #Pink Rejected + TD -> SW: MSG: [xB5: #3] Confirm Request \ + \n\t(U32) mId=0 (Shutdown) \ + \n\t(U32) mCommand=2 (GENERIC_CONFIRM_CMD_REJECT) \ + \n\t(U32) mReason>0 + SW -> UI: ACT: Confirm Request rejected + UI -> US: ACT: Display rejection reason + end + end + else #Pink Rejected + TD -> SW: MSG: [xB5: #3] Confirm Request \ + \n\t(U32) mId=0 (Shutdown) \ + \n\t(U32) mCommand=2 (GENERIC_CONFIRM_CMD_REJECT) \ + \n\t(U32) mReason>0 + SW -> UI: ACT: Confirm Request rejected + UI -> US: ACT: Display Auto-Hide dialog with rejection reason end == Power Off Sequence Timeout == - US -> TD: TCH: Press Hard Button - Power - TD -> SW: MSG: [xB5: #3] Confirm Request \ - \n\t(U32) mId=0 (Shutdown) \ - \n\t(U32) mCommand=0 (GENERIC_CONFIRM_CMD_REQUEST_OPEN) \ - \n\t(U32) mReason - SW -> UI: ACT: Power Off Request - UI -> US: ACT: Display Confirm shutdown dialog - ... Time passes ... loop Timeout US -> US: ACT: User idle for timeout limit end TD -> SW: MSG: [xB5: #3] Confirm Request \ \n\t(U32) mId=0 (Shutdown) \ \n\t(U32) mCommand=1 (GENERIC_CONFIRM_CMD_TIMEOUT_CLOSE) \ - \n\t(U32) mReason + \n\t(U32) mReason=0 SW -> UI: ACT: Confirm Request timeout close UI -> US: ACT: Close Dialog @enduml Index: sources/gui/qml/PowerItem.qml =================================================================== diff -u -r5ed84841f5852381b2e36328c0aeca7bc97b9c03 -re255d4633b338f4f46c3a2fad5a62f982ebfcd18 --- sources/gui/qml/PowerItem.qml (.../PowerItem.qml) (revision 5ed84841f5852381b2e36328c0aeca7bc97b9c03) +++ sources/gui/qml/PowerItem.qml (.../PowerItem.qml) (revision e255d4633b338f4f46c3a2fad5a62f982ebfcd18) @@ -35,17 +35,16 @@ property bool isOpen: false - AutoHideInfo { id: _autoHideInfo } ConfirmDialog { id: _powerOffDialog idText : vConfirm.id titleText : vConfirm.title messageText : vConfirm.message confirmText : vConfirm.confirm cancelText : vConfirm.cancel - confirmVisible : ! vConfirm.isReject +// confirmVisible : ! vConfirm.isReject notificationText: vConfirm.adjustment_ReasonText - autoClose : vConfirm.isReject + autoClose : false onVisibleChanged: { _root.isOpen = visible @@ -78,56 +77,33 @@ function cancel() { _root.isOpen = false _powerOffDialog.close() - if ( vConfirm.needConfirm ) vConfirm.doConfirm( false ) + vConfirm.doConfirm( false ) } - function reject() { // the power off is the only confirm has separate reject dialog, because the button is not only on UI and is HW as well. - _autoHideInfo.showDialog( - qsTr("Cannot shutdown during 'Treatment'"), // '%1').arg() + Connections { target: vConfirm + function onIsRejectTriggered ( vValue ) { + if ( vValue && ! _powerOffDialog.visible ) { + _autoHideInfo.showDialog( + vConfirm.adjustment_ReasonText, 2000 // notifies user and hides the dialog ) - } - - // ---- 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: vConfirm - function onIsRejectChanged ( vValue ) { - _powerOffDialog.footerUpdate() - if ( vValue ) _root.reject() + } } - function onVisibleChanged ( vValue ) { - if ( vValue ) open () - else close () + function onVisibleTriggered ( vValue ) { + print(vValue) + print("vConfirm.isReject " + vConfirm.isReject) + if ( vConfirm.isReject ) return + + if ( vValue ) open () + else close () } - function onPowerOffTriggered ( vValue ) { + 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. - ) + 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' + - // 'id : ' + vConfirm.id + '\n' + - // 'command : ' + vConfirm.command + '\n' + - // 'title : ' + vConfirm.title + '\n' + - // 'message : ' + vConfirm.message + '\n' + - // 'adjustment_ReasonText : ' + vConfirm.adjustment_ReasonText - // ) - } } } Index: sources/gui/qml/dialogs/AutoHideInfo.qml =================================================================== diff -u -r213b9fed4fc569eb85a0647bde9869a3c82c0db3 -re255d4633b338f4f46c3a2fad5a62f982ebfcd18 --- sources/gui/qml/dialogs/AutoHideInfo.qml (.../AutoHideInfo.qml) (revision 213b9fed4fc569eb85a0647bde9869a3c82c0db3) +++ sources/gui/qml/dialogs/AutoHideInfo.qml (.../AutoHideInfo.qml) (revision e255d4633b338f4f46c3a2fad5a62f982ebfcd18) @@ -38,11 +38,12 @@ autoHide : true TitleText { id: _titleText - anchors.centerIn: parent + anchors.centerIn : parent anchors.verticalCenterOffset: _root.verticalOffset - width: parent.width - text: message - font.pixelSize: _root.fontSize + width : parent.width + text : message + font.pixelSize : _root.fontSize + wrapMode : Text.Wrap } function showDialog(vMessage, vDuration) { Index: sources/gui/qml/main.qml =================================================================== diff -u -r213b9fed4fc569eb85a0647bde9869a3c82c0db3 -re255d4633b338f4f46c3a2fad5a62f982ebfcd18 --- sources/gui/qml/main.qml (.../main.qml) (revision 213b9fed4fc569eb85a0647bde9869a3c82c0db3) +++ sources/gui/qml/main.qml (.../main.qml) (revision e255d4633b338f4f46c3a2fad5a62f982ebfcd18) @@ -431,6 +431,7 @@ TreatmentAdjustmentVitals { id: _treatmentAdjustmentVitals } EndTreatmentDialog { id: _endTreatmentDialog } RinsebackCompleteDialog { id: _rinsebackCompleteDialog } + AutoHideInfo { id: _autoHideInfo } LockDialog { id: _lockDialog } AlarmItem { id: _alarmItem ; z: 996 } Index: sources/view/confirm/VConfirm.cpp =================================================================== diff -u -r5ed84841f5852381b2e36328c0aeca7bc97b9c03 -re255d4633b338f4f46c3a2fad5a62f982ebfcd18 --- sources/view/confirm/VConfirm.cpp (.../VConfirm.cpp) (revision 5ed84841f5852381b2e36328c0aeca7bc97b9c03) +++ sources/view/confirm/VConfirm.cpp (.../VConfirm.cpp) (revision e255d4633b338f4f46c3a2fad5a62f982ebfcd18) @@ -40,7 +40,7 @@ command ( vData.mCommand ); GuiConfirmCommand cmd = static_cast( _command ); - visible( ( cmd == GuiConfirmCommand::GENERIC_CONFIRM_CMD_REQUEST_OPEN || cmd == GuiConfirmCommand::GENERIC_CONFIRM_CMD_REJECT ) ); +// visible( ( cmd == GuiConfirmCommand::GENERIC_CONFIRM_CMD_REQUEST_OPEN ) ); switch ( cmd ) { case GuiConfirmCommand::GENERIC_CONFIRM_CMD_REQUEST_OPEN : @@ -49,31 +49,34 @@ isTimeout ( false ); isReject ( false ); isAccept ( false ); - break; + visible ( true ); + break; case GuiConfirmCommand::GENERIC_CONFIRM_CMD_TIMEOUT_CLOSE : adjustment_Reason ( GuiConfirmId::GENERIC_CONFIRM_ID_NONE ); // there is no need to display the timeout reason and just hides the dialog. adjustment_Accepted ( false ); isTimeout ( true ); isReject ( false ); isAccept ( false ); - break; + visible ( false ); + break; case GuiConfirmCommand::GENERIC_CONFIRM_CMD_REJECT : adjustment_Reason ( vData.mReason ); // there is no need to display the timeout reason and just hides the dialog. adjustment_Accepted ( false ); isTimeout ( false ); isReject ( true ); isAccept ( false ); - break; + visible ( false ); + break; case GuiConfirmCommand::GENERIC_CONFIRM_CMD_ACCEPT_CLOSE : adjustment_Reason ( GuiConfirmId::GENERIC_CONFIRM_ID_NONE ); // there is no need to display the timeout reason and just hides the dialog. adjustment_Accepted ( true ); isTimeout ( false ); isReject ( false ); isAccept ( true ); - break; + visible ( false ); + break; case GuiConfirmCommand::NUM_OF_GENERIC_CONFIRM_COMMAND : /* No code */ break; } - needConfirm ( cmd == GuiConfirmCommand::GENERIC_CONFIRM_CMD_REQUEST_OPEN ); } /*! @@ -121,7 +124,6 @@ * \details the invocable slot to send user's Confirmation */ void View::VConfirm::doConfirm(bool vConfirm) { - needConfirm ( false ); DuetConfirmUIrData data; data.mId = id(); data.mConfirm = vConfirm; Index: sources/view/confirm/VConfirm.h =================================================================== diff -u -r5ed84841f5852381b2e36328c0aeca7bc97b9c03 -re255d4633b338f4f46c3a2fad5a62f982ebfcd18 --- sources/view/confirm/VConfirm.h (.../VConfirm.h) (revision 5ed84841f5852381b2e36328c0aeca7bc97b9c03) +++ sources/view/confirm/VConfirm.h (.../VConfirm.h) (revision e255d4633b338f4f46c3a2fad5a62f982ebfcd18) @@ -51,8 +51,6 @@ const int dryDemoID = 99; // ********** DYNAMIC PROPERTIES: The properties which need to be updated by each confirm message received. ********** // - READONLY( bool , needConfirm , false) - // 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) @@ -62,7 +60,7 @@ PROPERTY(quint32 , command , 0) PROPERTY(bool , isTimeout , 0) - PROPERTY(bool , isReject , 0) + TRIGGER (bool , isReject , 0) PROPERTY(bool , isAccept , 0) TRIGGER (bool , visible , 0)