5import QGroundControl.Controls
6import QGroundControl.FactControls
12 property var activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
13 property string na: qsTr("N/A", "No data to display")
14 property string valueNA: qsTr("–", "No data to display")
16 property var _escs: activeVehicle ? activeVehicle.escs : null
17 property int _onlineBitmask: _escs ? _escs.get(0).info.rawValue : 0
19 function _isMotorOnline(motorIndex) {
20 return (_onlineBitmask & (1 << motorIndex)) !== 0
23 function _isMotorHealthy(motorIndex) {
24 return _isMotorOnline(motorIndex) && _escs.get(motorIndex).failureFlags.rawValue === 0
27 contentComponent: Component {
29 spacing: ScreenTools.defaultFontPixelHeight / 4
32 heading: qsTr("ESC Status Overview")
35 Layout.fillWidth: true
37 rowSpacing: ScreenTools.defaultFontPixelHeight * 0.25
38 columnSpacing: ScreenTools.defaultFontPixelWidth * 2
41 Layout.fillWidth: true
42 label: qsTr("Healthy Motors")
45 for (let i = 0; i < _escs.count; i++) {
46 if (_isMotorHealthy(i)) healthyCount++
48 return healthyCount + "/" + _escs.count
53 Layout.fillWidth: true
54 label: qsTr("Total Errors")
57 for (let i = 0; i < _escs.count; i++) {
58 totalErrors += _escs.get(i).errorCount.rawValue
60 return totalErrors.toString()
70 heading: qsTr("Motor %1 %2").arg(object.id.rawValue + 1).arg( _isThisMotorHealthy ? "" : qsTr("- OFFLINE"))
71 headingPointSize: ScreenTools.defaultFontPointSize * ScreenTools.smallFontPointRatio
72 outerBorderColor: _isThisMotorHealthy ? QGroundControl.globalPalette.colorGreen : QGroundControl.globalPalette.colorRed
74 property bool _isThisMotorHealthy: _isMotorHealthy(index)
78 columnSpacing: ScreenTools.defaultFontPixelWidth * 2.5
79 flow: GridLayout.LeftToRight
88 labelText: (object.temperature !== 32767 ? object.temperature.valueString : na) + " " + object.temperature.units
92 label: qsTr("Voltage")
97 label: qsTr("Current")
102 label: qsTr("Errors")
103 fact: object.errorCount