QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
PreFlightCheckModel.qml
Go to the documentation of this file.
1import QtQuick
2import QtQml.Models
3
4ObjectModel {
5 id: _root
6 property bool enforceOrder: true
7
8 function reset() {
9 for (var i=0; i<_root.count; i++) {
10 var group = _root.get(i)
11 group.reset()
12 if (enforceOrder) {
13 group.enabled = i === 0
14 } else {
15 group.enabled = true
16 }
17 group._checked = i === 0
18 }
19 }
20
21 function isPassed() {
22 for (var i = 0; i < _root.count; i++) {
23 var group = _root.get(i)
24 if(!group.passed) {
25 return false
26 }
27 }
28 return true
29 }
30
31 Component.onCompleted: reset()
32
33}