Commit a93076dd authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #4130 from DonLakeFlyer/APMSetupPage

Switch ArduPilot setup pages to new SetupPage usage, plus vehicle branding
parents 8f594e50 698e6bb1
...@@ -152,6 +152,8 @@ ...@@ -152,6 +152,8 @@
<file alias="ArrowDirection.svg">src/AutoPilotPlugins/Common/Images/ArrowDirection.svg</file> <file alias="ArrowDirection.svg">src/AutoPilotPlugins/Common/Images/ArrowDirection.svg</file>
<file alias="ArrowCW.svg">src/AutoPilotPlugins/Common/Images/ArrowCW.svg</file> <file alias="ArrowCW.svg">src/AutoPilotPlugins/Common/Images/ArrowCW.svg</file>
<file alias="ArrowCCW.svg">src/AutoPilotPlugins/Common/Images/ArrowCCW.svg</file> <file alias="ArrowCCW.svg">src/AutoPilotPlugins/Common/Images/ArrowCCW.svg</file>
<file alias="APM/BrandImage">src/FirmwarePlugin/APM/APMBrandImage.png</file>
<file alias="PX4/BrandImage">src/FirmwarePlugin/PX4/PX4BrandImage.png</file>
</qresource> </qresource>
<qresource prefix="/res"> <qresource prefix="/res">
<file alias="AntennaRC">resources/Antenna_RC.svg</file> <file alias="AntennaRC">resources/Antenna_RC.svg</file>
......
...@@ -32,8 +32,8 @@ QString APMAirframeComponent::name(void) const ...@@ -32,8 +32,8 @@ QString APMAirframeComponent::name(void) const
QString APMAirframeComponent::description(void) const QString APMAirframeComponent::description(void) const
{ {
return tr("The Airframe Component is used to select the airframe which matches your vehicle. " return tr("Airframe Setup is used to select the airframe which matches your vehicle. "
"This will in turn set up the various tuning values for flight parameters."); "You can also the load default parameter values associated with known vehicle types.");
} }
QString APMAirframeComponent::iconResource(void) const QString APMAirframeComponent::iconResource(void) const
......
...@@ -11,26 +11,24 @@ ...@@ -11,26 +11,24 @@
import QtQuick 2.5 import QtQuick 2.5
import QtQuick.Controls 1.2 import QtQuick.Controls 1.2
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.2
import QGroundControl.FactSystem 1.0 import QGroundControl.FactSystem 1.0
import QGroundControl.FactControls 1.0
import QGroundControl.Palette 1.0 import QGroundControl.Palette 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
import QGroundControl.Controllers 1.0 import QGroundControl.Controllers 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
QGCView { SetupPage {
id: qgcView id: airframePage
viewPanel: panel pageComponent: airframePageComponent
QGCPalette { id: qgcPal; colorGroupEnabled: panel.enabled }
property real _margins: ScreenTools.defaultFontPixelWidth property real _margins: ScreenTools.defaultFontPixelWidth
property Fact _frame: controller.getParameterFact(-1, "FRAME") property Fact _frame: controller.getParameterFact(-1, "FRAME")
APMAirframeComponentController { APMAirframeComponentController {
id: controller id: controller
factPanel: panel factPanel: airframePage.viewPanel
} }
ExclusiveGroup { ExclusiveGroup {
...@@ -89,57 +87,32 @@ QGCView { ...@@ -89,57 +87,32 @@ QGCView {
} }
} }
QGCViewPanel { Component {
id: panel id: airframePageComponent
anchors.fill: parent
Item { Column {
id: helpApplyRow width: availableWidth
anchors.top: parent.top height: 1000
spacing: _margins
RowLayout {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
height: Math.max(helpText.contentHeight, applyButton.height) spacing: _margins
QGCLabel { QGCLabel {
id: helpText
anchors.rightMargin: _margins
anchors.left: parent.left
anchors.right: applyButton.right
text: qsTr("Please select your airframe type")
font.pointSize: ScreenTools.mediumFontPointSize font.pointSize: ScreenTools.mediumFontPointSize
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: qsTr("Please select your airframe type")
Layout.fillWidth: true
} }
QGCButton { QGCButton {
id: applyButton
anchors.right: parent.right
text: qsTr("Load common parameters") text: qsTr("Load common parameters")
onClicked: showDialog(applyRestartDialogComponent, qsTr("Load common parameters"), qgcView.showDialogDefaultWidth, StandardButton.Close) onClicked: showDialog(applyRestartDialogComponent, qsTr("Load common parameters"), qgcView.showDialogDefaultWidth, StandardButton.Close)
} }
} }
Item {
id: helpSpacer
anchors.top: helpApplyRow.bottom
height: parent.spacerHeight
width: 10
}
QGCFlickable {
id: scroll
anchors.top: helpSpacer.bottom
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
contentHeight: frameColumn.height
contentWidth: frameColumn.width
Column {
id: frameColumn
spacing: _margins
Repeater { Repeater {
model: controller.airframeTypesModel model: controller.airframeTypesModel
...@@ -155,7 +128,6 @@ QGCView { ...@@ -155,7 +128,6 @@ QGCView {
} }
} }
} }
} } // Column
} } // Component - pageComponent
} // QGCViewPanel } // SetupPage
} // QGCView
...@@ -29,7 +29,7 @@ QString APMCameraComponent::name(void) const ...@@ -29,7 +29,7 @@ QString APMCameraComponent::name(void) const
QString APMCameraComponent::description(void) const QString APMCameraComponent::description(void) const
{ {
return tr("The Camera Component is used to setup camera and gimbal settings."); return tr("Camera setup is used to adjust camera and gimbal settings.");
} }
QString APMCameraComponent::iconResource(void) const QString APMCameraComponent::iconResource(void) const
......
...@@ -17,14 +17,20 @@ import QGroundControl.Palette 1.0 ...@@ -17,14 +17,20 @@ import QGroundControl.Palette 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
QGCView { SetupPage {
id: _cameraView id: cameraPage
viewPanel: panel pageComponent: cameraPageComponent
anchors.fill: parent
FactPanelController { id: controller; factPanel: panel } Component {
id: cameraPageComponent
Column {
spacing: _margins
width: availableWidth
QGCPalette { id: palette; colorGroupEnabled: enabled } FactPanelController { id: controller; factPanel: cameraPage.viewPanel }
QGCPalette { id: palette; colorGroupEnabled: true }
property Fact _mountRetractX: controller.getParameterFact(-1, "MNT_RETRACT_X") property Fact _mountRetractX: controller.getParameterFact(-1, "MNT_RETRACT_X")
property Fact _mountRetractY: controller.getParameterFact(-1, "MNT_RETRACT_Y") property Fact _mountRetractY: controller.getParameterFact(-1, "MNT_RETRACT_Y")
...@@ -442,16 +448,6 @@ QGCView { ...@@ -442,16 +448,6 @@ QGCView {
} // Item } // Item
} // Component - gimbalSettings } // Component - gimbalSettings
QGCViewPanel {
id: panel
anchors.fill: parent
QGCFlickable {
clip: true
anchors.fill: parent
contentWidth: gimbalDirectionTiltLoader.x + gimbalDirectionTiltLoader.width
contentHeight: _showGimbaLSettings ? gimbalSettingsLoader.y + gimbalSettingsLoader.height : gimbalDirectionPanLoader.y + gimbalDirectionPanLoader.height
Loader { Loader {
id: gimbalDirectionTiltLoader id: gimbalDirectionTiltLoader
sourceComponent: gimbalDirectionSettings sourceComponent: gimbalDirectionSettings
...@@ -471,8 +467,6 @@ QGCView { ...@@ -471,8 +467,6 @@ QGCView {
Loader { Loader {
id: gimbalDirectionRollLoader id: gimbalDirectionRollLoader
anchors.margins: _margins
anchors.top: gimbalDirectionTiltLoader.bottom
sourceComponent: gimbalDirectionSettings sourceComponent: gimbalDirectionSettings
property string directionTitle: qsTr("Roll") property string directionTitle: qsTr("Roll")
...@@ -490,8 +484,6 @@ QGCView { ...@@ -490,8 +484,6 @@ QGCView {
Loader { Loader {
id: gimbalDirectionPanLoader id: gimbalDirectionPanLoader
anchors.margins: _margins
anchors.top: gimbalDirectionRollLoader.bottom
sourceComponent: gimbalDirectionSettings sourceComponent: gimbalDirectionSettings
property string directionTitle: qsTr("Pan") property string directionTitle: qsTr("Pan")
...@@ -509,9 +501,7 @@ QGCView { ...@@ -509,9 +501,7 @@ QGCView {
Loader { Loader {
id: gimbalSettingsLoader id: gimbalSettingsLoader
anchors.margins: _margins
anchors.top: gimbalDirectionPanLoader.bottom
} }
} // Flickable } // Column
} // QGCViewPanel } // Component
} // QGCView } // SetupPage
...@@ -26,7 +26,7 @@ QString APMFlightModesComponent::name(void) const ...@@ -26,7 +26,7 @@ QString APMFlightModesComponent::name(void) const
QString APMFlightModesComponent::description(void) const QString APMFlightModesComponent::description(void) const
{ {
return QStringLiteral("The Flight Modes Component is used to assign FLight Modes to Channel 5."); return tr("Flight Modes Setup is used to configure the transmitter switches associated with Flight Modes.");
} }
QString APMFlightModesComponent::iconResource(void) const QString APMFlightModesComponent::iconResource(void) const
......
...@@ -18,9 +18,9 @@ import QGroundControl.Controls 1.0 ...@@ -18,9 +18,9 @@ import QGroundControl.Controls 1.0
import QGroundControl.Controllers 1.0 import QGroundControl.Controllers 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
QGCView { SetupPage {
id: rootQGCView id: flightModePage
viewPanel: panel pageComponent: flightModePageComponent
readonly property string _modeChannelParam: controller.modeChannelParam readonly property string _modeChannelParam: controller.modeChannelParam
readonly property string _modeParamPrefix: controller.modeParamPrefix readonly property string _modeParamPrefix: controller.modeParamPrefix
...@@ -33,26 +33,19 @@ QGCView { ...@@ -33,26 +33,19 @@ QGCView {
property bool _fltmodeChExists: controller.parameterExists(-1, _modeChannelParam) property bool _fltmodeChExists: controller.parameterExists(-1, _modeChannelParam)
property Fact _fltmodeCh: _fltmodeChExists ? controller.getParameterFact(-1, _modeChannelParam) : _nullFact property Fact _fltmodeCh: _fltmodeChExists ? controller.getParameterFact(-1, _modeChannelParam) : _nullFact
QGCPalette { id: qgcPal; colorGroupEnabled: panel.enabled } QGCPalette { id: qgcPal; colorGroupEnabled: true }
APMFlightModesComponentController { APMFlightModesComponentController {
id: controller id: controller
factPanel: panel factPanel: flightModePage.viewPanel
} }
QGCViewPanel { Component {
id: panel id: flightModePageComponent
anchors.fill: parent
QGCFlickable {
anchors.fill: parent
clip: true
contentHeight: flowLayout.height
contentWidth: flowLayout.width
Flow { Flow {
id: flowLayout id: flowLayout
width: panel.width // parent.width doesn't work here for some reason! width: availableWidth
spacing: _margins spacing: _margins
Column { Column {
...@@ -181,6 +174,5 @@ QGCView { ...@@ -181,6 +174,5 @@ QGCView {
} // Rectangle - Channel options } // Rectangle - Channel options
} // Column - Channel options } // Column - Channel options
} // Flow } // Flow
} // QGCFlickable } // Component - flightModePageComponent
} // QGCViewPanel } // SetupPage
} // QGCView
...@@ -29,7 +29,7 @@ QString APMSafetyComponent::name(void) const ...@@ -29,7 +29,7 @@ QString APMSafetyComponent::name(void) const
QString APMSafetyComponent::description(void) const QString APMSafetyComponent::description(void) const
{ {
return tr("The Safety Component is used to setup triggers for Return to Land as well as the settings for Return to Land itself."); return tr("Safety Setup is used to setup triggers for Return to Land as well as the settings for Return to Land itself.");
} }
QString APMSafetyComponent::iconResource(void) const QString APMSafetyComponent::iconResource(void) const
......
...@@ -18,14 +18,21 @@ import QGroundControl.Palette 1.0 ...@@ -18,14 +18,21 @@ import QGroundControl.Palette 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
QGCView { SetupPage {
id: _safetyView id: safetyPage
viewPanel: panel pageComponent: safetyPageComponent
anchors.fill: parent
FactPanelController { id: controller; factPanel: panel } Component {
id: safetyPageComponent
QGCPalette { id: ggcPal; colorGroupEnabled: enabled } Flow {
id: flowLayout
width: availableWidth
spacing: _margins
FactPanelController { id: controller; factPanel: safetyPage.viewPanel }
QGCPalette { id: ggcPal; colorGroupEnabled: true }
property Fact _failsafeGCSEnable: controller.getParameterFact(-1, "FS_GCS_ENABLE") property Fact _failsafeGCSEnable: controller.getParameterFact(-1, "FS_GCS_ENABLE")
property Fact _failsafeBattEnable: controller.getParameterFact(-1, "FS_BATT_ENABLE") property Fact _failsafeBattEnable: controller.getParameterFact(-1, "FS_BATT_ENABLE")
...@@ -55,21 +62,6 @@ QGCView { ...@@ -55,21 +62,6 @@ QGCView {
ExclusiveGroup { id: landLoiterRadioGroup } ExclusiveGroup { id: landLoiterRadioGroup }
ExclusiveGroup { id: returnAltRadioGroup } ExclusiveGroup { id: returnAltRadioGroup }
QGCViewPanel {
id: panel
anchors.fill: parent
QGCFlickable {
clip: true
anchors.fill: parent
contentHeight: flowLayout.height
contentWidth: flowLayout.width
Flow {
id: flowLayout
width: panel.width // parent.width doesn't work for some reason
spacing: _margins
Column { Column {
spacing: _margins / 2 spacing: _margins / 2
...@@ -319,7 +311,7 @@ QGCView { ...@@ -319,7 +311,7 @@ QGCView {
FactTextField { FactTextField {
id: fenceAltMaxField id: fenceAltMaxField
anchors.topMargin: _margins / 2 anchors.topMargin: _margins / 2
anchors.leftMargin: _margin anchors.leftMargin: _margins
anchors.left: fenceAltMaxLabel.right anchors.left: fenceAltMaxLabel.right
anchors.top: fenceRadiusField.bottom anchors.top: fenceRadiusField.bottom
fact: _fenceAltMax fact: _fenceAltMax
...@@ -503,6 +495,5 @@ QGCView { ...@@ -503,6 +495,5 @@ QGCView {
} // Rectangle - Arming checks } // Rectangle - Arming checks
} // Column - Arming Checks } // Column - Arming Checks
} // Flow } // Flow
} // QGCFlickable } // Component - safetyPageComponent
} // QGCViewPanel } // SetupView
} // QGCView
...@@ -18,14 +18,21 @@ import QGroundControl.Palette 1.0 ...@@ -18,14 +18,21 @@ import QGroundControl.Palette 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
QGCView { SetupPage {
id: _safetyView id: safetyPage
viewPanel: panel pageComponent: safetyPageComponent
anchors.fill: parent
FactPanelController { id: controller; factPanel: panel } Component {
id: safetyPageComponent
QGCPalette { id: palette; colorGroupEnabled: enabled } Flow {
id: flowLayout
width: availableWidth
spacing: _margins
FactPanelController { id: controller; factPanel: safetyPage.viewPanel }
QGCPalette { id: palette; colorGroupEnabled: true }
property Fact _failsafeBattMah: controller.getParameterFact(-1, "FS_BATT_MAH") property Fact _failsafeBattMah: controller.getParameterFact(-1, "FS_BATT_MAH")
property Fact _failsafeBattVoltage: controller.getParameterFact(-1, "FS_BATT_VOLTAGE") property Fact _failsafeBattVoltage: controller.getParameterFact(-1, "FS_BATT_VOLTAGE")
...@@ -39,21 +46,6 @@ QGCView { ...@@ -39,21 +46,6 @@ QGCView {
ExclusiveGroup { id: returnAltRadioGroup } ExclusiveGroup { id: returnAltRadioGroup }
QGCViewPanel {
id: panel
anchors.fill: parent
QGCFlickable {
clip: true
anchors.fill: parent
contentWidth: flowLayout.width
contentHeight: flowLayout.height
Flow {
id: flowLayout
width: panel.width // parent.width doesn't work for some reason
spacing: _margins
Column { Column {
spacing: _margins / 2 spacing: _margins / 2
...@@ -192,6 +184,5 @@ QGCView { ...@@ -192,6 +184,5 @@ QGCView {
} // Rectangle - RTL Settings } // Rectangle - RTL Settings
} // Column - RTL Settings } // Column - RTL Settings
} // Flow } // Flow
} // QGCFlickable } // Component
} // QGCViewPanel } // SetupView
} // QGCView
...@@ -30,8 +30,7 @@ QString APMSensorsComponent::name(void) const ...@@ -30,8 +30,7 @@ QString APMSensorsComponent::name(void) const
QString APMSensorsComponent::description(void) const QString APMSensorsComponent::description(void) const
{ {
return tr("The Sensors Component allows you to calibrate the sensors within your vehicle. " return tr("Sensors Setup is used to calibrate the sensors within your vehicle.");
"Prior to flight you must calibrate the Magnetometer, Gyroscope and Accelerometer.");
} }
QString APMSensorsComponent::iconResource(void) const QString APMSensorsComponent::iconResource(void) const
......
...@@ -12,6 +12,7 @@ import QtQuick 2.2 ...@@ -12,6 +12,7 @@ import QtQuick 2.2
import QtQuick.Controls 1.2 import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2 import QtQuick.Controls.Styles 1.2
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.2
import QGroundControl.FactSystem 1.0 import QGroundControl.FactSystem 1.0
import QGroundControl.FactControls 1.0 import QGroundControl.FactControls 1.0
...@@ -20,9 +21,17 @@ import QGroundControl.Controls 1.0 ...@@ -20,9 +21,17 @@ import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
import QGroundControl.Controllers 1.0 import QGroundControl.Controllers 1.0
QGCView { SetupPage {
id: qgcView id: sensorsPage
viewPanel: panel pageComponent: sensorsPageComponent
Component {
id: sensorsPageComponent
RowLayout {
width: 1000//availableWidth
height: 1000//availableHeight
spacing: ScreenTools.defaultFontPixelWidth / 2
// Help text which is shown both in the status text area prior to pressing a cal button and in the // Help text which is shown both in the status text area prior to pressing a cal button and in the
// pre-calibration dialog. // pre-calibration dialog.
...@@ -142,7 +151,7 @@ QGCView { ...@@ -142,7 +151,7 @@ QGCView {
APMSensorsComponentController { APMSensorsComponentController {
id: controller id: controller
factPanel: panel factPanel: sensorsPage.viewPanel
statusLog: statusTextArea statusLog: statusTextArea
progressBar: progressBar progressBar: progressBar
compassButton: compassButton compassButton: compassButton
...@@ -213,7 +222,7 @@ QGCView { ...@@ -213,7 +222,7 @@ QGCView {
} }
} }
QGCPalette { id: qgcPal; colorGroupEnabled: panel.enabled } QGCPalette { id: qgcPal; colorGroupEnabled: true }
Component { Component {
id: postCalibrationDialogComponent id: postCalibrationDialogComponent
...@@ -442,15 +451,11 @@ QGCView { ...@@ -442,15 +451,11 @@ QGCView {
} // Column } // Column
} // QGCFlickable } // QGCFlickable
} // QGCViewDialog } // QGCViewDialog
} } // Component - compassMotDialogComponent
QGCViewPanel {
id: panel
anchors.fill: parent
Column { Column {
id: buttonColumn
spacing: ScreenTools.defaultFontPixelHeight / 2 spacing: ScreenTools.defaultFontPixelHeight / 2
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
readonly property int buttonWidth: ScreenTools.defaultFontPixelWidth * 15 readonly property int buttonWidth: ScreenTools.defaultFontPixelWidth * 15
...@@ -510,11 +515,9 @@ QGCView { ...@@ -510,11 +515,9 @@ QGCView {
} // Column - Buttons } // Column - Buttons
Column { Column {
anchors.leftMargin: ScreenTools.defaultFontPixelWidth / 2
anchors.left: buttonColumn.right
anchors.right: parent.right
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
Layout.fillWidth: true
ProgressBar { ProgressBar {
id: progressBar id: progressBar
...@@ -627,5 +630,6 @@ QGCView { ...@@ -627,5 +630,6 @@ QGCView {
} }
} // Item - Cal display area } // Item - Cal display area
} // Column - cal display } // Column - cal display
} // QGCViewPanel } // Row
} // QGCView } // Component - sensorsPageComponent
} // SetupPage
...@@ -26,7 +26,7 @@ QString APMTuningComponent::name(void) const ...@@ -26,7 +26,7 @@ QString APMTuningComponent::name(void) const
QString APMTuningComponent::description(void) const QString APMTuningComponent::description(void) const
{ {
return tr("The Tuning Component is used to tune the flight characteristics of the Vehicle."); return tr("Tuning Setup is used to tune the flight characteristics of the Vehicle.");
} }
QString APMTuningComponent::iconResource(void) const QString APMTuningComponent::iconResource(void) const
......
...@@ -17,14 +17,20 @@ import QGroundControl.Palette 1.0 ...@@ -17,14 +17,20 @@ import QGroundControl.Palette 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
QGCView { SetupPage {
id: _safetyView id: tuningPage
viewPanel: panel pageComponent: tuningPageComponent
anchors.fill: parent
FactPanelController { id: controller; factPanel: panel } Component {
id: tuningPageComponent
QGCPalette { id: palette; colorGroupEnabled: enabled } Column {
width: availableWidth
spacing: _margins
FactPanelController { id: controller; factPanel: tuningPage.viewPanel }
QGCPalette { id: palette; colorGroupEnabled: true }
// Older firmwares use THR_MODE, newer use MOT_THST_HOVER // Older firmwares use THR_MODE, newer use MOT_THST_HOVER
property bool _throttleMidExists: controller.parameterExists(-1, "THR_MID") property bool _throttleMidExists: controller.parameterExists(-1, "THR_MID")
...@@ -115,16 +121,6 @@ QGCView { ...@@ -115,16 +121,6 @@ QGCView {
Connections { target: _ch11Opt; onValueChanged: calcAutoTuneChannel() } Connections { target: _ch11Opt; onValueChanged: calcAutoTuneChannel() }
Connections { target: _ch12Opt; onValueChanged: calcAutoTuneChannel() } Connections { target: _ch12Opt; onValueChanged: calcAutoTuneChannel() }
QGCViewPanel {
id: panel
anchors.fill: parent
QGCFlickable {
clip: true
anchors.fill: parent
contentHeight: autoTuneRect.y + autoTuneRect.height
flickableDirection: Flickable.VerticalFlick
QGCLabel { QGCLabel {
id: basicLabel id: basicLabel
text: qsTr("Basic Tuning") text: qsTr("Basic Tuning")
...@@ -133,10 +129,8 @@ QGCView { ...@@ -133,10 +129,8 @@ QGCView {
Rectangle { Rectangle {
id: basicTuningRect id: basicTuningRect
anchors.topMargin: _margins / 2
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.top: basicLabel.bottom
height: basicTuningColumn.y + basicTuningColumn.height + _margins height: basicTuningColumn.y + basicTuningColumn.height + _margins
color: palette.windowShade color: palette.windowShade
...@@ -277,9 +271,8 @@ QGCView { ...@@ -277,9 +271,8 @@ QGCView {
Flow { Flow {
id: flowLayout id: flowLayout
anchors.topMargin: _margins / 2 anchors.left: parent.left
width: panel.width // parent.width doesn't work here for some reason! anchors.right: parent.right
anchors.top: basicTuningRect.bottom
spacing: _margins spacing: _margins
Rectangle { Rectangle {
...@@ -417,6 +410,6 @@ QGCView { ...@@ -417,6 +410,6 @@ QGCView {
} // Rectangle - Channel 6 Tuning options } // Rectangle - Channel 6 Tuning options
} // Rectangle - Channel 6 Tuning options wrap } // Rectangle - Channel 6 Tuning options wrap
} // Flow - Tune } // Flow - Tune
} // QGCFlickable } // Column
} // QGCViewPanel } // Component
} // QGCView } // SetupView
...@@ -95,6 +95,7 @@ public: ...@@ -95,6 +95,7 @@ public:
QObject* loadParameterMetaData (const QString& metaDataFile); QObject* loadParameterMetaData (const QString& metaDataFile);
GeoFenceManager* newGeoFenceManager (Vehicle* vehicle) { return new APMGeoFenceManager(vehicle); } GeoFenceManager* newGeoFenceManager (Vehicle* vehicle) { return new APMGeoFenceManager(vehicle); }
RallyPointManager* newRallyPointManager (Vehicle* vehicle) { return new APMRallyPointManager(vehicle); } RallyPointManager* newRallyPointManager (Vehicle* vehicle) { return new APMRallyPointManager(vehicle); }
QString brandImage (const Vehicle* vehicle) const { Q_UNUSED(vehicle); return QStringLiteral("/qmlimages/APM/BrandImage"); }
QString getParameterMetaDataFile(Vehicle* vehicle); QString getParameterMetaDataFile(Vehicle* vehicle);
......
...@@ -222,6 +222,9 @@ public: ...@@ -222,6 +222,9 @@ public:
/// Return the resource file which contains the set of params loaded for offline editing. /// Return the resource file which contains the set of params loaded for offline editing.
virtual QString offlineEditingParamFile(Vehicle* vehicle) { Q_UNUSED(vehicle); return QString(); } virtual QString offlineEditingParamFile(Vehicle* vehicle) { Q_UNUSED(vehicle); return QString(); }
/// Return the resource file which contains the brand image for the vehicle.
virtual QString brandImage(const Vehicle* vehicle) const { Q_UNUSED(vehicle) return QString(); }
}; };
#endif #endif
...@@ -58,6 +58,7 @@ public: ...@@ -58,6 +58,7 @@ public:
bool adjustIncomingMavlinkMessage (Vehicle* vehicle, mavlink_message_t* message); bool adjustIncomingMavlinkMessage (Vehicle* vehicle, mavlink_message_t* message);
GeoFenceManager* newGeoFenceManager (Vehicle* vehicle) { return new PX4GeoFenceManager(vehicle); } GeoFenceManager* newGeoFenceManager (Vehicle* vehicle) { return new PX4GeoFenceManager(vehicle); }
QString offlineEditingParamFile(Vehicle* vehicle) final { Q_UNUSED(vehicle); return QStringLiteral(":/FirmwarePlugin/PX4/PX4.OfflineEditing.params"); } QString offlineEditingParamFile(Vehicle* vehicle) final { Q_UNUSED(vehicle); return QStringLiteral(":/FirmwarePlugin/PX4/PX4.OfflineEditing.params"); }
QString brandImage (const Vehicle* vehicle) const { Q_UNUSED(vehicle); return QStringLiteral("/qmlimages/PX4/BrandImage"); }
// Use these constants to set flight modes using setFlightMode method. Don't use hardcoded string names since the // Use these constants to set flight modes using setFlightMode method. Don't use hardcoded string names since the
// names may change. // names may change.
......
...@@ -1922,6 +1922,11 @@ void Vehicle::_newGeoFenceAvailable(void) ...@@ -1922,6 +1922,11 @@ void Vehicle::_newGeoFenceAvailable(void)
} }
} }
QString Vehicle::brandImage(void) const
{
return _firmwarePlugin->brandImage(this);
}
const char* VehicleGPSFactGroup::_hdopFactName = "hdop"; const char* VehicleGPSFactGroup::_hdopFactName = "hdop";
const char* VehicleGPSFactGroup::_vdopFactName = "vdop"; const char* VehicleGPSFactGroup::_vdopFactName = "vdop";
const char* VehicleGPSFactGroup::_courseOverGroundFactName = "courseOverGround"; const char* VehicleGPSFactGroup::_courseOverGroundFactName = "courseOverGround";
......
...@@ -279,6 +279,7 @@ public: ...@@ -279,6 +279,7 @@ public:
Q_PROPERTY(bool coaxialMotors READ coaxialMotors CONSTANT) Q_PROPERTY(bool coaxialMotors READ coaxialMotors CONSTANT)
Q_PROPERTY(bool xConfigMotors READ xConfigMotors CONSTANT) Q_PROPERTY(bool xConfigMotors READ xConfigMotors CONSTANT)
Q_PROPERTY(bool isOfflineEditingVehicle READ isOfflineEditingVehicle CONSTANT) Q_PROPERTY(bool isOfflineEditingVehicle READ isOfflineEditingVehicle CONSTANT)
Q_PROPERTY(QString brandImage READ brandImage CONSTANT)
/// true: Vehicle is flying, false: Vehicle is on ground /// true: Vehicle is flying, false: Vehicle is on ground
Q_PROPERTY(bool flying READ flying WRITE setFlying NOTIFY flyingChanged) Q_PROPERTY(bool flying READ flying WRITE setFlying NOTIFY flyingChanged)
...@@ -524,6 +525,7 @@ public: ...@@ -524,6 +525,7 @@ public:
uint8_t baseMode () const { return _base_mode; } uint8_t baseMode () const { return _base_mode; }
uint32_t customMode () const { return _custom_mode; } uint32_t customMode () const { return _custom_mode; }
bool isOfflineEditingVehicle () const { return _offlineEditingVehicle; } bool isOfflineEditingVehicle () const { return _offlineEditingVehicle; }
QString brandImage () const;
Fact* roll (void) { return &_rollFact; } Fact* roll (void) { return &_rollFact; }
Fact* heading (void) { return &_headingFact; } Fact* heading (void) { return &_headingFact; }
......
...@@ -421,6 +421,17 @@ Rectangle { ...@@ -421,6 +421,17 @@ Rectangle {
primary: true primary: true
onClicked: activeVehicle.disconnectInactiveVehicle() onClicked: activeVehicle.disconnectInactiveVehicle()
} }
Image {
anchors.rightMargin: ScreenTools.defaultFontPixelWidth / 2
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
visible: parent.x < x && !disconnectButton.visible && source != ""
fillMode: Image.PreserveAspectFit
source: activeVehicle ? activeVehicle.brandImage : ""
}
} }
// Progress bar // Progress bar
......
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