Commit 29f03bba authored by DonLakeFlyer's avatar DonLakeFlyer

More PreFlight control reorganization

parent b9f7dcc9
......@@ -89,6 +89,8 @@
<file alias="QGroundControl/Controls/PIDTuning.qml">src/QmlControls/PIDTuning.qml</file>
<file alias="QGroundControl/Controls/PlanToolBar.qml">src/PlanView/PlanToolBar.qml</file>
<file alias="QGroundControl/Controls/PreFlightCheckButton.qml">src/QmlControls/PreFlightCheckButton.qml</file>
<file alias="QGroundControl/Controls/PreFlightCheckGroup.qml">src/QmlControls/PreFlightCheckGroup.qml</file>
<file alias="QGroundControl/Controls/PreFlightCheckList.qml">src/QmlControls/PreFlightCheckList.qml</file>
<file alias="QGroundControl/Controls/QGCButton.qml">src/QmlControls/QGCButton.qml</file>
<file alias="QGroundControl/Controls/QGCCheckBox.qml">src/QmlControls/QGCCheckBox.qml</file>
<file alias="QGroundControl/Controls/QGCColoredImage.qml">src/QmlControls/QGCColoredImage.qml</file>
......@@ -121,7 +123,7 @@
<file alias="QGroundControl/Controls/RallyPointMapVisuals.qml">src/PlanView/RallyPointMapVisuals.qml</file>
<file alias="QGroundControl/Controls/RCChannelMonitor.qml">src/QmlControls/RCChannelMonitor.qml</file>
<file alias="QGroundControl/Controls/RoundButton.qml">src/QmlControls/RoundButton.qml</file>
<file alias="QGroundControl/Controls/SectionHeader.qml">src/PlanView/SectionHeader.qml</file>
<file alias="QGroundControl/Controls/SectionHeader.qml">src/QmlControls/SectionHeader.qml</file>
<file alias="QGroundControl/Controls/SetupPage.qml">src/AutoPilotPlugins/Common/SetupPage.qml</file>
<file alias="QGroundControl/Controls/SignalStrength.qml">src/ui/toolbar/SignalStrength.qml</file>
<file alias="QGroundControl/Controls/SimpleItemMapVisual.qml">src/PlanView/SimpleItemMapVisual.qml</file>
......@@ -154,7 +156,7 @@
<file alias="QGroundControl/FlightDisplay/MultiVehicleList.qml">src/FlightDisplay/MultiVehicleList.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightAHRSCheck.qml">src/FlightDisplay/PreFlightAHRSCheck.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightBatteryCheck.qml">src/FlightDisplay/PreFlightBatteryCheck.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightCheckList.qml">src/FlightDisplay/PreFlightCheckList.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightCheckModel.qml">src/FlightDisplay/PreFlightCheckModel.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightRCCheck.qml">src/FlightDisplay/PreFlightRCCheck.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightSensorsCheck.qml">src/FlightDisplay/PreFlightSensorsCheck.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightSoundCheck.qml">src/FlightDisplay/PreFlightSoundCheck.qml</file>
......
......@@ -112,8 +112,8 @@ QGCView {
Component.onCompleted: start(true /* flyView */)
}
PreFlightCheckList {
id: preFlightCheckList
PreFlightCheckModel {
id: preFlightCheckModel
}
Connections {
......@@ -691,56 +691,8 @@ QGCView {
Component {
id: checklistDropPanel
Rectangle {
id: checklistRect
visible: true
width: mainColumn.width + 3*ScreenTools.defaultFontPixelWidth
height: mainColumn.height + ScreenTools.defaultFontPixelHeight
color: qgcPal.windowShade
radius: 3
enabled: QGroundControl.multiVehicleManager.vehicles.count > 0;
Column {
id: mainColumn
width: 40*ScreenTools.defaultFontPixelWidth
spacing: 0.8*ScreenTools.defaultFontPixelWidth
anchors.left: parent.left
anchors.top: parent.top
anchors.topMargin: 0.6*ScreenTools.defaultFontPixelWidth
anchors.leftMargin: 1.5*ScreenTools.defaultFontPixelWidth
// Header/title of checklist
Item {
width: parent.width
height: 1.75*ScreenTools.defaultFontPixelHeight
QGCLabel {
text: _activeVehicle ? qsTr("Pre-Flight Checklist") : qsTr("Pre-flight checklist (no vehicle)")
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
font.pointSize: ScreenTools.mediumFontPointSize
}
QGCButton {
width: 1.2*ScreenTools.defaultFontPixelHeight
height: 1.2*ScreenTools.defaultFontPixelHeight
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
opacity : 0.2+0.8*(QGroundControl.multiVehicleManager.vehicles.count > 0)
tooltip: qsTr("Reset the checklist (e.g. after a vehicle reboot)")
onClicked: preFlightCheckList.reset()
Image { source:"/qmlimages/MapSyncBlack.svg" ; anchors.fill: parent }
}
}
Rectangle {width:parent.width ; height:1 ; color:qgcPal.text}
// All check list items
Repeater {
model: preFlightCheckList.checkListItems
}
} // Column
} //Rectangle
PreFlightCheckList {
model: preFlightCheckModel
}
} //Component
} //QGC View
......@@ -17,29 +17,9 @@ import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0
import QGroundControl.Vehicle 1.0
// This class stores the data and functions of the check list but NOT the GUI (which is handled somewhere else).
Item {
// Properties
property ObjectModel checkListItems: _checkListItems
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property int _checkState: _activeVehicle ? (_activeVehicle.armed ? 1 + (buttonActuators.state + buttonMotors.state + buttonMission.state + buttonSoundOutput.state) / 4 / 4 : 0) : 0 ; // Shows progress of checks inside the checklist - unlocks next check steps in groups
function reset() {
buttonHardware.reset();
buttonBattery.reset();
buttonRC.reset();
buttonActuators.reset();
buttonMotors.reset();
buttonMission.reset();
buttonSoundOutput.reset();
buttonPayload.reset();
buttonWeather.reset();
buttonFlightAreaFree.reset();
}
// Check list item data
ObjectModel {
id: _checkListItems
ObjectModel {
PreFlightCheckGroup {
name: qsTr("Initial checks")
// Standard check list items (group 0) - Available from the start
PreFlightCheckButton {
......@@ -48,11 +28,11 @@ Item {
manualText: qsTr("Props mounted? Wings secured? Tail secured?")
}
PreFlightBatteryCheck {
id: buttonBattery
failureVoltage: 40
id: buttonBattery
failureVoltage: 40
}
PreFlightSensorsCheck {
id: buttonSensors
id: buttonSensors
}
PreFlightRCCheck {
id: buttonRC
......@@ -60,51 +40,56 @@ Item {
PreFlightAHRSCheck {
id: buttonEstimator
}
}
PreFlightCheckGroup {
name: qsTr("Please arm the vehicle here")
// Check list item group 1 - Require arming
QGCLabel {text:qsTr("<i>Please arm the vehicle here.</i>") ; opacity: 0.2+0.8*(QGroundControl.multiVehicleManager.vehicles.count > 0) ; anchors.horizontalCenter:buttonHardware.horizontalCenter ; anchors.topMargin:40 ; anchors.bottomMargin:40;}
PreFlightCheckButton {
id: buttonActuators
name: qsTr("Actuators")
group: 1
manualText: qsTr("Move all control surfaces. Did they work properly?")
id: buttonActuators
name: qsTr("Actuators")
group: 1
manualText: qsTr("Move all control surfaces. Did they work properly?")
}
PreFlightCheckButton {
id: buttonMotors
name: qsTr("Motors")
group: 1
manualText: qsTr("Propellers free? Then throttle up gently. Working properly?")
id: buttonMotors
name: qsTr("Motors")
group: 1
manualText: qsTr("Propellers free? Then throttle up gently. Working properly?")
}
PreFlightCheckButton {
id: buttonMission
name: qsTr("Mission")
group: 1
manualText: qsTr("Please confirm mission is valid (waypoints valid, no terrain collision).")
id: buttonMission
name: qsTr("Mission")
group: 1
manualText: qsTr("Please confirm mission is valid (waypoints valid, no terrain collision).")
}
PreFlightSoundCheck {
id: buttonSoundOutput
group: 1
id: buttonSoundOutput
group: 1
}
}
PreFlightCheckGroup {
name: qsTr("Last preparations before launch")
// Check list item group 2 - Final checks before launch
QGCLabel {text:qsTr("<i>Last preparations before launch</i>") ; opacity : 0.2+0.8*(_checkState >= 2); anchors.horizontalCenter:buttonHardware.horizontalCenter}
PreFlightCheckButton {
id: buttonPayload
name: qsTr("Payload")
group: 2
manualText: qsTr("Configured and started? Payload lid closed?")
id: buttonPayload
name: qsTr("Payload")
group: 2
manualText: qsTr("Configured and started? Payload lid closed?")
}
PreFlightCheckButton {
id: buttonWeather
name: "Wind & weather"
group: 2
manualText: qsTr("OK for your platform? Lauching into the wind?")
id: buttonWeather
name: "Wind & weather"
group: 2
manualText: qsTr("OK for your platform? Lauching into the wind?")
}
PreFlightCheckButton {
id: buttonFlightAreaFree
name: qsTr("Flight area")
group: 2
manualText: qsTr("Launch area and path free of obstacles/people?")
id: buttonFlightAreaFree
name: qsTr("Flight area")
group: 2
manualText: qsTr("Launch area and path free of obstacles/people?")
}
} // Object Model
}
}
} // Object Model
......@@ -11,7 +11,7 @@ GuidedAltitudeSlider 1.0 GuidedAltitudeSlider.qml
MultiVehicleList 1.0 MultiVehicleList.qml
PreFlightBatteryCheck 1.0 PreFlightBatteryCheck.qml
PreFlightAHRSCheck 1.0 PreFlightAHRSCheck.qml
PreFlightCheckList 1.0 PreFlightCheckList.qml
PreFlightCheckModel 1.0 PreFlightCheckModel.qml
PreFlightRCCheck 1.0 PreFlightRCCheck.qml
PreFlightSensorsCheck 1.0 PreFlightSensorsCheck.qml
PreFlightSoundCheck 1.0 PreFlightSoundCheck.qml
......
......@@ -51,7 +51,7 @@ void QGCPalette::_buildMap(void)
DECLARE_QGC_COLOR(window, "#ffffff", "#ffffff", "#222222", "#222222")
DECLARE_QGC_COLOR(windowShade, "#d9d9d9", "#d9d9d9", "#333333", "#333333")
DECLARE_QGC_COLOR(windowShadeDark, "#bdbdbd", "#bdbdbd", "#282828", "#282828")
DECLARE_QGC_COLOR(text, "#9d9d9d", "#000000", "#a0a0a0", "#ffffff")
DECLARE_QGC_COLOR(text, "#9d9d9d", "#000000", "#707070", "#ffffff")
DECLARE_QGC_COLOR(warningText, "#cc0808", "#cc0808", "#f85761", "#f85761")
DECLARE_QGC_COLOR(button, "#ffffff", "#ffffff", "#707070", "#626270")
DECLARE_QGC_COLOR(buttonText, "#9d9d9d", "#000000", "#202020", "#ffffff")
......
......@@ -15,8 +15,9 @@ import QGroundControl 1.0
import QGroundControl.Palette 1.0
import QGroundControl.ScreenTools 1.0
/// The PreFlightCheckButtons supports creating a button which the user then has to verify/click to confirm a check.
/// It also supports failing the check based on values from within the system: telemetry or QGC app values.
/// The PreFlightCheckButton supports creating a button which the user then has to verify/click to confirm a check.
/// It also supports failing the check based on values from within the system: telemetry or QGC app values. These
/// controls are normally placed within a PreFlightCheckGroup.
///
/// Two types of checks may be included on the button:
/// Manual - This is simply a check which the user must verify and confirm. It is not based on any system state.
......@@ -62,8 +63,6 @@ QGCButton {
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _allowTelemetryFailureOverride: telemetryTextOverride !== ""
enabled: preFlightCheckList._checkState >= group
opacity: 0.2 + (0.8 * (preFlightCheckList._checkState >= group))
width: 40 * ScreenTools.defaultFontPixelWidth
style: ButtonStyle {
......@@ -77,7 +76,6 @@ QGCButton {
background: Rectangle {
color: qgcPal.button
border.color: qgcPal.button;
radius: 3
Rectangle {
color: _color
......@@ -121,8 +119,17 @@ QGCButton {
}
}
onPassedChanged: callButtonPassedChanged()
onParentChanged: callButtonPassedChanged()
function callButtonPassedChanged() {
if (typeof parent.buttonPassedChanged === "function") {
parent.buttonPassedChanged()
}
}
function reset() {
_manualState = manualText === "" ? statePass : _statePending
_manualState = manualText === "" ? _statePassed : _statePending
if (telemetryFailure) {
_telemetryState = _allowTelemetryFailureOverride ? _statePending : _stateFailed
} else {
......
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QtQuick 2.3
import QtQml.Models 2.1
import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0
/// A PreFlightCheckGroup manages a set of PreFlightCheckButtons as a single entity.
Column {
property string name
property bool passed: false
spacing: ScreenTools.defaultFontPixelHeight / 2
property alias _checked: header.checked
onPassedChanged: {
parent.groupPassedChanged(ObjectModel.index)
if (passed) {
header.checked = false
}
}
Component.onCompleted: {
enabled = _checked
var moveList = []
for (var i=2; i<children.length; i++) {
moveList.push(children[i])
}
for (var i=0; i<moveList.length; i++) {
moveList[i].parent = innerColumn
}
}
function reset() {
for (var i=0; i<innerColumn.children.length; i++) {
innerColumn.children[i].reset()
}
}
SectionHeader {
id: header
text: name + (passed ? qsTr(" (passed)") : "")
}
Column {
id: innerColumn
spacing: ScreenTools.defaultFontPixelHeight / 2
visible: header.checked
function buttonPassedChanged() {
for (var i=0; i<children.length; i++) {
if (!children[i].passed) {
passed = false
return
}
}
passed = true
}
}
}
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQml.Models 2.1
import QGroundControl 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.Controls 1.0
Rectangle {
width: mainColumn.width + 3*ScreenTools.defaultFontPixelWidth
height: mainColumn.height + ScreenTools.defaultFontPixelHeight
color: qgcPal.windowShade
radius: 3
property alias model: checkListRepeater.model
property bool _passed: false
function reset() {
for (var i=0; i<model.count; i++) {
var group = model.get(i)
group.reset()
group.enabled = i === 0
group._checked = i === 0
}
}
Component.onCompleted: reset()
Column {
id: mainColumn
width: 40*ScreenTools.defaultFontPixelWidth
spacing: 0.8*ScreenTools.defaultFontPixelWidth
anchors.left: parent.left
anchors.top: parent.top
anchors.topMargin: 0.6*ScreenTools.defaultFontPixelWidth
anchors.leftMargin: 1.5*ScreenTools.defaultFontPixelWidth
function groupPassedChanged(index) {
if (index + 1 < checkListRepeater.count) {
var group = checkListRepeater.itemAt(index + 1)
group.enabled = true
group._checked = true
}
for (var i=0; i<checkListRepeater.count; i++) {
if (!checkListRepeater.itemAt(i).passed) {
_passed = false
return
}
}
_passed = true
}
// Header/title of checklist
Item {
width: parent.width
height: 1.75*ScreenTools.defaultFontPixelHeight
QGCLabel {
text: qsTr("Pre-Flight Checklist %1").arg(_passed ? qsTr("(passed)") : "")
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
font.pointSize: ScreenTools.mediumFontPointSize
}
QGCButton {
width: 1.2*ScreenTools.defaultFontPixelHeight
height: 1.2*ScreenTools.defaultFontPixelHeight
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
opacity : 0.2+0.8*(QGroundControl.multiVehicleManager.vehicles.count > 0)
tooltip: qsTr("Reset the checklist (e.g. after a vehicle reboot)")
onClicked: reset()
Image { source:"/qmlimages/MapSyncBlack.svg" ; anchors.fill: parent }
}
}
// All check list items
Repeater {
id: checkListRepeater
}
} // Column
} //Rectangle
......@@ -8,8 +8,6 @@ import QGroundControl.ScreenTools 1.0
Text {
QGCPalette { id: __qgcPal; colorGroupEnabled: enabled }
property bool enabled: true
font.pointSize: ScreenTools.defaultFontPointSize
font.family: ScreenTools.normalFontFamily
color: __qgcPal.text
......
......@@ -35,6 +35,8 @@ ParameterEditorDialog 1.0 ParameterEditorDialog.qml
PIDTuning 1.0 PIDTuning.qml
PlanToolBar 1.0 PlanToolBar.qml
PreFlightCheckButton 1.0 PreFlightCheckButton.qml
PreFlightCheckGroup 1.0 PreFlightCheckGroup.qml
PreFlightCheckList 1.0 PreFlightCheckList.qml
QGCButton 1.0 QGCButton.qml
QGCCheckBox 1.0 QGCCheckBox.qml
QGCColoredImage 1.0 QGCColoredImage.qml
......
......@@ -24,7 +24,7 @@ FocusScope {
exclusiveGroup.bindCheckable(_root)
}
QGCPalette { id: qgcPal; colorGroupEnabled: true }
QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
QGCMouseArea {
anchors.fill: parent
......
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