Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip: feat: bombardier xstar improvements #225

Merged
merged 4 commits into from
Jun 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
feat: configurable oyster and unattended item warnings
  • Loading branch information
davwheat committed Jun 2, 2024
commit db25daac5f7fc0f9fee6d7c4d22647cbbb00eea9
Binary file added audio/SN/377/you cannot use oyster.mp3
Binary file not shown.
24 changes: 20 additions & 4 deletions src/announcement-data/systems/rolling-stock/BombardierXstar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import TrainAnnouncementSystem from '../../TrainAnnouncementSystem'
interface IApproachingStationAnnouncementOptions {
stationCode: string
mindTheGap: boolean
keepBelongings: boolean
cannotUseOyster: boolean
}

interface IStoppedAtStationAnnouncementOptions {
Expand Down Expand Up @@ -65,8 +67,6 @@ export default class BombardierXstar extends TrainAnnouncementSystem {
readonly FILE_PREFIX = 'SN/377'
readonly SYSTEM_TYPE = 'train'

private readonly stationsWithUnattendedBaggageAnnouncement = ['GTW']

private async playApproachingStationAnnouncement(options: IApproachingStationAnnouncementOptions, download: boolean = false): Promise<void> {
const files: AudioItem[] = []

Expand All @@ -77,8 +77,14 @@ export default class BombardierXstar extends TrainAnnouncementSystem {
files.push('please mind the gap between the train and the platform')
}

if (this.stationsWithUnattendedBaggageAnnouncement.includes(options.stationCode)) {
files.push('please do not leave unattended items of luggage in the train or on the station', '61016')
if (options.keepBelongings) {
if (options.mindTheGap) files.push('and')

files.push('please do not leave unattended items of luggage in the train or on the station')
}

if (options.cannotUseOyster) {
files.push('you cannot use oyster')
}

await this.playAudioFiles(files, download)
Expand Down Expand Up @@ -463,6 +469,16 @@ export default class BombardierXstar extends TrainAnnouncementSystem {
type: 'boolean',
default: true,
},
keepBelongings: {
name: 'Keep belongings with you?',
type: 'boolean',
default: false,
},
cannotUseOyster: {
name: 'Cannot use Oyster/Contactless beyond here?',
type: 'boolean',
default: false,
},
},
},
} as CustomAnnouncementTab<keyof IApproachingStationAnnouncementOptions>,
Expand Down
Loading