Index: denali.pro =================================================================== diff -u -r2c3846821eda0903c34bb5fcf2aebcbde2d0343a -r65558208e4968de9a5470ff5fda1ee2a9d00c793 --- denali.pro (.../denali.pro) (revision 2c3846821eda0903c34bb5fcf2aebcbde2d0343a) +++ denali.pro (.../denali.pro) (revision 65558208e4968de9a5470ff5fda1ee2a9d00c793) @@ -109,6 +109,12 @@ sources/model/hd/alarm/MAlarmTriggered.h \ sources/model/hd/alarm/MAlarmCleared.h \ sources/model/hd/alarm/MAlarmClearedCondition.h \ + \ # ---------- Models - States Data + sources/model/hd/data/MHDOperationModeData.h \ + sources/model/hd/data/pretreatment/MPreTreatmentStatesData.h \ + sources/model/hd/data/treatment/MTreatmentStatesData.h \ + sources/model/hd/data/posttreatment/MPostTreatmentStatesData.h \ + sources/model/dg/data/disinfect/MDisinfectStatesData.h \ \ # ---------- Models - HD - Adjustment sources/model/hd/adjustment/MAdjustRequestsBase.h \ sources/model/hd/adjustment/MAdjustPowerOff.h \ @@ -147,11 +153,6 @@ \ # ---------- Models - HD - Adjustment - Disinfeection sources/model/hd/adjustment/disinfect/MDisinfectAdjustRequests.h \ sources/model/hd/adjustment/disinfect/MDisinfectAdjustResponse.h \ - \ # ---------- Models - HD - States Data - sources/model/hd/data/MHDOperationModeData.h \ - sources/model/hd/data/pretreatment/MPreTreatmentStatesData.h \ - sources/model/hd/data/treatment/MTreatmentStatesData.h \ - sources/model/hd/data/posttreatment/MPostTreatmentStatesData.h \ \ # ---------- Models - HD - Data - Pre-Treatment - Progress sources/model/hd/data/pretreatment/MPreTreatmentSelfTestNoCartridgeData.h \ sources/model/hd/data/pretreatment/MPreTreatmentSelfTestDryData.h \ @@ -317,6 +318,12 @@ sources/model/hd/alarm/MAlarmTriggered.cpp \ sources/model/hd/alarm/MAlarmCleared.cpp \ sources/model/hd/alarm/MAlarmClearedCondition.cpp \ + \ # ---------- Models - Data - States + sources/model/hd/data/MHDOperationModeData.cpp \ + sources/model/hd/data/pretreatment/MPreTreatmentStatesData.cpp \ + sources/model/hd/data/treatment/MTreatmentStatesData.cpp \ + sources/model/hd/data/posttreatment/MPostTreatmentStatesData.cpp \ + sources/model/dg/data/disinfect/MDisinfectStatesData.cpp \ \ # ---------- Models - HD - Adjustment sources/model/hd/adjustment/MAdjustPowerOff.cpp \ \ # ---------- Models - HD - Adjustment - Settings @@ -354,11 +361,6 @@ sources/model/hd/data/pretreatment/MPreTreatmentDisposablesPrimeData.cpp \ sources/model/hd/data/pretreatment/MPreTreatmentSelfTestNoCartridgeData.cpp \ sources/model/hd/data/pretreatment/MPreTreatmentSelfTestDryData.cpp \ - \ # ---------- Models - HD - Data - States - sources/model/hd/data/MHDOperationModeData.cpp \ - sources/model/hd/data/pretreatment/MPreTreatmentStatesData.cpp \ - sources/model/hd/data/treatment/MTreatmentStatesData.cpp \ - sources/model/hd/data/posttreatment/MPostTreatmentStatesData.cpp \ \ # ---------- Models - HD - Data sources/model/hd/data/MHDDebugText.cpp \ sources/model/hd/data/MHDAccelerometerData.cpp \ Index: denali.pro.user =================================================================== diff -u -rc71946746586d5a4061ad866ce7dbbaf74b9798a -r65558208e4968de9a5470ff5fda1ee2a9d00c793 --- denali.pro.user (.../denali.pro.user) (revision c71946746586d5a4061ad866ce7dbbaf74b9798a) +++ denali.pro.user (.../denali.pro.user) (revision 65558208e4968de9a5470ff5fda1ee2a9d00c793) @@ -1,14 +1,14 @@ - + EnvironmentId {67370740-e20f-4fc6-be45-6652e866a8bf} ProjectExplorer.Project.ActiveTarget - 0 + 1 ProjectExplorer.Project.EditorSettings Index: en_US.udic =================================================================== diff -u -rc71946746586d5a4061ad866ce7dbbaf74b9798a -r65558208e4968de9a5470ff5fda1ee2a9d00c793 --- en_US.udic (.../en_US.udic) (revision c71946746586d5a4061ad866ce7dbbaf74b9798a) +++ en_US.udic (.../en_US.udic) (revision 65558208e4968de9a5470ff5fda1ee2a9d00c793) @@ -78,3 +78,6 @@ DGData getter VHDOperation +backend +TPAR +HDOp Index: scripts/date_time_set.sh =================================================================== diff -u --- scripts/date_time_set.sh (revision 0) +++ scripts/date_time_set.sh (revision 65558208e4968de9a5470ff5fda1ee2a9d00c793) @@ -0,0 +1,13 @@ +#!/bin/sh + +if [ $# -eq 0 ]; then + currentFile=$(basename "$0") + echo "Usage: ./$currentFile 'yyyy-mm-dd HH:MM:SS'" + exit 0 +fi + +date -s "$1" + +# set the hwclock from the system time +hwclock -w + Index: sources/canbus/MessageGlobals.h =================================================================== diff -u -r2c3846821eda0903c34bb5fcf2aebcbde2d0343a -r65558208e4968de9a5470ff5fda1ee2a9d00c793 --- sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision 2c3846821eda0903c34bb5fcf2aebcbde2d0343a) +++ sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision 65558208e4968de9a5470ff5fda1ee2a9d00c793) @@ -67,6 +67,7 @@ {Gui::GuiActionType::ID_PreTreatmentStates , 9 * 4 }, // 9 parameters each 4bytes {Gui::GuiActionType::ID_TreatmentStates , 9 * 4 }, // 9 parameters each 4bytes {Gui::GuiActionType::ID_TreatmentStates , 1 * 4 }, // 1 parameter each 4bytes + {Gui::GuiActionType::ID_DisinfectStates , 3 * 4 }, // 3 parameter each 4bytes // ---- {Gui::GuiActionType::ID_DGROPumpData , 4 * 4 }, // 4 parameters each 4bytes @@ -205,8 +206,8 @@ {Gui::GuiActionType::ID_DisinfectDGFlushData , 2 * 4 }, // 2 parameters each 4bytes {Gui::GuiActionType::ID_DisinfectDGHeatTimeData , 2 * 4 }, // 2 parameters each 4bytes {Gui::GuiActionType::ID_DisinfectDGHeatTempData , 2 * 4 }, // 2 parameters each 4bytes - {Gui::GuiActionType::ID_DisinfectDGChemTimeData , 2 * 4 }, // 2 parameters each 4bytes - {Gui::GuiActionType::ID_DisinfectDGChemTBDData , 2 * 4 }, // 2 parameters each 4bytes + {Gui::GuiActionType::ID_DisinfectDGChemicalTimeData , 2 * 4 }, // 2 parameters each 4bytes + {Gui::GuiActionType::ID_DisinfectDGChemicalTBDData , 2 * 4 }, // 2 parameters each 4bytes // ---- {Gui::GuiActionType::ID_CANBusFaultCount , 1 }, {Gui::GuiActionType::ID_RawData , 255 }, Index: sources/canbus/MessageInterpreter.cpp =================================================================== diff -u -rc71946746586d5a4061ad866ce7dbbaf74b9798a -r65558208e4968de9a5470ff5fda1ee2a9d00c793 --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision c71946746586d5a4061ad866ce7dbbaf74b9798a) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 65558208e4968de9a5470ff5fda1ee2a9d00c793) @@ -447,29 +447,31 @@ LOG_EVENT(QString("DG,CheckIn," + QVariant(vData).toStringList().join(','))); break; // DG data messages - case Gui::GuiActionType::ID_DGROPumpData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGROPumpData ); break; - case Gui::GuiActionType::ID_DGPressuresData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGPressuresData ); break; - case Gui::GuiActionType::ID_DGDrainPumpData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGDrainPumpData ); break; - case Gui::GuiActionType::ID_DGOperationModeData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGOperationModeData ); break; - case Gui::GuiActionType::ID_DGReservoirData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGReservoirData ); break; - case Gui::GuiActionType::ID_DGValvesStatesData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGValvesStatesData ); break; - case Gui::GuiActionType::ID_DGHeatersData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGHeatersData ); break; - case Gui::GuiActionType::ID_DGLoadCellReadingsData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGLoadCellReadingsData ); break; - case Gui::GuiActionType::ID_DGTemperaturesData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGTemperaturesData ); break; - case Gui::GuiActionType::ID_DGDebugText : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGDebugText ); break; - case Gui::GuiActionType::ID_DGAccelerometerData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGAccelerometerData ); break; + case Gui::GuiActionType::ID_DGROPumpData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGROPumpData ); break; + case Gui::GuiActionType::ID_DGPressuresData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGPressuresData ); break; + case Gui::GuiActionType::ID_DGDrainPumpData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGDrainPumpData ); break; + case Gui::GuiActionType::ID_DGOperationModeData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGOperationModeData ); break; + case Gui::GuiActionType::ID_DGReservoirData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGReservoirData ); break; + case Gui::GuiActionType::ID_DGValvesStatesData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGValvesStatesData ); break; + case Gui::GuiActionType::ID_DGHeatersData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGHeatersData ); break; + case Gui::GuiActionType::ID_DGLoadCellReadingsData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGLoadCellReadingsData ); break; + case Gui::GuiActionType::ID_DGTemperaturesData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGTemperaturesData ); break; + case Gui::GuiActionType::ID_DGDebugText : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGDebugText ); break; + case Gui::GuiActionType::ID_DGAccelerometerData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGAccelerometerData ); break; // ----- Datum - Pre-Treatment progress - case Gui::GuiActionType::ID_DGFilterFlushData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGFilterFlushData ); break; - // ----- Disinfection - Datum - case Gui::GuiActionType::ID_DisinfectDGFlushData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DisinfectDGFlushData ); break; - case Gui::GuiActionType::ID_DisinfectDGHeatTimeData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DisinfectDGHeatTimeData ); break; - case Gui::GuiActionType::ID_DisinfectDGHeatTempData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DisinfectDGHeatTempData ); break; - case Gui::GuiActionType::ID_DisinfectDGChemTimeData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DisinfectDGChemTimeData ); break; - case Gui::GuiActionType::ID_DisinfectDGChemTBDData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DisinfectDGChemTBDData ); break; + case Gui::GuiActionType::ID_DGFilterFlushData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGFilterFlushData ); break; + // ----- Datum - Disinfection + case Gui::GuiActionType::ID_DisinfectDGFlushData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DisinfectDGFlushData ); break; + case Gui::GuiActionType::ID_DisinfectDGHeatTimeData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DisinfectDGHeatTimeData ); break; + case Gui::GuiActionType::ID_DisinfectDGHeatTempData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DisinfectDGHeatTempData ); break; + case Gui::GuiActionType::ID_DisinfectDGChemicalTimeData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DisinfectDGChemicalTimeData ); break; + case Gui::GuiActionType::ID_DisinfectDGChemicalTBDData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DisinfectDGChemicalTBDData ); break; + // ----- Datum - Disinfect States + case Gui::GuiActionType::ID_DisinfectStates : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DisinfectStates ); break; // DG Response Messages - case Gui::GuiActionType::ID_AdjustDGVersionsRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustDGVersionsRsp ); break; - case Gui::GuiActionType::ID_AdjustDGDateTimeRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustDGDateTimeRsp ); break; + case Gui::GuiActionType::ID_AdjustDGVersionsRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustDGVersionsRsp ); break; + case Gui::GuiActionType::ID_AdjustDGDateTimeRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustDGDateTimeRsp ); break; // unhandled messages: these will only be logged as received message // there has nothing been defined for these messages. Index: sources/gui/GuiGlobals.h =================================================================== diff -u -rc71946746586d5a4061ad866ce7dbbaf74b9798a -r65558208e4968de9a5470ff5fda1ee2a9d00c793 --- sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision c71946746586d5a4061ad866ce7dbbaf74b9798a) +++ sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 65558208e4968de9a5470ff5fda1ee2a9d00c793) @@ -87,12 +87,14 @@ ID_AdjustDGDateTimeReq = 0x6F00, // 111 ID_AdjustDGDateTimeRsp = 0x7000, // 112 - // HD State Messages + // State Messages ID_HDOperationModeData = 0x2500, // 37 ID_PreTreatmentStates = 0x5C00, // 92 ID_TreatmentStates = 0x0F00, // 15 ID_PostTreatmentStates = 0x7700, // 119 + ID_DisinfectStates = 0x7E00, // 129 // DG message + // ----- ID_PowerOff = 0x0100, ID_ShuttingDown = 0x0E00, ID_TreatmentTime = 0x0D00, @@ -225,8 +227,8 @@ ID_DisinfectDGFlushData = 0x8200, // 130 ID_DisinfectDGHeatTimeData = 0x8300, // 131 ID_DisinfectDGHeatTempData = 0x8400, // 132 - ID_DisinfectDGChemTimeData = 0x8500, // 133 - ID_DisinfectDGChemTBDData = 0x8600, // 134 + ID_DisinfectDGChemicalTimeData = 0x8500, // 133 + ID_DisinfectDGChemicalTBDData = 0x8600, // 134 }; enum class GuiActionsData_Enum /*: quint8 QML doesn't support*/ { Index: sources/gui/qml/Keyboard.qml =================================================================== diff -u -rf7392d985121b21e9f9814e444b0810cd1d00b18 -r65558208e4968de9a5470ff5fda1ee2a9d00c793 --- sources/gui/qml/Keyboard.qml (.../Keyboard.qml) (revision f7392d985121b21e9f9814e444b0810cd1d00b18) +++ sources/gui/qml/Keyboard.qml (.../Keyboard.qml) (revision 65558208e4968de9a5470ff5fda1ee2a9d00c793) @@ -14,15 +14,16 @@ */ // Qt -import QtQuick 2.12 -import QtQuick.VirtualKeyboard 2.2 +import QtQuick 2.12 +import QtQuick.VirtualKeyboard 2.2 // Project // C++ imports - // Qml imports +import "qrc:/globals" + /*! * \brief Keyboard is the single keyboard in the entire applicaiton. */ @@ -32,8 +33,21 @@ } active : false // if active set to true then in the TextInput section handlers will show up, which is not nice. - y : Qt.inputMethod.visible ? parent.height - _root.height : parent.height + y : Qt.inputMethod.visible ? parent.height - _root.height - _bottomFiller.height : parent.height anchors.left : parent.left anchors.right : parent.right - Behavior on y { NumberAnimation { duration: 250 } } + + Behavior on y { NumberAnimation { duration: Variables.keybardAnimationDuration } } + // when an alarm is active then alarm covers the keyboard + // to avoid that keyboard moved a little higher + // because the keyboard height is calculated by InputPanel itself and can not be set, + // a gap beetween the bottom of the keyboard and the screen. + // the rectangle _bottomFiller is to fill that gap + Rectangle { id: _bottomFiller + height: Variables.minVGap + color: "black" // InputPanel background color. + anchors.left: _root.left + anchors.right: _root.right + anchors.top: _root.bottom + } } Index: sources/gui/qml/compounds/TouchGrid.qml =================================================================== diff -u -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f -r65558208e4968de9a5470ff5fda1ee2a9d00c793 --- sources/gui/qml/compounds/TouchGrid.qml (.../TouchGrid.qml) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) +++ sources/gui/qml/compounds/TouchGrid.qml (.../TouchGrid.qml) (revision 65558208e4968de9a5470ff5fda1ee2a9d00c793) @@ -26,11 +26,15 @@ Item { id: _root objectName: "_TouchGrid" - property var itemsText : [] - property var itemsEnabled : [] - property int itemWidth : 350 - property int itemHeight : 50 + property var itemsText : [] + property var itemsEnabled : [] + property int itemWidth : 350 + property int itemHeight : 50 + property alias layoutOrder : _grid.flow + property bool hasImage : true + property bool hasLine : true + readonly property int rowCount : 5 // rowCount should be readonly because it depends on the available space on the screen readonly property int colCount : itemsText.length > rowCount ? Math.ceil(itemsText.length / rowCount) : 1 readonly property int titleTopMargin: 110 @@ -59,17 +63,17 @@ onClicked : _root.itemClicked(index) Image { - visible: _touchItem.enabled && ! _touchItem.isPressed && _root.itemsText[index] - anchors.right: _touchItem.right - anchors.verticalCenter: _touchItem.verticalCenter - width : Variables.arrowWidth - height: Variables.arrowHeight - source: "qrc:/images/iArrowRight" + visible : _root.hasImage && _touchItem.enabled && ! _touchItem.isPressed && _root.itemsText[index] + anchors.right : _touchItem.right + anchors.verticalCenter : _touchItem.verticalCenter + width : Variables.arrowWidth + height : Variables.arrowHeight + source : "qrc:/images/iArrowRight" } Line { - visible: ! _touchItem.isPressed && _root.itemsText[index] - color: _touchItem.enabled ? Colors.borderButtonHalfDarker : Colors.borderDisableButton + visible : hasLine && ! _touchItem.isPressed && _root.itemsText[index] + color : _touchItem.enabled ? Colors.borderButtonHalfDarker : Colors.borderDisableButton anchors.left : _touchItem.left anchors.right : _touchItem.right anchors.bottom : _touchItem.bottom Index: sources/gui/qml/globals/Variables.qml =================================================================== diff -u -r9327fae7b109203ca698d361b113a81d139a0cf9 -r65558208e4968de9a5470ff5fda1ee2a9d00c793 --- sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision 9327fae7b109203ca698d361b113a81d139a0cf9) +++ sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision 65558208e4968de9a5470ff5fda1ee2a9d00c793) @@ -23,6 +23,8 @@ * which is going to be used in the project. */ QtObject { + readonly property int keybardAnimationDuration : 200 + readonly property int applicationWidth : 1280 readonly property int applicationHeight : 800 readonly property int buttonSpacing : 150 Index: sources/gui/qml/pages/MainStack.qml =================================================================== diff -u -r4afc91856c00e01dfb5d84bc54d2d92faefec0db -r65558208e4968de9a5470ff5fda1ee2a9d00c793 --- sources/gui/qml/pages/MainStack.qml (.../MainStack.qml) (revision 4afc91856c00e01dfb5d84bc54d2d92faefec0db) +++ sources/gui/qml/pages/MainStack.qml (.../MainStack.qml) (revision 65558208e4968de9a5470ff5fda1ee2a9d00c793) @@ -83,9 +83,10 @@ onServiceChanged : { page( _serviceModeScreen , vservice )} onInitChanged : { page( _initialModeScreen , vinit )} - onStandbyChanged : { /* It depends on the subModes of the standBy. Nothing to be done */ } - onStandbyStartChanged : { page( _mainHome , vstandbyStart )} - onStandbyWaitTreatmentChanged : { page( _mainHome , vstandbyWaitTreatment )} + onHomeChanged : { page( _mainHome , vhome )} + onStandbyChanged : { /* It depends on the subModes of the standBy. Handled by onHome. */ } + onStandbyStartChanged : { /* It depends on the subModes of the standBy. Handled by onHome. */ } + onStandbyWaitTreatmentChanged : { /* It depends on the subModes of the standBy. Handled by onHome. */ } onStandbyWaitDisinfectChanged : { page( _disinfectStack , vstandbyWaitDisinfect )} onValidateParametersChanged : { page( _preTreatmentCreateStack , vvalidateParameters )} Index: sources/gui/qml/pages/settings/SettingsBase.qml =================================================================== diff -u -rf7392d985121b21e9f9814e444b0810cd1d00b18 -r65558208e4968de9a5470ff5fda1ee2a9d00c793 --- sources/gui/qml/pages/settings/SettingsBase.qml (.../SettingsBase.qml) (revision f7392d985121b21e9f9814e444b0810cd1d00b18) +++ sources/gui/qml/pages/settings/SettingsBase.qml (.../SettingsBase.qml) (revision 65558208e4968de9a5470ff5fda1ee2a9d00c793) @@ -85,7 +85,7 @@ font.pixelSize : Fonts.fontPixelTitle } - // this meant to be used specifically as current state notification mostrly for the message respose back reasons. + // this meant to be used specifically as current state notification mostly for the message respose back reasons. NotificationBarSmall { id: _information visible : text color : Colors.transparent @@ -94,5 +94,10 @@ text : "" anchors.bottomMargin: Variables.mainMenuHeight + Variables.minVGap } -} + onVisibleChanged: { + if (visible) { + _mainMenu.hidden = true + } + } +} Index: sources/gui/qml/pages/settings/SettingsDateTime.qml =================================================================== diff -u -rf7392d985121b21e9f9814e444b0810cd1d00b18 -r65558208e4968de9a5470ff5fda1ee2a9d00c793 --- sources/gui/qml/pages/settings/SettingsDateTime.qml (.../SettingsDateTime.qml) (revision f7392d985121b21e9f9814e444b0810cd1d00b18) +++ sources/gui/qml/pages/settings/SettingsDateTime.qml (.../SettingsDateTime.qml) (revision 65558208e4968de9a5470ff5fda1ee2a9d00c793) @@ -31,36 +31,36 @@ property int labelWidth : 275 readonly property bool isValid : - _hours .textInput.acceptableInput && - _minutes.textInput.acceptableInput && _year .textInput.acceptableInput && _month .textInput.acceptableInput && - _day .textInput.acceptableInput + _day .textInput.acceptableInput && + _hours .textInput.acceptableInput && + _minutes.textInput.acceptableInput confirmEnabled: isValid notificationText: vDateTime.status onConfirmClicked: { vDateTime.doConfirm( - _hours .textInput.text , - _minutes.textInput.text , _year .textInput.text , _month .textInput.text , - _day .textInput.text ) + _day .textInput.text , + _hours .textInput.text , + _minutes.textInput.text ) } onVisibleChanged: { // it seems entering in the TextInput by keyboard breaks the binding - _hours .textInput.text = vDateTime.hour - _minutes.textInput.text = vDateTime.minute + _year .textInput.text = vDateTime.year _month .textInput.text = vDateTime.month _day .textInput.text = vDateTime.day - _year .textInput.text = vDateTime.year + _hours .textInput.text = vDateTime.hour + _minutes.textInput.text = vDateTime.minute } - Column { - spacing: 75 - anchors.top: parent.top - anchors.topMargin: topMarginContent + Column { id: _container + spacing: 70 + y : Qt.inputMethod.visible && _keyboard.visible ? topMarginContent : ( (_root.height - _container.height) / 2 ) + Behavior on y { NumberAnimation { duration: Variables.keybardAnimationDuration } } anchors.horizontalCenter: parent.horizontalCenter Row { // time Index: sources/gui/qml/pages/settings/SettingsHome.qml =================================================================== diff -u -rf7392d985121b21e9f9814e444b0810cd1d00b18 -r65558208e4968de9a5470ff5fda1ee2a9d00c793 --- sources/gui/qml/pages/settings/SettingsHome.qml (.../SettingsHome.qml) (revision f7392d985121b21e9f9814e444b0810cd1d00b18) +++ sources/gui/qml/pages/settings/SettingsHome.qml (.../SettingsHome.qml) (revision 65558208e4968de9a5470ff5fda1ee2a9d00c793) @@ -98,5 +98,16 @@ _GuiView.doActionTransmit(GuiActions.ID_PowerOff, GuiActions.NoData) } } + + // The Main menu need to hide in case we have any alarm, if not the menu is covered by keyboard but the alram does not. + // So what happens is alarm shows up on keyboard but a little higher (main menu height) and it makes the UI not nice. + // In the Sub Settings Screens we hide the main menu since those have back button, + // but we need to show it back again in the settings home screen since it is a main screen and the only navigation is through the main menu. + // So it overrides the parent logic. + onVisibleChanged: { + if (visible) { + _mainMenu.hidden = false + } + } } Index: sources/gui/qml/pages/treatment/sections/TreatmentSaline.qml =================================================================== diff -u -r583d1953c783940c93f22c37b23daadb1ff3a09c -r65558208e4968de9a5470ff5fda1ee2a9d00c793 --- sources/gui/qml/pages/treatment/sections/TreatmentSaline.qml (.../TreatmentSaline.qml) (revision 583d1953c783940c93f22c37b23daadb1ff3a09c) +++ sources/gui/qml/pages/treatment/sections/TreatmentSaline.qml (.../TreatmentSaline.qml) (revision 65558208e4968de9a5470ff5fda1ee2a9d00c793) @@ -65,10 +65,8 @@ notification { visible : true - text : isIdle ? "" : - isDisabled ? _private.mesgDisabled : - isWaitPump ? _private.mesgWaitForPump : - isStarted ? _private.mesgRejectReason : - "" + text : isDisabled ? _private.mesgDisabled : + isWaitPump ? _private.mesgWaitForPump : + _private.mesgRejectReason } } Index: sources/model/MModel.h =================================================================== diff -u -rc71946746586d5a4061ad866ce7dbbaf74b9798a -r65558208e4968de9a5470ff5fda1ee2a9d00c793 --- sources/model/MModel.h (.../MModel.h) (revision c71946746586d5a4061ad866ce7dbbaf74b9798a) +++ sources/model/MModel.h (.../MModel.h) (revision 65558208e4968de9a5470ff5fda1ee2a9d00c793) @@ -29,6 +29,7 @@ #include "MPreTreatmentStatesData.h" #include "MTreatmentStatesData.h" #include "MPostTreatmentStatesData.h" +#include "MDisinfectStatesData.h" // HD Data Messages #include "MTreatmentTimeData.h" @@ -235,6 +236,7 @@ REGISTER_METATYPE( PreTreatmentStatesData ) \ REGISTER_METATYPE( TreatmentStatesData ) \ REGISTER_METATYPE( PostTreatmentStatesData ) \ + REGISTER_METATYPE( DisinfectStatesData ) \ REGISTER_METATYPE( BloodFlowData ) \ REGISTER_METATYPE( DialysateFlowData ) \ REGISTER_METATYPE( OutletFlowData ) \ @@ -376,6 +378,7 @@ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, PreTreatmentStatesData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, TreatmentStatesData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, PostTreatmentStatesData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, DisinfectStatesData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, BloodFlowData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, DialysateFlowData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, OutletFlowData ) \ @@ -520,6 +523,7 @@ ACTION_RECEIVE_BRIDGE_DEFINITION( PreTreatmentStatesData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( TreatmentStatesData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( PostTreatmentStatesData ) \ + ACTION_RECEIVE_BRIDGE_DEFINITION( DisinfectStatesData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( BloodFlowData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( DialysateFlowData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( OutletFlowData ) \ @@ -737,6 +741,7 @@ ACTION_RECEIVE_SIGNAL( PreTreatmentStatesData ) \ ACTION_RECEIVE_SIGNAL( TreatmentStatesData ) \ ACTION_RECEIVE_SIGNAL( PostTreatmentStatesData ) \ + ACTION_RECEIVE_SIGNAL( DisinfectStatesData ) \ ACTION_RECEIVE_SIGNAL( BloodFlowData ) \ ACTION_RECEIVE_SIGNAL( DialysateFlowData ) \ ACTION_RECEIVE_SIGNAL( OutletFlowData ) \ Index: sources/model/dg/data/disinfect/MDisinfectStatesData.cpp =================================================================== diff -u --- sources/model/dg/data/disinfect/MDisinfectStatesData.cpp (revision 0) +++ sources/model/dg/data/disinfect/MDisinfectStatesData.cpp (revision 65558208e4968de9a5470ff5fda1ee2a9d00c793) @@ -0,0 +1,49 @@ +/*! + * + * Copyright (c) 2019-2020 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 MDisinfectStatesData.cpp + * \author (last) Behrouz NematiPour + * \date (last) 19-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 19-Apr-2021 + * + */ +#include "MDisinfectStatesData.h" + +using namespace Model; + +QVariantList MDisinfectStates::parameters() const { + return { + _data.mSubMode .value, + _data.mHeatStates .value, + _data.mChemicalStates .value, + }; +} + +bool MDisinfectStates::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if (GetValue(vByteArray, index, _data.mSubMode )) + if (GetValue(vByteArray, index, _data.mHeatStates )) + if (GetValue(vByteArray, index, _data.mChemicalStates )) + return true ; + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } +} + +/*! + * \brief MDisinfectStates::data + * \details Provides model's Data from the received messages data values + * \return Data + */ +MDisinfectStates::Data MDisinfectStates::data() const { + Data data; + data.mSubMode = _data.mSubMode .value; + data.mHeatStates = _data.mHeatStates .value; + data.mChemicalStates = _data.mChemicalStates .value; + return data; +} Index: sources/model/dg/data/disinfect/MDisinfectStatesData.h =================================================================== diff -u --- sources/model/dg/data/disinfect/MDisinfectStatesData.h (revision 0) +++ sources/model/dg/data/disinfect/MDisinfectStatesData.h (revision 65558208e4968de9a5470ff5fda1ee2a9d00c793) @@ -0,0 +1,85 @@ +/*! + * + * Copyright (c) 2019-2020 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 MDisinfectStatesData.h + * \author (last) Behrouz NematiPour + * \date (last) 19-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 19-Apr-2021 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "MAbstract.h" +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +/*! + * \brief The MDisinfectStates class + * \details The disinfection states data model + * These are states of the post treatment. + * + * | MSG | CAN ID | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:------:|:---:|:---:|:---:|:-----------:| + * |0x7E00| 0x080 | 1 Hz | N | DG | All | Disinfection States Data | + * + * | Payload || + * | || + * | #1:(U32) | \ref Data::mState | + * + * \sa Data + * \sa HD_Post_Treatment_Mode_States + * + *

