This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
dev:proposals:new-ks [2022-04-01 14:50] ywang |
dev:proposals:new-ks [2023-03-26 10:10] (current) ywang |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Implementation: | ||
+ | //Please refer to the source code for implementation details and API documentation. This information is provided here. The filenames provided below are relative to '' | ||
+ | |||
+ | * The distant signaling API is implemented in '' | ||
+ | * Formspecs have been partially modified to support distant signaling. Some formspecs are now implemented in various '' | ||
+ | * Signal aspect accessors have been modified and are now found in '' | ||
+ | * A signal aspect API is introduced. This allows manipulating signal aspect objects (implemented using tables) and creating signal aspect groups, the latter of which makes it possible to create route signals. The relevant code can be found in '' | ||
+ | * A '' | ||
+ | |||
+ | **The changes break a few minor things:** | ||
+ | |||
+ | * The signal aspect formspec uses dropdown indexing, which requires Minetest 5.4.0 or later. | ||
+ | * '' | ||
+ | * The results are cached. | ||
+ | * The signal aspect is " | ||
+ | * '' | ||
+ | * There is no API for setting the signal aspect while bypassing the cache and signal aspect adjustments, | ||
+ | * '' | ||
+ | * When setting a field of the signal aspect object to '' | ||
+ | * Certain features of signal aspect objects are implemented using metatables. These objects are therefore not suitable for serialization, | ||
+ | |||
+ | It is planned to merge the newly introduced signal aspect cache with its counterpart in the routesetting system. | ||
+ | |||
+ | Please refer to the source code (listed above) for details. | ||
====== Proposal: Distant signaling (second draft) ====== | ====== Proposal: Distant signaling (second draft) ====== | ||
- | // | + | //This draft has been superseded. Please refer to the actual implementation (mentioned above).// |
//This draft is mainly written to address the issues that appeared in the first draft. In particular, it addresses a request to implement route signaling.// | //This draft is mainly written to address the issues that appeared in the first draft. In particular, it addresses a request to implement route signaling.// | ||
Line 14: | Line 38: | ||
* When a route is set, the distant signals along the route are assigned to the upcoming signal (i.e. the signal first signal a train should encounter after passing the TCB). These distant signals are then set correspondingly. | * When a route is set, the distant signals along the route are assigned to the upcoming signal (i.e. the signal first signal a train should encounter after passing the TCB). These distant signals are then set correspondingly. | ||
* When a train leaves a TCB, the distant signal, if assigned to another signal, is unassigned. This should, at least theoretically, | * When a train leaves a TCB, the distant signal, if assigned to another signal, is unassigned. This should, at least theoretically, | ||
+ | |||
+ | ===== Setting distant signals ===== | ||
+ | * When a signal aspect is set, the distant signals are set correspondingly. | ||
+ | * When a distant signal is unassigned, its distant aspect is set to '' | ||
===== API Changes ===== | ===== API Changes ===== | ||
Line 40: | Line 68: | ||
=== Supported aspects === | === Supported aspects === | ||
The table of supported aspects should include the following fields: | The table of supported aspects should include the following fields: | ||
+ | * '' | ||
+ | * '' | ||
* '' | * '' | ||
* '' | * '' | ||
+ | * '' | ||
+ | |||
+ | When registering, | ||
+ | * '' | ||
* '' | * '' | ||
Line 51: | Line 85: | ||
=== Signal aspect translation === | === Signal aspect translation === | ||
- | * When a distant signal defined with the alternative signal aspect definition table is assigned to a signal that is not defined with the same signal aspect table, the distant signal is always given the //n-1//th entry (with //n// being the number of defined main aspects of the distant signal) unless the main aspect of the upcoming signal is -1, in which case the distant signal is given the first entry of the defined main aspects of the distant signal. | + | * When a distant signal defined with the alternative signal aspect definition table is assigned to a signal that is not defined with the same signal aspect table, the distant signal is always given the //n-1//th entry (with //n// being the number of defined main aspects of the distant signal) unless the main aspect of the upcoming signal is -1, in which case the distant signal is given the first entry of the defined main aspects of the distant signal, or an entry in the translation table can be used to determine the distant signal aspect. |
* When a distant signal defined with the current signal aspect definition table is assigned to a signal defined with the alternative current signal aspect definition table, the '' | * When a distant signal defined with the current signal aspect definition table is assigned to a signal defined with the alternative current signal aspect definition table, the '' | ||