Index: sources/canbus/MessageInterpreter.cpp =================================================================== diff -u -rc1d0546e2d1a51ff919b2172ce647003359f0853 -r23121e17d1a6120ae4a31930e18de362d9533bcb --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision c1d0546e2d1a51ff919b2172ce647003359f0853) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 23121e17d1a6120ae4a31930e18de362d9533bcb) @@ -200,7 +200,6 @@ vCanId = Can::Can_Id::eChlid_UI_TD ; vPayload.clear(); int length = vData.length(); - // DEBUG: LOG_EVENT(QString("0x%0").arg(vActionId, 4, 16,QChar('0'))); switch (vActionId) { // notice we are in transmit mode case Gui::GuiActionType::ID_Acknow: // len: 0, can have zero len @@ -250,7 +249,7 @@ case Gui::GuiActionType::ID_AdjustBloodDialysateReq : INTERPRET_TRANSMIT_MESSAGE(AdjustBloodDialysateRequestData ); break; case Gui::GuiActionType::ID_AdjustPressuresLimitsReq : INTERPRET_TRANSMIT_MESSAGE(AdjustPressuresLimitsRequestData ); break; case Gui::GuiActionType::ID_AdjustSalineReq : INTERPRET_TRANSMIT_MESSAGE(AdjustSalineRequestData ); break; - case Gui::GuiActionType::ID_AdjustVitalsReq : INTERPRET_TRANSMIT_MESSAGE(AdjustVitalsRequestData ); break; + case Gui::GuiActionType::ID_AdjustVitalsReq : INTERPRET_TRSMT_MT_MESSAGE(AdjustVitalsRequestData ); break; case Gui::GuiActionType::ID_AdjustHeparinReq : INTERPRET_TRANSMIT_MESSAGE(AdjustHeparinRequestData ); break; // in-treatment - ultrafiltration case Gui::GuiActionType::ID_AdjustUltrafiltrationStateReq : INTERPRET_TRANSMIT_MESSAGE(AdjustUltrafiltrationStateRequestData ); break; Index: sources/gui/qml/components/ModalDialog.qml =================================================================== diff -u -r31b1e7a5d69f014398827e16286f28515cd60e35 -r23121e17d1a6120ae4a31930e18de362d9533bcb --- sources/gui/qml/components/ModalDialog.qml (.../ModalDialog.qml) (revision 31b1e7a5d69f014398827e16286f28515cd60e35) +++ sources/gui/qml/components/ModalDialog.qml (.../ModalDialog.qml) (revision 23121e17d1a6120ae4a31930e18de362d9533bcb) @@ -81,8 +81,6 @@ NumPad { id: _numPad x : _root.width - _numPad.width y : 0 - slideToOpen : true - onCancel : _numPad.hide() } @@ -110,7 +108,6 @@ } } - NumberAnimation { id: _autoHideAnimation running: false target: _root Index: sources/gui/qml/components/NumPad.qml =================================================================== diff -u -r31b1e7a5d69f014398827e16286f28515cd60e35 -r23121e17d1a6120ae4a31930e18de362d9533bcb --- sources/gui/qml/components/NumPad.qml (.../NumPad.qml) (revision 31b1e7a5d69f014398827e16286f28515cd60e35) +++ sources/gui/qml/components/NumPad.qml (.../NumPad.qml) (revision 23121e17d1a6120ae4a31930e18de362d9533bcb) @@ -34,7 +34,6 @@ readonly property bool isValueValid : validator ? validator(valueInt) : true readonly property var valueInt : isNaN(parseInt(_valueLabel.text)) ? undefined : parseInt(_valueLabel.text) readonly property string backSpace : "qrc:/images/iBackspace" - property bool slideToOpen : false property bool isOpened : false @@ -47,23 +46,12 @@ radius : 9 color : Colors.transparent - layer.enabled : ! slideToOpen - layer.effect : DropShadow { id: _dropShadow - horizontalOffset: 4 - verticalOffset : 4 - radius : 12 - samples : 32 - color : Colors.dropShadowDialogColor - source : _root - anchors.fill : _root - } - signal cancel() x: Math.round((Variables.applicationWidth - _root.width) / 2) y: Math.round((Variables.applicationHeight - _root.height) / 2) - // slide animation for slideToOpen + // slide animation Behavior on x { NumberAnimation { duration: Variables.keybardAnimationDuration } } function open(entry, title, min, max, unit) { @@ -83,38 +71,19 @@ } function show() { + if ( ! _root.visible ) { _root.visible = true } if ( ! isOpened ) { - if ( ! _root.visible ) - { - _root.visible = true - } - - if ( slideToOpen ) - { - print("show x: " + x) - x = x + _root.width - } - + x = x + _root.width isOpened = true } } function hide() { if ( isOpened ) { - if ( slideToOpen ) - { - print("hide x: " + x) - - x = x - _root.width - } - - else if ( _root.visible ) - { - _root.visible = false - } - + x = x - _root.width isOpened = false } + else if ( _root.visible ) { _root.visible = false } } function reset() { @@ -140,40 +109,25 @@ } } - CloseButton { id : _closeButton - anchors { - top : parent.top - left : parent.left - margins : 10 - } - visible: ! slideToOpen - - onClicked: { - cancel() - reset() - } - } - TouchRect { id : _sliderButton anchors { verticalCenter : parent.verticalCenter left : parent.right leftMargin : height / 2 * -1 } - z : -1 - width : 100 - height : 100 - radius : height - border.color: Colors.transparent + z : -1 + height : 80 + width : height + radius : height + border.color : Colors.transparent backgroundColor : "#455B78" onPressed : isOpened ? hide() : show() Image { id : _iconImage anchors { - verticalCenter : parent.verticalCenter right : parent.right - rightMargin : 15 + rightMargin : 5 } height : Variables.headerIconDiameter width : Variables.headerIconDiameter @@ -186,7 +140,7 @@ Text { id: _title anchors { top : _root.top - topMargin : 5 + topMargin : 10 horizontalCenter: _root.horizontalCenter } font { @@ -231,7 +185,7 @@ Text { id: _range anchors { bottom : _numRect.top - bottomMargin : 10 + bottomMargin : 15 horizontalCenter: parent.horizontalCenter } font.pixelSize : 20 Index: sources/gui/qml/compounds/BPHREntry.qml =================================================================== diff -u -r31b1e7a5d69f014398827e16286f28515cd60e35 -r23121e17d1a6120ae4a31930e18de362d9533bcb --- sources/gui/qml/compounds/BPHREntry.qml (.../BPHREntry.qml) (revision 31b1e7a5d69f014398827e16286f28515cd60e35) +++ sources/gui/qml/compounds/BPHREntry.qml (.../BPHREntry.qml) (revision 23121e17d1a6120ae4a31930e18de362d9533bcb) @@ -26,7 +26,7 @@ * \details and dynamically creates list of items which can be later set as started/done to have * bussy circle or check mark as done. */ -Item { id: _root + Item { id: _root property int labelWidth : 200 property int unitWidth : 100 property int entryWidth : 100 @@ -63,85 +63,71 @@ anchors.fill: parent - Row { id: _container - spacing: 50 + Column { id: _container + spacing : 50 + leftPadding : _root.titleIndent anchors.centerIn: parent - Column { - spacing : 25 - leftPadding : _root.titleIndent - Row { - spacing : 10 - TextEntry { id : _bloodPressureSystolic - text : Variables.notSetVariable(vTreatmentVitals.systolic, 0) - label.text : qsTr("Blood Pressure") - label.width : _root.labelWidth - validator : IntValidator { bottom: vTreatmentVitals.systolicMin; top : vTreatmentVitals.systolicMax } - nextInput : _bloodPressureDiastolic - textInput.color: (textInput.acceptableInput && _private.isBloodPressureCompareValid) ? Colors.textMain : Colors.red - useQtNumPad : false + Row { + spacing : 10 + TextEntry { id : _bloodPressureSystolic + text : Variables.notSetVariable(vTreatmentVitals.systolic, 0) + label.text : qsTr("Blood Pressure") + label.width : _root.labelWidth + validator : IntValidator { bottom: vTreatmentVitals.systolicMin; top : vTreatmentVitals.systolicMax } + nextInput : _bloodPressureDiastolic + textInput.color: (textInput.acceptableInput && _private.isBloodPressureCompareValid) ? Colors.textMain : Colors.red + useQtNumPad : false - onClicked : numPad.open ( _bloodPressureSystolic, - qsTr("Systolic"), - vTreatmentVitals.systolicMin, - vTreatmentVitals.systolicMax, - Variables.unitTextBloodPressure) - } - Label { - text : "/" - width : 10 - } - TextEntry { id : _bloodPressureDiastolic - text : Variables.notSetVariable(vTreatmentVitals.diastolic, 0) - label.width : 0 - validator : IntValidator { bottom: vTreatmentVitals.diastolicMin; top : vTreatmentVitals.diastolicMax } - nextInput : _heartRate - textInput.color: (textInput.acceptableInput && _private.isBloodPressureCompareValid) ? Colors.textMain : Colors.red - useQtNumPad : false - - onClicked : numPad.open ( _bloodPressureDiastolic, - qsTr("Diastolic"), - vTreatmentVitals.diastolicMin, - _bloodPressureSystolic.textInput.acceptableInput && - _bloodPressureSystolic.text < vTreatmentVitals.diastolicMax ? _bloodPressureSystolic.text : - vTreatmentVitals.diastolicMax, - Variables.unitTextBloodPressure) - } - Label { - text : Variables.unitTextBloodPressure - width : unitWidth - } + onClicked : numPad.open ( _bloodPressureSystolic, + qsTr("Systolic"), + vTreatmentVitals.systolicMin, + vTreatmentVitals.systolicMax, + Variables.unitTextBloodPressure) } - Row { - spacing : 10 - TextEntry { id : _heartRate - text : Variables.notSetVariable(vTreatmentVitals.heartRate, 0) - label.text : qsTr("Heart Rate") - label.width : _root.labelWidth - validator : IntValidator { bottom: vTreatmentVitals.heartRateMin; top : vTreatmentVitals.heartRateMax } - useQtNumPad : false + Label { + text : "/" + width : 10 + } + TextEntry { id : _bloodPressureDiastolic + text : Variables.notSetVariable(vTreatmentVitals.diastolic, 0) + label.width : 0 + validator : IntValidator { bottom: vTreatmentVitals.diastolicMin; top : vTreatmentVitals.diastolicMax } + nextInput : _heartRate + textInput.color: (textInput.acceptableInput && _private.isBloodPressureCompareValid) ? Colors.textMain : Colors.red + useQtNumPad : false - onClicked : numPad.open ( _heartRate, - qsTr("Heart Rate"), - vTreatmentVitals.heartRateMin, - vTreatmentVitals.heartRateMax, - Variables.unitTextHeartBeat) - } - Label { - text : Variables.unitTextHeartBeat - width : unitWidth - } + onClicked : numPad.open ( _bloodPressureDiastolic, + qsTr("Diastolic"), + vTreatmentVitals.diastolicMin, + _bloodPressureSystolic.textInput.acceptableInput && + _bloodPressureSystolic.text < vTreatmentVitals.diastolicMax ? _bloodPressureSystolic.text : + vTreatmentVitals.diastolicMax, + Variables.unitTextBloodPressure) } + Label { + text : Variables.unitTextBloodPressure + width : unitWidth + } + } + Row { + spacing : 10 + TextEntry { id : _heartRate + text : Variables.notSetVariable(vTreatmentVitals.heartRate, 0) + label.text : qsTr("Heart Rate") + label.width : _root.labelWidth + validator : IntValidator { bottom: vTreatmentVitals.heartRateMin; top : vTreatmentVitals.heartRateMax } + useQtNumPad : false -// Text { id: _lastRecorded -// height : 50 -// width : 50 -// font.pixelSize : 16 -// font.weight : Font.Normal -// verticalAlignment : Text.AlignBottom -// color : Colors.textMain -// text : qsTr("Last Recorded: %1").arg(vTreatmentVitals.lastRead) -// } - + onClicked : numPad.open ( _heartRate, + qsTr("Heart Rate"), + vTreatmentVitals.heartRateMin, + vTreatmentVitals.heartRateMax, + Variables.unitTextHeartBeat) + } + Label { + text : Variables.unitTextHeartBeat + width : unitWidth + } } } } Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentVitals.qml =================================================================== diff -u -r31b1e7a5d69f014398827e16286f28515cd60e35 -r23121e17d1a6120ae4a31930e18de362d9533bcb --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentVitals.qml (.../TreatmentAdjustmentVitals.qml) (revision 31b1e7a5d69f014398827e16286f28515cd60e35) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentVitals.qml (.../TreatmentAdjustmentVitals.qml) (revision 23121e17d1a6120ae4a31930e18de362d9533bcb) @@ -17,37 +17,40 @@ import QtQuick 2.12 // Project - -// Qml imports import "qrc:/globals" import "qrc:/components" import "qrc:/compounds" TreatmentAdjustmentBase { id: _root contentItem.objectName: "TreatmentAdjustmentVitals" - titleText : qsTr("VITALS") - confirmEnabled : _bphrEntry.isValid - height : 500 - width : 750 -// y : Variables.mainMenuHeight - x: numPad.isOpened ? Math.round((Variables.applicationWidth - width) / 2) - 200 : - Math.round((Variables.applicationWidth - width) / 2) + titleText : qsTr("VITALS") + confirmEnabled : _bphrEntry.isValid + height : 500 + width : 750 + x : numPad.isOpened ? Math.round((Variables.applicationWidth - width) / 2) - 200 : + Math.round((Variables.applicationWidth - width) / 2) + notification.visible: vTreatmentVitals.lastRead - notificationText: qsTr("Interval:" ) - + " " + (vTreatmentVitals.interval ? (vTreatmentVitals.interval + qsTr("min")) : qsTr("OFF")) - + " , " - + qsTr("Last Read:") - + " " + vTreatmentVitals.lastRead + property string notificationTextString: qsTr("Interval:" ) + + " " + (vTreatmentVitals.interval ? (vTreatmentVitals.interval + qsTr("min")) : qsTr("OFF")) + + " , " + + qsTr("Last Read:") + + " " + vTreatmentVitals.lastRead function update(vSystolic, vDiastolic ,vHeartRate) { _bphrEntry.systolic = vSystolic ? vSystolic : "" _bphrEntry.diastolic = vDiastolic ? vDiastolic : "" _bphrEntry.heartRate = vHeartRate ? vHeartRate : "" } - onOpened: vTreatmentVitals.doTimerStop() + onOpened: { + notificationText = notificationTextString + vTreatmentVitals.doTimerStop() + vTreatmentAdjustmentVitals.doRequest() ///trjhrtjr + } + onClosed: vTreatmentVitals.doTimerStart() onConfirmClicked: { @@ -66,17 +69,31 @@ vTreatmentVitals.doSkip() } - BPHREntry { id : _bphrEntry + BPHREntry { id: _bphrEntry contentRectHeight : 350 } Connections { target: vTreatmentVitals function onDidTrigger ( vSystolic, vDiastolic, vHeartRate ) { - print("**** vTreatmentVitals.enableDialo " + vTreatmentVitals.enableDialog) print(("%1 / %2 -- %3").arg(vSystolic).arg(vDiastolic).arg(vHeartRate)) - _headerBar.vitalsRecorded() + _root.update ( vSystolic, vDiastolic, vHeartRate ) + + // vitals recorded + if ( vSystolic && vDiastolic && vHeartRate ) { + print("**** vitalsRecorded ") + _headerBar.vitalsRecorded() + } + else { + print("**** vTreatmentAdjustmentVitals.doRequest() ") + + vTreatmentAdjustmentVitals.doRequest() + + } + + if ( vTreatmentVitals.enableDialog ) { - _root.update ( vSystolic, vDiastolic, vHeartRate ) + print("**** vTreatmentVitals.enableDialog " + vTreatmentVitals.enableDialog) +// _root.update ( vSystolic, vDiastolic, vHeartRate ) // _root.open () } } Index: sources/model/td/adjustment/treatment/MTreatmentAdjustVitalsResponse.h =================================================================== diff -u -rc1d0546e2d1a51ff919b2172ce647003359f0853 -r23121e17d1a6120ae4a31930e18de362d9533bcb --- sources/model/td/adjustment/treatment/MTreatmentAdjustVitalsResponse.h (.../MTreatmentAdjustVitalsResponse.h) (revision c1d0546e2d1a51ff919b2172ce647003359f0853) +++ sources/model/td/adjustment/treatment/MTreatmentAdjustVitalsResponse.h (.../MTreatmentAdjustVitalsResponse.h) (revision 23121e17d1a6120ae4a31930e18de362d9533bcb) @@ -16,8 +16,12 @@ // Project #include "MAbstract.h" +#include "MAdjustRequestsBase.h" #include "types.h" +// forward declarations +class tst_models; + namespace Model { /*! @@ -48,6 +52,8 @@ */ class MAdjustVitalsResponse : public MAbstract { + friend class ::tst_models; + QVariantList parameters() const override; struct { @@ -66,9 +72,8 @@ quint32 mReason = 0; /*!< Reason value of type quint32 extracted out */ }; - MAdjustVitalsResponse() {}; + MAdjustVitalsResponse () {}; - bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; Data data ( ) const ; };