~infradeveconsys/+junk/qtcam

« back to all changes in this revision

Viewing changes to qtcam/src/ub22_qml/qtcam/UVCSettings/See3CamCu210/see3camcu210.qml

  • Committer: infradeveconsys
  • Date: 2023-10-05 16:03:55 UTC
  • Revision ID: infradev@e-consystems.com-20231005160355-6004e40uvrgmiyed
Added code for Ubuntu 22.04

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import econ.camera.see3camcu210 1.0
 
2
import QtQuick 2.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
 
8
import cameraenum 1.0
 
9
 
 
10
 
 
11
Item {
 
12
    width:268
 
13
    height:750
 
14
 
 
15
    property int qFactorMin: 0
 
16
    property int qFactorMax: 100
 
17
 
 
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
 
24
 
 
25
 
 
26
    Action {
 
27
        id: firmwareVersion
 
28
        onTriggered:
 
29
        {
 
30
            getFirmwareVersion()
 
31
        }
 
32
    }
 
33
 
 
34
    Action {
 
35
        id: serialNumber
 
36
        onTriggered: {
 
37
            getSerialNumber()
 
38
        }
 
39
    }
 
40
 
 
41
    Action {
 
42
        id: setDefault
 
43
        onTriggered:
 
44
        {
 
45
            setToDefaultValues()
 
46
        }
 
47
    }
 
48
 
 
49
    Action {
 
50
        id: ispVersion
 
51
        onTriggered:
 
52
        {
 
53
            getISPFirmwareVersion()
 
54
        }
 
55
    }
 
56
 
 
57
    Connections
 
58
    {
 
59
        target: root
 
60
        function onTakeScreenShot()
 
61
        {
 
62
           root.imageCapture(CommonEnums.BURST_SHOT);
 
63
        }
 
64
 
 
65
        function onGetVideoPinStatus()
 
66
        {
 
67
            root.enableVideoPin(true);
 
68
        }
 
69
        function onGetStillImageFormats()
 
70
        {
 
71
            var stillImageFormat = []
 
72
            stillImageFormat.push("jpg")
 
73
            stillImageFormat.push("bmp")
 
74
            stillImageFormat.push("raw")
 
75
            stillImageFormat.push("png")
 
76
            root.insertStillImageFormat(stillImageFormat);
 
77
        }
 
78
    }
 
79
 
 
80
    ScrollView{
 
81
 
 
82
        id: scrollview
 
83
        x: 10
 
84
        y: 189.5
 
85
        width: 257
 
86
        height: 500
 
87
        style: econscrollViewStyle
 
88
 
 
89
        Item{
 
90
            height: 900
 
91
 
 
92
            ColumnLayout{
 
93
                x:2
 
94
                y:5
 
95
                spacing:20
 
96
 
 
97
                Text
 
98
                {
 
99
                    id: awbMode
 
100
                    text: "--- AWB Mode ---"
 
101
                    font.pixelSize: 14
 
102
                    font.family: "Ubuntu"
 
103
                    color: "#ffffff"
 
104
                    smooth: true
 
105
                    Layout.alignment: Qt.AlignCenter
 
106
                    opacity: 0.50196078431373
 
107
                }
 
108
                ComboBox
 
109
                {
 
110
                    id: awbModeCombo
 
111
                    opacity: 1
 
112
                    enabled: true
 
113
                    model: ListModel {
 
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" }
 
123
 
 
124
                    }
 
125
                    activeFocusOnPress: true
 
126
                    style: econComboBoxStyle
 
127
                    onCurrentIndexChanged: {
 
128
                        if(skipUpdateUIOnAWBMode)
 
129
                        {
 
130
                            setAwbMode()
 
131
                        }
 
132
                        skipUpdateUIOnAWBMode = true
 
133
                    }
 
134
                }
 
135
 
 
136
                Text{
 
137
                    id: awbLockStatusText
 
138
                    text: "--- AWB Lock Status ---"
 
139
                    font.pixelSize: 14
 
140
                    font.family: "Ubuntu"
 
141
                    color: "#ffffff"
 
142
                    smooth: true
 
143
                    Layout.alignment: Qt.AlignCenter
 
144
                    opacity: 0.50196078431373
 
145
                }
 
146
                CheckBox {
 
147
                    id: awbLockCheckBox
 
148
                    enabled: true
 
149
                    opacity: 1
 
150
                    activeFocusOnPress : true
 
151
                    text: "AWB Lock"
 
152
                    style: econCheckBoxStyle
 
153
                    Layout.alignment: Qt.AlignCenter
 
154
                    onCheckedChanged: {
 
155
                        if(skipUpdateUIOnAWBLockStatus)
 
156
                        {
 
157
                            if(checked)
 
158
                            {
 
159
                                see3camcu210.setAwbLockStatus(See3CAM_CU210.AWB_ON)
 
160
                                awbModeCombo.enabled = false
 
161
                                awbModeCombo.opacity = 0.1
 
162
                            }
 
163
                            else
 
164
                            {
 
165
                                see3camcu210.setAwbLockStatus(See3CAM_CU210.AWB_OFF)
 
166
                                awbModeCombo.enabled = true
 
167
                                awbModeCombo.opacity = 1
 
168
                            }
 
169
                        }
 
170
                        skipUpdateUIOnAWBLockStatus = true
 
171
                    }
 
172
                }
 
173
                Text
 
174
                {
 
175
                    id: exposureMeteringMode
 
176
                    text: "--- AE Metering Mode ---"
 
177
                    font.pixelSize: 14
 
178
                    font.family: "Ubuntu"
 
179
                    color: "#ffffff"
 
180
                    smooth: true
 
181
                    Layout.alignment: Qt.AlignCenter
 
182
                    opacity: 0.50196078431373
 
183
                }
 
184
                ComboBox
 
185
                {
 
186
                    id: meteringModeCombo
 
187
                    opacity: 1
 
188
                    enabled: true
 
189
                    model: ListModel {
 
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" }
 
195
                    }
 
196
                    activeFocusOnPress: true
 
197
                    style: econComboBoxStyle
 
198
                    onCurrentIndexChanged: {
 
199
                        setExpMeteringMode()
 
200
                    }
 
201
                }
 
202
 
 
203
                Text{
 
204
                    id: aeLockStatusText
 
205
                    text: "--- AE Lock Status ---"
 
206
                    font.pixelSize: 14
 
207
                    font.family: "Ubuntu"
 
208
                    color: "#ffffff"
 
209
                    smooth: true
 
210
                    Layout.alignment: Qt.AlignCenter
 
211
                    opacity: 0.50196078431373
 
212
                }
 
213
                CheckBox {
 
214
                    id: aeLockCheckBox
 
215
                    enabled: true
 
216
                    opacity: 1
 
217
                    activeFocusOnPress : true
 
218
                    text: "AE Lock"
 
219
                    style: econCheckBoxStyle
 
220
                    Layout.alignment: Qt.AlignCenter
 
221
                    onCheckedChanged: {
 
222
                        if(skipUpdateUIOnAELockStatus)
 
223
                        {
 
224
                            if(checked)
 
225
                            {
 
226
                                see3camcu210.setAeLockStatus(See3CAM_CU210.AE_ON)
 
227
                                meteringModeCombo.enabled = false
 
228
                                meteringModeCombo.opacity = 0.1
 
229
                            }
 
230
                            else
 
231
                            {
 
232
                                see3camcu210.setAeLockStatus(See3CAM_CU210.AE_OFF)
 
233
                                meteringModeCombo.enabled = true
 
234
                                meteringModeCombo.opacity = 1
 
235
                            }
 
236
                        }
 
237
                        skipUpdateUIOnAELockStatus = true
 
238
                    }
 
239
                }
 
240
 
 
241
                Text
 
242
                {
 
243
                    id: antiFlickerMode
 
244
                    text: "--- Flicker Mode ---"
 
245
                    font.pixelSize: 14
 
246
                    font.family: "Ubuntu"
 
247
                    color: "#ffffff"
 
248
                    smooth: true
 
249
                    Layout.alignment: Qt.AlignCenter
 
250
                    opacity: 0.50196078431373
 
251
                }
 
252
                ComboBox
 
253
                {
 
254
                    id: flickerModeCombo
 
255
                    model: ListModel
 
256
                           {
 
257
                                ListElement { text: "AUTO" }
 
258
                                ListElement { text: "50 Hz" }
 
259
                                ListElement { text: "60 Hz" }
 
260
                                ListElement { text: "DISABLE" }
 
261
                           }
 
262
                    activeFocusOnPress: true
 
263
                    style: econComboBoxStyle
 
264
                    onCurrentIndexChanged: {
 
265
                        if(skipUpdateUIOnAntiFlickerMode){
 
266
                            setFlickerMode()
 
267
                        }
 
268
                        skipUpdateUIOnAntiFlickerMode = true
 
269
                    }
 
270
                }
 
271
 
 
272
                Text
 
273
                {
 
274
                    id: qFactorSliderTitle
 
275
                    text: "--- QFactor Slider ---"
 
276
                    font.pixelSize: 14
 
277
                    font.family: "Ubuntu"
 
278
                    color: "#ffffff"
 
279
                    smooth: true
 
280
                    Layout.alignment: Qt.AlignCenter
 
281
                    opacity: 0.50196078431373
 
282
                }
 
283
 
 
284
                Row
 
285
                {
 
286
                    spacing: 35
 
287
                    Slider
 
288
                    {
 
289
                        id: qFactorSlider
 
290
                        activeFocusOnPress: true
 
291
                        updateValueWhileDragging: false
 
292
                        width: 150
 
293
                        stepSize: 1
 
294
                        style:econSliderStyle
 
295
                        minimumValue: qFactorMin
 
296
                        maximumValue: qFactorMax
 
297
                        onValueChanged:
 
298
                        {
 
299
                            qFactorTextField.text = qFactorSlider.value
 
300
                            if(skipUpdateUIQFactor)
 
301
                            {
 
302
                                see3camcu210.setQFactorValue(qFactorSlider.value)
 
303
                            }
 
304
                            skipUpdateUIQFactor = true
 
305
                        }
 
306
                    }
 
307
                    TextField
 
308
                    {
 
309
                        id: qFactorTextField
 
310
                        text: qFactorSlider.value
 
311
                        font.pixelSize: 10
 
312
                        font.family: "Ubuntu"
 
313
                        smooth: true
 
314
                        horizontalAlignment: TextInput.AlignHCenter
 
315
                        style: econTextFieldStyle
 
316
                        validator: IntValidator {bottom: qFactorSlider.minimumValue; top: qFactorSlider.maximumValue}
 
317
                        onTextChanged:
 
318
                        {
 
319
                            if(text.length > 0)
 
320
                            {
 
321
                                qFactorSlider.value = qFactorTextField.text
 
322
                            }
 
323
                        }
 
324
                    }
 
325
                }
 
326
 
 
327
                Text
 
328
                {
 
329
                    id: burstLength
 
330
                    text: "Burst Length :"
 
331
                    font.pixelSize: 14
 
332
                    font.family: "Ubuntu"
 
333
                    color: "#ffffff"
 
334
                    smooth: true
 
335
                    opacity: 1
 
336
                }
 
337
                ComboBox
 
338
                {
 
339
                    id: burstLengthCombo
 
340
                    opacity: 1
 
341
                    enabled: true
 
342
                    model: ListModel
 
343
                           {
 
344
                                ListElement { text: "1" }
 
345
                                ListElement { text: "2" }
 
346
                                ListElement { text: "3" }
 
347
                                ListElement { text: "4" }
 
348
                                ListElement { text: "5" }
 
349
                            }
 
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)
 
356
                        }
 
357
                        skipUpdateUIOnBurstLength = true
 
358
                    }
 
359
                }
 
360
 
 
361
                Text
 
362
                {
 
363
                    id: denoiseText
 
364
                    text: "--- De-Noise ---"
 
365
                    font.pixelSize: 14
 
366
                    font.family: "Ubuntu"
 
367
                    color: "#ffffff"
 
368
                    smooth: true
 
369
                    Layout.alignment: Qt.AlignCenter
 
370
                    opacity: 0.50196078431373
 
371
                }
 
372
 
 
373
                Grid
 
374
                {
 
375
                      columns: 2
 
376
                      spacing: 20
 
377
                      ExclusiveGroup { id: denoiseGroup }
 
378
 
 
379
                      RadioButton
 
380
                      {
 
381
                          exclusiveGroup: denoiseGroup
 
382
                          id: denoiseEnable
 
383
                          text: "Enable"
 
384
                          activeFocusOnPress: true
 
385
                          style: econRadioButtonStyle
 
386
                          opacity: enabled ? 1 : 0.1
 
387
 
 
388
                          onClicked: {
 
389
                               see3camcu210.setDenoiseMode(See3CAM_CU210.ENABLE)
 
390
                          }
 
391
                          Keys.onReturnPressed: {
 
392
                              see3camcu210.setDenoiseMode(See3CAM_CU210.ENABLE)
 
393
                          }
 
394
                      }
 
395
                      RadioButton
 
396
                      {
 
397
                          exclusiveGroup: denoiseGroup
 
398
                          id: denoiseDisable
 
399
                          text: "Disable"
 
400
                          activeFocusOnPress: true
 
401
                          style: econRadioButtonStyle
 
402
                          opacity: enabled ? 1 : 0.1
 
403
 
 
404
                          onClicked: {
 
405
                              see3camcu210.setDenoiseMode(See3CAM_CU210.DISABLE)
 
406
                          }
 
407
                          Keys.onReturnPressed: {
 
408
                              see3camcu210.setDenoiseMode(See3CAM_CU210.DISABLE)
 
409
                          }
 
410
                      }
 
411
                }
 
412
 
 
413
 
 
414
                Row{
 
415
                    Layout.alignment: Qt.AlignCenter
 
416
                    Button {
 
417
                        id: defaultValue
 
418
                        opacity: 1
 
419
                        activeFocusOnPress : true
 
420
                        text: "Default"
 
421
                        tooltip: "Click to set default values in extension controls"
 
422
                        action: setDefault
 
423
                        style: econButtonStyle
 
424
                        Keys.onReturnPressed: {
 
425
                            setToDefaultValues()
 
426
                        }
 
427
                    }
 
428
                }
 
429
 
 
430
               Row{
 
431
                    Button {
 
432
                        id: f_wversion_selected130
 
433
                        opacity: 1
 
434
                        action: firmwareVersion
 
435
                        activeFocusOnPress : true
 
436
                        tooltip: "Click to view the firmware version of the camera"
 
437
                        style: ButtonStyle {
 
438
                            background: Rectangle {
 
439
                            border.width: control.activeFocus ? 3 :0
 
440
                            color: "#222021"
 
441
                            border.color: control.activeFocus ? "#ffffff" : "#222021"
 
442
                            radius: 5
 
443
                            }
 
444
                            label: Image {
 
445
                            source: "images/f_wversion_selected.png"
 
446
                            }
 
447
                        }
 
448
                        Keys.onReturnPressed: {
 
449
                            getFirmwareVersion()
 
450
                        }
 
451
                    }
 
452
                    Button {
 
453
                        id: serial_no_selected
 
454
                        opacity: 1
 
455
                        action: serialNumber
 
456
                        activeFocusOnPress : true
 
457
                        tooltip: "Click to view the Serial Number"
 
458
                        style: ButtonStyle {
 
459
                            background: Rectangle {
 
460
                            border.width: control.activeFocus ? 3 :0
 
461
                            color: "#222021"
 
462
                            border.color: control.activeFocus ? "#ffffff" : "#222021"
 
463
                            radius: 5
 
464
                            }
 
465
                            label: Image {
 
466
                            source: "images/serial_no_selected.png"
 
467
                            }
 
468
                        }
 
469
                        Keys.onReturnPressed: {
 
470
                           getSerialNumber()
 
471
                        }
 
472
                    }
 
473
                }
 
474
 
 
475
               Row{
 
476
                   Layout.alignment: Qt.AlignCenter
 
477
 
 
478
                   Button {
 
479
                       id: ispFirmwareVersion
 
480
                       opacity: 1
 
481
                       action: ispVersion
 
482
                       text: "ISP Version"
 
483
                       activeFocusOnPress : true
 
484
                       tooltip: "Click to view the ISP firmware version"
 
485
                       style: econButtonStyle
 
486
                       Keys.onReturnPressed: {
 
487
                           see3camcu210.readISPFirmwareVersion()
 
488
                       }
 
489
                   }
 
490
               }
 
491
 
 
492
            }//Coloumn Layout
 
