Skip to content

Commit

Permalink
chore: move to new display urls
Browse files Browse the repository at this point in the history
  • Loading branch information
davwheat committed Feb 22, 2024
1 parent dfdd361 commit 4338a58
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/components/AmeyLiveTrainAnnouncements.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,16 @@ export interface LiveTrainAnnouncementsProps<SystemKeys extends string> {
standingTrainHandler: Record<SystemKeys, (options: IStandingTrainAnnouncementOptions) => Promise<void>>
}

type DisplayType = 'gtr-new' | 'tfwm-lcd'
type DisplayType = 'infotec-landscape-dmi' | 'blackbox-landscape-lcd'

const MindTheGapStations: Record<string, string[]> = {
WVF: ['1', '2'],
LWS: ['1', '2', '3', '4', '5'],
}

const DisplayNames: Record<DisplayType, string> = {
'gtr-new': 'Infotec dot matrix (GTR-style)',
'tfwm-lcd': 'WMR/LNWR LCD',
'infotec-landscape-dmi': 'Infotec landscape DMI',
'blackbox-landscape-lcd': 'Blackbox landscape LCD',
}

export function LiveTrainAnnouncements<SystemKeys extends string>({
Expand Down Expand Up @@ -157,7 +157,7 @@ export function LiveTrainAnnouncements<SystemKeys extends string>({
},
)

const [displayType, setDisplayType] = useState<DisplayType>('gtr-new')
const [displayType, setDisplayType] = useState<DisplayType>('infotec-landscape-dmi')
const [isFullscreen, setFullscreen] = useState(false)
const [selectedCrs, setSelectedCrs] = useState('ECR')
const [hasEnabledFeature, setHasEnabledFeature] = useState(false)
Expand Down Expand Up @@ -1051,7 +1051,6 @@ export function LiveTrainAnnouncements<SystemKeys extends string>({
])

const iframeQueryParams = new URLSearchParams({
type: displayType,
station: selectedCrs,
noBg: '1',
hideSettings: '1',
Expand Down Expand Up @@ -1466,7 +1465,7 @@ export function LiveTrainAnnouncements<SystemKeys extends string>({
height: '100%',
},
}}
src={`https://raildotmatrix.co.uk/board/?${iframeQueryParams}`}
src={`https://raildotmatrix.co.uk/board/${displayType}?${iframeQueryParams}`}
/>
</FullScreen>

Expand Down

0 comments on commit 4338a58

Please sign in to comment.