-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpartenze.schema.json
More file actions
884 lines (884 loc) · 28.1 KB
/
Copy pathpartenze.schema.json
File metadata and controls
884 lines (884 loc) · 28.1 KB
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
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://raw.githubusercontent.com/dltmtt/viaggiatreno-api/refs/heads/main/schemas/partenze.schema.json",
"title": "Risposta dell'endpoint /partenze",
"type": "array",
"items": {
"type": "object",
"properties": {
"arrivato": {
"type": "boolean",
"description": "Se il treno è già arrivato nella stazione di cui si vogliono conoscere le partenze."
},
"dataPartenzaTrenoAsDate": {
"type": "string",
"format": "date",
"description": "Data di partenza del treno nel formato YYYY-MM-DD.",
"examples": ["2025-07-26"]
},
"dataPartenzaTreno": {
"type": "integer",
"description": "Data di partenza del treno in millisecondi dalla Unix Epoch.",
"examples": [1753480800000]
},
"partenzaTreno": {
"type": ["integer", "null"],
"description": "Ora di partenza del treno in millisecondi dalla Unix Epoch.",
"examples": [1753556970000, null]
},
"millisDataPartenza": {
"type": "string",
"description": "Data di partenza del treno in millisecondi dalla Unix Epoch come stringa.",
"examples": ["1753480800000"]
},
"numeroTreno": {
"type": "integer",
"description": "Numero identificativo del treno.",
"examples": [23, 26387, 21007]
},
"categoria": {
"enum": ["", "EC", "EN", "EXP", "IC", "ICN", "IR", "MET", "NCL", "REG"],
"description": "Categoria del treno. Meno dettagliato di `categoriaDescrizione`: le Frecce vedono questo campo vuoto."
},
"categoriaDescrizione": {
"$comment": "Lo spazio non è un errore, è così che viene restituito. Trovato vuoto in un Frecciarossa cancellato.",
"enum": [
"",
" FA",
" FB",
" FR",
"EC FR",
"EC",
"EN",
"EXP",
"IC",
"ICN",
"IR",
"MET",
"NCL",
"REG"
],
"description": "Categoria del treno."
},
"origine": {
"const": null
},
"codOrigine": {
"type": "string",
"pattern": "^S\\d{5}$",
"description": "Codice della stazione di origine del treno."
},
"destinazione": {
"type": "string",
"description": "Nome della stazione di destinazione del treno tra quelle presenti nel database. Può essere l'ultima stazione italiana o la prima estera dopo il confine nel caso di treni che vanno all'estero.",
"examples": [
"MODANE",
"MILANO CENTRALE",
"ROMA TERMINI",
"TORINO PORTA NUOVA"
]
},
"codDestinazione": {
"const": null
},
"origineEstera": {
"const": null
},
"destinazioneEstera": {
"type": ["string", "null"],
"description": "Pur avendo sicuramente a che fare con treni che entrano in territorio estero, non è chiaro il significato: non indica necessariamente la stazione di destinazione estera, come suggerisce il nome. Ad esempio, il REG 22964 Ventimiglia-Cuneo, che passa per la Francia, ha questo campo settato a VENTIMIGLIA.",
"examples": [
"PARIS-GARE-DE-LYON",
"ZUERICH HB",
"MUENCHEN HBF",
"VENTIMIGLIA"
]
},
"oraPartenzaEstera": {
"type": ["integer", "null"],
"description": "Orario (UTC) di partenza dalla stazione di partenza estera in millisecondi dalla mezzanotte della data di partenza del treno.",
"examples": [66780000, null]
},
"oraArrivoEstera": {
"const": null
},
"tratta": {
"const": 0
},
"regione": {
"const": 0
},
"origineZero": {
"const": null
},
"destinazioneZero": {
"const": null
},
"orarioPartenzaZero": {
"const": null
},
"orarioArrivoZero": {
"const": null
},
"circolante": {
"type": "boolean"
},
"codiceCliente": {
"enum": [1, 2, 4, 18, 63, 64, 910],
"description": "Codice cliente RFI associato all'impresa ferroviaria."
},
"binarioEffettivoArrivoCodice": {
"const": null
},
"binarioEffettivoArrivoDescrizione": {
"const": null
},
"binarioEffettivoArrivoTipo": {
"const": null
},
"binarioProgrammatoArrivoCodice": {
"const": null
},
"binarioProgrammatoArrivoDescrizione": {
"const": null
},
"binarioEffettivoPartenzaCodice": {
"type": ["string", "null"],
"examples": ["0", "2", "166", "167", "171", "1979", "1985", null]
},
"binarioEffettivoPartenzaDescrizione": {
"type": ["string", "null"],
"examples": ["16", "1", "6", "2TR", null]
},
"binarioEffettivoPartenzaTipo": {
"enum": ["0", null]
},
"binarioProgrammatoPartenzaCodice": {
"type": ["string", "null"],
"examples": ["0", "6", "51", null]
},
"binarioProgrammatoPartenzaDescrizione": {
"type": ["string", "null"],
"examples": ["9", "II", "15", "XVII", "18", "1 Tr MI", "VIT"]
},
"subTitle": {
"const": null
},
"esisteCorsaZero": {
"const": null
},
"orientamento": {
"enum": [
"A",
"B",
"",
"A|A",
"A|B",
"B|A",
"B|B",
"A1|B2@A|A",
"A1|B2@A|B",
"A1|B2@B|A",
"A1|B2@B|B",
"A2|B1@A|A",
"A2|B1@A|B",
"A2|B1@B|A",
"A2|B1@B|B",
null
],
"description": "Orientamento del treno, può essere A (executive/business/1 classe in coda), B (executive/business/1 classe in testa) o combinazioni varie. È `null` per i treni che non sono distinti in classi o che non prevedono la prenotazione dei posti, come i regionali. È una stringa vuota quando, pur essendo un treno con classi, non è possibile determinare l'orientamento."
},
"inStazione": {
"type": "boolean"
},
"haCambiNumero": {
"type": "boolean",
"description": "Indica se il treno cambia numero durante il viaggio."
},
"nonPartito": {
"type": "boolean"
},
"provvedimento": {
"$comment": "Potrebbero esserci altri valori numerici; lasciando la definizione così è possibile rilevare eventuali cambiamenti futuri per ulteriori analisi.",
"enum": [0, 1, 2, 3],
"default": 0,
"description": "Indica lo stato di cancellazione del treno: 1 = treno completamente cancellato, 2 = cancellato nella tratta finale (arriva in una stazione diversa rispetto a quella programmata), 3 = treno deviato (alcune fermate intermedie sono cancellate oppure gli orari sono stati modificati)."
},
"riprogrammazione": {
"enum": ["Y", "N", null],
"default": "N",
"description": "Indica se il treno è riprogrammato. Se `Y`, il treno parte da un stazione diversa rispetto a quella di partenza (le fermate iniziali sono cancellate)."
},
"orarioPartenza": {
"type": "integer",
"description": "Orario di partenza in millisecondi dalla Unix Epoch."
},
"orarioArrivo": {
"const": null
},
"stazionePartenza": {
"const": null
},
"stazioneArrivo": {
"const": null
},
"statoTreno": {
"const": null
},
"corrispondenze": {
"const": []
},
"servizi": {
"const": []
},
"ritardo": {
"type": "number",
"description": "Ritardo del treno in minuti. Se negativo indica un anticipo. Spesso a 0 anche quando il treno è in ritardo, utilizzare andamentoTreno per informazioni più accurate."
},
"tipoProdotto": {
"enum": ["", "0", "99", "100", "101", "102"],
"default": "0",
"description": "Valore associato a 99 per i Treni Storici, a 100 per i Frecciarossa, a 101 per i Frecciargento e a 102 per i Frecciabianca. Viene usato insieme a `categoria` per determinare `categoriaDescrizione`."
},
"compOrarioPartenzaZeroEffettivo": {
"type": "string",
"pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$",
"description": "Sempre uguale a `compOrarioPartenza`.",
"examples": ["11:52", "21:34", "22:06"]
},
"compOrarioArrivoZeroEffettivo": {
"const": null
},
"compOrarioPartenzaZero": {
"type": "string",
"pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$",
"description": "Sempre uguale a `compOrarioPartenza`.",
"examples": ["11:52", "21:34", "22:06"]
},
"compOrarioArrivoZero": {
"const": null
},
"compOrarioArrivo": {
"const": null
},
"compOrarioPartenza": {
"type": "string",
"pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$",
"description": "Orario di partenza nel formato HH:MM.",
"examples": ["11:52", "21:34", "22:06"]
},
"compNumeroTreno": {
"type": "string",
"description": "Nome completo del treno calcolato a partire da `categoria`, `numeroTreno` e `tipoProdotto`.",
"examples": ["REG 2328", " TS 96376", " FA 8852"]
},
"compOrientamento": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 9,
"maxItems": 9,
"description": "Orientamento del treno in diverse lingue (IT, EN, DE, FR, ES, RO, JA, ZH, RU).",
"examples": [
["--", "--", "--", "--", "--", "--", "--", "--", "--"],
[
"Business in testa",
"Business in the head",
"Business Zugspitze",
"Business en tête",
"Business al inicio del tren",
"Business la începutul trenului",
"頭の中でBusiness",
"Business在前几节车厢",
"Business в головной части поезда"
],
[
"Business in coda",
"Business at the rear",
"Business Zugende",
"Businesse en queue",
"Business al final del tren",
"Business la coada trenului",
"背面のBusiness",
"Business在后几节车厢",
"Business в хвосте поезда"
],
[
"Executive in testa",
"Executive in the head",
"Executive Zugspitze",
"Executive en tête",
"Executive al inicio del tren",
"Executive la începutul trenului",
"頭の中でExecutive",
"Executive在前几节车厢",
"Executive в головной части поезда"
],
[
"Executive in coda",
"Executive at the rear",
"Executive Zugende",
"Executive en queue",
"Executive al final del tren",
"Executive la coada trenului",
"背面のExecutive",
"Executive在后几节车厢",
"Executive в хвосте поезда"
],
[
"1 classe in testa",
"1st Class in the head",
"1. Klasse Zugspitze ",
"1ère classe en tête",
"1ª clase al inicio del tren",
"clasa I la începutul trenului",
"1等車前方",
"一等车厢在前几节车厢",
"1 класс в головной части поезда"
]
]
},
"compTipologiaTreno": {
"enum": ["regionale", "nazionale"],
"description": "Tipologia del treno."
},
"compClassRitardoTxt": {
"enum": ["", "ritardo01_txt", "ritardo02_txt", "ritardo03_txt", null]
},
"compClassRitardoLine": {
"enum": [
"regolare_line",
"ritardo01_line",
"ritardo02_line",
"ritardo03_line",
null
]
},
"compImgRitardo2": {
"$comment": "L'immagine che indica la cancellazione del treno è presente solo qua, non in compImgRitardo.",
"enum": [
"/vt_static/img/legenda/icone_legenda/nonpartito.png",
"/vt_static/img/legenda/icone_legenda/regolare.png",
"/vt_static/img/legenda/icone_legenda/ritardo01.png",
"/vt_static/img/legenda/icone_legenda/ritardo02.png",
"/vt_static/img/legenda/icone_legenda/ritardo03.png",
"/vt_static/img/avvisi/alert3.png",
"/vt_static/img/legenda/icone_legenda/cancellazione.png"
],
"format": "uri-reference"
},
"compImgRitardo": {
"enum": [
"/vt_static/img/legenda/icone_legenda/nonpartito.png",
"/vt_static/img/legenda/icone_legenda/regolare.png",
"/vt_static/img/legenda/icone_legenda/ritardo01.png",
"/vt_static/img/legenda/icone_legenda/ritardo02.png",
"/vt_static/img/legenda/icone_legenda/ritardo03.png",
"/vt_static/img/avvisi/alert3.png"
],
"format": "uri-reference",
"description": "URL relativo del bollino che indica il ritardo. È usato da ViaggiaTreno."
},
"compRitardo": {
"type": "array",
"description": "Descrizioni del ritardo in diverse lingue (IT, EN, DE, FR, ES, RO, JA, ZH, RU).",
"items": {
"type": ["string", "null"]
},
"minItems": 9,
"maxItems": 9,
"examples": [
[
"non partito",
"not departed",
"keine Partei",
"pas encore partit",
"no salió",
"nu a plecat",
"未発車",
"未出发",
"не отправленный"
],
[
"in orario",
"on time",
"pünktlich",
"à l'heure",
"en horario",
"conform orarului",
"定刻",
"按时",
"по расписанию"
],
[
"ritardo 1 min.",
"delay 1 min.",
"Verspätung 1 Min.",
"retard de 1 min.",
"retraso de 1 min.",
"întârziere 1 min.",
"遅延 1 分",
"误点 1分钟",
"опоздание на 1 минут"
],
[
"Mancato rilevamento",
"Missing detection",
"Erkennung fehlgeschlagen",
"Détection manquée",
"Detecciónn fallida",
null,
null,
null,
null
],
[
"Cancellato",
"Canceled",
"Storniert",
"Annulé",
"Cancelado",
null,
null,
null,
null
]
]
},
"compRitardoAndamento": {
"type": "array",
"items": {
"type": ["string", "null"]
},
"minItems": 9,
"maxItems": 9,
"examples": [
[
"non partito",
"not departed",
"keine Partei",
"pas encore partit",
"no salió",
"nu a plecat",
"未発車",
"未出发",
"не отправленный"
],
[
"con un anticipo di 1 min.",
"1 minutes early",
"mit einem Vorsprung von 1 Min.",
"en avance de 1 min.",
"está adelantado 1 min.",
"cu un avans de 1 min.",
"1 分の繰上",
"提前 1分钟",
"con un anticipo di 1 min."
],
[
"con un ritardo di 1 min.",
"1 minutes late",
"mit einer Verzögerung von 1 Min.",
"avec un retard de 1 min.",
"con un retraso de 1 min.",
"cu o întârziere de 1 min.",
"1 分の遅延",
"误点 1分钟",
"с опозданием в 1 минут"
]
]
},
"compInStazionePartenza": {
"$comment": "A quanto pare esistono rarissime varianti con altre traduzioni.",
"enum": [
["", "", "", "", "", "", "", "", ""],
[
"Partito",
"Departed",
"angefährt",
"Partit",
"Salido",
"Plecat",
"発車済",
"已出发",
"отправленный"
],
[
"Partito",
"Departed",
"angefährt",
"Partit",
"Salido",
"Plecat",
"車済",
"已出发",
"отправленный"
],
[
"Partito",
"Departed",
"angefährt",
"Partit",
"Salido",
"Plecat",
"発車済",
"出发",
"отправленный"
]
]
},
"compInStazioneArrivo": {
"$comment": "A quanto pare esistono rarissime varianti con altre traduzioni.",
"enum": [
["", "", "", "", "", "", "", "", ""],
[
"Arrivato",
"Arrived",
"angekommen",
"Arrivé",
"Llegado",
"Sosit",
"到着済",
"已到达",
"прибывший"
],
[
"Arrivato",
"Arrived",
"angekommen",
"Arrivé",
"Llegado",
"Sosit",
"着済",
"已到达",
"прибывший"
],
[
"Arrivato",
"Arrived",
"angekommen",
"Arrivé",
"Llegado",
"Sosit",
"到着済",
"到达",
"прибывший"
]
]
},
"compOrarioEffettivoArrivo": {
"const": null
},
"compDurata": {
"const": ""
},
"compImgCambiNumerazione": {
"$comment": "TODO: È plausibile possa esistere un treno che ha sia cambi numero che deviazioni. Magari cambiare in string e cambiare logica finale.",
"enum": [
" ",
" <img src=\"/vt_static/img/legenda/icone_legenda/numerazioni.png\">",
" <img src=\"/vt_static/img/legenda/icone_legenda/cancellazione.png\">",
" <img src=\"/vt_static/img/legenda/icone_legenda/numerazioni.png\"> <img src=\"/vt_static/img/legenda/icone_legenda/cancellazione.png\">",
" <img src=\"/vt_static/img/legenda/icone_legenda/deviazione.png\">",
" <img src=\"/vt_static/img/legenda/icone_legenda/numerazioni.png\"> <img src=\"/vt_static/img/legenda/icone_legenda/deviazione.png\">",
" <img src=\"/vt_static/img/legenda/icone_legenda/riprogrammato.png\">",
" <img src=\"/vt_static/img/legenda/icone_legenda/riprogrammato.png\"> <img src=\"/vt_static/img/legenda/icone_legenda/cancellazione.png\">"
],
"contentMediaType": "text/html",
"contentEncoding": "UTF-8",
"description": "HTML per l'immagine del cambio numerazione."
},
"materiale_label": {
"enum": ["business", null]
},
"ultimoRilev": {
"type": ["integer", "null"],
"description": "Ultimo rilevamento del treno in millisecondi dalla Unix Epoch."
},
"iconTreno": {
"const": null
}
},
"required": [
"arrivato",
"dataPartenzaTrenoAsDate",
"dataPartenzaTreno",
"partenzaTreno",
"millisDataPartenza",
"numeroTreno",
"categoria",
"categoriaDescrizione",
"origine",
"codOrigine",
"destinazione",
"codDestinazione",
"origineEstera",
"destinazioneEstera",
"oraPartenzaEstera",
"oraArrivoEstera",
"tratta",
"regione",
"origineZero",
"destinazioneZero",
"orarioPartenzaZero",
"orarioArrivoZero",
"circolante",
"codiceCliente",
"binarioEffettivoArrivoCodice",
"binarioEffettivoArrivoDescrizione",
"binarioEffettivoArrivoTipo",
"binarioProgrammatoArrivoCodice",
"binarioProgrammatoArrivoDescrizione",
"binarioEffettivoPartenzaCodice",
"binarioEffettivoPartenzaDescrizione",
"binarioEffettivoPartenzaTipo",
"binarioProgrammatoPartenzaCodice",
"binarioProgrammatoPartenzaDescrizione",
"subTitle",
"esisteCorsaZero",
"orientamento",
"inStazione",
"haCambiNumero",
"nonPartito",
"provvedimento",
"riprogrammazione",
"orarioPartenza",
"orarioArrivo",
"stazionePartenza",
"stazioneArrivo",
"statoTreno",
"corrispondenze",
"servizi",
"ritardo",
"tipoProdotto",
"compOrarioPartenzaZeroEffettivo",
"compOrarioArrivoZeroEffettivo",
"compOrarioPartenzaZero",
"compOrarioArrivoZero",
"compOrarioArrivo",
"compOrarioPartenza",
"compNumeroTreno",
"compOrientamento",
"compTipologiaTreno",
"compClassRitardoTxt",
"compClassRitardoLine",
"compImgRitardo2",
"compImgRitardo",
"compRitardo",
"compRitardoAndamento",
"compInStazionePartenza",
"compInStazioneArrivo",
"compOrarioEffettivoArrivo",
"compDurata",
"compImgCambiNumerazione",
"materiale_label",
"ultimoRilev",
"iconTreno"
],
"allOf": [
{
"if": {
"$comment": "Se il treno è stato cancellato completamente.",
"properties": {
"provvedimento": {
"const": 1
}
}
},
"then": {
"properties": {
"riprogrammazione": {
"const": null
},
"compRitardo": {
"const": [
"Cancellato",
"Canceled",
"Storniert",
"Annulé",
"Cancelado",
null,
null,
null,
null
]
},
"compImgRitardo2": {
"const": "/vt_static/img/legenda/icone_legenda/cancellazione.png"
},
"compImgRitardo": {
"const": "/vt_static/img/legenda/icone_legenda/regolare.png"
}
}
}
},
{
"if": {
"$comment": "Se il treno è riprogrammato.",
"properties": {
"riprogrammazione": {
"const": "Y"
}
}
},
"then": {
"if": {
"properties": {
"provvedimento": {
"const": 2
}
}
},
"then": {
"properties": {
"compImgCambiNumerazione": {
"const": " <img src=\"/vt_static/img/legenda/icone_legenda/riprogrammato.png\"> <img src=\"/vt_static/img/legenda/icone_legenda/cancellazione.png\">"
}
}
},
"else": {
"properties": {
"compImgCambiNumerazione": {
"const": " <img src=\"/vt_static/img/legenda/icone_legenda/riprogrammato.png\">"
}
}
}
},
"else": {
"$comment": "Se il treno NON è riprogrammato, controlla altri stati.",
"if": {
"$comment": "Se il treno è stato cancellato nella tratta finale.",
"properties": {
"provvedimento": {
"const": 2
}
}
},
"then": {
"if": {
"$comment": "Se il treno è stato cancellato nella tratta finale e cambia numero.",
"properties": {
"haCambiNumero": {
"const": true
}
}
},
"then": {
"properties": {
"compImgCambiNumerazione": {
"const": " <img src=\"/vt_static/img/legenda/icone_legenda/numerazioni.png\"> <img src=\"/vt_static/img/legenda/icone_legenda/cancellazione.png\">"
}
}
},
"else": {
"$comment": "Se il treno è stato cancellato nella tratta finale e NON cambia numero.",
"properties": {
"compImgCambiNumerazione": {
"const": " <img src=\"/vt_static/img/legenda/icone_legenda/cancellazione.png\">"
}
}
}
},
"else": {
"$comment": "Se il treno NON è stato cancellato nella tratta finale.",
"if": {
"$comment": "Se il treno NON è stato cancellato nella tratta finale, bensì è deviato.",
"properties": {
"provvedimento": {
"const": 3
}
}
},
"then": {
"if": {
"$comment": "Se il treno NON è stato cancellato nella tratta finale, bensì è deviato, e cambia numero.",
"properties": {
"haCambiNumero": {
"const": true
}
}
},
"then": {
"properties": {
"compImgCambiNumerazione": {
"const": " <img src=\"/vt_static/img/legenda/icone_legenda/numerazioni.png\"> <img src=\"/vt_static/img/legenda/icone_legenda/deviazione.png\">"
}
}
},
"else": {
"$comment": "Se il treno NON è stato cancellato nella tratta finale, bensì è deviato, e NON cambia numero.",
"properties": {
"compImgCambiNumerazione": {
"const": " <img src=\"/vt_static/img/legenda/icone_legenda/deviazione.png\">"
}
}
}
},
"else": {
"$comment": "Se il treno NON è stato cancellato nella tratta finale e NON è deviato.",
"if": {
"$comment": "Se il treno NON è stato cancellato nella tratta finale, non è deviato e cambia numero.",
"properties": {
"haCambiNumero": {
"const": true
}
}
},
"then": {
"properties": {
"compImgCambiNumerazione": {
"const": " <img src=\"/vt_static/img/legenda/icone_legenda/numerazioni.png\">"
}
}
},
"else": {
"$comment": "Se il treno NON è stato cancellato nella tratta finale, non è deviato e NON cambia numero.",
"properties": {
"compImgCambiNumerazione": {
"const": " "
}
}
}
}
}
}
},
{
"if": {
"$comment": "Se il treno è in stazione.",
"properties": {
"inStazione": {
"const": true
}
}
},
"then": {
"properties": {
"compInStazionePartenza": {
"not": {
"const": ["", "", "", "", "", "", "", "", ""]
}
},
"compInStazioneArrivo": {
"not": {
"const": ["", "", "", "", "", "", "", "", ""]
}
}
}
},
"else": {
"$comment": "Se il treno NON è in stazione.",
"properties": {
"compInStazionePartenza": {
"const": ["", "", "", "", "", "", "", "", ""]
},
"compInStazioneArrivo": {
"const": ["", "", "", "", "", "", "", "", ""]
}
}
}
}
]
}
}