Commit 8bc1336d authored by Don Gagne's avatar Don Gagne
Browse files

Convert setup pages to use SetupPage

parent 76013297
......@@ -45,10 +45,10 @@ public:
Q_PROPERTY(int minChannelCount MEMBER _chanMinimum CONSTANT)
Q_PROPERTY(int channelCount READ channelCount NOTIFY channelCountChanged)
Q_PROPERTY(QQuickItem* statusText MEMBER _statusText)
Q_PROPERTY(QQuickItem* cancelButton MEMBER _cancelButton)
Q_PROPERTY(QQuickItem* nextButton MEMBER _nextButton)
Q_PROPERTY(QQuickItem* skipButton MEMBER _skipButton)
Q_PROPERTY(QQuickItem* statusText MEMBER _statusText NOTIFY statusTextChanged)
Q_PROPERTY(QQuickItem* cancelButton MEMBER _cancelButton NOTIFY cancelButtonChanged)
Q_PROPERTY(QQuickItem* nextButton MEMBER _nextButton NOTIFY nextButtonChanged)
Q_PROPERTY(QQuickItem* skipButton MEMBER _skipButton NOTIFY skipButtonChanged)
Q_PROPERTY(bool rollChannelMapped READ rollChannelMapped NOTIFY rollChannelMappedChanged)
Q_PROPERTY(bool pitchChannelMapped READ pitchChannelMapped NOTIFY pitchChannelMappedChanged)
......@@ -103,6 +103,11 @@ public:
void setTransmitterMode(int mode);
signals:
void statusTextChanged(void);
void cancelButtonChanged(void);
void nextButtonChanged(void);
void skipButtonChanged(void);
void channelCountChanged(int channelCount);
void channelRCValueChanged(int channel, int rcValue);
......
......@@ -24,7 +24,9 @@ QGCView {
id: setupView
viewPanel: setupPanel
property alias pageComponent: pageLoader.sourceComponent
property alias pageComponent: pageLoader.sourceComponent
property real availableWidth: width - pageLoader.x
property real availableHeight: height - pageLoader.y
property real _margins: ScreenTools.defaultFontPixelHeight / 2
......@@ -36,14 +38,13 @@ QGCView {
QGCFlickable {
anchors.fill: parent
contentWidth: pageLoader.item.x + pageLoader.item.width
contentHeight: pageLoader.item.y + pageLoader.item.height
contentWidth: pageLoader.x + pageLoader.item.width
contentHeight: pageLoader.y + pageLoader.item.height
clip: true
Column {
id: headingColumn
anchors.left: parent.left
anchors.right: parent.right
width: setupPanel.width
spacing: _margins
QGCLabel {
......@@ -62,9 +63,10 @@ QGCView {
}
Loader {
id: pageLoader
anchors.topMargin: _margins
anchors.top: headingColumn.bottom
id: pageLoader
}
}
}
......
......@@ -113,7 +113,7 @@ QString AirframeComponent::name(void) const
QString AirframeComponent::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.");
}
......
......@@ -20,140 +20,131 @@ import QGroundControl.Controls 1.0
import QGroundControl.Controllers 1.0
import QGroundControl.ScreenTools 1.0
QGCView {
id: qgcView
viewPanel: panel
QGCPalette { id: qgcPal; colorGroupEnabled: panel.enabled }
property real _minW: ScreenTools.defaultFontPixelWidth * 30
property real _boxWidth: _minW
property real _boxSpace: ScreenTools.defaultFontPixelWidth
function computeDimensions() {
var sw = 0
var rw = 0
var idx = Math.floor(scroll.width / (_minW + ScreenTools.defaultFontPixelWidth))
if(idx < 1) {
_boxWidth = scroll.width
_boxSpace = 0
} else {
_boxSpace = 0
if(idx > 1) {
_boxSpace = ScreenTools.defaultFontPixelWidth
sw = _boxSpace * (idx - 1)
}
rw = scroll.width - sw
_boxWidth = rw / idx
}
}
AirframeComponentController {
id: controller
factPanel: panel
Component.onCompleted: {
if (controller.showCustomConfigPanel) {
showDialog(customConfigDialogComponent, qsTr("Custom Airframe Config"), qgcView.showDialogDefaultWidth, StandardButton.Reset)
}
}
}
SetupPage {
id: airframePage
pageComponent: pageComponent
Component {
id: customConfigDialogComponent
id: pageComponent
QGCViewMessage {
id: customConfigDialog
message: qsTr("Your vehicle is using a custom airframe configuration. ") +
qsTr("This configuration can only be modified through the Parameter Editor.\n\n") +
qsTr("If you want to reset your airframe configuration and select a standard configuration, click 'Reset' above.")
Column {
id: mainColumn
width: availableWidth
property Fact sys_autostart: controller.getParameterFact(-1, "SYS_AUTOSTART")
property real _minW: ScreenTools.defaultFontPixelWidth * 30
property real _boxWidth: _minW
property real _boxSpace: ScreenTools.defaultFontPixelWidth
function accept() {
sys_autostart.value = 0
customConfigDialog.hideDialog()
readonly property real spacerHeight: ScreenTools.defaultFontPixelHeight
onWidthChanged: {
computeDimensions()
}
}
}
Component {
id: applyRestartDialogComponent
Component.onCompleted: computeDimensions()
function computeDimensions() {
var sw = 0
var rw = 0
var idx = Math.floor(mainColumn.width / (_minW + ScreenTools.defaultFontPixelWidth))
if(idx < 1) {
_boxWidth = mainColumn.width
_boxSpace = 0
} else {
_boxSpace = 0
if(idx > 1) {
_boxSpace = ScreenTools.defaultFontPixelWidth
sw = _boxSpace * (idx - 1)
}
rw = mainColumn.width - sw
_boxWidth = rw / idx
}
}
QGCViewDialog {
id: applyRestartDialog
AirframeComponentController {
id: controller
factPanel: airframePage.viewPanel
function accept() {
controller.changeAutostart()
applyRestartDialog.hideDialog()
Component.onCompleted: {
if (controller.showCustomConfigPanel) {
showDialog(customConfigDialogComponent, qsTr("Custom Airframe Config"), qgcView.showDialogDefaultWidth, StandardButton.Reset)
}
}
}
QGCLabel {
anchors.fill: parent
wrapMode: Text.WordWrap
text: qsTr("Clicking “Apply” will save the changes you have made to your airframe configuration. ") +
qsTr("Your vehicle will also be restarted in order to complete the process.")
Component {
id: customConfigDialogComponent
QGCViewMessage {
id: customConfigDialog
message: qsTr("Your vehicle is using a custom airframe configuration. ") +
qsTr("This configuration can only be modified through the Parameter Editor.\n\n") +
qsTr("If you want to reset your airframe configuration and select a standard configuration, click 'Reset' above.")
property Fact sys_autostart: controller.getParameterFact(-1, "SYS_AUTOSTART")
function accept() {
sys_autostart.value = 0
customConfigDialog.hideDialog()
}
}
}
}
}
QGCViewPanel {
id: panel
anchors.fill: parent
readonly property real spacerHeight: ScreenTools.defaultFontPixelHeight
Item {
id: helpApplyRow
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
height: Math.max(helpText.contentHeight, applyButton.height)
QGCLabel {
id: helpText
width: parent.width - applyButton.width - 5
text: (controller.currentVehicleName != "" ?
qsTr("You've connected a %1.").arg(controller.currentVehicleName) :
qsTr("Airframe is not set.")) +
qsTr("To change this configuration, select the desired airframe below then click “Apply and Restart”.")
font.family: ScreenTools.demiboldFontFamily
wrapMode: Text.WordWrap
Component {
id: applyRestartDialogComponent
QGCViewDialog {
id: applyRestartDialog
function accept() {
controller.changeAutostart()
applyRestartDialog.hideDialog()
}
QGCLabel {
anchors.fill: parent
wrapMode: Text.WordWrap
text: qsTr("Clicking “Apply” will save the changes you have made to your airframe configuration. ") +
qsTr("Your vehicle will also be restarted in order to complete the process.")
}
}
}
QGCButton {
id: applyButton
Item {
id: helpApplyRow
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Apply and Restart")
height: Math.max(helpText.contentHeight, applyButton.height)
QGCLabel {
id: helpText
width: parent.width - applyButton.width - 5
text: (controller.currentVehicleName != "" ?
qsTr("You've connected a %1.").arg(controller.currentVehicleName) :
qsTr("Airframe is not set.")) +
qsTr("To change this configuration, select the desired airframe below then click “Apply and Restart”.")
font.family: ScreenTools.demiboldFontFamily
wrapMode: Text.WordWrap
}
QGCButton {
id: applyButton
anchors.right: parent.right
text: qsTr("Apply and Restart")
onClicked: showDialog(applyRestartDialogComponent, qsTr("Apply and Restart"), qgcView.showDialogDefaultWidth, StandardButton.Apply | StandardButton.Cancel)
onClicked: showDialog(applyRestartDialogComponent, qsTr("Apply and Restart"), qgcView.showDialogDefaultWidth, StandardButton.Apply | StandardButton.Cancel)
}
}
}
Item {
id: lastSpacer
anchors.top: helpApplyRow.bottom
height: parent.spacerHeight
width: 10
}
QGCFlickable {
id: scroll
anchors.top: lastSpacer.bottom
anchors.bottom: parent.bottom
width: parent.width
clip: true
contentHeight: flowView.height
contentWidth: parent.width
flickableDirection: Flickable.VerticalFlick
onWidthChanged: {
computeDimensions()
Item {
id: lastSpacer
height: parent.spacerHeight
width: 10
}
Flow {
id: flowView
width: scroll.width
width: parent.width
spacing: _boxSpace
ExclusiveGroup {
......@@ -246,6 +237,6 @@ QGCView {
}
} // Repeater - summary boxes
} // Flow - summary boxes
} // Scroll View - summary boxes
} // QGCViewPanel
} // QGCView
} // Column
} // Component
} // SetupPage
......@@ -29,7 +29,7 @@ QString CameraComponent::name(void) const
QString CameraComponent::description(void) const
{
return tr("The Camera is used to setup the camera modes and hardware configuration to use it.");
return tr("Camera setup is used to adjust camera and gimbal settings.");
}
QString CameraComponent::iconResource(void) const
......
......@@ -17,99 +17,90 @@ import QtGraphicalEffects 1.0
import QGroundControl 1.0
import QGroundControl.FactSystem 1.0
import QGroundControl.FactControls 1.0
import QGroundControl.Palette 1.0
import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0
QGCView {
id: _cameraView
viewPanel: panel
anchors.fill: parent
SetupPage {
id: cameraPage
pageComponent: pageComponent
FactPanelController { id: controller; factPanel: panel }
Component {
id: pageComponent
QGCPalette { id: palette; colorGroupEnabled: enabled }
Column {
width: availableWidth
property real _margins: ScreenTools.defaultFontPixelHeight
property real _middleRowWidth: ScreenTools.defaultFontPixelWidth * 16
property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 16
FactPanelController { id: controller; factPanel: cameraPage.viewPanel }
property Fact _camTriggerMode: controller.getParameterFact(-1, "TRIG_MODE")
property Fact _camTriggerInterface: controller.getParameterFact(-1, "TRIG_INTERFACE", false)
property Fact _camTriggerPol: controller.getParameterFact(-1, "TRIG_POLARITY", false) // Don't bitch about missing as these only exist if trigger mode is enabled
property Fact _auxPins: controller.getParameterFact(-1, "TRIG_PINS", false) // Ditto
property real _margins: ScreenTools.defaultFontPixelHeight
property real _middleRowWidth: ScreenTools.defaultFontPixelWidth * 16
property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 16
property bool _rebooting: false
property var _auxChannels: [ 0, 0, 0, 0, 0, 0]
property Fact _camTriggerMode: controller.getParameterFact(-1, "TRIG_MODE")
property Fact _camTriggerInterface: controller.getParameterFact(-1, "TRIG_INTERFACE", false)
property Fact _camTriggerPol: controller.getParameterFact(-1, "TRIG_POLARITY", false) // Don't bitch about missing as these only exist if trigger mode is enabled
property Fact _auxPins: controller.getParameterFact(-1, "TRIG_PINS", false) // Ditto
function clearAuxArray() {
for(var i = 0; i < 6; i++) {
_auxChannels[i] = 0
}
}
property bool _rebooting: false
property var _auxChannels: [ 0, 0, 0, 0, 0, 0]
function setAuxPins() {
if(_auxPins) {
var values = ""
for(var i = 0; i < 6; i++) {
if(_auxChannels[i]) {
values += ((i+1).toString())
function clearAuxArray() {
for(var i = 0; i < 6; i++) {
_auxChannels[i] = 0
}
}
_auxPins.value = parseInt(values)
}
}
Component.onCompleted: {
if(_auxPins) {
clearAuxArray()
var values = _auxPins.value.toString()
for(var i = 0; i < values.length; i++) {
var b = parseInt(values[i]) - 1
if(b >= 0 && b < 6) {
_auxChannels[b] = 1
function setAuxPins() {
if(_auxPins) {
var values = ""
for(var i = 0; i < 6; i++) {
if(_auxChannels[i]) {
values += ((i+1).toString())
}
}
_auxPins.value = parseInt(values)
}
}
}
}
QGCViewPanel {
id: panel
anchors.fill: parent
Item {
id: applyAndRestart
visible: false
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 10
anchors.rightMargin: ScreenTools.defaultFontPixelWidth * 10
height: applyButton.height
QGCLabel {
anchors.left: parent.left
text: qsTr("Vehicle must be restarted for changes to take effect. ")
Component.onCompleted: {
if(_auxPins) {
clearAuxArray()
var values = _auxPins.value.toString()
for(var i = 0; i < values.length; i++) {
var b = parseInt(values[i]) - 1
if(b >= 0 && b < 6) {
_auxChannels[b] = 1
}
}
}
}
QGCButton {
id: applyButton
anchors.right: parent.right
text: qsTr("Apply and Restart")
onClicked: {
//-- This will reboot the vehicle! We're set not to allow changes if armed.
QGroundControl.multiVehicleManager.activeVehicle.rebootVehicle()
applyAndRestart.visible = false
_rebooting = true
Item {
id: applyAndRestart
visible: false
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 10
anchors.rightMargin: ScreenTools.defaultFontPixelWidth * 10
height: applyButton.height
QGCLabel {
anchors.left: parent.left
text: qsTr("Vehicle must be restarted for changes to take effect. ")
}
QGCButton {
id: applyButton
anchors.right: parent.right
text: qsTr("Apply and Restart")
onClicked: {
//-- This will reboot the vehicle! We're set not to allow changes if armed.
QGroundControl.multiVehicleManager.activeVehicle.rebootVehicle()
applyAndRestart.visible = false
_rebooting = true
}
}
}
}
QGCFlickable {
clip: true
anchors.top: applyAndRestart.visible ? applyAndRestart.bottom : parent.top
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
contentHeight: mainCol.height
flickableDirection: Flickable.VerticalFlick
Column {
id: mainCol
spacing: _margins
......@@ -123,7 +114,7 @@ QGCView {
}
Rectangle {
id: camTrigRect
color: palette.windowShade
color: qgcPal.windowShade
width: camTrigRow.width + _margins * 2
height: camTrigRow.height + _margins * 2
Row {
......@@ -132,7 +123,7 @@ QGCView {
anchors.verticalCenter: parent.verticalCenter
Item { width: _margins * 0.5; height: 1; }
QGCColoredImage {
color: palette.text
color: qgcPal.text
height: ScreenTools.defaultFontPixelWidth * 10
width: ScreenTools.defaultFontPixelWidth * 20
sourceSize.width: width
......@@ -185,7 +176,7 @@ QGCView {
text: qsTr("Time Interval")
width: _middleRowWidth
anchors.baseline: timeIntervalField.baseline
color: palette.text
color: qgcPal.text
}
FactTextField {
id: timeIntervalField
......@@ -200,7 +191,7 @@ QGCView {
text: qsTr("Distance Interval")
width: _middleRowWidth
anchors.baseline: trigDistField.baseline
color: palette.text
color: qgcPal.text
}
FactTextField {
id: trigDistField
......@@ -223,7 +214,7 @@ QGCView {
visible: _auxPins
}
Rectangle {
color: palette.windowShade
color: qgcPal.windowShade
width: camTrigRect.width
height: camHardwareRow.height + _margins * 2
visible: _auxPins
......@@ -251,31 +242,31 @@ QGCView {
spacing: ScreenTools.defaultFontPixelWidth * 0.5
QGCLabel {
text: model.index + 1
color: palette.text
color: qgcPal.text
anchors.horizontalCenter: parent.horizontalCenter
}
Rectangle {
id: auxPin
width: ScreenTools.defaultFontPixelWidth * 2
height: ScreenTools.defaultFontPixelWidth * 2
border.color: palette.text
border.color: qgcPal.text
color: {
if(_auxPins) {
var pins = _auxPins.value.toString()
var pin = (model.index + 1).toString()
if(pins.indexOf(pin) < 0)
return palette.windowShadeDark
return qgcPal.windowShadeDark
else
return "green"
} else {
return palette.windowShade
return qgcPal.windowShade
}
}
MouseArea {
anchors.fill: parent
onClicked: {
_auxChannels[model.index] = 1 - _auxChannels[model.index]
auxPin.color = _auxChannels[model.index] ? "green" : palette.windowShadeDark
auxPin.color = _auxChannels[model.index] ? "green" : qgcPal.windowShadeDark
setAuxPins()
}
}
......@@ -327,7 +318,7 @@ QGCView {
text: qsTr("Trigger Period")
width: _middleRowWidth
anchors.baseline: trigPeriodField.baseline
color: palette.text
color: qgcPal.text
}
FactTextField {
id: trigPeriodField
......@@ -343,4 +334,3 @@ QGCView {
}
}
}
......@@ -33,9 +33,7 @@ QString FlightModesComponent::name(void) const
QString FlightModesComponent::description(void) const
{
// FIXME: Better text
return tr("The Flight Modes Component is used to set the switches associated with Flight Modes. "
"At a minimum the Main Mode Switch must be assigned prior to flight.");
return tr("Flight Modes Setup is used to configure the transmitter switches associated with Flight Modes.");
}
QString FlightModesComponent::iconResource(void) const
......
......@@ -91,8 +91,6 @@ Item {
readonly property real modeSpacing: ScreenTools.defaultFontPixelHeight / 3
QGCPalette { id: qgcPal; colorGroupEnabled: panel.enabled }
PX4AdvancedFlightModesController {
id: controller
factPanel: qgcViewPanel
......
......@@ -23,33 +23,31 @@ import QGroundControl.ScreenTools 1.0
/// PX4 Flight Mode configuration. This control will load either the Simple or Advanced Flight Mode config
/// based on current parameter settings.
QGCView {
id: rootQGCView
viewPanel: panel
SetupPage {
id: flightModesPage
pageComponent: pageComponent
property Fact _nullFact
property bool _rcMapFltmodeExists: controller.parameterExists(-1, "RC_MAP_FLTMODE")
property Fact _rcMapFltmode: _rcMapFltmodeExists ? controller.getParameterFact(-1, "RC_MAP_FLTMODE") : _nullFact
property Fact _rcMapModeSw: controller.getParameterFact(-1, "RC_MAP_MODE_SW")
property bool _simpleMode: _rcMapFltmodeExists ? _rcMapFltmode.value > 0 || _rcMapModeSw.value == 0 : false
QGCPalette { id: qgcPal; colorGroupEnabled: panel.enabled }
FactPanelController {
id: controller
factPanel: panel
}
QGCViewPanel {
id: panel
anchors.fill: parent
Component {
id: pageComponent
Loader {
anchors.fill: parent
source: _simpleMode ? "qrc:/qml/PX4SimpleFlightModes.qml" : "qrc:/qml/PX4AdvancedFlightModes.qml"
property var qgcView: rootQGCView
property var qgcViewPanel: panel
width: availableWidth
height: availableHeight
source: _simpleMode ? "qrc:/qml/PX4SimpleFlightModes.qml" : "qrc:/qml/PX4AdvancedFlightModes.qml"
property Fact _nullFact
property bool _rcMapFltmodeExists: controller.parameterExists(-1, "RC_MAP_FLTMODE")
property Fact _rcMapFltmode: _rcMapFltmodeExists ? controller.getParameterFact(-1, "RC_MAP_FLTMODE") : _nullFact
property Fact _rcMapModeSw: controller.getParameterFact(-1, "RC_MAP_MODE_SW")
property bool _simpleMode: _rcMapFltmodeExists ? _rcMapFltmode.value > 0 || _rcMapModeSw.value == 0 : false
FactPanelController {
id: controller
factPanel: flightModesPage.viewPanel
}
property var qgcView: flightModesPage
property var qgcViewPanel: flightModesPage.viewPanel
}
} // QGCViewPanel
} // QGCView
}
}
......@@ -24,9 +24,8 @@ QString PX4RadioComponent::name(void) const
QString PX4RadioComponent::description(void) const
{
return tr("The Radio Component is used to setup which channels on your RC Transmitter you will use for each vehicle control such as Roll, Pitch, Yaw and Throttle. "
"It also allows you to assign switches and dials to the various flight modes. "
"Prior to flight you must also calibrate the extents for all of your channels.");
return tr("Radio Setup is used to calibrate your transmitter. "
"It also assign channels for Roll, Pitch, Yaw and Throttle vehicle control as well as determining whether they are reversed.");
}
QString PX4RadioComponent::iconResource(void) const
......
......@@ -30,8 +30,6 @@ Item {
readonly property real _flightModeComboWidth: ScreenTools.defaultFontPixelWidth * 13
readonly property real _channelComboWidth: ScreenTools.defaultFontPixelWidth * 13
QGCPalette { id: qgcPal; colorGroupEnabled: panel.enabled }
PX4SimpleFlightModesController {
id: controller
factPanel: qgcViewPanel
......
......@@ -25,7 +25,7 @@ QString PX4TuningComponent::name(void) const
QString PX4TuningComponent::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 PX4TuningComponent::iconResource(void) const
......
......@@ -13,63 +13,72 @@ import QtQuick.Controls 1.4
import QGroundControl.Controls 1.0
FactSliderPanel {
anchors.fill: parent
panelTitle: "Tuning"
SetupPage {
id: tuningPage
pageComponent: pageComponent
sliderModel: ListModel {
ListElement {
title: qsTr("Hover Throttle")
description: qsTr("Adjust throttle so hover is at mid-throttle. Slide to the left if hover is lower than throttle center. Slide to the right if hover is higher than throttle center.")
param: "MPC_THR_HOVER"
min: 20
max: 80
step: 1
}
Component {
id: pageComponent
ListElement {
title: qsTr("Manual minimum throttle")
description: qsTr("Slide to the left to start the motors with less idle power. Slide to the right if descending in manual flight becomes unstable.")
param: "MPC_MANTHR_MIN"
min: 0
max: 15
step: 1
}
FactSliderPanel {
width: availableWidth
qgcViewPanel: tuningPage.viewPanel
ListElement {
title: qsTr("Roll sensitivity")
description: qsTr("Slide to the left to make roll control faster and more accurate. Slide to the right if roll oscillates or is too twitchy.")
param: "MC_ROLL_TC"
min: 0.15
max: 0.25
step: 0.01
}
sliderModel: ListModel {
ListElement {
title: qsTr("Hover Throttle")
description: qsTr("Adjust throttle so hover is at mid-throttle. Slide to the left if hover is lower than throttle center. Slide to the right if hover is higher than throttle center.")
param: "MPC_THR_HOVER"
min: 20
max: 80
step: 1
}
ListElement {
title: qsTr("Pitch sensitivity")
description: qsTr("Slide to the left to make pitch control faster and more accurate. Slide to the right if pitch oscillates or is too twitchy.")
param: "MC_PITCH_TC"
min: 0.15
max: 0.25
step: 0.01
}
ListElement {
title: qsTr("Manual minimum throttle")
description: qsTr("Slide to the left to start the motors with less idle power. Slide to the right if descending in manual flight becomes unstable.")
param: "MPC_MANTHR_MIN"
min: 0
max: 15
step: 1
}
ListElement {
title: qsTr("Altitude control sensitivity")
description: qsTr("Slide to the left to make altitude control smoother and less twitchy. Slide to the right to make altitude control more accurate and more aggressive.")
param: "MPC_Z_FF"
min: 0
max: 1.0
step: 0.1
}
ListElement {
title: qsTr("Roll sensitivity")
description: qsTr("Slide to the left to make roll control faster and more accurate. Slide to the right if roll oscillates or is too twitchy.")
param: "MC_ROLL_TC"
min: 0.15
max: 0.25
step: 0.01
}
ListElement {
title: qsTr("Pitch sensitivity")
description: qsTr("Slide to the left to make pitch control faster and more accurate. Slide to the right if pitch oscillates or is too twitchy.")
param: "MC_PITCH_TC"
min: 0.15
max: 0.25
step: 0.01
}
ListElement {
title: qsTr("Altitude control sensitivity")
description: qsTr("Slide to the left to make altitude control smoother and less twitchy. Slide to the right to make altitude control more accurate and more aggressive.")
param: "MPC_Z_FF"
min: 0
max: 1.0
step: 0.1
}
ListElement {
title: qsTr("Position control sensitivity")
description: qsTr("Slide to the left to make flight in position control mode smoother and less twitchy. Slide to the right to make position control more accurate and more aggressive.")
param: "MPC_XY_FF"
min: 0
max: 1.0
step: 0.1
ListElement {
title: qsTr("Position control sensitivity")
description: qsTr("Slide to the left to make flight in position control mode smoother and less twitchy. Slide to the right to make position control more accurate and more aggressive.")
param: "MPC_XY_FF"
min: 0
max: 1.0
step: 0.1
}
}
}
}
}
} // Component
} // SetupPage
......@@ -13,44 +13,54 @@ import QtQuick.Controls 1.4
import QGroundControl.Controls 1.0
FactSliderPanel {
anchors.fill: parent
sliderModel: ListModel {
ListElement {
title: "Roll sensitivity"
description: "Slide to the left to make roll control faster and more accurate. Slide to the right if roll oscillates or is too twitchy."
param: "FW_R_TC"
min: 0.2
max: 0.8
step: 0.01
}
SetupPage {
id: tuningPage
pageComponent: pageComponent
ListElement {
title: "Pitch sensitivity"
description: "Slide to the left to make pitch control faster and more accurate. Slide to the right if pitch oscillates or is too twitchy."
param: "FW_P_TC"
min: 0.2
max: 0.8
step: 0.01
}
Component {
id: pageComponent
ListElement {
title: "Cruise throttle"
description: "This is the throttle setting required to achieve the desired cruise speed. Most planes need 50-60%."
param: "FW_THR_CRUISE"
min: 20
max: 80
step: 1
}
FactSliderPanel {
width: availableWidth
qgcViewPanel: tuningPage.viewPanel
sliderModel: ListModel {
ListElement {
title: "Roll sensitivity"
description: "Slide to the left to make roll control faster and more accurate. Slide to the right if roll oscillates or is too twitchy."
param: "FW_R_TC"
min: 0.2
max: 0.8
step: 0.01
}
ListElement {
title: "Pitch sensitivity"
description: "Slide to the left to make pitch control faster and more accurate. Slide to the right if pitch oscillates or is too twitchy."
param: "FW_P_TC"
min: 0.2
max: 0.8
step: 0.01
}
ListElement {
title: "Cruise throttle"
description: "This is the throttle setting required to achieve the desired cruise speed. Most planes need 50-60%."
param: "FW_THR_CRUISE"
min: 20
max: 80
step: 1
}
ListElement {
title: "Mission mode sensitivity"
description: "Slide to the left to make position control more accurate and more aggressive. Slide to the right to make flight in mission mode smoother and less twitchy."
param: "FW_L1_PERIOD"
min: 12
max: 50
step: 0.5
ListElement {
title: "Mission mode sensitivity"
description: "Slide to the left to make position control more accurate and more aggressive. Slide to the right to make flight in mission mode smoother and less twitchy."
param: "FW_L1_PERIOD"
min: 12
max: 50
step: 0.5
}
}
}
}
}
......@@ -13,98 +13,108 @@ import QtQuick.Controls 1.4
import QGroundControl.Controls 1.0
FactSliderPanel {
anchors.fill: parent
sliderModel: ListModel {
ListElement {
title: qsTr("Hover Roll sensitivity")
description: qsTr("Slide to the left to make roll control during hover faster and more accurate. Slide to the right if roll oscillates or is too twitchy.")
param: "MC_ROLL_TC"
min: 0.15
max: 0.25
step: 0.01
}
SetupPage {
id: tuningPage
pageComponent: pageComponent
ListElement {
title: qsTr("Hover Pitch sensitivity")
description: qsTr("Slide to the left to make pitch control during hover faster and more accurate. Slide to the right if pitch oscillates or is too twitchy.")
param: "MC_PITCH_TC"
min: 0.15
max: 0.25
step: 0.01
}
Component {
id: pageComponent
ListElement {
title: qsTr("Hover Altitude control sensitivity")
description: qsTr("Slide to the left to make altitude control during hover smoother and less twitchy. Slide to the right to make altitude control more accurate and more aggressive.")
param: "MPC_Z_FF"
min: 0
max: 1.0
step: 0.1
}
FactSliderPanel {
width: availableWidth
qgcViewPanel: tuningPage.viewPanel
ListElement {
title: qsTr("Hover Position control sensitivity")
description: qsTr("Slide to the left to make flight during hover in position control mode smoother and less twitchy. Slide to the right to make position control more accurate and more aggressive.")
param: "MPC_XY_FF"
min: 0
max: 1.0
step: 0.1
}
ListElement {
title: qsTr("Plane Roll sensitivity")
description: qsTr("Slide to the left to make roll control faster and more accurate. Slide to the right if roll oscillates or is too twitchy.")
param: "FW_R_TC"
min: 0.2
max: 0.8
step: 0.01
}
sliderModel: ListModel {
ListElement {
title: qsTr("Plane Pitch sensitivity")
description: qsTr("Slide to the left to make pitch control faster and more accurate. Slide to the right if pitch oscillates or is too twitchy.")
param: "FW_P_TC"
min: 0.2
max: 0.8
step: 0.01
}
ListElement {
title: qsTr("Hover Roll sensitivity")
description: qsTr("Slide to the left to make roll control during hover faster and more accurate. Slide to the right if roll oscillates or is too twitchy.")
param: "MC_ROLL_TC"
min: 0.15
max: 0.25
step: 0.01
}
ListElement {
title: qsTr("Plane Cruise throttle")
description: qsTr("This is the throttle setting required to achieve the desired cruise speed. Most planes need 50-60%.")
param: "FW_THR_CRUISE"
min: 20
max: 80
step: 1
}
ListElement {
title: qsTr("Hover Pitch sensitivity")
description: qsTr("Slide to the left to make pitch control during hover faster and more accurate. Slide to the right if pitch oscillates or is too twitchy.")
param: "MC_PITCH_TC"
min: 0.15
max: 0.25
step: 0.01
}
ListElement {
title: qsTr("Hover Throttle")
description: qsTr("Adjust throttle so hover is at mid-throttle. Slide to the left if hover is lower than throttle center. Slide to the right if hover is higher than throttle center.")
param: "MPC_THR_HOVER"
min: 20
max: 80
step: 1
}
ListElement {
title: qsTr("Hover Altitude control sensitivity")
description: qsTr("Slide to the left to make altitude control during hover smoother and less twitchy. Slide to the right to make altitude control more accurate and more aggressive.")
param: "MPC_Z_FF"
min: 0
max: 1.0
step: 0.1
}
ListElement {
title: qsTr("Hoever manual minimum throttle")
description: qsTr("Slide to the left to start the motors with less idle power. Slide to the right if descending in manual flight becomes unstable.")
param: "MPC_MANTHR_MIN"
min: 0
max: 15
step: 1
}
ListElement {
title: qsTr("Hover Position control sensitivity")
description: qsTr("Slide to the left to make flight during hover in position control mode smoother and less twitchy. Slide to the right to make position control more accurate and more aggressive.")
param: "MPC_XY_FF"
min: 0
max: 1.0
step: 0.1
}
ListElement {
title: qsTr("Plane Roll sensitivity")
description: qsTr("Slide to the left to make roll control faster and more accurate. Slide to the right if roll oscillates or is too twitchy.")
param: "FW_R_TC"
min: 0.2
max: 0.8
step: 0.01
}
ListElement {
title: qsTr("Plane Pitch sensitivity")
description: qsTr("Slide to the left to make pitch control faster and more accurate. Slide to the right if pitch oscillates or is too twitchy.")
param: "FW_P_TC"
min: 0.2
max: 0.8
step: 0.01
}
ListElement {
title: qsTr("Plane Cruise throttle")
description: qsTr("This is the throttle setting required to achieve the desired cruise speed. Most planes need 50-60%.")
param: "FW_THR_CRUISE"
min: 20
max: 80
step: 1
}
ListElement {
title: qsTr("Hover Throttle")
description: qsTr("Adjust throttle so hover is at mid-throttle. Slide to the left if hover is lower than throttle center. Slide to the right if hover is higher than throttle center.")
param: "MPC_THR_HOVER"
min: 20
max: 80
step: 1
}
ListElement {
title: qsTr("Hoever manual minimum throttle")
description: qsTr("Slide to the left to start the motors with less idle power. Slide to the right if descending in manual flight becomes unstable.")
param: "MPC_MANTHR_MIN"
min: 0
max: 15
step: 1
}
ListElement {
title: qsTr("Plane Mission mode sensitivity")
description: qsTr("Slide to the left to make position control more accurate and more aggressive. Slide to the right to make flight in mission mode smoother and less twitchy.")
param: "FW_L1_PERIOD"
min: 12
max: 50
step: 0.5
ListElement {
title: qsTr("Plane Mission mode sensitivity")
description: qsTr("Slide to the left to make position control more accurate and more aggressive. Slide to the right to make flight in mission mode smoother and less twitchy.")
param: "FW_L1_PERIOD"
min: 12
max: 50
step: 0.5
}
}
}
}
}
......@@ -28,7 +28,7 @@ QString PowerComponent::name(void) const
QString PowerComponent::description(void) const
{
return tr("The Power Component is used to setup battery parameters as well as advanced settings for propellers and magnetometer.");
return tr("Power Setup is used to setup battery parameters as well as advanced settings for propellers.");
}
QString PowerComponent::iconResource(void) const
......
This diff is collapsed.
......@@ -27,7 +27,7 @@ QString SafetyComponent::name(void) const
QString SafetyComponent::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 SafetyComponent::iconResource(void) const
......
......@@ -16,48 +16,47 @@ import QtGraphicalEffects 1.0
import QGroundControl.FactSystem 1.0
import QGroundControl.FactControls 1.0
import QGroundControl.Palette 1.0
import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0
QGCView {
id: _safetyView
viewPanel: panel
anchors.fill: parent
SetupPage {
id: safetyPage
pageComponent: pageComponent
FactPanelController { id: controller; factPanel: panel }
Component {
id: pageComponent
QGCPalette { id: palette; colorGroupEnabled: enabled }
Item {
width: Math.max(availableWidth, mainCol.width)
height: mainCol.height
property real _margins: ScreenTools.defaultFontPixelHeight
property real _middleRowWidth: ScreenTools.defaultFontPixelWidth * 20
property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 14
FactPanelController {
id: controller
factPanel: safetyPage.viewPanel
}
property real _margins: ScreenTools.defaultFontPixelHeight
property real _middleRowWidth: ScreenTools.defaultFontPixelWidth * 20
property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 14
property Fact _fenceAction: controller.getParameterFact(-1, "GF_ACTION")
property Fact _fenceRadius: controller.getParameterFact(-1, "GF_MAX_HOR_DIST")
property Fact _fenceAlt: controller.getParameterFact(-1, "GF_MAX_VER_DIST")
property Fact _rtlLandDelay: controller.getParameterFact(-1, "RTL_LAND_DELAY")
property Fact _lowBattAction: controller.getParameterFact(-1, "COM_LOW_BAT_ACT")
property Fact _rcLossAction: controller.getParameterFact(-1, "NAV_RCL_ACT")
property Fact _dlLossAction: controller.getParameterFact(-1, "NAV_DLL_ACT")
property Fact _disarmLandDelay: controller.getParameterFact(-1, "COM_DISARM_LAND")
property Fact _landSpeedMC: controller.getParameterFact(-1, "MPC_LAND_SPEED", false)
property Fact _fenceAction: controller.getParameterFact(-1, "GF_ACTION")
property Fact _fenceRadius: controller.getParameterFact(-1, "GF_MAX_HOR_DIST")
property Fact _fenceAlt: controller.getParameterFact(-1, "GF_MAX_VER_DIST")
property Fact _rtlLandDelay: controller.getParameterFact(-1, "RTL_LAND_DELAY")
property Fact _lowBattAction: controller.getParameterFact(-1, "COM_LOW_BAT_ACT")
property Fact _rcLossAction: controller.getParameterFact(-1, "NAV_RCL_ACT")
property Fact _dlLossAction: controller.getParameterFact(-1, "NAV_DLL_ACT")
property Fact _disarmLandDelay: controller.getParameterFact(-1, "COM_DISARM_LAND")
property Fact _landSpeedMC: controller.getParameterFact(-1, "MPC_LAND_SPEED", false)
property bool _showIcons: !ScreenTools.isTinyScreen
property bool _showIcons: !ScreenTools.isTinyScreen
QGCViewPanel {
id: panel
anchors.fill: parent
QGCFlickable {
clip: true
anchors.fill: parent
contentHeight: mainCol.height
flickableDirection: Flickable.VerticalFlick
Column {
id: mainCol
spacing: _margins
anchors.horizontalCenter: parent.horizontalCenter
/*
**** Low Battery ****
*/
......@@ -67,7 +66,7 @@ QGCView {
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
color: palette.windowShade
color: qgcPal.windowShade
width: rtlSettings.width
height: lowBattRow.height + _margins * 2
Row {
......@@ -81,7 +80,7 @@ QGCView {
sourceSize.width: width
mipmap: true
fillMode: Image.PreserveAspectFit
source: qgcPal.globalTheme === QGCPalette.Light ? "/qmlimages/LowBatteryLight.svg" : "/qmlimages/LowBattery.svg"
source: qgcPal.globalTheme === qgcPal.Light ? "/qmlimages/LowBatteryLight.svg" : "/qmlimages/LowBattery.svg"
anchors.verticalCenter: parent.verticalCenter
visible: _showIcons
}
......@@ -143,7 +142,7 @@ QGCView {
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
color: palette.windowShade
color: qgcPal.windowShade
width: rtlSettings.width
height: rcLossRow.height + _margins * 2
Row {
......@@ -157,7 +156,7 @@ QGCView {
sourceSize.width: width
mipmap: true
fillMode: Image.PreserveAspectFit
source: qgcPal.globalTheme === QGCPalette.Light ? "/qmlimages/RCLossLight.svg" : "/qmlimages/RCLoss.svg"
source: qgcPal.globalTheme === qgcPal.Light ? "/qmlimages/RCLossLight.svg" : "/qmlimages/RCLoss.svg"
anchors.verticalCenter: parent.verticalCenter
visible: _showIcons
}
......@@ -206,7 +205,7 @@ QGCView {
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
color: palette.windowShade
color: qgcPal.windowShade
width: rtlSettings.width
height: dlLossRow.height + _margins * 2
Row {
......@@ -220,7 +219,7 @@ QGCView {
sourceSize.width: width
mipmap: true
fillMode: Image.PreserveAspectFit
source: qgcPal.globalTheme === QGCPalette.Light ? "/qmlimages/DatalinkLossLight.svg" : "/qmlimages/DatalinkLoss.svg"
source: qgcPal.globalTheme === qgcPal.Light ? "/qmlimages/DatalinkLossLight.svg" : "/qmlimages/DatalinkLoss.svg"
anchors.verticalCenter: parent.verticalCenter
visible: _showIcons
}
......@@ -269,7 +268,7 @@ QGCView {
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
color: palette.windowShade
color: qgcPal.windowShade
width: rtlSettings.width
height: geofenceRow.height + _margins * 2
Row {
......@@ -283,7 +282,7 @@ QGCView {
sourceSize.width: width
mipmap: true
fillMode: Image.PreserveAspectFit
source: qgcPal.globalTheme === QGCPalette.Light ? "/qmlimages/GeoFenceLight.svg" : "/qmlimages/GeoFence.svg"
source: qgcPal.globalTheme === qgcPal.Light ? "/qmlimages/GeoFenceLight.svg" : "/qmlimages/GeoFence.svg"
anchors.verticalCenter: parent.verticalCenter
visible: _showIcons
}
......@@ -356,7 +355,7 @@ QGCView {
}
Rectangle {
id: rtlSettings
color: palette.windowShade
color: qgcPal.windowShade
width: rtlRow.width + _margins * 2
height: rtlRow.height + _margins * 2
Row {
......@@ -366,7 +365,7 @@ QGCView {
Item { width: _margins * 0.5; height: 1; }
QGCColoredImage {
id: icon
color: palette.text
color: qgcPal.text
height: ScreenTools.defaultFontPixelWidth * 10
width: ScreenTools.defaultFontPixelWidth * 20
sourceSize.width: width
......@@ -436,7 +435,7 @@ QGCView {
text: qsTr("Loiter Time")
width: _middleRowWidth
anchors.baseline: landDelayField.baseline
color: palette.text
color: qgcPal.text
enabled: homeLoiterLandRadio.checked === true
}
FactTextField {
......@@ -452,7 +451,7 @@ QGCView {
text: qsTr("Loiter Altitude")
width: _middleRowWidth
anchors.baseline: descendField.baseline
color: palette.text
color: qgcPal.text
enabled: homeLoiterLandRadio.checked === true || homeLoiterNoLandRadio.checked === true
}
FactTextField {
......@@ -474,7 +473,7 @@ QGCView {
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
color: palette.windowShade
color: qgcPal.windowShade
width: rtlSettings.width
height: landModeRow.height + _margins * 2
Row {
......@@ -486,7 +485,7 @@ QGCView {
height: 1
}
QGCColoredImage {
color: palette.text
color: qgcPal.text
height: ScreenTools.defaultFontPixelWidth * 13
width: ScreenTools.defaultFontPixelWidth * 20
sourceSize.width: width
......@@ -539,8 +538,8 @@ QGCView {
}
}
Item { width: 1; height: _margins * 0.5; }
}
}
}
}
} // Column
} // Item
} // Component
} // SetupPage
Supports Markdown
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