From 88ccbfecb4e9db7194c6fdb08f0d52a01c77b1b7 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Fri, 10 Apr 2015 20:06:52 -0700 Subject: [PATCH] Convert to VehicleSummaryRow --- .../PX4/SensorsComponentSummary.qml | 48 ++++++------------- .../PX4/SensorsComponentSummaryFixedWing.qml | 6 +-- 2 files changed, 18 insertions(+), 36 deletions(-) diff --git a/src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml b/src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml index 56b53115f..3fabc547a 100644 --- a/src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml +++ b/src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml @@ -6,47 +6,29 @@ import QGroundControl.FactSystem 1.0 import QGroundControl.Controls 1.0 /* - IMPORTANT NOTE: Any changes made here must also be made to SensorsComponentSummaryFixedWing.qml + IMPORTANT NOTE: Any changes made here must also be made to SensorsComponentSummary.qml */ Column { - anchors.fill: parent - anchors.margins: 8 + Fact { id: mag0IdFact; name: "CAL_MAG0_ID" } + Fact { id: gyro0IdFact; name: "CAL_GYRO0_ID" } + Fact { id: accel0IdFact; name: "CAL_ACC0_ID" } - Component { - id: component + anchors.fill: parent + anchors.margins: 8 - Row { - width: parent.width - - QGCLabel { id: label; text: labelText } - QGCLabel { - property Fact fact: Fact { name: factName } - horizontalAlignment: Text.AlignRight; - width: parent.width - label.contentWidth; - text: fact.value == 0 ? "Setup required" : "Ready" - } - } - } - - Loader { - property string labelText: "Compass:" - property string factName: "CAL_MAG0_ID" - width: parent.width - sourceComponent: component + VehicleSummaryRow { + labelText: "Compass:" + valueText: mag0IdFact.value == 0 ? "Setup required" : "Ready" } - Loader { - property string labelText: "Gyro:" - property string factName: "CAL_GYRO0_ID" - width: parent.width - sourceComponent: component + VehicleSummaryRow { + labelText: "Gyro:" + valueText: gyro0IdFact.value == 0 ? "Setup required" : "Ready" } - Loader { - property string labelText: "Accelerometer:" - property string factName: "CAL_ACC0_ID" - width: parent.width - sourceComponent: component + VehicleSummaryRow { + labelText: "Accelerometer:" + valueText: accel0IdFact.value == 0 ? "Setup required" : "Ready" } } diff --git a/src/AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.qml b/src/AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.qml index 7211124ca..770508674 100644 --- a/src/AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.qml +++ b/src/AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.qml @@ -23,17 +23,17 @@ Column { valueText: mag0IdFact.value == 0 ? "Setup required" : "Ready" } - Row { + VehicleSummaryRow { labelText: "Gyro:" valueText: gyro0IdFact.value == 0 ? "Setup required" : "Ready" } - Row { + VehicleSummaryRow { labelText: "Accelerometer:" valueText: accel0IdFact.value == 0 ? "Setup required" : "Ready" } - Row { + VehicleSummaryRow { labelText: "Airspeed:" valueText: dPressOffFact.value == 0 ? "Setup required" : "Ready" } -- 2.22.0