From f8c2ec60d6fe1927b444aae51c3bce075ed05208 Mon Sep 17 00:00:00 2001 From: orwell Date: Sun, 17 Dec 2023 12:20:22 +0100 Subject: Signals can have nil name, documentation on route def --- advtrains_interlocking/database.lua | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'advtrains_interlocking/database.lua') diff --git a/advtrains_interlocking/database.lua b/advtrains_interlocking/database.lua index 492326c..5d42309 100644 --- a/advtrains_interlocking/database.lua +++ b/advtrains_interlocking/database.lua @@ -178,6 +178,12 @@ TCB data structure signal_name = -- The human-readable name of the signal, only for documenting purposes routes = { } -- a collection of routes from this signal route_auto = -- When set, we will automatically re-set the route (designated by routeset) + + auto_block_signal_mode = -- Simplified mode for simple block signals: + -- Signal has only one route which is constantly re-set (route_auto is implied) + -- Supposed to be used when only a single track section is ahead and it directly ends at the next signal + -- UI only offers to enable or disable the signal + -- ARS is implicitly disabled on the signal }, -- This is the "B" side of the TCB [2] = { -- Variant: end of track-circuited area (initial state of TC) @@ -185,6 +191,29 @@ TCB data structure } } +Route definition +routes = { + [i] = { + -- one table for each track section on the route + -- Note that the section ID is implicitly inferred from the TCB + 1 = { + locks = { -- component locks for this section of the route. Not used when use_rscache is true. + (-16,9,0) = st + } + next = S[(-23,9,0)/2] -- the start TCB of the next route segment (pointing forward) + } + 2 = { + locks = {} + -- if next is omitted, then there is no final TCB (e.g. a buffer) + } + name = "" + ars = { } + use_rscache = false -- if true, instead of "locks", the track section's rs_cache will be used to set locks + -- Fields used by the autorouter: + ar_end_sigd = -- the sigd describing the end of the route. Used for merging route options on recalculation + } +} + Track section [id] = { name = "Some human-readable name" -- cgit v1.2.3