From 3fdf1b88e3262a6141dac6791dfea4fb531b028e Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Fri, 25 Dec 2015 20:20:57 -0800 Subject: [PATCH] New Vehicle Summary format Takes less real estate and flows better and small displays --- .../APM/APMAirframeComponentSummary.qml | 42 +++-- .../APM/APMCameraComponentSummary.qml | 57 ++++--- .../APM/APMFlightModesComponentSummary.qml | 65 ++++---- .../APM/APMPowerComponentSummary.qml | 29 ++-- .../APM/APMRadioComponentSummary.qml | 59 ++++--- .../APM/APMSafetyComponentSummaryCopter.qml | 95 +++++------- .../APM/APMSafetyComponentSummaryPlane.qml | 58 ++++--- .../APM/APMSafetyComponentSummaryRover.qml | 1 - .../APM/APMSensorsComponentSummary.qml | 37 ++--- .../PX4/AirframeComponentSummary.qml | 48 +++--- .../PX4/FlightModesComponentSummary.qml | 58 ++++--- .../PX4/PX4RadioComponentSummary.qml | 68 ++++---- .../PX4/PowerComponentSummary.qml | 46 +++--- .../PX4/SafetyComponentSummary.qml | 66 ++++---- .../PX4/SensorsComponentSummary.qml | 51 +++--- src/VehicleSetup/VehicleSummary.qml | 145 ++++++------------ 16 files changed, 399 insertions(+), 526 deletions(-) diff --git a/src/AutoPilotPlugins/APM/APMAirframeComponentSummary.qml b/src/AutoPilotPlugins/APM/APMAirframeComponentSummary.qml index 3e697b1b1..f7bf543ae 100644 --- a/src/AutoPilotPlugins/APM/APMAirframeComponentSummary.qml +++ b/src/AutoPilotPlugins/APM/APMAirframeComponentSummary.qml @@ -1,18 +1,21 @@ -import QtQuick 2.2 +import QtQuick 2.5 import QtQuick.Controls 1.2 -import QGroundControl.FactSystem 1.0 -import QGroundControl.FactControls 1.0 -import QGroundControl.Controls 1.0 -import QGroundControl.Controllers 1.0 -import QGroundControl.Palette 1.0 +import QGroundControl.FactSystem 1.0 +import QGroundControl.FactControls 1.0 +import QGroundControl.Controls 1.0 +import QGroundControl.Controllers 1.0 +import QGroundControl.Palette 1.0 +import QGroundControl.ScreenTools 1.0 FactPanel { - id: panel - anchors.fill: parent - color: qgcPal.windowShadeDark + id: panel + width: grid.width + height: grid.height + color: qgcPal.windowShade QGCPalette { id: qgcPal; colorGroupEnabled: enabled } + APMAirframeComponentController { id: controller factPanel: panel @@ -20,20 +23,13 @@ FactPanel { property Fact sysIdFact: controller.getParameterFact(-1, "FRAME") + Grid { + id: grid + rows: 1 + columns: 2 + spacing: ScreenTools.defaultFontPixelWidth / 2 - Column { - anchors.fill: parent - anchors.margins: 8 - - VehicleSummaryRow { - id: nameRow; - labelText: "Frame Type:" - valueText: sysIdFact.valueString === "0" ? "Plus" - : sysIdFact.valueString === "1" ? "X" - : sysIdFact.valueString === "2" ? "V" - : sysIdFact.valueString == "3" ? "H" - :/* Fact.value == 10 */ "New Y6"; - - } + QGCLabel { text: "Frame Type:" } + QGCLabel { text: sysIdFact.enumStringValue } } } diff --git a/src/AutoPilotPlugins/APM/APMCameraComponentSummary.qml b/src/AutoPilotPlugins/APM/APMCameraComponentSummary.qml index 62ebfae01..c2b44806e 100644 --- a/src/AutoPilotPlugins/APM/APMCameraComponentSummary.qml +++ b/src/AutoPilotPlugins/APM/APMCameraComponentSummary.qml @@ -1,15 +1,18 @@ import QtQuick 2.5 import QtQuick.Controls 1.2 -import QGroundControl.FactSystem 1.0 -import QGroundControl.FactControls 1.0 -import QGroundControl.Controls 1.0 -import QGroundControl.Palette 1.0 +import QGroundControl.FactSystem 1.0 +import QGroundControl.FactControls 1.0 +import QGroundControl.Controls 1.0 +import QGroundControl.Controllers 1.0 +import QGroundControl.Palette 1.0 +import QGroundControl.ScreenTools 1.0 FactPanel { - id: panel - anchors.fill: parent - color: qgcPal.windowShadeDark + id: panel + width: grid.width + height: grid.height + color: qgcPal.windowShade QGCPalette { id: qgcPal; colorGroupEnabled: enabled } FactPanelController { id: controller; factPanel: panel } @@ -19,28 +22,22 @@ FactPanel { property Fact _mountRCInPan: controller.getParameterFact(-1, "MNT_RC_IN_PAN") property Fact _mountType: controller.getParameterFact(-1, "MNT_TYPE") - Column { - anchors.fill: parent - anchors.margins: 8 - - VehicleSummaryRow { - labelText: "Gimbal type:" - valueText: _mountType.enumStringValue - } - - VehicleSummaryRow { - labelText: "Tilt input channel:" - valueText: _mountRCInTilt.enumStringValue - } - - VehicleSummaryRow { - labelText: "Pan input channel:" - valueText: _mountRCInPan.enumStringValue - } - - VehicleSummaryRow { - labelText: "Roll input channel:" - valueText: _mountRCInRoll.enumStringValue - } + Grid { + id: grid + rows: 4 + columns: 2 + spacing: ScreenTools.defaultFontPixelWidth / 2 + + QGCLabel { text: "Gimbal type:" } + QGCLabel { text: _mountType.enumStringValue } + + QGCLabel { text: "Tilt input channel:" } + QGCLabel { text: _mountRCInTilt.enumStringValue } + + QGCLabel { text: "Pan input channel:" } + QGCLabel { text: _mountRCInPan.enumStringValue } + + QGCLabel { text: "Roll input channel:" } + QGCLabel { text: _mountRCInRoll.enumStringValue } } } diff --git a/src/AutoPilotPlugins/APM/APMFlightModesComponentSummary.qml b/src/AutoPilotPlugins/APM/APMFlightModesComponentSummary.qml index 4454fe064..0e42ff1be 100644 --- a/src/AutoPilotPlugins/APM/APMFlightModesComponentSummary.qml +++ b/src/AutoPilotPlugins/APM/APMFlightModesComponentSummary.qml @@ -4,12 +4,15 @@ import QtQuick.Controls 1.2 import QGroundControl.FactSystem 1.0 import QGroundControl.FactControls 1.0 import QGroundControl.Controls 1.0 +import QGroundControl.Controllers 1.0 import QGroundControl.Palette 1.0 +import QGroundControl.ScreenTools 1.0 FactPanel { - id: panel - anchors.fill: parent - color: qgcPal.windowShadeDark + id: panel + width: grid.width + height: grid.height + color: qgcPal.windowShade QGCPalette { id: qgcPal; colorGroupEnabled: enabled } FactPanelController { id: controller; factPanel: panel } @@ -21,38 +24,28 @@ FactPanel { property Fact flightMode5: controller.getParameterFact(-1, "FLTMODE5") property Fact flightMode6: controller.getParameterFact(-1, "FLTMODE6") - Column { - anchors.fill: parent - anchors.margins: 8 - - VehicleSummaryRow { - labelText: "Flight Mode 1:" - valueText: flightMode1.enumStringValue - } - - VehicleSummaryRow { - labelText: "Flight Mode 2:" - valueText: flightMode2.enumStringValue - } - - VehicleSummaryRow { - labelText: "Flight Mode 3:" - valueText: flightMode3.enumStringValue - } - - VehicleSummaryRow { - labelText: "Flight Mode 4:" - valueText: flightMode4.enumStringValue - } - - VehicleSummaryRow { - labelText: "Flight Mode 5:" - valueText: flightMode5.enumStringValue - } - - VehicleSummaryRow { - labelText: "Flight Mode 6:" - valueText: flightMode6.enumStringValue - } + Grid { + id: grid + rows: 6 + columns: 2 + spacing: ScreenTools.defaultFontPixelWidth / 2 + + QGCLabel { text: "Flight Mode 1:" } + QGCLabel { text: flightMode1.enumStringValue } + + QGCLabel { text: "Flight Mode 2:" } + QGCLabel { text: flightMode2.enumStringValue } + + QGCLabel { text: "Flight Mode 3:" } + QGCLabel { text: flightMode3.enumStringValue } + + QGCLabel { text: "Flight Mode 4:" } + QGCLabel { text: flightMode4.enumStringValue } + + QGCLabel { text: "Flight Mode 5:" } + QGCLabel { text: flightMode5.enumStringValue } + + QGCLabel { text: "Flight Mode 6:" } + QGCLabel { text: flightMode6.enumStringValue } } } diff --git a/src/AutoPilotPlugins/APM/APMPowerComponentSummary.qml b/src/AutoPilotPlugins/APM/APMPowerComponentSummary.qml index 2575a6d7b..f3bead9df 100644 --- a/src/AutoPilotPlugins/APM/APMPowerComponentSummary.qml +++ b/src/AutoPilotPlugins/APM/APMPowerComponentSummary.qml @@ -27,12 +27,15 @@ import QtQuick.Controls 1.2 import QGroundControl.FactSystem 1.0 import QGroundControl.FactControls 1.0 import QGroundControl.Controls 1.0 +import QGroundControl.Controllers 1.0 import QGroundControl.Palette 1.0 +import QGroundControl.ScreenTools 1.0 FactPanel { - id: panel - anchors.fill: parent - color: qgcPal.windowShadeDark + id: panel + width: grid.width + height: grid.height + color: qgcPal.windowShade QGCPalette { id: qgcPal; colorGroupEnabled: enabled } FactPanelController { id: controller; factPanel: panel } @@ -40,18 +43,16 @@ FactPanel { property Fact battCapacity: controller.getParameterFact(-1, "BATT_CAPACITY") property Fact battMonitor: controller.getParameterFact(-1, "BATT_MONITOR") - Column { - anchors.fill: parent - anchors.margins: 8 + Grid { + id: grid + rows: 2 + columns: 2 + spacing: ScreenTools.defaultFontPixelWidth / 2 - VehicleSummaryRow { - labelText: "Battery monitor:" - valueText: battMonitor.enumStringValue - } + QGCLabel { text: "Battery monitor:" } + QGCLabel { text: battMonitor.enumStringValue } - VehicleSummaryRow { - labelText: "Battery capacity:" - valueText: battCapacity.valueString - } + QGCLabel { text: "Battery capacity:" } + FactLabel { fact: battCapacity } } } diff --git a/src/AutoPilotPlugins/APM/APMRadioComponentSummary.qml b/src/AutoPilotPlugins/APM/APMRadioComponentSummary.qml index a41fa81d6..fa40c1083 100644 --- a/src/AutoPilotPlugins/APM/APMRadioComponentSummary.qml +++ b/src/AutoPilotPlugins/APM/APMRadioComponentSummary.qml @@ -1,15 +1,18 @@ -import QtQuick 2.2 +import QtQuick 2.5 import QtQuick.Controls 1.2 -import QGroundControl.FactSystem 1.0 -import QGroundControl.FactControls 1.0 -import QGroundControl.Controls 1.0 -import QGroundControl.Palette 1.0 +import QGroundControl.FactSystem 1.0 +import QGroundControl.FactControls 1.0 +import QGroundControl.Controls 1.0 +import QGroundControl.Controllers 1.0 +import QGroundControl.Palette 1.0 +import QGroundControl.ScreenTools 1.0 FactPanel { - id: panel - anchors.fill: parent - color: qgcPal.windowShadeDark + id: panel + width: grid.width + height: grid.height + color: qgcPal.windowShade QGCPalette { id: qgcPal; colorGroupEnabled: enabled } FactPanelController { id: controller; factPanel: panel } @@ -19,28 +22,22 @@ FactPanel { property Fact mapYawFact: controller.getParameterFact(-1, "RCMAP_YAW") property Fact mapThrottleFact: controller.getParameterFact(-1, "RCMAP_THROTTLE") - Column { - anchors.fill: parent - anchors.margins: 8 - - VehicleSummaryRow { - labelText: "Roll:" - valueText: mapRollFact.value == 0 ? "Setup required" : "Channel " + mapRollFact.valueString - } - - VehicleSummaryRow { - labelText: "Pitch:" - valueText: mapPitchFact.value == 0 ? "Setup required" : "Channel " + mapPitchFact.valueString - } - - VehicleSummaryRow { - labelText: "Yaw:" - valueText: mapYawFact.value == 0 ? "Setup required" : "Channel " + mapYawFact.valueString - } - - VehicleSummaryRow { - labelText: "Throttle:" - valueText: mapThrottleFact.value == 0 ? "Setup required" : "Channel " + mapThrottleFact.valueString - } + Grid { + id: grid + rows: 4 + columns: 2 + spacing: ScreenTools.defaultFontPixelWidth / 2 + + QGCLabel { text: "Roll:" } + QGCLabel { text: mapRollFact.value == 0 ? "Setup required" : "Channel " + mapRollFact.valueString } + + QGCLabel { text: "Pitch:" } + QGCLabel { text: mapPitchFact.value == 0 ? "Setup required" : "Channel " + mapPitchFact.valueString } + + QGCLabel { text: "Yaw:" } + QGCLabel { text: mapYawFact.value == 0 ? "Setup required" : "Channel " + mapYawFact.valueString } + + QGCLabel { text: "Throttle:" } + QGCLabel { text: mapThrottleFact.value == 0 ? "Setup required" : "Channel " + mapThrottleFact.valueString } } } diff --git a/src/AutoPilotPlugins/APM/APMSafetyComponentSummaryCopter.qml b/src/AutoPilotPlugins/APM/APMSafetyComponentSummaryCopter.qml index 0d2328082..c3d31eb29 100644 --- a/src/AutoPilotPlugins/APM/APMSafetyComponentSummaryCopter.qml +++ b/src/AutoPilotPlugins/APM/APMSafetyComponentSummaryCopter.qml @@ -1,15 +1,17 @@ -import QtQuick 2.2 +import QtQuick 2.5 import QtQuick.Controls 1.2 -import QGroundControl.FactSystem 1.0 -import QGroundControl.FactControls 1.0 -import QGroundControl.Controls 1.0 -import QGroundControl.Palette 1.0 +import QGroundControl.FactSystem 1.0 +import QGroundControl.FactControls 1.0 +import QGroundControl.Controls 1.0 +import QGroundControl.Palette 1.0 +import QGroundControl.ScreenTools 1.0 FactPanel { - id: panel - anchors.fill: parent - color: qgcPal.windowShadeDark + id: panel + width: grid.width + height: grid.height + color: qgcPal.windowShade QGCPalette { id: qgcPal; colorGroupEnabled: enabled } FactPanelController { id: controller; factPanel: panel } @@ -81,55 +83,42 @@ FactPanel { } } - Column { - anchors.fill: parent - anchors.margins: 8 - - VehicleSummaryRow { - labelText: "Throttle failsafe:" - valueText: _failsafeThrEnableText - } - - VehicleSummaryRow { - labelText: "Battery failsafe:" - valueText: _failsafeBattEnableText + Grid { + id: grid + rows: 8 + columns: 2 + spacing: ScreenTools.defaultFontPixelWidth / 2 + + QGCLabel { text: "Throttle failsafe:" } + QGCLabel { text: _failsafeThrEnableText } + + QGCLabel { text: "Battery failsafe:" } + QGCLabel { text: _failsafeBattEnableText } + + QGCLabel { text: "GeoFence:" } + QGCLabel { text: _fenceEnable.value == 0 || _fenceType == 0 ? + "Disabled" : + (_fenceType.value == 1 ? + "Altitude" : + (_fenceType.value == 2 ? "Circle" : "Altitude,Circle")) } + + QGCLabel { text: "GeoFence:"; visible: _fenceEnable.value != 0 } + QGCLabel { text: _fenceAction.value == 0 ? + "Report only" : + (_fenceAction.value == 1 ? "RTL or Land" : "Unknown") + visible: _fenceEnable.value != 0 } - VehicleSummaryRow { - labelText: "GeoFence:" - valueText: _fenceEnable.value == 0 || _fenceType == 0 ? - "Disabled" : - (_fenceType.value == 1 ? - "Altitude" : - (_fenceType.value == 2 ? "Circle" : "Altitude,Circle")) - } + QGCLabel { text: "RTL min alt:" } + QGCLabel { text: _rtlAltFact.value == 0 ? "current" : _rtlAltFact.valueString } - VehicleSummaryRow { - labelText: "GeoFence:" - valueText: _fenceAction.value == 0 ? - "Report only" : - (_fenceAction.value == 1 ? "RTL or Land" : "Unknown") - visible: _fenceEnable.value != 0 - } + QGCLabel { text: "RTL loiter time:" } + QGCLabel { text: _rtlLoitTimeFact.valueString } - VehicleSummaryRow { - labelText: "RTL min alt:" - valueText: _rtlAltFact.value == 0 ? "current" : _rtlAltFact.valueString - } + QGCLabel { text: "RTL final alt:" } + QGCLabel { text: _rtlAltFinalFact.value == 0 ? "Land" : _rtlAltFinalFact.valueString } - VehicleSummaryRow { - labelText: "RTL loiter time:" - valueText: _rtlLoitTimeFact.valueString - } - - VehicleSummaryRow { - labelText: "RTL final alt:" - valueText: _rtlAltFinalFact.value == 0 ? "Land" : _rtlAltFinalFact.valueString - } - - VehicleSummaryRow { - labelText: "Descent speed:" - valueText: _landSpeedFact.valueString - } + QGCLabel { text: "Descent speed:" } + QGCLabel { text: _landSpeedFact.valueString } } } diff --git a/src/AutoPilotPlugins/APM/APMSafetyComponentSummaryPlane.qml b/src/AutoPilotPlugins/APM/APMSafetyComponentSummaryPlane.qml index 260bc9817..88544a95d 100644 --- a/src/AutoPilotPlugins/APM/APMSafetyComponentSummaryPlane.qml +++ b/src/AutoPilotPlugins/APM/APMSafetyComponentSummaryPlane.qml @@ -1,15 +1,17 @@ -import QtQuick 2.2 +import QtQuick 2.5 import QtQuick.Controls 1.2 -import QGroundControl.FactSystem 1.0 -import QGroundControl.FactControls 1.0 -import QGroundControl.Controls 1.0 -import QGroundControl.Palette 1.0 +import QGroundControl.FactSystem 1.0 +import QGroundControl.FactControls 1.0 +import QGroundControl.Controls 1.0 +import QGroundControl.Palette 1.0 +import QGroundControl.ScreenTools 1.0 FactPanel { - id: panel - anchors.fill: parent - color: qgcPal.windowShadeDark + id: panel + width: grid.width + height: grid.height + color: qgcPal.windowShade QGCPalette { id: qgcPal; colorGroupEnabled: enabled } FactPanelController { id: controller; factPanel: panel } @@ -22,28 +24,22 @@ FactPanel { property Fact _rtlAltFact: controller.getParameterFact(-1, "ALT_HOLD_RTL") - Column { - anchors.fill: parent - anchors.margins: 8 - - VehicleSummaryRow { - labelText: "Throttle failsafe:" - valueText: _failsafeThrEnable.value != 0 ? _failsafeThrValue.valueString : "Disabled" - } - - VehicleSummaryRow { - labelText: "Voltage failsafe:" - valueText: _failsafeBattVoltage.value == 0 ? "Disabled" : _failsafeBattVoltage.valueString - } - - VehicleSummaryRow { - labelText: "mAh failsafe:" - valueText: _failsafeBattMah.value == 0 ? "Disabled" : _failsafeBattMah.valueString - } - - VehicleSummaryRow { - labelText: "RTL min alt:" - valueText: _rtlAltFact.value < 0 ? "current" : _rtlAltFact.valueString - } + Grid { + id: grid + rows: 4 + columns: 2 + spacing: ScreenTools.defaultFontPixelWidth / 2 + + QGCLabel { text: "Throttle failsafe:" } + QGCLabel { text: _failsafeThrEnable.value != 0 ? _failsafeThrValue.valueString : "Disabled" } + + QGCLabel { text: "Voltage failsafe:" } + QGCLabel { text: _failsafeBattVoltage.value == 0 ? "Disabled" : _failsafeBattVoltage.valueString } + + QGCLabel { text: "mAh failsafe:" } + QGCLabel { text: _failsafeBattMah.value == 0 ? "Disabled" : _failsafeBattMah.valueString } + + QGCLabel { text: "RTL min alt:" } + QGCLabel { text: _rtlAltFact.value < 0 ? "current" : _rtlAltFact.valueString } } } diff --git a/src/AutoPilotPlugins/APM/APMSafetyComponentSummaryRover.qml b/src/AutoPilotPlugins/APM/APMSafetyComponentSummaryRover.qml index ace3b3a1d..aec51fbb4 100644 --- a/src/AutoPilotPlugins/APM/APMSafetyComponentSummaryRover.qml +++ b/src/AutoPilotPlugins/APM/APMSafetyComponentSummaryRover.qml @@ -26,7 +26,6 @@ import QtQuick 2.5 import QGroundControl.Controls 1.0 QGCLabel { - anchors.fill: parent text: "Not supported" horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter diff --git a/src/AutoPilotPlugins/APM/APMSensorsComponentSummary.qml b/src/AutoPilotPlugins/APM/APMSensorsComponentSummary.qml index 75902f551..fcc70f8cd 100644 --- a/src/AutoPilotPlugins/APM/APMSensorsComponentSummary.qml +++ b/src/AutoPilotPlugins/APM/APMSensorsComponentSummary.qml @@ -1,21 +1,18 @@ -import QtQuick 2.5 -import QtQuick.Controls 1.2 -import QtQuick.Controls.Styles 1.2 +import QtQuick 2.5 +import QtQuick.Controls 1.2 import QGroundControl.FactSystem 1.0 import QGroundControl.FactControls 1.0 import QGroundControl.Controls 1.0 import QGroundControl.Palette 1.0 +import QGroundControl.ScreenTools 1.0 import QGroundControl.Controllers 1.0 -/* - IMPORTANT NOTE: Any changes made here must also be made to SensorsComponentSummary.qml -*/ - FactPanel { - id: panel - anchors.fill: parent - color: qgcPal.windowShadeDark + id: panel + width: grid.width + height: grid.height + color: qgcPal.windowShade QGCPalette { id: qgcPal; colorGroupEnabled: enabled } APMSensorsComponentController { id: controller; factPanel: panel } @@ -23,18 +20,16 @@ FactPanel { property bool accelCalNeeded: controller.accelSetupNeeded property bool compassCalNeeded: controller.compassSetupNeeded - Column { - anchors.fill: parent - anchors.margins: 8 + Grid { + id: grid + rows: 2 + columns: 2 + spacing: ScreenTools.defaultFontPixelWidth / 2 - VehicleSummaryRow { - labelText: "Compass:" - valueText: compassCalNeeded ? "Setup required" : "Ready" - } + QGCLabel { text: "Compass:" } + QGCLabel { text: compassCalNeeded ? "Setup required" : "Ready" } - VehicleSummaryRow { - labelText: "Accelerometer:" - valueText: accelCalNeeded ? "Setup required" : "Ready" - } + QGCLabel { text: "Accelerometer:" } + QGCLabel { text: accelCalNeeded ? "Setup required" : "Ready" } } } diff --git a/src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml b/src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml index 75dc76ddb..dedb7b97a 100644 --- a/src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml +++ b/src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml @@ -1,16 +1,18 @@ -import QtQuick 2.2 +import QtQuick 2.5 import QtQuick.Controls 1.2 -import QGroundControl.FactSystem 1.0 -import QGroundControl.FactControls 1.0 -import QGroundControl.Controls 1.0 -import QGroundControl.Controllers 1.0 -import QGroundControl.Palette 1.0 +import QGroundControl.FactSystem 1.0 +import QGroundControl.FactControls 1.0 +import QGroundControl.Controls 1.0 +import QGroundControl.Controllers 1.0 +import QGroundControl.Palette 1.0 +import QGroundControl.ScreenTools 1.0 FactPanel { - id: panel - anchors.fill: parent - color: qgcPal.windowShadeDark + id: panel + width: grid.width + height: grid.height + color: qgcPal.windowShade QGCPalette { id: qgcPal; colorGroupEnabled: enabled } AirframeComponentController { id: controller; factPanel: panel } @@ -20,23 +22,19 @@ FactPanel { property bool autoStartSet: sysAutoStartFact.value != 0 - Column { - anchors.fill: parent - anchors.margins: 8 + Grid { + id: grid + rows: 3 + columns: 2 + spacing: ScreenTools.defaultFontPixelWidth / 2 - VehicleSummaryRow { - labelText: "System ID:" - valueText: sysIdFact.valueString - } + QGCLabel { text: "System ID:" } + FactLabel { fact: sysIdFact } - VehicleSummaryRow { - labelText: "Airframe type:" - valueText: autoStartSet ? controller.currentAirframeType : "Setup required" - } + QGCLabel { text: "Airframe type:" } + QGCLabel { text: autoStartSet ? controller.currentAirframeType : "Setup required" } - VehicleSummaryRow { - labelText: "Vehicle:" - valueText: autoStartSet ? controller.currentVehicleName : "Setup required" - } + QGCLabel { text: "Vehicle:" } + QGCLabel { text: autoStartSet ? controller.currentVehicleName : "Setup required" } } -} \ No newline at end of file +} diff --git a/src/AutoPilotPlugins/PX4/FlightModesComponentSummary.qml b/src/AutoPilotPlugins/PX4/FlightModesComponentSummary.qml index bbf7cf443..f3e17e874 100644 --- a/src/AutoPilotPlugins/PX4/FlightModesComponentSummary.qml +++ b/src/AutoPilotPlugins/PX4/FlightModesComponentSummary.qml @@ -1,15 +1,17 @@ -import QtQuick 2.2 +import QtQuick 2.5 import QtQuick.Controls 1.2 -import QGroundControl.FactSystem 1.0 -import QGroundControl.FactControls 1.0 -import QGroundControl.Controls 1.0 -import QGroundControl.Palette 1.0 +import QGroundControl.FactSystem 1.0 +import QGroundControl.FactControls 1.0 +import QGroundControl.Controls 1.0 +import QGroundControl.Palette 1.0 +import QGroundControl.ScreenTools 1.0 FactPanel { - id: panel - anchors.fill: parent - color: qgcPal.windowShadeDark + id: panel + width: grid.width + height: grid.height + color: qgcPal.windowShade QGCPalette { id: qgcPal; colorGroupEnabled: enabled } FactPanelController { id: controller; factPanel: panel } @@ -19,28 +21,22 @@ FactPanel { property Fact loiterSwFact: controller.getParameterFact(-1, "RC_MAP_LOITER_SW") property Fact returnSwFact: controller.getParameterFact(-1, "RC_MAP_RETURN_SW") - Column { - anchors.fill: parent - anchors.margins: 8 - - VehicleSummaryRow { - labelText: "Mode switch:" - valueText: modeSwFact.value == 0 ? "Setup required" : modeSwFact.valueString - } - - VehicleSummaryRow { - labelText: "Position Ctl switch:" - valueText: posCtlSwFact.value == 0 ? "Disabled" : posCtlSwFact.valueString - } - - VehicleSummaryRow { - labelText: "Loiter switch:" - valueText: loiterSwFact.value == 0 ? "Disabled" : loiterSwFact.valueString - } - - VehicleSummaryRow { - labelText: "Return switch:" - valueText: returnSwFact.value == 0 ? "Disabled" : returnSwFact.valueString - } + Grid { + id: grid + rows: 4 + columns: 2 + spacing: ScreenTools.defaultFontPixelWidth / 2 + + QGCLabel { text: "Mode switch:" } + QGCLabel { text: modeSwFact.value == 0 ? "Setup required" : modeSwFact.valueString } + + QGCLabel { text: "Position Ctl switch:" } + QGCLabel { text: posCtlSwFact.value == 0 ? "Disabled" : posCtlSwFact.valueString } + + QGCLabel { text: "Loiter switch:" } + QGCLabel { text: loiterSwFact.value == 0 ? "Disabled" : loiterSwFact.valueString } + + QGCLabel { text: "Return switch:" } + QGCLabel { text: returnSwFact.value == 0 ? "Disabled" : returnSwFact.valueString } } } diff --git a/src/AutoPilotPlugins/PX4/PX4RadioComponentSummary.qml b/src/AutoPilotPlugins/PX4/PX4RadioComponentSummary.qml index 663d2649b..2b56f350c 100644 --- a/src/AutoPilotPlugins/PX4/PX4RadioComponentSummary.qml +++ b/src/AutoPilotPlugins/PX4/PX4RadioComponentSummary.qml @@ -1,15 +1,17 @@ -import QtQuick 2.2 +import QtQuick 2.5 import QtQuick.Controls 1.2 -import QGroundControl.FactSystem 1.0 -import QGroundControl.FactControls 1.0 -import QGroundControl.Controls 1.0 -import QGroundControl.Palette 1.0 +import QGroundControl.FactSystem 1.0 +import QGroundControl.FactControls 1.0 +import QGroundControl.Controls 1.0 +import QGroundControl.Palette 1.0 +import QGroundControl.ScreenTools 1.0 FactPanel { - id: panel - anchors.fill: parent - color: qgcPal.windowShadeDark + id: panel + width: grid.width + height: grid.height + color: qgcPal.windowShade QGCPalette { id: qgcPal; colorGroupEnabled: enabled } FactPanelController { id: controller; factPanel: panel } @@ -22,43 +24,31 @@ FactPanel { property Fact mapAux1Fact: controller.getParameterFact(-1, "RC_MAP_AUX1") property Fact mapAux2Fact: controller.getParameterFact(-1, "RC_MAP_AUX2") - Column { - anchors.fill: parent - anchors.margins: 8 + Grid { + id: grid + rows: 7 + columns: 2 + spacing: ScreenTools.defaultFontPixelWidth / 2 - VehicleSummaryRow { - labelText: "Roll:" - valueText: mapRollFact.value == 0 ? "Setup required" : mapRollFact.valueString - } + QGCLabel { text: "Roll:" } + QGCLabel { text: mapRollFact.value == 0 ? "Setup required" : mapRollFact.valueString } - VehicleSummaryRow { - labelText: "Pitch:" - valueText: mapPitchFact.value == 0 ? "Setup required" : mapPitchFact.valueString - } + QGCLabel { text: "Pitch:" } + QGCLabel { text: mapPitchFact.value == 0 ? "Setup required" : mapPitchFact.valueString } - VehicleSummaryRow { - labelText: "Yaw:" - valueText: mapYawFact.value == 0 ? "Setup required" : mapYawFact.valueString - } + QGCLabel { text: "Yaw:" } + QGCLabel { text: mapYawFact.value == 0 ? "Setup required" : mapYawFact.valueString } - VehicleSummaryRow { - labelText: "Throttle:" - valueText: mapThrottleFact.value == 0 ? "Setup required" : mapThrottleFact.valueString - } + QGCLabel { text: "Throttle:" } + QGCLabel { text: mapThrottleFact.value == 0 ? "Setup required" : mapThrottleFact.valueString } - VehicleSummaryRow { - labelText: "Flaps:" - valueText: mapFlapsFact.value == 0 ? "Disabled" : mapFlapsFact.valueString - } + QGCLabel { text: "Flaps:" } + QGCLabel { text: mapFlapsFact.value == 0 ? "Disabled" : mapFlapsFact.valueString } - VehicleSummaryRow { - labelText: "Aux1:" - valueText: mapAux1Fact.value == 0 ? "Disabled" : mapAux1Fact.valueString - } + QGCLabel { text: "Aux1:" } + QGCLabel { text: mapAux1Fact.value == 0 ? "Disabled" : mapAux1Fact.valueString } - VehicleSummaryRow { - labelText: "Aux2:" - valueText: mapAux2Fact.value == 0 ? "Disabled" : mapAux2Fact.valueString - } + QGCLabel { text: "Aux2:" } + QGCLabel { text: mapAux2Fact.value == 0 ? "Disabled" : mapAux2Fact.valueString } } } diff --git a/src/AutoPilotPlugins/PX4/PowerComponentSummary.qml b/src/AutoPilotPlugins/PX4/PowerComponentSummary.qml index 334329537..5ad17dcc2 100644 --- a/src/AutoPilotPlugins/PX4/PowerComponentSummary.qml +++ b/src/AutoPilotPlugins/PX4/PowerComponentSummary.qml @@ -25,18 +25,20 @@ /// @brief Battery, propeller and magnetometer summary /// @author Gus Grubba -import QtQuick 2.2 +import QtQuick 2.5 import QtQuick.Controls 1.2 -import QGroundControl.FactSystem 1.0 -import QGroundControl.FactControls 1.0 -import QGroundControl.Controls 1.0 -import QGroundControl.Palette 1.0 +import QGroundControl.FactSystem 1.0 +import QGroundControl.FactControls 1.0 +import QGroundControl.Controls 1.0 +import QGroundControl.Palette 1.0 +import QGroundControl.ScreenTools 1.0 FactPanel { - id: panel - anchors.fill: parent - color: qgcPal.windowShadeDark + id: panel + width: grid.width + height: grid.height + color: qgcPal.windowShade QGCPalette { id: qgcPal; colorGroupEnabled: enabled } FactPanelController { id: controller; factPanel: panel } @@ -45,23 +47,19 @@ FactPanel { property Fact batVEmptyFact: controller.getParameterFact(-1, "BAT_V_EMPTY") property Fact batCellsFact: controller.getParameterFact(-1, "BAT_N_CELLS") - Column { - anchors.fill: parent - anchors.margins: 8 + Grid { + id: grid + rows: 3 + columns: 2 + spacing: ScreenTools.defaultFontPixelWidth / 2 - VehicleSummaryRow { - labelText: "Battery Full:" - valueText: batVChargedFact.valueString - } + QGCLabel { text: "Battery Full:" } + FactLabel { fact: batVChargedFact } - VehicleSummaryRow { - labelText: "Battery Empty:" - valueText: batVEmptyFact.valueString - } + QGCLabel { text: "Battery Empty:" } + FactLabel { fact: batVEmptyFact } - VehicleSummaryRow { - labelText: "Number of Cells:" - valueText: batCellsFact.valueString - } + QGCLabel { text: "Number of Cells:" } + FactLabel { fact: batCellsFact } } -} \ No newline at end of file +} diff --git a/src/AutoPilotPlugins/PX4/SafetyComponentSummary.qml b/src/AutoPilotPlugins/PX4/SafetyComponentSummary.qml index 46785ad60..28b925ef2 100644 --- a/src/AutoPilotPlugins/PX4/SafetyComponentSummary.qml +++ b/src/AutoPilotPlugins/PX4/SafetyComponentSummary.qml @@ -1,15 +1,17 @@ -import QtQuick 2.2 +import QtQuick 2.5 import QtQuick.Controls 1.2 -import QGroundControl.FactSystem 1.0 -import QGroundControl.FactControls 1.0 -import QGroundControl.Controls 1.0 -import QGroundControl.Palette 1.0 +import QGroundControl.FactSystem 1.0 +import QGroundControl.FactControls 1.0 +import QGroundControl.Controls 1.0 +import QGroundControl.Palette 1.0 +import QGroundControl.ScreenTools 1.0 FactPanel { - id: panel - anchors.fill: parent - color: qgcPal.windowShadeDark + id: panel + width: grid.width + height: grid.height + color: qgcPal.windowShade QGCPalette { id: qgcPal; colorGroupEnabled: enabled } FactPanelController { id: controller; factPanel: panel } @@ -20,33 +22,25 @@ FactPanel { property Fact commDLLossFact: controller.getParameterFact(-1, "COM_DL_LOSS_EN") property Fact commRCLossFact: controller.getParameterFact(-1, "COM_RC_LOSS_T") - Column { - anchors.fill: parent - anchors.margins: 8 - - VehicleSummaryRow { - labelText: "RTL min alt:" - valueText: returnAltFact.valueString - } - - VehicleSummaryRow { - labelText: "RTL home alt:" - valueText: descendAltFact.valueString - } - - VehicleSummaryRow { - labelText: "RTL loiter delay:" - valueText: landDelayFact.value < 0 ? "Disabled" : landDelayFact.valueString - } - - VehicleSummaryRow { - labelText: "Telemetry loss RTL:" - valueText: commDLLossFact.value != -1 ? "Disabled" : commDLLossFact.valueString - } - - VehicleSummaryRow { - labelText: "RC loss RTL (seconds):" - valueText: commRCLossFact.valueString - } + Grid { + id: grid + rows: 5 + columns: 2 + spacing: ScreenTools.defaultFontPixelWidth / 2 + + QGCLabel { text: "RTL min alt:" } + QGCLabel { text: returnAltFact.valueString } + + QGCLabel { text: "RTL home alt:" } + QGCLabel { text: descendAltFact.valueString } + + QGCLabel { text: "RTL loiter delay:" } + QGCLabel { text: landDelayFact.value < 0 ? "Disabled" : landDelayFact.valueString } + + QGCLabel { text: "Telemetry loss RTL:" } + QGCLabel { text: commDLLossFact.value != -1 ? "Disabled" : commDLLossFact.valueString } + + QGCLabel { text: "RC loss RTL (seconds):" } + QGCLabel { text: commRCLossFact.valueString } } } diff --git a/src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml b/src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml index 2f7a3edb9..4997fe1f3 100644 --- a/src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml +++ b/src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml @@ -1,20 +1,17 @@ -import QtQuick 2.2 +import QtQuick 2.5 import QtQuick.Controls 1.2 -import QtQuick.Controls.Styles 1.2 -import QGroundControl.FactSystem 1.0 -import QGroundControl.FactControls 1.0 -import QGroundControl.Controls 1.0 -import QGroundControl.Palette 1.0 - -/* - IMPORTANT NOTE: Any changes made here must also be made to SensorsComponentSummary.qml -*/ +import QGroundControl.FactSystem 1.0 +import QGroundControl.FactControls 1.0 +import QGroundControl.Controls 1.0 +import QGroundControl.Palette 1.0 +import QGroundControl.ScreenTools 1.0 FactPanel { - id: panel - anchors.fill: parent - color: qgcPal.windowShadeDark + id: panel + width: grid.width + height: grid.height + color: qgcPal.windowShade QGCPalette { id: qgcPal; colorGroupEnabled: enabled } FactPanelController { id: controller; factPanel: panel } @@ -23,23 +20,19 @@ FactPanel { property Fact gyro0IdFact: controller.getParameterFact(-1, "CAL_GYRO0_ID") property Fact accel0IdFact: controller.getParameterFact(-1, "CAL_ACC0_ID") - Column { - anchors.fill: parent - anchors.margins: 8 + Grid { + id: grid + rows: 3 + columns: 2 + spacing: ScreenTools.defaultFontPixelWidth / 2 - VehicleSummaryRow { - labelText: "Compass:" - valueText: mag0IdFact.value == 0 ? "Setup required" : "Ready" - } + QGCLabel { text: "Compass:" } + QGCLabel { text: mag0IdFact.value == 0 ? "Setup required" : "Ready" } - VehicleSummaryRow { - labelText: "Gyro:" - valueText: gyro0IdFact.value == 0 ? "Setup required" : "Ready" - } + QGCLabel { text: "Gyro:" } + QGCLabel { text: gyro0IdFact.value == 0 ? "Setup required" : "Ready" } - VehicleSummaryRow { - labelText: "Accelerometer:" - valueText: accel0IdFact.value == 0 ? "Setup required" : "Ready" - } + QGCLabel { text: "Accelerometer:" } + QGCLabel { text: accel0IdFact.value == 0 ? "Setup required" : "Ready" } } -} \ No newline at end of file +} diff --git a/src/VehicleSetup/VehicleSummary.qml b/src/VehicleSetup/VehicleSummary.qml index ed126b21b..7b0b58897 100644 --- a/src/VehicleSetup/VehicleSummary.qml +++ b/src/VehicleSetup/VehicleSummary.qml @@ -36,122 +36,63 @@ Rectangle { anchors.fill: parent color: qgcPal.window - property real _minSummaryW: ScreenTools.defaultFontPixelWidth * 30 - property real _summaryBoxWidth: _minSummaryW - property real _summaryBoxSpace: ScreenTools.defaultFontPixelWidth - - function computeSummaryBoxSize() { - var sw = 0 - var rw = 0 - var idx = Math.floor(_summaryRoot.width / (_minSummaryW + ScreenTools.defaultFontPixelWidth)) - if(idx < 1) { - _summaryBoxWidth = _summaryRoot.width - _summaryBoxSpace = 0 - } else { - _summaryBoxSpace = 0 - if(idx > 1) { - _summaryBoxSpace = ScreenTools.defaultFontPixelWidth - sw = _summaryBoxSpace * (idx - 1) - } - rw = _summaryRoot.width - sw - _summaryBoxWidth = rw / idx - } - } + readonly property real _margins: ScreenTools.defaultFontPixelHeight function capitalizeWords(sentence) { return sentence.replace(/(?:^|\s)\S/g, function(a) { return a.toUpperCase(); }); } - QGCPalette { - id: qgcPal - colorGroupEnabled: enabled - } - - Component.onCompleted: { - computeSummaryBoxSize() - } - - onWidthChanged: { - computeSummaryBoxSize() - } + QGCPalette { id: qgcPal; colorGroupEnabled: enabled } Flickable { clip: true anchors.fill: parent - contentHeight: summaryColumn.height - contentWidth: _summaryRoot.width + contentHeight: summaryFlow.y + summaryFlow.height flickableDirection: Flickable.VerticalFlick - boundsBehavior: Flickable.StopAtBounds - - Column { - id: summaryColumn - width: _summaryRoot.width - spacing: ScreenTools.defaultFontPixelHeight - - QGCLabel { - width: parent.width - wrapMode: Text.WordWrap - color: setupComplete ? qgcPal.text : qgcPal.warningText - font.weight: Font.DemiBold - text: setupComplete ? - "Below you will find a summary of the settings for your vehicle. To the left are the setup menus for each component." : - "WARNING: Your vehicle requires setup prior to flight. Please resolve the items marked in red using the menu on the left." - property bool setupComplete: multiVehicleManager.activeVehicle.autopilot.setupComplete - } - Flow { - id: _flowCtl - width: _summaryRoot.width - spacing: _summaryBoxSpace + QGCLabel { + id: topLabel + width: parent.width + wrapMode: Text.WordWrap + color: setupComplete ? qgcPal.text : qgcPal.warningText + font.weight: setupComplete ? Font.Normal : Font.DemiBold + text: setupComplete ? + "Below you will find a summary of the settings for your vehicle. To the left are the setup menus for each component." : + "WARNING: Your vehicle requires setup prior to flight. Please resolve the items marked in red using the menu on the left." + property bool setupComplete: multiVehicleManager.activeVehicle.autopilot.setupComplete + } - Repeater { - model: multiVehicleManager.activeVehicle.autopilot.vehicleComponents + Flow { + id: summaryFlow + anchors.topMargin: _margins + anchors.top: topLabel.bottom + width: parent.width + spacing: ScreenTools.defaultFontPixelWidth - // Outer summary item rectangle - Rectangle { - width: _summaryBoxWidth - height: ScreenTools.defaultFontPixelHeight * 13 - color: qgcPal.window - visible: modelData.summaryQmlSource.toString() != "" - - readonly property real titleHeight: ScreenTools.defaultFontPixelHeight * 2 - - // Title bar - Rectangle { - id: titleBar - width: parent.width - height: titleHeight - color: qgcPal.windowShade - - // Title text - QGCLabel { - anchors.fill: parent - verticalAlignment: TextEdit.AlignVCenter - horizontalAlignment: TextEdit.AlignHCenter - text: capitalizeWords(modelData.name) - } - - // Setup indicator - Rectangle { - anchors.rightMargin: ScreenTools.defaultFontPixelWidth / 3 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - width: ScreenTools.defaultFontPixelWidth - height: width - radius: width / 2 - color: modelData.setupComplete ? "#00d932" : "red" - visible: modelData.requiresSetup - } - } + Repeater { + model: multiVehicleManager.activeVehicle.autopilot.vehicleComponents + + QGCLabel { + width: summaryRectangle.width + height: summaryRectangle.y + summaryRectangle.height + text: capitalizeWords(modelData.name) + font.weight: Font.DemiBold + visible: modelData.summaryQmlSource.toString() != "" + color: modelData.setupComplete ? qgcPal.text : "red" - // Summary Qml - Rectangle { - anchors.top: titleBar.bottom - width: parent.width - Loader { - anchors.fill: parent - source: modelData.summaryQmlSource - } + Rectangle { + id: summaryRectangle + y: parent.contentHeight + (_margins / 2) + width: summaryLoader.width + _margins + height: summaryLoader.height + _margins + color: qgcPal.windowShade + + Loader { + id: summaryLoader + anchors.margins: _margins / 2 + anchors.left: parent.left + anchors.top: parent.top + source: modelData.summaryQmlSource } } } -- 2.22.0