Index: denali.pro =================================================================== diff -u -r2f0d1d22a15f0ddb459c6527b4746439f66bfe1b -rb50431293b0690d6071f0fd58044880909cef01d --- denali.pro (.../denali.pro) (revision 2f0d1d22a15f0ddb459c6527b4746439f66bfe1b) +++ denali.pro (.../denali.pro) (revision b50431293b0690d6071f0fd58044880909cef01d) @@ -83,10 +83,12 @@ sources/view/hd/adjustment/disinfect \ sources/view/hd/alarm \ sources/view/hd/data \ + sources/view/hd/data/post \ sources/view/hd/data/pretreatment \ sources/view/hd/data/treatment \ sources/view/hd/data/posttreatment \ sources/view/dg/data \ + sources/view/dg/data/post \ sources/view/dg/data/pretreatment \ sources/view/dg/data/disinfect @@ -110,6 +112,7 @@ sources/device/DeviceController.h \ sources/storage/Settings.h \ sources/storage/TreatmentLog.h \ + sources/view/hd/data/post/VHDPOSTData.h \ sources/wifi/WifiInterface.h \ \ # ---------- Models ---------- sources/model/MModel.h \ @@ -242,6 +245,8 @@ sources/view/VView.h \ sources/view/VPowerOff.h \ sources/device/DeviceView.h \ + \ # ---------- Views - POST + sources/view/dg/data/post/VDGPOSTData.h \ \ # ---------- Views - Settings sources/view/settings/VDateTime.h \ sources/view/settings/VSettings.h \ @@ -348,6 +353,7 @@ sources/device/DeviceController.cpp \ sources/storage/Settings.cpp \ sources/storage/TreatmentLog.cpp \ + sources/view/hd/data/post/VHDPOSTData.cpp \ sources/wifi/WifiInterface.cpp \ \ # ---------- Models ---------- sources/model/MAbstract.cpp \ @@ -470,6 +476,8 @@ sources/view/VEventSpy.cpp \ sources/view/VPowerOff.cpp \ sources/device/DeviceView.cpp \ + \ # ---------- Views - POST + sources/view/dg/data/post/VDGPOSTData.cpp \ \ # ---------- Views - Alarm sources/view/hd/alarm/VAlarmStatus.cpp \ sources/view/hd/alarm/VAlarmActiveList.cpp \ Index: denali.pro.user =================================================================== diff -u -rb22dd46db3def5d3c36d36c319f0bea89bf018d9 -rb50431293b0690d6071f0fd58044880909cef01d --- denali.pro.user (.../denali.pro.user) (revision b22dd46db3def5d3c36d36c319f0bea89bf018d9) +++ denali.pro.user (.../denali.pro.user) (revision b50431293b0690d6071f0fd58044880909cef01d) @@ -1,6 +1,6 @@ - + EnvironmentId Index: denali.qrc =================================================================== diff -u -rac23b968f565c2beeb153ca2d554b8f868634512 -rb50431293b0690d6071f0fd58044880909cef01d --- denali.qrc (.../denali.qrc) (revision ac23b968f565c2beeb153ca2d554b8f868634512) +++ denali.qrc (.../denali.qrc) (revision b50431293b0690d6071f0fd58044880909cef01d) @@ -58,6 +58,7 @@ resources/images/Decelerate.png resources/images/Busy.png resources/images/BusyDone.png + resources/images/BusyFail.png resources/images/eject.png resources/images/eye.png Index: en_US.udic =================================================================== diff -u -r2f0d1d22a15f0ddb459c6527b4746439f66bfe1b -rb50431293b0690d6071f0fd58044880909cef01d --- en_US.udic (.../en_US.udic) (revision 2f0d1d22a15f0ddb459c6527b4746439f66bfe1b) +++ en_US.udic (.../en_US.udic) (revision b50431293b0690d6071f0fd58044880909cef01d) @@ -149,3 +149,8 @@ UIPost vID vMODEL +VDGPOSTData +MDGPost +VHDPOSTData +MHDPost +PWM Index: resources/images/BusyFail.png =================================================================== diff -u Binary files differ Index: sources/gui/GuiGlobals.cpp =================================================================== diff -u -rab7ffd27ecea1277d8645a8b62ff48c0cb3f6ff4 -rb50431293b0690d6071f0fd58044880909cef01d --- sources/gui/GuiGlobals.cpp (.../GuiGlobals.cpp) (revision ab7ffd27ecea1277d8645a8b62ff48c0cb3f6ff4) +++ sources/gui/GuiGlobals.cpp (.../GuiGlobals.cpp) (revision b50431293b0690d6071f0fd58044880909cef01d) @@ -22,6 +22,10 @@ #include "GuiView.h" #include "VEventSpy.h" +// POST +#include "VHDPOSTData.h" +#include "VDGPOSTData.h" + // Device #include "DeviceView.h" Index: sources/gui/GuiGlobals.h =================================================================== diff -u -r667baa15f6fc3a9438dae68ded8cee26c2ca7450 -rb50431293b0690d6071f0fd58044880909cef01d --- sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 667baa15f6fc3a9438dae68ded8cee26c2ca7450) +++ sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision b50431293b0690d6071f0fd58044880909cef01d) @@ -280,6 +280,7 @@ Q_ENUM(Request_Reject_Reasons) #include "HDDefs.h" + Q_ENUM(HD_POST_States) Q_ENUM(HD_Op_Modes) Q_ENUM(HD_Standby_States) // Treatment @@ -324,6 +325,7 @@ Q_ENUM(DG_Disinfect_States) #include "DGDefs.h" + Q_ENUM(DG_POST_States) Q_ENUM(DG_Op_Modes) Q_ENUM(DG_Flush_UI_States) Q_ENUM(DG_Heat_UI_States) @@ -341,6 +343,9 @@ typedef GuiActions::Alarm_Data_Types GuiAlarmDataTypes; typedef GuiActions::Request_Reject_Reasons GuiRequestReasons; + // POST + typedef GuiActions::HD_POST_States GuiHDPOSTStates; + typedef GuiActions::DG_POST_States GuiDGPOSTStates; // operation mode typedef GuiActions::HD_Op_Modes GuiHDOpModes; typedef GuiActions::DG_Op_Modes GuiDGOpModes; Index: sources/gui/qml/components/WaitDone.qml =================================================================== diff -u -r22bd5aba8d60c1cfda0e0b3bdcb0f54cdc27dafb -rb50431293b0690d6071f0fd58044880909cef01d --- sources/gui/qml/components/WaitDone.qml (.../WaitDone.qml) (revision 22bd5aba8d60c1cfda0e0b3bdcb0f54cdc27dafb) +++ sources/gui/qml/components/WaitDone.qml (.../WaitDone.qml) (revision b50431293b0690d6071f0fd58044880909cef01d) @@ -26,6 +26,7 @@ Item { id: _root property int diameter: 50 property bool done : false + property bool fail : false Image { id: _busyIndicator visible : true @@ -54,7 +55,7 @@ opacity : _root.done ? 1 : 0 width : _root.diameter + 15 height : _root.diameter + 15 - source : "qrc:/images/iBusyDone" + source : fail ? "qrc:/images/iBusyFail" : "qrc:/images/iBusyDone" Behavior on opacity { OpacityAnimator { duration: 1200 } } } } Index: sources/gui/qml/main.qml =================================================================== diff -u -rab7ffd27ecea1277d8645a8b62ff48c0cb3f6ff4 -rb50431293b0690d6071f0fd58044880909cef01d --- sources/gui/qml/main.qml (.../main.qml) (revision ab7ffd27ecea1277d8645a8b62ff48c0cb3f6ff4) +++ sources/gui/qml/main.qml (.../main.qml) (revision b50431293b0690d6071f0fd58044880909cef01d) @@ -24,6 +24,10 @@ // View classes import VHDAccelerometer 0.1 +// POST +import VHDPOSTData 0.1 +import VDGPOSTData 0.1 + // Device import VDevice 0.1 @@ -116,6 +120,9 @@ width : Variables.applicationWidth height: Variables.applicationHeight + VHDPOSTData { id: vHDPOSTData } + VDGPOSTData { id: vDGPOSTData } + VDevice { id: vDevice } VSettings { id: vSettings } VAdjustmentVersions { id: vAdjustmentVersions } Index: sources/gui/qml/pages/MainStack.qml =================================================================== diff -u -r5c21e83a3fdc897cb99ac62e1cec0213f411cd73 -rb50431293b0690d6071f0fd58044880909cef01d --- sources/gui/qml/pages/MainStack.qml (.../MainStack.qml) (revision 5c21e83a3fdc897cb99ac62e1cec0213f411cd73) +++ sources/gui/qml/pages/MainStack.qml (.../MainStack.qml) (revision b50431293b0690d6071f0fd58044880909cef01d) @@ -34,7 +34,7 @@ * is selected from the main menu. */ StackItem { id : _root - stackView.initialItem : _mainHome + stackView.initialItem : _initialModeScreen function doSettingsDisinfect() { _mainMenu.currentIndex = 0 @@ -59,6 +59,7 @@ PostTreatmentStack { id: _postTreatmentStack } ScreenItem { id: _faultModeScreen + // we recently decided to not change the screen on fault and stay on current(whatever are we on currently) screen. PlaceHolderText { screenName: qsTr("FAULT MODE") } onVisibleChanged: if (visible) _mainMenu.hidden = true } @@ -69,8 +70,43 @@ } ScreenItem { id: _initialModeScreen - PlaceHolderText { screenName: qsTr("INITIAL MODE") } onVisibleChanged: if (visible) _mainMenu.hidden = true + Image { id: _dialityLogo + Behavior on opacity { OpacityAnimator { duration: 1000 } } + opacity : _initialModeScreen.visible ? 1 : 0 + anchors.centerIn: parent + source : "qrc:/images/iLogoDiality" + } + + ProgressBar { + minimum : 0 + maximum : vHDPOSTData.itemCount + value : vHDPOSTData.start ? vHDPOSTData.itemIndex + 1 : 0 // the index starts from 0 and 0 which is a valid test index will not show anything. So for progress we start from 1. + width : _dialityLogo.width + 50 + height : 3 + minText .visible: false + maxText .visible: false + marker .visible: false + anchors { + top: _dialityLogo.bottom + topMargin : 15 + horizontalCenter: parent.horizontalCenter + } + } + + WaitDone { id: _hdWaitdone + diameter: 100 + anchors { + top: _dialityLogo.bottom + topMargin: 100 + horizontalCenter: parent.horizontalCenter + } + visible : true + // HD will pause for a few seconds before changing to stand-by mode + // So we can show that POST has completed + done : vHDPOSTData.done + fail : ! vHDPOSTData.doneResult + } } MainHome { id: _mainHome @@ -127,7 +163,7 @@ onVisibleChanged: { if (visible) { - _mainMenu.hidden = false + _mainMenu.hidden = true // initially our landing screen is _initialModeScreen which should not have the Main menu. } else { stackView.initialItem = null Index: sources/view/VView.h =================================================================== diff -u -rab7ffd27ecea1277d8645a8b62ff48c0cb3f6ff4 -rb50431293b0690d6071f0fd58044880909cef01d --- sources/view/VView.h (.../VView.h) (revision ab7ffd27ecea1277d8645a8b62ff48c0cb3f6ff4) +++ sources/view/VView.h (.../VView.h) (revision b50431293b0690d6071f0fd58044880909cef01d) @@ -101,6 +101,9 @@ //--------------------------------------------------------------------------------// #define REGISTER_VIEW_TYPES \ using namespace View; \ + /* POST */ \ + REGISTER_TYPE( VHDPOSTData ) \ + REGISTER_TYPE( VDGPOSTData ) \ /* Device */ \ REGISTER_TYPE( VDevice ) \ /* Settings */ \ Index: sources/view/dg/data/post/VDGPOSTData.cpp =================================================================== diff -u --- sources/view/dg/data/post/VDGPOSTData.cpp (revision 0) +++ sources/view/dg/data/post/VDGPOSTData.cpp (revision b50431293b0690d6071f0fd58044880909cef01d) @@ -0,0 +1,59 @@ +/*! + * + * 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 VDGPOSTData.cpp + * \author (last) Behrouz NematiPour + * \author (original) Behrouz NematiPour + * \date (last) 27-Jul-2021 + * \date (original) 27-Jul-2021 + * + */ +#include "VDGPOSTData.h" + +// Project +#include "GuiController.h" + +VIEW_DEF_CLASS_ADJUSTMENT(VDGPOSTData) + +/*! \brief Connection Initializer + \details All the class signal/slot connections are defined here. +*/ +void View::VDGPOSTData::initConnections() { + ACTION_VIEW_CONNECTION(DGPostSingleResultData); + ACTION_VIEW_CONNECTION(DGPostFinalResultData ); +} + +/*! + * \brief VDGPOSTData::onActionReceive + * \details received response model data handler + * \param vData - model data + */ +void View::VDGPOSTData::onActionReceive(const DGPostSingleResultData &vData) +{ + itemIndex ( vData.mIndex ); + itemResult ( vData.mResult ); + start ( true ); + + // *** has to be the last to let the information to be set and then emit the signal *** + // *** otherwise will use the Previous values before being set. *** + adjustment ( true ); +} + +/*! + * \brief VDGPOSTData::onActionReceive + * \details received response model data handler + * \param vData - model data + */ +void View::VDGPOSTData::onActionReceive(const DGPostFinalResultData &vData) +{ + doneResult ( vData.mResult ); + done ( true ); + + // *** has to be the last to let the information to be set and then emit the signal *** + // *** otherwise will use the Previous values before being set. *** + adjustment ( true ); +} Index: sources/view/dg/data/post/VDGPOSTData.h =================================================================== diff -u --- sources/view/dg/data/post/VDGPOSTData.h (revision 0) +++ sources/view/dg/data/post/VDGPOSTData.h (revision b50431293b0690d6071f0fd58044880909cef01d) @@ -0,0 +1,61 @@ +/*! + * + * 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 VDGPOSTData.h + * \author (last) Behrouz NematiPour + * \author (original) Behrouz NematiPour + * \date (last) 27-Jul-2021 + * \date (original) 27-Jul-2021 + * + */ +#pragma once + +#include + +// Project +#include "main.h" // Doxygen : don't remove +#include "VAdjustmentResponseBase.h" +#include "MDGPostSingleResultData.h" +#include "MDGPostFinalResultData.h" + +namespace View { + +/*! + * \brief The VDGPOSTData class + * \details View for Model's Data representation. + * + * \sa Model::MDGPostSingleResult + * \sa Model::MDGPostFinalResult + * + */ +class VDGPOSTData : public VAdjustmentResponseBase +{ + Q_OBJECT + + // friends + friend class ::tst_views; + + // coco begin validated: + // The property adjustment_Triggered has to be always true + // and to always trigger the change event to work as a notifier for GUI + // has been manually tested that it works perfectly fine + TRIGGER ( bool , adjustment , 0) + // coco end + CONSTANT(quint32 , itemCount , GuiDGPOSTStates::NUM_OF_DG_POST_STATES) + + PROPERTY(bool , start , 0) + PROPERTY(quint32 , itemIndex , 0) + PROPERTY(bool , itemResult , 0) + + PROPERTY(bool , doneResult , 0) + PROPERTY(bool , done , 0) + + VIEW_DEC_CLASS(VDGPOSTData) + VIEW_DEC_SLOT (DGPostSingleResultData) + VIEW_DEC_SLOT (DGPostFinalResultData ) +}; +} Index: sources/view/hd/data/post/VHDPOSTData.cpp =================================================================== diff -u --- sources/view/hd/data/post/VHDPOSTData.cpp (revision 0) +++ sources/view/hd/data/post/VHDPOSTData.cpp (revision b50431293b0690d6071f0fd58044880909cef01d) @@ -0,0 +1,59 @@ +/*! + * + * 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 VHDPOSTData.cpp + * \author (last) Behrouz NematiPour + * \author (original) Behrouz NematiPour + * \date (last) 27-Jul-2021 + * \date (original) 27-Jul-2021 + * + */ +#include "VHDPOSTData.h" + +// Project +#include "GuiController.h" + +VIEW_DEF_CLASS_ADJUSTMENT(VHDPOSTData) + +/*! \brief Connection Initializer + \details All the class signal/slot connections are defined here. +*/ +void View::VHDPOSTData::initConnections() { + ACTION_VIEW_CONNECTION(HDPostSingleResultData); + ACTION_VIEW_CONNECTION(HDPostFinalResultData ); +} + +/*! + * \brief VHDPOSTData::onActionReceive + * \details received response model data handler + * \param vData - model data + */ +void View::VHDPOSTData::onActionReceive(const HDPostSingleResultData &vData) +{ + itemIndex ( vData.mIndex ); + itemResult ( vData.mResult ); + start ( true ); + + // *** has to be the last to let the information to be set and then emit the signal *** + // *** otherwise will use the Previous values before being set. *** + adjustment ( true ); +} + +/*! + * \brief VHDPOSTData::onActionReceive + * \details received response model data handler + * \param vData - model data + */ +void View::VHDPOSTData::onActionReceive(const HDPostFinalResultData &vData) +{ + doneResult ( vData.mResult ); + done ( true ); + + // *** has to be the last to let the information to be set and then emit the signal *** + // *** otherwise will use the Previous values before being set. *** + adjustment ( true ); +} Index: sources/view/hd/data/post/VHDPOSTData.h =================================================================== diff -u --- sources/view/hd/data/post/VHDPOSTData.h (revision 0) +++ sources/view/hd/data/post/VHDPOSTData.h (revision b50431293b0690d6071f0fd58044880909cef01d) @@ -0,0 +1,61 @@ +/*! + * + * 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 VHDPOSTData.h + * \author (last) Behrouz NematiPour + * \author (original) Behrouz NematiPour + * \date (last) 27-Jul-2021 + * \date (original) 27-Jul-2021 + * + */ +#pragma once + +#include + +// Project +#include "main.h" // Doxygen : don't remove +#include "VAdjustmentResponseBase.h" +#include "MHDPostSingleResultData.h" +#include "MHDPostFinalResultData.h" + +namespace View { + +/*! + * \brief The VHDPOSTData class + * \details View for Model's Data representation. + * + * \sa Model::MHDPostSingleResult + * \sa Model::MHDPostFinalResult + * + */ +class VHDPOSTData : public VAdjustmentResponseBase +{ + Q_OBJECT + + // friends + friend class ::tst_views; + + // coco begin validated: + // The property adjustment_Triggered has to be always true + // and to always trigger the change event to work as a notifier for GUI + // has been manually tested that it works perfectly fine + TRIGGER ( bool , adjustment , 0) + // coco end + CONSTANT(quint32 , itemCount , GuiHDPOSTStates::NUM_OF_POST_STATES) + + PROPERTY(bool , start , 0) + PROPERTY(quint32 , itemIndex , 0) + PROPERTY(bool , itemResult , 0) + + PROPERTY(bool , doneResult , 0) + PROPERTY(bool , done , 0) + + VIEW_DEC_CLASS(VHDPOSTData) + VIEW_DEC_SLOT (HDPostSingleResultData) + VIEW_DEC_SLOT (HDPostFinalResultData ) +}; +}