Index: sources/gui/qml/main.qml =================================================================== diff -u -r95c671ab7037af055db551456a719ff67bf10262 -rd4b88173e0d4a683a315d2fc57b8e1ec356b1232 --- sources/gui/qml/main.qml (.../main.qml) (revision 95c671ab7037af055db551456a719ff67bf10262) +++ sources/gui/qml/main.qml (.../main.qml) (revision d4b88173e0d4a683a315d2fc57b8e1ec356b1232) @@ -166,11 +166,40 @@ NotificationBar { id: _alarm + // TODO: Maybe add semi-transparent speaker icon inside the notification bar to toggle alarm + // OR, Create a dialog that has the OK button and dismiss button with + // metadata of the alarm that can be viewed when tapping on the notification bar + // TODO: Also need to create UX diagram flow and put it in the SRS, talk to Nick and Blaine for approval + // The highest priority alarm will unsilence itself automatically every minute. FW controls audio output + // When the highest priority alarm unsilences itself, the dialog should show again. The dialog may need to + // be implemented or a base dialog qml object should be used. + // The alarm should be controllable from the Dialog or the notification bar or both. (Settings page, too?) + anchors.bottom: _mainMenu.top level : vAlarmStatus.alarm_Priority - text : vAlarmStatus.text + text : vAlarmStatus.text; + + MouseArea { + id: _TouchArea + anchors.fill: parent; + onClicked: { + notification.visible = true; + notification.titleText = "Alarm"; + notification.description = vAlarmStatus.text; + [notification.backgroundColor, notification.textColor] = getRootTextFromAlarmLevel(vAlarmStatus.alarm_Priority); + _alarm.visible = false; + notification.dismissBtn.callback = (function() {vAlarmStatus.dismissAlarm();}); + notification.okayBtn.callback = (function() {vAlarmStatus.okayAlarm();}); + } + } } + NotificationDialog { id: notification + onClosed: { + _alarm.visible = true; + } + } + // 9 - Others Text { // TEST : Application version should be moved into the information screen later. color: Colors.textMain @@ -186,4 +215,29 @@ text: Qt.application.version font.pixelSize: 14 } + + function getRootTextFromAlarmLevel(level) { + let root_color = ""; + let text_color = ""; + switch (level) { + case GuiActions.ALARM_PRIORITY_HIGH: + root_color = Colors.textNotificationHighBg; + text_color = Colors.textNotificationHighFg; + break; + case GuiActions.ALARM_PRIORITY_MEDIUM: + root_color = Colors.textNotificationMedBg; + text_color = Colors.textNotificationMedFg; + break; + case GuiActions.ALARM_PRIORITY_LOW: + root_color = Colors.textNotificationLowBg; + text_color = Colors.textNotificationLowFg; + break; + default : // GuiActions.ALARM_PRIORITY_NONE + root_color = Colors.textNotificationNoneBg; + text_color = Colors.textNotificationNoneFg; + + } + return [root_color, text_color]; + + } }