Index: sources/gui/qml/pages/ManagerHome.qml =================================================================== diff -u -red5d989264015440d9da6d0830679394a323cf55 -r06d10ee1174f0947a01087554f3da3109b47aef6 --- sources/gui/qml/pages/ManagerHome.qml (.../ManagerHome.qml) (revision ed5d989264015440d9da6d0830679394a323cf55) +++ sources/gui/qml/pages/ManagerHome.qml (.../ManagerHome.qml) (revision 06d10ee1174f0947a01087554f3da3109b47aef6) @@ -17,7 +17,8 @@ import QtQuick 2.12 // Project -import Gui.Actions 0.1; +import Gui.Actions 0.1; +import Gui.VEventSpy 0.1; // Qml imports import "qrc:/globals" @@ -29,296 +30,228 @@ */ ScreenItem { id: _root - Text { id : _titleText - visible: true - anchors { - top : parent.top - left : parent.horizontalCenter - topMargin : (Variables.headerHeight - Variables.logoHeight) / 2 - horizontalCenter: parent.horizontalCenter - } - text: qsTr("~ DG ~") - horizontalAlignment: Text.horizontalCenter - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle + function col(idx, gap = 10) { + return idx * 150 + gap } - Column { id: _DGROPumpColumn - width : 150 - spacing : -5 - topPadding : 75 - leftPadding : 50 - Text { - id: _DGROPump_Title - text: qsTr(" ROPmp ") - width: _DGROPumpColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - font.underline: true - } - Repeater { - model: [ - vDGROPump.pressure , - vDGROPump.flowRate .toFixed(2) , - vDGROPump.pwm .toFixed(2) - ] - Text { - objectName: "_DGROPumpData" + index - text: modelData - width: _DGROPumpColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - } - } + function row(idx, gap = 10) { + return idx * 100 + gap } + DebugDataColumn { id: _DGROPumpColumn + x: col(0) + y: row(0) + title: qsTr(" ROPmp ") + model: [ + vDGROPump.pressure , + vDGROPump.flowRate .toFixed(2) , + vDGROPump.pwm .toFixed(2) + ] + textObjectName: "_DGROPumpData" + } - Column { id: _DGPressuresColumn - width : 150 - spacing : -5 - topPadding : 75 - leftPadding : 250 - Text { - id: _DGPressures_Title - text: qsTr(" Prssr ") - width: _DGPressuresColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - font.underline: true - } - Repeater { - model: [ - vDGPressures.roInletPSI .toFixed(2) , - vDGPressures.roOutletPSI .toFixed(2) , - vDGPressures.drainInletPSI .toFixed(2) , - vDGPressures.drainOutletPSI .toFixed(2) - ] - Text { - objectName: "_DGPressuresData" + index - text: modelData - width: _DGPressuresColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - } - } + DebugDataColumn { id: _DGDrainPumpColumn + x: col(1) + y: row(0) + title: qsTr(" DRPmp ") + model: [ + vDGDrainPump.rpm , + vDGDrainPump.dac , + ] + textObjectName: "_DGDrainPumpData" } - Column { id: _DGReservoirColumn - width : 150 - spacing : -5 - topPadding : 75 - leftPadding : 450 - Text { - id: _DGReservoir_Title - text: qsTr(" Rsrvr ") - width: _DGReservoirColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - font.underline: true - } - Repeater { - model: [ - vDGReservoir.activeReservoir , - vDGReservoir.fillToVol , - vDGReservoir.drainToVol , - ] - Text { - objectName: "_DGReservoirData" + index - text: modelData - width: _DGReservoirColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - } - } + DebugDataColumn { id: _DGPressuresColumn + x: col(2) + y: row(0) + title: qsTr(" Prssr ") + model: [ + vDGPressures.roInletPSI .toFixed(2) , + vDGPressures.roOutletPSI .toFixed(2) , + vDGPressures.drainInletPSI .toFixed(2) , + vDGPressures.drainOutletPSI .toFixed(2) + ] + textObjectName: "_DGPressuresData" } - Column { id: _DGHeatersColumn - width : 150 - spacing : -5 - topPadding : 75 - leftPadding : 650 - Text { - id: _DGHeaters_Title - text: qsTr(" Heatrs ") - width: _DGHeatersColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - font.underline: true - } - Repeater { - model: [ - vDGHeaters.mainPrimaryDC , - vDGHeaters.smallPrimaryDC , - vDGHeaters.trimmerDC , - ] - Text { - objectName: "_DGHeatersData" + index - text: modelData - width: _DGHeatersColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - } - } + DebugDataColumn { id: _DGReservoirColumn + x: col(3) + y: row(0) + title: qsTr(" Rsrvr ") + model: [ + vDGReservoir.activeReservoir , + vDGReservoir.fillToVol , + vDGReservoir.drainToVol , + ] + textObjectName: "_DGReservoirData" } - Column { id: _LoadCellReadingsColumn - width : 150 - spacing : -5 - topPadding : 75 - leftPadding : 850 - Text { - id: _LoadCellReading_Title - text: qsTr(" LoadCl ") - width: _LoadCellReadingsColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - font.underline: true - } - Repeater { - model: [ - vDGLoadCellReadings.reservoir1Prim .toFixed(2) , - vDGLoadCellReadings.reservoir1Bkup .toFixed(2) , - vDGLoadCellReadings.reservoir2Prim .toFixed(2) , - vDGLoadCellReadings.reservoir2Bkup .toFixed(2) - ] - Text { - objectName: "_DGLoadCellReadingsData" + index - text: modelData - width: _LoadCellReadingsColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - } - } + DebugDataColumn { id: _DGHeatersColumn + x: col(4) + y: row(0) + title: qsTr(" Heatrs ") + model: [ + vDGHeaters.mainPrimaryDC , + vDGHeaters.smallPrimaryDC , + vDGHeaters.trimmerDC , + ] + textObjectName: "_DGHeatersData" } - Column { id: _DGTemperaturesColumn - width : 150 - spacing : -5 - topPadding : 75 - leftPadding : 1050 - Text { - id: _DGTemperatures_Title - text: qsTr(" Tmprtr ") - width: _DGTemperaturesColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - font.underline: true - } - Repeater { - model: [ - vDGTemperatures.inletPrimaryHeater .toFixed(2) , - vDGTemperatures.outletPrimaryHeater .toFixed(2) , - vDGTemperatures.conductivitySensor1 .toFixed(2) , - vDGTemperatures.conductivitySensor2 .toFixed(2) , - vDGTemperatures.outletRedundancy .toFixed(2) , - vDGTemperatures.inletDialysate .toFixed(2) , - vDGTemperatures.primaryHeaterThermoCouple .toFixed(2) , - vDGTemperatures.trimmerHeaterThermoCouple .toFixed(2) , - vDGTemperatures.primaryHeaterColdJunction .toFixed(2) , - vDGTemperatures.trimmerHeaterColdJunction .toFixed(2) , - vDGTemperatures.primaryHeaterInternal .toFixed(2) , - vDGTemperatures.trimmerHeaterInternal .toFixed(2) - ] - Text { - objectName: "_DGTemperaturesData" + index - text: modelData - width: _DGTemperaturesColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - } - } + DebugDataColumn { id: _LoadCellReadingsColumn + x: col(5) + y: row(0) + title: qsTr(" LoadCl ") + model: [ + vDGLoadCellReadings.reservoir1Prim .toFixed(2) , + vDGLoadCellReadings.reservoir1Bkup .toFixed(2) , + vDGLoadCellReadings.reservoir2Prim .toFixed(2) , + vDGLoadCellReadings.reservoir2Bkup .toFixed(2) + ] + textObjectName: "_DGLoadCellReadingsData" } - // Row 2 - Column { id: _DGDrainPumpColumn - width : 150 - spacing : -5 - topPadding : 375 - leftPadding : 50 - Text { - id: _DGDrainPump_Title - text: qsTr(" DrnPmp ") - width: _DGDrainPumpColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - font.underline: true - } - Repeater { - model: [ - vDGDrainPump.rpm , - vDGDrainPump.dac , - ] - Text { - objectName: "_DGDrainPumpData" + index - text: modelData - width: _DGDrainPumpColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - } - } + DebugDataColumn { id: _DGTemperaturesColumn + x: col(6) + y: row(0) + title: qsTr(" Tmprtr ") + model: [ + vDGTemperatures.inletPrimaryHeater .toFixed(2) , + vDGTemperatures.outletPrimaryHeater .toFixed(2) , + vDGTemperatures.conductivitySensor1 .toFixed(2) , + vDGTemperatures.conductivitySensor2 .toFixed(2) , + vDGTemperatures.outletRedundancy .toFixed(2) , + vDGTemperatures.inletDialysate .toFixed(2) , + vDGTemperatures.primaryHeaterThermoCouple .toFixed(2) , + vDGTemperatures.trimmerHeaterThermoCouple .toFixed(2) , + vDGTemperatures.primaryHeaterColdJunction .toFixed(2) , + vDGTemperatures.trimmerHeaterColdJunction .toFixed(2) , + vDGTemperatures.primaryHeaterInternal .toFixed(2) , + vDGTemperatures.trimmerHeaterInternal .toFixed(2) + ] + textObjectName: "_DGTemperaturesData" } - // Row 3 - Column { id: _DGValvesStatesColumn - width : 300 - spacing : -5 - topPadding : 575 - leftPadding : 50 - Text { - id: _DGValvesStates_Title - text: qsTr(" Valves ") - width: _DGValvesStatesColumn.width - horizontalAlignment: Text.AlignLeft - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - font.underline: true - } - Text { - objectName: "_DGValvesStatesData" - text: vDGValvesStates.text - width: _DGValvesStatesColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - } + // Next row + DebugDataColumn { id: _DGValvesStatesColumn + x: col(1) + y: row(2) + title: qsTr(" Valves ") + model: [ vDGValvesStates.text ] + textObjectName: "_DGValvesStatesData" } - Column { id: _DGOperationModeColumn - width : 300 - spacing : -5 - topPadding : 575 - leftPadding : 450 - Text { - id: _DGOperationMode_Title - text: qsTr(" Op Mode ") - width: _DGOperationModeColumn.width - horizontalAlignment: Text.AlignLeft - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - font.underline: true + DebugDataColumn { id: _DGOperationModeColumn + x: col(5) + y: row(2) + title: qsTr(" DG Mode ") + model: [ vDGOperationMode.text ] + textObjectName: "_DGOperationModeData" + } + + // --- HD --- + DebugDataColumn { id: _HDBloodFlowColumn + x: col(0) + y: row(3) + title: qsTr(" Blood ") + model: [ + vTreatmentBloodFlow.bloodFlow_FlowSetPoint , + vTreatmentBloodFlow.bloodFlow_MeasuredFlow .toFixed(2) , + vTreatmentBloodFlow.bloodFlow_RotorSpeed .toFixed(2) , + vTreatmentBloodFlow.bloodFlow_MotorSpeed .toFixed(2) , + vTreatmentBloodFlow.bloodFlow_MotorCtlSpeed .toFixed(2) , + vTreatmentBloodFlow.bloodFlow_MotorCtlCurrent .toFixed(2) , + "%" + vTreatmentBloodFlow.bloodFlow_PWMDutyCycle .toFixed(2) + ] + textObjectName: "_HDBloodFlowData" + } + + DebugDataColumn { id: _HDDialysateInletFlowColumn + x: col(1) + y: row(3) + title: qsTr(" Dlyst I ") + model: [ + vTreatmentDialysateFlow.dialysateFlow_FlowSetPoint .toFixed(2) , + vTreatmentDialysateFlow.dialysateFlow_MeasuredFlow .toFixed(2) , + vTreatmentDialysateFlow.dialysateFlow_RotorSpeed .toFixed(2) , + vTreatmentDialysateFlow.dialysateFlow_MotorSpeed .toFixed(2) , + vTreatmentDialysateFlow.dialysateFlow_MotorCtlSpeed .toFixed(2) , + vTreatmentDialysateFlow.dialysateFlow_MotorCtlCurrent.toFixed(2) , + "%" + vTreatmentDialysateFlow.dialysateFlow_PWMDutyCycle .toFixed(2) + ] + textObjectName: "_HDInletFlowData" + } + + DebugDataColumn { id: _HDDialysateOutletFlowColumn + x: col(2) + y: row(3) + title: qsTr(" Dlyst O ") + model: [ + vTreatmentUltrafiltration.ultrafiltration_RefUFVol .toFixed(2) , + vTreatmentUltrafiltration.ultrafiltration_MeasUFVol .toFixed(2) , + vTreatmentUltrafiltration.ultrafiltration_RotorSpeed .toFixed(2) , + vTreatmentUltrafiltration.ultrafiltration_MotorSpeed .toFixed(2) , + vTreatmentUltrafiltration.ultrafiltration_MotorCtlSpeed .toFixed(2) , + vTreatmentUltrafiltration.ultrafiltration_MotorCtlCurrent.toFixed(2) , + "%" + vTreatmentUltrafiltration.ultrafiltration_PWMDtCycle .toFixed(2) + ] + textObjectName: "_HDOutletFlowData" + } + + DebugDataColumn { id: _HDPressureOcclusionColumn + x: col(3) + y: row(3) + title: qsTr(" Prsr Oc ") + model: [ + vTreatmentPressureOcclusion.pressureocclusion_ArterialPressure .toFixed(2) , + vTreatmentPressureOcclusion.pressureocclusion_VenousPressure .toFixed(2) , + vTreatmentPressureOcclusion.pressureocclusion_BloodPumpOcclusion .toFixed(2) , + vTreatmentPressureOcclusion.pressureocclusion_DialysateInletPumpOcclusion .toFixed(2) , + vTreatmentPressureOcclusion.pressureocclusion_DialysateOutletPumpOcclusion .toFixed(2) + ] + textObjectName: "_PressureOcclusionData" + } + + DebugDataColumn { id: _HDOperationModeColumn + x: col(3) + y: row(2) + title: qsTr(" HD Mode ") + model: [ vHDOperationMode.text ] + textObjectName: "_HDOperationModeData" + } + + Text { id : _canbusFaultCountText + x: col(0) + y: row(6) + property int count: 0 + visible: true + text: qsTr("CAN Faults: %1").arg(count) + horizontalAlignment: Text.AlignLeft + color: Colors.textMain + font.pixelSize: 38 + } + + Text { id : _mouseEventCountText + x: col(2) + y: row(6) + visible: true + text: String("Touch Count: %1,%2") + .arg(GuiEventSpy.touchCount /*.toString().padStart(4,'0')*/ ) + .arg(GuiEventSpy.touchPoints /*.toString().padStart(4,'0')*/ ) + horizontalAlignment: Text.AlignLeft + color: Colors.textMain + font.pixelSize: 38 + MouseArea { + anchors.fill: _mouseEventCountText + onClicked: GuiEventSpy.doTouchReset() } - Text { - objectName: "_DGOperationModeData" - text: vDGOperationMode.text - width: _DGOperationModeColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - } } + Connections { target: _GuiView + onDidActionReceive: { + if (vAction === GuiActions.ID_CANBusFaultCount ) { + _canbusFaultCountText.count = vData[0] + } + } + } }