summaryrefslogtreecommitdiffstats
path: root/app/CameraControl.qml
diff options
context:
space:
mode:
Diffstat (limited to 'app/CameraControl.qml')
-rw-r--r--app/CameraControl.qml35
1 files changed, 32 insertions, 3 deletions
diff --git a/app/CameraControl.qml b/app/CameraControl.qml
index 4e0b94d..eb9b6af 100644
--- a/app/CameraControl.qml
+++ b/app/CameraControl.qml
@@ -20,10 +20,10 @@ import QtQuick.Controls 2.0
RowLayout {
property var device
- property var listWH
+ property var ratio: 4/3
property var number: []
property var fps: ["10", "20", "30", "40", "50", "60"]
- property var resolution: listWH ? ["320*240", "640*480", "1280*720", "1920*1080"] : ["320*240"]
+ property var resolution: ["320*240", "640*480", "1280*720", "1920*1080"]
property var models: [number, fps, resolution]
property real back: 1
property bool switchstatus: true
@@ -31,7 +31,7 @@ RowLayout {
Repeater {
id: info
- model: ["No.:", "FPS:", "W*H:"]
+ model: ["No:", "FPS:", "W*H:"]
delegate: RowLayout{
Label {
id: label
@@ -107,6 +107,29 @@ RowLayout {
}
background: Image { source: "images/camera/camerainfo_bg.svg" }
+ onCurrentIndexChanged:
+ if(cameraswitch.checked && device){
+ var dNo = info.itemAt(0).children[1].currentText
+ var dFps = info.itemAt(1).children[1].currentText
+ var dRes = info.itemAt(2).children[1].currentText
+ if (index === 0){
+ dNo = number[listview.currentIndex]
+ }
+ if (index === 1){
+ dFps = fps[listview.currentIndex]
+ }
+ if (index === 2){
+ dRes = resolution[listview.currentIndex]
+ if(listview.currentIndex === 0 || listview.currentIndex === 1){
+ ratio = 4/3
+ }
+ else{
+ ratio = 16/9
+ }
+ }
+ device.stop()
+ device.start(dNo, dFps, dRes)
+ }
}
}
}
@@ -115,6 +138,12 @@ RowLayout {
enabled: switchstatus
checked: switchChecked
onCheckedChanged: {
+ if (info.itemAt(2).children[1].currentText === "320*240" || info.itemAt(2).children[1].currentText === "640*480"){
+ ratio = 4/3
+ }
+ else{
+ ratio = 16/9
+ }
if (checked && device){
device.start(info.itemAt(0).children[1].currentText, info.itemAt(1).children[1].currentText, info.itemAt(2).children[1].currentText)
}else if (!checked && device){