493
 
 
494
         } // Item
 
495
 
 
496
    }//ScrollView
 
497
 
 
498
   See3CAM_CU210{
 
499
     id:see3camcu210
 
500
 
 
501
     onAwbModeRecieved:{
 
502
         skipUpdateUIOnAWBMode = false
 
503
         currentAwbMode(awbMode)
 
504
         skipUpdateUIOnAWBMode = true
 
505
     }
 
506
     onAwbLockStatusReceived: {
 
507
         skipUpdateUIOnAWBLockStatus = false
 
508
         currentAwbLockStatus(awbLockStatus)
 
509
         skipUpdateUIOnAWBLockStatus = true
 
510
     }
 
511
     onMeteringModeReceived: {
 
512
         currentExpMeteringMode(meteringMode)
 
513
     }
 
514
     onAeLockStatusReceived: {
 
515
         skipUpdateUIOnAELockStatus = false
 
516
         currentAeLockStatus(aeLockStatus)
 
517
         skipUpdateUIOnAELockStatus = true
 
518
     }
 
519
     onBurstLengthReceived: {
 
520
         skipUpdateUIOnBurstLength = false
 
521
         burstLengthCombo.currentIndex = burstLength - 1
 
522
         skipUpdateUIOnBurstLength = true
 
523
     }
 
524
     onFlickerModeReceived: {
 
525
         skipUpdateUIOnAntiFlickerMode = false
 
526
         currentFlickerValue(flickerMode)
 
527
         skipUpdateUIOnAntiFlickerMode = true
 
528
     }
 
529
     onQFactorValueReceived: {
 
530
         skipUpdateUIQFactor = false
 
531
         qFactorSlider.value = Qfactor
 
532
         skipUpdateUIQFactor = true
 
533
     }
 
534
     onDenoiseModeReceived: {
 
535
         currentDenoiseMode(denoise)
 
536
     }
 
537
     onTitleTextChanged: {
 
538
         messageDialog.title = _title.toString()
 
539
         messageDialog.text = _text.toString()
 
540
         messageDialog.open()
 
541
     }
 
542
 
 
543
   }
 
