Skip to content

Commit

Permalink
feat: add first class location
Browse files Browse the repository at this point in the history
  • Loading branch information
opott authored and davwheat committed Apr 8, 2024
1 parent ead1dea commit 959ab78
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/announcement-data/systems/stations/AmeyPhil.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export interface INextTrainAnnouncementOptions {
terminatingStationCode: string
vias: CallingAtPoint[]
callingAt: CallingAtPoint[]
firstClassLocation: string
coaches: string | null
}

Expand Down Expand Up @@ -4537,6 +4538,13 @@ export default class AmeyPhil extends StationAnnouncementSystem {
)),
)

if (options.firstClassLocation !== 'none') {
files.push(
{ id: `m.first class accommodation is situated at the`, opts: { delayStart: 500 } },
`e.${options.firstClassLocation} of the train`,
)
}

if (options.coaches) {
const coaches = options.coaches.split(' ')[0]

Expand Down Expand Up @@ -4645,6 +4653,13 @@ export default class AmeyPhil extends StationAnnouncementSystem {
)),
)

if (options.firstClassLocation !== 'none') {
files.push(
{ id: `m.first class accommodation is situated at the`, opts: { delayStart: 500 } },
`e.${options.firstClassLocation} of the train`,
)
}

await this.playAudioFiles(files, download)
}

Expand Down Expand Up @@ -5289,6 +5304,17 @@ export default class AmeyPhil extends StationAnnouncementSystem {
} as ICallingAtSelectorProps,
default: [],
},
firstClassLocation: {
name: 'First Class Location',
type: 'select',
default: 'none',
options: [
{ title: 'None', value: 'none' },
{ title: 'Front of Train', value: 'front' },
{ title: 'Middle of Train', value: 'middle' },
{ title: 'Rear of Train', value: 'rear' },
],
},
coaches: {
name: 'Coach count',
default: '8 coaches',
Expand Down Expand Up @@ -5518,6 +5544,17 @@ export default class AmeyPhil extends StationAnnouncementSystem {
} as ICallingAtSelectorProps,
default: [],
},
firstClassLocation: {
name: 'First Class Location',
type: 'select',
default: 'none',
options: [
{ title: 'None', value: 'none' },
{ title: 'Front of Train', value: 'front' },
{ title: 'Middle of Train', value: 'middle' },
{ title: 'Rear of Train', value: 'rear' },
],
},
coaches: {
name: 'Coach count',
default: '8 coaches',
Expand Down

0 comments on commit 959ab78

Please sign in to comment.