Browse Source

Merge pull request #5135 from bluerobotics/vehicle-health-alert

Rework vehicle sensors_health alert
QGC4.4
Don Gagne 8 years ago committed by GitHub
parent
commit
42a2e61d25
  1. 4
      src/FlightMap/Widgets/InstrumentSwipeView.qml
  2. 31
      src/FlightMap/Widgets/QGCInstrumentWidget.qml
  3. 7
      src/FlightMap/Widgets/VehicleHealthWidget.qml
  4. 2
      src/FlightMap/Widgets/VibrationWidget.qml

4
src/FlightMap/Widgets/InstrumentSwipeView.qml

@ -41,6 +41,10 @@ Item { @@ -41,6 +41,10 @@ Item {
showPage(_currentPage)
}
function currentPage() {
return _currentPage
}
MouseArea {
anchors.fill: parent
onClicked: showNextPage()

31
src/FlightMap/Widgets/QGCInstrumentWidget.qml

@ -92,6 +92,37 @@ Rectangle { @@ -92,6 +92,37 @@ Rectangle {
onClicked: _valuesWidget.showPicker()
}
}
Image {
id: healthWarning
anchors.bottom: outerCompass.bottom
anchors.left: outerCompass.left
source: "/qmlimages/Yield.svg"
mipmap: true
visible: _activeVehicle ? !_warningsViewed && _activeVehicle.unhealthySensors.length > 0 && _valuesWidget.currentPage() != 2 : false
opacity: 0.8
width: outerCompass.width * 0.15
sourceSize.width: width
fillMode: Image.PreserveAspectFit
property bool _warningsViewed: false
MouseArea {
anchors.fill: parent
hoverEnabled: true
onEntered: healthWarning.opacity = 1
onExited: healthWarning.opacity = 0.8
onClicked: {
_valuesWidget.showPage(2)
healthWarning._warningsViewed = true
}
}
Connections {
target: _activeVehicle
onUnhealthySensorsChanged: healthWarning._warningsViewed = false
}
}
}
Rectangle {

7
src/FlightMap/Widgets/VehicleHealthWidget.qml

@ -27,13 +27,6 @@ QGCFlickable { @@ -27,13 +27,6 @@ QGCFlickable {
property var unhealthySensors: QGroundControl.multiVehicleManager.activeVehicle ? QGroundControl.multiVehicleManager.activeVehicle.unhealthySensors : [ ]
// Any time the unhealthy sensors list changes, switch to the health page
onUnhealthySensorsChanged: {
if (unhealthySensors.length != 0) {
showPage(2)
}
}
MouseArea {
anchors.fill: parent
onClicked: showNextPage()

2
src/FlightMap/Widgets/VibrationWidget.qml

@ -153,7 +153,7 @@ QGCFlickable { @@ -153,7 +153,7 @@ QGCFlickable {
}
QGCLabel {
text: qsTr("Accel 2: ") + (_activeVehicle ? _activeVehicle.vibration.clipCount3.valueString : "")
text: qsTr("Accel 3: ") + (_activeVehicle ? _activeVehicle.vibration.clipCount3.valueString : "")
color: textColor
}
}

Loading…
Cancel
Save