Skip to content

Commit

Permalink
FBI Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Holden committed Oct 23, 2024
1 parent ac3cbb1 commit 2464464
Show file tree
Hide file tree
Showing 8 changed files with 197 additions and 46 deletions.
1 change: 1 addition & 0 deletions custom/custom.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<file alias="MainRootWindow.qml">qml/MainRootWindow.qml</file>
<file alias="QGroundControl/FlightMap/PhotoVideoControl.qml">qml/PhotoVideoControl.qml</file>
<file alias="ViewproVideoControl.qml">qml/Viewpro/ViewproVideoControl.qml</file>
<file alias="VirtualJoystick.qml">qml/VirtualJoystick.qml</file>
</qresource>
<qresource prefix="/toolbar">
<file alias="DroneIndicator.qml">qml/DroneIndicator.qml</file>
Expand Down
1 change: 1 addition & 0 deletions custom/qgroundcontrol.exclusion
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
<file alias="FlyViewSettings.qml">src/UI/preferences/FlyViewSettings.qml</file>
<file alias="MainRootWindow.qml">src/UI/MainRootWindow.qml</file>
<file alias="QGroundControl/FlightMap/PhotoVideoControl.qml">src/FlightMap/Widgets/PhotoVideoControl.qml</file>
<file alias="VirtualJoystick.qml">src/FlightDisplay/VirtualJoystick.qml</file>
1 change: 0 additions & 1 deletion custom/qgroundcontrol.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@
<file alias="VehicleSummary.qml">../src/VehicleSetup/VehicleSummary.qml</file>
<file alias="VibrationPage.qml">../src/AnalyzeView/VibrationPage.qml</file>
<file alias="VideoSettings.qml">../src/UI/preferences/VideoSettings.qml</file>
<file alias="VirtualJoystick.qml">../src/FlightDisplay/VirtualJoystick.qml</file>
<file alias="VTOLLandingPatternEditor.qml">../src/PlanView/VTOLLandingPatternEditor.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewInsetViewer.qml">../src/FlightDisplay/FlyViewInsetViewer.qml</file>
<file alias="Viewer3D/Viewer3D.qml">../src/Viewer3D/Viewer3DQml/Viewer3D.qml</file>
Expand Down
126 changes: 96 additions & 30 deletions custom/qml/PhotoVideoControl.qml
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls

import QGroundControl
import QGroundControl.ScreenTools
import QGroundControl.Controls
import QGroundControl.Palette

