13 changed files with 354 additions and 246 deletions
@ -1,110 +0,0 @@
@@ -1,110 +0,0 @@
|
||||
/**************************************************************************** |
||||
* |
||||
* (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 1.0 |
||||
import QGroundControl.FlightDisplay 1.0 |
||||
import QGroundControl.ScreenTools 1.0 |
||||
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 |
||||
|
||||
// Standard check list items (group 0) - Available from the start |
||||
PreFlightCheckButton { |
||||
id: buttonHardware |
||||
name: qsTr("Hardware") |
||||
manualText: qsTr("Props mounted? Wings secured? Tail secured?") |
||||
} |
||||
PreFlightBatteryCheck { |
||||
id: buttonBattery |
||||
failureVoltage: 40 |
||||
} |
||||
PreFlightSensorsCheck { |
||||
id: buttonSensors |
||||
} |
||||
PreFlightRCCheck { |
||||
id: buttonRC |
||||
} |
||||
PreFlightAHRSCheck { |
||||
id: buttonEstimator |
||||
} |
||||
|
||||
// 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?") |
||||
} |
||||
PreFlightCheckButton { |
||||
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).") |
||||
} |
||||
PreFlightSoundCheck { |
||||
id: buttonSoundOutput |
||||
group: 1 |
||||
} |
||||
|
||||
// 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?") |
||||
} |
||||
PreFlightCheckButton { |
||||
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?") |
||||
} |
||||
} // Object Model |
||||
} |
@ -0,0 +1,95 @@
@@ -0,0 +1,95 @@
|
||||
/**************************************************************************** |
||||
* |
||||
* (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 1.0 |
||||
import QGroundControl.FlightDisplay 1.0 |
||||
import QGroundControl.ScreenTools 1.0 |
||||
import QGroundControl.Controls 1.0 |
||||
import QGroundControl.Palette 1.0 |
||||
import QGroundControl.Vehicle 1.0 |
||||
|
||||
ObjectModel { |
||||
PreFlightCheckGroup { |
||||
name: qsTr("Initial checks") |
||||
|
||||
// Standard check list items (group 0) - Available from the start |
||||
PreFlightCheckButton { |
||||
id: buttonHardware |
||||
name: qsTr("Hardware") |
||||
manualText: qsTr("Props mounted? Wings secured? Tail secured?") |
||||
} |
||||
PreFlightBatteryCheck { |
||||
id: buttonBattery |
||||
failureVoltage: 40 |
||||
} |
||||
PreFlightSensorsCheck { |
||||
id: buttonSensors |
||||
} |
||||
PreFlightRCCheck { |
||||
id: buttonRC |
||||
} |
||||
PreFlightAHRSCheck { |
||||
id: buttonEstimator |
||||
} |
||||
} |
||||
|
||||
PreFlightCheckGroup { |
||||
name: qsTr("Please arm the vehicle here") |
||||
|
||||
PreFlightCheckButton { |
||||
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?") |
||||
} |
||||
PreFlightCheckButton { |
||||
id: buttonMission |
||||
name: qsTr("Mission") |
||||
group: 1 |
||||
manualText: qsTr("Please confirm mission is valid (waypoints valid, no terrain collision).") |
||||
} |
||||
PreFlightSoundCheck { |
||||
id: buttonSoundOutput |
||||
group: 1 |
||||
} |
||||
} |
||||
|
||||
PreFlightCheckGroup { |
||||
name: qsTr("Last preparations before launch") |
||||
|
||||
// Check list item group 2 - Final checks before launch |
||||
PreFlightCheckButton { |
||||
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?") |
||||
} |
||||
PreFlightCheckButton { |
||||
id: buttonFlightAreaFree |
||||
name: qsTr("Flight area") |
||||
group: 2 |
||||
manualText: qsTr("Launch area and path free of obstacles/people?") |
||||
} |
||||
} |
||||
} // Object Model |
@ -0,0 +1,69 @@
@@ -0,0 +1,69 @@
|
||||
/**************************************************************************** |
||||
* |
||||
* (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 |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,93 @@
@@ -0,0 +1,93 @@
|
||||
/**************************************************************************** |
||||
* |
||||
* (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 |
Loading…
Reference in new issue