Index: sources/gui/GuiGlobals.h =================================================================== diff -u -r1f9e84f74ead9e10577c8caa204c6eb911e12ab8 -r41ba9331e6a540df0c8eced0c4d3b8684afa9afa --- sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 1f9e84f74ead9e10577c8caa204c6eb911e12ab8) +++ sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 41ba9331e6a540df0c8eced0c4d3b8684afa9afa) @@ -86,7 +86,7 @@ ID_HDPostFinalResultData = 0x8F00, // 143 ID_DGPostSingleResultData = 0x9000, // 144 ID_DGPostFinalResultData = 0x9100, // 145 - ID_UIPostFinalResultData = 0x9200, // 146 // ID_UIFinalResultTxr - UI Final Result response/Data transmit + ID_UIPostFinalResultData = 0x920F, // 146 //// ----- @CRAPIZED: had to change to avoid duplication ID_UIPostFinalResultHDReq = 0xB200, // 178 // ID_HDFinalResultRxq - HD Final Result request received // ----- Settings @@ -172,8 +172,8 @@ // Pre-Treatment SelfTest NoCartridge Progress Data ID_SelfTestNoCartridgeData = 0x6100, // 97 // there is no specific response message for this request and changing of the state in Pre_Treatment_States is used as the response // Pre-Treatment Disposables Installation Confirm - ID_AdjustDisposablesConfirmReq = 0x6200, // 98 // there is no specific response message for this request and changing of the state in Pre_Treatment_States is used as the response - ID_AdjustDisposablesConfirmRsp = 0xAD00, // 173 // there is no specific response message for this request and changing of the state in Pre_Treatment_States is used as the response + ID_AdjustDisposablesConfirmReq = 0x9200, // 146 // there is no specific response message for this request and changing of the state in Pre_Treatment_States is used as the response + ID_AdjustDisposablesConfirmRsp = 0x9300, // 147 // there is no specific response message for this request and changing of the state in Pre_Treatment_States is used as the response // Pre-Treatment SelfTest Dry Progress Data ID_SelfTestDryData = 0x630F, // 99 //// ----- @CRAPIZED: had to change to avoid duplication // Pre-Treatment Disposable Priming @@ -285,8 +285,8 @@ ID_AdjustPatientDisconnectConfirmRsp = 0x7E00, // 126 // Disposables Removal - ID_AdjustDisposablesRemovalConfirmReq = 0x7300, // 115 - ID_AdjustDisposablesRemovalConfirmRsp = 0x7400, // 116 + ID_AdjustDisposablesRemovalConfirmReq = 0x9400, // 148 + ID_AdjustDisposablesRemovalConfirmRsp = 0x9500, // 149 // Treatment Log Adjs ID_AdjustTreatmentLogReq = 0x7500, // 117 Index: sources/gui/qml/compounds/InstructionView.qml =================================================================== diff -u -rb59827b661a423b2b1ad2ca7b8611c2c0be7bd6a -r41ba9331e6a540df0c8eced0c4d3b8684afa9afa --- sources/gui/qml/compounds/InstructionView.qml (.../InstructionView.qml) (revision b59827b661a423b2b1ad2ca7b8611c2c0be7bd6a) +++ sources/gui/qml/compounds/InstructionView.qml (.../InstructionView.qml) (revision 41ba9331e6a540df0c8eced0c4d3b8684afa9afa) @@ -15,84 +15,107 @@ // Qt import QtQuick 2.12 -import QtQuick.Controls 2.12 // swipeview // Project // Qml imports import "qrc:/globals" import "qrc:/components" -/*! - * \brief Contains a back button as well - * as the current progress in each of the steps. - */ Rectangle { id: _root + property string title : "" + property var stepNames : [] + property var stepImages : [] + property int currentIndex : 0 + readonly property bool isEmpty : stepNames.length == 0 && stepImages.length == 0 - property string title : "" - property var stepNames : [] - property var stepImages : [] - - property int fontPixelMessage : 25 - property int fontPixelTitle : 20 - - readonly property bool isEmpty : stepNames.length == 0 && stepImages.length == 0 - - readonly property int outerRadius : Variables.dialogRadius * 2 - readonly property int innerRadius : Variables.dialogRadius - color : Colors.offWhite - radius : _root.outerRadius + radius : Variables.alarmDialogRadius Text { id: _title anchors { - left : parent.left - top : parent.top + left : parent.left + leftMargin : Variables.defaultMargin * 3 + top : parent.top + topMargin : Variables.defaultMargin * 2 } text : _root.title color : Colors.backgroundMainMenu - font.pixelSize : 20 + font.pixelSize : Fonts.fontPixelInstructionTitle font.weight : Font.Medium } - - Item { id: _containerSwipeView - clip : true // it has to be clipped although not performace friendly, otherwise the other pages will be partially shown. + Item { id: _instructionContainer anchors { right : _root.right - left : _root.left - top : _root.top + left : _title.left + top : _title.bottom bottom : _root.bottom } - Repeater { - model: _root.stepNames - Loader { id: _content - anchors.bottom: parent.bottom - active: SwipeView.isPreviousItem || SwipeView.isCurrentItem || SwipeView.isNextItem - sourceComponent: Item { + Column { id: _contentColumn + anchors.top : parent.top + anchors.topMargin : Variables.defaultMargin * 2 + spacing : 5 + width : parent.width * 2/3 + + Repeater { id: _instrutionSteps + model: _root.stepNames + + delegate: Item { id: _delegate + width : _contentColumn.width + height : Variables.instructionHeight + + Rectangle { id: _stepRect + anchors.left : parent.left + anchors.verticalCenter : parent.verticalCenter + + height : 50 + width : height + radius : height + color : Colors.backgroundMainMenu + + Text { id: _stepNumberRect + anchors.centerIn: parent + text : index + 1 + color : Colors.white + font.pixelSize : 28 + font.weight : Font.Medium + } + } + Text { id: _message - text : _root.stepNames.length ? _root.stepNames[index] : "" - color : Colors.textMain - width : parent.width - height : 65 - horizontalAlignment : Text.AlignHCenter - verticalAlignment : Text.AlignVCenter - font.pixelSize : _root.fontPixelMessage + anchors { + left : _stepRect.right + leftMargin : Variables.defaultMargin * 2 + right : parent.right + verticalCenter : parent.verticalCenter + } + text : _root.stepNames.length ? _root.stepNames[index] : "" + font.weight : index === _root.currentIndex ? Font.DemiBold : Font.Normal + color : index === _root.currentIndex ? "#18559E" : Colors.alarmDialogText + wrapMode : Text.WordWrap + font.pixelSize : Fonts.fontPixelInstructionStep } - Image { id: _image - source: _root.stepImages.length && _root.stepImages[index] ? _root.stepImages[index] : "" -// width : _innerFrame.width -// height : _innerFrame.height - anchors.top : parent.top - anchors.topMargin : 65 - anchors.horizontalCenter : parent.horizontalCenter - horizontalAlignment : Image.AlignHCenter - verticalAlignment : Image.AlignVCenter - fillMode : Image.PreserveAspectFit + + MouseArea { + anchors.fill: parent + onClicked: { + _root.currentIndex = index + } } } } } - } + Image { id: _image + anchors { + right : parent.right + rightMargin : Variables.defaultMargin * 2 + } + source : _root.stepImages.length && _root.stepImages[_root.currentIndex] ? _root.stepImages[_root.currentIndex] : "" + width : parent.width / 3 + height : parent.height + fillMode : Image.PreserveAspectFit + } + } } Index: sources/gui/qml/dialogs/NotificationDialog.qml =================================================================== diff -u -r16a8f25568b4636ebc31e76c86a8031940cc4ad7 -r41ba9331e6a540df0c8eced0c4d3b8684afa9afa --- sources/gui/qml/dialogs/NotificationDialog.qml (.../NotificationDialog.qml) (revision 16a8f25568b4636ebc31e76c86a8031940cc4ad7) +++ sources/gui/qml/dialogs/NotificationDialog.qml (.../NotificationDialog.qml) (revision 41ba9331e6a540df0c8eced0c4d3b8684afa9afa) @@ -165,7 +165,7 @@ delegate: Item { id: _delegateControl width : _listView.width - height : 73 + height : Variables.instructionHeight clip : true Rectangle { id: _stepRect Index: sources/gui/qml/globals/Fonts.qml =================================================================== diff -u -r1f9e84f74ead9e10577c8caa204c6eb911e12ab8 -r41ba9331e6a540df0c8eced0c4d3b8684afa9afa --- sources/gui/qml/globals/Fonts.qml (.../Fonts.qml) (revision 1f9e84f74ead9e10577c8caa204c6eb911e12ab8) +++ sources/gui/qml/globals/Fonts.qml (.../Fonts.qml) (revision 41ba9331e6a540df0c8eced0c4d3b8684afa9afa) @@ -99,6 +99,9 @@ readonly property int fontPixelContainerTitleSmall : 22 readonly property int fontPixelContainerUnitSmall : 15 + readonly property int fontPixelInstructionTitle : 45 + readonly property int fontPixelInstructionStep : 30 + readonly property int fontPixelDebugTitle : 25 readonly property int fontPixelDebugText : 32 readonly property int fontPixelDebugLabel : 20 Index: sources/gui/qml/globals/Variables.qml =================================================================== diff -u -r1f9e84f74ead9e10577c8caa204c6eb911e12ab8 -r41ba9331e6a540df0c8eced0c4d3b8684afa9afa --- sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision 1f9e84f74ead9e10577c8caa204c6eb911e12ab8) +++ sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision 41ba9331e6a540df0c8eced0c4d3b8684afa9afa) @@ -42,6 +42,8 @@ readonly property int mainMenuHeight : 80 //// ----- @LEAHIZED readonly property int alarmDialogHeaderHeight : 100 + readonly property int instructionHeight : 73 + readonly property int minVGap : 15 readonly property int minVGap2 : 30 Index: sources/gui/qml/pages/TreatmentFlowBase.qml =================================================================== diff -u -rb59827b661a423b2b1ad2ca7b8611c2c0be7bd6a -r41ba9331e6a540df0c8eced0c4d3b8684afa9afa --- sources/gui/qml/pages/TreatmentFlowBase.qml (.../TreatmentFlowBase.qml) (revision b59827b661a423b2b1ad2ca7b8611c2c0be7bd6a) +++ sources/gui/qml/pages/TreatmentFlowBase.qml (.../TreatmentFlowBase.qml) (revision 41ba9331e6a540df0c8eced0c4d3b8684afa9afa) @@ -55,7 +55,6 @@ property bool checkListTimeVisible : false property int checkListTimeSeconds : 0 - property string completeText : "" property bool isComplete : false @@ -69,6 +68,8 @@ onVisibleChanged: { if (checkList) checkList.resetItems() + if (instruction) + instruction.currentIndex = 0 _notification.text = "" if (visible) { _mainMenu.hidden = true @@ -192,5 +193,4 @@ } } } - } Index: sources/gui/qml/pages/posttreatment/PostTreatmentBase.qml =================================================================== diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -r41ba9331e6a540df0c8eced0c4d3b8684afa9afa --- sources/gui/qml/pages/posttreatment/PostTreatmentBase.qml (.../PostTreatmentBase.qml) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/gui/qml/pages/posttreatment/PostTreatmentBase.qml (.../PostTreatmentBase.qml) (revision 41ba9331e6a540df0c8eced0c4d3b8684afa9afa) @@ -30,7 +30,26 @@ header.stepNames: [ qsTr("Disconnection"), qsTr("Review" ), - qsTr("Disposables" ), qsTr("Disinfection" ), ] + + header.stepLineLength : 100 + + onVisibleChanged: { + if (visible) { + _root.updateModel(stackStepIndex) + } + } + + function updateModel (index) { + let group = _root.header.stepNames[index] + if ( group === undefined ) group = "" + let instructionsGroup = vSettings.instructions[group] + + if ( instructionsGroup !== undefined ) { + instructionTitle = instructionsGroup.title + instructionStepNames = instructionsGroup.keys + instructionStepImages = instructionsGroup.values + } + } } Index: sources/gui/qml/pages/pretreatment/PreTreatmentBase.qml =================================================================== diff -u -rb59827b661a423b2b1ad2ca7b8611c2c0be7bd6a -r41ba9331e6a540df0c8eced0c4d3b8684afa9afa --- sources/gui/qml/pages/pretreatment/PreTreatmentBase.qml (.../PreTreatmentBase.qml) (revision b59827b661a423b2b1ad2ca7b8611c2c0be7bd6a) +++ sources/gui/qml/pages/pretreatment/PreTreatmentBase.qml (.../PreTreatmentBase.qml) (revision 41ba9331e6a540df0c8eced0c4d3b8684afa9afa) @@ -27,16 +27,7 @@ */ TreatmentFlowBase { id: _root objectName: "_PreTreatmentBase" - header.stepNames: [ - qsTr("Installation" ), - qsTr("Self-Tests" ), - qsTr("Saline" ), - qsTr("Prime" ), - qsTr("Rx" ), - qsTr("UF" ), - qsTr("Connect" ), - ] - header.stepLineLength : 100 + header.visible : false onVisibleChanged: { if (visible) { @@ -45,18 +36,14 @@ } function updateModel (index) { - let group = _root.header.stepNames[index] + let group = stepNames[index] if ( group === undefined ) group = "" let instructionsGroup = vSettings.instructions[group] if ( instructionsGroup !== undefined ) { instructionTitle = instructionsGroup.title instructionStepNames = instructionsGroup.keys instructionStepImages = instructionsGroup.values - - print("instructionTitle " + instructionTitle) - print("instructionStepNames " + instructionStepNames) - print("instructionStepImages " + instructionStepImages) } } } Index: sources/gui/qml/pages/pretreatment/PreTreatmentInstallation.qml =================================================================== diff -u -rb59827b661a423b2b1ad2ca7b8611c2c0be7bd6a -r41ba9331e6a540df0c8eced0c4d3b8684afa9afa --- sources/gui/qml/pages/pretreatment/PreTreatmentInstallation.qml (.../PreTreatmentInstallation.qml) (revision b59827b661a423b2b1ad2ca7b8611c2c0be7bd6a) +++ sources/gui/qml/pages/pretreatment/PreTreatmentInstallation.qml (.../PreTreatmentInstallation.qml) (revision 41ba9331e6a540df0c8eced0c4d3b8684afa9afa) @@ -1,22 +1,10 @@ import QtQuick 2.15 PreTreatmentBase { id: _root - property int stackStepIndex : PreTreatmentStack.Installation - header.confirmVisible : true - header.backVisible : true + instructionBased: true - header.confirmText.text : qsTr("Auto-Load") - onConfirmClicked : page ( _pretreatmentCreate ) // TODO REQUEST FW - onBackClicked : vPreTreatmentAdjustmentInitTreatment.doCancel() // request standby - - Connections { target: vPreTreatmentAdjustmentDisposablesConfirm - function onAdjustmentTriggered ( vValue ) { - if ( vPreTreatmentAdjustmentDisposablesConfirm.adjustment_Accepted ) { - informationText = "" - } else { - informationText = vPreTreatmentAdjustmentDisposablesConfirm.text() - } - } + onVisibleChanged: { + if (visible) { stackStepIndex = PreTreatmentStack.Installation} } } Index: sources/gui/qml/pages/pretreatment/PreTreatmentStack.qml =================================================================== diff -u -rb59827b661a423b2b1ad2ca7b8611c2c0be7bd6a -r41ba9331e6a540df0c8eced0c4d3b8684afa9afa --- sources/gui/qml/pages/pretreatment/PreTreatmentStack.qml (.../PreTreatmentStack.qml) (revision b59827b661a423b2b1ad2ca7b8611c2c0be7bd6a) +++ sources/gui/qml/pages/pretreatment/PreTreatmentStack.qml (.../PreTreatmentStack.qml) (revision 41ba9331e6a540df0c8eced0c4d3b8684afa9afa) @@ -20,18 +20,16 @@ // Qml imports import "qrc:/globals" import "qrc:/components" +import "qrc:/compounds" import "qrc:/pages/pretreatment" -import "qrc:/pages/pretreatment/connection" import "qrc:/pages/pretreatment/create" /*! - * \brief the pre treatment prime stack screen + * \brief the pre treatment stack screen */ StackItem { id: _root - objectName: "_PreTreatmentStack" - stackView.initialItem : _pretreatmentInstallation - enum StackStepIndex { + enum StackStep { Installation , SelfTests , Saline , @@ -41,17 +39,130 @@ Connect } + property var stepNames: [ + qsTr("Installation" ), + qsTr("Self-Tests" ), + qsTr("Saline" ), + qsTr("Prime" ), + qsTr("Rx" ), + qsTr("UF" ), + qsTr("Connect" ), + ] + + property int stepLineLength : 100 + property int stackStepIndex : 0 + + onVisibleChanged: { + if (visible) { + _mainMenu.hidden = true + _headerBar.titleText = qsTr("Setup Treatment") + _root.stackStepIndex = 0 + } + else { + stackView.initialItem = null + _headerBar.titleText = "" + } + } + + function clear(vValue) { if ( ! vValue ) return; _pretreatmentCreate.clear(vValue) } + + function confirmClicked() { + switch ( _root.stackStepIndex ) { + case PreTreatmentStack.Installation: + page ( _pretreatmentCreate ) // TODO FIX ME IN PRE TREATMENT + break + case PreTreatmentStack.SelfTests: + break + case PreTreatmentStack.Saline: + break + case PreTreatmentStack.Prime: + break + case PreTreatmentStack.CreateRx: + _pretreatmentCreate.confirmButtonClicked() + break + case PreTreatmentStack.UF: + break + case PreTreatmentStack.Connect: + break + default: + break + } + } + + function backClicked() { + switch ( _root.stackStepIndex ) { + case PreTreatmentStack.Installation: + vPreTreatmentAdjustmentInitTreatment.doCancel() // request standby + break + case PreTreatmentStack.SelfTests: + break + case PreTreatmentStack.Saline: + break + case PreTreatmentStack.Prime: + break + case PreTreatmentStack.CreateRx: + page ( _pretreatmentInstallation ) // TODO FIX ME IN PRE TREATMENT + break + case PreTreatmentStack.UF: + break + case PreTreatmentStack.Connect: + break + default: + break + } + } + + function confirmButtonText() { + switch ( _root.stackStepIndex ) { + case PreTreatmentStack.Installation: + return qsTr("Auto-Load") + case PreTreatmentStack.CreateRx: + return vTreatmentCreate.parametersValidated ? qsTr("CONFIRM") : + qsTr("VALIDATE"); + default: + return qsTr("CONFIRM") + } + } + + StepNavigationTitleBar { id: _titleBar + stepIndex : _root.stackStepIndex + anchors { + top : _root.top + left : parent.left + right : parent.right + leftMargin : Variables.defaultMargin * 2 + rightMargin : anchors.leftMargin + } + confirmText.text: confirmButtonText() + confirmVisible : true + confirmEnabled : _root.stackStepIndex === PreTreatmentStack.CreateRx ? _pretreatmentCreate.confirmReady() : true + backVisible : _root.stackStepIndex === PreTreatmentStack.CreateRx ? ! vTreatmentCreate.parametersValidated : true + width : _root.width + stepNames : _root.stepNames + onBackClicked : _root.backClicked() + onConfirmClicked: _root.confirmClicked() + } + + // TODO in pre treatment story // PreTreatmentWaterSampleStack{ id: _preTreatmentWaterSampleStack ;objectName: "_preTreatmentWaterSampleStack" } // PreTreatmentConsumablesStack{ id: _preTreatmentConsumablesStack ;objectName: "_preTreatmentConsumablesStack" } // PreTreatmentPrimeStack { id: _pretreatmentPrimeStack ;objectName: "_pretreatmentPrimeStack" } // PreTreatmentConnectionStack { id: _pretreatmentConnectionStack ;objectName: "_pretreatmentConnectionStack " } PreTreatmentInstallation { id: _pretreatmentInstallation } + PreTreatmentCreate { id: _pretreatmentCreate } - PreTreatmentCreate { id: _pretreatmentCreate ; } + Connections { target: vPreTreatmentAdjustmentDisposablesConfirm + function onAdjustmentTriggered ( vValue ) { + if ( vPreTreatmentAdjustmentDisposablesConfirm.adjustment_Accepted ) { + _pretreatmentInstallation.informationText = "" + page ( _pretreatmentCreate ) // TODO fix in pre treatment.. Skip to create for now + } else { + _pretreatmentInstallation.informationText = vPreTreatmentAdjustmentDisposablesConfirm.text() + } + } + } - function clear(vValue) { if ( ! vValue ) return; _pretreatmentCreate.clear(vValue) } - - + // TODO in pre treatment story // Connections { target: vPreTreatmentStates // function onWaterSampleChanged ( vValue ) { page( _preTreatmentWaterSampleStack , vValue )} // function onSelfTestConsumablesChanged ( vValue ) { page( _preTreatmentConsumablesStack , vValue )} @@ -62,15 +173,4 @@ // function onRecirculateChanged ( vValue ) { page( _pretreatmentPrimeStack , vValue )} // DEBUG: Experimental : console.debug("vrecirculate " // function onPatientConnectionChanged ( vValue ) { page( _pretreatmentConnectionStack , vValue )} // } - - onVisibleChanged: { - if (visible) { - _mainMenu.hidden = true - _headerBar.titleText = qsTr("Setup Treatment") - } - else { - stackView.initialItem = null - _headerBar.titleText = "" - } - } } Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml =================================================================== diff -u -rb59827b661a423b2b1ad2ca7b8611c2c0be7bd6a -r41ba9331e6a540df0c8eced0c4d3b8684afa9afa --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision b59827b661a423b2b1ad2ca7b8611c2c0be7bd6a) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision 41ba9331e6a540df0c8eced0c4d3b8684afa9afa) @@ -28,18 +28,16 @@ */ PreTreatmentBase { id: _root objectName: "_PreTreatmentCreate" // SquishQt testability - property int stackStepIndex : PreTreatmentStack.CreateRx - header.confirmVisible : true - header.backVisible : ! vTreatmentCreate.parametersValidated - header.confirmEnabled : _preTreatmentCreateContent.confirmReady() - header.confirmText.text : vTreatmentCreate.parametersValidated ? qsTr("CONFIRM") : - qsTr("VALIDATE") - onConfirmClicked : vTreatmentCreate.parametersValidated ? _preTreatmentCreateContent.confirm() : - _preTreatmentCreateContent.validate() - onBackClicked : page ( _pretreatmentInstallation )// TODO FIX ME IN PRE TREATMENT - function clear( vValue ) { if ( ! vValue ) return; _preTreatmentCreateContent.clear() } + onVisibleChanged: { + if (visible) { stackStepIndex = PreTreatmentStack.CreateRx } + } + function clear( vValue ) { if ( ! vValue ) return; _preTreatmentCreateContent.clear() } + function confirmReady() { return _preTreatmentCreateContent.confirmReady() } + function confirmButtonClicked() { if (vTreatmentCreate.parametersValidated) { _preTreatmentCreateContent.confirm() } + else { _preTreatmentCreateContent.validate() }} + PreTreatmentCreateContent { id: _preTreatmentCreateContent anchors { top : _root.header.bottom