Index: sources/gui/qml/AlarmItem.qml =================================================================== diff -u -r7a1509a80fed2dd51aa28b460acbf0227d0c96d7 -r13e65c3d271d503c2e2e2f1f20736652c470f8cc --- sources/gui/qml/AlarmItem.qml (.../AlarmItem.qml) (revision 7a1509a80fed2dd51aa28b460acbf0227d0c96d7) +++ sources/gui/qml/AlarmItem.qml (.../AlarmItem.qml) (revision 13e65c3d271d503c2e2e2f1f20736652c470f8cc) @@ -1,15 +1,15 @@ /*! * - * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * Copyright (c) 2021-2022 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 AlarmItem.qml * \author (last) Behrouz NematiPour - * \date (last) 28-Feb-2021 + * \date (last) 18-Mar-2022 * \author (original) Behrouz NematiPour - * \date (original) 28-Feb-2021 + * \date (original) 01-Mar-2021 * */ @@ -31,6 +31,9 @@ * This item needs to work with the NotificationBar component. */ Item { id : _root + + readonly property bool _DEBUG_DISABLE_MAXIMIZE_: false // due to touch screen issue on some devices, the maximized alarm can't be minimized to see the screen underneath. + anchors.fill: parent VAlarmStatus { id: vAlarmStatus } @@ -41,21 +44,37 @@ readonly property alias text : vAlarmStatus.text readonly property alias isSilenced : vAlarmStatus.alarm_Flag_alarmsSilenced readonly property alias timeout : vAlarmStatus.alarm_MuteTimeout + readonly property alias alarm_AlarmID : vAlarmStatus.alarm_AlarmID function clearAlarm() { vAlarmStatus.doClearCondition() } // Alarms dialog/bar navigation handling ----- vvvvv ----- function alarmMinimize() { + // The has alarm check has been added here to let other components call this function, + // without worrying about the alarmDialog popoing up without an alarm present. + // Look at the PowerItem as an example. + if ( ! vAlarmStatus.hasAlarm ) return + + _alarmDialog .visible = false _alarmListDialog.visible = false _alarmBar .visible = true } function alarmMaximize() { - _alarmDialog .visible = true - _alarmListDialog.visible = false - _alarmBar .visible = false + // The has alarm check has been added here to let other components call this function, + // without worrying about the alarmDialog popoing up without an alarm present. + // Look at the PowerItem as an example. + if ( ! vAlarmStatus.hasAlarm ) return + + if ( _root._DEBUG_DISABLE_MAXIMIZE_ ) { + alarmMinimize() + } else { + _alarmDialog .visible = true + _alarmListDialog.visible = false + _alarmBar .visible = false + } } function alarmList() { vAlarmActiveList.doRequest() @@ -109,6 +128,8 @@ endVisible : ! vAlarmStatus.alarm_Flag_noEndTreatment minVisible : ! vAlarmStatus.alarm_Flag_noMinimize titleFading : vHDOperationMode.fault + countDown : vTreatmentStop.countDown + countDownVisible : vHDOperationMode.inTreatment && vHDTreatmentStates.txStop && vTreatmentStop.total onMuteClicked : vAlarmStatus.doSilence () onResumeClicked : vAlarmStatus.doUserActionResume ()