From cb56b8b49aa872642e53fc1a82cbdb546d5bfbcb Mon Sep 17 00:00:00 2001 From: orwell96 Date: Sun, 12 Aug 2018 14:25:38 +0200 Subject: Signal aspect handling, make default signals compatible, fix signal digging --- advtrains_interlocking/routesetting.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'advtrains_interlocking/routesetting.lua') diff --git a/advtrains_interlocking/routesetting.lua b/advtrains_interlocking/routesetting.lua index b98b234..1e516a6 100644 --- a/advtrains_interlocking/routesetting.lua +++ b/advtrains_interlocking/routesetting.lua @@ -225,10 +225,27 @@ function ilrs.cancel_route_from(sigd) end end +local asp_generic_free = { + main = { + free = true, + speed = 100, + }, + shunt = { + free = false, + }, + dst = { + free = true, + speed = 100, + }, + info = {} +} + -- TCBS Routesetting helper: generic update function for -- route setting function ilrs.update_route(sigd, tcbs, newrte, cancel) + -- in general, always show danger signal + tcbs.aspect = nil if (newrte and tcbs.routeset and tcbs.routeset ~= newrte) or cancel then if tcbs.route_committed then atdebug("Cancelling:",tcbs.routeset) @@ -259,8 +276,10 @@ function ilrs.update_route(sigd, tcbs, newrte, cancel) atdebug("Committed Route:",tcbs.routeset) tcbs.route_committed = true tcbs.route_rsn = false + tcbs.aspect = asp_generic_free end end + advtrains.interlocking.update_signal_aspect(tcbs) end -- Try to re-set routes that conflicted with this point -- cgit v1.2.3