diff --git a/qgcresources.qrc b/qgcresources.qrc
index 3f7b733f7f237a065c0514d2f6fb0f3103c95281..a1085bbb816fbf7239aa610748b25a97ca330a12 100644
--- a/qgcresources.qrc
+++ b/qgcresources.qrc
@@ -48,7 +48,6 @@
src/QmlControls/arrow-down.png
resources/camera.svg
src/Camera/images/camera_photo.svg
- src/Camera/images/camera_settings.svg
src/Camera/images/camera_video.svg
src/QmlControls/check.png
src/VehicleSetup/FirmwareUpgradeIcon.png
diff --git a/qgroundcontrol.qrc b/qgroundcontrol.qrc
index f9fe44274272af4da385f1847134a9abac6cf1bf..ce13d5a07c6f47b1338cb42d0acc832678dce46b 100644
--- a/qgroundcontrol.qrc
+++ b/qgroundcontrol.qrc
@@ -21,7 +21,6 @@
src/ui/preferences/BluetoothSettings.qml
src/AutoPilotPlugins/PX4/CameraComponent.qml
src/AutoPilotPlugins/PX4/CameraComponentSummary.qml
- src/Camera/CameraControl.qml
src/ViewWidgets/CustomCommandWidget.qml
src/ui/preferences/DebugWindow.qml
src/AutoPilotPlugins/Common/ESP8266Component.qml
diff --git a/src/Camera/CameraControl.qml b/src/Camera/CameraControl.qml
deleted file mode 100644
index fa855feb5161fbc190162f340d39c9aa944cacc8..0000000000000000000000000000000000000000
--- a/src/Camera/CameraControl.qml
+++ /dev/null
@@ -1,341 +0,0 @@
-/****************************************************************************
- *
- * (c) 2009-2016 QGROUNDCONTROL PROJECT
- *
- * QGroundControl is licensed according to the terms in the file
- * COPYING.md in the root of the source code directory.
- *
- ****************************************************************************/
-
-
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Dialogs 1.2
-import QtGraphicalEffects 1.0
-
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Vehicle 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-
-Rectangle {
- id: mainRect
- height: mainRow.height + (ScreenTools.defaultFontPixelWidth * 2)
- width: mainRow.width + (ScreenTools.defaultFontPixelWidth * 2)
- radius: ScreenTools.defaultFontPixelWidth * 0.5
- color: qgcPal.globalTheme === QGCPalette.Light ? Qt.rgba(1,1,1,0.95) : Qt.rgba(0,0,0,0.75)
- border.width: 1
- border.color: qgcPal.globalTheme === QGCPalette.Light ? Qt.rgba(0,0,0,0.35) : Qt.rgba(1,1,1,0.35)
-
- QGCPalette { id: qgcPal; colorGroupEnabled: true }
-
- property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
- property var _dynamicCameras: _activeVehicle ? _activeVehicle.dynamicCameras : null
- property bool _isCamera: _dynamicCameras ? _dynamicCameras.cameras.count > 0 : false
- property bool _cameraModeUndefined: _isCamera ? _dynamicCameras.cameras.get(0).cameraMode === QGCCameraControl.CAMERA_MODE_UNDEFINED : true
- property bool _cameraVideoMode: _isCamera ? _dynamicCameras.cameras.get(0).cameraMode === QGCCameraControl.CAMERA_MODE_VIDEO : false
- property bool _cameraPhotoMode: _isCamera ? _dynamicCameras.cameras.get(0).cameraMode === QGCCameraControl.CAMERA_MODE_PHOTO : false
- property var _camera: _isCamera ? _dynamicCameras.cameras.get(0) : null // Single camera support for the time being
- property real _spacers: ScreenTools.defaultFontPixelHeight * 0.5
- property real _labelFieldWidth: ScreenTools.defaultFontPixelWidth * 30
- property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 30
- property bool _communicationLost: _activeVehicle ? _activeVehicle.connectionLost : false
- property bool _hasModes: _isCamera && _camera && _camera.hasModes
-
- MouseArea {
- anchors.fill: parent
- onWheel: { wheel.accepted = true; }
- onPressed: { mouse.accepted = true; }
- onReleased: { mouse.accepted = true; }
- }
-
- Connections {
- target: QGroundControl.multiVehicleManager.activeVehicle
- onConnectionLostChanged: {
- if(_communicationLost) {
- if(rootLoader.sourceComponent === cameraSettingsComponent) {
- rootLoader.sourceComponent = null
- }
- }
- }
- }
-
- Row {
- id: mainRow
- spacing: _spacers
- anchors.centerIn: parent
- Column {
- spacing: _spacers
- anchors.verticalCenter: parent.verticalCenter
- //-----------------------------------------------------------------
- QGCLabel {
- id: cameraLabel
- text: _isCamera ? _dynamicCameras.cameras.get(0).modelName : qsTr("Camera")
- font.pointSize: ScreenTools.smallFontPointSize
- anchors.horizontalCenter: parent.horizontalCenter
- }
- //-- Camera Mode (visible only if camera has modes)
- Rectangle {
- width: _hasModes ? ScreenTools.defaultFontPixelWidth * 12 : 0
- height: _hasModes ? ScreenTools.defaultFontPixelWidth * 4 : 0
- color: qgcPal.window
- radius: height * 0.5
- visible: _hasModes
- anchors.horizontalCenter: parent.horizontalCenter
- //-- Video Mode
- Rectangle {
- width: parent.height * 0.9
- height: parent.height * 0.9
- color: qgcPal.windowShadeDark
- radius: height * 0.5
- anchors.left: parent.left
- anchors.leftMargin: 4
- anchors.verticalCenter: parent.verticalCenter
- QGCColoredImage {
- anchors.fill: parent
- source: "/qmlimages/camera_video.svg"
- fillMode: Image.PreserveAspectFit
- sourceSize.height: height
- color: _cameraVideoMode ? qgcPal.colorGreen : qgcPal.text
- MouseArea {
- anchors.fill: parent
- enabled: _cameraPhotoMode
- onClicked: {
- _camera.setVideoMode()
- }
- }
- }
- }
- //-- Photo Mode
- Rectangle {
- width: parent.height * 0.9
- height: parent.height * 0.9
- color: qgcPal.window
- radius: height * 0.5
- anchors.right: parent.right
- anchors.rightMargin: 4
- anchors.verticalCenter: parent.verticalCenter
- QGCColoredImage {
- anchors.fill: parent
- source: "/qmlimages/camera_photo.svg"
- fillMode: Image.PreserveAspectFit
- sourceSize.height: height
- color: _cameraPhotoMode ? qgcPal.colorGreen : qgcPal.text
- MouseArea {
- anchors.fill: parent
- enabled: _cameraVideoMode
- onClicked: {
- _camera.setPhotoMode()
- }
- }
- }
- }
- }
- //-- Settings
- QGCColoredImage {
- width: ScreenTools.defaultFontPixelWidth * 3
- height: width
- sourceSize.width: width
- source: "/qmlimages/camera_settings.svg"
- fillMode: Image.PreserveAspectFit
- color: _cameraModeUndefined ? qgcPal.colorGrey : qgcPal.text
- anchors.horizontalCenter: parent.horizontalCenter
- MouseArea {
- anchors.fill: parent
- enabled: !_cameraModeUndefined
- onClicked: {
- if(rootLoader.sourceComponent === null) {
- rootLoader.sourceComponent = cameraSettingsComponent
- } else {
- rootLoader.sourceComponent = null
- }
- }
- }
- }
- }
- //-- Shutter
- Rectangle {
- color: Qt.rgba(0,0,0,0)
- width: ScreenTools.defaultFontPixelWidth * 6
- height: width
- radius: width * 0.5
- border.color: qgcPal.buttonText
- border.width: 3
- anchors.verticalCenter: parent.verticalCenter
- Rectangle {
- width: parent.width * 0.75
- height: width
- radius: width * 0.5
- color: _cameraModeUndefined ? qgcPal.colorGrey : qgcPal.colorRed
- anchors.centerIn: parent
- }
- MouseArea {
- anchors.fill: parent
- enabled: !_cameraModeUndefined
- onClicked: {
- if(_cameraVideoMode) {
- //-- Start/Stop Video
- } else {
- _camera.takePhoto()
- }
- }
- }
- }
- }
-
- Component {
- id: cameraSettingsComponent
- Item {
- id: cameraSettingsRect
- width: mainWindow.width
- height: mainWindow.height
- anchors.centerIn: parent
- MouseArea {
- anchors.fill: parent
- onClicked: {
- rootLoader.sourceComponent = null
- }
- }
- Rectangle {
- id: camSettingsRect
- width: _labelFieldWidth + _editFieldWidth + (ScreenTools.defaultFontPixelWidth * 8)
- height: Math.max(mainWindow.height * 0.65, ScreenTools.defaultFontPixelHeight * 20)
- radius: ScreenTools.defaultFontPixelWidth
- color: qgcPal.globalTheme === QGCPalette.Light ? Qt.rgba(1,1,1,0.95) : Qt.rgba(0,0,0,0.75)
- border.width: 1
- border.color: qgcPal.globalTheme === QGCPalette.Light ? Qt.rgba(0,0,0,0.35) : Qt.rgba(1,1,1,0.35)
- anchors.centerIn: parent
- QGCLabel {
- id: cameraSettingsLabel
- text: _cameraVideoMode ? qsTr("Video Settings") : qsTr("Camera Settings")
- font.family: ScreenTools.demiboldFontFamily
- font.pointSize: ScreenTools.mediumFontPointSize
- anchors.margins: ScreenTools.defaultFontPixelHeight * 0.5
- anchors.top: parent.top
- anchors.left: parent.left
- }
- QGCFlickable {
- clip: true
- anchors.top: cameraSettingsLabel.bottom
- anchors.topMargin: ScreenTools.defaultFontPixelHeight
- anchors.bottom: parent.bottom
- width: cameraSettingsCol.width
- contentHeight: cameraSettingsCol.height
- contentWidth: cameraSettingsCol.width
- anchors.horizontalCenter: parent.horizontalCenter
- Column {
- id: cameraSettingsCol
- spacing: ScreenTools.defaultFontPixelHeight * 0.5
- width: camSettingsRect.width
- anchors.margins: ScreenTools.defaultFontPixelHeight
- //-------------------------------------------
- //-- Camera Settings
- Repeater {
- model: _camera ? _camera.activeSettings : []
- Row {
- spacing: ScreenTools.defaultFontPixelWidth
- anchors.horizontalCenter: parent.horizontalCenter
- QGCLabel {
- text: _camera.getFact(modelData).shortDescription
- width: _labelFieldWidth
- anchors.verticalCenter: parent.verticalCenter
- }
- FactComboBox {
- width: _editFieldWidth
- fact: _camera.getFact(modelData)
- indexModel: false
- visible: !_camera.getFact(modelData).typeIsBool
- anchors.verticalCenter: parent.verticalCenter
- }
- Item {
- width: _editFieldWidth
- height: factSwitch.height
- visible: _camera.getFact(modelData).typeIsBool
- anchors.verticalCenter: parent.verticalCenter
- Switch {
- id: factSwitch
- anchors.left: parent.left
- checked: fact ? fact.value : false
- onClicked: fact.value = checked ? 1 : 0
- property var fact: _camera.getFact(modelData)
- }
- }
- }
- }
- //-------------------------------------------
- //-- Reset Camera
- Row {
- spacing: ScreenTools.defaultFontPixelWidth
- anchors.horizontalCenter: parent.horizontalCenter
- QGCLabel {
- text: qsTr("Reset Camera Defaults")
- width: _labelFieldWidth
- anchors.verticalCenter: parent.verticalCenter
- }
- QGCButton {
- text: qsTr("Reset")
- onClicked: resetPrompt.open()
- width: _editFieldWidth
- anchors.verticalCenter: parent.verticalCenter
- MessageDialog {
- id: resetPrompt
- title: qsTr("Reset Camera to Factory Settings")
- text: qsTr("Confirm resetting all settings?")
- standardButtons: StandardButton.Yes | StandardButton.No
- onNo: resetPrompt.close()
- onYes: {
- // TODO
- resetPrompt.close()
- }
- }
- }
- }
- //-------------------------------------------
- //-- Format Storage
- Row {
- spacing: ScreenTools.defaultFontPixelWidth
- anchors.horizontalCenter: parent.horizontalCenter
- QGCLabel {
- text: qsTr("Storage")
- width: _labelFieldWidth
- anchors.verticalCenter: parent.verticalCenter
- }
- QGCButton {
- text: qsTr("Format")
- enabled: false
- onClicked: formatPrompt.open()
- width: _editFieldWidth
- anchors.verticalCenter: parent.verticalCenter
- MessageDialog {
- id: formatPrompt
- title: qsTr("Format Camera Storage")
- text: qsTr("Confirm erasing all files?")
- standardButtons: StandardButton.Yes | StandardButton.No
- onNo: formatPrompt.close()
- onYes: {
- // TODO
- formatPrompt.close()
- }
- }
- }
- }
- }
- }
- }
- Component.onCompleted: {
- rootLoader.width = cameraSettingsRect.width
- rootLoader.height = cameraSettingsRect.height
- }
- Keys.onBackPressed: {
- rootLoader.sourceComponent = null
- }
- Keys.onEscapePressed: {
- rootLoader.sourceComponent = null
- }
- }
- }
-}
diff --git a/src/Camera/QGCCameraManager.cc b/src/Camera/QGCCameraManager.cc
index e75852d620d5e35d42a6864ab07d19668e3cdb9a..530a0c80863ab352d96a2425d64be226fe617a4d 100644
--- a/src/Camera/QGCCameraManager.cc
+++ b/src/Camera/QGCCameraManager.cc
@@ -27,13 +27,6 @@ QGCCameraManager::~QGCCameraManager()
{
}
-//-----------------------------------------------------------------------------
-QString
-QGCCameraManager::controllerSource()
-{
- return QStringLiteral("/qml/CameraControl.qml");
-}
-
//-----------------------------------------------------------------------------
void
QGCCameraManager::_vehicleReady(bool ready)
diff --git a/src/Camera/QGCCameraManager.h b/src/Camera/QGCCameraManager.h
index 2f69b68881105520f20e76a4fdafcfd9c94ceb4f..9817c574ed566a2d38213e4b3ff2a7b1e7a04383 100644
--- a/src/Camera/QGCCameraManager.h
+++ b/src/Camera/QGCCameraManager.h
@@ -26,16 +26,12 @@ public:
virtual ~QGCCameraManager();
Q_PROPERTY(QmlObjectListModel* cameras READ cameras NOTIFY camerasChanged)
- Q_PROPERTY(QString controllerSource READ controllerSource NOTIFY controllerSourceChanged)
//-- Return a list of cameras provided by this vehicle
virtual QmlObjectListModel* cameras () { return &_cameras; }
- //-- Camera controller source (QML)
- virtual QString controllerSource ();
signals:
void camerasChanged ();
- void controllerSourceChanged ();
protected slots:
void _vehicleReady (bool ready);
diff --git a/src/Camera/images/camera_settings.svg b/src/Camera/images/camera_settings.svg
deleted file mode 100644
index 78a6a13934ece0b81b93d07b704c2674a9f065d8..0000000000000000000000000000000000000000
--- a/src/Camera/images/camera_settings.svg
+++ /dev/null
@@ -1,102 +0,0 @@
-
-
-
diff --git a/src/FlightDisplay/FlightDisplayViewVideo.qml b/src/FlightDisplay/FlightDisplayViewVideo.qml
index db790943ca3f6db82aad8317e959303160dbd063..a3d39fd822ec9bea0fb79623ba108d0956c28810 100644
--- a/src/FlightDisplay/FlightDisplayViewVideo.qml
+++ b/src/FlightDisplay/FlightDisplayViewVideo.qml
@@ -105,13 +105,4 @@ Item {
}
}
}
- //-- Camera Controller
- Loader {
- source: QGroundControl.videoManager.fullScreen ? "" : (_dynamicCameras ? _dynamicCameras.controllerSource : "")
- visible: !_mainIsMap && _dynamicCameras && _dynamicCameras.cameras.count && _connected && !QGroundControl.videoManager.fullScreen
- anchors.right: parent.right
- anchors.rightMargin: ScreenTools.defaultFontPixelWidth
- anchors.bottom: parent.bottom
- anchors.bottomMargin: ScreenTools.defaultFontPixelHeight * 2
- }
}
diff --git a/src/FlightMap/Widgets/CameraPageWidget.qml b/src/FlightMap/Widgets/CameraPageWidget.qml
index 68e90505dfeae884e23304212dce2960714506ed..859a320be9fc2beb08f80114d192f558b1068f57 100644
--- a/src/FlightMap/Widgets/CameraPageWidget.qml
+++ b/src/FlightMap/Widgets/CameraPageWidget.qml
@@ -7,26 +7,282 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Layouts 1.2
+import QtQuick 2.4
+import QtPositioning 5.2
+import QtQuick.Layouts 1.2
+import QtQuick.Controls 1.4
+import QtQuick.Dialogs 1.2
+import QtGraphicalEffects 1.0
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl 1.0
+import QGroundControl.ScreenTools 1.0
+import QGroundControl.Controls 1.0
+import QGroundControl.Palette 1.0
+import QGroundControl.Vehicle 1.0
+import QGroundControl.Controllers 1.0
+import QGroundControl.FactSystem 1.0
+import QGroundControl.FactControls 1.0
/// Camera page for Instrument Panel PageView
Column {
width: pageWidth
spacing: ScreenTools.defaultFontPixelHeight
- property bool showSettingsIcon: false
+ property bool showSettingsIcon: _camera !== null
- property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
+ property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
+ property var _dynamicCameras: _activeVehicle ? _activeVehicle.dynamicCameras : null
+ property bool _isCamera: _dynamicCameras ? _dynamicCameras.cameras.count > 0 : false
+ property bool _cameraModeUndefined: _isCamera ? _dynamicCameras.cameras.get(0).cameraMode === QGCCameraControl.CAMERA_MODE_UNDEFINED : true
+ property bool _cameraVideoMode: _isCamera ? _dynamicCameras.cameras.get(0).cameraMode === QGCCameraControl.CAMERA_MODE_VIDEO : false
+ property bool _cameraPhotoMode: _isCamera ? _dynamicCameras.cameras.get(0).cameraMode === QGCCameraControl.CAMERA_MODE_PHOTO : false
+ property var _camera: _isCamera ? _dynamicCameras.cameras.get(0) : null // Single camera support for the time being
+ property real _spacers: ScreenTools.defaultFontPixelHeight * 0.5
+ property real _labelFieldWidth: ScreenTools.defaultFontPixelWidth * 30
+ property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 30
+ property bool _communicationLost: _activeVehicle ? _activeVehicle.connectionLost : false
+ property bool _hasModes: _isCamera && _camera && _camera.hasModes
+ function showSettings() {
+ qgcView.showDialog(cameraSettings, _cameraVideoMode ? qsTr("Video Settings") : qsTr("Camera Settings"), 70, StandardButton.Ok)
+ }
+
+ //-- Dumb camera trigger if no actual camera interface exists
QGCButton {
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Trigger Camera")
+ visible: !_isCamera
onClicked: _activeVehicle.triggerCamera()
enabled: _activeVehicle
}
+ Item { width: 1; height: ScreenTools.defaultFontPixelHeight; visible: _isCamera; }
+ //-- Actual controller
+ QGCLabel {
+ id: cameraLabel
+ text: _isCamera ? _dynamicCameras.cameras.get(0).modelName : qsTr("Camera")
+ visible: _isCamera
+ font.pointSize: ScreenTools.smallFontPointSize
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ //-- Camera Mode (visible only if camera has modes)
+ Rectangle {
+ width: _hasModes ? ScreenTools.defaultFontPixelWidth * 12 : 0
+ height: _hasModes ? ScreenTools.defaultFontPixelWidth * 4 : 0
+ color: qgcPal.window
+ radius: height * 0.5
+ visible: _hasModes
+ anchors.horizontalCenter: parent.horizontalCenter
+ //-- Video Mode
+ Rectangle {
+ width: parent.height * 0.9
+ height: parent.height * 0.9
+ color: qgcPal.windowShadeDark
+ radius: height * 0.5
+ anchors.left: parent.left
+ anchors.leftMargin: 4
+ anchors.verticalCenter: parent.verticalCenter
+ QGCColoredImage {
+ anchors.fill: parent
+ source: "/qmlimages/camera_video.svg"
+ fillMode: Image.PreserveAspectFit
+ sourceSize.height: height
+ color: _cameraVideoMode ? qgcPal.colorGreen : qgcPal.text
+ MouseArea {
+ anchors.fill: parent
+ enabled: _cameraPhotoMode
+ onClicked: {
+ _camera.setVideoMode()
+ }
+ }
+ }
+ }
+ //-- Photo Mode
+ Rectangle {
+ width: parent.height * 0.9
+ height: parent.height * 0.9
+ color: qgcPal.windowShade
+ radius: height * 0.5
+ anchors.right: parent.right
+ anchors.rightMargin: 4
+ anchors.verticalCenter: parent.verticalCenter
+ QGCColoredImage {
+ anchors.fill: parent
+ source: "/qmlimages/camera_photo.svg"
+ fillMode: Image.PreserveAspectFit
+ sourceSize.height: height
+ color: _cameraPhotoMode ? qgcPal.colorGreen : qgcPal.text
+ MouseArea {
+ anchors.fill: parent
+ enabled: _cameraVideoMode
+ onClicked: {
+ _camera.setPhotoMode()
+ }
+ }
+ }
+ }
+ }
+ //-- Shutter
+ Rectangle {
+ color: Qt.rgba(0,0,0,0)
+ width: ScreenTools.defaultFontPixelWidth * 6
+ height: width
+ radius: width * 0.5
+ visible: _isCamera
+ border.color: qgcPal.buttonText
+ border.width: 3
+ anchors.horizontalCenter: parent.horizontalCenter
+ Rectangle {
+ width: parent.width * 0.75
+ height: width
+ radius: width * 0.5
+ color: _cameraModeUndefined ? qgcPal.colorGrey : qgcPal.colorRed
+ anchors.centerIn: parent
+ }
+ MouseArea {
+ anchors.fill: parent
+ enabled: !_cameraModeUndefined
+ onClicked: {
+ if(_cameraVideoMode) {
+ //-- Start/Stop Video
+ } else {
+ _camera.takePhoto()
+ }
+ }
+ }
+ }
+ Item { width: 1; height: ScreenTools.defaultFontPixelHeight; visible: _isCamera; }
+ Component {
+ id: cameraSettings
+ QGCViewDialog {
+ id: _cameraSettingsDialog
+ QGCFlickable {
+ anchors.fill: parent
+ contentHeight: camSettingsCol.height
+ flickableDirection: Flickable.VerticalFlick
+ clip: true
+ Column {
+ id: camSettingsCol
+ anchors.left: parent.left
+ anchors.right: parent.right
+ spacing: _margins
+ //-------------------------------------------
+ //-- Camera Settings
+ Repeater {
+ model: _camera ? _camera.activeSettings : []
+ Row {
+ spacing: ScreenTools.defaultFontPixelWidth
+ anchors.horizontalCenter: parent.horizontalCenter
+ property var _fact: _camera.getFact(modelData)
+ property bool _isBool: _fact.typeIsBool
+ property bool _isCombo: !_isBool && _fact.enumStrings.length > 0
+ property bool _isSlider: _fact && !isNaN(_fact.increment)
+ property bool _isEdit: !_isBool && !_isSlider && _fact.enumStrings.length < 1
+ QGCLabel {
+ text: parent._fact.shortDescription
+ width: _labelFieldWidth
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ FactComboBox {
+ width: parent._isCombo ? _editFieldWidth : 0
+ fact: parent._fact
+ indexModel: false
+ visible: parent._isCombo
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ FactTextField {
+ width: parent._isEdit ? _editFieldWidth : 0
+ fact: parent._fact
+ visible: parent._isEdit
+ }
+ QGCSlider {
+ width: parent._isSlider ? _editFieldWidth : 0
+ maximumValue: parent._fact.max
+ minimumValue: parent._fact.min
+ stepSize: parent._fact.increment
+ visible: parent._isSlider
+ updateValueWhileDragging: false
+ anchors.verticalCenter: parent.verticalCenter
+ Component.onCompleted: {
+ value = parent._fact.value
+ }
+ onValueChanged: {
+ parent._fact.value = value
+ }
+ }
+ Item {
+ width: parent._isBool ? _editFieldWidth : 0
+ height: factSwitch.height
+ visible: parent._isBool
+ anchors.verticalCenter: parent.verticalCenter
+ property var _fact: parent._fact
+ Switch {
+ id: factSwitch
+ anchors.left: parent.left
+ checked: parent._fact ? parent._fact.value : false
+ onClicked: parent._fact.value = checked ? 1 : 0
+ }
+ }
+ }
+ }
+ //-------------------------------------------
+ //-- Reset Camera
+ Row {
+ spacing: ScreenTools.defaultFontPixelWidth
+ anchors.horizontalCenter: parent.horizontalCenter
+ QGCLabel {
+ text: qsTr("Reset Camera Defaults")
+ width: _labelFieldWidth
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ QGCButton {
+ text: qsTr("Reset")
+ onClicked: resetPrompt.open()
+ width: _editFieldWidth
+ anchors.verticalCenter: parent.verticalCenter
+ MessageDialog {
+ id: resetPrompt
+ title: qsTr("Reset Camera to Factory Settings")
+ text: qsTr("Confirm resetting all settings?")
+ standardButtons: StandardButton.Yes | StandardButton.No
+ onNo: resetPrompt.close()
+ onYes: {
+ // TODO
+ resetPrompt.close()
+ }
+ }
+ }
+ }
+ //-------------------------------------------
+ //-- Format Storage
+ Row {
+ spacing: ScreenTools.defaultFontPixelWidth
+ anchors.horizontalCenter: parent.horizontalCenter
+ QGCLabel {
+ text: qsTr("Storage")
+ width: _labelFieldWidth
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ QGCButton {
+ text: qsTr("Format")
+ enabled: false
+ onClicked: formatPrompt.open()
+ width: _editFieldWidth
+ anchors.verticalCenter: parent.verticalCenter
+ MessageDialog {
+ id: formatPrompt
+ title: qsTr("Format Camera Storage")
+ text: qsTr("Confirm erasing all files?")
+ standardButtons: StandardButton.Yes | StandardButton.No
+ onNo: formatPrompt.close()
+ onYes: {
+ // TODO
+ formatPrompt.close()
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
}