Browse Source

Merge pull request #6501 from DonLakeFlyer/PreFlightButtons

PreFlight: Style cleanup and changes
QGC4.4
Don Gagne 7 years ago committed by GitHub
parent
commit
77b6dc5e57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/FlightDisplay/FlightDisplayView.qml
  2. 6
      src/FlightDisplay/PreFlightBatteryCheck.qml
  3. 18
      src/FlightDisplay/PreFlightCheckList.qml
  4. 4
      src/FlightDisplay/PreFlightRCCheck.qml
  5. 37
      src/FlightDisplay/PreFlightSensorsCheck.qml
  6. 4
      src/FlightDisplay/PreFlightSoundCheck.qml
  7. 5
      src/QmlControls/DropPanel.qml
  8. 22
      src/QmlControls/PreFlightCheckButton.qml

4
src/FlightDisplay/FlightDisplayView.qml

@ -716,7 +716,7 @@ QGCView { @@ -716,7 +716,7 @@ QGCView {
height: 1.75*ScreenTools.defaultFontPixelHeight
QGCLabel {
text: _activeVehicle ? qsTr("Pre-flight checklist")+" (MAV ID:"+_activeVehicle.id+")" : qsTr("Pre-flight checklist (no vehicle)")
text: _activeVehicle ? qsTr("Pre-Flight Checklist") : qsTr("Pre-flight checklist (no vehicle)")
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
font.pointSize: ScreenTools.mediumFontPointSize
@ -727,7 +727,7 @@ QGCView { @@ -727,7 +727,7 @@ QGCView {
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
opacity : 0.2+0.8*(QGroundControl.multiVehicleManager.vehicles.count > 0)
tooltip: "Reset the checklist (e.g. after a vehicle reboot)"
tooltip: qsTr("Reset the checklist (e.g. after a vehicle reboot)")
onClicked: preFlightCheckList.resetNrClicks()

6
src/FlightDisplay/PreFlightBatteryCheck.qml

@ -16,7 +16,7 @@ import QGroundControl.Vehicle 1.0 @@ -16,7 +16,7 @@ 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)
pendingText: qsTr("Healthy & charged > %1. Battery connector firmly plugged?").arg(failureVoltage)
property int failureVoltage: 40
@ -35,10 +35,10 @@ PreFlightCheckButton { @@ -35,10 +35,10 @@ PreFlightCheckButton {
state = stateNotChecked
} else {
if (_unhealthySensors & Vehicle.SysStatusSensorBattery) {
failuretext = qsTr("Not healthy. Check console.")
failureText = qsTr("Not healthy. Check console.")
state = stateMajorIssue
} else if (_batPercentRemaining < failureVoltage) {
failuretext = qsTr("Low (below %1). Please recharge.").arg(failureVoltage)
failureText = qsTr("Low (below %1). Please recharge.").arg(failureVoltage)
state = stateMajorIssue
} else {
state = _nrClicked > 0 ? statePassed : statePending

18
src/FlightDisplay/PreFlightCheckList.qml

@ -45,7 +45,7 @@ Item { @@ -45,7 +45,7 @@ Item {
PreFlightCheckButton {
id: buttonHardware
name: "Hardware"
defaulttext: "Props mounted? Wings secured? Tail secured?"
defaultText: "Props mounted? Wings secured? Tail secured?"
}
PreFlightBatteryCheck {
id: buttonBattery
@ -67,19 +67,19 @@ Item { @@ -67,19 +67,19 @@ Item {
id: buttonActuators
name: "Actuators"
group: 1
defaulttext: "Move all control surfaces. Did they work properly?"
defaultText: "Move all control surfaces. Did they work properly?"
}
PreFlightCheckButton {
id: buttonMotors
name: "Motors"
group: 1
defaulttext: "Propellers free? Then throttle up gently. Working properly?"
defaultText: "Propellers free? Then throttle up gently. Working properly?"
}
PreFlightCheckButton {
id: buttonMission
name: "Mission"
group: 1
defaulttext: "Please confirm mission is valid (waypoints valid, no terrain collision)."
defaultText: "Please confirm mission is valid (waypoints valid, no terrain collision)."
}
PreFlightSoundCheck {
id: buttonSoundOutput
@ -92,21 +92,21 @@ Item { @@ -92,21 +92,21 @@ Item {
id: buttonPayload
name: "Payload"
group: 2
defaulttext: "Configured and started?"
pendingtext: "Payload lid closed?"
defaultText: "Configured and started?"
pendingText: "Payload lid closed?"
}
PreFlightCheckButton {
id: buttonWeather
name: "Wind & weather"
group: 2
defaulttext: "OK for your platform?"
pendingtext: "Launching into the wind?"
defaultText: "OK for your platform?"
pendingText: "Launching into the wind?"
}
PreFlightCheckButton {
id: buttonFlightAreaFree
name: "Flight area"
group: 2
defaulttext: "Launch area and path free of obstacles/people?"
defaultText: "Launch area and path free of obstacles/people?"
}
} // Object Model
}

4
src/FlightDisplay/PreFlightRCCheck.qml

@ -15,8 +15,8 @@ import QGroundControl.Vehicle 1.0 @@ -15,8 +15,8 @@ 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.")
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

37
src/FlightDisplay/PreFlightSensorsCheck.qml

@ -16,11 +16,22 @@ import QGroundControl.Vehicle 1.0 @@ -16,11 +16,22 @@ import QGroundControl.Vehicle 1.0
PreFlightCheckButton {
name: qsTr("Sensors")
property int failureSatCount: -1 ///< -1 indicates no sat count check
property int _unhealthySensors: _activeVehicle ? _activeVehicle.sensorsUnhealthyBits : 0
property bool _gpsLock: _activeVehicle ? _activeVehicle.gps.lock.rawValue>=3 : 0
property bool _gpsLock: _activeVehicle ? _activeVehicle.gps.lock.rawValue >= 3 : 0
property bool _satCount: _activeVehicle ? _activeVehicle.gps.count : 0
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property int _allCheckedSensors: Vehicle.SysStatusSensor3dMag |
Vehicle.SysStatusSensor3dAccel |
Vehicle.SysStatusSensor3dGyro |
Vehicle.SysStatusSensorAbsolutePressure |
Vehicle.SysStatusSensorDifferentialPressure |
Vehicle.SysStatusSensorGPS
on_GpsLockChanged: updateItem()
on_SatCountChanged: updateItem()
on_UnhealthySensorsChanged: updateItem()
on_ActiveVehicleChanged: updateItem()
@ -30,25 +41,23 @@ PreFlightCheckButton { @@ -30,25 +41,23 @@ PreFlightCheckButton {
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(!(_unhealthySensors & _allCheckedSensors)) {
if (!_gpsLock) {
pendingtext = qsTr("Pending. Waiting for GPS lock.")
pendingText = qsTr("Pending. Waiting for GPS lock.")
state = statePending
} else if (failureSatCount !== -1 && _satCount <= failureSatCount) {
pendingText = qsTr("Pending. Waiting for Sat Count > %1.").arg(failureSatCount)
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.")
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
}
}

4
src/FlightDisplay/PreFlightSoundCheck.qml

@ -15,8 +15,8 @@ import QGroundControl.Vehicle 1.0 @@ -15,8 +15,8 @@ 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!")
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

5
src/QmlControls/DropPanel.qml

@ -120,6 +120,10 @@ Item { @@ -120,6 +120,10 @@ Item {
Item {
id: dropDownItem
DeadMouseArea {
anchors.fill: parent
}
Canvas {
id: arrowCanvas
anchors.fill: parent
@ -161,5 +165,6 @@ Item { @@ -161,5 +165,6 @@ Item {
property var dropPanel: _root
}
}
} // Item - dropDownItem
}

22
src/QmlControls/PreFlightCheckButton.qml

@ -18,9 +18,9 @@ import QGroundControl.ScreenTools 1.0 @@ -18,9 +18,9 @@ import QGroundControl.ScreenTools 1.0
QGCButton {
property string name: ""
property int group: 0
property string defaulttext: qsTr("Not checked yet")
property string pendingtext: ""
property string failuretext: qsTr("Failure. Check console.")
property string defaultText: qsTr("Not checked yet")
property string pendingText: ""
property string failureText: qsTr("Failure. Check console.")
property int state: stateNotChecked
readonly property int stateNotChecked: 0
@ -31,7 +31,7 @@ QGCButton { @@ -31,7 +31,7 @@ QGCButton {
property var _color: qgcPal.button
property int _nrClicked: 0
property string _text: name + ": " + defaulttext
property string _text: name + ": " + defaultText
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
enabled: (!_activeVehicle || _activeVehicle.connectionLost) ? false : preFlightCheckList._checkState >= group
@ -48,8 +48,8 @@ QGCButton { @@ -48,8 +48,8 @@ QGCButton {
}
}
onPendingtextChanged: { if (state === statePending) { getTextFromState(); getColorFromState(); } }
onFailuretextChanged: { if (state === stateMajorIssue) { getTextFromState(); getColorFromState(); } }
onPendingTextChanged: { if (state === statePending) { getTextFromState(); getColorFromState(); } }
onFailureTextChanged: { if (state === stateMajorIssue) { getTextFromState(); getColorFromState(); } }
onStateChanged: { getTextFromState(); getColorFromState(); }
onClicked: {
if (state <= statePending) {
@ -60,12 +60,12 @@ QGCButton { @@ -60,12 +60,12 @@ QGCButton {
function updateItem() {
// This is the default updateFunction. It assumes the item is a MANUAL check list item, i.e. one that
// only requires user clicks (one click if pendingtext="", two clicks otherwise) for completion.
// only requires user clicks (one click if pendingText="", two clicks otherwise) for completion.
if (_nrClicked === 0) {
state = stateNotChecked
} else if (_nrClicked === 1) {
if (pendingtext.length === 0) {
if (pendingText.length === 0) {
state = statePassed
} else {
state = statePending
@ -80,13 +80,13 @@ QGCButton { @@ -80,13 +80,13 @@ QGCButton {
function getTextFromState() {
if (state === stateNotChecked) {
_text = qsTr(name) + ": " + qsTr(defaulttext)
_text = qsTr(name) + ": " + qsTr(defaultText)
} else if (state === statePending) {
_text = "<b>"+qsTr(name)+"</b>" +": " + pendingtext
_text = "<b>"+qsTr(name)+"</b>" +": " + pendingText
} else if (state === stateMinorIssue) {
_text = "<b>"+qsTr(name)+"</b>" +": " + qsTr("Minor problem")
} else if (state === stateMajorIssue) {
_text = "<b>"+qsTr(name)+"</b>" +": " + failuretext
_text = "<b>"+qsTr(name)+"</b>" +": " + failureText
} else if (state === statePassed) {
_text = "<b>"+qsTr(name)+"</b>" +": " + qsTr("OK")
} else {

Loading…
Cancel
Save