PreFlightCheckList.qml 4.19 KB
Newer Older
DonLakeFlyer's avatar
DonLakeFlyer committed
1 2 3 4 5 6 7 8 9
/****************************************************************************
 *
 *   (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.
 *
 ****************************************************************************/

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
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
DonLakeFlyer's avatar
DonLakeFlyer committed
25
    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
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44

    function resetNrClicks() {
        buttonHardware.resetNrClicks();
        buttonBattery.resetNrClicks();
        buttonRC.resetNrClicks();
        buttonActuators.resetNrClicks();
        buttonMotors.resetNrClicks();
        buttonMission.resetNrClicks();
        buttonSoundOutput.resetNrClicks();
        buttonPayload.resetNrClicks();
        buttonWeather.resetNrClicks();
        buttonFlightAreaFree.resetNrClicks();
    }

    // Check list item data
    ObjectModel {
        id: _checkListItems

        // Standard check list items (group 0) - Available from the start
DonLakeFlyer's avatar
DonLakeFlyer committed
45
        PreFlightCheckButton {
46 47
            id: buttonHardware
            name: "Hardware"
DonLakeFlyer's avatar
DonLakeFlyer committed
48
            defaultText: "Props mounted? Wings secured? Tail secured?"
49
        }
50 51 52
        PreFlightBatteryCheck {
             id:                buttonBattery
             failureVoltage:    40
53
        }
54
        PreFlightSensorsCheck {
55 56
             id: buttonSensors
        }
57
        PreFlightRCCheck {
58 59
            id: buttonRC
        }
60
        PreFlightAHRSCheck {
61 62 63 64 65
            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;}
DonLakeFlyer's avatar
DonLakeFlyer committed
66
        PreFlightCheckButton {
67 68 69
           id: buttonActuators
           name: "Actuators"
           group: 1
DonLakeFlyer's avatar
DonLakeFlyer committed
70
           defaultText: "Move all control surfaces. Did they work properly?"
71
        }
DonLakeFlyer's avatar
DonLakeFlyer committed
72
        PreFlightCheckButton {
73 74 75
           id: buttonMotors
           name: "Motors"
           group: 1
DonLakeFlyer's avatar
DonLakeFlyer committed
76
           defaultText: "Propellers free? Then throttle up gently. Working properly?"
77
        }
DonLakeFlyer's avatar
DonLakeFlyer committed
78
        PreFlightCheckButton {
79 80 81
           id: buttonMission
           name: "Mission"
           group: 1
DonLakeFlyer's avatar
DonLakeFlyer committed
82
           defaultText: "Please confirm mission is valid (waypoints valid, no terrain collision)."
83
        }
84 85 86
        PreFlightSoundCheck {
           id:      buttonSoundOutput
           group:   1
87 88 89 90
        }

        // 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}
DonLakeFlyer's avatar
DonLakeFlyer committed
91
        PreFlightCheckButton {
92 93 94
           id: buttonPayload
           name: "Payload"
           group: 2
DonLakeFlyer's avatar
DonLakeFlyer committed
95 96
           defaultText: "Configured and started?"
           pendingText: "Payload lid closed?"
97
        }
DonLakeFlyer's avatar
DonLakeFlyer committed
98
        PreFlightCheckButton {
99 100 101
           id: buttonWeather
           name: "Wind & weather"
           group: 2
DonLakeFlyer's avatar
DonLakeFlyer committed
102 103
           defaultText: "OK for your platform?"
           pendingText: "Launching into the wind?"
104
        }
DonLakeFlyer's avatar
DonLakeFlyer committed
105
        PreFlightCheckButton {
106 107 108
           id: buttonFlightAreaFree
           name: "Flight area"
           group: 2
DonLakeFlyer's avatar
DonLakeFlyer committed
109
           defaultText: "Launch area and path free of obstacles/people?"
110 111 112
        }
    } // Object Model
}