Commit c8e4878d authored by Jacob Walser's avatar Jacob Walser

Flight Display: refactor video recording status for readability

parent 6af4274d
...@@ -44,6 +44,7 @@ QGCView { ...@@ -44,6 +44,7 @@ QGCView {
property var _rallyPointController: _planMasterController.rallyPointController property var _rallyPointController: _planMasterController.rallyPointController
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property var _videoReceiver: QGroundControl.videoManager.videoReceiver property var _videoReceiver: QGroundControl.videoManager.videoReceiver
property bool _recordingVideo: _videoReceiver && _videoReceiver.recording
property bool _mainIsMap: QGroundControl.videoManager.hasVideo ? QGroundControl.loadBoolGlobalSetting(_mainIsMapKey, true) : true property bool _mainIsMap: QGroundControl.videoManager.hasVideo ? QGroundControl.loadBoolGlobalSetting(_mainIsMapKey, true) : true
property bool _isPipVisible: QGroundControl.videoManager.hasVideo ? QGroundControl.loadBoolGlobalSetting(_PIPVisibleKey, true) : false property bool _isPipVisible: QGroundControl.videoManager.hasVideo ? QGroundControl.loadBoolGlobalSetting(_PIPVisibleKey, true) : false
property real _savedZoomLevel: 0 property real _savedZoomLevel: 0
...@@ -381,11 +382,11 @@ QGCView { ...@@ -381,11 +382,11 @@ QGCView {
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
width: height width: height
radius: QGroundControl.videoManager && _videoReceiver && _videoReceiver.recording ? 0 : height radius: _recordingVideo ? 0 : height
color: "red" color: "red"
SequentialAnimation on visible { SequentialAnimation on visible {
running: QGroundControl.videoManager && QGroundControl.videoManager.videoReceiver && QGroundControl.videoManager.videoReceiver.recording running: _recordingVideo
loops: Animation.Infinite loops: Animation.Infinite
PropertyAnimation { to: false; duration: 1000 } PropertyAnimation { to: false; duration: 1000 }
PropertyAnimation { to: true; duration: 1000 } PropertyAnimation { to: true; duration: 1000 }
...@@ -407,12 +408,13 @@ QGCView { ...@@ -407,12 +408,13 @@ QGCView {
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
if (QGroundControl.videoManager && QGroundControl.videoManager.videoReceiver) { if (_videoReceiver) {
if (QGroundControl.videoManager.videoReceiver.recording) { if (_recordingVideo) {
QGroundControl.videoManager.videoReceiver.stopRecording() _videoReceiver.stopRecording()
// reset blinking animation
recordBtnBackground.visible = true recordBtnBackground.visible = true
} else { } else {
QGroundControl.videoManager.videoReceiver.startRecording() _videoReceiver.startRecording()
} }
} }
} }
......
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