Index: denali.pro
===================================================================
diff -u -rfe9182d85a7e707c5a476331e03ed493371f7f7f -rf148379112a69d1c52027f2667e95f3f96d948ad
--- denali.pro (.../denali.pro) (revision fe9182d85a7e707c5a476331e03ed493371f7f7f)
+++ denali.pro (.../denali.pro) (revision f148379112a69d1c52027f2667e95f3f96d948ad)
@@ -38,6 +38,7 @@
HEADERS += \
sources/main.h \
sources/maintimer.h \
+ sources/model/mtreatmentadjustblooddialysateresponse.h \
sources/model/mtreatmentpressureocclusion.h \
sources/threads.h \
sources/applicationcontroller.h \
@@ -60,6 +61,7 @@
sources/model/mtreatmentflows.h \
sources/model/mtreatmentoutletflow.h \
sources/model/mtreatmenttime.h \
+ sources/view/vtreatmentadjustmentsresponse.h \
sources/view/vtreatmentpressureocclusion.h \
sources/view/vview.h \
sources/view/vpoweroff.h \
@@ -80,6 +82,7 @@
SOURCES += \
main.cpp \
sources/maintimer.cpp \
+ sources/model/mtreatmentadjustblooddialysateresponse.cpp \
sources/model/mtreatmentpressureocclusion.cpp \
sources/threads.cpp \
sources/applicationcontroller.cpp \
@@ -101,6 +104,7 @@
sources/model/mtreatmenttime.cpp \
sources/model/malarmstatus.cpp \
sources/view/vpoweroff.cpp \
+ sources/view/vtreatmentadjustmentsresponse.cpp \
sources/view/vtreatmentbloodflow.cpp \
sources/view/vtreatmentdialysateflow.cpp \
sources/view/vtreatmentpressureocclusion.cpp \
Index: denali.qrc
===================================================================
diff -u -rcd7de5f6d239a11615ba8c6c03339a10996486ca -rf148379112a69d1c52027f2667e95f3f96d948ad
--- denali.qrc (.../denali.qrc) (revision cd7de5f6d239a11615ba8c6c03339a10996486ca)
+++ denali.qrc (.../denali.qrc) (revision f148379112a69d1c52027f2667e95f3f96d948ad)
@@ -48,6 +48,7 @@
sources/gui/qml/components/CloseButton.qml
sources/gui/qml/components/ConfirmButton.qml
sources/gui/qml/components/TickMarks.qml
+ sources/gui/qml/components/NotificationBar.qml
qtquickcontrols2.conf
Index: sources/canbus/messagedispatcher.h
===================================================================
diff -u -r4a6abe765f03feae8100ec660aa04aa218d4dfa3 -rf148379112a69d1c52027f2667e95f3f96d948ad
--- sources/canbus/messagedispatcher.h (.../messagedispatcher.h) (revision 4a6abe765f03feae8100ec660aa04aa218d4dfa3)
+++ sources/canbus/messagedispatcher.h (.../messagedispatcher.h) (revision f148379112a69d1c52027f2667e95f3f96d948ad)
@@ -99,7 +99,9 @@
QThread *_thread = nullptr;
bool _init = false;
- QList _needsAcknow {}; // no action needs Acknow for now
+ QList _needsAcknow {
+ // GuiActionType::AdjustBloodDialysateReq
+ }; // no action needs Acknow for now
// Singleton
SINGLETON(MessageDispatcher)
Index: sources/canbus/messageinterpreter.cpp
===================================================================
diff -u -rfef563aa317eb3e025e2dab0264e854f05a216d6 -rf148379112a69d1c52027f2667e95f3f96d948ad
--- sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision fef563aa317eb3e025e2dab0264e854f05a216d6)
+++ sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision f148379112a69d1c52027f2667e95f3f96d948ad)
@@ -31,6 +31,24 @@
*/
MessageInterpreter::MessageInterpreter(QObject *parent) : QObject(parent) { }
+bool MessageInterpreter::isType(const Message &vMessage, Gui::GuiActionType vType) const
+{
+ if ( vMessage.actionId != vType ) {
+ return false;
+ }
+ return true;
+}
+
+bool MessageInterpreter::isPayloadLenValid(const Message &vMessage, Gui::GuiActionType vType) const
+{
+ if ( vMessage.data.length() < payloadLen[vType] ) {
+ QString mActionIdHexString = Format::toHexString(vMessage.actionId);
+ LOG_ERROR(tr("Incorrect data for Message ID (HD) '%1'").arg(mActionIdHexString));
+ return false;
+ }
+ return true;
+}
+
/*!
* \brief MessageInterpreter::interpretMessage
* \details This method will be called
@@ -219,9 +237,15 @@
break;
case Gui::GuiActionType::PressureOcclusion:
- ok = pressureOcclusionData (vMessage, vData);
+ ok = pressureOcclusionData (vMessage, vData);
break;
+ case Gui::GuiActionType::AdjustBloodDialysateRsp:
+ ok = adjustBloodDialysateData (vMessage, vData);
+ break;
+
+
+
default:
printUnhandled (vMessage);
break;
@@ -577,3 +601,20 @@
}
return ok;
}
+
+bool MessageInterpreter::adjustBloodDialysateData(const Message &vMessage, QVariantList &vData)
+{
+ // TODO : review other methods
+ bool ok = false;
+ if ( ! isType (vMessage, Gui::GuiActionType::AdjustBloodDialysateRsp) ) return ok;
+ if ( ! isPayloadLenValid(vMessage, Gui::GuiActionType::AdjustBloodDialysateRsp) ) return ok;
+
+ Model::MAdjustBloodDialysateResponse mData;
+ ok = mData.fromByteArray(vMessage.data);
+ LOG_DATUM(mData.toString());
+
+ mData.toVariantList(vData);
+ emit didActionReceive(mData.data());
+
+ return ok;
+}
Index: sources/canbus/messageinterpreter.h
===================================================================
diff -u -r3bdf58e8bee7d76eb19c1116738ff1e2c534ccc7 -rf148379112a69d1c52027f2667e95f3f96d948ad
--- sources/canbus/messageinterpreter.h (.../messageinterpreter.h) (revision 3bdf58e8bee7d76eb19c1116738ff1e2c534ccc7)
+++ sources/canbus/messageinterpreter.h (.../messageinterpreter.h) (revision f148379112a69d1c52027f2667e95f3f96d948ad)
@@ -33,6 +33,9 @@
{
Q_OBJECT
+ bool isType(const Message &vMessage, Gui::GuiActionType vType) const;
+ bool isPayloadLenValid(const Message &vMessage, Gui::GuiActionType vType) const;
+
void printUnhandled(const Message &vMessage);
bool interpretMessage_HD(const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__;
@@ -67,6 +70,9 @@
bool getPressureOcclusionData(const Message &vMessage, Model::MPressureOcclusion &vData) __attribute_warn_unused_result__;
bool pressureOcclusionData(const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__;
+ // ---- Treatment Adjust response for Blood/Dialysate Flow Rate
+ bool adjustBloodDialysateData(const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__;
+
public:
explicit MessageInterpreter(QObject *parent = nullptr);
Index: sources/gui/guiglobals.cpp
===================================================================
diff -u -r3bdf58e8bee7d76eb19c1116738ff1e2c534ccc7 -rf148379112a69d1c52027f2667e95f3f96d948ad
--- sources/gui/guiglobals.cpp (.../guiglobals.cpp) (revision 3bdf58e8bee7d76eb19c1116738ff1e2c534ccc7)
+++ sources/gui/guiglobals.cpp (.../guiglobals.cpp) (revision f148379112a69d1c52027f2667e95f3f96d948ad)
@@ -41,6 +41,8 @@
qRegisterMetaType ("GuiAlarmID" );
qRegisterMetaType ("GuiAlarmPriority");
+ qRegisterMetaType ("GuiRequestReasons");
+
REGISTER_MODEL_METATYPES
}
Index: sources/gui/guiglobals.h
===================================================================
diff -u -rfef563aa317eb3e025e2dab0264e854f05a216d6 -rf148379112a69d1c52027f2667e95f3f96d948ad
--- sources/gui/guiglobals.h (.../guiglobals.h) (revision fef563aa317eb3e025e2dab0264e854f05a216d6)
+++ sources/gui/guiglobals.h (.../guiglobals.h) (revision f148379112a69d1c52027f2667e95f3f96d948ad)
@@ -120,13 +120,32 @@
NUM_OF_ALARM_IDS
};
+ enum GuiRequestReasons_Enum
+ {
+ REASON_NONE = 0, ///< No reason.
+ REASON_NOT_ALLOWED_IN_CURRENT_MODE, ///< Request is not allowed in the current operating mode.
+ REASON_TIMEOUT_WAITING_FOR_USER_CONFIRM, ///< Validated request was not confirmed by user in reasonable time.
+ REASON_NOT_IN_TREATMENT_MODE, ///< Request is not allowed if not in treatment mode.
+ REASON_INVALID_TREATMENT_STATE, ///< Request is not allowed in current treatment state.
+ REASON_TREATMENT_TOO_CLOSE_TO_FINISHED, ///< Request is not allowed so near end of treatment.
+ REASON_TREATMENT_TIME_OUT_OF_RANGE, ///< Treatment duration is out of range.
+ REASON_TREATMENT_TIME_LESS_THAN_CURRENT, ///< Treatment time change is less than currently elapsed treatment time.
+ REASON_BLOOD_FLOW_OUT_OF_RANGE, ///< Blood flow is out of range.
+ REASON_DIAL_FLOW_OUT_OF_RANGE, ///< Dialysate flow is out of range.
+ REASON_DIAL_VOLUME_OUT_OF_RANGE, ///< Dialysate flow rate or treatment duration causes dialysate volume to exceed limit.
+ REASON_UF_VOLUME_OUT_OF_RANGE, ///< Ultrafiltration volume is out of range.
+ REASON_UF_RATE_OUT_OF_RANGE, ///< Ultrafiltration rate is out of range.
+ NUM_OF_REQUEST_REJECT_REASONS ///< Number of settings change reject codes.
+ };
Q_ENUM(GuiActionsType_Enum)
Q_ENUM(GuiActionsData_Enum)
Q_ENUM(GuiActionsIndx_Enum)
Q_ENUM(GuiAlarmPriority_Enum)
Q_ENUM(GuiAlarmID_Enum)
+
+ Q_ENUM(GuiRequestReasons_Enum)
};
// to be able to use the enum as signal/slot parameter
@@ -137,6 +156,8 @@
typedef GuiActions::GuiAlarmPriority_Enum GuiAlarmPriority;
typedef GuiActions::GuiAlarmID_Enum GuiAlarmID;
+ typedef GuiActions::GuiRequestReasons_Enum GuiRequestReasons;
+
void registerTypes();
void registerQmlTypes();
Index: sources/gui/guiview.cpp
===================================================================
diff -u -rfef563aa317eb3e025e2dab0264e854f05a216d6 -rf148379112a69d1c52027f2667e95f3f96d948ad
--- sources/gui/guiview.cpp (.../guiview.cpp) (revision fef563aa317eb3e025e2dab0264e854f05a216d6)
+++ sources/gui/guiview.cpp (.../guiview.cpp) (revision f148379112a69d1c52027f2667e95f3f96d948ad)
@@ -159,39 +159,3 @@
{
emit didExportLog();
}
-
-/*!
- * \brief GuiView::alarmPriorityName
- * \details this code is the place holder for the alarms description mapping
- * since it is another feature
- * it returns the enum name for now
- * \param vEnum - The Alarm priority
- * \return String representation of the Alarm priority Enum name
- */
-QString GuiView::alarmPriorityName(GuiAlarmPriority vEnum)
-{
- // this code is the place holder for the alarms description mapping
- // since it is another feature
- // it returns the enum name for now
- const QMetaObject *mo = qt_getEnumMetaObject(vEnum);
- int enumIdx = mo->indexOfEnumerator(qt_getEnumName(vEnum));
- return mo->enumerator(enumIdx).valueToKey(vEnum);
-}
-
-/*!
- * \brief GuiView::alarmIDName
- * \details this code is the place holder for the alarms description mapping
- * since it is another feature
- * it returns the enum name for now
- * \param vEnum - The Alarm ID
- * \return String representation of the Alarm Id Enum name
- */
-QString GuiView::alarmIDName(GuiAlarmID vEnum)
-{
- // TEST : this code is the place holder for the alarms description mapping
- // since it is another feature
- // it returns the enum name for now
- const QMetaObject *mo = qt_getEnumMetaObject(vEnum);
- int enumIdx = mo->indexOfEnumerator(qt_getEnumName(vEnum));
- return mo->enumerator(enumIdx).valueToKey(vEnum);
-}
Index: sources/gui/guiview.h
===================================================================
diff -u -rfef563aa317eb3e025e2dab0264e854f05a216d6 -rf148379112a69d1c52027f2667e95f3f96d948ad
--- sources/gui/guiview.h (.../guiview.h) (revision fef563aa317eb3e025e2dab0264e854f05a216d6)
+++ sources/gui/guiview.h (.../guiview.h) (revision f148379112a69d1c52027f2667e95f3f96d948ad)
@@ -49,9 +49,6 @@
void doUSBDriveUmount();
void doExportLog ();
- QString alarmPriorityName (GuiAlarmPriority vEnum);
- QString alarmIDName (GuiAlarmID vEnum);
-
signals:
void didActionReceive (GuiActionType vAction, const QVariantList &vData); // UI <= HD/DG
void didActionTransmit(GuiActionType vAction, const QVariantList &vData); // UI => HD/DG
Index: sources/gui/qml/components/ModalDialog.qml
===================================================================
diff -u -rcd7de5f6d239a11615ba8c6c03339a10996486ca -rf148379112a69d1c52027f2667e95f3f96d948ad
--- sources/gui/qml/components/ModalDialog.qml (.../ModalDialog.qml) (revision cd7de5f6d239a11615ba8c6c03339a10996486ca)
+++ sources/gui/qml/components/ModalDialog.qml (.../ModalDialog.qml) (revision f148379112a69d1c52027f2667e95f3f96d948ad)
@@ -24,8 +24,9 @@
* \brief The parent item for modal dialogs
*/
Dialog { id : _root
- property bool autoHide : false
- property int autoHideDuration : 1000
+ property bool autoHide : false
+ property int autoHideDuration : 1000
+ property alias notificationText : _notification.text
width : Variables.dialogWidth
height : Variables.dialogHeight
@@ -66,4 +67,6 @@
_root.visible = false
}
}
+
+ NotificationBar { id: _notification }
}
Index: sources/gui/qml/components/NotificationBar.qml
===================================================================
diff -u
--- sources/gui/qml/components/NotificationBar.qml (revision 0)
+++ sources/gui/qml/components/NotificationBar.qml (revision f148379112a69d1c52027f2667e95f3f96d948ad)
@@ -0,0 +1,68 @@
+/*!
+ *
+ * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved.
+ * \copyright \n
+ * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n
+ * IN PART OR IN WHOLE, \n
+ * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n
+ *
+ * \file NotificationBar.qml
+ * \date 2020/03/30
+ * \author Behrouz NematiPour
+ *
+ */
+
+// Qt
+import QtQuick 2.12
+import QtQuick.Controls 2.12 // Dialog
+
+import Gui.Actions 0.1
+
+// Project
+// Qml imports
+import "qrc:/globals"
+
+Rectangle { id: _root
+ property alias text : _text.text
+ property int level : 0
+
+ visible : _text.text
+
+ height : Variables.notificationHeight
+ color : Colors.textNotificationNoneBg
+ radius : Variables.dialogRadius
+ anchors {
+ bottom : parent.bottom
+ left : parent.left
+ right : parent.right
+ }
+
+ Text { id: _text
+ color : Colors.textNotificationNoneFg
+ anchors.fill : parent
+ font.pixelSize : Fonts.fontPixelNotification
+ horizontalAlignment : Text.AlignHCenter
+ verticalAlignment : Text.AlignVCenter
+ }
+
+ onLevelChanged: {
+ switch (level) {
+ case GuiActions.ALARM_PRIORITY_HIGH:
+ _root.color = Colors.textNotificationHighBg;
+ _text.color = Colors.textNotificationHighFg;
+ break;
+ case GuiActions.ALARM_PRIORITY_MEDIUM:
+ _root.color = Colors.textNotificationMedBg;
+ _text.color = Colors.textNotificationMedFg;
+ break;
+ case GuiActions.ALARM_PRIORITY_LOW:
+ _root.color = Colors.textNotificationLowBg;
+ _text.color = Colors.textNotificationLowFg;
+ break;
+ default : // GuiActions.ALARM_PRIORITY_NONE
+ _root.color = Colors.textNotificationNoneBg;
+ _text.color = Colors.textNotificationNoneFg;
+ break;
+ }
+ }
+}
Index: sources/gui/qml/components/Slider.qml
===================================================================
diff -u -rcd7de5f6d239a11615ba8c6c03339a10996486ca -rf148379112a69d1c52027f2667e95f3f96d948ad
--- sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision cd7de5f6d239a11615ba8c6c03339a10996486ca)
+++ sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision f148379112a69d1c52027f2667e95f3f96d948ad)
@@ -62,7 +62,7 @@
if ( x > width ) {
value = maximum
} else
- if (step === 1) { // only for performance othewise formula works perfectly fine for any step.
+ if (step === 1) { // only for performance otherwise formula works perfectly fine for any step.
value = getPosition(x)
} else {
value = Math.round((getPosition(x) - minimum) / step) * step + minimum
@@ -75,7 +75,6 @@
minimum : parent.minimum
maximum : parent.maximum
- value : parent.value
// propagation is not working on drag
onDragged: {
Index: sources/gui/qml/globals/Colors.qml
===================================================================
diff -u -r79bf4dda5c027044ebd0014e7deac42a058a7fcf -rf148379112a69d1c52027f2667e95f3f96d948ad
--- sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision 79bf4dda5c027044ebd0014e7deac42a058a7fcf)
+++ sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision f148379112a69d1c52027f2667e95f3f96d948ad)
@@ -48,7 +48,7 @@
readonly property color borderButton : "#4290EC" //K:D //"#438FEB"
readonly property color borderDisableButton : "#607A91"
readonly property color boderSeparatorLine : "#476982"
- readonly property color borderDialog : "#D01A344D" // "#D00F0F0F" //"#F51A344D"
+ readonly property color borderDialog : "transparent" // "#D01A344D" // "#D00F0F0F" //"#F51A344D"
readonly property color touchTextAreaTitle : "#a0b6d0"
@@ -66,5 +66,15 @@
readonly property color infusionValue : "white"
readonly property color infusionUnit : "#708795"
+ readonly property color textNotificationNoneBg : "white"
+ readonly property color textNotificationNoneFg : "#1b2b3e"
+ readonly property color textNotificationLowBg : "green" // ?
+ readonly property color textNotificationLowFg : "white" // ?
+
+ readonly property color textNotificationMedBg : "orange" // ?
+ readonly property color textNotificationMedFg : "white" // ?
+
+ readonly property color textNotificationHighBg : "#c53b33" // red
+ readonly property color textNotificationHighFg : "white"
}
Index: sources/gui/qml/globals/Fonts.qml
===================================================================
diff -u -r79bf4dda5c027044ebd0014e7deac42a058a7fcf -rf148379112a69d1c52027f2667e95f3f96d948ad
--- sources/gui/qml/globals/Fonts.qml (.../Fonts.qml) (revision 79bf4dda5c027044ebd0014e7deac42a058a7fcf)
+++ sources/gui/qml/globals/Fonts.qml (.../Fonts.qml) (revision f148379112a69d1c52027f2667e95f3f96d948ad)
@@ -46,4 +46,5 @@
readonly property int fontPixelSliderMarker : 17
+ readonly property int fontPixelNotification : 24
}
Index: sources/gui/qml/globals/Variables.qml
===================================================================
diff -u -r3bdf58e8bee7d76eb19c1116738ff1e2c534ccc7 -rf148379112a69d1c52027f2667e95f3f96d948ad
--- sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision 3bdf58e8bee7d76eb19c1116738ff1e2c534ccc7)
+++ sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision f148379112a69d1c52027f2667e95f3f96d948ad)
@@ -64,6 +64,8 @@
readonly property int sliderTextMargin : 20
+ readonly property int notificationHeight : 60
+
// --- PRS ---
readonly property int bloodFlowResolution : 25
readonly property int dialysateFlowResolution : 50
Index: sources/gui/qml/main.qml
===================================================================
diff -u -r3676cd80ff97ac0785547e29e63f54b95b53f9f8 -rf148379112a69d1c52027f2667e95f3f96d948ad
--- sources/gui/qml/main.qml (.../main.qml) (revision 3676cd80ff97ac0785547e29e63f54b95b53f9f8)
+++ sources/gui/qml/main.qml (.../main.qml) (revision f148379112a69d1c52027f2667e95f3f96d948ad)
@@ -160,6 +160,28 @@
}
}
+
+ NotificationBar { id: _alarm
+ anchors.bottom: _mainMenu.top
+ level : vAlarmStatus.alarm_Priority
+ text :
+ //vAlarmStatus.alarmPriorityName(vAlarmStatus.alarm_Priority) + " , " +
+ vAlarmStatus.alarmIDName (vAlarmStatus.alarm_AlarmID) + " , " +
+ vAlarmStatus.alarm_EscalateIn + " , " +
+ vAlarmStatus.alarm_MuteTimeout + " [" +
+ (vAlarmStatus.alarm_Flag_systemFault ? "1" : "0" ) + " " +
+ (vAlarmStatus.alarm_Flag_stop ? "1" : "0" ) + " " +
+ (vAlarmStatus.alarm_Flag_noClear ? "1" : "0" ) + " " +
+ (vAlarmStatus.alarm_Flag_noResume ? "1" : "0" ) + " " +
+ (vAlarmStatus.alarm_Flag_noRinseback ? "1" : "0" ) + " " +
+ (vAlarmStatus.alarm_Flag_noEndTreatment ? "1" : "0" ) + " " +
+ (vAlarmStatus.alarm_Flag_noNewTreatment ? "1" : "0" ) + " " +
+ (vAlarmStatus.alarm_Flag_bypassDialyzer ? "1" : "0" ) + " " +
+ (vAlarmStatus.alarm_Flag_alarmsToEscalate ? "1" : "0" ) + " " +
+ (vAlarmStatus.alarm_Flag_alarmsSilenced ? "1" : "0" ) + "]"
+
+ }
+
// 9 - Others
Text { // TEST : Application version should be moved into the information screen later.
color: Colors.textMain
@@ -175,19 +197,4 @@
anchors.rightMargin: 4
font.pixelSize: 14
}
-
- Rectangle { // TEST : Some kind of alarm bar.
- visible: false
- height: 50
- anchors {
- bottom: parent.bottom
- left: parent.left
- right: parent.right
- }
- radius: 5
- Text {
- anchors.centerIn: parent
- text: qsTr("Something had happened...")
- }
- }
}
Index: sources/gui/qml/pages/SettingsHome.qml
===================================================================
diff -u -rcd7de5f6d239a11615ba8c6c03339a10996486ca -rf148379112a69d1c52027f2667e95f3f96d948ad
--- sources/gui/qml/pages/SettingsHome.qml (.../SettingsHome.qml) (revision cd7de5f6d239a11615ba8c6c03339a10996486ca)
+++ sources/gui/qml/pages/SettingsHome.qml (.../SettingsHome.qml) (revision f148379112a69d1c52027f2667e95f3f96d948ad)
@@ -165,46 +165,4 @@
}
}
}
-
- Column { id: _AlarmStatusColumn
- width: 270
- spacing: 5
- topPadding: 100
- leftPadding: 700
- Text {
- id: _AlarmStatus_Title
- text: qsTr(" Alarm Status ")
- width: _AlarmStatusColumn.width
- horizontalAlignment: Text.AlignLeft
- color: Colors.textMain
- font.pixelSize: Fonts.fontPixelTitle
- font.underline: true
- }
- Repeater {
- model: [
- _GuiView.alarmPriorityName(vAlarmStatus.alarm_Priority) ,
- _GuiView.alarmIDName (vAlarmStatus.alarm_AlarmID) ,
- "Escalates In : " + vAlarmStatus.alarm_EscalateIn ,
- "MuteTimeout : " + vAlarmStatus.alarm_MuteTimeout ,
- (vAlarmStatus.alarm_Flag_systemFault ? "1" : "0" ) + " : systemFault " ,
- (vAlarmStatus.alarm_Flag_stop ? "1" : "0" ) + " : stop " ,
- (vAlarmStatus.alarm_Flag_noClear ? "1" : "0" ) + " : noClear " ,
- (vAlarmStatus.alarm_Flag_noResume ? "1" : "0" ) + " : noResume " ,
- (vAlarmStatus.alarm_Flag_noRinseback ? "1" : "0" ) + " : noRinseback " ,
- (vAlarmStatus.alarm_Flag_noEndTreatment ? "1" : "0" ) + " : noEndTreatment " ,
- (vAlarmStatus.alarm_Flag_noNewTreatment ? "1" : "0" ) + " : noNewTreatment " ,
- (vAlarmStatus.alarm_Flag_bypassDialyzer ? "1" : "0" ) + " : bypassDialyzer " ,
- (vAlarmStatus.alarm_Flag_alarmsToEscalate ? "1" : "0" ) + " : alarmsToEscalate " ,
- (vAlarmStatus.alarm_Flag_alarmsSilenced ? "1" : "0" ) + " : alarmsSilenced "
- ]
- Text {
- id: _AlarmStatus_Priority
- text: modelData
- width: _AlarmStatusColumn.width
- horizontalAlignment: Text.AlignLeft
- color: Colors.textMain
- font.pixelSize: Fonts.fontPixelButton
- }
- }
- }
}
Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentFlow.qml
===================================================================
diff -u -r7edbf109108511ddf6066758bdb7aa29f9d8fad3 -rf148379112a69d1c52027f2667e95f3f96d948ad
--- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentFlow.qml (.../TreatmentAdjustmentFlow.qml) (revision 7edbf109108511ddf6066758bdb7aa29f9d8fad3)
+++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentFlow.qml (.../TreatmentAdjustmentFlow.qml) (revision f148379112a69d1c52027f2667e95f3f96d948ad)
@@ -21,6 +21,8 @@
import "qrc:/globals"
import "qrc:/components"
+import VTreatmentAdjustmentsResponse 0.1;
+
/*!
* \brief TreatmentAdjustmentFlow.qml is the screen
* To adjust the treatment blood/dialysate flow
@@ -40,6 +42,27 @@
property string unit : qsTr("mL/min")
property int textWidth : 200
+ VTreatmentAdjustmentsResponse { id: vTreatmentAdjustmentsResponse
+ onAdjustment_TriggeredChanged: {
+ // TODO : This is a work around, I can't find out why binding is not working
+ _bloodFlowSlider .value = vTreatmentAdjustmentsResponse. bloodFlow_MeasuredFlow
+ _dialysateFlowSlider.value = vTreatmentAdjustmentsResponse.dialysateFlow_MeasuredFlow
+
+ if ( adjustment_Accepted ) {
+ accept()
+ } else {
+ notificationText = // adjustment_Reason
+ adjustment_Accepted + " , " +
+ vTreatmentAdjustmentsResponse.reasonName(adjustment_Reason) + " , " +
+ bloodFlow_MeasuredFlow + " , " +
+ dialysateFlow_MeasuredFlow;
+ }
+ }
+ }
+ onVisibleChanged: {
+ notificationText = "";
+ }
+
Column { id : _flowsColumn
spacing: 100
anchors.centerIn: parent
@@ -64,6 +87,8 @@
unit : _root.unit
step : Variables.bloodFlowResolution
ticks : true
+ // TODO : I can't find out why binding is not working
+ value : vTreatmentAdjustmentsResponse.bloodFlow_MeasuredFlow
}
}
Line {
@@ -92,6 +117,8 @@
unit : _root.unit
step : Variables.dialysateFlowResolution
ticks : true
+ // TODO : I can't find out why binding is not working
+ value : vTreatmentAdjustmentsResponse.dialysateFlow_MeasuredFlow
}
}
}
Index: sources/model/mmodel.h
===================================================================
diff -u -r35959dd708a5c4fdf02626306441e5a77e7f7782 -rf148379112a69d1c52027f2667e95f3f96d948ad
--- sources/model/mmodel.h (.../mmodel.h) (revision 35959dd708a5c4fdf02626306441e5a77e7f7782)
+++ sources/model/mmodel.h (.../mmodel.h) (revision f148379112a69d1c52027f2667e95f3f96d948ad)
@@ -17,11 +17,13 @@
// models
#include "malarmstatus.h"
+#include "mpoweroff.h"
+
#include "mtreatmenttime.h"
#include "mtreatmentflows.h"
#include "mtreatmentoutletflow.h"
#include "mtreatmentpressureocclusion.h"
-#include "mpoweroff.h"
+#include "mtreatmentadjustblooddialysateresponse.h"
/*!
* \brief Message interpretation instruction
@@ -103,50 +105,56 @@
//--------------------------------------------------------------------------------//
//-------- Please add the model type to the lists below to register them ---------//
//--------------------------------------------------------------------------------//
-#define ACTION_RECEIVE_MODEL_BRIDGE_CONNECTIONS(vSOURCE) \
- ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, BloodFlowData ) \
- ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, DialysateFlowData ) \
- ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, OutletFlowData ) \
- ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, TreatmentTimeData ) \
- ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, PressureOcclusionData ) \
- ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AlarmStatusData ) \
- ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, PowerOffData )
+#define ACTION_RECEIVE_MODEL_BRIDGE_CONNECTIONS(vSOURCE) \
+ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, BloodFlowData ) \
+ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, DialysateFlowData ) \
+ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, OutletFlowData ) \
+ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, TreatmentTimeData ) \
+ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, PressureOcclusionData ) \
+ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AlarmStatusData ) \
+ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, PowerOffData ) \
+ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustBloodDialysateResponseData )
+
//--------------------------------------------------------------------------------//
-#define ACTION_RECEIVE_MODEL_BRIDGE_DEFINITIONS \
- ACTION_RECEIVE_BRIDGE_DEFINITION( BloodFlowData ) \
- ACTION_RECEIVE_BRIDGE_DEFINITION( DialysateFlowData ) \
- ACTION_RECEIVE_BRIDGE_DEFINITION( OutletFlowData ) \
- ACTION_RECEIVE_BRIDGE_DEFINITION( TreatmentTimeData ) \
- ACTION_RECEIVE_BRIDGE_DEFINITION( PressureOcclusionData ) \
- ACTION_RECEIVE_BRIDGE_DEFINITION( AlarmStatusData ) \
- ACTION_RECEIVE_BRIDGE_DEFINITION( PowerOffData )
+#define ACTION_RECEIVE_MODEL_BRIDGE_DEFINITIONS \
+ ACTION_RECEIVE_BRIDGE_DEFINITION( BloodFlowData ) \
+ ACTION_RECEIVE_BRIDGE_DEFINITION( DialysateFlowData ) \
+ ACTION_RECEIVE_BRIDGE_DEFINITION( OutletFlowData ) \
+ ACTION_RECEIVE_BRIDGE_DEFINITION( TreatmentTimeData ) \
+ ACTION_RECEIVE_BRIDGE_DEFINITION( PressureOcclusionData ) \
+ ACTION_RECEIVE_BRIDGE_DEFINITION( AlarmStatusData ) \
+ ACTION_RECEIVE_BRIDGE_DEFINITION( PowerOffData ) \
+ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustBloodDialysateResponseData )
//--------------------------------------------------------------------------------//
-#define REGISTER_MODEL_METATYPES \
- REGISTER_METATYPE( BloodFlowData ) \
- REGISTER_METATYPE( DialysateFlowData ) \
- REGISTER_METATYPE( OutletFlowData ) \
- REGISTER_METATYPE( TreatmentTimeData ) \
- REGISTER_METATYPE( PressureOcclusionData ) \
- REGISTER_METATYPE( AlarmStatusData ) \
- REGISTER_METATYPE( AlarmStatusFlag ) \
- REGISTER_METATYPE( PowerOffData )
+#define REGISTER_MODEL_METATYPES \
+ REGISTER_METATYPE( BloodFlowData ) \
+ REGISTER_METATYPE( DialysateFlowData ) \
+ REGISTER_METATYPE( OutletFlowData ) \
+ REGISTER_METATYPE( TreatmentTimeData ) \
+ REGISTER_METATYPE( PressureOcclusionData ) \
+ REGISTER_METATYPE( AlarmStatusData ) \
+ REGISTER_METATYPE( AlarmStatusFlag ) \
+ REGISTER_METATYPE( PowerOffData ) \
+ REGISTER_METATYPE( AdjustBloodDialysateResponseData )
//--------------------------------------------------------------------------------//
-#define ACTION_RECEIVE_INTERPRETER_CONNECTIONS \
- ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, BloodFlowData ) \
- ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, DialysateFlowData ) \
- ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, OutletFlowData ) \
- ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, TreatmentTimeData ) \
- ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, PressureOcclusionData ) \
- ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, AlarmStatusData ) \
- ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, PowerOffData )
+#define ACTION_RECEIVE_INTERPRETER_CONNECTIONS \
+ ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, BloodFlowData ) \
+ ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, DialysateFlowData ) \
+ ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, OutletFlowData ) \
+ ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, TreatmentTimeData ) \
+ ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, PressureOcclusionData ) \
+ ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, AlarmStatusData ) \
+ ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, PowerOffData ) \
+ ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, AdjustBloodDialysateResponseData )
//--------------------------------------------------------------------------------//
-#define ACTION_RECEIVE_SIGNALS \
- ACTION_RECEIVE_SIGNAL( BloodFlowData ) \
- ACTION_RECEIVE_SIGNAL( DialysateFlowData ) \
- ACTION_RECEIVE_SIGNAL( OutletFlowData ) \
- ACTION_RECEIVE_SIGNAL( TreatmentTimeData ) \
- ACTION_RECEIVE_SIGNAL( PressureOcclusionData ) \
- ACTION_RECEIVE_SIGNAL( AlarmStatusData ) \
- ACTION_RECEIVE_SIGNAL( PowerOffData )
+#define ACTION_RECEIVE_SIGNALS \
+ ACTION_RECEIVE_SIGNAL( BloodFlowData ) \
+ ACTION_RECEIVE_SIGNAL( DialysateFlowData ) \
+ ACTION_RECEIVE_SIGNAL( OutletFlowData ) \
+ ACTION_RECEIVE_SIGNAL( TreatmentTimeData ) \
+ ACTION_RECEIVE_SIGNAL( PressureOcclusionData ) \
+ ACTION_RECEIVE_SIGNAL( AlarmStatusData ) \
+ ACTION_RECEIVE_SIGNAL( PowerOffData ) \
+ ACTION_RECEIVE_SIGNAL( AdjustBloodDialysateResponseData )
//--------------------------------------------------------------------------------//
//--------------------------------------------------------------------------------//
Index: sources/model/mtreatmentadjustblooddialysateresponse.cpp
===================================================================
diff -u
--- sources/model/mtreatmentadjustblooddialysateresponse.cpp (revision 0)
+++ sources/model/mtreatmentadjustblooddialysateresponse.cpp (revision f148379112a69d1c52027f2667e95f3f96d948ad)
@@ -0,0 +1,53 @@
+/*!
+ *
+ * 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 mtreatmentpressureocclusion.cpp
+ * date 3/23/2020
+ * author Behrouz NematiPour
+ *
+ */
+#include "mtreatmentadjustblooddialysateresponse.h"
+
+using namespace Model;
+
+QString MAdjustBloodDialysateResponse::toString() const {
+ return QString(stringPrefix + "(%1, %2, %3, %4)")
+ .arg(_data.mAccepted .value)
+ .arg(_data.mReason .value)
+ .arg(_data.mBloodRate .value)
+ .arg(_data.mDialydateReate .value);
+}
+
+void MAdjustBloodDialysateResponse::toVariantList(QVariantList &vData) const {
+ vData += _data.mAccepted .value;
+ vData += _data.mReason .value;
+ vData += _data.mBloodRate .value;
+ vData += _data.mDialydateReate .value;
+}
+
+bool MAdjustBloodDialysateResponse::fromByteArray(const QByteArray &vByteArray) {
+ int index = 0; // message data start position
+ if (Types::getValue<>(vByteArray, index, _data.mAccepted ))
+ if (Types::getValue<>(vByteArray, index, _data.mReason ))
+ if (Types::getValue<>(vByteArray, index, _data.mBloodRate ))
+ if (Types::getValue<>(vByteArray, index, _data.mDialydateReate ))
+ return true ;
+ else return false;
+ else return false;
+ else return false;
+ else return false;
+}
+
+AdjustBloodDialysateResponseData MAdjustBloodDialysateResponse::data() const {
+ Data data;
+ data.mAccepted = _data.mAccepted .value;
+ data.mReason = _data.mReason .value;
+ data.mBloodRate = _data.mBloodRate .value;
+ data.mDialydateReate = _data.mDialydateReate .value;
+ return data;
+}
Index: sources/model/mtreatmentadjustblooddialysateresponse.h
===================================================================
diff -u
--- sources/model/mtreatmentadjustblooddialysateresponse.h (revision 0)
+++ sources/model/mtreatmentadjustblooddialysateresponse.h (revision f148379112a69d1c52027f2667e95f3f96d948ad)
@@ -0,0 +1,54 @@
+/*!
+ *
+ * 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 mtreatmentpressureocclusion.h
+ * date 3/23/2020
+ * author Behrouz NematiPour
+ *
+ */
+#pragma once
+
+// Qt
+#include
+
+// Project
+#include "types.h"
+
+namespace Model {
+
+class MAdjustBloodDialysateResponse {
+public:
+ QString stringPrefix = "Adjust Blood/Dialisate";
+ struct Data {
+ bool mAccepted = 0; /*!< Accepted value of type quint32 extracted out */
+ quint32 mReason = 0; /*!< Reason value of type quint32 extracted out */
+ quint32 mBloodRate = 0; /*!< BloodRate value of type quint32 extracted out */
+ quint32 mDialydateReate = 0; /*!< DialydateReate value of type quint32 extracted out */
+ };
+
+private:
+ struct {
+ Types::U32 mAccepted ;
+ Types::U32 mReason ;
+ Types::U32 mBloodRate ;
+ Types::U32 mDialydateReate ;
+ } _data;
+
+public:
+ MAdjustBloodDialysateResponse () { }
+
+ QString toString ( ) const ;
+ void toVariantList ( QVariantList &vData ) const ;
+ bool fromByteArray(const QByteArray &vByteArray );
+
+ Data data() const;
+};
+
+}
+
+typedef Model::MAdjustBloodDialysateResponse::Data AdjustBloodDialysateResponseData;
Index: sources/view/valarmstatus.cpp
===================================================================
diff -u -r595ed1fbe8066960afd4c8fea168208e81b173d9 -rf148379112a69d1c52027f2667e95f3f96d948ad
--- sources/view/valarmstatus.cpp (.../valarmstatus.cpp) (revision 595ed1fbe8066960afd4c8fea168208e81b173d9)
+++ sources/view/valarmstatus.cpp (.../valarmstatus.cpp) (revision f148379112a69d1c52027f2667e95f3f96d948ad)
@@ -18,6 +18,8 @@
VIEW_DEF(VAlarmStatus, AlarmStatusData)
+using namespace Gui;
+
void VAlarmStatus::onActionReceive(const AlarmStatusData &vData)
{
alarm_Priority (vData.mState );
@@ -35,3 +37,39 @@
alarm_Flag_alarmsToEscalate (vData.mFlags.at(AlarmStatusFlag::eFlag_alarmsToEscalate));
alarm_Flag_alarmsSilenced (vData.mFlags.at(AlarmStatusFlag::eFlag_alarmsSilenced ));
}
+
+/*!
+ * \brief VAlarmStatus::alarmPriorityName
+ * \details this code is the place holder for the alarms description mapping
+ * since it is another feature
+ * it returns the enum name for now
+ * \param vEnum - The Alarm priority
+ * \return String representation of the Alarm priority Enum name
+ */
+QString VAlarmStatus::alarmPriorityName(GuiAlarmPriority vEnum)
+{
+ // TEST : this code is the place holder for the alarms description mapping
+ // since it is another feature
+ // it returns the enum name for now
+ const QMetaObject *mo = qt_getEnumMetaObject(vEnum);
+ int enumIdx = mo->indexOfEnumerator(qt_getEnumName(vEnum));
+ return mo->enumerator(enumIdx).valueToKey(vEnum);
+}
+
+/*!
+ * \brief VAlarmStatus::alarmIDName
+ * \details this code is the place holder for the alarms description mapping
+ * since it is another feature
+ * it returns the enum name for now
+ * \param vEnum - The Alarm ID
+ * \return String representation of the Alarm Id Enum name
+ */
+QString VAlarmStatus::alarmIDName(GuiAlarmID vEnum)
+{
+ // TEST : this code is the place holder for the alarms description mapping
+ // since it is another feature
+ // it returns the enum name for now
+ const QMetaObject *mo = qt_getEnumMetaObject(vEnum);
+ int enumIdx = mo->indexOfEnumerator(qt_getEnumName(vEnum));
+ return mo->enumerator(enumIdx).valueToKey(vEnum);
+}
Index: sources/view/valarmstatus.h
===================================================================
diff -u -r3bdf58e8bee7d76eb19c1116738ff1e2c534ccc7 -rf148379112a69d1c52027f2667e95f3f96d948ad
--- sources/view/valarmstatus.h (.../valarmstatus.h) (revision 3bdf58e8bee7d76eb19c1116738ff1e2c534ccc7)
+++ sources/view/valarmstatus.h (.../valarmstatus.h) (revision f148379112a69d1c52027f2667e95f3f96d948ad)
@@ -19,8 +19,10 @@
// Project
#include "mmodel.h"
#include "vview.h"
+#include "guiglobals.h"
// namespace
+using namespace Gui;
namespace View {
class VAlarmStatus : public QObject
@@ -44,6 +46,11 @@
VIEW_DEC(VAlarmStatus, AlarmStatusData)
+
+public slots:
+ QString alarmPriorityName (GuiAlarmPriority vEnum);
+ QString alarmIDName (GuiAlarmID vEnum);
+
};
}
Index: sources/view/vtreatmentadjustmentsresponse.cpp
===================================================================
diff -u
--- sources/view/vtreatmentadjustmentsresponse.cpp (revision 0)
+++ sources/view/vtreatmentadjustmentsresponse.cpp (revision f148379112a69d1c52027f2667e95f3f96d948ad)
@@ -0,0 +1,49 @@
+/*!
+ *
+ * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved.
+ * copyright
+ * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM,
+ * IN PART OR IN WHOLE,
+ * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER.
+ *
+ * file vtreatmentadjustmentsresponse.cpp
+ * date 3/29/2020
+ * author Behrouz NematiPour
+ *
+ */
+#include "vtreatmentadjustmentsresponse.h"
+
+// Project
+#include "guicontroller.h"
+
+VIEW_DEF_CLASS(VTreatmentAdjustmentsResponse)
+void VTreatmentAdjustmentsResponse::initConnections() {
+ VIEW_DEF_CONNECTION_ADJUSTMENTS
+}
+
+void VTreatmentAdjustmentsResponse::onActionReceive(const AdjustBloodDialysateResponseData &vData)
+{
+ adjustment_Triggered ( true );
+ adjustment_Accepted ( vData.mAccepted );
+ adjustment_Reason ( vData.mReason );
+ bloodFlow_MeasuredFlow ( vData.mBloodRate );
+ dialysateFlow_MeasuredFlow ( vData.mDialydateReate );
+}
+
+/*!
+ * \brief VTreatmentAdjustmentsResponse::reasonName
+ * \details this code is the place holder for the alarms description mapping
+ * since it is another feature
+ * it returns the enum name for now
+ * \param vEnum - The Rejection Reason enum
+ * \return String representation of the Rejection Reason enum name
+ */
+QString VTreatmentAdjustmentsResponse::reasonName(GuiRequestReasons vEnum)
+{
+ // TEST : this code is the place holder for the alarms description mapping
+ // since it is another feature
+ // it returns the enum name for now
+ const QMetaObject *mo = qt_getEnumMetaObject(vEnum);
+ int enumIdx = mo->indexOfEnumerator(qt_getEnumName(vEnum));
+ return mo->enumerator(enumIdx).valueToKey(vEnum);
+}
Index: sources/view/vtreatmentadjustmentsresponse.h
===================================================================
diff -u
--- sources/view/vtreatmentadjustmentsresponse.h (revision 0)
+++ sources/view/vtreatmentadjustmentsresponse.h (revision f148379112a69d1c52027f2667e95f3f96d948ad)
@@ -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 vtreatmentadjustmentsresponse.h
+ * date 3/29/2020
+ * author Behrouz NematiPour
+ *
+ */
+#pragma once
+
+// Qt
+#include
+
+// Project
+#include "mmodel.h"
+#include "vview.h"
+#include "guiglobals.h"
+
+// namespace
+using namespace Gui;
+namespace View {
+
+class VTreatmentAdjustmentsResponse : public QObject
+{
+ Q_OBJECT
+
+ PROPERTY( bool , adjustment_Triggered , 0, true )
+ PROPERTY( bool , adjustment_Accepted , 0, false)
+ PROPERTY( quint32 , adjustment_Reason , 0, false)
+ PROPERTY( quint32 , bloodFlow_MeasuredFlow , 0, true )
+ PROPERTY( quint32 , dialysateFlow_MeasuredFlow , 0, true )
+
+ VIEW_DEC_CLASS(VTreatmentAdjustmentsResponse)
+ VIEW_DEC_SLOT_ADJUSTMENTS
+
+public slots:
+ QString reasonName (GuiRequestReasons vEnum);
+
+};
+}
Index: sources/view/vview.h
===================================================================
diff -u -r3676cd80ff97ac0785547e29e63f54b95b53f9f8 -rf148379112a69d1c52027f2667e95f3f96d948ad
--- sources/view/vview.h (.../vview.h) (revision 3676cd80ff97ac0785547e29e63f54b95b53f9f8)
+++ sources/view/vview.h (.../vview.h) (revision f148379112a69d1c52027f2667e95f3f96d948ad)
@@ -35,42 +35,64 @@
//--------------------------------------------------------------------------------//
//--------------------------------------------------------------------------------//
// The child declaration in header
-#define VIEW_DEC(vCLASS, vDATATYPE) \
+#define VIEW_DEC_CLASS(vCLASS) \
private: \
void initConnections(); \
public: \
- explicit vCLASS(QObject *parent = nullptr); \
+ explicit vCLASS(QObject *parent = nullptr);
+//--------------------------------------------------------------------------------//
+#define VIEW_DEC_SLOT(vDATATYPE) \
private Q_SLOTS: \
- void onActionReceive (const vDATATYPE &vData); \
+ void onActionReceive (const vDATATYPE &vData);
+//--------------------------------------------------------------------------------//
+#define VIEW_DEC(vCLASS, vDATATYPE) \
+ VIEW_DEC_CLASS(vCLASS) \
+ VIEW_DEC_SLOT(vDATATYPE) \
private:
//--------------------------------------------------------------------------------//
+
+//--------------------------------------------------------------------------------//
// The child definition in cpp
-#define VIEW_DEF(vCLASS, vDATATYPE) \
+#define VIEW_DEF_CLASS(vCLASS) \
using namespace View; \
vCLASS::vCLASS(QObject *parent) : QObject(parent) { \
initConnections(); \
-} \
+}
+//--------------------------------------------------------------------------------//
+#define VIEW_DEF_CONNECTION(vCLASS, vDATATYPE) \
void vCLASS::initConnections() { \
ACTION_RECEIVE_BRIDGE_CONNECTION( \
Gui::_GuiController, vDATATYPE); \
}
//--------------------------------------------------------------------------------//
+#define VIEW_DEF(vCLASS, vDATATYPE) \
+ VIEW_DEF_CLASS(vCLASS) \
+ VIEW_DEF_CONNECTION(vCLASS, vDATATYPE)
+//--------------------------------------------------------------------------------//
//--------- Please add the view type to the lists below to register them ---------//
//--------------------------------------------------------------------------------//
+//--------------------------------------------------------------------------------//
+#define REGISTER_VIEW_TYPES \
+ REGISTER_TYPE( VTreatmentBloodFlow ) \
+ REGISTER_TYPE( VTreatmentDialysateFlow ) \
+ REGISTER_TYPE( VTreatmentUltrafiltration ) \
+ REGISTER_TYPE( VTreatmentPressureOcclusion ) \
+ REGISTER_TYPE( VTreatmentTime ) \
+ REGISTER_TYPE( VTreatmentAdjustmentsResponse ) \
+ REGISTER_TYPE( VAlarmStatus ) \
+ REGISTER_TYPE( VPowerOff )
+//--------------------------------------------------------------------------------//
+#define VIEW_DEF_CONNECTION_ADJUSTMENTS \
+ ACTION_RECEIVE_BRIDGE_CONNECTION(Gui::_GuiController, AdjustBloodDialysateResponseData);
+//--------------------------------------------------------------------------------//
+#define VIEW_DEC_SLOT_ADJUSTMENTS \
+ VIEW_DEC_SLOT(AdjustBloodDialysateResponseData)
+//--------------------------------------------------------------------------------//
#include "vtreatmentbloodflow.h"
#include "vtreatmentdialysateflow.h"
#include "vtreatmentultrafiltration.h"
#include "vtreatmentpressureocclusion.h"
#include "vtreatmenttime.h"
+#include "vtreatmentadjustmentsresponse.h"
#include "valarmstatus.h"
#include "vpoweroff.h"
-//--------------------------------------------------------------------------------//
-#define REGISTER_VIEW_TYPES \
- REGISTER_TYPE( VTreatmentBloodFlow ) \
- REGISTER_TYPE( VTreatmentDialysateFlow ) \
- REGISTER_TYPE( VTreatmentUltrafiltration ) \
- REGISTER_TYPE( VTreatmentPressureOcclusion ) \
- REGISTER_TYPE( VTreatmentTime ) \
- REGISTER_TYPE( VAlarmStatus ) \
- REGISTER_TYPE( VPowerOff )
-