Index: sources/canbus/messageinterpreter.cpp =================================================================== diff -u -r5c5fa01738826261e0b3647db6b7b3fc26b04251 -r9ec7a27375189ad75f0bef142cd6beb386db0955 --- sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) +++ sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision 9ec7a27375189ad75f0bef142cd6beb386db0955) @@ -227,16 +227,6 @@ ok = alarmStatus (vMessage, vData); break; - case Gui::GuiActionType::AlarmTriggered: - printUnhandled (vMessage); - ok = true; - break; - - case Gui::GuiActionType::AlarmCleared: - printUnhandled (vMessage); - ok = true; - break; - case Gui::GuiActionType::PressureOcclusion: ok = pressureOcclusionData (vMessage, vData); break; @@ -253,6 +243,23 @@ ok = adjustDurationData (vMessage, vData); break; + // unhandles messages: these will only be logged as received message + // there has nothing been defined for these messages. + case Gui::GuiActionType::AlarmTriggered: + printUnhandled (vMessage); + ok = true; + break; + + case Gui::GuiActionType::AlarmCleared: + printUnhandled (vMessage); + ok = true; + break; + + case Gui::GuiActionType::TreatmentState: + printUnhandled (vMessage); + ok = true; + break; + default: printUnhandled (vMessage); break; Index: sources/gui/guiglobals.h =================================================================== diff -u -r5c5fa01738826261e0b3647db6b7b3fc26b04251 -r9ec7a27375189ad75f0bef142cd6beb386db0955 --- sources/gui/guiglobals.h (.../guiglobals.h) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) +++ sources/gui/guiglobals.h (.../guiglobals.h) (revision 9ec7a27375189ad75f0bef142cd6beb386db0955) @@ -68,6 +68,8 @@ TreatmentRanges = 0x1A00, // 26 + TreatmentState = 0x0F00, // 15 + String = 0xFFFE, Acknow = 0xFFFF, Index: sources/gui/qml/components/Slider.qml =================================================================== diff -u -r95c671ab7037af055db551456a719ff67bf10262 -r9ec7a27375189ad75f0bef142cd6beb386db0955 --- sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision 95c671ab7037af055db551456a719ff67bf10262) +++ sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision 9ec7a27375189ad75f0bef142cd6beb386db0955) @@ -25,6 +25,8 @@ RangeRect { id: _root property alias value : _progressRect.value property int step : 1 + property bool stepSnap : false + property bool ticks : false property alias color : _progressRect.color @@ -62,22 +64,25 @@ font.bold : false } - function getPosition(x) { + function getValueOfX(x) { return ( x * ( maximum - minimum ) ) / width + minimum } function setValue(x) { - if ( x < 0 ) { - value = minimum - } else - if ( x > width ) { - value = maximum - } else - 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 - } + if ( x < 0 ) { value = minimum; return; } + if ( x > width ) { value = maximum; return; } + + value = getValueOfX(x) + + if ( step === 1 ) { /* keep the value and return */ return; } + + var start = 0 + if ( ! stepSnap ) start = minimum + + value = Math.round((value - start) / step) * step + start + + if ( value < minimum ) { value = minimum; return; } + if ( value > maximum ) { value = maximum; return; } } ProgressRect { id: _progressRect @@ -105,6 +110,8 @@ minimum : _root.minimum maximum : _root.maximum step : _root.step + stepSnap : _root.stepSnap + textColor : _root.color } } Index: sources/gui/qml/components/TickMarks.qml =================================================================== diff -u -rcd7de5f6d239a11615ba8c6c03339a10996486ca -r9ec7a27375189ad75f0bef142cd6beb386db0955 --- sources/gui/qml/components/TickMarks.qml (.../TickMarks.qml) (revision cd7de5f6d239a11615ba8c6c03339a10996486ca) +++ sources/gui/qml/components/TickMarks.qml (.../TickMarks.qml) (revision 9ec7a27375189ad75f0bef142cd6beb386db0955) @@ -29,27 +29,35 @@ property int minimum : parent.minimum property int maximum : parent.maximum property int step : parent.step + property bool stepSnap : false property color color : Colors.backgroundDialog property int orientation : Line.Orientation.Vertical property int length : parent.height property int thickness : 1 + property bool textVisible : false + property color textColor : "white" + anchors.fill: parent Repeater { id : _repeater model: (maximum - minimum) / step + 1 Line { id: _line + property int gap : stepSnap ? + ( + (parent.width * (step - (minimum % step))) / (maximum - minimum) + ) : 0 orientation : _root.orientation thickness : _root.thickness color : _root.color length : _root.length - x: (((index * step) * (parent.width - parent.x)) / (maximum - minimum)) + x: (((index * step) * (parent.width - parent.x)) / (maximum - minimum)) + gap y: 0 Text { id : _text visible: textVisible - color: _root.color + color: _root.textColor font.pixelSize: 10 text: (index * step) + minimum anchors { Index: sources/gui/qml/globals/Variables.qml =================================================================== diff -u -r34471900489397f483e052870ddc46059cef49fb -r9ec7a27375189ad75f0bef142cd6beb386db0955 --- sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision 34471900489397f483e052870ddc46059cef49fb) +++ sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision 9ec7a27375189ad75f0bef142cd6beb386db0955) @@ -71,6 +71,6 @@ readonly property int bloodFlowResolution : 25 readonly property int dialysateFlowResolution : 50 - readonly property int durationResolution : 1 // ? + readonly property int durationResolution : 15 // PRS346 } Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentDuration.qml =================================================================== diff -u -r95c671ab7037af055db551456a719ff67bf10262 -r9ec7a27375189ad75f0bef142cd6beb386db0955 --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentDuration.qml (.../TreatmentAdjustmentDuration.qml) (revision 95c671ab7037af055db551456a719ff67bf10262) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentDuration.qml (.../TreatmentAdjustmentDuration.qml) (revision 9ec7a27375189ad75f0bef142cd6beb386db0955) @@ -65,8 +65,10 @@ minimum : vTreatmentRanges.treatmentRanges_Duration_Min // in Minutes maximum : vTreatmentRanges.treatmentRanges_Duration_Max // in Minutes step : Variables.durationResolution + stepSnap: true minText.visible: false maxText.visible: false + ticks: true TimeText { id: _durationText seconds: 60 * _durationSlider.value // in Minutes => to Seconds secondsVisible: false