Pane {
Rectangle {
id: root
width: mainLayout.width + (_margins * 2)
height: mainLayout.height + (_margins * 2)
color: Qt.rgba(qgcPal.window.r, qgcPal.window.g, qgcPal.window.b, 0.5)
radius: _margins
signal snapshot
signal record

property real _margins: ScreenTools.defaultFontPixelHeight / 2

// property Viewpro viewpro // Reference to your Viewpro class instance

// Properties for settings
Expand All @@ -20,10 +30,60 @@ Pane {
property bool imageFlipIR: false
property int trackingTemplate: 0

QGCPalette { id: qgcPal; colorGroupEnabled: enabled }

/*RoundButton {
id: hideVideoControl
visible: CameraSettings.showCameraControl
anchors {
right: videoControlLoader.right
top: root.top
}
icon.source: "qrc:///qt/qml/comms/res/images/cheveron-outline-right.svg"
onClicked: {
show = !show
icon.source = show ? "qrc:///qt/qml/comms/res/images/cheveron-outline-right.svg" : "qrc:///qt/qml/comms/res/images/video-camera.svg"
}
property bool show: true
}*/

/*Loader {
width: Math.min(root.height * 0.25, ScreenTools.defaultFontPixelWidth * 16)
height: Math.min(root.height * 0.25, ScreenTools.defaultFontPixelWidth * 16)
anchors {
margins: ScreenTools.defaultFontPixelWidth * 2
right: root.right
bottom: root.bottom
}
active: CameraSettings.virtualCamJoystick
sourceComponent: VirtualJoystick {
id: camStick
enabled: (DroneData.viewproEnabled && ViewproData.linkUp) || (DroneData.nextvisionEnabled && NextVisionData.linkUp)
Timer {
interval: 250
running: camStick.enabled
repeat: true
onTriggered: {
if(DroneData.nextvisionEnabled) {
NextVision.sendGimbalVirtualCmd(-camStick.axis.x, camStick.axis.y)
} else if(DroneData.viewproEnabled) {
Viewpro.gimbalManualRCSerial(camStick.axis.x, camStick.axis.y)
}
}
}
}
}*/

ColumnLayout {
id: mainLayout
enabled: true // Adjust based on your application logic
anchors.margins: _margins
anchors.top: parent.top
anchors.left: parent.left
spacing: _margins

Label {
QGCLabel {
text: "Camera Controls"
font.pointSize: ScreenTools.isAndroid ? ScreenTools.mediumFontPointSize : ScreenTools.largeFontPointSize
Layout.alignment: Qt.AlignHCenter
Expand All @@ -33,21 +93,21 @@ Pane {
RowLayout {
spacing: ScreenTools.defaultFontPixelHeight

Button {
QGCButton {
text: "+"
horizontalPadding: ScreenTools.defaultFontPixelWidth * 2
onPressed: viewpro.zoomInSerial(zoomSpeed)
onReleased: viewpro.focusZoomStopSerial()
Layout.fillWidth: true
}

Label {
QGCLabel {
text: "Zoom"
Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
}

Button {
QGCButton {
text: "-"
horizontalPadding: ScreenTools.defaultFontPixelWidth * 2
onPressed: viewpro.zoomOutSerial(zoomSpeed)
Expand All @@ -61,21 +121,21 @@ Pane {
spacing: ScreenTools.defaultFontPixelHeight
visible: !autoFocus

Button {
QGCButton {
text: "+"
horizontalPadding: ScreenTools.defaultFontPixelWidth * 2
onPressed: viewpro.focusInSerial()
onReleased: viewpro.focusZoomStopSerial()
Layout.fillWidth: true
}

Label {
QGCLabel {
text: "Focus"
Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
}

Button {
QGCButton {
text: "-"
horizontalPadding: ScreenTools.defaultFontPixelWidth * 2
onPressed: viewpro.focusOutSerial()
Expand All @@ -88,13 +148,14 @@ Pane {
RowLayout {
spacing: ScreenTools.defaultFontPixelHeight

Label {
QGCLabel {
text: "PIP Mode:"
}

ComboBox {
QGCComboBox {
Layout.fillWidth: true
model: ["EO/IR", "IR", "IR/EO", "EO"]
sizeToContents: true

onActivated: function (currentIndex) {
switch (currentIndex) {
Expand Down Expand Up @@ -125,13 +186,14 @@ Pane {
RowLayout {
spacing: ScreenTools.defaultFontPixelHeight

Label {
QGCLabel {
text: "IR Mode:"
}

ComboBox {
QGCComboBox {
Layout.fillWidth: true
model: ["White Hot", "Black Hot", "Pseudo Color", "Ext1", "Ext2", "Ext3"]
sizeToContents: true

onActivated: function (currentIndex) {
switch (currentIndex) {
Expand Down Expand Up @@ -164,13 +226,14 @@ Pane {
RowLayout {
spacing: ScreenTools.defaultFontPixelHeight

Label {
QGCLabel {
text: "Gimbal Mode:"
}

ComboBox {
QGCComboBox {
Layout.fillWidth: true
model: ["Recenter", "Follow Yaw", "Lock Yaw", "Look Down"]
sizeToContents: true

onActivated: function (currentIndex) {
switch (currentIndex) {
Expand Down Expand Up @@ -198,7 +261,7 @@ Pane {
}

// Tracking Control
Button {
QGCButton {
id: trackButton
Layout.fillWidth: true
horizontalPadding: ScreenTools.defaultFontPixelWidth * 2
Expand All @@ -212,13 +275,14 @@ Pane {
RowLayout {
spacing: ScreenTools.defaultFontPixelHeight

Label {
QGCLabel {
text: "Template Size:"
}

ComboBox {
QGCComboBox {
Layout.fillWidth: true
model: ["small", "medium", "big", "small-medium", "small-big", "medium-big", "small-medium-big"]
sizeToContents: true

onActivated: function (currentIndex) {
viewpro.trackingTemplateSizeSerial(currentIndex)
Expand All @@ -228,14 +292,14 @@ Pane {
}

// EO Stream Settings Label
Label {
QGCLabel {
text: "EO Stream Settings"
font.bold: true
Layout.alignment: Qt.AlignHCenter
}

// Auto Focus
CheckBox {
QGCCheckBox {
text: "Auto Focus"
checked: autoFocus
onCheckedChanged: {
Expand All @@ -245,7 +309,7 @@ Pane {
}

// Digital Zoom EO
CheckBox {
QGCCheckBox {
text: "Digital Zoom"
checked: digitalZoomEO
onCheckedChanged: {
Expand All @@ -255,7 +319,7 @@ Pane {
}

// Show On Screen Display
CheckBox {
QGCCheckBox {
text: "Show OSD"
checked: showOSD
onCheckedChanged: {
Expand All @@ -266,7 +330,7 @@ Pane {
}

// Image Flip EO
CheckBox {
QGCCheckBox {
text: "Image Flip EO"
checked: imageFlipEO
onCheckedChanged: {
Expand All @@ -279,13 +343,14 @@ Pane {
RowLayout {
spacing: ScreenTools.defaultFontPixelHeight

Label {
QGCLabel {
text: "Zoom Speed:"
}

ComboBox {
QGCComboBox {
Layout.fillWidth: true
model: ["1", "2", "3", "4", "5", "6", "7"]
sizeToContents: true

onActivated: function (currentIndex) {
zoomSpeed = currentIndex + 1
Expand All @@ -294,7 +359,7 @@ Pane {
}

// IR Stream Settings Label
Label {
QGCLabel {
text: "IR Stream Settings"
font.bold: true
Layout.alignment: Qt.AlignHCenter
Expand All @@ -304,13 +369,14 @@ Pane {
RowLayout {
spacing: ScreenTools.defaultFontPixelHeight

Label {
QGCLabel {
text: "IR Digital Zoom:"
}

ComboBox {
QGCComboBox {
Layout.fillWidth: true
model: ["1x", "2x", "3x", "4x"]
sizeToContents: true

onActivated: function (currentIndex) {
viewpro.zoomToIRSerial(currentIndex + 1)
Expand All @@ -320,7 +386,7 @@ Pane {
}

// Image Flip IR
CheckBox {
QGCCheckBox {
text: "Image Flip IR"
checked: imageFlipIR
onCheckedChanged: {
Expand All @@ -333,14 +399,14 @@ Pane {
RowLayout {
spacing: ScreenTools.defaultFontPixelHeight

Button {
QGCButton {
Layout.fillWidth: true
text: "Screenshot"
horizontalPadding: ScreenTools.defaultFontPixelWidth * 2
onReleased: root.snapshot()
}

Button {
QGCButton {
id: recordButton
Layout.fillWidth: true
text: recording ? "Stop" : "Record"
Expand Down
Loading

0 comments on commit 2464464

Please sign in to comment.