Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
7695c019
Commit
7695c019
authored
May 24, 2018
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create standalone controls for PreFlight
parent
119f88e1
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
247 additions
and
125 deletions
+247
-125
qgroundcontrol.qrc
qgroundcontrol.qrc
+5
-0
PreFlightAHRSCheck.qml
src/FlightDisplay/PreFlightAHRSCheck.qml
+38
-0
PreFlightBatteryCheck.qml
src/FlightDisplay/PreFlightBatteryCheck.qml
+48
-0
PreFlightCheckList.qml
src/FlightDisplay/PreFlightCheckList.qml
+9
-125
PreFlightRCCheck.qml
src/FlightDisplay/PreFlightRCCheck.qml
+40
-0
PreFlightSensorsCheck.qml
src/FlightDisplay/PreFlightSensorsCheck.qml
+56
-0
PreFlightSoundCheck.qml
src/FlightDisplay/PreFlightSoundCheck.qml
+46
-0
qmldir
src/FlightDisplay/qmldir
+5
-0
No files found.
qgroundcontrol.qrc
View file @
7695c019
...
...
@@ -152,7 +152,12 @@
<file alias="QGroundControl/FlightDisplay/GuidedActionsController.qml">src/FlightDisplay/GuidedActionsController.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedAltitudeSlider.qml">src/FlightDisplay/GuidedAltitudeSlider.qml</file>
<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/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>
<file alias="QGroundControl/FlightDisplay/qmldir">src/FlightDisplay/qmldir</file>
<file alias="QGroundControl/FlightMap/CameraTriggerIndicator.qml">src/FlightMap/MapItems/CameraTriggerIndicator.qml</file>
<file alias="QGroundControl/FlightMap/CenterMapDropButton.qml">src/FlightMap/Widgets/CenterMapDropButton.qml</file>
...
...
src/FlightDisplay/PreFlightAHRSCheck.qml
0 → 100644
View file @
7695c019
/****************************************************************************
*
* (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
QGroundControl
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Vehicle
1.0
PreFlightCheckButton
{
name
:
qsTr
(
"
Global position estimate
"
)
property
int
_unhealthySensors
:
_activeVehicle
?
_activeVehicle
.
sensorsUnhealthyBits
:
0
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
on_UnhealthySensorsChanged
:
updateItem
()
on_ActiveVehicleChanged
:
updateItem
()
Component.onCompleted
:
updateItem
()
function
updateItem
()
{
if
(
!
_activeVehicle
)
{
state
=
stateNotChecked
}
else
{
if
(
_unhealthySensors
&
Vehicle
.
SysStatusSensorAHRS
)
{
state
=
stateMajorIssue
}
else
{
state
=
statePassed
}
}
}
}
src/FlightDisplay/PreFlightBatteryCheck.qml
0 → 100644
View file @
7695c019
/****************************************************************************
*
* (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
QGroundControl
1.0
import
QGroundControl
.
Controls
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).
PreFlightCheckButton
{
name
:
qsTr
(
"
Battery
"
)
pendingtext
:
qsTr
(
"
Healthy & charged > %1. Battery connector firmly plugged?
"
).
arg
(
failureVoltage
)
property
int
failureVoltage
:
40
property
int
_unhealthySensors
:
_activeVehicle
?
_activeVehicle
.
sensorsUnhealthyBits
:
0
property
var
_batPercentRemaining
:
_activeVehicle
?
_activeVehicle
.
battery
.
percentRemaining
.
value
:
0
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
on_BatPercentRemainingChanged
:
updateItem
()
on_UnhealthySensorsChanged
:
updateItem
()
on_ActiveVehicleChanged
:
updateItem
()
Component.onCompleted
:
updateItem
()
function
updateItem
()
{
if
(
!
_activeVehicle
)
{
state
=
stateNotChecked
}
else
{
if
(
_unhealthySensors
&
Vehicle
.
SysStatusSensorBattery
)
{
failuretext
=
qsTr
(
"
Not healthy. Check console.
"
)
state
=
stateMajorIssue
}
else
if
(
_batPercentRemaining
<
failureVoltage
)
{
failuretext
=
qsTr
(
"
Low (below %1). Please recharge.
"
).
arg
(
failureVoltage
)
state
=
stateMajorIssue
}
else
{
state
=
_nrClicked
>
0
?
statePassed
:
statePending
}
}
}
}
src/FlightDisplay/PreFlightCheckList.qml
View file @
7695c019
...
...
@@ -20,41 +20,10 @@ 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
int
unhealthySensors
:
_activeVehicle
?
_activeVehicle
.
sensorsUnhealthyBits
:
0
property
bool
gpsLock
:
_activeVehicle
?
_activeVehicle
.
gps
.
lock
.
rawValue
>=
3
:
0
property
var
batPercentRemaining
:
_activeVehicle
?
_activeVehicle
.
battery
.
percentRemaining
.
value
:
0
property
bool
audioMuted
:
QGroundControl
.
settingsManager
.
appSettings
.
audioMuted
.
rawValue
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
// Connections
onBatPercentRemainingChanged
:
buttonBattery
.
updateItem
();
onGpsLockChanged
:
buttonSensors
.
updateItem
();
onAudioMutedChanged
:
buttonSoundOutput
.
updateItem
();
onUnhealthySensorsChanged
:
updateVehicleDependentItems
();
Connections
{
target
:
QGroundControl
.
multiVehicleManager
onActiveVehicleChanged
:
onActiveVehicleChanged
();
}
Component.onCompleted
:
{
if
(
QGroundControl
.
multiVehicleManager
.
vehicles
.
count
>
0
)
{
onActiveVehicleChanged
();
}
}
// Functions
function
updateVehicleDependentItems
()
{
buttonSensors
.
updateItem
();
buttonBattery
.
updateItem
();
buttonRC
.
updateItem
();
buttonEstimator
.
updateItem
();
}
function
onActiveVehicleChanged
()
{
buttonSoundOutput
.
updateItem
();
// Just updated here for initialization once we connect to a vehicle
updateVehicleDependentItems
();
}
function
resetNrClicks
()
{
buttonHardware
.
resetNrClicks
();
buttonBattery
.
resetNrClicks
();
...
...
@@ -78,88 +47,18 @@ Item {
name
:
"
Hardware
"
defaulttext
:
"
Props mounted? Wings secured? Tail secured?
"
}
PreFlightCheckButton
{
id
:
buttonBattery
name
:
"
Battery
"
pendingtext
:
"
Healthy & charged > 40%. Battery connector firmly plugged?
"
function
updateItem
()
{
if
(
!
_activeVehicle
)
{
state
=
statePassed
}
else
{
if
(
unhealthySensors
&
Vehicle
.
SysStatusSensorBattery
)
{
failuretext
=
qsTr
(
"
Not healthy. Check console.
"
)
state
=
stateMajorIssue
}
else
if
(
batPercentRemaining
<
40.0
)
{
failuretext
=
qsTr
(
"
Low (below 40%). Please recharge.
"
)
state
=
stateMajorIssue
}
else
{
state
=
_nrClicked
>
0
?
statePassed
:
statePending
}
}
}
PreFlightBatteryCheck
{
id
:
buttonBattery
failureVoltage
:
40
}
PreFlight
CheckButton
{
PreFlight
SensorsCheck
{
id
:
buttonSensors
name
:
"
Sensors
"
function
updateItem
()
{
if
(
!
_activeVehicle
)
{
state
=
statePassed
}
else
{
if
(
!
(
unhealthySensors
&
Vehicle
.
SysStatusSensor3dMag
)
&&
!
(
unhealthySensors
&
Vehicle
.
SysStatusSensor3dAccel
)
&&
!
(
unhealthySensors
&
Vehicle
.
SysStatusSensor3dGyro
)
&&
!
(
unhealthySensors
&
Vehicle
.
SysStatusSensorAbsolutePressure
)
&&
!
(
unhealthySensors
&
Vehicle
.
SysStatusSensorDifferentialPressure
)
&&
!
(
unhealthySensors
&
Vehicle
.
SysStatusSensorGPS
))
{
if
(
!
gpsLock
)
{
pendingtext
=
qsTr
(
"
Pending. Waiting for GPS lock.
"
)
state
=
statePending
}
else
{
state
=
statePassed
}
}
else
{
if
(
unhealthySensors
&
Vehicle
.
SysStatusSensor3dMag
)
failuretext
=
"
Failure. Magnetometer issues. Check console.
"
;
else
if
(
unhealthySensors
&
Vehicle
.
SysStatusSensor3dAccel
)
failuretext
=
"
Failure. Accelerometer issues. Check console.
"
;
else
if
(
unhealthySensors
&
Vehicle
.
SysStatusSensor3dGyro
)
failuretext
=
"
Failure. Gyroscope issues. Check console.
"
;
else
if
(
unhealthySensors
&
Vehicle
.
SysStatusSensorAbsolutePressure
)
failuretext
=
"
Failure. Barometer issues. Check console.
"
;
else
if
(
unhealthySensors
&
Vehicle
.
SysStatusSensorDifferentialPressure
)
failuretext
=
"
Failure. Airspeed sensor issues. Check console.
"
;
else
if
(
unhealthySensors
&
Vehicle
.
SysStatusSensorGPS
)
failuretext
=
"
Failure. No valid or low quality GPS signal. Check console.
"
;
state
=
stateMajorIssue
}
}
}
}
PreFlight
CheckButton
{
PreFlight
RCCheck
{
id
:
buttonRC
name
:
"
Radio Control
"
pendingtext
:
"
Receiving signal. Perform range test & confirm.
"
failuretext
:
"
No signal or invalid autopilot-RC config. Check RC and console.
"
function
updateItem
()
{
if
(
!
_activeVehicle
)
{
state
=
statePassed
}
else
{
if
(
unhealthySensors
&
Vehicle
.
SysStatusSensorRCReceiver
)
{
state
=
stateMajorIssue
}
else
{
state
=
_nrClicked
>
0
?
statePassed
:
statePending
}
}
}
}
PreFlight
CheckButton
{
PreFlight
AHRSCheck
{
id
:
buttonEstimator
name
:
"
Global position estimate
"
function
updateItem
()
{
if
(
!
_activeVehicle
)
{
state
=
statePassed
}
else
{
if
(
unhealthySensors
&
Vehicle
.
SysStatusSensorAHRS
)
{
state
=
stateMajorIssue
}
else
{
state
=
statePassed
}
}
}
}
// Check list item group 1 - Require arming
...
...
@@ -182,24 +81,9 @@ Item {
group
:
1
defaulttext
:
"
Please confirm mission is valid (waypoints valid, no terrain collision).
"
}
PreFlightCheckButton
{
id
:
buttonSoundOutput
name
:
"
Sound output
"
group
:
1
pendingtext
:
"
QGC audio output enabled. System audio output enabled, too?
"
failuretext
:
"
Failure, QGC audio output is disabled. Please enable it under application settings->general to hear audio warnings!
"
function
updateItem
()
{
if
(
!
_activeVehicle
)
{
state
=
statePassed
}
else
{
if
(
audioMuted
)
{
state
=
stateMajorIssue
_nrClicked
=
0
}
else
{
state
=
_nrClicked
>
0
?
statePassed
:
statePending
}
}
}
PreFlightSoundCheck
{
id
:
buttonSoundOutput
group
:
1
}
// Check list item group 2 - Final checks before launch
...
...
src/FlightDisplay/PreFlightRCCheck.qml
0 → 100644
View file @
7695c019
/****************************************************************************
*
* (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
QGroundControl
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Vehicle
1.0
PreFlightCheckButton
{
name
:
qsTr
(
"
Radio Control
"
)
pendingtext
:
qsTr
(
"
Receiving signal. Perform range test & confirm.
"
)
failuretext
:
qsTr
(
"
No signal or invalid autopilot-RC config. Check RC and console.
"
)
property
int
_unhealthySensors
:
_activeVehicle
?
_activeVehicle
.
sensorsUnhealthyBits
:
0
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
on_UnhealthySensorsChanged
:
updateItem
()
on_ActiveVehicleChanged
:
updateItem
()
Component.onCompleted
:
updateItem
()
function
updateItem
()
{
if
(
!
_activeVehicle
)
{
state
=
stateNotChecked
}
else
{
if
(
_unhealthySensors
&
Vehicle
.
SysStatusSensorRCReceiver
)
{
state
=
stateMajorIssue
}
else
{
state
=
_nrClicked
>
0
?
statePassed
:
statePending
}
}
}
}
src/FlightDisplay/PreFlightSensorsCheck.qml
0 → 100644
View file @
7695c019
/****************************************************************************
*
* (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
QGroundControl
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Vehicle
1.0
PreFlightCheckButton
{
name
:
qsTr
(
"
Sensors
"
)
property
int
_unhealthySensors
:
_activeVehicle
?
_activeVehicle
.
sensorsUnhealthyBits
:
0
property
bool
_gpsLock
:
_activeVehicle
?
_activeVehicle
.
gps
.
lock
.
rawValue
>=
3
:
0
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
on_GpsLockChanged
:
updateItem
()
on_UnhealthySensorsChanged
:
updateItem
()
on_ActiveVehicleChanged
:
updateItem
()
Component.onCompleted
:
updateItem
()
function
updateItem
()
{
if
(
!
_activeVehicle
)
{
state
=
stateNotChecked
}
else
{
if
(
!
(
_unhealthySensors
&
Vehicle
.
SysStatusSensor3dMag
)
&&
!
(
_unhealthySensors
&
Vehicle
.
SysStatusSensor3dAccel
)
&&
!
(
_unhealthySensors
&
Vehicle
.
SysStatusSensor3dGyro
)
&&
!
(
_unhealthySensors
&
Vehicle
.
SysStatusSensorAbsolutePressure
)
&&
!
(
_unhealthySensors
&
Vehicle
.
SysStatusSensorDifferentialPressure
)
&&
!
(
_unhealthySensors
&
Vehicle
.
SysStatusSensorGPS
))
{
if
(
!
_gpsLock
)
{
pendingtext
=
qsTr
(
"
Pending. Waiting for GPS lock.
"
)
state
=
statePending
}
else
{
state
=
statePassed
}
}
else
{
if
(
_unhealthySensors
&
Vehicle
.
SysStatusSensor3dMag
)
failuretext
=
qsTr
(
"
Failure. Magnetometer issues. Check console.
"
)
else
if
(
_unhealthySensors
&
Vehicle
.
SysStatusSensor3dAccel
)
failuretext
=
qsTr
(
"
Failure. Accelerometer issues. Check console.
"
)
else
if
(
_unhealthySensors
&
Vehicle
.
SysStatusSensor3dGyro
)
failuretext
=
qsTr
(
"
Failure. Gyroscope issues. Check console.
"
)
else
if
(
_unhealthySensors
&
Vehicle
.
SysStatusSensorAbsolutePressure
)
failuretext
=
qsTr
(
"
Failure. Barometer issues. Check console.
"
)
else
if
(
_unhealthySensors
&
Vehicle
.
SysStatusSensorDifferentialPressure
)
failuretext
=
qsTr
(
"
Failure. Airspeed sensor issues. Check console.
"
)
else
if
(
_unhealthySensors
&
Vehicle
.
SysStatusSensorGPS
)
failuretext
=
qsTr
(
"
Failure. No valid or low quality GPS signal. Check console.
"
)
state
=
stateMajorIssue
}
}
}
}
src/FlightDisplay/PreFlightSoundCheck.qml
0 → 100644
View file @
7695c019
/****************************************************************************
*
* (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
QGroundControl
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Vehicle
1.0
PreFlightCheckButton
{
name
:
qsTr
(
"
Sound output
"
)
pendingtext
:
qsTr
(
"
QGC audio output enabled. System audio output enabled, too?
"
)
failuretext
:
qsTr
(
"
Failure, QGC audio output is disabled. Please enable it under application settings->general to hear audio warnings!
"
)
property
bool
_audioMuted
:
QGroundControl
.
settingsManager
.
appSettings
.
audioMuted
.
rawValue
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
on_AudioMutedChanged
:
updateItem
()
on_ActiveVehicleChanged
:
updateItem
()
Component.onCompleted
:
updateItem
()
function
onActiveVehicleChanged
()
{
buttonSoundOutput
.
updateItem
();
// Just updated here for initialization once we connect to a vehicle
updateVehicleDependentItems
();
}
function
updateItem
()
{
if
(
!
_activeVehicle
)
{
state
=
stateNotChecked
}
else
{
if
(
_audioMuted
)
{
state
=
stateMajorIssue
_nrClicked
=
0
}
else
{
state
=
_nrClicked
>
0
?
statePassed
:
statePending
}
}
}
}
src/FlightDisplay/qmldir
View file @
7695c019
...
...
@@ -9,5 +9,10 @@ GuidedActionsController 1.0 GuidedActionsController.qml
GuidedActionList 1.0 GuidedActionList.qml
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
PreFlightRCCheck 1.0 PreFlightRCCheck.qml
PreFlightSensorsCheck 1.0 PreFlightSensorsCheck.qml
PreFlightSoundCheck 1.0 PreFlightSoundCheck.qml
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment