1
import econ.camera.see3camcu210 1.0
3
import QtQuick.Controls 1.1
4
import QtQuick.Controls.Styles 1.0
5
import QtQuick.Dialogs 1.1
6
import econ.camera.uvcsettings 1.0
7
import QtQuick.Layouts 1.1
15
property int qFactorMin: 0
16
property int qFactorMax: 100
18
property bool skipUpdateUIQFactor : false
19
property bool skipUpdateUIOnBurstLength : false
20
property bool skipUpdateUIOnAntiFlickerMode :false
21
property bool skipUpdateUIOnAWBLockStatus :false
22
property bool skipUpdateUIOnAELockStatus :false
23
property bool skipUpdateUIOnAWBMode :false
53
getISPFirmwareVersion()
60
function onTakeScreenShot()
62
root.imageCapture(CommonEnums.BURST_SHOT);
65
function onGetVideoPinStatus()
67
root.enableVideoPin(true);
69
function onGetStillImageFormats()
71
var stillImageFormat = []
72
stillImageFormat.push("jpg")
73
stillImageFormat.push("bmp")
74
stillImageFormat.push("raw")
75
stillImageFormat.push("png")
76
root.insertStillImageFormat(stillImageFormat);
87
style: econscrollViewStyle
100
text: "--- AWB Mode ---"
102
font.family: "Ubuntu"
105
Layout.alignment: Qt.AlignCenter
106
opacity: 0.50196078431373
114
ListElement { text: "Cloudy" }
115
ListElement { text: "Daylight" }
116
ListElement { text: "Flash" }
117
ListElement { text: "Cool white fluorescent" }
118
ListElement { text: "Tungsten" }
119
ListElement { text: "Candlelight" }
120
ListElement { text: "Horizon" }
121
ListElement { text: "Custom" }
122
ListElement { text: "Auto" }
125
activeFocusOnPress: true
126
style: econComboBoxStyle
127
onCurrentIndexChanged: {
128
if(skipUpdateUIOnAWBMode)
132
skipUpdateUIOnAWBMode = true
137
id: awbLockStatusText
138
text: "--- AWB Lock Status ---"
140
font.family: "Ubuntu"
143
Layout.alignment: Qt.AlignCenter
144
opacity: 0.50196078431373
150
activeFocusOnPress : true
152
style: econCheckBoxStyle
153
Layout.alignment: Qt.AlignCenter
155
if(skipUpdateUIOnAWBLockStatus)
159
see3camcu210.setAwbLockStatus(See3CAM_CU210.AWB_ON)
160
awbModeCombo.enabled = false
161
awbModeCombo.opacity = 0.1
165
see3camcu210.setAwbLockStatus(See3CAM_CU210.AWB_OFF)
166
awbModeCombo.enabled = true
167
awbModeCombo.opacity = 1
170
skipUpdateUIOnAWBLockStatus = true
175
id: exposureMeteringMode
176
text: "--- AE Metering Mode ---"
178
font.family: "Ubuntu"
181
Layout.alignment: Qt.AlignCenter
182
opacity: 0.50196078431373
186
id: meteringModeCombo
190
ListElement { text: "Auto Exposure Off" }
191
ListElement { text: "Centre-Weighted Average" }
192
ListElement { text: "All Block Integral" }
193
ListElement { text: "Small Area" }
194
ListElement { text: "Large Area" }
196
activeFocusOnPress: true
197
style: econComboBoxStyle
198
onCurrentIndexChanged: {
205
text: "--- AE Lock Status ---"
207
font.family: "Ubuntu"
210
Layout.alignment: Qt.AlignCenter
211
opacity: 0.50196078431373
217
activeFocusOnPress : true
219
style: econCheckBoxStyle
220
Layout.alignment: Qt.AlignCenter
222
if(skipUpdateUIOnAELockStatus)
226
see3camcu210.setAeLockStatus(See3CAM_CU210.AE_ON)
227
meteringModeCombo.enabled = false
228
meteringModeCombo.opacity = 0.1
232
see3camcu210.setAeLockStatus(See3CAM_CU210.AE_OFF)
233
meteringModeCombo.enabled = true
234
meteringModeCombo.opacity = 1
237
skipUpdateUIOnAELockStatus = true
244
text: "--- Flicker Mode ---"
246
font.family: "Ubuntu"
249
Layout.alignment: Qt.AlignCenter
250
opacity: 0.50196078431373
257
ListElement { text: "AUTO" }
258
ListElement { text: "50 Hz" }
259
ListElement { text: "60 Hz" }
260
ListElement { text: "DISABLE" }
262
activeFocusOnPress: true
263
style: econComboBoxStyle
264
onCurrentIndexChanged: {
265
if(skipUpdateUIOnAntiFlickerMode){
268
skipUpdateUIOnAntiFlickerMode = true
274
id: qFactorSliderTitle
275
text: "--- QFactor Slider ---"
277
font.family: "Ubuntu"
280
Layout.alignment: Qt.AlignCenter
281
opacity: 0.50196078431373
290
activeFocusOnPress: true
291
updateValueWhileDragging: false
294
style:econSliderStyle
295
minimumValue: qFactorMin
296
maximumValue: qFactorMax
299
qFactorTextField.text = qFactorSlider.value
300
if(skipUpdateUIQFactor)
302
see3camcu210.setQFactorValue(qFactorSlider.value)
304
skipUpdateUIQFactor = true
310
text: qFactorSlider.value
312
font.family: "Ubuntu"
314
horizontalAlignment: TextInput.AlignHCenter
315
style: econTextFieldStyle
316
validator: IntValidator {bottom: qFactorSlider.minimumValue; top: qFactorSlider.maximumValue}
321
qFactorSlider.value = qFactorTextField.text
330
text: "Burst Length :"
332
font.family: "Ubuntu"
344
ListElement { text: "1" }
345
ListElement { text: "2" }
346
ListElement { text: "3" }
347
ListElement { text: "4" }
348
ListElement { text: "5" }
350
activeFocusOnPress: true
351
style: econComboBoxStyle
352
onCurrentIndexChanged: {
353
root.stillBurstLength(burstLengthCombo.currentIndex + 1) // combobox index starts from 0
354
if(skipUpdateUIOnBurstLength){
355
see3camcu210.setBurstLength(burstLengthCombo.currentText)
357
skipUpdateUIOnBurstLength = true
364
text: "--- De-Noise ---"
366
font.family: "Ubuntu"
369
Layout.alignment: Qt.AlignCenter
370
opacity: 0.50196078431373
377
ExclusiveGroup { id: denoiseGroup }
381
exclusiveGroup: denoiseGroup
384
activeFocusOnPress: true
385
style: econRadioButtonStyle
386
opacity: enabled ? 1 : 0.1
389
see3camcu210.setDenoiseMode(See3CAM_CU210.ENABLE)
391
Keys.onReturnPressed: {
392
see3camcu210.setDenoiseMode(See3CAM_CU210.ENABLE)
397
exclusiveGroup: denoiseGroup
400
activeFocusOnPress: true
401
style: econRadioButtonStyle
402
opacity: enabled ? 1 : 0.1
405
see3camcu210.setDenoiseMode(See3CAM_CU210.DISABLE)
407
Keys.onReturnPressed: {
408
see3camcu210.setDenoiseMode(See3CAM_CU210.DISABLE)
415
Layout.alignment: Qt.AlignCenter
419
activeFocusOnPress : true
421
tooltip: "Click to set default values in extension controls"
423
style: econButtonStyle
424
Keys.onReturnPressed: {
432
id: f_wversion_selected130
434
action: firmwareVersion
435
activeFocusOnPress : true
436
tooltip: "Click to view the firmware version of the camera"
438
background: Rectangle {
439
border.width: control.activeFocus ? 3 :0
441
border.color: control.activeFocus ? "#ffffff" : "#222021"
445
source: "images/f_wversion_selected.png"
448
Keys.onReturnPressed: {
453
id: serial_no_selected
456
activeFocusOnPress : true
457
tooltip: "Click to view the Serial Number"
459
background: Rectangle {
460
border.width: control.activeFocus ? 3 :0
462
border.color: control.activeFocus ? "#ffffff" : "#222021"
466
source: "images/serial_no_selected.png"
469
Keys.onReturnPressed: {
476
Layout.alignment: Qt.AlignCenter
479
id: ispFirmwareVersion
483
activeFocusOnPress : true
484
tooltip: "Click to view the ISP firmware version"
485
style: econButtonStyle
486
Keys.onReturnPressed: {
487
see3camcu210.readISPFirmwareVersion()
502
skipUpdateUIOnAWBMode = false
503
currentAwbMode(awbMode)
504
skipUpdateUIOnAWBMode = true
506
onAwbLockStatusReceived: {
507
skipUpdateUIOnAWBLockStatus = false
508
currentAwbLockStatus(awbLockStatus)
509
skipUpdateUIOnAWBLockStatus = true
511
onMeteringModeReceived: {
512
currentExpMeteringMode(meteringMode)
514
onAeLockStatusReceived: {
515
skipUpdateUIOnAELockStatus = false
516
currentAeLockStatus(aeLockStatus)
517
skipUpdateUIOnAELockStatus = true
519
onBurstLengthReceived: {
520
skipUpdateUIOnBurstLength = false
521
burstLengthCombo.currentIndex = burstLength - 1
522
skipUpdateUIOnBurstLength = true
524
onFlickerModeReceived: {
525
skipUpdateUIOnAntiFlickerMode = false
526
currentFlickerValue(flickerMode)
527
skipUpdateUIOnAntiFlickerMode = true
529
onQFactorValueReceived: {
530
skipUpdateUIQFactor = false
531
qFactorSlider.value = Qfactor
532
skipUpdateUIQFactor = true
534
onDenoiseModeReceived: {
535
currentDenoiseMode(denoise)
537
onTitleTextChanged: {
538
messageDialog.title = _title.toString()
539
messageDialog.text = _text.toString()
547
onTitleTextChanged: {
548
messageDialog.title = _title.toString()
549
messageDialog.text = _text.toString()
553
messageDialog.title = qsTr("Serial Number")
554
messageDialog.text = serialNumber;
560
id: econRadioButtonStyle
565
font.family: "Ubuntu"
570
background: Rectangle {
572
border.color: control.activeFocus ? "#ffffff" : "#222021"
578
id: econCheckBoxStyle
583
font.family: "Ubuntu"
588
background: Rectangle {
590
border.color: control.activeFocus ? "#ffffff" : "#222021"
596
id: econComboBoxStyle
600
source: "../../Views/images/device_box.png"
602
width: combo_bkgrnd.sourceSize.width - 28
603
height: combo_bkgrnd.sourceSize.height
605
border.color: "white"
606
border.width: control.activeFocus ? 3 : 1
607
radius: control.activeFocus ? 5 : 0
613
elide: Text.ElideRight
614
text: control.currentText
615
verticalAlignment: Text.AlignVCenter
617
font.family: "Ubuntu"
626
background: Rectangle {
629
border.width: control.activeFocus ? 3 :0
631
border.color: control.activeFocus ? "#ffffff" : "#222021"
632
radius: control.activeFocus ? 5 : 0
636
horizontalAlignment: Text.AlignHCenter
637
verticalAlignment: Text.AlignVCenter
638
font.family: "Ubuntu"
646
id: econscrollViewStyle
648
scrollToClickedPosition: true
651
source: "images/scroller.png"
653
scrollBarBackground: Image {
655
source: "images/Scroller_bg.png"
657
incrementControl: Image {
659
source: "images/down_arrow.png"
661
decrementControl: Image {
663
source: "images/up_arrow.png"
668
id: econCheckBoxTextWrapModeStyle
673
font.family: "Ubuntu"
678
wrapMode: Text.WordWrap
680
background: Rectangle {
682
border.color: control.activeFocus ? "#ffffff" : "#222021"
687
function currentAwbMode(mode)
691
case See3CAM_CU210.CLOUDY:
692
awbModeCombo.currentIndex = 0
694
case See3CAM_CU210.DAYLIGHT:
695
awbModeCombo.currentIndex = 1
697
case See3CAM_CU210.FLASH:
698
awbModeCombo.currentIndex = 2
700
case See3CAM_CU210.COOL_WHITE_FLUORESCENT:
701
awbModeCombo.currentIndex = 3
703
case See3CAM_CU210.TUNGSTEN:
704
awbModeCombo.currentIndex = 4
706
case See3CAM_CU210.CANDLE_LIGHT:
707
awbModeCombo.currentIndex = 5
709
case See3CAM_CU210.HORIZON:
710
awbModeCombo.currentIndex = 6
712
case See3CAM_CU210.CUSTOM:
713
awbModeCombo.currentIndex = 7
715
case See3CAM_CU210.AUTO:
716
awbModeCombo.currentIndex = 8
721
function setAwbMode()
723
if(awbModeCombo.currentText.toString() == "Cloudy")
725
see3camcu210.setAwbMode(See3CAM_CU210.CLOUDY)
727
else if(awbModeCombo.currentText.toString() == "Daylight")
729
see3camcu210.setAwbMode(See3CAM_CU210.DAYLIGHT)
731
else if(awbModeCombo.currentText.toString() == "Flash")
733
see3camcu210.setAwbMode(See3CAM_CU210.FLASH)
735
else if(awbModeCombo.currentText.toString() == "Cool white fluorescent")
737
see3camcu210.setAwbMode(See3CAM_CU210.COOL_WHITE_FLUORESCENT)
739
else if(awbModeCombo.currentText.toString() == "Tungsten")
741
see3camcu210.setAwbMode(See3CAM_CU210.TUNGSTEN)
743
else if(awbModeCombo.currentText.toString() == "Candlelight")
745
see3camcu210.setAwbMode(See3CAM_CU210.CANDLE_LIGHT)
747
else if(awbModeCombo.currentText.toString() == "Horizon")
749
see3camcu210.setAwbMode(See3CAM_CU210.HORIZON)
751
else if(awbModeCombo.currentText.toString() == "Custom")
753
see3camcu210.setAwbMode(See3CAM_CU210.CUSTOM)
755
else if(awbModeCombo.currentText.toString() == "Auto")
757
see3camcu210.setAwbMode(See3CAM_CU210.AUTO)
761
function currentAwbLockStatus(mode){
762
if(mode == See3CAM_CU210.AWB_ON)
764
awbLockCheckBox.checked = true
765
awbModeCombo.enabled = false
766
awbModeCombo.opacity = 0.1
768
else if(mode == See3CAM_CU210.AWB_OFF)
770
awbLockCheckBox.checked = false
771
awbModeCombo.enabled = true
772
awbModeCombo.opacity = 1
776
function currentAeLockStatus(status)
778
if(status == See3CAM_CU210.AE_ON)
780
aeLockCheckBox.checked = true
781
meteringModeCombo.enabled = false
782
meteringModeCombo.opacity = 0.1
784
else if(status == See3CAM_CU210.AE_OFF)
786
aeLockCheckBox.checked = false
787
meteringModeCombo.enabled = true
788
meteringModeCombo.opacity = 1
792
function currentExpMeteringMode(mode)
794
if(mode == See3CAM_CU210.AUTO_EXPOSURE_OFF)
796
meteringModeCombo.currentIndex = 0
798
else if(mode == See3CAM_CU210.AVERAGE)
800
meteringModeCombo.currentIndex = 1
802
else if(mode == See3CAM_CU210.INTEGRAL)
804
meteringModeCombo.currentIndex = 2
806
else if(mode == See3CAM_CU210.SMALL_AREA)
808
meteringModeCombo.currentIndex = 3
810
else if(mode == See3CAM_CU210.LARGE_AREA)
812
meteringModeCombo.currentIndex = 4
816
function setExpMeteringMode()
818
if(meteringModeCombo.currentText.toString() == "Auto Exposure Off")
820
see3camcu210.setExposureMeteringMode(See3CAM_CU210.AUTO_EXPOSURE_OFF)
822
else if(meteringModeCombo.currentText.toString() == "Centre-Weighted Average")
824
see3camcu210.setExposureMeteringMode(See3CAM_CU210.AVERAGE)
826
else if(meteringModeCombo.currentText.toString() == "All Block Integral")
828
see3camcu210.setExposureMeteringMode(See3CAM_CU210.INTEGRAL)
830
else if(meteringModeCombo.currentText.toString() == "Small Area")
832
see3camcu210.setExposureMeteringMode(See3CAM_CU210.SMALL_AREA)
834
else if(meteringModeCombo.currentText.toString() == "Large Area")
836
see3camcu210.setExposureMeteringMode(See3CAM_CU210.LARGE_AREA)
840
function currentFlickerValue(flickerVal)
842
if(flickerVal == See3CAM_CU210.FLICKER_AUTO)
844
flickerModeCombo.currentIndex = 0
846
else if(flickerVal == See3CAM_CU210.FLICKER_50HZ)
848
flickerModeCombo.currentIndex = 1
850
else if(flickerVal == See3CAM_CU210.FLICKER_60HZ)
852
flickerModeCombo.currentIndex = 2
854
else if(flickerVal == See3CAM_CU210.FLICKER_DISABLE)
856
flickerModeCombo.currentIndex = 3
860
function setFlickerMode()
862
if(flickerModeCombo.currentIndex === 0)
863
see3camcu210.setFlickerMode(See3CAM_CU210.FLICKER_AUTO)
864
else if(flickerModeCombo.currentIndex === 1)
865
see3camcu210.setFlickerMode(See3CAM_CU210.FLICKER_50HZ)
866
else if(flickerModeCombo.currentIndex === 2)
867
see3camcu210.setFlickerMode(See3CAM_CU210.FLICKER_60HZ)
868
else if(flickerModeCombo.currentIndex === 3)
869
see3camcu210.setFlickerMode(See3CAM_CU210.FLICKER_DISABLE)
872
function currentDenoiseMode(denoiseVal)
874
if(denoiseVal == See3CAM_CU210.ENABLE)
876
denoiseEnable.checked = true
878
else if(denoiseVal == See3CAM_CU210.DISABLE)
880
denoiseDisable.checked = true
884
function setToDefaultValues(){
885
root.checkForTriggerMode(false)
886
root.captureBtnEnable(true)
887
root.videoRecordBtnEnable(true)
888
see3camcu210.setToDefaultValues()
889
getValuesFromCamera()
892
function getSerialNumber() {
893
uvccamera.getSerialNumber()
897
function getFirmwareVersion() {
898
uvccamera.getFirmWareVersion()
902
function getISPFirmwareVersion(){
903
see3camcu210.readISPFirmwareVersion()
907
function getValuesFromCamera(){
908
see3camcu210.getAwbMode()
909
see3camcu210.getAwbLockStatus()
910
see3camcu210.getExposureMeteringMode()
911
see3camcu210.getAeLockStatus()
912
see3camcu210.getBurstLength()
913
see3camcu210.getFlickerMode()
914
see3camcu210.getQFactorValue()
915
see3camcu210.getDenoiseMode()
918
Component.onCompleted: {
919
getValuesFromCamera();