Commit b9c5d2ed authored by DonLakeFlyer's avatar DonLakeFlyer

Style cleanup and changes

* Added support for sat count to Sensors check control
parent 4ee40f9f
......@@ -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 {
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()
......
......@@ -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 {
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
......
......@@ -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 {
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 {
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
}
......@@ -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
......
......@@ -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 {
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
}
}
......
......@@ -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
......
......@@ -120,6 +120,10 @@ Item {
Item {
id: dropDownItem
DeadMouseArea {
anchors.fill: parent
}
Canvas {
id: arrowCanvas
anchors.fill: parent
......@@ -161,5 +165,6 @@ Item {
property var dropPanel: _root
}
}
} // Item - dropDownItem
}
......@@ -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 {
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 {
}
}
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 {
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 {
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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment