From 1a7f513fb1ee605f0bd838beaed8ebd72c09f17f Mon Sep 17 00:00:00 2001 From: James Turner Date: Thu, 28 Jun 2018 16:42:38 +0100 Subject: [PATCH] Allow setting VC for on-final start --- src/GUI/LocationController.cxx | 4 ++++ src/GUI/qml/LocationAirportView.qml | 33 ++++++++++++++++++++++++++++- src/GUI/qml/StyledText.qml | 1 + 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/src/GUI/LocationController.cxx b/src/GUI/LocationController.cxx index 551db1b92..411bf3762 100644 --- a/src/GUI/LocationController.cxx +++ b/src/GUI/LocationController.cxx @@ -1031,6 +1031,10 @@ void LocationController::onCollectConfig() m_config->setArg("glideslope", std::string("3.0")); m_config->setArg("offset-distance", QString::number(m_offsetNm)); m_config->setArg("on-ground", std::string("false")); + + if (m_speedEnabled) { + m_config->setArg("vc", QString::number(m_airspeedKnots)); + } } } else if (m_airportLocation->type() == FGPositioned::HELIPORT) { m_config->setArg("runway", QString::fromStdString(m_detailLocation->ident())); diff --git a/src/GUI/qml/LocationAirportView.qml b/src/GUI/qml/LocationAirportView.qml index cf0faa577..1341bece1 100644 --- a/src/GUI/qml/LocationAirportView.qml +++ b/src/GUI/qml/LocationAirportView.qml @@ -161,6 +161,8 @@ Item { // no offset for helipads visible: !isHeliport + readonly property bool enableOnFinal: runwayRadio.selected && _location.onFinal + ToggleSwitch { id: onFinalToggle label: qsTr("On final approach at ") @@ -183,12 +185,40 @@ Item { live: true anchors.verticalCenter: parent.verticalCenter - enabled: runwayRadio.selected && onFinalToggle.checked + enabled: parent.enableOnFinal } StyledText { text: qsTr(" from the threshold") anchors.verticalCenter: parent.verticalCenter + enabled: parent.enableOnFinal + } + + Item { + // padding + width: Style.strutSize + height: 1 + } + + ToggleSwitch { + id: airspeedToggle + enabled: parent.enableOnFinal + checked: _location.speedEnabled + onCheckedChanged: _location.speedEnabled = checked; + anchors.verticalCenter: parent.verticalCenter + } + + IntegerSpinbox { + label: qsTr("Airspeed:") + suffix: "kts" + min: 0 + max: 10000 // more for spaceships? + step: 5 + maxDigits: 5 + enabled: _location.speedEnabled && parent.enableOnFinal + value: _location.airspeedKnots + onCommit: _location.airspeedKnots = newValue + anchors.verticalCenter: parent.verticalCenter } } @@ -196,6 +226,7 @@ Item { x: Style.strutSize // no localizer for helipads visible: !isHeliport + enabled:runwayRadio.selected // enable if selected runway has ILS label: qsTr("Tune navigation radio (NAV1) to runway localizer") diff --git a/src/GUI/qml/StyledText.qml b/src/GUI/qml/StyledText.qml index 2ad53cce8..813efe392 100644 --- a/src/GUI/qml/StyledText.qml +++ b/src/GUI/qml/StyledText.qml @@ -3,6 +3,7 @@ import QtQuick 2.4 import "." Text { + id: root font.pixelSize: Style.baseFontPixelSize property bool enabled: true