Commit 260b4bc1 authored by DonLakeFlyer's avatar DonLakeFlyer

Commands which apply to all vehicles

Plus other ui tweaks
parent 0690559b
...@@ -18,55 +18,93 @@ import QGroundControl.Palette 1.0 ...@@ -18,55 +18,93 @@ import QGroundControl.Palette 1.0
import QGroundControl.Vehicle 1.0 import QGroundControl.Vehicle 1.0
import QGroundControl.FlightMap 1.0 import QGroundControl.FlightMap 1.0
QGCListView { Item {
property var guidedActionsController
property real _margin: ScreenTools.defaultFontPixelWidth / 2
property real _widgetHeight: ScreenTools.defaultFontPixelHeight * 3
property color _textColor: "black"
property real _rectOpacity: 0.8
QGCPalette { id: qgcPal }
NoMouseThroughRectangle {
id: mvCommands
anchors.left: parent.left
anchors.right: parent.right
height: mvCommandsColumn.height + (_margin *2)
color: qgcPal.missionItemEditor
opacity: _rectOpacity
radius: _margin
Column {
id: mvCommandsColumn
anchors.margins: _margin
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
spacing: _margin
QGCLabel {
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("The following commands will be applied to all vehicles")
color: _textColor
wrapMode: Text.WordWrap
font.pointSize: ScreenTools.smallFontPointSize
}
Row {
spacing: _margin
QGCButton {
text: "Pause"
onClicked: guidedActionsController.confirmAction(guidedActionsController.actionMVPause)
}
QGCButton {
text: "Start Mision"
onClicked: guidedActionsController.confirmAction(guidedActionsController.actionMVStartMission)
}
}
}
}
QGCListView {
id: missionItemEditorListView id: missionItemEditorListView
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: _margin
anchors.top: mvCommands.bottom
anchors.bottom: parent.bottom
spacing: ScreenTools.defaultFontPixelHeight / 2 spacing: ScreenTools.defaultFontPixelHeight / 2
orientation: ListView.Vertical orientation: ListView.Vertical
model: QGroundControl.multiVehicleManager.vehicles model: QGroundControl.multiVehicleManager.vehicles
cacheBuffer: _cacheBuffer < 0 ? 0 : _cacheBuffer cacheBuffer: _cacheBuffer < 0 ? 0 : _cacheBuffer
clip: true clip: true
property real _margin: ScreenTools.defaultFontPixelWidth / 2
property real _cacheBuffer: height * 2 property real _cacheBuffer: height * 2
property real _widgetHeight: ScreenTools.defaultFontPixelHeight * 3
delegate: Rectangle { delegate: Rectangle {
width: parent.width width: parent.width
height: innerColumn.y + innerColumn.height + _margin height: innerColumn.y + innerColumn.height + _margin
color: qgcPal.missionItemEditor color: qgcPal.missionItemEditor
opacity: 0.8 opacity: _rectOpacity
radius: _margin radius: _margin
property var _vehicle: object property var _vehicle: object
property color _textColor: "black"
QGCPalette { id: qgcPal } ColumnLayout {
id: innerColumn
Row {
id: widgetLayout
anchors.margins: _margin anchors.margins: _margin
anchors.top: parent.top anchors.top: parent.top
anchors.right: parent.right anchors.left: parent.left
spacing: ScreenTools.defaultFontPixelWidth / 2 anchors.right: parent.left
layoutDirection: Qt.RightToLeft spacing: _margin
QGCCompassWidget {
size: _widgetHeight
vehicle: _vehicle
}
QGCAttitudeWidget {
size: _widgetHeight
vehicle: _vehicle
}
}
RowLayout { RowLayout {
anchors.top: widgetLayout.top
anchors.bottom: widgetLayout.bottom
anchors.left: parent.left anchors.left: parent.left
anchors.right: widgetLayout.left anchors.right: parent.left
spacing: ScreenTools.defaultFontPixelWidth / 2
QGCLabel { QGCLabel {
Layout.alignment: Qt.AlignTop Layout.alignment: Qt.AlignTop
...@@ -74,27 +112,34 @@ QGCListView { ...@@ -74,27 +112,34 @@ QGCListView {
color: _textColor color: _textColor
} }
ColumnLayout {
Layout.alignment: Qt.AlignCenter
spacing: _margin
FlightModeMenu { FlightModeMenu {
anchors.horizontalCenter: parent.horizontalCenter
font.pointSize: ScreenTools.largeFontPointSize font.pointSize: ScreenTools.largeFontPointSize
color: _textColor color: _textColor
activeVehicle: _vehicle activeVehicle: _vehicle
} }
QGCLabel {
anchors.horizontalCenter: parent.horizontalCenter
text: _vehicle.armed ? qsTr("Armed") : qsTr("Disarmed")
color: _textColor
}
} }
Column { QGCCompassWidget {
id: innerColumn size: _widgetHeight
anchors.margins: _margin vehicle: _vehicle
anchors.left: parent.left }
anchors.right: parent.right
anchors.top: widgetLayout.bottom
spacing: _margin
Rectangle { QGCAttitudeWidget {
anchors.left: parent.left size: _widgetHeight
anchors.right: parent.right vehicle: _vehicle
height: 5
color: "green"
} }
} // RowLayout
Row { Row {
spacing: ScreenTools.defaultFontPixelWidth spacing: ScreenTools.defaultFontPixelWidth
...@@ -106,13 +151,13 @@ QGCListView { ...@@ -106,13 +151,13 @@ QGCListView {
} }
QGCButton { QGCButton {
text: "Start" text: "Start Mission"
visible: _vehicle.armed && _vehicle.flightMode != _vehicle.missionFlightMode visible: _vehicle.armed && _vehicle.flightMode != _vehicle.missionFlightMode
onClicked: _vehicle.flightMode = _vehicle.missionFlightMode onClicked: _vehicle.startMission()
} }
QGCButton { QGCButton {
text: "Stop" text: "Pause"
visible: _vehicle.armed && _vehicle.pauseVehicleSupported visible: _vehicle.armed && _vehicle.pauseVehicleSupported
onClicked: _vehicle.pauseVehicle() onClicked: _vehicle.pauseVehicle()
} }
...@@ -128,8 +173,8 @@ QGCListView { ...@@ -128,8 +173,8 @@ QGCListView {
visible: _vehicle.armed && _vehicle.flightMode != _vehicle.takeControlFlightMode visible: _vehicle.armed && _vehicle.flightMode != _vehicle.takeControlFlightMode
onClicked: _vehicle.flightMode = _vehicle.takeControlFlightMode onClicked: _vehicle.flightMode = _vehicle.takeControlFlightMode
} }
} // Row
} } // ColumnLayout
} } // delegate - Rectangle
} } // QGCListView
} // QGCListView } // Item
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