Logging info

+ * | || + * | || + * | typeText | Datum | + * | unitText | HD | + * | infoText | DisinfectStates | + * + */ +class MDisinfectStates : public MAbstract { + + // friends + friend class ::tst_models; + + QVariantList parameters() const override; + + struct { + Types::U32 mSubMode ; ///< Sub State - HD_Post_Treatment_Mode_States + Types::U32 mHeatStates ; ///< Heat State - DG_Heat_States + Types::U32 mChemicalStates ; ///< Chemical State - /* Not Complete */ + } _data; + +public: + + Type_Enum typeText () const override { return Type_Enum::eDatum ; } + Unit_Enum unitText () const override { return Unit_Enum::eHD ; } + QString infoText () const override { return QString("DisinfectStates"); } + + struct Data { + quint32 mSubMode = 0; ///< Sub State - HD_Post_Treatment_Mode_States + quint32 mHeatStates = 0; ///< Heat State - DG_Heat_States + quint32 mChemicalStates = 0; ///< Chem State - /* Not Complete */ + }; + + MDisinfectStates() { } + + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; + Data data ( ) const ; +}; +} + +typedef Model::MDisinfectStates::Data DisinfectStatesData; Index: sources/view/hd/data/VHDOperationModeData.cpp =================================================================== diff -u -rc71946746586d5a4061ad866ce7dbbaf74b9798a -r65558208e4968de9a5470ff5fda1ee2a9d00c793 --- sources/view/hd/data/VHDOperationModeData.cpp (.../VHDOperationModeData.cpp) (revision c71946746586d5a4061ad866ce7dbbaf74b9798a) +++ sources/view/hd/data/VHDOperationModeData.cpp (.../VHDOperationModeData.cpp) (revision 65558208e4968de9a5470ff5fda1ee2a9d00c793) @@ -42,6 +42,25 @@ standbyDGDisinfectHeat ( vData.mSubMode == GuiHDStandbyStates ::STANDBY_DG_HEAT_DISINFECT_IN_PROGRESS_STATE ); standbyDGDisinfectChemical ( vData.mSubMode == GuiHDStandbyStates ::STANDBY_DG_CHEM_DISINFECT_IN_PROGRESS_STATE ); } + + // Go to home is kind of tricky and needs to be managed here in the backend. + // It seems we need more states. + // It can be handled in the QML but two things will happen that none of which are good. + // Problem : The issue is for example FW may changed the opMode state to TPAR <=> INIT but during that subMode is not changing. + // and when it comes back to the opMode Init again only opMode is changing which is not enough, + // because we still need to know when we are in INIT what subMode of INIT we need to be in + // and because that doesn't change QML since FW change opMode INIT <=> TPAR then UI is doing nothing. + // The solutions on QML side are: + // 1 - On each standby change INIT <=> TPAR which is not good because if in INIT we need to the go to the anything other than Start/waitTreatment. + // Issue : But then the home screen would jump. + // 2 - And we can also check that if subMode is Start/WaitTreatment go to home in QML. + // 3 - Make the sub PROPERTY as TRIGGER and if standby is true trigger them. + // Issue : None of the two later ideas are good either, because FW is sending the HDOpMode message each second(maybe on higher freq later) + // and then QML is updating itself on a high frequency, which is absolutely incorrect on UI side, + // Final Solution: # - The solution though is to have a special state in backend C++ that checks if opMode is standby and subMode is state/waitTreatment + // and if these conditions changed since the last time then signal emits. + // Brief : *** So actually we have a mixed condition property *** + home ( _standby && ( _standbyStart || _standbyWaitTreatment ) ); } QString View::VHDOperationMode::text() Index: sources/view/hd/data/VHDOperationModeData.h =================================================================== diff -u -rc71946746586d5a4061ad866ce7dbbaf74b9798a -r65558208e4968de9a5470ff5fda1ee2a9d00c793 --- sources/view/hd/data/VHDOperationModeData.h (.../VHDOperationModeData.h) (revision c71946746586d5a4061ad866ce7dbbaf74b9798a) +++ sources/view/hd/data/VHDOperationModeData.h (.../VHDOperationModeData.h) (revision 65558208e4968de9a5470ff5fda1ee2a9d00c793) @@ -52,13 +52,15 @@ PROPERTY( bool , invalidMode , false ) ///< Not legal - an illegal mode transition occurred // these are triggers but shall only be triggered when in standby mode. - TRIGGER ( bool , standbyStart , false ) ///< Start standby , STANDBY_START_STATE = 0 - TRIGGER ( bool , standbyWaitTreatment , false ) ///< Wait for treatment , STANDBY_WAIT_FOR_TREATMENT_STATE - TRIGGER ( bool , standbyWaitDisinfect , false ) ///< Wait for disinfect , STANDBY_WAIT_FOR_DISINFECT_STATE - TRIGGER ( bool , standbyDGFlush , false ) ///< DG flush operation is in progress , STANDBY_DG_FLUSH_IN_PROGRESS_STATE - TRIGGER ( bool , standbyDGDisinfectHeat , false ) ///< DG heat disinfection operation is in progress , STANDBY_DG_HEAT_DISINFECT_IN_PROGRESS_STATE - TRIGGER ( bool , standbyDGDisinfectChemical , false ) ///< DG chemical disinfection operation is in progress , STANDBY_DG_CHEM_DISINFECT_IN_PROGRESS_STATE + PROPERTY( bool , standbyStart , false ) ///< Start standby , STANDBY_START_STATE = 0 + PROPERTY( bool , standbyWaitTreatment , false ) ///< Wait for treatment , STANDBY_WAIT_FOR_TREATMENT_STATE + PROPERTY( bool , standbyWaitDisinfect , false ) ///< Wait for disinfect , STANDBY_WAIT_FOR_DISINFECT_STATE + PROPERTY( bool , standbyDGFlush , false ) ///< DG flush operation is in progress , STANDBY_DG_FLUSH_IN_PROGRESS_STATE + PROPERTY( bool , standbyDGDisinfectHeat , false ) ///< DG heat disinfection operation is in progress , STANDBY_DG_HEAT_DISINFECT_IN_PROGRESS_STATE + PROPERTY( bool , standbyDGDisinfectChemical , false ) ///< DG chemical disinfection operation is in progress , STANDBY_DG_CHEM_DISINFECT_IN_PROGRESS_STATE + PROPERTY( bool , home , false ) ///< Special Home mode // see in the cpp file. + Q_PROPERTY(QString text READ text NOTIFY opModeChanged) VIEW_DEC(VHDOperationMode, HDOperationModeData) Index: sources/view/settings/VDateTime.cpp =================================================================== diff -u -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f -r65558208e4968de9a5470ff5fda1ee2a9d00c793 --- sources/view/settings/VDateTime.cpp (.../VDateTime.cpp) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) +++ sources/view/settings/VDateTime.cpp (.../VDateTime.cpp) (revision 65558208e4968de9a5470ff5fda1ee2a9d00c793) @@ -66,20 +66,37 @@ const QString &vHour , const QString &vMinute ) { + year ( vYear ); + month ( vMonth ); + day ( vDay ); + hour ( vHour ); + minute ( vMinute ); quint32 epoch = QDateTime( - QDate(vYear .toInt() , - vMonth .toInt() , - vDay .toInt()), - QTime(vHour .toInt() , - vMinute .toInt()) + QDate(_year .toInt() , + _month .toInt() , + _day .toInt()), + QTime(_hour .toInt() , + _minute .toInt()) ).toSecsSinceEpoch(); - status("Setting date and time..."); + // the accepted format of the Linux data command: + // example: 2021-03-16 16:24:00 + QString mDateTime = QString("%1-%2-%3 %4:%5:%6") + .arg(_year ) + .arg(_month ) + .arg(_day ) + .arg(_hour ) + .arg(_minute) + .arg(_second); - dateTimeHD(epoch); - dateTimeDG(epoch); - dateTimeUI( ); + LOG_EVENT(tr("SetDateTime %1").arg(mDateTime)); + + status("Setting date and time ..."); + + dateTimeUI(mDateTime); + dateTimeHD(epoch ); + dateTimeDG(epoch ); } /*! @@ -95,6 +112,7 @@ } else { _acceptUI = SUCCEED; + LOG_EVENT("SetDateTime Succeed"); } updateStatus(); } @@ -153,18 +171,9 @@ * \brief VDateTime::dateTimeUI * \details starts the shell script in a process defined in Storage::Date_Time_Set_Sh to update the device date/time */ -void VDateTime::dateTimeUI() +void VDateTime::dateTimeUI(const QString &vDateTime) { - // the accepted format of the Linux data command: - // example: 2021-03-16 16:24:00 - QString setTime = QString("%1-%2-%3 %4:%5:%6") - .arg(_year ) - .arg(_month ) - .arg(_day ) - .arg(_hour ) - .arg(_minute) - .arg(_second); - _process.start(Storage::Date_Time_Set_Sh, QStringList() << setTime); + _process.start(Storage::Date_Time_Set_Sh, QStringList() << vDateTime); } /*! Index: sources/view/settings/VDateTime.h =================================================================== diff -u -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f -r65558208e4968de9a5470ff5fda1ee2a9d00c793 --- sources/view/settings/VDateTime.h (.../VDateTime.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) +++ sources/view/settings/VDateTime.h (.../VDateTime.h) (revision 65558208e4968de9a5470ff5fda1ee2a9d00c793) @@ -63,7 +63,7 @@ void dateTimeHD(quint32 epoch); void dateTimeDG(quint32 epoch); - void dateTimeUI( ); + void dateTimeUI(const QString &vDateTime); QString status(DateTimeSetStatus vStatus, quint8 vReason); void updateStatus();