Browse Source

Merge pull request #4130 from DonLakeFlyer/APMSetupPage

Switch ArduPilot setup pages to new SetupPage usage, plus vehicle branding
QGC4.4
Don Gagne 9 years ago committed by GitHub
parent
commit
a93076dd32
  1. 2
      qgcresources.qrc
  2. 4
      src/AutoPilotPlugins/APM/APMAirframeComponent.cc
  3. 66
      src/AutoPilotPlugins/APM/APMAirframeComponent.qml
  4. 2
      src/AutoPilotPlugins/APM/APMCameraComponent.cc
  5. 40
      src/AutoPilotPlugins/APM/APMCameraComponent.qml
  6. 2
      src/AutoPilotPlugins/APM/APMFlightModesComponent.cc
  7. 28
      src/AutoPilotPlugins/APM/APMFlightModesComponent.qml
  8. 162
      src/AutoPilotPlugins/APM/APMPowerComponent.qml
  9. 2
      src/AutoPilotPlugins/APM/APMSafetyComponent.cc
  10. 41
      src/AutoPilotPlugins/APM/APMSafetyComponentCopter.qml
  11. 39
      src/AutoPilotPlugins/APM/APMSafetyComponentPlane.qml
  12. 3
      src/AutoPilotPlugins/APM/APMSensorsComponent.cc
  13. 36
      src/AutoPilotPlugins/APM/APMSensorsComponent.qml
  14. 2
      src/AutoPilotPlugins/APM/APMTuningComponent.cc
  15. 41
      src/AutoPilotPlugins/APM/APMTuningComponentCopter.qml
  16. BIN
      src/FirmwarePlugin/APM/APMBrandImage.png
  17. 1
      src/FirmwarePlugin/APM/APMFirmwarePlugin.h
  18. 3
      src/FirmwarePlugin/FirmwarePlugin.h
  19. BIN
      src/FirmwarePlugin/PX4/PX4BrandImage.png
  20. 1
      src/FirmwarePlugin/PX4/PX4FirmwarePlugin.h
  21. 5
      src/Vehicle/Vehicle.cc
  22. 2
      src/Vehicle/Vehicle.h
  23. 11
      src/ui/toolbar/MainToolBar.qml

2
qgcresources.qrc

@ -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>

4
src/AutoPilotPlugins/APM/APMAirframeComponent.cc

@ -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

66
src/AutoPilotPlugins/APM/APMAirframeComponent.qml

@ -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 {
} }
} }
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 {
} }
} }
} }
} } // Column
} } // Component - pageComponent
} // QGCViewPanel } // SetupPage
} // QGCView

2
src/AutoPilotPlugins/APM/APMCameraComponent.cc

@ -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

40
src/AutoPilotPlugins/APM/APMCameraComponent.qml

@ -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 {
} // 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 {
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 {
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 {
Loader { Loader {
id: gimbalSettingsLoader id: gimbalSettingsLoader
anchors.margins: _margins
anchors.top: gimbalDirectionPanLoader.bottom
} }
} // Flickable } // Column
} // QGCViewPanel } // Component
} // QGCView } // SetupPage

2
src/AutoPilotPlugins/APM/APMFlightModesComponent.cc

@ -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

28
src/AutoPilotPlugins/APM/APMFlightModesComponent.qml

@ -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 {
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 {
} // Rectangle - Channel options } // Rectangle - Channel options
} // Column - Channel options } // Column - Channel options
} // Flow } // Flow
} // QGCFlickable } // Component - flightModePageComponent
} // QGCViewPanel } // SetupPage
} // QGCView

162
src/AutoPilotPlugins/APM/APMPowerComponent.qml

