Index: sources/gui/qml/components/SliderCreateTreatment.qml =================================================================== diff -u -reae47411318bcf48addb424f3c2fedcd4d7b92f5 -r40c81d8364424610feeffeb5ac30e990105c8c00 --- sources/gui/qml/components/SliderCreateTreatment.qml (.../SliderCreateTreatment.qml) (revision eae47411318bcf48addb424f3c2fedcd4d7b92f5) +++ sources/gui/qml/components/SliderCreateTreatment.qml (.../SliderCreateTreatment.qml) (revision 40c81d8364424610feeffeb5ac30e990105c8c00) @@ -133,7 +133,7 @@ handlerColor : Colors.createTreatmentInactive handlerVisible : _root.adjustable // The slider is active by default if dryDemoMode is enables - isActive : _GuiView.dryDemoMode ? true : _root.active + isActive : _root.active ticks : true onDragged : { setInteractive(false) ; ; } onPressed : { setInteractive(false) ; _root.pressed () ; } Index: sources/gui/qml/dialogs/DryDemoDialog.qml =================================================================== diff -u --- sources/gui/qml/dialogs/DryDemoDialog.qml (revision 0) +++ sources/gui/qml/dialogs/DryDemoDialog.qml (revision 40c81d8364424610feeffeb5ac30e990105c8c00) @@ -0,0 +1,95 @@ +/*! + * + * Copyright (c) 2021-2024 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 DryDemoDialog.qml + * \author (last) Dara Navaei + * \date (last) 05-Mar-2024 + * \author (original) Behrouz NematiPour + * \date (original) 11-May-2021 + * + */ + +// Qt +import QtQuick 2.12 + +// Project +import Gui.Actions 0.1 +import Gui.VEventSpy 0.1 + +// Qml imports +import "qrc:/" +import "qrc:/globals" +import "qrc:/components" +import "qrc:/compounds" + + +/*! + * \brief DryDemo is the screen + */ +ModalDialog { id: _root + + width : 400 //Variables.applicationWidth + height : 700 //Variables.applicationHeight - 60 + //anchors.centerIn: undefined // TODO figure out the anchor right + + readonly property int rowCount : 12 + readonly property int colCount : itemsText.length > rowCount ? Math.ceil(itemsText.length / rowCount) : 1 + + property var itemsText : [ + qsTr("Standby" ), // 0: Standy + qsTr("Creat Treatment" ), // 1: Create Treatment + qsTr("Water Sample" ), // 2: Water sample + qsTr("Consumables" ), // 3: Consumables + qsTr("Disposables" ), // 4: Disposables + qsTr("System Prime" ), // 5: System prime + qsTr("BP/HR" ), // 6: BP/HR + qsTr("Ultrafiltration" ), // 7: Ultrafiltration + qsTr("Connection" ), // 8: Connection + qsTr("Start Treatment" ), // 9: Start treatment + qsTr("End Treatment" ), // 10: End treatment + qsTr("Disinfection" ), // 11: Disinfection + ] + + function col(idx, gap = 0) { + return idx * 155 + gap + } + + function row(idx, gap = 10) { + return idx * 100 + gap + } + + function itemClicked(vIndex) { + //console.log("Index", vIndex) // TODO for debugging purposes only + vConfirm.sendDryDemoCommand(vIndex) + } + + Connections { target: vConfirm + function onVisibleChanged ( vValue ) { + if ( vValue ) open () + else close () + } + } + + CloseButton { id : _closeButton + anchors.left : undefined + anchors.right : parent.right + anchors.top : parent.top + anchors.margins : 6 + onClicked : close() + } + + TouchGrid { id: _dryDemoItems + anchors.centerIn: parent + onItemClicked : _root.itemClicked(vIndex) + rowCount : _root.rowCount + colCount : _root.colCount + itemWidth : 325 + itemsText : _root.itemsText + rowSpacing : 0 + } +} + Index: sources/gui/qml/main.qml =================================================================== diff -u -r5687815256ae070a9a207107088e3f72dd464da0 -r40c81d8364424610feeffeb5ac30e990105c8c00 --- sources/gui/qml/main.qml (.../main.qml) (revision 5687815256ae070a9a207107088e3f72dd464da0) +++ sources/gui/qml/main.qml (.../main.qml) (revision 40c81d8364424610feeffeb5ac30e990105c8c00) @@ -394,11 +394,7 @@ // TODO: disable this later. this is only for diagnostic purpose. onDoubleClicked : { if ( _GuiView.dryDemoMode ) { - let dryDemoTempID = 99 - let id = vConfirm.id - vConfirm.id = dryDemoTempID - vConfirm.doConfirm( true ) - vConfirm.id = id + _dryDemoDialog.open() } else { _diagnosticsDialog.open() @@ -413,6 +409,7 @@ PowerItem { id: _powerItem ; z: 997 } ConfirmDialog { id: _confirmDialog ; z: 998 } DiagnosticsDialog { id: _diagnosticsDialog; z: 999 } + DryDemoDialog { id: _dryDemoDialog ; z: 999 } // Note: NotificationBar has to be anchored to the main menu and if it is moved into the AlarmItem // then cannot be anchored. Index: sources/gui/qml/pages/pretreatment/connection/PreTreatmentConnectionStack.qml =================================================================== diff -u -reae47411318bcf48addb424f3c2fedcd4d7b92f5 -r40c81d8364424610feeffeb5ac30e990105c8c00 --- sources/gui/qml/pages/pretreatment/connection/PreTreatmentConnectionStack.qml (.../PreTreatmentConnectionStack.qml) (revision eae47411318bcf48addb424f3c2fedcd4d7b92f5) +++ sources/gui/qml/pages/pretreatment/connection/PreTreatmentConnectionStack.qml (.../PreTreatmentConnectionStack.qml) (revision 40c81d8364424610feeffeb5ac30e990105c8c00) @@ -38,15 +38,13 @@ function clear() { _preTreatmentVitals .clear() _preTreatmentUltrafiltration.clear() - } PreTreatmentBase { id: _preTreatmentVitals // BP/HR Entry function update(vSystolic, vDiastolic ,vHeartRate) { _bphrEntry.systolic = vSystolic ? vSystolic : "" _bphrEntry.diastolic = vDiastolic ? vDiastolic : "" _bphrEntry.heartRate = vHeartRate ? vHeartRate : "" - } function clear() { @@ -135,6 +133,11 @@ instructionBased : true } + Connections { target: vConfirm + function onIsUltrafiltChanged ( vValue ) { page( _preTreatmentUltrafiltration , vValue )} + function onIsConnectionChanged ( vValue ) { page( _preTreatmentPatientConnection , vValue )} + } + Connections { target: vPreTreatmentStates function onPatientConnectionChanged ( vValue ) { page( _preTreatmentVitals , vValue )} } Index: sources/gui/qml/pages/pretreatment/connection/PreTreatmentUltrafiltration.qml =================================================================== diff -u -reae47411318bcf48addb424f3c2fedcd4d7b92f5 -r40c81d8364424610feeffeb5ac30e990105c8c00 --- sources/gui/qml/pages/pretreatment/connection/PreTreatmentUltrafiltration.qml (.../PreTreatmentUltrafiltration.qml) (revision eae47411318bcf48addb424f3c2fedcd4d7b92f5) +++ sources/gui/qml/pages/pretreatment/connection/PreTreatmentUltrafiltration.qml (.../PreTreatmentUltrafiltration.qml) (revision 40c81d8364424610feeffeb5ac30e990105c8c00) @@ -41,7 +41,7 @@ function clear() { _volumeSlider.reset ( _volumeSlider.defaultValue ) - _volumeSlider.isActive = false + _volumeSlider.isActive = _GuiView.dryDemoMode //false } function handleMinimum( vValue ) { Index: sources/view/confirm/VConfirm.cpp =================================================================== diff -u -r2ef03b2ce51b4dc507f66e9671953a8e0824bde9 -r40c81d8364424610feeffeb5ac30e990105c8c00 --- sources/view/confirm/VConfirm.cpp (.../VConfirm.cpp) (revision 2ef03b2ce51b4dc507f66e9671953a8e0824bde9) +++ sources/view/confirm/VConfirm.cpp (.../VConfirm.cpp) (revision 40c81d8364424610feeffeb5ac30e990105c8c00) @@ -93,6 +93,14 @@ id ( vData.mId ); } +void View::VConfirm::sendDryDemoCommand(quint32 vCommandID) +{ + DuetConfirmUIrData data; + data.mId = DRY_DEMO_COMMAND; + data.mConfirm = vCommandID; + emit didAdjustment(data); +} + /*! * \brief View::VConfirm::setPowerOffCommand */ @@ -125,6 +133,19 @@ id ( 0 ); } +void View::VConfirm::setDryDemoStatus(const DuetConfirmHDiData &vData) +{ + enum User_Command_ID { + CMD_ULTRAFILTRATION = 7, + CMD_CONNECTION = 8, + }; + + if ( ! gEnableDryDemo ) return; + qDebug() << "Dry Demo status" << vData.mId; + isUltrafilt (vData.mId == CMD_ULTRAFILTRATION); + isConnection(vData.mId == CMD_CONNECTION ); +} + /*! * \brief VConfirm::onActionReceive * \details received response model data handler @@ -136,6 +157,7 @@ setConfirmCommand ( vData ); setConfirmId ( vData ); + setDryDemoStatus ( vData ); // *** has to be the last to let the information to be set and then emit the signal *** // *** otherwise will use the Previous values before being set. *** Index: sources/view/confirm/VConfirm.h =================================================================== diff -u -r2ef03b2ce51b4dc507f66e9671953a8e0824bde9 -r40c81d8364424610feeffeb5ac30e990105c8c00 --- sources/view/confirm/VConfirm.h (.../VConfirm.h) (revision 2ef03b2ce51b4dc507f66e9671953a8e0824bde9) +++ sources/view/confirm/VConfirm.h (.../VConfirm.h) (revision 40c81d8364424610feeffeb5ac30e990105c8c00) @@ -69,6 +69,9 @@ PROPERTY(bool , isReject , 0) PROPERTY(bool , isAccept , 0) + PROPERTY(bool , isUltrafilt , 0) + PROPERTY(bool , isConnection , 0) + TRIGGER (bool , visible , 0) IDBASED (QString , title ,tr("Confirm" ), confirms, id) @@ -82,14 +85,16 @@ void setPowerOffCommand (); void setPowerOffId (); + void setDryDemoStatus (const DuetConfirmHDiData &vData); VIEW_DEC_CLASS (VConfirm ) VIEW_DEC_SLOT (DuetConfirmHDiData ) VIEW_DEC_SLOT (PowerOffData ) VIEW_DEC_SLOT (SettingsData ) public slots: - void doConfirm(bool vConfirm); + void doConfirm (bool vConfirm); + void sendDryDemoCommand (quint32 vCommandID); signals: /*! @@ -99,5 +104,7 @@ */ void didAdjustment(const DuetConfirmUIrData &vData); +private: + #define DRY_DEMO_COMMAND 99 }; }