Commit cdc27364 authored by Don Gagne's avatar Don Gagne

Use common control for summary rows

parent 146f52ce
...@@ -23,9 +23,11 @@ ...@@ -23,9 +23,11 @@
<file alias="QGroundControl/Controls/QGCComboBox.qml">src/QmlControls/QGCComboBox.qml</file> <file alias="QGroundControl/Controls/QGCComboBox.qml">src/QmlControls/QGCComboBox.qml</file>
<file alias="QGroundControl/Controls/QGCColoredImage.qml">src/QmlControls/QGCColoredImage.qml</file> <file alias="QGroundControl/Controls/QGCColoredImage.qml">src/QmlControls/QGCColoredImage.qml</file>
<file alias="QGroundControl/Controls/QGCToolBarButton.qml">src/QmlControls/QGCToolBarButton.qml</file> <file alias="QGroundControl/Controls/QGCToolBarButton.qml">src/QmlControls/QGCToolBarButton.qml</file>
<file alias="QGroundControl/Controls/SubMenuButton.qml">src/QmlControls/SubMenuButton.qml</file> <file alias="QGroundControl/Controls/SubMenuButton.qml">src/QmlControls/SubMenuButton.qml</file>
<file alias="QGroundControl/Controls/IndicatorButton.qml">src/QmlControls/IndicatorButton.qml</file> <file alias="QGroundControl/Controls/IndicatorButton.qml">src/QmlControls/IndicatorButton.qml</file>
<file alias="QGroundControl/Controls/VehicleRotationCal.qml">src/QmlControls/VehicleRotationCal.qml</file> <file alias="QGroundControl/Controls/VehicleRotationCal.qml">src/QmlControls/VehicleRotationCal.qml</file>
<file alias="QGroundControl/Controls/VehicleSummaryRow.qml">src/QmlControls/VehicleSummaryRow.qml</file>
<file alias="QGroundControl/Controls/arrow-down.png">src/QmlControls/arrow-down.png</file> <file alias="QGroundControl/Controls/arrow-down.png">src/QmlControls/arrow-down.png</file>
<file alias="SetupViewButtonsConnected.qml">src/VehicleSetup/SetupViewButtonsConnected.qml</file> <file alias="SetupViewButtonsConnected.qml">src/VehicleSetup/SetupViewButtonsConnected.qml</file>
......
...@@ -8,43 +8,28 @@ import QGroundControl.Controls 1.0 ...@@ -8,43 +8,28 @@ import QGroundControl.Controls 1.0
import QGroundControl.Controllers 1.0 import QGroundControl.Controllers 1.0
Column { Column {
Fact { id: sysIdFact; name: "MAV_SYS_ID" }
Fact { id: sysAutoStartFact; name: "SYS_AUTOSTART" }
property bool autoStartSet: sysAutoStartFact.value != 0
anchors.fill: parent anchors.fill: parent
anchors.margins: 8 anchors.margins: 8
AirframeComponentController { id: controller } AirframeComponentController { id: controller }
Row { VehicleSummaryRow {
width: parent.width labelText: "System ID:"
valueText: sysIdFact.valueString
QGCLabel { id: systemId; text: "System ID:" }
FactLabel {
horizontalAlignment: Text.AlignRight
width: parent.width - systemId.contentWidth
fact: Fact { name: "MAV_SYS_ID" }
}
} }
Row { VehicleSummaryRow {
width: parent.width labelText: "Airframe type:"
valueText: autoStartSet ? controller.currentAirframeType : "Setup required"
QGCLabel { id: airframeType; text: "Airframe type:" }
QGCLabel {
property Fact fact: Fact { name: "SYS_AUTOSTART" }
horizontalAlignment: Text.AlignRight
width: parent.width - airframeType.contentWidth
text: fact.value == 0 ? "Setup required" : controller.currentAirframeType
}
} }
Row { VehicleSummaryRow {
width: parent.width labelText: "Vehicle:"
valueText: autoStartSet ? controller.currentVehicleName : "Setup required"
QGCLabel { id: vehicle; text: "Vehicle:" }
QGCLabel {
property Fact fact: Fact { name: "SYS_AUTOSTART" }
horizontalAlignment: Text.AlignRight
width: parent.width - vehicle.contentWidth
text: fact.value == 0 ? "Setup required" : controller.currentVehicleName
}
} }
} }
...@@ -6,54 +6,31 @@ import QGroundControl.FactSystem 1.0 ...@@ -6,54 +6,31 @@ import QGroundControl.FactSystem 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
Column { Column {
anchors.fill: parent Fact { id: modeSwFact; name: "RC_MAP_MODE_SW" }
anchors.margins: 8 Fact { id: posCtlSwFact; name: "RC_MAP_POSCTL_SW" }
Fact { id: loiterSwFact; name: "RC_MAP_LOITER_SW" }
Fact { id: returnSwFact; name: "RC_MAP_RETURN_SW" }
Component { anchors.fill: parent
id: component anchors.margins: 8
Row { VehicleSummaryRow {
width: parent.width labelText: "Mode switch:"
valueText: modeSwFact.value == 0 ? "Setup required" : modeSwFact.valueString
QGCLabel { id: label; text: labelText }
QGCLabel {
property Fact fact: Fact { name: factName }
horizontalAlignment: Text.AlignRight
width: parent.width - label.contentWidth
text: fact.value == 0 ? zeroText : fact.value
}
}
}
Loader {
property string labelText: "Mode switch:"
property string zeroText: "Setup required"
property string factName: "RC_MAP_MODE_SW"
width: parent.width
sourceComponent: component
} }
Loader { VehicleSummaryRow {
property string labelText: "Position Ctl switch:" labelText: "Position Ctl switch:"
property string zeroText: "Disabled" valueText: posCtlSwFact.value == 0 ? "Disabled" : fact.valueString
property string factName: "RC_MAP_POSCTL_SW"
width: parent.width
sourceComponent: component
} }
Loader { VehicleSummaryRow {
property string labelText: "Position Ctl switch:" labelText: "Position Ctl switch:"
property string zeroText: "Disabled" valueText: loiterSwFact.value == 0 ? "Disabled" : fact.valueString
property string factName: "RC_MAP_LOITER_SW"
width: parent.width
sourceComponent: component
} }
Loader { VehicleSummaryRow {
property string labelText: "Return switch:" labelText: "Return switch:"
property string zeroText: "Disabled" valueText: returnSwFact.value == 0 ? "Disabled" : fact.valueString
property string factName: "RC_MAP_RETURN_SW"
width: parent.width
sourceComponent: component
} }
} }
...@@ -34,47 +34,25 @@ import QGroundControl.FactControls 1.0 ...@@ -34,47 +34,25 @@ import QGroundControl.FactControls 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
Column { Column {
anchors.fill: parent Fact { id: batVChargedFact; name: "BAT_V_CHARGED" }
anchors.margins: 8 Fact { id: batVEmptyFact; name: "BAT_V_EMPTY" }
Fact { id: batCellsFact; name: "BAT_N_CELLS" }
Row { anchors.fill: parent
width: parent.width anchors.margins: 8
QGCLabel { id: battFull; text: "Battery Full:" }
FactLabel {
fact: Fact { name: "BAT_V_CHARGED" }
horizontalAlignment: Text.AlignRight;
width: parent.width - battFull.contentWidth;
}
}
Row { VehicleSummaryRow {
width: parent.width labelText: "Battery Full:"
QGCLabel { id: battEmpty; text: "Battery Empty:" } valueText: batVChargedFact.valueString
FactLabel {
fact: Fact { name: "BAT_V_EMPTY" }
horizontalAlignment: Text.AlignRight;
width: parent.width - battEmpty.contentWidth;
}
} }
Row { VehicleSummaryRow {
width: parent.width labelText: "Battery Empty:"
QGCLabel { id: battCells; text: "Number of Cells:" } valueText: batVEmptyFact.valueString
FactLabel {
fact: Fact { name: "BAT_N_CELLS" }
horizontalAlignment: Text.AlignRight;
width: parent.width - battCells.contentWidth;
}
} }
Row { VehicleSummaryRow {
width: parent.width labelText: "Number of Cells:"
QGCLabel { id: battDrop; text: "Voltage Drop:" } valueText: batCellsFact.valueString
FactLabel {
fact: Fact { name: "BAT_V_LOAD_DROP" }
horizontalAlignment: Text.AlignRight;
width: parent.width - battDrop.contentWidth;
}
} }
} }
...@@ -6,78 +6,49 @@ import QGroundControl.FactSystem 1.0 ...@@ -6,78 +6,49 @@ import QGroundControl.FactSystem 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
Column { Column {
anchors.fill: parent Fact { id: mapRollFact; name: "RC_MAP_ROLL" }
anchors.margins: 8 Fact { id: mapPitchFact; name: "RC_MAP_PITCH" }
Fact { id: mapYawFact; name: "RC_MAP_YAW" }
Fact { id: mapThrottleFact; name: "RC_MAP_THROTTLE" }
Fact { id: mapFlapsFact; name: "RC_MAP_FLAPS" }
Fact { id: mapAux1Fact; name: "RC_MAP_AUX1" }
Fact { id: mapAux2Fact; name: "RC_MAP_AUX2" }
Component { anchors.fill: parent
id: component anchors.margins: 8
Row { VehicleSummaryRow {
width: parent.width labelText: "Roll:"
valueText: mapRollFact.value == 0 ? "Setup required" : mapRollFact.valueString
QGCLabel { id: label; text: labelText }
QGCLabel {
Fact { id: fact; name: factName }
horizontalAlignment: Text.AlignRight
width: parent.width - label.contentWidth
text: fact.value == 0 ? zeroText : fact.value
}
}
}
Loader {
property string labelText: "Roll:"
property string zeroText: "Setup required"
property string factName: "RC_MAP_ROLL"
width: parent.width
sourceComponent: component
} }
Loader { VehicleSummaryRow {
property string labelText: "Pitch:" labelText: "Pitch:"
property string zeroText: "Setup required" valueText: mapPitchFact.value == 0 ? "Setup required" : mapPitchFact.valueString
property string factName: "RC_MAP_PITCH"
width: parent.width
sourceComponent: component
} }
Loader { VehicleSummaryRow {
property string labelText: "Yaw:" labelText: "Yaw:"
property string zeroText: "Setup required" valueText: mapYawFact.value == 0 ? "Setup required" : mapYawFact.valueString
property string factName: "RC_MAP_YAW"
width: parent.width
sourceComponent: component
} }
Loader { VehicleSummaryRow {
property string labelText: "Throttle:" labelText: "Throttle:"
property string zeroText: "Setup required" valueText: mapThrottleFact.value == 0 ? "Setup required" : mapThrottleFact.valueString
property string factName: "RC_MAP_THROTTLE"
width: parent.width
sourceComponent: component
} }
Loader { VehicleSummaryRow {
property string labelText: "Flaps:" labelText: "Flaps:"
property string zeroText: "Disabled" valueText: mapFlapsFact.value == 0 ? "Disabled" : mapFlapsFact.valueString
property string factName: "RC_MAP_FLAPS"
width: parent.width
sourceComponent: component
} }
Loader { VehicleSummaryRow {
property string labelText: "Aux1:" labelText: "Aux1:"
property string zeroText: "Disabled" valueText: mapAux1Fact.value == 0 ? "Disabled" : mapAux1Fact.valueString
property string factName: "RC_MAP_AUX1"
width: parent.width
sourceComponent: component
} }
Loader { VehicleSummaryRow {
property string labelText: "Aux2:" labelText: "Aux2:"
property string zeroText: "Disabled" valueText: mapAux2Fact.value == 0 ? "Disabled" : mapAux2Fact.valueString
property string factName: "RC_MAP_AUX2"
width: parent.width
sourceComponent: component
} }
} }
...@@ -7,63 +7,37 @@ import QGroundControl.FactControls 1.0 ...@@ -7,63 +7,37 @@ import QGroundControl.FactControls 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
Column { Column {
anchors.fill: parent Fact { id: returnAltFact; name: "RTL_RETURN_ALT" }
anchors.margins: 8 Fact { id: descendAltFact; name: "RTL_DESCEND_ALT" }
Fact { id: landDelayFact; name: "RTL_LAND_DELAY" }
Row { Fact { id: commDLLossFact; name: "COM_DL_LOSS_EN" }
width: parent.width Fact { id: commRCLossFact; name: "COM_RC_LOSS_T" }
QGCLabel { id: rtlMinAlt; text: "RTL min alt:" } anchors.fill: parent
FactLabel { anchors.margins: 8
fact: Fact { name: "RTL_RETURN_ALT" }
horizontalAlignment: Text.AlignRight; VehicleSummaryRow {
width: parent.width - rtlMinAlt.contentWidth; labelText: "RTL min alt:"
} valueText: returnAltFact.valueString
} }
Row { VehicleSummaryRow {
width: parent.width labelText: "RTL home alt:"
valueText: descendAltFact.valueString
QGCLabel { id: rtlHomeAlt; text: "RTL home alt:" }
FactLabel {
fact: Fact { name: "RTL_DESCEND_ALT" }
horizontalAlignment: Text.AlignRight;
width: parent.width - rtlHomeAlt.contentWidth;
}
} }
Row { VehicleSummaryRow {
width: parent.width labelText: "RTL loiter delay:"
valueText: landDelayFact.value < 0 ? "Disabled" : landDelayFact.valueString
QGCLabel { id: rtlLoiter; text: "RTL loiter delay:" }
QGCLabel {
property Fact fact: Fact { name: "RTL_LAND_DELAY" }
horizontalAlignment: Text.AlignRight;
width: parent.width - rtlLoiter.contentWidth;
text: fact.value < 0 ? "Disabled" : fact.valueString
}
} }
Row { VehicleSummaryRow {
width: parent.width labelText: "Telemetry loss RTL:"
valueText: commDLLossFact.value != -1 ? "Disabled" : commDLLossFact.valueString
QGCLabel { id: commLoss; text: "Telemetry loss RTL:" }
QGCLabel {
property Fact fact: Fact { name: "COM_DL_LOSS_EN" }
horizontalAlignment: Text.AlignRight;
width: parent.width - commLoss.contentWidth;
text: fact.value != 1 ? "Disabled" : fact.valueString
}
} }
Row { VehicleSummaryRow {
width: parent.width labelText: "RC loss RTL (seconds):"
valueText: commRCLossFact.valueString
QGCLabel { id: rcLoss; text: "RC loss RTL (seconds):" }
FactLabel {
fact: Fact { name: "COM_RC_LOSS_T" }
horizontalAlignment: Text.AlignRight;
width: parent.width - rcLoss.contentWidth;
}
} }
} }
...@@ -10,54 +10,32 @@ import QGroundControl.Controls 1.0 ...@@ -10,54 +10,32 @@ import QGroundControl.Controls 1.0
*/ */
Column { Column {
anchors.fill: parent Fact { id: mag0IdFact; name: "CAL_MAG0_ID" }
anchors.margins: 8 Fact { id: gyro0IdFact; name: "CAL_GYRO0_ID" }
Fact { id: accel0IdFact; name: "CAL_ACC0_ID" }
Fact { id: dPressOffFact; name: "SENS_DPRES_OFF" }
Row { anchors.fill: parent
width: parent.width anchors.margins: 8
QGCLabel { id: compass; text: "Compass:" } VehicleSummaryRow {
QGCLabel { labelText: "Compass:"
property Fact fact: Fact { name: "CAL_MAG0_ID" } valueText: mag0IdFact.value == 0 ? "Setup required" : "Ready"
horizontalAlignment: Text.AlignRight;
width: parent.width - compass.contentWidth;
text: fact.value == 0 ? "Setup required" : "Ready"
} }
} }
Row { Row {
width: parent.width labelText: "Gyro:"
valueText: gyro0IdFact.value == 0 ? "Setup required" : "Ready"
QGCLabel { id: gyro; text: "Gyro:" }
QGCLabel {
property Fact fact: Fact { name: "CAL_GYRO0_ID" }
horizontalAlignment: Text.AlignRight;
width: parent.width - compass.contentWidth;
text: fact.value == 0 ? "Setup required" : "Ready"
}
} }
Row { Row {
width: parent.width labelText: "Accelerometer:"
valueText: accel0IdFact.value == 0 ? "Setup required" : "Ready"
QGCLabel { id: accel; text: "Accelerometer:" }
QGCLabel {
property Fact fact: Fact { name: "CAL_ACC0_ID" }
horizontalAlignment: Text.AlignRight;
width: parent.width - compass.contentWidth;
text: fact.value == 0 ? "Setup required" : "Ready"
}
} }
Row { Row {
width: parent.width labelText: "Airspeed:"
valueText: dPressOffFact.value == 0 ? "Setup required" : "Ready"
QGCLabel { id: airspeed; text: "Airspeed:" }
QGCLabel {
property Fact fact: Fact { name: "SENS_DPRES_OFF" }
horizontalAlignment: Text.AlignRight;
width: parent.width - airspeed.contentWidth;
text: fact.value == 0.0 ? "Setup required" : "Ready"
}
} }
} }
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
Row {
property string labelText: "Label"
property string valueText: "value"
width: parent.width
QGCLabel {
id: label
text: labelText
}
QGCLabel {
width: parent.width - label.contentWidth
text: valueText
horizontalAlignment: Text.AlignRight;
}
}
...@@ -12,4 +12,5 @@ QGCToolBarButton 1.0 QGCToolBarButton.qml ...@@ -12,4 +12,5 @@ QGCToolBarButton 1.0 QGCToolBarButton.qml
SubMenuButton 1.0 SubMenuButton.qml SubMenuButton 1.0 SubMenuButton.qml
IndicatorButton 1.0 IndicatorButton.qml IndicatorButton 1.0 IndicatorButton.qml
VehicleRotationCal 1.0 VehicleRotationCal.qml VehicleRotationCal 1.0 VehicleRotationCal.qml
VehicleSummaryRow 1.0 VehicleSummaryRow.qml
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment