@@ -7,24 +7,26 @@ import TrainAnnouncementSystem from '../../TrainAnnouncementSystem'
7
7
8
8
interface IApproachingStationAnnouncementOptions {
9
9
stationCode : string
10
+ terminatesHere : boolean
10
11
ticketsReady : boolean
11
12
mindTheGap : boolean
12
13
}
13
14
14
15
interface IWelcomeAnnouncementOptions {
15
16
terminatesAtCode : string
17
+ terminatesHere : boolean
16
18
readAllStations : boolean
17
19
callingAtCodes : { crsCode : string ; name : string ; randomId : string } [ ]
18
20
}
19
21
20
22
const announcementPresets : Readonly < Record < string , ICustomAnnouncementPreset [ ] > > = {
21
23
welcome : [
22
24
{
23
- name : 'Birmingham Snow Hill to Worcester Forgate Street' ,
25
+ name : 'Dorridge to Worcester Forgate Street' ,
24
26
state : {
25
27
terminatesAtCode : 'WOF' ,
26
28
readAllStations : true ,
27
- callingAtCodes : [ 'JEQ' , 'THW' , 'SGB' , 'ROW' , 'CRA' , 'SBJ' , 'HAG' , 'BKD' , 'KID' , 'HBY' , 'DTW' ] . map ( crsToStationItemMapper ) ,
29
+ callingAtCodes : [ 'WMR' , 'SOL' , 'OLT' , 'ACG' , 'TYS' , 'SMA' , 'BMO' , 'BSW' , ' JEQ', 'THW' , 'SGB' , 'ROW' , 'CRA' , 'SBJ' , 'HAG' , 'BKD' , 'KID' , 'HBY' , 'DTW' ] . map ( crsToStationItemMapper ) ,
28
30
} ,
29
31
} ,
30
32
] ,
@@ -43,6 +45,10 @@ export default class WMTClass172 extends TrainAnnouncementSystem {
43
45
files . push ( 'we are now approaching' )
44
46
files . push ( { id : `stations.${ options . stationCode } ` , opts : { delayStart : 200 } } )
45
47
48
+ if ( options . terminatesHere ) {
49
+ files . push ( { id : 'our final destination' , opts : { delayStart : 200 } } )
50
+ }
51
+
46
52
if ( options . ticketsReady ) {
47
53
files . push ( { id : 'please have your tickets ready' , opts : { delayStart : 300 } } )
48
54
}
@@ -63,6 +69,16 @@ export default class WMTClass172 extends TrainAnnouncementSystem {
63
69
64
70
const files : AudioItem [ ] = [ ]
65
71
files . push ( 'bing bong' )
72
+
73
+ if ( options . terminatesHere ) {
74
+ files . push ( 'this is' )
75
+ files . push ( { id : `stations.${ terminatesAtCode } ` , opts : { delayStart : 200 } } )
76
+ files . push ( { id : 'our final destination' , opts : { delayStart : 200 } } )
77
+ files . push ( { id : 'please mind the gap when leaving the train and step' , opts : { delayStart : 500 } } )
78
+ await this . playAudioFiles ( files , download )
79
+ return
80
+ }
81
+
66
82
files . push ( 'welcome to this service for' )
67
83
files . push ( { id : `stations.${ terminatesAtCode } ` , opts : { delayStart : 200 } } )
68
84
@@ -73,10 +89,7 @@ export default class WMTClass172 extends TrainAnnouncementSystem {
73
89
74
90
if ( callingAtCodes . some ( code => ! this . validateStationExists ( code ) ) ) return
75
91
76
- if ( remainingStops . length === 0 ) {
77
- // We are at the termination point.
78
- // files.push('this train terminates here all change please ensure')
79
- } else if ( remainingStops . length === 1 || ! readAllStations ) {
92
+ if ( remainingStops . length === 1 || ! readAllStations ) {
80
93
// Next station is the termination point or we are not reading all stations.
81
94
files . push ( { id : `the next station is` , opts : { delayStart : 200 } } )
82
95
files . push ( remainingStops [ 0 ] )
@@ -108,7 +121,10 @@ export default class WMTClass172 extends TrainAnnouncementSystem {
108
121
'SBJ' ,
109
122
'SGB' ,
110
123
'SMA' ,
124
+ 'SOL' ,
111
125
'THW' ,
126
+ 'TYS' ,
127
+ 'WMR' ,
112
128
'WOF' ,
113
129
'WOS' ,
114
130
]
@@ -124,6 +140,7 @@ export default class WMTClass172 extends TrainAnnouncementSystem {
124
140
component : CustomAnnouncementPane ,
125
141
defaultState : {
126
142
stationCode : this . RealAvailableStationNames [ 0 ] ,
143
+ terminatesHere : false ,
127
144
ticketsReady : true ,
128
145
mindTheGap : true ,
129
146
} ,
@@ -146,6 +163,11 @@ export default class WMTClass172 extends TrainAnnouncementSystem {
146
163
type : 'boolean' ,
147
164
default : true ,
148
165
} ,
166
+ terminatesHere : {
167
+ name : 'Train terminates here?' ,
168
+ type : 'boolean' ,
169
+ default : false ,
170
+ } ,
149
171
} ,
150
172
} ,
151
173
} as CustomAnnouncementTab < keyof IApproachingStationAnnouncementOptions > ,
@@ -154,6 +176,7 @@ export default class WMTClass172 extends TrainAnnouncementSystem {
154
176
component : CustomAnnouncementPane ,
155
177
defaultState : {
156
178
terminatesAtCode : this . RealAvailableStationNames [ 0 ] ,
179
+ terminatesHere : false ,
157
180
readAllStations : true ,
158
181
callingAtCodes : [ ] ,
159
182
} ,
@@ -172,6 +195,11 @@ export default class WMTClass172 extends TrainAnnouncementSystem {
172
195
type : 'boolean' ,
173
196
default : true ,
174
197
} ,
198
+ terminatesHere : {
199
+ name : 'Train terminates here?' ,
200
+ type : 'boolean' ,
201
+ default : false ,
202
+ } ,
175
203
callingAtCodes : {
176
204
name : '' ,
177
205
type : 'custom' ,
0 commit comments