Index: sources/gui/qml/pages/treatment/TreatmentStack.qml =================================================================== diff -u -rbf9223700613ced6c377f3e3a7b4de8367c30474 -rb12cc2840bb819c5222bfd3bc2cc5ca6eb4c37fd --- sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision bf9223700613ced6c377f3e3a7b4de8367c30474) +++ sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision b12cc2840bb819c5222bfd3bc2cc5ca6eb4c37fd) @@ -21,6 +21,7 @@ import "qrc:/compounds" import "qrc:/dialogs" import "qrc:/globals" +import "qrc:/pages/endtreatment" import "qrc:/pages/treatment/adjustments" /*! @@ -40,12 +41,16 @@ _treatmentAdjustmentDuration .close() _treatmentAdjustmentUltrafiltration .close() - if (! visible) { + if (visible) { + _headerBar.activeStack = stackView + } + else { _headerBar.menuHidden = true + stackView.initialItem = null } } - stackView.initialItem : null + stackView.initialItem : _treatmentHome readonly property bool isTreatmentPaused : vTDTreatmentStates.txStop readonly property bool isSBInProgress : ( vTDTreatmentStates.sbRunning || vTDTreatmentStates.sbWaitPump ) @@ -54,16 +59,16 @@ onHeaderMenuIndexChanged: { switch( _headerBar.currentScreen ) { - case MainMenu.Treatment: + case HeaderBar.Treatment: pop(null) // unwind stack back to main treatment break - case MainMenu.Trends: + case HeaderBar.Trends: page( _treatmentTrends ) break; - case MainMenu.Heparin: + case HeaderBar.Heparin: page( _treatmentHeparin ) break - case MainMenu.HDF: // TODO + case HeaderBar.HDF: // TODO page( _treatmentHDF ) break default: @@ -73,9 +78,31 @@ } // Components - TreatmentBloodPrime { id: _treatmentBloodPrime } - TreatmentHome { id: _treatmentHome } + TreatmentBloodPrime { id: _treatmentBloodPrime + onIncrementRate : function(newValue) { vTreatmentAdjustmentBloodFlowRate.doAdjustment(newValue) } + onDecrementRate : function(newValue) { vTreatmentAdjustmentBloodFlowRate.doAdjustment(newValue) } + onPause : { vTreatmentAdjustmentBloodPrime.doPause() } + onResume : { vTreatmentAdjustmentBloodPrime.doResume() } + } + TreatmentHome { id: _treatmentHome } + TreatmentTrends { id: _treatmentTrends } + TreatmentHeparin { id: _treatmentHeparin } + TreatmentHDF { id: _treatmentHDF } + + // End Treatment + EndTreatmentRinsebackStack { id: _endTreatmentRinsebackStack } + EndTreatmentRecirculateStack { id: _endTreatmentRecirculateStack } + + //// Treatment Adjustment Dialogs + TreatmentAdjustmentSetPoints { id: _treatmentAdjustmentSetPoints } + TreatmentAdjustmentPressuresLimits { id: _treatmentAdjustmentPressuresLimits } + TreatmentAdjustmentBolusVolume { id: _treatmentAdjustmentBolusVolume } + TreatmentAdjustmentUltrafiltrationStack { id: _treatmentAdjustmentUltrafiltration } + TreatmentAdjustmentHDF { id: _treatmentAdjustmentHDF } + TreatmentAdjustmentDurationStack { id: _treatmentAdjustmentDuration } + TreatmentAdjustmentVitalsInterval { id: _treatmentAdjustmentVitalsInterval } + Connections { target: _treatmentHome function onSectionFlowClicked ( vValue ) { _treatmentAdjustmentSetPoints.open() @@ -97,33 +124,40 @@ } } - ScreenItem { id: _treatmentTrends } // TODO: make me! - TreatmentHeparin { id: _treatmentHeparin } Connections { target: _treatmentHeparin function onIdleTimeout ( ) { - _headerBar.headerMenuIndex = MainMenu.Treatment // on heparin idle timeout go to main treatment + _headerBar.headerMenuIndex = HeaderBar.Treatment // on heparin idle timeout go to main treatment } } - ScreenItem { id: _treatmentHDF } // TODO: make me! + Connections { target: _treatmentHDF + function onSectionPressuresClicked ( ) { + _treatmentAdjustmentPressuresLimits.open() + } - //// Treatment Adjustment Dialogs - TreatmentAdjustmentSetPoints { id: _treatmentAdjustmentSetPoints } - TreatmentAdjustmentPressuresLimits { id: _treatmentAdjustmentPressuresLimits } - TreatmentAdjustmentBolusVolume { id: _treatmentAdjustmentBolusVolume } - TreatmentAdjustmentUltrafiltration { id: _treatmentAdjustmentUltrafiltration } + function onTreatmentHDFEditClicked ( ) { + _treatmentAdjustmentHDF.open() + } + } + Connections { target: _treatmentAdjustmentSetPoints function onConfirmClicked ( vValue ) { vTreatmentAdjustmentSetPoints.doAdjustment( _treatmentAdjustmentSetPoints.bloodFlowRate , _treatmentAdjustmentSetPoints.dialysateFlowRate , _treatmentAdjustmentSetPoints.dialysateTemperature , _treatmentAdjustmentSetPoints.acidConcentrate , - _treatmentAdjustmentSetPoints.bicarbConcentrate + vTreatmentRanges.acidConcentrateModel.get(_treatmentAdjustmentSetPoints.acidConcentrate).value, + _treatmentAdjustmentSetPoints.bicarbConcentrate , + _treatmentAdjustmentSetPoints.treatmentModality , + _treatmentAdjustmentSetPoints.hepatitus , + _treatmentAdjustmentSetPoints.sodium , + _treatmentAdjustmentSetPoints.bicarbonate ) } } + Connections { target: _treatmentAdjustmentPressuresLimits function onConfirmClicked ( vValue ) { vTreatmentAdjustmentPressuresLimits.doAdjustment( @@ -134,16 +168,13 @@ ) } } + Connections { target: _treatmentAdjustmentBolusVolume function onConfirmClicked ( vValue ) { vTreatmentAdjustmentBolusVolume.doAdjustment(_treatmentAdjustmentBolusVolume.fluidBolusVolume) } } - TreatmentAdjustmentDuration { id: _treatmentAdjustmentDuration } - - TreatmentAdjustmentVitalsInterval { id: _treatmentAdjustmentVitalsInterval } - // ---------- Manages Responses ---------- Connections { target: vTreatmentAdjustmentBolusVolume function onAdjustmentTriggered ( vValue ) { @@ -159,7 +190,7 @@ Connections { target: vTreatmentAdjustmentPressuresLimits function onAdjustmentTriggered ( vValue ) { if (vTreatmentAdjustmentPressuresLimits.adjustment_Accepted) { - _treatmentAdjustmentPressuresLimits.close() + if ( _treatmentAdjustmentPressuresLimits.isValid ) { _treatmentAdjustmentPressuresLimits.close() } } else { _treatmentAdjustmentPressuresLimits.notification.text = vTreatmentAdjustmentPressuresLimits.text() @@ -170,36 +201,72 @@ Connections { target: vTreatmentAdjustmentSetPoints function onAdjustmentTriggered ( vValue ) { if (vTreatmentAdjustmentSetPoints.adjustment_Accepted) { - _treatmentAdjustmentSetPoints.close() + vTreatmentCreate.treatmentModality = _treatmentAdjustmentSetPoints.treatmentModality + vTreatmentCreate.acidConcentrate = _treatmentAdjustmentSetPoints.acidConcentrate + vTreatmentCreate.dryBicarbCartSize = _treatmentAdjustmentSetPoints.bicarbConcentrate + vTreatmentCreate.hepatitusBStatus = _treatmentAdjustmentSetPoints.hepatitus + vTreatmentCreate.sodium = _treatmentAdjustmentSetPoints.sodium + vTreatmentCreate.bicarbonate = _treatmentAdjustmentSetPoints.bicarbonate + if ( _treatmentAdjustmentSetPoints.isValid ) { _treatmentAdjustmentSetPoints.close() } } else { _treatmentAdjustmentSetPoints.notification.text = vTreatmentAdjustmentSetPoints.text() } } } + + Connections { target: vTreatmentAdjustmentVitalsAlarmLimits + function onAdjustmentTriggered ( vValue ) { + if (vTreatmentAdjustmentVitalsAlarmLimits.adjustment_Accepted) { + if ( _treatmentAdjustmentVitalsInterval.isValid ) { _treatmentAdjustmentVitalsInterval.close() } + } + else { + _treatmentAdjustmentVitalsInterval.notification.text = vTreatmentAdjustmentVitalsAlarmLimits.text() + } + } + } + + Connections { target: vTreatmentAdjustmentBloodPrime + function onAdjustmentTriggered ( vValue ) { + if (vTreatmentAdjustmentBloodPrime.adjustment_Accepted) { + _treatmentBloodPrime.notification.text = "" + } + else { + _treatmentBloodPrime.notification.text = vTreatmentAdjustmentBloodPrime.text() + } + } + } + + Connections { target: vTreatmentAdjustmentBloodFlowRate + function onAdjustmentTriggered ( vValue ) { + if (vTreatmentAdjustmentBloodPrime.adjustment_Accepted) { + _treatmentBloodPrime.notification.text = "" + } + else { + _treatmentBloodPrime.notification.text = vTreatmentAdjustmentBloodFlowRate.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. - function onInTreatmentChanged ( vValue ) { page( _treatmentBloodPrime , vValue )} - } - - Connections { target: _treatmentBloodPrime - function onVisibleChanged ( vValue ) { - if (_treatmentBloodPrime.visible) { - _headerBar.menuHidden = true + function onInTreatmentChanged ( vValue ) { + page( _treatmentBloodPrime , vValue ) + if (vValue) { + _treatmentTrends.isParamExpanded = true + vTreatmentTrends.doClearData() } } } Connections { target: vTDTreatmentStates // in-Treatmet - function onTxBloodPrimeChanged ( vValue ) { page( _treatmentBloodPrime , vValue )} - function onTxDialysisChanged ( vValue ) { page( _treatmentHome , vValue )} - function onTxEndChanged ( vValue ) { if ( vValue ) { _endTreatmentDialog.open() }} + function onTxBloodPrimeChanged ( vValue ) { page( _treatmentBloodPrime , vValue )} + function onTxDialysisChanged ( vValue ) { page( _treatmentHome , vValue )} + function onTxEndChanged ( vValue ) { if ( vValue ) { _endTreatmentDialog.open() }} + function onTxRinsebackChanged ( vValue ) { page( _endTreatmentRinsebackStack , vValue )} + function onTxRecirculateChanged ( vValue ) { page( _endTreatmentRecirculateStack , vValue )} } - - Connections { target: _mainHome - function onStartTreatment ( vValue ) { page( _treatmentHome )} - } }