foo
This commit is contained in:
commit
b97b221891
8 changed files with 243 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
modules/*
|
16
inc/bahnhoefe.sh
Executable file
16
inc/bahnhoefe.sh
Executable file
|
@ -0,0 +1,16 @@
|
||||||
|
ZielBhf() {
|
||||||
|
FileZielBhf=$(awk -F, -v search="$ZielBhf" '$5 == search {print $1}' modules/ziele.csv)
|
||||||
|
FullZielBhf=$(awk -F, -v search="$ZielBhf" '$5 == search {print $6}' modules/ziele.csv)
|
||||||
|
printf "${RED}$FullZielBhf${NC}\n"
|
||||||
|
mpv modules/dt/ziele/variante2/hoch/$FileZielBhf 2&>1 1>/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
ViaBhf() {
|
||||||
|
IFS=',' read -ra values <<< $ViaBhf
|
||||||
|
for value in "${values[@]}"; do
|
||||||
|
FileViaBhf=$(awk -F, -v search="$value" '$5 == search {print $1}' modules/ziele.csv)
|
||||||
|
FullViaBhf=$(awk -F, -v search="$value" '$5 == search {print $6}' modules/ziele.csv)
|
||||||
|
printf "${RED}$FullViaBhf${NC}\n"
|
||||||
|
mpv modules/dt/ziele/variante2/hoch/$FileViaBhf 2&>1 1>/dev/null
|
||||||
|
done
|
||||||
|
}
|
49
inc/floskeln.sh
Executable file
49
inc/floskeln.sh
Executable file
|
@ -0,0 +1,49 @@
|
||||||
|
MeineDamenundHerrenanGleis() {
|
||||||
|
#Meine Damen und Herren, an Gleis
|
||||||
|
printf "${RED}Meine Damen und Herren an Gleis${NC}\n"
|
||||||
|
mpv modules/dt/module/0143.wav 2&>1 1>/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
vorsicht_bei_der_einfahrt() {
|
||||||
|
#Bitte vorsicht bei der Einfahrt
|
||||||
|
printf "${RED}Bitte Vorsicht bei der Einfahrt${NC}\n"
|
||||||
|
mpv modules/dt/module/0012.wav 2&>1 1>/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
BitteBeachtenSie() {
|
||||||
|
#bitte beachten sie
|
||||||
|
printf "${RED}Bitte beachten sie${NC}\n"
|
||||||
|
mpv modules/dt/module/0089.wav 2&>1 1>/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
InformationZu() {
|
||||||
|
#information zu,
|
||||||
|
printf "${RED}Information zu${NC}\n"
|
||||||
|
mpv modules/dt/module_3_1/030.wav 2&>1 1>/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
Nach() {
|
||||||
|
#nach
|
||||||
|
printf "${RED}Nach${NC}\n"
|
||||||
|
mpv modules/dt/module/0054.wav 2&>1 1>/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
Ueber() {
|
||||||
|
#über
|
||||||
|
printf "${RED}über${NC}\n"
|
||||||
|
mpv modules/dt/module/0063.wav 2&>1 1>/dev/null
|
||||||
|
}
|
||||||
|
Abfahrt_ursp() {
|
||||||
|
printf "${RED}Abfahrt ursprünglich${NC}\n"
|
||||||
|
mpv modules/dt/module_3_1/002.wav 2&>1 1>/dev/null
|
||||||
|
}
|
||||||
|
Ankunft_ursp() {
|
||||||
|
printf "${RED}Ankunft ursprünglich${NC}\n"
|
||||||
|
mpv modules/dt/module_3_1/005.wav 2&>1 1>/dev/null
|
||||||
|
}
|
||||||
|
Dieser_Zug_wird() {
|
||||||
|
printf "${RED}Dieser Zug wird${NC}\n"
|
||||||
|
#Dieser Zug wird
|
||||||
|
mpv modules/dt/module/0207.wav 2&>1 1>/dev/null
|
||||||
|
}
|
||||||
|
|
17
inc/platform.sh
Executable file
17
inc/platform.sh
Executable file
|
@ -0,0 +1,17 @@
|
||||||
|
GleisNr() {
|
||||||
|
#Gleis
|
||||||
|
printf "${RED}$GleisNr${NC}\n"
|
||||||
|
mpv modules/dt/gleise_zahlen/hoch//$GleisNr.wav 2&>1 1>/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
ZugEinfahrt() {
|
||||||
|
#fährt jetzt ein
|
||||||
|
printf "${RED}fährt jetzt ein${NC}\n"
|
||||||
|
mpv modules/dt/module/0095.wav 2&>1 1>/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
planm_abfahrt() {
|
||||||
|
printf "${RED}planmäßige Abfahrt${NC}\n"
|
||||||
|
#planmäßige Abfahrt
|
||||||
|
mpv modules/dt/module/0438.wav 2&>1 1>/dev/null
|
||||||
|
}
|
5
inc/tones.sh
Executable file
5
inc/tones.sh
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
Ansage_Start() {
|
||||||
|
#Gong
|
||||||
|
printf "${RED}Gong${NC}\n"
|
||||||
|
mpv modules/gong/klangtyp_modern/ag-short-gong3.wav 2&>1 1>/dev/null
|
||||||
|
}
|
39
inc/zeiten.sh
Executable file
39
inc/zeiten.sh
Executable file
|
@ -0,0 +1,39 @@
|
||||||
|
uhrzeit(){
|
||||||
|
length=${#AbfahrtUhr}
|
||||||
|
|
||||||
|
# Check if the number has at least 3 digits
|
||||||
|
if [[ $length -eq 1 ]]; then
|
||||||
|
mpv modules/dt/gleise_zahlen//hoch/$AbfahrtUhr.wav 2&>1 1>/dev/null
|
||||||
|
echo "1 Digit"
|
||||||
|
elif [[ $length -eq 2 ]]; then
|
||||||
|
mpv modules/dt/gleise_zahlen//hoch/$AbfahrtUhr.wav 2&>1 1>/dev/null
|
||||||
|
echo "2 Digit"
|
||||||
|
elif [[ $length -eq 3 ]]; then
|
||||||
|
# Get the first part by truncating to the nearest hundred
|
||||||
|
first_part=$(($AbfahrtUhr / 100 * 100)) # Truncate to the nearest hundred
|
||||||
|
second_part=$(($AbfahrtUhr % 100)) # Get the remainder (last two digits)
|
||||||
|
|
||||||
|
printf "${RED}$first_part $second_part${NC}\n"
|
||||||
|
mpv modules/dt/gleise_zahlen//hoch/${first_part}_.wav modules/dt/gleise_zahlen/hoch//$second_part.wav 2&>1 1>/dev/null
|
||||||
|
|
||||||
|
elif [[ $length -eq 4 ]]; then
|
||||||
|
# Split a 4-digit number into 2 + 2
|
||||||
|
first_part="${AbfahrtUhr:0:2}" # First two digits
|
||||||
|
second_part="${AbfahrtUhr:2:2}" # Last two digits
|
||||||
|
|
||||||
|
printf "${RED}$first_part Uhr${NC}\n"
|
||||||
|
mpv modules/dt/zeiten/stunden/hoch/${first_part}.wav 2&>1 1>/dev/null
|
||||||
|
printf "${RED}$second_part${NC}\n"
|
||||||
|
mpv modules/dt/zeiten/minuten/hoch/$second_part.wav 2&>1 1>/dev/null
|
||||||
|
|
||||||
|
else
|
||||||
|
echo "Please enter a number with at least 3 digits."
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
verspaetung_45() {
|
||||||
|
printf "${RED}voraussichtlich 45 Min später eintreffen${NC}\n"
|
||||||
|
#vorraussichtlich 45 Minuten später eintreffen
|
||||||
|
mpv modules/dt/zeiten/verspaetung_an/045.wav 2&>1 1>/dev/null
|
||||||
|
}
|
||||||
|
|
46
inc/zuege.sh
Executable file
46
inc/zuege.sh
Executable file
|
@ -0,0 +1,46 @@
|
||||||
|
Zuggattung() {
|
||||||
|
#ICE, RE usw.
|
||||||
|
printf "${RED}$Zuggattung${NC}\n"
|
||||||
|
mpv modules/dt/zuggattungen/hoch//$Zuggattung.wav 2&>1 1>/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
ZugNr() {
|
||||||
|
# Check if the input is a valid number
|
||||||
|
if ! [[ "$ZugNr" =~ ^[0-9]+$ ]]; then
|
||||||
|
echo "Please enter a valid number."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# Get the length of the number
|
||||||
|
length=${#ZugNr}
|
||||||
|
|
||||||
|
# Check if the number has at least 3 digits
|
||||||
|
if [[ $length -eq 1 ]]; then
|
||||||
|
mpv modules/dt/gleise_zahlen//hoch/$ZugNr.wav 2&>1 1>/dev/null
|
||||||
|
printf "${RED}$ZugNr${NC}\n"
|
||||||
|
elif [[ $length -eq 2 ]]; then
|
||||||
|
printf "${RED}$ZugNr${NC}\n"
|
||||||
|
mpv modules/dt/gleise_zahlen//hoch/$ZugNr.wav 2&>1 1>/dev/null
|
||||||
|
elif [[ $length -eq 3 ]]; then
|
||||||
|
# Get the first part by truncating to the nearest hundred
|
||||||
|
first_part=$(($ZugNr / 100 * 100)) # Truncate to the nearest hundred
|
||||||
|
second_part=$(($ZugNr % 100)) # Get the remainder (last two digits)
|
||||||
|
|
||||||
|
printf "${RED}$first_part${NC}\n"
|
||||||
|
mpv modules/dt/gleise_zahlen//hoch/${first_part}_.wav 2&>1 1>/dev/null
|
||||||
|
printf "${RED}$second_part${NC}\n"
|
||||||
|
mpv modules/dt/gleise_zahlen/hoch//$second_part.wav 2&>1 1>/dev/null
|
||||||
|
|
||||||
|
elif [[ $length -eq 4 ]]; then
|
||||||
|
# Split a 4-digit number into 2 + 2
|
||||||
|
first_part="${ZugNr:0:2}" # First two digits
|
||||||
|
second_part="${ZugNr:2:2}" # Last two digits
|
||||||
|
|
||||||
|
printf "${RED}$first_part${NC}\n"
|
||||||
|
mpv modules/dt/gleise_zahlen//hoch/${first_part}.wav 2&>1 1>/dev/null
|
||||||
|
printf "${RED}$second_part${NC}\n"
|
||||||
|
mpv modules/dt/gleise_zahlen/hoch//$second_part.wav 2&>1 1>/dev/null
|
||||||
|
|
||||||
|
else
|
||||||
|
echo "Please enter a number with at least 3 digits."
|
||||||
|
fi
|
||||||
|
}
|
70
play.sh
Executable file
70
play.sh
Executable file
|
@ -0,0 +1,70 @@
|
||||||
|
AnsageTyp=$1
|
||||||
|
GleisNr=$2
|
||||||
|
Zuggattung=$3
|
||||||
|
ZugNr=$4
|
||||||
|
ZielBhf=$5
|
||||||
|
ViaBhf=$6
|
||||||
|
AbfahrtUhr=$7
|
||||||
|
|
||||||
|
RED='\033[0;31m'
|
||||||
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
|
. $(dirname $0)/inc/floskeln.sh
|
||||||
|
. $(dirname $0)/inc/bahnhoefe.sh
|
||||||
|
. $(dirname $0)/inc/floskeln.sh
|
||||||
|
. $(dirname $0)/inc/platform.sh
|
||||||
|
. $(dirname $0)/inc/tones.sh
|
||||||
|
. $(dirname $0)/inc/zeiten.sh
|
||||||
|
. $(dirname $0)/inc/zuege.sh
|
||||||
|
|
||||||
|
if [ $AnsageTyp = "Einfahrt" ]; then
|
||||||
|
Ansage_Start
|
||||||
|
read -t 0.5
|
||||||
|
MeineDamenundHerrenanGleis
|
||||||
|
read -t 0.5
|
||||||
|
GleisNr $GleisNr
|
||||||
|
read -t 0.5
|
||||||
|
ZugEinfahrt
|
||||||
|
read -t 0.5
|
||||||
|
Zuggattung $Zuggattung
|
||||||
|
read -t 0.5
|
||||||
|
ZugNr $ZugNr
|
||||||
|
read -t 0.5
|
||||||
|
Nach
|
||||||
|
read -t 0.5
|
||||||
|
ZielBhf $ZielBhf
|
||||||
|
read -t 0.5
|
||||||
|
Ueber
|
||||||
|
read -t 0.5
|
||||||
|
ViaBhf $ViaBhf
|
||||||
|
read -t 0.5
|
||||||
|
planm_abfahrt
|
||||||
|
read -t 0.5
|
||||||
|
uhrzeit $AbfahrtUhr
|
||||||
|
read -t 0.5
|
||||||
|
vorsicht_bei_der_einfahrt
|
||||||
|
|
||||||
|
elif [ $AnsageTyp = "Information" ]; then
|
||||||
|
Ansage_Start
|
||||||
|
InformationZu
|
||||||
|
Zuggattung $Zuggattung
|
||||||
|
ZugNr $ZugNr
|
||||||
|
Nach
|
||||||
|
ZielBhf $ZielBhf
|
||||||
|
Ankunft_ursp
|
||||||
|
uhrzeit $AbfahrtUhr
|
||||||
|
Abfahrt_ursp
|
||||||
|
uhrzeit $AbfahrtUhr
|
||||||
|
Dieser_Zug_wird
|
||||||
|
verspaetung_45
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
#Dieser Zug wird
|
||||||
|
#mpv modules/dt/module/0207.wav
|
||||||
|
#vorraussichtlich 45 Minuten später eintreffen
|
||||||
|
#mpv modules/dt/zeiten/verspaetung_an/045.wav
|
||||||
|
#Grund dafür verspätung vorausfahender zug
|
||||||
|
#mpv modules/dt/grund_dafuer/035.wav
|
||||||
|
#Wir bitten um Entschuldigung
|
||||||
|
#mpv modules/dt/module_3_1/042.wav
|
||||||
|
|
Loading…
Add table
Reference in a new issue