Index: denali.pro =================================================================== diff -u -r066258b65a1c41afe3828c92d2606d2642505d72 -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- denali.pro (.../denali.pro) (revision 066258b65a1c41afe3828c92d2606d2642505d72) +++ denali.pro (.../denali.pro) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -1,5 +1,6 @@ QT += widgets qml quick serialbus concurrent CONFIG += c++17 warn_on +# CONFIG += disable-desktop QMAKE_CXXFLAGS += -Wall -Werror -Wimplicit-fallthrough # -save-temps # see .ii #CONFIG += disable_crc @@ -51,6 +52,7 @@ sources/model \ sources/model/settings \ sources/model/hd/adjustment \ + sources/model/hd/adjustment/settings \ sources/model/hd/adjustment/pretreatment \ sources/model/hd/adjustment/treatment \ sources/model/hd/adjustment/posttreatment \ @@ -61,6 +63,7 @@ sources/model/hd/data/posttreatment \ sources/model/dg/data \ sources/model/dg/adjustment \ + sources/model/dg/adjustment/settings \ sources/view \ sources/view/settings \ sources/view/hd/adjustment \ @@ -87,6 +90,9 @@ sources/AlarmGenerator.h \ sources/ApplicationPost.h \ \ # Controllers + sources/model/dg/adjustment/settings/MAdjustDGRequests.h \ + sources/model/hd/adjustment/settings/MAdjustHDRequests.h \ + sources/storage/Settings.h \ sources/ApplicationController.h \ \ # ---------- Models ---------- sources/model/MModel.h \ @@ -101,7 +107,9 @@ \ # ---------- Models - HD - Adjustment sources/model/hd/adjustment/MAdjustRequestsBase.h \ sources/model/hd/adjustment/MAdjustPowerOff.h \ - sources/model/hd/adjustment/MAdjustHDVersionsResponse.h \ + \ # ---------- Models - HD - Adjustment - Settings + sources/model/hd/adjustment/settings/MAdjustHDVersionsResponse.h \ + sources/model/hd/adjustment/settings/MAdjustHDDateTimeResponse.h \ \ # ---------- Models - HD - Adjustment - Pre-Treatment sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustRequests.h \ sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustInitTreatmentResponse.h \ @@ -153,7 +161,9 @@ sources/model/hd/data/treatment/MTreatmentRecirculateData.h \ sources/model/hd/data/treatment/MTreatmentBloodPrimeData.h \ \ # ---------- Models - DG - Adjustment - sources/model/dg/adjustment/MAdjustDGVersionsResponse.h \ + \ # ---------- Models - DG - Adjustment - Settings + sources/model/dg/adjustment/settings/MAdjustDGVersionsResponse.h \ + sources/model/dg/adjustment/settings/MAdjustDGDateTimeResponse.h \ \ # ---------- Models - DG - Data - Pre-Treatment - Progress sources/model/dg/data/MDGFilterFlushData.h \ \ # ---------- Models - DG - Data @@ -182,15 +192,18 @@ sources/gui/GuiView.h \ sources/gui/GuiController.h \ \ # ---------- Views ---------- - sources/storage/Settings.h \ sources/view/VTreatmentCreate.h \ sources/view/VEventSpy.h \ sources/view/VView.h \ sources/view/VPowerOff.h \ + \ # ---------- Views - Settings + sources/view/settings/VDateTime.h \ + sources/view/settings/VSettings.h \ + sources/view/settings/VAdjustmentVersions.h \ \ # ---------- Views - Alarm sources/view/hd/alarm/VAlarmStatus.h \ \ # ---------- Views - HD - Adjustment - sources/view/hd/adjustment/VTreatmentAdjustmentVersions.h \ + sources/view/VAdjustmentResponseBase.h \ \ # ---------- Views - HD - Adjustment - Pre-Treatment sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentInitTreatment.h \ sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentWaterSample.h \ @@ -202,7 +215,6 @@ sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentPatientConnectionConfirm.h \ sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentStartTreatment.h \ \ # ---------- Views - HD - Adjustment - In-Treatment - sources/view/hd/adjustment/treatment/VTreatmentAdjustmentResponseBase.h \ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentDuration.h \ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentFlows.h \ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationState.h \ @@ -263,11 +275,7 @@ \ # Utility sources/utility/crc.h \ sources/utility/format.h \ - sources/utility/types.h \ - sources/view/settings/VSettings.h -# sources/configuration/display.h \ -# sources/configuration/sound.h \ -# sources/storage/settings.h \ + sources/utility/types.h SOURCES += \ \ # common @@ -278,6 +286,7 @@ sources/AlarmGenerator.cpp \ sources/ApplicationPost.cpp \ \ # Controllers + sources/storage/Settings.cpp \ sources/ApplicationController.cpp \ \ # ---------- Models ---------- sources/model/MAbstract.cpp \ @@ -290,7 +299,9 @@ sources/model/hd/alarm/MAlarmClearedCondition.cpp \ \ # ---------- Models - HD - Adjustment sources/model/hd/adjustment/MAdjustPowerOff.cpp \ - sources/model/hd/adjustment/MAdjustHDVersionsResponse.cpp \ + \ # ---------- Models - HD - Adjustment - Settings + sources/model/hd/adjustment/settings/MAdjustHDVersionsResponse.cpp \ + sources/model/hd/adjustment/settings/MAdjustHDDateTimeResponse.cpp \ \ # ---------- Models - HD - Adjustment - Pre-Treatment sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustInitTreatmentResponse.cpp \ sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustParametersValidationResponse.cpp \ @@ -340,7 +351,9 @@ sources/model/hd/data/treatment/MTreatmentRecirculateData.cpp \ sources/model/hd/data/treatment/MTreatmentBloodPrimeData.cpp \ \ # ---------- Models - DG - Adjustment - sources/model/dg/adjustment/MTreatmentAdjustDGVersionsResponse.cpp \ + \ # ---------- Models - DG - Adjustment - Settings + sources/model/dg/adjustment/settings/MAdjustDGVersionsResponse.cpp \ + sources/model/dg/adjustment/settings/MAdjustDGDateTimeResponse.cpp \ \ # ---------- Models - DG - Data - Pre-Treatment - Progress sources/model/dg/data/MDGFilterFlushData.cpp \ \ # ---------- Models - DG - Data @@ -368,14 +381,17 @@ sources/gui/GuiView.cpp \ sources/gui/GuiController.cpp \ \ # ---------- Views ---------- - sources/storage/Settings.cpp \ sources/view/VTreatmentCreate.cpp \ sources/view/VEventSpy.cpp \ sources/view/VPowerOff.cpp \ \ # ---------- Views - Alarm sources/view/hd/alarm/VAlarmStatus.cpp \ + \ # ---------- Views - Settings + sources/view/settings/VSettings.cpp \ + sources/view/settings/VDateTime.cpp \ + sources/view/settings/VAdjustmentVersions.cpp \ \ # ---------- Views - HD - Adjustment - sources/view/hd/adjustment/VTreatmentAdjustmentVersions.cpp \ + sources/view/VAdjustmentResponseBase.cpp \ \ # ---------- Views - HD - Adjustment - Pre-Treatment sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentInitTreatment.cpp \ sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentWaterSample.cpp \ @@ -387,7 +403,6 @@ sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentPatientConnectionConfirm.cpp \ sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentStartTreatment.cpp \ \ # ---------- Views - HD - Adjustment - In-Treatment - sources/view/hd/adjustment/treatment/VTreatmentAdjustmentResponseBase.cpp \ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentDuration.cpp \ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentFlows.cpp \ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationState.cpp \ @@ -450,10 +465,8 @@ \ # Utility sources/utility/crc.cpp \ sources/utility/format.cpp \ - sources/utility/types.cpp \ - sources/view/settings/VSettings.cpp + sources/utility/types.cpp - RESOURCES += \ denali.qrc Index: denali.pro.user =================================================================== diff -u -r066258b65a1c41afe3828c92d2606d2642505d72 -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- denali.pro.user (.../denali.pro.user) (revision 066258b65a1c41afe3828c92d2606d2642505d72) +++ denali.pro.user (.../denali.pro.user) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -1,6 +1,6 @@ - + EnvironmentId Index: denali.qrc =================================================================== diff -u -r066258b65a1c41afe3828c92d2606d2642505d72 -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- denali.qrc (.../denali.qrc) (revision 066258b65a1c41afe3828c92d2606d2642505d72) +++ denali.qrc (.../denali.qrc) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -4,9 +4,13 @@ sources/gui/qml/pages/MainHome.qml sources/gui/qml/pages/ManagerStack.qml sources/gui/qml/pages/ManagerHome.qml - sources/gui/qml/pages/SettingsStack.qml - sources/gui/qml/pages/SettingsHome.qml + + sources/gui/qml/pages/settings/SettingsBase.qml + sources/gui/qml/pages/settings/SettingsStack.qml + sources/gui/qml/pages/settings/SettingsHome.qml + sources/gui/qml/pages/settings/SettingsDateTime.qml + sources/gui/qml/dialogs/PowerOff.qml sources/gui/qml/dialogs/AutoHideInfo.qml @@ -35,7 +39,6 @@ resources/images/Clock-Plus.png resources/images/Wave-Minus.png resources/images/Wave-Plus.png - resources/images/microsd.png resources/images/check.png resources/images/checkCircle.png resources/images/OffGray.png @@ -102,6 +105,7 @@ sources/gui/qml/components/WaitDone.qml sources/gui/qml/components/TimeCircle.qml sources/gui/qml/components/Footer.qml + sources/gui/qml/components/TextEntry.qml sources/gui/qml/compounds/PressureRangeSlider.qml @@ -115,6 +119,8 @@ sources/gui/qml/main.qml sources/gui/qml/AlarmItem.qml sources/gui/qml/PowerItem.qml + sources/gui/qml/Keyboard.qml + sources/gui/qml/SDItem.qml @@ -142,7 +148,7 @@ sources/gui/qml/pages/treatment/TreatmentStack.qml - sources/gui/qml/pages/treatment/TreatmentStart.qml + sources/gui/qml/pages/treatment/TreatmentHome.qml sources/gui/qml/pages/treatment/TreatmentBloodPrime.qml sources/gui/qml/pages/treatment/TreatmentUltrafiltrationItem.qml Index: en_US.udic =================================================================== diff -u -r98581b325c24eb5ef0ce0ce475ad15320d659140 -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- en_US.udic (.../en_US.udic) (revision 98581b325c24eb5ef0ce0ce475ad15320d659140) +++ en_US.udic (.../en_US.udic) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -51,3 +51,20 @@ VPost MPre groupheader +MAlarm +qtvirtualkeyboard +HDRequests +HDDate +RTC +DGRequests +DGDate +DG +VAdjustment +DEFinition +DEClaration +VDate +hh +ss +yyyy +MessageID +unhandled Index: main.cpp =================================================================== diff -u -r821bf955d0ba7e028bccfee7c04ca77cf80a0bd4 -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- main.cpp (.../main.cpp) (revision 821bf955d0ba7e028bccfee7c04ca77cf80a0bd4) +++ main.cpp (.../main.cpp) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -266,6 +266,9 @@ signal(SIGTERM, signalhandler); #endif + // setting the environment for the keyboard. + qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard")); + //! - Qt Application initialization and parameters settings // Qt Core Application parameters settings QApplication::setApplicationName(QLatin1String("Denali")); Index: resources/images/microsd.png =================================================================== diff -u -r4df19fe88c454bd54abcdaf983be59464c5ef5bc -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f Binary files differ Index: scripts/setup.sh =================================================================== diff -u -r56e378f7504701b9e9a9dccaf205aef2fd52c58e -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- scripts/setup.sh (.../setup.sh) (revision 56e378f7504701b9e9a9dccaf205aef2fd52c58e) +++ scripts/setup.sh (.../setup.sh) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -27,6 +27,10 @@ fi done +echo "Setup the timezone (PST)" +rm -f /etc/localtime +ln -s /usr/share/zoneinfo/America/Los_Angeles /etc/localtime + echo "Setup the hardware clock" hwclock -w Index: sources/canbus/MessageDispatcher.cpp =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/canbus/MessageDispatcher.cpp (.../MessageDispatcher.cpp) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/canbus/MessageDispatcher.cpp (.../MessageDispatcher.cpp) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -628,6 +628,32 @@ onActionTransmit(GuiActionType::ID_AdjustTreatmentLogReq, mData); } +/*! + * \brief MessageDispatcher::onAdjustment + * \details This method transmits the HD Set Date Time Denali message. + * \param vData - Data model contains the epoch time + * \return void + */ +void MessageDispatcher::onAdjustment(const AdjustHDDateTimeRequestData &vData) +{ + QVariantList mData; + mData += vData.mEpoch ; + onActionTransmit(GuiActionType::ID_AdjustHDDateTimeReq, mData); +} + +/*! + * \brief MessageDispatcher::onAdjustment + * \details This method transmits the DG Set Date Time Denali message. + * \param vData - Data model contains the epoch time + * \return void + */ +void MessageDispatcher::onAdjustment(const AdjustDGDateTimeRequestData &vData) +{ + QVariantList mData; + mData += vData.mEpoch ; + onActionTransmit(GuiActionType::ID_AdjustDGDateTimeReq, mData); +} + // ---------------------------------------------------------------------------------------------------- /*! Index: sources/canbus/MessageDispatcher.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/canbus/MessageDispatcher.h (.../MessageDispatcher.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/canbus/MessageDispatcher.h (.../MessageDispatcher.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -139,6 +139,9 @@ GuiActionType::ID_AdjustPatientDisconnectionConfirmReq , GuiActionType::ID_AdjustDisposablesRemovalConfirmReq , GuiActionType::ID_AdjustTreatmentLogReq , + // Settings + GuiActionType::ID_AdjustHDDateTimeReq , + GuiActionType::ID_AdjustDGDateTimeReq , }; public slots: Index: sources/canbus/MessageGlobals.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -192,6 +192,12 @@ {Gui::GuiActionType::ID_AdjustHDVersionsRsp , 9 }, // 9 parameters each 4bytes {Gui::GuiActionType::ID_AdjustDGVersionsRsp , 9 }, // 9 parameters each 4bytes + // ---- RTC + {Gui::GuiActionType::ID_AdjustHDDateTimeReq , 1 * 4 }, // 1 parameters each 4bytes + {Gui::GuiActionType::ID_AdjustHDDateTimeRsp , 2 * 4 }, // 2 parameters each 4bytes + {Gui::GuiActionType::ID_AdjustDGDateTimeReq , 1 * 4 }, // 1 parameters each 4bytes + {Gui::GuiActionType::ID_AdjustDGDateTimeRsp , 2 * 4 }, // 2 parameters each 4bytes + // ---- {Gui::GuiActionType::ID_CANBusFaultCount , 1 }, {Gui::GuiActionType::ID_RawData , 255 }, @@ -261,7 +267,7 @@ // UI listens occasionally eChlid_DG_UI = 0x070, ///< DG => UI - eChlid_UI_DG = eChlid_UI_Sync , ///< No direct channel has been defined between DG&UI, May be required for logging + eChlid_UI_DG = 0x110, ///< UI => DG [Out] }; /*! Index: sources/canbus/MessageInterpreter.cpp =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -232,7 +232,10 @@ break; case Gui::GuiActionType::ID_PowerOff : INTERPRET_TRANSMIT_MESSAGE(AdjustPowerOffRequestData ); break; + // Settings case Gui::GuiActionType::ID_AdjustVersionsReq : INTERPRET_TRSMT_MT_MESSAGE(AdjustVersionsRequestData ); break; + case Gui::GuiActionType::ID_AdjustHDDateTimeReq : INTERPRET_TRANSMIT_MESSAGE(AdjustHDDateTimeRequestData ); break; + case Gui::GuiActionType::ID_AdjustDGDateTimeReq : INTERPRET_TRANSMIT_MESSAGE(AdjustDGDateTimeRequestData ); break; // Pre-Treatment case Gui::GuiActionType::ID_AdjustInitTreatmentReq : INTERPRET_TRANSMIT_MESSAGE(AdjustInitTreatmentRequestData ); break; case Gui::GuiActionType::ID_AdjustParametersValidationReq : INTERPRET_TRANSMIT_MESSAGE(AdjustParametersValidationRequestData ); break; @@ -339,6 +342,10 @@ case Gui::GuiActionType::ID_PowerOff : ok = notify(vMessage, vData, Gui::GuiActionType::ID_PowerOff ); break; case Gui::GuiActionType::ID_ShuttingDown : ok = true; LOG_EVENT("HD,ShuttingDown"); break; // TODO : implement notify<>() + // ----- Settings + case Gui::GuiActionType::ID_AdjustHDVersionsRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustHDVersionsRsp ); break; + case Gui::GuiActionType::ID_AdjustHDDateTimeRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustHDDateTimeRsp ); break; + // ----- States case Gui::GuiActionType::ID_HDOperationModeData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_HDOperationModeData ); break; case Gui::GuiActionType::ID_PreTreatmentStates : ok = notify(vMessage, vData, Gui::GuiActionType::ID_PreTreatmentStates ); break; @@ -386,7 +393,6 @@ case Gui::GuiActionType::ID_AdjustRinsebackRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustRinsebackRsp ); break; case Gui::GuiActionType::ID_AdjustRecirculateRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustRecirculateRsp ); break; case Gui::GuiActionType::ID_AdjustTreatmentEndRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustTreatmentEndRsp ); break; - case Gui::GuiActionType::ID_AdjustHDVersionsRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustHDVersionsRsp ); break; // ----- In-Treatment Adjust case Gui::GuiActionType::ID_AdjustDisposableRemovalConfirmRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustDisposableRemovalConfirmRsp ); break; @@ -451,6 +457,7 @@ // 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; // unhandled messages: these will only be logged as received message // there has nothing been defined for these messages. Index: sources/gui/GuiGlobals.cpp =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/gui/GuiGlobals.cpp (.../GuiGlobals.cpp) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/gui/GuiGlobals.cpp (.../GuiGlobals.cpp) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -24,10 +24,12 @@ // Project #include "VView.h" - +// Settings #include "VSettings.h" #include "VAlarmStatus.h" #include "VPowerOff.h" +#include "VAdjustmentVersions.h" +#include "VDateTime.h" // states data #include "VHDOperationModeData.h" #include "VPreTreatmentStatesData.h" @@ -90,8 +92,8 @@ #include "VPostTreatmentAdjustTreatmentLog.h" // ----- #include "VTreatmentAdjustmentEnd.h" -#include "VTreatmentAdjustmentVersions.h" + namespace Gui { MainView *_viewer = nullptr; Index: sources/gui/GuiGlobals.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -75,6 +75,18 @@ ID_DGCheckIn = 0x0600, ID_KeepAlive = 0x0700, + // ----- Settings + // Version + ID_AdjustVersionsReq = 0x1C00, // 28 + ID_AdjustHDVersionsRsp = 0x1D00, // 29 + ID_AdjustDGVersionsRsp = 0x1E00, // 30 + + // RTC + ID_AdjustHDDateTimeReq = 0x6D00, // 109 + ID_AdjustHDDateTimeRsp = 0x6E00, // 110 + ID_AdjustDGDateTimeReq = 0x6F00, // 111 + ID_AdjustDGDateTimeRsp = 0x7000, // 112 + // HD State Messages ID_HDOperationModeData = 0x2500, // 37 ID_PreTreatmentStates = 0x5C00, // 92 @@ -206,12 +218,6 @@ ID_AdjustTreatmentLogReq = 0x7500, // 117 ID_AdjustTreatmentLogRsp = 0x7600, // 118 - // Independent Bidirectional - ID_AdjustVersionsReq = 0x1C00, // 28 - ID_AdjustHDVersionsRsp = 0x1D00, // 29 - ID_AdjustDGVersionsRsp = 0x1E00, // 30 - - }; enum class GuiActionsData_Enum /*: quint8 QML doesn't support*/ { Index: sources/gui/qml/AlarmItem.qml =================================================================== diff -u -r99a56ec30f1ca4f401e744766bde4f6fac291752 -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/gui/qml/AlarmItem.qml (.../AlarmItem.qml) (revision 99a56ec30f1ca4f401e744766bde4f6fac291752) +++ sources/gui/qml/AlarmItem.qml (.../AlarmItem.qml) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -40,6 +40,10 @@ readonly property alias isSilenced : vAlarmStatus.alarm_Flag_alarmsSilenced readonly property alias timeout : vAlarmStatus.alarm_MuteTimeout + function clearAlarm() { + vAlarmStatus.doClearCondition() + } + // Alarms function alarmMinimize() { _alarmDialog .visible = false @@ -99,7 +103,6 @@ // by the next alarm status received. // see also the "Connections { target: vAlarmStatus" implementation vAlarmStatus.alarm_KeepMinimized = true - // DEBUG: vAlarmStatus.doClearCondition() } } @@ -117,15 +120,14 @@ onAlarm_Flag_UserMustAckChanged : vAlarmStatus.alarm_KeepMinimized = false onAlarm_AlarmIDChanged : vAlarmStatus.alarm_KeepMinimized = false onAlarm_Flag_alarmsSilencedChanged : vAlarmStatus.alarm_KeepMinimized = vAlarmStatus.alarm_Flag_alarmsSilenced - onAlarm_PriorityChanged: { - [ + onAlarm_PriorityChanged: [ _alarmDialog.titleBarBackground, _alarmDialog.titleBarForeground, _alarmDialog.backgroundColor , _alarmDialog.textColor , - ] = Colors.alarmPriorityColors(vAlarmStatus.alarm_Priority) - } + ] = Colors.alarmPriorityColors(vAlarmStatus.alarm_Priority) + onDidAlarmRaise: { let silenceMinimize = false if (vAlarmStatus.alarm_Flag_alarmsSilenced && silenceMinimize) { @@ -136,9 +138,9 @@ alarmMinimize() } else { - if (! vAlarmStatus.alarm_KeepMinimized) { - alarmMaximize() - } + if (! vAlarmStatus.alarm_KeepMinimized) { + alarmMaximize() + } } } Index: sources/gui/qml/Keyboard.qml =================================================================== diff -u --- sources/gui/qml/Keyboard.qml (revision 0) +++ sources/gui/qml/Keyboard.qml (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -0,0 +1,38 @@ +/*! + * + * 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 Keyboard.qml + * \author (last) Behrouz NematiPour + * \date (last) 16-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 16-Apr-2021 + * + */ + +// Qt +import QtQuick 2.12 +import QtQuick.VirtualKeyboard 2.2 + +// Project +// C++ imports + + +// Qml imports + +/*! + * \brief Keyboard is the single keyboard in the entire applicaiton. + */ +InputPanel { id : _root + function setVisible(vVisible) { + active = vVisible + } + + y: Qt.inputMethod.visible ? parent.height - _root.height : parent.height + anchors.left: parent.left + anchors.right: parent.right + Behavior on y { NumberAnimation { duration: 250 } } +} Index: sources/gui/qml/SDItem.qml =================================================================== diff -u --- sources/gui/qml/SDItem.qml (revision 0) +++ sources/gui/qml/SDItem.qml (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -0,0 +1,48 @@ +/*! + * + * 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 SDItem.qml + * \author (last) Behrouz NematiPour + * \date (last) 16-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 16-Apr-2021 + * + */ + +// Qt +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. + */ +Rectangle { id: _SDNotification// TEST : SD-Card not present should be handled with better indication(s). + color : Colors.transparent + border.color : ! _GuiView.sdIsReady ? Colors.red : _GuiView.sdIsReadOnly ? "gray" : "green" + anchors { + top : parent.top + right : parent.right + topMargin : 5 + rightMargin : 5 + } + width : 28 + height: width + radius: width + Text { id: _SDText + anchors.centerIn: parent + color: ! _GuiView.sdIsReady ? Colors.red : _GuiView.sdIsReadOnly ? "gray" : Colors.white + text: qsTr("SD") + font.pixelSize: 12 + font.bold: true + } +} Index: sources/gui/qml/components/MainMenu.qml =================================================================== diff -u -r73091a6f5717c0fc88e236c06c618ad361f30a3c -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/gui/qml/components/MainMenu.qml (.../MainMenu.qml) (revision 73091a6f5717c0fc88e236c06c618ad361f30a3c) +++ sources/gui/qml/components/MainMenu.qml (.../MainMenu.qml) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -30,7 +30,7 @@ Bottom } - property variant titles : [] + property var titles : [] property bool hidden : false property int position : MainMenu.Position.Bottom property bool hasRightText : false @@ -53,7 +53,7 @@ * this section is used as the calculation section whcih soppose not to be changed by user. */ QtObject { id: _private - readonly property variant repeaterTitles: hasRightText ? titles.slice(0,titles.length - 1) : titles + readonly property var repeaterTitles: hasRightText ? titles.slice(0,titles.length - 1) : titles readonly property string rightText : titles.length ? titles[titles.length - 1] : "" readonly property int partitionWidth: _row.width / ( _private.repeaterTitles.length * 2 + 1) } @@ -119,11 +119,12 @@ anchors.right: _rightTouchRect.left anchors.verticalCenter: parent.verticalCenter } - TouchRect { id : _rightTouchRect - visible: hasRightText - width: partitionWidth + rightTextGaps - height: parent.height - text.text: _private.rightText + TouchRect { id : _rightTouchRect + animated : false + visible : hasRightText + width : partitionWidth + rightTextGaps + height : parent.height + text.text : _private.rightText border.width: 0 onPressed: { itemPressed( titles.length ? titles.length - 1 : -1 ) Index: sources/gui/qml/components/TextEntry.qml =================================================================== diff -u --- sources/gui/qml/components/TextEntry.qml (revision 0) +++ sources/gui/qml/components/TextEntry.qml (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -0,0 +1,95 @@ +/*! + * + * 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 TextEntry.qml + * \author (last) Peter Lucia + * \date (last) 07-Jan-2021 + * \author (original) Peter Lucia + * \date (original) 07-Jan-2021 + * + */ + +// Qt +import QtQuick 2.12 + +// Project +// Qml imports +import "qrc:/globals" + +Item { id: _root + enum Constants { + TextInputWidth = 350 , + TextInputHeight = 50 , + TextInputLineWidth = 100 + } + + property alias textInput : _input + property alias line : _line + property alias label : _label + property alias labelText : _label.text + property alias validator : _input.validator + property alias labelVisible : _label.visible + + signal enterPressed() + + width : TextEntry.TextInputWidth + height : TextEntry.TextInputHeight + + Text { id: _label + anchors { + left: parent.left + top: parent.top + } + color: Colors.textMain + font.pixelSize: Fonts.fontPixelTextRectExtra + } + + TextInput { id: _input + anchors { + left: _label.right + } + + color: acceptableInput ? Colors.textMain : Colors.red + text: "" + font.pixelSize: Fonts.fontPixelTextRectExtra + selectionColor: Colors.borderButtonHalfDarker + height: parent.height + width: Variables.textInputLineWidth + horizontalAlignment: TextInput.AlignHCenter + inputMethodHints: Qt.ImhDigitsOnly + selectedTextColor: acceptableInput ? Colors.textMain : Colors.red + activeFocusOnPress: true + onPreeditTextChanged: { + console.debug(preeditText) + } + + onFocusChanged: { + if (focus) { + selectAll() + _keyboard.active = false + } + } + Keys.onPressed: { + if (! acceptableInput) { + event + } + } + + onAccepted: { + _root.enterPressed() + } + } + + Line { id: _line + color: Colors.borderButtonHalfDarker + width: Variables.textInputLineWidth + anchors { + top: _input.bottom + left: _input.left + } + } +} Index: sources/gui/qml/compounds/TouchGrid.qml =================================================================== diff -u -r066258b65a1c41afe3828c92d2606d2642505d72 -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/gui/qml/compounds/TouchGrid.qml (.../TouchGrid.qml) (revision 066258b65a1c41afe3828c92d2606d2642505d72) +++ sources/gui/qml/compounds/TouchGrid.qml (.../TouchGrid.qml) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -59,7 +59,7 @@ onClicked : _root.itemClicked(index) Image { - visible: _touchItem.enabled && ! _touchItem.isPressed + visible: _touchItem.enabled && ! _touchItem.isPressed && _root.itemsText[index] anchors.right: _touchItem.right anchors.verticalCenter: _touchItem.verticalCenter width : Variables.arrowWidth @@ -68,7 +68,7 @@ } Line { - visible: ! _touchItem.isPressed + visible: ! _touchItem.isPressed && _root.itemsText[index] color: _touchItem.enabled ? Colors.borderButtonHalfDarker : Colors.borderDisableButton anchors.left : _touchItem.left anchors.right : _touchItem.right Index: sources/gui/qml/globals/Variables.qml =================================================================== diff -u -rc6cfb5043fc9c29cc039e36915368bcd3a63baa6 -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision c6cfb5043fc9c29cc039e36915368bcd3a63baa6) +++ sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -123,12 +123,46 @@ readonly property int notificationBarIconHeight : 30 readonly property int notificationBarIconWidth : 30 + readonly property int rinsebackIconDiameterDefault : 85 + readonly property int rinsebackIconDiameterResumePause : 110 + + readonly property int settingsArrowHeight : 30 + readonly property int settingsArrowWidth : 24 + readonly property int settingsButtonWidth : 300 + readonly property int settingsButtonHeight : 85 + readonly property int settingsMargin : 75 + readonly property int settingsSpacing : 20 + readonly property int settingsInputWidth : 225 + + readonly property int settingsNotificationMargin : 10 + + readonly property int settingsBLEListViewWidth : 360 + readonly property int settingsBLEItemRightMargin : 20 + readonly property int settingsBLEButtonWidth : settingsButtonWidth + readonly property int settingsBLEButtonHeight : settingsButtonHeight + readonly property int settingsBLEMargin : settingsMargin + readonly property int settingsBLEListViewMargin : 25 readonly property int settingsOptionWidth : 550 readonly property int settingsOptionHeight : 50 - readonly property int rinsebackIconDiameterDefault : 85 - readonly property int rinsebackIconDiameterResumePause : 110 + readonly property int settingsWIFIButtonWidth : settingsButtonWidth + readonly property int settingsWIFIButtonHeight : settingsButtonHeight + readonly property int settingsWIFIMargin : settingsMargin + readonly property int settingsWIFIInputWidth : settingsInputWidth + readonly property int settingsWIFISpacing : settingsSpacing + readonly property int settingsWIFINetworkHeight : 85 + readonly property int settingsWIFINetworkWidth : 375 + readonly property int settingsWIFINetworksWidth : settingsWIFINetworkWidth + 50 + readonly property int settingsWIFIBottomMargin : 15 + readonly property int textInputWidth : 350 + readonly property int textInputHeight : 50 + readonly property int textInputLineWidth : 100 + + readonly property int settingsDateTimeSetMargin : settingsMargin + readonly property int settingsDateTimeSetSpacing : settingsSpacing + readonly property int settingsDateTimeSetInputWidth : settingsInputWidth + // ---------- < PRS > Related Section ---------- // Min/Max readonly property int bloodFlowMin : 100 Index: sources/gui/qml/main.qml =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/gui/qml/main.qml (.../main.qml) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/gui/qml/main.qml (.../main.qml) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -21,11 +21,13 @@ import Gui.View 0.1 import Gui.Actions 0.1 -import VSettings 0.1 // View classes import VHDAccelerometer 0.1 -import VTreatmentAdjustmentVersions 0.1 +// Settings +import VSettings 0.1 +import VAdjustmentVersions 0.1 +import VDateTime 0.1 // States views import VHDOperationMode 0.1 @@ -89,6 +91,7 @@ import "qrc:/globals" import "qrc:/pages" import "qrc:/pages/treatment" +import "qrc:/pages/settings" import "qrc:/components" import "qrc:/dialogs" @@ -100,6 +103,8 @@ height: Variables.applicationHeight VSettings { id: vSettings } + VAdjustmentVersions { id: vAdjustmentVersions } + VDateTime { id: vDateTime } VHDOperationMode { id: vHDOperationMode } VPreTreatmentStates { id: vPreTreatmentStates } @@ -158,7 +163,6 @@ VTreatmentAdjustmentRinseback { id: vTreatmentAdjustmentRinseback } VTreatmentAdjustmentRecirculate { id: vTreatmentAdjustmentRecirculate } VTreatmentAdjustmentEnd { id: vTreatmentAdjustmentEnd } - VTreatmentAdjustmentVersions { id: vTreatmentAdjustmentVersions } // --- Post Treatment VPostTreatmentAdjustmentPatientDisconnectionConfirm { id: vPostTreatmentAdjustmentPatientDisconnectionConfirm } @@ -211,27 +215,11 @@ font.pixelSize: 14 } - Rectangle { // TEST : SD-Card not present should be handled with better indication(s). - color : ! _GuiView.sdIsReady ? "red" : _GuiView.sdIsReadOnly ? "gray" : "green" - anchors { - top : parent.top - right : parent.right - topMargin : 5 - rightMargin : 5 - } - width : 25 - height: 25 - radius: width - Image { id: _imageMicrosd - anchors.fill: parent - source: "qrc:/images/iMicroSD" - } - visible: true - } + SDItem { } + PowerItem { id: _powerItem } + AlarmItem { id: _alarmItem } + Keyboard { id: _keyboard } - PowerItem { id: _powerItem } - AlarmItem { id: _alarmItem } - // NotificationBar has to be anchored to the main menu and if it is moved into the AlarmItem // then cannot be anchored. NotificationBar { id: _alarmBar Index: sources/gui/qml/pages/MainHome.qml =================================================================== diff -u -r7cc15ae5968205b241a08ca4646f283b8bf97b03 -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/gui/qml/pages/MainHome.qml (.../MainHome.qml) (revision 7cc15ae5968205b241a08ca4646f283b8bf97b03) +++ sources/gui/qml/pages/MainHome.qml (.../MainHome.qml) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -23,7 +23,7 @@ import "qrc:/components" /*! - * \brief TreatmentHome is the screen + * \brief MainHome is the screen * which is the default screen in the "Treatment" stack */ ScreenItem { id: _root Index: sources/gui/qml/pages/ManagerHome.qml =================================================================== diff -u -r0a4abcc41defc031ae20dd79f9550619bc6c9806 -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/gui/qml/pages/ManagerHome.qml (.../ManagerHome.qml) (revision 0a4abcc41defc031ae20dd79f9550619bc6c9806) +++ sources/gui/qml/pages/ManagerHome.qml (.../ManagerHome.qml) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -277,14 +277,14 @@ y: row(4.5) title: qsTr(" HD Ver ") model: [ "v%1.%2.%3-%4 %5 v%6.%7 %8" - .arg(vTreatmentAdjustmentVersions.hdVerMajor) - .arg(vTreatmentAdjustmentVersions.hdVerMinor) - .arg(vTreatmentAdjustmentVersions.hdVerMicro) - .arg(vTreatmentAdjustmentVersions.hdVerBuild) - .arg(vTreatmentAdjustmentVersions.hdVerFPGAId) - .arg(vTreatmentAdjustmentVersions.hdVerFPGAMajor) - .arg(vTreatmentAdjustmentVersions.hdVerFPGAMinor) - .arg(vTreatmentAdjustmentVersions.hdVerFPGALab) + .arg(vAdjustmentVersions.hdVerMajor) + .arg(vAdjustmentVersions.hdVerMinor) + .arg(vAdjustmentVersions.hdVerMicro) + .arg(vAdjustmentVersions.hdVerBuild) + .arg(vAdjustmentVersions.hdVerFPGAId) + .arg(vAdjustmentVersions.hdVerFPGAMajor) + .arg(vAdjustmentVersions.hdVerFPGAMinor) + .arg(vAdjustmentVersions.hdVerFPGALab) ] textObjectName: "_HDVersions" } @@ -294,22 +294,22 @@ width : 150 height : 35 text.text : "Get Version" - onClicked : vTreatmentAdjustmentVersions.doAdjustment() + onClicked : vAdjustmentVersions.doAdjustment() } DebugDataColumn { id: _DGVersionsColumn x: col(6) y: row(5.4) title: qsTr(" DG Ver ") model: [ "v%1.%2.%3-%4 %5 v%6.%7 %8" - .arg(vTreatmentAdjustmentVersions.dgVerMajor) - .arg(vTreatmentAdjustmentVersions.dgVerMinor) - .arg(vTreatmentAdjustmentVersions.dgVerMicro) - .arg(vTreatmentAdjustmentVersions.dgVerBuild) - .arg(vTreatmentAdjustmentVersions.dgVerFPGAId) - .arg(vTreatmentAdjustmentVersions.dgVerFPGAMajor) - .arg(vTreatmentAdjustmentVersions.dgVerFPGAMinor) - .arg(vTreatmentAdjustmentVersions.dgVerFPGALab) + .arg(vAdjustmentVersions.dgVerMajor) + .arg(vAdjustmentVersions.dgVerMinor) + .arg(vAdjustmentVersions.dgVerMicro) + .arg(vAdjustmentVersions.dgVerBuild) + .arg(vAdjustmentVersions.dgVerFPGAId) + .arg(vAdjustmentVersions.dgVerFPGAMajor) + .arg(vAdjustmentVersions.dgVerFPGAMinor) + .arg(vAdjustmentVersions.dgVerFPGALab) ] textObjectName: "_DGVersions" } Fisheye: Tag 506a9e3db1a20bda1685e38c5e9041005c9a4a4f refers to a dead (removed) revision in file `sources/gui/qml/pages/SettingsHome.qml'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 506a9e3db1a20bda1685e38c5e9041005c9a4a4f refers to a dead (removed) revision in file `sources/gui/qml/pages/SettingsStack.qml'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/gui/qml/pages/settings/SettingsBase.qml =================================================================== diff -u --- sources/gui/qml/pages/settings/SettingsBase.qml (revision 0) +++ sources/gui/qml/pages/settings/SettingsBase.qml (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -0,0 +1,96 @@ +/*! + * + * 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 SettingsBase.qml + * \author (last) Behrouz NematiPour + * \date (last) 14-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 14-Apr-2021 + * + */ + +// Qt +import QtQuick 2.12 + +// Qml imports +import "qrc:/globals" +import "qrc:/components" + +/*! + * \brief SettingsBase is the screen + * which is the parent screen of all setting screens in the "Settings" stack + */ +ScreenItem { id: _root + objectName: "_SettingsBase" + + readonly + property int topMarginTitle : 100 + property int topMarginContent : 200 + + property int itemIndex : 0 + property alias title : _titleText.text + + property alias notificationText : _information.text + + property alias backVisible : _backButton .visible + property alias backEnabled : _backButton .enabled + property alias confirmVisible : _confirmButton.visible + property alias confirmEnabled : _confirmButton.enabled + property alias confirmText : _confirmButton.text + + signal backClicked() + signal confirmClicked() + + BackButton { id : _backButton + objectName: "_backButton" + visible: true + enabled: true + anchors { + top : _root.top + left : _root.left + } + onClicked: { + _root.backClicked() + pop() + } + } + + ConfirmButton { id : _confirmButton + objectName: "_confirmButton" + visible: true + enabled: true + anchors { + left : undefined + top : parent.top + right : parent.right + } + onClicked: _root.confirmClicked() + } + + Text { id: _titleText + anchors { + top : _root.top + topMargin : topMarginTitle + horizontalCenter: parent.horizontalCenter + } + text : itemsText[itemIndex] + color : Colors.textMain + font.pixelSize : Fonts.fontPixelTitle + } + // this notification shall not be confused with the _notification in the parent ModalDailog + // this meant to be used specifically as current state notification like paused/off in UF + // it is also available in TreatmentAdjustmentFlow and TreatmentAdjustmentDuration but not used. + NotificationBarSmall { id: _information + visible : true // false + color : Colors.transparent + textColor : Colors.white + imageSource : "" + text : "Test Notification" + anchors.bottomMargin: Variables.mainMenuHeight + Variables.minVGap + } +} + Index: sources/gui/qml/pages/settings/SettingsDateTime.qml =================================================================== diff -u --- sources/gui/qml/pages/settings/SettingsDateTime.qml (revision 0) +++ sources/gui/qml/pages/settings/SettingsDateTime.qml (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -0,0 +1,171 @@ +/*! + * + * 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 SettingsDateTimeSet.qml + * \author (last) Peter Lucia + * \date (last) 14-Mar-2021 + * \author (original) Peter Lucia + * \date (original) 14-Mar-2021 + * + */ + +// Qt +import QtQuick 2.12 + +// Project +import Gui.Actions 0.1; + +// Qml imports +import "qrc:/globals" +import "qrc:/components" + +/*! + * \brief SettingsDateTimeSet is used to adjust the + * date and time on the device + */ +SettingsBase { id: _root + + property int labelWidth : 275 + readonly property bool isValid : + _hours .textInput.acceptableInput && + _minutes.textInput.acceptableInput && + _year .textInput.acceptableInput && + _month .textInput.acceptableInput && + _day .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 ) + } + + onVisibleChanged: { // it seems entering in the TextInput by keyboard breaks the binding + _hours .textInput.text = vDateTime.hour + _minutes.textInput.text = vDateTime.minute + _month .textInput.text = vDateTime.month + _day .textInput.text = vDateTime.day + _year .textInput.text = vDateTime.year + } + + Column { + spacing: 75 + anchors.top: parent.top + anchors.topMargin: topMarginContent + anchors.horizontalCenter: parent.horizontalCenter + + Row { // time + spacing: 5 + Text { id: _timeLabel + width: labelWidth + text: qsTr("Time (HH:MM)") + color: Colors.textMain + font.pixelSize: Fonts.fontPixelTextRectExtra + } + + TextEntry { id: _hours + label.visible: false + width: Variables.textInputLineWidth + validator : IntValidator{ + bottom : 0 + top : 24 + } + onEnterPressed: { + if (textInput.acceptableInput) { + _minutes.textInput.forceActiveFocus() + } + } + } + + Text { id: _colon + text: qsTr(":") + color: Colors.textMain + font.pixelSize: Fonts.fontPixelTextRectExtra + } + + TextEntry { id: _minutes + label.visible: false + validator : IntValidator{ + bottom : 0 + top : 59 + } + onEnterPressed: { + if (textInput.acceptableInput) { + _month.textInput.forceActiveFocus() + } + } + } + } + + Row { // date + spacing: 5 + Text { id: _dateLabel + width: labelWidth + text: qsTr("Date (MM/DD/YYYY)") + color: Colors.textMain + font.pixelSize: Fonts.fontPixelTextRectExtra + } + + TextEntry { id: _month + label.visible: false + width: Variables.textInputLineWidth + validator : IntValidator{ + bottom : 1 + top : 12 + } + onEnterPressed: { + if (textInput.acceptableInput) { + _day.textInput.forceActiveFocus() + } + } + } + + Text { id: _slashMonthDay + text: qsTr("/") + color: Colors.textMain + font.pixelSize: Fonts.fontPixelTextRectExtra + } + + TextEntry { id: _day + label.visible: false + width: Variables.textInputLineWidth + validator : IntValidator{ + bottom : 1 + top : 31 + } + onEnterPressed: { + if (textInput.acceptableInput) { + _year.textInput.forceActiveFocus() + } + } + } + + Text { id: _slashDayYear + text: qsTr("/") + color: Colors.textMain + font.pixelSize: Fonts.fontPixelTextRectExtra + } + + TextEntry { id: _year + label.visible: false + validator : IntValidator { + bottom : 1970 + } + onEnterPressed: { + if (textInput.acceptableInput) { + _keyboard.setVisible(false) + } + } + } + } + } +} Index: sources/gui/qml/pages/settings/SettingsHome.qml =================================================================== diff -u --- sources/gui/qml/pages/settings/SettingsHome.qml (revision 0) +++ sources/gui/qml/pages/settings/SettingsHome.qml (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -0,0 +1,99 @@ +/*! + * + * 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 SettingsHome.qml + * \author (last) Behrouz NematiPour + * \date (last) 14-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 21-Oct-2019 + * + */ + +// Qt +import QtQuick 2.12 + +// Qml imports +import "qrc:/globals" +import "qrc:/components" +import "qrc:/compounds" + +/*! + * \brief SettingsHome is the screen + * which is the default screen in the "Settings" stack + */ +SettingsBase { id: _root + objectName: "_SettingsHome" + + property alias itemsText : _settingItems.itemsText + property alias itemsEnabled : _settingItems.itemsEnabled + + 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 + + signal itemClicked(int vIndex) + + title : qsTr("Device Settings") + + TouchGrid { id: _settingItems + anchors.centerIn: _root + onItemClicked : _root.itemClicked(vIndex) + } + + // Test Codes + TouchRect { id : _clearAlarmCondition + objectName: "_clearAlarmCondition" + width : 300 + height : Variables.logoHeight + animated: true + anchors { + top : parent.top + right : _usbButton.left + topMargin : (Variables.headerHeight - Variables.logoHeight) / 2 + rightMargin : (Variables.headerHeight - Variables.logoHeight) / 2 + } + text.text: qsTr("Clear Alarm Condition") + onClicked: { + _alarmItem.clearAlarm() + } + } + + 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 + anchors { + top : parent.top + right : parent.right + topMargin : (Variables.headerHeight - Variables.logoHeight) / 2 + rightMargin : (Variables.headerHeight - Variables.logoHeight) / 2 + } + text.text: qsTr("Shutdown") + onPressed: { + _GuiView.doActionTransmit(GuiActions.ID_PowerOff, GuiActions.NoData) + } + } +} + Index: sources/gui/qml/pages/settings/SettingsStack.qml =================================================================== diff -u --- sources/gui/qml/pages/settings/SettingsStack.qml (revision 0) +++ sources/gui/qml/pages/settings/SettingsStack.qml (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -0,0 +1,81 @@ +/*! + * + * 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 SettingsStack.qml + * \author (last) Behrouz NematiPour + * \date (last) 01-Mar-2021 + * \author (original) Behrouz NematiPour + * \date (original) 21-Oct-2019 + * + */ + +// Qt +import QtQuick 2.12 + +// Project +// Qml imports +import "qrc:/globals" +import "qrc:/components" + +/*! + * \brief SettingsStack is the screen + * which contains the main stack for all the Settings screens + * This is the screen which will show up when "Settings" option + * is selected from the main menu. + */ +StackItem { id : _root + objectName: "_SettingsStack" + + stackView.initialItem : _settingsHome + + enum ItmesIndex { + SetDateTime , + WiFi , + Bluetooth , + Services + } + + property var itemsText : [ + qsTr("Set Date And Time"), + qsTr("Wi-Fi" ), + qsTr("Bluetooth" ), + "" , + qsTr("Services" ), + ] + + SettingsDateTime { id: _settingsDateTime + itemIndex : SettingsStack.SetDateTime + } + + SettingsHome { id : _settingsHome + backVisible : false + confirmVisible : false + itemsText : _root.itemsText + itemsEnabled : [ 1,1,1,0,0,0,0,0,0 ] + onItemClicked : { + switch (vIndex) { + case SettingsStack.SetDateTime: + vDateTime.doInit() + push(_settingsDateTime) + break + + case 1: + console.debug(vIndex) + break + } + } + } + + onVisibleChanged: { + if (visible) { + _mainMenu.hidden = false + } + else { + stackView.initialItem = null + } + } +} Fisheye: Tag c15ce613e372838316d42c40a86953e6f0aa05d3 refers to a dead (removed) revision in file `sources/gui/qml/pages/treatment/TreatmentHome.qml'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/gui/qml/pages/treatment/TreatmentStack.qml =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -48,7 +48,7 @@ y : Variables.mainMenuHeight * -1 position : MainMenu.Position.Top hidden : true - titles : [ qsTr("Back") , qsTr("Treatment") , qsTr("Trending") , qsTr("Settings") ] + titles : [ qsTr("Treatment") , qsTr("Trending") , qsTr("Settings") ] spacing : 20 leftPdding : 20 partitionWidth : 100 // Todo Important : max width should be the width for all bottons @@ -58,14 +58,11 @@ TreatmentBloodPrime { id: _treatmentBloodPrime } TreatmentUltrafiltrationItem{ id: _treatmentUltrafiltrationItem } - TreatmentStart { id: _treatmentStart - onBackClicked : { - _root.backClicked() - } + TreatmentHome { id: _treatmentHome onSectionFlowClicked : { _treatmentAdjustmentFlow.open() } - onSectionVitalsClicked: { + onSectionVitalsClicked : { // no page yet } onSectionPressuresClicked: { @@ -165,10 +162,10 @@ Connections { target: vHDTreatmentStates // in-Treatmet onTxBloodPrimeChanged : { page( _treatmentBloodPrime , vtxBloodPrime )} - onTxDialysisChanged : { page( _treatmentStart , vtxDialysis )} + onTxDialysisChanged : { page( _treatmentHome , vtxDialysis )} } Connections { target: _mainHome - onStartTreatment : { page ( _treatmentStart )} + onStartTreatment : { page ( _treatmentHome )} } } Fisheye: Tag 506a9e3db1a20bda1685e38c5e9041005c9a4a4f refers to a dead (removed) revision in file `sources/gui/qml/pages/treatment/TreatmentStart.qml'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/model/MModel.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/model/MModel.h (.../MModel.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/model/MModel.h (.../MModel.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -47,6 +47,14 @@ #include "MHDDebugText.h" #include "MDGDebugText.h" +// Settings +#include "MAdjustHDRequests.h" +#include "MAdjustDGRequests.h" +#include "MAdjustHDVersionsResponse.h" +#include "MAdjustDGVersionsResponse.h" +#include "MAdjustHDDateTimeResponse.h" +#include "MAdjustDGDateTimeResponse.h" + // DG Data Messages #include "MDGDrainPumpData.h" #include "MDGHeatersData.h" @@ -87,8 +95,6 @@ #include "MTreatmentAdjustRecirculateResponse.h" #include "MTreatmentAdjustEndResponse.h" #include "MTreatmentAdjustPressuresLimitsResponse.h" -#include "MAdjustHDVersionsResponse.h" -#include "MAdjustDGVersionsResponse.h" // Post-Treatment #include "MPostTreatmentAdjustRequests.h" @@ -295,6 +301,8 @@ REGISTER_METATYPE( AdjustTreatmentEndRequestData ) \ REGISTER_METATYPE( AdjustPressuresLimitsRequestData ) \ REGISTER_METATYPE( AdjustVersionsRequestData ) \ + REGISTER_METATYPE( AdjustHDDateTimeRequestData ) \ + REGISTER_METATYPE( AdjustDGDateTimeRequestData ) \ \ /* Response */ \ /* Post-Treatment */ \ @@ -323,7 +331,10 @@ REGISTER_METATYPE( AdjustPressuresLimitsResponseData ) \ REGISTER_METATYPE( AdjustHDVersionsResponseData ) \ REGISTER_METATYPE( AdjustDGVersionsResponseData ) \ + REGISTER_METATYPE( AdjustHDDateTimeResponseData ) \ + REGISTER_METATYPE( AdjustDGDateTimeResponseData ) \ + //===============================================================================// /*! \def ACTION_RECEIVE_MODEL_BRIDGE_CONNECTIONS @@ -410,6 +421,8 @@ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustPressuresLimitsResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustHDVersionsResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustDGVersionsResponseData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustHDDateTimeResponseData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustDGDateTimeResponseData ) \ // /* Request */ ---------------------------------------------------------// #define ADJUST_TRANSMT_MODEL_BRIDGE_CONNECTIONS(vSOURCE) \ @@ -427,6 +440,8 @@ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustTreatmentEndRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustPressuresLimitsRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustVersionsRequestData ) \ + ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustHDDateTimeRequestData ) \ + ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustDGDateTimeRequestData ) \ /* Post-Treatment */ \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustPatientDisconnectionConfirmRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustDisposablesRemovalConfirmRequestData ) \ @@ -539,6 +554,8 @@ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustPressuresLimitsResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustHDVersionsResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustDGVersionsResponseData ) \ + ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustHDDateTimeResponseData ) \ + ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustDGDateTimeResponseData ) \ #define ADJUST_TRANSMT_MODEL_BRIDGE_DEFINITIONS \ /* Request --------------------------------------------------------- */ \ @@ -572,6 +589,8 @@ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustTreatmentEndRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustPressuresLimitsRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustVersionsRequestData ) \ + ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustHDDateTimeRequestData ) \ + ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustDGDateTimeRequestData ) \ \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AlarmSilenceRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AlarmUserActionRequestData ) \ @@ -611,6 +630,8 @@ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustTreatmentEndRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustPressuresLimitsRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustVersionsRequestData ) \ + ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustHDDateTimeRequestData ) \ + ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustDGDateTimeRequestData ) \ \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AlarmSilenceRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AlarmUserActionRequestData ) \ @@ -650,6 +671,8 @@ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustRecirculateRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustTreatmentEndRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustVersionsRequestData ) \ + ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustHDDateTimeRequestData ) \ + ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustDGDateTimeRequestData ) \ \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AlarmSilenceRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AlarmUserActionRequestData ) \ @@ -729,6 +752,8 @@ ACTION_RECEIVE_SIGNAL( AdjustPressuresLimitsResponseData ) \ ACTION_RECEIVE_SIGNAL( AdjustHDVersionsResponseData ) \ ACTION_RECEIVE_SIGNAL( AdjustDGVersionsResponseData ) \ + ACTION_RECEIVE_SIGNAL( AdjustHDDateTimeResponseData ) \ + ACTION_RECEIVE_SIGNAL( AdjustDGDateTimeResponseData ) \ //--------------------------------------------------------------------------------// //--------------------------------------------------------------------------------// Fisheye: Tag 506a9e3db1a20bda1685e38c5e9041005c9a4a4f refers to a dead (removed) revision in file `sources/model/dg/adjustment/MAdjustDGVersionsResponse.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 506a9e3db1a20bda1685e38c5e9041005c9a4a4f refers to a dead (removed) revision in file `sources/model/dg/adjustment/MTreatmentAdjustDGVersionsResponse.cpp'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/model/dg/adjustment/settings/MAdjustDGDateTimeResponse.cpp =================================================================== diff -u --- sources/model/dg/adjustment/settings/MAdjustDGDateTimeResponse.cpp (revision 0) +++ sources/model/dg/adjustment/settings/MAdjustDGDateTimeResponse.cpp (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -0,0 +1,45 @@ +/*! + * + * 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 MAdjustDGDateTimeResponse.cpp + * \author (last) Peter Lucia + * \date (last) 15-Mar-2021 + * \author (original) Peter Lucia + * \date (original) 15-Mar-2021 + * + */ +#include "MAdjustDGDateTimeResponse.h" + +using namespace Model; + +QVariantList MAdjustDGDateTimeResponse::parameters() const { + return { + _data.mAccepted.value, + _data.mReason .value, + }; +} + +bool MAdjustDGDateTimeResponse::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if (GetValue(vByteArray, index, _data.mAccepted )) + if (GetValue(vByteArray, index, _data.mReason )) + return true ; + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } +} + +/*! + * \brief MAdjustDGDateTimeResponse::data + * \details Provides model's Data from the received messages data values + * \return Data + */ +AdjustDGDateTimeResponseData MAdjustDGDateTimeResponse::data() const { + Data data; + data.mAccepted = _data.mAccepted.value; + data.mReason = _data.mReason .value; + return data; +} Index: sources/model/dg/adjustment/settings/MAdjustDGDateTimeResponse.h =================================================================== diff -u --- sources/model/dg/adjustment/settings/MAdjustDGDateTimeResponse.h (revision 0) +++ sources/model/dg/adjustment/settings/MAdjustDGDateTimeResponse.h (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -0,0 +1,82 @@ +/*! + * + * 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 MAdjustDGDateTimeResponse.h + * \author (last) Peter Lucia + * \date (last) 15-Mar-2021 + * \author (original) Peter Lucia + * \date (original) 15-Mar-2021 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "MAbstract.h" +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +/*! + * \brief The MAdjustDGDateTimeResponse class + * \details The DG Date and Time adjustment response model + * + * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | + * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:---------------------:| + * |0x7000| 0x070 | | Rsp | Y | DG | UI | Set RTC Response | + * + * | Payload || + * | || + * | #1:(U32) | \ref Data::mAccepted | + * | #2:(U32) | \ref Data::mReason | + * + * \sa Data + * + *

