Index: denali.qrc =================================================================== diff -u -rd4b88173e0d4a683a315d2fc57b8e1ec356b1232 -r255df1f61af0193b8f2f9630bdf3ce68be0f5e29 --- denali.qrc (.../denali.qrc) (revision d4b88173e0d4a683a315d2fc57b8e1ec356b1232) +++ denali.qrc (.../denali.qrc) (revision 255df1f61af0193b8f2f9630bdf3ce68be0f5e29) @@ -3,12 +3,13 @@ sources/gui/qml/pages/ManagerStack.qml sources/gui/qml/pages/SettingsStack.qml sources/gui/qml/pages/SettingsHome.qml + sources/gui/qml/pages/Diagnostics.qml sources/gui/qml/pages/ManagerHome.qml sources/gui/qml/dialogs/PowerOff.qml sources/gui/qml/dialogs/AutoHideInfo.qml - sources/gui/qml/dialogs/NotificationDialog.qml + sources/gui/qml/dialogs/Alarm.qml resources/images/Settings_gear_setting_tools-128.png @@ -33,6 +34,7 @@ sources/gui/qml/components/USBButton.qml sources/gui/qml/components/ExportButton.qml sources/gui/qml/components/TouchArea.qml + sources/gui/qml/components/SettingsItem.qml sources/gui/qml/components/TextRect.qml sources/gui/qml/components/Background.qml sources/gui/qml/components/Line.qml Index: resources/images/alarm.svg =================================================================== diff -u -r19ad29b1c0f0e9570be6af468ca9787d68ddfc76 -r255df1f61af0193b8f2f9630bdf3ce68be0f5e29 --- resources/images/alarm.svg (.../alarm.svg) (revision 19ad29b1c0f0e9570be6af468ca9787d68ddfc76) +++ resources/images/alarm.svg (.../alarm.svg) (revision 255df1f61af0193b8f2f9630bdf3ce68be0f5e29) @@ -1 +1,3 @@ - \ No newline at end of file + + + Index: sources/applicationcontroller.cpp =================================================================== diff -u -r5c5fa01738826261e0b3647db6b7b3fc26b04251 -r255df1f61af0193b8f2f9630bdf3ce68be0f5e29 --- sources/applicationcontroller.cpp (.../applicationcontroller.cpp) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) +++ sources/applicationcontroller.cpp (.../applicationcontroller.cpp) (revision 255df1f61af0193b8f2f9630bdf3ce68be0f5e29) @@ -16,13 +16,6 @@ // Qt // Project -#include "guiglobals.h" -#include "maintimer.h" -#include "guicontroller.h" -#include "messagedispatcher.h" -#include "logger.h" -#include "usbwatcher.h" -#include "filehandler.h" /*! * \brief ApplicationController::ApplicationController @@ -98,6 +91,9 @@ connect(&_MessageDispatcher, SIGNAL(didActionReceive(GuiActionType, const QVariantList &)), this , SLOT( onActionReceive(GuiActionType, const QVariantList &))); + connect(&_MessageDispatcher, SIGNAL(didFailedTransmit(Sequence)), + this , SLOT(onFailedTransmit(Sequence))); + connect(&_GuiController , SIGNAL(didUSBDriveUmount()), this , SLOT( onUSBDriveUmount())); connect(&_USBWatcher , SIGNAL(didUSBDriveMount ()), @@ -156,6 +152,16 @@ // coco end /*! + * \brief ApplicationController::onFailedTransmit + * Called when we failed to get a response back from the HD + * \param seq - The sequence that failed to send to the HD. + */ +void ApplicationController::onFailedTransmit(Sequence seq) +{ + emit didFailedTransmit(seq); +} + +/*! * \brief Process the requested action * \details Processes the requested action * \param vAction - User requested Action Index: sources/applicationcontroller.h =================================================================== diff -u -r5c5fa01738826261e0b3647db6b7b3fc26b04251 -r255df1f61af0193b8f2f9630bdf3ce68be0f5e29 --- sources/applicationcontroller.h (.../applicationcontroller.h) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) +++ sources/applicationcontroller.h (.../applicationcontroller.h) (revision 255df1f61af0193b8f2f9630bdf3ce68be0f5e29) @@ -21,7 +21,14 @@ #include "guiglobals.h" #include "applicationpost.h" #include "mmodel.h" +#include "maintimer.h" +#include "guicontroller.h" +#include "messagedispatcher.h" +#include "logger.h" +#include "usbwatcher.h" +#include "filehandler.h" + // define #define _ApplicationController ApplicationController::I() @@ -30,6 +37,7 @@ // namespace using namespace Gui; +using namespace Can; class ApplicationController : public QObject @@ -80,6 +88,7 @@ void onAdjustBloodDialysateFlows(quint32 vBloodFlow, quint32 vDialysateFlow); void onAdjustDuration (quint32 vDuration); + void onFailedTransmit(Sequence seq); ACTION_RECEIVE_MODEL_BRIDGE_DEFINITIONS @@ -95,5 +104,7 @@ void didAdjustBloodDialysateFlows(quint32 vBloodFlow, quint32 vDialysateFlow); void didAdjustDuration(quint32 vDuration); + void didFailedTransmit(Sequence seq); + }; Index: sources/canbus/messagedispatcher.cpp =================================================================== diff -u -rb798668f16ad0967ab97e96f5f9a2cdd821e899f -r255df1f61af0193b8f2f9630bdf3ce68be0f5e29 --- sources/canbus/messagedispatcher.cpp (.../messagedispatcher.cpp) (revision b798668f16ad0967ab97e96f5f9a2cdd821e899f) +++ sources/canbus/messagedispatcher.cpp (.../messagedispatcher.cpp) (revision 255df1f61af0193b8f2f9630bdf3ce68be0f5e29) @@ -101,8 +101,7 @@ this , SLOT( onFramesTransmit(Can_Id, Sequence, const FrameList &))); connect(&_MessageAcknowModel , SIGNAL(didFailedTransmit( Sequence )), - this , SLOT( onFailedTransmit( Sequence ))); - + this , SLOT(onFailedTransmit( Sequence ))); // From HD -> Message interpreter ACTION_RECEIVE_INTERPRETER_CONNECTIONS } @@ -196,9 +195,7 @@ void MessageDispatcher::onFailedTransmit(Sequence vSequence) { // coco begin validated: Is a placeholder and has not beed implemented yet - Q_UNUSED(vSequence) - // may requires showing an alarm screen - // but we don't know yet. + emit didFailedTransmit(vSequence); } // coco end Index: sources/canbus/messagedispatcher.h =================================================================== diff -u -rb798668f16ad0967ab97e96f5f9a2cdd821e899f -r255df1f61af0193b8f2f9630bdf3ce68be0f5e29 --- sources/canbus/messagedispatcher.h (.../messagedispatcher.h) (revision b798668f16ad0967ab97e96f5f9a2cdd821e899f) +++ sources/canbus/messagedispatcher.h (.../messagedispatcher.h) (revision 255df1f61af0193b8f2f9630bdf3ce68be0f5e29) @@ -104,6 +104,8 @@ QList _needsAcknow { GuiActionType::AdjustBloodDialysateReq , GuiActionType::AdjustDurationReq , + GuiActionType::AlarmSilenceReq , + GuiActionType::KeepAlive }; // no action needs Acknow for now // Singleton @@ -180,6 +182,13 @@ */ void didFrameTransmit (Can_Id vCan_Id, const QByteArray &vPayload); + /*! + * \brief didFailedTransmit + * \details When a message fails to transmit to the HD, emit this signal. + * \param vSequence - The message Sequence we that failed to send. + */ + void didFailedTransmit(Sequence vSequence); + private slots: // A Frame has been received from CanInterface void onFrameReceive (Can_Id vCan_Id, const QByteArray &vPayload); Index: sources/canbus/messageglobals.h =================================================================== diff -u -r6d62bbaca6363f7ff83715f78607cb60a4736771 -r255df1f61af0193b8f2f9630bdf3ce68be0f5e29 --- sources/canbus/messageglobals.h (.../messageglobals.h) (revision 6d62bbaca6363f7ff83715f78607cb60a4736771) +++ sources/canbus/messageglobals.h (.../messageglobals.h) (revision 255df1f61af0193b8f2f9630bdf3ce68be0f5e29) @@ -51,7 +51,8 @@ {Gui::GuiActionType::DialysateOutletFlow , 7 * 4 }, // 7 parameters each 4bytes {Gui::GuiActionType::TreatmentTime , 3 * 4 }, // 3 parameters each 4bytes {Gui::GuiActionType::PressureOcclusion , 5 * 4 }, // 5 parameters each 4bytes - {Gui::GuiActionType::AlarmSilence , 5 * 4 }, // 5 parameters each 4bytes + {Gui::GuiActionType::AlarmSilenceReq , 5 * 4 }, // 5 parameters each 4bytes + {Gui::GuiActionType::AlarmSilenceRsp , 5 * 4 }, // 5 parameters each 4bytes // ---- {Gui::GuiActionType::AlarmStatus , 4 * 4 + 2 }, // 4 parameters each 4bytes + 1 parameter 2bytes Index: sources/canbus/messageinterpreter.cpp =================================================================== diff -u -r6d62bbaca6363f7ff83715f78607cb60a4736771 -r255df1f61af0193b8f2f9630bdf3ce68be0f5e29 --- sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision 6d62bbaca6363f7ff83715f78607cb60a4736771) +++ sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision 255df1f61af0193b8f2f9630bdf3ce68be0f5e29) @@ -105,7 +105,7 @@ vPayload = Format::fromVariant(vData); } break; - case Gui::GuiActionType::AlarmSilence: + case Gui::GuiActionType::AlarmSilenceReq: if (count) { vPayload = Format::fromVariant(vData); } @@ -254,6 +254,10 @@ printUnhandled (vMessage); ok = true; break; + case Gui::GuiActionType::AlarmSilenceRsp: + printUnhandled (vMessage); + ok = true; + break; case Gui::GuiActionType::TreatmentState: printUnhandled (vMessage); Index: sources/gui/guicontroller.cpp =================================================================== diff -u -r5c5fa01738826261e0b3647db6b7b3fc26b04251 -r255df1f61af0193b8f2f9630bdf3ce68be0f5e29 --- sources/gui/guicontroller.cpp (.../guicontroller.cpp) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) +++ sources/gui/guicontroller.cpp (.../guicontroller.cpp) (revision 255df1f61af0193b8f2f9630bdf3ce68be0f5e29) @@ -81,6 +81,9 @@ connect(&_ApplicationController, SIGNAL(didExport()), this , SLOT( onExport())); + connect(&_ApplicationController, SIGNAL(didFailedTransmit(Sequence)), + this , SLOT(didFailedTransmit(Sequence))); + ACTION_RECEIVE_MODEL_BRIDGE_CONNECTIONS(_ApplicationController) } @@ -286,3 +289,20 @@ { emit didAdjustDuration(vDuration); } + +/*! + * \brief GuiController::didFailedTransmit + * Raises an HD communiation timeout alarm if communication with HD is lost. + * \param seq - Sequence that failed to transmit + */ +void GuiController::didFailedTransmit(Sequence seq) +{ + Q_UNUSED(seq); + AlarmStatusData data; + data.mState = GuiAlarmPriority::ALARM_PRIORITY_HIGH; // Alarm priority + data.mTop = GuiAlarmID::ALARM_ID_HD_COMM_TIMEOUT; // Alarm ID + data.mMuteTimeout = 0; // Alarm timeout + data.mEscalatesIn = 0; // Alarm Escalate Time Period + data.mFlags = QBitArray(16, false); // 16 QBitArray of flags, if needed + emit didActionReceive(data); +} Index: sources/gui/guicontroller.h =================================================================== diff -u -r5c5fa01738826261e0b3647db6b7b3fc26b04251 -r255df1f61af0193b8f2f9630bdf3ce68be0f5e29 --- sources/gui/guicontroller.h (.../guicontroller.h) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) +++ sources/gui/guicontroller.h (.../guicontroller.h) (revision 255df1f61af0193b8f2f9630bdf3ce68be0f5e29) @@ -20,10 +20,13 @@ #include "main.h" #include "guiglobals.h" #include "mmodel.h" +#include "messageglobals.h" // define #define _GuiController GuiController::I() +using namespace Can; + // namespace namespace Gui { @@ -66,7 +69,9 @@ void onUSBDriveRemove(); // OS => UI void onExport (); // OS => UI + void didFailedTransmit(Sequence seq); + ACTION_RECEIVE_MODEL_BRIDGE_DEFINITIONS signals: Index: sources/gui/guiglobals.h =================================================================== diff -u -r6d62bbaca6363f7ff83715f78607cb60a4736771 -r255df1f61af0193b8f2f9630bdf3ce68be0f5e29 --- sources/gui/guiglobals.h (.../guiglobals.h) (revision 6d62bbaca6363f7ff83715f78607cb60a4736771) +++ sources/gui/guiglobals.h (.../guiglobals.h) (revision 255df1f61af0193b8f2f9630bdf3ce68be0f5e29) @@ -52,7 +52,8 @@ AlarmStatus = 0x0200, AlarmTriggered = 0x0300, AlarmCleared = 0x0400, - AlarmSilence = 0x0500, + AlarmSilenceReq = 0x2F00, // 47 + AlarmSilenceRsp = 0x3000, // 48 PressureOcclusion = 0x0900, Index: sources/gui/guiview.h =================================================================== diff -u -r5c5fa01738826261e0b3647db6b7b3fc26b04251 -r255df1f61af0193b8f2f9630bdf3ce68be0f5e29 --- sources/gui/guiview.h (.../guiview.h) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) +++ sources/gui/guiview.h (.../guiview.h) (revision 255df1f61af0193b8f2f9630bdf3ce68be0f5e29) @@ -18,7 +18,10 @@ // Project #include "guiglobals.h" +#include "messageglobals.h" +using namespace Can; + // define // ... Index: sources/gui/qml/components/NotificationBar.qml =================================================================== diff -u -r6d62bbaca6363f7ff83715f78607cb60a4736771 -r255df1f61af0193b8f2f9630bdf3ce68be0f5e29 --- sources/gui/qml/components/NotificationBar.qml (.../NotificationBar.qml) (revision 6d62bbaca6363f7ff83715f78607cb60a4736771) +++ sources/gui/qml/components/NotificationBar.qml (.../NotificationBar.qml) (revision 255df1f61af0193b8f2f9630bdf3ce68be0f5e29) @@ -14,6 +14,7 @@ // Qt import QtQuick 2.12 +import QtGraphicalEffects 1.12 // Project import Gui.Actions 0.1 @@ -22,9 +23,11 @@ Rectangle { id: _root objectName: "NotificationBar" - property alias text : _text.text; - property alias textColor : _text.color; - property int level : 0; + property alias text : _text.text; + property alias textColor : _text.color; + property int level : 0; + property bool isSilenced : false; + property color backgroundColor : Colors.textNotificationNoneBg; visible : _text.text @@ -37,9 +40,28 @@ right : parent.right } + Image { + id: _icon + source: "qrc:/images/alarm.svg" + anchors.right: _text.left + anchors.rightMargin: Variables.notificationBarIconMargin; + anchors.verticalCenter: parent.verticalCenter; + sourceSize.height: Variables.notificationBarIconHeight; + sourceSize.width: Variables.notificationBarIconWidth; + } + + ColorOverlay { + id: _icon_overlay + anchors.fill: _icon; + source: _icon; + color: _root.backgroundColor; + cached: true; + antialiasing: true; + } + Text { id: _text color : Colors.textNotificationNoneFg - anchors.fill : parent + anchors.centerIn : parent font.pixelSize : Fonts.fontPixelNotification horizontalAlignment : Text.AlignHCenter verticalAlignment : Text.AlignVCenter Index: sources/gui/qml/components/SettingsItem.qml =================================================================== diff -u --- sources/gui/qml/components/SettingsItem.qml (revision 0) +++ sources/gui/qml/components/SettingsItem.qml (revision 255df1f61af0193b8f2f9630bdf3ce68be0f5e29) @@ -0,0 +1,72 @@ +/*! + * + * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * \copyright \n + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n + * IN PART OR IN WHOLE, \n + * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n + * + * \file TouchArea.qml + * \date 2019/01/09 + * \author Behrouz NematiPour + * + */ + +// Qt +import QtQuick 2.12 + +// Project +// Qml imports +import "qrc:/globals" + +/*! + * \brief The TouchArea Component + * which is used as a touchable component(s) container + * with a title at the top + * if set to be touchable will show an arrow right side of the title + * next to the right edge of the component. + */ +Rectangle { id : _root + signal clicked(); + property alias title : _titleText.text; + color: "transparent" + border.color: "transparent"; + width: 550 + height: 50 + + MouseArea { + anchors.fill: parent; + + Text { id: _titleText + anchors.left: parent.left; + anchors.verticalCenter: parent.verticalCenter + text: "Settings Option 1" + color: Colors.textButton + font.pixelSize: Fonts.fontPixelButton + + } + + Image { id: _arrowImage + visible: true + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + width : Variables.largeArrowWidth + height: Variables.largeArrowHeight + source: "qrc:/images/iArrow" + } + + Line { + width: parent.width + color: "gray" + anchors.left: parent.left; + anchors.bottom: parent.bottom; + } + + onClicked: { + console.debug("Clicked " + _titleText.text); + _root.clicked(); + } + + } + +} Index: sources/gui/qml/dialogs/Alarm.qml =================================================================== diff -u --- sources/gui/qml/dialogs/Alarm.qml (revision 0) +++ sources/gui/qml/dialogs/Alarm.qml (revision 255df1f61af0193b8f2f9630bdf3ce68be0f5e29) @@ -0,0 +1,114 @@ +/*! + * + * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * \copyright \n + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n + * IN PART OR IN WHOLE, \n + * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n + * + * \file Notification.qml + * \date 2020/06/01 + * \author Peter Lucia + * + */ + +// Qt +import QtQuick 2.12 +import QtGraphicalEffects 1.12 + +// Project +// Qml imports +import "qrc:/globals" +import "qrc:/components" + +/*! + * \brief Contains the PowerOff Dialog Implementation + */ +ModalDialog { id : _root + property alias titleText : _title.text; + property alias description : _desc.text; + property alias titleBarForeground : _title.color + property alias titleBarBackground : _titleBar.color; + property alias okayBtn : _okay; + property alias dismissBtn : _dismiss; + property bool isSilenced : false; + + radius: 0; + Rectangle { + id: _titleBar; + color: Colors.alarmTopBarHighBg; + height: _root.height / 4; + width: _root.width; + radius: _root.radius; + + Image { + id: _icon + source: "qrc:/images/alarm.svg" + anchors.horizontalCenter: _title.horizontalCenter + anchors.verticalCenter: _title.verticalCenter; + anchors.horizontalCenterOffset: -_title.width + Variables.dialogSVGIconOffset; + sourceSize.height: Variables.dialogSVGHeight; + sourceSize.width: Variables.dialogSVGWidth; + } + + ColorOverlay { + id: _icon_overlay + anchors.fill: _icon; + source: _icon; + color: _root.backgroundColor; + cached: true; + antialiasing: true; + } + + Text { id: _title + color: Colors.textMain + font.pixelSize: Fonts.fontPixelTitle + text: qsTr("Notification") + anchors.centerIn: _titleBar; + } + } + Text { + id: _desc + color: Colors.textMain + font.pixelSize: Fonts.fontPixelButton + anchors { + horizontalCenter: parent.horizontalCenter; + verticalCenter: parent.verticalCenter; + } + } + + Row { + id: _buttons + spacing: Variables.buttonSpacing; + anchors { + horizontalCenter: parent.horizontalCenter; + bottom: parent.bottom; + bottomMargin: Variables.dialogMargin / 2; + } + + TouchRect { id : _okay + width: _root.width / 3; + text.text: qsTr("OKAY") + borderColor: _root.textColor; + property var callback: (function() { + console.debug("Default okay button callback...override needed..."); + }); + button.onPressed: { + _root.visible = false; + callback(); + } + } + TouchRect { id : _dismiss + width: _root.width / 3; + text.text: qsTr("SILENCE") + borderColor: _root.textColor; + property var callback: (function() { + console.debug("Default silence button callback...override needed..."); + }); + button.onPressed: { + _root.visible = false; + callback(); + } + } + } +} Fisheye: Tag 255df1f61af0193b8f2f9630bdf3ce68be0f5e29 refers to a dead (removed) revision in file `sources/gui/qml/dialogs/NotificationDialog.qml'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/gui/qml/globals/Colors.qml =================================================================== diff -u -r6d62bbaca6363f7ff83715f78607cb60a4736771 -r255df1f61af0193b8f2f9630bdf3ce68be0f5e29 --- sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision 6d62bbaca6363f7ff83715f78607cb60a4736771) +++ sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision 255df1f61af0193b8f2f9630bdf3ce68be0f5e29) @@ -69,10 +69,10 @@ readonly property color textNotificationNoneBg : "transparent" readonly property color textNotificationNoneFg : "#1b2b3e" - readonly property color textNotificationLowBg : "green" // ? + readonly property color textNotificationLowBg : "#f5a623" // ? readonly property color textNotificationLowFg : "white" // ? - readonly property color textNotificationMedBg : "orange" // ? + readonly property color textNotificationMedBg : "#f5a623" // ? readonly property color textNotificationMedFg : "white" // ? readonly property color textNotificationHighBg : "#c53b33" // red @@ -84,7 +84,7 @@ readonly property color alarmTopBarMedBg : "#db8f00" readonly property color alarmTopBarMedFg : "white" - readonly property color alarmTopBarLowBg : "#004700" + readonly property color alarmTopBarLowBg : "#db8f00" readonly property color alarmTopBarLowFg : "white" } Index: sources/gui/qml/globals/Variables.qml =================================================================== diff -u -rd4b88173e0d4a683a315d2fc57b8e1ec356b1232 -r255df1f61af0193b8f2f9630bdf3ce68be0f5e29 --- sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision d4b88173e0d4a683a315d2fc57b8e1ec356b1232) +++ sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision 255df1f61af0193b8f2f9630bdf3ce68be0f5e29) @@ -35,6 +35,9 @@ readonly property int logoWidth : 50 readonly property int logoHeight : 50 + readonly property int largeArrowWidth : 24 + readonly property int largeArrowHeight : 32 + readonly property int arrowWidth : 12 readonly property int arrowHeight : 16 @@ -77,4 +80,10 @@ readonly property int durationResolution : 15 // PRS346 + readonly property int notificationBarIconMargin : 10 + readonly property int notificationBarIconHeight : 30 + readonly property int notificationBarIconWidth : 30 + + + } Index: sources/gui/qml/main.qml =================================================================== diff -u -r6d62bbaca6363f7ff83715f78607cb60a4736771 -r255df1f61af0193b8f2f9630bdf3ce68be0f5e29 --- sources/gui/qml/main.qml (.../main.qml) (revision 6d62bbaca6363f7ff83715f78607cb60a4736771) +++ sources/gui/qml/main.qml (.../main.qml) (revision 255df1f61af0193b8f2f9630bdf3ce68be0f5e29) @@ -111,6 +111,8 @@ VAlarmStatus { id: vAlarmStatus onRaiseAlarm: { updateAlarm(); + _alarm.isSilenced = vAlarmStatus.alarm_Flag_alarmsSilenced + _notification.isSilenced = vAlarmStatus.alarm_Flag_alarmsSilenced if (vAlarmStatus.alarm_Priority === GuiActions.ALARM_PRIORITY_HIGH) { _notification.visible = true; @@ -120,7 +122,7 @@ _alarm.visible = true; } } - } + } onHideAlarm: { _alarm.visible = false; @@ -206,12 +208,14 @@ _notification.description = vAlarmStatus.text; [_notification.backgroundColor, _notification.textColor] = getRootTextFromAlarmLevel(vAlarmStatus.alarm_Priority); [_notification.titleBarBackground, _notification.titleBarForeground] = getAlarmTopBarColors(vAlarmStatus.alarm_Priority); - _notification.dismissBtn.callback = (function() {_GuiView.doActionTransmit(GuiActions.AlarmSilence, - [GuiActions.Request, 1, 2, 3, 4, 5])}); + _alarm.backgroundColor = _notification.titleBarBackground; + _notification.dismissBtn.callback = (function() { + vAlarmStatus.requestSilence(); + }); } - NotificationDialog { id: _notification + Alarm { id: _notification onClosed: { _alarm.visible = true; } Index: sources/gui/qml/pages/Diagnostics.qml =================================================================== diff -u --- sources/gui/qml/pages/Diagnostics.qml (revision 0) +++ sources/gui/qml/pages/Diagnostics.qml (revision 255df1f61af0193b8f2f9630bdf3ce68be0f5e29) @@ -0,0 +1,175 @@ +/*! + * + * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * \copyright \n + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n + * IN PART OR IN WHOLE, \n + * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n + * + * \file SettingsHome.qml + * \date 2019/10/21 + * \author Behrouz NematiPour + * + */ + +// Qt +import QtQuick 2.12 + +// Project +import Gui.Actions 0.1; + +// Qml imports +import "qrc:/globals" +import "qrc:/components" + +/*! + * \brief SettingsHome is the screen + * which is the default screen in the "Settings" stack + */ +ScreenItem { id: _root + + BackButton { id: _backButton + onClicked: { + pop(); + } + + } + + USBButton { id: _usbButton + anchors { + top : parent.top + right : _exportButton.left + topMargin : (Variables.headerHeight - Variables.logoHeight) / 2 + rightMargin : (Variables.headerHeight - Variables.logoHeight) / 2 + } + } + + ExportButton { id: _exportButton + width: 150 + height: 50 + anchors { + top : parent.top + right : _poweroffButton.left + topMargin : (Variables.headerHeight - Variables.logoHeight) / 2 + rightMargin : (Variables.headerHeight - Variables.logoHeight) / 2 + } + } + + TouchRect { id : _poweroffButton + width: 150 + height: Variables.logoHeight + animated: true + anchors { + top : parent.top + right : parent.right + topMargin : (Variables.headerHeight - Variables.logoHeight) / 2 + rightMargin : (Variables.headerHeight - Variables.logoHeight) / 2 + } + text.text: qsTr("Shutdown") + button.onPressed: { + _GuiView.doActionTransmit(GuiActions.PowerOff, GuiActions.NoData) + } + } + + Column { id: _BloodFlowColumn + width: 150 + spacing: 20 + topPadding: 100 + leftPadding: 10 + Text { + id: _BloodFlow_Title + text: qsTr(" Blood ") + width: _BloodFlowColumn.width + horizontalAlignment: Text.AlignHCenter + color: Colors.textMain + font.pixelSize: Fonts.fontPixelTitle + font.underline: true + } + Repeater { + model: [ + vTreatmentBloodFlow.bloodFlow_FlowSetPoint , + vTreatmentBloodFlow.bloodFlow_MeasuredFlow .toFixed(2) , + vTreatmentBloodFlow.bloodFlow_RotorSpeed .toFixed(2) , + vTreatmentBloodFlow.bloodFlow_MotorSpeed .toFixed(2) , + vTreatmentBloodFlow.bloodFlow_MotorCtlSpeed .toFixed(2) , + vTreatmentBloodFlow.bloodFlow_MotorCtlCurrent .toFixed(2) , + "%" + vTreatmentBloodFlow.bloodFlow_PWMDutyCycle .toFixed(2) + ] + Text { + text: modelData + width: _BloodFlowColumn.width + horizontalAlignment: Text.AlignRight + color: Colors.textMain + font.pixelSize: Fonts.fontPixelTitle + } + } + } + + Column { id: _DialysateInletFlowColumn + width: 150 + spacing: 20 + topPadding: 100 + leftPadding: 180 + Text { + id: _DialysateInletFlow_Title + text: qsTr(" Dialysate I ") + width: _DialysateInletFlowColumn.width + horizontalAlignment: Text.AlignLeft + color: Colors.textMain + font.pixelSize: Fonts.fontPixelTitle + font.underline: true + } + Repeater { + model: [ + vTreatmentDialysateFlow.dialysateFlow_FlowSetPoint .toFixed(2) , + vTreatmentDialysateFlow.dialysateFlow_MeasuredFlow .toFixed(2) , + vTreatmentDialysateFlow.dialysateFlow_RotorSpeed .toFixed(2) , + vTreatmentDialysateFlow.dialysateFlow_MotorSpeed .toFixed(2) , + vTreatmentDialysateFlow.dialysateFlow_MotorCtlSpeed .toFixed(2) , + vTreatmentDialysateFlow.dialysateFlow_MotorCtlCurrent.toFixed(2) , + "%" + vTreatmentDialysateFlow.dialysateFlow_PWMDutyCycle .toFixed(2) + ] + Text { + text: modelData + width: _DialysateInletFlowColumn.width + horizontalAlignment: Text.AlignRight + color: Colors.textMain + font.pixelSize: Fonts.fontPixelTitle + } + } + } + + Column { id: _DialysateOutletFlowColumn + width: 150 + spacing: 20 + topPadding: 100 + leftPadding: 400 + Text { + id: _DialysateOutletFlow_Title + text: qsTr(" Dialysate O ") + width: _DialysateOutletFlowColumn.width + horizontalAlignment: Text.AlignLeft + color: Colors.textMain + font.pixelSize: Fonts.fontPixelTitle + font.underline: true + } + Repeater { + model: [ + vTreatmentUltrafiltration.ultrafiltration_RefUFVol .toFixed(2) , + vTreatmentUltrafiltration.ultrafiltration_MeasUFVol .toFixed(2) , + vTreatmentUltrafiltration.ultrafiltration_RotorSpeed .toFixed(2) , + vTreatmentUltrafiltration.ultrafiltration_MotorSpeed .toFixed(2) , + vTreatmentUltrafiltration.ultrafiltration_MotorCtlSpeed .toFixed(2) , + vTreatmentUltrafiltration.ultrafiltration_MotorCtlCurrent.toFixed(2) , + "%" + vTreatmentUltrafiltration.ultrafiltration_PWMDtCycle .toFixed(2) + ] + Text { + text: modelData + width: _DialysateOutletFlowColumn.width + horizontalAlignment: Text.AlignRight + color: Colors.textMain + font.pixelSize: Fonts.fontPixelTitle + } + } + } +} Index: sources/gui/qml/pages/SettingsHome.qml =================================================================== diff -u -rf148379112a69d1c52027f2667e95f3f96d948ad -r255df1f61af0193b8f2f9630bdf3ce68be0f5e29 --- sources/gui/qml/pages/SettingsHome.qml (.../SettingsHome.qml) (revision f148379112a69d1c52027f2667e95f3f96d948ad) +++ sources/gui/qml/pages/SettingsHome.qml (.../SettingsHome.qml) (revision 255df1f61af0193b8f2f9630bdf3ce68be0f5e29) @@ -21,148 +21,37 @@ // Qml imports import "qrc:/globals" import "qrc:/components" +import "qrc:/pages/treatment/sections" /*! * \brief SettingsHome is the screen * which is the default screen in the "Settings" stack */ ScreenItem { id: _root - USBButton { id: _usbButton - anchors { - top : parent.top - right : _exportButton.left - topMargin : (Variables.headerHeight - Variables.logoHeight) / 2 - rightMargin : (Variables.headerHeight - Variables.logoHeight) / 2 - } - } + TitleText { id: _titleText + anchors.horizontalCenter: parent.horizontalCenter; + anchors.top: parent.top + anchors.topMargin: 150 - ExportButton { id: _exportButton - width: 150 - height: 50 - anchors { - top : parent.top - right : _poweroffButton.left - topMargin : (Variables.headerHeight - Variables.logoHeight) / 2 - rightMargin : (Variables.headerHeight - Variables.logoHeight) / 2 - } - } + width: parent.width + text: qsTr("Device Settings") - TouchRect { id : _poweroffButton - width: 150 - height: Variables.logoHeight - animated: true - anchors { - top : parent.top - right : parent.right - topMargin : (Variables.headerHeight - Variables.logoHeight) / 2 - rightMargin : (Variables.headerHeight - Variables.logoHeight) / 2 - } - text.text: qsTr("Shutdown") - button.onPressed: { - _GuiView.doActionTransmit(GuiActions.PowerOff, GuiActions.NoData) - } } - Column { id: _BloodFlowColumn - width: 150 - spacing: 20 - topPadding: 100 - leftPadding: 10 - Text { - id: _BloodFlow_Title - text: qsTr(" Blood ") - width: _BloodFlowColumn.width - horizontalAlignment: Text.AlignHCenter - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - font.underline: true - } - Repeater { - model: [ - vTreatmentBloodFlow.bloodFlow_FlowSetPoint , - vTreatmentBloodFlow.bloodFlow_MeasuredFlow .toFixed(2) , - vTreatmentBloodFlow.bloodFlow_RotorSpeed .toFixed(2) , - vTreatmentBloodFlow.bloodFlow_MotorSpeed .toFixed(2) , - vTreatmentBloodFlow.bloodFlow_MotorCtlSpeed .toFixed(2) , - vTreatmentBloodFlow.bloodFlow_MotorCtlCurrent .toFixed(2) , - "%" + vTreatmentBloodFlow.bloodFlow_PWMDutyCycle .toFixed(2) - ] - Text { - text: modelData - width: _BloodFlowColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - } - } - } + Diagnostics { id: _diagnostics } - Column { id: _DialysateInletFlowColumn - width: 150 - spacing: 20 - topPadding: 100 - leftPadding: 180 - Text { - id: _DialysateInletFlow_Title - text: qsTr(" Dialysate I ") - width: _DialysateInletFlowColumn.width - horizontalAlignment: Text.AlignLeft - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - font.underline: true - } - Repeater { - model: [ - vTreatmentDialysateFlow.dialysateFlow_FlowSetPoint .toFixed(2) , - vTreatmentDialysateFlow.dialysateFlow_MeasuredFlow .toFixed(2) , - vTreatmentDialysateFlow.dialysateFlow_RotorSpeed .toFixed(2) , - vTreatmentDialysateFlow.dialysateFlow_MotorSpeed .toFixed(2) , - vTreatmentDialysateFlow.dialysateFlow_MotorCtlSpeed .toFixed(2) , - vTreatmentDialysateFlow.dialysateFlow_MotorCtlCurrent.toFixed(2) , - "%" + vTreatmentDialysateFlow.dialysateFlow_PWMDutyCycle .toFixed(2) - ] - Text { - text: modelData - width: _DialysateInletFlowColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - } - } - } + Column { + anchors.centerIn: parent; - Column { id: _DialysateOutletFlowColumn - width: 150 - spacing: 20 - topPadding: 100 - leftPadding: 400 - Text { - id: _DialysateOutletFlow_Title - text: qsTr(" Dialysate O ") - width: _DialysateOutletFlowColumn.width - horizontalAlignment: Text.AlignLeft - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - font.underline: true - } - Repeater { - model: [ - vTreatmentUltrafiltration.ultrafiltration_RefUFVol .toFixed(2) , - vTreatmentUltrafiltration.ultrafiltration_MeasUFVol .toFixed(2) , - vTreatmentUltrafiltration.ultrafiltration_RotorSpeed .toFixed(2) , - vTreatmentUltrafiltration.ultrafiltration_MotorSpeed .toFixed(2) , - vTreatmentUltrafiltration.ultrafiltration_MotorCtlSpeed .toFixed(2) , - vTreatmentUltrafiltration.ultrafiltration_MotorCtlCurrent.toFixed(2) , - "%" + vTreatmentUltrafiltration.ultrafiltration_PWMDtCycle .toFixed(2) - ] - Text { - text: modelData - width: _DialysateOutletFlowColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle + // add each settings page here. + SettingsItem { title : qsTr("Sound") } + SettingsItem { title : qsTr("Diagnostics") + onClicked: { + push(_diagnostics); } } + + } } Index: sources/view/valarmstatus.cpp =================================================================== diff -u -r6d62bbaca6363f7ff83715f78607cb60a4736771 -r255df1f61af0193b8f2f9630bdf3ce68be0f5e29 --- sources/view/valarmstatus.cpp (.../valarmstatus.cpp) (revision 6d62bbaca6363f7ff83715f78607cb60a4736771) +++ sources/view/valarmstatus.cpp (.../valarmstatus.cpp) (revision 255df1f61af0193b8f2f9630bdf3ce68be0f5e29) @@ -44,6 +44,9 @@ } else { emit hideAlarm(); } + + connect(this, SIGNAL(requestActionTransmit(GuiActionType,QVariantList)), + &_GuiController, SLOT(doActionTransmit(GuiActionType,QVariantList))); } /*! @@ -103,3 +106,15 @@ { return QString("%0").arg(static_cast(alarm_AlarmID())); } + +/*! + * \brief VAlarmStatus::requestSilence + * Send out a request to silence alarms. + */ +void VAlarmStatus::requestSilence() +{ + // TODO: Update with needed data. Placeholder for now. + QVariantList messageData = {1,2,3,4,5}; + GuiActionType messageAction = GuiActions::AlarmSilenceReq; + emit requestActionTransmit(messageAction, messageData); +} Index: sources/view/valarmstatus.h =================================================================== diff -u -r6d62bbaca6363f7ff83715f78607cb60a4736771 -r255df1f61af0193b8f2f9630bdf3ce68be0f5e29 --- sources/view/valarmstatus.h (.../valarmstatus.h) (revision 6d62bbaca6363f7ff83715f78607cb60a4736771) +++ sources/view/valarmstatus.h (.../valarmstatus.h) (revision 255df1f61af0193b8f2f9630bdf3ce68be0f5e29) @@ -20,7 +20,9 @@ #include "mmodel.h" #include "vview.h" #include "guiglobals.h" +#include "messageglobals.h" +using namespace Can; // namespace using namespace Gui; namespace View { @@ -53,6 +55,7 @@ signals: void raiseAlarm(); void hideAlarm(); + void requestActionTransmit(GuiActionType vAction, const QVariantList &vData); private: QString alarmPriorityText (GuiAlarmPriority vEnum); @@ -61,6 +64,7 @@ public slots: QString text(); QString id(); + void requestSilence(); };