Skip to content

Commit

Permalink
Merge branch 'main' into deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
davwheat committed Dec 17, 2023
2 parents 39df56e + c4ada4a commit c726001
Show file tree
Hide file tree
Showing 96 changed files with 19 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/announcement-data/systems/stations/AmeyCelia.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2780,6 +2780,7 @@ export default class AmeyCelia extends AmeyPhil {
'WEA',
'WED',
'WEE',
'WEH',
'WEL',
'WEM',
'WES',
Expand Down
19 changes: 16 additions & 3 deletions src/announcement-data/systems/stations/AmeyPhil.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1884,6 +1884,7 @@ export default class AmeyPhil extends StationAnnouncementSystem {
'HMP',
'HMS',
'HMT',
'HMW',
'HMY',
'HNA',
'HNB',
Expand Down Expand Up @@ -3155,6 +3156,7 @@ export default class AmeyPhil extends StationAnnouncementSystem {
'WEA',
'WED',
'WEE',
'WEH',
'WEL',
'WEM',
'WET',
Expand Down Expand Up @@ -5002,6 +5004,18 @@ function LiveTrainAnnouncements({ nextTrainHandler, disruptedTrainHandler, syste
[system],
)

const guessViaPoint = useCallback(function guessViaPoint(via: string): string | null {
if (stationNameToCrsMap[via]) return stationNameToCrsMap[via]

// Manual entries
switch (via) {
case 'cobham':
return 'CSD'
}

return null
}, [])

const announceNextTrain = useCallback(
async function announceNextTrain(train: TrainService, abortController: AbortController) {
console.log(train)
Expand All @@ -5020,9 +5034,8 @@ function LiveTrainAnnouncements({ nextTrainHandler, disruptedTrainHandler, syste
const toc = system.processTocForLiveTrains(train.operator, train.origin[0].crs, train.destination[0].crs)

const callingPoints = train.subsequentLocations.filter(s => {
if (s.isCancelled) return false
if (s.isPass) return false
if (!s.crs) return false
if (s.isCancelled || s.isOperational || s.isPass) return false
if (!system.STATIONS.includes(s.crs)) return false
return true
})
Expand Down Expand Up @@ -5057,7 +5070,7 @@ function LiveTrainAnnouncements({ nextTrainHandler, disruptedTrainHandler, syste
const v: string = train.destination[0].via.startsWith('via ') ? train.destination[0].via.slice(4) : train.destination[0].via

v.split(/(&|and)/).forEach(via => {
const guessViaCrs = stationNameToCrsMap[via.trim().toLowerCase()]
const guessViaCrs = guessViaPoint(via.trim().toLowerCase())

addLog(`Guessed via ${guessViaCrs} for ${via}`)
console.log(`[Live Trains] Guessed via ${guessViaCrs} for ${via}`)
Expand Down
4 changes: 2 additions & 2 deletions src/data/changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ const changelog: IChangelogVersion[] = [
additions: ['[Amey Phil] Bodged GWR TOC snippet'],
},
{
date: '2023-12-11',
additions: ['[LNER Azuma] Add Azuma announcement system'],
date: '2023-12-12',
additions: ['[LNER Azuma] Add Azuma announcement system', '[Amey Celia & Phil] Add approaching train option'],
},
]

Expand Down
Binary file not shown.
Binary file not shown.
Binary file modified static/audio/station/ketech/celia/station/e/AFS.mp3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified static/audio/station/ketech/celia/station/e/GIL.mp3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified static/audio/station/ketech/celia/station/e/HHY.mp3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified static/audio/station/ketech/celia/station/e/UPW.mp3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified static/audio/station/ketech/celia/station/e/YRK.mp3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified static/audio/station/ketech/celia/station/m/AFS.mp3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified static/audio/station/ketech/celia/station/m/GIL.mp3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified static/audio/station/ketech/celia/station/m/HHY.mp3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified static/audio/station/ketech/celia/station/m/UPW.mp3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified static/audio/station/ketech/celia/station/m/YRK.mp3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified static/audio/station/ketech/phil/station/e/AFS.mp3
Binary file not shown.
Binary file not shown.
Binary file removed static/audio/station/ketech/phil/station/e/BFN-2.mp3
Binary file not shown.
Binary file modified static/audio/station/ketech/phil/station/e/BFN.mp3
Binary file not shown.
Binary file not shown.
Binary file removed static/audio/station/ketech/phil/station/e/ESH-2.mp3
Binary file not shown.
Binary file modified static/audio/station/ketech/phil/station/e/ESH.mp3
Binary file not shown.
Binary file not shown.
Binary file removed static/audio/station/ketech/phil/station/e/GIL-3.mp3
Binary file not shown.
Binary file modified static/audio/station/ketech/phil/station/e/GIL.mp3
Binary file not shown.
Binary file not shown.
Binary file removed static/audio/station/ketech/phil/station/e/HHY-2.mp3
Binary file not shown.
Binary file modified static/audio/station/ketech/phil/station/e/HHY.mp3
Binary file not shown.
Binary file removed static/audio/station/ketech/phil/station/e/HMP-2.mp3
Binary file not shown.
Binary file modified static/audio/station/ketech/phil/station/e/HMP.mp3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified static/audio/station/ketech/phil/station/e/ROM-2.mp3
Binary file not shown.
Binary file removed static/audio/station/ketech/phil/station/e/ROM-3.mp3
Binary file not shown.
Binary file modified static/audio/station/ketech/phil/station/e/ROM.mp3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified static/audio/station/ketech/phil/station/m/AFS.mp3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified static/audio/station/ketech/phil/station/m/BFN.mp3
Binary file not shown.
Binary file not shown.
Binary file removed static/audio/station/ketech/phil/station/m/ESH-2.mp3
Binary file not shown.
Binary file modified static/audio/station/ketech/phil/station/m/ESH.mp3
Binary file not shown.
Binary file not shown.
Binary file removed static/audio/station/ketech/phil/station/m/FEL-2.mp3
Binary file not shown.
Binary file modified static/audio/station/ketech/phil/station/m/FEL.mp3
Binary file not shown.
Binary file not shown.
Binary file removed static/audio/station/ketech/phil/station/m/GIL-3.mp3
Binary file not shown.
Binary file modified static/audio/station/ketech/phil/station/m/GIL.mp3
Binary file not shown.
Binary file not shown.
Binary file removed static/audio/station/ketech/phil/station/m/HHY-2.mp3
Binary file not shown.
Binary file modified static/audio/station/ketech/phil/station/m/HHY.mp3
Binary file not shown.
Binary file not shown.
Binary file modified static/audio/station/ketech/phil/station/m/ROM-2.mp3
Binary file not shown.
Binary file removed static/audio/station/ketech/phil/station/m/ROM-3.mp3
Binary file not shown.
Binary file modified static/audio/station/ketech/phil/station/m/ROM.mp3
Binary file not shown.
Binary file not shown.
Binary file removed static/audio/station/ketech/phil/station/m/UPW-2.mp3
Binary file not shown.
Binary file modified static/audio/station/ketech/phil/station/m/UPW.mp3
Binary file not shown.

0 comments on commit c726001

Please sign in to comment.