Commit 07f790aa authored by dogmaphobic's avatar dogmaphobic

Added toolbar indicators popup (drop down) showing extended information.

parent dcd33841
...@@ -30,6 +30,7 @@ import QGroundControl.Palette 1.0 ...@@ -30,6 +30,7 @@ import QGroundControl.Palette 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
import QGroundControl.FlightDisplay 1.0 import QGroundControl.FlightDisplay 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
import QGroundControl.MultiVehicleManager 1.0
/// Qml for MainWindow /// Qml for MainWindow
Item { Item {
...@@ -50,6 +51,11 @@ Item { ...@@ -50,6 +51,11 @@ Item {
property var defaultPosition: QtPositioning.coordinate(37.803784, -122.462276) property var defaultPosition: QtPositioning.coordinate(37.803784, -122.462276)
property var tabletPosition: defaultPosition property var tabletPosition: defaultPosition
property var currentPopUp: null
property real currentCenterX: 0
property var activeVehicle: multiVehicleManager.activeVehicle
property string formatedMessage: activeVehicle ? activeVehicle.formatedMessage : ""
Connections { Connections {
target: controller target: controller
...@@ -129,6 +135,42 @@ Item { ...@@ -129,6 +135,42 @@ Item {
flightView.interactive = enabled flightView.interactive = enabled
} }
onFormatedMessageChanged: {
if(messageArea.visible) {
messageText.append(formatedMessage)
//-- Hack to scroll down
messageFlick.flick(0,-500)
}
}
function showMessageArea() {
if(currentPopUp) {
currentPopUp.close()
}
if(multiVehicleManager.activeVehicleAvailable) {
messageText.text = activeVehicle.formatedMessages
//-- Hack to scroll to last message
for (var i = 0; i < activeVehicle.messageCount; i++)
messageFlick.flick(0,-5000)
activeVehicle.resetMessages()
} else {
messageText.text = "No Messages"
}
currentPopUp = messageArea
messageArea.visible = true
mainWindow.setMapInteractive(false)
}
function showPopUp(dropItem, centerX) {
if(currentPopUp) {
currentPopUp.close()
}
indicatorDropdown.centerX = centerX
indicatorDropdown.sourceComponent = dropItem
indicatorDropdown.visible = true
currentPopUp = indicatorDropdown
}
//-- Left Settings Menu //-- Left Settings Menu
Loader { Loader {
id: leftPanel id: leftPanel
...@@ -176,4 +218,83 @@ Item { ...@@ -176,4 +218,83 @@ Item {
visible: false visible: false
} }
//-------------------------------------------------------------------------
//-- Dismiss Pop Up Messages
MouseArea {
visible: currentPopUp != null
enabled: currentPopUp != null
anchors.fill: parent
onClicked: {
currentPopUp.close()
}
}
//-------------------------------------------------------------------------
//-- Indicator Drop Down Info
Loader {
id: indicatorDropdown
visible: false
property real centerX: 0
function close() {
sourceComponent = null
mainWindow.currentPopUp = null
}
}
//-------------------------------------------------------------------------
//-- System Message Area
Rectangle {
id: messageArea
function close() {
currentPopUp = null
messageText.text = ""
mainWindow.setMapInteractive(true)
messageArea.visible = false
}
width: mainWindow.width * 0.5
height: mainWindow.height * 0.5
color: Qt.rgba(0,0,0,0.75)
visible: false
radius: ScreenTools.defaultFontPixelHeight * 0.5
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.topMargin: tbHeight + ScreenTools.defaultFontPixelHeight
Flickable {
id: messageFlick
anchors.margins: ScreenTools.defaultFontPixelHeight
anchors.fill: parent
contentHeight: messageText.height
contentWidth: messageText.width
boundsBehavior: Flickable.StopAtBounds
pixelAligned: true
clip: true
TextEdit {
id: messageText
readOnly: true
textFormat: TextEdit.RichText
color: "white"
}
}
//-- Dismiss System Message
Image {
anchors.margins: ScreenTools.defaultFontPixelHeight
anchors.top: parent.top
anchors.right: parent.right
width: ScreenTools.defaultFontPixelHeight * 1.5
height: ScreenTools.defaultFontPixelHeight * 1.5
source: "/res/XDelete.svg"
fillMode: Image.PreserveAspectFit
mipmap: true
smooth: true
MouseArea {
anchors.fill: parent
onClicked: {
messageArea.close()
}
}
}
}
} }
...@@ -28,12 +28,12 @@ This file is part of the QGROUNDCONTROL project ...@@ -28,12 +28,12 @@ This file is part of the QGROUNDCONTROL project
*/ */
import QtQuick 2.5 import QtQuick 2.5
import QtQuick.Layouts 1.2
import QtQuick.Controls 1.2 import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2 import QtQuick.Controls.Styles 1.2
import QGroundControl 1.0 import QGroundControl 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
import QGroundControl.FactControls 1.0
import QGroundControl.Palette 1.0 import QGroundControl.Palette 1.0
import QGroundControl.MultiVehicleManager 1.0 import QGroundControl.MultiVehicleManager 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
...@@ -51,8 +51,6 @@ Rectangle { ...@@ -51,8 +51,6 @@ Rectangle {
property bool isBackgroundDark: true property bool isBackgroundDark: true
property bool opaqueBackground: false property bool opaqueBackground: false
property string formatedMessage: activeVehicle ? activeVehicle.formatedMessage : ""
/* /*
Dev System (Mac OS) Dev System (Mac OS)
...@@ -149,28 +147,6 @@ Rectangle { ...@@ -149,28 +147,6 @@ Rectangle {
MainToolBarController { id: _controller } MainToolBarController { id: _controller }
onFormatedMessageChanged: {
if(messageArea.visible) {
messageText.append(formatedMessage)
//-- Hack to scroll down
messageFlick.flick(0,-500)
}
}
function showMessageArea() {
if(multiVehicleManager.activeVehicleAvailable) {
messageText.text = activeVehicle.formatedMessages
//-- Hack to scroll to last message
for (var i = 0; i < activeVehicle.messageCount; i++)
messageFlick.flick(0,-5000)
activeVehicle.resetMessages()
} else {
messageText.text = "No Messages"
}
messageArea.visible = true
mainWindow.setMapInteractive(false)
}
function showToolbarMessage(message) { function showToolbarMessage(message) {
toolBarMessage.text = message toolBarMessage.text = message
toolBarMessageArea.visible = true toolBarMessageArea.visible = true
...@@ -180,6 +156,21 @@ Rectangle { ...@@ -180,6 +156,21 @@ Rectangle {
return (multiVehicleManager.activeVehicleAvailable && activeVehicle.heartbeatTimeout === 0); return (multiVehicleManager.activeVehicleAvailable && activeVehicle.heartbeatTimeout === 0);
} }
function getBatteryColor() {
if(activeVehicle) {
if(activeVehicle.batteryPercent > 75) {
return colorGreen
}
if(activeVehicle.batteryPercent > 50) {
return colorOrange
}
if(activeVehicle.batteryPercent > 0.1) {
return colorRed
}
}
return colorGrey
}
Component.onCompleted: { Component.onCompleted: {
//-- TODO: Get this from the actual state //-- TODO: Get this from the actual state
flyButton.checked = true flyButton.checked = true
...@@ -192,6 +183,113 @@ Rectangle { ...@@ -192,6 +183,113 @@ Rectangle {
onShowSetupView:{ setupButton.checked = true } onShowSetupView:{ setupButton.checked = true }
} }
//---------------------------------------------
// Battery Info
Component {
id: batteryInfo
Rectangle {
color: Qt.rgba(0,0,0,0.75)
width: battCol.width + ScreenTools.defaultFontPixelWidth * 3
height: battCol.height + ScreenTools.defaultFontPixelHeight * 2
radius: ScreenTools.defaultFontPixelHeight * 0.5
Column {
id: battCol
spacing: ScreenTools.defaultFontPixelHeight * 0.5
width: Math.max(battGrid.width, battLabel.width)
anchors.margins: ScreenTools.defaultFontPixelHeight
anchors.centerIn: parent
QGCLabel {
id: battLabel
text: (activeVehicle && (activeVehicle.batteryVoltage > 0)) ? "Battery Status" : "Battery Data Unavailable"
font.weight:Font.DemiBold
anchors.horizontalCenter: parent.horizontalCenter
}
GridLayout {
id: battGrid
visible: (activeVehicle && (activeVehicle.batteryVoltage > 0))
anchors.margins: ScreenTools.defaultFontPixelHeight
columnSpacing: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
columns: 2
QGCLabel {
text: "Voltage:"
}
QGCLabel {
text: activeVehicle ? (activeVehicle.batteryVoltage.toFixed(1) + " V") : "N/A"
color: getBatteryColor()
}
// TODO: What "controller" provides "Facts"?
/*
QGCLabel {
text: "Cell Voltage:"
}
QGCLabel {
text: (activeVehicle.batteryVoltage / controller.getParameterFact(-1, "BAT_N_CELLS").value) + "V"
color: getBatteryColor()
}
*/
QGCLabel {
text: "Accumulated Consumption:"
}
QGCLabel {
text: activeVehicle ? (activeVehicle.batteryConsumed + " mA") : "N/A"
color: getBatteryColor()
}
}
}
Component.onCompleted: {
var pos = mapFromItem(toolBar, centerX - (width / 2), toolBar.height)
x = pos.x
y = pos.y + ScreenTools.defaultFontPixelHeight
}
}
}
//---------------------------------------------
// RC RSSI Info
Component {
id: rcRSSIInfo
Rectangle {
color: Qt.rgba(0,0,0,0.75)
width: battCol.width + ScreenTools.defaultFontPixelWidth * 3
height: battCol.height + ScreenTools.defaultFontPixelHeight * 2
radius: ScreenTools.defaultFontPixelHeight * 0.5
Column {
id: battCol
spacing: ScreenTools.defaultFontPixelHeight * 0.5
width: Math.max(battGrid.width, rssiLabel.width)
anchors.margins: ScreenTools.defaultFontPixelHeight
anchors.centerIn: parent
QGCLabel {
id: rssiLabel
text: "RC RSSI Status"
font.weight:Font.DemiBold
anchors.horizontalCenter: parent.horizontalCenter
}
GridLayout {
id: battGrid
anchors.margins: ScreenTools.defaultFontPixelHeight
columnSpacing: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
columns: 2
QGCLabel {
text: "RSSI:"
}
QGCLabel {
text: activeVehicle ? (activeVehicle.rcRSSI + "%") : 0
}
}
}
Component.onCompleted: {
var pos = mapFromItem(toolBar, centerX - (width / 2), toolBar.height)
x = pos.x
y = pos.y + ScreenTools.defaultFontPixelHeight
}
}
}
//---------------------------------------------
// Toolbar Row
Row { Row {
id: viewRow id: viewRow
height: mainWindow.tbCellHeight height: mainWindow.tbCellHeight
...@@ -287,55 +385,6 @@ Rectangle { ...@@ -287,55 +385,6 @@ Rectangle {
} }
} }
//-------------------------------------------------------------------------
//-- System Message Area
Rectangle {
id: messageArea
width: mainWindow.width * 0.5
height: mainWindow.height * 0.5
anchors.top: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
color: Qt.rgba(0,0,0,0.75)
visible: false
radius: ScreenTools.defaultFontPixelHeight * 0.5
Flickable {
id: messageFlick
anchors.margins: ScreenTools.defaultFontPixelHeight
anchors.fill: parent
contentHeight: messageText.height
contentWidth: messageText.width
boundsBehavior: Flickable.StopAtBounds
pixelAligned: true
clip: true
TextEdit {
id: messageText
readOnly: true
textFormat: TextEdit.RichText
color: "white"
}
}
//-- Dismiss System Message
Image {
anchors.margins: ScreenTools.defaultFontPixelHeight
anchors.top: parent.top
anchors.right: parent.right
width: ScreenTools.defaultFontPixelHeight * 1.5
height: ScreenTools.defaultFontPixelHeight * 1.5
source: "/res/XDelete.svg"
fillMode: Image.PreserveAspectFit
mipmap: true
smooth: true
MouseArea {
anchors.fill: parent
onClicked: {
messageText.text = ""
messageArea.visible = false
mainWindow.setMapInteractive(true)
}
}
}
}
QGCLabel { QGCLabel {
id: connectionStatus id: connectionStatus
visible: (_controller.connectionCount > 0 && multiVehicleManager.activeVehicleAvailable && activeVehicle.heartbeatTimeout != 0) visible: (_controller.connectionCount > 0 && multiVehicleManager.activeVehicleAvailable && activeVehicle.heartbeatTimeout != 0)
......
...@@ -49,6 +49,7 @@ Row { ...@@ -49,6 +49,7 @@ Row {
} }
function getMessageColor() { function getMessageColor() {
if (activeVehicle) {
if (activeVehicle.messageTypeNone) if (activeVehicle.messageTypeNone)
return colorGrey return colorGrey
if (activeVehicle.messageTypeNormal) if (activeVehicle.messageTypeNormal)
...@@ -57,6 +58,7 @@ Row { ...@@ -57,6 +58,7 @@ Row {
return colorOrange; return colorOrange;
if (activeVehicle.messageTypeError) if (activeVehicle.messageTypeError)
return colorRed; return colorRed;
}
// Cannot be so make make it obnoxious to show error // Cannot be so make make it obnoxious to show error
console.log("Invalid vehicle message type") console.log("Invalid vehicle message type")
return "purple"; return "purple";
...@@ -75,26 +77,15 @@ Row { ...@@ -75,26 +77,15 @@ Row {
} }
function getBatteryPercentageText() { function getBatteryPercentageText() {
if(activeVehicle) {
if(activeVehicle.batteryPercent > 98.9) { if(activeVehicle.batteryPercent > 98.9) {
return "100%" return "100%"
} }
if(activeVehicle.batteryPercent > 0.1) { if(activeVehicle.batteryPercent > 0.1) {
return activeVehicle.batteryPercent.toFixed(0) + "%" return activeVehicle.batteryPercent.toFixed(0) + "%"
} }
return "N/A"
}
function getBatteryColor() {
if(activeVehicle.batteryPercent > 75) {
return colorGreen
}
if(activeVehicle.batteryPercent > 50) {
return colorOrange
} }
if(activeVehicle.batteryPercent > 0.1) { return "N/A"
return colorRed
}
return colorGrey
} }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
...@@ -103,13 +94,13 @@ Row { ...@@ -103,13 +94,13 @@ Row {
id: messages id: messages
width: mainWindow.tbCellHeight width: mainWindow.tbCellHeight
height: mainWindow.tbCellHeight height: mainWindow.tbCellHeight
visible: activeVehicle.messageCount visible: activeVehicle ? activeVehicle.messageCount : false
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
Item { Item {
id: criticalMessage id: criticalMessage
anchors.fill: parent anchors.fill: parent
visible: activeVehicle.messageCount > 0 && isMessageImportant visible: activeVehicle ? (activeVehicle.messageCount > 0 && isMessageImportant) : false
Image { Image {
source: "/qmlimages/Yield.svg" source: "/qmlimages/Yield.svg"
height: mainWindow.tbCellHeight * 0.75 height: mainWindow.tbCellHeight * 0.75
...@@ -160,7 +151,7 @@ Row { ...@@ -160,7 +151,7 @@ Row {
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
toolBar.showMessageArea() mainWindow.showMessageArea()
} }
} }
} }
...@@ -182,20 +173,20 @@ Row { ...@@ -182,20 +173,20 @@ Row {
smooth: true smooth: true
width: mainWindow.tbCellHeight * 0.65 width: mainWindow.tbCellHeight * 0.65
height: mainWindow.tbCellHeight * 0.5 height: mainWindow.tbCellHeight * 0.5
opacity: activeVehicle.satelliteCount < 1 ? 0.5 : 1 opacity: activeVehicle ? (activeVehicle.satelliteCount < 1 ? 0.5 : 1) : 0.5
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
SignalStrength { SignalStrength {
size: mainWindow.tbCellHeight * 0.5 size: mainWindow.tbCellHeight * 0.5
percent: getSatStrength(activeVehicle.satelliteCount) percent: activeVehicle ? getSatStrength(activeVehicle.satelliteCount) : ""
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
} }
QGCLabel { QGCLabel {
text: activeVehicle.satelliteCount text: activeVehicle ? activeVehicle.satelliteCount : 0
font.pixelSize: tbFontSmall font.pixelSize: tbFontSmall
color: colorWhite color: colorWhite
opacity: activeVehicle.satelliteCount < 1 ? 0.5 : 1 opacity: activeVehicle ? (activeVehicle.satelliteCount < 1 ? 0.5 : 1) : 0.5
anchors.top: parent.top anchors.top: parent.top
anchors.leftMargin: gpsIcon.width anchors.leftMargin: gpsIcon.width
anchors.left: parent.left anchors.left: parent.left
...@@ -218,15 +209,22 @@ Row { ...@@ -218,15 +209,22 @@ Row {
smooth: true smooth: true
width: mainWindow.tbCellHeight * 0.65 width: mainWindow.tbCellHeight * 0.65
height: mainWindow.tbCellHeight * 0.5 height: mainWindow.tbCellHeight * 0.5
opacity: activeVehicle.rcRSSI < 1 ? 0.5 : 1 opacity: activeVehicle ? (activeVehicle.rcRSSI < 1 ? 0.5 : 1) : 0.5
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
SignalStrength { SignalStrength {
size: mainWindow.tbCellHeight * 0.5 size: mainWindow.tbCellHeight * 0.5
percent: activeVehicle.rcRSSI percent: activeVehicle ? activeVehicle.rcRSSI : 0
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
} }
MouseArea {
anchors.fill: parent
onClicked: {
var centerX = mapToItem(toolBar, x, y).x + (width / 2)
mainWindow.showPopUp(rcRSSIInfo, centerX)
}
}
} }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
...@@ -235,47 +233,31 @@ Row { ...@@ -235,47 +233,31 @@ Row {
id: batteryStatus id: batteryStatus
width: battRow.width * 1.1 width: battRow.width * 1.1
height: mainWindow.tbCellHeight height: mainWindow.tbCellHeight
opacity: (activeVehicle.batteryVoltage > 0) ? 1 : 0.5 opacity: activeVehicle ? ((activeVehicle.batteryVoltage > 0) ? 1 : 0.5) : 0.5
Row { Row {
id: battRow id: battRow
height: mainWindow.tbCellHeight height: mainWindow.tbCellHeight
spacing: tbSpacing
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
Column {
spacing: tbSpacing * 0.5
anchors.verticalCenter: parent.verticalCenter
Image { Image {
id: batIcon
source: "/qmlimages/Battery.svg" source: "/qmlimages/Battery.svg"
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
mipmap: true mipmap: true
smooth: true smooth: true
height: batPercent.height * 0.85 height: mainWindow.tbCellHeight * 0.65
anchors.horizontalCenter: parent.horizontalCenter
}
QGCLabel {
text: (activeVehicle.batteryConsumed > 0) ? activeVehicle.batteryConsumed.toFixed(0) + 'mAh' : 'N/A';
font.pixelSize: tbFontSmall
color: getBatteryColor()
visible: QGroundControl.isAdvancedMode
anchors.horizontalCenter: parent.horizontalCenter
}
}
Column {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
}
QGCLabel { QGCLabel {
id: batPercent
text: getBatteryPercentageText() text: getBatteryPercentageText()
font.pixelSize: tbFontLarge font.pixelSize: tbFontLarge
color: getBatteryColor() color: getBatteryColor()
anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter
} }
QGCLabel {
text: getBatteryVoltageText()
font.pixelSize: tbFontNormal
color: getBatteryColor()
anchors.horizontalCenter: parent.horizontalCenter
} }
MouseArea {
anchors.fill: parent
onClicked: {
var centerX = mapToItem(toolBar, x, y).x + (width / 2)
mainWindow.showPopUp(batteryInfo, centerX)
} }
} }
} }
...@@ -286,7 +268,7 @@ Row { ...@@ -286,7 +268,7 @@ Row {
id: vehicleSelectorButton id: vehicleSelectorButton
width: ScreenTools.defaultFontPixelSize * 12 width: ScreenTools.defaultFontPixelSize * 12
height: mainWindow.tbButtonWidth height: mainWindow.tbButtonWidth
text: "Vehicle " + activeVehicle.id text: "Vehicle " + (activeVehicle ? activeVehicle.id : "None")
visible: QGroundControl.multiVehicleManager.vehicles.count > 1 visible: QGroundControl.multiVehicleManager.vehicles.count > 1
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
...@@ -357,7 +339,7 @@ Row { ...@@ -357,7 +339,7 @@ Row {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
QGCLabel { QGCLabel {
text: activeVehicle.flightMode text: activeVehicle ? activeVehicle.flightMode : "N/A"
font.pixelSize: tbFontLarge font.pixelSize: tbFontLarge
color: colorWhite color: colorWhite
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
...@@ -373,8 +355,12 @@ Row { ...@@ -373,8 +355,12 @@ Row {
MenuItem { MenuItem {
checkable: true checkable: true
checked: activeVehicle.flightMode === text checked: activeVehicle ? (activeVehicle.flightMode === text) : false
onTriggered: activeVehicle.flightMode = text onTriggered: {
if(activeVehicle) {
activeVehicle.flightMode = text
}
}
} }
} }
...@@ -404,7 +390,7 @@ Row { ...@@ -404,7 +390,7 @@ Row {
} }
MouseArea { MouseArea {
visible: activeVehicle.flightModeSetAvailable visible: activeVehicle ? activeVehicle.flightModeSetAvailable : false
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
flightModesMenu.popup() flightModesMenu.popup()
...@@ -429,11 +415,11 @@ Row { ...@@ -429,11 +415,11 @@ Row {
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
mipmap: true mipmap: true
smooth: true smooth: true
source: activeVehicle.armed ? "/qmlimages/Disarmed.svg" : "/qmlimages/Armed.svg" source: activeVehicle ? (activeVehicle.armed ? "/qmlimages/Disarmed.svg" : "/qmlimages/Armed.svg") : "/qmlimages/Disarmed.svg"
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
QGCLabel { QGCLabel {
text: activeVehicle.armed ? "Armed" : "Disarmed" text: activeVehicle ? (activeVehicle.armed ? "Armed" : "Disarmed") : ""
font.pixelSize: tbFontLarge font.pixelSize: tbFontLarge
color: colorWhite color: colorWhite
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
...@@ -450,8 +436,8 @@ Row { ...@@ -450,8 +436,8 @@ Row {
visible: false visible: false
icon: StandardIcon.Warning icon: StandardIcon.Warning
standardButtons: StandardButton.Yes | StandardButton.No standardButtons: StandardButton.Yes | StandardButton.No
title: activeVehicle.armed ? "Disarming Vehicle" : "Arming Vehicle" title: activeVehicle ? (activeVehicle.armed ? "Disarming Vehicle" : "Arming Vehicle") : ""
text: activeVehicle.armed ? "Do you want to disarm? This will cut power to all motors." : "Do you want to arm? This will enable all motors." text: activeVehicle ? (activeVehicle.armed ? "Do you want to disarm? This will cut power to all motors." : "Do you want to arm? This will enable all motors.") : ""
onYes: { onYes: {
activeVehicle.armed = !activeVehicle.armed activeVehicle.armed = !activeVehicle.armed
armDialog.visible = false armDialog.visible = false
......
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