Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework vehicle sensors_health alert #5135

Merged
merged 3 commits into from
Aug 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/FlightMap/Widgets/InstrumentSwipeView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ Item {
showPage(_currentPage)
}

function currentPage() {
return _currentPage
}

MouseArea {
anchors.fill: parent
onClicked: showNextPage()
Expand Down
31 changes: 31 additions & 0 deletions src/FlightMap/Widgets/QGCInstrumentWidget.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use a QGCMouseArea for this? This will cause it to automatically expand in size on touch systems. You set fillItem instead of doing an anchors.fill

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to merge and just change it over myself after the fact.

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 {
Expand Down
7 changes: 0 additions & 7 deletions src/FlightMap/Widgets/VehicleHealthWidget.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/FlightMap/Widgets/VibrationWidget.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down