aboutsummaryrefslogtreecommitdiff
path: root/assets/manual
diff options
context:
space:
mode:
authorY. Wang <yw05@forksworld.de>2022-04-25 14:55:42 +0200
committerY. Wang <yw05@forksworld.de>2022-04-25 14:55:42 +0200
commit686e1dde468fcabf512522be586241f483a0f551 (patch)
tree76c357b7c62cfc7bc1797d5865a07dc9090f3009 /assets/manual
parent539a0742c3c2ac0929c2c8906d8d99161088d73d (diff)
downloadadvtrains-686e1dde468fcabf512522be586241f483a0f551.tar.gz
advtrains-686e1dde468fcabf512522be586241f483a0f551.tar.bz2
advtrains-686e1dde468fcabf512522be586241f483a0f551.zip
Add some documentation on creating signals
Diffstat (limited to 'assets/manual')
-rw-r--r--assets/manual/manual.tex24
1 files changed, 22 insertions, 2 deletions
diff --git a/assets/manual/manual.tex b/assets/manual/manual.tex
index 41291e4..2a2d1d6 100644
--- a/assets/manual/manual.tex
+++ b/assets/manual/manual.tex
@@ -1332,9 +1332,29 @@ The following entries are present in \texttt{advtrains.speed}:
\item \apifunc{merge\_aspect}{\var{train},\var{asp}} Merge the signal aspect \var{asp} into the speed restriction table of \var{train} and update the \texttt{speed\_restriction} field of \var{train} accordingly.
\end{apidoc}
-\section{Definition tables}\label{s:deftables}
+\section{Node definition}
+
+\subsection{Node groups}
+\advtrains{} uses node groups to identify whether a node has certain properties. The following fields are used:
+\begin{apidoc}{Node definition!\texttt{groups}}
+\item \apifield{advtrains\_signal} Whether the node is a signal.
+\item \apifield{not\_blocking\_trains} The numeric constant 1 if the item does not block trains.
+\item \apifield{save\_in\_at\_nodedb} The numeric constant 1 if the item should be save in the internal node database used by \advtrains{}.
+\end{apidoc}
+
+The following values (as numeric constants) are accepted for items in the \texttt{advtrains\_signal} group:
+\begin{apidoc}{Node definition!\texttt{groups}!\texttt{advtrains\_signal}}
+\item \apienum{1} The node is a signal with a static signal aspect.
+\item \apienum{2} The node is a signal, and its signal aspect can be set.
+\end{apidoc}
-Please refer to \texttt{advtrains/api\_doc.txt} for now.
+\subsection{The \texttt{advtrains} field}
+The \texttt{advtrains} field in the node definition may contain the following fields:
+\begin{apidoc}{Node definition!\texttt{advtrains}}
+\item \apifield{get\_aspect(\var{pos}, \var{node})} A function that returns the signal aspect of the signal \var{node} at \var{pos}. The returned signal aspect does not need to be identical to the signal aspect passed to the previous call to \texttt{set\_aspect}.
+\item \apifield{set\_aspect(\var{pos}, \var{node}, \var{asp})} A function that sets the aspect of the signal \var{node} at \var{pos} to \var{pos}. If \var{asp} is not supported by the signal, the implementation may choose to set the aspect to something different.
+\item \apifield{supported\_aspects} A table of supported signal aspects.
+\end{apidoc}
\section{Table structures}\label{s:structs}