Index: denali.pro.user =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r98581b325c24eb5ef0ce0ce475ad15320d659140 --- denali.pro.user (.../denali.pro.user) (revision 88563177f10f20ced98750b2e40036201728131d) +++ denali.pro.user (.../denali.pro.user) (revision 98581b325c24eb5ef0ce0ce475ad15320d659140) @@ -1,6 +1,6 @@ - + EnvironmentId Index: denali.qrc =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r98581b325c24eb5ef0ce0ce475ad15320d659140 --- denali.qrc (.../denali.qrc) (revision 88563177f10f20ced98750b2e40036201728131d) +++ denali.qrc (.../denali.qrc) (revision 98581b325c24eb5ef0ce0ce475ad15320d659140) @@ -184,4 +184,8 @@ sources/gui/qml/pages/endtreatment/end/EndTreatmentEnd.qml sources/gui/qml/pages/endtreatment/end/EndTreatmentEndPause.qml + + sources/gui/qml/pages/posttreatment/PostTreatmentBase.qml + sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml + Index: en_US.udic =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r98581b325c24eb5ef0ce0ce475ad15320d659140 --- en_US.udic (.../en_US.udic) (revision 88563177f10f20ced98750b2e40036201728131d) +++ en_US.udic (.../en_US.udic) (revision 98581b325c24eb5ef0ce0ce475ad15320d659140) @@ -50,3 +50,4 @@ VPre VPost MPre +groupheader Index: resources/settings/instructions/instructions.conf =================================================================== diff -u -r4b7b2f3079f81ff442fcbbde5d5e5465f5937417 -r98581b325c24eb5ef0ce0ce475ad15320d659140 --- resources/settings/instructions/instructions.conf (.../instructions.conf) (revision 4b7b2f3079f81ff442fcbbde5d5e5465f5937417) +++ resources/settings/instructions/instructions.conf (.../instructions.conf) (revision 98581b325c24eb5ef0ce0ce475ad15320d659140) @@ -50,4 +50,9 @@ Insert cartridge using alignment pins Connection^Start Treatment=2.png HD machine door open / HD machine door closed Connection^Start Treatment=3.png +[Disconnection^Patient Disconnection] +1 - . Unlock pump track . Lock pump track Connection^Start Treatment=1.png +2 - Insert cartridge using alignment pins Connection^Start Treatment=2.png + + Index: sources/gui/qml/components/Footer.qml =================================================================== diff -u -rbd01334f257c35b96b7b232beacbcd7fae60c852 -r98581b325c24eb5ef0ce0ce475ad15320d659140 --- sources/gui/qml/components/Footer.qml (.../Footer.qml) (revision bd01334f257c35b96b7b232beacbcd7fae60c852) +++ sources/gui/qml/components/Footer.qml (.../Footer.qml) (revision 98581b325c24eb5ef0ce0ce475ad15320d659140) @@ -24,12 +24,37 @@ * \brief Denali project Footer section which gives all the children same width with same spacing, aligned in center */ Row { id: _root - property int childrenCount: children.length - readonly property int splits: _root.width / (childrenCount * 2 + 1 ) + property int childrenWidth : _root.width / (childrenCount * 2 + 1 ) + property int childrenCount : children.length - spacing : _root.splits - rightPadding : spacing - leftPadding : spacing + QtObject { id: _private + property int spacing : 0 + } + + // this code will run once and will not run for each child, + // that's becuase the available property to add children is the children property + // and that property can only change by assigning a list to it. + // so it happens once with no performance issue of multiple redundant call. + onChildrenCountChanged: { + // check there is a child + let count = childrenCount + if ( ! count ) return + + + let width = childrenWidth + let spacing = (_root.width - (width * count)) / (count + 1) + + for (let i = 0; i < count; i++) { + if (children[i].width !== width) { + children[i].width = width + } + } + _private.spacing = spacing + } + + spacing : _private.spacing + rightPadding : _private.spacing + leftPadding : _private.spacing width : parent.width anchors.bottom : parent.bottom anchors.bottomMargin: Variables.notificationHeight + Variables.minVGap Index: sources/gui/qml/compounds/StepNavigationTitleBar.qml =================================================================== diff -u -rbd01334f257c35b96b7b232beacbcd7fae60c852 -r98581b325c24eb5ef0ce0ce475ad15320d659140 --- sources/gui/qml/compounds/StepNavigationTitleBar.qml (.../StepNavigationTitleBar.qml) (revision bd01334f257c35b96b7b232beacbcd7fae60c852) +++ sources/gui/qml/compounds/StepNavigationTitleBar.qml (.../StepNavigationTitleBar.qml) (revision 98581b325c24eb5ef0ce0ce475ad15320d659140) @@ -26,6 +26,7 @@ */ Rectangle { id: _root property alias stepIndex : _stepIndicator.currentStepIndex + property alias stepLineLength : _stepIndicator.spacerLineLength property alias backVisible : _backButton .visible property alias backEnabled : _backButton .enabled property alias confirmVisible : _confirmButton.visible Index: sources/gui/qml/pages/MainStack.qml =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r98581b325c24eb5ef0ce0ce475ad15320d659140 --- sources/gui/qml/pages/MainStack.qml (.../MainStack.qml) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/gui/qml/pages/MainStack.qml (.../MainStack.qml) (revision 98581b325c24eb5ef0ce0ce475ad15320d659140) @@ -24,6 +24,7 @@ import "qrc:/pages/pretreatment/create" import "qrc:/pages/treatment" import "qrc:/pages/endtreatment" +import "qrc:/pages/posttreatment" /*! * \brief ManagerStack is the screen @@ -51,6 +52,9 @@ EndTreatmentRecirculateStack { id: _endTreatmentRecirculateStack } EndTreatmentEndStack { id: _endTreatmentEndStack } + // Post Treatment + PostTreatmentStack { id: _postTreatmentStack } + ScreenItem { id: _faultModeScreen PlaceHolderText { screenName: qsTr("FAULT MODE") } onVisibleChanged: if (visible) _mainMenu.hidden = true @@ -79,7 +83,7 @@ onValidateParametersChanged : { page( _preTreatmentCreateStack , vvalidateParameters )} onPreTreatmentChanged : { page( _preTreatmentMainStack , vpreTreatment )} onInTreatmentChanged : { page( _treatmentStack , vinTreatment )} - onPostTreatmentChanged : { page( null , vpostTreatment )} + onPostTreatmentChanged : { page( _postTreatmentStack , vpostTreatment )} onInvalidModeChanged : { page( null , vinvalidMode )} } Index: sources/gui/qml/pages/posttreatment/PostTreatmentBase.qml =================================================================== diff -u --- sources/gui/qml/pages/posttreatment/PostTreatmentBase.qml (revision 0) +++ sources/gui/qml/pages/posttreatment/PostTreatmentBase.qml (revision 98581b325c24eb5ef0ce0ce475ad15320d659140) @@ -0,0 +1,183 @@ +/*! + * + * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file PostTreatmentBase.qml + * \author (last) Behrouz NematiPour + * \date (last) 12-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 12-Apr-2021 + * + */ + +// Qt +import QtQuick 2.12 + +// Project +// Qml imports +import "qrc:/globals" +import "qrc:/components" +import "qrc:/compounds" + +/*! + * \brief the parent page of the post-treatment screens + */ +ScreenItem { id: _root + objectName: "_PostTreatmentBase" + + property alias reasonText : _notification.text + property alias header : _titleBar + property alias title : _titleText + property alias footer : _footer + + property bool instructionBased : false + readonly property alias instruction : _instructionLoader.item + property string instructionlocation : "" + property var instructionStepNames : [] + property var instructionStepImages : [] + + property bool hasTimeCircle : false + readonly property alias timeCircle : _timeCircleLoader.item + property bool timeCircleisChecked : false + property int timeCircleMinimum : 0 + property int timeCircleMaximum : 0 + property int timeCircleProgressValue : 0 + property int timeCircleTimeTextValue : 0 + + property bool hasCheckList : false + readonly property alias checkList : _checkListLoader.item + property var checkListStepNames : [] + property int checkListCompleteMargin : 50 + property string completeText : "" + + property bool isComplete : false + + readonly property int titleTopMargin: 110 + + signal backClicked() + signal confirmClicked() + + // vvvvvvvvvvvvvvvvvvvvvvvvv HEADER vvvvvvvvvvvvvvvvvvvvvvvvv // + StepNavigationTitleBar { id: _titleBar + stepIndex : stackStepIndex // shall have a definition in the parent stack + stepLineLength : 120 + anchors.top : _root.top + anchors.horizontalCenter : parent.horizontalCenter + width : _root.width + confirmEnabled : instruction ? instruction.lastStep : true + stepNames: [ + qsTr("Disconnection"), + qsTr("Review" ), + qsTr("Disposables" ), + qsTr("Disinfection" ), + ] + onBackClicked : _root.backClicked() + onConfirmClicked: _root.confirmClicked() + } + + Text { id: _titleText + anchors { + top : _root.top + topMargin : titleTopMargin + horizontalCenter: parent.horizontalCenter + } + text : qsTr("PostTreatmentBase") + color : Colors.textMain + font.pixelSize : Fonts.fontPixelTitle + } + + // ^^^^^^^^^^^^^^^^^^^^^^^^^ HEADER ^^^^^^^^^^^^^^^^^^^^^^^^^ // + + // vvvvvvvvvvvvvvvvvvvv Optional Components vvvvvvvvvvvvvvvvvvvv // + Loader { id: _instructionLoader + readonly property int outerHMargin : 30 + readonly property int outerVMargin : 15 + active : _root.instructionBased + anchors { + top : title.bottom + bottom : footer.top + left : parent.left + right : parent.right + leftMargin : outerHMargin + rightMargin : outerHMargin + topMargin : outerVMargin + bottomMargin : outerVMargin + } + sourceComponent : InstructionView { id: _instructionView + location : _root.instructionlocation + stepNames : _root.instructionStepNames + stepImages : _root.instructionStepImages + } + } + + Loader { id : _timeCircleLoader + active : _root.hasTimeCircle + + anchors.top : _root.hasCheckList ? title.bottom : undefined + anchors.topMargin : _root.hasCheckList ? 25 : 0 + anchors.horizontalCenter: _root.horizontalCenter + anchors.centerIn : ! _root.hasCheckList ? parent : undefined + sourceComponent : TimeCircle { id: _timeCircle + isChecked : _root.isComplete + minimum : _root.timeCircleMinimum + maximum : _root.timeCircleMaximum + progressValue : _root.timeCircleProgressValue + timeTextValue : _root.timeCircleTimeTextValue + thickness : _root.hasCheckList ? 1 : 2 + diameter : _root.hasCheckList ? Variables.progressCircleDiameterSmall : Variables.progressCircleDiameterNormal + timeTextPixelSize : _root.hasCheckList ? Fonts.fontPixelCirclProgressTimeSmall : Fonts.fontPixelCirclProgressTimeNormal + } + } + + Loader { id: _checkListLoader + active : _root.hasCheckList + anchors.top : _root.hasTimeCircle ? _timeCircleLoader.bottom : undefined + anchors.topMargin : _root.hasTimeCircle ? 25 : 0 + anchors.horizontalCenter: _root.horizontalCenter + anchors.centerIn : ! _root.hasTimeCircle ? parent : undefined + width : Variables.checkListViewItemWidth + height : Variables.checkListViewItemHeight * _root.checkListStepNames.length + sourceComponent : CheckListView { id: _checkListView + completeVisible : _root.isComplete + completeText : _root.completeText + stepNames : _root.checkListStepNames + completeMargin : _root.checkListCompleteMargin + } + } + + // ^^^^^^^^^^^^^^^^^^^^ Optional Components ^^^^^^^^^^^^^^^^^^^^ // + + Footer { id: _footer } + + NotificationBar { id: _notification + iconVisible: false + } + + Connections { target: vSettings + onSettingsChanged : { + if ( instructionBased ) { + var group = vSettings.groupFormat.arg(header.stepNames[stackStepIndex]).arg(title.text) + // DEBUG : console.debug(" 00000 ", group) + if ( vSettings.settings[group] !== undefined ) { + _root.instructionlocation = vSettings.settings[group].location + _root.instructionStepNames = vSettings.settings[group].keys + _root.instructionStepImages = vSettings.settings[group].values + } + } + } + } + + onVisibleChanged: { + if (checkList) + checkList.resetItems() + if (instruction) + instruction.currentStepIndex = 0 + _notification.text = "" + if (visible) { + _mainMenu.hidden = true + } + } +} Index: sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml =================================================================== diff -u --- sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml (revision 0) +++ sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml (revision 98581b325c24eb5ef0ce0ce475ad15320d659140) @@ -0,0 +1,136 @@ +/*! + * + * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file PostTreatmentMainStack.qml + * \author (last) Behrouz NematiPour + * \date (last) 12-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 12-Apr-2021 + * + */ + +// Qt +import QtQuick 2.12 + +// Project +// Qml imports +import "qrc:/globals" +import "qrc:/components" +import "qrc:/pages/posttreatment" +/*! + * \brief the post treatment prime stack screen + */ +StackItem { id: _root + objectName: "_PostTreatmentStack" + + stackView.initialItem : null + + signal patientDisconnectionConfirm () + signal treatmentReviewConfirm () + signal disposablesRemovalConfirm () + signal disinfectionSkip () + signal disinfectionHeatClicked () + signal disinfectionChemicalClicked () + signal disinfectionChemicalTest () + + PostTreatmentBase { id: _patientDisconnectionConfirm + property int stackStepIndex : 0 + header.confirmVisible : true + title.text : qsTr("Patient Disconnection") + instructionBased : true + onConfirmClicked : _root.patientDisconnectionConfirm() + } + + PostTreatmentBase { id: _treatmentReviewConfirm + property int stackStepIndex : 1 + header.confirmVisible : true + title.text : qsTr("Treatment Review") + instructionBased : false + onConfirmClicked : _root.treatmentReviewConfirm() + } + + PostTreatmentBase { id: _disposablesRemovalConfirm + property int stackStepIndex : 2 + header.confirmVisible : true + title.text : qsTr("Disposables Removal") + instructionBased : true + onConfirmClicked : _root.disposablesRemovalConfirm() + } + + PostTreatmentBase { id: _disinfection + property int stackStepIndex : 3 + header.confirmVisible : true + header.confirmText.text : qsTr("SKIP") + title.text : qsTr("Disinfection") + footer.childrenWidth : 350 + footer.children: [ + TouchRect { + text.text: qsTr("Heat Disinfection") + onClicked: _root.disinfectionHeatClicked() + }, + TouchRect { + text.text: qsTr("Chemical Disinfection") + onClicked: _root.disinfectionChemicalClicked() + } + ] + onConfirmClicked : _root.disinfectionSkip() + } + + PostTreatmentBase { id: _disinfectionHeat + property int stackStepIndex : 3 + title.text : qsTr("Heat Disinfection") + hasTimeCircle : true + } + + PostTreatmentBase { id: _disinfectionChemicalInstruction + property int stackStepIndex : 3 + header.confirmVisible : true + header.confirmText.text : qsTr("_TEST_") + title.text : qsTr("Chemical Disinfection") + instructionBased : true + onConfirmClicked : _root.disinfectionChemicalTest() + } + + PostTreatmentBase { id: _disinfectionChemicalProgress + property int stackStepIndex : 3 + title.text : qsTr("Chemical Disinfection") + hasTimeCircle : true + } + + PostTreatmentBase { id: _flush + property int stackStepIndex : 3 + title.text : qsTr("Flush") + hasTimeCircle : true + } + + Connections { target: vPostTreatmentStates + onPatientDisconnectionChanged : { console.debug("patientDisconnection", vpatientDisconnection )} + onDrainReservoirsChanged : { console.debug("drainReservoirs ", vdrainReservoirs )} + onVerifyChanged : { console.debug("verify ", vverify )} + } + + Connections { target: vHDOperationMode + onPostTreatmentChanged : { page( _patientDisconnectionConfirm , vpostTreatment )} + } + + onPatientDisconnectionConfirm : { page( _treatmentReviewConfirm )} + onTreatmentReviewConfirm : { page( _disposablesRemovalConfirm )} + onDisposablesRemovalConfirm : { page( _disinfection )} + onDisinfectionHeatClicked : { page( _disinfectionHeat )} + onDisinfectionChemicalClicked : { page( _disinfectionChemicalInstruction )} + onDisinfectionChemicalTest : { page( _disinfectionChemicalProgress )} + onDisinfectionSkip : { page( _flush )} + + onVisibleChanged: { + if (visible) { + _mainMenu.hidden = true + } + else { + stackView.initialItem = null + } + } +} Index: sources/gui/qml/pages/pretreatment/PreTreatmentWaterSampleStack.qml =================================================================== diff -u -rf5498e2cd91de9d120b591a36f871db2e2b80fa7 -r98581b325c24eb5ef0ce0ce475ad15320d659140 --- sources/gui/qml/pages/pretreatment/PreTreatmentWaterSampleStack.qml (.../PreTreatmentWaterSampleStack.qml) (revision f5498e2cd91de9d120b591a36f871db2e2b80fa7) +++ sources/gui/qml/pages/pretreatment/PreTreatmentWaterSampleStack.qml (.../PreTreatmentWaterSampleStack.qml) (revision 98581b325c24eb5ef0ce0ce475ad15320d659140) @@ -55,7 +55,6 @@ instructionBased : true footer.children: [ TouchRect { - width: parent.splits text.text: qsTr("WATER SAMPLE") onPressed : _root.samplePressed () onReleased : _root.sampleReleased() @@ -69,12 +68,10 @@ instructionBased : true footer.children: [ TouchRect { - width: parent.splits text.text: qsTr("FAIL") onClicked: _root.failClicked() }, TouchRect { - width: parent.splits text.text: qsTr("PASS") isDefault: true onClicked: _root.passClicked() @@ -87,7 +84,6 @@ instructionBased : true footer.children: [ TouchRect { - width: parent.spacing text.text: qsTr("OK") onClicked: _root.okClicked() } Index: sources/model/hd/adjustment/posttreatment/MPostTreatmentAdjustTreatmentLogResponse.h =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r98581b325c24eb5ef0ce0ce475ad15320d659140 --- sources/model/hd/adjustment/posttreatment/MPostTreatmentAdjustTreatmentLogResponse.h (.../MPostTreatmentAdjustTreatmentLogResponse.h) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/model/hd/adjustment/posttreatment/MPostTreatmentAdjustTreatmentLogResponse.h (.../MPostTreatmentAdjustTreatmentLogResponse.h) (revision 98581b325c24eb5ef0ce0ce475ad15320d659140) @@ -38,7 +38,7 @@ * | || * | # 1:(U32) | \ref Data::mAccepted | | * | # 2:(U32) | \ref Data::mReason | | - * | # 3:(U32) | \ref Data::mBloodFlowRate | | + * | # 3:(U32) | \ref Data::mBloodFlowRate | (mL/min) | * | # 4:(U32) | \ref Data::mDialysateFlowRate | (mL/min) | * | # 5:(U32) | \ref Data::mTreatmentDuration | (min) | * | # 6:(U32) | \ref Data::mActualTreatmentDuration | (min) | Index: sources/storage/Settings.cpp =================================================================== diff -u -r94fc1cd187816ecbf176df26f9dc5601bf379f13 -r98581b325c24eb5ef0ce0ce475ad15320d659140 --- sources/storage/Settings.cpp (.../Settings.cpp) (revision 94fc1cd187816ecbf176df26f9dc5601bf379f13) +++ sources/storage/Settings.cpp (.../Settings.cpp) (revision 98581b325c24eb5ef0ce0ce475ad15320d659140) @@ -47,10 +47,22 @@ QStringList fileFilter = QStringList() << QString("*.%1").arg(_settingsExt); QFileInfoList settingFiles = FileHandler::find (Storage::Settings_Path_Name, fileFilter); QStringList settingFolders = FileHandler::subFolders(Storage::Settings_Path_Name); + + if ( ! settingFolders.count() ) { + LOG_DEBUG(QObject::tr("No setting folder in the %1").arg(Storage::Settings_Path_Name)); + return 1; // TODO : Define an error enum when completed + } + for ( QString &settingFolder : settingFolders ) { QString folder = settingFolder.prepend(Storage::Settings_Path_Name); settingFiles += FileHandler::find(folder, fileFilter); } + + if ( ! settingFolders.count() ) { + LOG_DEBUG(QObject::tr("No setting files in the %1").arg(Storage::Settings_Path_Name)); + return 2; // TODO : Define an error enum when completed + } + for (const auto &settingFile: settingFiles) { if (! isValid(settingFile.absoluteFilePath())) continue; @@ -74,6 +86,7 @@ QString value = keyValue[1].trimmed(); QString location= settingFile.absolutePath() + "/"; _SettingModel.add(group, key, QVariant(value), location); + // DEBUG: qDebug() << group << key << value; } } }