544
 
 
545
    Uvccamera {
 
546
        id: uvccamera
 
547
        onTitleTextChanged: {
 
548
            messageDialog.title = _title.toString()
 
549
            messageDialog.text = _text.toString()
 
550
            messageDialog.open()
 
551
        }
 
552
        onSerialNumber:{
 
553
            messageDialog.title = qsTr("Serial Number")
 
554
            messageDialog.text = serialNumber;
 
555
        }
 
556
    }
 
557
 
 
558
 
 
559
    Component {
 
560
        id: econRadioButtonStyle
 
561
        RadioButtonStyle {
 
562
            label: Text {
 
563
                text: control.text
 
564
                font.pixelSize: 14
 
565
                font.family: "Ubuntu"
 
566
                color: "#ffffff"
 
567
                smooth: true
 
568
                opacity: 1
 
569
            }
 
570
            background: Rectangle {
 
571
                color: "#222021"
 
572
                border.color: control.activeFocus ? "#ffffff" : "#222021"
 
573
            }
 
574
        }
 
575
    }
 
576
 
 
577
    Component {
 
578
        id: econCheckBoxStyle
 
579
        CheckBoxStyle {
 
580
            label: Text {
 
581
                text: control.text
 
582
                font.pixelSize: 14
 
583
                font.family: "Ubuntu"
 
584
                color: "#ffffff"
 
585
                smooth: true
 
586
                opacity: 1
 
587
            }
 
588
            background: Rectangle {
 
589
                color: "#222021"
 
590
                border.color: control.activeFocus ? "#ffffff" : "#222021"
 
591
            }
 
592
        }
 
593
    }
 
594
 
 
595
    Component {
 
596
        id: econComboBoxStyle
 
597
        ComboBoxStyle {
 
598
            background: Image {
 
599
                id: combo_bkgrnd
 
600
                source: "../../Views/images/device_box.png"
 
601
                Rectangle {
 
602
                    width: combo_bkgrnd.sourceSize.width  - 28
 
603
                    height: combo_bkgrnd.sourceSize.height
 
604
                    color: "#222021"
 
605
                    border.color: "white"
 
606
                    border.width: control.activeFocus ? 3 : 1
 
607
                    radius: control.activeFocus ? 5 : 0
 
608
                }
 
609
            }
 
610
            label:  Text{
 
611
                anchors.fill: parent
 
612
                color: "#ffffff"
 
613
                elide: Text.ElideRight
 
614
                text: control.currentText
 
615
                verticalAlignment: Text.AlignVCenter
 
616
                maximumLineCount: 1
 
617
                font.family: "Ubuntu"
 
618
                font.pixelSize: 14
 
619
            }
 
620
        }
 
621
    }
 
622
 
 
623
    Component {
 
624
        id: econButtonStyle
 
625
        ButtonStyle {
 
626
            background: Rectangle {
 
627
                implicitHeight: 38
 
628
                implicitWidth: 104
 
629
                border.width: control.activeFocus ? 3 :0
 
630
                color: "#e76943"
 
631
                border.color: control.activeFocus ? "#ffffff" : "#222021"
 
632
                radius: control.activeFocus ? 5 : 0
 
633
            }
 
634
            label: Text {
 
635
                color: "#ffffff"
 
636
                horizontalAlignment: Text.AlignHCenter
 
637
                verticalAlignment: Text.AlignVCenter
 
638
                font.family: "Ubuntu"
 
639
                font.pointSize: 10
 
640
                text: control.text
 
641
            }
 
642
        }
 
643
    }
 
