Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml =================================================================== diff -u -r987ea5bbcaf541b46eb6d1beb9d34ba9e03af709 -rb54264a622d738efdafe842942921b6840828914 --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision 987ea5bbcaf541b46eb6d1beb9d34ba9e03af709) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision b54264a622d738efdafe842942921b6840828914) @@ -569,6 +569,60 @@ value : vTreatmentRanges.bloodPressureMeasureIntervalDef onPressed : vTreatmentCreate.bloodPressureMeasureInterval = value onReleased : vTreatmentCreate.bloodPressureMeasureInterval = value + adjustable : _bloodPressureIntervalSwitch.checked + inActiveZero: true + + Switch { id: _bloodPressureIntervalSwitch + property bool active: false + onCheckedChanged: { + if ( ! active ) { + active = true + checked = ! checked + } + vTreatmentCreate.bloodPressureMeasureInterval = 0 + _bloodPressureInterval.value = 0 + _bloodPressureInterval.active = ! checked + + } + + x : width * -1.5 + y : 5 // these values are set to align the switch with slider + width : 75 // these values are set to align the switch with slider + height : 85 // these values are set to align the switch with slider + // DEBUG: background : Rectangle { color : "white" } + + indicator: Rectangle { + implicitWidth : Variables.sliderCircleDiameter * 1.7 + implicitHeight : Variables.sliderCircleDiameter - ( Variables.progressbarHandlerBorderWidth * 2 ) + radius : implicitHeight + anchors.centerIn: parent + color : _bloodPressureIntervalSwitch.checked ? Colors.backgroundButtonSelect : Colors.createTreatmentInactive + border.color : _bloodPressureIntervalSwitch.checked ? Colors.borderButton : Colors.createTreatmentInactive + Rectangle { + property real diameter : Variables.sliderCircleDiameter + + x: _bloodPressureIntervalSwitch.checked ? parent.width - width : 0 + anchors.verticalCenter: parent.verticalCenter + width : diameter + height : diameter + radius : diameter + color : _bloodPressureIntervalSwitch.active ? Colors.highlightProgressBar : Colors.createTreatmentInactive + border { + width: Variables.progressbarHandlerBorderWidth + color: Colors.textMain + } + } + } + + contentItem: Text { + text : _bloodPressureIntervalSwitch.checked ? qsTr("ON") : qsTr("OFF") + font : _bloodPressureIntervalSwitch.font + color : _bloodPressureIntervalSwitch.active ? Colors.textMain : Colors.textDisableButton + verticalAlignment: Text.AlignTop + horizontalAlignment: Text.AlignHCenter + anchors.centerIn: parent + } + } } SliderCreateTreatment { id: _rinsebackFlowRate Index: sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp =================================================================== diff -u -r799431fc75a1fbe1b874f08344c009c6b511047d -rb54264a622d738efdafe842942921b6840828914 --- sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp (.../VCommonAdjustmentVitals.cpp) (revision 799431fc75a1fbe1b874f08344c009c6b511047d) +++ sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp (.../VCommonAdjustmentVitals.cpp) (revision b54264a622d738efdafe842942921b6840828914) @@ -174,6 +174,7 @@ if ( ! _timerId ) return; // No timer started or failed starting if ( ! _interval ) return; // if interval is 0/OFF return + // DEBUG: qDebug() << __FUNCTION__ << _counter_sec << _counter_min << _interval << _timerId; _counter_sec++; if ( _counter_sec % 60 ) return; // only check every minute @@ -189,6 +190,7 @@ void View::VTreatmentVitals::onIntervalChanged() { + // DEBUG: qDebug() << __FUNCTION__ << _counter_sec << _counter_min << _interval << _timerId; if ( _interval ) timerReset(); else timerStop (); // Timer stop is resetting timer too. } @@ -202,6 +204,7 @@ { if ( _timerId ) killTimer(_timerId); // this typically should not happen. if ( ! _interval ) return; // if interval is 0/OFF return + // DEBUG: qDebug() << __FUNCTION__ << _counter_sec << _counter_min << _interval << _timerId; timerReset(); _timerId = startTimer(1000); // 1 sec interval which will used as 1 min in timerEvent (easier to debug) } @@ -217,6 +220,7 @@ _counter_min = 0; } _counter_sec = 0; + // DEBUG: qDebug() << __FUNCTION__ << _counter_sec << _counter_min << _interval << _timerId; } /*! @@ -226,6 +230,7 @@ void View::VTreatmentVitals::timerStop() { if ( ! _timerId ) return; // No timer started or failed starting + // DEBUG: qDebug() << __FUNCTION__ << _counter_sec << _counter_min << _interval << _timerId; killTimer(_timerId); _timerId = 0; timerReset();