Skip to content

Commit

Permalink
Merge pull request #8576 from DonLakeFlyer/MasterCherryPick
Browse files Browse the repository at this point in the history
Master cherry pick
  • Loading branch information
DonLakeFlyer authored Mar 18, 2020
2 parents 09c886a + 6139f8b commit db63cac
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 38 deletions.
50 changes: 21 additions & 29 deletions src/AutoPilotPlugins/APM/APMSafetyComponent.qml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ SetupPage {
property Fact _armingCheck: controller.getParameterFact(-1, "ARMING_CHECK")

property real _margins: ScreenTools.defaultFontPixelHeight
property real _innerMargin: _margins / 2
property bool _showIcon: !ScreenTools.isTinyScreen
property bool _roverFirmware: controller.parameterExists(-1, "MODE1") // This catches all usage of ArduRover firmware vehicle types: Rover, Boat...

Expand Down Expand Up @@ -551,8 +552,8 @@ SetupPage {

Rectangle {
id: rtlSettings
width: rltAltFinalField.x + rltAltFinalField.width + _margins
height: rltAltFinalField.y + rltAltFinalField.height + _margins
width: landSpeedField.x + landSpeedField.width + _margins
height: landSpeedField.y + landSpeedField.height + _margins
color: ggcPal.windowShade

Image {
Expand All @@ -578,7 +579,7 @@ SetupPage {

QGCRadioButton {
id: returnAtCurrentRadio
anchors.margins: _margins
anchors.margins: _innerMargin
anchors.left: _showIcon ? icon.right : parent.left
anchors.top: parent.top
text: qsTr("Return at current altitude")
Expand All @@ -589,9 +590,9 @@ SetupPage {

QGCRadioButton {
id: returnAltRadio
anchors.topMargin: _margins
anchors.left: returnAtCurrentRadio.left
anchors.topMargin: _innerMargin
anchors.top: returnAtCurrentRadio.bottom
anchors.left: returnAtCurrentRadio.left
text: qsTr("Return at specified altitude:")
checked: _rtlAltFact.value != 0

Expand Down Expand Up @@ -620,50 +621,41 @@ SetupPage {

FactTextField {
id: landDelayField
anchors.topMargin: _margins * 1.5
anchors.topMargin: _innerMargin
anchors.left: rltAltField.left
anchors.top: rltAltField.bottom
fact: _rtlLoitTimeFact
showUnits: true
enabled: homeLoiterCheckbox.checked === true
}

QGCRadioButton {
id: landRadio
QGCLabel {
anchors.left: returnAtCurrentRadio.left
anchors.baseline: landSpeedField.baseline
text: qsTr("Land with descent speed:")
checked: _rtlAltFinalFact.value == 0

onClicked: _rtlAltFinalFact.value = 0
anchors.baseline: rltAltFinalField.baseline
text: qsTr("Final land stage altitude:")
}

FactTextField {
id: landSpeedField
anchors.topMargin: _margins * 1.5
anchors.top: landDelayField.bottom
id: rltAltFinalField
anchors.topMargin: _innerMargin
anchors.left: rltAltField.left
fact: _landSpeedFact
anchors.top: landDelayField.bottom
fact: _rtlAltFinalFact
showUnits: true
enabled: landRadio.checked
}

QGCRadioButton {
id: finalLoiterRadio
QGCLabel {
anchors.left: returnAtCurrentRadio.left
anchors.baseline: rltAltFinalField.baseline
text: qsTr("Final loiter altitude:")

onClicked: _rtlAltFinalFact.value = _rtlAltFact.value
anchors.baseline: landSpeedField.baseline
text: qsTr("Final land stage descent speed:")
}

FactTextField {
id: rltAltFinalField
anchors.topMargin: _margins / 2
id: landSpeedField
anchors.topMargin: _innerMargin
anchors.left: rltAltField.left
anchors.top: landSpeedField.bottom
fact: _rtlAltFinalFact
enabled: finalLoiterRadio.checked
anchors.top: rltAltFinalField.bottom
fact: _landSpeedFact
showUnits: true
}
} // Rectangle - RTL Settings
Expand Down
17 changes: 11 additions & 6 deletions src/AutoPilotPlugins/Common/RadioComponent.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
****************************************************************************/

import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.11

Expand Down Expand Up @@ -90,14 +90,16 @@ SetupPage {
QGCViewDialog {

function accept() {
controller.spektrumBindMode(radioGroup.current.bindMode)
controller.spektrumBindMode(radioGroup.checkedButton.bindMode)
hideDialog()
}

function reject() {
hideDialog()
}

ButtonGroup { id: radioGroup }

Column {
anchors.fill: parent
spacing: 5
Expand All @@ -109,18 +111,21 @@ SetupPage {
}

QGCRadioButton {
text: qsTr("DSM2 Mode")
text: qsTr("DSM2 Mode")
ButtonGroup.group: radioGroup
property int bindMode: RadioComponentController.DSM2
}

QGCRadioButton {
text: qsTr("DSMX (7 channels or less)")
text: qsTr("DSMX (7 channels or less)")
ButtonGroup.group: radioGroup
property int bindMode: RadioComponentController.DSMX7
}

QGCRadioButton {
checked: true
text: qsTr("DSMX (8 channels or more)")
checked: true
text: qsTr("DSMX (8 channels or more)")
ButtonGroup.group: radioGroup
property int bindMode: RadioComponentController.DSMX8
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/QmlControls/QGCFileDialogController.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ QString QGCFileDialogController::filenameWithExtension(const QString& filename,

bool matchFound = false;
for (const QString& extension : rgFileExtensions) {
QString dotExtension = QString(".%1").arg(extension);
QString dotExtension = QStringLiteral(".%1").arg(extension);
matchFound = filenameWithExtension.endsWith(dotExtension);
if (matchFound) {
break;
}
}

if (!matchFound) {
filenameWithExtension += rgFileExtensions[0];
filenameWithExtension += QStringLiteral(".%1").arg(rgFileExtensions[0]);
}

return filenameWithExtension;
return filenameWithExtension;
}

bool QGCFileDialogController::fileExists(const QString& filename)
Expand Down

0 comments on commit db63cac

Please sign in to comment.