644
 
 
645
    Component {
 
646
        id: econscrollViewStyle
 
647
        ScrollViewStyle {
 
648
            scrollToClickedPosition: true
 
649
            handle: Image {
 
650
                id: scrollhandle
 
651
                source: "images/scroller.png"
 
652
            }
 
653
            scrollBarBackground: Image {
 
654
                id: scrollStyle
 
655
                source: "images/Scroller_bg.png"
 
656
            }
 
657
            incrementControl: Image {
 
658
                id: increment
 
659
                source: "images/down_arrow.png"
 
660
            }
 
661
            decrementControl: Image {
 
662
                id: decrement
 
663
                source: "images/up_arrow.png"
 
664
            }
 
665
        }
 
666
    }
 
667
    Component {
 
668
        id: econCheckBoxTextWrapModeStyle
 
669
        CheckBoxStyle {
 
670
            label: Text {
 
671
                text: control.text
 
672
                font.pixelSize: 14
 
673
                font.family: "Ubuntu"
 
674
                color: "#ffffff"
 
675
                smooth: true
 
676
                opacity: 1
 
677
                width: 100
 
678
                wrapMode: Text.WordWrap
 
679
            }
 
680
            background: Rectangle {
 
681
                color: "#222021"
 
682
                border.color: control.activeFocus ? "#ffffff" : "#222021"
 
683
            }
 
684
        }
 
685
    }
 
