blob: b67ea562c73874e3c7a71d9d086ecf6b88f890c4 (
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
|
/*
* Copyright 2020,2021 Panasonic Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import QtQuick 2.14
Item {
id: turnByTurn
property int receivedArrowId : 0 /* 1:l1 2:l2 3:r1 4:r2 */
property int receivedTbtValue : 0
onReceivedArrowIdChanged: {
tbtParts.idchange()
}
onReceivedTbtValueChanged: {
tbtParts.valuechange()
}
Component.onCompleted: {
receivedArrowId = 1
receivedTbtValue = 200
}
Item{
id:tbtParts
property int receivedTbtValue1 : receivedTbtValue%10
property int receivedTbtValue10 : (receivedTbtValue/10)%10
property int receivedTbtValue100 : (receivedTbtValue/100)%10
property int currentArrowId : 0
property int currentTbtValue : 0
property int currentTbtValue1 : currentTbtValue%10
property int currentTbtValue10 : (currentTbtValue/10)%10
property int currentTbtValue100 : (currentTbtValue/100)%10
Connections{
target: rootItem
onTransNormalToAdas:{
normalToAdasAnimationTbt.start()
}
onTransAdasToMap:{
adasToMapAnimationTbt.start()
}
onTransMapToNormal:{
mapToNormalAnimationTbt.start()
}
}
function idchange(){
if(currentArrowId != 0){
tbtArrowCur.source = "qrc:/Images/NormalView/TBT/tbt_arrow-" + currentArrowId + ".ktx"
tbtArrowNex.source = "qrc:/Images/NormalView/TBT/tbt_arrow-" + receivedArrowId + ".ktx"
switch(currentArrowId){
case 1:
tbtArrowCurMap.source = "qrc:/Images/ADASView/TBT/map_tbt_arrow-" + "l1" + ".ktx"
break
case 2:
tbtArrowCurMap.source = "qrc:/Images/ADASView/TBT/map_tbt_arrow-" + "l2" + ".ktx"
break
case 3:
tbtArrowCurMap.source = "qrc:/Images/ADASView/TBT/map_tbt_arrow-" + "r1" + ".ktx"
break
case 4:
tbtArrowCurMap.source = "qrc:/Images/ADASView/TBT/map_tbt_arrow-" + "r2" + ".ktx"
break
default:
break
}
switch(receivedArrowId){
case 1:
tbtArrowNexMap.source = "qrc:/Images/ADASView/TBT/map_tbt_arrow-" + "l1" + ".ktx"
break
case 2:
tbtArrowNexMap.source = "qrc:/Images/ADASView/TBT/map_tbt_arrow-" + "l2" + ".ktx"
break
case 3:
tbtArrowNexMap.source = "qrc:/Images/ADASView/TBT/map_tbt_arrow-" + "r1" + ".ktx"
break
case 4:
tbtArrowNexMap.source = "qrc:/Images/ADASView/TBT/map_tbt_arrow-" + "r2" + ".ktx"
break
default:
break
}
}
else{ //if no displayed item
tbtArrowNex.source = "qrc:/Images/NormalView/TBT/tbt_arrow-" + receivedArrowId + ".ktx"
switch(receivedArrowId){
case 1:
tbtArrowNexMap.source = "qrc:/Images/ADASView/TBT/map_tbt_arrow-" + "l1" + ".ktx"
break
case 2:
tbtArrowNexMap.source = "qrc:/Images/ADASView/TBT/map_tbt_arrow-" + "l2" + ".ktx"
break
case 3:
tbtArrowNexMap.source = "qrc:/Images/ADASView/TBT/map_tbt_arrow-" + "r1" + ".ktx"
break
case 4:
tbtArrowNexMap.source = "qrc:/Images/ADASView/TBT/map_tbt_arrow-" + "r2" + ".ktx"
break
default:
break
}
}
arrowAnim.start()
currentArrowId = receivedArrowId
}
function valuechange(){
receivedTbtValue1 = receivedTbtValue%10
receivedTbtValue10 = (receivedTbtValue/10)%10
receivedTbtValue100 = (receivedTbtValue/100)%10
currentTbtValue1 = currentTbtValue%10
currentTbtValue10 = (currentTbtValue/10)%10
currentTbtValue100 = (currentTbtValue/100)%10
if(currentTbtValue >= 100) {
tbtNum1Cur.visible = true
tbtNum10Cur.visible = true
tbtNum100Cur.visible = true
tbtNum1CurMap.visible = true
tbtNum10CurMap.visible = true
tbtNum100CurMap.visible = true
}else if(currentTbtValue >= 10){
tbtNum1Cur.visible = true
tbtNum10Cur.visible = true
tbtNum100Cur.visible = false
tbtNum1CurMap.visible = true
tbtNum10CurMap.visible = true
tbtNum100CurMap.visible = false
}else{
tbtNum1Cur.visible = true
tbtNum10Cur.visible = false
tbtNum100Cur.visible = false
tbtNum1CurMap.visible = true
tbtNum10CurMap.visible = false
tbtNum100CurMap.visible = false
}
if(receivedTbtValue >= 100) {
tbtNum1Nex.visible = true
tbtNum10Nex.visible = true
tbtNum100Nex.visible = true
tbtNum1NexMap.visible = true
tbtNum10NexMap.visible = true
tbtNum100NexMap.visible = true
}else if(receivedTbtValue >= 10){
tbtNum1Nex.visible = true
tbtNum10Nex.visible = true
tbtNum100Nex.visible = false
tbtNum1NexMap.visible = true
tbtNum10NexMap.visible = true
tbtNum100NexMap.visible = false
}else{
tbtNum1Nex.visible = true
tbtNum10Nex.visible = false
tbtNum100Nex.visible = false
tbtNum1NexMap.visible = true
tbtNum10NexMap.visible = false
tbtNum100NexMap.visible = false
}
tbtUnitCur.source = "qrc:/Images/NormalView/TBT/tbt_unit.png"
tbtNum1Cur.source = "qrc:/Images/NormalView/TBT/tbt_num1-" + currentTbtValue1 + ".png"//9
tbtNum10Cur.source = "qrc:/Images/NormalView/TBT/tbt_num10-" + currentTbtValue10 + ".png"//0
tbtNum100Cur.source = "qrc:/Images/NormalView/TBT/tbt_num100-" + currentTbtValue100 + ".png"//0
tbtUnitNex.source = "qrc:/Images/NormalView/TBT/tbt_unit.png"
tbtNum1Nex.source = "qrc:/Images/NormalView/TBT/tbt_num1-" + receivedTbtValue1 + ".png"//9
tbtNum10Nex.source = "qrc:/Images/NormalView/TBT/tbt_num10-" + receivedTbtValue10 + ".png"//9
tbtNum100Nex.source = "qrc:/Images/NormalView/TBT/tbt_num100-" + receivedTbtValue100 + ".png"//1
tbtUnitCurMap.source = "qrc:/Images/ADASView/TBT/map_tbt_unit.png"
tbtNum1CurMap.source = "qrc:/Images/ADASView/TBT/map_tbt_num1-" + currentTbtValue1 + ".png"//9
tbtNum10CurMap.source = "qrc:/Images/ADASView/TBT/map_tbt_num10-" + currentTbtValue10 + ".png"//0
tbtNum100CurMap.source = "qrc:/Images/ADASView/TBT/map_tbt_num100-" + currentTbtValue100 + ".png"//0
tbtUnitNexMap.source = "qrc:/Images/ADASView/TBT/map_tbt_unit.png"
tbtNum1NexMap.source = "qrc:/Images/ADASView/TBT/map_tbt_num1-" + receivedTbtValue1 + ".png"//9
tbtNum10NexMap.source = "qrc:/Images/ADASView/TBT/map_tbt_num10-" + receivedTbtValue10 + ".png"//9
tbtNum100NexMap.source = "qrc:/Images/ADASView/TBT/map_tbt_num100-" + receivedTbtValue100 + ".png"//1
value_anim.start()
currentTbtValue = receivedTbtValue
}
Item{
id:tbtNormal
/*-----------------------------------current tbt value------------------------------------*/
Image{
id:tbtUnitCur
x:1525
y:327
width:23
height:17
opacity: 0
}
Image{
id:tbtNum1Cur
x:1501
y:316
width:19
height:28
opacity: 0
}
Image{
id:tbtNum10Cur
x:1482
y:316
width:19
height:28
opacity: 0
}
Image{
id:tbtNum100Cur
x:1463
y:316
width:19
height:28
opacity: 0
}
/*----------------------------------- next tbt value ------------------------------------*/
Image{
id:tbtUnitNex
x:1525
y:327
width:23
height:17
opacity: 0
}
Image{
id:tbtNum1Nex
x:1501
y:316
width:19
height:28
opacity: 0
}
Image{
id:tbtNum10Nex
x:1482
y:316
width:19
height:28
opacity: 0
}
Image{
id:tbtNum100Nex
x:1463
y:316
width:19
height:28
opacity: 0
}
/*-----------------------------------current tbt arrow------------------------------------*/
Image{
id:tbtArrowCur
x:1349
y:176
width:307
height:111
opacity: 0
}
/*----------------------------------- next tbt arrow ------------------------------------*/
Image{
id:tbtArrowNex
x:1349
y:176
width:307
height:111
opacity: 0
}
}
Item{
id:tbtMap
y: -20
visible: false
/*-----------------------------------current tbt value------------------------------------*/
Image{
id:tbtUnitCurMap
x:974
y:440
width:26
height:20
opacity: 0
}
Image{
id:tbtNum1CurMap
x:948
y:428
width:24
height:32
opacity: 0
}
Image{
id:tbtNum10CurMap
x:925
y:428
width:24
height:32
opacity: 0
}
Image{
id:tbtNum100CurMap
x:902
y:428
width:24
height:32
opacity: 0
}
/*----------------------------------- next tbt value ------------------------------------*/
Image{
id:tbtUnitNexMap
x:974
y:440
width:26
height:20
opacity: 0
}
Image{
id:tbtNum1NexMap
x:948
y:428
width:24
height:32
opacity: 0
}
Image{
id:tbtNum10NexMap
x:925
y:428
width:24
height:32
opacity: 0
}
Image{
id:tbtNum100NexMap
x:902
y:428
width:24
height:32
opacity: 0
}
/*-----------------------------------current tbt arrow------------------------------------*/
Image{
id:tbtArrowCurMap
x:798
y:296
width:307
height:111
opacity: 0
}
/*----------------------------------- next tbt arrow ------------------------------------*/
Image{
id:tbtArrowNexMap
x:798
y:296
width:307
height:111
opacity: 0
}
}
/*----------------------------------- value animation ------------------------------------*/
ParallelAnimation{
id: value_anim
NumberAnimation {
target: tbtUnitCur
property: "opacity"
duration: 500
easing.type: Easing.Linear
from: 1
to: 0
}
NumberAnimation {
target: tbtNum1Cur
property: "opacity"
duration: 500
easing.type: Easing.Linear
from: 1
to: 0
}
NumberAnimation {
target: tbtNum10Cur
property: "opacity"
duration: 500
easing.type: Easing.Linear
from: 1
to: 0
}
NumberAnimation {
target: tbtNum100Cur
property: "opacity"
duration: 500
easing.type: Easing.Linear
from: 1
to: 0
}
NumberAnimation {
target: tbtUnitNex
property: "opacity"
duration: 500
easing.type: Easing.Linear
from : 0
to: 1
}
NumberAnimation {
target: tbtNum1Nex
property: "opacity"
duration: 500
easing.type: Easing.Linear
from : 0
to: 1
}
NumberAnimation {
target: tbtNum10Nex
property: "opacity"
duration: 500
easing.type: Easing.Linear
from : 0
to: 1
}
NumberAnimation {
target: tbtNum100Nex
property: "opacity"
duration: 500
easing.type: Easing.Linear
from : 0
to: 1
}
NumberAnimation {
target: tbtUnitCurMap
property: "opacity"
duration: 500
easing.type: Easing.Linear
from: 1
to: 0
}
NumberAnimation {
target: tbtNum1CurMap
property: "opacity"
duration: 500
easing.type: Easing.Linear
from: 1
to: 0
}
NumberAnimation {
target: tbtNum10CurMap
property: "opacity"
duration: 500
easing.type: Easing.Linear
from: 1
to: 0
}
NumberAnimation {
target: tbtNum100CurMap
property: "opacity"
duration: 500
easing.type: Easing.Linear
from: 1
to: 0
}
NumberAnimation {
target: tbtUnitNexMap
property: "opacity"
duration: 500
easing.type: Easing.Linear
from : 0
to: 1
}
NumberAnimation {
target: tbtNum1NexMap
property: "opacity"
duration: 500
easing.type: Easing.Linear
from : 0
to: 1
}
NumberAnimation {
target: tbtNum10NexMap
property: "opacity"
duration: 500
easing.type: Easing.Linear
from : 0
to: 1
}
NumberAnimation {
target: tbtNum100NexMap
property: "opacity"
duration: 500
easing.type: Easing.Linear
from : 0
to: 1
}
}
/*----------------------------------- arrow animation ------------------------------------*/
ParallelAnimation{
id: arrowAnim
NumberAnimation {
target: tbtArrowCur
property: "opacity"
duration: 500
easing.type: Easing.Linear
from: 1
to: 0
}
NumberAnimation {
target: tbtArrowNex
property: "opacity"
duration: 500
easing.type: Easing.Linear
from : 0
to: 1
}
NumberAnimation {
target: tbtArrowCurMap
property: "opacity"
duration: 500
easing.type: Easing.Linear
from: 1
to: 0
}
NumberAnimation {
target: tbtArrowNexMap
property: "opacity"
duration: 500
easing.type: Easing.Linear
from : 0
to: 1
}
}
/*----------------------------------- mode toransition animation ------------------------------------*/
SequentialAnimation{
id:normalToAdasAnimationTbt
onStarted: rootItem.focus=false
NumberAnimation {
target: tbtNormal
property: "opacity"
duration: 330
from:1
to:0
}
PropertyAnimation{
target: tbtNormal
property: "visible"
duration: 0
from: true
to: false
}
}
SequentialAnimation{
id: adasToMapAnimationTbt
onStarted: rootItem.focus=false
PropertyAnimation{
target: tbtMap
property: "visible"
duration: 0
to: true
}
PropertyAnimation{
target: tbtMap
property: "opacity"
duration: 330
to: 1
}
}
SequentialAnimation{
id:mapToNormalAnimationTbt
onStarted: rootItem.focus=false
onStopped: rootItem.focus=true
PauseAnimation {
duration: 254
}
PropertyAnimation{
target: tbtMap
property: "opacity"
duration: 330
to: 0
}
PropertyAnimation{
target: tbtMap
property: "visible"
duration: 0
to: false
}
PauseAnimation {
duration: 891
}
PropertyAnimation{
target: tbtNormal
property: "visible"
duration:0
from:"flase"
to: true
}
NumberAnimation {
target: tbtNormal
property: "opacity"
duration: 330
from:0
to:1
}
}
}
}
|