Index: denali.pro =================================================================== diff -u -rc71deaab48699cffdf9db816dfac2778d79c2238 -r2d09ae36f6b791e0415a87b6f14f582d4b434d7d --- denali.pro (.../denali.pro) (revision c71deaab48699cffdf9db816dfac2778d79c2238) +++ denali.pro (.../denali.pro) (revision 2d09ae36f6b791e0415a87b6f14f582d4b434d7d) @@ -16,13 +16,6 @@ DEFINES += "\"QT_MESSAGE_PATTERN=[%{type}] (%{file}:%{line}) - %{message}\"" -CONFIG(debug, debug | release ) { - DEFINES += DEBUG -} else { - DEFINES += RELEASE - DEFINES += QT_NO_DEBUG_OUTPUT -} - # The following define makes your compiler emit warnings if you use # any Qt feature that has been marked deprecated (the exact warnings # depend on your compiler). Refer to the documentation for the Index: denali.pro.user =================================================================== diff -u -rc71deaab48699cffdf9db816dfac2778d79c2238 -r2d09ae36f6b791e0415a87b6f14f582d4b434d7d --- denali.pro.user (.../denali.pro.user) (revision c71deaab48699cffdf9db816dfac2778d79c2238) +++ denali.pro.user (.../denali.pro.user) (revision 2d09ae36f6b791e0415a87b6f14f582d4b434d7d) @@ -1,6 +1,6 @@ - + EnvironmentId Index: sources/gui/qml/components/RectSelectCreateTreatment.qml =================================================================== diff -u -rc71deaab48699cffdf9db816dfac2778d79c2238 -r2d09ae36f6b791e0415a87b6f14f582d4b434d7d --- sources/gui/qml/components/RectSelectCreateTreatment.qml (.../RectSelectCreateTreatment.qml) (revision c71deaab48699cffdf9db816dfac2778d79c2238) +++ sources/gui/qml/components/RectSelectCreateTreatment.qml (.../RectSelectCreateTreatment.qml) (revision 2d09ae36f6b791e0415a87b6f14f582d4b434d7d) @@ -27,18 +27,28 @@ id: _root anchors.horizontalCenter: parent.horizontalCenter color: "transparent" - property int numRows: 2 - property int numCols: 2 - property int buttonHeight: 78 - property int buttonWidth: 313 - property var buttonNames: ["Button 1", "Button 2", "Button 3"] - property alias name: _text.text - property int selectedIndex: unselectedIndex - property int unselectedIndex: 9999 + property int numRows : 2 + property int numCols : 2 + property int buttonHeight : 78 + property int buttonWidth : 313 + property var buttonNames : ["Button 1", "Button 2", "Button 3"] + property alias name : _text.text + property int selectedIndex : unselectedIndex + property int unselectedIndex : 9999 height: numRows * buttonHeight width: numCols * buttonWidth signal buttonClicked() + + function setValid(valid) { + if (valid) { + _text.color = Colors.textMain + } else { + _text.color = Colors.createTrInvalidParam + } + + } + Text { id: _text text: "Title" @@ -71,6 +81,7 @@ width: _root.buttonWidth radius: 0 onClicked: { + _text.color = Colors.textMain if (selectedIndex === index) { _repeater.itemAt(index).setSelected(false) selectedIndex = unselectedIndex Index: sources/gui/qml/components/SliderCreateTreatment.qml =================================================================== diff -u -rc71deaab48699cffdf9db816dfac2778d79c2238 -r2d09ae36f6b791e0415a87b6f14f582d4b434d7d --- sources/gui/qml/components/SliderCreateTreatment.qml (.../SliderCreateTreatment.qml) (revision c71deaab48699cffdf9db816dfac2778d79c2238) +++ sources/gui/qml/components/SliderCreateTreatment.qml (.../SliderCreateTreatment.qml) (revision 2d09ae36f6b791e0415a87b6f14f582d4b434d7d) @@ -41,6 +41,16 @@ anchors.horizontalCenter: parent.horizontalCenter color: "transparent"; + function setValid(valid) { + if (valid) { + _selected_value.color = Colors.textMain + _text.color = Colors.textMain + } else { + _selected_value.color = Colors.createTrInvalidParam + _text.color = Colors.createTrInvalidParam + } + } + Text { id: _text text: "" @@ -78,17 +88,21 @@ _selected_value.text = value + _root.units sliderChanged() } + onActiveChanged: { if (isActive) { _selected_value.color = Colors.textMain + _text.color = Colors.textMain } else { _selected_value.color = Colors.textDisableButton + _text.color = Colors.textDisableButton } } - onProgressRectClicked: setActive(true) - onProgressRectDragged: setActive(true) - onDragged: setActive(true) - onClicked: setActive(true) + onProgressRectClicked: { setActive(true); setValid(true); } + onProgressRectDragged: { setActive(true); setValid(true); } + onDragged: { setActive(true); setValid(true); } + onClicked: { setActive(true); setValid(true); } + } } Index: sources/gui/qml/components/SliderDoubleCreateTreatment.qml =================================================================== diff -u -rc71deaab48699cffdf9db816dfac2778d79c2238 -r2d09ae36f6b791e0415a87b6f14f582d4b434d7d --- sources/gui/qml/components/SliderDoubleCreateTreatment.qml (.../SliderDoubleCreateTreatment.qml) (revision c71deaab48699cffdf9db816dfac2778d79c2238) +++ sources/gui/qml/components/SliderDoubleCreateTreatment.qml (.../SliderDoubleCreateTreatment.qml) (revision 2d09ae36f6b791e0415a87b6f14f582d4b434d7d) @@ -53,6 +53,26 @@ anchors.horizontalCenter: parent.horizontalCenter color: "transparent"; + function setLowValid(valid) { + if (valid) { + _lowTitle.color = Colors.textMain + _lowSelectedValue.color = Colors.textMain + } else { + _lowTitle.color = Colors.createTrInvalidParam + _lowSelectedValue.color = Colors.createTrInvalidParam + } + } + + function setHighValid(valid) { + if (valid) { + _highTitle.color = Colors.textMain + _highSelectedValue.color = Colors.textMain + } else { + _highTitle.color = Colors.createTrInvalidParam + _highSelectedValue.color = Colors.createTrInvalidParam + } + } + Text { id: _lowTitle text: "Low" @@ -93,6 +113,7 @@ } onActiveChanged: { if (isActive) { + _lowTitle.color = Colors.textMain _lowSelectedValue.color = Colors.textMain } else { _lowSelectedValue.color = Colors.createTreatmentInactive; @@ -146,16 +167,17 @@ onActiveChanged: { if (isActive) { + _highTitle.color = Colors.textMain _highSelectedValue.color = Colors.textMain } else { _highSelectedValue.color = Colors.createTreatmentInactive } } - onProgressRectClicked: setActive(true) - onProgressRectDragged: setActive(true) - onDragged: setActive(true) - onClicked: setActive(true) + onProgressRectClicked: { setActive(true); setHighValid(true); } + onProgressRectDragged: { setActive(true); setHighValid(true); } + onDragged: { setActive(true); setHighValid(true); } + onClicked: { setActive(true); setHighValid(true); } } } Index: sources/gui/qml/globals/Colors.qml =================================================================== diff -u -rc71deaab48699cffdf9db816dfac2778d79c2238 -r2d09ae36f6b791e0415a87b6f14f582d4b434d7d --- sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision c71deaab48699cffdf9db816dfac2778d79c2238) +++ sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision 2d09ae36f6b791e0415a87b6f14f582d4b434d7d) @@ -99,6 +99,7 @@ readonly property color createTreatmentReady : "#438FEB" readonly property color createTrTextNotReady : "#507090" readonly property color createTrTextReady : "white" + readonly property color createTrInvalidParam : "red" } Index: sources/gui/qml/pages/treatment/TreatmentCreate.qml =================================================================== diff -u -rc71deaab48699cffdf9db816dfac2778d79c2238 -r2d09ae36f6b791e0415a87b6f14f582d4b434d7d --- sources/gui/qml/pages/treatment/TreatmentCreate.qml (.../TreatmentCreate.qml) (revision c71deaab48699cffdf9db816dfac2778d79c2238) +++ sources/gui/qml/pages/treatment/TreatmentCreate.qml (.../TreatmentCreate.qml) (revision 2d09ae36f6b791e0415a87b6f14f582d4b434d7d) @@ -28,6 +28,7 @@ * which is the default screen in the "Manager" stack */ ScreenItem { id: _root + objectName: "TreatmentCreate"; // SquishQt testability signal clickedBack() signal clickedContinue() backgroundRect.color: Colors.backgroundMainMenu @@ -81,7 +82,6 @@ units: qsTr(" mL/min") min: vCreateTreatment.bloodFlowRateMin max: vCreateTreatment.bloodFlowRateMax - value: vCreateTreatment.bloodFlowRate onSliderChanged: { vCreateTreatment.bloodFlowRate = value; } @@ -172,7 +172,7 @@ } RectSelectCreateTreatment { - id: _dialyserType + id: _dialyzerType name: "Dialyzer Type" numRows: 3 numCols: 2 @@ -213,6 +213,8 @@ lowMax: vCreateTreatment.arterialPressureLimitLowMax highMin: vCreateTreatment.arterialPressureLimitHighMin highMax: vCreateTreatment.arterialPressureLimitHighMax + lowValue: vCreateTreatment.arterialPressureLimitLowMin + highValue: vCreateTreatment.arterialPressureLimitHighMin onLowSliderChanged: { vCreateTreatment.arterialPressureLimitLow = lowValue } @@ -241,6 +243,8 @@ lowMax: vCreateTreatment.venousPressureLimitLowMax highMin: vCreateTreatment.venousPressureLimitHighMin highMax: vCreateTreatment.venousPressureLimitHighMax + lowValue: vCreateTreatment.venousPressureLimitLowMin + highValue: vCreateTreatment.venousPressureLimitHighMin onLowSliderChanged: { vCreateTreatment.venousPressureLimitLow = lowValue } @@ -282,7 +286,7 @@ borderColor: Colors.createTreatmentNotReady textColor: Colors.createTrTextNotReady button.onClicked: { - console.log("continue enabled: " + vCreateTreatment.continueEnabled); + vCreateTreatment.saveTreatmentProfile = false; if (vCreateTreatment.continueEnabled) { _root.clickedContinue() } @@ -363,7 +367,7 @@ _salineBolus.setActive(false); _acidConcentrate.setActive(false); _bicarbonateConcentrate.setActive(false); - _dialyserType.setActive(false); + _dialyzerType.setActive(false); _dialysateTemperature.isActive = false; _arterialPressureLimits.isLowActive = false; @@ -376,12 +380,99 @@ } onFwValidationFailed: { - console.debug("Fw validation failed: " + reason); + console.debug("Fw validation failed: " + reason) } onBloodFlowRate_ValidationFailed: { - console.debug("Blood flow validation failed: " + reason); + console.debug("Blood flow validation failed: " + reason) + _bloodFlowRate.setValid(false) } + + onDialysateFlowRate_ValidationFailed: { + console.debug("Dialysate flow rate validation failed: " + reason) + _dialysateFlowRate.setValid(false) + } + + + onDuration_ValidationFailed: { + console.debug("Duration validation failed: " + reason) + _duration.setValid(false) + } + + onHeparinDispensingRate_ValidationFailed: { + console.debug("Heparin dispensing rate validation failed: " + reason) + _heparinDispensingRate.setValid(false) + } + + onHeparinBolusVolume_ValidationFailed: { + console.debug("Heparin bolus volume validation failed: " + reason) + _heparinBolusVolume.setValid(false) + } + + onHeparinStopTime_ValidationFailed: { + console.debug("Heparin stop time validation failed: " + reason) + _heparinStopTime.setValid(false) + + } + + onSalineBolusVolume_ValidationFailed: { + console.debug("Saline bolus volume validation failed: " + reason) + _salineBolus.setValid(false) + + } + + onAcidConcentrate_ValidationFailed: { + console.debug("Acid concentrate validation failed: " + reason) + _acidConcentrate.setValid(false) + + } + + onBicarbonateConcentrate_ValidationFailed: { + console.debug("Bicarbonate concentrate validation failed: " + reason) + _bicarbonateConcentrate.setValid(false) + } + + onDialyzerType_ValidationFailed: { + console.debug("Dialyzer type validation failed: " + reason) + _dialyzerType.setValid(false) + } + + onDialysateTemp_ValidationFailed: { + console.debug("Dialysate temp validation failed: " + reason) + _dialysateTemperature.setValid(false) + } + + onArterialPressureLimitLow_ValidationFailed: { + console.debug("Arterial pressure limit low validation failed: " + reason) + _arterialPressureLimits.setLowValid(false) + } + + onArterialPressureLimitHigh_ValidationFailed: { + console.debug("Arterial pressure limit high validation failed: " + reason) + _arterialPressureLimits.setHighValid(false) + } + + onVenousPressureLimitLow_ValidationFailed: { + console.debug("Venous pressure limit low validation failed: " + reason) + _venousPressureLimits.setLowValid(false) + } + + onVenousPressureLimitHigh_ValidationFailed: { + console.debug("Venous pressure limit high validation failed: " + reason) + _venousPressureLimits.setHighValid(false) + } + + onBloodPressureMeasureInterval_ValidationFailed: { + console.debug("Blood pressure measure interval validation failed: " + reason) + _bloodPressureMeasurementInterval.setValid(false) + } + + onRinsebackFlowRate_ValidationFailed: { + console.debug("Rinseback flow rate validation failed: " + reason) + _rinsebackFlowRate.setValid(false) + } + + } Index: sources/gui/qml/pages/treatment/TreatmentStack.qml =================================================================== diff -u -rc71deaab48699cffdf9db816dfac2778d79c2238 -r2d09ae36f6b791e0415a87b6f14f582d4b434d7d --- sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision c71deaab48699cffdf9db816dfac2778d79c2238) +++ sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 2d09ae36f6b791e0415a87b6f14f582d4b434d7d) @@ -50,7 +50,7 @@ TreatmentHome { id: _treatmentHome onTreatmentStarted : push( _treatmentStart ) - onTreatmentCreated : { vCreateTreatment.onResetCreateTreatment(); push( _treatmentCreate); } + onTreatmentCreated : push( _treatmentCreate) } TreatmentStart { id: _treatmentStart Index: sources/main.h =================================================================== diff -u -rc71deaab48699cffdf9db816dfac2778d79c2238 -r2d09ae36f6b791e0415a87b6f14f582d4b434d7d --- sources/main.h (.../main.h) (revision c71deaab48699cffdf9db816dfac2778d79c2238) +++ sources/main.h (.../main.h) (revision 2d09ae36f6b791e0415a87b6f14f582d4b434d7d) @@ -48,7 +48,7 @@ extern bool gDisableTimeout; //--------------------------------------------------------------------------------// //--------------------------------------------------------------------------------// -#define DEBUG_PROPERTY_CHANGED(vVARIABLE, PREFIX) // qDebug() << "#" << #vVARIABLE << PREFIX##vVARIABLE; +#define DEBUG_PROPERTY_CHANGED(vVARIABLE, PREFIX) // qDebug() << "#" << #vVARIABLE << PREFIX##vVARIABLE; //--------------------------------------------------------------------------------// #define PROPERTY_SLOT( vTYPE , vVARIABLE ) \ protected : \ Index: sources/storage/storageglobals.cpp =================================================================== diff -u -rc71deaab48699cffdf9db816dfac2778d79c2238 -r2d09ae36f6b791e0415a87b6f14f582d4b434d7d --- sources/storage/storageglobals.cpp (.../storageglobals.cpp) (revision c71deaab48699cffdf9db816dfac2778d79c2238) +++ sources/storage/storageglobals.cpp (.../storageglobals.cpp) (revision 2d09ae36f6b791e0415a87b6f14f582d4b434d7d) @@ -30,7 +30,7 @@ const char *Log_File_Name = "denali.log"; // Treatment -#ifdef DEBUG +#ifdef QT_DEBUG const char *Treatment_Base_Path_Name = "/home/denali/Desktop/treatment/"; const char *Treatment_Profiles_Dir = "/home/denali/Desktop/treatment/profiles/"; const char *Treatment_Parameter_Ranges_Path = "/home/denali/Desktop/treatment/denali.conf"; Index: sources/view/VCreateTreatment.cpp =================================================================== diff -u -rc71deaab48699cffdf9db816dfac2778d79c2238 -r2d09ae36f6b791e0415a87b6f14f582d4b434d7d --- sources/view/VCreateTreatment.cpp (.../VCreateTreatment.cpp) (revision c71deaab48699cffdf9db816dfac2778d79c2238) +++ sources/view/VCreateTreatment.cpp (.../VCreateTreatment.cpp) (revision 2d09ae36f6b791e0415a87b6f14f582d4b434d7d) @@ -25,6 +25,11 @@ loadTreatmentParameterRanges(); } +/** + * @brief VCreateTreatment::loadTreatmentParameterRanges + * Loads treatment parameters from a json file + * @return QJsonObject holding the treatment parameters + */ QJsonObject VCreateTreatment::loadTreatmentParameterRanges() { QJsonObject obj; @@ -196,25 +201,6 @@ setTreatmentData(); - qDebug() << treatmentData.bloodFlowRate; - qDebug() << treatmentData.dialysateFlowRate; - qDebug() << treatmentData.duration; - qDebug() << treatmentData.heparinDispensingRate; - qDebug() << treatmentData.heparinBolusVolume; - qDebug() << treatmentData.heparinStopTime; - qDebug() << treatmentData.salineBolus; - - qDebug() << treatmentData.acidConcentrate; - qDebug() << treatmentData.bicarbonateConcentrate; - qDebug() << treatmentData.dialyzerType; - qDebug() << treatmentData.dialysateTemp; - qDebug() << treatmentData.arterialPressureLimitLow; - qDebug() << treatmentData.arterialPressureLimitHigh; - qDebug() << treatmentData.venousPressureLimitLow; - qDebug() << treatmentData.venousPressureLimitHigh; - qDebug() << treatmentData.bloodPressureMeasureInterval; - qDebug() << treatmentData.rinsebackFlowRate; - if (!validate(treatmentData)) { qDebug() << "Local create treatment validation failed."; @@ -223,10 +209,10 @@ } -#ifdef DEBUG +#ifdef QT_DEBUG emit showConfirm(); #else - // TODO: Ask FW to validate selected parameters + // Request that FW validates the selected parameters QVariantList messageData = { treatmentData.bloodFlowRate, treatmentData.dialysateFlowRate, @@ -300,7 +286,7 @@ } if (data.heparinDispensingRate != Gui::GuiRequestReasons::REQUEST_REJECT_REASON_NONE) { success = false; - emit heparinBolusVolume_ValidationFailed(enumToString(static_cast(data.heparinDispensingRate))); + emit heparinDispensingRate_ValidationFailed(enumToString(static_cast(data.heparinDispensingRate))); } if (data.heparinBolusVolume != Gui::GuiRequestReasons::REQUEST_REJECT_REASON_NONE) { @@ -325,7 +311,7 @@ } if (data.dialyzerType != Gui::GuiRequestReasons::REQUEST_REJECT_REASON_NONE) { success = false; - emit dialysateFlowRate_ValidationFailed(enumToString(static_cast(data.dialyzerType))); + emit dialyzerType_ValidationFailed(enumToString(static_cast(data.dialyzerType))); } if (data.dialysateTemp != Gui::GuiRequestReasons::REQUEST_REJECT_REASON_NONE) { success = false; @@ -349,7 +335,7 @@ } if (data.bloodPressureMeasureInterval != Gui::GuiRequestReasons::REQUEST_REJECT_REASON_NONE) { success = false; - emit bloodFlowRate_ValidationFailed(enumToString(static_cast(data.bloodPressureMeasureInterval))); + emit bloodPressureMeasureInterval_ValidationFailed(enumToString(static_cast(data.bloodPressureMeasureInterval))); } if (data.rinsebackFlowRate != Gui::GuiRequestReasons::REQUEST_REJECT_REASON_NONE) { success = false; @@ -392,7 +378,8 @@ {"rinsebackFlowRate", QString::number(treatmentData.rinsebackFlowRate)} }; - saveNewTreatment(obj); + if (saveTreatmentProfile()) + saveNewTreatment(obj); emit didCreateTreatment(treatmentData); emit showPrime(); @@ -506,7 +493,6 @@ success = false; if (!success) { - qDebug() << "Not all values are set yet."; return false; } @@ -614,12 +600,6 @@ success = false; } - if (!success) - { - qDebug() << "Initial treatment parameter validation failed."; - } - - return success; } Index: sources/view/VCreateTreatment.h =================================================================== diff -u -rc71deaab48699cffdf9db816dfac2778d79c2238 -r2d09ae36f6b791e0415a87b6f14f582d4b434d7d --- sources/view/VCreateTreatment.h (.../VCreateTreatment.h) (revision c71deaab48699cffdf9db816dfac2778d79c2238) +++ sources/view/VCreateTreatment.h (.../VCreateTreatment.h) (revision 2d09ae36f6b791e0415a87b6f14f582d4b434d7d) @@ -84,6 +84,7 @@ PROPERTY(quint32, rinsebackFlowRateMax, 150) PROPERTY(bool, continueEnabled, false) + PROPERTY(bool, saveTreatmentProfile, false) TreatmentData treatmentData; bool validate(const TreatmentData &vData);