Commit 355b8064 authored by Gus Grubba's avatar Gus Grubba

Remove overly redundant activeVehicle redefinitions.

Fixed flight widget position.
parent e95c0951
......@@ -35,8 +35,7 @@ SetupPage {
QGCPalette { id: palette; colorGroupEnabled: true }
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _oldFW: !(_activeVehicle.firmwareMajorVersion > 3 || _activeVehicle.firmwareMinorVersion > 5 || _activeVehicle.firmwarePatchVersion >= 2)
property bool _oldFW: !(activeVehicle.firmwareMajorVersion > 3 || activeVehicle.firmwareMinorVersion > 5 || activeVehicle.firmwarePatchVersion >= 2)
property Fact _mountRetractX: controller.getParameterFact(-1, "MNT_RETRACT_X")
property Fact _mountRetractY: controller.getParameterFact(-1, "MNT_RETRACT_Y")
......
......@@ -33,8 +33,7 @@ SetupPage {
QGCPalette { id: palette; colorGroupEnabled: true }
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _oldFW: _activeVehicle.versionCompare(3, 5, 2) < 0
property bool _oldFW: activeVehicle.versionCompare(3, 5, 2) < 0
property Fact _rc5Function: controller.getParameterFact(-1, "r.SERVO5_FUNCTION")
property Fact _rc6Function: controller.getParameterFact(-1, "r.SERVO6_FUNCTION")
property Fact _rc7Function: controller.getParameterFact(-1, "r.SERVO7_FUNCTION")
......
......@@ -35,8 +35,7 @@ SetupPage {
QGCPalette { id: ggcPal; colorGroupEnabled: true }
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _firmware34: _activeVehicle.versionCompare(3, 5, 0) < 0
property bool _firmware34: activeVehicle.versionCompare(3, 5, 0) < 0
// Enable/Action parameters
property Fact _failsafeBatteryEnable: controller.getParameterFact(-1, "r.BATT_FS_LOW_ACT")
......
......@@ -77,7 +77,6 @@ SetupPage {
property bool _orientationsDialogShowCompass: true
property string _orientationDialogHelp: orientationHelpSet
property int _orientationDialogCalType
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property real _margins: ScreenTools.defaultFontPixelHeight / 2
property bool _compassAutoRotAvailable: controller.parameterExists(-1, "COMPASS_AUTO_ROT")
property Fact _compassAutoRotFact: controller.getParameterFact(-1, "COMPASS_AUTO_ROT", false /* reportMissing */)
......@@ -518,9 +517,9 @@ SetupPage {
wrapMode: Text.WordWrap
text: _helpText
readonly property string _altText: _activeVehicle.sub ? qsTr("depth") : qsTr("altitude")
readonly property string _altText: activeVehicle.sub ? qsTr("depth") : qsTr("altitude")
readonly property string _helpText: qsTr("Pressure calibration will set the %1 to zero at the current pressure reading. %2").arg(_altText).arg(_helpTextFW)
readonly property string _helpTextFW: _activeVehicle.fixedWing ? qsTr("To calibrate the airspeed sensor shield it from the wind. Do not touch the sensor or obstruct any holes during the calibration.") : ""
readonly property string _helpTextFW: activeVehicle.fixedWing ? qsTr("To calibrate the airspeed sensor shield it from the wind. Do not touch the sensor or obstruct any holes during the calibration.") : ""
}
} // QGCViewDialog
} // Component - calibratePressureDialogComponent
......@@ -582,13 +581,13 @@ SetupPage {
text: _calibratePressureText
onClicked: mainWindow.showDialog(calibratePressureDialogComponent, _calibratePressureText, mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok)
readonly property string _calibratePressureText: _activeVehicle.fixedWing ? qsTr("Cal Baro/Airspeed") : qsTr("Calibrate Pressure")
readonly property string _calibratePressureText: activeVehicle.fixedWing ? qsTr("Cal Baro/Airspeed") : qsTr("Calibrate Pressure")
}
QGCButton {
width: _buttonWidth
text: qsTr("CompassMot")
visible: _activeVehicle ? _activeVehicle.supportsMotorInterference : false
visible: activeVehicle ? activeVehicle.supportsMotorInterference : false
onClicked: mainWindow.showDialog(compassMotDialogComponent, qsTr("CompassMot - Compass Motor Interference Calibration"), mainWindow.showDialogFullWidth, StandardButton.Cancel | StandardButton.Ok)
}
......
......@@ -24,8 +24,7 @@ SetupPage {
id: subFramePage
pageComponent: subFramePageComponent
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _oldFW: _activeVehicle.versionCompare(3 ,5 ,2) < 0
property bool _oldFW: activeVehicle.versionCompare(3 ,5 ,2) < 0
APMAirframeComponentController { id: controller; }
......
......@@ -33,10 +33,9 @@ Item {
property bool showAdvanced: false
property alias advanced: advancedCheckBox.checked
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _vehicleIsRover: _activeVehicle ? _activeVehicle.rover : false
property bool _vehicleArmed: _activeVehicle ? _activeVehicle.armed : false
property bool _vehicleFlying: _activeVehicle ? _activeVehicle.flying : false
property bool _vehicleIsRover: activeVehicle ? activeVehicle.rover : false
property bool _vehicleArmed: activeVehicle ? activeVehicle.armed : false
property bool _vehicleFlying: activeVehicle ? activeVehicle.flying : false
property bool _disableDueToArmed: vehicleComponent ? (!vehicleComponent.allowSetupWhileArmed && _vehicleArmed) : false
// FIXME: The _vehicleIsRover checkl is a hack to work around https://github.com/PX4/Firmware/issues/10969
property bool _disableDueToFlying: vehicleComponent ? (!_vehicleIsRover && !vehicleComponent.allowSetupWhileFlying && _vehicleFlying) : false
......
This diff is collapsed.
......@@ -46,7 +46,7 @@ FlightMap {
property var _geoFenceController: planMasterController.geoFenceController
property var _rallyPointController: planMasterController.rallyPointController
property var _activeVehicleCoordinate: activeVehicle ? activeVehicle.coordinate : QtPositioning.coordinate()
property real _toolButtonTopMargin: parent.height - ScreenTools.availableHeight + (ScreenTools.defaultFontPixelHeight / 2)
property real _toolButtonTopMargin: parent.height - mainWindow.height + (ScreenTools.defaultFontPixelHeight / 2)
property bool _airspaceEnabled: QGroundControl.airmapSupported ? (QGroundControl.settingsManager.airMapSettings.enableAirMap.rawValue && QGroundControl.airspaceManager.connected): false
property bool _disableVehicleTracking: false
......
......@@ -38,7 +38,6 @@ Item {
readonly property real _margins: ScreenTools.defaultFontPixelHeight * 0.5
QGCMapPalette { id: mapPal; lightColors: useLightColors }
QGCPalette { id: qgcPal }
function getPreferredInstrumentWidth() {
// Don't allow instrument panel to chew more than 1/4 of full window
......@@ -180,8 +179,8 @@ Item {
target: instrumentsLoader
anchors.verticalCenter: undefined
anchors.bottom: undefined
anchors.top: _root ? _root.top : undefined
anchors.right: _root ? _root.right : undefined
anchors.top: widgetRoot ? widgetRoot.top : undefined
anchors.right: widgetRoot ? widgetRoot.right : undefined
anchors.left: undefined
}
},
......@@ -191,8 +190,8 @@ Item {
target: instrumentsLoader
anchors.top: undefined
anchors.bottom: undefined
anchors.verticalCenter: _root ? _root.verticalCenter : undefined
anchors.right: _root ? _root.right : undefined
anchors.verticalCenter: widgetRoot ? widgetRoot.verticalCenter : undefined
anchors.right: widgetRoot ? widgetRoot.right : undefined
anchors.left: undefined
}
},
......@@ -202,8 +201,8 @@ Item {
target: instrumentsLoader
anchors.top: undefined
anchors.verticalCenter: undefined
anchors.bottom: _root ? _root.bottom : undefined
anchors.right: _root ? _root.right : undefined
anchors.bottom: widgetRoot ? widgetRoot.bottom : undefined
anchors.right: widgetRoot ? widgetRoot.right : undefined
anchors.left: undefined
}
},
......@@ -213,9 +212,9 @@ Item {
target: instrumentsLoader
anchors.verticalCenter: undefined
anchors.bottom: undefined
anchors.top: _root ? _root.top : undefined
anchors.top: widgetRoot ? widgetRoot.top : undefined
anchors.right: undefined
anchors.left: _root ? _root.left : undefined
anchors.left: widgetRoot ? widgetRoot.left : undefined
}
},
State {
......@@ -224,9 +223,9 @@ Item {
target: instrumentsLoader
anchors.top: undefined
anchors.bottom: undefined
anchors.verticalCenter: _root ? _root.verticalCenter : undefined
anchors.verticalCenter: widgetRoot ? widgetRoot.verticalCenter : undefined
anchors.right: undefined
anchors.left: _root ? _root.left : undefined
anchors.left: widgetRoot ? widgetRoot.left : undefined
}
},
State {
......@@ -235,9 +234,9 @@ Item {
target: instrumentsLoader
anchors.top: undefined
anchors.verticalCenter: undefined
anchors.bottom: _root ? _root.bottom : undefined
anchors.bottom: widgetRoot ? widgetRoot.bottom : undefined
anchors.right: undefined
anchors.left: _root ? _root.left : undefined
anchors.left: widgetRoot ? widgetRoot.left : undefined
}
}
]
......
......@@ -25,8 +25,6 @@ PreFlightCheckButton {
property int failurePercent: 40
property bool allowFailurePercentOverride: false
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property var _batPercentRemaining: _activeVehicle ? _activeVehicle.battery.percentRemaining.value : 0
property bool _batLow: _batPercentRemaining < failurePercent
property var _batPercentRemaining: activeVehicle ? activeVehicle.battery.percentRemaining.value : 0
property bool _batLow: _batPercentRemaining < failurePercent
}
......@@ -24,9 +24,8 @@ PreFlightCheckButton {
property bool allowOverrideSatCount: false ///< true: sat count above failureSatCount reguired to pass, false: user can click past satCount <= failureSetCount
property int failureSatCount: -1 ///< -1 indicates no sat count check
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _3dLock: _activeVehicle ? _activeVehicle.gps.lock.rawValue >= 3 : false
property int _satCount: _activeVehicle ? _activeVehicle.gps.count.rawValue : 0
property bool _3dLock: activeVehicle ? activeVehicle.gps.lock.rawValue >= 3 : false
property int _satCount: activeVehicle ? activeVehicle.gps.count.rawValue : 0
property bool _3dLockFailure: !_3dLock
property bool _satCountFailure: failureSatCount !== -1 && _satCount <= failureSatCount
property string _satCountFailureText: allowOverrideSatCount ? qsTr("Warning - Sat count below %1.").arg(failureSatCount + 1) : qsTr("Waiting for sat count above %1.").arg(failureSatCount)
......
......@@ -19,6 +19,5 @@ PreFlightCheckButton {
telemetryTextFailure: qsTr("No signal or invalid autopilot-RC config. Check RC and console.")
telemetryFailure: _unhealthySensors & Vehicle.SysStatusSensorRCReceiver
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property int _unhealthySensors: _activeVehicle ? _activeVehicle.sensorsUnhealthyBits : 0
property int _unhealthySensors: activeVehicle ? activeVehicle.sensorsUnhealthyBits : 0
}
......@@ -17,8 +17,7 @@ PreFlightCheckButton {
name: qsTr("Sensors")
telemetryFailure: _unhealthySensors & _allCheckedSensors
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property int _unhealthySensors: _activeVehicle ? _activeVehicle.sensorsUnhealthyBits : 0
property int _unhealthySensors: activeVehicle ? activeVehicle.sensorsUnhealthyBits : 0
property int _allCheckedSensors: Vehicle.SysStatusSensor3dMag |
Vehicle.SysStatusSensor3dAccel |
Vehicle.SysStatusSensor3dGyro |
......
......@@ -17,15 +17,15 @@ import QGroundControl.Palette 1.0
import QGroundControl.Vehicle 1.0
Item {
//property bool useLightColors - Must be passed in from loaded
//property bool useLightColors - Must be passed in from loader
Timer {
interval: 40 // 25Hz, same as real joystick rate
running: QGroundControl.settingsManager.appSettings.virtualJoystick.value && _activeVehicle
running: QGroundControl.settingsManager.appSettings.virtualJoystick.value && activeVehicle
repeat: true
onTriggered: {
if (_activeVehicle) {
_activeVehicle.virtualTabletJoystickValue(rightStick.xAxis, rightStick.yAxis, leftStick.xAxis, leftStick.yAxis)
if (activeVehicle) {
activeVehicle.virtualTabletJoystickValue(rightStick.xAxis, rightStick.yAxis, leftStick.xAxis, leftStick.yAxis)
}
}
}
......
......@@ -169,7 +169,7 @@ Item {
QGCMapLabel {
id: polygonHelp
anchors.topMargin: parent.height - ScreenTools.availableHeight
anchors.topMargin: parent.height - mainWindow.height
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
......
......@@ -35,8 +35,6 @@ DropButton {
property bool showFollowVehicle: false
property bool followVehicle: false
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
function fitHomePosition() {
var homePosition = QtPositioning.coordinate()
var activeVehicle = QGroundControl.multiVehicleManager.activeVehicle
......@@ -223,7 +221,7 @@ DropButton {
QGCButton {
text: qsTr("Vehicle")
Layout.fillWidth: true
enabled: _activeVehicle && _activeVehicle.latitude != 0 && _activeVehicle.longitude != 0 && !followVehicleCheckBox.checked
enabled: activeVehicle && activeVehicle.latitude != 0 && activeVehicle.longitude != 0 && !followVehicleCheckBox.checked
onClicked: {
dropButton.hideDropDown()
......
......@@ -26,8 +26,6 @@ ColumnLayout {
property bool showMission: true
property bool showAllItems: true
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
QGCLabel { text: qsTr("Center map on:") }
QGCButton {
......@@ -65,7 +63,7 @@ ColumnLayout {
QGCButton {
text: qsTr("Vehicle")
Layout.fillWidth: true
enabled: _activeVehicle && _activeVehicle.coordinate.isValid
enabled: activeVehicle && activeVehicle.coordinate.isValid
onClicked: {
dropPanel.hide()
......
......@@ -34,7 +34,6 @@ Rectangle {
property real _margin: ScreenTools.defaultFontPixelWidth / 2
property real _spacer: ScreenTools.defaultFontPixelWidth / 2
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property string _setToVehicleHeadingStr: qsTr("Set to vehicle heading")
property string _setToVehicleLocationStr: qsTr("Set to vehicle location")
......@@ -79,8 +78,8 @@ Rectangle {
QGCButton {
text: _setToVehicleHeadingStr
visible: _activeVehicle
onClicked: missionItem.landingHeading.rawValue = _activeVehicle.heading.rawValue
visible: activeVehicle
onClicked: missionItem.landingHeading.rawValue = activeVehicle.heading.rawValue
}
}
......@@ -148,9 +147,9 @@ Rectangle {
QGCButton {
text: _setToVehicleLocationStr
visible: _activeVehicle
visible: activeVehicle
Layout.columnSpan: 2
onClicked: missionItem.landingCoordinate = _activeVehicle.coordinate
onClicked: missionItem.landingCoordinate = activeVehicle.coordinate
}
}
}
......@@ -216,17 +215,17 @@ Rectangle {
anchors.right: parent.right
horizontalAlignment: Text.AlignHCenter
text: qsTr("- or -")
visible: _activeVehicle
visible: activeVehicle
}
QGCButton {
anchors.horizontalCenter: parent.horizontalCenter
text: _setToVehicleLocationStr
visible: _activeVehicle
visible: activeVehicle
onClicked: {
missionItem.landingCoordinate = _activeVehicle.coordinate
missionItem.landingHeading.rawValue = _activeVehicle.heading.rawValue
missionItem.landingCoordinate = activeVehicle.coordinate
missionItem.landingHeading.rawValue = activeVehicle.heading.rawValue
}
}
}
......
......@@ -322,7 +322,7 @@ Rectangle {
Rectangle {
anchors.bottom: parent.bottom
height: toolBar.height * 0.05
width: _activeVehicle ? _activeVehicle.parameterManager.loadProgress * parent.width : 0
width: activeVehicle ? activeVehicle.parameterManager.loadProgress * parent.width : 0
color: qgcPal.colorGreen
visible: !largeProgressBar.visible
}
......
......@@ -44,7 +44,7 @@ Item {
readonly property real _margin: ScreenTools.defaultFontPixelHeight * 0.5
readonly property real _radius: ScreenTools.defaultFontPixelWidth * 0.5
readonly property real _rightPanelWidth: Math.min(parent.width / 3, ScreenTools.defaultFontPixelWidth * 30)
readonly property real _toolButtonTopMargin: parent.height - ScreenTools.availableHeight + (ScreenTools.defaultFontPixelHeight / 2)
readonly property real _toolButtonTopMargin: parent.height - mainWindow.height + (ScreenTools.defaultFontPixelHeight / 2)
readonly property var _defaultVehicleCoordinate: QtPositioning.coordinate(37.803784, -122.462276)
readonly property bool _waypointsOnlyMode: QGroundControl.corePlugin.options.missionWaypointsOnly
......@@ -58,7 +58,7 @@ Item {
property bool _addWaypointOnClick: false
property bool _addROIOnClick: false
property bool _singleComplexItem: _missionController.complexMissionItemNames.length === 1
property real _toolbarHeight: _root.height - ScreenTools.availableHeight
property real _toolbarHeight: _root.height - mainWindow.height
property int _editingLayer: _layerMission
property int _toolStripBottom: toolStrip.height + toolStrip.y
property var _appSettings: QGroundControl.settingsManager.appSettings
......@@ -476,7 +476,7 @@ Item {
editorMap.focus = true
//-- Don't pay attention to items beneath the toolbar.
var topLimit = parent.height - ScreenTools.availableHeight
var topLimit = parent.height - mainWindow.height
if(mouse.y < topLimit) {
return
}
......@@ -653,7 +653,7 @@ Item {
// Right pane for mission editing controls
Rectangle {
id: rightPanel
height: ScreenTools.availableHeight
height: mainWindow.height
width: _rightPanelWidth
color: qgcPal.window
opacity: planExpanded.visible ? 0.2 : 0
......
......@@ -17,7 +17,7 @@ Item {
property int dropDirection: dropDown
property alias dropDownComponent: dropDownLoader.sourceComponent
property real viewportMargins: 0
property real topMargin: parent.height - ScreenTools.availableHeight
property real topMargin: parent.height - mainWindow.height
property alias lightBorders: roundButton.lightBorders
width: radius * 2
......
......@@ -27,18 +27,18 @@ RowLayout {
property real _chartHeight: ScreenTools.defaultFontPixelHeight * 20
property real _margins: ScreenTools.defaultFontPixelHeight / 2
property string _currentTuneType: tuneList[0]
property real _roll: _activeVehicle.roll.value
property real _rollSetpoint: _activeVehicle.setpoint.roll.value
property real _rollRate: _activeVehicle.rollRate.value
property real _rollRateSetpoint: _activeVehicle.setpoint.rollRate.value
property real _pitch: _activeVehicle.pitch.value
property real _pitchSetpoint: _activeVehicle.setpoint.pitch.value
property real _pitchRate: _activeVehicle.pitchRate.value
property real _pitchRateSetpoint: _activeVehicle.setpoint.pitchRate.value
property real _yaw: _activeVehicle.heading.value
property real _yawSetpoint: _activeVehicle.setpoint.yaw.value
property real _yawRate: _activeVehicle.yawRate.value
property real _yawRateSetpoint: _activeVehicle.setpoint.yawRate.value
property real _roll: activeVehicle.roll.value
property real _rollSetpoint: activeVehicle.setpoint.roll.value
property real _rollRate: activeVehicle.rollRate.value
property real _rollRateSetpoint: activeVehicle.setpoint.rollRate.value
property real _pitch: activeVehicle.pitch.value
property real _pitchSetpoint: activeVehicle.setpoint.pitch.value
property real _pitchRate: activeVehicle.pitchRate.value
property real _pitchRateSetpoint: activeVehicle.setpoint.pitchRate.value
property real _yaw: activeVehicle.heading.value
property real _yawSetpoint: activeVehicle.setpoint.yaw.value
property real _yawRate: activeVehicle.yawRate.value
property real _yawRateSetpoint: activeVehicle.setpoint.yawRate.value
property var _valueXAxis: valueXAxis
property var _valueRateXAxis: valueRateXAxis
property var _valueYAxis: valueYAxis
......@@ -229,7 +229,6 @@ RowLayout {
*/
}
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property int _maxPointCount: 10000 / interval
}
......
......@@ -29,7 +29,6 @@ Item {
property bool _searchFilter: searchText.text.trim() != "" ///< true: showing results of search
property var _searchResults ///< List of parameter names from search results
property bool _showRCToParam: !ScreenTools.isMobile && QGroundControl.multiVehicleManager.activeVehicle.px4Firmware
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property var _appSettings: QGroundControl.settingsManager.appSettings
ParameterEditorController {
......@@ -107,7 +106,7 @@ Item {
}
MenuItem {
text: qsTr("Reset all to defaults")
visible: !_activeVehicle.apmFirmware
visible: !activeVehicle.apmFirmware
onTriggered: mainWindow.showDialog(resetToDefaultConfirmComponent, qsTr("Reset All"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Reset)
}
MenuSeparator { }
......@@ -330,7 +329,7 @@ Item {
QGCViewDialog {
function accept() {
_activeVehicle.rebootVehicle()
activeVehicle.rebootVehicle()
hideDialog()
}
......
......@@ -59,8 +59,6 @@ QGCButton {
_pendingColor :
_failedColor))
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
width: 40 * ScreenTools.defaultFontPixelWidth
style: ButtonStyle {
......
......@@ -16,9 +16,9 @@ Rectangle {
parent.flickableDirection === Flickable.HorizontalAndVerticalFlick) &&
(parent.contentHeight > parent.height)
Component.onCompleted: animateOpacity.restart()
onVisibleChanged: animateOpacity.restart()
onHeightChanged: animateOpacity.restart()
Component.onCompleted: { if(animateOpacity) animateOpacity.restart() }
onVisibleChanged: { if(animateOpacity) animateOpacity.restart() }
onHeightChanged: { if(animateOpacity) animateOpacity.restart() }
Connections {
target: verticalIndicator.parent
......
......@@ -46,7 +46,6 @@ Item {
property real mediumFontPointSize: 10
property real largeFontPointSize: 10
property real availableHeight: 0
property real toolbarHeight: 0
readonly property real smallFontPointRatio: 0.75
......
......@@ -26,9 +26,7 @@ SetupPage {
id: firmwarePage
pageComponent: firmwarePageComponent
pageName: qsTr("Firmware")
showAdvanced: _activeVehicle && _activeVehicle.apmFirmware
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
showAdvanced: activeVehicle && activeVehicle.apmFirmware
signal cancelDialog
......@@ -459,7 +457,7 @@ SetupPage {
id: flashBootloaderButton
text: qsTr("Flash ChibiOS Bootloader")
visible: firmwarePage.advanced
onClicked: _activeVehicle.flashBootloader()
onClicked: activeVehicle.flashBootloader()
}
TextArea {
......
......@@ -51,7 +51,6 @@ SetupPage {
readonly property real labelToMonitorMargin: ScreenTools.defaultFontPixelWidth * 3
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property var _activeJoystick: joystickManager.activeJoystick
JoystickConfigController {
......@@ -188,7 +187,7 @@ SetupPage {
QGCLabel {
id: rollLabel
width: ScreenTools.defaultFontPixelWidth * 10
text: _activeVehicle.sub ? qsTr("Lateral") : qsTr("Roll")
text: activeVehicle.sub ? qsTr("Lateral") : qsTr("Roll")
}
Loader {
......@@ -218,7 +217,7 @@ SetupPage {
QGCLabel {
id: pitchLabel
width: ScreenTools.defaultFontPixelWidth * 10
text: _activeVehicle.sub ? qsTr("Forward") : qsTr("Pitch")
text: activeVehicle.sub ? qsTr("Forward") : qsTr("Pitch")
}
Loader {
......@@ -365,14 +364,14 @@ SetupPage {
id: enabledCheckBox
enabled: _activeJoystick ? _activeJoystick.calibrated : false
text: _activeJoystick ? _activeJoystick.calibrated ? qsTr("Enable joystick input") : qsTr("Enable not allowed (Calibrate First)") : ""
onClicked: _activeVehicle.joystickEnabled = checked
Component.onCompleted: checked = _activeVehicle.joystickEnabled
onClicked: activeVehicle.joystickEnabled = checked
Component.onCompleted: checked = activeVehicle.joystickEnabled
Connections {
target: _activeVehicle
target: activeVehicle
onJoystickEnabledChanged: {
enabledCheckBox.checked = _activeVehicle.joystickEnabled
enabledCheckBox.checked = activeVehicle.joystickEnabled
}
}
......@@ -381,7 +380,7 @@ SetupPage {
onActiveJoystickChanged: {
if(_activeJoystick) {
enabledCheckBox.checked = Qt.binding(function() { return _activeJoystick.calibrated && _activeVehicle.joystickEnabled })
enabledCheckBox.checked = Qt.binding(function() { return _activeJoystick.calibrated && activeVehicle.joystickEnabled })
}
}
}
......@@ -427,7 +426,7 @@ SetupPage {
Column {
spacing: ScreenTools.defaultFontPixelHeight / 3
visible: _activeVehicle.supportsThrottleModeCenterZero
visible: activeVehicle.supportsThrottleModeCenterZero
ExclusiveGroup { id: throttleModeExclusiveGroup }
......@@ -463,10 +462,10 @@ SetupPage {
}
QGCCheckBox {
visible: _activeVehicle.supportsNegativeThrust
visible: activeVehicle.supportsNegativeThrust
id: negativeThrust
text: qsTr("Allow negative Thrust")
enabled: _activeJoystick.negativeThrust = _activeVehicle.supportsNegativeThrust
enabled: _activeJoystick.negativeThrust = activeVehicle.supportsNegativeThrust
checked: _activeJoystick ? _activeJoystick.negativeThrust : false
onClicked: _activeJoystick.negativeThrust = checked
}
......@@ -499,12 +498,12 @@ SetupPage {
QGCCheckBox {
id: advancedSettings
checked: _activeVehicle.joystickMode != 0
checked: activeVehicle.joystickMode != 0
text: qsTr("Advanced settings (careful!)")
onClicked: {
if (!checked) {
_activeVehicle.joystickMode = 0
activeVehicle.joystickMode = 0
}
}
}
......@@ -522,11 +521,11 @@ SetupPage {
QGCComboBox {
id: joystickModeCombo
currentIndex: _activeVehicle.joystickMode
currentIndex: activeVehicle.joystickMode
width: ScreenTools.defaultFontPixelWidth * 20
model: _activeVehicle.joystickModes
model: activeVehicle.joystickModes
onActivated: _activeVehicle.joystickMode = index
onActivated: activeVehicle.joystickMode = index
}
}
......@@ -554,7 +553,7 @@ SetupPage {
visible: advancedSettings.checked
QGCCheckBox {
id: joystickCircleCorrection
checked: _activeVehicle.joystickMode != 0
checked: activeVehicle.joystickMode != 0
text: qsTr("Enable circle correction")
Component.onCompleted: checked = _activeJoystick.circleCorrection
......@@ -625,7 +624,7 @@ SetupPage {
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: !_activeVehicle.supportsJSButton
visible: !activeVehicle.supportsJSButton
property bool pressed
......@@ -667,7 +666,7 @@ SetupPage {
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: _activeVehicle.supportsJSButton
visible: activeVehicle.supportsJSButton
QGCLabel {
horizontalAlignment: Text.AlignHCenter
......@@ -692,7 +691,7 @@ SetupPage {
Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: _activeVehicle.supportsJSButton
visible: activeVehicle.supportsJSButton
property bool pressed
......
......@@ -44,13 +44,21 @@ ApplicationWindow {
property var activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool communicationLost: activeVehicle ? activeVehicle.connectionLost : false
property string formatedMessage: activeVehicle ? activeVehicle.formatedMessage : ""
property real availableHeight: mainWindow.height - mainWindow.header.height
readonly property string navButtonWidth: ScreenTools.defaultFontPixelWidth * 24
readonly property real defaultTextHeight: ScreenTools.defaultFontPixelHeight
readonly property real defaultTextWidth: ScreenTools.defaultFontPixelWidth
QGCPalette { id: qgcPal; colorGroupEnabled: true }
//-------------------------------------------------------------------------
//-- Actions
signal armVehicle
signal disarmVehicle
signal vtolTransitionToFwdFlight
signal vtolTransitionToMRFlight
//-------------------------------------------------------------------------
//-- Global Scope Functions
......
......@@ -32,7 +32,6 @@ Rectangle {
property int _selectedCount: 0
property real _columnSpacing: ScreenTools.defaultFontPixelHeight * 0.25
property bool _uploadedSelected: false
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _showMavlinkLog: QGroundControl.corePlugin.options.showMavlinkLogOptions
property bool _showAPMStreamRates: QGroundControl.apmFirmwareSupported && QGroundControl.settin