aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking/routesetting.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2018-08-12 14:25:38 +0200
committerorwell96 <orwell@bleipb.de>2018-08-12 14:25:38 +0200
commitcb56b8b49aa872642e53fc1a82cbdb546d5bfbcb (patch)
treecd11da5a2c3c1bac4c1361458ca754672abbcd30 /advtrains_interlocking/routesetting.lua
parent6cdb47edd231da08b32b8258eaa507ff312134cd (diff)
downloadadvtrains-cb56b8b49aa872642e53fc1a82cbdb546d5bfbcb.tar.gz
advtrains-cb56b8b49aa872642e53fc1a82cbdb546d5bfbcb.tar.bz2
advtrains-cb56b8b49aa872642e53fc1a82cbdb546d5bfbcb.zip
Signal aspect handling, make default signals compatible, fix signal digging
Diffstat (limited to 'advtrains_interlocking/routesetting.lua')
-rw-r--r--advtrains_interlocking/routesetting.lua19
1 files changed, 19 insertions, 0 deletions
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