summaryrefstree
path: root/usr/bin/qml/Mirrorlink/Mirrorlink_Main.qml
blob: ef77d25ae4149d307bdbf9509b333e62b39fab26 (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
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
import QtQuick 2.0
import "../com/neusoft/auto/widgets"
import "../windowsList.js" as WindowsList
import "../layoutList.js" as Layout
import "mirrorlinkEvent.js" as MirrorEvent
import "../Setting/Settinglist.js" as Setting
import "../AC/AC.js" as AC
import Label 2.0

HMIWindow{	//add by lizhe for half->full
	id:mirrorlink_main

    property bool mirrorlinkClose: false	//add by lizhe for #157075
    //ADD F0155 2016/10/12 mengyufeng begin
    property bool flickMaskFlag: false
    //ADD By qu-shh for auto display off start
    property bool display_flag:false
    //ADD By qu-shh for auto display off end
	//modify by Jiyulong for #210943 start 2017/10/13
    property bool ipod_phoneLink_error:false
	//modify by Jiyulong for #210943 end
    Component.onCompleted:
    {
		//modify by Jiyulong for mh_restart start 2017/7/13
    	mirrorlinkCtrl.setPhonelinkExitFlag(false);
		//modify by Jiyulong for mh_restart end
        if(!systemCtrl.getWarningFlag())//ADD 2017/3/22 ld
        {
            mirrorlinkCtrl.startMirrorLinkApp();
            flickMaskTimerOut.start()
        }
        systemCtrl.setGestureShieldState(Layout.GESTURE_POP,Layout.POP_ALL_NOT_AVAILABLE)
        flickMaskFlag=true

        windowID=WindowsList.MIRRORLINK_MAIN; //add by lizhe for half->full
    }
    //ADD F0155 2016/10/12 mengyufeng end
    //add by lizhe for half->full start 
    Mirrorlink_Half{
        id: half_window
        x:120
        y:44
        visible: !mirrorlink_main.bMaxWindow && (mirrorlinkCtrl.phoneIsConnected ===1)&& mirrorlinkCtrl.phonelinkStart
    }

//    HMILabel{
//        width:700
//        height:30
//        font.pixelSize:28
//        anchors.horizontalCenter:mirrorlink_main.horizontalCenter
//        anchors.verticalCenter: mirrorlink_main.verticalCenter
//        text:  systemCtrl.iLanguage == 1?"请通过USB数据线或蓝牙连接车机和手机。":"Connect the Phone and Vehicle with USB cable and BT. "
//        visible: !mirrorlink_main.bMaxWindow && (mirrorlinkCtrl.phoneIsConnected ===0)&&mirrorlinkCtrl.phonelinkStart
//    }
    //add by lizhe for half->full end

    Mirrorlink_Instructions{
        id: halfInstruction
        x:0
        y:0
        visible: !mirrorlink_main.bMaxWindow && (mirrorlinkCtrl.phoneIsConnected ===0)&&mirrorlinkCtrl.phonelinkStart
        closeed:  mirrorlink_main.visible
    }

	HMILabel{
		id:loading_label
        //changed by lizhe for half->full start
        x:390
         //#162385  start
        y:bMaxWindow?312:156
        //changed by lizhe for half->full end
        font.pixelSize:30
        width:180
        height:50	//naca #146081
         //#162385 end
		text:systemCtrl.iLanguage == 1?qsTr("加载中..."):qsTr("Loading…")
		color: "white"
		clip:true
        //changed by lizhe
        visible:mirrorlinkCtrl.getPhonelinkStatus() ===1?false:true
        //changed by lizhe
	}

    HMILoading
    {
        id:powerloadTimer
        //changed by lizhe for half->full start
        x:450
        y:bMaxWindow?451:225  //#162385
        //changed by lizhe for half->full end
		visible: (1===mirrorlinkCtrl.getPhonelinkStatus() )?false:true
    }
    
    //add by lizhe for half->full start
    onMaxWindow: {
        if(mirrorlink_main.bMaxWindow && mirrorlinkCtrl.phonelinkStart) //changed by lizhe #150221
        {
            bButtonBarVisiable = false; //naca 151622
            if (!half_window.intoApp){
                mirrorlinkCtrl.sendMessageToPhonelink(66,0);
            }
            mirrorlinkCtrl.sendMessageToPhonelink(51,1)
        }
    }
    //add by lizhe naca 151229 begin
    onMinWindow: {
        //changed by lizhe for #157075 begin
        bButtonBarVisiable = true;        
        half_window.intoApp = false;
        mirrorlinkCtrl.setPhonelinkNaviStatus(0)//ADD 2017/4/25 ld
        if(!mirrorlinkClose)
        {
            ScreenManager.changeForm(Layout.FM_OPACITY_END,WindowsList.MIRRORLINK_MAIN)
            waitTime.start();
        }
        //changed by lizhe for #157075 end
        
    }
     //add by lizhe naca 151229 end
    //add by lizhe for half->full end
	onVisibleChanged:
	{
        //add by lizhe for half->full start
        bFullWindow = false;
        bMainWindow = false;
        //add by lizhe for half->full end
		if(mirrorlink_main.visible==true)
		{
			//modify by Jiyulong for mh_restart start 2017/7/13
		    if( true == mirrorlinkCtrl.getPhonelinkExitFlag())
	        {
                loading_label.visible = true;
                powerloadTimer.visible = true;
                mirrorlinkCtrl.setPhonelinkExitFlag(false);
                if(!systemCtrl.getWarningFlag())//ADD 2017/3/22 ld
		        {
		            mirrorlinkCtrl.startMirrorLinkApp();
		            flickMaskTimerOut.start()
		        }
		        systemCtrl.setGestureShieldState(Layout.GESTURE_POP,Layout.POP_ALL_NOT_AVAILABLE)
		        flickMaskFlag=true
	        }
			//modify by Jiyulong for mh_restart end
            mirrorlinkClose = false;	//add by lizhe for #157075
            //add by lizhe for half->full start
            bNoSwitchBarVisiable = true
            //mirrorlink_main.opacity=0
            half_window.intoApp = false;
            //add by lizhe for half->full end
			console.log("***********************************mirrorlink_main visible true***********************************")
            mirrorlinkCtrl.setAppCommonMediaInfo();
            if((!systemCtrl.getWarningFlag())&&(mirrorlinkCtrl.phonelinkStart)  )	//add by lizhe for half->full
            {
                if(mirrorlink_main.bMaxWindow )
                {
                    ScreenManager.changeForm(Layout.FM_OPACITY_START,WindowsList.MIRRORLINK_MAIN)
                    //change by lizhe  naca #130957
                    waitTime.start();
                    //change by lizhe  naca #130957
                    mirrorlinkCtrl.sendMessageToPhonelink(51,1)
                }
                else
                {
                    mirrorlinkCtrl.sendMessageToPhonelink(51,2)
                }
			}
            mirrorlinkCtrl.setPhonelinkNaviStatus(0)//ADD 2017/4/25 ld
            //naviCtrl.setNaviPhonelinkStatus(1); //ADD naviphonelink xbw 20170111 end
            //modify by Jiyulong for #210943 start 2017/10/13
			if ( true == ipod_phoneLink_error || true == ipodCtrl.ipod_getScanErrorFlag())
            {
                if( popDelayTimer.running == true)
                {
                    popDelayTimer.restart()
                }
                else
                {
                    popDelayTimer.start()
                }
            }
			//modify by Jiyulong for #210943 end
		}
        else if((mirrorlink_main.visible==false)&&(mirrorlinkCtrl.phonelinkStart) )
		{
            console.log("***********************************mirrorlink_main visible false***********************************");
            //chang by lizhe naca #137683
			waitTime.start();
            //chang by lizhe naca #137683
            ScreenManager.changeForm(Layout.FM_OPACITY_END,WindowsList.MIRRORLINK_MAIN)
//ADD By qu-shh for auto display off start
            if(display_flag)
            {
                systemCtrl.auto_Displayoff_Unshield()
                display_flag = false
            }
//ADD By qu-shh for auto display off end
		}
	}
	
	function reqphonelinkShow()
	{
        ScreenManager.changeForm(Layout.FM_OPACITY_START,WindowsList.MIRRORLINK_MAIN); //add by lizhe for #157075 
        //console.log("***************reqphonelinkShow******1******")
		if(mirrorlinkCtrl.phonelinkStart)
		{
			if(mirrorlinkCtrl.getLinkUpdateStatus())
			{
                //console.log("***************reqphonelinkShow******2******")
				systemCtrl.changWindowlayer(Layout.PHONEUPGRADE_LAYER,Layout.LayerShow)
			}
			else
			{
                //console.log("***************reqphonelinkShow******3******")
				systemCtrl.changWindowlayer(Layout.PHONELINK_LAYER,Layout.LayerShow)
			}
            if(mirrorlinkCtrl.getPhonelinkNaviStatus() && (ScreenManager.getFormInfo(WindowsList.MIRRORLINK_MAIN)&7) !=4)//fod 2017/4/18 ld
			{
                //console.log("***************reqphonelinkShow******4******")
				systemCtrl.changWindowlayer(Layout.PHONELINKNAVI_Layer,Layout.LayerShow)
			}
            mirrorlinkCtrl.sendMessageToPhonelink(51,1);
		}
	}
	
	function reqLinkLowerShow()
	{
        //changed by lizhe 20161221
		if(mirrorlinkCtrl.getPhonelinkNaviStatus()){
            systemCtrl.changWindowlayer(Layout.PHONELINKNAVI_Layer,Layout.LayerLowerShow);
        }
        if(mirrorlinkCtrl.getLinkUpdateStatus()){
            systemCtrl.changWindowlayer(Layout.PHONEUPGRADE_LAYER,Layout.LayerLowerShow);
        }
		systemCtrl.changWindowlayer(Layout.PHONELINK_LAYER,Layout.LayerLowerShow);

         //changed by lizhe 20161221
	}
	//change by lizhe  naca #130957
	Timer{
		id : waitTime
		interval: 10
		onTriggered: {
            if (mirrorlink_main.visible==true &&mirrorlink_main.bMaxWindow) //add by lizhe for #157075
			{
                    //changed by lizhe naca #146648
                    if (checkStaus()){
                        reqphonelinkShow  ();
                    }
                    else
                    {
                        reqLinkLowerShow();
                    }
                //changed by lizhe naca #146648 end
            }
            //add by lizhe for #157075 begin
            else if (mirrorlink_main.visible==true &&!mirrorlink_main.bMaxWindow)
            {
                //ScreenManager.changeForm(Layout.FM_OPACITY_END,WindowsList.MIRRORLINK_MAIN)
                systemCtrl.changWindowlayer(Layout.PHONEUPGRADE_LAYER,Layout.LayerHide);
                systemCtrl.changWindowlayer(Layout.PHONELINK_LAYER,Layout.LayerHide);
                systemCtrl.changWindowlayer(Layout.PHONELINKNAVI_Layer,Layout.LayerHide);
                //mirrorlinkCtrl.sendMessageToPhonelink(51,0);
                mirrorlinkCtrl.sendMessageToPhonelink(51,2)
            }
            //add by lizhe for #157075 end
            //chang by lizhe naca #137683
            else
            {
                //ScreenManager.changeForm(Layout.FM_OPACITY_END,WindowsList.MIRRORLINK_MAIN)
                systemCtrl.changWindowlayer(Layout.PHONEUPGRADE_LAYER,Layout.LayerHide)
                systemCtrl.changWindowlayer(Layout.PHONELINK_LAYER,Layout.LayerHide)
                systemCtrl.changWindowlayer(Layout.PHONELINKNAVI_Layer,Layout.LayerHide)
				//add by  lizhe 20161223
                mirrorlinkCtrl.sendMessageToPhonelink(51,0)
            }
            //chang by lizhe naca #137683
        }
    }
	//change by lizhe  naca #130957
	Timer{
		id : sleepTime
		interval: 1000
		onTriggered: {

			loading_label.visible = false
            powerloadTimer.visible=false; //add by  lizhe naca  #146092
            if (mirrorlink_main.visible==true && !systemCtrl.getWarningFlag())  //add by  lizhe naca  #146092
			{
				console.log("*****************onPhonelinkStatusChanged========2==")
                if(mirrorlink_main.bMaxWindow)  //changed by #157410
                {
                    //console.log("*****************onPhonelinkStatusChanged========3==")
                    mirrorlink_main.opacity = 0
                    //systemCtrl.changeApp(Layout.HMI_APP_PHONELINK) //changed by #157410
                    //ScreenManager.changeForm(Layout.FM_OPACITY_START,WindowsList.MIRRORLINK_MAIN)
                    waitTime.start();
                    mirrorlinkCtrl.sendMessageToPhonelink(51,1)
                }
                else
                {
                    mirrorlinkCtrl.sendMessageToPhonelink(51,2)
                }
            }
            else
            {
				
            }
        }
    }
    //fod 2017/4/18 ld begin
    Timer{
        id : backHome
        interval: 50
        onTriggered: {
            mirrorlinkCtrl.sendMessageToPhonelink(51,0);
        }
    }
    Timer{
        id : flickMaskTimerOut
        interval: 10000
        onTriggered: {
            //console.log("mirrorlink flickMaskTimerOut")
            if(flickMaskFlag==true){
                systemCtrl.setGestureShieldState(Layout.GESTURE_POP,Layout.POP_ALL_AVAILABLE)
                flickMaskFlag=false
                //console.log("mirrorlink flickMaskTimerOut over")
            }
        }
    }
    //fod 2017/4/18 ld end
	Connections
    {
        target: systemCtrl
		onWarningFlagChange:
		{
			console.log("***********************************mirrorlink_main onWarningFlagChange**********************************")
            if((!systemCtrl.getWarningFlag())
                    && mirrorlink_main.visible==true
                    && mirrorlinkCtrl.phonelinkStart)
			{
                if(mirrorlink_main.bMaxWindow)
                {
                    reqphonelinkShow()
                    ScreenManager.changeForm(Layout.FM_OPACITY_START,WindowsList.MIRRORLINK_MAIN)
                    mirrorlinkCtrl.sendMessageToPhonelink(51,1);
                }
			}
		}
	}
	Connections
    {
        target: mirrorlinkCtrl
		onPhonelinkMessageSend:
		{
            //changed by lizhe for half->full start
            console.log("~~~~~~~~~~~type~~~~~~~~~~",type);
            console.log("~~~~~~~~~~~value~~~~~~~~~~",value);
//ADD By qu-shh for auto display off start
            if((type == MirrorEvent.MSG_TYPE_LINK_NAVI_SHOW_FOREGROUND) || ((type == MirrorEvent.MSG_TYPE_LINK_MAP_STATUS) && (value == 1)))
            {
                if(!display_flag)
                {
                    systemCtrl.auto_Displayoff_Shield()
                    display_flag = true
                }
            }
            else
            {
                if(display_flag)
                {
                    systemCtrl.auto_Displayoff_Unshield()
                    display_flag = false
                }
            }
//ADD By qu-shh for auto display off end
            switch(type)
            {
                case  MirrorEvent.MSG_TYPE_LINK_STATUS:
                    if (value == 0){
                        mirrorlinkClose = true; //add by lizhe for #157075
                        ScreenManager.changeForm(Layout.FM_CLOSE,WindowsList.MIRRORLINK_MAIN);
                    }
                    break;
               case  MirrorEvent.MSG_TYPE_LINK_RUN_STATUS:
                   if (value == 0){
                       loading_label.visible = true;
                       powerloadTimer.visible=true;
                   }
                   else if (value == 1){
                       settingCtrl.setBackgroundForMirrorlink()//ADD #167353 baojinfeng 2017/05/31 begin
                       loading_label.visible = false;
                       powerloadTimer.visible=false;
                    //naviCtrl.setNaviPhonelinkStatus(1); //ADD naviphonelink xbw 20170111 end
                       if(flickMaskFlag==true){
                           //console.log("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ mirrorlinkCtrl setGestureShieldState")
                           systemCtrl.setGestureShieldState(Layout.GESTURE_POP,Layout.POP_ALL_AVAILABLE)
                           flickMaskFlag=false
                       }
                   }
                   else{
                       //do nothing
                   }
                   break;
                case  MirrorEvent.MSG_TYPE_LINK_MAP_STATUS:
                    if(mirrorlinkCtrl.getPhonelinkNaviStatus() &&(ScreenManager.getFormInfo(WindowsList.MIRRORLINK_MAIN)&7) !=4)//fod 2017/4/48 ld
                    {
                        if (checkStaus())
                        {
                        systemCtrl.changWindowlayer(Layout.PHONELINKNAVI_Layer,Layout.LayerShow);
                        }
                        else
                        {
                        systemCtrl.changWindowlayer(Layout.PHONELINKNAVI_Layer,Layout.LayerLowerShow);
                        }
                    }
		    
                    break;
		case  MirrorEvent.MSG_TYPE_LINK_CONNECT_STATUS:
                    if (value == 0)
                    {
						if ( Layout.HMI_SRC_APPLINK ==systemCtrl.getCurrentSource() || Layout.HMI_SRC_MIRROLINK_VIDEO ==systemCtrl.getCurrentSource())
						{
						//MODIFY By qu-shh for add linkdummy source  start
							systemCtrl.reqSource(Layout.HMI_SRC_LINK_DUMMY,Layout.HMI_SRC_START,Layout.HMI_SRC_Front);
						//MODIFY By qu-shh for add linkdummy source  end
						}
                    }
		    break;
                //add by lizhe for navi mutex start
            case MirrorEvent.MSG_TYPE_LINK_NAVI_SHOW_FOREGROUND:
                naviCtrl.setNaviPhonelinkStatus(1);
                break;
                //add by lizhe for navi mutex end
            default:
                break;

            }
            //changed by lizhe for half->full end
		}
		onPhonelinkStatusChanged:
		{
			console.log("*****************onPhonelinkStatusChanged========mirrorlinkCtrl.phonelinkStart=="+mirrorlinkCtrl.phonelinkStart)
			if(mirrorlinkCtrl.phonelinkStart)
			{
				//if(mirrorlink_main.visible==true)	delete by lizhe naca  148853
				//{
					console.log("*****************onPhonelinkStatusChanged========1==")
                    //if(!systemCtrl.getWarningFlag())  delete by  lizhe naca  #146092
                    //{
						sleepTime.start();
                    //}
				//}
			}
		}
	//add by lizhe for half->full start 
        onSigPhonelinkHafChanged:
        {                
            if(bMaxWindow) //naca 151622
            {
                //changed by lizhe for #157075 begin
                ScreenManager.changeForm(Layout.FM_MINIMUM,windowID);
                bButtonBarVisiable = true; //naca 151622
                //changed by lizhe for #157075 end
            }
        }
//        onSigFingerLeft:
//        {
//            if(mirrorlink_main.bMaxWindow)
//            {
//                //console.log("@@@@@@@@@@@@@@onSingleFingerGestureSignals_Left@@@@@@@@@@@@@@@@@@")
//                //mirrorlinkCtrl.sendMessageToPhonelink(51,0)
//                systemCtrl.changWindowlayer(Layout.PHONEUPGRADE_LAYER,Layout.LayerLowerShow)
//                systemCtrl.changWindowlayer(Layout.PHONELINK_LAYER,Layout.LayerLowerShow)
//                systemCtrl.changWindowlayer(Layout.PHONELINKNAVI_Layer,Layout.LayerLowerShow)
//            }
//        }
//        onSigFingerRight:
//        {
//            if(mirrorlink_main.bMaxWindow)
//            {
//                //console.log("@@@@@@@@@@@@@@onSingleFingerGestureSignals_Right@@@@@@@@@@@@@@@@@@");
//                //mirrorlinkCtrl.sendMessageToPhonelink(51,0)
//                systemCtrl.changWindowlayer(Layout.PHONELINKNAVI_Layer,Layout.LayerLowerShow)
//                systemCtrl.changWindowlayer(Layout.PHONEUPGRADE_LAYER,Layout.LayerLowerShow)
//                systemCtrl.changWindowlayer(Layout.PHONELINK_LAYER,Layout.LayerLowerShow)
//            }
//        }
		//modify by Jiyulong for mh_restart start 2017/7/13
        onPhoneLink_ScreenExit:
        {
	//		console.log("----------   onPhoneLink_ScreenExit  -----------------  =",WindowsList.MIRRORLINK_MAIN);
			if( true == mirrorlink_main.bMaxWindow)
			{
			//	mirrorlinkClose = true;
				ScreenManager.changeForm(Layout.FM_CLOSE,WindowsList.MIRRORLINK_MAIN);
			//	systemCtrl.homelineclose(); 
			}
			else
			{
				ScreenManager.changeForm(Layout.FM_CLOSE,WindowsList.MIRRORLINK_MAIN);
	            systemCtrl.homelineclose();     
			}
   
        }
		//modify by Jiyulong for mh_restart end
        
	}
	//add by lizhe for half->full end 

	Connections
    {
        target:ScreenManager
        onFormchange:{
            //changed by lizhe for half->full start
            console.log("------------------------------overlay----------------------------",formType);
            console.log("------------------------------overlay&7----------------------------",(ScreenManager.getFormInfo(WindowsList.MIRRORLINK_MAIN)&7));
            if (((ScreenManager.getFormInfo(WindowsList.MIRRORLINK_MAIN) &8) == 8)&&
                    ((ScreenManager.getFormInfo(WindowsList.MIRRORLINK_MAIN) &7) != 0)&&
                    ((ScreenManager.getFormInfo(WindowsList.MIRRORLINK_MAIN) &7) != 4))
            {
                console.log ("------phonelink layer need show--------------------");
                if(mirrorlink_main.visible)
                {
                     if (formType === Layout.overlayerShow)//有POPUP显示
                     {
                         if (!checkStaus()){
                             console.log("------------overlay show, MirrorLink layer lower show--------------");
                             reqLinkLowerShow()
                         }
                     }
                     else
                     {
                        if (checkStaus())//check是否还有其他popup
                        {
                            if((!systemCtrl.getWarningFlag()) && (mirrorlinkCtrl.phonelinkStart) ) //changed by lizhe for #157075 
                            {
                                //change by lizhe  naca #130957
                                waitTime.stop();
                                waitTime.start();
                                //change by lizhe  naca #130957
                            }
                        }
                        //changed by lizhe #naca ST_Bug #137531
                        else
                        {
                           waitTime.stop();
                        }
                    }
                }
             }
            else
            {
                //add by lizhe naca 151229 begin
                if( (ScreenManager.getFormInfo(WindowsList.MIRRORLINK_MAIN) &7) === 0
                        || (ScreenManager.getFormInfo(WindowsList.MIRRORLINK_MAIN) &7) === 4)
                {
                    if(mirrorlink_main.visible && mirrorlink_main.bMaxWindow)
                    {
                        waitTime.stop();
			//fod 2017/4/18 ld begin
                        systemCtrl.changWindowlayer(Layout.PHONEUPGRADE_LAYER,Layout.LayerHide)
                        systemCtrl.changWindowlayer(Layout.PHONELINK_LAYER,Layout.LayerHide)
                        systemCtrl.changWindowlayer(Layout.PHONELINKNAVI_Layer,Layout.LayerHide)
                        backHome.restart()
                        //mirrorlinkCtrl.sendMessageToPhonelink(51,0);
			//fod 2017/4/18 ld end
                    }
                }
                //add by lizhe naca 151229 end
            }
         }
        //changed by lizhe for half->full end
    }
    Connections
    {
        target:  systemCtrl
        onPowerNotice :{
            console.log("----MirrorLink--------onPowerNotice--------",status);
            if (MirrorEvent.checkMaxWindow())	//changed by lizhe for half->full
            {
                if(status ===0 || status===2)
                {
                    console.log("---MirrorLink------power-off----");
                    reqLinkLowerShow()
                }
                else if (status ===1 || status === 3)
                {
                    console.log("---mirrorlink_main.qml------power-on-------");
                    if (checkStaus())
                    {
						reqphonelinkShow()
                    }
                }
                else
                {
                    console.log ("---mirrorlink_main.qml------status---error--------");
                }
            }
        }
	//ADD 2017/3/22 ld
        onWarningFlagChange:
        {
            if(mirrorlink_main.visible)
            {
                mirrorlinkCtrl.startMirrorLinkApp();
                flickMaskTimerOut.start()
            }
        }
	//ADD 2017/3/22 ld


    }
    Connections
    {
        target: acCtrl
		/*****倒车***************/
        onCvbsStatusOn:{
            console.log("------mirrorlink_main.qml-----DaoChe----on----------");
            if (MirrorEvent.checkMaxWindow() )	//changed by lizhe for half->full
            {
				reqLinkLowerShow()
            }
        }
        onCvbsStatusOff:{
            console.log("------mirrorlink_main.qml-----DaoChe----off----------");
            if (MirrorEvent.checkMaxWindow() && (ScreenManager.getFormInfo(WindowsList.MIRRORLINK_MAIN) &7) === 2)	//changed by lizhe for half->full
			{
                if (checkStaus())
                {
					reqphonelinkShow()
                }
			}            
        }
		/*********空调*****BODY B************/
		onShowAdjustment:{
			console.log("----------ShowAdjustment-----------mirrorlink_main.qml----------");
            if (MirrorEvent.checkMaxWindow())	//changed by lizhe for half->full
            {
				reqLinkLowerShow()
            }
		}
		onHideAdjustment:{
			console.log("----------onHideAdjustment-----------mirrorlink_main.qml----------");
            if (MirrorEvent.checkMaxWindow()  &&(ScreenManager.getFormInfo(WindowsList.MIRRORLINK_MAIN) &7) === 2)	//changed by lizhe for half->full
			{
                if (checkStaus())
                {
					reqphonelinkShow()
                }
			}   
		}
		/*********空调*****乘客温度区域************/
		onShowPassengerTemp:{
            console.log("----------ShowPassengerTemp-----------mirrorlink_main.qml----------");
            if (MirrorEvent.checkMaxWindow())	//changed by lizhe for half->full
            {
				reqLinkLowerShow()
            }
		}
		onHidePassengerTemp:{
			console.log("----------HidePassengerTemp-----------mirrorlink_main.qml----------");
            if (MirrorEvent.checkMaxWindow() &&(ScreenManager.getFormInfo(WindowsList.MIRRORLINK_MAIN) &7) === 2)	//changed by lizhe for half->full
			{
                if (checkStaus())
                {
					reqphonelinkShow()
                }
			}   
		}
		/*********空调*****驾驶员温度************/
		onShowDriverTemp:{
            console.log("----------ShowDriverTemp-----------mirrorlink_main.qml----------");
            if (MirrorEvent.checkMaxWindow())	//changed by lizhe for half->full
            {
				reqLinkLowerShow()
            }
		}
		onHideDriverTemp:{
			console.log("----------HideDriverTemp-----------mirrorlink_main.qml----------");
            if (MirrorEvent.checkMaxWindow() &&(ScreenManager.getFormInfo(WindowsList.MIRRORLINK_MAIN) &7) === 2)	//changed by lizhe for half->full
			{
                if (checkStaus())
                {
					reqphonelinkShow()
                }
			}   
		}
		// add by lizhe
		onShowDriverSeat:{
			console.log("----------showDriverSeat-----------mirrorlink_main.qml----------");
            if (MirrorEvent.checkMaxWindow()) 	//changed by lizhe for half->full
            {
				reqLinkLowerShow()
            }
		}
		onHideDriverSeat:{
			console.log("----------hideDriverSeat-----------mirrorlink_main.qml----------");
            if (MirrorEvent.checkMaxWindow() &&(ScreenManager.getFormInfo(WindowsList.MIRRORLINK_MAIN) &7) === 2) //changed by lizhe for half->full
			{
                if (checkStaus())
                {
					reqphonelinkShow()
                }
			}   
		}
		onShowPassengerSeat:{
			console.log("----------showPassengerSeat-----------mirrorlink_main.qml----------");
            if (MirrorEvent.checkMaxWindow())
            {
				reqLinkLowerShow()
            }
		}
		onHidePassengerSeat:{
			console.log("----------hidePassengerSeat-----------mirrorlink_main.qml----------");
            if (MirrorEvent.checkMaxWindow() &&(ScreenManager.getFormInfo(WindowsList.MIRRORLINK_MAIN) &7) === 2) //changed by lizhe for half->full
			{
                if (checkStaus())
                {
					reqphonelinkShow()
                }
			}   
		}	
		// add by lizhe	
    }
    Connections
    {
        target: settingCtrl
        onTellQuickLinkShow:{
            console.log("----------TellQuickLinkShow-----------mirrorlink_main.qml----------");
             if (MirrorEvent.checkMaxWindow())  //changed by lizhe for half->full
             {
				reqLinkLowerShow()
             }
        }
        onTellQuickLinkHide:{
            console.log("----------TellQuickLinkHide-----------mirrorlink_main.qml----------");
            //changed by lizhe for half->full start
            if (MirrorEvent.checkMaxWindow())
            {
                if (checkStaus())
                {
                    console.log("-------------------------------------------------------",ScreenManager.getFormInfo(WindowsList.MIRRORLINK_MAIN) &7);
                    if((ScreenManager.getFormInfo(WindowsList.MIRRORLINK_MAIN) &7) === 2 )
                    {
                         reqphonelinkShow();
                    }
                }
            }
            //changed by lizhe for half->full end
        }
    }
	//modify by Jiyulong for #210943 start 2017/10/13
    Connections
    {
        target: ipodCtrl
        onIpod_scan_isError:
        {
            ipod_phoneLink_error = true
            if(true == mirrorlink_main.visible)
            {
                ScreenManager.showOverlay(WindowsList.MIRRORLINK_STATEERROR)
            }
        }
        onIpod_disconnect:
        {
            ipod_phoneLink_error = false
            popDelayTimer.stop()
            if(true == ScreenManager.isOverlayShowed(WindowsList.MIRRORLINK_STATEERROR) )
            {
                ScreenManager.hideOverlay(WindowsList.MIRRORLINK_STATEERROR)
            }
        }
    }
	//modify by Jiyulong for #210943 end
    function checkStaus()
    {
            var status = false;
    	/*
        console.log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~",acCtrl.iCVBSStatus === AC.HMI_CVBS_OFF);
        console.log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~",systemCtrl.getPowerStatus()===Layout.POWER_ON);
        console.log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~",acCtrl.getAdjustmentPageStatus() === AC.AC_BODYB_PAGE_HIDE);
        console.log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~",acCtrl.getDriverTempPageStatus() === AC.AC_BODYB_PAGE_HIDE);
        console.log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~",acCtrl.getPassengerTempPageStatus() === AC.AC_BODYB_PAGE_HIDE);
        console.log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~",!ScreenManager.checkHighOverlay(WindowsList.MIRRORLINK_MAIN));
        console.log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~",settingCtrl.getQuickLinkShowState() === Setting.QUICK_LINK_HIDE);
        console.log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~",!vrCtrl.vrGetVisibleStatus());
        console.log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~",acCtrl.getDriverSeatPageStatus() === AC.AC_BODYB_PAGE_HIDE);
        console.log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~",acCtrl.getPassengerSeatPageStatus() === AC.AC_BODYB_PAGE_HIDE);
        console.log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~",ScreenManager.getFormInfo(WindowsList.MIRRORLINK_MAIN) &7);
	*/
        //changed by lizhe #naca ST_Bug #137531
            if (acCtrl.iCVBSStatus === AC.HMI_CVBS_OFF
                   && systemCtrl.getPowerStatus()===Layout.POWER_ON
                    && acCtrl.getAdjustmentPageStatus() === AC.AC_BODYB_PAGE_HIDE
                    && acCtrl.getDriverTempPageStatus() === AC.AC_BODYB_PAGE_HIDE
                    && acCtrl.getPassengerTempPageStatus() === AC.AC_BODYB_PAGE_HIDE
                    //&&!ScreenManager.checkHighOverlay(WindowsList.MIRRORLINK_MAIN)//for PC link
                     && settingCtrl.getQuickLinkShowState() === Setting.QUICK_LINK_HIDE
					 /*&& !vrCtrl.vrGetVisibleStatus()*/
					 && acCtrl.getDriverSeatPageStatus() === AC.AC_BODYB_PAGE_HIDE
                     && acCtrl.getPassengerSeatPageStatus() === AC.AC_BODYB_PAGE_HIDE
                    && (ScreenManager.getFormInfo(WindowsList.MIRRORLINK_MAIN) &7) !== 0
                    && (ScreenManager.getFormInfo(WindowsList.MIRRORLINK_MAIN) &7) !== 4)//del by yx

            {
                status = true;
                return status;
            }
            return status;
    }
	//modify by Jiyulong for #210943 start 2017/10/13
    Timer
    {
        id:popDelayTimer
        interval: 3000
        running: false
        repeat: false
        onTriggered:
        {
            ScreenManager.showOverlay(WindowsList.MIRRORLINK_STATEERROR)
        }
    }
	//modify by Jiyulong for #210943 end
}