686
 
 
687
    function currentAwbMode(mode)
 
688
    {
 
689
        switch(mode)
 
690
        {
 
691
            case See3CAM_CU210.CLOUDY:
 
692
                awbModeCombo.currentIndex = 0
 
693
                break
 
694
            case See3CAM_CU210.DAYLIGHT:
 
695
                awbModeCombo.currentIndex = 1
 
696
                break
 
697
            case See3CAM_CU210.FLASH:
 
698
                awbModeCombo.currentIndex = 2
 
699
                break
 
700
            case See3CAM_CU210.COOL_WHITE_FLUORESCENT:
 
701
                awbModeCombo.currentIndex = 3
 
702
                break
 
703
            case See3CAM_CU210.TUNGSTEN:
 
704
                awbModeCombo.currentIndex = 4
 
705
                break
 
706
            case See3CAM_CU210.CANDLE_LIGHT:
 
707
                awbModeCombo.currentIndex = 5
 
708
                break
 
709
            case See3CAM_CU210.HORIZON:
 
710
                awbModeCombo.currentIndex = 6
 
711
                break
 
712
            case See3CAM_CU210.CUSTOM:
 
713
                awbModeCombo.currentIndex = 7
 
714
                break
 
715
            case See3CAM_CU210.AUTO:
 
716
                awbModeCombo.currentIndex = 8
 
717
                break
 
718
         }
 
719
    }
 
