From 65675664e3cdf3328b89b4bdc22cc07c21be3a56 Mon Sep 17 00:00:00 2001 From: orwell96 Date: Tue, 19 Jun 2018 19:50:11 +0200 Subject: Interlocking: Create demo signals, signal API and model for TCB configurer node --- advtrains_interlocking/database.lua | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'advtrains_interlocking/database.lua') diff --git a/advtrains_interlocking/database.lua b/advtrains_interlocking/database.lua index 7a49383..61bf5ad 100644 --- a/advtrains_interlocking/database.lua +++ b/advtrains_interlocking/database.lua @@ -5,8 +5,7 @@ The interlocking system is based on track circuits. Track circuit breaks must be manually set by the user. Signals must be assigned to track circuit breaks and to a direction(connid). To simplify the whole system, there is no overlap. == Trains == -A train always reserves the space between two signals facing it. All track circuits in this space -have a reservation entry TRAIN with the train's ID +Trains always occupy certain track circuits. These are shown red in the signalbox view (TRAIN occupation entry). == Database storage == The things that are actually saved are the Track Circuit Breaks. Each TCB holds a list of the TCBs that are adjacent in each direction. TC occupation/state is then saved inside each (TCB,Direction) and held in sync across all TCBs adjacent to this one. If something should not be in sync, @@ -21,6 +20,8 @@ A track circuit does not have a state as such, but has more or less a list of "r type can be one of these: TRAIN See Trains obove ROUTE Route set from a signal, but no train has yet passed that signal. +Not implemented (see note by reversible): OWNED - former ROUTE segments that a train has begun passing (train_id assigned) + - Space behind a train up to the next signal, when a TC is set as REVERSIBLE Certain TCs can be marked as "allow call-on". == Route setting: == Routes are set from a signal (the entry signal) to another signal facing the same direction (the exit signal) @@ -35,8 +36,17 @@ Apart from this, we need to set turnouts It will be necessary to join and split trains using call-on routes. A call-on route may be set when: - there are no ROUTE reservations - there are TRAIN reservations only inside TCs that have "allow call-on" set - - +== TC Properties == +Note: Reversible property will not be implemented, assuming everything as non-rev. +This is sufficient to cover all use cases, and is done this way in reality. + REVERSIBLE - Whether trains are allowed to reverse while on track circuit + This property is supposed to be set for station tracks, where there is a signal at each end, and for sidings. + It should in no case be set for TCs covering turnouts, or for main running lines. + When a TC is not set as reversible, the OWNED status is cleared from the TC right after the train left it, + to allow other trains to pass it. + If it is set reversible, interlocking will keep the OWNED state behind the train up to the next signal, clearing it + as soon as the train passes another signal or enters a non-reversible section. +CALL_ON_ALLOWED - Whether this TC being blocked (TRAIN or ROUTE) does not prevent shunt routes being set through this TC == More notes == - It may not be possible to switch turnouts when their TC has any state entry -- cgit v1.2.3