diff options
author | autocommitter <autocommitter@linux-forks.de> | 2024-04-22 14:53:27 +0200 |
---|---|---|
committer | autocommitter <autocommitter@linux-forks.de> | 2024-04-22 14:53:27 +0200 |
commit | 92b4523c0e8eaa9c61635b5b3307cd6022a1578d (patch) | |
tree | 66dde038161edb4399fe7acaf6a01bc8acb09cf5 | |
parent | 50e7e846b18f4a3e0185659874371f67f461635c (diff) | |
download | luaatc_envs-92b4523c0e8eaa9c61635b5b3307cd6022a1578d.tar.gz luaatc_envs-92b4523c0e8eaa9c61635b5b3307cd6022a1578d.tar.bz2 luaatc_envs-92b4523c0e8eaa9c61635b5b3307cd6022a1578d.zip |
State at 2021-07-01
-rw-r--r-- | Crossroads/init_code.lua | 19 | ||||
-rw-r--r-- | Crossroads/nodes/(1122,19,3018).lua | 1 | ||||
-rw-r--r-- | Crossroads/nodes/(1125,23,3014).lua | 1 | ||||
-rw-r--r-- | Crossroads/nodes/(1125,23,3027).lua | 1 |
4 files changed, 18 insertions, 4 deletions
diff --git a/Crossroads/init_code.lua b/Crossroads/init_code.lua index 4b18696..442dd76 100644 --- a/Crossroads/init_code.lua +++ b/Crossroads/init_code.lua @@ -3,6 +3,7 @@ if not S.odsd then S.odsd = {} end if not S.cpoints then S.cpoints = {} end S.pd = {} S.pdt = {} +__approach_callback_mode = 1 F.odj = {} @@ -161,7 +162,13 @@ function F.stn2gen(stn, trk, door, ret, chout) interval = 15 end atc_send(string.format("A0B0WO%sD%dOCD1%sA1SM", door, interval, (ret and "R" or ""))) - local intext_nxt = F.stnlist[t[i][2]] and ("Next station:\n%s\n(Track: %s)"):format(F.stnlist[t[i][2]], t[i][3] or "?") or "" + local nxt = t[i][2] + local intext_nxt = "" + local nxtdisp = "" + if F.stnlist[nxt] then + intext_nxt = F.stnlist[nxt] and ("Next station: %s (Track: %s)"):format(F.stnlist[nxt], t[i][3] or "?") or "" + nxtdisp = intext_nxt + end local intext = ("%s\n%s\nDebug: %d %d"):format(F.stnlist[stn] or stn, intext_nxt, arroff or timenow, interval) local outtext = string.format("%s (%06d)",F.lines[l].name or l, atc_id) if t[i][4] then outtext = outtext.." - "..(F.stnlist[t[i][4]] or t[i][4]) end @@ -177,7 +184,7 @@ function F.stn2gen(stn, trk, door, ret, chout) s = stn, t = (trk or "N/A"), } - schedule_in(interval) + schedule_in(interval, {intext = nxtdisp}) break end end @@ -186,6 +193,10 @@ function F.stn2gen(stn, trk, door, ret, chout) end elseif event.type == "schedule" then if atc_id then + local msg = event.msg or {} + if msg.intext then + atc_set_text_inside(msg.intext) + end atc_send("OCD1"..(((not ret) == (not atc_arrow)) and "R" or "").."A1SM") end end @@ -347,8 +358,8 @@ F.lines = { name = "ATL-B Commuter", short = "ATL-B/C", ring = false, interval = 240, - [1] = { {"crch","2"}, --[[ {"crwm","3"},]] {"scs","N1"}, {"scc","N1"}, {"scn","N1"}, {"cg","1"}, {"thecube","4"}, --[[{"phsc","N"},]] {"grsc", "4"}, {"phwest","2"} }, - [2] = { {"phwest","2"}, {"grsc", "3"}, --[[{"phsc","S"},]] {"thecube","1"}, {"cg","2"}, {"scn","S1"}, {"scc","S1"}, {"scs","S1"}, --[[ {"crwm","4"}, ]] {"crch","2"} }, + [1] = { {"crch","2"}, --[[ {"crwm","3"},]] {"scs","N1"}, {"scc","N1"}, {"scn","N1"}, {"cg","1"}, {"thecube","4"}, --[[{"phsc","N"},]] {"grsc", "4"}, {"phwest","1"} }, + [2] = { {"phwest","1"}, {"grsc", "3"}, --[[{"phsc","S"},]] {"thecube","1"}, {"cg","2"}, {"scn","S1"}, {"scc","S1"}, {"scs","S1"}, --[[ {"crwm","4"}, ]] {"crch","2"} }, }, ["ABE"] = { name = "ATL-B Express", short = "ATL-B/E", diff --git a/Crossroads/nodes/(1122,19,3018).lua b/Crossroads/nodes/(1122,19,3018).lua new file mode 100644 index 0000000..da8687d --- /dev/null +++ b/Crossroads/nodes/(1122,19,3018).lua @@ -0,0 +1 @@ +F.stn2gen("phwest", "1", "R", true, true)
\ No newline at end of file diff --git a/Crossroads/nodes/(1125,23,3014).lua b/Crossroads/nodes/(1125,23,3014).lua new file mode 100644 index 0000000..bdd5bc1 --- /dev/null +++ b/Crossroads/nodes/(1125,23,3014).lua @@ -0,0 +1 @@ +if event.channel == "track1-update" then F.pdisp("phwest", "1", "S") end
\ No newline at end of file diff --git a/Crossroads/nodes/(1125,23,3027).lua b/Crossroads/nodes/(1125,23,3027).lua new file mode 100644 index 0000000..a183351 --- /dev/null +++ b/Crossroads/nodes/(1125,23,3027).lua @@ -0,0 +1 @@ +if event.channel == "track1-update" then F.pdisp("phwest", "1", "N") end
\ No newline at end of file |