Index: denali.pro =================================================================== diff -u -rb94c297fa75f826acd539c57684c1769e5883d67 -r161d1431cc3507cd430f54af6aa47dab5145d472 --- denali.pro (.../denali.pro) (revision b94c297fa75f826acd539c57684c1769e5883d67) +++ denali.pro (.../denali.pro) (revision 161d1431cc3507cd430f54af6aa47dab5145d472) @@ -209,6 +209,7 @@ sources/model/hd/data/treatment/MTreatmentRinsebackData.h \ sources/model/hd/data/treatment/MTreatmentRecirculateData.h \ sources/model/hd/data/treatment/MTreatmentBloodPrimeData.h \ + sources/model/hd/data/treatment/MTreatmentStopData.h \ \ # ---------- Models - HD - Data - Treatment Log sources/model/hd/data/treatmentlog/MTreatmentLogAlarmData.h \ sources/model/hd/data/treatmentlog/MTreatmentLogAvrgeData.h \ @@ -326,6 +327,7 @@ sources/view/hd/data/treatment/VTreatmentRinsebackData.h \ sources/view/hd/data/treatment/VTreatmentRecirculateData.h \ sources/view/hd/data/treatment/VTreatmentBloodPrimeData.h \ + sources/view/hd/data/treatment/VTreatmentStopData.h \ \ # ---------- Views - DG - Data - Pre-Treatment - Progress sources/view/dg/data/pretreatment/VDGFilterFlushData.h \ \ # ---------- Views - DG - Data - Disinfection - Progress @@ -449,6 +451,7 @@ sources/model/hd/data/treatment/MTreatmentRinsebackData.cpp \ sources/model/hd/data/treatment/MTreatmentRecirculateData.cpp \ sources/model/hd/data/treatment/MTreatmentBloodPrimeData.cpp \ + sources/model/hd/data/treatment/MTreatmentStopData.cpp \ \ # ---------- Models - HD - Data - Pre-Treatment sources/model/hd/data/pretreatment/MPreTreatmentDisposablesPrimeData.cpp \ sources/model/hd/data/pretreatment/MPreTreatmentSelfTestNoCartridgeData.cpp \ @@ -569,6 +572,7 @@ sources/view/hd/data/treatment/VTreatmentBloodPrimeData.cpp \ sources/view/hd/data/treatment/VTreatmentRinsebackData.cpp \ sources/view/hd/data/treatment/VTreatmentRecirculateData.cpp \ + sources/view/hd/data/treatment/VTreatmentStopData.cpp \ \ # ---------- Views - DG - Data - Pre-Treatment - Progress sources/view/dg/data/pretreatment/VDGFilterFlushData.cpp \ \ # ---------- Views - DG - Data - Disinfect - Progress Index: denali.pro.user =================================================================== diff -u -rb94c297fa75f826acd539c57684c1769e5883d67 -r161d1431cc3507cd430f54af6aa47dab5145d472 --- denali.pro.user (.../denali.pro.user) (revision b94c297fa75f826acd539c57684c1769e5883d67) +++ denali.pro.user (.../denali.pro.user) (revision 161d1431cc3507cd430f54af6aa47dab5145d472) @@ -1,6 +1,6 @@ - + EnvironmentId Index: sources/canbus/MessageGlobals.h =================================================================== diff -u -rb94c297fa75f826acd539c57684c1769e5883d67 -r161d1431cc3507cd430f54af6aa47dab5145d472 --- sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision b94c297fa75f826acd539c57684c1769e5883d67) +++ sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision 161d1431cc3507cd430f54af6aa47dab5145d472) @@ -67,6 +67,7 @@ {Gui::GuiActionType::ID_Rinseback , 6 * 4 }, // 6 parameters each 4bytes {Gui::GuiActionType::ID_Recirculate , 2 * 4 }, // 2 parameters each 4bytes {Gui::GuiActionType::ID_BloodPrime , 2 * 4 }, // 2 parameters each 4bytes + {Gui::GuiActionType::ID_TreatmentStop , 2 * 4 }, // 2 parameters each 4bytes // ---- {Gui::GuiActionType::ID_HDOperationModeData , 2 * 4 }, // 2 parameter each 4bytes Index: sources/canbus/MessageInterpreter.cpp =================================================================== diff -u -rb94c297fa75f826acd539c57684c1769e5883d67 -r161d1431cc3507cd430f54af6aa47dab5145d472 --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision b94c297fa75f826acd539c57684c1769e5883d67) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 161d1431cc3507cd430f54af6aa47dab5145d472) @@ -457,6 +457,7 @@ case Gui::GuiActionType::ID_Rinseback : ok = notify(vMessage, vData, Gui::GuiActionType::ID_Rinseback ); break; case Gui::GuiActionType::ID_Recirculate : ok = notify(vMessage, vData, Gui::GuiActionType::ID_Recirculate ); break; case Gui::GuiActionType::ID_BloodPrime : ok = notify(vMessage, vData, Gui::GuiActionType::ID_BloodPrime ); break; + case Gui::GuiActionType::ID_TreatmentStop : ok = notify(vMessage, vData, Gui::GuiActionType::ID_TreatmentStop ); break; // ----- In-Treatment Adjust case Gui::GuiActionType::ID_AdjustDurationRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustDurationRsp ); break; case Gui::GuiActionType::ID_AdjustBloodDialysateRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustBloodDialysateRsp ); break; Index: sources/gui/GuiGlobals.cpp =================================================================== diff -u -r2dd767833cf0cf706c457951c2d78e7e20aff768 -r161d1431cc3507cd430f54af6aa47dab5145d472 --- sources/gui/GuiGlobals.cpp (.../GuiGlobals.cpp) (revision 2dd767833cf0cf706c457951c2d78e7e20aff768) +++ sources/gui/GuiGlobals.cpp (.../GuiGlobals.cpp) (revision 161d1431cc3507cd430f54af6aa47dab5145d472) @@ -76,6 +76,7 @@ #include "VTreatmentRinsebackData.h" #include "VTreatmentRecirculateData.h" #include "VTreatmentBloodPrimeData.h" +#include "VTreatmentStopData.h" #include "VHDAccelerometerData.h" #include "VHDSyringePumpData.h" // DG data Index: sources/gui/GuiGlobals.h =================================================================== diff -u -rb94c297fa75f826acd539c57684c1769e5883d67 -r161d1431cc3507cd430f54af6aa47dab5145d472 --- sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision b94c297fa75f826acd539c57684c1769e5883d67) +++ sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 161d1431cc3507cd430f54af6aa47dab5145d472) @@ -128,6 +128,7 @@ ID_Rinseback = 0x5600, // 86 ID_Recirculate = 0x5A00, // 90 ID_BloodPrime = 0x5900, // 89 + ID_TreatmentStop = 0x4900, // 73 // Alarm Messages ID_AlarmStatus = 0x0200, Index: sources/gui/qml/AlarmItem.qml =================================================================== diff -u -r76d4131d70c18cbfaf47c242c17258e80161e8dc -r161d1431cc3507cd430f54af6aa47dab5145d472 --- sources/gui/qml/AlarmItem.qml (.../AlarmItem.qml) (revision 76d4131d70c18cbfaf47c242c17258e80161e8dc) +++ sources/gui/qml/AlarmItem.qml (.../AlarmItem.qml) (revision 161d1431cc3507cd430f54af6aa47dab5145d472) @@ -114,6 +114,8 @@ endVisible : ! vAlarmStatus.alarm_Flag_noEndTreatment minVisible : ! vAlarmStatus.alarm_Flag_noMinimize titleFading : vHDOperationMode.fault + countDown : vTreatmentStop.countDown + countDownVisible : vHDTreatmentStates.txStop && vTreatmentStop.total onMuteClicked : vAlarmStatus.doSilence () onResumeClicked : vAlarmStatus.doUserActionResume () Index: sources/gui/qml/dialogs/NotificationDialog.qml =================================================================== diff -u -rfc329c788fe9453983072bee937ccbc95b4ed6e4 -r161d1431cc3507cd430f54af6aa47dab5145d472 --- sources/gui/qml/dialogs/NotificationDialog.qml (.../NotificationDialog.qml) (revision fc329c788fe9453983072bee937ccbc95b4ed6e4) +++ sources/gui/qml/dialogs/NotificationDialog.qml (.../NotificationDialog.qml) (revision 161d1431cc3507cd430f54af6aa47dab5145d472) @@ -35,6 +35,10 @@ property alias timeout : _muteButton.timeout property int alarmID : -1 + property alias countDown : _timeoutText.countDown + property alias countDownVisible : _timeoutText.visible + + property bool resumeVisible : false property bool rinsebackVisible : false property bool endVisible : false @@ -113,6 +117,24 @@ } onClicked: _root.muteClicked() } + + TimeText { id: _timeoutText + property int countDown : 0 + seconds : countDown * 60 + + height: _titleBar.height + anchors { + verticalCenter : _titleBar.verticalCenter + right : _titleBar.right + rightMargin : _minimizeButton.width * 2 + } + textPixelSize : 30 + textWeight : Font.Normal + secondsVisible : false + hourZero : false + minuteZero : true + } + // TODO: disable this later. this is only for diagnostic purpose when alarm dialog covers the entire screen. MouseArea { anchors.fill: _icon @@ -121,14 +143,23 @@ } } - Text { id: _desc - objectName: "_NotificationDialog_Description" - color: Colors.textMain - font.pixelSize: Fonts.fontPixelButton + Rectangle { id: _descReect + color: Colors.transparent anchors { - horizontalCenter: parent.horizontalCenter; - verticalCenter: parent.verticalCenter; + fill : parent + topMargin : 5 + _titleBar .height + bottomMargin : 5 + _buttonGroup .height + _buttonGroup.spacing } + + Text { id: _desc + objectName: "_NotificationDialog_Description" + color: Colors.textMain + font.pixelSize: Fonts.fontPixelButton + anchors { + horizontalCenter: parent.horizontalCenter + verticalCenter : parent.verticalCenter + } + } } Row { id: _buttonGroup Index: sources/gui/qml/main.qml =================================================================== diff -u -r76d4131d70c18cbfaf47c242c17258e80161e8dc -r161d1431cc3507cd430f54af6aa47dab5145d472 --- sources/gui/qml/main.qml (.../main.qml) (revision 76d4131d70c18cbfaf47c242c17258e80161e8dc) +++ sources/gui/qml/main.qml (.../main.qml) (revision 161d1431cc3507cd430f54af6aa47dab5145d472) @@ -59,6 +59,7 @@ import VTreatmentRinseback 0.1 import VTreatmentRecirculate 0.1 import VTreatmentBloodPrime 0.1 +import VTreatmentStop 0.1 import VTreatmentRanges 0.1 // Pre-Treatment import VPreTreatmentAdjustmentInitTreatment 0.1 @@ -153,6 +154,7 @@ VTreatmentBloodPrime { id: vTreatmentBloodPrime } VTreatmentRinseback { id: vTreatmentRinseback } VTreatmentRecirculate { id: vTreatmentRecirculate } + VTreatmentStop { id: vTreatmentStop } VHDAccelerometer { id: vHDAccelerometer } VHDSyringePump { id: vHDSyringePump } // ---- DG Index: sources/model/MModel.h =================================================================== diff -u -rb94c297fa75f826acd539c57684c1769e5883d67 -r161d1431cc3507cd430f54af6aa47dab5145d472 --- sources/model/MModel.h (.../MModel.h) (revision b94c297fa75f826acd539c57684c1769e5883d67) +++ sources/model/MModel.h (.../MModel.h) (revision 161d1431cc3507cd430f54af6aa47dab5145d472) @@ -54,6 +54,7 @@ #include "MTreatmentRinsebackData.h" #include "MTreatmentRecirculateData.h" #include "MTreatmentBloodPrimeData.h" +#include "MTreatmentStopData.h" #include "MHDAccelerometerData.h" #include "MHDSyringePumpData.h" @@ -286,6 +287,7 @@ REGISTER_METATYPE( TreatmentRinsebackData ) \ REGISTER_METATYPE( TreatmentRecirculateData ) \ REGISTER_METATYPE( TreatmentBloodPrimeData ) \ + REGISTER_METATYPE( TreatmentStopData ) \ REGISTER_METATYPE( HDSyringePumpData ) \ REGISTER_METATYPE( HDAccelerometerData ) \ /* Treatment Log */ \ @@ -454,6 +456,7 @@ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, TreatmentRinsebackData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, TreatmentRecirculateData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, TreatmentBloodPrimeData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, TreatmentStopData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, HDSyringePumpData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, HDAccelerometerData ) \ /* Treatment Log */ \ @@ -625,6 +628,7 @@ ACTION_RECEIVE_BRIDGE_DEFINITION( TreatmentRinsebackData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( TreatmentRecirculateData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( TreatmentBloodPrimeData ) \ + ACTION_RECEIVE_BRIDGE_DEFINITION( TreatmentStopData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( HDSyringePumpData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( HDAccelerometerData ) \ /* Treatment Log */ \ @@ -881,6 +885,7 @@ ACTION_RECEIVE_SIGNAL( TreatmentRinsebackData ) \ ACTION_RECEIVE_SIGNAL( TreatmentRecirculateData ) \ ACTION_RECEIVE_SIGNAL( TreatmentBloodPrimeData ) \ + ACTION_RECEIVE_SIGNAL( TreatmentStopData ) \ ACTION_RECEIVE_SIGNAL( HDSyringePumpData ) \ ACTION_RECEIVE_SIGNAL( HDAccelerometerData ) \ /* Alarms */ \ Index: sources/model/hd/data/treatment/MTreatmentStopData.cpp =================================================================== diff -u --- sources/model/hd/data/treatment/MTreatmentStopData.cpp (revision 0) +++ sources/model/hd/data/treatment/MTreatmentStopData.cpp (revision 161d1431cc3507cd430f54af6aa47dab5145d472) @@ -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 MTreatmentStopData.h + * \author (last) Behrouz NematiPour + * \author (original) Behrouz NematiPour + * \date (last) 07-Oct-2021 + * \date (original) 07-Oct-2021 + * + */ +#include "MTreatmentStopData.h" + +using namespace Model; + +QVariantList MTreatmentStop::parameters() const { + return { + _data.mTotal .value, + _data.mCountDown.value, + }; +} + +bool MTreatmentStop::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if (GetValue(vByteArray, index, _data.mTotal )) + if (GetValue(vByteArray, index, _data.mCountDown)) + return true ; + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } +} + +/*! + * \brief MTreatmentStop::data + * \details Provides model's Data from the received messages data values + * \return Data + */ +MTreatmentStop::Data MTreatmentStop::data() const { + Data data; + data.mTotal = _data.mTotal .value; + data.mCountDown = _data.mCountDown.value; + return data; +} Index: sources/model/hd/data/treatment/MTreatmentStopData.h =================================================================== diff -u --- sources/model/hd/data/treatment/MTreatmentStopData.h (revision 0) +++ sources/model/hd/data/treatment/MTreatmentStopData.h (revision 161d1431cc3507cd430f54af6aa47dab5145d472) @@ -0,0 +1,83 @@ +/*! + * + * 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 MTreatmentStopData.h + * \author (last) Behrouz NematiPour + * \author (original) Behrouz NematiPour + * \date (last) 07-Oct-2021 + * \date (original) 07-Oct-2021 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "MAbstract.h" +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +/*! + * \brief The MTreatmentStop class + * \details The treatment Stop bolus data model + * + * | MSG | CAN ID | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:------:|:---:|:---:|:---:|:-----------:| + * |0x4900| 0x020 | 1 Hz | N | HD | UI | Treatment Stop Progress | + * + * | Payload || + * | || + * | #1:(U32) | \ref Data::mTotal | + * | #2:(U32) | \ref Data::mCountDown | + * + * \sa Data + * + *

