summaryrefstree
path: root/usr/bin/qml/Carplay/Carplay.qml
blob: d2cb85b96c5c95fc4ccde6165c54e54455a1631e (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
import QtQuick 2.0
import "../com/neusoft/auto/widgets"
import "../eventsList.js" as EventsList
import "../layoutList.js" as Layout
import "../windowsList.js" as WindowsList
import "../USB/usb_define.js" as UsbStatusList

HMIWindow
{
    id:carplay_hmi
    property string bgImageStyle: systemCtrl.style
    property int mouseCPX:0
    property int mouseCPY:0
    property bool presse:false
    property bool completeFlag:false
    x:0
    y:0
    width:960
    height:960//540
    opacity:0
    Component.onCompleted:
    {
        windowID = WindowsList.CARPLAY_QML
    }
    onVisibleChanged:
    {     
        if(true == carplay_hmi.visible)
        {
            carplayCtrl.carplay_Ctrl_setQuickLinkHide()
            carplInitTimer.start()    //ADD 2019/09/20 FOR 349170
	    //DEL 2019/09/20 FOR 349170 begin
	    //systemCtrl.changWindowlayerState(Layout.VIDEO_LAYER,UsbStatusList.VIDEO_CARPLAY)
            systemCtrl.changWindowlayer(Layout.VIDEO_LAYER,Layout.LayerShow)//add ghy 2018/9/14
            systemCtrl.menuBarVisibleCtrl(false)//add by menghui for CarPlayMenuBa 2018/09/19r end
            ScreenManager.setFormOpacityOpen(WindowsList.CARPLAY_QML);
            ////ScreenManager.hideOverlay(WindowsList.QUICKLINK_DRAG)
            //ScreenManager.hideOverlay(WindowsList.FAVOURITE_LIST)//add by plc for #328217
	    //DEL 2019/09/20 FOR 349170 end
            if(completeFlag)
            {
                systemCtrl.setGestureShieldState(Layout.GESTURE_DISPLAY,Layout.POP_ALL_NOT_AVAILABLE)
            }
        }
        else
        {
        //	console.log("print system time onVisibleChanged",Qt.formatDateTime(new Date(),"yyyy-MM-dd hh:mm:ss.zzz"))
             //systemCtrl.changWindowlayer(Layout.VIDEO_LAYER,Layout.LayerHide)
            //systemCtrl.menuBarVisibleCtrl(true)//add by menghui for CarPlayMenuBar 2018/09/19 end
            ScreenManager.setFormOpacityClose(WindowsList.CARPLAY_QML);//modify by lium
            //ScreenManager.showOverlay(WindowsList.QUICKLINK_DRAG)
            if(completeFlag)
            {
                systemCtrl.setGestureShieldState(Layout.GESTURE_DISPLAY,Layout.POP_ALL_AVAILABLE)
            }
            else{
                completeFlag = true;
            }
        }
    }
    //ADD 2019/09/20 FOR 349170 begin
    Timer
    {
        id: carplInitTimer
        repeat: false
        interval: 3
        onTriggered:
        {
            systemCtrl.changWindowlayerState(Layout.VIDEO_LAYER,UsbStatusList.VIDEO_CARPLAY)
            //systemCtrl.changWindowlayer(Layout.VIDEO_LAYER,Layout.LayerShow)//add ghy 2018/9/14
            //systemCtrl.menuBarVisibleCtrl(false)//add by menghui for CarPlayMenuBa 2018/09/19r end
            //ScreenManager.setFormOpacityOpen(WindowsList.CARPLAY_QML);
            //ScreenManager.hideOverlay(WindowsList.QUICKLINK_DRAG)
            ScreenManager.hideOverlay(WindowsList.FAVOURITE_LIST)//add by plc for #328217
        }
    }
    //ADD 2019/09/20 FOR 349170 end
    Image
    {

        id:headerbg
        x:0
        y:-100
        width:960
        height:160
        source:"qrc:MATERIAL/MATERIAL_HEADER_BG"+bgImageStyle

    }
    Image
    {
        id:headelogo
        x:435
        y:-38
        width:90
        height:85
        source: "qrc:MATERIAL/MATERIAL_HEADE_ICON_LOGO"+bgImageStyle
    }
    HMIMouseArea
    {
    id:carplay_MouseArea
    x:0
    y:60
    width:960
    height:960
    bBeep:false
    onPressed:
    {
    console.log("#####carplay_bg pressed ",mouseX,mouseY,carplay_MouseArea.pressed)       
    presse = true
    carplayCtrl.cpMouseAreaEvent(mouseX,mouseY,1)
    }
    //add by lishibin for zuobiao guding pinlv
    /*
    onReleased:
    {
    console.log("@@@@@carplay_bg Released",mouseX,mouseY)
    carplayCtrl.cpMouseAreaEvent(mouseX,mouseY,0)
    }
    */
    onMouseXChanged:
    {
    mouseCPX = mouseX
    mouseCPY = mouseY
        if(mouseCPX>0 && mouseCPY>0 && mouseCPY<960)
        {
        console.log("XY_change in screen",mouseCPX,mouseCPY,true)
        presse = true
        carplayCtrl.cpMouseAreaEvent(mouseCPX,mouseCPY,1)
        }
        //if(mouseCPY >= 960)
        //{
        // console.log("XY_change out screen")
        // carplayCtrl.cpMouseAreaEvent(mouseCPX,mouseCPY,0)
        //}
        //else if((mouseY > 0) && (mouseY <= 20))
        //{
        // console.log("#####carplay_bg up taiqi ")
        // carplayCtrl.cpMouseAreaEvent(mouseX,mouseY,0)
        //}
        //else
        //{
        //    //do nothing
        //}
    }
    //add by zlx 2018/12/14 #314720 begin
    onMouseYChanged:
    {
        mouseCPX = mouseX
        mouseCPY = mouseY
        if(!(mouseCPX>0 && mouseCPY>0 && mouseCPY<960))
        {
            console.log("Y_change in screen",mouseCPX,mouseCPY,false)
            presse = false
            carplayCtrl.cpMouseAreaEvent(mouseCPX,mouseCPY,0)
        }
    }
    //add by zlx 2018/12/14 #314720 end
    onCanceled:
    {

    }
    onClicked:
    {

    }

    }
    Connections
    {
        target:carplayCtrl      
        onCarpalyModesChanged:
        {
           if(true == carplay_hmi.visible)
           {
           	if (presse == true)
                {
			presse = false
    			carplayCtrl.cpMouseAreaEvent(carplay_MouseArea.mouseX,carplay_MouseArea.mouseY,0)
                }
              console.log("\n onCarpalyModesChanged print system time",Qt.formatDateTime(new Date(),"yyyy-MM-dd hh:mm:ss.zzz"))
                ScreenManager.changeForm(Layout.ACT_CANCEL,WindowsList.CARPLAY_QML)
                //ScreenManager.setFormOpacityClose(WindowsList.CARPLAY_QML)//modify by lium
                systemCtrl.changWindowlayer(Layout.VIDEO_LAYER,Layout.LayerHide)
                MessageTransfer.click_m_menubar_cp(false)
                systemCtrl.menuBarVisibleCtrl(true)//add by menghui for CarPlayMenuBar 2018/09/19 end
                //ScreenManager.showOverlay(WindowsList.QUICKLINK_DRAG)
                console.log("windowID == WindowsList.CARPLAY_QML",windowID)
            }
        }
	//add by lishibin for zuobiao guding pinlv
        onCpCtrl_send_Timer:
        {
            if(mouseCPX>0 && mouseCPY>0 && mouseCPY<960)
            {
            console.log("zhouqi fa zuobiao ",mouseCPX,mouseCPY,true)
            if(presse == false)
            {
            	presse = true
            }
            carplayCtrl.cpMouseAreaEvent(mouseCPX,mouseCPY,1)
            }
        }

    }
    
    Connections
    {
        target: systemCtrl
        onTouchRelase:
        {
            if (true == carplay_hmi.visible)
            {
                console.log("carplay_hmi -------- onTouchRelase ----------")
                if (presse == true)
                {
                        console.log("@@@@@carplay_bg Released",carplay_MouseArea.mouseX,carplay_MouseArea.mouseY)
			presse = false
    			   carplayCtrl.cpMouseAreaEvent(carplay_MouseArea.mouseX,carplay_MouseArea.mouseY,0)
                }
            }
        }
    }
}