diff options
Diffstat (limited to 'advtrains_interlocking/database.lua')
-rw-r--r-- | advtrains_interlocking/database.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/advtrains_interlocking/database.lua b/advtrains_interlocking/database.lua index de6f2e8..5e35dba 100644 --- a/advtrains_interlocking/database.lua +++ b/advtrains_interlocking/database.lua @@ -214,10 +214,11 @@ TCB data structure -- aspect will be set accordingly. routeset = <index in routes> -- Route set from this signal. This is the entry that is cleared once -- train has passed the signal. (which will set the aspect to "danger" again) - route_committed = <boolean> -- When setting/requesting a route, routetar will be set accordingly, + -- routeset may be a table (e.g. {1,2}) while the route is not committed yet, indicating a wait for multiple routes at once (Multi-ARS) + route_committed = <boolean> -- When setting/requesting a route, routeset will be set accordingly, -- while the signal still displays danger and nothing is written to the TCs -- As soon as the route can actually be set, all relevant TCs and turnouts are set and this field - -- is set true, clearing the signal + -- is set true, clearing the signal (when this is true, routeset is never a table) aspect = <asp> -- The aspect the signal should show. If this is nil, should show the most restrictive aspect (red) signal_name = <string> -- The human-readable name of the signal, only for documenting purposes routes = { <route definition> } -- a collection of routes from this signal @@ -760,7 +761,7 @@ function ildb.update_rs_cache(ts_id) --atdebug("== Running update_rs_cache for ",ts_id) -- start on every of the TS's TCBs, walk the track forward and store locks along the way for start_tcbi, start_tcbs in ipairs(ts.tc_breaks) do - local start_pkey = advtrains.encode_pos(start_tcbs.p) + start_pkey = advtrains.encode_pos(start_tcbs.p) rscache[start_pkey] = {} --atdebug("Starting for ",start_tcbi, start_tcbs) local locks_found = {} @@ -770,7 +771,7 @@ function ildb.update_rs_cache(ts_id) -- now result_table contains found route locks. Match them with the other TCBs we have in this section for end_tcbi, end_tcbs in ipairs(ts.tc_breaks) do if end_tcbi ~= start_tcbi then - local end_pkey = advtrains.encode_pos(end_tcbs.p) + end_pkey = advtrains.encode_pos(end_tcbs.p) if result_table[end_pkey] then --atdebug("Set RSCache entry",end_pkey.."-"..end_pkey,"=",result_table[end_pkey]) local lockstab = result_table[end_pkey] @@ -941,7 +942,6 @@ function ildb.remove_ts(ts_id) if not ts then error("remove_ts: "..ts_id.." doesn't exist") end - local i = 1 while ts.tc_breaks[i] do -- get TCBS local sigd = ts.tc_breaks[i] |