@ -11,6 +11,7 @@
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.FactControls 1.0
@ -18,9 +19,15 @@ 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: rootQGCView id: powerPage
viewPanel: panel pageComponent: powerPageComponent
Component {
id: powerPageComponent
Column {
spacing: _margins
property Fact battAmpPerVolt: controller.getParameterFact(-1, "BATT_AMP_PERVOLT") property Fact battAmpPerVolt: controller.getParameterFact(-1, "BATT_AMP_PERVOLT")
property Fact battCapacity: controller.getParameterFact(-1, "BATT_CAPACITY") property Fact battCapacity: controller.getParameterFact(-1, "BATT_CAPACITY")
@ -29,8 +36,9 @@ QGCView {
property Fact battVoltMult: controller.getParameterFact(-1, "BATT_VOLT_MULT") property Fact battVoltMult: controller.getParameterFact(-1, "BATT_VOLT_MULT")
property Fact battVoltPin: controller.getParameterFact(-1, "BATT_VOLT_PIN") property Fact battVoltPin: controller.getParameterFact(-1, "BATT_VOLT_PIN")
property real _margins: ScreenTools.defaultFontPixelHeight property real _margins: ScreenTools.defaultFontPixelHeight / 2
property bool _showAdvanced: sensorCombo.currentIndex == sensorModel.count - 1 property bool _showAdvanced: sensorCombo.currentIndex == sensorModel.count - 1
property real _fieldWidth: ScreenTools.defaultFontPixelWidth * 25
Component.onCompleted: calcSensor() Component.onCompleted: calcSensor()
@ -47,9 +55,12 @@ QGCView {
sensorCombo.currentIndex = sensorModel.count - 1 sensorCombo.currentIndex = sensorModel.count - 1
} }
QGCPalette { id: palette; colorGroupEnabled: panel.enabled } QGCPalette { id: palette; colorGroupEnabled: true }
FactPanelController { id: controller; factPanel: panel } FactPanelController {
id: controller
factPanel: powerPage.viewPanel
}
ListModel { ListModel {
id: sensorModel id: sensorModel
@ -199,66 +210,41 @@ QGCView {
} // QGCViewDialog } // QGCViewDialog
} // Component - calcAmpsPerVoltDlgComponent } // Component - calcAmpsPerVoltDlgComponent
QGCViewPanel { GridLayout {
id: panel columns: 3
anchors.fill: parent rowSpacing: _margins
columnSpacing: _margins
QGCFlickable { QGCLabel { text: qsTr("Battery monitor:") }
anchors.fill: parent
clip: true
contentWidth: capacityField.x + capacityField.width + _margins
contentHeight: (_showAdvanced ? ampPerVoltHelp.y + ampPerVoltHelp.height : sensorCombo.y + sensorCombo.height) + _margins
QGCLabel {
id: monitorLabel
anchors.margins: _margins
anchors.left: parent.left
anchors.baseline: monitorCombo.baseline
text: qsTr("Battery monitor:")
}
FactComboBox { FactComboBox {
id: monitorCombo id: monitorCombo
anchors.topMargin: _margins Layout.minimumWidth: _fieldWidth
anchors.top: parent.top
anchors.left: capacityField.left
width: capacityField.width
fact: battMonitor fact: battMonitor
indexModel: false indexModel: false
} }
QGCLabel { QGCLabel {
id: capacityLabel Layout.row: 1
anchors.margins: _margins Layout.column: 0
anchors.left: parent.left
anchors.baseline: capacityField.baseline
text: qsTr("Battery capacity:") text: qsTr("Battery capacity:")
} }
FactTextField { FactTextField {
id: capacityField id: capacityField
anchors.leftMargin: _margins width: _fieldWidth
anchors.topMargin: _margins / 2
anchors.top: monitorCombo.bottom
anchors.left: capacityLabel.right
width: ScreenTools.defaultFontPixelWidth * 25
fact: battCapacity fact: battCapacity
} }
QGCLabel { QGCLabel {
id: sensorLabel Layout.row: 2
anchors.margins: _margins Layout.column: 0
anchors.left: parent.left
anchors.baseline: sensorCombo.baseline
text: qsTr("Power sensor:") text: qsTr("Power sensor:")
} }
QGCComboBox { QGCComboBox {
id: sensorCombo id: sensorCombo
anchors.topMargin: _margins Layout.minimumWidth: _fieldWidth
anchors.top: capacityField.bottom
anchors.left: capacityField.left
width: capacityField.width
model: sensorModel model: sensorModel
onActivated: { onActivated: {
@ -274,128 +260,86 @@ QGCView {
} }
QGCLabel { QGCLabel {
id: currPinLabel Layout.row: 3
anchors.margins: _margins Layout.column: 0
anchors.left: parent.left
anchors.baseline: currPinCombo.baseline
text: qsTr("Current pin:") text: qsTr("Current pin:")
visible: _showAdvanced visible: _showAdvanced
} }
FactComboBox { FactComboBox {
id: currPinCombo Layout.minimumWidth: _fieldWidth
anchors.topMargin: _margins
anchors.top: sensorCombo.bottom
anchors.left: capacityField.left
width: capacityField.width
fact: battCurrPin fact: battCurrPin
indexModel: false
visible: _showAdvanced visible: _showAdvanced
} }
QGCLabel { QGCLabel {
id: voltPinLabel Layout.row: 4
anchors.margins: _margins Layout.column: 0
anchors.left: parent.left
anchors.baseline: voltPinCombo.baseline
text: qsTr("Voltage pin:") text: qsTr("Voltage pin:")
visible: _showAdvanced visible: _showAdvanced
} }
FactComboBox { FactComboBox {
id: voltPinCombo Layout.minimumWidth: _fieldWidth
anchors.topMargin: _margins / 2
anchors.top: currPinCombo.bottom
anchors.left: capacityField.left
width: capacityField.width
fact: battVoltPin fact: battVoltPin
indexModel: false indexModel: false
visible: _showAdvanced visible: _showAdvanced
} }
QGCLabel { QGCLabel {
id: voltMultLabel Layout.row: 5
anchors.margins: _margins Layout.column: 0
anchors.left: parent.left
anchors.baseline: voltMultField.baseline
text: qsTr("Voltage multiplier:") text: qsTr("Voltage multiplier:")
visible: _showAdvanced visible: _showAdvanced
} }
FactTextField { FactTextField {
id: voltMultField width: _fieldWidth
anchors.topMargin: _margins
anchors.top: voltPinCombo.bottom
anchors.left: capacityField.left
width: capacityField.width
fact: battVoltMult fact: battVoltMult
visible: _showAdvanced visible: _showAdvanced
} }
QGCButton { QGCButton {
id: voltMultCalculateButton text: qsTr("Calculate")
anchors.margins: _margins
anchors.left: voltMultField.right
anchors.baseline: voltMultField.baseline
text: "Calculate"
visible: _showAdvanced
onClicked: showDialog(calcVoltageMultiplierDlgComponent, qsTr("Calculate Voltage Multiplier"), qgcView.showDialogDefaultWidth, StandardButton.Close) onClicked: showDialog(calcVoltageMultiplierDlgComponent, qsTr("Calculate Voltage Multiplier"), qgcView.showDialogDefaultWidth, StandardButton.Close)
visible: _showAdvanced
} }
QGCLabel { QGCLabel {
id: voltMultHelp Layout.columnSpan: 3
anchors.left: voltMultLabel.left Layout.fillWidth: true
anchors.right: voltMultCalculateButton.right
anchors.topMargin: _margins / 2
anchors.top: voltMultField.bottom
font.pointSize: ScreenTools.smallFontPointSize font.pointSize: ScreenTools.smallFontPointSize
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: "If the battery voltage reported by the vehicle is largely different than the voltage read externally using a voltmeter you can adjust the voltage multiplier value to correct this. " + text: qsTr("If the battery voltage reported by the vehicle is largely different than the voltage read externally using a voltmeter you can adjust the voltage multiplier value to correct this. Click the Calculate button for help with calculating a new value.")
"Click the Calculate button for help with calculating a new value."
visible: _showAdvanced visible: _showAdvanced
} }
QGCLabel { QGCLabel {
id: ampPerVoltLabel
anchors.margins: _margins
anchors.left: parent.left
anchors.baseline: ampPerVoltField.baseline
text: qsTr("Amps per volt:") text: qsTr("Amps per volt:")
visible: _showAdvanced visible: _showAdvanced
} }
FactTextField { FactTextField {
id: ampPerVoltField width: _fieldWidth
anchors.topMargin: _margins
anchors.top: voltMultHelp.bottom
anchors.left: capacityField.left
width: capacityField.width
fact: battAmpPerVolt fact: battAmpPerVolt
visible: _showAdvanced visible: _showAdvanced
} }
QGCButton { QGCButton {
id: ampPerVoltCalculateButton text: qsTr("Calculate")
anchors.margins: _margins
anchors.left: ampPerVoltField.right
anchors.baseline: ampPerVoltField.baseline
text: "Calculate"
visible: _showAdvanced
onClicked: showDialog(calcAmpsPerVoltDlgComponent, qsTr("Calculate Amps per Volt"), qgcView.showDialogDefaultWidth, StandardButton.Close) onClicked: showDialog(calcAmpsPerVoltDlgComponent, qsTr("Calculate Amps per Volt"), qgcView.showDialogDefaultWidth, StandardButton.Close)
visible: _showAdvanced
} }
QGCLabel { QGCLabel {
id: ampPerVoltHelp Layout.columnSpan: 3
anchors.left: ampPerVoltLabel.left Layout.fillWidth: true
anchors.right: ampPerVoltCalculateButton.right
anchors.topMargin: _margins / 2
anchors.top: ampPerVoltField.bottom
font.pointSize: ScreenTools.smallFontPointSize font.pointSize: ScreenTools.smallFontPointSize
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: "If the current draw reported by the vehicle is largely different than the current read externally using a current meter you can adjust the amps per volt value to correct this. " + text: qsTr("If the current draw reported by the vehicle is largely different than the current read externally using a current meter you can adjust the amps per volt value to correct this. Click the Calculate button for help with calculating a new value.")
"Click the Calculate button for help with calculating a new value."
visible: _showAdvanced visible: _showAdvanced
} }
} // QGCFlickable } // GridLayout
} // QGCViewPanel } // Column
} // QGCView } // Component
} // SetupPage

2
src/AutoPilotPlugins/APM/APMSafetyComponent.cc

@ -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

41
src/AutoPilotPlugins/APM/APMSafetyComponentCopter.qml

@ -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 {
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 {
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 {
} // Rectangle - Arming checks } // Rectangle - Arming checks
} // Column - Arming Checks } // Column - Arming Checks
} // Flow } // Flow
} // QGCFlickable } // Component - safetyPageComponent
} // QGCViewPanel } // SetupView
} // QGCView

39
src/AutoPilotPlugins/APM/APMSafetyComponentPlane.qml

@ -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 {
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 {
} // Rectangle - RTL Settings } // Rectangle - RTL Settings
} // Column - RTL Settings } // Column - RTL Settings
} // Flow } // Flow
} // QGCFlickable } // Component
} // QGCViewPanel } // SetupView
} // QGCView

