diff --git a/src/data/liveTrains/shortPlatforms.ts b/src/data/liveTrains/shortPlatforms.ts index d6068b9c1..9c46664dc 100644 --- a/src/data/liveTrains/shortPlatforms.ts +++ b/src/data/liveTrains/shortPlatforms.ts @@ -1772,6 +1772,15 @@ const data: Record< }, }, DVP: { + '1': { + SE: southeasternHs1('front.8', 'front.12'), + }, + '2': { + SE: southeasternHs1('front.8', 'front.10'), + }, + '3': { + SE: 'front.8', + }, '*': { SE: 'front.8', }, @@ -2161,3 +2170,21 @@ function southernTurboElectro(turboLen: `${'front' | 'middle' | 'rear'}.${number return electroLen } } + +function southeasternHs1(nonHs1: `${'front' | 'middle' | 'rear'}.${number}`, hs1: `${'front' | 'middle' | 'rear'}.${number}`) { + return (trainService: TrainService): `${'front' | 'middle' | 'rear'}.${number}` | null => { + const hs1Stations = ['STP', 'EBD', 'SFA', 'ASI', 'AFK'] + + if ( + trainService.origin.some(s => hs1Stations.includes(s.crs)) || + trainService.destination.some(s => hs1Stations.includes(s.crs)) || + trainService.origin.some(s => hs1Stations.includes(s.crs)) || + trainService.destination.some(s => hs1Stations.includes(s.crs)) || + trainService.subsequentLocations.some(s => hs1Stations.includes(s.crs || '')) + ) { + return hs1 + } + + return nonHs1 + } +}