Index: sources/gui/qml/globals/Colors.qml =================================================================== diff -u -r642f08650a7a88ad6a2305fdea6bd18365aab5c7 -r8ee8ce1e868b66dd0ae197ef7a947e0436037ef3 --- sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision 642f08650a7a88ad6a2305fdea6bd18365aab5c7) +++ sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision 8ee8ce1e868b66dd0ae197ef7a947e0436037ef3) @@ -43,7 +43,7 @@ readonly property color backgroundSlider : "#195187" readonly property color sliderHighlightColor : "orange" - readonly property color sliderProgressBorderActive : "white" + readonly property color sliderProgressBorderActive : white readonly property color backgroundUltrafiltrationButton : "#31568F" readonly property color textValueUltrafiltrationButtonFg: "#98aec2" @@ -123,7 +123,7 @@ readonly property color createTreatmentTextReady : white readonly property color createTreatmentInvalidParam : red - readonly property color scrollBarBgColor :"white" //"#80696969" // half transparent dimgray + readonly property color scrollBarBgColor : white //"#80696969" // half transparent dimgray // ---------- < PRS > Related Section ---------- // Alarm priority colors Index: sources/gui/qml/pages/settings/SettingsStack.qml =================================================================== diff -u -r4eecbe25c905517c495c69ad9524ffdc7ffe181a -r8ee8ce1e868b66dd0ae197ef7a947e0436037ef3 --- sources/gui/qml/pages/settings/SettingsStack.qml (.../SettingsStack.qml) (revision 4eecbe25c905517c495c69ad9524ffdc7ffe181a) +++ sources/gui/qml/pages/settings/SettingsStack.qml (.../SettingsStack.qml) (revision 8ee8ce1e868b66dd0ae197ef7a947e0436037ef3) @@ -15,6 +15,7 @@ // Qt import QtQuick 2.12 +import QtQuick.Controls 2.12 // Switch // Project import Gui.Actions 0.1 @@ -48,6 +49,7 @@ Services , SetDateTime , ExportLogs , + RoInput , Language , Calibration , SWUpdate , @@ -62,6 +64,7 @@ qsTr("Service" ), // Service qsTr("Set Date And Time" ), // SetDateTime qsTr("Export Logs" ), // ExportLogs + qsTr("Water Input Mode" ), // RoInput qsTr("Set Language" ), // Language qsTr("Calibration " ), // Calibration qsTr("Software Update" ), // SWUpdate @@ -76,6 +79,7 @@ true , // Services true , // SetDateTime true , // ExportLogs + true , // RoInput false , // Language false , // Calibration false , // SWUpdate @@ -90,6 +94,7 @@ ! serviceMode , // Services serviceMode , // SetDateTime true , // ExportLogs + true , // RoInput false /* serviceMode phase 1 */ , // Language false /* serviceMode phase 1 */ , // Calibration false /* serviceMode phase 1 */ , // SWUpdate @@ -145,6 +150,10 @@ push( _settingsExportLogs ) break + case SettingsStack.RoInput: + push( _settingsRoInput ) + break + default: console.debug("Unknown Index", vIndex) break @@ -236,6 +245,73 @@ itemIndex : SettingsStack.ExportLogs } + SettingsBase { id: _settingsRoInput + confirmVisible : false + itemIndex : SettingsStack.RoInput + + + Row { id: _settingsRoInputRow + anchors.centerIn: parent + + Text { id : _settingsRoInputLabel + text : qsTr("Pure Water Mode") + width : 300 + height : _settingsRoInputSwitch.height + color : Colors.white + font.pixelSize: Fonts.fontPixelButton + verticalAlignment : Text.AlignVCenter + horizontalAlignment : Text.AlignLeft + } + + Switch { id: _settingsRoInputSwitch + property bool active: true + onCheckedChanged: { + if ( ! active ) active = true + vSettings.roWaterMode = checked + } + + checked : vSettings.roWaterMode + + width : 85 + height : 85 + + indicator: Rectangle { + implicitWidth : Variables.sliderCircleDiameter * 1.7 + implicitHeight : Variables.sliderCircleDiameter - ( Variables.progressbarHandlerBorderWidth * 2 ) + radius : implicitHeight + anchors.centerIn: parent + color : _settingsRoInputSwitch.checked ? Colors.backgroundButtonSelect : Colors.createTreatmentInactive + border.color : _settingsRoInputSwitch.checked ? Colors.borderButton : Colors.createTreatmentInactive + Rectangle { + property real diameter : Variables.sliderCircleDiameter + x: _settingsRoInputSwitch.checked ? parent.width - width : 0 + anchors.verticalCenter: parent.verticalCenter + width : diameter + height : diameter + radius : diameter + color : _settingsRoInputSwitch.active ? Colors.highlightProgressBar : Colors.createTreatmentInactive + border { + width: Variables.progressbarHandlerBorderWidth + color: Colors.textMain + } + } + } + + contentItem: Text { + width : parent.width + height : parent.height + text : _settingsRoInputSwitch.checked ? qsTr("ON") : qsTr("OFF") + font.pixelSize: Fonts.fontPixelButton + color : _settingsRoInputSwitch.active ? Colors.textMain : Colors.textDisableButton + verticalAlignment : Text.AlignTop + horizontalAlignment : Text.AlignHCenter + // anchors.bottom : parent.top + // anchors.verticalCenter : parent.verticalCenter + } + } + } + } + UserConfirmation { id: _servicePassword property bool isPassword_Accepted : false property bool isDefaultPasswordSet : (vSettings.servicePass != "") Index: sources/view/settings/VSettings.cpp =================================================================== diff -u -r4eecbe25c905517c495c69ad9524ffdc7ffe181a -r8ee8ce1e868b66dd0ae197ef7a947e0436037ef3 --- sources/view/settings/VSettings.cpp (.../VSettings.cpp) (revision 4eecbe25c905517c495c69ad9524ffdc7ffe181a) +++ sources/view/settings/VSettings.cpp (.../VSettings.cpp) (revision 8ee8ce1e868b66dd0ae197ef7a947e0436037ef3) @@ -29,6 +29,7 @@ ACTION_VIEW_CONNECTION (SettingsData ); PROPERTY_POST_CONNECTION(VSettings, servicePass ); PROPERTY_POST_CONNECTION(VSettings, alarmVolume ); + PROPERTY_POST_CONNECTION(VSettings, roWaterMode ); PROPERTY_POST_CONNECTION(VSettings, noCANBus ); connect(&_GuiController, SIGNAL(didActionReceive (GuiActionType, const QVariantList &)), @@ -44,6 +45,14 @@ } } +void VSettings::roWaterMode_post(const bool &vroWaterMode_post) { + Storage::Settings settings; + if ( settings.save(roWaterModeCategory(), roWaterModeGroup(), roWaterModeKey(), QString::number(vroWaterMode_post)) != 0 ) { + roWaterMode(false); + // FIXME: Notify UI with a message + } +} + void VSettings::alarmVolume_post(const quint8 &valarmVolume) { Storage::Settings settings; settings.save(alarmVolumeCategory(), alarmVolumeGroup(), alarmVolumeKey(), QString::number(valarmVolume)); @@ -79,6 +88,12 @@ keyValue[key] = mServicePass ; servicePass ( mServicePass); } + else if ( isroWaterMode (category, group, key) ) { + bool mRoWaterMode; + mRoWaterMode = _Settings.value(category, group, key).toBool (); + keyValue[key] = mRoWaterMode ; + roWaterMode ( mRoWaterMode); + } else if ( isalarmVolume (category, group, key) ) { quint8 mAlarmVolume; mAlarmVolume = _Settings.value(category, group, key).toInt (); // returns 0 if fails, so no error checking needed. @@ -108,6 +123,7 @@ // otherwise will use the default value and will notify the update. servicePass ( _servicePass ); alarmVolume ( _alarmVolume ); + roWaterMode ( _roWaterMode ); // noCANBus ( _noCANBus ); // This line has been put here to remind developers that it is intentionally removed, to not to add a default value. adjustment(true); Index: sources/view/settings/VSettings.h =================================================================== diff -u -r4eecbe25c905517c495c69ad9524ffdc7ffe181a -r8ee8ce1e868b66dd0ae197ef7a947e0436037ef3 --- sources/view/settings/VSettings.h (.../VSettings.h) (revision 4eecbe25c905517c495c69ad9524ffdc7ffe181a) +++ sources/view/settings/VSettings.h (.../VSettings.h) (revision 8ee8ce1e868b66dd0ae197ef7a947e0436037ef3) @@ -65,6 +65,7 @@ SETTINGS(QString , servicePass , "" , Storage::Settings_Category_SettingsSystem , "Service" , "Password" ) SETTINGS(quint8 , alarmVolume , 100 , Storage::Settings_Category_SettingsSystem , "Alarm" , "Volume" ) + SETTINGS(bool , roWaterMode , false , Storage::Settings_Category_SettingsSystem , "RoWaterMode" , "RoWaterMode" ) SETTINGS(bool , noCANBus , false , Storage::Settings_Category_NoCANBus , "Navigation" , "Create Treatment To Patient ID" ) VIEW_DEC(VSettings, SettingsData)