summaryrefstree
path: root/usr/bin/qml/Home/HomeMenuBar.qml
blob: 0eafd6a93a3d8fd2c7f7dab5ba63da6a14466dc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
import QtQuick 2.0
import Label 2.0
import "../com/neusoft/auto/widgets"
import "../layoutList.js" as Layout
import "../USB/usb_define.js" as UsbStateList
import "../eventsList.js" as EventsList

Item
{
    property int sysNaviCoding: systemCtrl.checkAppCommCodingData(EventsList.HMI_CODING_SYS_NAVI)
    property int misscall:btCtrl.btMissNums    //ADD by wyc 2018/12/13 FOR ST#314757
    property int north: 0//add by qwg 2019/1/23 start
    property int north_east: 2
    property int east: 4
    property int south_east: 6
    property int south: 8
    property int south_west: 10
    property int west: 12
    property int north_west: 14//add by qwg 2019/1/23 end
    property string idirection: ""
    property int enterAction: Layout.ENTER_BY_MENUBAR
    Component.onCompleted:
    {
        sysNaviCoding = systemCtrl.checkAppCommCodingData(EventsList.HMI_CODING_SYS_NAVI)
        if(0 == sysNaviCoding)
        {
            navi.enabled = false
            carplayCtrl.naiv_direction_Start();
        }
        else if(1 == sysNaviCoding)
        {
            navi.enabled = true
            carplayCtrl.naiv_direction_Stop();
            updateNaviMenuBar()
        }
        else
        {
            navi.enabled = true
            carplayCtrl.naiv_direction_Stop();
            updateNaviMenuBar()
        }
    }

    property string bgImageStyle: systemCtrl.style
    //ADD 20170103 #141056 liduo begin
    property int buttonIndex: 0
    //ADD 20170103 #141056 liduo end
    onVisibleChanged:
    {
        carplay.visible = carplayCtrl.getcarplayconnectstatus()
        androidauto.visible = andrCtrl.aa_ctrl_getConnectionStatus()
        if(1 == sysNaviCoding)
        {
            navi.enabled = true
            carplayCtrl.naiv_direction_Stop();
            updateNaviMenuBar()
        }
    }
    //y:71 //FOD 2017/2/15 ld
    y:45//71
    //height:90
    height: 160
    width:960


    HMIButton
    {
        id:media
        //x:codingType?50:""//-1
        x:136//166
        //y:0
        y:0//19
        //width:codingType?108:""//191
        width:89//29
        //height:90
        height: 83//45
        Image
        {
            id:mediasimg
            x:0
            y:0
            // height:91
            // width:90
            anchors.horizontalCenter: parent.horizontalCenter
            source:media.pressed?("qrc:MATERIAL/MATERIAL_HEADE_ICON_MEDIA_P"+bgImageStyle):("qrc:MATERIAL/MATERIAL_HEADE_ICON_MEDIA"+bgImageStyle)
        }
        onClicked:
        {
            if(buttonIndex==0){
                buttonIndex=1
                buttonTimer.restart()
            }
            //ADD 20170103 #141056 liduo begin
        }
    }
    Image
    {
        id:mediasred
        x:110
        y:32
        width:136
        height:56
        visible: media.pressed?true:false
        source:"qrc:MATERIAL/MATERIAL_HEADE_BUTTON_P_MEDIA"+bgImageStyle
    }
    HMIButton
    {
        id:phone
        //x:241//216
        x:266
        //y:0
        y:8
        //width:104
        width: 83//29
        //height:90
        height:82//42
        visible: true
        //btnImg:phone.pressed?("qrc:MATERIAL/MATERIAL_HEADE_ICON_PHONE_P"+bgImageStyle):("qrc:MATERIAL/MATERIAL_HEADE_ICON_PHONE"+bgImageStyle)
        Image
        {
            id:phonesimg
            x:0
            y:0
            // height:91
            // width:90
            anchors.horizontalCenter: parent.horizontalCenter
            source:phone.pressed?("qrc:MATERIAL/MATERIAL_HEADE_ICON_PHONE_P"+bgImageStyle):("qrc:MATERIAL/MATERIAL_HEADE_ICON_PHONE"+bgImageStyle)
        }
        onClicked:
        {
	    //update by ZhangLiXin #347393
            console.log("\n@AndroidAuto**ZLX**Phone**onClicked**andrCtrl.aa_ctrl_getConnectionStatus()=["+andrCtrl.aa_ctrl_getConnectionStatus()+"]")
            console.log("\n@AndroidAuto**ZLX**Phone**onClicked**carplayCtrl.getcarplayconnectstatus()=["+carplayCtrl.getcarplayconnectstatus()+"]")
            if(/*false == andrCtrl.aa_ctrl_getConnectionStatus() && */false == carplayCtrl.getcarplayconnectstatus())
            {
                if(buttonIndex==0)
                {
                    buttonIndex=2
                    buttonTimer.restart()
                }
            }
            else
            {
                //do nothing
            }

            //ADD 20170103 #141056 liduo end
        }
    }
    Image
    {
        id:phonesred
        x:240
        y:40
        width:136
        height:56
        visible: phone.pressed?true:false
        source:"qrc:MATERIAL/MATERIAL_HEADE_BUTTON_P_PHONE"+bgImageStyle
    }
    //ADD by wyc 2018/12/13 FOR ST#314757 begin
    Item
    {
        id:phonecallicon
        x:324//822
        y:19//176
        width:40
        height:28
        visible:(misscall !=0)
        Image
        {
            id:misscall_10_down
            x:0
            y:0
            width:28
            height:28
            source:"qrc:MATERIAL/MATERIAL_PHONE_DOT_1_LITTLE"+style
            visible:(misscall<10)&&(misscall>0)
        }
        Image
        {
            id:misscall_10_up
            x:0
            y:0
            width:40
            height:28
            source:"qrc:MATERIAL/MATERIAL_PHONE_DOT_2_LITTLE"+style
            visible:(misscall>=10)
        }
        HMILabel
        {
            id:misscallnumber
            anchors.horizontalCenter: {
                if(misscall>9){
                    misscall_10_up.horizontalCenter
                }else{
                    misscall_10_down.horizontalCenter
                }
            }
            width: 28
            height: 28
            text:(misscall>99)?"99":misscall
            font.pixelSize: 20
            color:"white"
        }
    }
    //ADD by wyc 2018/12/13 FOR ST#314757 end
    HMIButton
    {
        id:navi
        //x:216
        x:641
        //y:0
        y:10
        //width:104
        width:56
        //height:90
        height: 70
        enabled: sysNaviCoding == 0? false:true
        Image
        {
            id:naviimg
            x:0
            y:0
            source:navi.pressed?("qrc:MATERIAL/MATERIAL_HEADE_ICON_NAVI_P"+bgImageStyle):("qrc:MATERIAL/MATERIAL_HEADE_ICON_NAVI"+bgImageStyle)
        }
        HMILabel
        {
            id:nonavi_txt
            x:2
            y:38
            width: 54
            height: 24
            visible: sysNaviCoding == 0? true:false
            font.pixelSize: 22
            text: (idirection == "")?"-":idirection
        }

        HMILabel
        {
            id: navi_txt
            //modify by Jiyulong for #20170310_design_change start 2017/3/15
            //FOD by lishunan 2018/09/12 for #BF_USB_19 start
            x: 2//13 //bMaxWindow == true?320:13// 333:25//333//383
            y: 38// bMaxWindow == true?636:166//bMaxWindow == true?680:239//bMaxWindow == true?546:243//541:238
            width: 54// bMaxWindow == true?157:130//196//96
            //modify by Jiyulong for #20170310_design_change end
            height: 24//26//30//20
            //text:"NW"//usb_ptime==""?"00:00:00":usb_ptime
            visible: sysNaviCoding == 0? false:true
            font.pixelSize: 22//26//18
            // color:"white"
            //horizontalAlignment: Label.AlignHCenter// Label.AlignLeft
            wtitesize:1
            //FOD by lishunan 2018/09/12 for #BF_USB_19 end
        }
        onClicked:
        {
            if(buttonIndex==0){
                buttonIndex=3
                buttonTimer.restart()
            }
            //                //ADD 20170103 #141056 liduo end
        }
    }
    Image
    {
        id:navired
        x:602
        y:40
        width:135
        height:55
        visible: navi.pressed?true:false
        source:"qrc:MATERIAL/MATERIAL_HEADE_BUTTON_P_NAVI"+bgImageStyle
    }
    HMIButton
    {
        id:home
        x:438
        //  y:0
        y:24
        width:84
        //height:90
        height: 81
        Image
        {
            id:homesimg
            x:0
            y:0
            anchors.horizontalCenter: parent.horizontalCenter
            source:home.pressed?("qrc:MATERIAL/MATERIAL_HEADE_ICON_HOME_P"+bgImageStyle):("qrc:MATERIAL/MATERIAL_HEADE_ICON_HOME"+bgImageStyle)
        }
        onClicked:
        {
            if(buttonIndex==0){
                buttonIndex=5
                buttonTimer.restart()
            }
            //ADD 20170103 #141056 liduo end
        }
    }
    Image
    {
        id:homesred
        x:392
        y:44
        width:176
        height:69
        visible: home.pressed?true:false
        source:"qrc:MATERIAL/MATERIAL_HEADE_BUTTON_P_HOME"+bgImageStyle
    }
    HMIButton
    {
        id:carplay
        x:762
        y:1
        width: 79
        height: 79
        btnImg:carplay.pressed?("qrc:MATERIAL/MATERIAL_HEADE_ICON_CARPLAY_P"+bgImageStyle):("qrc:MATERIAL/MATERIAL_HEADE_ICON_CARPLAY"+bgImageStyle)
        onClicked:
        {
            carplayCtrl.cp_set_last_screen_carplay()
            console.log("####carplayCtrl.cp_44_set_last_screen_carplay()")
            if(buttonIndex==0)
            {
                buttonIndex=10
                buttonTimer.restart()
                MessageTransfer.click_m_menubar_cp(true)
            }
        }
    }
    Image
    {
        id: caplayred
        x:734
        y:32
        width:135
        height:55
        visible: carplay.pressed?true:false
        source: "qrc:MATERIAL/MATERIAL_HEADE_BUTTON_P_AUTO"+bgImageStyle
    }
    HMIButton
    {
        id:androidauto
        x:762
        y:1
        width: 79
        height: 79
        visible: false
        btnImg:androidauto.pressed?("qrc:MATERIAL/MATERIAL_HEADE_ICON_ANDROID_AUTO_P"+bgImageStyle):("qrc:MATERIAL/MATERIAL_HEADE_ICON_ANDROID_AUTO"+bgImageStyle)
        onClicked:
        {
            if(buttonIndex == 0)
            {
                buttonIndex = 11
                buttonTimer.restart()
                MessageTransfer.click_m_menubar_aa(true)
            }
        }
    }
    Image
    {
        id: androidautored
        x:734
        y:32
        width:135
        height:55
        visible: androidauto.pressed?true:false
        source: "qrc:MATERIAL/MATERIAL_HEADE_BUTTON_P_AUTO"+bgImageStyle
    }
    HMIButton
    {
        id:settings
        //x:codingType?615:770
        x:8//11
        //y:0
        y:-18//-15//45
        //width:codingType?104:191
        width:91
        //height:90
        height:90
        Image
        {
            id:settingssimg
            x:0
            y:0
            width:91
            height:90
            anchors.horizontalCenter: parent.horizontalCenter
            source:settings.pressed?("qrc:MATERIAL/MATERIAL_HEADE_ICON_SETTINGS_P"+bgImageStyle):("qrc:MATERIAL/MATERIAL_HEADE_ICON_SETTINGS"+bgImageStyle)
        }
        onClicked:
        {
            if(buttonIndex==0){
                buttonIndex=8
                buttonTimer.restart()
            }
            //ADD 20170103 #141056 liduo end
        }
    }
    Image
    {
        id: settingred
        x:0
        y:24
        width:120
        height:56
        visible: settings.pressed?true:false
        source: "qrc:MATERIAL/MATERIAL_HEADE_BUTTON_P_SETTINGS"+bgImageStyle
    }
    //ADD 20170103 #141056 liduo begin
    Timer
    {
        id:buttonTimer
        interval: 100
        running: false
        repeat: false
        onTriggered:
        {
            //ADD 2019/04/30 by wyc FOR 329897 begin
            if (false == visible)
            {
                enterAction = Layout.ENTER_BY_HOME;
            }
            else
            {
                enterAction = Layout.ENTER_BY_MENUBAR;
            }
            //ADD 2019/04/30 by wyc FOR 329897 end
            switch(buttonIndex){
            case 1:
                //ve5Ctrl.fullToClose = true
                //console.log("------------~~~~~~~~~~~-------------------",ve5Ctrl.fullToClose)
                //settingCtrl.reqHideQuickLink();//DEL #167396 baojinfeng 2017/4/19 end
                USBControl1.usbCtrlSetEnterPageWay(UsbStateList.USB_BUTTON_ENTER)
                //FOD by lishunan for changeForm start
                //systemCtrl.changeApp(Layout.HMI_APP_MEDIA,Layout.ENTER_BY_MENUBAR)
                systemCtrl.changeApp(Layout.HMI_APP_MEDIA,enterAction)
                //systemCtrl.changeApp(Layout.HMI_APP_MEDIA)
                //FOD by lishunan for changeForm end
                break;
            case 2:
                //settingCtrl.reqHideQuickLink();//DEL #167396 baojinfeng 2017/4/19 end
                //FOD 2018/09/26 by wangyuecheng for changeForm begin
                //systemCtrl.changeApp(Layout.HMI_APP_PHONE)
                //console.log("$$$$$$$$$$$$$$$$$$$$$$$$$$btCtrl.getOperationAfterCall():",btCtrl.getOperationAfterCall())
                if (btCtrl.getOperationAfterCall() != Layout.INVALID_VALUE)
                {
                    btCtrl.setOperateAfterCall(Layout.HMI_BTP_NO_OPERATE)
                }
                //systemCtrl.changeApp(Layout.HMI_APP_PHONE,Layout.ENTER_BY_MENUBAR)
                systemCtrl.changeApp(Layout.HMI_APP_PHONE,enterAction)
                //FOD 2018/09/26 by wangyuecheng for changeForm end
                break;
            case 3:
                //                ve5Ctrl.fullToClose = true
                //settingCtrl.reqHideQuickLink();//DEL #167396 baojinfeng 2017/4/19 end
                naviCtrl.startNaviAppProcess();//ADD 2017/5/10 ld
                //systemCtrl.changeApp(Layout.HMI_APP_NAVI,Layout.ENTER_BY_MENUBAR)
                systemCtrl.changeApp(Layout.HMI_APP_NAVI,enterAction)
                break;
            case 4:
                //settingCtrl.reqHideQuickLink();//DEL #167396 baojinfeng 2017/4/19 end
                //                if(true == onlineEnableSts)
                //                {
                //                    systemCtrl.changeApp(Layout.HMI_APP_ENTER)
                //                }
                //                else
                //                {
                //                    systemCtrl.changeApp(Layout.HMI_APP_SOUND)
                //                }

                //                if (systemCtrl.getCurrentSource() !== Layout.HMI_SRC_OL_ENTER)
                //                {
                //                    systemCtrl.reqSource(Layout.HMI_SRC_OL_ENTER,Layout.HMI_SRC_START,Layout.HMI_SRC_Front);
                //                }
                break;
            case 5:
                console.log("***llll****home*****222222222222222")
                ScreenManager.changeForm(Layout.ACT_MENUBAR)
                //ScreenManager.hideOverlay(WindowsList.QUICKLINK)
                //settingCtrl.reqHideQuickLink();//DEL #167396 baojinfeng 2017/4/19 end
                systemCtrl.homelinevisible();
                console.log("***llll****home*****333333333333333333")
                break;
            case 6:
                //settingCtrl.reqHideQuickLink();//DEL #167396 baojinfeng 2017/4/19 end
                //                systemCtrl.changeApp(Layout.HMI_APP_PHONELINK)
                break;
            case 7:
                //settingCtrl.reqHideQuickLink();//DEL #167396 baojinfeng 2017/4/19 end
                //                systemCtrl.changeApp(Layout.HMI_APP_CALENDAR)
                break;
            case 8:
                //settingCtrl.reqHideQuickLink();//DEL #167396 baojinfeng 2017/4/19 end
                systemCtrl.changeApp(Layout.HMI_APP_SETTING,enterAction)
                break;
            case 9:
                //                systemCtrl.changeApp(Layout.HMI_APP_SPEECH)
                //settingCtrl.reqHideQuickLink();//DEL #167396 baojinfeng 2017/4/19 end
                break;
            case 10:
                carplayCtrl.request_cp_home("");
                //systemCtrl.changeApp(Layout.HMI_APP_PHONELINK,Layout.ENTER_BY_MENUBAR)
                break;
            case 11:
                andrCtrl.aa_ctrl_lastScreen();
                andrCtrl.aa_ctrl_setPermissionToMD(Layout.AA_VIDEO_FOCUS_PROJECTED,Layout.AA_ACTIVE);
                //systemCtrl.changeApp(Layout.HMI_APP_PHONELINK,Layout.ENTER_BY_MENUBAR)
                break;
            default:
                buttonIndex=0
                break;
            }
            buttonIndex=0
        }
    }
    //ADD 20170103 #141056 liduo end
    Connections
    {
        target: systemCtrl
        onCodingChange:
        {
            sysNaviCoding = systemCtrl.checkAppCommCodingData(EventsList.HMI_CODING_SYS_NAVI)
            if(0 == sysNaviCoding)
            {
                navi.enabled = false
                carplayCtrl.naiv_direction_Start();
            }
            else if(1 == sysNaviCoding)
            {
                navi.enabled = true
                carplayCtrl.naiv_direction_Stop();
                updateNaviMenuBar()
            }
            else
            {
                navi.enabled = true
                carplayCtrl.naiv_direction_Stop();
                updateNaviMenuBar()
            }
        }
    }
    Connections
    {
        target: carplayCtrl
        onCp_icon_display:
        {
            if(eventid == 1)
            {
                carplay.visible = true
            }
            else
            {
                carplay.visible = false
            }
        }
        onCp_navi_info_direction:
        {
            idirection = carplayCtrl.get_ctrl_direction()
            console.log("##QML Home MenuBAR##idirection "+idirection)
        }
    }
    //add by qwg 2019/1/23 start
    function updateNaviMenuBar()
    {
        switch(naviCtrl.getCarHeadingDirection())
        {
        case north:
            navi_txt.text = "N"
            break;
        case north_east:
            navi_txt.text = "NE"
            break;
        case east:
            navi_txt.text = "E"
            break;
        case south_east:
            navi_txt.text = "SE"
            break;
        case south:
            navi_txt.text = "S"
            break;
        case south_west:
            navi_txt.text = "SW"
            break;
        case west:
            navi_txt.text = "W"
            break;
        case north_west:
            navi_txt.text = "NW"
            break;
        default:
            navi_txt.text = "NW"
            break;
        }
    }
    Connections
    {
        target: naviCtrl
        onNavigetCarHeadingDirection:
        {
            updateNaviMenuBar()
        }
        //add by qwg 2019/1/23 end
    }
    //add by zhanglixin 2019/04/04 androidauto begin
    Connections
    {
        target: andrCtrl
        onAa_icon_display:
        {
            console.log("@ZLX**Home Menu Bar aa_icon_display status=**"+status)
            if(1 == status)
            {
                androidauto.visible = true
            }
            else
            {
                androidauto.visible = false
                console.log("\n\n@ZLX**Home Menu Bar aa_icon_display androidauto.visible=**"+androidauto.visible+"\n\n")
            }
        }
    }
    //add by zhanglixin 2019/04/04 androidauto end
}