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 Nov 25, 2023
2 parents 864dbb0 + ea273c6 commit 177bedc
Show file tree
Hide file tree
Showing 35 changed files with 359 additions and 233 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/smoketest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ jobs:
id: gatsbyCache
with:
path: ./.cache
key: ${{ runner.os }}-gatsby-cache-${{ secrets.CACHE_VERSION }}-${{ hashFiles('public') }}
key: ${{ runner.os }}-gatsby-cache-${{ hashFiles('public') }}
restore-keys: |
${{ runner.os }}-gatsby-cache-${{ secrets.CACHE_VERSION }}-
${{ runner.os }}-gatsby-cache-
- name: Build site
run: yarn build:ci
Expand All @@ -75,7 +75,6 @@ jobs:

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
if: github.ref == 'refs/heads/deploy' && github.event_name == 'push'
with:
path: ./public

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@
"uk-railway-stations": "^1.5.1"
},
"devDependencies": {
"@sentry/cli": "^2.21.5",
"@sentry/cli": "^2.22.2",
"@types/react-beautiful-dnd": "^13.1.7",
"cross-env": "^7.0.3",
"gatsby-plugin-webpack-bundle-analyser-v2": "^1.1.32",
"prettier": "^3.1.0",
"typescript": "^5.2.2"
"typescript": "^5.3.2"
},
"packageManager": "[email protected]"
}
4 changes: 2 additions & 2 deletions src/announcement-data/systems/stations/AmeyCelia.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export default class AmeyCelia extends AmeyPhil {
readonly FILE_PREFIX = 'station/ketech/celia'
readonly SYSTEM_TYPE = 'station'

protected readonly CALLING_POINT_DELAY = 100
protected readonly CALLING_POINT_AND_DELAY = 50
protected readonly CALLING_POINT_DELAY = 160
protected readonly CALLING_POINT_AND_DELAY = 80

protected get DEFAULT_CHIME(): ChimeType {
return 'three'
Expand Down
44 changes: 36 additions & 8 deletions src/announcement-data/systems/stations/AmeyPhil.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,23 @@ export default class AmeyPhil extends StationAnnouncementSystem {
},
},
],
disruptedTrain: [
{
name: '21:39 +44 | SN Havant to SOU',
// Modelled on https://www.realtimetrains.co.uk/service/gb-nr:Y50425/2023-11-24/detailed
state: {
chime: this.DEFAULT_CHIME,
hour: '21',
min: '39',
toc: 'southern',
terminatingStationCode: 'SOU',
vias: ['FRM'].map(crsToStationItemMapper),
disruptionType: 'delayedBy',
delayTime: '44',
disruptionReason: 'awaiting a member of the train crew',
},
},
],
}
}

Expand Down Expand Up @@ -4036,20 +4053,31 @@ export default class AmeyPhil extends StationAnnouncementSystem {
}

files.push(`${endInflection}.${num !== 1 ? 'minutes' : 'minute'}`)

if (options.disruptionReason) {
files.push('m.due to', `disruption-reason.e.${options.disruptionReason}`)
}
break
case 'delay':
files.push(`${endInflection}.is being delayed`)
if (options.disruptionReason) {
files.push('m.is being delayed due to', `disruption-reason.e.${options.disruptionReason}`)
} else {
files.push('e.is being delayed')
}
break
case 'cancel':
files.push(`${endInflection}.has been cancelled`)
if (options.disruptionReason) {
files.push('m.has been cancelled due to', `disruption-reason.e.${options.disruptionReason}`)
} else {
files.push('e.has been cancelled')
}
break
}

if (options.disruptionReason) {
files.push('m.due to', `disruption-reason.e.${options.disruptionReason}`)
}

files.push({ id: 'w.were sorry for the delay this will cause to your journey', opts: { delayStart: 250 } })
files.push(
{ id: 'w.please listen for further announcements', opts: { delayStart: 250 } },
{ id: 'w.were sorry for the delay this will cause to your journey', opts: { delayStart: 250 } },
)

await this.playAudioFiles(files, download)
}
Expand Down Expand Up @@ -4187,7 +4215,7 @@ export default class AmeyPhil extends StationAnnouncementSystem {
name: 'Disrupted train',
component: CustomAnnouncementPane,
props: {
// presets: this.announcementPresets.nextTrain,
presets: this.announcementPresets.disruptedTrain,
playHandler: this.playDisruptedTrainAnnouncement.bind(this),
options: {
chime: {
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified static/audio/station/ketech/celia/station/e/SOU.mp3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified static/audio/station/ketech/celia/station/m/SOU.mp3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed static/audio/station/ketech/phil/station/e/HMT-2.mp3
Binary file not shown.
Binary file modified static/audio/station/ketech/phil/station/e/HMT.mp3
Binary file not shown.
Binary file modified static/audio/station/ketech/phil/station/m/HMT-2.mp3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
30 changes: 30 additions & 0 deletions static/audio/station/ketech/update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# This script is used to update the audio files for the KeTech/Amey systems
# from the master copy.
#
# It assumes you have a copy of https://github.com/Rail-Announcements/ketech-llpa-announcements
# cloned under ~/ketech-llpa-announcements

# Current pwd
pwd=$(pwd)

# Get script dir
dir="$(cd -P -- "$(dirname -- "$0")" && pwd -P)"

# Set working dir to script dir
cd $dir

# Remove existing files
rm -rf phil/* celia/*

# Copy renamed files
cp -r ~/ketech-llpa-announcements/renamed/Male1/* ./phil/
cp -r ~/ketech-llpa-announcements/renamed/Female1/* ./celia/

# Copy extra custom files
cp -r ~/ketech-llpa-announcements/custom/Male1/* ./phil/
cp -r ~/ketech-llpa-announcements/custom/Female1/* ./celia/

# Set working dir back to original
cd $pwd
Loading

0 comments on commit 177bedc

Please sign in to comment.