Index: sources/gui/qml/pages/treatment/TreatmentStack.qml =================================================================== diff -u -r57ea732311e6f4c746974f5a52316f63dec23ca8 -rbf9223700613ced6c377f3e3a7b4de8367c30474 --- sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 57ea732311e6f4c746974f5a52316f63dec23ca8) +++ sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision bf9223700613ced6c377f3e3a7b4de8367c30474) @@ -33,11 +33,12 @@ objectName: "TreatmentStack" onVisibleChanged : { // this should never happen by design, but in tests it can easily happen and will block the screen touch. - _treatmentAdjustmentFlow .close() - _vitalEntry .close( true ) // vQuit == true + _treatmentAdjustmentSetPoints .close() + _treatmentAdjustmentVitals .close() _treatmentAdjustmentPressuresLimits .close() + _treatmentAdjustmentBolusVolume .close() _treatmentAdjustmentDuration .close() - _treatmentUltrafiltrationItem .close() + _treatmentAdjustmentUltrafiltration .close() if (! visible) { _headerBar.menuHidden = true @@ -46,148 +47,117 @@ stackView.initialItem : null - // ultrafiltration state information bar properties - readonly property bool isUFPaused : vTDTreatmentStates.ufPaused - readonly property bool isUFRunning : vTDTreatmentStates.ufRunning readonly property bool isTreatmentPaused : vTDTreatmentStates.txStop - - readonly property string ufInfoImageSource : isUFPaused ? "qrc:/images/iPauseGray" : "" - readonly property string ufInfoText : isUFPaused ? qsTr("Ultrafiltration Paused" ) : "" - readonly property string ufInfoTextColor : isUFPaused ? "gray" : "" - readonly property bool isSBInProgress : ( vTDTreatmentStates.sbRunning || vTDTreatmentStates.sbWaitPump ) + readonly property bool isTreatmentEnd : vTDTreatmentStates.txEnd + property int headerMenuIndex : _headerBar.headerMenuIndex - readonly property bool isDialogOpened : _treatmentAdjustmentFlow .visible - || _treatmentAdjustmentPressuresLimits .visible - || _treatmentAdjustmentDuration .visible - || _treatmentUltrafiltrationItem .visible - - property int headerMenuIndex: _headerBar.headerMenuIndex - onHeaderMenuIndexChanged: { - if ( _root.headerMenuIndex === 2) page(_treatmentHeparin) - if ( _root.headerMenuIndex === 1) page(_treatmentTrends) - if ( _root.headerMenuIndex === 0) pop(null) // unwind stack + switch( _headerBar.currentScreen ) { + case MainMenu.Treatment: + pop(null) // unwind stack back to main treatment + break + case MainMenu.Trends: + page( _treatmentTrends ) + break; + case MainMenu.Heparin: + page( _treatmentHeparin ) + break + case MainMenu.HDF: // TODO + page( _treatmentHDF ) + break + default: + pop(null) // unwind stack back to main treatment + break + } } // Components TreatmentBloodPrime { id: _treatmentBloodPrime } - TreatmentUltrafiltrationItem{ id: _treatmentUltrafiltrationItem } TreatmentHome { id: _treatmentHome } Connections { target: _treatmentHome function onSectionFlowClicked ( vValue ) { - _treatmentAdjustmentFlow.open() + _treatmentAdjustmentSetPoints.open() } function onSectionVitalsClicked ( vValue ) { - _vitalEntry.open() + _treatmentAdjustmentVitalsInterval.open() } function onSectionPressuresClicked ( vValue ) { _treatmentAdjustmentPressuresLimits.open() } + function onSectionSalineClicked ( vValue ) { + _treatmentAdjustmentBolusVolume.open() + } function onSectionTimeClicked ( vValue ) { - //DEBUG: console.log("time total minutes: " + vTreatmentTime.time_Total / 60 ) - _treatmentAdjustmentDuration.setDurationValue(vTreatmentTime.time_Total / 60) // minutes => hours _treatmentAdjustmentDuration.open() } function onSectionUltrafiltrationClicked ( vValue ) { - _treatmentUltrafiltrationItem.open() + _treatmentAdjustmentUltrafiltration.open() } } ScreenItem { id: _treatmentTrends } // TODO: make me! - ScreenItem { id: _treatmentHeparin } // TODO: make me! + TreatmentHeparin { id: _treatmentHeparin } + Connections { target: _treatmentHeparin + function onIdleTimeout ( ) { + _headerBar.headerMenuIndex = MainMenu.Treatment // on heparin idle timeout go to main treatment + } + } + ScreenItem { id: _treatmentHDF } // TODO: make me! + //// Treatment Adjustment Dialogs - TreatmentAdjustmentFlow { id: _treatmentAdjustmentFlow } - TreatmentAdjustmentPressuresLimits { id: _treatmentAdjustmentPressuresLimits } + TreatmentAdjustmentSetPoints { id: _treatmentAdjustmentSetPoints } + TreatmentAdjustmentPressuresLimits { id: _treatmentAdjustmentPressuresLimits } + TreatmentAdjustmentBolusVolume { id: _treatmentAdjustmentBolusVolume } + TreatmentAdjustmentUltrafiltration { id: _treatmentAdjustmentUltrafiltration } - Connections { target: _treatmentAdjustmentFlow - function onConfirmClicked ( vValue ) { vTreatmentAdjustmentFlows.doAdjustment( - _treatmentAdjustmentFlow.bloodFlowRateValue , - _treatmentAdjustmentFlow.dialysateFlowRateValue ) + Connections { target: _treatmentAdjustmentSetPoints + function onConfirmClicked ( vValue ) { + vTreatmentAdjustmentSetPoints.doAdjustment( + _treatmentAdjustmentSetPoints.bloodFlowRate , + _treatmentAdjustmentSetPoints.dialysateFlowRate , + _treatmentAdjustmentSetPoints.dialysateTemperature , + _treatmentAdjustmentSetPoints.acidConcentrate , + _treatmentAdjustmentSetPoints.bicarbConcentrate + ) } } Connections { target: _treatmentAdjustmentPressuresLimits - function onConfirmClicked ( vValue ) { vTreatmentAdjustmentPressuresLimits.doAdjustment( - _treatmentAdjustmentPressuresLimits.arterialPressureLimitWindow , - _treatmentAdjustmentPressuresLimits.venousPressureLimitWindow , - _treatmentAdjustmentPressuresLimits.venousPressureLimitAsymtrc ) + function onConfirmClicked ( vValue ) { + vTreatmentAdjustmentPressuresLimits.doAdjustment( + _treatmentAdjustmentPressuresLimits.arterialPressureLimitWindow , + _treatmentAdjustmentPressuresLimits.venousPressureLimitWindow , + _treatmentAdjustmentPressuresLimits.venousPressureLimitAsymtrc , + _treatmentAdjustmentPressuresLimits.tmpLimitWindow + ) } } - - TreatmentAdjustmentDuration { id: _treatmentAdjustmentDuration } - Connections { target: _treatmentAdjustmentDuration - function onConfirmClicked ( vValue ) { vTreatmentAdjustmentDuration.doAdjustment( - _treatmentAdjustmentDuration.durationValue ) + Connections { target: _treatmentAdjustmentBolusVolume + function onConfirmClicked ( vValue ) { + vTreatmentAdjustmentBolusVolume.doAdjustment(_treatmentAdjustmentBolusVolume.fluidBolusVolume) } } - EntryDialog { id: _vitalEntry - function update(vSystolic, vDiastolic ,vHeartRate) { - _bphrEntry.systolic = vSystolic ? vSystolic : "" - _bphrEntry.diastolic = vDiastolic ? vDiastolic : "" - _bphrEntry.heartRate = vHeartRate ? vHeartRate : "" - } + TreatmentAdjustmentDuration { id: _treatmentAdjustmentDuration } - titleText : qsTr("VITALS") - confirmEnabled : _bphrEntry.isValid - onConfirmClicked : { - _vitalEntry.close() - vTreatmentVitals.doConfirm( - _bphrEntry.systolic , - _bphrEntry.diastolic , - _bphrEntry.heartRate - ) - _treatmentHome.logVitalTime() - } + TreatmentAdjustmentVitalsInterval { id: _treatmentAdjustmentVitalsInterval } - onCloseClicked : { - vTreatmentVitals.doSkip() // only for logging - } - - onOpened : vTreatmentVitals.doTimerStop() // Can't be moved to C++, and has to be handled here because it can manually being opened by the user - - onClosed : (vQuit) => { - if ( ! vQuit ) - vTreatmentVitals.doTimerStart() - } - - BPHREntry { id : _bphrEntry - contentRectHeight : _vitalEntry.contentRect.height - } - - Connections { target: vTreatmentVitals - function onDidTrigger ( vSystolic, vDiastolic, vHeartRate ) { - if ( vTreatmentVitals.enableDialog ) { - _vitalEntry.update ( vSystolic, vDiastolic, vHeartRate ) - _vitalEntry.open () - } - } - } - } - // ---------- Manages Responses ---------- - Connections { target: vTreatmentAdjustmentDuration + Connections { target: vTreatmentAdjustmentBolusVolume function onAdjustmentTriggered ( vValue ) { - if ( vTreatmentAdjustmentDuration.adjustment_Accepted ) { - vTreatmentUltrafiltration.maximum = vTreatmentAdjustmentDuration.ultrafiltration - _treatmentAdjustmentDuration.accept() - } else { - _treatmentAdjustmentDuration.setDurationValue(vTreatmentAdjustmentDuration.duration); - _treatmentAdjustmentDuration.notification.text = vTreatmentAdjustmentDuration.text(); + if ( vTreatmentAdjustmentBolusVolume.adjustment_Accepted ) { + _treatmentAdjustmentBolusVolume.close() } + else { + _treatmentAdjustmentBolusVolume.notification.text = vTreatmentAdjustmentBolusVolume.text() + } } } Connections { target: vTreatmentAdjustmentPressuresLimits function onAdjustmentTriggered ( vValue ) { - // values have to be update even when rejected HD is reverting back the values. - // if accepted will be updated for later [may need refresh later] - _treatmentAdjustmentPressuresLimits.arterialPressureLimitWindow = vTreatmentAdjustmentPressuresLimits.arterialPressureLimitWindow - _treatmentAdjustmentPressuresLimits.venousPressureLimitWindow = vTreatmentAdjustmentPressuresLimits.venousPressureLimitWindow - _treatmentAdjustmentPressuresLimits.venousPressureLimitAsymtrc = vTreatmentAdjustmentPressuresLimits.venousPressureLimitAsymtrc - if (vTreatmentAdjustmentPressuresLimits.adjustment_Accepted) { _treatmentAdjustmentPressuresLimits.close() } @@ -197,6 +167,17 @@ } } + Connections { target: vTreatmentAdjustmentSetPoints + function onAdjustmentTriggered ( vValue ) { + if (vTreatmentAdjustmentSetPoints.adjustment_Accepted) { + _treatmentAdjustmentSetPoints.close() + } + else { + _treatmentAdjustmentSetPoints.notification.text = vTreatmentAdjustmentSetPoints.text() + } + } + } + Connections { target: vTDOpMode // The initail screen should be the Blood Prime, since that one is the earlier state in the list. // also since it is being used in two stacks In-Treatment and also in End-Treatmet is has been defined in the MainStack. @@ -213,11 +194,12 @@ Connections { target: vTDTreatmentStates // in-Treatmet - function onTxBloodPrimeChanged ( vValue ) { page( _treatmentBloodPrime , vValue )} - function onTxDialysisChanged ( vValue ) { page( _treatmentHome , vValue )} + function onTxBloodPrimeChanged ( vValue ) { page( _treatmentBloodPrime , vValue )} + function onTxDialysisChanged ( vValue ) { page( _treatmentHome , vValue )} + function onTxEndChanged ( vValue ) { if ( vValue ) { _endTreatmentDialog.open() }} } Connections { target: _mainHome - function onStartTreatment ( vValue ) { page( _treatmentHome )} + function onStartTreatment ( vValue ) { page( _treatmentHome )} } }