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
|
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 Label 2.0
HMIWindow{
id:main_window
property bool isLongPress : false
property bool needReflesh : false
property bool speechIndex : false
property int pyeventx: 15
Component.onCompleted:
{
windowID = WindowsList.CARLINK_DIALOGBOX
}
onVisibleChanged:
{
bMainWindow = false
bFullWindow = true
if(main_window.visible ===true){
console.log("---------dialogbox----visible--------")
user_input.focus = false;
user_input.text="";
//keyBoard.opacity = 0;
}
else if(main_window.visible ===false)
{
if(speechIndex===true)
{
console.log("visible is false ,speech_stop ---------------->")
speechIndex=false
carlinkCtrl.stopSpeech()
car_vrTimer.stop()
speech_tanchu.visible=false
}
}
}
HMILabel {
id : text_title
x : 51 -pyeventx
y : 148-131
height : 28
width : 250
font.pixelSize:26
horizontalAlignment: Label.AlignLeft
text : carlinkCtrl.currentDialogName
}
HMIButton{
id:back
x:689-pyeventx
y:151-131
width:31
height:21
btnImg:back.pressed?"qrc:MATERIAL/MATERIAL_M8X_ICON_BACK_P"+bgImageStyle
:"qrc:MATERIAL/MATERIAL_M8X_ICON_BACK"+bgImageStyle
onClicked: {
//ScreenManager.changeForm(Layout.FM_CLOSE,windowID)
carlinkCtrl.setCurrentDialogId("ChatInteraction");
carlinkCtrl.cleanMsgListOfUserId();
ScreenManager.changeForm(Layout.FM_OPEN,WindowsList.CARLINK_CHATINTERACTION)
console.log("dialog back setCurrentUseId ChatInteraction---------->>>");
}
}
Item{
id:input_frame
x:34-pyeventx
y:197-131
width: 524
height: 48
Image {
id: input_bk
x: 0
y: 0
source:user_input.focus ? "qrc:MATERIAL/MATERIAL_M8X_INPUT-BOX_524_C"+bgImageStyle
: "qrc:MATERIAL/MATERIAL_M8X_INPUT-BOX_524"+bgImageStyle
HMILabel {
id: input_title
x:35
y:13
width: 250
height: 23
color:"gray"
text:qsTr("Please input info")+systemCtrl.emptyString
font.pixelSize: 23
visible:user_input.focus||user_input.text.length>0?false:true
}
HMIInputText {
id: user_input
x:5
y:10
height: 48
width: 500
focus: false
horizontalAlignment: Label.AlignLeft
color: "white"
text:""
font.pixelSize: 24
clip:true
//autoScroll: false
cursorVisible:user_input.focus?true:false
onCursorPositionChanged: {
if(user_input.text.length>0)
{
keyBoard.deleteEnable=true
}
else
{
keyBoard.deleteEnable=false
}
}
onContentWidthChanged: {
if (user_input.text.length > 200)
{
user_input.text = user_input.text.substring(0, user_input.text.length - 1);
}
}
MouseArea
{
anchors.fill: parent
onClicked: {
user_input.focus = true
if(keyBoard.opacity ===1){
keyBoard.opacity = 0
}
else{
keyBoard.opacity = 1
}
if(keyBoard.enabled ===false){
keyBoard.enabled = true;
}
else{
keyBoard.enabled = false;
}
if(user_input.text.length > 0)
{
keyBoard.deleteEnable=true
}
else
{
keyBoard.deleteEnable=false
}
systemCtrl.setTextInputHandle(user_input)
}
}
}
}
}
Component{
id:model_delegate
Item{
id : everyone
height: (model.modelData.Msg_Type==="1")?msg_background.height+25+45:
(model.modelData.Msg_Type==="2")?msg_background.height+25+45:
(model.modelData.Msg_Type==="3")?msg_background.height+25+45:
""
//height: 150
width:700
HMILabel{
id : msg_time
x:269-34
y:19
height: 25
width :230
font.pixelSize:25
horizontalAlignment: Label.AlignHCenter
text:model.modelData.Msg_Date
visible:model.modelData.Displaytime==="1"?true:false
}
Image{
id : send_status
x:264-34-34
y:318-253
source: model.modelData.SendStatus ==="1"?"qrc:MATERIAL/MATERIAL_M8X_ICON_SENDING"+bgImageStyle
:(model.modelData.SendStatus ==="2"?"qrc:MATERIAL/MATERIAL_M8X_ICON_SMS-FALLURE"+bgImageStyle:"")
visible:model.modelData.SendStatus ==="0"?false:true
//source: "qrc:MATERIAL/MATERIAL_M8X_ICON_SMS-FALLURE"+bgImageStyle
}
Image{
id : msg_background
x:model.modelData.SndOrRcv==="1"?0:
(model.modelData.Msg_Type==="3")?400:((model.modelData.Msg_Type==="2")?264-34:264-34)
y:318-253
//width: 470
width: (model.modelData.Msg_Type==="1")?470:
((model.modelData.Msg_Type==="3")?300:470)//((model.modelData.Msg_Type==="2")?380:470)
height: (model.modelData.Msg_Type==="1")?msg_content.height:
((model.modelData.Msg_Type==="3")?145:msg_content.height)
source: model.modelData.SndOrRcv==="1"?"qrc:MATERIAL/MATERIAL_M8X_DIALOG-BOX_W470_H62"+bgImageStyle
: "qrc:MATERIAL/MATERIAL_M8X_DIALOG-BOX_W470_H62_P"+bgImageStyle
Image{
id:touxiang
x:model.modelData.SndOrRcv==="1"?9:((model.modelData.Msg_Type==="3")?245:415)//((model.modelData.Msg_Type==="2")?245:415)
y:8
sourceSize.height:46
sourceSize.width:46
source: model.modelData.SndOrRcv==="1"?model.modelData.Icon_Path:"qrc:MATERIAL/MATERIAL_M8X_DEFAULT_AVATAR"+bgImageStyle
}
Text{
id : msg_content
x:model.modelData.SndOrRcv==="1"?(99-34):(316-264)
y:340-318-8
width :348
font.pixelSize:20
horizontalAlignment: Label.AlignLeft
verticalAlignment :Label.AlignTop
wrapMode: Label.Wrap
text:model.modelData.Msg_Content
visible: model.modelData.Msg_Type==="1"? true : false
color:"white"
font.family: "方正兰亭黑简体"
height:msg_content.lineCount*20+42
}
Image{
id : msg_speech
x:model.modelData.SndOrRcv==="1"?60:model.modelData.Msg_Content<=5?(415-40):
model.modelData.Msg_Content<=10?(380-40):
model.modelData.Msg_Content<=15?(345-40):
model.modelData.Msg_Content<=20?(310-40):
model.modelData.Msg_Content<=25?(275-40):
model.modelData.Msg_Content<=30?(240-40):
model.modelData.Msg_Content<=35?(205-40):
model.modelData.Msg_Content<=40?(170-40):
model.modelData.Msg_Content<=45?(135-40):
model.modelData.Msg_Content<=50?(100-40):
model.modelData.Msg_Content<=55?(65-40):
(model.modelData.Msg_Content<60?(45-40):(30-40))
/* (5<model.modelData.Msg_Content<=10)?(380-40):
(10<model.modelData.Msg_Content<=15)?(345-40):
(15<model.modelData.Msg_Content<=20)?(315-40):
(20<model.modelData.Msg_Content<=25)?(280-40):
(25<model.modelData.Msg_Content<=30)?(245-40):
(30<model.modelData.Msg_Content<=35)?(210-40):
(40<model.modelData.Msg_Content<=45)?(175-40):
(45<model.modelData.Msg_Content<=50)?(140-40):
(50<model.modelData.Msg_Content<=55)?(105-40):
((55<model.modelData.Msg_Content<60)?(70-40):(35-40))*/
// (100-40)//(0-40)
y:319-318
width :model.modelData.Msg_Content<=5?35:
model.modelData.Msg_Content<=10?70:
model.modelData.Msg_Content<=15?105:
model.modelData.Msg_Content<=20?140:
model.modelData.Msg_Content<=25?175:
model.modelData.Msg_Content<=30?210:
model.modelData.Msg_Content<=35?245:
model.modelData.Msg_Content<=40?270:
model.modelData.Msg_Content<=45?305:
model.modelData.Msg_Content<=50?340:
model.modelData.Msg_Content<=55?375:
(model.modelData.Msg_Content<60?395:410)
/*(5<model.modelData.Msg_Content<=10)?70:
(10<model.modelData.Msg_Content<=15)?105:
(15<model.modelData.Msg_Content<=20)?140:
(20<model.modelData.Msg_Content<=25)?175:
(25<model.modelData.Msg_Content<=30)?210:
(30<model.modelData.Msg_Content<=35)?245:
(40<model.modelData.Msg_Content<=45)?270:
(45<model.modelData.Msg_Content<=50)?305:
(50<model.modelData.Msg_Content<=55)?340:
((55<model.modelData.Msg_Content<60)?375:410)*/
// model.modelData.Msg_Content==="60"?470:348//348//450
height:msg_content.height
visible : model.modelData.Msg_Type==="2"? true : false
source: model.modelData.SndOrRcv==="1"? "../images/speech_rec.PNG":"../images/speech_send.PNG"
// sourceSize.width :348//200
// sourceSize.height:100
}
HMILabel{
id : speech_time
x:model.modelData.SndOrRcv==="1"?550-50:0-34-34//550-50-50:0-34-34
y:319-318
//height: 25
// width :230
font.pixelSize:20
horizontalAlignment: Label.AlignHCenter
text:model.modelData.Msg_Content
visible:model.modelData.Msg_Type==="2"? true : false//((model.modelData.SndOrRcv==="1")||((model.modelData.SndOrRcv==="0")&&(model.modelData.SendStatus==="3")))?true:false
}
Image{
id : msg_image
x:model.modelData.SndOrRcv==="1"?(122):(316-264)
y:340-318
visible : model.modelData.Msg_Type==="3"? true : false
source: model.modelData.File_Path
sourceSize.width :200
sourceSize.height: 100
}
HMIMouseArea{
anchors.fill: parent
onLongPress: {
console.log("long clicked~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
carlinkCtrl.setAutoGrpMsgIndex(model.modelData.Index,index);
if(model.modelData.Msg_Type==="3"){
carlinkCtrl.setForwardMsg(model.modelData.File_Path);
}
else if ("1" === model.modelData.Msg_Type ){
carlinkCtrl.setForwardMsg(model.modelData.Msg_Content);
}
else if ("2" === model.modelData.Msg_Type ){
carlinkCtrl.setForwardMsg(model.modelData.File_Path);
carlinkCtrl.setForwardPlayTime(model.modelData.Msg_Content);
}
carlinkCtrl.setForwardType(model.modelData.Msg_Type);
pop.popvisible = true;
isLongPress = true ;
}
onClicked: {
if (isLongPress ===false){
if (model.modelData.Msg_Type==="3")
{
showImage.popsource = model.modelData.File_Path
showImage.popvisible = true ;
}
else if (model.modelData.Msg_Type==="2")
{
/* showImage.popsource = model.modelData.File_Path
showImage.popvisible = true ;*/
if (model.modelData.Msg_Type==="2")
{
console.log("speech_play clicked~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
systemCtrl.reqSource(Layout.HMI_SRC_AUDIO_TTS,Layout.HMI_SRC_START,Layout.HMI_SRC_Front)
carlinkCtrl.playSpeech(model.modelData.File_Path)
// systemCtrl.reqSource(Layout.HMI_SRC_AUDIO_TTS,Layout.HMI_SRC_End,Layout.HMI_SRC_Front)
}
}
}
else{
isLongPress = false
//do nothing
}
/* if (model.modelData.Msg_Type==="2")
{
console.log("speech_play clicked~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
systemCtrl.reqSource(Layout.HMI_SRC_AUDIO_TTS,Layout.HMI_SRC_START,Layout.HMI_SRC_Front)
carlinkCtrl.playSpeech(model.modelData.File_Path)
// systemCtrl.reqSource(Layout.HMI_SRC_AUDIO_TTS,Layout.HMI_SRC_End,Layout.HMI_SRC_Front)
}*/
}
}
}
}
}
HMIListView{
id:msg_list
x:34-pyeventx
y:253-131
width:700+20
height: bMaxWindow?550:190
model:carlinkCtrl.getAutoGroupListforId ()
delegate: model_delegate
spacing: 5
showBar:true
scrollBar:true
currentIndex: carlinkCtrl.getAutoGroupListCount()-1
onContentYChanged: {
if(contentY < originY){
var dy = contentY - originY;
if (dy < -150){
needReflesh = true ;
}
}
}
onMovementEnded:{
if (needReflesh === true){
needReflesh =false;
console.log("need reflesh-------------------------------------------------->>")
if ("1" === carlinkCtrl.currentDialogType){
carlinkCtrl.loadMoreMsgforId();
}
else if ("3" === carlinkCtrl.currentDialogType){
carlinkCtrl.loadMoreMsgforGroup();
}
else{
}
}
}
}
HMIButton{
id: send
x:574-pyeventx
y:193-131
labelText: qsTr("Send")+systemCtrl.emptyString
enabled:user_input.text.length>0?true:false
labelColor: (user_input.text.length >0)?"#FFFFFF" : "#656565"
btnImg:send.pressed? "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_PUSHED"+bgImageStyle
:"qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON"+bgImageStyle
onClicked: {
console.log("send button is clicked---------------->")
carlinkCtrl.appSendMsgText_Request(user_input.text);
}
}
HMIButton{
id:speech
x:70-pyeventx+2
y:bMaxWindow?828-131-3:444-131-3
labelPixelSize:14
labelText:speechIndex? qsTr("End_Record"):qsTr("Speech_Record")
btnImg:speech.pressed?"qrc:MATERIAL/MATERIAL_M8X_FUNCTION_BUTTON_4_P"+bgImageStyle
:"qrc:MATERIAL/MATERIAL_M8X_FUNCTION_BUTTON_4"+bgImageStyle
onClicked: {
if(speechIndex===false)
{
console.log("speech button is clicked---------------->")
console.log("start onClicked systemCtrl.getCurrentSource()-->" + systemCtrl.getCurrentSource())
carlinkCtrl.getTimeForSpeechStart();
if (Layout.HMI_SRC_PHONE == systemCtrl.getCurrentSource())
{
console.log("current source is phone")
}
else
{
systemCtrl.reqSource(Layout.HMI_SRC_AUDIO_TTS,Layout.HMI_SRC_START,Layout.HMI_SRC_Front)
}
speechIndex=true
carlinkCtrl.startSpeech()
car_vrTimer.start()
speech_tanchu.visible=true
}
else
{
console.log("speech_stop button is clicked---------------->")
carlinkCtrl.getTimeForSpeechStop();
speechIndex=false
carlinkCtrl.stopSpeech()
car_vrTimer.stop()
speech_tanchu.visible=false
}
}
}
HMIButton{
id:addpictrue
x:192-pyeventx+2
y:bMaxWindow?828-131-3:444-131-3
btnImg:addpictrue.pressed?"qrc:MATERIAL/MATERIAL_M8X_FUNCTION_BUTTON_4_P"+bgImageStyle
:"qrc:MATERIAL/MATERIAL_M8X_FUNCTION_BUTTON_4"+bgImageStyle
//enabled: carlinkCtrl.isUsbConnected?true:false
Image{
x:47
y:18
source: "qrc:MATERIAL/MATERIAL_M8X_ICON_+"+bgImageStyle
}
onClicked: {
carlinkCtrl.get_rootFolder();
ScreenManager.changeForm(Layout.FM_OPEN,WindowsList.CARLINK_IMGBROWSER)
}
}
HMIButton{
id:locationshare
x:314-pyeventx+2
y:bMaxWindow?828-131-3:444-131-3
labelPixelSize:23
labelText: qsTr("Location")
btnImg:locationshare.pressed?"qrc:MATERIAL/MATERIAL_M8X_FUNCTION_BUTTON_4_P"+bgImageStyle
:"qrc:MATERIAL/MATERIAL_M8X_FUNCTION_BUTTON_4"+bgImageStyle
}
HMIButton{
id:searchrequest
x:436-pyeventx+2
y:bMaxWindow?828-131-3:444-131-3
labelPixelSize:23
labelText: qsTr("Track")
btnImg:searchrequest.pressed?"qrc:MATERIAL/MATERIAL_M8X_FUNCTION_BUTTON_4_P"+bgImageStyle
:"qrc:MATERIAL/MATERIAL_M8X_FUNCTION_BUTTON_4"+bgImageStyle
}
HMIKeyBoard{
id: keyBoard
x: 0
y: bMaxWindow ?440:257-131-70
opacity: 0
enabled: false
iType:1
isPinyin:true
iSerach:false
iConfirm:true
onClickspell:
{
if(!keyBoard.isPinyin)
{
systemCtrl.setKeyPress(spell)
}
}
}
DiagLogPopup{
x:-1
y:1
id:pop
isMaxWindow: bMaxWindow
popvisible: false
}
ShowImage{
id:showImage
popvisible: false
}
Connections {
target: carlinkCtrl
onSigAutoGrpMsgListForIdChanged : {
msg_list.model = carlinkCtrl.getAutoGroupListforId();
//user_input.focus = false;
user_input.text="";
msg_list.currentIndex= carlinkCtrl.getAutoGroupListCount()-1
keyBoard.opacity = 0;
keyBoard.enabled = false;
}
onSigImageFileDownLoadSuccess :{
var id = carlinkCtrl.getCurrentUseId();
if ("1" === carlinkCtrl.currentDialogType)
{
console.log("--------dialogbox-----user------")
carlinkCtrl.selAutoGroupListforId(id);
}
else if ("3" === carlinkCtrl.currentDialogType ){
carlinkCtrl.selAutoGroupListforGroup(id);
}
else{
//do nothing
}
}
}
Rectangle{
id:speech_tanchu
anchors.verticalCenter:parent.verticalCenter
anchors.horizontalCenter:parent.horizontalCenter
width: 300;height: 150;
color:"lightgreen"
radius: 10
Text {
id: text3
text: "录制中......"
anchors.verticalCenter:parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
font.pointSize: 30
font.bold: true
}
visible:false
opacity: 0.7
}
/* Pop up result Timer */
Timer
{
id:car_vrTimer
interval: 60000
running: false
repeat: false
onTriggered:
{
//text3.text=20//main_window.counter
//main_window.counter-=1;
//if(main_window.counter<0)
//{
speechIndex=false
carlinkCtrl.getTimeForSpeechStop();
carlinkCtrl.stopSpeech();
speech_tanchu.visible=false
//text3.visible=false
diagCtrl.stopVR()
car_vrTimer.stop()
// }
}
}
}
|