Logging info

+ * | || + * | || + * | typeText | Datum | + * | unitText | HD | + * | infoText | StopData | + * + */ +class MTreatmentStop : public MAbstract { + + // friends + friend class ::tst_models; + + QVariantList parameters() const override; + + struct { + Types::U32 mTotal ; + Types::U32 mCountDown; + } _data; + +public: + + Type_Enum typeText() const override { return Type_Enum::eDatum ; } + Unit_Enum unitText() const override { return Unit_Enum::eHD ; } + QString infoText() const override { return QString("StopData") ; } + + struct Data { + quint32 mTotal = 0; ///< Total Timeout of Treatment Blood Stop + quint32 mCountDown = 0; ///< Current Timeout count down of Treatment Blood Stop + }; + +public: + MTreatmentStop () { } + + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; + Data data ( ) const ; +}; +} + +typedef Model::MTreatmentStop::Data TreatmentStopData; Index: sources/view/VView.h =================================================================== diff -u -r2dd767833cf0cf706c457951c2d78e7e20aff768 -r161d1431cc3507cd430f54af6aa47dab5145d472 --- sources/view/VView.h (.../VView.h) (revision 2dd767833cf0cf706c457951c2d78e7e20aff768) +++ sources/view/VView.h (.../VView.h) (revision 161d1431cc3507cd430f54af6aa47dab5145d472) @@ -140,6 +140,7 @@ REGISTER_TYPE( VTreatmentRinseback ) \ REGISTER_TYPE( VTreatmentRecirculate ) \ REGISTER_TYPE( VTreatmentBloodPrime ) \ + REGISTER_TYPE( VTreatmentStop ) \ /* Device - Data */ \ REGISTER_TYPE( VHDAccelerometer ) \ REGISTER_TYPE( VHDSyringePump ) \ Index: sources/view/hd/data/treatment/VTreatmentStopData.cpp =================================================================== diff -u --- sources/view/hd/data/treatment/VTreatmentStopData.cpp (revision 0) +++ sources/view/hd/data/treatment/VTreatmentStopData.cpp (revision 161d1431cc3507cd430f54af6aa47dab5145d472) @@ -0,0 +1,26 @@ +/*! + * + * 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 VTreatmentStopData.cpp + * \author (last) Behrouz NematiPour + * \author (original) Behrouz NematiPour + * \date (last) 07-Oct-2021 + * \date (original) 07-Oct-2021 + * + */ +#include "VTreatmentStopData.h" + +// Project +#include "GuiController.h" + +VIEW_DEF(VTreatmentStop, TreatmentStopData) + +void VTreatmentStop::onActionReceive(const TreatmentStopData &vData) +{ + total ( vData.mTotal ); + countDown( vData.mCountDown ); +} Index: sources/view/hd/data/treatment/VTreatmentStopData.h =================================================================== diff -u --- sources/view/hd/data/treatment/VTreatmentStopData.h (revision 0) +++ sources/view/hd/data/treatment/VTreatmentStopData.h (revision 161d1431cc3507cd430f54af6aa47dab5145d472) @@ -0,0 +1,44 @@ +/*! + * + * 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 VTreatmentStopData.h + * \author (last) Behrouz NematiPour + * \author (original) Behrouz NematiPour + * \date (last) 07-Oct-2021 + * \date (original) 07-Oct-2021 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "main.h" // Doxygen : do not remove +#include "VView.h" +#include "MTreatmentStopData.h" + +// namespace +namespace View { + +/*! + * \brief The VTreatmentStop class + * \details View for Model's data representation. + * + * \sa Model::MTreatmentStop + * + */ +class VTreatmentStop : public QObject +{ + Q_OBJECT + + PROPERTY( quint32 , total , 0) + PROPERTY( quint32 , countDown, 0) + + VIEW_DEC(VTreatmentStop, TreatmentStopData) +}; +}