3
src/AutoPilotPlugins/APM/APMSensorsComponent.cc

@ -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

36
src/AutoPilotPlugins/APM/APMSensorsComponent.qml

@ -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
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 {
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 {
} }
} }
QGCPalette { id: qgcPal; colorGroupEnabled: panel.enabled } QGCPalette { id: qgcPal; colorGroupEnabled: true }
Component { Component {
id: postCalibrationDialogComponent id: postCalibrationDialogComponent
@ -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 {
} // 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 {
} }
} // Item - Cal display area } // Item - Cal display area
} // Column - cal display } // Column - cal display
} // QGCViewPanel } // Row
} // QGCView } // Component - sensorsPageComponent
} // SetupPage

2
src/AutoPilotPlugins/APM/APMTuningComponent.cc

@ -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

41
src/AutoPilotPlugins/APM/APMTuningComponentCopter.qml

@ -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 {
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 {
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 {
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 {
} // 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

BIN
src/FirmwarePlugin/APM/APMBrandImage.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

1
src/FirmwarePlugin/APM/APMFirmwarePlugin.h

@ -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);

3
src/FirmwarePlugin/FirmwarePlugin.h

@ -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

BIN
src/FirmwarePlugin/PX4/PX4BrandImage.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

1
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.h

@ -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.

5
src/Vehicle/Vehicle.cc

@ -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";

2
src/Vehicle/Vehicle.h

@ -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:
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; }

11
src/ui/toolbar/MainToolBar.qml

@ -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

Loading…
Cancel
Save