Hallo,
ich habe schon einige Zeit an dem Script für eine DFI gearbeitet.
Leider funktioniert es weiterhin nicht so, wie ich es gerne möchte.
Code: DFI3.osc
'#################################
'Dynamic Busstop Display System
'#################################
'Displays actual time in "hh:mm Uhr" format,
'6 arrival times in "hh:mm" format
'6 (3) approximate arrival times in "hh:mm" format
'6 lines and
'6 destinations
'(c) 13.04.2022 jjb
'Script Version: 1.0
'Omsi release: 2.0.0.32
'Needs:
'- none
{init}
0 (S.L.RefreshCounter)
{end}
{frame}
' letzte Framedauer - Refreshcounter
(L.L.RefreshCounter) (L.S.Timegap) - (S.L.RefreshCounter)
' um Fehler zu vermeiden! nur refreshen, wenn Zeit abgelaufen
(L.L.RefreshCounter) 0 <
{if}
5 (S.L.RefreshCounter)
1 (S.L.Refresh_Strings)
{endif}
'###############
'Uhrzeit
'###############
(L.S.Time) 3600 / s0 trunc s1 "02" $IntToStrEnh ":" $+ l0 l1 - 60 * "02" $IntToStrEnh $+ " Uhr" $+ (S.$.Uhrzeit)
'###############
'Ziele
'###############
'Zeile 1: Ziel
0 (M.V.GetArrBusTerminus) (S.$.Dest1)
'Zeile 2: Ziel
1 (M.V.GetArrBusTerminus) (S.$.Dest2)
'Zeile 3: Ziel
2 (M.V.GetArrBusTerminus) (S.$.Dest3)
'Zeile 4: Ziel
3 (M.V.GetArrBusTerminus) (S.$.Dest4)
'Zeile 5: Ziel
4 (M.V.GetArrBusTerminus) (S.$.Dest5)
'Zeile 6: Ziel
5 (M.V.GetArrBusTerminus) (S.$.Dest6)
'###############
'Linien
'###############
'Zeile 1: Linie
0 (M.V.GetArrBusLine) (S.$.Line1)
'Zeile 2: Linie
1 (M.V.GetArrBusLine) (S.$.Line2)
'Zeile 3: Linie
2 (M.V.GetArrBusLine) (S.$.Line3)
'Zeile 4: Linie
3 (M.V.GetArrBusLine) (S.$.Line4)
'Zeile 5: Linie
4 (M.V.GetArrBusLine) (S.$.Line5)
'Zeile 6: Linie
5 (M.V.GetArrBusLine) (S.$.Line6)
'###############
'Differenz
'###############
' Zeile 1: Zeitdifferenz
0 (M.V.GetArrBusTimeDiff) (L.S.Time) + 3600 / s0 trunc s1 "02" $IntToStrEnh ":" $+ l0 l1 - 60 * "02" $IntToStrEnh $+ (S.$.Diff1)
' Zeile 2: Zeitdifferenz
1 (M.V.GetArrBusTimeDiff) (L.S.Time) + 3600 / s0 trunc s1 "02" $IntToStrEnh ":" $+ l0 l1 - 60 * "02" $IntToStrEnh $+ (S.$.Diff2)
' Zeile 3: Zeitdifferenz
2 (M.V.GetArrBusTimeDiff) (L.S.Time) + 3600 / s0 trunc s1 "02" $IntToStrEnh ":" $+ l0 l1 - 60 * "02" $IntToStrEnh $+ (S.$.Diff3)
' Zeile 4: Zeitdifferenz
3 (M.V.GetArrBusTimeDiff) (L.S.Time) + 3600 / s0 trunc s1 "02" $IntToStrEnh ":" $+ l0 l1 - 60 * "02" $IntToStrEnh $+ (S.$.Diff4)
' Zeile 5: Zeitdifferenz
4 (M.V.GetArrBusTimeDiff) (L.S.Time) + 3600 / s0 trunc s1 "02" $IntToStrEnh ":" $+ l0 l1 - 60 * "02" $IntToStrEnh $+ (S.$.Diff5)
' Zeile 6: Zeitdifferenz
5 (M.V.GetArrBusTimeDiff) (L.S.Time) + 3600 / s0 trunc s1 "02" $IntToStrEnh ":" $+ l0 l1 - 60 * "02" $IntToStrEnh $+ (S.$.Diff6)
'###############
'Tatsaechliche Ankunft
'###############
' tatsaechliche Ankunft zu nichts setzen
"" (S.$.Today1) (S.$.Today2) (S.$.Today3) (S.$.Today4) (S.$.Today5) (S.$.Today6)
0 (M.V.GetArrBusTimeDiff) 60 / 5 <
{if}
0 (M.V.GetArrBusTimeDiff) (L.S.Time) + 2 random + 3600 / s0 trunc s1 "02" $IntToStrEnh ":" $+ l0 l1 - 60 * "02" $IntToStrEnh $+ (S.$.Today1)
{endif}
1 (M.V.GetArrBusTimeDiff) 60 / 5 <
{if}
(M.V.GetArrBusTimeDiff) (L.S.Time) + 2 random + 3600 / s0 trunc s1 "02" $IntToStrEnh ":" $+ l0 l1 - 60 * "02" $IntToStrEnh $+ (S.$.Today2)
{endif}
2 (M.V.GetArrBusTimeDiff) 60 / 5 <
{if}
2 (M.V.GetArrBusTimeDiff) (L.S.Time) + 2 random + 3600 / s0 trunc s1 "02" $IntToStrEnh ":" $+ l0 l1 - 60 * "02" $IntToStrEnh $+ (S.$.Today3)
{endif}
3 (M.V.GetArrBusTimeDiff) 60 / 5 <
{if}
3 (M.V.GetArrBusTimeDiff) (L.S.Time) + 2 random + 3600 / s0 trunc s1 "02" $IntToStrEnh ":" $+ l0 l1 - 60 * "02" $IntToStrEnh $+ (S.$.Today4)
{endif}
4 (M.V.GetArrBusTimeDiff) 60 / 5 <
{if}
4 (M.V.GetArrBusTimeDiff) (L.S.Time) + 2 random + 3600 / s0 trunc s1 "02" $IntToStrEnh ":" $+ l0 l1 - 60 * "02" $IntToStrEnh $+ (S.$.Today5)
{endif}
5 (M.V.GetArrBusTimeDiff) 60 / 5 <
{if}
5 (M.V.GetArrBusTimeDiff) (L.S.Time) + 2 random + 3600 / s0 trunc s1 "02" $IntToStrEnh ":" $+ l0 l1 - 60 * "02" $IntToStrEnh $+ (S.$.Today6)
{endif}
' Informationen nur anzeigen, wenn Bus auch kommt
0 (M.V.GetArrBusTerminus) "" =
{if}
"" (S.$.Dest1) (S.$.Line1) (S.$.Diff1) (S.$.Today1)
{endif}
1 (M.V.GetArrBusTerminus) "" =
{if}
"" (S.$.Dest2) (S.$.Line2) (S.$.Diff2) (S.$.Today2)
{endif}
2 (M.V.GetArrBusTerminus) "" =
{if}
"" (S.$.Dest3) (S.$.Line3) (S.$.Diff3) (S.$.Today3)
{endif}
3 (M.V.GetArrBusTerminus) "" =
{if}
"" (S.$.Dest4) (S.$.Line4) (S.$.Diff4) (S.$.Today4)
{endif}
4 (M.V.GetArrBusTerminus) "" =
{if}
"" (S.$.Dest5) (S.$.Line5) (S.$.Diff5) (S.$.Today5)
{endif}
5 (M.V.GetArrBusTerminus) "" =
{if}
"" (S.$.Dest6) (S.$.Line6) (S.$.Diff6) (S.$.Today6)
{endif}
{end}
Alles anzeigen
Entweder zeigt es nichts an:
… oder nur die letzten drei Abfahrtszeiten:
Es liegt wirklich nur am Script. Die Textfelder sind alle richtig eingetragen und funktionieren alle. Ich nutze nicht einfach nur 1 (S.L.Refresh_Strings), da dies nie die Strings aktualisiert hat. Das Script ist irgendwie immer davor abgebrochen ...
Vielen Dank im Voraus für die Hilfe.