720
 
 
721
    function setAwbMode()
 
722
    {
 
723
        if(awbModeCombo.currentText.toString() == "Cloudy")
 
724
        {
 
725
            see3camcu210.setAwbMode(See3CAM_CU210.CLOUDY)
 
726
        }
 
727
        else if(awbModeCombo.currentText.toString() == "Daylight")
 
728
        {
 
729
            see3camcu210.setAwbMode(See3CAM_CU210.DAYLIGHT)
 
730
        }
 
731
        else if(awbModeCombo.currentText.toString() == "Flash")
 
732
        {
 
733
            see3camcu210.setAwbMode(See3CAM_CU210.FLASH)
 
734
        }
 
735
        else if(awbModeCombo.currentText.toString() == "Cool white fluorescent")
 
736
        {
 
737
            see3camcu210.setAwbMode(See3CAM_CU210.COOL_WHITE_FLUORESCENT)
 
738
        }
 
739
        else if(awbModeCombo.currentText.toString() == "Tungsten")
 
740
        {
 
741
            see3camcu210.setAwbMode(See3CAM_CU210.TUNGSTEN)
 
742
        }
 
743
        else if(awbModeCombo.currentText.toString() == "Candlelight")
 
744
        {
 
745
            see3camcu210.setAwbMode(See3CAM_CU210.CANDLE_LIGHT)
 
746
        }
 
747
        else if(awbModeCombo.currentText.toString() == "Horizon")
 
748
        {
 
749
            see3camcu210.setAwbMode(See3CAM_CU210.HORIZON)
 
750
        }
 
751
        else if(awbModeCombo.currentText.toString() == "Custom")
 
752
        {
 
753
            see3camcu210.setAwbMode(See3CAM_CU210.CUSTOM)
 
754
        }
 
755
        else if(awbModeCombo.currentText.toString() == "Auto")
 
756
        {
 
757
            see3camcu210.setAwbMode(See3CAM_CU210.AUTO)
 
758
        }
 
759
    }
 
760
 
 
761
    function currentAwbLockStatus(mode){
 
762
        if(mode == See3CAM_CU210.AWB_ON)
 
763
        {
 
764
           awbLockCheckBox.checked = true
 
765
           awbModeCombo.enabled = false
 
766
           awbModeCombo.opacity = 0.1
 
767
        }
 
768
        else if(mode == See3CAM_CU210.AWB_OFF)
 
769
        {
 
770
           awbLockCheckBox.checked = false
 
771
           awbModeCombo.enabled = true
 
772
           awbModeCombo.opacity = 1
 
773
        }
 
774
    }
 
775
 
 
776
    function currentAeLockStatus(status)
 
777
    {
 
778
        if(status == See3CAM_CU210.AE_ON)
 
779
        {
 
780
            aeLockCheckBox.checked = true
 
781
            meteringModeCombo.enabled = false
 
782
            meteringModeCombo.opacity = 0.1
 
783
        }
 
784
        else if(status == See3CAM_CU210.AE_OFF)
 
785
        {
 
786
            aeLockCheckBox.checked = false
 
787
            meteringModeCombo.enabled = true
 
788
            meteringModeCombo.opacity = 1
 
789
        }
 
790
    }
 
791
 
 
792
    function currentExpMeteringMode(mode)
 
