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

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
......
......@@ -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
......
......@@ -33,8 +33,7 @@ QString SensorsComponent::name(void) const
QString SensorsComponent::description(void) const
{
return tr("The Sensors Component allows you to calibrate the sensors within your vehicle. "
"Prior to flight you must calibrate the Magnetometer, Gyroscope and Accelerometer.");
return tr("Sensors Setup is used to calibrate the sensors within your vehicle.");
}
QString SensorsComponent::iconResource(void) const
......
......@@ -16,11 +16,7 @@ import QGroundControl.Palette 1.0
import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0
QGCView {
viewPanel: panel
property string panelTitle: "Title" ///< Title for panel
Column {
/// ListModel must contains elements which look like this:
/// ListElement {
/// title: "Roll sensitivity"
......@@ -32,12 +28,17 @@ QGCView {
/// }
property ListModel sliderModel
FactPanelController { id: controller; factPanel: panel }
property var qgcViewPanel
QGCPalette { id: palette; colorGroupEnabled: enabled }
property real _margins: ScreenTools.defaultFontPixelHeight
property real _margins: ScreenTools.defaultFontPixelHeight
property bool _loadComplete: false
property bool _loadComplete: false
FactPanelController {
id: controller
factPanel: qgcViewPanel
}
QGCPalette { id: palette; colorGroupEnabled: enabled }
Component.onCompleted: {
// Qml Sliders have a strange behavior in which they first set Slider::value to some internal
......@@ -51,84 +52,69 @@ QGCView {
_loadComplete = true
}
QGCViewPanel {
id: panel
anchors.fill: parent
QGCFlickable {
clip: true
anchors.fill: parent
contentHeight: sliderOuterColumn.y + sliderOuterColumn.height
flickableDirection: Flickable.VerticalFlick
QGCLabel {
id: panelLabel
text: panelTitle
font.family: ScreenTools.demiboldFontFamily
}
QGCLabel {
id: panelLabel
text: panelTitle
font.family: ScreenTools.demiboldFontFamily
}
Column {
id: sliderOuterColumn
anchors.left: parent.left
anchors.right: parent.right
spacing: _margins
Repeater {
id: sliderRepeater
model: sliderModel
Column {
id: sliderOuterColumn
anchors.margins: _margins
Rectangle {
id: sliderRect
anchors.left: parent.left
anchors.right: parent.right
anchors.top: panelLabel.bottom
spacing: _margins
Repeater {
id: sliderRepeater
model: sliderModel
Rectangle {
id: sliderRect
height: sliderColumn.y + sliderColumn.height + _margins
color: palette.windowShade
property alias sliderValue: slider.value
Column {
id: sliderColumn
anchors.margins: _margins
anchors.left: parent.left
anchors.right: parent.right
anchors.top: sliderRect.top
QGCLabel {
text: title
font.family: ScreenTools.demiboldFontFamily
}
QGCLabel {
text: description
anchors.left: parent.left
anchors.right: parent.right
wrapMode: Text.WordWrap
}
Slider {
id: slider
anchors.left: parent.left
anchors.right: parent.right
height: sliderColumn.y + sliderColumn.height + _margins
color: palette.windowShade
property alias sliderValue: slider.value
minimumValue: min
maximumValue: max
stepSize: isNaN(fact.increment) ? step : fact.increment
tickmarksEnabled: true
Column {
id: sliderColumn
anchors.margins: _margins
anchors.left: parent.left
anchors.right: parent.right
anchors.top: sliderRect.top
property Fact fact: controller.getParameterFact(-1, param)
QGCLabel {
text: title
font.family: ScreenTools.demiboldFontFamily
onValueChanged: {
if (_loadComplete) {
fact.value = value
}
QGCLabel {
text: description
anchors.left: parent.left
anchors.right: parent.right
wrapMode: Text.WordWrap
}
Slider {
id: slider
anchors.left: parent.left
anchors.right: parent.right
minimumValue: min
maximumValue: max
stepSize: isNaN(fact.increment) ? step : fact.increment
tickmarksEnabled: true
property Fact fact: controller.getParameterFact(-1, param)
onValueChanged: {
if (_loadComplete) {
fact.value = value
}
}
} // Slider
} // Column
} // Rectangle
} // Repeater
} // Column
} // QGCFlickable
} // QGCViewPanel
}
} // Slider
} // Column
} // Rectangle
} // Repeater
} // Column
} // QGCView
......@@ -89,7 +89,7 @@ Rectangle {
spacing: ScreenTools.defaultFontPixelWidth * 2
QGCLabel {
width: ScreenTools.defaultFontPixelWidth * monitorThresholdCharWidth
id: monitorLabel
height: ScreenTools.defaultFontPixelHeight
verticalAlignment: Text.AlignVCenter
text: qsTr("Monitor:")
......@@ -129,13 +129,12 @@ Rectangle {
spacing: ScreenTools.defaultFontPixelWidth * 2
QGCLabel {
width: ScreenTools.defaultFontPixelWidth * monitorThresholdCharWidth
id: thresholdLabel
height: ScreenTools.defaultFontPixelHeight
verticalAlignment: Text.AlignVCenter
text: qsTr("Threshold:")
}
Item {
id: thresholdContainer
height: ScreenTools.defaultFontPixelHeight
......
......@@ -27,7 +27,7 @@ FactPanel {
readonly property int _pwmMax: 2200
readonly property int _pwmRange: _pwmMax - _pwmMin
QGCPalette { id: qgcPal; colorGroupEnabled: panel.enabled }
QGCPalette { id: qgcPal; colorGroupEnabled: _root.enabled }
RCChannelMonitorController {
id: controller
......
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