aboutsummaryrefslogtreecommitdiff
path: root/advtrains_signals_muc_ubahn
diff options
context:
space:
mode:
authororwell <orwell@bleipb.de>2025-01-07 23:57:15 +0100
committerorwell <orwell@bleipb.de>2025-01-07 23:57:15 +0100
commit265d1e519bbc1ed956bb1a489b2ceaddb3082004 (patch)
treea12748106c3af0976ea32526224f3ef7ce06c33e /advtrains_signals_muc_ubahn
parent49d177d82cb09d19e7a9f5731e316d1079546b28 (diff)
downloadadvtrains-265d1e519bbc1ed956bb1a489b2ceaddb3082004.tar.gz
advtrains-265d1e519bbc1ed956bb1a489b2ceaddb3082004.tar.bz2
advtrains-265d1e519bbc1ed956bb1a489b2ceaddb3082004.zip
Update docs, fix the other signals
Diffstat (limited to 'advtrains_signals_muc_ubahn')
-rwxr-xr-xadvtrains_signals_muc_ubahn/init.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/advtrains_signals_muc_ubahn/init.lua b/advtrains_signals_muc_ubahn/init.lua
index 17ecac2..182a3dc 100755
--- a/advtrains_signals_muc_ubahn/init.lua
+++ b/advtrains_signals_muc_ubahn/init.lua
@@ -20,6 +20,9 @@ local mainaspects = {
{ name = "hp2", description = "Hp2: Reduced Speed" },
{ name = "hp3", description = "Hp3: Shunt" },
}
+local dstaspects = {
+ { name = "vr1", description = "Vr1: Expect Full speed" },
+}
local function applyaspect_main(loc)
return function(pos, node, main_aspect, rem_aspect, rem_aspinfo)
@@ -38,7 +41,7 @@ end
local function applyaspect_distant(loc)
return function(pos, node, main_aspect, rem_aspect, rem_aspinfo)
local ma_node = "vr0" -- show expect stop by default
- if not main_aspect.halt and rem_aspinfo and (not rem_aspinfo.main or rem_aspinfo.main>12 or rem_aspinfo.main==-1) then
+ if not main_aspect.halt and (not rem_aspinfo or not rem_aspinfo.main or rem_aspinfo.main>12 or rem_aspinfo.main==-1) then
ma_node = "vr1" -- show free when dst is at least 12
end
advtrains.ndb.swap_node(pos, {name = "advtrains_signals_muc_ubahn:signal_wall_"..loc.."_"..ma_node, param2 = node.param2})
@@ -74,8 +77,9 @@ for r,f in pairs(all_sigs) do
after_dig_node = advtrains.interlocking.signal.after_dig,
-- new signal API
advtrains = {
- main_aspects = not f.distant and mainaspects, -- main aspects only for main
+ main_aspects = f.distant and dstaspects or mainaspects, -- main aspects only for main
apply_aspect = f.distant and applyaspect_distant(loc) or applyaspect_main(loc),
+ pure_distant = f.distant,
get_aspect_info = function() return f.asp end,
route_role = f.distant and "distant" or "main"
},