793
    {
 
794
        if(mode == See3CAM_CU210.AUTO_EXPOSURE_OFF)
 
795
        {
 
796
            meteringModeCombo.currentIndex = 0
 
797
        }
 
798
        else if(mode == See3CAM_CU210.AVERAGE)
 
799
        {
 
800
            meteringModeCombo.currentIndex = 1
 
801
        }
 
802
        else if(mode == See3CAM_CU210.INTEGRAL)
 
803
        {
 
804
            meteringModeCombo.currentIndex = 2
 
805
        }
 
806
        else if(mode == See3CAM_CU210.SMALL_AREA)
 
807
        {
 
808
            meteringModeCombo.currentIndex = 3
 
809
        }
 
810
        else if(mode == See3CAM_CU210.LARGE_AREA)
 
811
        {
 
812
            meteringModeCombo.currentIndex = 4
 
813
        }
 
814
    }
 
815
 
 
816
    function setExpMeteringMode()
 
817
    {
 
818
        if(meteringModeCombo.currentText.toString() == "Auto Exposure Off")
 
819
        {
 
820
            see3camcu210.setExposureMeteringMode(See3CAM_CU210.AUTO_EXPOSURE_OFF)
 
821
        }
 
822
        else if(meteringModeCombo.currentText.toString() == "Centre-Weighted Average")
 
823
        {
 
824
            see3camcu210.setExposureMeteringMode(See3CAM_CU210.AVERAGE)
 
825
        }
 
826
        else if(meteringModeCombo.currentText.toString() == "All Block Integral")
 
827
        {
 
828
            see3camcu210.setExposureMeteringMode(See3CAM_CU210.INTEGRAL)
 
829
        }
 
830
        else if(meteringModeCombo.currentText.toString() == "Small Area")
 
831
        {
 
832
            see3camcu210.setExposureMeteringMode(See3CAM_CU210.SMALL_AREA)
 
833
        }
 
834
        else if(meteringModeCombo.currentText.toString() == "Large Area")
 
835
        {
 
836
            see3camcu210.setExposureMeteringMode(See3CAM_CU210.LARGE_AREA)
 
837
        }
 
838
    }
 
839
 
 
840
    function currentFlickerValue(flickerVal)
 
841
    {
 
842
        if(flickerVal == See3CAM_CU210.FLICKER_AUTO)
 
843
        {
 
844
            flickerModeCombo.currentIndex = 0
 
845
        }
 
846
        else if(flickerVal == See3CAM_CU210.FLICKER_50HZ)
 
847
        {
 
848
            flickerModeCombo.currentIndex = 1
 
849
        }
 
850
        else if(flickerVal == See3CAM_CU210.FLICKER_60HZ)
 
851
        {
 
852
            flickerModeCombo.currentIndex = 2
 
853
        }
 
854
        else if(flickerVal == See3CAM_CU210.FLICKER_DISABLE)
 
855
        {
 
856
            flickerModeCombo.currentIndex = 3
 
857
        }
 
858
    }
 
859
 
 
860
    function setFlickerMode()
 
861
    {
 
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)
 
870
    }
 
871
 
 
872
    function currentDenoiseMode(denoiseVal)
 
873
    {
 
874
        if(denoiseVal == See3CAM_CU210.ENABLE)
 
875
        {
 
876
            denoiseEnable.checked = true
 
877
        }
 
878
        else if(denoiseVal == See3CAM_CU210.DISABLE)
 
879
        {
 
880
            denoiseDisable.checked = true
 
881
        }
 
882
    }
 
883
 
 
884
    function setToDefaultValues(){
 
885
        root.checkForTriggerMode(false)
 
886
        root.captureBtnEnable(true)
 
887
        root.videoRecordBtnEnable(true)
 
888
        see3camcu210.setToDefaultValues()
 
889
        getValuesFromCamera()
 
890
    }
 
891
 
 
892
    function getSerialNumber() {
 
893
        uvccamera.getSerialNumber()
 
894
        messageDialog.open()
 
895
    }
 
896
 
 
897
    function getFirmwareVersion() {
 
898
        uvccamera.getFirmWareVersion()
 
899
        messageDialog.open()
 
900
    }
 
901
 
 
902
    function getISPFirmwareVersion(){
 
903
        see3camcu210.readISPFirmwareVersion()
 
904
        messageDialog.open()
 
905
    }
 
906
 
 
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()
 
916
    }
 
917
 
 
918
    Component.onCompleted: {
 
919
        getValuesFromCamera();
 
920
    }
 
921
}