From 8135d8ddc7a8e6c8851300abf97c886e0e473002 Mon Sep 17 00:00:00 2001 From: olliw42 Date: Wed, 30 Oct 2019 18:10:05 +0100 Subject: [PATCH 1/4] CameraManager: bug in CameraPageWudget.gml, stream variable not defined, also avoids a gray spurios window --- src/FlightMap/Widgets/CameraPageWidget.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/FlightMap/Widgets/CameraPageWidget.qml b/src/FlightMap/Widgets/CameraPageWidget.qml index 916dca3..f2212cc 100644 --- a/src/FlightMap/Widgets/CameraPageWidget.qml +++ b/src/FlightMap/Widgets/CameraPageWidget.qml @@ -42,6 +42,7 @@ Column { property real _labelFieldWidth: ScreenTools.defaultFontPixelWidth * 30 property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 30 property bool _communicationLost: activeVehicle ? activeVehicle.connectionLost : false + property bool _streamingEnabled: false //TODO: determine what it should be, VideoPageWidget.qml does QGroundControl.settingsManager.videoSettings.streamConfigured property bool _hasModes: _camera && _camera && _camera.hasModes property bool _videoRecording: _camera && _camera.videoStatus === QGCCameraControl.VIDEO_CAPTURE_STATUS_RUNNING property bool _storageReady: _camera && _camera.storageStatus === QGCCameraControl.STORAGE_READY From 838d9e927f31f4872aa76d6f3c13fa7364c82a1a Mon Sep 17 00:00:00 2001 From: olliw42 Date: Fri, 1 Nov 2019 15:47:49 +0100 Subject: [PATCH 2/4] CameraManager: two bugs in CameraPageWidgets, resolves cant-stop-video issue --- src/FlightMap/Widgets/CameraPageWidget.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FlightMap/Widgets/CameraPageWidget.qml b/src/FlightMap/Widgets/CameraPageWidget.qml index 2f68954..6800d1c 100644 --- a/src/FlightMap/Widgets/CameraPageWidget.qml +++ b/src/FlightMap/Widgets/CameraPageWidget.qml @@ -45,10 +45,10 @@ Column { property bool _streamingEnabled: false //TODO: determine what it should be, VideoPageWidget.qml does QGroundControl.settingsManager.videoSettings.streamConfigured property bool _hasModes: _camera && _camera.hasModes property bool _videoRecording: _camera && _camera.videoStatus === QGCCameraControl.VIDEO_CAPTURE_STATUS_RUNNING - property bool _photoIdle: _camera && _camera.photoStatus === QGCCameraControl.PHOTO_CAPTURE_IDLE + property bool _photoIdle: _camera && (_camera.photoStatus === QGCCameraControl.PHOTO_CAPTURE_IDLE || _camera.photoStatus >= QGCCameraControl.PHOTO_CAPTURE_LAST) property bool _storageReady: _camera && _camera.storageStatus === QGCCameraControl.STORAGE_READY property bool _storageIgnored: _camera && _camera.storageStatus === QGCCameraControl.STORAGE_NOT_SUPPORTED - property bool _canShoot: !_cameraModeUndefined && !_videoRecording && _photoIdle && ((_storageReady && _camera.storageFree > 0) || _storageIgnored) + property bool _canShoot: !_cameraModeUndefined && ((_storageReady && _camera.storageFree > 0) || _storageIgnored) function showSettings() { mainWindow.showComponentDialog(cameraSettings, _cameraVideoMode ? qsTr("Video Settings") : qsTr("Camera Settings"), 70, StandardButton.Ok) From aa68a73c8fddbeb482197e3d93606bc177b2f7ae Mon Sep 17 00:00:00 2001 From: olliw42 Date: Sat, 2 Nov 2019 05:28:12 +0100 Subject: [PATCH 3/4] merge stuff of pr-isshooting --- src/FlightMap/Widgets/CameraPageWidget.qml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/FlightMap/Widgets/CameraPageWidget.qml b/src/FlightMap/Widgets/CameraPageWidget.qml index 6800d1c..ad9a2c6 100644 --- a/src/FlightMap/Widgets/CameraPageWidget.qml +++ b/src/FlightMap/Widgets/CameraPageWidget.qml @@ -49,6 +49,7 @@ Column { property bool _storageReady: _camera && _camera.storageStatus === QGCCameraControl.STORAGE_READY property bool _storageIgnored: _camera && _camera.storageStatus === QGCCameraControl.STORAGE_NOT_SUPPORTED property bool _canShoot: !_cameraModeUndefined && ((_storageReady && _camera.storageFree > 0) || _storageIgnored) + property bool _isShooting: (_cameraVideoMode && _videoRecording) || (_cameraPhotoMode && !_photoIdle) function showSettings() { mainWindow.showComponentDialog(cameraSettings, _cameraVideoMode ? qsTr("Video Settings") : qsTr("Camera Settings"), 70, StandardButton.Ok) @@ -107,7 +108,7 @@ Column { color: _cameraVideoMode ? qgcPal.colorGreen : qgcPal.text MouseArea { anchors.fill: parent - enabled: _cameraPhotoMode + enabled: _cameraPhotoMode && !_isShooting onClicked: { _camera.setVideoMode() } @@ -134,7 +135,7 @@ Column { color: _cameraPhotoMode ? qgcPal.colorGreen : qgcPal.text MouseArea { anchors.fill: parent - enabled: _cameraVideoMode + enabled: _cameraVideoMode && !_isShooting onClicked: { _camera.setPhotoMode() } @@ -155,9 +156,9 @@ Column { border.width: 3 anchors.horizontalCenter: parent.horizontalCenter Rectangle { - width: parent.width * (_videoRecording || (_cameraPhotoMode && !_photoIdle && _cameraElapsedMode) ? 0.5 : 0.75) + width: parent.width * (_isShooting ? 0.5 : 0.75) height: width - radius: _videoRecording || (_cameraPhotoMode && !_photoIdle && _cameraElapsedMode) ? 0 : width * 0.5 + radius: _isShooting ? 0 : width * 0.5 color: _canShoot ? qgcPal.colorRed : qgcPal.colorGrey anchors.centerIn: parent } @@ -177,6 +178,7 @@ Column { } } } + //-- Timer/Counter Item { width: 1; height: ScreenTools.defaultFontPixelHeight * 0.75; visible: _camera; } QGCLabel { text: (_cameraVideoMode && _camera.videoStatus === QGCCameraControl.VIDEO_CAPTURE_STATUS_RUNNING) ? _camera.recordTimeStr : "00:00:00" @@ -190,6 +192,7 @@ Column { visible: _cameraPhotoMode anchors.horizontalCenter: parent.horizontalCenter } + //-- Settings Item { width: 1; height: ScreenTools.defaultFontPixelHeight; visible: _camera; } Component { id: cameraSettings From 0dcf712d0e618cd97e37e345d1c8db4c92341387 Mon Sep 17 00:00:00 2001 From: olliw42 Date: Sun, 3 Nov 2019 08:56:21 +0100 Subject: [PATCH 4/4] bug: checked for _isCamera but _camera used --- src/FlightMap/Widgets/CameraPageWidget.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FlightMap/Widgets/CameraPageWidget.qml b/src/FlightMap/Widgets/CameraPageWidget.qml index ad9a2c6..f296852 100644 --- a/src/FlightMap/Widgets/CameraPageWidget.qml +++ b/src/FlightMap/Widgets/CameraPageWidget.qml @@ -231,7 +231,7 @@ Column { //-- Stream Selector Row { spacing: ScreenTools.defaultFontPixelWidth - visible: _isCamera && _camera.streamLabels.length > 1 + visible: _camera && _camera.streamLabels.length > 1 anchors.horizontalCenter: parent.horizontalCenter QGCLabel { text: qsTr("Stream Selector:")