Logging info

+ * | || + * | || + * | typeText | Event | + * | unitText | DG | + * | infoText | AdjustDGDateTime | + * + */ +class MAdjustDGDateTimeResponse : public MAbstract { + + // friends + friend class ::tst_models; + + QVariantList parameters() const override; + + struct { + Types::U32 mAccepted; + Types::U32 mReason ; + } _data; + +public: + + Type_Enum typeText () const override { return Type_Enum::eEvent ; } + Unit_Enum unitText () const override { return Unit_Enum::eDG ; } + QString infoText () const override { return QString("AdjustDGDateTime") ; } + + struct Data { + bool mAccepted = 0; /*!< Accepted value of type quint32 extracted out */ + quint32 mReason = 0; /*!< Reason value of type quint32 extracted out */ + }; + + MAdjustDGDateTimeResponse () { } + + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; + Data data ( ) const ; +}; +} + +typedef Model::MAdjustDGDateTimeResponse::Data AdjustDGDateTimeResponseData; Index: sources/model/dg/adjustment/settings/MAdjustDGRequests.h =================================================================== diff -u --- sources/model/dg/adjustment/settings/MAdjustDGRequests.h (revision 0) +++ sources/model/dg/adjustment/settings/MAdjustDGRequests.h (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -0,0 +1,63 @@ +/*! + * + * 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 MAdjustDGRequests.h + * \author (last) Behrouz NematiPour + * \date (last) 16-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 16-Apr-2021 + * + */ + +#pragma once + +// Qt + +//project +#include "MAdjustRequestsBase.h" + +using namespace Gui; + +namespace Model { + +/*! + * Simple request models + * These are models to send the request for the doAdjustment + * The the only reason thy have been defined to help overloading the adjustment methods + * Otherwise the parameters are so tiny models. + */ + +/*! + * \brief The MAdjustDGDateTime class + * \details The model to request starting a treatment + * + * | MSG | CAN ID | Type | Ack | Src | Dest | Description | + * |:----:|:------:|:----:|:---:|:---:|:----:|:-----------:| + * | 111 | 0x110 | Req | Y | UI | DG | Set RTC Date and Time | + * + * | Payload || + * | || + * | #1:(U32) | \ref mEpoch | + * + */ +class MAdjustDGDateTimeReq : public MModel { +public: + quint32 mEpoch; + // coco begin validated : Has been validated manually. + QString toString() { + return toString({mEpoch}); + } + // coco end + static QString toString(const QVariantList &vParameters) { + return MModel::toString("AdjustDGDateTime", vParameters); + } +}; + +} + +typedef Model::MAdjustDGDateTimeReq AdjustDGDateTimeRequestData; + Index: sources/model/dg/adjustment/settings/MAdjustDGVersionsResponse.cpp =================================================================== diff -u --- sources/model/dg/adjustment/settings/MAdjustDGVersionsResponse.cpp (revision 0) +++ sources/model/dg/adjustment/settings/MAdjustDGVersionsResponse.cpp (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -0,0 +1,64 @@ +/*! + * + * 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 MTreatmentAdjustDGVersionsResponse.cpp + * \author (last) Peman Montazemi + * \date (last) 10-Dec-2020 + * \author (original) Peman Montazemi + * \date (original) 10-Dec-2020 + * + */ +#include "MAdjustDGVersionsResponse.h" + +using namespace Model; + +QVariantList MAdjustDGVersionsResponse::parameters() const { + return { + _data.mMajor .value, + _data.mMinor .value, + _data.mMicro .value, + _data.mBuild .value, + _data.mFPGAId .value, + _data.mFPGAMajor.value, + _data.mFPGAMinor.value, + _data.mFPGALab .value + }; +} + +bool MAdjustDGVersionsResponse::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if (GetValue(vByteArray, index, _data.mMajor )) + if (GetValue(vByteArray, index, _data.mMinor )) + if (GetValue(vByteArray, index, _data.mMicro )) + if (GetValue(vByteArray, index, _data.mBuild )) + if (GetValue(vByteArray, index, _data.mFPGAId )) + if (GetValue(vByteArray, index, _data.mFPGAMajor)) + if (GetValue(vByteArray, index, _data.mFPGAMinor)) + if (GetValue(vByteArray, index, _data.mFPGALab )) + return true ; + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } +} + +AdjustDGVersionsResponseData MAdjustDGVersionsResponse::data() const { + Data data; + data.mMajor = _data.mMajor .value; + data.mMinor = _data.mMinor .value; + data.mMicro = _data.mMicro .value; + data.mBuild = _data.mBuild .value; + data.mFPGAId = _data.mFPGAId .value; + data.mFPGAMajor = _data.mFPGAMajor.value; + data.mFPGAMinor = _data.mFPGAMinor.value; + data.mFPGALab = _data.mFPGALab .value; + return data; +} Index: sources/model/dg/adjustment/settings/MAdjustDGVersionsResponse.h =================================================================== diff -u --- sources/model/dg/adjustment/settings/MAdjustDGVersionsResponse.h (revision 0) +++ sources/model/dg/adjustment/settings/MAdjustDGVersionsResponse.h (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -0,0 +1,101 @@ +/*! + * + * 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 MTreatmentAdjustDGVersionsResponse.h + * \author (last) Peman Montazemi + * \date (last) 8-Dec-2020 + * \author (original) Peman Montazemi + * \date (original) 8-Dec-2020 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "MAbstract.h" +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +/*! + * \brief The MAdjustDGVersionsResponse class + * \details The DG versions data model + * + * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | + * |:------:|:------:|:-----:|:----:|:---:|:---:|:----:|:---------------------:| + * | 0x1E00 | 0x070 | 17 | Rsp | Y | DG | UI | DG Versions Data | + * + * | Payload || + * | || + * | #1:(U08) | \ref Data::mMajor | + * | #2:(U08) | \ref Data::mMinor | + * | #3:(U08) | \ref Data::mMicro | + * | #4:(U16) | \ref Data::mBuild | + * | #5:(U08) | \ref Data::mFPGAId | + * | #6:(U08) | \ref Data::mFPGAMajor | + * | #7:(U08) | \ref Data::mFPGAMinor | + * | #8:(U08) | \ref Data::mFPGALab | + * + * \sa Data + * \sa MAdjustDGVersionsResponse : DG Versions Response Data + * + *

Logging info

+ * | || + * | || + * | typeText | Event | + * | unitText | DG | + * | infoText | DGVersions | + * + */ +class MAdjustDGVersionsResponse : public MAbstract { + + // friends + friend class ::tst_models; + + QVariantList parameters() const override; + + struct { + Types::U08 mMajor ; + Types::U08 mMinor ; + Types::U08 mMicro ; + Types::U16 mBuild ; + Types::U08 mFPGAId ; + Types::U08 mFPGAMajor ; + Types::U08 mFPGAMinor ; + Types::U08 mFPGALab ; + } _data; + +public: + + Type_Enum typeText () const override { return Type_Enum::eEvent ; } + Unit_Enum unitText () const override { return Unit_Enum::eDG ; } + QString infoText () const override { return QString("DGVersions") ; } + + struct Data { + quint8 mMajor = 0; /*!< DG Versions Major value of type quint8 extracted out */ + quint8 mMinor = 0; /*!< DG Versions Minor value of type quint8 extracted out */ + quint8 mMicro = 0; /*!< DG Versions Micro value of type quint8 extracted out */ + quint16 mBuild = 0; /*!< DG Versions Build value of type quint16 extracted out */ + quint8 mFPGAId = 0; /*!< DG Versions FPGA ID value of type quint8 extracted out */ + quint8 mFPGAMajor = 0; /*!< DG Versions FPGA Major value of type quint8 extracted out */ + quint8 mFPGAMinor = 0; /*!< DG Versions FPGA Minor value of type quint8 extracted out */ + quint8 mFPGALab = 0; /*!< DG Versions FPGA Lab value of type quint8 extracted out */ + }; + + MAdjustDGVersionsResponse () { } + + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; + Data data ( ) const ; +}; +} + +typedef Model::MAdjustDGVersionsResponse::Data AdjustDGVersionsResponseData; Fisheye: Tag 506a9e3db1a20bda1685e38c5e9041005c9a4a4f refers to a dead (removed) revision in file `sources/model/hd/adjustment/MAdjustHDVersionsResponse.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 506a9e3db1a20bda1685e38c5e9041005c9a4a4f refers to a dead (removed) revision in file `sources/model/hd/adjustment/MAdjustHDVersionsResponse.h'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/model/hd/adjustment/settings/MAdjustHDDateTimeResponse.cpp =================================================================== diff -u --- sources/model/hd/adjustment/settings/MAdjustHDDateTimeResponse.cpp (revision 0) +++ sources/model/hd/adjustment/settings/MAdjustHDDateTimeResponse.cpp (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -0,0 +1,45 @@ +/*! + * + * 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 MAdjustHDDateTimeResponse.cpp + * \author (last) Peter Lucia + * \date (last) 15-Mar-2021 + * \author (original) Peter Lucia + * \date (original) 15-Mar-2021 + * + */ +#include "MAdjustHDDateTimeResponse.h" + +using namespace Model; + +QVariantList MAdjustHDDateTimeResponse::parameters() const { + return { + _data.mAccepted.value, + _data.mReason .value, + }; +} + +bool MAdjustHDDateTimeResponse::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if (GetValue(vByteArray, index, _data.mAccepted )) + if (GetValue(vByteArray, index, _data.mReason )) + return true ; + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } +} + +/*! + * \brief MAdjustHDDateTimeResponse::data + * \details Provides model's Data from the received messages data values + * \return Data + */ +AdjustHDDateTimeResponseData MAdjustHDDateTimeResponse::data() const { + Data data; + data.mAccepted = _data.mAccepted.value; + data.mReason = _data.mReason .value; + return data; +} Index: sources/model/hd/adjustment/settings/MAdjustHDDateTimeResponse.h =================================================================== diff -u --- sources/model/hd/adjustment/settings/MAdjustHDDateTimeResponse.h (revision 0) +++ sources/model/hd/adjustment/settings/MAdjustHDDateTimeResponse.h (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -0,0 +1,82 @@ +/*! + * + * 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 MAdjustHDDateTimeResponse.h + * \author (last) Peter Lucia + * \date (last) 15-Mar-2021 + * \author (original) Peter Lucia + * \date (original) 15-Mar-2021 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "MAbstract.h" +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +/*! + * \brief The MAdjustHDDateTimeResponse class + * \details The HD Date and Time adjustment response model + * + * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | + * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:---------------------:| + * |0x6E00| 0x020 | | Rsp | Y | HD | UI | Set RTC Response | + * + * | Payload || + * | || + * | #1:(U32) | \ref Data::mAccepted | + * | #2:(U32) | \ref Data::mReason | + * + * \sa Data + * + *

Logging info

+ * | || + * | || + * | typeText | Event | + * | unitText | DG | + * | infoText | AdjustHDDateTime | + * + */ +class MAdjustHDDateTimeResponse : public MAbstract { + + // friends + friend class ::tst_models; + + QVariantList parameters() const override; + + struct { + Types::U32 mAccepted; + Types::U32 mReason ; + } _data; + +public: + + Type_Enum typeText () const override { return Type_Enum::eEvent ; } + Unit_Enum unitText () const override { return Unit_Enum::eHD ; } + QString infoText () const override { return QString("AdjustHDDateTime") ; } + + struct Data { + bool mAccepted = 0; /*!< Accepted value of type quint32 extracted out */ + quint32 mReason = 0; /*!< Reason value of type quint32 extracted out */ + }; + + MAdjustHDDateTimeResponse () { } + + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; + Data data ( ) const ; +}; +} + +typedef Model::MAdjustHDDateTimeResponse::Data AdjustHDDateTimeResponseData; Index: sources/model/hd/adjustment/settings/MAdjustHDRequests.h =================================================================== diff -u --- sources/model/hd/adjustment/settings/MAdjustHDRequests.h (revision 0) +++ sources/model/hd/adjustment/settings/MAdjustHDRequests.h (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -0,0 +1,63 @@ +/*! + * + * 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 MAdjustHDRequests.h + * \author (last) Behrouz NematiPour + * \date (last) 16-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 16-Apr-2021 + * + */ + +#pragma once + +// Qt + +//project +#include "MAdjustRequestsBase.h" + +using namespace Gui; + +namespace Model { + +/*! + * Simple request models + * These are models to send the request for the doAdjustment + * The the only reason thy have been defined to help overloading the adjustment methods + * Otherwise the parameters are so tiny models. + */ + +/*! + * \brief The MAdjustHDDateTime class + * \details The model to request starting a treatment + * + * | MSG | CAN ID | Type | Ack | Src | Dest | Description | + * |:----:|:------:|:----:|:---:|:---:|:----:|:-----------:| + * | 109 | 0x100 | Req | Y | UI | HD | Set RTC Date and Time | + * + * | Payload || + * | || + * | #1:(U32) | \ref mEpoch | + * + */ +class MAdjustHDDateTimeReq : public MModel { +public: + quint32 mEpoch; + // coco begin validated : Has been validated manually. + QString toString() { + return toString({mEpoch}); + } + // coco end + static QString toString(const QVariantList &vParameters) { + return MModel::toString("AdjustHDDateTime", vParameters); + } +}; + +} + +typedef Model::MAdjustHDDateTimeReq AdjustHDDateTimeRequestData; + Index: sources/model/hd/adjustment/settings/MAdjustHDVersionsResponse.cpp =================================================================== diff -u --- sources/model/hd/adjustment/settings/MAdjustHDVersionsResponse.cpp (revision 0) +++ sources/model/hd/adjustment/settings/MAdjustHDVersionsResponse.cpp (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -0,0 +1,64 @@ +/*! + * + * 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 MHDVersionResponse.cpp + * \author (last) Peman Montazemi + * \date (last) 4-Nov-2020 + * \author (original) Peman Montazemi + * \date (original) 4-Nov-2020 + * + */ +#include "MAdjustHDVersionsResponse.h" + +using namespace Model; + +QVariantList MAdjustHDVersionsResponse::parameters() const { + return { + _data.mMajor .value, + _data.mMinor .value, + _data.mMicro .value, + _data.mBuild .value, + _data.mFPGAId .value, + _data.mFPGAMajor.value, + _data.mFPGAMinor.value, + _data.mFPGALab .value + }; +} + +bool MAdjustHDVersionsResponse::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if (GetValue(vByteArray, index, _data.mMajor )) + if (GetValue(vByteArray, index, _data.mMinor )) + if (GetValue(vByteArray, index, _data.mMicro )) + if (GetValue(vByteArray, index, _data.mBuild )) + if (GetValue(vByteArray, index, _data.mFPGAId )) + if (GetValue(vByteArray, index, _data.mFPGAMajor)) + if (GetValue(vByteArray, index, _data.mFPGAMinor)) + if (GetValue(vByteArray, index, _data.mFPGALab )) + return true ; + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } +} + +AdjustHDVersionsResponseData MAdjustHDVersionsResponse::data() const { + Data data; + data.mMajor = _data.mMajor .value; + data.mMinor = _data.mMinor .value; + data.mMicro = _data.mMicro .value; + data.mBuild = _data.mBuild .value; + data.mFPGAId = _data.mFPGAId .value; + data.mFPGAMajor = _data.mFPGAMajor.value; + data.mFPGAMinor = _data.mFPGAMinor.value; + data.mFPGALab = _data.mFPGALab .value; + return data; +} Index: sources/model/hd/adjustment/settings/MAdjustHDVersionsResponse.h =================================================================== diff -u --- sources/model/hd/adjustment/settings/MAdjustHDVersionsResponse.h (revision 0) +++ sources/model/hd/adjustment/settings/MAdjustHDVersionsResponse.h (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -0,0 +1,101 @@ +/*! + * + * 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 MTreatmentAdjustHDVersionsResponse.h + * \author (last) Peman Montazemi + * \date (last) 6-Nov-2020 + * \author (original) Peman Montazemi + * \date (original) 4-Nov-2020 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "MAbstract.h" +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +/*! + * \brief The MAdjustHDVersionsResponse class + * \details The HD versions data model + * + * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | + * |:------:|:------:|:-----:|:----:|:---:|:---:|:----:|:---------------------:| + * | 0x1D00 | 0x020 | 6 | Rsp | Y | HD | UI | HD Versions Data | + * + * | Payload || + * | || + * | #1:(U08) | \ref Data::mHDMajor | + * | #2:(U08) | \ref Data::mHDMinor | + * | #3:(U08) | \ref Data::mHDMicro | + * | #4:(U16) | \ref Data::mHDBuild | + * | #5:(U08) | \ref Data::mHDFPGAId | + * | #6:(U08) | \ref Data::mHDFPGAMajor | + * | #7:(U08) | \ref Data::mHDFPGAMinor | + * | #8:(U08) | \ref Data::mHDFPGALab | + * + * \sa Data + * \sa MAdjustHDVersionsResponse : HD Versions Response Data + * + *

Logging info

+ * | || + * | || + * | typeText | Event | + * | unitText | HD | + * | infoText | HDVersions | + * + */ +class MAdjustHDVersionsResponse : public MAbstract { + + // friends + friend class ::tst_models; + + QVariantList parameters() const override; + + struct { + Types::U08 mMajor ; + Types::U08 mMinor ; + Types::U08 mMicro ; + Types::U16 mBuild ; + Types::U08 mFPGAId ; + Types::U08 mFPGAMajor ; + Types::U08 mFPGAMinor ; + Types::U08 mFPGALab ; + } _data; + +public: + + Type_Enum typeText () const override { return Type_Enum::eEvent ; } + Unit_Enum unitText () const override { return Unit_Enum::eHD ; } + QString infoText () const override { return QString("HDVersions") ; } + + struct Data { + quint8 mMajor = 0; /*!< HD Versions Major value of type quint8 extracted out */ + quint8 mMinor = 0; /*!< HD Versions Minor value of type quint8 extracted out */ + quint8 mMicro = 0; /*!< HD Versions Micro value of type quint8 extracted out */ + quint16 mBuild = 0; /*!< HD Versions Build value of type quint16 extracted out */ + quint8 mFPGAId = 0; /*!< HD Versions FPGA ID value of type quint8 extracted out */ + quint8 mFPGAMajor = 0; /*!< HD Versions FPGA Major value of type quint8 extracted out */ + quint8 mFPGAMinor = 0; /*!< HD Versions FPGA Minor value of type quint8 extracted out */ + quint8 mFPGALab = 0; /*!< HD Versions FPGA Lab value of type quint8 extracted out */ + }; + + MAdjustHDVersionsResponse () { } + + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; + Data data ( ) const ; +}; +} + +typedef Model::MAdjustHDVersionsResponse::Data AdjustHDVersionsResponseData; Index: sources/storage/StorageGlobals.cpp =================================================================== diff -u -r066258b65a1c41afe3828c92d2606d2642505d72 -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/storage/StorageGlobals.cpp (.../StorageGlobals.cpp) (revision 066258b65a1c41afe3828c92d2606d2642505d72) +++ sources/storage/StorageGlobals.cpp (.../StorageGlobals.cpp) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -47,4 +47,6 @@ // should be in the project application folder. [is tracking by git] const char *Settings_Path_Name = "/home/denali/Projects/application/resources/settings/"; #endif + // Date and Time + const char *Date_Time_Set_Sh = "date_time_set.sh"; } Index: sources/storage/StorageGlobals.h =================================================================== diff -u -r821bf955d0ba7e028bccfee7c04ca77cf80a0bd4 -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/storage/StorageGlobals.h (.../StorageGlobals.h) (revision 821bf955d0ba7e028bccfee7c04ca77cf80a0bd4) +++ sources/storage/StorageGlobals.h (.../StorageGlobals.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -28,4 +28,7 @@ // Settings extern const char *Settings_Path_Name; + + // Date and Time + extern const char *Date_Time_Set_Sh; } Index: sources/view/VAdjustmentResponseBase.cpp =================================================================== diff -u --- sources/view/VAdjustmentResponseBase.cpp (revision 0) +++ sources/view/VAdjustmentResponseBase.cpp (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -0,0 +1,34 @@ +/*! + * + * 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 VAdjustmentResponseBase.cpp + * \author (last) Behrouz NematiPour + * \date (last) 16-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 26-Aug-2020 + * + */ +#include "VAdjustmentResponseBase.h" + +// Project +#include "GuiController.h" + +VIEW_DEF_CLASS(VAdjustmentResponseBase) +void View::VAdjustmentResponseBase::initConnections() { } + +/*! + * \brief View::VAdjustmentResponseBase::text + * \details The slot to get the Reason Description + * \return Reason description as string + */ +QString View::VAdjustmentResponseBase::text() +{ + QString text; + if (_adjustment_Reason != GuiRequestReasons::REQUEST_REJECT_REASON_NONE) + text = Gui::enumString(static_cast(_adjustment_Reason), "[%1] Unknown Error"); + return text; +} Index: sources/view/VAdjustmentResponseBase.h =================================================================== diff -u --- sources/view/VAdjustmentResponseBase.h (revision 0) +++ sources/view/VAdjustmentResponseBase.h (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -0,0 +1,68 @@ +/*! + * + * 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 VAdjustmentResponseBase.h + * \author (last) Behrouz NematiPour + * \date (last) 16-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 26-Aug-2020 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "main.h" // Doxygen : don't remove +#include "VView.h" +#include "MAdjustHDRequests.h" +#include "MAdjustDGRequests.h" +#include "MPreTreatmentAdjustRequests.h" +#include "MTreatmentAdjustRequests.h" +#include "MPostTreatmentAdjustRequests.h" +#include "GuiGlobals.h" + +// forward declarations +class tst_views; + +// namespace +using namespace Gui; +namespace View { + +/*! + * \brief The VAdjustmentResponseBase class + * \details The base class of all the view classes for adjustment response. + * All the adjustment responses contain accepted field as a flag for acceptance or rejection of the requested adjustment. + * In case of adjustment request rejection the reason field is the reason for rejection. + */ +class VAdjustmentResponseBase : public QObject +{ + + Q_OBJECT + + // friends + friend class ::tst_views; + + // coco begin validated: + // The adjustment_Reason property as quint32 is not used directly in GUI + // it will be used as QString text. + // has been manually tested that it works perfectly fine if used. + // this property changed to trigger since it has been found out during tests that the reason could be same but has to be shown again. + TRIGGER ( quint32 , adjustment_Reason , 0) + // coco end + + PROPERTY( bool , adjustment_Accepted , 0) + + Q_PROPERTY(QString adjustment_ReasonText READ text NOTIFY adjustment_ReasonTriggered) + + VIEW_DEC_CLASS(VAdjustmentResponseBase) + +protected slots: + QString text(); +}; +} Index: sources/view/VView.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/view/VView.h (.../VView.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/view/VView.h (.../VView.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -83,14 +83,14 @@ //--------------------------------------------------------------------------------// //--------------------------------------------------------------------------------// -// The Adjustment child definition in cpp +// The Adjustment child DEFinition in cpp and DEClaration in .h #define VIEW_DEC_CLASS_ADJUSTMENT(vCLASS, vDATATYPE)\ VIEW_DEC_CLASS(vCLASS) \ VIEW_DEC_SLOT(vDATATYPE) \ //--------------------------------------------------------------------------------// #define VIEW_DEF_CLASS_ADJUSTMENT(vCLASS) \ using namespace View; \ - vCLASS::vCLASS(QObject *parent) : VTreatmentAdjustmentResponseBase(parent) { \ + vCLASS::vCLASS(QObject *parent) : VAdjustmentResponseBase(parent) { \ initConnections(); \ } \ //--------------------------------------------------------------------------------// @@ -101,8 +101,10 @@ //--------------------------------------------------------------------------------// #define REGISTER_VIEW_TYPES \ using namespace View; \ - \ + /* Settings */ \ REGISTER_TYPE( VSettings ) \ + REGISTER_TYPE( VAdjustmentVersions ) \ + REGISTER_TYPE( VDateTime ) \ \ REGISTER_TYPE( VAlarmStatus ) \ REGISTER_TYPE( VPowerOff ) \ @@ -164,7 +166,6 @@ REGISTER_TYPE( VTreatmentAdjustmentEnd ) \ REGISTER_TYPE( VTreatmentAdjustmentPressuresLimits ) \ REGISTER_TYPE( VTreatmentCreate ) \ - REGISTER_TYPE( VTreatmentAdjustmentVersions ) \ /* Post-Treatment */ \ REGISTER_TYPE( VPostTreatmentAdjustmentPatientDisconnectionConfirm ) \ REGISTER_TYPE( VPostTreatmentAdjustmentDisposablesRemovalConfirm ) \ Fisheye: Tag 506a9e3db1a20bda1685e38c5e9041005c9a4a4f refers to a dead (removed) revision in file `sources/view/hd/adjustment/VTreatmentAdjustmentVersions.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 506a9e3db1a20bda1685e38c5e9041005c9a4a4f refers to a dead (removed) revision in file `sources/view/hd/adjustment/VTreatmentAdjustmentVersions.h'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustDisposablesRemovalConfirm.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustDisposablesRemovalConfirm.h (.../VPostTreatmentAdjustDisposablesRemovalConfirm.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustDisposablesRemovalConfirm.h (.../VPostTreatmentAdjustDisposablesRemovalConfirm.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -18,7 +18,7 @@ // Project #include "main.h" // Doxygen : don't remove -#include "VTreatmentAdjustmentResponseBase.h" +#include "VAdjustmentResponseBase.h" #include "MPostTreatmentAdjustDisposablesRemovalConfirmResponse.h" namespace View { @@ -30,7 +30,7 @@ * \sa Model::MAdjustDisposablesRemovalConfirmResponse * */ -class VPostTreatmentAdjustmentDisposablesRemovalConfirm : public VTreatmentAdjustmentResponseBase +class VPostTreatmentAdjustmentDisposablesRemovalConfirm : public VAdjustmentResponseBase { Q_OBJECT Index: sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustPatientDisconnectionConfirm.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustPatientDisconnectionConfirm.h (.../VPostTreatmentAdjustPatientDisconnectionConfirm.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustPatientDisconnectionConfirm.h (.../VPostTreatmentAdjustPatientDisconnectionConfirm.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -18,7 +18,7 @@ // Project #include "main.h" // Doxygen : don't remove -#include "VTreatmentAdjustmentResponseBase.h" +#include "VAdjustmentResponseBase.h" namespace View { @@ -29,7 +29,7 @@ * \sa Model::MAdjustDisposablesRemovalConfirmResponse * */ -class VPostTreatmentAdjustmentPatientDisconnectionConfirm : public VTreatmentAdjustmentResponseBase +class VPostTreatmentAdjustmentPatientDisconnectionConfirm : public VAdjustmentResponseBase { Q_OBJECT Index: sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustTreatmentLog.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustTreatmentLog.h (.../VPostTreatmentAdjustTreatmentLog.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustTreatmentLog.h (.../VPostTreatmentAdjustTreatmentLog.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -18,7 +18,7 @@ // Project #include "main.h" // Doxygen : don't remove -#include "VTreatmentAdjustmentResponseBase.h" +#include "VAdjustmentResponseBase.h" #include "MPostTreatmentAdjustTreatmentLogResponse.h" namespace View { @@ -30,7 +30,7 @@ * \sa Model::MAdjustTreatmentLogResponse * */ -class VPostTreatmentAdjustmentTreatmentLog : public VTreatmentAdjustmentResponseBase +class VPostTreatmentAdjustmentTreatmentLog : public VAdjustmentResponseBase { Q_OBJECT Index: sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentConsumablesConfirm.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentConsumablesConfirm.h (.../VPreTreatmentAdjustmentConsumablesConfirm.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentConsumablesConfirm.h (.../VPreTreatmentAdjustmentConsumablesConfirm.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -18,7 +18,7 @@ // Project #include "main.h" // Doxygen : don't remove -#include "VTreatmentAdjustmentResponseBase.h" +#include "VAdjustmentResponseBase.h" namespace View { @@ -29,7 +29,7 @@ * \sa Model::MAdjustConsumablesConfirmResponse * */ -class VPreTreatmentAdjustmentConsumablesConfirm : public VTreatmentAdjustmentResponseBase +class VPreTreatmentAdjustmentConsumablesConfirm : public VAdjustmentResponseBase { Q_OBJECT Index: sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentDisposablesConfirm.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentDisposablesConfirm.h (.../VPreTreatmentAdjustmentDisposablesConfirm.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentDisposablesConfirm.h (.../VPreTreatmentAdjustmentDisposablesConfirm.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -18,7 +18,7 @@ // Project #include "main.h" // Doxygen : don't remove -#include "VTreatmentAdjustmentResponseBase.h" +#include "VAdjustmentResponseBase.h" namespace View { @@ -29,7 +29,7 @@ * \sa Model::MAdjustDisposablesConfirmResponse * */ -class VPreTreatmentAdjustmentDisposablesConfirm : public VTreatmentAdjustmentResponseBase +class VPreTreatmentAdjustmentDisposablesConfirm : public VAdjustmentResponseBase { Q_OBJECT Index: sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentDisposablesPrime.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentDisposablesPrime.h (.../VPreTreatmentAdjustmentDisposablesPrime.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentDisposablesPrime.h (.../VPreTreatmentAdjustmentDisposablesPrime.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -18,7 +18,7 @@ // Project #include "main.h" // Doxygen : don't remove -#include "VTreatmentAdjustmentResponseBase.h" +#include "VAdjustmentResponseBase.h" #include "MPreTreatmentAdjustDisposablesPrimeResponse.h" namespace View { @@ -30,7 +30,7 @@ * \sa Model::MAdjustDisposablesPrimeResponse * */ -class VPreTreatmentAdjustmentDisposablesPrime : public VTreatmentAdjustmentResponseBase +class VPreTreatmentAdjustmentDisposablesPrime : public VAdjustmentResponseBase { Q_OBJECT Index: sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentInitTreatment.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentInitTreatment.h (.../VPreTreatmentAdjustmentInitTreatment.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentInitTreatment.h (.../VPreTreatmentAdjustmentInitTreatment.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -18,7 +18,7 @@ // Project #include "main.h" // Doxygen : don't remove -#include "VTreatmentAdjustmentResponseBase.h" +#include "VAdjustmentResponseBase.h" #include "MPreTreatmentAdjustInitTreatmentResponse.h" namespace View { @@ -30,7 +30,7 @@ * \sa Model::MAdjustInitTreatmentResponse * */ -class VPreTreatmentAdjustmentInitTreatment : public VTreatmentAdjustmentResponseBase +class VPreTreatmentAdjustmentInitTreatment : public VAdjustmentResponseBase { Q_OBJECT Index: sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentPatientConnectionBegin.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentPatientConnectionBegin.h (.../VPreTreatmentAdjustmentPatientConnectionBegin.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentPatientConnectionBegin.h (.../VPreTreatmentAdjustmentPatientConnectionBegin.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -18,7 +18,7 @@ // Project #include "main.h" // Doxygen : don't remove -#include "VTreatmentAdjustmentResponseBase.h" +#include "VAdjustmentResponseBase.h" #include "MPreTreatmentAdjustPatientConnectionBeginResponse.h" namespace View { @@ -30,7 +30,7 @@ * \sa Model::MAdjustPatientConnectionBeginResponse * */ -class VPreTreatmentAdjustmentPatientConnectionBegin : public VTreatmentAdjustmentResponseBase +class VPreTreatmentAdjustmentPatientConnectionBegin : public VAdjustmentResponseBase { Q_OBJECT Index: sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentPatientConnectionConfirm.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentPatientConnectionConfirm.h (.../VPreTreatmentAdjustmentPatientConnectionConfirm.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentPatientConnectionConfirm.h (.../VPreTreatmentAdjustmentPatientConnectionConfirm.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -18,7 +18,7 @@ // Project #include "main.h" // Doxygen : don't remove -#include "VTreatmentAdjustmentResponseBase.h" +#include "VAdjustmentResponseBase.h" #include "MPreTreatmentAdjustPatientConnectionConfirmResponse.h" namespace View { @@ -30,7 +30,7 @@ * \sa Model::MAdjustPatientConnectionConfirmResponse * */ -class VPreTreatmentAdjustmentPatientConnectionConfirm : public VTreatmentAdjustmentResponseBase +class VPreTreatmentAdjustmentPatientConnectionConfirm : public VAdjustmentResponseBase { Q_OBJECT Index: sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentStartTreatment.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentStartTreatment.h (.../VPreTreatmentAdjustmentStartTreatment.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentStartTreatment.h (.../VPreTreatmentAdjustmentStartTreatment.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -18,7 +18,7 @@ // Project #include "main.h" // Doxygen : don't remove -#include "VTreatmentAdjustmentResponseBase.h" +#include "VAdjustmentResponseBase.h" #include "MPreTreatmentAdjustStartTreatmentResponse.h" namespace View { @@ -30,7 +30,7 @@ * \sa Model::MAdjustStartTreatmentResponse * */ -class VPreTreatmentAdjustmentStartTreatment : public VTreatmentAdjustmentResponseBase +class VPreTreatmentAdjustmentStartTreatment : public VAdjustmentResponseBase { Q_OBJECT Index: sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentUltrafiltrationInit.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentUltrafiltrationInit.h (.../VPreTreatmentAdjustmentUltrafiltrationInit.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentUltrafiltrationInit.h (.../VPreTreatmentAdjustmentUltrafiltrationInit.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -18,7 +18,7 @@ // Project #include "main.h" // Doxygen : don't remove -#include "VTreatmentAdjustmentResponseBase.h" +#include "VAdjustmentResponseBase.h" #include "MPreTreatmentAdjustUltrafiltrationInitResponse.h" namespace View { @@ -30,7 +30,7 @@ * \sa Model::MAdjustUltrafiltrationInitResponse * */ -class VPreTreatmentAdjustmentUltrafiltrationInit : public VTreatmentAdjustmentResponseBase +class VPreTreatmentAdjustmentUltrafiltrationInit : public VAdjustmentResponseBase { Q_OBJECT Index: sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentWaterSample.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentWaterSample.h (.../VPreTreatmentAdjustmentWaterSample.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentWaterSample.h (.../VPreTreatmentAdjustmentWaterSample.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -18,7 +18,7 @@ // Project #include "main.h" // Doxygen : don't remove -#include "VTreatmentAdjustmentResponseBase.h" +#include "VAdjustmentResponseBase.h" #include "MPreTreatmentAdjustWaterSampleResponse.h" namespace View { @@ -30,7 +30,7 @@ * \sa Model::MAdjustWaterSampleResponse * */ -class VPreTreatmentAdjustmentWaterSample : public VTreatmentAdjustmentResponseBase +class VPreTreatmentAdjustmentWaterSample : public VAdjustmentResponseBase { Q_OBJECT Index: sources/view/hd/adjustment/treatment/VTreatmentAdjustmentDuration.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/view/hd/adjustment/treatment/VTreatmentAdjustmentDuration.h (.../VTreatmentAdjustmentDuration.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentDuration.h (.../VTreatmentAdjustmentDuration.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -18,7 +18,7 @@ // Project #include "main.h" // Doxygen : don't remove -#include "VTreatmentAdjustmentResponseBase.h" +#include "VAdjustmentResponseBase.h" #include "MTreatmentAdjustDurationResponse.h" namespace View { @@ -30,7 +30,7 @@ * \sa Model::MAdjustDurationResponse * */ -class VTreatmentAdjustmentDuration : public VTreatmentAdjustmentResponseBase +class VTreatmentAdjustmentDuration : public VAdjustmentResponseBase { Q_OBJECT Index: sources/view/hd/adjustment/treatment/VTreatmentAdjustmentEnd.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/view/hd/adjustment/treatment/VTreatmentAdjustmentEnd.h (.../VTreatmentAdjustmentEnd.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentEnd.h (.../VTreatmentAdjustmentEnd.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -18,7 +18,7 @@ // Project #include "main.h" // Doxygen : don't remove -#include "VTreatmentAdjustmentResponseBase.h" +#include "VAdjustmentResponseBase.h" #include "MTreatmentAdjustEndResponse.h" namespace View { @@ -30,7 +30,7 @@ * \sa Model::MAdjustTreatmentEndResponse * */ -class VTreatmentAdjustmentEnd : public VTreatmentAdjustmentResponseBase +class VTreatmentAdjustmentEnd : public VAdjustmentResponseBase { Q_OBJECT Index: sources/view/hd/adjustment/treatment/VTreatmentAdjustmentFlows.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/view/hd/adjustment/treatment/VTreatmentAdjustmentFlows.h (.../VTreatmentAdjustmentFlows.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentFlows.h (.../VTreatmentAdjustmentFlows.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -19,7 +19,7 @@ // Project #include "main.h" // Doxygen : don't remove -#include "VTreatmentAdjustmentResponseBase.h" +#include "VAdjustmentResponseBase.h" #include "MTreatmentAdjustBloodDialysateResponse.h" namespace View { @@ -31,7 +31,7 @@ * \sa Model::MAdjustBloodDialysateResponse * */ -class VTreatmentAdjustmentFlows : public VTreatmentAdjustmentResponseBase +class VTreatmentAdjustmentFlows : public VAdjustmentResponseBase { Q_OBJECT // friends Index: sources/view/hd/adjustment/treatment/VTreatmentAdjustmentHeparin.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/view/hd/adjustment/treatment/VTreatmentAdjustmentHeparin.h (.../VTreatmentAdjustmentHeparin.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentHeparin.h (.../VTreatmentAdjustmentHeparin.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -18,7 +18,7 @@ // Project #include "main.h" // Doxygen : don't remove -#include "VTreatmentAdjustmentResponseBase.h" +#include "VAdjustmentResponseBase.h" #include "MTreatmentAdjustHeparinResponse.h" namespace View { @@ -30,7 +30,7 @@ * \sa Model::MAdjustHeparinResponse * */ -class VTreatmentAdjustmentHeparin : public VTreatmentAdjustmentResponseBase +class VTreatmentAdjustmentHeparin : public VAdjustmentResponseBase { Q_OBJECT Index: sources/view/hd/adjustment/treatment/VTreatmentAdjustmentPressuresLimits.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/view/hd/adjustment/treatment/VTreatmentAdjustmentPressuresLimits.h (.../VTreatmentAdjustmentPressuresLimits.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentPressuresLimits.h (.../VTreatmentAdjustmentPressuresLimits.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -19,7 +19,7 @@ // Project #include "main.h" // Doxygen : don't remove -#include "VTreatmentAdjustmentResponseBase.h" +#include "VAdjustmentResponseBase.h" #include "MTreatmentAdjustPressuresLimitsResponse.h" namespace View { @@ -31,7 +31,7 @@ * \sa Model::MAdjustPressuresLimitsResponse * */ -class VTreatmentAdjustmentPressuresLimits : public VTreatmentAdjustmentResponseBase +class VTreatmentAdjustmentPressuresLimits : public VAdjustmentResponseBase { Q_OBJECT // friends Index: sources/view/hd/adjustment/treatment/VTreatmentAdjustmentRecirculate.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/view/hd/adjustment/treatment/VTreatmentAdjustmentRecirculate.h (.../VTreatmentAdjustmentRecirculate.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentRecirculate.h (.../VTreatmentAdjustmentRecirculate.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -18,7 +18,7 @@ // Project #include "main.h" // Doxygen : don't remove -#include "VTreatmentAdjustmentResponseBase.h" +#include "VAdjustmentResponseBase.h" #include "MTreatmentAdjustRecirculateResponse.h" namespace View { @@ -30,7 +30,7 @@ * \sa Model::MAdjustRecirculateResponse * */ -class VTreatmentAdjustmentRecirculate : public VTreatmentAdjustmentResponseBase +class VTreatmentAdjustmentRecirculate : public VAdjustmentResponseBase { Q_OBJECT Fisheye: Tag 506a9e3db1a20bda1685e38c5e9041005c9a4a4f refers to a dead (removed) revision in file `sources/view/hd/adjustment/treatment/VTreatmentAdjustmentResponseBase.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 506a9e3db1a20bda1685e38c5e9041005c9a4a4f refers to a dead (removed) revision in file `sources/view/hd/adjustment/treatment/VTreatmentAdjustmentResponseBase.h'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/view/hd/adjustment/treatment/VTreatmentAdjustmentRinseback.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/view/hd/adjustment/treatment/VTreatmentAdjustmentRinseback.h (.../VTreatmentAdjustmentRinseback.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentRinseback.h (.../VTreatmentAdjustmentRinseback.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -18,7 +18,7 @@ // Project #include "main.h" // Doxygen : don't remove -#include "VTreatmentAdjustmentResponseBase.h" +#include "VAdjustmentResponseBase.h" #include "MTreatmentAdjustRinsebackResponse.h" namespace View { @@ -30,7 +30,7 @@ * \sa Model::MAdjustRinsebackResponse * */ -class VTreatmentAdjustmentRinseback : public VTreatmentAdjustmentResponseBase +class VTreatmentAdjustmentRinseback : public VAdjustmentResponseBase { Q_OBJECT Index: sources/view/hd/adjustment/treatment/VTreatmentAdjustmentSaline.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/view/hd/adjustment/treatment/VTreatmentAdjustmentSaline.h (.../VTreatmentAdjustmentSaline.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentSaline.h (.../VTreatmentAdjustmentSaline.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -18,7 +18,7 @@ // Project #include "main.h" // Doxygen : don't remove -#include "VTreatmentAdjustmentResponseBase.h" +#include "VAdjustmentResponseBase.h" #include "MTreatmentAdjustSalineResponse.h" namespace View { @@ -30,7 +30,7 @@ * \sa Model::MAdjustSalineResponse * */ -class VTreatmentAdjustmentSaline : public VTreatmentAdjustmentResponseBase +class VTreatmentAdjustmentSaline : public VAdjustmentResponseBase { Q_OBJECT Index: sources/view/hd/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationConfirm.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/view/hd/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationConfirm.h (.../VTreatmentAdjustmentUltrafiltrationConfirm.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationConfirm.h (.../VTreatmentAdjustmentUltrafiltrationConfirm.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -18,7 +18,7 @@ // Project #include "main.h" // Doxygen : don't remove -#include "VTreatmentAdjustmentResponseBase.h" +#include "VAdjustmentResponseBase.h" #include "MTreatmentAdjustUltrafiltrationConfirmResponse.h" namespace View { @@ -30,7 +30,7 @@ * \sa Model::MAdjustUltrafiltrationConfirmResponse * */ -class VTreatmentAdjustmentUltrafiltrationConfirm : public VTreatmentAdjustmentResponseBase +class VTreatmentAdjustmentUltrafiltrationConfirm : public VAdjustmentResponseBase { Q_OBJECT Index: sources/view/hd/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationEdit.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/view/hd/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationEdit.h (.../VTreatmentAdjustmentUltrafiltrationEdit.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationEdit.h (.../VTreatmentAdjustmentUltrafiltrationEdit.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -18,7 +18,7 @@ // Project #include "main.h" // Doxygen : don't remove -#include "VTreatmentAdjustmentResponseBase.h" +#include "VAdjustmentResponseBase.h" #include "MTreatmentAdjustUltrafiltrationEditResponse.h" namespace View { @@ -30,7 +30,7 @@ * \sa Model::MAdjustUltrafiltrationEditResponse * */ -class VTreatmentAdjustmentUltrafiltrationEdit : public VTreatmentAdjustmentResponseBase +class VTreatmentAdjustmentUltrafiltrationEdit : public VAdjustmentResponseBase { Q_OBJECT Index: sources/view/hd/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationState.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/view/hd/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationState.h (.../VTreatmentAdjustmentUltrafiltrationState.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationState.h (.../VTreatmentAdjustmentUltrafiltrationState.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -18,7 +18,7 @@ // Project #include "main.h" // Doxygen : don't remove -#include "VTreatmentAdjustmentResponseBase.h" +#include "VAdjustmentResponseBase.h" #include "MTreatmentAdjustUltrafiltrationStateResponse.h" namespace View { @@ -30,7 +30,7 @@ * \sa Model::MAdjustUltrafiltrationStateResponse * */ -class VTreatmentAdjustmentUltrafiltrationState : public VTreatmentAdjustmentResponseBase +class VTreatmentAdjustmentUltrafiltrationState : public VAdjustmentResponseBase { Q_OBJECT Index: sources/view/hd/alarm/VAlarmStatus.h =================================================================== diff -u -r99a56ec30f1ca4f401e744766bde4f6fac291752 -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- sources/view/hd/alarm/VAlarmStatus.h (.../VAlarmStatus.h) (revision 99a56ec30f1ca4f401e744766bde4f6fac291752) +++ sources/view/hd/alarm/VAlarmStatus.h (.../VAlarmStatus.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -31,7 +31,7 @@ // Project #include "main.h" // Doxygen : don't remove -#include "VTreatmentAdjustmentResponseBase.h" +#include "VAdjustmentResponseBase.h" namespace View { @@ -42,7 +42,7 @@ * \sa Model::MAlarmStatus * */ -class VAlarmStatus : public VTreatmentAdjustmentResponseBase +class VAlarmStatus : public VAdjustmentResponseBase { Q_OBJECT Index: sources/view/settings/VAdjustmentVersions.cpp =================================================================== diff -u --- sources/view/settings/VAdjustmentVersions.cpp (revision 0) +++ sources/view/settings/VAdjustmentVersions.cpp (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -0,0 +1,60 @@ +/*! + * + * 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 VAdjustmentVersions.cpp + * \author (last) Peman Montazemi + * \date (last) 6-Nov-2020 + * \author (original) Peman Montazemi + * \date (original) 6-Nov-2020 + * + */ +#include "VAdjustmentVersions.h" + +// Project +#include "GuiController.h" + +VIEW_DEF_CLASS_ADJUSTMENT(VAdjustmentVersions) + +void VAdjustmentVersions::initConnections() { + ACTION_VIEW_CONNECTION(AdjustHDVersionsResponseData); + ACTION_VIEW_CONNECTION(AdjustDGVersionsResponseData); + ADJUST_VIEW_CONNECTION( AdjustVersionsRequestData); +} + +void VAdjustmentVersions::onActionReceive(const AdjustHDVersionsResponseData &vData) +{ + // HD versions data + hdVerMajor (vData.mMajor ); + hdVerMinor (vData.mMinor ); + hdVerMicro (vData.mMicro ); + hdVerBuild (vData.mBuild ); + hdVerFPGAId (vData.mFPGAId ); + hdVerFPGAMajor (vData.mFPGAMajor); + hdVerFPGAMinor (vData.mFPGAMinor); + hdVerFPGALab (vData.mFPGALab ); + + // *** 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. *** + adjustmentHD(true); // set here only because adjustment parent needs it, but HD Versions does not +} + +void VAdjustmentVersions::onActionReceive(const AdjustDGVersionsResponseData &vData) +{ + // DG versions data + dgVerMajor (vData.mMajor ); + dgVerMinor (vData.mMinor ); + dgVerMicro (vData.mMicro ); + dgVerBuild (vData.mBuild ); + dgVerFPGAId (vData.mFPGAId ); + dgVerFPGAMajor (vData.mFPGAMajor); + dgVerFPGAMinor (vData.mFPGAMinor); + dgVerFPGALab (vData.mFPGALab ); + + // *** 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. *** + adjustmentDG(true); // set here only because adjustment parent needs it, but HD Versions does not +} Index: sources/view/settings/VAdjustmentVersions.h =================================================================== diff -u --- sources/view/settings/VAdjustmentVersions.h (revision 0) +++ sources/view/settings/VAdjustmentVersions.h (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -0,0 +1,84 @@ +/*! + * + * 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 VAdjustmentVersions.h + * \author (last) Peman Montazemi + * \date (last) 6-Nov-2020 + * \author (original) Peman Montazemi + * \date (original) 6-Nov-2020 + * + */ +#pragma once + +#include + +// Project +#include "main.h" // Doxygen : don't remove +#include "VAdjustmentResponseBase.h" +#include "MAdjustHDVersionsResponse.h" +#include "MAdjustDGVersionsResponse.h" + +namespace View { + +/*! + * \brief The VAdjustmentVersions class + * \details View for Model's Data representation. + * + * \sa Model::MAdjustVersionsResponse + * + */ +class VAdjustmentVersions : public VAdjustmentResponseBase { + Q_OBJECT + + // friends + friend class ::tst_views; + + AdjustVersionsRequestData _data; + + // 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 , adjustmentHD , 0) + TRIGGER( bool , adjustmentDG , 0) + // coco end + + // HD Versions data + PROPERTY( quint8 , hdVerMajor , 0) + PROPERTY( quint8 , hdVerMinor , 0) + PROPERTY( quint8 , hdVerMicro , 0) + PROPERTY( quint16 , hdVerBuild , 0) + PROPERTY( quint8 , hdVerFPGAId , 0) + PROPERTY( quint8 , hdVerFPGAMajor , 0) + PROPERTY( quint8 , hdVerFPGAMinor , 0) + PROPERTY( quint8 , hdVerFPGALab , 0) + + // DG Versions data + PROPERTY( quint8 , dgVerMajor , 0) + PROPERTY( quint8 , dgVerMinor , 0) + PROPERTY( quint8 , dgVerMicro , 0) + PROPERTY( quint16 , dgVerBuild , 0) + PROPERTY( quint8 , dgVerFPGAId , 0) + PROPERTY( quint8 , dgVerFPGAMajor , 0) + PROPERTY( quint8 , dgVerFPGAMinor , 0) + PROPERTY( quint8 , dgVerFPGALab , 0) + + VIEW_DEC_CLASS(VAdjustmentVersions) + VIEW_DEC_SLOT (AdjustHDVersionsResponseData) + VIEW_DEC_SLOT (AdjustDGVersionsResponseData) + +// ---------- Version +public slots: + void doAdjustment() { + AdjustVersionsRequestData data; + emit didAdjustment(data); + } + +signals: + void didAdjustment(const AdjustVersionsRequestData &vData); +}; +} Index: sources/view/settings/VDateTime.cpp =================================================================== diff -u --- sources/view/settings/VDateTime.cpp (revision 0) +++ sources/view/settings/VDateTime.cpp (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -0,0 +1,206 @@ +/*! + * + * 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 VDateTime.cpp + * \author (last) Peter Lucia + * \date (last) 16-Apr-2021 + * \author (original) Peter Lucia + * \date (original) 16-Apr-2021 + * + */ +#include "VDateTime.h" + +// Qt +#include + +// Project +#include "GuiController.h" +// #include "Logger.h" + +using namespace View; + +VIEW_DEF_CLASS(VDateTime) + +void VDateTime::initConnections() { + ACTION_VIEW_CONNECTION(AdjustHDDateTimeResponseData); + ACTION_VIEW_CONNECTION(AdjustDGDateTimeResponseData); + ADJUST_VIEW_CONNECTION( AdjustHDDateTimeRequestData); + ADJUST_VIEW_CONNECTION( AdjustDGDateTimeRequestData); + + connect(&_process, SIGNAL( finished(int)), + this, SLOT(onSetDateUIFinished(int))); +} + +/*! + * \brief VDateTime::doCurrentTime + * Reads and displays the current date and time + */ +void VDateTime::doInit() +{ + _acceptHD = NOT_SET; + _acceptDG = NOT_SET; + _acceptUI = NOT_SET; + QDateTime _currentTime = QDateTime::currentDateTime(); + hour (_currentTime.toString("hh" )); + minute(_currentTime.toString("mm" )); + second(_currentTime.toString("ss" )); + day (_currentTime.toString("dd" )); + month (_currentTime.toString("MM" )); + year (_currentTime.toString("yyyy" )); + + status(""); +} + +/*! + * \brief doConfirm + * \details Issues request to save the current date and time to UI, HD and DG + */ +void VDateTime::doConfirm( + const QString &vYear , + const QString &vMonth , + const QString &vDay , + const QString &vHour , + const QString &vMinute ) +{ + quint32 epoch = + QDateTime( + QDate(vYear .toInt() , + vMonth .toInt() , + vDay .toInt()), + QTime(vHour .toInt() , + vMinute .toInt()) + ).toSecsSinceEpoch(); + + status("Setting date and time..."); + + dateTimeHD(epoch); + dateTimeDG(epoch); + dateTimeUI( ); +} + +/*! + * \brief VDateTime::onFinishedSetDateUI + * Called when the process that sets the UI date and time has finished. + * \param vExitCode - (int) the exit code of the process + */ +void VDateTime::onSetDateUIFinished(const int &vExitCode) +{ + if ( vExitCode ) { + _acceptUI = FAILED; + LOG_DEBUG(QString("SetDataTime[%1]").arg(vExitCode)); + } + else { + _acceptUI = SUCCEED; + } + updateStatus(); +} + +/*! + * \brief VDateTime::onActionReceive + * Called when we receive a response back from the HD after requesting to + * set the epoch + * \param vData (AdjustHDDateTimeResponseData) - the response data + */ +void VDateTime::onActionReceive(const AdjustHDDateTimeResponseData &vData) +{ + _acceptHD = vData.mAccepted ? SUCCEED : FAILED; + _reasonHD = vData.mReason ; + updateStatus(); +} + +/*! + * \brief VDateTime::onActionReceive + * Called when we receive a response back from the DG after requesting to + * set the epoch + * \param vResponse (AdjustDGDateTimeResponseData) - the response + */ +void VDateTime::onActionReceive(const AdjustDGDateTimeResponseData &vData) +{ + _acceptDG = vData.mAccepted ? SUCCEED : FAILED; + _reasonDG = vData.mReason ; + updateStatus(); +} + +/*! + * \brief VDateTime::dateTimeHD + * \details Requests HD to set the date/time + * \param epoch - the epoch parameter which FW understands to set date/time + */ +void VDateTime::dateTimeHD(quint32 epoch) +{ + AdjustHDDateTimeRequestData data; + data.mEpoch = epoch; + emit didAdjustment(data); +} + +/*! + * \brief VDateTime::dateTimeDG + * \details Requests DG to set the date/time + * \param epoch - the epoch parameter which FW understands to set date/time + */ +void VDateTime::dateTimeDG(quint32 epoch) +{ + AdjustDGDateTimeRequestData data; + data.mEpoch = epoch; + emit didAdjustment(data); +} + +/*! + * \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() +{ + // 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); +} + +/*! + * \brief VDateTime::status + * \details Returns the appropriate string for the date/time adjustment status + * \param vStatus - the status of the adjustment + * \param vReason - the reason if the adjustment has been rejected. + * \return the status string + */ +QString VDateTime::status(VDateTime::DateTimeSetStatus vStatus, quint8 vReason) +{ + QString mNotSet = tr("Not Set"); + QString mSucceed = tr("Succeed"); + QString mFailed = tr("Failed" ) + " [%1]"; + switch (vStatus) { + case SUCCEED: + return mSucceed; + break; + case FAILED: + return mFailed.arg(vReason); + break; + default: + return mNotSet; + break; + } +} + +/*! + * \brief VDateTime::updateStatus + * Update the notification bar's status + */ +void VDateTime::updateStatus() +{ + status(QString("HD: %1, DG: %2, UI: %3") + .arg(status(_acceptHD, _reasonHD)) + .arg(status(_acceptDG, _reasonDG)) + .arg(status(_acceptUI, _reasonUI)) + ); +} Index: sources/view/settings/VDateTime.h =================================================================== diff -u --- sources/view/settings/VDateTime.h (revision 0) +++ sources/view/settings/VDateTime.h (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -0,0 +1,98 @@ +/*! + * + * 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 VDateTime.h + * \author (last) Peter Lucia + * \date (last) 16-Apr-2021 + * \author (original) Peter Lucia + * \date (original) 16-Apr-2021 + * + */ +#pragma once + +// Qt +#include +#include + +// Project +#include "main.h" // Doxygen : don't remove +#include "VAdjustmentResponseBase.h" +#include "MAdjustHDDateTimeResponse.h" +#include "MAdjustDGDateTimeResponse.h" + + +// forward declarations +class tst_views; + +namespace View { + +/*! + * \brief The VDateTime class + * \details View for handling the date and time + * + */ +class VDateTime : public QObject +{ + Q_OBJECT + + // friends + friend class ::tst_views; + +public: + enum DateTimeSetStatus { + NOT_SET = -1, + FAILED , // 0 == false == FAILED + SUCCEED , // 1 == true == SUCCEED + }; + Q_ENUM(DateTimeSetStatus) + +private: + int _timerInterval = 1000; // ms + QProcess _process ; + + DateTimeSetStatus _acceptHD = NOT_SET; + DateTimeSetStatus _acceptDG = NOT_SET; + DateTimeSetStatus _acceptUI = NOT_SET; + quint8 _reasonHD = 0; + quint8 _reasonDG = 0; + quint8 _reasonUI = 0; + + void dateTimeHD(quint32 epoch); + void dateTimeDG(quint32 epoch); + void dateTimeUI( ); + + QString status(DateTimeSetStatus vStatus, quint8 vReason); + void updateStatus(); + + PROPERTY(QString, year , "0000") + PROPERTY(QString, month , "00" ) + PROPERTY(QString, day , "00" ) + PROPERTY(QString, hour , "00" ) + PROPERTY(QString, minute , "00" ) + PROPERTY(QString, second , "00" ) + PROPERTY(QString, status , "" ) + + VIEW_DEC_CLASS(VDateTime) + VIEW_DEC_SLOT (AdjustHDDateTimeResponseData) + VIEW_DEC_SLOT (AdjustDGDateTimeResponseData) + +private slots: + void onSetDateUIFinished(const int &vExitCode); + +public slots: + void doInit (); + void doConfirm (const QString &vYear , + const QString &vMonth , + const QString &vDay , + const QString &vHour , + const QString &vMinute); + +signals: + void didAdjustment(const AdjustHDDateTimeRequestData); + void didAdjustment(const AdjustDGDateTimeRequestData); +}; +} Index: unittests/tst_views.cpp =================================================================== diff -u -r7cc15ae5968205b241a08ca4646f283b8bf97b03 -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f --- unittests/tst_views.cpp (.../tst_views.cpp) (revision 7cc15ae5968205b241a08ca4646f283b8bf97b03) +++ unittests/tst_views.cpp (.../tst_views.cpp) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) @@ -17,7 +17,7 @@ // Qt // Project -#include "VTreatmentAdjustmentResponseBase.h" +#include "VAdjustmentResponseBase.h" #include "VTreatmentAdjustmentUltrafiltrationState.h" #include "FileHandler.h" #include "VPreTreatmentDisposablesPrimeData.h" @@ -27,14 +27,14 @@ void tst_views::VTreatmentAdjustmentsResponse_text_NoReason() { - View::VTreatmentAdjustmentResponseBase v; + View::VAdjustmentResponseBase v; v.adjustment_Reason(GuiRequestReasons::REQUEST_REJECT_REASON_NONE); QVERIFY(v.text().isEmpty()); } void tst_views::VTreatmentAdjustmentsResponse_text_WAReason() { - View::VTreatmentAdjustmentResponseBase v; + View::VAdjustmentResponseBase v; v.adjustment_Reason(GuiRequestReasons::REQUEST_REJECT_REASON_INVALID_TREATMENT_STATE); QVERIFY(! v.text().isEmpty()); }