diff --git a/LICENSE b/LICENSE index 80ed141..0826334 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ ISC License -Copyright (c) 2019, Martin Scheidt \ +Copyright (c) 2018 - 2020, Martin Scheidt \ Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. diff --git a/README.md b/README.md index 1d95b1d..2221db7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,17 @@ -# installation +------------ -todo +# Installation + +The tikz library is contained in the files: +* tikzlibrarytrackschematic.code.tex, +* tikzlibrarytrackschematic.topology.code.tex, +* tikzlibrarytrackschematic.trafficcontrol.code.tex, +* tikzlibrarytrackschematic.vehicles.code.tex, +* tikzlibrarytrackschematic.constructions.code.tex, and +* tikzlibrarytrackschematic.messures.code.tex. +These files should be copied wherever TeX can find it, for example in your TEXMF folder. The library can then be loaded through the command \usetikzlibrary{trackschematic} in any tex file. + +------------ # Usage @@ -16,7 +27,7 @@ todo \coordinate (T) at (5,0); \maintrack (A) -- (B); - \train[moving,forward] at (T) label (train); + \train[forward] at (T) label (train); \end{tikzpicture} @@ -24,11 +35,13 @@ todo ``` ------------ + # History ## Version 0.5 - * new improved syntax + * new improved syntax for topology + * documentation ## Version 0.4 @@ -56,7 +69,27 @@ todo Basic concept of a library with railway topology symbols and some examples. ------------ + # Roadmap + * rethink syntax * provide option for internationalziation (i18n) - * write usefull documentation \ No newline at end of file + * rewrite library with better coding skills + +------------ + +# Acknowledgement + + This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No. 826347. + +------------ + +# License + + ISC License + + Copyright (c) 2018 - 2020, Martin Scheidt \ + + Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/doc/authors.tex b/doc/authors.tex deleted file mode 100644 index 4727b5f..0000000 --- a/doc/authors.tex +++ /dev/null @@ -1,8 +0,0 @@ -%!TEX TS-program = pdflatexmk -%!TEX root = doc.tex - -% Copyright 2018,2019 Martin Scheidt (ISC license) - -% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -\newcommand{\MS}{Martin Scheidt} diff --git a/doc/doc.pdf b/doc/doc.pdf index 765e660..53dda09 100644 Binary files a/doc/doc.pdf and b/doc/doc.pdf differ diff --git a/doc/doc.sty b/doc/doc.sty new file mode 100644 index 0000000..46ddf74 --- /dev/null +++ b/doc/doc.sty @@ -0,0 +1,103 @@ +%% symbol library for TikZ track schematics +% +% Copyright 2018,2019 Martin Scheidt (ISC license) + +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\ProvidesPackage{doc}[2019-09-30 Doc Package] + +% --------[ Coding and Language ]---------- +\RequirePackage{scrhack,marginnote} +\RequirePackage[utf8]{inputenc} +\RequirePackage[T1]{fontenc} +\RequirePackage[main=english]{babel} +% --------[ revision history ]---------- +\RequirePackage[tocentry]{vhistory} +% --------[ Layout ]----------- +\pretolerance=8000 +\tolerance=9500 +\hbadness=8000 +\vbadness=10000 +\displaywidowpenalty=10000 +\clubpenalty=10000 +\widowpenalty=10000 +\RequirePackage{lmodern,microtype,mathptmx,courier} +\RequirePackage[scaled=0.92]{helvet} +\RequirePackage[% + automark,% + headsepline,% + draft=false,% +]{scrlayer-scrpage}% +\pagestyle{scrheadings} +\RequirePackage{multicol} +% -----------[ PDF linking ]---------------- +\RequirePackage[% + pdftex,% + pdfpagelabels, % modify PDF page labels + hyperindex,% + hyperfigures,% + bookmarksopen,% + bookmarksnumbered,% + draft=false,% + pageanchor=true, % Determines whether every page is given an implicit anchor at the top left corner + %pagebackref, % Adds ‘backlink’ text to the end of each item in the bibliography, as a list of page numbers + %linktocpage, % make page number, not text, be link on TOC, LOF and LOT + breaklinks=true, % allow links to break over lines by making links over multiple lines into PDF links to the same target + colorlinks=true, % Colors the text of links and anchors + linkcolor=base01, % Color for normal internal links + urlcolor=blue, % Color for web links +]{hyperref} % PDF with a linked TableOfContent +\RequirePackage{bookmark} % Adding package bookmark improves bookmarks handling. +\RequirePackage{url} + +% ----------[ display ]----------- +\RequirePackage[prefix=]{xcolor-solarized} +\RequirePackage[inline]{enumitem} + +\RequirePackage[final]{listings} +\lstdefinelanguage{tikz}{% + keywordsprefix = \\, + alsoletter = \\,% + morekeywords = {},% + sensitive = true,% + morecomment = [l]\%,% + morestring=[s][\bfseries\color{magenta}]{\[}{\]},% + morestring=[s][\bfseries\color{violet}]{\{}{\}},% + morestring=[s][\bfseries\color{violet}]{(}{)},% +}[keywords,comments,strings]% + +\lstset{% + language = tikz,% + basicstyle = \scriptsize\ttfamily,% + keywordstyle = \bfseries\color{blue},% + commentstyle = \itshape\color{green},% + backgroundcolor = \color{base3},% + showstringspaces = false,% + columns = fullflexible,% + breaklines = true,% + frame = single,% +}% + +\RequirePackage{longtable,tikz,siunitx,adjustbox,rotating} +\sisetup{math-rm=\mathsf} + +\usetikzlibrary{trackschematic} + +\def\rootTrackschematic{.} + +\renewcommand{\symbol}[2][1.0]{% + \adjustbox{valign=c}{\begin{tikzpicture}[scale=#1]% + \input{\rootTrackschematic/snippets/#2}% + \path (-0.1,-1.1) rectangle (6.1,1.1); % background rectangle to unify every cell containing a symbol + \end{tikzpicture}}% +}% + +\newcommand{\symboldescription}[1]{\paragraph*{#1}\marginnote{\tikz{\fill (-0.4,0.15)--(-0.4,-0.15)--(0,0)--cycle;}}\mbox{}\\}% + +\newcommand{\code}[1]{\lstinputlisting[firstline=7]{\rootTrackschematic/snippets/#1}}% + +\newcounter{symbolNo}% +\def\No{\stepcounter{symbolNo}\arabic{symbolNo}}% + +\setlength{\parindent}{0cm} +\reversemarginpar \ No newline at end of file diff --git a/doc/doc.tex b/doc/doc.tex index 191323f..881305d 100644 --- a/doc/doc.tex +++ b/doc/doc.tex @@ -1,60 +1,28 @@ %% symbol library for TikZ track schematics % -% Copyright 2018,2019 Martin Scheidt (ISC license) +% Copyright 2018,2019,2020 Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. \documentclass[ - draft, paper=a4, - version=3.25, + % version=3.25, pagesize=pdftex, twoside=false, toc=listof, + BCOR=0pt, + DIV=15, ]{scrartcl} -% --------[ Coding and Language ]---------- -\usepackage{scrhack} -\usepackage[utf8]{inputenc} -\usepackage[T1]{fontenc} -\usepackage[main=english]{babel} -% --------[ revision history ]---------- -\usepackage[tocentry]{vhistory} -\input{authors.tex} -% --------[ Layout ]----------- -\pretolerance=8000 -\tolerance=9500 -\hbadness=8000 -\vbadness=10000 -\displaywidowpenalty=10000 -\clubpenalty=10000 -\widowpenalty=10000 -\usepackage{lmodern,microtype,mathptmx,courier} -\usepackage[scaled=0.92]{helvet} -\usepackage[ - automark, - headsepline, - draft=false -]{scrlayer-scrpage} -\pagestyle{scrheadings} -% -----------[ PDF linking ]---------------- -\usepackage[ - pdftex, - pdfpagelabels, % modify PDF page labels - hyperindex, - hyperfigures, - bookmarksopen, - bookmarksnumbered, - draft=false, - pageanchor=true, % Determines whether every page is given an implicit anchor at the top left corner - %pagebackref, % Adds ‘backlink’ text to the end of each item in the bibliography, as a list of page numbers - %linktocpage, % make page number, not text, be link on TOC, LOF and LOT - breaklinks=true, % allow links to break over lines by making links over multiple lines into PDF links to the same target - colorlinks=true, % Colors the text of links and anchors - linkcolor=base01, % Color for normal internal links - urlcolor=blue, % Color for web links -]{hyperref} % PDF with a linked TableOfContent -\usepackage{bookmark} % Adding package bookmark improves bookmarks handling. -\usepackage{url} + +\usepackage{doc} + +%%%%%% AUTHORS list %%%%%%%%%% + +%\newcommand{\initials}{fullname} +\newcommand{\MS}{Martin Scheidt} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % -------[ PDF Informations ]--------- \hypersetup{% pdftitle={tikz/trackschematic}, @@ -63,68 +31,1052 @@ pdfkeywords={latex, tikz, library, railway, track, layout} } -\usepackage[inline]{enumitem} -\usepackage{tikz} - -\usepackage[prefix=]{xcolor-solarized} -\def\rootTrackschematic{../../tikz-trackschematic} -\def\srcTrackschematic{\rootTrackschematic/src/tikzlibrarytrackschematic} -\input{\srcTrackschematic.topology.code.tex} -\input{\srcTrackschematic.trafficcontrol.code.tex} -\input{\srcTrackschematic.vehicles.code.tex} -\input{\srcTrackschematic.constructions.code.tex} - \begin{document} -\title{\tikz\node[scale=1.2]{\color{gray}\Huge\sffamily \{\textcolor{black}{Ti\textcolor{orange}{\emph{k}}Z}/\textcolor{blue}{trackschematic}\}};} +\title{\tikz\node[scale=1.2]{\color{gray}\Huge\sffamily \{\textcolor{black}{Ti\textcolor{orange}{\emph{k}}Z}-\textcolor{blue}{trackschematic}\}};} \subtitle{A Ti\emph{k}Z library for track schematics} \author{\vhListAllAuthorsLong} \date{Version \vhCurrentVersion~ from \vhCurrentDate} \maketitle -\tableofcontents +\begin{multicols}{2} + \tableofcontents +\end{multicols} +\cleardoublepage \section{Introduction}\label{sec:intro} -\subsection[About]{About tikz/trackschematic} + \subsection[About]{About tikz-trackschematic} - The Ti\emph{k}Z \emph{trackschematic} library is a toolbox of symbols geared primarily towards creating track schematic for either research or educational purposes. - It provides a tikz frontends to some of the symbols which maybe needed to describe situations and layouts in railway operation. - The library is divided into four sublibraries: - \begin{itemize*}[label={}] - \item topology, - \item traffic control, - \item vehicles, and - \item constructions. - \end{itemize*} + The Ti\emph{k}Z-\emph{trackschematic} library is a toolbox of symbols geared primarily towards creating track schematic for either research or educational purposes. + It provides a Ti\emph{k}Z frontend to some of the symbols which maybe needed to describe situations and layouts in railway operation. + The library is divided into four sublibraries: + \begin{itemize*}[label={}] + \item \texttt{topology}, + \item \texttt{trafficcontrol}, + \item \texttt{vehicles}, + \item \texttt{constructions}, and + \item \texttt{messures}. + \end{itemize*} + + \subsection{Acknowledgement} + + This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No. 826347. + + \subsection{Requirements}\label{sec:require} + + The library uses Ti\emph{k}Z and it is based the following packages: + \begin{itemize*}[label={}] + \item \texttt{tikz}, + \item \texttt{lmodern}, + \item \texttt{xcolor}, and + \item \texttt{etoolbox}. + \end{itemize*} + Further more it uses the following Ti\emph{k}Z libraries: + \begin{itemize*}[label={}] + \item \texttt{calc}, + \item \texttt{intersections}, + \item \texttt{patterns}, and + \item \texttt{arrows.meta}. + \end{itemize*} -\subsection{Requirements}\label{sec:require} + \subsection{License} - The library uses Ti\emph{k}Z and it is based the following packages: - \begin{itemize*}[label={}] - \item tikz, - \item xcolor, and - \item etoolbox. - \end{itemize*} - Further more it uses the following Ti\emph{k}Z libraries: - \begin{itemize*}[label={}] - \item calc, - \item patterns, and - \item arrows.meta. - \end{itemize*} + Copyright (c) 2018 - 2020, \MS. + Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies (\href{https://www.tldrlegal.com/l/isc}{ISC license}). + + \subsection{Alternatives} + + Apart from this library, there is also a \href{https://tu-dresden.de/bu/verkehr/ibv/vst/die-professur/mitarb/ulrich-maschek/signalschablone}{Signalschablone} with german (Deutsche Bahn) symbols for MS Visio. -\subsection{License} - - Copyright 2018, 2019 \MS. Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies (\href{https://www.tldrlegal.com/l/isc}{ISC license}). - +% \newpage \section{Usage}\label{sec:use} + \subsection{A complete minimal example} - loading ther library + The command \texttt{\textbackslash usetikzlibrary\{trackschematic\}} will load the library; place it somewhere in your preamble. + Here is a complete working minimal example which will produce a single PDF file with the figure on the right:\\ + \begin{minipage}[c]{0.51\textwidth} + \centering + \begin{lstlisting}[gobble=8] + \documentclass[tikz]{standalone} + + % loading the library + \usetikzlibrary{trackschematic} + + \begin{document} + \begin{tikzpicture} + + % draw a track + \maintrack (0,0) -- (6,0); + + % place a train on the track + \train[forward] at (5,0) label (); + + \end{tikzpicture} + \end{document} + \end{lstlisting} + \end{minipage} + \hfil + \begin{minipage}[c]{0.45\textwidth} + \centering + \begin{tikzpicture} + \path (-0.2,-1.45) rectangle (6.2,1.45); + \coordinate (A) at (0,0); + \coordinate (T) at (5,0); + \coordinate (B) at (6,0); + \maintrack (A) -- (B); + \train[forward] at (T) label (); + \end{tikzpicture} + \end{minipage} + + \subsection{Placement}\label{sec:placement} + + To place symbols in a track schematic, they need to placed and oriented correctly. + The placement ist done through the given Ti\emph{k}Z coordinate. + There are a few assumaptions made about the placement: + \begin{enumerate} + \item Parallel tracks are drawn at a distance of 1 cm (which is the base unit of Ti\emph{k}Z). + \item Tracks are only drawn at an angle of $n \cdot 45^{\circ}$. + \end{enumerate} + + \subsection{Orientation system}\label{sec:orientationsystem} + + The orientation is controlled via given Ti\emph{k}Z options or pgfkey. + The orientation options/pgfkeys are named in relation to orientation-based coordinates, which inhibate thier meaning from reading left to right beeing \texttt{forward} and relate \texttt{left}/\texttt{right} to that movement. + \begin{center} + \begin{tikzpicture}[font=\ttfamily] + \draw[<->] (-0.5,0) node[left] {backward} -- (0.5,0) node[right] {forward}; + \draw[<->] (0,-0.5) node[below] {right} -- (0,0.5) node[above] {left}; + \end{tikzpicture} + \end{center} + + The main option/pgfkey is the \texttt{face} option to control in which direction an object will face. + The key can take one of the following two values: + \begin{itemize*}[label={}] + \item \texttt{forward}, and + \item \texttt{backward}. + \end{itemize*} + \begin{minipage}[c]{0.68\textwidth} + \begin{lstlisting}[gobble=6] + + \train[face=forward ] at (coordinate) label (); + + \end{lstlisting} + \end{minipage} + \hfil + \begin{minipage}[c]{0.30\textwidth} + \tikz{\train[face=forward] at (5,0) label ();} + \end{minipage} + \begin{minipage}[c]{0.68\textwidth} + \begin{lstlisting}[gobble=6] + + \train[face=backward] at (coordinate) label (); + + \end{lstlisting} + \end{minipage} + \hfil + \begin{minipage}[c]{0.30\textwidth} + \tikz{\train[face=backward] at (1,0) label ();} + \end{minipage} + As a shortcut you may also just give the option \texttt{forward} or \texttt{backward} without the \texttt{face=} in front of it. + + If you have objects which branch either to the left or the right you have to give the \texttt{branch} option which takes one of the following two values: + \begin{itemize*}[label={}] + \item \texttt{left}, and + \item \texttt{right}. + \end{itemize*}\\ + \begin{minipage}[c]{0.68\textwidth} + \begin{lstlisting}[gobble=6] + + \turnout[forward ,branch=left ] at (coordinate) label (); + + \end{lstlisting} + \end{minipage} + \hfil + \begin{minipage}[c]{0.30\textwidth} + \tikz{\maintrack (0,0)--(4,0);\maintrack (2,0)--++(0.5,0.5);\turnout[forward,branch=left] at (2,0) label ();} + \end{minipage} + \begin{minipage}[c]{0.68\textwidth} + \begin{lstlisting}[gobble=6] + + \turnout[forward ,branch=right] at (coordinate) label (); + + \end{lstlisting} + \end{minipage} + \hfil + \begin{minipage}[c]{0.30\textwidth} + \tikz{\maintrack (0,0)--(4,0);\maintrack (2,0)--++(0.5,-0.5);\turnout[forward,branch=right] at (2,0) label ();} + \end{minipage} + \begin{minipage}[c]{0.68\textwidth} + \begin{lstlisting}[gobble=6] + + \turnout[backward,branch=left ] at (coordinate) label (); + + \end{lstlisting} + \end{minipage} + \hfil + \begin{minipage}[c]{0.30\textwidth} + \tikz{\maintrack (0,0)--(4,0);\maintrack (2,0)--++(-0.5,0.5);\turnout[backward,branch=left] at (2,0) label ();} + \end{minipage} + \begin{minipage}[c]{0.68\textwidth} + \begin{lstlisting}[gobble=6] + + \turnout[backward,branch=right] at (coordinate) label (); + + \end{lstlisting} + \end{minipage} + \hfil + \begin{minipage}[c]{0.30\textwidth} + \tikz{\maintrack (0,0)--(4,0);\maintrack (2,0)--++(-0.5,-0.5);\turnout[backward,branch=right] at (2,0) label ();} + \end{minipage} + There is no shortcut and the key \texttt{branch=} must be given contrary to the key \texttt{face=}. + + \subsection{Left- and right-hand traffic}\label{sec:traffic} + + The traffic practice to divide bidirectional traffic has impact mostly on traffic control. + The default traffic practice for this library ist right-hand traffic. + You can change it either globally or locally with the key \texttt{traffic practice=left}. + There is also the alias \texttt{position} for single local entries. + \begin{minipage}[c]{0.65\textwidth} + \begin{lstlisting}[gobble=8] + \documentclass[tikz]{standalone} + + % load the library + \usetikzlibrary{trackschematic} + + \begin{document} + \begin{tikzpicture} + % set the traffic practice + \tikzset{traffic practice=left} + + \maintrack (0,1) -- (5,1); + \maintrack (0,0) -- (5,0); + \routesignal[forward] at (2,1) label (left); + \routesignal[forward,position=right] at (2,0) label (right); + \end{tikzpicture} + \end{document} + \end{lstlisting} + \end{minipage} + \hfil + \begin{minipage}[c]{0.34\textwidth} + \begin{tikzpicture} + \tikzset{traffic practice=left} + \path (-0.2,-1.6) rectangle (5.2,2.6); + \coordinate (A1) at (0,1); + \coordinate (S1) at (2,1); + \coordinate (B1) at (5,1); + \maintrack (A1) -- ( B1); + \coordinate (A2) at (0,0); + \coordinate (S2) at (2,0); + \coordinate (B2) at (5,0); + \maintrack (A2) -- ( B2); + \routesignal[forward] at (S1) label (left); + \routesignal[forward,position=right] at (S2) label (right); + \end{tikzpicture} + \end{minipage} + + \subsection{Colors: background and foreground}\label{sec:colors} + + The two main colors \texttt{white} and \texttt{black} are set for the \texttt{background} and \texttt{foreground} keys by default. + If you want to change them, provide a new value for the keys. + For example like this:\\ + \begin{minipage}[c]{0.65\textwidth} + \begin{lstlisting}[gobble=8] + \documentclass[tikz]{standalone} + + % load the library + \usetikzlibrary{trackschematic} + + \begin{document} + \begin{tikzpicture} + % set the colors + \tikzset{background=lightgray,foreground=violet} + + \maintrack (0,0) -- (6,0); + \train[forward] at (5,0) label (grey train); + \end{tikzpicture} + \end{document} + \end{lstlisting} + \end{minipage} + \hfil + \begin{minipage}[c]{0.34\textwidth} + \begin{tikzpicture} + \tikzset{background=lightgray,foreground=violet} + \path (-0.2,-1.6) rectangle (5.2,1.6); + \coordinate (A) at (0 ,0); + \coordinate (T) at (4.5,0); + \coordinate (B) at (5 ,0); + \maintrack (A) -- (B); + \train[forward] at (T) label (grey train); + \end{tikzpicture} + \end{minipage} + + +\section{Provided Symbols and their commands} + + Each sublibrary provides different symbols. The following section will go through each symbol their command and options. + % for aperance see the snippet document + + \subsection{Topology} + + \subsubsection{Tracks}\label{sec:track} + + Drawing a track follows the same pricipal as drawing a line in Ti\emph{k}Z. + There are two generell optionss of track with different commands: + \begin{itemize*}[label={}] + \item \texttt{main tracks}, and + \item \texttt{secondary tracks}. + \end{itemize*} + + \symboldescription{Main track} + \symbol{main_track.tikz} + \begin{lstlisting}[gobble=10] + \maintrack (coord1) -- (coord2); + \maintrack (coord1) -- (coord2) -- (coord3) -- etc.; + \end{lstlisting} + No \texttt{options} available.\\ + This command is equivalent to: + \begin{lstlisting}[gobble=10] + \path[draw=foreground,line width=2pt] (coord1) -- (coord2); + \end{lstlisting} + Beware of the placement assumption by the library (see Section \ref{sec:placement}). + + + \symboldescription{Secondary track} + \symbol{secondary_track.tikz} + \begin{lstlisting}[gobble=10] + \secondarytrack (coord1) -- (coord2); + \secondarytrack (coord1) -- (coord2) -- (coord3) -- etc.; + \end{lstlisting} + For the secondary track you may also use the following alias: + \begin{lstlisting}[gobble=10] + \sidetrack (coord1) -- (coord2); + \end{lstlisting} + No \texttt{options} available.\\ + The command is equivalent to: + \begin{lstlisting}[gobble=10] + \path[draw=foreground,line width=0.7pt] (coord1) -- (coord2); + \end{lstlisting} + Beware of the placement assumption by the library (see Section \ref{sec:placement}). + + \symboldescription{Track number or track label} + \symbol{track_number.tikz} + \begin{lstlisting}[gobble=10] + \tracklabel at (coord) label (number); + \end{lstlisting} + No \texttt{options} available.\\ + This command is equivalent to: + \begin{lstlisting}[gobble=10] + \node[fill=background,text=foreground] at (coord) {number}; + \end{lstlisting} + + \symboldescription{Buffer stops} + \symbol{bufferstop_forward.tikz} + \symbol{friction_bufferstop_forward.tikz} + \begin{lstlisting}[gobble=10] + \bufferstop[options] at (coord); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{forward} or \texttt{backward} (mandatory) + \item \texttt{friction=\textit{length unit}} (optional) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \end{itemize} + + \symboldescription{Track closures} + \symbol{track_closure.tikz} + \begin{lstlisting}[gobble=10] + \trackclosure at (coord); + \end{lstlisting} + No \texttt{options} available.\\ + + \subsubsection{Turnouts and similar}\label{sec:turnout} + \symboldescription{Turnouts} + \symbol{turnout_with_fouling_left_forward.tikz} + \symbol{turnout_left_forward_manually.tikz} + % \symbol{turnout_left_forward_right_position.tikz} + \begin{lstlisting}[gobble=10] + \turnout[options] at (coord) label (name); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{forward} or \texttt{backward} (mandatory) + \item \texttt{branch=left} or \texttt{branch=right} (mandatory) + \item \texttt{operation=manual} (optional) % \texttt{operation=remote} (default) + \item \texttt{fouling point} (optional) + \item \texttt{points=left} or \texttt{points=right} (optional) + \item \texttt{shift label=\{\textit{(label-coord)}\}} (optional, default: (0,0)) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \end{itemize} + + \symboldescription{Diamond crossings} + \symbol{diamond_crossing_left.tikz} + \begin{lstlisting}[gobble=10] + \crossing[options] at (coord) label (name); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{branch=left} or \texttt{branch=right} (mandatory) + \item \texttt{fouling point} (optional) + \item \texttt{shift label=\{\textit{(label-coord)}\}} (optional, default: (0,0)) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \end{itemize} + + \symboldescription{Slip switchs or slip turnouts} + \symbol{double-slip_turnout_left.tikz} + \begin{lstlisting}[gobble=10] + \slipturnout[options] at (coord) label (name1)(name2); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{branch=left} or \texttt{branch=right} (mandatory) + \item \texttt{slip=double} (default), \texttt{slip=none}, \texttt{slip=left} or \texttt{slip=right} (mandatory) + \item \texttt{operation=manual} (optional) % \texttt{operation=remote} (default) + \item \texttt{fouling point} (optional) + \item \texttt{forward points=left} or \texttt{forward points=right} (optional) + \item \texttt{backward points=left} or \texttt{backward points=right} (optional) + \item \texttt{shift label=\{\textit{(label-coord)}\}} (optional, default: (0,0)) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \end{itemize} + + \symboldescription{Derailers} + \symbol{derailer_left_forward.tikz} + \begin{lstlisting}[gobble=10] + \derailer[options] at (coord) label (name); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{forward} or \texttt{backward} (mandatory) + \item \texttt{branch=left} or \texttt{branch=right} (mandatory) + \item \texttt{shift label=\{\textit{(label-coord)}\}} (optional, default: (0,0)) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \end{itemize} + + \subsection{Vehicles}\label{sec:vehicles} + + \symboldescription{Parked vehicles}\label{sec:parked} + \symbol{parked_vehicles.tikz} + \begin{lstlisting}[gobble=8] + \parkedvehicles[options] at (coord) label (name); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{length=\textit{length unit}} (optional, default 4cm) + \item \texttt{label at=\{\textit{(label-coord)}\}} (optional, default: \textit{center}) + \item \texttt{label align=left} or \texttt{label align=right} (optional, default: center) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \item \texttt{background=\textit{color}} (optional, default: \texttt{white}) + \end{itemize} + The value for \textit{(label-coord)} is relative to \textit{(coord)}. + An absolute \textit{(label-coord)} can be specified with the Ti\emph{k}Z \textbackslash coordinate command. + + \symboldescription{Shunting movements}\label{sec:shunting} + % \symbol{train_shunt_mode_forward.tikz} + \symbol{train_shunting_forward.tikz} + \begin{lstlisting}[gobble=8] + \shunting[options] at (coord) label (name); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{movement} (optional) + \item \texttt{forward} or \texttt{backward} (mandatory) + \item \texttt{length=\textit{length unit}} (optional, default 4cm) + \item \texttt{operation=manual} or \texttt{operation=automatic} (optional) % \texttt{operation=undefined} (default) + \item \texttt{bend left at=\{\textit{(bend-coord)}\}} (optional, default: \textit{none}) + \item \texttt{bend right at=\{\textit{(bend-coord)}\}} (optional, default: \textit{none}) + \item \texttt{label at=\{\textit{(label-coord)}\}} (optional, default: \textit{center}) + \item \texttt{label align=left} or \texttt{label align=right} (optional, default: center) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \item \texttt{background=\textit{color}} (optional, default: \texttt{white}) + \end{itemize} + The value for \textit{(label-coord)} and \textit{(bend-coord)} is relative to \textit{(coord)}. + An absolute \textit{(label-coord)} or \textit{(bend-coord)} can be specified with the Ti\emph{k}Z \textbackslash coordinate command. + + \symboldescription{Train runs}\label{sec:train} + \symbol{train_moving_fast_forward.tikz} + \symbol{train_ghost_direction_forward.tikz} + \begin{lstlisting}[gobble=8] + \train[options] at (coord) label (name); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{run=slow}, \texttt{run=normal} or \texttt{run=fast} (optional) + \item \texttt{forward} or \texttt{backward} (mandatory) + \item \texttt{length=\textit{length unit}} (optional, default 4cm) + \item \texttt{operation=manual} or \texttt{operation=automatic} (optional) % \texttt{operation=undefined} (default) + \item \texttt{ghost} (optional) + \item \texttt{bend left at=\{\textit{(bend-coord)}\}} (optional, default: \textit{none}) + \item \texttt{bend right at=\{\textit{(bend-coord)}\}} (optional, default: \textit{none}) + \item \texttt{shift label=\{\textit{(label-coord)}\}} (optional, default: (0,0)) + \item \texttt{label align=left} or \texttt{label align=right} (optional, default: center) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \item \texttt{background=\textit{color}} (optional, default: \texttt{white}) + \end{itemize} + The value for \textit{(label-coord)} and \textit{(bend-coord)} is relative to \textit{(coord)}. + An absolute \textit{(label-coord)} or \textit{(bend-coord)} can be specified with the Ti\emph{k}Z \textbackslash coordinate command. + + \subsection{Traffic control} + \subsubsection{Signals}\label{sec:signals} + + \symboldescription{Generic signal command} + \begin{lstlisting}[gobble=10] + \signal[options] at (coord) label (name); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item at least one of the following: + \begin{enumerate*}[label={}] + \item \texttt{distant}, + \item \texttt{speed type}, + \item \texttt{block}, + \item \texttt{route}, + \item \texttt{shunt limit}, + \item \texttt{shunting} and/or + \item \texttt{berth} + \end{enumerate*} + \item \texttt{forward} or \texttt{backward} (mandatory) + \item \texttt{speed=\textit{value}} (optional) + \item \texttt{distant speed=\textit{value}} (optional) + \item \texttt{locked=false} (default) or \texttt{locked=true} (optional) + \item \texttt{position=left} or \texttt{position=right} (optional, default: \textit{traffic practice}) + \item \texttt{shift label=\{\textit{(label-coord)}\}} (optional, default: (0,0)) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \end{itemize} + + \symboldescription{Distant signal} + \symbol{distant_signal_forward.tikz} + \begin{lstlisting}[gobble=10] + \distantsignal[options] at (coord) label (name); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{forward} or \texttt{backward} (mandatory) + \item \texttt{distant speed=\textit{value}} (optional) + \item \texttt{position=left} or \texttt{position=right} (optional, default: \textit{traffic practice}) + \item \texttt{shift label=\{\textit{(label-coord)}\}} (optional, default: (0,0)) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \end{itemize} + This command is equivalent to: + \begin{lstlisting}[gobble=10] + \signal[distant,options] at (coord) label (name); + \end{lstlisting} + + \symboldescription{Speed signal/sign} + \symbol{speed_signal_forward.tikz} + \begin{lstlisting}[gobble=10] + \speedsignal[options] at (coord) label (name); + \end{lstlisting} + For the speed signal you may also use the following alias: + \begin{lstlisting}[gobble=10] + \speedsign[options] at (coord) label (name); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{forward} or \texttt{backward} (mandatory) + \item \texttt{speed=\textit{value}} (optional) + \item \texttt{position=left} or \texttt{position=right} (optional, default: \textit{traffic practice}) + \item \texttt{shift label=\{\textit{(label-coord)}\}} (optional, default: (0,0)) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \end{itemize} + This command is equivalent to: + \begin{lstlisting}[gobble=10] + \signal[speed type,options] at (coord) label (name); + \end{lstlisting} + + \symboldescription{Block signal} + \symbol{block_signal_forward.tikz} + \begin{lstlisting}[gobble=10] + \blocksignal[options] at (coord) label (name); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{forward} or \texttt{backward} (mandatory) + \item \texttt{speed=\textit{value}} (optional) + \item \texttt{position=left} or \texttt{position=right} (optional, default: \textit{traffic practice}) + \item \texttt{shift label=\{\textit{(label-coord)}\}} (optional, default: (0,0)) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \end{itemize} + This command is equivalent to: + \begin{lstlisting}[gobble=10] + \signal[block,options] at (coord) label (name); + \end{lstlisting} + + \symboldescription{Route signal} + \symbol{route_signal_forward.tikz} + \begin{lstlisting}[gobble=10] + \routesignal[options] at (coord) label (name); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{forward} or \texttt{backward} (mandatory) + \item \texttt{speed=\textit{value}} (optional) + \item \texttt{locked=false} (default) or \texttt{locked=true} (optional) + \item \texttt{position=left} or \texttt{position=right} (optional, default: \textit{traffic practice}) + \item \texttt{shift label=\{\textit{(label-coord)}\}} (optional, default: (0,0)) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \end{itemize} + This command is equivalent to: + \begin{lstlisting}[gobble=10] + \signal[route,options] at (coord) label (name); + \end{lstlisting} + + \symboldescription{Shunting signal} + \symbol{shunt_signal_forward.tikz} + \begin{lstlisting}[gobble=10] + \shuntsignal[options] at (coord) label (name); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{forward} or \texttt{backward} (mandatory) + \item \texttt{locked=false} (default) or \texttt{locked=true} (optional) + \item \texttt{position=left} or \texttt{position=right} (optional, default: \textit{traffic practice}) + \item \texttt{shift label=\{\textit{(label-coord)}\}} (optional, default: (0,0)) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \end{itemize} + This command is equivalent to: + \begin{lstlisting}[gobble=10] + \signal[shunting,options] at (coord) label (name); + \end{lstlisting} + + \symboldescription{Shunt limit} + \symbol{shunt_limit_forward.tikz} + \begin{lstlisting}[gobble=10] + \shuntlimit[options] at (coord) label (name); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{forward} or \texttt{backward} (mandatory) + \item \texttt{position=left} or \texttt{position=right} (optional, default: \textit{traffic practice}) + \item \texttt{shift label=\{\textit{(label-coord)}\}} (optional, default: (0,0)) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \end{itemize} + This command is equivalent to: + \begin{lstlisting}[gobble=10] + \signal[shunt limit,options] at (coord) label (name); + \end{lstlisting} + + \symboldescription{Berth signal/sign} + \symbol{train_berth_sign_forward.tikz} + \begin{lstlisting}[gobble=10] + \berthsignal[options] at (coord) label (name); + \end{lstlisting} + For the speed signal you may also use the following alias: + \begin{lstlisting}[gobble=10] + \berthsign[options] at (coord) label (name); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{forward} or \texttt{backward} (mandatory) + \item \texttt{position=left} or \texttt{position=right} (optional, default: \textit{traffic practice}) + \item \texttt{shift label=\{\textit{(label-coord)}\}} (optional, default: (0,0)) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \end{itemize} + This command is equivalent to: + \begin{lstlisting}[gobble=10] + \signal[berth,options] at (coord) label (name); + \end{lstlisting} + + \subsubsection{Clearing points}\label{sec:clearingpoints} + + \symboldescription{Generic clearing point} + \begin{lstlisting}[gobble=10] + \clearingpoint[options] at (coord) label (name); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item at least one of the following: + \begin{enumerate*}[label={}] + \item \texttt{standard}, + \item \texttt{block} and/or + \item \texttt{route} + \end{enumerate*} + \item \texttt{forward} (default) or \texttt{backward} (optional) + \item \texttt{position=left} or \texttt{position=right} (optional, default: \textit{traffic practice}) + \item \texttt{shift label=\{\textit{(label-coord)}\}} (optional, default: (0,0)) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \end{itemize} + + \symboldescription{Standard clearing point} + \symbol{clearing_point.tikz} + \begin{lstlisting}[gobble=10] + \standardclearing[options] at (coord) label (name); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{forward} (default) or \texttt{backward} (optional) + \item \texttt{position=left} or \texttt{position=right} (optional, default: \textit{traffic practice}) + \item \texttt{shift label=\{\textit{(label-coord)}\}} (optional, default: (0,0)) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \end{itemize} + This command is equivalent to: + \begin{lstlisting}[gobble=10] + \clearingpoint[standard,options] at (coord) label (name); + \end{lstlisting} + + \symboldescription{Block clearing point} + \symbol{block_clearing_point_forward.tikz} + \begin{lstlisting}[gobble=10] + \blockclearing[options] at (coord) label (name); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{forward} (default) or \texttt{backward} (optional) + \item \texttt{position=left} or \texttt{position=right} (optional, default: \textit{traffic practice}) + \item \texttt{shift label=\{\textit{(label-coord)}\}} (optional, default: (0,0)) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \end{itemize} + This command is equivalent to: + \begin{lstlisting}[gobble=10] + \clearingpoint[block,options] at (coord) label (name); + \end{lstlisting} + + \symboldescription{Route clearing point} + \symbol{route_clearing_point_forward.tikz} + \begin{lstlisting}[gobble=10] + \routeclearing[options] at (coord) label (name); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{forward} (default) or \texttt{backward} (optional) + \item \texttt{position=left} or \texttt{position=right} (optional, default: \textit{traffic practice}) + \item \texttt{shift label=\{\textit{(label-coord)}\}} (optional, default: (0,0)) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \end{itemize} + This command is equivalent to: + \begin{lstlisting}[gobble=10] + \clearingpoint[route,options] at (coord) label (name); + \end{lstlisting} + + \subsubsection{Transmitters}\label{sec:transmitters} + + \symboldescription{Generic transmitter command} + \begin{lstlisting}[gobble=10] + \transmitter[options] at (coord) label (name); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{type=balise} or \texttt{type=loop} (mandatory) + \item \texttt{forward}, \texttt{backward} or \texttt{bidirectional} (optional) + \item \texttt{position=left} or \texttt{position=right} (optional, default: \textit{traffic practice}) + \item \texttt{shift label=\{\textit{(label-coord)}\}} (optional, default: (0,0)) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \end{itemize} + + \symboldescription{Balise} + \symbol{transmitter_right_bidirectional.tikz} + \begin{lstlisting}[gobble=10] + \balise[options] at (coord) label (name); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{forward}, \texttt{backward} or \texttt{bidirectional} (optional) + \item \texttt{position=left} or \texttt{position=right} (optional, default: \textit{traffic practice}) + \item \texttt{shift label=\{\textit{(label-coord)}\}} (optional, default: (0,0)) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \end{itemize} + This command is equivalent to: + \begin{lstlisting}[gobble=10] + \transmitter[type=balise,options] at (coord) label (name); + \end{lstlisting} + + \symboldescription{Loop} + \symbol{loop_transmitter.tikz} + \begin{lstlisting}[gobble=10] + \trackloop[options] at (coord) label (name); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{position=left} or \texttt{position=right} (optional, default: \textit{traffic practice}) + \item \texttt{shift label=\{\textit{(label-coord)}\}} (optional, default: (0,0)) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \end{itemize} + This command is equivalent to: + \begin{lstlisting}[gobble=10] + \transmitter[type=loop,options] at (coord) label (name); + \end{lstlisting} + + \subsubsection{Miscellaneous}\label{sec:misc} + + \symboldescription{View point} + \symbol{view_point_forward.tikz} + \begin{lstlisting}[gobble=10] + \viewpoint[options] at (coord); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{forward} or \texttt{backward} (mandatory) + \item \texttt{position=left} or \texttt{position=right} (optional, default: \textit{traffic practice}) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \end{itemize} + + \symboldescription{End of movement authority} + \symbol{block_end_marker_forward.tikz} + \begin{lstlisting}[gobble=10] + \movementauthority[options] at (coord) label (name); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{forward}, \texttt{backward} or \texttt{bidirectional} (mandatory) + \item \texttt{direction arrow=true} (default) or \texttt{direction arrow=false} (mandatory) + \item \texttt{position=left} or \texttt{position=right} (optional, default: \textit{traffic practice}) + \item \texttt{shift label=\{\textit{(label-coord)}\}} (optional, default: (0,0)) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \end{itemize} + + \symboldescription{Route} + \symbol{route.tikz} + \begin{lstlisting}[gobble=10] + \route[options] at (coord); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{forward} or \texttt{backward} (mandatory) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \end{itemize} + + \subsection{Constructions}\label{sec:constructions} + + \symboldescription{Platform} + \symbol{platform_left.tikz} + \begin{lstlisting}[gobble=8] + \platform[options] at (coord); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{side=left}, \texttt{side=right} or \texttt{side=both} (mandatory) + \item \texttt{length=\textit{length unit}} (optional, default 4cm) + \item \texttt{width=\textit{length unit}} (optional, default 0.5cm) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \end{itemize} + + \symboldescription{Level crossings} + \symbol{level_crossing_single.tikz} + \begin{lstlisting}[gobble=8] + \levelcrossing[options] at (coord); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{barrier=none} (default), \texttt{barrier=semi} or \texttt{barrier=full} (optional) + \item \texttt{side=both} (default), \texttt{side=left} or \texttt{side=right} (optional) + \item \texttt{road width=\textit{length unit}} (optional, default 0.4cm) + \item \texttt{width=\textit{length unit}} (optional, default 0.5cm) + \item \texttt{no road} (optional) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \end{itemize} + + \symboldescription{Bridge} + \symbol{bridge.tikz} + \begin{lstlisting}[gobble=8] + \bridge[options] at (coord); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{length=\textit{length unit}} (optional, default 4cm) + \item \texttt{width=\textit{length unit}} (optional, default 0.5cm) + \item \texttt{shift left=\textit{length unit}} (optional, default 0cm) + \item \texttt{shift right=\textit{length unit}} (optional, default 0cm) + \item \texttt{side=both} (default), \texttt{side=left} or \texttt{side=right} (optional) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \item \texttt{background=\textit{color}} (optional, default: \texttt{white}) + \item \texttt{no background} (optional) + \end{itemize} + + \symboldescription{Interlocking} + \symbol{interlocking.tikz} + \begin{lstlisting}[gobble=8] + \interlocking at (coord); + \end{lstlisting} + No \texttt{options} available.\\ + + \symboldescription{Hump} + \symbol{hump.tikz} + \begin{lstlisting}[gobble=8] + \hump at (coord); + \end{lstlisting} + No \texttt{options} available.\\ + + \subsection{Messures}\label{sec:messures} + + \symboldescription{Track distance} + \symbol{track_distance.tikz} + \begin{lstlisting}[gobble=10] + \trackdistance between (coord1) and (coord2) distance (value); + \end{lstlisting} + No \texttt{options} available. + + \symboldescription{Train berth} + \symbol{train_berth_shape.tikz} + \begin{lstlisting}[gobble=10] + \berth[options] at (coord) length (value); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{forward}, \texttt{backward} or \texttt{bidirectional} (mandatory) + \item \texttt{length=\textit{length unit}} (optional, default 4cm) + \item \texttt{position=left} or \texttt{position=right} (optional, default: \textit{traffic practice}) + \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) + \end{itemize} + + \symboldescription{Hectometer} + \symbol{hectometer.tikz} + \begin{lstlisting}[gobble=10] + \hectometer[options] at (coord) mileage (name); + \end{lstlisting} + values for \texttt{options} (comma seperated): + \begin{itemize}[label={}] + \item \texttt{hectometer base=\{\textit{(base-coord)}\}} (mandatory) + \item \texttt{orientation=left} or \texttt{orientation=right} (mandatory) + \item \texttt{shift label=\{\textit{(label-coord)}\}} (optional, default: (0,0)) + \item \texttt{hectometer color=\textit{color}} (optional, default: \texttt{foreground!50!background}) + \end{itemize} + The value for \textit{(base-coord)} and \textit{(label-coord)} is relative to \textit{(coord)}. + An absolute \textit{(base-coord)} or \textit{(label-coord)} can be specified with the Ti\emph{k}Z \textbackslash coordinate command. + Specify a commen hectometer base and orientation if you have to place multipile hectometers, i.e. with: + \texttt{\textbackslash tikzset\{hectometer base=\{(base-coord)\},orientation=right\};}. + + \symboldescription{Messure line} + \symbol{messure_line.tikz} + \begin{lstlisting}[gobble=10] + \messureline (coord1) -- (coord2); + \messureline (coord1) -- (coord2) -- (coord3) -- etc.; + \end{lstlisting} + No \texttt{options} available.\\ + This command is equivalent to: + \begin{lstlisting}[gobble=10] + \path[draw=foreground!50!background,dashed,shorten <=0.75cm,shorten >=0.75cm] (coord1) -- (coord2); + \end{lstlisting} + +\clearpage +\appendix +\section{Symbology} + + \begin{longtable}{|r|l|c|c|} + \hline + No. & Name & Symbol & See section \\ + \endhead + \hline + \No & main track & \symbol{main_track.tikz} & \ref{sec:track} \\ + \hline + \No & secondary track & \symbol{secondary_track.tikz} & \ref{sec:track} \\ + \hline + \No & track number & \symbol{track_number.tikz} & \ref{sec:track} \\ + \hline + \No & bufferstop & \symbol{bufferstop_forward.tikz} & \ref{sec:track} \\ + \hline + \No & friction bufferstop & \symbol{friction_bufferstop_forward.tikz} & \ref{sec:track} \\ + \hline + \No & track closure & \symbol{track_closure.tikz} & \ref{sec:track} \\ + \hline + \No & turnout & \symbol{turnout_left_forward.tikz} & \ref{sec:turnout} \\ + \hline + \No & \parbox[c]{5cm}{turnout\\with fouling point indicator} + & \symbol{turnout_with_fouling_left_forward.tikz} & \ref{sec:turnout} \\ + \hline + \No & \parbox[c]{5cm}{turnout\\operated manually} + & \symbol{turnout_left_forward_manually.tikz} & \ref{sec:turnout} \\ + \hline + \No & double-slip turnout & \symbol{double-slip_turnout_left.tikz} & \ref{sec:turnout} \\ + \hline + \No & diamond crossing & \symbol{diamond_crossing_left.tikz} & \ref{sec:turnout} \\ + \hline + \No & \parbox[c]{5cm}{turnout\\with points in right position} + & \symbol{turnout_left_forward_right_position.tikz} & \ref{sec:turnout} \\ + \hline + \No & \parbox[c]{5cm}{turnout\\with points in left position} + & \symbol{turnout_left_forward_left_position.tikz} & \ref{sec:turnout} \\ + \hline + \No & \parbox[c]{5cm}{turnout\\with moving points} + & \symbol{turnout_left_forward_moving_points.tikz} & \ref{sec:turnout} \\ + \hline + \No & derailer & \symbol{derailer_left_forward.tikz} & \ref{sec:turnout} \\ + \hline + \No & parked vehicles & \symbol{parked_vehicles.tikz} & \ref{sec:parked} \\ + \hline + \No & train in shunting mode & \symbol{train_shunt_mode_forward.tikz} & \ref{sec:shunting} \\ + \hline + \No & train shunting & \symbol{train_shunting_forward.tikz} & \ref{sec:shunting} \\ + \hline + \No & train & \symbol{train_direction_forward.tikz} & \ref{sec:train} \\ + \hline + \No & train moving slow & \symbol{train_moving_slow_forward.tikz} & \ref{sec:train} \\ + \hline + \No & train moving & \symbol{train_moving_forward.tikz} & \ref{sec:train} \\ + \hline + \No & train moving fast & \symbol{train_moving_fast_forward.tikz} & \ref{sec:train} \\ + \hline + \No & train ghost & \symbol{train_ghost_direction_forward.tikz} & \ref{sec:train} \\ + \hline + \No & train operated automatic & \symbol{train_drive_automatic.tikz} & \ref{sec:train} \\ + \hline + \No & train operated by human & \symbol{train_drive_human.tikz} & \ref{sec:train} \\ + \hline + \No & distant signal & \symbol{distant_signal_forward.tikz} & \ref{sec:signals} \\ + \hline + \No & \parbox[c]{4cm}{distant signal\\with speed indicator} + & \symbol{distant_speed_signal_forward.tikz} & \ref{sec:signals} \\ + \hline + \No & speed signal & \symbol{speed_signal_forward.tikz} & \ref{sec:signals} \\ + \hline + \No & block signal & \symbol{block_signal_forward.tikz} & \ref{sec:signals} \\ + \hline + \No & route signal & \symbol{route_signal_forward.tikz} & \ref{sec:signals} \\ + \hline + \No & \parbox[c]{4cm}{combined signal\\(distant, block and route signal)} + & \symbol{combined_signal_forward.tikz} & \ref{sec:signals} \\ + \hline + \No & shunt signal & \symbol{shunt_signal_forward.tikz} & \ref{sec:signals} \\ + \hline + \No & shunt signal locked & \symbol{shunt_signal_forward_locked.tikz} & \ref{sec:signals} \\ + \hline + \No & shunt limit & \symbol{shunt_limit_forward.tikz} & \ref{sec:signals} \\ + \hline + \No & train berth sign & \symbol{train_berth_sign_forward.tikz} & \ref{sec:signals} \\ + \hline + \No & clearing point & \symbol{clearing_point.tikz} & \ref{sec:clearingpoints} \\ + \hline + \No & block clearing point & \symbol{block_clearing_point_forward.tikz} & \ref{sec:clearingpoints} \\ + \hline + \No & route clearing point & \symbol{route_clearing_point_forward.tikz} & \ref{sec:clearingpoints} \\ + \hline + \No & transmitter & \symbol{transmitter_right.tikz} & \ref{sec:transmitters} \\ + \hline + \No & transmitter effective forward & \symbol{transmitter_right_forward.tikz} & \ref{sec:transmitters} \\ + \hline + \No & transmitter bidirectional & \symbol{transmitter_right_bidirectional.tikz} & \ref{sec:transmitters} \\ + \hline + \No & loop transmitter & \symbol{loop_transmitter.tikz} & \ref{sec:transmitters} \\ + \hline + \No & view point & \symbol{view_point_forward.tikz} & \ref{sec:misc} \\ + \hline + \No & \parbox[c]{4.5cm}{block end marker\\(end of movement authority)} + & \symbol{block_end_marker_forward.tikz} & \ref{sec:misc} \\ + \hline + \No & route & \symbol{route.tikz} & \ref{sec:misc} \\ + \hline + \No & platform & \symbol{platform_left.tikz} & \ref{sec:constructions} \\ + \hline + \No & level crossing & \symbol{level_crossing_single.tikz} & \ref{sec:constructions} \\ + \hline + \No & bridge & \symbol{bridge.tikz} & \ref{sec:constructions} \\ + \hline + \No & hump & \symbol{hump.tikz} & \ref{sec:constructions} \\ + \hline + \No & interlocking & \symbol{interlocking.tikz} & \ref{sec:constructions} \\ + \hline + \No & track distance (in \si{\metre}) & \symbol{track_distance.tikz} & \ref{sec:messures} \\ + \hline + \No & train berth shape & \symbol{train_berth_shape.tikz} & \ref{sec:messures} \\ + \hline + \No & hectometer & \symbol{hectometer.tikz} & \ref{sec:messures} \\ + \hline + \No & Messure line & \symbol{messure_line.tikz} & \ref{sec:messures} \\ + \hline + \end{longtable} -% \appendix \input{versionhistory.tex} \vhListAllAuthorsLongWithAbbrev + \end{document} \ No newline at end of file diff --git a/doc/examples/network.pdf b/doc/examples/network.pdf deleted file mode 100644 index 3fc0f54..0000000 Binary files a/doc/examples/network.pdf and /dev/null differ diff --git a/doc/examples/network.tex b/doc/examples/network.tex deleted file mode 100644 index 9fc0ae2..0000000 --- a/doc/examples/network.tex +++ /dev/null @@ -1,21 +0,0 @@ -%!TEX TS-program = pdflatexmk - -% Copyright 2019 Martin Scheidt (ISC license) -% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -\documentclass[tikz,border=2]{standalone} - -\usepackage{lmodern} -\usepackage[prefix=]{xcolor-solarized} - -\def\rootTrackschematic{../../tikz-trackschematic} -\def\srcTrackschematic{\rootTrackschematic/src/tikzlibrarytrackschematic} -\input{\srcTrackschematic.topology.code.tex} -\input{\srcTrackschematic.trafficcontrol.code.tex} -\input{\srcTrackschematic.constructions.code.tex} - -\begin{document} - \begin{tikzpicture}[font=\sffamily] - \input{network.tikz} - \end{tikzpicture} -\end{document} \ No newline at end of file diff --git a/doc/examples/network.tikz b/doc/examples/network.tikz deleted file mode 100644 index e896caa..0000000 --- a/doc/examples/network.tikz +++ /dev/null @@ -1,18 +0,0 @@ -%!TEX TS-program = pdflatexmk -%!TEX root = network.tex - -% Copyright 2019 Martin Scheidt (ISC license) -% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -\begin{scope}[shift={(-60,0)}] - \input{station_rebenau.tikz} -\end{scope} -\begin{scope}[shift={(10,-10)}] - \input{station_pockelsdorf.tikz} -\end{scope} -\begin{scope}[shift={(0,0)}] - \input{station_okerbach.tikz} -\end{scope} -\begin{scope}[shift={(60,0)}] - \input{station_schleinitz.tikz} -\end{scope} \ No newline at end of file diff --git a/doc/examples/station_berg.pdf b/doc/examples/station_berg.pdf index 121041c..2519a7d 100644 Binary files a/doc/examples/station_berg.pdf and b/doc/examples/station_berg.pdf differ diff --git a/doc/examples/station_berg.tex b/doc/examples/station_berg.tex index 39589ef..485baca 100644 --- a/doc/examples/station_berg.tex +++ b/doc/examples/station_berg.tex @@ -1,147 +1,154 @@ %!TEX TS-program = pdflatexmk -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. \documentclass[tikz,border=2]{standalone} - -\usepackage{lmodern} -\usepackage[prefix=]{xcolor-solarized} - -\def\rootTrackschematic{../../tikz-trackschematic} -\def\srcTrackschematic{\rootTrackschematic/src/tikzlibrarytrackschematic} -\input{\srcTrackschematic.topology.code.tex} -\input{\srcTrackschematic.vehicles.code.tex} -\input{\srcTrackschematic.constructions.code.tex} -\input{\srcTrackschematic.trafficcontrol.code.tex}% Order 1 -\input{\rootTrackschematic/src/layoutSymbols_DE.tikz} % Order 2 (important) +\usetikzlibrary{trackschematic} \begin{document} \begin{tikzpicture}[font=\sffamily] - { % stations - \tikzset{every node/.style={base00}}; + { % station names + \tikzset{every node/.style={\foreground!50!\background}}; \node[right,align=left] at ( 2,1.3) {to and from\\ Arnau}; \node at (21,3.3) {{\LARGE Bf Berg}}; \node[left,align=right] at (38,1.3) {to and from\\ Chamstadt}; } - { % tracks - \draw[MainTrack] ( 1.5, 0) -- ++(37,0); - \draw[MainTrack] (15 , 0) -- ++( 1,1) -- ++(10,0) -- ++(1,-1); - \draw[SecondaryTrack] (11 ,-1) -- ++( 2,0) -- ++( 1,1); - \draw[SecondaryTrack] ( 9 , 1) -- ++( 7,0); - \draw[SecondaryTrack] (14 , 1) -- ++( 1,1) -- ++(10,0); + % coordinates + \coordinate (A) at ( 1.5, 0); + \coordinate (B) at (38.5, 0); + + \coordinate (E1) at ( 9 , 1); + \coordinate (E2) at (11 ,-1); + \coordinate (E3) at (25 , 2); + \coordinate (H1) at (15 , 2); + \coordinate (H2) at (26 , 1); + + \coordinate (Y1) at (14 , 0); + \coordinate (Y2) at (15 , 0); + \coordinate (Y3) at (14 , 1); + \coordinate (Y4) at (16 , 1); + \coordinate (Y5) at (27 , 0); + \coordinate (Y6) at (12.8,-1); + + \coordinate (S1) at ( 7 , 0); + \coordinate (S2) at (10 , 0); + \coordinate (S3) at (18 , 0); + \coordinate (S4) at (18 , 1); + \coordinate (S5) at (24 , 0); + \coordinate (S6) at (24 , 1); + \coordinate (S7) at (30 , 0); + \coordinate (S8) at (33 , 0); + + \coordinate (T1) at ( 6 , 0); + \coordinate (T2) at (10.2, 1); + \coordinate (T3) at (23 , 2); + \coordinate (T4) at (34 , 0); + + \coordinate (P1) at (21 , 0); + \coordinate (P2) at (21 , 1); + + \coordinate (HM) at (0,-1.85); + + { %% topology + % tracks + \maintrack (A) -- (B); + \maintrack (Y2) -- (Y4) -- (H2) -- (Y5); + \secondarytrack (E1) -- (Y4); + \secondarytrack (E2) -- ++( 2,0) -- (Y1); + \secondarytrack (Y3) -- (H1) -- (E3); + % track numbers - \node[fill=background] at (11.7, 1) {12}; - \node[fill=background] at (11.7,-1) {10}; - \node[fill=background] at (21.0, 2) { 3}; - \node[fill=background] at (21.0, 1) { 2}; - \node[fill=background] at (21.0, 0) { 1}; + \tracklabel at (11.7, 1) label (12); + \tracklabel at (11.7,-1) label (10); + \tracklabel at (21 , 2) label (3); + \tracklabel at (P2) label (2); + \tracklabel at (P1) label (1); + % bufferstops - \pic at ( 9, 1) {bufferstop_backward}; - \pic at (11,-1) {bufferstop_backward}; - \pic at (25, 2) {bufferstop_forward}; + \bufferstop[backward] at (E1); + \bufferstop[backward] at (E2); + \bufferstop[forward] at (E3); + % turnouts - \pic at (12.8,-1) {derailer_right_forward}; - \node at (12.7,-1.4) {\footnotesize Gs7}; - \pic at (14,0) {turnout_left_backward}; - \pic at (14,0) {fouling_point_left_backward}; - \node at (14,0.2) {\footnotesize W1}; - \pic at (14,1) {turnout_left_forward}; - \pic at (14,1) {fouling_point_left_forward}; - \node at (14,0.8) {\footnotesize W4}; - \pic at (15,0) {turnout_left_forward}; - \pic at (15,0) {fouling_point_left_forward}; - \node at (15,-0.2) {\footnotesize W2}; - \pic at (16,1) {turnout_left_backward}; - \pic at (16,1) {fouling_point_left_backward}; - \node at (16,1.2) {\footnotesize W3}; - \pic at (27,0) {turnout_right_backward}; - \pic at (27,0) {fouling_point_right_backward}; - \node at (27,-0.2) {\footnotesize W6}; - % platforms - \pic at (19,0) {platform_left}; - \pic at (19,1) {platform_right}; + \tikzset{every node/.style={fouling point}}; + \turnout[backward,branch=right] at (Y1) label (W1); + \turnout[forward ,branch=left ] at (Y2) label (W2); + \turnout[forward ,branch=left ] at (Y3) label (W3); + \turnout[backward,branch=right] at (Y4) label (W4); + \turnout[backward,branch=left ] at (Y5) label (W5); + \derailer[forward,branch=right] at (Y6) label (Gs6); } - { % signals - \pic at ( 7, 0 ) {distant_signal_forward}; - \node[left] at ( 7,-0.4) {Va}; - \pic at (10, 0 ) {route_signal_forward}; - \pic at (10, 0 ) {distant_signal_forward}; - \node[left] at (10,-0.4) {A}; - \pic at (18, 1 ) {route_signal_backward}; - \node[right] at (18, 1.4) {P2}; - \pic at (18, 0 ) {route_signal_backward}; - \node[right] at (18, 0.4) {P1}; - \pic at (24, 1 ) {route_signal_forward}; - \node[left] at (24, 0.6) {N2}; - \pic at (24, 0 ) {route_signal_forward}; - \node[left] at (24,-0.4) {N1}; - \pic at (30, 0 ) {route_signal_backward}; - \pic at (30, 0 ) {distant_signal_backward}; - \node[right] at (30, 0.4) {F}; - \pic at (33, 0 ) {distant_signal_backward}; - \node[right] at (33, 0.4) {Vf}; + { %% traffic control + % signals + \distantsignal[forward] at (S1) label (Va); + + \signal[distant,route,forward] at (S2) label (A); + + \routesignal[backward] at (S3) label (P1); + \routesignal[backward] at (S4) label (P2); + + \routesignal[forward] at (S5) label (N1); + \routesignal[forward] at (S6) label (N2); + + \signal[distant,route,backward] at (S7) label (F); + + \distantsignal[backward] at (S8) label (Vf); + % routes - \pic at (20,0) {route_backward}; - \pic at (22,0) {route_forward}; - \pic at (20,1) {route_backward}; - \pic at (22,1) {route_forward}; + \route[backward] at (20,0); + \route[forward] at (22,0); + \route[backward] at (20,1); + \route[forward] at (22,1); + + % clearing points + \tikzset{every node/.style={backward}}; + \clearingpoint[] at (10 , 0) label (); + \clearingpoint[] at (12.3,-1) label (); + \clearingpoint[] at (12.8, 0) label (); + \clearingpoint[] at (13.4, 1) label (); + \clearingpoint[] at (14.9, 1) label (); + \coordinate (H3) at ($(Y2)!0.5!(Y4)$); % using tikz calc library + \clearingpoint[rotate=45] at (H3) label (); + \coordinate (H4) at ($(Y3)!0.8!(H1)$); % using tikz calc library + \clearingpoint[rotate=45] at (H4) label (); + \clearingpoint[] at (16 , 0) label (); + \clearingpoint[] at (18 , 1) label (); + \clearingpoint[] at (18 , 0) label (); + \clearingpoint[] at (24 , 1) label (); + \clearingpoint[] at (24 , 0) label (); + \clearingpoint[] at (26 , 0) label (); + \clearingpoint[] at (27.5, 0) label (); + \coordinate (H5) at ($(Y5)!0.8!(H2)$); % using tikz calc library + \clearingpoint[rotate=315] at (H5) label (); + \clearingpoint[] at (30 , 0) label (); } - { % axle counters - \pic at (10 , 0) {axle_counter_right}; - \pic at (12.3,-1) {axle_counter_right}; - \pic at (12.8, 0) {axle_counter_right}; - \pic at (13.4, 1) {axle_counter_right}; - \pic at (14.9, 1) {axle_counter_right}; - \pic [rotate=45] at (14.5, 2 ) {axle_counter_right}; - \pic [rotate=45] at (15.9, 0.4) {axle_counter_left}; - \pic at (16 , 0) {axle_counter_right}; - \pic at (18 , 1) {axle_counter_right}; - \pic at (18 , 0) {axle_counter_right}; - \pic at (24 , 1) {axle_counter_right}; - \pic at (24 , 0) {axle_counter_right}; - \pic at (26 , 0) {axle_counter_right}; - \pic at (27.5, 0) {axle_counter_right}; - \pic [rotate=315] at (26.2, 0.8) {axle_counter_left}; - \pic at (30 , 0) {axle_counter_right}; + { %% vehicles + \train[run=normal,forward] at (T1) label (RB); + \train[run=fast,backward] at (T4) label (IC); + \parkedvehicles[length=3cm] at (T3) label (WG); + \parkedvehicles[length=1cm] at (T2) label (Tfz); } - { % vehicles - \pic at ( 6 ,0) {train_moving_forward}; - \node at ( 4 ,0) {\emph{RB}}; - \pic at (21.5,2) {train=3}; - \node at (23 ,2) {\emph{WG}}; - \pic at (10.2,1) {train=1}; - \node at (10.7,1) {\emph{Tfz}}; - \pic at (34 ,0) {train_moving_backward}; - \node at (36 ,0) {\emph{IC}}; + { %% constructions + % platforms + \platform[side=right] at (P2); + \platform[side=left ] at (P1); } - { % hectometer posts - \tikzset{every node/.style={left,base00,rotate=-90},every path/.style={base00,dashed}}; - \node at (07.0,-2.75) { 7.200}; - \draw (07.0,-1.55) -- ++(0,0.7); - \node at (10.0,-2.75) { 8.200}; - \draw (10.0,-1.55) -- ++(0,0.7); - \node at (12.8,-2.75) { 8.400}; - \draw (12.8,-1.70) -- ++(0,0.1); - \draw (12.8,-0.70) -- ++(0,0.3); - \node at (16.0,-2.75) { 8.600}; - \draw (16.0,-1.55) -- ++(0,1.1); - \node at (18.0,-2.75) { 8.700}; - \draw (18.0,-1.55) -- ++(0,1.1); - \node at (19.0,-2.75) { 8.750}; - \draw (19.0,-1.55) -- ++(0,1.3); - \node at (23.0,-2.75) { 9.000}; - \draw (23.0,-1.55) -- ++(0,1.3); - \node at (24.0,-2.75) { 9.100}; - \draw (24.0,-1.55) -- ++(0,0.7); - \node at (26.0,-2.75) { 9.200}; - \draw (26.0,-1.55) -- ++(0,1.1); - \node at (27.5,-2.75) { 9.300}; - \draw (27.5,-1.55) -- ++(0,1.1); - \node at (30.0,-2.75) { 9.500}; - \draw (30.0,-1.55) -- ++(0,1.1); - \node at (33.0,-2.75) {10.500}; - \draw (33.0,-1.55) -- ++(0,1.3); + { %% messures + % hectometer posts + \tikzset{hectometer base={(HM)},orientation=right}; + \hectometer[] at (S1) label ( 7.200); + \hectometer[] at (S2) label ( 8.200); + \hectometer[] at (12.8,-1) label ( 8.400); + \hectometer[] at (16 , 0) label ( 8.600); + \hectometer[] at (S3) label ( 8.700); + \hectometer[] at (19 , 0) label ( 8.750); + \hectometer[] at (23 , 0) label ( 9.000); + \hectometer[] at (S5) label ( 9.100); + \hectometer[] at (26 , 0) label ( 9.200); + \hectometer[] at (27.5, 0) label ( 9.300); + \hectometer[] at (S7) label ( 9.500); + \hectometer[] at (S8) label (10.500); } \end{tikzpicture} \end{document} \ No newline at end of file diff --git a/doc/examples/station_chamstadt.pdf b/doc/examples/station_chamstadt.pdf index b527f47..7c5df6c 100644 Binary files a/doc/examples/station_chamstadt.pdf and b/doc/examples/station_chamstadt.pdf differ diff --git a/doc/examples/station_chamstadt.tex b/doc/examples/station_chamstadt.tex index 0d23e31..e1ec3aa 100644 --- a/doc/examples/station_chamstadt.tex +++ b/doc/examples/station_chamstadt.tex @@ -1,183 +1,177 @@ %!TEX TS-program = pdflatexmk -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. \documentclass[tikz,border=2]{standalone} - -\usepackage{lmodern} -\usepackage[prefix=]{xcolor-solarized} - -\def\rootTrackschematic{../../tikz-trackschematic} -\def\srcTrackschematic{\rootTrackschematic/src/tikzlibrarytrackschematic} -\input{\srcTrackschematic.topology.code.tex} -\input{\srcTrackschematic.vehicles.code.tex} -\input{\srcTrackschematic.constructions.code.tex} -\input{\srcTrackschematic.trafficcontrol.code.tex}% Order 1 -\input{\rootTrackschematic/src/layoutSymbols_DE.tikz} % Order 2 (important) +\usetikzlibrary{trackschematic} \begin{document} \begin{tikzpicture}[font=\sffamily] - { % % stations - \tikzset{every node/.style={base00}}; + { % station names + \tikzset{every node/.style={\foreground!50!\background}}; \node[right,align=left] at ( 5,1.3) {to and from\\ Berg}; \node at (21,3.9) {{\LARGE Bf Chamstadt}}; \node[left,align=right] at (37.5,1.3) {to and from\\ Dornroda}; \node[left,align=right] at (36.5,4.0) {to and from\\ Ehrenstein}; } - { % % tracks - \draw[MainTrack] ( 4.5, 0) -- ++(33, 0); - \draw[MainTrack] (15 , 0) -- ++( 1, 1) -- ++(14,0); - \draw[MainTrack] (14 , 0) -- ++( 1,-1) -- ++(10.5,0) -- ++( 1,1); - \draw[MainTrack] (27 , 1) -- ++( 1,-1); - \draw[MainTrack] (29 , 0) -- ++( 5, 5); - \draw[SecondaryTrack] ( 9 , 1) -- ++( 7, 0); - % % track numbers - \node[fill=background] at (12.5, 1) {11}; - \node[fill=background] at (21.75, 1) { 1}; - \node[fill=background] at (21.75, 0) { 2}; - \node[fill=background] at (21.75,-1) { 3}; - % % bufferstops - \pic at ( 9, 1) {bufferstop_backward}; - % % turnouts - \pic at (14.8, 1) {derailer_left_forward}; - \node at (14.7, 0.6) {\footnotesize Gs7}; - \pic at (14,0) {turnout_right_forward}; - \pic at (14,0) {fouling_point_right_forward}; - \node at (14,0.2) {\footnotesize W1}; - \pic at (15,0) {turnout_left_forward}; - \pic at (15,0) {fouling_point_left_forward}; - \node at (15,-0.2) {\footnotesize W2}; - \pic at (16,1) {turnout_left_backward}; - \pic at (16,1) {fouling_point_left_backward}; - \node at (16,1.2) {\footnotesize W3}; - \pic at (26.5,0) {turnout_left_backward}; - \pic at (26.5,0) {fouling_point_left_backward}; - \node at (26.5,0.2) {\footnotesize W4}; - \pic at (27,1) {turnout_right_forward}; - \pic at (27,1) {fouling_point_right_forward}; - \node at (27,1.2) {\footnotesize W5}; - \pic at (28,0) {turnout_right_backward}; - \pic at (28,0) {fouling_point_right_backward}; - \node at (28,-0.2) {\footnotesize W6}; - \pic at (29,0) {turnout_left_forward}; - \pic at (29,0) {fouling_point_left_forward}; - \node at (29,-0.2) {\footnotesize W7}; - \pic at (30,1) {turnout_left_backward}; - \pic at (30,1) {fouling_point_left_backward}; - \node at (30.3,0.8) {\footnotesize W8}; + % coordinates + \coordinate (A) at ( 1.5, 0); + \coordinate (B) at (37.5, 0); + \coordinate (C) at (34 , 5); - % % platforms - \pic at (19,0) {platform_left}; - \pic at (19,1) {platform_right}; + \coordinate (E1) at ( 9 , 1); + + \coordinate (Y1) at (14 , 0); + \coordinate (Y2) at (15 , 0); + \coordinate (Y3) at (16 , 1); + \coordinate (Y4) at (14.8, 1); + \coordinate (Y5) at (26.5, 0); + \coordinate (Y6) at (27 , 1); + \coordinate (Y7) at (28 , 0); + \coordinate (Y8) at (29 , 0); + \coordinate (Y9) at (30 , 1); + + \coordinate (S01) at ( 7.5, 0); + \coordinate (S02) at (10 , 0); + \coordinate (S03) at (16 ,-1); + \coordinate (S04) at (18 , 0); + \coordinate (S05) at (18 , 1); + \coordinate (S06) at (24 , 0); + \coordinate (S07) at (24 , 1); + \coordinate (S08) at (25 ,-1); + \coordinate (S09) at (33 , 0); + \coordinate (S10) at (32 , 3); + \coordinate (S11) at (35.5, 0); + \coordinate (S12) at (33.5, 4.5); + + \coordinate (T1) at ( 6 , 0); + \coordinate (T2) at (10.2, 1); + \coordinate (T3) at (16.5,-1); + + \coordinate (P1) at (21 , 0); + \coordinate (P2) at (21 , 1); + + \coordinate (HM1) at (0,-1.85); + \coordinate (HM2) at (0, 2.15); + + { %% topology + % tracks + \maintrack (A) -- (B); + \maintrack (Y1) -- ++( 1,-1) -- ++(10.5,0) -- (Y5); + \maintrack (Y2) -- ++( 1, 1) -- (Y9); + \maintrack (Y6) -- ++( 1,-1); + \maintrack (Y8) -- (Y9) -- (C); + \secondarytrack (E1) -- (Y3); + + % track numbers + \tracklabel at (12.5, 1) label (11); + \tracklabel at (21 ,-1) label (3); + \tracklabel at (P1) label (1); + \tracklabel at (P2) label (2); + + % bufferstops + \bufferstop[backward] at (E1); + + % turnouts + \tikzset{every node/.style={fouling point}}; + \turnout[forward ,branch=right] at (Y1) label (W1); + \turnout[forward ,branch=left ] at (Y2) label (W2); + \turnout[backward,branch=right] at (Y3) label (W3); + \derailer[forward,branch=left ] at (Y4) label (Gs4); + \turnout[backward,branch=right] at (Y5) label (W5); + \turnout[forward ,branch=right] at (Y6) label (W6); + \turnout[backward,branch=left ] at (Y7) label (W7); + \turnout[forward ,branch=left ] at (Y8) label (W8); + \turnout[backward,branch=right,shift label={(0.2,-0.5)}] at (Y9) label (W9); } - { % % signals - \pic at ( 7.5, 0 ) {distant_signal_forward}; - \node[left] at ( 7.5,-0.4) {Va}; - \pic at (10, 0 ) {route_signal_forward}; - \pic at (10, 0 ) {distant_signal_forward}; - \node[left] at (10,-0.4) {A}; - \pic at (16,-1 ) {route_signal_backward}; - \node[right] at (16,-0.6) {P3}; - \pic at (18, 1 ) {route_signal_backward}; - \node[right] at (18, 1.4) {P1}; - \pic at (18, 0 ) {route_signal_backward}; - \node[right] at (18, 0.4) {P2}; - \pic at (24, 1 ) {route_signal_forward}; - \node[left] at (24, 0.6) {N1}; - \pic at (24, 0 ) {route_signal_forward}; - \node[left] at (24,-0.4) {N2}; - \pic at (25,-1 ) {route_signal_forward}; - \node[left] at (25,-1.4) {N3}; - \pic at (33, 0 ) {route_signal_backward}; - \pic at (33, 0 ) {distant_signal_backward}; - \node[right] at (33, 0.4) {F}; - \pic at (35.5, 0 ) {distant_signal_backward}; - \node[right] at (35.5, 0.4) {Vf}; - \pic[rotate=45] at (32.5, 2.5) {route_signal_backward}; - \pic[rotate=45] at (32.5, 2.5) {distant_signal_backward}; - \node[right,rotate=45] at (32.2, 2.8) {G}; - \pic[rotate=45] at (34, 4 ) {distant_signal_backward}; - \node[right,rotate=45] at (33.7, 4.3) {Vg}; - % % routes - \pic at (21,-1) {route_freight_backward}; - \pic at (22.5,-1) {route_freight_forward}; - \pic at (21,0) {route_passanger_backward}; - \pic at (22.5,0) {route_passanger_forward}; - \pic at (21,1) {route_passanger_backward}; - \pic at (22.5,1) {route_passanger_forward}; + { %% traffic control + % signals + \distantsignal[forward] at (S01) label (Va); + + \signal[distant,route,forward] at (S02) label (A); + + \routesignal[backward] at (S03) label (P3); + \routesignal[backward] at (S04) label (P1); + \routesignal[backward] at (S05) label (P2); + + \routesignal[forward] at (S06) label (N1); + \routesignal[forward] at (S07) label (N2); + \routesignal[forward] at (S08) label (N3); + + \signal[distant,route,backward] at (S09) label (F); + \signal[distant,route,backward,rotate=45,shift label={(0.1,0.1)}] at (S10) label (G); + + \distantsignal[backward] at (S11) label (Vf); + \distantsignal[backward,rotate=45,shift label={(0.1,0.1)}] at (S12) label (Vg); + + % routes + \route[backward] at (20,-1); + \route[forward] at (22,-1); + \route[backward] at (20, 0); + \route[forward] at (22, 0); + \route[backward] at (20, 1); + \route[forward] at (22, 1); + + % clearing points + \tikzset{every node/.style={backward}}; + \clearingpoint[] at (10 , 0) label (); + \clearingpoint[] at (13 , 0) label (); + \clearingpoint[] at (14 , 1) label (); + \clearingpoint[] at (16 , 0) label (); + \clearingpoint[] at (16 ,-1) label (); + \clearingpoint[rotate= 45] at (15.5, 0.5) label (); + \clearingpoint[] at (18 , 1) label (); + \clearingpoint[] at (18 , 0) label (); + \clearingpoint[] at (24 , 1) label (); + \clearingpoint[] at (24 , 0) label (); + \clearingpoint[] at (26 , 1) label (); + \clearingpoint[] at (25 ,-1) label (); + \clearingpoint[] at (27 , 0) label (); + \clearingpoint[rotate=-45] at (27.5, 0.5) label (); + \clearingpoint[rotate= 45] at (29.5, 0.5) label (); + \clearingpoint[] at (30.2, 0) label (); + \clearingpoint[] at (33 , 0) label (); + \clearingpoint[rotate= 45] at (30.5, 1.5) label (); + \clearingpoint[rotate= 45] at (32 , 3 ) label (); } - { % % clearing points - \pic at (10 , 0) {clearing_point}; - \pic at (13 , 0) {clearing_point}; - \pic at (14 , 1) {clearing_point}; - \pic at (16 , 0) {clearing_point}; - \pic at (16 ,-1) {clearing_point}; - \pic[rotate=45] at (15.5, 0.5) {clearing_point}; - \pic at (18 , 1) {clearing_point}; - \pic at (18 , 0) {clearing_point}; - \pic at (24 , 1) {clearing_point}; - \pic at (24 , 0) {clearing_point}; - \pic at (26 , 1) {clearing_point}; - \pic at (25 ,-1) {clearing_point}; - \pic at (27 , 0) {clearing_point}; - \pic[rotate=-45] at (27.5, 0.5) {clearing_point}; - \pic[rotate= 45] at (29.5, 0.5) {clearing_point}; - \pic at (30.2, 0) {clearing_point}; - \pic at (33 , 0) {clearing_point}; - \pic[rotate= 45] at (30.2, 1.2) {clearing_point}; - \pic[rotate= 45] at (32 , 3 ) {clearing_point}; + { %% vehicles + \train[run=normal,forward] at (T1) label (RB); + \parkedvehicles[length=1cm] at (T2) label (Tfz); + \train[backward] at (T3) label (GZ); } - { % % vehicles - \pic at ( 7 ,0) {train_direction_forward=2}; - \node at ( 6,0) {\emph{RB}}; - % \pic at (21.5,2) {train=3}; - % \node at (23 ,2) {\emph{WG}}; - \pic at (10.2,1) {train=1}; - \node at (10.7,1) {\emph{Tfz}}; - \pic at (16.5,-1) {train_direction_backward}; - \node at (18.5,-1) {\emph{GZ}}; + { %% constructions + % platforms + \platform[side=right] at (P2); + \platform[side=left ] at (P1); } - { % % hectometer posts - \tikzset{every node/.style={left,base00,rotate=-90},every path/.style={base00,dashed}}; - \node at (07.5,-2.75) { 7.200}; - \draw (07.5,-1.55) -- ++(0,0.7); - \node at (10.0,-2.75) { 8.200}; - \draw (10.0,-1.55) -- ++(0,0.7); - \node at (13.0,-2.75) { 8.400}; - \draw (13.0,-1.55) -- ++(0,1.1); - \node at (14.0, 2.25) { 8.500}; - \draw (14.0, 2.15) -- ++(0,-.8); - \node at (15.5, 2.25) { 8.550}; - \draw (15.5, 2.15) -- ++(0,-.8); - \node at (16.0,-2.75) { 8.600}; - \draw (16.0,-1.55) -- ++(0,0.3); - \node at (18.0, 2.25) { 8.700}; - \draw (18.0, 2.15) -- ++(0,-.3); - \node at (19.0, 2.25) { 8.750}; - \draw (19.0, 2.15) -- ++(0,-.8); - \node at (23.0, 2.25) { 9.000}; - \draw (23.0, 2.15) -- ++(0,-.8); - \node at (24.0, 2.25) { 9.100}; - \draw (24.0, 2.15) -- ++(0,-.8); - \node at (25.0,-2.75) { 9.150}; - \draw (25.0,-1.55) -- ++(0,0.0); - \node at (26.0, 2.25) { 9.200}; - \draw (26.0, 2.15) -- ++(0,-.8); - \node at (27.0,-2.75) { 9.250}; - \draw (27.0,-1.55) -- ++(0,1.1); - \node at (27.5,-2.75) { 9.300}; - \draw (27.5,-1.55) -- ++(0,1.1); - \node at (29.5,-2.75) { 9.450}; - \draw (29.5,-1.55) -- ++(0,1.1); - \node at (30.2,-2.75) { 9.500}; - \draw (30.2,-1.55) -- ++(0,1.1); - \node at (33.0,-2.75) { 9.900}; - \draw (33.0,-1.55) -- ++(0,1.3); - \draw (33.0, 0.85) -- ++(0,1.2) -- ++(-0.5,0.5); - \node at (35.5,-2.75) {10.900}; - \draw (35.5,-1.55) -- ++(0,1.3); - \draw (35.5, 0.85) -- ++(0,1.7) -- ++(-1.5,1.5); + { %% messures + % hectometer posts + \tikzset{hectometer base={(HM1)},orientation=right}; + \hectometer[] at (S01) label ( 7.200); + \hectometer[] at (S02) label ( 8.200); + \hectometer[] at (13 ,0) label ( 8.400); + \hectometer[] at (S03) label ( 8.600); + + \hectometer[] at (S08) label ( 9.150); + \hectometer[] at (27 ,0) label ( 9.250); + \hectometer[] at (27.5,0) label ( 9.300); + \hectometer[] at (29.5,0) label ( 9.450); + \hectometer[] at (30.2,0) label ( 9.500); + \hectometer[] at (S09) label ( 9.900); + \hectometer[] at (S11) label (10.900); + + \messureline (S09) -- ++(0,1.7) -- (S10); + \messureline (S11) -- ++(0,2.2) -- (S12); + + \tikzset{hectometer base={(HM2)},orientation=left}; + \hectometer[] at (14 ,1) label ( 8.500); + \hectometer[] at (15.5,1) label ( 8.550); + \hectometer[] at (S05) label ( 8.700); + \hectometer[] at (19 ,1) label ( 8.750); + \hectometer[] at (23 ,1) label ( 9.000); + \hectometer[] at (S07) label ( 9.100); + \hectometer[] at (26 ,1) label ( 9.200); } \end{tikzpicture} \end{document} \ No newline at end of file diff --git a/doc/examples/station_okerbach.pdf b/doc/examples/station_okerbach.pdf deleted file mode 100644 index 3580e3a..0000000 Binary files a/doc/examples/station_okerbach.pdf and /dev/null differ diff --git a/doc/examples/station_okerbach.tex b/doc/examples/station_okerbach.tex deleted file mode 100644 index a3eb97d..0000000 --- a/doc/examples/station_okerbach.tex +++ /dev/null @@ -1,21 +0,0 @@ -%!TEX TS-program = pdflatexmk - -% Copyright 2019 Martin Scheidt (ISC license) -% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -\documentclass[tikz,border=2]{standalone} - -\usepackage{lmodern} -\usepackage[prefix=]{xcolor-solarized} - -\def\rootTrackschematic{../../tikz-trackschematic} -\def\srcTrackschematic{\rootTrackschematic/src/tikzlibrarytrackschematic} -\input{\srcTrackschematic.topology.code.tex} -\input{\srcTrackschematic.trafficcontrol.code.tex} -\input{\srcTrackschematic.constructions.code.tex} - -\begin{document} - \begin{tikzpicture}[font=\sffamily] - \input{station_okerbach.tikz} - \end{tikzpicture} -\end{document} \ No newline at end of file diff --git a/doc/examples/station_okerbach.tikz b/doc/examples/station_okerbach.tikz deleted file mode 100644 index 7d9be19..0000000 --- a/doc/examples/station_okerbach.tikz +++ /dev/null @@ -1,195 +0,0 @@ -%!TEX TS-program = pdflatexmk -%!TEX root = station_okerbach.tex - -% Copyright 2019 Martin Scheidt (ISC license) -% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -%% coordinates -\coordinate (O2R-1) at ( 0,0); % track 1 to Rebenau -\coordinate (O2R-2) at ( 0,1); % track 2 to Rebenau -\coordinate (O2S-1) at (42,0); % track 1 to Schleinitz -\coordinate (O2S-2) at (42,1); % track 2 to Schleinitz - -{ %% stations - \tikzset{every node/.style={base00}}; - \node[right,align=left] at ( 0. , 2. ) {to and from\\ Rebenau}; - \node[left,align=right] at ( 3.5, 4.0) {Sidings (Workshop)}; - \node[left,align=right] at ( 3.5, 5.0) {Sidings (Habour)}; - \node[right,align=left] at (37.5,-1.5) {Sidings (Power Station)}; - \node at (15.5, 6.3) {{\LARGE Okerbach Gbf}}; - \node at (29.0, 6.3) {{\LARGE Okerbach Pbf}}; - \node[left,align=right] at (42,2) {to and from\\ Schleinitz}; -} -{ %% tracks - \draw[MainTrack] (O2R-1) -- (O2S-1); % track 1 - \draw[MainTrack] (O2R-2) -- (O2S-2); % track 2 - \draw[MainTrack] ( 5, 1) -- ++( 1,-1); % track W1/W2 - \draw[MainTrack] ( 7, 0) -- ++( 1, 1); % track W3/W4 - \draw[SecondaryTrack] ( 7, 2) -- ++(-3, 3) -- ++(-0.5,0); % track 132 - \draw[MainTrack] ( 8, 0) -- ++( 1,-1) -- ++(13. ,0) -- ++( 1. , 1); % track 10 - \draw[MainTrack] ( 9, 1) -- ++( 1, 1) -- ++(11. ,0) -- ++( 1. ,-1); % track 13 - \draw[SecondaryTrack] (10, 2) -- ++(-4, 0) -- ++(-2. ,2) -- ++(-0.5, 0); % track 131 - \draw[MainTrack] (10, 2) -- ++( 1, 1) -- ++( 9. ,0) -- ++( 1. ,-1); % track 14 - \draw[SecondaryTrack] (11, 3) -- ++( 1, 1) -- ++( 7. ,0) -- ++( 1. ,-1); % track 15 - \draw[SecondaryTrack] (19, 4) -- ++( 4, 0); % track 215 - \draw[MainTrack] (23, 1) -- ++( 1,-1); % track W16/W18 - \draw[SecondaryTrack] (32, 0) -- ++( 1.5,-1.5) -- ++( 4, 0); % track 410 - \draw[MainTrack] (35, 0) -- ++( 1, 1); % track W21/W22 -} -{ %% track numbers - \node[fill=background,rotate=-45] at ( 4.4, 3.6) {131}; - \node[fill=background,rotate=-45] at ( 4.9, 4.1) {132}; - \node[fill=background] at (15.5,-1. ) { 10}; - \node[fill=background] at (15.5, 0. ) { 11}; - \node[fill=background] at (15.5, 1. ) { 12}; - \node[fill=background] at (15.5, 2. ) { 13}; - \node[fill=background] at (15.5, 3. ) { 14}; - \node[fill=background] at (15.5, 4. ) { 15}; - \node[fill=background] at (22. , 4. ) {215}; - \node[fill=background] at (29. , 0. ) { 1}; - \node[fill=background] at (29. , 1. ) { 2}; - \node[fill=background] at (36.5,-1.5) {410}; -} -{ %% bufferstops - \pic at ( 23, 4) {bufferstop_forward}; -} -{ %% turnouts - \pic at ( 5,1) {turnout_right_forward}; - \node at ( 5,1.2) {\footnotesize W1}; - % \pic at ( 5,1) {fouling_point_left_forward}; - \pic at ( 6,0) {turnout_right_backward}; - \node at ( 6,-0.2) {\footnotesize W2}; - % \pic at ( 6,0) {fouling_point_left_backward}; - \pic at ( 7,0) {turnout_left_forward}; - \node at ( 7,-0.2) {\footnotesize W3}; - % \pic at ( 7,0) {fouling_point_left_forward}; - \pic at ( 7,2) {turnout_right_backward}; - \node at ( 7,1.8) {\footnotesize W9}; - % \pic at ( 7,2) {fouling_point_right_backward}; - \pic at ( 8,1) {turnout_left_backward}; - \node at ( 8,1.2) {\footnotesize W4}; - % \pic at ( 8,1) {fouling_point_left_backward}; - \pic at ( 8,0) {turnout_right_forward}; - \node at ( 8,0.2) {\footnotesize W5}; - % \pic at ( 8,0) {fouling_point_right_forward}; - \pic at ( 8.5,2) {derailer_left_forward}; - \node[left,align=right] at ( 8.5,1.8) {\footnotesize Gs8}; - \pic at ( 9,1) {turnout_left_forward}; - \node at ( 9,0.8) {\footnotesize W6}; - % \pic at ( 9,1) {fouling_point_left_forward}; - \pic at (10,2) {turnout_left_forward}; - \pic at (10,2) {turnout_left_backward}; - \pic at (10,2) {slip_left_forward}; - \pic at (10,2) {slip_left_backward}; - \node[left,align=right] at ( 9.7,1.8) {\footnotesize W7ab}; - \node[right,align=left] at (10.3,2.2) {\footnotesize W7cd}; - % \pic at (10,2) {fouling_point_left_backward}; - % \pic at (10,2) {fouling_point_left_forward}; - \pic at (11,3) {turnout_left_forward}; - \node[left,align=right] at (11,3.1) {\footnotesize W10}; - % \pic at (11,3) {fouling_point_left_forward}; - - \pic at (19,4) {turnout_right_forward}; - \node at (19,4.2) {\footnotesize W11}; - % \pic at (19,4) {fouling_point_right_forward}; - \pic at (20,4) {derailer_right_backward}; - \node[right] at (20,3.8) {\footnotesize Gs12}; - \pic at (20,3) {turnout_right_backward}; - \node[right,align=left] at (20,3.1) {\footnotesize W13}; - % \pic at (20,3) {fouling_point_right_backward}; - \pic at (21,2) {turnout_right_backward}; - \node[right,align=left] at (21,2.1) {\footnotesize W14}; - % \pic at (21,2) {fouling_point_right_backward}; - \pic at (22,1) {turnout_right_backward}; - \node at (22,0.8) {\footnotesize W15}; - % \pic at (22,1) {fouling_point_left_backward}; - \pic at (23,1) {turnout_right_forward}; - \node at (23,1.2) {\footnotesize W16}; - % \pic at (23,1) {fouling_point_left_forward}; - \pic at (23,0) {turnout_left_backward}; - \node at (23,0.2) {\footnotesize W17}; - % \pic at (23,0) {fouling_point_left_backward}; - \pic at (24,0) {turnout_right_backward}; - \node at (24,-0.2) {\footnotesize W18}; - % \pic at (24,0) {fouling_point_left_backward}; - - \pic at (32,0) {turnout_right_forward}; - \node at (32,0.2) {\footnotesize W19}; - % \pic at (23,0) {fouling_point_right_forward}; - \pic at (34. ,-1.5) {derailer_left_backward}; - \node[right] at (34. ,-1.7) {\footnotesize Gs20}; - \pic at (35,0) {turnout_left_forward}; - \node at (35,-0.2) {\footnotesize W21}; - % \pic at (35,0) {fouling_point_left_forward}; - \pic at (36,1) {turnout_left_backward}; - \node at (36,1.2) {\footnotesize W22}; - % \pic at (36,1) {fouling_point_left_backward}; -} -{ %% platforms - \pic at (26,0) {platform_right=6}; - \pic at (26,1) {platform_left=6}; -} -{ %% signals - \pic at ( 1,0) {route_signal_forward}; - \node[left] at ( 1,-0.4) {A}; - \pic at ( 1,1) {route_signal_forward}; - \node[left] at ( 1, 0.6) {AA}; - \pic at ( 3,0) {shunt_limit_backward}; - \pic at ( 4,0) {shunt_signal_forward}; - \node[left] at ( 4,-0.4) {W2X}; - \pic at ( 4,1) {shunt_signal_forward}; - \node[left] at ( 4, 0.6) {W1X}; - \pic[rotate=-45] at (5.5,2.5) {shunt_signal_forward}; - \node[left,rotate=-45] at (5.3,2.3) {W9X1}; - \pic[rotate=-45] at (6. ,3. ) {shunt_signal_forward}; - \node[left,rotate=-45] at (5.8,2.8) {W9X2}; - \pic at (11,-1) {route_signal_backward}; - \node[right] at (11,-0.6) {P10}; - \pic at (11,0) {shunt_signal_backward}; - \node[right] at (11, 0.4) {W5Y}; - \pic at (11,1) {route_signal_backward}; - \node[right] at (11, 1.4) {P12}; - \pic at (12.5,2) {route_signal_backward}; - \node[right] at (12.5, 2.4) {P13}; - \pic at (13,3) {route_signal_backward}; - \node[right] at (13, 3.4) {P14}; - \pic at (13,4) {shunt_signal_backward}; - \node[right] at (13, 4.4) {W10Y}; - - \pic at (18. , 4) {shunt_signal_forward}; - \node[left] at (18, 3.6) {W11X}; - \pic at (18.5, 3) {route_signal_forward}; - \node[left] at (18.5, 2.6) {ZR14}; - \pic at (19.5, 2) {route_signal_forward}; - \node[left] at (19.5, 1.6) {ZR13}; - \pic at (20.5, 1) {route_signal_forward}; - \node[left] at (20.5, 0.6) {ZR12}; - \pic at (20.5, 0) {route_signal_forward}; - \node[left] at (20.5,-0.4) {ZR11}; - \pic at (20.5,-1) {route_signal_forward}; - \node[left] at (20.5,-1.4) {ZR10}; - \pic at (21. , 4) {shunt_signal_backward}; - \node[right] at (21. , 4.4) {W12Y}; - \pic at (25. ,1) {route_signal_backward}; - \node[right] at (25. , 1.4) {ZU2}; - \pic at (25. ,0) {route_signal_backward}; - \node[right] at (25. , 0.4) {ZU1}; - - \pic at (35. ,-1.5) {shunt_signal_backward}; - \node[right] at (35. ,-1.1) {W20Y}; - \pic at (33.5,0) {route_signal_forward}; - \node[left] at (33.5,-0.4) {N1}; - \pic at (33.5,1) {route_signal_forward}; - \node[left] at (33.5, 0.6) {N2}; - \pic at (37.5,1) {shunt_signal_backward}; - \node[right] at (37.5,1.4) {W22Y}; - \pic at (39.0,1) {shunt_limit_forward}; - \pic at (41.0,0) {route_signal_backward}; - \node[right] at (41.0, 0.4) {FF}; - \pic at (41.0,1) {route_signal_backward}; - \node[right] at (41.0, 1.4) {F}; -} -{ %% hectometer posts - \tikzset{every node/.style={base00,rotate=-90},every path/.style={base00,dashed}}; - % \draw (01.0,-0.85) -- ++(0,-0.7) node [right,align= left] {15.000}; -} \ No newline at end of file diff --git a/doc/examples/station_pockelsdorf.pdf b/doc/examples/station_pockelsdorf.pdf deleted file mode 100644 index 993abaf..0000000 Binary files a/doc/examples/station_pockelsdorf.pdf and /dev/null differ diff --git a/doc/examples/station_pockelsdorf.tex b/doc/examples/station_pockelsdorf.tex deleted file mode 100644 index 527faca..0000000 --- a/doc/examples/station_pockelsdorf.tex +++ /dev/null @@ -1,21 +0,0 @@ -%!TEX TS-program = pdflatexmk - -% Copyright 2019 Martin Scheidt (ISC license) -% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -\documentclass[tikz,border=2]{standalone} - -\usepackage{lmodern} -\usepackage[prefix=]{xcolor-solarized} - -\def\rootTrackschematic{../../tikz-trackschematic} -\def\srcTrackschematic{\rootTrackschematic/src/tikzlibrarytrackschematic} -\input{\srcTrackschematic.topology.code.tex} -\input{\srcTrackschematic.trafficcontrol.code.tex} -\input{\srcTrackschematic.constructions.code.tex} - -\begin{document} - \begin{tikzpicture}[font=\sffamily] - \input{station_pockelsdorf.tikz} - \end{tikzpicture} -\end{document} \ No newline at end of file diff --git a/doc/examples/station_pockelsdorf.tikz b/doc/examples/station_pockelsdorf.tikz deleted file mode 100644 index 992082a..0000000 --- a/doc/examples/station_pockelsdorf.tikz +++ /dev/null @@ -1,106 +0,0 @@ -%!TEX TS-program = pdflatexmk -%!TEX root = station_pockelsdorf.tex - -% Copyright 2019 Martin Scheidt (ISC license) -% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -%% coordinates -\coordinate (P2R) at ( 0, 0); % track to Rebenau -\coordinate (P2M) at ( 3,-4); % track to Mittelstadt -\coordinate (P2S) at (28, 0); % track to Schleinitz - -{ %% stations - \tikzset{every node/.style={base00}}; - \node[right,align=left] at ( 0, 1) {to and from\\ Rebenau}; - \node[left,align=right] at ( 3,-3) {to and from\\ Mittelstadt}; - \node at (13.5,3.3) {{\LARGE Pockelsdorf}}; - \node[right,align=left] at (26.5,-1.5) {Sidings}; - \node[left,align=right] at (28,1) {to and from\\ Schleinitz}; -} -{ %% tracks - \draw[MainTrack] ( P2R) -- (P2S); % track 1 - \draw[MainTrack] ( 5,0) -- ++(1,1) -- ++(14,0) -- ++(1,-1); % track 2 - \draw[MainTrack] ( 7,1) -- ++(1,1) -- ++(11,0) -- ++(1,-1); % track 3 - \draw[MainTrack] ( P2M) -- ++(5,5); - \draw[SecondaryTrack] (22,0) -- ++(1.5,-1.5) -- ++(3,0); % track 10 -} -{ %% track numbers - \node[fill=background] at (13.5, 0) { 1}; - \node[fill=background] at (13.5, 1) { 2}; - \node[fill=background] at (13.5, 2) { 3}; - \node[fill=background] at (26. ,-1.5) {10}; -} -{ %% bufferstops - % \pic at ( 9, 1) {bufferstop_backward}; -} -{ %% turnouts - \pic at ( 5,0) {turnout_left_forward}; - \node at ( 5,-0.2) {\footnotesize W1}; - % \pic at ( 5,0) {fouling_point_left_forward}; - \pic at ( 7,1) {turnout_left_forward}; - \node at ( 7,0.8) {\footnotesize W2}; - % \pic at ( 7,1) {fouling_point_left_forward}; - \pic at ( 7,0) {turnout_left_forward}; - \pic at ( 7,0) {turnout_left_backward}; - \pic at ( 7,0) {slip_left_backward}; - \node[left,align=right] at (6.7, 0.2) {\footnotesize W3ab}; - \node[right,align=left] at (7.3,-0.2) {\footnotesize W3cd}; - % \pic at ( 7,0) {fouling_point_left_forward}; - % \pic at ( 7,0) {fouling_point_left_backward}; - \pic at ( 8,1) {turnout_left_backward}; - \node at ( 8,1.2) {\footnotesize W4}; - % \pic at ( 8,1) {fouling_point_left_backward}; - - \pic at (20,1) {turnout_right_backward}; - \node[right,align=left] at (19.9,1.2) {\footnotesize W5}; - % \pic at (20,1) {fouling_point_left_backward}; - \pic at (21,0) {turnout_right_backward}; - \node at (21,-0.2) {\footnotesize W6}; - % \pic at (21,0) {fouling_point_left_backward}; - \pic at (22,0) {turnout_right_forward}; - \node at (22,0.2) {\footnotesize W7}; - % \pic at (22,0) {fouling_point_left_forward}; - \pic at (24. ,-1.5) {derailer_left_backward}; - \node[right,align=left] at (24. ,-1.7) {\footnotesize Gs10}; -} -{ %% platforms - \pic at (10.5,0) {platform_right=6}; - \pic at (10.5,1) {platform_left=6}; - \pic at (10.5,2) {platform_right=6}; -} -{ %% signals - \pic at ( 1,0) {route_signal_forward}; - \node[left] at (1,-0.4) {A}; - \pic at ( 3,0) {shunt_limit_backward}; - \pic at ( 4,0) {shunt_signal_forward}; - \node[left] at ( 4,-0.4) {W1X}; - \pic[rotate=45] at (3.75,-3.25) {route_signal_forward}; - \node[left,rotate=45] at (4.05,-3.55) {B}; - \pic[rotate=45] at (5.25,-1.75) {shunt_limit_backward}; - \pic[rotate=45] at (6 ,-1 ) {shunt_signal_forward}; - \node[left,rotate=45] at (6.3,-1.3) {W3X}; - \pic at (9.5,0) {route_signal_backward}; - \node[right] at (9.5, 0.4) {P1}; - \pic at (9.5,1) {route_signal_backward}; - \node[right] at (9.5, 1.4) {P2}; - \pic at (9.5,2) {route_signal_backward}; - \node[right] at (9.5, 2.4) {P3}; - - \pic at (17.5,0) {route_signal_forward}; - \node[left] at (17.5,-0.4) {N1}; - \pic at (17.5,1) {route_signal_forward}; - \node[left] at (17.5, 0.6) {N2}; - \pic at (17.5,2) {route_signal_forward}; - \node[left] at (17.5, 1.6) {N3}; - \pic at (23.0,0) {shunt_signal_backward}; - \node[right] at (23,0.4) {W7Y}; - \pic at (25. ,-1.5) {shunt_signal_backward}; - \node[right] at (25. ,-1.1) {W10Y}; - \pic at (25.0,0) {shunt_limit_forward}; - \pic at (27.0,0) {route_signal_backward}; - \node[right] at (27.0, 0.4) {G}; -} -{ %% hectometer posts - \tikzset{every node/.style={base00,rotate=-90},every path/.style={base00,dashed}}; - % \draw (01.0,-0.85) -- ++(0,-0.7) node [right,align= left] {15.000}; -} \ No newline at end of file diff --git a/doc/examples/station_rebenau.pdf b/doc/examples/station_rebenau.pdf deleted file mode 100644 index ff7908a..0000000 Binary files a/doc/examples/station_rebenau.pdf and /dev/null differ diff --git a/doc/examples/station_rebenau.tex b/doc/examples/station_rebenau.tex deleted file mode 100644 index 767c9ac..0000000 --- a/doc/examples/station_rebenau.tex +++ /dev/null @@ -1,21 +0,0 @@ -%!TEX TS-program = pdflatexmk - -% Copyright 2019 Martin Scheidt (ISC license) -% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -\documentclass[tikz,border=2]{standalone} - -\usepackage{lmodern} -\usepackage[prefix=]{xcolor-solarized} - -\def\rootTrackschematic{../../tikz-trackschematic} -\def\srcTrackschematic{\rootTrackschematic/src/tikzlibrarytrackschematic} -\input{\srcTrackschematic.topology.code.tex} -\input{\srcTrackschematic.trafficcontrol.code.tex} -\input{\srcTrackschematic.constructions.code.tex} - -\begin{document} - \begin{tikzpicture}[font=\sffamily] - \input{station_rebenau.tikz} - \end{tikzpicture} -\end{document} \ No newline at end of file diff --git a/doc/examples/station_rebenau.tikz b/doc/examples/station_rebenau.tikz deleted file mode 100644 index fe7cfa3..0000000 --- a/doc/examples/station_rebenau.tikz +++ /dev/null @@ -1,217 +0,0 @@ -%!TEX TS-program = pdflatexmk -%!TEX root = station_rebenau.tex - -% Copyright 2019 Martin Scheidt (ISC license) -% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -%% coordinates -\coordinate (R2W-1) at ( 0,0); % track 1 to Wenden -\coordinate (R2W-2) at ( 0,1); % track 2 to Wenden -\coordinate (R2P) at (42,4); % track to Pockelsdorf -\coordinate (R2O-1) at (42,0); % track 1 to Okerbach -\coordinate (R2O-2) at (42,1); % track 2 to Okerbach - -{ %% stations - \tikzset{every node/.style={base00}}; - \node[right,align=left] at ( 0,2) {to and from\\ Wenden}; - \node[left,align=right] at ( 8,4.0) {Sidings}; - \node at (22.5,6.3) {{\LARGE Rebenau}}; - \node[left,align=right] at (42,2) {to and from\\ Okerbach}; - \node[left,align=right] at (42,5) {to and from\\ Pockelsdorf}; -} -{ %% tracks - \draw[MainTrack] (R2W-1) -- (R2O-1); % track 1 - \draw[MainTrack] ( 5, 0) -- ++( 1, 1); - \draw[MainTrack] (R2W-2) -- ++( 8, 0) -- ++(2,2) -- ++(26,0) -- ++(2,-2) -- (R2O-2); % track 3 - \draw[SecondaryTrack] ( 9, 1) -- ++( 6, 0); % track 21 - \draw[SecondaryTrack] ( 8, 4) -- ++( 7, 0); % track 41 - \draw[SecondaryTrack] (12, 4) -- ++( 1,-1); - \draw[MainTrack] (14, 3) -- (15, 4) -- (R2P); % track 4 - \draw[MainTrack] (14, 0) -- ++( 1, 1) -- ++(18, 0); % track 2 - \draw[MainTrack] (15, 3) -- ++( 2,-2); - \draw[MainTrack] (16, 4) -- (17, 5) -- (29, 5) -- ++(5,-5); % track 5 - \draw[MainTrack] (28, 1) -- ++( 1, 1) -- ++( 5, 0) -- ++(2, 2); - \draw[SecondaryTrack] (26, 5) -- ++( 1, 1) -- ++( 3, 0); % track 51 -} -{ %% track numbers - \node[fill=background] at ( 9.0, 4) {41}; - \node[fill=background] at (10.0, 1) {21}; - \node[fill=background] at (22.5, 0) { 1}; - \node[fill=background] at (22.5, 1) { 2}; - \node[fill=background] at (22.5, 3) { 3}; - \node[fill=background] at (22.5, 4) { 4}; - \node[fill=background] at (22.5, 5) { 5}; - \node[fill=background] at (29.0, 6) {51}; -} -{ %% bufferstops - \pic at ( 9, 1) {bufferstop_backward}; - \pic at (30, 6) {bufferstop_forward}; -} -{ %% turnouts - \pic at ( 5,0) {turnout_left_forward}; - \node at ( 5,-0.2) {\footnotesize W1}; - % \pic at ( 5,0) {fouling_point_left_forward}; - \pic at ( 6,1) {turnout_left_backward}; - \node at ( 6,1.2) {\footnotesize W2}; - % \pic at ( 6,1) {fouling_point_left_backward}; - \pic at (11,4) {derailer_left_forward}; - \node[left,align=right] at (11.1,4.2) {\footnotesize Gs41}; - \pic at (12,4) {turnout_right_forward}; - \node at (12,4.2) {\footnotesize W3}; - % \pic at (12,4) {fouling_point_right_forward}; - \pic at (13,3) {turnout_right_backward}; - \node at (13,2.8) {\footnotesize W4}; - % \pic at (13,3) {fouling_point_right_backward}; - \pic at (14,3) {turnout_left_forward}; - \node at (14,2.8) {\footnotesize W5}; - % \pic at (14,3) {fouling_point_left_forward}; - \pic at (15,4) {turnout_left_backward}; - \node at (15,4.2) {\footnotesize W6}; - % \pic at (15,4) {fouling_point_left_backward}; - \pic at (14,0) {turnout_left_forward}; - \node at (14,-0.2) {\footnotesize W10}; - % \pic at (14.0,0) {fouling_point_left_forward}; - \pic at (15,1) {turnout_left_backward}; - \node at (15,1.2) {\footnotesize W11}; - % \pic at (15,1) {fouling_point_left_backward}; - \pic at (14,1) {derailer_left_forward}; - \node[left,align=right] at (14.1,1.2) {\footnotesize Gs21}; - \pic at (15,3) {turnout_right_forward}; - \node at (15,3.2) {\footnotesize W8}; - % \pic at (15,3) {fouling_point_right_forward}; - \pic at (16,4) {turnout_left_forward}; - \node at (16,3.8) {\footnotesize W7}; - % \pic at (16,4) {fouling_point_left_forward}; - \pic at (17,1) {turnout_right_backward}; - \node at (17,0.8) {\footnotesize W9}; - % \pic at (17,1) {fouling_point_right_backward}; - - \pic at (28,1) {turnout_left_forward}; - \node at (28,0.8) {\footnotesize W15}; - % \pic at (28,1) {fouling_point_left_forward}; - \pic at (26,5) {turnout_left_forward}; - \node at (26,4.8) {\footnotesize W12}; - % \pic at (28,5) {fouling_point_right_forward}; - \pic [rotate=45] at (26.7,5.7) {derailer_right_backward}; - \node[right,align=left] at (26.8,5.6) {\footnotesize Gs51}; - \pic at (30,4) {turnout_right_forward}; - \pic at (30,4) {turnout_right_backward}; - \pic at (30,4) {slip_right_forward}; - \pic at (30,4) {slip_right_backward}; - \node[left,align=right] at (29.7,4.2) {\footnotesize W13ab}; - \node[right,align=left] at (30.3,3.8) {\footnotesize W13cd}; - % \pic at (30,4) {fouling_point_right_backward}; - % \pic at (30,4) {fouling_point_right_forward}; - \pic at (31,3) {turnout_right_forward}; - \pic at (31,3) {turnout_right_backward}; - \pic at (31,3) {slip_right_forward}; - \pic at (31,3) {slip_right_backward}; - \node[left,align=right] at (30.7,3.2) {\footnotesize W14ab}; - \node[right,align=left] at (31.3,2.8) {\footnotesize W14cd}; - % \pic at (31,3) {fouling_point_right_backward}; - % \pic at (31,3) {fouling_point_right_forward}; - \pic at (32,2) {turnout_right_forward=none}; - \pic at (32,2) {turnout_right_backward=none}; - \node[right,align=left] at (31.9,2.2) {\footnotesize K16}; - % \pic at (32,2) {fouling_point_right_backward}; - % \pic at (32,2) {fouling_point_right_forward}; - \pic at (33,1) {turnout_right_backward}; - \node[right,align=left] at (32.9,1.2) {\footnotesize W17}; - % \pic at (33,1) {fouling_point_right_backward}; - \pic at (34,0) {turnout_right_backward}; - \node at (34,-0.2) {\footnotesize W18}; - % \pic at (34,0) {fouling_point_right_backward}; - \pic at (35,3) {turnout_left_forward}; - \pic at (35,3) {turnout_left_backward}; - \pic at (35,3) {slip_left_forward}; - \pic at (35,3) {slip_left_backward}; - \node[left,align=right] at (34.7,2.8) {\footnotesize W19ab}; - \node[right,align=left] at (35.3,3.2) {\footnotesize W19cd}; - % \pic at (35,3) {fouling_point_left_backward}; - % \pic at (35,3) {fouling_point_left_forward}; - \pic at (36,4) {turnout_left_backward}; - \node at (36,4.2) {\footnotesize W20}; - % \pic at (36,4) {fouling_point_left_backward}; -} -{ %% platforms - \pic at (19.5,0) {platform_right=6}; - \pic at (19.5,1) {platform_left=6}; - \pic at (19.5,3) {platform_right=6}; -} -{ %% signals - \pic at ( 1,0) {route_signal_forward}; - \node[left] at (1,-0.4) {A}; - \pic at ( 1,1) {route_signal_forward}; - \node[left] at (1, 0.6) {AA}; - \pic at ( 3,0) {shunt_limit_backward}; - \pic at ( 4,0) {shunt_signal_forward}; - \node[left] at ( 4,-0.4) {W1X}; - \pic at ( 7,1) {shunt_signal_backward}; - \node[right] at ( 7, 1.4) {W2Y}; - \pic at ( 7,0) {shunt_signal_backward}; - \node[right] at ( 7, 0.4) {W1Y}; - \pic at (11,3) {shunt_signal_forward}; - \node[left] at (11, 2.6) {W4X}; - \pic at (10,4) {shunt_signal_forward}; - \node[left] at (10, 3.6) {41X}; - \pic at (13,0) {shunt_signal_forward}; - \node[left] at (13,-0.4) {W10X}; - \pic at (13,1) {shunt_signal_forward}; - \node[left] at (13, 0.6) {21X}; - \pic at (18.5,0) {route_signal_backward}; - \node[right] at (18.5, 0.4) {P1}; - \pic at (18.5,1) {route_signal_backward}; - \node[right] at (18.5, 1.4) {P2}; - \pic at (18.5,3) {route_signal_backward}; - \node[right] at (18.5, 3.4) {P3}; - \pic at (18.5,4) {route_signal_backward}; - \node[right] at (18.5, 4.4) {P4}; - \pic at (18.5,5) {route_signal_backward}; - \node[right] at (18.5, 5.4) {P5}; - - \pic at (24.5,5) {route_signal_forward}; - \node[left] at (24.5, 4.6) {N5}; - \pic at (26.5,1) {route_signal_forward}; - \node[left] at (26.5, 0.6) {N2}; - \pic at (26.5,3) {route_signal_forward}; - \node[left] at (26.5, 2.6) {N3}; - \pic at (26.5,4) {route_signal_forward}; - \node[left] at (26.5, 3.6) {N4}; - \pic at (27.5,6) {shunt_signal_backward}; - \node[right] at ( 27.5, 6.4) {51Y}; - \pic at (30.0,0) {route_signal_forward}; - \node[left] at (30.0,-0.4) {N1}; - \pic at (35.0,0) {shunt_signal_backward}; - \node[right] at ( 35, 0.4) {W18Y}; - \pic[rotate=-45] at (36.8,2.2) {shunt_signal_backward}; - \node[right,rotate=-45] at ( 37.0, 2.5) {W19Y}; - \pic at (37.0,4) {shunt_signal_backward}; - \node[right] at ( 37, 4.4) {W20Y}; - \pic at (39.0,1) {shunt_limit_forward}; - \pic at (39.0,4) {shunt_limit_forward}; - \pic at (41.0,0) {route_signal_backward}; - \node[right] at (41.0, 0.4) {FF}; - \pic at (41.0,1) {route_signal_backward}; - \node[right] at (41.0, 1.4) {F}; - \pic at (41.0,4) {route_signal_backward}; - \node[right] at (41.0, 4.4) {G}; -} -{ %% hectometer posts - \tikzset{every node/.style={base00,rotate=-90},every path/.style={base00,dashed}}; - \draw (01.0,-0.85) -- ++(0,-0.7) node [right,align= left] {15.000}; - \draw (14.5,-0.85) -- ++(0,-0.7) node [right,align= left] {15.800}; - \draw (14.5, 4.35) -- ++(0, 1.2) node [ left,align=right] {15.800}; - \draw (15.8,-0.35) -- ++(0,-1.2) node [right,align= left] {15.900}; - \draw (15.8, 4.35) -- ++(0, 1.2) node [ left,align=right] {15.900}; - \draw (18.5,-0.35) -- ++(0,-1.2) node [right,align= left] {16.000}; - \draw (22.5,-0.85) -- ++(0,-0.7) node [right,align= left] {16.300}; - \draw (24.5, 5.35) -- ++(0, 0.7) node [ left,align=right] {16.400}; - \draw (26.5,-0.35) -- ++(0,-1.2) node [right,align= left] {16.500}; - \draw (30.0,-0.85) -- ++(0,-0.7) node [right,align= left] {16.600}; - \draw (30.0, 6.35) -- ++(0, 0.3) node [ left,align=right] {16.600}; - \draw (30.0, 4.75) -- ++(0, 0.7); - \draw (31.5,-0.85) -- ++(0,-0.7) node [right,align= left] {16.700}; - \draw (31.5, 4.35) -- ++(0, 0.7) node [ left,align=right] {16.700}; - \draw (33.3,-0.35) -- ++(0,-1.2) node [right,align= left] {16.800}; - \draw (41.0,-0.35) -- ++(0,-1.2) node [right,align= left] {17.200}; -} \ No newline at end of file diff --git a/doc/examples/station_schleinitz.pdf b/doc/examples/station_schleinitz.pdf deleted file mode 100644 index e1a3fe0..0000000 Binary files a/doc/examples/station_schleinitz.pdf and /dev/null differ diff --git a/doc/examples/station_schleinitz.tex b/doc/examples/station_schleinitz.tex deleted file mode 100644 index ecc2686..0000000 --- a/doc/examples/station_schleinitz.tex +++ /dev/null @@ -1,21 +0,0 @@ -%!TEX TS-program = pdflatexmk - -% Copyright 2019 Martin Scheidt (ISC license) -% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -\documentclass[tikz,border=2]{standalone} - -\usepackage{lmodern} -\usepackage[prefix=]{xcolor-solarized} - -\def\rootTrackschematic{../../tikz-trackschematic} -\def\srcTrackschematic{\rootTrackschematic/src/tikzlibrarytrackschematic} -\input{\srcTrackschematic.topology.code.tex} -\input{\srcTrackschematic.trafficcontrol.code.tex} -\input{\srcTrackschematic.constructions.code.tex} - -\begin{document} - \begin{tikzpicture}[font=\sffamily] - \input{station_schleinitz.tikz} - \end{tikzpicture} -\end{document} \ No newline at end of file diff --git a/doc/examples/station_schleinitz.tikz b/doc/examples/station_schleinitz.tikz deleted file mode 100644 index f917862..0000000 --- a/doc/examples/station_schleinitz.tikz +++ /dev/null @@ -1,172 +0,0 @@ -%!TEX TS-program = pdflatexmk -%!TEX root = station_schleinitz.tex - -% Copyright 2019 Martin Scheidt (ISC license) -% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -%% coordinates -\coordinate (S2O-1) at ( 0, 0); % track 1 to Okerbach -\coordinate (S2O-2) at ( 0, 1); % track 2 to Okerbach -\coordinate (S2P) at ( 0,-4); % track to Pockelsdorf -\coordinate (S2SB-1) at (44, 0); % track 1 to Schlossberg -\coordinate (S2SB-2) at (44, 1); % track 2 to Schlossberg - -{ %% stations - \tikzset{every node/.style={base00}}; - \node[right,align=left] at ( 0,2) {to and from\\ Okerbach}; - % \node[left,align=right] at ( 8,4.0) {Sidings}; - \node at ( 5.0,3.3) {{\LARGE Abzw Bülten}}; - \node at (30.0,5.3) {{\LARGE Schleinitz}}; - \node[left,align=right] at (44,2) {to and from\\ Schlossberg}; - \node[left,align=right,rotate=45] at (2,-1) {to and from\\ Pockelsdorf}; -} -{ %% tracks - \draw[MainTrack] (S2O-1) -- (S2SB-1); % track 2 - \draw[MainTrack] (S2O-2) -- (S2SB-2); % track 3 - \draw[MainTrack] (S2P) -- ++( 4, 4); % track to pockelsdorf - \draw[MainTrack] ( 5, 0) -- ++( 1, 1); % track W2/W3 - \draw[MainTrack] (16, 1) -- ++( 1,-1); % track W4/W5 - \draw[MainTrack] (18, 0) -- ++( 1, 1); % track W6/W7 - \draw[SecondaryTrack] (23, 2) -- ++( -5, 0); % track 41 - \draw[MainTrack] (22, 0) -- ++( 1,-1) -- ++(13. ,0) -- ++( 1. , 1); % track 1 - \draw[MainTrack] (22, 1) -- ++( 1, 1) -- ++(13. ,0) -- ++( 1. ,-1); % track 4 - \draw[SecondaryTrack] (24, 2) -- ++( 1, 1) -- ++(10. ,0) -- ++( 1. ,-1); % track 5 - \draw[SecondaryTrack] (36,-1) -- ++( 5, 0); % track 11 - \draw[MainTrack] (38, 1) -- ++( 1,-1); % track W18/W19 -} -{ %% track numbers - \node[fill=background] at (19.0, 2) {41}; - \node[fill=background] at (30.0,-1) { 1}; - \node[fill=background] at (30.0, 0) { 2}; - \node[fill=background] at (30.0, 1) { 3}; - \node[fill=background] at (30.0, 2) { 4}; - \node[fill=background] at (30.0, 3) { 5}; - \node[fill=background] at (40.0,-1) {11}; -} -{ %% bufferstops - \pic at ( 18, 2) {bufferstop_backward}; - \pic at ( 41,-1) {bufferstop_forward}; -} -{ %% turnouts - \pic at ( 4,0) {turnout_left_backward}; - \node at ( 4,0.2) {\footnotesize W1}; - % \pic at ( 4,0) {fouling_point_left_backward}; - \pic at ( 5,0) {turnout_left_forward}; - \node at ( 5,-0.2) {\footnotesize W2}; - % \pic at ( 5,0) {fouling_point_left_forward}; - \pic at ( 6,1) {turnout_left_backward}; - \node at ( 6,1.2) {\footnotesize W3}; - % \pic at ( 6,1) {fouling_point_left_backward}; - \pic at (16,1) {turnout_right_forward}; - \node at (16,1.2) {\footnotesize W4}; - % \pic at (16,1) {fouling_point_right_forward}; - \pic at (17,0) {turnout_right_backward}; - \node at (17,-0.2) {\footnotesize W5}; - % \pic at (17,0) {fouling_point_right_backward}; - \pic at (18,0) {turnout_left_forward}; - \node at (18,-0.2) {\footnotesize W6}; - % \pic at (18,0) {fouling_point_left_forward}; - \pic at (19,1) {turnout_left_backward}; - \node at (19,1.2) {\footnotesize W7}; - % \pic at (19,1) {fouling_point_left_backward}; - \pic at (22,0) {turnout_right_forward}; - \node at (22,0.2) {\footnotesize W8}; - % \pic at (22,0) {fouling_point_right_forward}; - \pic at (22,1) {turnout_left_forward}; - \node at (22,0.8) {\footnotesize W9}; - % \pic at (22,1) {fouling_point_left_forward}; - \pic at (22,2) {derailer_left_forward}; - \node[left,align=right] at (22,1.8) {\footnotesize Gs10}; - \pic at (23,2) {turnout_left_backward}; - \node at (23,2.2) {\footnotesize W11}; - % \pic at (23,2) {fouling_point_left_backward}; - \pic at (24,2) {turnout_left_forward}; - \node at (24,1.8) {\footnotesize W12}; - % \pic at (24,2) {fouling_point_left_forward}; - - \pic at (36,-1) {turnout_left_forward}; - \node at (36,-1.2) {\footnotesize W13}; - % \pic at (36,-1) {fouling_point_left_forward}; - \pic at (36,2) {turnout_right_backward}; - \node[right,align=left] at (35.9,2.2) {\footnotesize W14}; - % \pic at (17,0) {fouling_point_right_backward}; - \pic at (37,1) {turnout_right_backward}; - \node at (37,0.8) {\footnotesize W17}; - % \pic at (37,1) {fouling_point_right_backward}; - \pic at (37,0) {turnout_left_backward}; - \node at (37,0.2) {\footnotesize W16}; - % \pic at (37,0) {fouling_point_left_backward}; - \pic at (37,-1) {derailer_left_backward}; - \node[right,align=left] at (37,-1.2) {\footnotesize Gs15}; - \pic at (38,1) {turnout_right_forward}; - \node at (38,1.2) {\footnotesize W18}; - % \pic at (38,1) {fouling_point_right_forward}; - \pic at (39,0) {turnout_right_backward}; - \node at (39,-0.2) {\footnotesize W19}; - % \pic at (39,0) {fouling_point_right_backward}; -} -{ %% platforms - \pic at (27,0) {platform_left=6}; - \pic at (27,1) {platform_right=6}; -} -{ %% signals - \pic at ( 2,0) {route_signal_forward}; - \node[left] at (2,-0.4) {19}; - \pic at ( 2,1) {route_signal_forward}; - \node[left] at (2, 0.6) {39}; - \pic[rotate=45] at (2.25,-1.75) {route_signal_forward}; - \node[left,rotate=45] at (2.5,-2.0) {49}; - \pic at ( 8,0) {route_signal_backward}; - \node[right] at (8, 0.4) {20}; - \pic at ( 8,1) {route_signal_backward}; - \node[right] at (8, 1.4) {30}; - \pic at (12,0) {route_signal_forward}; - \node[left] at (12,-0.4) {A}; - \pic at (12,1) {route_signal_forward}; - \node[left] at (12, 0.6) {AA}; - \pic at (14,0) {shunt_limit_backward}; - \pic at (15,0) {shunt_signal_forward}; - \node[left] at (15,-0.4) {W5X}; - \pic at (15,1) {shunt_signal_forward}; - \node[left] at (15, 0.6) {W4X}; - \pic at (21,1) {shunt_signal_forward}; - \node[left] at (21, 0.6) {W9X}; - \pic at (20.5,2) {shunt_signal_forward}; - \node[left] at (20.5, 1.6) {W10X}; - \pic at (24,-1) {route_signal_backward}; - \node[right] at (24,-0.6) {P1}; - \pic at (24, 0) {route_signal_backward}; - \node[right] at (24, 0.4) {P2}; - \pic at (26, 1) {route_signal_backward}; - \node[right] at (26, 1.4) {P3}; - \pic at (26, 2) {route_signal_backward}; - \node[right] at (26, 2.4) {P4}; - \pic at (26, 3) {shunt_signal_backward}; - \node[right] at (26, 3.4) {W12Y}; - - \pic at (34, 3) {shunt_signal_forward}; - \node[left] at (34, 2.6) {W14X}; - \pic at (34, 2) {route_signal_forward}; - \node[left] at (34, 1.6) {N4}; - \pic at (34, 1) {route_signal_forward}; - \node[left] at (34, 0.6) {N3}; - \pic at (34, 0) {route_signal_forward}; - \node[left] at (34,-0.4) {N2}; - \pic at (34,-1) {route_signal_forward}; - \node[left] at (34,-1.4) {N1}; - \pic at (38,-1) {shunt_signal_backward}; - \node[right] at (38,-0.6) {W15Y}; - \pic at (40,0) {shunt_signal_backward}; - \node[right] at (40,0.4) {W18Y}; - \pic at (40,1) {shunt_signal_backward}; - \node[right] at (40,1.4) {W19Y}; - \pic at (41.5,1) {shunt_limit_forward}; - \pic at (43.5,0) {route_signal_backward}; - \node[right] at (43.5, 0.4) {FF}; - \pic at (43.5,1) {route_signal_backward}; - \node[right] at (43.5, 1.4) {F}; -} -{ %% hectometer posts - \tikzset{every node/.style={base00,rotate=-90},every path/.style={base00,dashed}}; - % \draw (01.0,-0.85) -- ++(0,-0.7) node [right,align= left] {15.000}; -} \ No newline at end of file diff --git a/doc/snippets.pdf b/doc/snippets.pdf index dea8774..3b74c49 100644 Binary files a/doc/snippets.pdf and b/doc/snippets.pdf differ diff --git a/doc/snippets.tex b/doc/snippets.tex index dfe7aae..5d1e8da 100644 --- a/doc/snippets.tex +++ b/doc/snippets.tex @@ -1,58 +1,56 @@ %!TEX TS-program = pdflatexmk -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. \documentclass[a4paper,landscape]{article} \usepackage[margin=0pt]{geometry} \pagestyle{empty} -\usepackage{longtable,siunitx,tikz,adjustbox} -\usepackage{listings} -\lstset{ - language=TeX, - basicstyle=\ttfamily, - columns=fullflexible, - breaklines=true -} -\def\rootTrackschematic{../tikz-trackschematic} +\usepackage{doc} -\renewcommand{\symbol}[1]{ - \adjustbox{valign=c}{\begin{tikzpicture}[scale=1.0,transform shape] - \input{\rootTrackschematic/snippets/#1} - \path (-3,-1.1) rectangle (3,1.1); % background rectangle to unify every cell containing a symbol - \end{tikzpicture}} -} -\newcommand{\code}[1]{\lstinputlisting[firstline=7]{\rootTrackschematic/snippets/#1}} -\newcounter{symbolNo} -\def\No{\stepcounter{symbolNo}\arabic{symbolNo}} - -\def\srcTrackschematic{\rootTrackschematic/src/tikzlibrarytrackschematic} -\input{\srcTrackschematic.topology.code.tex} -\input{\srcTrackschematic.trafficcontrol.code.tex} -\input{\srcTrackschematic.vehicles.code.tex} -\input{\srcTrackschematic.constructions.code.tex} - -\title{Snippets}\author{}\date{} +\lstset{% + language = TeX,% + basicstyle = \bfseries\scriptsize\ttfamily,% + keywordstyle = \bfseries\color{black},% + commentstyle = \itshape\color{green},% + backgroundcolor = \color{white},% + showstringspaces = false,% + columns = fullflexible,% + breaklines = true,% + frame = none,% +}% \begin{document} + + \title{Snippets}\author{}\date{} + \maketitle \centering + \begin{longtable}{|r|l|c|l|c|} \hline - No. & Name & Symbol & Code & Sub library \\ + No. & Name & Symbol & Code & Sublibrary \\ \endhead \hline \No & main track & \symbol{main_track.tikz} & \code{main_track.tikz} & \texttt{topology} \\ \hline \No & main line (double track) & \symbol{main_line.tikz} & \code{main_line.tikz} & \texttt{topology} \\ - \hline - \No & track distance (in \si{\metre}) & \symbol{track_distance.tikz} & \code{track_distance.tikz} & \texttt{topology} \\ \hline \No & secondary track & \symbol{secondary_track.tikz} & \code{secondary_track.tikz} & \texttt{topology} \\ \hline \No & track number & \symbol{track_number.tikz} & \code{track_number.tikz} & \texttt{topology} \\ + \hline + \No & bufferstop (forward) & \symbol{bufferstop_forward.tikz} & \code{bufferstop_forward.tikz} & \texttt{topology} \\ + \hline + \No & bufferstop (backward) & \symbol{bufferstop_backward.tikz} & \code{bufferstop_backward.tikz} & \texttt{topology} \\ + \hline + \No & friction bufferstop (forward) & \symbol{friction_bufferstop_forward.tikz} & \code{friction_bufferstop_forward.tikz} & \texttt{topology} \\ + \hline + \No & friction bufferstop (backward) & \symbol{friction_bufferstop_backward.tikz} & \code{friction_bufferstop_backward.tikz} & \texttt{topology} \\ + \hline + \No & track closure & \symbol{track_closure.tikz} & \code{track_closure.tikz} & \texttt{topology} \\ \hline \No & turnout left (forward) & \symbol{turnout_left_forward.tikz} & \code{turnout_left_forward.tikz} & \texttt{topology} \\ \hline @@ -117,6 +115,18 @@ \hline \No & \parbox[c]{5cm}{turnout right (backward)\\with moving points} & \symbol{turnout_right_backward_moving_points.tikz} & \code{turnout_right_backward_moving_points.tikz} & \texttt{topology} \\ + \hline + \No & \parbox[c]{5cm}{turnout left (forward)\\operated manually} + & \symbol{turnout_left_forward_manually.tikz} & \code{turnout_left_forward_manually.tikz} & \texttt{topology} \\ + \hline + \No & \parbox[c]{5cm}{turnout right (forward)\\operated manually} + & \symbol{turnout_right_forward_manually.tikz} & \code{turnout_right_forward_manually.tikz} & \texttt{topology} \\ + \hline + \No & \parbox[c]{5cm}{turnout left (backward)\\operated manually} + & \symbol{turnout_left_backward_manually.tikz} & \code{turnout_left_backward_manually.tikz} & \texttt{topology} \\ + \hline + \No & \parbox[c]{5cm}{turnout right (backward)\\operated manually} + & \symbol{turnout_right_backward_manually.tikz} & \code{turnout_right_backward_manually.tikz} & \texttt{topology} \\ \hline \No & derailer left (forward) & \symbol{derailer_left_forward.tikz} & \code{derailer_left_forward.tikz} & \texttt{topology} \\ \hline @@ -126,23 +136,25 @@ \hline \No & derailer right (backward) & \symbol{derailer_right_backward.tikz} & \code{derailer_right_backward.tikz} & \texttt{topology} \\ \hline - \No & bufferstop (forward) & \symbol{bufferstop_forward.tikz} & \code{bufferstop_forward.tikz} & \texttt{topology} \\ + \No & vehicles (parked) & \symbol{parked_vehicles.tikz} & \code{parked_vehicles.tikz} & \texttt{vehicles} \\ \hline - \No & bufferstop (backward) & \symbol{bufferstop_backward.tikz} & \code{bufferstop_backward.tikz} & \texttt{topology} \\ + \No & vehicles with label (parked) & \symbol{parked_vehicles_with_label.tikz} & \code{parked_vehicles_with_label.tikz} & \texttt{vehicles} \\ \hline - \No & vehicles (parked) & \symbol{vehicles.tikz} & \code{vehicles.tikz} & \texttt{vehicles} \\ + \No & vehicle (parked) & \symbol{parked_vehicle.tikz} & \code{parked_vehicle.tikz} & \texttt{vehicles} \\ \hline - \No & vehicles with label (parked) & \symbol{vehicles_with_label.tikz} & \code{vehicles_with_label.tikz} & \texttt{vehicles} \\ + \No & \parbox[c]{4cm}{train in shunting mode\\(direction forward)} + & \symbol{train_shunt_mode_forward.tikz} & \code{train_shunt_mode_forward.tikz} & \texttt{vehicles} \\ \hline - \No & vehicle (parked) & \symbol{vehicle.tikz} & \code{vehicle.tikz} & \texttt{vehicles} \\ + \No & \parbox[c]{4cm}{train in shunting mode\\(direction backward)} + & \symbol{train_shunt_mode_backward.tikz} & \code{train_shunt_mode_backward.tikz} & \texttt{vehicles} \\ + \hline + \No & train shunting (forward) & \symbol{train_shunting_forward.tikz} & \code{train_shunting_forward.tikz} & \texttt{vehicles} \\ + \hline + \No & train shunting (backward) & \symbol{train_shunting_backward.tikz} & \code{train_shunting_backward.tikz} & \texttt{vehicles} \\ \hline \No & train (direction forward) & \symbol{train_direction_forward.tikz} & \code{train_direction_forward.tikz} & \texttt{vehicles} \\ \hline \No & train (direction backward) & \symbol{train_direction_backward.tikz} & \code{train_direction_backward.tikz} & \texttt{vehicles} \\ - \hline - \No & ghost train (direction forward) & \symbol{ghost_train_direction_forward.tikz} & \code{ghost_train_direction_forward.tikz} & \texttt{vehicles} \\ - \hline - \No & ghost train (direction backward)& \symbol{ghost_train_direction_backward.tikz} & \code{ghost_train_direction_backward.tikz} & \texttt{vehicles} \\ \hline \No & train moving (forward) & \symbol{train_moving_forward.tikz} & \code{train_moving_forward.tikz} & \texttt{vehicles} \\ \hline @@ -156,21 +168,17 @@ \hline \No & train moving fast (backward) & \symbol{train_moving_fast_backward.tikz} & \code{train_moving_fast_backward.tikz} & \texttt{vehicles} \\ \hline - \No & \parbox[c]{4cm}{train in shunting mode\\(direction forward)} - & \symbol{train_shunt_mode_forward.tikz} & \code{train_shunt_mode_forward.tikz} & \texttt{vehicles} \\ + \No & train ghost (direction forward) & \symbol{train_ghost_direction_forward.tikz} & \code{train_ghost_direction_forward.tikz} & \texttt{vehicles} \\ \hline - \No & \parbox[c]{4cm}{train in shunting mode\\(direction backward)} - & \symbol{train_shunt_mode_backward.tikz} & \code{train_shunt_mode_backward.tikz} & \texttt{vehicles} \\ - \hline - \No & train shunting (forward) & \symbol{train_shunting_forward.tikz} & \code{train_shunting_forward.tikz} & \texttt{vehicles} \\ - \hline - \No & train shunting (backward) & \symbol{train_shunting_backward.tikz} & \code{train_shunting_backward.tikz} & \texttt{vehicles} \\ + \No & train ghost (direction backward)& \symbol{train_ghost_direction_backward.tikz} & \code{train_ghost_direction_backward.tikz} & \texttt{vehicles} \\ \hline \No & \parbox[c]{4cm}{train operated automatic\\(direction forward)} & \symbol{train_drive_automatic.tikz} & \code{train_drive_automatic.tikz} & \texttt{vehicles} \\ \hline \No & \parbox[c]{4cm}{train operated by human\\(direction forward)} & \symbol{train_drive_human.tikz} & \code{train_drive_human.tikz} & \texttt{vehicles} \\ + \hline + \No & train running over a junction & \symbol{bend_train.tikz} & \code{bend_train.tikz} & \texttt{vehicles} \\ \hline \No & view point (forward) & \symbol{view_point_forward.tikz} & \code{view_point_forward.tikz} & \texttt{trafficcontrol} \\ \hline @@ -198,7 +206,7 @@ \hline \No & route signal (backward) & \symbol{route_signal_backward.tikz} & \code{route_signal_backward.tikz} & \texttt{trafficcontrol} \\ \hline - \No & \parbox[c]{4cm}{combined signal\\(distant and block signal)} + \No & \parbox[c]{4cm}{combined signal\\(distant, block and route signal)} & \symbol{combined_signal_forward.tikz} & \code{combined_signal_forward.tikz} & \texttt{trafficcontrol} \\ \hline \No & shunt signal (forward) & \symbol{shunt_signal_forward.tikz} & \code{shunt_signal_forward.tikz} & \texttt{trafficcontrol} \\ @@ -212,24 +220,12 @@ \No & shunt limit (forward) & \symbol{shunt_limit_forward.tikz} & \code{shunt_limit_forward.tikz} & \texttt{trafficcontrol} \\ \hline \No & shunt limit (backward) & \symbol{shunt_limit_backward.tikz} & \code{shunt_limit_backward.tikz} & \texttt{trafficcontrol} \\ - \hline - \No & transmitter (below \& above) & \symbol{transmitter.tikz} & \code{transmitter.tikz} & \texttt{trafficcontrol} \\ - \hline - \No & \parbox[c]{4.5cm}{transmitter (below)\\with signal} - & \symbol{transmitter_below_with_signal.tikz} & \code{transmitter_below_with_signal.tikz} & \texttt{trafficcontrol} \\ - \hline - \No & \parbox[c]{4.5cm}{transmitter (below \& above)\\ effective forward} - & \symbol{transmitter_forward.tikz} & \code{transmitter_forward.tikz} & \texttt{trafficcontrol} \\ - \hline - \No & \parbox[c]{4.5cm}{transmitter (below \& above)\\ effective backward} - & \symbol{transmitter_backward.tikz} & \code{transmitter_backward.tikz} & \texttt{trafficcontrol} \\ - \hline - \No & \parbox[c]{4.5cm}{transmitter (below \& above)\\ effective bidirectional} - & \symbol{transmitter_bidirectional.tikz} & \code{transmitter_bidirectional.tikz} & \texttt{trafficcontrol} \\ \hline \No & block end marker (forward) & \symbol{block_end_marker_forward.tikz} & \code{block_end_marker_forward.tikz} & \texttt{trafficcontrol} \\ \hline \No & block end marker (backward) & \symbol{block_end_marker_backward.tikz} & \code{block_end_marker_backward.tikz} & \texttt{trafficcontrol} \\ + \hline + \No & route (forward \& backward) & \symbol{route.tikz} & \code{route.tikz} & \texttt{trafficcontrol} \\ \hline \No & block clearing point (forward) & \symbol{block_clearing_point_forward.tikz} & \code{block_clearing_point_forward.tikz} & \texttt{trafficcontrol} \\ \hline @@ -245,13 +241,23 @@ \hline \No & train berth sign (backward) & \symbol{train_berth_sign_backward.tikz} & \code{train_berth_sign_backward.tikz} & \texttt{trafficcontrol} \\ \hline - \No & train berth shape & \symbol{train_berth_shape.tikz} & \code{train_berth_shape.tikz} & \texttt{trafficcontrol} \\ + \No & train berth & \symbol{train_berth.tikz} & \code{train_berth.tikz} & \parbox[c]{3cm}{\centering\texttt{trafficcontrol} \\ \& \\ \texttt{messures}} \\ \hline - \No & train berth shape bidirectional & \symbol{train_berth_shape_bidirectional.tikz} & \code{train_berth_shape_bidirectional.tikz} & \texttt{trafficcontrol} \\ + \No & transmitter (right \& left) & \symbol{transmitter.tikz} & \code{transmitter.tikz} & \texttt{trafficcontrol} \\ \hline - \No & train berth with different shape& \symbol{train_berth_shape_different.tikz} & \code{train_berth_shape_different.tikz} & \texttt{trafficcontrol} \\ + \No & \parbox[c]{4.5cm}{transmitter (right)\\with signal} + & \symbol{transmitter_right_with_signal.tikz} & \code{transmitter_right_with_signal.tikz} & \texttt{trafficcontrol} \\ \hline - \No & train berth & \symbol{train_berth.tikz} & \code{train_berth.tikz} & \texttt{trafficcontrol} \\ + \No & \parbox[c]{4.5cm}{transmitter (right \& left)\\ effective forward} + & \symbol{transmitter_forward.tikz} & \code{transmitter_forward.tikz} & \texttt{trafficcontrol} \\ + \hline + \No & \parbox[c]{4.5cm}{transmitter (right \& left)\\ effective backward} + & \symbol{transmitter_backward.tikz} & \code{transmitter_backward.tikz} & \texttt{trafficcontrol} \\ + \hline + \No & \parbox[c]{4.5cm}{transmitter (right \& left)\\ effective bidirectional} + & \symbol{transmitter_bidirectional.tikz} & \code{transmitter_bidirectional.tikz} & \texttt{trafficcontrol} \\ + \hline + \No & loop transmitter & \symbol{loop_transmitter.tikz} & \code{loop_transmitter.tikz} & \texttt{trafficcontrol} \\ \hline \No & platform (left) & \symbol{platform_left.tikz} & \code{platform_left.tikz} & \texttt{constructions} \\ \hline @@ -275,5 +281,15 @@ \hline \No & interlocking & \symbol{interlocking.tikz} & \code{interlocking.tikz} & \texttt{constructions} \\ \hline + \No & train berth shape & \symbol{train_berth_shape.tikz} & \code{train_berth_shape.tikz} & \texttt{messures} \\ + \hline + \No & train berth shape bidirectional & \symbol{train_berth_shape_bidirectional.tikz} & \code{train_berth_shape_bidirectional.tikz} & \texttt{messures} \\ + \hline + \No & train berth with special shape & \symbol{train_berth_shape_special.tikz} & \code{train_berth_shape_special.tikz} & \texttt{messures} \\ + \hline + \No & track distance (in \si{\metre}) & \symbol{track_distance.tikz} & \code{track_distance.tikz} & \texttt{messures} \\ + \hline + \No & hectometer (in \si{\kilo\metre}) & \symbol{hectometer.tikz} & \code{hectometer.tikz} & \texttt{messures} \\ + \hline \end{longtable} \end{document} \ No newline at end of file diff --git a/doc/snippets/bend_train.tikz b/doc/snippets/bend_train.tikz new file mode 100644 index 0000000..29fe377 --- /dev/null +++ b/doc/snippets/bend_train.tikz @@ -0,0 +1,25 @@ +%!TEX TS-program = pdflatexmk +%!TEX root = ../snippets.tex + +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\coordinate (A1) at (0 ,-0.5); +\coordinate (Y1) at (2.5,-0.5); +\coordinate (B1) at (6 ,-0.5); +\coordinate (A2) at (0 , 0.5); +\coordinate (Y2) at (3.5, 0.5); +\coordinate (B2) at (6 , 0.5); +\coordinate (T) at (5 , 0.5); + +\maintrack (A1) -- (B1); +\maintrack (A2) -- (B2); +\maintrack (Y1) -- (Y2); +\turnout[forward ,branch=left ] at (Y1) label (Y1); +\turnout[backward,branch=right] at (Y2) label (Y2); + +\train[ + run=slow,forward, + bend left at={(Y1)},bend right at={(Y2)}, + shift label={(-2,-0.5)} % relative coordinate +] at (T) label (T1); \ No newline at end of file diff --git a/doc/snippets/block_clearing_point_backward.tikz b/doc/snippets/block_clearing_point_backward.tikz index 5fb93ea..453886a 100644 --- a/doc/snippets/block_clearing_point_backward.tikz +++ b/doc/snippets/block_clearing_point_backward.tikz @@ -1,8 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {block_clearing_point_backward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (CP) at (3,0); + +\maintrack (A) -- (B); + +\blockclearing[backward] at (CP) label (); \ No newline at end of file diff --git a/doc/snippets/block_clearing_point_forward.tikz b/doc/snippets/block_clearing_point_forward.tikz index fb0305d..d8e6975 100644 --- a/doc/snippets/block_clearing_point_forward.tikz +++ b/doc/snippets/block_clearing_point_forward.tikz @@ -1,8 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {block_clearing_point_forward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (CP) at (3,0); + +\maintrack (A) -- (B); + +\blockclearing[forward] at (CP) label (); \ No newline at end of file diff --git a/doc/snippets/block_end_marker_backward.tikz b/doc/snippets/block_end_marker_backward.tikz index a934d2d..9e36abe 100644 --- a/doc/snippets/block_end_marker_backward.tikz +++ b/doc/snippets/block_end_marker_backward.tikz @@ -1,8 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {block_end_marker_backward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (S) at (3,0); + +\maintrack (A) -- (B); + +\movementauthority[backward] at (S) label (); \ No newline at end of file diff --git a/doc/snippets/block_end_marker_forward.tikz b/doc/snippets/block_end_marker_forward.tikz index dd6d486..81ec5fd 100644 --- a/doc/snippets/block_end_marker_forward.tikz +++ b/doc/snippets/block_end_marker_forward.tikz @@ -1,8 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {block_end_marker_forward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (S) at (3,0); + +\maintrack (A) -- (B); + +\movementauthority[forward] at (S) label (); \ No newline at end of file diff --git a/doc/snippets/block_signal_backward.tikz b/doc/snippets/block_signal_backward.tikz index d9cd71b..9c6c472 100644 --- a/doc/snippets/block_signal_backward.tikz +++ b/doc/snippets/block_signal_backward.tikz @@ -1,9 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {block_signal_backward={S}}; -% replace the S with desired speed or remove \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (S) at (3,0); + +\maintrack (A) -- (B); + +\blocksignal[backward] at (S) label (2); \ No newline at end of file diff --git a/doc/snippets/block_signal_forward.tikz b/doc/snippets/block_signal_forward.tikz index aba6d35..c3dfda7 100644 --- a/doc/snippets/block_signal_forward.tikz +++ b/doc/snippets/block_signal_forward.tikz @@ -1,8 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {block_signal_forward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (S) at (3,0); + +\maintrack (A) -- (B); + +\blocksignal[forward] at (S) label (1); \ No newline at end of file diff --git a/doc/snippets/bridge.tikz b/doc/snippets/bridge.tikz index a940f1c..5abb929 100644 --- a/doc/snippets/bridge.tikz +++ b/doc/snippets/bridge.tikz @@ -1,9 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (-2,0) {bridge_left=4}; -\pic at (-2,0) {bridge_right=4}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (X) at (3,0); + +% order is important +\bridge[] at (X); % first +\maintrack (A) -- (B); % secound \ No newline at end of file diff --git a/doc/snippets/bridge_track_beneath.tikz b/doc/snippets/bridge_track_beneath.tikz index e109ce8..1682b4b 100644 --- a/doc/snippets/bridge_track_beneath.tikz +++ b/doc/snippets/bridge_track_beneath.tikz @@ -1,11 +1,15 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. +\coordinate (A1) at (0, 0); +\coordinate (B1) at (6, 0); +\coordinate (A2) at (2,-1); +\coordinate (B2) at (4, 1); +\coordinate (X) at (3,0); -\draw[MainTrack] (-1,-1) -- ++(2,2); -\fill[background] (-1,-0.4) rectangle (1,0.4); -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (-1,0) {bridge_left=3}; -\pic at (-2,0) {bridge_right=3}; \ No newline at end of file +% order is important +\maintrack (A2) -- (B2); % first +\bridge[shift left=0.25cm,shift right=-0.25cm] at (X); % secound +\maintrack (A1) -- (B1); % third \ No newline at end of file diff --git a/doc/snippets/bufferstop_backward.tikz b/doc/snippets/bufferstop_backward.tikz index 7baec64..1423cd7 100644 --- a/doc/snippets/bufferstop_backward.tikz +++ b/doc/snippets/bufferstop_backward.tikz @@ -1,8 +1,11 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[SecondaryTrack] (0,0) -- ++(2.5,0); -\pic at (0,0) {bufferstop_backward}; \ No newline at end of file +\coordinate (A) at (3,0); +\coordinate (B) at (6,0); + +\maintrack (A) -- (B); +\bufferstop[backward] at (A); \ No newline at end of file diff --git a/doc/snippets/bufferstop_forward.tikz b/doc/snippets/bufferstop_forward.tikz index 12c3641..13c6f12 100644 --- a/doc/snippets/bufferstop_forward.tikz +++ b/doc/snippets/bufferstop_forward.tikz @@ -1,8 +1,11 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[SecondaryTrack] (-2.5,0) -- ++(2.5,0); -\pic at (0,0) {bufferstop_forward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (3,0); + +\maintrack (A) -- (B); +\bufferstop[forward] at (B); \ No newline at end of file diff --git a/doc/snippets/clearing_point.tikz b/doc/snippets/clearing_point.tikz index 4f90334..3a6f979 100644 --- a/doc/snippets/clearing_point.tikz +++ b/doc/snippets/clearing_point.tikz @@ -1,8 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {clearing_point}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (CP) at (3,0); + +\maintrack (A) -- (B); + +\clearingpoint[backward] at (CP) label (); \ No newline at end of file diff --git a/doc/snippets/combined_signal_forward.tikz b/doc/snippets/combined_signal_forward.tikz index a9c041e..ca1ae29 100644 --- a/doc/snippets/combined_signal_forward.tikz +++ b/doc/snippets/combined_signal_forward.tikz @@ -1,10 +1,15 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {block_signal_forward={S}}; % Order 1 -% replace the S with desired speed or remove -\pic at (0,0) {distant_signal_forward}; % Order 2 \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (S) at (3,0); + +\maintrack (A) -- (B); + +\signal[distant,block,route,forward,distant speed=8,speed=8] + at (S) label (K1); +% replace the 8 with desired speed or remove tikz key \ No newline at end of file diff --git a/doc/snippets/derailer_left_backward.tikz b/doc/snippets/derailer_left_backward.tikz index 925b6cb..1f7b05a 100644 --- a/doc/snippets/derailer_left_backward.tikz +++ b/doc/snippets/derailer_left_backward.tikz @@ -1,8 +1,12 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[SecondaryTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {derailer_left_backward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\secondarytrack (A) -- (B); +\derailer[backward,branch=left] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/derailer_left_forward.tikz b/doc/snippets/derailer_left_forward.tikz index b3c0aac..bdb78bc 100644 --- a/doc/snippets/derailer_left_forward.tikz +++ b/doc/snippets/derailer_left_forward.tikz @@ -1,8 +1,12 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[SecondaryTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {derailer_left_forward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\secondarytrack (A) -- (B); +\derailer[forward,branch=left] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/derailer_right_backward.tikz b/doc/snippets/derailer_right_backward.tikz index db9f4ae..854c923 100644 --- a/doc/snippets/derailer_right_backward.tikz +++ b/doc/snippets/derailer_right_backward.tikz @@ -1,8 +1,12 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[SecondaryTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {derailer_right_backward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\secondarytrack (A) -- (B); +\derailer[backward,branch=right] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/derailer_right_forward.tikz b/doc/snippets/derailer_right_forward.tikz index 3cd482f..4f69e50 100644 --- a/doc/snippets/derailer_right_forward.tikz +++ b/doc/snippets/derailer_right_forward.tikz @@ -1,8 +1,12 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[SecondaryTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {derailer_right_forward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\secondarytrack (A) -- (B); +\derailer[forward,branch=right] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/diamond_crossing_left.tikz b/doc/snippets/diamond_crossing_left.tikz index d6b9fce..64779a7 100644 --- a/doc/snippets/diamond_crossing_left.tikz +++ b/doc/snippets/diamond_crossing_left.tikz @@ -1,10 +1,15 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5, 0) -- ++(5,0); -\draw[MainTrack] (-1 ,-1) -- ++(2,2); -\pic at (0,0) {turnout_left_forward=none}; -\pic at (0,0) {turnout_left_backward=none}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\maintrack (A) -- (B); +\maintrack (Y) -- ++( 1, 1); +\maintrack (Y) -- ++(-1,-1); + +\crossing[branch=left] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/diamond_crossing_right.tikz b/doc/snippets/diamond_crossing_right.tikz index 791fa76..7ab523e 100644 --- a/doc/snippets/diamond_crossing_right.tikz +++ b/doc/snippets/diamond_crossing_right.tikz @@ -1,10 +1,15 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5, 0); -\draw[MainTrack] (-1 ,1) -- ++(2,-2); -\pic at (0,0) {turnout_right_forward=none}; -\pic at (0,0) {turnout_right_backward=none}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\maintrack (A) -- (B); +\maintrack (Y) -- ++( 1,-1); +\maintrack (Y) -- ++(-1, 1); + +\crossing[branch=right] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/distant_signal_backward.tikz b/doc/snippets/distant_signal_backward.tikz index 87d8d3b..4a5ff79 100644 --- a/doc/snippets/distant_signal_backward.tikz +++ b/doc/snippets/distant_signal_backward.tikz @@ -1,8 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {distant_signal_backward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (S) at (3,0); + +\maintrack (A) -- (B); + +\distantsignal[backward] at (S) label (d2); \ No newline at end of file diff --git a/doc/snippets/distant_signal_forward.tikz b/doc/snippets/distant_signal_forward.tikz index e4c44ca..93b4a78 100644 --- a/doc/snippets/distant_signal_forward.tikz +++ b/doc/snippets/distant_signal_forward.tikz @@ -1,8 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {distant_signal_forward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (S) at (3,0); + +\maintrack (A) -- (B); + +\distantsignal[forward] at (S) label (d1); \ No newline at end of file diff --git a/doc/snippets/distant_speed_signal_backward.tikz b/doc/snippets/distant_speed_signal_backward.tikz index 8dedf1d..0f8c179 100644 --- a/doc/snippets/distant_speed_signal_backward.tikz +++ b/doc/snippets/distant_speed_signal_backward.tikz @@ -1,9 +1,14 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {distant_signal_backward={S}}; -% replace the S with desired speed or remove \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (S) at (3,0); + +\maintrack (A) -- (B); + +\distantsignal[backward,distant speed={8}] at (S) label (); +% replace the 8 with desired speed or remove tikz key \ No newline at end of file diff --git a/doc/snippets/distant_speed_signal_forward.tikz b/doc/snippets/distant_speed_signal_forward.tikz index 0983b2c..7d816ae 100644 --- a/doc/snippets/distant_speed_signal_forward.tikz +++ b/doc/snippets/distant_speed_signal_forward.tikz @@ -1,9 +1,14 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {distant_signal_forward={S}}; -% replace the S with desired speed or remove \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (S) at (3,0); + +\maintrack (A) -- (B); + +\distantsignal[forward,distant speed={8}] at (S) label (); +% replace the 8 with desired speed or remove tikz key \ No newline at end of file diff --git a/doc/snippets/double-slip_turnout_left.tikz b/doc/snippets/double-slip_turnout_left.tikz index 826e82d..623bcdd 100644 --- a/doc/snippets/double-slip_turnout_left.tikz +++ b/doc/snippets/double-slip_turnout_left.tikz @@ -1,12 +1,15 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5, 0) -- ++(5,0); -\draw[MainTrack] (-1 ,-1) -- ++(2,2); -\pic at (0,0) {turnout_left_forward}; -\pic at (0,0) {turnout_left_backward}; -\pic at (0,0) {slip_left_forward}; -\pic at (0,0) {slip_left_backward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\maintrack (A) -- (B); +\maintrack (Y) -- ++( 1, 1); +\maintrack (Y) -- ++(-1,-1); + +\slipturnout[branch=left] at (Y) label (ab)(cd); \ No newline at end of file diff --git a/doc/snippets/double-slip_turnout_right.tikz b/doc/snippets/double-slip_turnout_right.tikz index 8149ab0..adf5b30 100644 --- a/doc/snippets/double-slip_turnout_right.tikz +++ b/doc/snippets/double-slip_turnout_right.tikz @@ -1,12 +1,15 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5, 0); -\draw[MainTrack] (-1 ,1) -- ++(2,-2); -\pic at (0,0) {turnout_right_forward}; -\pic at (0,0) {turnout_right_backward}; -\pic at (0,0) {slip_right_forward}; -\pic at (0,0) {slip_right_backward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\maintrack (A) -- (B); +\maintrack (Y) -- ++( 1,-1); +\maintrack (Y) -- ++(-1, 1); + +\slipturnout[branch=right] at (Y) label (ab)(cd); \ No newline at end of file diff --git a/doc/snippets/transmitter_below_bidirectional.tikz b/doc/snippets/friction_bufferstop_backward.tikz similarity index 60% rename from doc/snippets/transmitter_below_bidirectional.tikz rename to doc/snippets/friction_bufferstop_backward.tikz index 2b8b465..e1bbbef 100644 --- a/doc/snippets/transmitter_below_bidirectional.tikz +++ b/doc/snippets/friction_bufferstop_backward.tikz @@ -1,8 +1,11 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {transmitter_below_bidirectional}; \ No newline at end of file +\coordinate (A) at (3,0); +\coordinate (B) at (6,0); + +\maintrack (A) -- (B); +\bufferstop[backward,friction=.5] at (A); \ No newline at end of file diff --git a/doc/snippets/ghost_train_direction_forward.tikz b/doc/snippets/friction_bufferstop_forward.tikz similarity index 60% rename from doc/snippets/ghost_train_direction_forward.tikz rename to doc/snippets/friction_bufferstop_forward.tikz index 25775fa..a16d755 100644 --- a/doc/snippets/ghost_train_direction_forward.tikz +++ b/doc/snippets/friction_bufferstop_forward.tikz @@ -1,8 +1,11 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (2,0) {ghost_train_direction_forward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (3,0); + +\maintrack (A) -- (B); +\bufferstop[forward,friction=.5] at (B); \ No newline at end of file diff --git a/doc/snippets/hectometer.tikz b/doc/snippets/hectometer.tikz new file mode 100644 index 0000000..c78deee --- /dev/null +++ b/doc/snippets/hectometer.tikz @@ -0,0 +1,20 @@ +%!TEX TS-program = pdflatexmk +%!TEX root = ../snippets.tex + +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\coordinate (A) at (0,0); +\coordinate (X1) at (3,0); +\coordinate (X2) at (3.5,0); +\coordinate (B) at (6,0); + +\coordinate (hb) at (0,-2); + +\maintrack (A) -- (B); + +\tikzset{hectometer base={(hb)},orientation=right} +\hectometer[] at (A) mileage (0.000); +\hectometer[] at (X1) mileage (4.000); +\hectometer[shift label={(0.3,0)}] at (X2) mileage (4.500); +\hectometer[] at (B) mileage (6.000); \ No newline at end of file diff --git a/doc/snippets/hump.tikz b/doc/snippets/hump.tikz old mode 100755 new mode 100644 index cbcea3e..cfa61e6 --- a/doc/snippets/hump.tikz +++ b/doc/snippets/hump.tikz @@ -1,8 +1,12 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[SecondaryTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {hump}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (H) at (3,0); + +\secondarytrack (A) -- (B); +\hump at (H); \ No newline at end of file diff --git a/doc/snippets/interlocking.tikz b/doc/snippets/interlocking.tikz old mode 100755 new mode 100644 index 21b1da3..dacf709 --- a/doc/snippets/interlocking.tikz +++ b/doc/snippets/interlocking.tikz @@ -1,7 +1,9 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\pic at (0,0) {interlocking}; \ No newline at end of file +\coordinate (I) at (3,0); + +\interlocking at (I); \ No newline at end of file diff --git a/doc/snippets/level_crossing_double.tikz b/doc/snippets/level_crossing_double.tikz index fe3001f..3f275c3 100644 --- a/doc/snippets/level_crossing_double.tikz +++ b/doc/snippets/level_crossing_double.tikz @@ -1,11 +1,17 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,-0.5) -- ++(5,0); -\draw[MainTrack] (-2.5, 0.5) -- ++(5,0); -\pic at (0, 0.5) {level_crossing_barrier_left}; -\pic at (0, 0.5) {level_crossing}; -\pic at (0,-0.5) {level_crossing_barrier_right}; \ No newline at end of file +\coordinate (A1) at (0,-0.5); +\coordinate (B1) at (6,-0.5); +\coordinate (A2) at (0, 0.5); +\coordinate (B2) at (6, 0.5); +\coordinate (X1) at (3, 0.5); +\coordinate (X2) at (3,-0.5); + +\maintrack (A1) -- (B1); +\maintrack (A2) -- (B2); +\levelcrossing[barrier=semi,side=left] at (X1); +\levelcrossing[barrier=semi,side=right] at (X2); \ No newline at end of file diff --git a/doc/snippets/level_crossing_double_full_closure.tikz b/doc/snippets/level_crossing_double_full_closure.tikz index ad60a79..7ad136b 100644 --- a/doc/snippets/level_crossing_double_full_closure.tikz +++ b/doc/snippets/level_crossing_double_full_closure.tikz @@ -1,13 +1,17 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,-0.5) -- ++(5,0); -\draw[MainTrack] (-2.5, 0.5) -- ++(5,0); -\pic at (0, 1.5) {level_crossing_barrier_right}; -\pic at (0, 0.5) {level_crossing_barrier_left}; -\pic at (0, 0.5) {level_crossing}; -\pic at (0,-0.5) {level_crossing_barrier_right}; -\pic at (0,-1.5) {level_crossing_barrier_left}; \ No newline at end of file +\coordinate (A1) at (0,-0.5); +\coordinate (B1) at (6,-0.5); +\coordinate (A2) at (0, 0.5); +\coordinate (B2) at (6, 0.5); +\coordinate (X1) at (3, 0.5); +\coordinate (X2) at (3,-0.5); + +\maintrack (A1) -- (B1); +\maintrack (A2) -- (B2); +\levelcrossing[barrier=full,side=left] at (X1); +\levelcrossing[barrier=full,side=right] at (X2); \ No newline at end of file diff --git a/doc/snippets/level_crossing_single.tikz b/doc/snippets/level_crossing_single.tikz index 3724306..298320b 100644 --- a/doc/snippets/level_crossing_single.tikz +++ b/doc/snippets/level_crossing_single.tikz @@ -1,9 +1,12 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {level_crossing_barrier_left}; -\pic at (0,0) {level_crossing_barrier_right}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (X) at (3,0); + +\maintrack (A) -- (B); +\levelcrossing[barrier=semi] at (X); \ No newline at end of file diff --git a/doc/snippets/loop_transmitter.tikz b/doc/snippets/loop_transmitter.tikz new file mode 100644 index 0000000..981d519 --- /dev/null +++ b/doc/snippets/loop_transmitter.tikz @@ -0,0 +1,13 @@ +%!TEX TS-program = pdflatexmk +%!TEX root = ../snippets.tex + +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (T) at (3,0); + +\maintrack (A) -- (B); + +\transmitter[type=loop] at (T) label (); \ No newline at end of file diff --git a/doc/snippets/main_line.tikz b/doc/snippets/main_line.tikz index 2d40121..02a9d0b 100644 --- a/doc/snippets/main_line.tikz +++ b/doc/snippets/main_line.tikz @@ -1,8 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5, 0.5) -- ++(5,0); -\draw[MainTrack] (-2.5,-0.5) -- ++(5,0); \ No newline at end of file +\coordinate (A1) at (0,-0.5); +\coordinate (B1) at (6,-0.5); +\coordinate (A2) at (0, 0.5); +\coordinate (B2) at (6, 0.5); + +\maintrack (A1) -- (B1); +\maintrack (A2) -- (B2); \ No newline at end of file diff --git a/doc/snippets/main_track.tikz b/doc/snippets/main_track.tikz index 610ad71..755cfdd 100644 --- a/doc/snippets/main_track.tikz +++ b/doc/snippets/main_track.tikz @@ -1,7 +1,10 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); + +\maintrack (A) -- (B); \ No newline at end of file diff --git a/doc/snippets/transmitter_below.tikz b/doc/snippets/messure_line.tikz similarity index 66% rename from doc/snippets/transmitter_below.tikz rename to doc/snippets/messure_line.tikz index 5ece3af..7e63a87 100644 --- a/doc/snippets/transmitter_below.tikz +++ b/doc/snippets/messure_line.tikz @@ -1,8 +1,10 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {transmitter_below}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); + +\messureline (A) -- (B); \ No newline at end of file diff --git a/doc/snippets/parked_vehicle.tikz b/doc/snippets/parked_vehicle.tikz new file mode 100644 index 0000000..314fe72 --- /dev/null +++ b/doc/snippets/parked_vehicle.tikz @@ -0,0 +1,12 @@ +%!TEX TS-program = pdflatexmk +%!TEX root = ../snippets.tex + +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (T) at (3,0); + +\secondarytrack (A) -- (B); +\parkedvehicles[length=0.5cm] at (T) label (); \ No newline at end of file diff --git a/doc/snippets/parked_vehicles.tikz b/doc/snippets/parked_vehicles.tikz new file mode 100644 index 0000000..f751f5b --- /dev/null +++ b/doc/snippets/parked_vehicles.tikz @@ -0,0 +1,12 @@ +%!TEX TS-program = pdflatexmk +%!TEX root = ../snippets.tex + +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (T) at (3,0); + +\secondarytrack (A) -- (B); +\parkedvehicles[] at (T) label (); \ No newline at end of file diff --git a/doc/snippets/parked_vehicles_with_label.tikz b/doc/snippets/parked_vehicles_with_label.tikz new file mode 100644 index 0000000..794e4fa --- /dev/null +++ b/doc/snippets/parked_vehicles_with_label.tikz @@ -0,0 +1,12 @@ +%!TEX TS-program = pdflatexmk +%!TEX root = ../snippets.tex + +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (T) at (3,0); + +\secondarytrack (A) -- (B); +\parkedvehicles[] at (T) label (label); \ No newline at end of file diff --git a/doc/snippets/platform_left.tikz b/doc/snippets/platform_left.tikz index 8566cb0..b3ef189 100644 --- a/doc/snippets/platform_left.tikz +++ b/doc/snippets/platform_left.tikz @@ -1,9 +1,12 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (-2,0) {platform_left=4}; -% change the 4 to desired length \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (P) at (3,0); + +\maintrack (A) -- (B); +\platform[side=left] at (P); \ No newline at end of file diff --git a/doc/snippets/platform_middle.tikz b/doc/snippets/platform_middle.tikz index 80416dc..c591dcf 100644 --- a/doc/snippets/platform_middle.tikz +++ b/doc/snippets/platform_middle.tikz @@ -1,10 +1,17 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5, 0.5) -- ++(5,0); -\draw[MainTrack] (-2.5,-0.5) -- ++(5,0); -\pic at (-2, 0.5) {platform_right}; -\pic at (-2,-0.5) {platform_left}; \ No newline at end of file +\coordinate (A1) at (0,-0.5); +\coordinate (B1) at (6,-0.5); +\coordinate (A2) at (0, 0.5); +\coordinate (B2) at (6, 0.5); +\coordinate (P1) at (3, 0.5); +\coordinate (P2) at (3,-0.5); + +\maintrack (A1) -- (B1); +\maintrack (A2) -- (B2); +\platform[side=right] at (P1); +\platform[side=left] at (P2); \ No newline at end of file diff --git a/doc/snippets/platform_right.tikz b/doc/snippets/platform_right.tikz index 66015d2..b40d142 100644 --- a/doc/snippets/platform_right.tikz +++ b/doc/snippets/platform_right.tikz @@ -1,9 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (-2,0) {platform_right=4}; -% change the 4 to desired length \ No newline at end of file + +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (P) at (3,0); + +\maintrack (A) -- (B); +\platform[side=right] at (P); \ No newline at end of file diff --git a/doc/snippets/route.tikz b/doc/snippets/route.tikz new file mode 100644 index 0000000..4c42069 --- /dev/null +++ b/doc/snippets/route.tikz @@ -0,0 +1,14 @@ +%!TEX TS-program = pdflatexmk +%!TEX root = ../snippets.tex + +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (R1) at (2,0); +\coordinate (R2) at (4,0); + +\maintrack (A) -- (B); +\route[backward] at (R1); +\route[forward] at (R2); \ No newline at end of file diff --git a/doc/snippets/route_clearing_point_backward.tikz b/doc/snippets/route_clearing_point_backward.tikz index 3fa8723..21d0b0c 100644 --- a/doc/snippets/route_clearing_point_backward.tikz +++ b/doc/snippets/route_clearing_point_backward.tikz @@ -1,8 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {route_clearing_point_backward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (CP) at (3,0); + +\maintrack (A) -- (B); + +\routeclearing[backward] at (CP) label (); \ No newline at end of file diff --git a/doc/snippets/route_clearing_point_forward.tikz b/doc/snippets/route_clearing_point_forward.tikz index 7473e62..49874bd 100644 --- a/doc/snippets/route_clearing_point_forward.tikz +++ b/doc/snippets/route_clearing_point_forward.tikz @@ -1,8 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {route_clearing_point_forward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (CP) at (3,0); + +\maintrack (A) -- (B); + +\routeclearing[forward] at (CP) label (); \ No newline at end of file diff --git a/doc/snippets/route_signal_backward.tikz b/doc/snippets/route_signal_backward.tikz index 54e6524..70a3fd2 100644 --- a/doc/snippets/route_signal_backward.tikz +++ b/doc/snippets/route_signal_backward.tikz @@ -1,9 +1,14 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {route_signal_backward={S}}; -% replace the S with desired speed or remove \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (S) at (3,0); + +\maintrack (A) -- (B); + +\routesignal[backward,speed={8}] at (S) label (F); +% replace the 8 with desired speed or remove tikz key \ No newline at end of file diff --git a/doc/snippets/route_signal_forward.tikz b/doc/snippets/route_signal_forward.tikz index 40f81ad..7c4dd78 100644 --- a/doc/snippets/route_signal_forward.tikz +++ b/doc/snippets/route_signal_forward.tikz @@ -1,8 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {route_signal_forward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (S) at (3,0); + +\maintrack (A) -- (B); + +\routesignal[forward] at (S) label (R1); \ No newline at end of file diff --git a/doc/snippets/secondary_track.tikz b/doc/snippets/secondary_track.tikz index 72be7c3..d633164 100644 --- a/doc/snippets/secondary_track.tikz +++ b/doc/snippets/secondary_track.tikz @@ -1,7 +1,10 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[SecondaryTrack] (-2.5,0) -- ++(5,0); \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); + +\secondarytrack (A) -- (B); \ No newline at end of file diff --git a/doc/snippets/shunt_limit_backward.tikz b/doc/snippets/shunt_limit_backward.tikz index 804b4a5..b7204ce 100644 --- a/doc/snippets/shunt_limit_backward.tikz +++ b/doc/snippets/shunt_limit_backward.tikz @@ -1,8 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {shunt_limit_backward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (S) at (3,0); + +\maintrack (A) -- (B); + +\shuntlimit[backward] at (S) label (); \ No newline at end of file diff --git a/doc/snippets/shunt_limit_forward.tikz b/doc/snippets/shunt_limit_forward.tikz index 2111ba0..b63720c 100644 --- a/doc/snippets/shunt_limit_forward.tikz +++ b/doc/snippets/shunt_limit_forward.tikz @@ -1,8 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {shunt_limit_forward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (S) at (3,0); + +\maintrack (A) -- (B); + +\shuntlimit[forward] at (S) label (); \ No newline at end of file diff --git a/doc/snippets/shunt_signal_backward.tikz b/doc/snippets/shunt_signal_backward.tikz index 6b3037f..d773c43 100644 --- a/doc/snippets/shunt_signal_backward.tikz +++ b/doc/snippets/shunt_signal_backward.tikz @@ -1,8 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {shunt_signal_backward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (S) at (3,0); + +\maintrack (A) -- (B); + +\shuntsignal[backward] at (S) label (); \ No newline at end of file diff --git a/doc/snippets/shunt_signal_backward_locked.tikz b/doc/snippets/shunt_signal_backward_locked.tikz index cf967a1..10d7b00 100644 --- a/doc/snippets/shunt_signal_backward_locked.tikz +++ b/doc/snippets/shunt_signal_backward_locked.tikz @@ -1,8 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {shunt_signal_backward_locked}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (S) at (3,0); + +\maintrack (A) -- (B); + +\shuntsignal[backward,locked] at (S) label (); \ No newline at end of file diff --git a/doc/snippets/shunt_signal_forward.tikz b/doc/snippets/shunt_signal_forward.tikz index 89e14e3..cd1b464 100644 --- a/doc/snippets/shunt_signal_forward.tikz +++ b/doc/snippets/shunt_signal_forward.tikz @@ -1,8 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {shunt_signal_forward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (S) at (3,0); + +\maintrack (A) -- (B); + +\shuntsignal[forward] at (S) label (); \ No newline at end of file diff --git a/doc/snippets/shunt_signal_forward_locked.tikz b/doc/snippets/shunt_signal_forward_locked.tikz index 7e07034..8e9ced8 100644 --- a/doc/snippets/shunt_signal_forward_locked.tikz +++ b/doc/snippets/shunt_signal_forward_locked.tikz @@ -1,8 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {shunt_signal_forward_locked}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (S) at (3,0); + +\maintrack (A) -- (B); + +\shuntsignal[forward,locked] at (S) label (); \ No newline at end of file diff --git a/doc/snippets/speed_signal_backward.tikz b/doc/snippets/speed_signal_backward.tikz index 40e32c7..4840c01 100644 --- a/doc/snippets/speed_signal_backward.tikz +++ b/doc/snippets/speed_signal_backward.tikz @@ -1,9 +1,14 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {speed_signal_backward={S}}; -% replace the S with desired speed or remove \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (S) at (3,0); + +\maintrack (A) -- (B); + +\speedsignal[backward,speed={8}] at (S) label (); +% replace the 8 with desired speed \ No newline at end of file diff --git a/doc/snippets/speed_signal_forward.tikz b/doc/snippets/speed_signal_forward.tikz index 0711071..8d52691 100644 --- a/doc/snippets/speed_signal_forward.tikz +++ b/doc/snippets/speed_signal_forward.tikz @@ -1,9 +1,14 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {speed_signal_forward={S}}; -% replace the S with desired speed or remove \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (S) at (3,0); + +\maintrack (A) -- (B); + +\speedsignal[forward,speed={8}] at (S) label (); +% replace the 8 with desired speed \ No newline at end of file diff --git a/doc/snippets/ghost_train_direction_backward.tikz b/doc/snippets/track_closure.tikz similarity index 63% rename from doc/snippets/ghost_train_direction_backward.tikz rename to doc/snippets/track_closure.tikz index d7fa758..075421d 100644 --- a/doc/snippets/ghost_train_direction_backward.tikz +++ b/doc/snippets/track_closure.tikz @@ -1,8 +1,11 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (-2,0) {ghost_train_direction_backward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (3,0); + +\maintrack (A) -- (B); +\trackclosure at (B); \ No newline at end of file diff --git a/doc/snippets/track_distance.tikz b/doc/snippets/track_distance.tikz old mode 100755 new mode 100644 index 68b1322..7346aaa --- a/doc/snippets/track_distance.tikz +++ b/doc/snippets/track_distance.tikz @@ -1,9 +1,16 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5, 0.5) -- ++(5,0); -\pic at (0,-0.5) {track_distance={4,50}}; -\draw[MainTrack] (-2.5,-0.5) -- ++(5,0); \ No newline at end of file +\coordinate (A1) at (0,-0.5); +\coordinate (X1) at (3,-0.5); +\coordinate (B1) at (6,-0.5); +\coordinate (A2) at (0, 0.5); +\coordinate (X2) at (3, 0.5); +\coordinate (B2) at (6, 0.5); + +\maintrack (A1) -- (B1); +\maintrack (A2) -- (B2); +\trackdistance between (X2) and (X1) distance (4,50); \ No newline at end of file diff --git a/doc/snippets/track_number.tikz b/doc/snippets/track_number.tikz old mode 100755 new mode 100644 index 9d8211d..3b932c5 --- a/doc/snippets/track_number.tikz +++ b/doc/snippets/track_number.tikz @@ -1,8 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0, 0) {track_number={2}}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (X) at (3,0); +\coordinate (B) at (6,0); + +% order is important +\maintrack (A) -- (B); % first +\tracklabel at (X) label (No.); % secound \ No newline at end of file diff --git a/doc/snippets/train_berth.tikz b/doc/snippets/train_berth.tikz index 6268632..b347880 100644 --- a/doc/snippets/train_berth.tikz +++ b/doc/snippets/train_berth.tikz @@ -1,10 +1,18 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (-2,0) {train_berth_sign_backward}; -\pic at (-2,0) {train_berth_shape}; -\pic at ( 2,0) {train_berth_sign_forward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (H) at (3,0); +\coordinate (S1) at (1,0); +\coordinate (S2) at (5,0); + +\maintrack (A) -- (B); + +\berth[forward ] at (H) length (); +\berth[backward] at (H) length (); +\berthsignal[backward] at (S1) label (); +\berthsignal[forward ] at (S2) label (); \ No newline at end of file diff --git a/doc/snippets/train_berth_shape.tikz b/doc/snippets/train_berth_shape.tikz index 8a9ac2d..5b5de32 100644 --- a/doc/snippets/train_berth_shape.tikz +++ b/doc/snippets/train_berth_shape.tikz @@ -1,8 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (-2,0) {train_berth_shape_forward={4}}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (H) at (3,0); + +\maintrack (A) -- (B); + +\berth[forward] at (H) length (\SI{750}{\metre}); \ No newline at end of file diff --git a/doc/snippets/train_berth_shape_bidirectional.tikz b/doc/snippets/train_berth_shape_bidirectional.tikz index e5e3905..f45ca96 100644 --- a/doc/snippets/train_berth_shape_bidirectional.tikz +++ b/doc/snippets/train_berth_shape_bidirectional.tikz @@ -1,9 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (-2,0) {train_berth_shape=4}; -% change the 4 to desired length \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (H) at (3,0); + +\maintrack (A) -- (B); + +\berth[bidirectional] at (H) length (\SI{750}{\metre}); \ No newline at end of file diff --git a/doc/snippets/train_berth_shape_special.tikz b/doc/snippets/train_berth_shape_special.tikz new file mode 100644 index 0000000..a3688d3 --- /dev/null +++ b/doc/snippets/train_berth_shape_special.tikz @@ -0,0 +1,15 @@ +%!TEX TS-program = pdflatexmk +%!TEX root = ../snippets.tex + +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (H1) at (3.25,0); +\coordinate (H2) at (3,0); + +\maintrack (A) -- (B); + +\berth[forward ,length=3.0cm] at (H1) length (\SI{550}{\metre}); +\berth[backward,length=3.5cm] at (H2) length (\SI{650}{\metre}); \ No newline at end of file diff --git a/doc/snippets/train_berth_sign_backward.tikz b/doc/snippets/train_berth_sign_backward.tikz index 08240a8..ea69565 100644 --- a/doc/snippets/train_berth_sign_backward.tikz +++ b/doc/snippets/train_berth_sign_backward.tikz @@ -1,8 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {train_berth_sign_backward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (S) at (3,0); + +\maintrack (A) -- (B); + +\berthsignal[backward] at (S) label (); \ No newline at end of file diff --git a/doc/snippets/train_berth_sign_forward.tikz b/doc/snippets/train_berth_sign_forward.tikz index 5b50672..27054b7 100644 --- a/doc/snippets/train_berth_sign_forward.tikz +++ b/doc/snippets/train_berth_sign_forward.tikz @@ -1,8 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {train_berth_sign_forward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (S) at (3,0); + +\maintrack (A) -- (B); + +\berthsignal[forward] at (S) label (); \ No newline at end of file diff --git a/doc/snippets/train_direction_backward.tikz b/doc/snippets/train_direction_backward.tikz index 9cdd7e0..8950536 100644 --- a/doc/snippets/train_direction_backward.tikz +++ b/doc/snippets/train_direction_backward.tikz @@ -1,8 +1,12 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (-2,0) {train_direction_backward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (T) at (1,0); + +\maintrack (A) -- (B); +\train[backward] at (T) label (); \ No newline at end of file diff --git a/doc/snippets/train_direction_forward.tikz b/doc/snippets/train_direction_forward.tikz index 0757397..0144354 100644 --- a/doc/snippets/train_direction_forward.tikz +++ b/doc/snippets/train_direction_forward.tikz @@ -1,8 +1,12 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (2,0) {train_direction_forward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (T) at (5,0); + +\maintrack (A) -- (B); +\train[forward] at (T) label (); \ No newline at end of file diff --git a/doc/snippets/train_drive_automatic.tikz b/doc/snippets/train_drive_automatic.tikz index 2f1ec73..c959c4b 100644 --- a/doc/snippets/train_drive_automatic.tikz +++ b/doc/snippets/train_drive_automatic.tikz @@ -1,9 +1,12 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (2,0) {train_direction_forward}; % train -\pic at (2,0) {train_automatic_forward}; % triangle \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (T) at (5,0); + +\maintrack (A) -- (B); +\train[operation=automatic,forward] at (T) label (); \ No newline at end of file diff --git a/doc/snippets/train_drive_human.tikz b/doc/snippets/train_drive_human.tikz index 2c0687e..ab17f93 100644 --- a/doc/snippets/train_drive_human.tikz +++ b/doc/snippets/train_drive_human.tikz @@ -1,9 +1,12 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (2,0) {train_direction_forward}; % train -\pic at (2,0) {train_human_forward}; % dot \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (T) at (5,0); + +\maintrack (A) -- (B); +\train[operation=manual,forward] at (T) label (); \ No newline at end of file diff --git a/doc/snippets/train_ghost_direction_backward.tikz b/doc/snippets/train_ghost_direction_backward.tikz new file mode 100644 index 0000000..f3cedbb --- /dev/null +++ b/doc/snippets/train_ghost_direction_backward.tikz @@ -0,0 +1,12 @@ +%!TEX TS-program = pdflatexmk +%!TEX root = ../snippets.tex + +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (T) at (1,0); + +\maintrack (A) -- (B); +\train[ghost,backward] at (T) label (); \ No newline at end of file diff --git a/doc/snippets/train_ghost_direction_forward.tikz b/doc/snippets/train_ghost_direction_forward.tikz new file mode 100644 index 0000000..c2f7649 --- /dev/null +++ b/doc/snippets/train_ghost_direction_forward.tikz @@ -0,0 +1,12 @@ +%!TEX TS-program = pdflatexmk +%!TEX root = ../snippets.tex + +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (T) at (5,0); + +\maintrack (A) -- (B); +\train[ghost,forward] at (T) label (); \ No newline at end of file diff --git a/doc/snippets/train_moving_backward.tikz b/doc/snippets/train_moving_backward.tikz index 87b661f..c943950 100644 --- a/doc/snippets/train_moving_backward.tikz +++ b/doc/snippets/train_moving_backward.tikz @@ -1,8 +1,12 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (-2,0) {train_moving_backward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (T) at (1,0); + +\maintrack (A) -- (B); +\train[run=normal,backward] at (T) label (); \ No newline at end of file diff --git a/doc/snippets/train_moving_fast_backward.tikz b/doc/snippets/train_moving_fast_backward.tikz index 8df3a20..c6ee7d4 100644 --- a/doc/snippets/train_moving_fast_backward.tikz +++ b/doc/snippets/train_moving_fast_backward.tikz @@ -1,8 +1,12 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (-2,0) {train_moving_fast_backward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (T) at (1,0); + +\maintrack (A) -- (B); +\train[run=fast,backward] at (T) label (); \ No newline at end of file diff --git a/doc/snippets/train_moving_fast_forward.tikz b/doc/snippets/train_moving_fast_forward.tikz index 48526a7..ead1431 100644 --- a/doc/snippets/train_moving_fast_forward.tikz +++ b/doc/snippets/train_moving_fast_forward.tikz @@ -1,8 +1,12 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (2,0) {train_moving_fast_forward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (T) at (5,0); + +\maintrack (A) -- (B); +\train[run=fast,forward] at (T) label (); \ No newline at end of file diff --git a/doc/snippets/train_moving_forward.tikz b/doc/snippets/train_moving_forward.tikz index a6858a9..261f5c3 100644 --- a/doc/snippets/train_moving_forward.tikz +++ b/doc/snippets/train_moving_forward.tikz @@ -1,8 +1,12 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (2,0) {train_moving_forward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (T) at (5,0); + +\maintrack (A) -- (B); +\train[run=normal,forward] at (T) label (); \ No newline at end of file diff --git a/doc/snippets/train_moving_slow_backward.tikz b/doc/snippets/train_moving_slow_backward.tikz index d09b251..0ca90c0 100644 --- a/doc/snippets/train_moving_slow_backward.tikz +++ b/doc/snippets/train_moving_slow_backward.tikz @@ -1,8 +1,12 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (-2,0) {train_moving_slow_backward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (T) at (1,0); + +\maintrack (A) -- (B); +\train[run=slow,backward] at (T) label (); \ No newline at end of file diff --git a/doc/snippets/train_moving_slow_forward.tikz b/doc/snippets/train_moving_slow_forward.tikz index 9951ed0..2458e40 100644 --- a/doc/snippets/train_moving_slow_forward.tikz +++ b/doc/snippets/train_moving_slow_forward.tikz @@ -1,8 +1,12 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (2,0) {train_moving_slow_forward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (T) at (5,0); + +\maintrack (A) -- (B); +\train[run=slow,forward] at (T) label (); \ No newline at end of file diff --git a/doc/snippets/train_shunt_mode_backward.tikz b/doc/snippets/train_shunt_mode_backward.tikz index a658df9..26ae800 100644 --- a/doc/snippets/train_shunt_mode_backward.tikz +++ b/doc/snippets/train_shunt_mode_backward.tikz @@ -1,8 +1,12 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (-2,0) {train_shunt_mode_backward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (T) at (1,0); + +\maintrack (A) -- (B); +\shunting[backward] at (T) label (); \ No newline at end of file diff --git a/doc/snippets/train_shunt_mode_forward.tikz b/doc/snippets/train_shunt_mode_forward.tikz index 7764f87..c2ff464 100644 --- a/doc/snippets/train_shunt_mode_forward.tikz +++ b/doc/snippets/train_shunt_mode_forward.tikz @@ -1,8 +1,12 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (2,0) {train_shunt_mode_forward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (T) at (5,0); + +\maintrack (A) -- (B); +\shunting[forward] at (T) label (); \ No newline at end of file diff --git a/doc/snippets/train_shunting_backward.tikz b/doc/snippets/train_shunting_backward.tikz index 526bb73..2b68ab9 100644 --- a/doc/snippets/train_shunting_backward.tikz +++ b/doc/snippets/train_shunting_backward.tikz @@ -1,8 +1,12 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (-2,0) {train_shunting_backward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (T) at (1,0); + +\maintrack (A) -- (B); +\shunting[movement,backward] at (T) label (); \ No newline at end of file diff --git a/doc/snippets/train_shunting_forward.tikz b/doc/snippets/train_shunting_forward.tikz index 938f16a..2193e2d 100644 --- a/doc/snippets/train_shunting_forward.tikz +++ b/doc/snippets/train_shunting_forward.tikz @@ -1,8 +1,12 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (2,0) {train_shunting_forward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (T) at (5,0); + +\maintrack (A) -- (B); +\shunting[movement,forward] at (T) label (); \ No newline at end of file diff --git a/doc/snippets/transmitter.tikz b/doc/snippets/transmitter.tikz index 83f7f14..f0df563 100644 --- a/doc/snippets/transmitter.tikz +++ b/doc/snippets/transmitter.tikz @@ -1,9 +1,15 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (-1,0) {transmitter_below}; -\pic at ( 1,0) {transmitter_above}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (T1) at (2,0); +\coordinate (T2) at (4,0); + +\maintrack (A) -- (B); + +\balise[] at (T1) label (); +\balise[position=left] at (T2) label (); \ No newline at end of file diff --git a/doc/snippets/transmitter_backward.tikz b/doc/snippets/transmitter_backward.tikz index 5b1b320..37b97cf 100644 --- a/doc/snippets/transmitter_backward.tikz +++ b/doc/snippets/transmitter_backward.tikz @@ -1,9 +1,15 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (-1,0) {transmitter_below_backward}; -\pic at ( 1,0) {transmitter_above_backward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (T1) at (2,0); +\coordinate (T2) at (4,0); + +\maintrack (A) -- (B); + +\balise[backward] at (T1) label (); +\balise[backward,position=left] at (T2) label (); \ No newline at end of file diff --git a/doc/snippets/transmitter_below_forward.tikz b/doc/snippets/transmitter_below_forward.tikz deleted file mode 100644 index 16772f6..0000000 --- a/doc/snippets/transmitter_below_forward.tikz +++ /dev/null @@ -1,8 +0,0 @@ -%!TEX TS-program = pdflatexmk -%!TEX root = ../snippets.tex - -% Copyright 2019 Martin Scheidt (ISC license) -% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {transmitter_below_forward}; \ No newline at end of file diff --git a/doc/snippets/transmitter_below_with_signal.tikz b/doc/snippets/transmitter_below_with_signal.tikz deleted file mode 100644 index aeb2589..0000000 --- a/doc/snippets/transmitter_below_with_signal.tikz +++ /dev/null @@ -1,9 +0,0 @@ -%!TEX TS-program = pdflatexmk -%!TEX root = ../snippets.tex - -% Copyright 2019 Martin Scheidt (ISC license) -% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {route_signal_forward}; -\pic at (0,0) {transmitter_below}; \ No newline at end of file diff --git a/doc/snippets/transmitter_bidirectional.tikz b/doc/snippets/transmitter_bidirectional.tikz index 3083d54..a4fc070 100644 --- a/doc/snippets/transmitter_bidirectional.tikz +++ b/doc/snippets/transmitter_bidirectional.tikz @@ -1,9 +1,15 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (-1,0) {transmitter_below_bidirectional}; -\pic at ( 1,0) {transmitter_above_bidirectional}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (T1) at (2,0); +\coordinate (T2) at (4,0); + +\maintrack (A) -- (B); + +\balise[bidirectional] at (T1) label (); +\balise[bidirectional,position=left] at (T2) label (); \ No newline at end of file diff --git a/doc/snippets/transmitter_forward.tikz b/doc/snippets/transmitter_forward.tikz index 19f9933..4fcb47b 100644 --- a/doc/snippets/transmitter_forward.tikz +++ b/doc/snippets/transmitter_forward.tikz @@ -1,9 +1,15 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (-1,0) {transmitter_below_forward}; -\pic at ( 1,0) {transmitter_above_forward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (T1) at (2,0); +\coordinate (T2) at (4,0); + +\maintrack (A) -- (B); + +\balise[forward] at (T1) label (); +\balise[forward,position=left] at (T2) label (); \ No newline at end of file diff --git a/doc/snippets/train_berth_shape_different.tikz b/doc/snippets/transmitter_right.tikz similarity index 58% rename from doc/snippets/train_berth_shape_different.tikz rename to doc/snippets/transmitter_right.tikz index 304d817..e75bf48 100644 --- a/doc/snippets/train_berth_shape_different.tikz +++ b/doc/snippets/transmitter_right.tikz @@ -1,9 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (-2,0) {train_berth_shape_forward={4}}; -\pic at (-1,0) {train_berth_shape_backward={3}}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (T) at (3,0); + +\maintrack (A) -- (B); + +\balise[] at (T) label (); \ No newline at end of file diff --git a/doc/snippets/transmitter_right_bidirectional.tikz b/doc/snippets/transmitter_right_bidirectional.tikz new file mode 100644 index 0000000..02d2ef7 --- /dev/null +++ b/doc/snippets/transmitter_right_bidirectional.tikz @@ -0,0 +1,13 @@ +%!TEX TS-program = pdflatexmk +%!TEX root = ../snippets.tex + +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (T) at (3,0); + +\maintrack (A) -- (B); + +\balise[bidirectional] at (T) label (); \ No newline at end of file diff --git a/doc/snippets/transmitter_right_forward.tikz b/doc/snippets/transmitter_right_forward.tikz new file mode 100644 index 0000000..fdfc7bf --- /dev/null +++ b/doc/snippets/transmitter_right_forward.tikz @@ -0,0 +1,13 @@ +%!TEX TS-program = pdflatexmk +%!TEX root = ../snippets.tex + +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (T) at (3,0); + +\maintrack (A) -- (B); + +\balise[forward] at (T) label (); \ No newline at end of file diff --git a/doc/snippets/transmitter_right_with_signal.tikz b/doc/snippets/transmitter_right_with_signal.tikz new file mode 100644 index 0000000..97e150b --- /dev/null +++ b/doc/snippets/transmitter_right_with_signal.tikz @@ -0,0 +1,14 @@ +%!TEX TS-program = pdflatexmk +%!TEX root = ../snippets.tex + +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (S) at (3,0); + +\maintrack (A) -- (B); + +\routesignal[forward] at (S) label (); +\balise[] at (S) label (); \ No newline at end of file diff --git a/doc/snippets/turnout_left_backward.tikz b/doc/snippets/turnout_left_backward.tikz index ebfb3ea..4a429ae 100644 --- a/doc/snippets/turnout_left_backward.tikz +++ b/doc/snippets/turnout_left_backward.tikz @@ -1,9 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++( 5, 0); -\draw[MainTrack] ( 0,0) -- ++(-1,-1); -\pic at (0,0) {turnout_left_backward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\maintrack (A) -- (B); +\maintrack (Y) -- ++(-1,1); +\turnout[backward,branch=left] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/turnout_left_backward_left_position.tikz b/doc/snippets/turnout_left_backward_left_position.tikz index 2254651..dc694f5 100644 --- a/doc/snippets/turnout_left_backward_left_position.tikz +++ b/doc/snippets/turnout_left_backward_left_position.tikz @@ -1,10 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++( 5, 0); -\draw[MainTrack] ( 0,0) -- ++(-1,-1); -\pic at (0,0) {turnout_left_backward}; -\pic at (0,0) {turnout_left_backward_points_left}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\maintrack (A) -- (B); +\maintrack (Y) -- ++(-1,1); +\turnout[backward,branch=left,points=left] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/turnout_left_backward_manually.tikz b/doc/snippets/turnout_left_backward_manually.tikz new file mode 100644 index 0000000..aa237b2 --- /dev/null +++ b/doc/snippets/turnout_left_backward_manually.tikz @@ -0,0 +1,13 @@ +%!TEX TS-program = pdflatexmk +%!TEX root = ../snippets.tex + +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\secondarytrack (A) -- (B); +\secondarytrack (Y) -- ++(-1,1); +\turnout[backward,branch=left,operation=manual] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/turnout_left_backward_moving_points.tikz b/doc/snippets/turnout_left_backward_moving_points.tikz index 473ad6a..04f1993 100644 --- a/doc/snippets/turnout_left_backward_moving_points.tikz +++ b/doc/snippets/turnout_left_backward_moving_points.tikz @@ -1,10 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++( 5, 0); -\draw[MainTrack] ( 0,0) -- ++(-1,-1); -\pic at (0,0) {turnout_left_backward}; -\pic at (0,0) {turnout_left_backward_points_moving}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\maintrack (A) -- (B); +\maintrack (Y) -- ++(-1,1); +\turnout[backward,branch=left,points=moving] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/turnout_left_backward_right_position.tikz b/doc/snippets/turnout_left_backward_right_position.tikz index 7aa14b3..42c9e99 100644 --- a/doc/snippets/turnout_left_backward_right_position.tikz +++ b/doc/snippets/turnout_left_backward_right_position.tikz @@ -1,10 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++( 5, 0); -\draw[MainTrack] ( 0,0) -- ++(-1,-1); -\pic at (0,0) {turnout_left_backward}; -\pic at (0,0) {turnout_left_backward_points_right}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\maintrack (A) -- (B); +\maintrack (Y) -- ++(-1,1); +\turnout[backward,branch=left,points=right] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/turnout_left_forward.tikz b/doc/snippets/turnout_left_forward.tikz index 4f240c0..51c45f8 100644 --- a/doc/snippets/turnout_left_forward.tikz +++ b/doc/snippets/turnout_left_forward.tikz @@ -1,9 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\draw[MainTrack] ( 0,0) -- ++(1,1); -\pic at (0,0) {turnout_left_forward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\maintrack (A) -- (B); +\maintrack (Y) -- ++(1,1); +\turnout[forward,branch=left] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/turnout_left_forward_left_position.tikz b/doc/snippets/turnout_left_forward_left_position.tikz index 7f27609..eb9bd4d 100644 --- a/doc/snippets/turnout_left_forward_left_position.tikz +++ b/doc/snippets/turnout_left_forward_left_position.tikz @@ -1,10 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\draw[MainTrack] ( 0,0) -- ++(1,1); -\pic at (0,0) {turnout_left_forward}; -\pic at (0,0) {turnout_left_forward_points_left}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\maintrack (A) -- (B); +\maintrack (Y) -- ++(1,1); +\turnout[forward,branch=left,points=left] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/turnout_left_forward_manually.tikz b/doc/snippets/turnout_left_forward_manually.tikz new file mode 100644 index 0000000..68406b9 --- /dev/null +++ b/doc/snippets/turnout_left_forward_manually.tikz @@ -0,0 +1,13 @@ +%!TEX TS-program = pdflatexmk +%!TEX root = ../snippets.tex + +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\secondarytrack (A) -- (B); +\secondarytrack (Y) -- ++(1,1); +\turnout[forward,branch=left,operation=manual] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/turnout_left_forward_moving_points.tikz b/doc/snippets/turnout_left_forward_moving_points.tikz index 6333869..56edd14 100644 --- a/doc/snippets/turnout_left_forward_moving_points.tikz +++ b/doc/snippets/turnout_left_forward_moving_points.tikz @@ -1,10 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\draw[MainTrack] ( 0,0) -- ++(1,1); -\pic at (0,0) {turnout_left_forward}; -\pic at (0,0) {turnout_left_forward_points_moving}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\maintrack (A) -- (B); +\maintrack (Y) -- ++(1,1); +\turnout[forward,branch=left,points=moving] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/turnout_left_forward_right_position.tikz b/doc/snippets/turnout_left_forward_right_position.tikz index b69a286..91be83b 100644 --- a/doc/snippets/turnout_left_forward_right_position.tikz +++ b/doc/snippets/turnout_left_forward_right_position.tikz @@ -1,10 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\draw[MainTrack] ( 0,0) -- ++(1,1); -\pic at (0,0) {turnout_left_forward}; -\pic at (0,0) {turnout_left_forward_points_right}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\maintrack (A) -- (B); +\maintrack (Y) -- ++(1,1); +\turnout[forward,branch=left,points=right] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/turnout_right_backward.tikz b/doc/snippets/turnout_right_backward.tikz index b7c2143..09270f5 100644 --- a/doc/snippets/turnout_right_backward.tikz +++ b/doc/snippets/turnout_right_backward.tikz @@ -1,9 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++( 5,0); -\draw[MainTrack] ( 0,0) -- ++(-1,1); -\pic at (0,0) {turnout_right_backward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\maintrack (A) -- (B); +\maintrack (Y) -- ++(-1,-1); +\turnout[backward,branch=right] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/turnout_right_backward_left_position.tikz b/doc/snippets/turnout_right_backward_left_position.tikz index 4b54ddb..f081b13 100644 --- a/doc/snippets/turnout_right_backward_left_position.tikz +++ b/doc/snippets/turnout_right_backward_left_position.tikz @@ -1,10 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++( 5,0); -\draw[MainTrack] ( 0,0) -- ++(-1,1); -\pic at (0,0) {turnout_right_backward}; -\pic at (0,0) {turnout_right_backward_points_left}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\maintrack (A) -- (B); +\maintrack (Y) -- ++(-1,-1); +\turnout[backward,branch=right,points=left] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/turnout_right_backward_manually.tikz b/doc/snippets/turnout_right_backward_manually.tikz new file mode 100644 index 0000000..e43ae4b --- /dev/null +++ b/doc/snippets/turnout_right_backward_manually.tikz @@ -0,0 +1,13 @@ +%!TEX TS-program = pdflatexmk +%!TEX root = ../snippets.tex + +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\secondarytrack (A) -- (B); +\secondarytrack (Y) -- ++(-1,-1); +\turnout[backward,branch=right,operation=manual] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/turnout_right_backward_moving_points.tikz b/doc/snippets/turnout_right_backward_moving_points.tikz index dbbb887..f91d92f 100644 --- a/doc/snippets/turnout_right_backward_moving_points.tikz +++ b/doc/snippets/turnout_right_backward_moving_points.tikz @@ -1,10 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++( 5,0); -\draw[MainTrack] ( 0,0) -- ++(-1,1); -\pic at (0,0) {turnout_right_backward}; -\pic at (0,0) {turnout_right_backward_points_moving}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\maintrack (A) -- (B); +\maintrack (Y) -- ++(-1,-1); +\turnout[backward,branch=right,points=moving] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/turnout_right_backward_right_position.tikz b/doc/snippets/turnout_right_backward_right_position.tikz index fe48d8b..72cae3c 100644 --- a/doc/snippets/turnout_right_backward_right_position.tikz +++ b/doc/snippets/turnout_right_backward_right_position.tikz @@ -1,10 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++( 5,0); -\draw[MainTrack] ( 0,0) -- ++(-1,1); -\pic at (0,0) {turnout_right_backward}; -\pic at (0,0) {turnout_right_backward_points_right}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\maintrack (A) -- (B); +\maintrack (Y) -- ++(-1,-1); +\turnout[backward,branch=right,points=right] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/turnout_right_forward.tikz b/doc/snippets/turnout_right_forward.tikz index dd0c6d0..8cc9014 100644 --- a/doc/snippets/turnout_right_forward.tikz +++ b/doc/snippets/turnout_right_forward.tikz @@ -1,9 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5, 0); -\draw[MainTrack] ( 0,0) -- ++(1,-1); -\pic at (0,0) {turnout_right_forward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\maintrack (A) -- (B); +\maintrack (Y) -- ++(1,-1); +\turnout[forward,branch=right] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/turnout_right_forward_left_position.tikz b/doc/snippets/turnout_right_forward_left_position.tikz index c2f62a5..cf48f77 100644 --- a/doc/snippets/turnout_right_forward_left_position.tikz +++ b/doc/snippets/turnout_right_forward_left_position.tikz @@ -1,10 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5, 0); -\draw[MainTrack] ( 0,0) -- ++(1,-1); -\pic at (0,0) {turnout_right_forward}; -\pic at (0,0) {turnout_right_forward_points_left}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\maintrack (A) -- (B); +\maintrack (Y) -- ++(1,-1); +\turnout[forward,branch=right,points=left] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/turnout_right_forward_manually.tikz b/doc/snippets/turnout_right_forward_manually.tikz new file mode 100644 index 0000000..3c02bda --- /dev/null +++ b/doc/snippets/turnout_right_forward_manually.tikz @@ -0,0 +1,13 @@ +%!TEX TS-program = pdflatexmk +%!TEX root = ../snippets.tex + +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\secondarytrack (A) -- (B); +\secondarytrack (Y) -- ++(1,-1); +\turnout[forward,branch=right,operation=manual] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/turnout_right_forward_moving_points.tikz b/doc/snippets/turnout_right_forward_moving_points.tikz index 568067f..787a48d 100644 --- a/doc/snippets/turnout_right_forward_moving_points.tikz +++ b/doc/snippets/turnout_right_forward_moving_points.tikz @@ -1,10 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5, 0); -\draw[MainTrack] ( 0,0) -- ++(1,-1); -\pic at (0,0) {turnout_right_forward}; -\pic at (0,0) {turnout_right_forward_points_moving}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\maintrack (A) -- (B); +\maintrack (Y) -- ++(1,-1); +\turnout[forward,branch=right,points=moving] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/turnout_right_forward_right_position.tikz b/doc/snippets/turnout_right_forward_right_position.tikz index ce7c3a2..f46c799 100644 --- a/doc/snippets/turnout_right_forward_right_position.tikz +++ b/doc/snippets/turnout_right_forward_right_position.tikz @@ -1,10 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5, 0); -\draw[MainTrack] ( 0,0) -- ++(1,-1); -\pic at (0,0) {turnout_right_forward}; -\pic at (0,0) {turnout_right_forward_points_right}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\maintrack (A) -- (B); +\maintrack (Y) -- ++(1,-1); +\turnout[forward,branch=right,points=right] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/turnout_with_fouling_left_backward.tikz b/doc/snippets/turnout_with_fouling_left_backward.tikz index e290320..ef63a63 100644 --- a/doc/snippets/turnout_with_fouling_left_backward.tikz +++ b/doc/snippets/turnout_with_fouling_left_backward.tikz @@ -1,10 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++( 5, 0); -\draw[MainTrack] ( 0,0) -- ++(-1,-1); -\pic at (0,0) {turnout_left_backward}; -\pic at (0,0) {fouling_point_left_backward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\maintrack (A) -- (B); +\maintrack (Y) -- ++(-1,1); +\turnout[backward,branch=left,fouling point] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/turnout_with_fouling_left_forward.tikz b/doc/snippets/turnout_with_fouling_left_forward.tikz index a998a75..396e033 100644 --- a/doc/snippets/turnout_with_fouling_left_forward.tikz +++ b/doc/snippets/turnout_with_fouling_left_forward.tikz @@ -1,10 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\draw[MainTrack] ( 0,0) -- ++(1,1); -\pic at (0,0) {turnout_left_forward}; -\pic at (0,0) {fouling_point_left_forward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\maintrack (A) -- (B); +\maintrack (Y) -- ++(1,1); +\turnout[forward,branch=left,fouling point] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/turnout_with_fouling_right_backward.tikz b/doc/snippets/turnout_with_fouling_right_backward.tikz index 61e38a2..50c5b94 100644 --- a/doc/snippets/turnout_with_fouling_right_backward.tikz +++ b/doc/snippets/turnout_with_fouling_right_backward.tikz @@ -1,10 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++( 5,0); -\draw[MainTrack] ( 0,0) -- ++(-1,1); -\pic at (0,0) {turnout_right_backward}; -\pic at (0,0) {fouling_point_right_backward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\maintrack (A) -- (B); +\maintrack (Y) -- ++(-1,-1); +\turnout[backward,branch=right,fouling point] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/turnout_with_fouling_right_forward.tikz b/doc/snippets/turnout_with_fouling_right_forward.tikz index 9726738..3c954fb 100644 --- a/doc/snippets/turnout_with_fouling_right_forward.tikz +++ b/doc/snippets/turnout_with_fouling_right_forward.tikz @@ -1,10 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5, 0); -\draw[MainTrack] ( 0,0) -- ++(1,-1); -\pic at (0,0) {turnout_right_forward}; -\pic at (0,0) {fouling_point_right_forward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (Y) at (3,0); +\coordinate (B) at (6,0); + +\maintrack (A) -- (B); +\maintrack (Y) -- ++(1,-1); +\turnout[forward,branch=right,fouling point] at (Y) label (); \ No newline at end of file diff --git a/doc/snippets/vehicle.tikz b/doc/snippets/vehicle.tikz deleted file mode 100644 index 1d8ea8f..0000000 --- a/doc/snippets/vehicle.tikz +++ /dev/null @@ -1,9 +0,0 @@ -%!TEX TS-program = pdflatexmk -%!TEX root = ../snippets.tex - -% Copyright 2019 Martin Scheidt (ISC license) -% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -\draw[SecondaryTrack] (-2.5,0) -- ++(5,0); -\pic at (-0.5,0) {vehicles=1}; -% change the 1 to desired length \ No newline at end of file diff --git a/doc/snippets/vehicles.tikz b/doc/snippets/vehicles.tikz deleted file mode 100644 index 411c50e..0000000 --- a/doc/snippets/vehicles.tikz +++ /dev/null @@ -1,8 +0,0 @@ -%!TEX TS-program = pdflatexmk -%!TEX root = ../snippets.tex - -% Copyright 2019 Martin Scheidt (ISC license) -% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -\draw[SecondaryTrack] (-2.5,0) -- ++(5,0); -\pic at (-2,0) {vehicles}; \ No newline at end of file diff --git a/doc/snippets/vehicles_with_label.tikz b/doc/snippets/vehicles_with_label.tikz deleted file mode 100644 index 81f0834..0000000 --- a/doc/snippets/vehicles_with_label.tikz +++ /dev/null @@ -1,9 +0,0 @@ -%!TEX TS-program = pdflatexmk -%!TEX root = ../snippets.tex - -% Copyright 2019 Martin Scheidt (ISC license) -% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -\draw[SecondaryTrack] (-2.5,0) -- ++(5,0); -\pic at (-2,0) {vehicles}; -\node[font=\sffamily] at (0,0) {label}; \ No newline at end of file diff --git a/doc/snippets/view_point_backward.tikz b/doc/snippets/view_point_backward.tikz index 0e9f2fd..112e7c6 100644 --- a/doc/snippets/view_point_backward.tikz +++ b/doc/snippets/view_point_backward.tikz @@ -1,8 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {view_point_backward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (S) at (3,0); + +\maintrack (A) -- (B); + +\viewpoint[backward] at (S); \ No newline at end of file diff --git a/doc/snippets/view_point_forward.tikz b/doc/snippets/view_point_forward.tikz index 1a6f6c0..1a7bff5 100644 --- a/doc/snippets/view_point_forward.tikz +++ b/doc/snippets/view_point_forward.tikz @@ -1,8 +1,13 @@ %!TEX TS-program = pdflatexmk %!TEX root = ../snippets.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\draw[MainTrack] (-2.5,0) -- ++(5,0); -\pic at (0,0) {view_point_forward}; \ No newline at end of file +\coordinate (A) at (0,0); +\coordinate (B) at (6,0); +\coordinate (S) at (3,0); + +\maintrack (A) -- (B); + +\viewpoint[forward] at (S); \ No newline at end of file diff --git a/doc/symbology.pdf b/doc/symbology.pdf deleted file mode 100644 index 5e2701c..0000000 Binary files a/doc/symbology.pdf and /dev/null differ diff --git a/doc/symbology.tex b/doc/symbology.tex deleted file mode 100644 index a3f58f8..0000000 --- a/doc/symbology.tex +++ /dev/null @@ -1,149 +0,0 @@ -%!TEX TS-program = pdflatexmk - -% Copyright 2019 Martin Scheidt (ISC license) -% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -\documentclass[a4paper]{article} - -\usepackage[margin=0pt]{geometry} -\pagestyle{empty} -\usepackage{longtable,siunitx,tikz,adjustbox} -\usepackage{listings} -\lstset{ - language=TeX, - basicstyle=\ttfamily, - columns=fullflexible, - breaklines=true -} - -\def\rootTrackschematic{../tikz-trackschematic} - -\renewcommand{\symbol}[1]{ - \adjustbox{valign=c}{\begin{tikzpicture}[scale=1.0,transform shape] - \input{\rootTrackschematic/snippets/#1} - \path (-3,-1.1) rectangle (3,1.1); % background rectangle to unify every cell containing a symbol - \end{tikzpicture}} -} -\newcommand{\code}[1]{\lstinputlisting[firstline=7]{\rootTrackschematic/snippets/#1}} -\newcounter{symbolNo} -\def\No{\stepcounter{symbolNo}\arabic{symbolNo}} - -\def\srcTrackschematic{\rootTrackschematic/src/tikzlibrarytrackschematic} -\input{\srcTrackschematic.topology.code.tex} -\input{\srcTrackschematic.trafficcontrol.code.tex} -\input{\srcTrackschematic.vehicles.code.tex} -\input{\srcTrackschematic.constructions.code.tex} - -\title{Symbology}\author{}\date{} - -\begin{document} - \maketitle - \centering - \begin{longtable}{|r|l|c|} - \hline - No. & Name & Symbol \\ - \endhead - \hline - \No & main track & \symbol{main_track.tikz} \\ - \hline - \No & track distance (in \si{\metre}) & \symbol{track_distance.tikz} \\ - \hline - \No & secondary track & \symbol{secondary_track.tikz} \\ - \hline - \No & track number & \symbol{track_number.tikz} \\ - \hline - \No & turnout & \symbol{turnout_left_forward.tikz} \\ - \hline - \No & \parbox[c]{5cm}{turnout\\with fouling point indicator} - & \symbol{turnout_with_fouling_left_forward.tikz} \\ - \hline - \No & double-slip turnout & \symbol{double-slip_turnout_left.tikz} \\ - \hline - \No & diamond crossing & \symbol{diamond_crossing_left.tikz} \\ - \hline - \No & \parbox[c]{5cm}{turnout\\with points in right position} - & \symbol{turnout_left_forward_right_position.tikz} \\ - \hline - \No & \parbox[c]{5cm}{turnout\\with points in left position} - & \symbol{turnout_left_forward_left_position.tikz} \\ - \hline - \No & \parbox[c]{5cm}{turnout\\with moving points} - & \symbol{turnout_left_forward_moving_points.tikz} \\ - \hline - \No & derailer & \symbol{derailer_left_forward.tikz} \\ - \hline - \No & bufferstop & \symbol{bufferstop_forward.tikz} \\ - \hline - \No & vehicles & \symbol{vehicles.tikz} \\ - \hline - \No & train & \symbol{train_direction_forward.tikz} \\ - \hline - \No & ghost train & \symbol{ghost_train_direction_forward.tikz} \\ - \hline - \No & train moving & \symbol{train_moving_forward.tikz} \\ - \hline - \No & train moving slow & \symbol{train_moving_slow_forward.tikz} \\ - \hline - \No & train moving fast & \symbol{train_moving_fast_forward.tikz} \\ - \hline - \No & train in shunting mode & \symbol{train_shunt_mode_forward.tikz} \\ - \hline - \No & train shunting & \symbol{train_shunting_forward.tikz} \\ - \hline - \No & train operated automatic & \symbol{train_drive_automatic.tikz} \\ - \hline - \No & train operated by human & \symbol{train_drive_human.tikz} \\ - \hline - \No & view point & \symbol{view_point_forward.tikz} \\ - \hline - \No & distant signal & \symbol{distant_signal_forward.tikz} \\ - \hline - \No & \parbox[c]{4cm}{distant signal\\with speed indicator} - & \symbol{distant_speed_signal_forward.tikz} \\ - \hline - \No & speed signal & \symbol{speed_signal_forward.tikz} \\ - \hline - \No & block signal & \symbol{block_signal_forward.tikz} \\ - \hline - \No & route signal & \symbol{route_signal_forward.tikz} \\ - \hline - \No & \parbox[c]{4cm}{combined signal\\(distant and block signal)} - & \symbol{combined_signal_forward.tikz} \\ - \hline - \No & shunt signal & \symbol{shunt_signal_forward.tikz} \\ - \hline - \No & shunt signal locked & \symbol{shunt_signal_forward_locked.tikz} \\ - \hline - \No & shunt limit & \symbol{shunt_limit_forward.tikz} \\ - \hline - \No & transmitter & \symbol{transmitter_below.tikz} \\ - \hline - \No & transmitter effective forward & \symbol{transmitter_below_forward.tikz} \\ - \hline - \No & transmitter bidirectional & \symbol{transmitter_below_bidirectional.tikz} \\ - \hline - \No & \parbox[c]{4cm}{block end marker\\(end of movement authority)} - & \symbol{block_end_marker_forward.tikz} \\ - \hline - \No & block clearing point & \symbol{block_clearing_point_forward.tikz} \\ - \hline - \No & route clearing point & \symbol{route_clearing_point_forward.tikz} \\ - \hline - \No & clearing point & \symbol{clearing_point.tikz} \\ - \hline - \No & train berth sign & \symbol{train_berth_sign_forward.tikz} \\ - \hline - \No & train berth shape & \symbol{train_berth_shape.tikz} \\ - \hline - \No & platform & \symbol{platform_left.tikz} \\ - \hline - \No & level crossing & \symbol{level_crossing_single.tikz} \\ - \hline - \No & bridge & \symbol{bridge.tikz} \\ - \hline - \No & hump & \symbol{hump.tikz} \\ - \hline - \No & interlocking & \symbol{interlocking.tikz} \\ - \hline - \end{longtable} -\end{document} \ No newline at end of file diff --git a/doc/versionhistory.tex b/doc/versionhistory.tex index 6326b44..4c7030c 100644 --- a/doc/versionhistory.tex +++ b/doc/versionhistory.tex @@ -1,8 +1,7 @@ %!TEX TS-program = pdflatexmk %!TEX root = doc.tex -% Copyright 2018,2019 Martin Scheidt (ISC license) - +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. \begin{versionhistory} @@ -19,7 +18,7 @@ \vhEntry{0.4}{2019-07-21}{MS}{ Reworked library for common tikz library layout. } - \vhEntry{0.5}{2019-12-19}{MS}{ - Introduced new syntax. + \vhEntry{0.5}{2020-01-14}{MS}{ + Introducing new syntax and providing a documentation. } \end{versionhistory} diff --git a/src/layoutSymbols_DE.tikz b/src/layoutSymbols_DE.tikz deleted file mode 100644 index b5f0cae..0000000 --- a/src/layoutSymbols_DE.tikz +++ /dev/null @@ -1,280 +0,0 @@ -%% symbol library for TikZ track schematics -% -% Copyright 2019 Martin Scheidt (ISC license) - -% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -% based on Ril 819.9002 by Deutsche Bahn released 01.05.2012 - -\tikzset{ - distant_signal_forward/.pic={ - { % signal pole - \path[draw, line width=1pt,foreground] (0,-0.3) -- ++(0,-0.2); - \path[draw, line width=1pt,foreground] (0,-0.4) -- ++(0.5,0); - } - { % signal marker - \path[draw, fill,foreground] (0.7,-0.6) rectangle ++(0.2,0.4); - \path[draw, fill,foreground] (0.7,-0.2) arc (90:270:0.2); - } - }; -} -\tikzset{ - distant_signal_backward/.pic={ - { % signal pole - \path[draw, line width=1pt,foreground] (0,0.3) -- ++(0,0.2); - \path[draw, line width=1pt,foreground] (0,0.4) -- ++(-0.5,0); - } - { % signal marker - \path[draw, fill,foreground] (-0.7,0.6) rectangle ++(-0.2,-0.4); - \path[draw, fill,foreground] (-0.7,0.2) arc (90:270:-0.2); - } - }; -} -\tikzset{ - route_signal_forward/.pic={ - { % signal pole - \path[draw, line width=1pt,foreground] (0,-0.3) -- ++(0,-0.2); - \path[draw, line width=1pt,foreground] (0,-0.4) -- ++(0.7,0); - } - { % signal marker - \path[draw, fill,foreground] (0.7,-0.6) rectangle ++(0.3,0.4); - \path[draw, fill,foreground] (1.0,-0.6) arc (90:270:-0.2); - } - }; -} -\tikzset{ - route_signal_backward/.pic={ - { % signal pole - \path[draw, line width=1pt,foreground] (0,0.3) -- ++(0,0.2); - \path[draw, line width=1pt,foreground] (0,0.4) -- ++(-0.7,0); - } - { % signal marker - \path[draw, fill,foreground] (-0.7,0.6) rectangle ++(-0.3,-0.4); - \path[draw, fill,foreground] (-1.0,0.6) arc (90:270:0.2); - } - }; -} -\tikzset{ - block_signal_forward/.pic={ - { % signal pole - \path[draw, line width=1pt,foreground] (0,-0.3) -- ++(0,-0.2); - \path[draw, line width=1pt,foreground] (0,-0.4) -- ++(0.7,0); - } - { % signal marker - \path[draw, fill,foreground] (0.7,-0.6) rectangle ++(0.3,0.4); - \path[draw, fill,foreground] (1.0,-0.6) arc (90:270:-0.2); - } - }; -} -\tikzset{ - block_signal_backward/.pic={ - { % signal pole - \path[draw, line width=1pt,foreground] (0,0.3) -- ++(0,0.2); - \path[draw, line width=1pt,foreground] (0,0.4) -- ++(-0.7,0); - } - { % signal marker - \path[draw, fill,foreground] (-0.7,0.6) rectangle ++(-0.3,-0.4); - \path[draw, fill,foreground] (-1.0,0.6) arc (90:270:0.2); - } - }; -} -\tikzset{ - main_route_forward/.pic={ - \draw[foreground] (-0.06,0) circle (0.19); - \fill[foreground] (-0.175,-0.15) -- ++(0,0.3) -- ++ (0.35,-0.15) -- cycle; - }; -} -\tikzset{ - main_route_backward/.pic={ - \draw[foreground] (0.06,0) circle (0.19); - \fill[foreground] (0.175,-0.15) -- ++(0,0.3) -- ++ (-0.35,-0.15) -- cycle; - }; -} -\tikzset{ - passanger_route_forward/.pic={ - \fill[foreground] (-0.175,-0.15) -- ++(0,0.3) -- ++ (0.35,-0.15) -- cycle; - }; -} -\tikzset{ - passanger_route_backward/.pic={ - \fill[foreground] (0.175,-0.15) -- ++(0,0.3) -- ++ (-0.35,-0.15) -- cycle; - }; -} -\tikzset{ - commuter_route_forward/.pic={ - \fill[foreground] (-0.2,0) circle (0.15); - \fill[foreground] ( 0 ,-0.15) -- ++(0,0.3) -- ++ (0.35,-0.15) -- cycle; - }; -} -\tikzset{ - commuter_route_backward/.pic={ - \fill[foreground] (0.2,0) circle (-0.15); - \fill[foreground] (0 ,-0.15) -- ++(0,0.3) -- ++ (-0.35,-0.15) -- cycle; - }; -} -\tikzset{ - freight_route_forward/.pic={ - \fill[foreground] (-0.35,-0.15) -- ++(0,0.3) -- ++ (0.35,-0.15) -- cycle; - \fill[foreground] ( 0 ,-0.15) -- ++(0,0.3) -- ++ (0.35,-0.15) -- cycle; - }; -} -\tikzset{ - freight_route_backward/.pic={ - \fill[foreground] (0.35,-0.15) -- ++(0,0.3) -- ++ (-0.35,-0.15) -- cycle; - \fill[foreground] (0 ,-0.15) -- ++(0,0.3) -- ++ (-0.35,-0.15) -- cycle; - }; -} -\tikzset{ - shunting_route_forward/.pic={ - \fill[foreground] ( 0.175,-0.15) -- ++(0,0.3) -- ++ (0.35,-0.15) -- cycle; - \fill[foreground] (-0.175,-0.15) -- ++(0,0.3) -- ++ (0.35,-0.15) -- cycle; - \fill[foreground] (-0.525,-0.15) -- ++(0,0.3) -- ++ (0.35,-0.15) -- cycle; - }; -} -\tikzset{ - shunting_route_backward/.pic={ - \fill[foreground] ( 0.525,-0.15) -- ++(0,0.3) -- ++ (-0.35,-0.15) -- cycle; - \fill[foreground] ( 0.175,-0.15) -- ++(0,0.3) -- ++ (-0.35,-0.15) -- cycle; - \fill[foreground] (-0.175,-0.15) -- ++(0,0.3) -- ++ (-0.35,-0.15) -- cycle; - }; -} -\tikzset{ - pics/speed_signal_forward/.style args={#1}{ - code={ - { % signal pole - \path[draw, line width=1pt,foreground] (0,-0.3) -- ++(0,-0.2); - \path[draw, line width=1pt,foreground] (0,-0.4) -- ++(0.4,0); - } - \path[draw, line width=1pt,foreground] (0.4,-0.2) -- ++(0,-0.4) -- ++ (0.35,0.2) -- cycle; % signal marker - \node[rotate=-90,font=\sffamily,text=foreground] at (1.0,-0.4) {#1}; % speed indicator - } - }, - pics/speed_signal_forward/.default=, -} -\tikzset{ - pics/speed_signal_backward/.style args={#1}{ - code={ - { % signal pole - \path[draw, line width=1pt,foreground] (0,0.3) -- ++(0,0.2); - \path[draw, line width=1pt,foreground] (0,0.4) -- ++(-0.4,0); - } - \path[draw, line width=1pt,foreground] (-0.4,0.2) -- ++(0,0.4) -- ++ (-0.35,-0.2) -- cycle; % signal marker - \node[rotate=90,font=\sffamily,text=foreground] at (-1.0,0.4) {#1}; % speed indicator - } - }, - pics/speed_signal_backward/.default=, -} -\tikzset{ - pics/speed_distant_signal_forward/.style args={#1}{ - code={ - { % signal pole - \path[draw, line width=1pt,foreground] (0,-0.3) -- ++(0,-0.2); - \path[draw, line width=1pt,foreground] (0,-0.4) -- ++(0.4,0); - } - \path[draw, line width=1pt,foreground] (0.75,-0.2) -- ++(0,-0.4) -- ++ (-0.35,0.2) -- cycle; % signal marker - \node[rotate=-90,font=\sffamily,text=foreground] at (1.0,-0.4) {#1}; % speed indicator - } - }, - pics/speed_distant_signal_forward/.default=, -} -\tikzset{ - pics/speed_distant_signal_backward/.style args={#1}{ - code={ - { % signal pole - \path[draw, line width=1pt,foreground] (0,0.3) -- ++(0,0.2); - \path[draw, line width=1pt,foreground] (0,0.4) -- ++(-0.4,0); - } - \path[draw, line width=1pt,foreground] (-0.75,0.2) -- ++(0,0.4) -- ++ (0.35,-0.2) -- cycle; % signal marker - \node[rotate=90,font=\sffamily,text=foreground] at (-1.0,0.4) {#1}; % speed indicator - } - }, - pics/speed_distant_signal_backward/.default=, -} -\tikzset{ - shunt_signal_forward/.pic={ - { % signal pole - \path[draw, line width=1pt,foreground] (0,-0.3) -- ++(0,-0.2); - \path[draw, line width=1pt,foreground] (0,-0.4) -- ++(0.6,0); - } - { % signal marker - \path[draw, line width=1pt, fill=background,foreground] (0.6,-0.55) rectangle ++(0.3,0.3); - \path[draw, line width=1pt,foreground] (0.75,-0.55) -- ++(0,0.3); - } - }; -} -\tikzset{ - shunt_signal_backward/.pic={ - { % signal pole - \path[draw, line width=1pt,foreground] (0,0.3) -- ++(0,0.2); - \path[draw, line width=1pt,foreground] (0,0.4) -- ++(-0.6,0); - } - { % signal marker - \path[draw, line width=1pt, fill=background,foreground] (-0.6,0.55) rectangle ++(-0.3,-0.3); - \path[draw, line width=1pt,foreground] (-0.75,0.55) -- ++(0,-0.3); - } - }; -} -\tikzset{ - shunt_limit_forward/.pic={ - { % signal pole - \path[draw, line width=1pt,foreground] (0,-0.3) -- ++(0,-0.2); - \path[draw, line width=1pt,foreground] (0,-0.4) -- ++(0.5,0); - } - \path[draw, line width=1pt,foreground] (0.5,-0.25) arc (270:90:-0.15) -- cycle;; % signal marker - }; -} -\tikzset{ - shunt_limit_backward/.pic={ - { % signal pole - \path[draw, line width=1pt,foreground] (0,0.3) -- ++(0,0.2); - \path[draw, line width=1pt,foreground] (0,0.4) -- ++(-0.5,0); - } - \path[draw, line width=1pt,foreground] (-0.5,0.55) arc (90:270:0.15) -- cycle;; % signal marker - }; -} -\tikzset{ - pics/axle_counter_left/.style args={#1}{ - code={ - \path[draw, line width=1pt,foreground] (-0.25,0.16) -- ++(0.5,0); - \path[draw, line width=1pt, fill,foreground] (-0.1,0.16) circle (0.07); - \path[draw, line width=1pt, fill,foreground] ( 0.1,0.16) circle (0.07); - \node[font=\sffamily,text=foreground] at (0,0.4) {#1}; % indicator - } - }, - pics/axle_counter_left/.default=, -} -\tikzset{ - pics/axle_counter_right/.style args={#1}{ - code={ - \path[draw, line width=1pt,foreground] (-0.25,-0.16) -- ++(0.5,0); - \path[draw, line width=1pt, fill,foreground] (-0.1,-0.16) circle (0.07); - \path[draw, line width=1pt, fill,foreground] ( 0.1,-0.16) circle (0.07); - \node[font=\sffamily,text=foreground] at (0,-0.4) {#1}; % indicator - } - }, - pics/axle_counter_right/.default=, -} -\tikzset{ - derailer_right_forward/.pic={ - \fill[foreground] (-0.1,0.2) -- ++(0,-0.4) -- ++(0.2,0) -- ++(0,0.4) -- cycle; % signal pole - \path[draw,->,>=latex,line width=1pt,foreground] (-0.2,0.2) -- (0.4,-0.4); % derailer marker - }; -} -\tikzset{ - derailer_left_forward/.pic={ - \fill[foreground] (-0.1,0.2) -- ++(0,-0.4) -- ++(0.2,0) -- ++(0,0.4) -- cycle; % signal pole - \path[draw,->,>=latex,line width=1pt,foreground] (-0.2,-0.2) -- (0.4,0.4); % derailer marker - }; -} -\tikzset{ - derailer_right_backward/.pic={ - \fill[foreground] (-0.1,0.2) -- ++(0,-0.4) -- ++(0.2,0) -- ++(0,0.4) -- cycle; % signal pole - \path[draw,->,>=latex,line width=1pt,foreground] (0.2,-0.2) -- (-0.4,0.4); % derailer marker - }; -} -\tikzset{ - derailer_left_backward/.pic={ - \fill[foreground] (-0.1,0.2) -- ++(0,-0.4) -- ++(0.2,0) -- ++(0,0.4) -- cycle; % signal pole - \path[draw,->,>=latex,line width=1pt,foreground] (0.2,0.2) -- (-0.4,-0.4); % derailer marker - }; -} diff --git a/src/tikzlibrarytrackschematic.code.tex b/src/tikzlibrarytrackschematic.code.tex index 8170e3c..41e8313 100644 --- a/src/tikzlibrarytrackschematic.code.tex +++ b/src/tikzlibrarytrackschematic.code.tex @@ -1,31 +1,13 @@ %% symbol library for TikZ track schematics % -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -\ProvidesFileRCS{tikzlibrarytrackschematic.code.tex} - -%%%%%%%%%%%%%%% -% global settings -%%%%%%%%%%%%%%% -\RequirePackage{tikz,xcolor} - -\colorlet{background}{white} -\colorlet{foreground}{black} - -\pgfkeys{% - /tikz/trackschematic/.is family,% - /tikz/trackschematic/.cd,% - %% face - face/.value required,% forward OR backward - face/.store in=\face, - /tikz/face/.forward to=/tikz/trackschematic/face,% - /tikz/forward/.code={\pgfkeys{/tikz/trackschematic/face=forward}},% - /tikz/backward/.code={\pgfkeys{/tikz/trackschematic/face=backward}},% - % -} - +% +\ProvidesFileRCS{tikzlibrarytrackschematic.code.tex}% +% +\RequirePackage{tikz,etoolbox,lmodern}% +% %%%%%%%%%%%%%%% % symbol definitions %%%%%%%%%%%%%%% @@ -33,5 +15,9 @@ \usetikzlibrary{trackschematic.trafficcontrol}% \usetikzlibrary{trackschematic.vehicles}% \usetikzlibrary{trackschematic.constructions}% - -\endinput +\usetikzlibrary{trackschematic.messures}% +% \usetikzlibrary{trackschematic.i18n}% +% +%%%%%%%%%%%%%%% +\endinput% +% \ No newline at end of file diff --git a/src/tikzlibrarytrackschematic.constructions.code.tex b/src/tikzlibrarytrackschematic.constructions.code.tex index 8d420ff..a8713de 100644 --- a/src/tikzlibrarytrackschematic.constructions.code.tex +++ b/src/tikzlibrarytrackschematic.constructions.code.tex @@ -1,117 +1,389 @@ %% symbol library for TikZ track schematics % -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -\ProvidesFileRCS{tikzlibrarytrackschematic.construction.code.tex} - -\colorlet{background}{white} -\colorlet{foreground}{black} - -\tikzset{ - pics/platform_left/.default=4, - pics/platform_left/.style n args={1}{ - code={ - \path[draw, line width=0.75pt,foreground] (0,0.5) -- ++(0,-0.3) -- ++(#1,0) -- ++(0,0.3); - \path[draw, line width=0.75pt,foreground] (0,0.3) -- ++(#1,0); - } - }, -} - -\tikzset{ - pics/platform_right/.default=4, - pics/platform_right/.style n args={1}{ - code={ - \path[draw, line width=0.75pt,foreground] (0,-0.5) -- ++(0,0.3) -- ++(#1,0) -- ++(0,-0.3); - \path[draw, line width=0.75pt,foreground] (0,-0.3) -- ++(#1,0); - } - }, -} - -\tikzset{ - level_crossing_barrier_left/.pic={ - { % road - \path[draw, line width=1pt,foreground] (-0.2, 0.8) -- ++(0,-0.6); - \path[draw, line width=1pt,foreground] ( 0.2, 0.8) -- ++(0,-0.6); - } - { % barrier - \filldraw[foreground] (-0.4,0.5) circle (0.05); - \path[draw, line width=1pt,foreground] (-0.4,0.5) -- ++(0.39,0); - } - }; -} - -\tikzset{ - level_crossing_barrier_right/.pic={ - { % road - \path[draw, line width=1pt,foreground] (-0.2,-0.8) -- ++(0, 0.6); - \path[draw, line width=1pt,foreground] ( 0.2,-0.8) -- ++(0, 0.6); - } - { % barrier - \filldraw[foreground] (0.4,-0.5) circle (0.05); - \path[draw, line width=1pt,foreground] (0.4,-0.5) -- ++(-0.39,0); - } - }; -} - -\tikzset{ - level_crossing/.pic={ - { % road - \path[draw, line width=1pt,foreground] (-0.2,-0.8) -- ++(0, 0.6); - \path[draw, line width=1pt,foreground] ( 0.2,-0.8) -- ++(0, 0.6); - } - }; -} - -\tikzset{ - pics/bridge_left/.style n args={1}{ - code={ - \path[draw, line width=0.75pt,foreground] (-0.1,0.48) -- ++(0.08,-0.08) -- ++(#1,0) -- ++(0.08,0.08); - } - }, - pics/bridge_left/.default=3, -} - -\tikzset{ - pics/bridge_right/.default=3, - pics/bridge_right/.style n args={1}{ - code={ - \path[draw, line width=0.75pt,foreground] (-0.1,-0.48) -- ++(0.08,0.08) -- ++(#1,0) -- ++(0.08,-0.08); - } - }, -} - -\tikzset{ - interlocking/.pic={ - { - \path[draw, line width=1pt,foreground] (-0.6,-0.4 ) rectangle ++(1.2,0.8); % building - \path[draw, fill,foreground] (-0.5,-0.3 ) rectangle ++(1.0,0.2); % table - \path[draw, fill,foreground] ( 0 , 0.15) circle (0.15); % human dot - } - }; -} - -\tikzset{ - hump/.pic={ - { % upper side - \path[draw, line width=0.75pt,foreground] (-0.3, 0.1) -- ++(0,0.05); - \path[draw, line width=0.75pt,foreground] (-0.2, 0.1) -- ++(0,0.15); - \path[draw, line width=0.75pt,foreground] (-0.1, 0.1) -- ++(0,0.25); - \path[draw, line width=0.75pt,foreground] ( 0.0, 0.1) -- ++(0,0.35); - \path[draw, line width=0.75pt,foreground] ( 0.1, 0.1) -- ++(0,0.25); - \path[draw, line width=0.75pt,foreground] ( 0.2, 0.1) -- ++(0,0.15); - \path[draw, line width=0.75pt,foreground] ( 0.3, 0.1) -- ++(0,0.05); - % lower side - \path[draw, line width=0.75pt,foreground] (-0.3,-0.1) -- ++(0,-0.05); - \path[draw, line width=0.75pt,foreground] (-0.2,-0.1) -- ++(0,-0.15); - \path[draw, line width=0.75pt,foreground] (-0.1,-0.1) -- ++(0,-0.25); - \path[draw, line width=0.75pt,foreground] ( 0.0,-0.1) -- ++(0,-0.35); - \path[draw, line width=0.75pt,foreground] ( 0.1,-0.1) -- ++(0,-0.25); - \path[draw, line width=0.75pt,foreground] ( 0.2,-0.1) -- ++(0,-0.15); - \path[draw, line width=0.75pt,foreground] ( 0.3,-0.1) -- ++(0,-0.05); - } - }; -} - -\endinput +% +\ProvidesFileRCS{tikzlibrarytrackschematic.construction.code.tex}% +% +%%%%%%%%%%%%%%% +% global settings +%%%%%%%%%%%%%%% +\RequirePackage{tikz,etoolbox,lmodern}% +\usetikzlibrary{calc}% +% +\ifdeflength{\objectlength}{}{% Not defined, so define it! + \newlength{\objectlength}% +}% +\setlength{\objectlength}{4cm}% +% +%%%%%%%%%%%%%%% +% tikz keys for multiple use +%%%%%%%%%%%%%%% +\pgfkeys{% + /tikz/trackschematic/.is family,% + /tikz/trackschematic/.cd,% + %% color foreground + foreground/.store in=\foreground,% + foreground=black,% DEFAULT + /tikz/foreground/.forward to=/tikz/trackschematic/foreground,% + %% color background + background/.store in=\background,% + background=white,% DEFAULT + /tikz/background/.forward to=/tikz/trackschematic/background,% + %% length + length/.store in=\objectlength,% default length 4cm + /tikz/length/.forward to=/tikz/trackschematic/length,% + %% traffic practice + traffic practice/.value required,% left OR right + traffic practice/.store in=\trafficpractice,% + traffic practice=right,% DEFAULT + /tikz/traffic practice/.forward to=/tikz/trackschematic/traffic practice,% + /tikz/position/.forward to=/tikz/trackschematic/traffic practice,% +}% +\newlength{\objectwidth}\setlength{\objectwidth}{0.5cm}% +\pgfkeys{% + /tikz/trackschematic/constructions/.is family,% + /tikz/trackschematic/constructions/.cd,% + %% side + side/.value required,% left, right OR both + side/.store in=\side,% left, right OR both + /tikz/side/.forward to=/tikz/trackschematic/constructions/side,% + %% width + width/.store in=\objectwidth,% default width 0.5cm + /tikz/width/.forward to=/tikz/trackschematic/constructions/width,% +}% +% +%%%%%%%%%%%%%%% +% symbol platform +%%%%%%%%%%%%%%% +% +%% command +\newcommand\platform{}% just for safety +\def\platform[#1]#2(#3){% \platform[options] at (coord); + \pic[#1] at (#3) {platform={#2}}% symbol +}% +%% symbol definition +\tikzset{% + pics/platform/.default=,% + pics/platform/.style args={#1}{code={% + %% settings + \def\coordcommand{#1}% beware of leading and tailing spaces! + % + \ifdefstring{\side}{left}{% side + \pgfmathsetmacro{\sidefactor}{1}% + }{% + \ifdefstring{\side}{right}{% side + \pgfmathsetmacro{\sidefactor}{-1}% + }{% + \ifdefstring{\side}{both}{% side + }{% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/constructions/side}{“left“, “right“ OR “both“ as key required}}% + }% + }% + }% end \ifdefstring{\side} + %% platform shape + \tikzset{every path/.style={draw=\foreground,line width=0.75pt}};% + \ifdefstring{\side}{both}{% double side + \path ($-0.5*(\objectlength,0) + (0, \objectwidth)$) --% + ($-0.5*(\objectlength,0) + (0, 0.2)$) --% + ($ 0.5*(\objectlength,0) + (0, 0.2)$) --% + ($ 0.5*(\objectlength,0) + (0, \objectwidth)$);% part 1 + \path ($-0.5*(\objectlength,0) + (0, 0.3)$) --% + ($ 0.5*(\objectlength,0) + (0, 0.3)$);% part 2 + \path ($-0.5*(\objectlength,0) + (0,-\objectwidth)$) --% + ($-0.5*(\objectlength,0) + (0,-0.2)$) --% + ($ 0.5*(\objectlength,0) + (0,-0.2)$) --% + ($ 0.5*(\objectlength,0) + (0,-\objectwidth)$);% part 3 + \path ($-0.5*(\objectlength,0) + (0,-0.3)$) --% + ($ 0.5*(\objectlength,0) + (0,-0.3)$);% part 4 + }{% single side + \path ($-0.5*(\objectlength,0) + \sidefactor*(0,\objectwidth)$) --% + ($-0.5*(\objectlength,0) + \sidefactor*(0,0.2)$) --% + ($ 0.5*(\objectlength,0) + \sidefactor*(0,0.2)$) --% + ($ 0.5*(\objectlength,0) + \sidefactor*(0,\objectwidth)$);% part 1 + \path ($-0.5*(\objectlength,0) + \sidefactor*(0,0.3)$) --% + ($ 0.5*(\objectlength,0) + \sidefactor*(0,0.3)$);% part 2 + }% + }},% +}% +% +%%%%%%%%%%%%%%% +% symbol level crossing +%%%%%%%%%%%%%%% +% +%% command +\newcommand\levelcrossing{}% just for safety +\def\levelcrossing[#1]#2(#3){% \levelcrossing[options] at (coord); + \pic[side=both,#1] at (#3) {level_crossing={#2}}% symbol +}% +%% tikz keys +\newlength{\roadwidth}\setlength{\roadwidth}{0.4cm}% +\newtoggle{show_road}\settoggle{show_road}{true}% +\pgfkeys{% + /tikz/trackschematic/constructions/level crossing/.is family,% + /tikz/trackschematic/constructions/level crossing/.cd,% + %% barrier + barrier/.store in=\barrier,% full, semi OR none + barrier=none,% DEFAULT + /tikz/barrier/.forward to=/tikz/trackschematic/constructions/level crossing/barrier,% + /tikz/barrier side/.forward to=/tikz/trackschematic/constructions/side,% + %% show road + no road/.value forbidden,% + no road/.code={\settoggle{show_road}{false}},% + /tikz/no road/.forward to=/tikz/trackschematic/constructions/level crossing/no road,% + %% road width + road width/.store in=\roadwidth,% default width 0.4cm + /tikz/road width/.forward to=/tikz/trackschematic/constructions/level crossing/road width,% +}% +%% symbol definition +\tikzset{% + pics/level_crossing/.default=,% + pics/level_crossing/.style args={#1}{code={% + %% settings + \def\coordcommand{#1} % beware of leading and tailing spaces! + %% traffic practice setup + \ifdefstring{\trafficpractice}{left}{% branch + \pgfmathsetmacro{\trafficfactor}{-1}% + }{% + \ifdefstring{\trafficpractice}{right}{% branch + \pgfmathsetmacro{\trafficfactor}{1}% + }{% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/trafficcontrol/traffic practice}{“left“ OR “right“ as key required}}% + }% + }% end \ifdefstring{\trafficpractice} + %% symbol + \tikzset{every path/.style={draw=\foreground,line width=1pt}};% + \iftoggle{show_road}{% true + \path ($0.5*(-\roadwidth,0) + (0,-0.1)$) --% + ++($(0,-\objectwidth)$);% road part 1 + \path ($0.5*( \roadwidth,0) + (0,-0.1)$) --% + ++($(0,-\objectwidth)$);% road part 2 + \path ($0.5*(-\roadwidth,0) + (0, 0.1)$) --% + ++($(0, \objectwidth)$);% road part 3 + \path ($0.5*( \roadwidth,0) + (0, 0.1)$) --% + ++($(0, \objectwidth)$);% road part 4 + }{}% END \iftoggle{show_road} + \ifdefstring{\barrier}{full}{% full barrier + \ifdefstring{\side}{both}{% + \filldraw[\foreground]% left barrier part 1 + ($(-0.5\roadwidth,0)+(-0.2,0)+(0,0.35)$) circle (0.05);% + \filldraw[\foreground]% left barrier part 2 + ($( 0.5\roadwidth,0)+( 0.2,0)+(0,0.35)$) circle (0.05);% + \path ($(-0.5\roadwidth,0)+(-0.2,0)+(0,0.35)$) --% + ++($( 0.45\roadwidth,0)+( 0.2,0)$);% left barrier part 3 + \path ($( 0.5\roadwidth,0)+( 0.2,0)+(0,0.35)$) --% + ++($(-0.45\roadwidth,0)+(-0.2,0)$);% left barrier part 4 + % + \filldraw[\foreground]% right barrier part 1 + ($( 0.5\roadwidth,0)+( 0.2,0)+(0,-0.35)$) circle (0.05);% + \filldraw[\foreground]% right barrier part 2 + ($(-0.5\roadwidth,0)+(-0.2,0)+(0,-0.35)$) circle (0.05);% + \path ($( 0.5\roadwidth,0)+( 0.2,0)+(0,-0.35)$) --% + ++($(-0.45\roadwidth,0)+(-0.2,0)$);% right barrier part 3 + \path ($(-0.5\roadwidth,0)+(-0.2,0)+(0,-0.35)$) --% + ++($( 0.45\roadwidth,0)+( 0.2,0)$);% right barrier part 4 + }{% + \ifdefstring{\side}{left}{% + \filldraw[\foreground]% left barrier part 1 + ($(-0.5\roadwidth,0)+(-0.2,0)+(0,0.35)$) circle (0.05);% + \filldraw[\foreground]% left barrier part 2 + ($( 0.5\roadwidth,0)+( 0.2,0)+(0,0.35)$) circle (0.05);% + \path ($(-0.5\roadwidth,0)+(-0.2,0)+(0,0.35)$) --% + ++($( 0.45\roadwidth,0)+( 0.2,0)$);% left barrier part 3 + \path ($( 0.5\roadwidth,0)+( 0.2,0)+(0,0.35)$) --% + ++($(-0.45\roadwidth,0)+(-0.2,0)$);% left barrier part 4 + }{% + \ifdefstring{\side}{right}{% + \filldraw[\foreground]% right barrier part 1 + ($( 0.5\roadwidth,0)+( 0.2,0)+(0,-0.35)$) circle (0.05);% + \filldraw[\foreground]% right barrier part 2 + ($(-0.5\roadwidth,0)+(-0.2,0)+(0,-0.35)$) circle (0.05);% + \path ($( 0.5\roadwidth,0)+( 0.2,0)+(0,-0.35)$) --% + ++($(-0.45\roadwidth,0)+(-0.2,0)$);% right barrier part 3 + \path ($(-0.5\roadwidth,0)+(-0.2,0)+(0,-0.35)$) --% + ++($( 0.45\roadwidth,0)+( 0.2,0)$);% right barrier part 4 + }{%% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/constructions/side}{“left“, “right“ OR “both“ as key required}}% + }% END \ifdefstring{\side}{right} + }% END \ifdefstring{\side}{left} + }% END \ifdefstring{\side}{both} + }{% + \ifdefstring{\barrier}{semi}{% semi barrier + \ifdefstring{\side}{both}{% + \filldraw[\foreground]% left barrier part 1 + ($\trafficfactor*(-0.5\roadwidth,0)+\trafficfactor*(-0.2,0)+(0,0.35)$) circle (0.05);% + \path ($\trafficfactor*(-0.5\roadwidth,0)+\trafficfactor*(-0.2,0)+(0,0.35)$) --% + ++($\trafficfactor*(0.5\roadwidth,0)+\trafficfactor*(0.2,0)$);% left barrier part 2 + % + \filldraw[\foreground]% right barrier part 1 + ($\trafficfactor*(0.5\roadwidth,0)+\trafficfactor*(0.2,0)+(0,-0.35)$) circle (0.05);% + \path ($\trafficfactor*(0.5\roadwidth,0)+\trafficfactor*(0.2,0)+(0,-0.35)$) --% + ++($\trafficfactor*(-0.5\roadwidth,0)+\trafficfactor*(-0.2,0)$);% right barrier part 2 + }{% + \ifdefstring{\side}{left}{% + \filldraw[\foreground]% left barrier part 1 + ($\trafficfactor*(-0.5\roadwidth,0)+\trafficfactor*(-0.2,0)+(0,0.35)$) circle (0.05);% + \path ($\trafficfactor*(-0.5\roadwidth,0)+\trafficfactor*(-0.2,0)+(0,0.35)$) --% + ++($\trafficfactor*(0.5\roadwidth,0)+\trafficfactor*(0.2,0)$);% left barrier part 2 + }{% + \ifdefstring{\side}{right}{% + \filldraw[\foreground]% right barrier part 1 + ($\trafficfactor*(0.5\roadwidth,0)+\trafficfactor*(0.2,0)+(0,-0.35)$) circle (0.05);% + \path ($\trafficfactor*(0.5\roadwidth,0)+\trafficfactor*(0.2,0)+(0,-0.35)$) --% + ++($\trafficfactor*(-0.5\roadwidth,0)+\trafficfactor*(-0.2,0)$);% right barrier part 2 + }{%% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/constructions/side}{“left“, “right“ OR “both“ as key required}}% + }% END \ifdefstring{\side}{right} + }% END \ifdefstring{\side}{left} + }% END \ifdefstring{\side}{both} + }{% + \ifdefstring{\barrier}{none}{% no barriers + }{% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/constructions/level crossing/barrier}{“full“, “semi“ OR “none“ as key required}}% + }% + }% END \ifdefstring{\barrier}{semi} + }% END \ifdefstring{\barrier}{full} + }},% +}% +% +%%%%%%%%%%%%%%% +% symbol bridge +%%%%%%%%%%%%%%% +% +%% command +\newcommand\bridge{}% just for safety +\def\bridge[#1]#2(#3){% \bridge[options] at (coord); + \pic[side=both,#1] at (#3) {bridge={#2}}% symbol +}% +\newlength{\shiftleft}\setlength{\shiftleft}{0cm}% +\newlength{\shiftright}\setlength{\shiftright}{0cm}% +\newtoggle{show_background}\settoggle{show_background}{true}% +%% tikz keys +\pgfkeys{% + /tikz/trackschematic/constructions/bridge/.is family,% + /tikz/trackschematic/constructions/bridge/.cd,% + % shift + shift left/.store in=\shiftleft,% default shift 0cm + /tikz/shift left/.forward to=/tikz/trackschematic/constructions/bridge/shift left,% + shift right/.store in=\shiftright,% default shift 0cm + /tikz/shift right/.forward to=/tikz/trackschematic/constructions/bridge/shift right,% + %% show road + no background/.value forbidden,% + no background/.code={\settoggle{show_background}{false}},% + /tikz/no background/.forward to=/tikz/trackschematic/constructions/bridge/no background,% +}% +%% symbol definition +\tikzset{% + pics/bridge/.default=,% + pics/bridge/.style args={#1}{code={% + %% settings + \def\coordcommand{#1} % beware of leading and tailing spaces! + %% symbol + \iftoggle{show_background}{% true + \fill[\background]% + ($(-0.5\objectlength,\objectwidth)+(0,-0.1)$) rectangle% + ($(0.5\objectlength,-\objectwidth)+(0,0.1)$);% + }{}% + \tikzset{every path/.style={draw=\foreground,line width=0.75pt}};% + \ifdefstring{\side}{both}{% + \path ($-0.5*(\objectlength,0)+(-0.1,0)+(\shiftleft,\objectwidth)$) --% + ++($(0.1,-0.1)$) --% + ++($(\objectlength,0)$) --% + ++($(0.1,0.1)$);% left bridge + \path ($-0.5*(\objectlength,0)+(-0.1,0)+(\shiftright,-\objectwidth)$) --% + ++($(0.1,0.1)$) --% + ++($(\objectlength,0)$) --% + ++($(0.1,-0.1)$);% right bridge + }{% + \ifdefstring{\side}{left}{% + \path ($-0.5*(\objectlength,0)+(-0.1,0)+(\shiftleft,\objectwidth)$) --% + ++($(0.1,-0.1)$) --% + ++($(\objectlength,0)$) --% + ++($(0.1,0.1)$);% left bridge + }{% + \ifdefstring{\side}{right}{% + \path ($-0.5*(\objectlength,0)+(-0.1,0)+(\shiftright,-\objectwidth)$) --% + ++($(0.1,0.1)$) --% + ++($(\objectlength,0)$) --% + ++($(0.1,-0.1)$);% right bridge + }{%% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/constructions/side}{“left“, “right“ OR “both“ as key required}}% + }% END \ifdefstring{\side}{right} + }% END \ifdefstring{\side}{left} + }% END \ifdefstring{\side}{both} + }},% +}% +% +%%%%%%%%%%%%%%% +% symbol interlocking +%%%%%%%%%%%%%%% +% +%% command +\newcommand\interlocking{}% just for safety +\def\interlocking#1(#2){% \interlocking at (coord); + \pic at (#2) {interlocking={#1}}% symbol +}% +%% tikz keys +% \pgfkeys{% +% /tikz/trackschematic/.is family,% +% /tikz/trackschematic/.cd,% +% }% +%% symbol definition +\tikzset{% + pics/interlocking/.default=,% + pics/interlocking/.style args={#1}{code={% + %% settings + \def\coordcommand{#1} % beware of leading and tailing spaces! + %% symbol + \tikzset{every path/.style={draw=\foreground,line width=1pt}};% + \path (-0.6,-0.4 ) rectangle ++(1.2,0.8); % building + \path[fill=\foreground] (-0.5,-0.3 ) rectangle ++(1.0,0.2); % table + \path[fill=\foreground] ( 0 , 0.15) circle (0.15); % human dot + }},% +}% +% +%%%%%%%%%%%%%%% +% symbol hump +%%%%%%%%%%%%%%% +% +%% command +\newcommand\hump{}% just for safety +\def\hump#1(#2){% \hump at (coord); + \pic at (#2) {hump={#1}}% symbol +}% +%% tikz keys +% \pgfkeys{% +% /tikz/trackschematic/.is family,% +% /tikz/trackschematic/.cd,% +% }% +%% symbol definition +\tikzset{% + pics/hump/.default=,% + pics/hump/.style args={#1}{code={% + %% settings + \def\coordcommand{#1} % beware of leading and tailing spaces! + %% symbol + \tikzset{every path/.style={draw=\foreground,line width=0.75pt}};% + % left side + \path (-0.3, 0.1) -- ++(0,0.05); + \path (-0.2, 0.1) -- ++(0,0.15); + \path (-0.1, 0.1) -- ++(0,0.25); + \path ( 0.0, 0.1) -- ++(0,0.35); + \path ( 0.1, 0.1) -- ++(0,0.25); + \path ( 0.2, 0.1) -- ++(0,0.15); + \path ( 0.3, 0.1) -- ++(0,0.05); + % right side + \path (-0.3,-0.1) -- ++(0,-0.05); + \path (-0.2,-0.1) -- ++(0,-0.15); + \path (-0.1,-0.1) -- ++(0,-0.25); + \path ( 0.0,-0.1) -- ++(0,-0.35); + \path ( 0.1,-0.1) -- ++(0,-0.25); + \path ( 0.2,-0.1) -- ++(0,-0.15); + \path ( 0.3,-0.1) -- ++(0,-0.05); + }},% +}% +% +%%%%%%%%%%%%%%% +\endinput% +% \ No newline at end of file diff --git a/src/tikzlibrarytrackschematic.messures.code.tex b/src/tikzlibrarytrackschematic.messures.code.tex new file mode 100644 index 0000000..290701b --- /dev/null +++ b/src/tikzlibrarytrackschematic.messures.code.tex @@ -0,0 +1,253 @@ +%% symbol library for TikZ track schematics +% +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. +% +\ProvidesFileRCS{tikzlibrarytrackschematic.messures.code.tex}% +% +%%%%%%%%%%%%%%% +% global settings +%%%%%%%%%%%%%%% +\RequirePackage{tikz,etoolbox,lmodern}% +\usetikzlibrary{calc,intersections,arrows.meta}% +% +% https://tex.stackexchange.com/questions/56353/extract-x-y-coordinate-of-an-arbitrary-point-on-curve-in-tikz +\providecommand{\gettikzxy}[3]{% + \tikz@scan@one@point\pgfutil@firstofone#1\relax% + \edef#2{\the\pgf@x}% + \edef#3{\the\pgf@y}% +}% +% +%%%%%%%%%%%%%%% +% tikz keys for multiple use +%%%%%%%%%%%%%%% +\ifdeflength{\objectlength}{}{% Not defined, so define it! + \newlength{\objectlength}% +}% +\setlength{\objectlength}{4cm}% +% +\pgfkeys{% + /tikz/trackschematic/.is family,% + /tikz/trackschematic/.cd,% + %% color foreground + foreground/.store in=\foreground,% + foreground=black,% DEFAULT + /tikz/foreground/.forward to=/tikz/trackschematic/foreground,% + %% color background + background/.store in=\background,% + background=white,% DEFAULT + /tikz/background/.forward to=/tikz/trackschematic/background,% + %% face + face/.value required,% forward, backward OR bidirectional + face/.store in=\face,% forward, backward OR bidirectional + /tikz/face/.forward to=/tikz/trackschematic/face,% + /tikz/forward/.code={\pgfkeys{/tikz/trackschematic/face=forward}},% + /tikz/backward/.code={\pgfkeys{/tikz/trackschematic/face=backward}},% + /tikz/bidirectional/.code={\pgfkeys{/tikz/trackschematic/face=bidirectional}},% + %% length + length/.store in=\objectlength,% default length 4cm + /tikz/length/.forward to=/tikz/trackschematic/length,% + %% traffic practice + traffic practice/.value required,% left OR right + traffic practice/.store in=\trafficpractice,% + /tikz/traffic practice/.forward to=/tikz/trackschematic/traffic practice,% + /tikz/position/.forward to=/tikz/trackschematic/traffic practice,% + %% label + shift label/.store in=\labelcoord,% (coord) + shift label=(none),% DEFAULT + /tikz/shift label/.forward to=/tikz/trackschematic/shift label,% +}% +\tikzset{traffic practice=right}% +% +% tikz keys +\pgfkeys{% + /tikz/trackschematic/messures/.is family,% + /tikz/trackschematic/messures/.cd,% + %% color hectometer + color/.store in=\hectometercolor,% + color=\foreground!50!\background,% DEFAULT + /tikz/hectometer color/.forward to=/tikz/trackschematic/messures/color,% +}% +%%%%%%%%%%%%%%%% +% symbol train berth +%%%%%%%%%%%%%%% +%% command +\newcommand\berth{}% just for safety +\def\berth[#1]#2(#3)#4(#5){% \berth[options] at (coord) length (usable length); + \pic[#1] at (#3) {train_berth={#2/#4/#5}}% symbol +}% +%% +%% symbol definition +\tikzset{% + pics/train_berth/.default=,% + pics/train_berth/.style args={#1/#2/#3}{code={% + %% settings + \def\coordcommand{#1}% beware of leading and tailing spaces! + \def\labelcommand{#2}% beware of leading and tailing spaces! + \def\labelcontent{#3}% + %% face setup + \ifdefstring{\face}{bidirectional}{% face + \pgfmathsetmacro{\facefactor}{1}% + }{% + \ifdefstring{\face}{forward}{% face + \pgfmathsetmacro{\facefactor}{1}% + }{% + \ifdefstring{\face}{backward}{% face + \pgfmathsetmacro{\facefactor}{-1}% + }{% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/face}{“forward“, “backward“ OR “bidirectional“ as key required}}% + }% + }% + }% end \ifdefstring{\face} + %% traffic practice setup + \ifdefstring{\trafficpractice}{left}{% branch + \pgfmathsetmacro{\trafficfactor}{-1}% + }{% + \ifdefstring{\trafficpractice}{right}{% branch + \pgfmathsetmacro{\trafficfactor}{1}% + }{% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/trafficcontrol/traffic practice}{“left“ OR “right“ as key required}}% + }% + }% end \ifdefstring{\trafficpractice} + % + \tikzset{every path/.style={draw=\foreground,line width=0.75pt,line cap=round,dash pattern=on 0pt off 2.4\pgflinewidth}};% + \path% berth shape forward + ($-0.5*(\objectlength,0) + (-0.05,0) + \trafficfactor*\facefactor*(0,-0.25)$) --% + ($-0.5*(\objectlength,0) + (-0.05,0) + \trafficfactor*\facefactor*(0,-0.35)$)% + ($-0.5*(\objectlength,0) + (-0.05,0) + \trafficfactor*\facefactor*(0,-0.35) + (\pgflinewidth,0)$) --% + ($ 0.5*(\objectlength,0) + ( 0.05,0) + \trafficfactor*\facefactor*(0,-0.35)$)% + ($ 0.5*(\objectlength,0) + ( 0.05,0) + \trafficfactor*\facefactor*(0,-0.25)$) --% + ($ 0.5*(\objectlength,0) + ( 0.05,0) + \trafficfactor*\facefactor*(0,-0.35)$);% berth shape forward + \path[draw=none,fill=\foreground]% arrow front + ($\facefactor*0.5*(\objectlength,0) + \facefactor*(-0.1,0) + \trafficfactor*\facefactor*(0,-0.35)$) --% + ++($(0,-0.04) + \facefactor*(-0.1,0)$) -- ++(0,0.08) -- cycle;% arrow + \path[draw=none,fill=\foreground]% arrow back + ($\facefactor*-0.5*(\objectlength,0) + \facefactor*(0.2,0) + \trafficfactor*\facefactor*(0,-0.35)$) --% + ++($(0,-0.04) + \facefactor*(-0.1,0)$) -- ++(0,0.08) -- cycle;% arrow + \ifdefstring{\face}{bidirectional}{% bidirectional + \pgfmathsetmacro{\facefactor}{-1}% + \path% berth shape forward + ($-0.5*(\objectlength,0) + (-0.05,0) + \trafficfactor*\facefactor*(0,-0.25)$) --% + ($-0.5*(\objectlength,0) + (-0.05,0) + \trafficfactor*\facefactor*(0,-0.35)$)% + ($-0.5*(\objectlength,0) + (-0.05,0) + \trafficfactor*\facefactor*(0,-0.35) + (\pgflinewidth,0)$) --% + ($ 0.5*(\objectlength,0) + ( 0.05,0) + \trafficfactor*\facefactor*(0,-0.35)$)% + ($ 0.5*(\objectlength,0) + ( 0.05,0) + \trafficfactor*\facefactor*(0,-0.25)$) --% + ($ 0.5*(\objectlength,0) + ( 0.05,0) + \trafficfactor*\facefactor*(0,-0.35)$);% berth shape forward + \path[draw=none,fill=\foreground]% arrow front + ($\facefactor*0.5*(\objectlength,0) + \facefactor*(-0.1,0) + \trafficfactor*\facefactor*(0,-0.35)$) --% + ++($(0,-0.04) + \facefactor*(-0.1,0)$) -- ++(0,0.08) -- cycle;% arrow + \path[draw=none,fill=\foreground]% arrow back + ($\facefactor*-0.5*(\objectlength,0) + \facefactor*(0.2,0) + \trafficfactor*\facefactor*(0,-0.35)$) --% + ++($(0,-0.04) + \facefactor*(-0.1,0)$) -- ++(0,0.08) -- cycle;% arrow + }{}% + %% label + \ifdefstring{\labelcontent}{}{}{% label NOT empty + \node[fill=\background,text=\foreground,inner sep=1pt] at ($\facefactor*(0,-0.35)$) {\tiny \labelcontent};% + \ifdefstring{\face}{bidirectional}{% bidirectional + \pgfmathsetmacro{\facefactor}{1}% + \node[fill=\background,text=\foreground,inner sep=1pt] at ($\facefactor*(0,-0.35)$) {\tiny \labelcontent};% + }{}% + }% + }},% end pics/train_berth/.style args={#1/#2/#3} +}% +% +%%%%%%%%%%%%%%% +% symbol track distance +%%%%%%%%%%%%%%% +% +%% command +\newcommand\trackdistance{}% just for safety +\def\trackdistance#1(#2)#3(#4)#5(#6){% \trackdistance between (coord1) and (coord2) label (distance); + \path[draw=\background,<->,>={Stealth[\foreground,inset=0pt,angle=50:0.2cm]},shorten <=1pt,shorten >=1pt] (#2) -- (#4)% arrow tips + node[hectometer base=(current bounding box.center),text=\foreground,midway,sloped,rotate=90] {#6};% label +}% +% +%%%%%%%%%%%%%%% +% symbol hectometer posts +%%%%%%%%%%%%%%% +% +%% command +\newcommand\hectometer{}% just for safety +\def\hectometer[#1]#2(#3)#4(#5){% \hectometer[options] at (coord) label (name); + \pic[#1] at (#3) {hectometer_posts={#2/#4/#5}}% symbol +}% +% tikz keys +\pgfkeys{% + /tikz/trackschematic/messures/hectometer/.is family,% + /tikz/trackschematic/messures/hectometer/.cd,% + %% hectometer base + base/.value required,% + base/.store in=\basecoord,% + /tikz/hectometer base/.forward to=/tikz/trackschematic/messures/hectometer/base,% + %% hectometer base + orientation/.value required,% + orientation/.store in=\orientation,% + /tikz/orientation/.forward to=/tikz/trackschematic/messures/hectometer/orientation,% +}% +%% symbol definition +\tikzset{% + pics/hectometer_posts/.default=,% + pics/hectometer_posts/.style args={#1/#2/#3}{code={% + %% settings + \def\coordcommand{#1}% beware of leading and tailing spaces! + \def\labelcommand{#2}% beware of leading and tailing spaces! + \def\labelcontent{#3}% + % + \gettikzxy{\basecoord}{\basecoordX}{\basecoordY}% + \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default + \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% + } + %% orientation setup + \ifdefstring{\orientation}{left}{% orientation + \def\align{right}% + }{% + \ifdefstring{\orientation}{right}{% orientation + \def\align{left}% + }{% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/messures/hectometer/orientation}{“left“ OR “right“ as key required}}% + }% + }% end \ifdefstring{\orientation} + %% calculation of coordinates + %% + %% bend 1 bend 2 + %% (0,0.75) (ts-hm-b1) (ts-hm-b2) + %% (0,0)• • ------- • --------- • ----- •(ts-hm-l) label + %% + \coordinate (ts-hm-l) at (0,\basecoordY);% + \ifdefstring{\labelcoord}{(none)}{% + \coordinate (ts-hm-b1) at (ts-hm-l);% + \coordinate (ts-hm-b2) at (ts-hm-l);% + }{% initialize if NOT default + \coordinate (ts-hm-b1) at ($(ts-hm-l) + (0,0.5)$);% + \coordinate (ts-hm-b2) at ($(ts-hm-l) + (\labelcoordX,0.25)$);% + \coordinate (ts-hm-l) at ($(ts-hm-l) + (\labelcoordX,\labelcoordY)$);% + }% + %% symbol + \path[draw=\hectometercolor,dashed,shorten <=0.75cm]% + (0,0) -- (ts-hm-b1) -- (ts-hm-b2) -- (ts-hm-l);% + %% label + \ifdefstring{\labelcontent}{}{}{% label NOT empty + \node[font=\sffamily,text=\hectometercolor,rotate=-90,\orientation,align=\align,fill=\background] at (ts-hm-l) {\labelcontent};% + }% + }},% +}% +% +%%%%%%%%%%%%%%% +% symbol messureline +%%%%%%%%%%%%%%% +% +% command +\newcommand\messureline{}% just for safety +\def\messureline{\path[MessureLine]}% \maintrack (coord1) -- (coord2); +% +\tikzset{MessureLine/.style={draw=\hectometercolor,dashed,shorten <=0.75cm,shorten >=0.75cm}}% +% +%%%%%%%%%%%%%%% +% TODO: +% * platform length +% * direction of milage +% +%%%%%%%%%%%%%%% +\endinput% +% \ No newline at end of file diff --git a/src/tikzlibrarytrackschematic.topology.code.tex b/src/tikzlibrarytrackschematic.topology.code.tex index d47ca35..8ca7a66 100644 --- a/src/tikzlibrarytrackschematic.topology.code.tex +++ b/src/tikzlibrarytrackschematic.topology.code.tex @@ -1,41 +1,97 @@ %% symbol library for TikZ track schematics % -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -\ProvidesFileRCS{tikzlibrarytrackschematic.topology.code.tex} - +% +\ProvidesFileRCS{tikzlibrarytrackschematic.topology.code.tex}% +% %%%%%%%%%%%%%%% -% local +% Requirements %%%%%%%%%%%%%%% - -\RequirePackage{etoolbox} -\usetikzlibrary{calc,patterns,arrows.meta} - +\RequirePackage{tikz,etoolbox,lmodern}% +\usetikzlibrary{calc,patterns}% +% +% https://tex.stackexchange.com/questions/56353/extract-x-y-coordinate-of-an-arbitrary-point-on-curve-in-tikz +\providecommand{\gettikzxy}[3]{% + \tikz@scan@one@point\pgfutil@firstofone#1\relax% + \edef#2{\the\pgf@x}% + \edef#3{\the\pgf@y}% +}% +% +%%%%%%%%%%%%%%% +% tikz keys for multiple use +%%%%%%%%%%%%%%% +\pgfkeys{% + /tikz/trackschematic/.is family,% + /tikz/trackschematic/.cd,% + %% color foreground + foreground/.store in=\foreground,% + foreground=black,% DEFAULT + /tikz/foreground/.forward to=/tikz/trackschematic/foreground,% + %% color background + background/.store in=\background,% + background=white,% DEFAULT + /tikz/background/.forward to=/tikz/trackschematic/background,% + %% face + face/.value required,% forward OR backward + face/.store in=\face,% + /tikz/face/.forward to=/tikz/trackschematic/face,% + /tikz/forward/.code={\pgfkeys{/tikz/trackschematic/face=forward}},% + /tikz/backward/.code={\pgfkeys{/tikz/trackschematic/face=backward}},% + /tikz/bidirectional/.code={\pgfkeys{/tikz/trackschematic/face=bidirectional}},% + %% operation + operation mode/.store in=\operationmode,% manual, remote OR none + operation mode=none,% DEFAULT + /tikz/operation/.forward to=/tikz/trackschematic/operation mode,% + %% label + shift label/.store in=\labelcoord,% (coord) + shift label=(none),% DEFAULT + /tikz/shift label/.forward to=/tikz/trackschematic/shift label,% +}% +% +\pgfkeys{% + /tikz/trackschematic/topology/.is family,% + /tikz/trackschematic/topology/.cd,% + %% branch + branch/.value required,% left OR right + branch/.store in=\branch,% left OR right + /tikz/branch/.forward to=/tikz/trackschematic/topology/branch,% + %% fouling point + fouling point/.value forbidden,% + fouling point/.code={\settoggle{fouling_point}{true}},% + /tikz/fouling point/.forward to=/tikz/trackschematic/topology/fouling point,% + %% points + points/.store in=\points,% moving, left, right OR none + points=none,% DEFAULT + /tikz/points/.forward to=/tikz/trackschematic/topology/points,% +}% +% options +\newtoggle{fouling_point}\settoggle{fouling_point}{false}% +% %%%%%%%%%%%%%%% % symbol track %%%%%%%%%%%%%%% - +% % tracks \newcommand\maintrack{}% just for safety -\def\maintrack{\path[draw,MainTrack]}% +\def\maintrack{\path[draw,MainTrack]}% \maintrack (coord1) -- (coord2); \newcommand\secondarytrack{}% just for safety -\def\secondarytrack{\path[draw,SecondaryTrack]}% +\def\secondarytrack{\path[draw,SecondaryTrack]}% \secondarytrack (coord1) -- (coord2); \newcommand\sidetrack{}% just for safety \def\sidetrack{\path[draw,SecondaryTrack]}% alias for \secondarytrack - -\tikzset{MainTrack/.style={line width=2pt,foreground}}% -\tikzset{SecondaryTrack/.style={line width=0.7pt,foreground}}% - +% +\tikzset{MainTrack/.style={line width=2pt,\foreground}}% +\tikzset{SecondaryTrack/.style={line width=0.7pt,\foreground}}% +% %%%%%%%%%%%%%%% % symbol track number %%%%%%%%%%%%%%% - +% %% command \newcommand\tracklabel{}% just for safety -\def\tracklabel#1(#2)#3(#4){% \tracknumber[options] at (coord) label (name); - \pic at (#2) {track_label={#1/#3/#4}};% symbol +\def\tracklabel#1(#2)#3(#4){% \tracklabel at (coord) label (name); + \pic at (#2) {track_label={#1/#3/#4}}% symbol }% %% tikz keys % \pgfkeys{% @@ -46,434 +102,42 @@ \tikzset{% pics/track_label/.default=,% pics/track_label/.style args={#1/#2/#3}{code={% - %% settings - \def\coordcommand{#1} % beware of leading and tailing spaces! - \def\labelcommand{#2} % beware of leading and tailing spaces! - \def\labelcontent{#3} - %% label - \node[fill=background,text=foreground] at (0,0) {\labelcontent};% label - }% - },% -}% - -%%%%%%%%%%%%%%% -% symbol track distance -%%%%%%%%%%%%%%% - -%% command -\newcommand\trackdistance{}% just for safety -\def\trackdistance#1(#2)#3(#4)#5(#6){% \trackdistance between (coord1) and (coord2) label (distance); - \path[draw=background,<->,>={Stealth[foreground,inset=0pt,angle=50:0.3cm]},shorten <=1pt,shorten >=1pt] (#2) -- (#4)% arrow tips - node[baseline=(current bounding box.center),text=foreground,midway,sloped,rotate=90] {#6};% label -}% - -%%%%%%%%%%%%%%% -% symbol turnout -%%%%%%%%%%%%%%% - -% command -\newcommand\turnout{}% just for safety -\def\turnout[#1]#2(#3)#4(#5){% \turnout[type] at (coord) label (name); - \pic[#1] at (#3) {turnout={#2/#4/#5}};% symbol -}% -% options -\newtoggle{fouling_point}\settoggle{fouling_point}{false} -\newtoggle{manual_operated}\settoggle{fouling_point}{false} -% tikz keys -\pgfkeys{% - /tikz/trackschematic/turnout/.is family,% - /tikz/trackschematic/turnout/.cd,% - % - %% branch - branch/.value required,% left OR right - branch/.store in=\branch,% left OR right - /tikz/branch/.forward to=/tikz/trackschematic/turnout/branch,% - % - %% fouling point - fouling point/.value forbidden,% - fouling point/.code={\settoggle{fouling_point}{true}},% - /tikz/fouling point/.forward to=/tikz/trackschematic/turnout/fouling point,% - % - %% points - points/.store in=\points,% moving, left, right OR none - points=none,% moving, left, right OR none - /tikz/points/.forward to=/tikz/trackschematic/turnout/points,% - % - %% manual operated - manual operated/.value forbidden,% - manual operated/.code={\settoggle{manual_operated}{true}},% - /tikz/manual operated/.forward to=/tikz/trackschematic/turnout/manual operated,% - % -}% -% symbol definition -\tikzset{% - pics/turnout/.default=, - pics/turnout/.style args={#1/#2/#3}{code={ %% settings \def\coordcommand{#1} % beware of leading and tailing spaces! \def\labelcommand{#2} % beware of leading and tailing spaces! \def\labelcontent{#3} - %% face setup - \ifdefstring{\face}{forward}{% face - \pgfmathsetmacro{\facefactor}{1}% - }{% - \ifdefstring{\face}{backward}{% face - \pgfmathsetmacro{\facefactor}{-1}% - }{% error message - \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/face}{forward OR backward as key required}} - }% - }% end \ifdefstring{\face} - %% branch setup - \ifdefstring{\branch}{left}{% branch - \ifdefstring{\face}{forward}{% - \pgfmathsetmacro{\branchfactor}{1}% - }{% - \pgfmathsetmacro{\branchfactor}{-1}% - }% - }{% - \ifdefstring{\branch}{right}{% branch - \ifdefstring{\face}{forward}{% - \pgfmathsetmacro{\branchfactor}{-1}% - }{% - \pgfmathsetmacro{\branchfactor}{1}% - }% - }{% error message - \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/turnout/branch}{left OR right as key required}} - }% - }% end \ifdefstring{\branch} - %% turnout marker - \iftoggle{manual_operated}{% manual operated - \ifdefstring{\branch}{left}{% branch - \def\patterntype{north west lines}% - }{% - \def\patterntype{north east lines}% - }% - \path[draw,pattern=\patterntype, pattern color=foreground] (0,0) -- ++($\facefactor*(0.4,0)$) -- ++($\branchfactor*(0,0.4)$) -- cycle;% turnout marker - }{% operated automaticly - \path[fill=foreground] (0,0) -- ++($\facefactor*(0.4,0)$) -- ++($\branchfactor*(0,0.4)$) -- cycle;% turnout marker - }% - % %% label - %TODO - % \ifdefstring{\labelcommand}{label}{% label - \node at ($\branchfactor*(0,-8pt)$) {\footnotesize \labelcontent};% - % }{ - % \node[red] at ($\branchfactor*(0,-8pt)$) {\tiny +\labelcommand+ != +label+};% - % }% - % - %% fouling point indicator - \iftoggle{fouling_point}{% - \path[draw=foreground] ($\facefactor*(0.7,0)$) -- ++($\branchfactor*(0,0.7)$);% fouling point indicator - }{}% - % - %% points - \ifdefstring{\points}{left}{% points left - \ifdefstring{\branch}{left}{% - \path[draw=foreground,line width=1.5pt] ($\facefactor*(-0.035,0) + \branchfactor*(0,0.1)$) -- ++($\branchfactor*(0.2,0.2)$);% - }{% - \path[draw=foreground,line width=1.5pt] ($\facefactor*( 0.035,0.1)$) -- ++($\facefactor*(0.265,0)$);% - }% - }{% - \ifdefstring{\points}{right}{% points right - \ifdefstring{\branch}{left}{% - \path[draw=foreground,line width=1.5pt] ($\facefactor*( 0.035,-0.1)$) -- ++($\facefactor*(0.265,0)$); - }{% - \path[draw=foreground,line width=1.5pt] ($\facefactor*(-0.035,0) + \branchfactor*(0,0.1)$) -- ++($\branchfactor*(-0.2,0.2)$);% - }% - }{% - \ifdefstring{\points}{moving}{% moving points - \fill[foreground] ($\facefactor*(0.075,0) + \branchfactor*(0,-0.1 )$) circle (0.05);% points indicator left - \fill[foreground] ($\facefactor*(0.225,0) + \branchfactor*(0,-0.1 )$) circle (0.05);% points indicator left - \fill[foreground] ($\facefactor*(0.015,0) + \branchfactor*(0, 0.15)$) circle (0.05);% points indicator right - \fill[foreground] ($\facefactor*(0.115,0) + \branchfactor*(0, 0.25)$) circle (0.05);% points indicator right - }{% error message - \ifdefstring{\points}{none}{% - }{% - \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/points}{left, right OR moving as key required}} - }% - }% - }% - }% end \ifdefstring{\points} - % - }},% end pics/turnout/.style args={#1/#2/#3} -}% - - -%%%%%%%%%%%%%%% -% symbol crossing - using parts of turnout -%%%%%%%%%%%%%%% - -\newcommand\crossing{}% just for safety -\def\crossing[#1]#2(#3)#4(#5){% \crossing[type] at (coord) label (name); - \pic[#1] at (#3) {crossing={#2/#4/#5}};% symbol -}% -% symbol definition -\tikzset{% - pics/crossing/.default=, - pics/crossing/.style args={#1/#2/#3}{code={ - %% settings - \def\coordcommand{#1} % beware of leading and tailing spaces! - \def\labelcommand{#2} % beware of leading and tailing spaces! - \def\labelcontent{#3} - %% face setup - %% branch setup - \ifdefstring{\branch}{left}{% branch - \pgfmathsetmacro{\branchfactor}{1}% - }{% - \ifdefstring{\branch}{right}{% branch - \pgfmathsetmacro{\branchfactor}{-1}% - }{% error message - \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/branch}{left OR right as key required}} + \ifdefstring{\labelcontent}{}{}{% label NOT empty + \tikzset{every node/.style={fill=\background,text=\foreground}};% + \coordinate (ts-tl-l) at (0,0);% + \ifdefstring{\labelcoord}{(none)}{% default coord + }{% initialize if NOT default + \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% + \coordinate (ts-tl-l) at ($(ts-tl-l)+(\labelcoordX,\labelcoordY)$);% }% + \node at (ts-tl-l) {\labelcontent};% }% - % - %% crossing marker - \path[draw=foreground] (0,0) -- ++( 0.4,0) -- ++($\branchfactor*(0, 0.4)$) -- cycle;% turnout marker - \path[draw=foreground] (0,0) -- ++(-0.4,0) -- ++($\branchfactor*(0,-0.4)$) -- cycle;% turnout marker - % - %% label - %TODO - % \ifdefstring{\labelcommand}{label}{% label - \node[right] at ($(2pt,0) + \branchfactor*(0,-9pt)$) {\footnotesize \labelcontent};% - % }{ - % \node[red] at ($\branchfactor*(0,-8pt)$) {\tiny +\labelcommand+ != +label+};% - % }% - % - %% fouling point indicator - \iftoggle{fouling_point}{% - \path[draw=foreground] ( 0.7,0) -- ++($\branchfactor*(0, 0.7)$);% fouling point indicator - \path[draw=foreground] (-0.7,0) -- ++($\branchfactor*(0,-0.7)$);% fouling point indicator - }{}% - % - }},% end of pics/crossing/.style args={#1/#2/#3}{ -}% - -%%%%%%%%%%%%%%% -% symbol slip switch turnout - using parts of turnout -%%%%%%%%%%%%%%% - -\newcommand\slipturnout{}% just for safety -\def\slipturnout[#1]#2(#3)#4(#5)(#6){% \crossing[type] at (coord) label (name); - \pic[slip=double,#1] at (#3) {slipturnout={#2/#4/#5/#6}};% symbol -}% -% tikz keys -\pgfkeys{% - /tikz/trackschematic/slipturnout/.is family,% - /tikz/trackschematic/slipturnout/.cd,% - % - %% points - forward points/.store in=\forwardpoints,% moving, left, right OR none - forward points=none,% moving, left, right OR none - /tikz/forward points/.forward to=/tikz/trackschematic/slipturnout/forward points,% - backward points/.store in=\backwardpoints,% moving, left, right OR none - backward points=none,% moving, left, right OR none - /tikz/backward points/.forward to=/tikz/trackschematic/slipturnout/backward points,% - % - %% slips - slip/.store in=\slip,% double, left, right OR none - slip=none,% double, left, right OR none - /tikz/slip/.forward to=/tikz/trackschematic/slipturnout/slip,% - % -}% -% symbol definition -\tikzset{% - pics/slipturnout/.default=, - pics/slipturnout/.style args={#1/#2/#3/#4}{code={ - %% settings - \def\coordcommand{#1} % beware of leading and tailing spaces! - \def\labelcommand{#2} % beware of leading and tailing spaces! - \def\labelcontentA{#3} - \def\labelcontentB{#4} - %% branch setup - \ifdefstring{\branch}{left}{% branch - \pgfmathsetmacro{\branchfactor}{1}% - }{% - \ifdefstring{\branch}{right}{% branch - \pgfmathsetmacro{\branchfactor}{-1}% - }{% error message - \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/turnout/branch}{left OR right as key required}} - }% - }% end \ifdefstring{\branch} - %% turnout marker - \iftoggle{manual_operated}{% manual operated - \ifdefstring{\branch}{left}{% branch - \def\patterntype{north west lines}% - }{% - \def\patterntype{north east lines}% - }% - \path[draw,pattern=\patterntype, pattern color=foreground] (0,0) -- ++($( 0.4,0)$) -- ++($\branchfactor*(0, 0.4)$) -- cycle;% turnout marker - \path[draw,pattern=\patterntype, pattern color=foreground] (0,0) -- ++($(-0.4,0)$) -- ++($\branchfactor*(0,-0.4)$) -- cycle;% turnout marker - }{% operated automaticly - \path[fill=foreground] (0,0) -- ++($( 0.4,0)$) -- ++($\branchfactor*(0, 0.4)$) -- cycle;% turnout marker - \path[fill=foreground] (0,0) -- ++($(-0.4,0)$) -- ++($\branchfactor*(0,-0.4)$) -- cycle;% turnout marker - } - % - %% label - %TODO - % \ifdefstring{\labelcommand}{label}{% label - \node[right] at ($(2pt,0) + \branchfactor*(0,-9pt)$) {\footnotesize \labelcontentA};% - \node[left] at ($(2pt,0) + \branchfactor*(0,10pt)$) {\footnotesize \labelcontentB};% - % }{ - % \node[red] at ($\branchfactor*(0,-8pt)$) {\tiny +\labelcommand+ != +label+};% - % }% - % - %% fouling point indicator - \iftoggle{fouling_point}{% - \path[draw=foreground] ( 0.7,0) -- ++($\branchfactor*(0, 0.7)$);% fouling point indicator - \path[draw=foreground] (-0.7,0) -- ++($\branchfactor*(0,-0.7)$);% fouling point indicator - }{}% - % - %% points - \ifdefstring{\forwardpoints}{left}{% points left - \ifdefstring{\branch}{left}{% - \path[draw=foreground,line width=1.5pt] (-0.035,0.1) -- ++(0.2,0.2);% - }{% - \path[draw=foreground,line width=1.5pt] ( 0.035,0.1) -- ++(0.265,0);% - }% - }{% - \ifdefstring{\forwardpoints}{right}{% points right - \ifdefstring{\branch}{left}{% - \path[draw=foreground,line width=1.5pt] ( 0.035,-0.1) -- ++(0.265,0); - }{% - \path[draw=foreground,line width=1.5pt] (-0.035,-0.1) -- ++(0.2,-0.2);% - }% - }{% - \ifdefstring{\forwardpoints}{moving}{% moving points - \fill[foreground] ($(0.075,0) + \branchfactor*(0,-0.1 )$) circle (0.05);% points indicator left - \fill[foreground] ($(0.225,0) + \branchfactor*(0,-0.1 )$) circle (0.05);% points indicator left - \fill[foreground] ($(0.015,0) + \branchfactor*(0, 0.15)$) circle (0.05);% points indicator right - \fill[foreground] ($(0.115,0) + \branchfactor*(0, 0.25)$) circle (0.05);% points indicator right - }{% error message - \ifdefstring{\forwardpoints}{none}{% - }{% - \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/slipturnout/forward points}{left, right OR moving as key required}} - }% - }% - }% - }% end of \ifdefstring{\forwardpoints} - \ifdefstring{\backwardpoints}{left}{% points left - \ifdefstring{\branch}{left}{% - \path[draw=foreground,line width=1.5pt] (0.035,-0.1) -- ++(-0.2,-0.2);% - }{% - \path[draw=foreground,line width=1.5pt] (-0.035,-0.1) -- ++(-0.265,0);% - }% - }{% - \ifdefstring{\backwardpoints}{right}{% points right - \ifdefstring{\branch}{left}{% - \path[draw=foreground,line width=1.5pt] (-0.035,0.1) -- ++(-0.265,0); - }{% - \path[draw=foreground,line width=1.5pt] (0.035,0.1) -- ++(-0.2,0.2);% - }% - }{% - \ifdefstring{\backwardpoints}{moving}{% moving points - \fill[foreground] ($(-0.075,0) + \branchfactor*(0, 0.1 )$) circle (0.05);% points indicator left - \fill[foreground] ($(-0.225,0) + \branchfactor*(0, 0.1 )$) circle (0.05);% points indicator left - \fill[foreground] ($(-0.015,0) + \branchfactor*(0,-0.15)$) circle (0.05);% points indicator right - \fill[foreground] ($(-0.115,0) + \branchfactor*(0,-0.25)$) circle (0.05);% points indicator right - }{% error message - \ifdefstring{\backwardpoints}{none}{% - }{% - \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/slipturnout/forward points}{left, right OR moving as key required}} - }% - }% - }% - }% end of \ifdefstring{\backwardpoints} - % - %% slips - \ifdefstring{\slip}{double}{% slip - \path[draw=foreground,line width=0.75pt] ($\branchfactor*(-0.4,0) + (0, 0.1)$) -- ($\branchfactor*( 0.3,0) + (0, 0.4)$);% slip - \path[draw=foreground,line width=0.75pt] ($\branchfactor*( 0.4,0) + (0,-0.1)$) -- ($\branchfactor*(-0.3,0) + (0,-0.4)$);% slip - }{% - \ifdefstring{\slip}{left}{% - \path[draw=foreground,line width=0.75pt] ($\branchfactor*(-0.4,0) + (0,0.1)$) -- ($\branchfactor*(0.3,0) + (0,0.4)$);% slip - }{% - \ifdefstring{\slip}{right}{% - \path[draw=foreground,line width=0.75pt] ($\branchfactor*(0.4,0) + (0,-0.1)$) -- ($\branchfactor*(-0.3,0) + (0,-0.4)$);% slip - }{% - \ifdefstring{\slip}{none}{% - % - }{%error message - \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/slipturnout/slip}{double, left, right OR none as key required}} - }% - }% - }% - }% - % - }},% end of pics/slipturnout/.style args={#1/#2/#3/#4}{ -}% - - -%%%%%%%%%%%%%%% -% symbol derailer -%%%%%%%%%%%%%%% - -% command -\newcommand\derailer{}% just for safety -\def\derailer[#1]#2(#3)#4(#5){% \bufferstop[options] at (coord) label (name); - \pic[#1] at (#3) {derailer={#2/#4/#5}};% symbol -}% -% symbol definition -\tikzset{% - pics/derailer/.default=,% - pics/derailer/.style args={#1/#2/#3}{code={% - %% settings - \def\coordcommand{#1} % beware of leading and tailing spaces! - \def\labelcommand{#2} % beware of leading and tailing spaces! - \def\labelcontent{#3} - %% face setup - \ifdefstring{\face}{forward}{% face - \pgfmathsetmacro{\facefactor}{1}% - }{% - \ifdefstring{\face}{backward}{% face - \pgfmathsetmacro{\facefactor}{-1}% - }{% error message - \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/face}{forward OR backward as key required}} - }% - }% end \ifdefstring{\face} - %% branch setup - \ifdefstring{\branch}{left}{% branch - \ifdefstring{\face}{forward}{% - \pgfmathsetmacro{\branchfactor}{1}% - }{% - \pgfmathsetmacro{\branchfactor}{-1}% - }% - }{% - \ifdefstring{\branch}{right}{% branch - \ifdefstring{\face}{forward}{% - \pgfmathsetmacro{\branchfactor}{-1}% - }{% - \pgfmathsetmacro{\branchfactor}{1}% - }% - }{% error message - \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/turnout/branch}{left OR right as key required}} - }% - }% end \ifdefstring{\branch} - %% symbol - \path[draw=foreground, line width=1pt] (0,0.2) -- ++(0,-0.4); % derailer marker - \path[draw=foreground,->,>=latex,line width=1pt,dashed] (0,0) -- ++($\facefactor*(0.4,0) + \branchfactor*(0,0.4)$); % derailer arrow }},% }% - +% %%%%%%%%%%%%%%% % symbol buffer stop %%%%%%%%%%%%%%% - +% % command \newcommand\bufferstop{}% just for safety \def\bufferstop[#1]#2(#3){% \bufferstop[options] at (coord); - \pic[#1] at (#3) {bufferstop={#2}};% symbol + \pic[#1] at (#3) {bufferstop={#2}}% symbol }% -\newlength{\friction}\setlength{\friction}{0cm} +\newlength{\friction}\setlength{\friction}{0.5cm} % tikz keys \pgfkeys{% - /tikz/trackschematic/bufferstop/.is family,% - /tikz/trackschematic/bufferstop/.cd,% - % - %% points + /tikz/trackschematic/topology/bufferstop/.is family,% + /tikz/trackschematic/topology/bufferstop/.cd,% + %% friction friction/.store in=\friction,% length OR none friction=none,% length OR none - /tikz/friction/.forward to=/tikz/trackschematic/bufferstop/friction,% - % + /tikz/friction/.forward to=/tikz/trackschematic/topology/bufferstop/friction,% }% % symbol definition \tikzset{% @@ -488,17 +152,444 @@ \ifdefstring{\face}{backward}{% face \pgfmathsetmacro{\facefactor}{-1}% }{% error message - \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/face}{forward OR backward as key required}} + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/face}{“forward“ OR “backward“ as key required}}% }% }% end \ifdefstring{\face} %% symbol \ifdefstring{\friction}{none}{% friction - \path[draw=foreground, line width=1pt] ($\facefactor*(-0.1,0) + (0,0.2)$) -- ++($\facefactor*( 0.1,0)$) -- ++(0,-0.4) -- ++ ($\facefactor*(-0.1,0)$); % bufferstop marker + \path[draw=\foreground, line width=1pt] ($\facefactor*(-0.1,0) + (0,0.2)$) -- ++($\facefactor*( 0.1,0)$) -- ++(0,-0.4) -- ++ ($\facefactor*(-0.1,0)$); % bufferstop marker }{ - \path[draw=foreground, line width=1pt] ($\facefactor*(-\friction,0) + \facefactor*( 0.1,0) + (0,0.2)$) -- ++($\facefactor*(-0.1,0)$) -- ++(0,-0.4) -- ++ ($\facefactor*( 0.1,0)$); % bufferstop marker + \path[draw=\foreground, line width=1pt] ($\facefactor*(-\friction,0) + \facefactor*( 0.1,0) + (0,0.2)$) -- ++($\facefactor*(-0.1,0)$) -- ++(0,-0.4) -- ++ ($\facefactor*( 0.1,0)$); % bufferstop marker + \fill[\foreground] (0,0) circle (0.06);% track closure indicator } }},% }% - +% %%%%%%%%%%%%%%% -\endinput +% symbol track closure +%%%%%%%%%%%%%%% +% +%% command +\newcommand\trackclosure{}% just for safety +\def\trackclosure#1(#2){% \trackclosure at (coord); + \pic at (#2) {track_closure={#1}}% symbol +}% +\tikzset{% + pics/track_closure/.default=,% + pics/track_closure/.style args={#1}{code={% + %% settings + \def\coordcommand{#1} % beware of leading and tailing spaces! + %% + \fill[\foreground] (0,0) circle (0.06);% track closure indicator + % \path[fill=\foreground] (0.04,0.02) -- (0.04,-0.02) -- (0.02,-0.04) -- (-0.02,-0.04) -- (-0.04,-0.02) -- (-0.04,0.02) -- (-0.02,0.04) -- (0.02,0.04) -- cycle;% label + }},% end pics/track_closure/.style args={#1} +}% +% +%%%%%%%%%%%%%%% +% symbol turnout +%%%%%%%%%%%%%%% +% +% command +\newcommand\turnout{}% just for safety +\def\turnout[#1]#2(#3)#4(#5){% \turnout[options] at (coord) label (name); + \pic[operation=remote,#1] at (#3) {turnout={#2/#4/#5}}% symbol +}% +% tikz keys +\pgfkeys{% + /tikz/trackschematic/topology/turnout/.is family,% + /tikz/trackschematic/topology/turnout/.cd,% + %% points + points/.store in=\points,% moving, left, right OR none + points=none,% moving, left, right OR none + /tikz/points/.forward to=/tikz/trackschematic/topology/turnout/points,% +}% +% symbol definition +\tikzset{% + pics/turnout/.default=,% + pics/turnout/.style args={#1/#2/#3}{code={% + %% settings + \def\coordcommand{#1}% beware of leading and tailing spaces! + \def\labelcommand{#2}% beware of leading and tailing spaces! + \def\labelcontent{#3}% + %% face setup + \ifdefstring{\face}{forward}{% face + \pgfmathsetmacro{\facefactor}{1}% + }{% + \ifdefstring{\face}{backward}{% face + \pgfmathsetmacro{\facefactor}{-1}% + }{% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/face}{“forward“ OR “backward“ as key required}}% + }% + }% end \ifdefstring{\face} + %% branch setup + \ifdefstring{\branch}{left}{% branch + \pgfmathsetmacro{\branchfactor}{1}% + }{% + \ifdefstring{\branch}{right}{% branch + \pgfmathsetmacro{\branchfactor}{-1}% + }{% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/topology/branch}{“left“ OR “right“ as key required}}% + }% + }% end \ifdefstring{\branch} + %% turnout marker + \ifdefstring{\operationmode}{manual}{% operation=manual + \ifdefstring{\face}{forward}{% + \ifdefstring{\branch}{left}{% branch + \def\patterntype{north west lines}% + }{% + \def\patterntype{north east lines}% + }% + }{% + \ifdefstring{\branch}{right}{% branch + \def\patterntype{north west lines}% + }{% + \def\patterntype{north east lines}% + }% + }% + \path[draw=\foreground,pattern=\patterntype, pattern color=\foreground] (0,0) -- ++($\facefactor*(0.4,0)$) -- ++($\branchfactor*(0,0.4)$) -- cycle;% turnout marker + }{% + \ifdefstring{\operationmode}{remote}{% operation=remote + \path[fill=\foreground] (0,0) -- ++($\facefactor*(0.4,0)$) -- ++($\branchfactor*(0,0.4)$) -- cycle;% turnout marker + }{% + \ifdefstring{\operationmode}{none}{ + \path[draw=\foreground] (0,0) -- ++($\facefactor*(0.4,0)$) -- ++($\branchfactor*(0,0.4)$) -- cycle;% turnout marker + }{% + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/operation}{“manual“, “remote“ OR “none“ as key required}}% + }% + } + }% + % + %% label + \ifdefstring{\labelcontent}{}{}{% label NOT empty + \tikzset{every node/.style={text=\foreground}};% + \coordinate (ts-y-l) at ($\branchfactor*(0,-8pt)$);% + \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default + \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% + \coordinate (ts-y-l) at ($(ts-y-l)+(\labelcoordX,\labelcoordY)$);% + }% + \node at (ts-y-l) {\footnotesize \labelcontent};% + }% + % + %% fouling point indicator + \iftoggle{fouling_point}{% + \path[draw=\foreground] ($\facefactor*(0.7,0)$) -- ++($\branchfactor*(0,0.7)$);% fouling point indicator + }{}% + % + %% points + \ifdefstring{\points}{left}{% points left + \ifdefstring{\branch}{left}{% + \path[draw=\foreground,line width=1.5pt] ($\facefactor*(-0.035,0)+(0,0.1)$) -- ++($\facefactor*(0.2,0)+(0,0.2)$);% + }{% + \path[draw=\foreground,line width=1.5pt] ($\facefactor*( 0.035,0)+(0,0.1)$) -- ++($\facefactor*( 0.265,0 )$);% + }% + }{% + \ifdefstring{\points}{right}{% points right + \ifdefstring{\branch}{left}{% + \path[draw=\foreground,line width=1.5pt] ($\facefactor*( 0.035,0)+(0,-0.1)$) -- ++($\facefactor*( 0.265,0 )$);% + }{% + \path[draw=\foreground,line width=1.5pt] ($\facefactor*(-0.035,0)+(0,-0.1)$) -- ++($\facefactor*(0.2,0)+(0,-0.2)$);% + }% + }{% + \ifdefstring{\points}{moving}{% moving points + \fill[\foreground] ($\facefactor*(0.075,0) + \branchfactor*(0,-0.1 )$) circle (0.05);% points indicator left + \fill[\foreground] ($\facefactor*(0.225,0) + \branchfactor*(0,-0.1 )$) circle (0.05);% points indicator left + \fill[\foreground] ($\facefactor*(0.015,0) + \branchfactor*(0, 0.15)$) circle (0.05);% points indicator right + \fill[\foreground] ($\facefactor*(0.115,0) + \branchfactor*(0, 0.25)$) circle (0.05);% points indicator right + }{% error message + \ifdefstring{\points}{none}{% + }{% + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/topology/turnout/points}{“left“, “right“ OR “moving“ as key required}}% + }% + }% + }% + }% end \ifdefstring{\points} + % + }},% end pics/turnout/.style args={#1/#2/#3} +}% +% +%%%%%%%%%%%%%%% +% symbol slip switch turnout - using parts of turnout +%%%%%%%%%%%%%%% +% +\newcommand\slipturnout{}% just for safety +\def\slipturnout[#1]#2(#3)#4(#5)(#6){% \slipturnout[options] at (coord) label (name1)(name2); + \pic[operation=remote,slip=double,#1] at (#3) {slipturnout={#2/#4/#5/#6}}% symbol +}% +% tikz keys +\pgfkeys{% + /tikz/trackschematic/topology/slipturnout/.is family,% + /tikz/trackschematic/topology/slipturnout/.cd,% + %% points + forward points/.store in=\forwardpoints,% moving, left, right OR none + forward points=none,% moving, left, right OR none + /tikz/forward points/.forward to=/tikz/trackschematic/topology/slipturnout/forward points,% + backward points/.store in=\backwardpoints,% moving, left, right OR none + backward points=none,% moving, left, right OR none + /tikz/backward points/.forward to=/tikz/trackschematic/topology/slipturnout/backward points,% + %% slips + slip/.store in=\slip,% double, left, right OR none + slip=none,% double, left, right OR none + /tikz/slip/.forward to=/tikz/trackschematic/topology/slipturnout/slip,% +}% +% symbol definition +\tikzset{% + pics/slipturnout/.default=,% + pics/slipturnout/.style args={#1/#2/#3/#4}{code={% + %% settings + \def\coordcommand{#1}% beware of leading and tailing spaces! + \def\labelcommand{#2}% beware of leading and tailing spaces! + \def\labelcontentleft{#3}% + \def\labelcontentright{#4}% + %% branch setup + \ifdefstring{\branch}{left}{% branch + \pgfmathsetmacro{\branchfactor}{1}% + }{% + \ifdefstring{\branch}{right}{% branch + \pgfmathsetmacro{\branchfactor}{-1}% + }{% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/topology/branch}{“left“ OR “right“ as key required}}% + }% + }% end \ifdefstring{\branch} + %% turnout marker + \ifdefstring{\operationmode}{manual}{% operation=manual + \ifdefstring{\branch}{left}{% branch + \def\patterntype{north west lines}% + }{% + \def\patterntype{north east lines}% + }% + \path[draw,pattern=\patterntype, pattern color=\foreground] (0,0) -- ++($( 0.4,0)$) -- ++($\branchfactor*(0, 0.4)$) -- cycle;% turnout marker + \path[draw,pattern=\patterntype, pattern color=\foreground] (0,0) -- ++($(-0.4,0)$) -- ++($\branchfactor*(0,-0.4)$) -- cycle;% turnout marker + }{% operated automaticly + \ifdefstring{\operationmode}{remote}{% operation=remote + \path[fill=\foreground] (0,0) -- ++($( 0.4,0)$) -- ++($\branchfactor*(0, 0.4)$) -- cycle;% turnout marker + \path[fill=\foreground] (0,0) -- ++($(-0.4,0)$) -- ++($\branchfactor*(0,-0.4)$) -- cycle;% turnout marker + }{% + \ifdefstring{\operationmode}{none}{}{% + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/operation}{“manual“, “remote“ OR “none“ as key required}}% + }% + }% + }% + % + %% label + \tikzset{every node/.style={text=\foreground}};% + \ifdefstring{\labelcontentleft}{}{}{% label NOT empty + \coordinate (ts-sy-l1) at ($(2pt,0) + \branchfactor*(0, 10pt)$);% + \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default + \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% + \coordinate (ts-sy-l1) at ($(ts-sy-l1)+(\labelcoordX,\labelcoordY)$);% + }% + \node[left] at (ts-sy-l1) {\footnotesize \labelcontentleft};% + }% + \ifdefstring{\labelcontentright}{}{}{% label NOT empty + \coordinate (ts-sy-l2) at ($(2pt,0) + \branchfactor*(0,-10pt)$);% + \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default + \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% + \coordinate (ts-sy-l2) at ($(ts-sy-l2)-(\labelcoordX,\labelcoordY)$);% + }% + \node[right] at (ts-sy-l2) {\footnotesize \labelcontentright};% + }% + % + %% fouling point indicator + \iftoggle{fouling_point}{% + \path[draw=\foreground] ( 0.7,0) -- ++($\branchfactor*(0, 0.7)$);% fouling point indicator + \path[draw=\foreground] (-0.7,0) -- ++($\branchfactor*(0,-0.7)$);% fouling point indicator + }{}% + % + %% points + \ifdefstring{\forwardpoints}{left}{% points left + \ifdefstring{\branch}{left}{% + \path[draw=\foreground,line width=1.5pt] (-0.035,0.1) -- ++(0.2,0.2);% + }{% + \path[draw=\foreground,line width=1.5pt] ( 0.035,0.1) -- ++(0.265,0);% + }% + }{% + \ifdefstring{\forwardpoints}{right}{% points right + \ifdefstring{\branch}{left}{% + \path[draw=\foreground,line width=1.5pt] ( 0.035,-0.1) -- ++(0.265,0); + }{% + \path[draw=\foreground,line width=1.5pt] (-0.035,-0.1) -- ++(0.2,-0.2);% + }% + }{% + \ifdefstring{\forwardpoints}{moving}{% moving points + \fill[\foreground] ($(0.075,0) + \branchfactor*(0,-0.1 )$) circle (0.05);% points indicator left + \fill[\foreground] ($(0.225,0) + \branchfactor*(0,-0.1 )$) circle (0.05);% points indicator left + \fill[\foreground] ($(0.015,0) + \branchfactor*(0, 0.15)$) circle (0.05);% points indicator right + \fill[\foreground] ($(0.115,0) + \branchfactor*(0, 0.25)$) circle (0.05);% points indicator right + }{% error message + \ifdefstring{\forwardpoints}{none}{% + }{% + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/topology/slipturnout/forward points}{“left“, “right“ OR “moving“ as key required}}% + }% + }% + }% + }% end of \ifdefstring{\forwardpoints} + \ifdefstring{\backwardpoints}{left}{% points left + \ifdefstring{\branch}{left}{% + \path[draw=\foreground,line width=1.5pt] (0.035,-0.1) -- ++(-0.2,-0.2);% + }{% + \path[draw=\foreground,line width=1.5pt] (-0.035,-0.1) -- ++(-0.265,0);% + }% + }{% + \ifdefstring{\backwardpoints}{right}{% points right + \ifdefstring{\branch}{left}{% + \path[draw=\foreground,line width=1.5pt] (-0.035,0.1) -- ++(-0.265,0); + }{% + \path[draw=\foreground,line width=1.5pt] (0.035,0.1) -- ++(-0.2,0.2);% + }% + }{% + \ifdefstring{\backwardpoints}{moving}{% moving points + \fill[\foreground] ($(-0.075,0) + \branchfactor*(0, 0.1 )$) circle (0.05);% points indicator left + \fill[\foreground] ($(-0.225,0) + \branchfactor*(0, 0.1 )$) circle (0.05);% points indicator left + \fill[\foreground] ($(-0.015,0) + \branchfactor*(0,-0.15)$) circle (0.05);% points indicator right + \fill[\foreground] ($(-0.115,0) + \branchfactor*(0,-0.25)$) circle (0.05);% points indicator right + }{% error message + \ifdefstring{\backwardpoints}{none}{% + }{% + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/topology/slipturnout/forward points}{“left“, “right“ OR “moving“ as key required}}% + }% + }% + }% + }% end of \ifdefstring{\backwardpoints} + % + %% slips + \ifdefstring{\slip}{double}{% slip + \path[draw=\foreground,line width=0.75pt] ($\branchfactor*(-0.4,0) + (0, 0.1)$) -- ($\branchfactor*( 0.3,0) + (0, 0.4)$);% slip + \path[draw=\foreground,line width=0.75pt] ($\branchfactor*( 0.4,0) + (0,-0.1)$) -- ($\branchfactor*(-0.3,0) + (0,-0.4)$);% slip + }{% + \ifdefstring{\slip}{left}{% + \path[draw=\foreground,line width=0.75pt] ($\branchfactor*(-0.4,0) + (0,0.1)$) -- ($\branchfactor*(0.3,0) + (0,0.4)$);% slip + }{% + \ifdefstring{\slip}{right}{% + \path[draw=\foreground,line width=0.75pt] ($\branchfactor*(0.4,0) + (0,-0.1)$) -- ($\branchfactor*(-0.3,0) + (0,-0.4)$);% slip + }{% + \ifdefstring{\slip}{none}{% + % + }{%error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/topology/slipturnout/slip}{“double“, “left“, “right“ OR “none“ as key required}}% + }% + }% + }% + }% + % + }},% end of pics/slipturnout/.style args={#1/#2/#3/#4}{ +}% +% +%%%%%%%%%%%%%%% +% symbol crossing - using parts of turnout +%%%%%%%%%%%%%%% +% +\newcommand\crossing{}% just for safety +\def\crossing[#1]#2(#3)#4(#5){% \crossing[options] at (coord) label (name); + \pic[#1] at (#3) {crossing={#2/#4/#5}}% symbol +}% +% symbol definition +\tikzset{% + pics/crossing/.default=,% + pics/crossing/.style args={#1/#2/#3}{code={% + %% settings + \def\coordcommand{#1}% beware of leading and tailing spaces! + \def\labelcommand{#2}% beware of leading and tailing spaces! + \def\labelcontent{#3}% + %% face setup + %% branch setup + \ifdefstring{\branch}{left}{% branch + \pgfmathsetmacro{\branchfactor}{1}% + }{% + \ifdefstring{\branch}{right}{% branch + \pgfmathsetmacro{\branchfactor}{-1}% + }{% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/topology/branch}{“left“ OR “right“ as key required}}% + }% + }% + % + %% crossing marker + \path[draw=\foreground] (0,0) -- ++( 0.4,0) -- ++($\branchfactor*(0, 0.4)$) -- cycle;% turnout marker + \path[draw=\foreground] (0,0) -- ++(-0.4,0) -- ++($\branchfactor*(0,-0.4)$) -- cycle;% turnout marker + % + %% label + \ifdefstring{\labelcontent}{}{}{% label NOT empty + \tikzset{every node/.style={text=\foreground}};% + \coordinate (ts-x-l) at ($(2pt,0) + \branchfactor*(0,-9pt)$);% + \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default + \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% + \coordinate (ts-x-l) at ($(ts-x-l)+(\labelcoordX,\labelcoordY)$);% + }% + \node[right] at (ts-x-l) {\footnotesize \labelcontent};% + }% + % + %% fouling point indicator + \iftoggle{fouling_point}{% + \path[draw=\foreground] ( 0.7,0) -- ++($\branchfactor*(0, 0.7)$);% fouling point indicator + \path[draw=\foreground] (-0.7,0) -- ++($\branchfactor*(0,-0.7)$);% fouling point indicator + }{}% + % + }},% end of pics/crossing/.style args={#1/#2/#3}{ +}% +% +%%%%%%%%%%%%%%% +% symbol derailer +%%%%%%%%%%%%%%% +% +% command +\newcommand\derailer{}% just for safety +\def\derailer[#1]#2(#3)#4(#5){% \derailer[options] at (coord) label (name); + \pic[#1] at (#3) {derailer={#2/#4/#5}}% symbol +}% +% symbol definition +\tikzset{% + pics/derailer/.default=,% + pics/derailer/.style args={#1/#2/#3}{code={% + %% settings + \def\coordcommand{#1}% beware of leading and tailing spaces! + \def\labelcommand{#2}% beware of leading and tailing spaces! + \def\labelcontent{#3}% + %% face setup + \ifdefstring{\face}{forward}{% face + \pgfmathsetmacro{\facefactor}{1}% + }{% + \ifdefstring{\face}{backward}{% face + \pgfmathsetmacro{\facefactor}{-1}% + }{% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/face}{“forward“ OR “backward“ as key required}}% + }% + }% end \ifdefstring{\face} + %% branch setup + \ifdefstring{\branch}{left}{% branch + \ifdefstring{\face}{forward}{% + \pgfmathsetmacro{\branchfactor}{1}% + }{% + \pgfmathsetmacro{\branchfactor}{-1}% + }% + }{% + \ifdefstring{\branch}{right}{% branch + \ifdefstring{\face}{forward}{% + \pgfmathsetmacro{\branchfactor}{-1}% + }{% + \pgfmathsetmacro{\branchfactor}{1}% + }% + }{% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/topology/branch}{“left“ OR “right“ as key required}}% + }% + }% end \ifdefstring{\branch} + % + %% symbol + \path[draw=\foreground, line width=1pt] (0,0.1) -- ++(0,-0.2);% derailer marker + \path[draw=\foreground,->,>=latex,line width=1pt,dashed] (0,0) -- ++($\facefactor*(0.4,0) + \branchfactor*(0,0.4)$);% derailer arrow + % + %% label + \ifdefstring{\labelcontent}{}{}{% label NOT empty + \tikzset{every node/.style={text=\foreground}};% + \coordinate (ts-dr-l) at ($\branchfactor*(0,-10pt)$);% + \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default + \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% + \coordinate (ts-dr-l) at ($(ts-dr-l)+(\labelcoordX,\labelcoordY)$);% + }% + \node[right] at (ts-dr-l) {\footnotesize \labelcontent};% + }% + % + }},% +}% +% +%%%%%%%%%%%%%%% +\endinput% +% \ No newline at end of file diff --git a/src/tikzlibrarytrackschematic.trafficcontrol.code.tex b/src/tikzlibrarytrackschematic.trafficcontrol.code.tex index 52577c4..4d32c17 100644 --- a/src/tikzlibrarytrackschematic.trafficcontrol.code.tex +++ b/src/tikzlibrarytrackschematic.trafficcontrol.code.tex @@ -1,388 +1,606 @@ %% symbol library for TikZ track schematics % -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -\ProvidesFileRCS{tikzlibrarytrackschematic.trafficcontrol.code.tex} - -\colorlet{background}{white} -\colorlet{foreground}{black} - -\tikzset{ - train_berth_sign_forward/.pic={ - \path[draw=foreground,line width=1pt] (0,0) -- ++(0,-0.4) -- ++(0.3,0); % signal pole - { % signal marker - \path[draw=foreground,line width=1pt] (0.3,-0.575) rectangle ++(0.5,0.35); - \path[draw=foreground,line width=0.75pt] (0.375,-0.3) -- ++(0.35,0); - \path[draw=foreground,line width=0.75pt] (0.55,-0.5) -- ++(0,0.2); - \path[draw=foreground,line width=0.75pt] (0.375,-0.5) -- ++(0.35,0); - } - }; -} - -\tikzset{ - train_berth_sign_backward/.pic={ - \path[draw=foreground,line width=1pt] (0,0) -- ++(0,0.4) -- ++(-0.3,0); % signal pole - { % signal marker - \path[draw=foreground,line width=1pt] (-0.3,0.575) rectangle ++(-0.5,-0.35); - \path[draw=foreground,line width=0.75pt] (-0.375,0.3) -- ++(-0.35,0); - \path[draw=foreground,line width=0.75pt] (-0.55,0.5) -- ++(0,-0.2); - \path[draw=foreground,line width=0.75pt] (-0.375,0.5) -- ++(-0.35,0); - } - }; -} - -\tikzset{ - pics/train_berth_shape/.default=4, - pics/train_berth_shape/.style n args={1}{ - code={ - \path[draw=foreground,line width=0.75pt,densely dotted] (0, 0.25) -- (0, 0.35) -- (#1, 0.35) -- ++(0,-0.1); % berth shape - \path[draw=foreground,line width=0.75pt,densely dotted] (0,-0.25) -- (0,-0.35) -- (#1,-0.35) -- ++(0, 0.1); % berth shape - } - }, -} - -\tikzset{ - pics/train_berth_shape/.default=4, - pics/train_berth_shape_forward/.style n args={1}{ - code={ - \path[draw=foreground,line width=0.75pt,densely dotted] (0,-0.25) -- (0,-0.35) -- (#1,-0.35) -- ++(0, 0.1); % berth shape - } - }, -} - -\tikzset{ - pics/train_berth_shape/.default=4, - pics/train_berth_shape_backward/.style n args={1}{ - code={ - \path[draw=foreground,line width=0.75pt,densely dotted] (0, 0.25) -- (0, 0.35) -- (#1, 0.35) -- ++(0,-0.1); % berth shape - } - }, -} - -\tikzset{ - view_point_forward/.pic={ - \path[draw=foreground,<-,>=latex,line width=1pt] (0,-0.1) -- ++(0,-0.3) -- ++(0.2,0); % arrow - { % eye - \filldraw[foreground] (0.4,-0.4) circle (0.1); - \path[draw=foreground, line width=1pt] - (0.4,-0.15) .. controls (0.25,-0.25) and (0.25,-0.55) .. (0.4,-0.65) .. controls (0.55,-0.55) and (0.55,-0.25) .. (0.4,-0.15)--cycle; - } - }; -} - -\tikzset{ - view_point_backward/.pic={ - \path[draw=foreground,<-,>=latex,line width=1pt] (0,0.1) -- ++(0,0.3) -- ++(-0.2,0); % arrow - { % eye - \filldraw[foreground] (-0.4,0.4) circle (0.1); - \path[draw=foreground, line width=1pt] - (-0.4,0.15) .. controls (-0.25,0.25) and (-0.25,0.55) .. (-0.4,0.65) .. controls (-0.55,0.55) and (-0.55,0.25) .. (-0.4,0.15)--cycle; - } - }; -} - -\tikzset{ - pics/distant_signal_forward/.default=, - pics/distant_signal_forward/.style args={#1}{ - code={ - \path[draw=foreground,line width=1pt] (0,0) -- ++(0,-0.4) -- ++(0.4,0); % signal pole - \path[draw=foreground,fill=background,line width=1pt] (0.7,-0.6) -- ++(0,0.4) -- ++ (-0.35,-0.2) -- cycle; % signal marker - \node[rotate=-90,font=\sffamily,text=foreground] at (0.9,-0.4) {#1}; % speed indicator - } - }, -} - -\tikzset{ - pics/distant_signal_backward/.default=, - pics/distant_signal_backward/.style args={#1}{ - code={ - \path[draw=foreground,line width=1pt] (0,0) -- ++(0,0.4) -- ++(-0.4,0); % signal pole - \path[draw=foreground,fill=background,line width=1pt] (-0.7,0.6) -- ++(0,-0.4) -- ++ (0.35,0.2) -- cycle; % signal marker - \node[rotate=90,font=\sffamily,text=foreground] at (-0.9,0.4) {#1}; % speed indicator - } - }, -} - -\tikzset{ - pics/speed_signal_forward/.default=, - pics/speed_signal_forward/.style args={#1}{ - code={ - \path[draw=foreground,line width=1pt] (0,0) -- ++(0,-0.4) -- ++(0.4,0); % signal pole - \path[draw=foreground,line width=1pt] (0.4,-0.2) -- ++(0,-0.4) -- ++ (0.35,0.2) -- cycle; % signal marker - \node[rotate=-90,font=\sffamily,text=foreground] at (1.0,-0.4) {#1}; % speed indicator - } - }, -} - -\tikzset{ - pics/speed_signal_backward/.default=, - pics/speed_signal_backward/.style args={#1}{ - code={ - \path[draw=foreground,line width=1pt] (0,0) -- ++(0,0.4) -- ++(-0.4,0); % signal pole - \path[draw=foreground,line width=1pt] (-0.4,0.2) -- ++(0,0.4) -- ++ (-0.35,-0.2) -- cycle; % signal marker - \node[rotate=90,font=\sffamily,text=foreground] at (-1.0,0.4) {#1}; % speed indicator - } - }, -} - -\tikzset{ - pics/block_signal_forward/.style args={#1}{ - code={ - \path[draw=foreground,line width=1pt] (0,0) -- ++(0,-0.4) -- ++(0.7,0); % signal pole - \path[draw=foreground,line width=1pt] (0.7,-0.6) rectangle ++(0.4,0.4); % signal marker - \node[rotate=-90,font=\sffamily,text=foreground] at (1.3,-0.4) {#1}; % speed indicator - } - }, - pics/block_signal_forward/.default=, -} -\tikzset{ - pics/block_signal_backward/.default=, - pics/block_signal_backward/.style args={#1}{ - code={ - \path[draw=foreground,line width=1pt] (0,0) -- ++(0,0.4) -- ++(-0.7,0); % signal pole - \path[draw=foreground,line width=1pt] (-0.7,0.6) rectangle ++(-0.4,-0.4); % signal marker - \node[rotate=90,font=\sffamily,text=foreground] at (-1.3,0.4) {#1}; % speed indicator - } - }, -} - -\tikzset{ - pics/route_signal_forward/.default=, - pics/route_signal_forward/.style args={#1}{ - code={ - \path[draw=foreground,line width=1pt] (0,0) -- ++(0,-0.4) -- ++(0.7,0); % signal pole - \path[draw=foreground,line width=1pt] (0.9,-0.4) circle (0.2); % signal marker - \node[rotate=-90,font=\sffamily,text=foreground] at (1.3,-0.4) {#1}; % speed indicator - } - }, -} - -\tikzset{ - pics/route_signal_backward/.default=, - pics/route_signal_backward/.style args={#1}{ - code={ - \path[draw=foreground,line width=1pt] (0,0) -- ++(0,0.4) -- ++(-0.7,0); % signal pole - \path[draw=foreground,line width=1pt] (-0.9,0.4) circle (0.2); % signal marker - \node[rotate=90,font=\sffamily,text=foreground] at (-1.3,0.4) {#1}; % speed indicator - } - }, -} - -\tikzset{ - shunt_signal_forward/.pic={ - \path[draw=foreground,line width=1pt] (0,0) -- ++(0,-0.4) -- ++(0.7,0); % signal pole - \path[draw=foreground,line width=1pt] (0.6,-0.3) circle (0.1); % signal marker - }; -} - -\tikzset{ - shunt_signal_forward_locked/.pic={ - \path[draw=foreground,line width=1pt] (0,0) -- ++(0,-0.4) -- ++(0.7,0); % signal pole - % \path[fill=red] (0.6,-0.3) circle (0.1); % signal aspect - \path[draw=foreground, line width=1pt] (0.6,-0.2) -- ++(0,-0.2); % signal aspect - \path[draw=foreground,line width=1pt] (0.6,-0.3) circle (0.1); % signal marker - }; -} - -\tikzset{ - shunt_signal_backward/.pic={ - \path[draw=foreground, line width=1pt] (0,0) -- ++(0,0.4) -- ++(-0.7,0); % signal pole - \path[draw=foreground, line width=1pt] (-0.6,0.3) circle (0.1); % signal marker - }; -} - -\tikzset{ - shunt_signal_backward_locked/.pic={ - \path[draw=foreground, line width=1pt] (0,0) -- ++(0,0.4) -- ++(-0.7,0); % signal pole - % \path[fill=red] (-0.6,0.3) circle (0.1); % signal aspect - \path[draw=foreground, line width=1pt] (-0.6,0.2) -- ++(0,0.2); % signal aspect - \path[draw=foreground, line width=1pt] (-0.6,0.3) circle (0.1); % signal marker - }; -} - -\tikzset{ - shunt_limit_forward/.pic={ - \path[draw=foreground,line width=1pt] (0,0) -- ++(0,-0.4) -- ++(0.7,0); % signal pole - \path[draw=foreground,line width=1pt] (0.6,-0.2) arc (270:90:-0.1) -- cycle;; % signal marker - }; -} - -\tikzset{ - shunt_limit_backward/.pic={ - \path[draw=foreground,line width=1pt] (0,0) -- ++(0,0.4) -- ++(-0.7,0); % signal pole - \path[draw=foreground,line width=1pt] (-0.6,0.4) arc (90:270:0.1) -- cycle;; % signal marker - }; -} - -\tikzset{ - block_end_marker_forward/.pic={ - \path[draw=foreground,line width=1pt] (0,0) -- ++(0,-0.5); % marker - \path[draw=foreground,line width=1pt] (-0.1,-0.7) rectangle ++(0.2,0.2); % sign - }; -} - -\tikzset{ - block_end_marker_backward/.pic={ - \path[draw=foreground,line width=1pt] (0,0) -- ++(0,0.5); % marker - \path[draw=foreground,line width=1pt] (0.1,0.7) rectangle ++(-0.2,-0.2); % sign - }; -} - -\tikzset{ - block_clearing_point_forward/.pic={ - \path[draw=foreground,line width=1pt] (0,0.1) -- ++(0,-0.2); % marker - \path[draw=foreground,line width=1pt] (0,-0.1) -- ++(-0.1,-0.1) -- ++(0.1,-0.1) -- ++(0.1,0.1) -- cycle; % sign - }; -} - -\tikzset{ - block_clearing_point_backward/.pic={ - \path[draw=foreground, line width=1pt] (0,-0.1) -- ++(0,0.2); % marker - \path[draw=foreground, line width=1pt] (0,0.1) -- ++(0.1,0.1) -- ++(-0.1,0.1) -- ++(-0.1,-0.1) -- cycle; % sign - }; -} - -\tikzset{ - route_clearing_point_forward/.pic={ - \path[draw=foreground, line width=1pt] (0,0.1) -- ++(0,-0.2); % marker - \path[draw=foreground, line width=1pt] (0,-0.2) circle (0.1); % sign - }; -} - -\tikzset{ - route_clearing_point_backward/.pic={ - \path[draw=foreground, line width=1pt] (0,-0.1) -- ++(0,0.2); % marker - \path[draw=foreground, line width=1pt] (0, 0.2) circle (0.1); % sign - }; -} - -\tikzset{ - pics/clearing_point/.default=, - pics/clearing_point/.style args={#1}{ - code={ - \path[draw=foreground, line width=1pt] (0 ,-0.1) -- ++( 0 ,0.2); % marker - \path[draw=foreground, line width=1pt] (0.1, 0.1) -- ++(-0.2,0 ); % sign - \node[font=\sffamily,text=foreground] at (0,0.45) {#1}; % indicator - } - }, -} - -\tikzset{ - pics/transmitter_below/.default=background, - pics/transmitter_below/.style args={#1}{ - code={ - \path[draw=foreground,line width=1pt,fill=#1] (-0.25,0) rectangle (0.25,-0.25); % turnout marker - } - }, -} - -\tikzset{ - pics/transmitter_below_forward/.default=background, - pics/transmitter_below_forward/.style args={#1}{ - code={ - \path[draw=foreground,line width=1pt,fill=#1] (-0.25,0) rectangle (0.25,-0.25); % turnout marker - \path[draw=foreground] (0.1,-0.05) -- (0.2,-0.125) -- (0.1,-0.2) -- cycle; - } - }, -} - -\tikzset{ - pics/transmitter_below_backward/.default=background, - pics/transmitter_below_backward/.style args={#1}{ - code={ - \path[draw=foreground,line width=1pt,fill=#1] (-0.25,0) rectangle (0.25,-0.25); % turnout marker - \path[draw=foreground] (-0.1,-0.05) -- (-0.2,-0.125) -- (-0.1,-0.2) -- cycle; - } - }, -} - -\tikzset{ - pics/transmitter_below_bidirectional/.default=background, - pics/transmitter_below_bidirectional/.style args={#1}{ - code={ - \path[draw=foreground,line width=1pt,fill=#1] (-0.25,0) rectangle (0.25,-0.25); % turnout marker - \path[draw=foreground] ( 0.1,-0.05) -- ( 0.2,-0.125) -- ( 0.1,-0.2) -- cycle; - \path[draw=foreground] (-0.1,-0.05) -- (-0.2,-0.125) -- (-0.1,-0.2) -- cycle; - } - }, -} - -\tikzset{ - pics/transmitter_above/.default=background, - pics/transmitter_above/.style args={#1}{ - code={ - \path[draw=foreground,line width=1pt,fill=#1] (-0.25,0) rectangle (0.25,0.25); % turnout marker - } - }, -} - -\tikzset{ - pics/transmitter_above_forward/.default=background, - pics/transmitter_above_forward/.style args={#1}{ - code={ - \path[draw=foreground,line width=1pt,fill=#1] (-0.25,0) rectangle (0.25,0.25); % turnout marker - \path[draw=foreground] (0.1,0.05) -- (0.2,0.125) -- (0.1,0.2) -- cycle; - } - }, -} - -\tikzset{ - pics/transmitter_above_backward/.default=background, - pics/transmitter_above_backward/.style args={#1}{ - code={ - \path[draw=foreground,line width=1pt,fill=#1] (-0.25,0) rectangle (0.25,0.25); % turnout marker - \path[draw=foreground] (-0.1,0.05) -- (-0.2,0.125) -- (-0.1,0.2) -- cycle; - } - }, -} - -\tikzset{ - pics/transmitter_above_bidirectional/.default=background, - pics/transmitter_above_bidirectional/.style args={#1}{ - code={ - \path[draw=foreground,line width=1pt,fill=#1] (-0.25,0) rectangle (0.25,0.25); % turnout marker - \path[draw=foreground] ( 0.1,0.05) -- ( 0.2,0.125) -- ( 0.1,0.2) -- cycle; - \path[draw=foreground] (-0.1,0.05) -- (-0.2,0.125) -- (-0.1,0.2) -- cycle; - } - }, -} - -\tikzset{ - opposing_protection_forward/.pic={ - \path[draw=foreground, fill=background] (-0.175,-0.15) -- ++(0,0.3) -- ++ (0.35,-0.15) -- cycle; - }; -} - -\tikzset{ - opposing_protection_backward/.pic={ - \path[draw=foreground, fill=background] (0.175,-0.15) -- ++(0,0.3) -- ++ (-0.35,-0.15) -- cycle; - }; -} - -\tikzset{ - opposing_protection_granted_forward/.pic={ - \fill[foreground] (-0.175,-0.15) -- ++(0,0.3) -- ++ (0.35,-0.15) -- cycle; - }; -} - -\tikzset{ - opposing_protection_granted_backward/.pic={ - \fill[foreground] (0.175,-0.15) -- ++(0,0.3) -- ++ (-0.35,-0.15) -- cycle; - }; -} - -\tikzset{ - opposing_protection_declined_forward/.pic={ - \path[draw=foreground, fill=background, densely dotted] (-0.175,-0.15) -- ++(0,0.3) -- ++ (0.35,-0.15) -- cycle; - }; -} - -\tikzset{ - opposing_protection_declined_backward/.pic={ - \path[draw=foreground, fill=background, densely dotted] (0.175,-0.15) -- ++(0,0.3) -- ++ (-0.35,-0.15) -- cycle; - }; -} - -\endinput +% +\ProvidesFileRCS{tikzlibrarytrackschematic.trafficcontrol.code.tex}% +% +%%%%%%%%%%%%%%% +% Requirements +%%%%%%%%%%%%%%% +\RequirePackage{tikz,etoolbox,lmodern}% +\usetikzlibrary{calc}% +% +% https://tex.stackexchange.com/questions/56353/extract-x-y-coordinate-of-an-arbitrary-point-on-curve-in-tikz +\providecommand{\gettikzxy}[3]{% + \tikz@scan@one@point\pgfutil@firstofone#1\relax% + \edef#2{\the\pgf@x}% + \edef#3{\the\pgf@y}% +}% +% +%%%%%%%%%%%%%%% +% tikz keys for multiple use +%%%%%%%%%%%%%%% +\pgfkeys{% + /tikz/trackschematic/.is family,% + /tikz/trackschematic/.cd,% + %% color \foreground + foreground/.store in=\foreground,% + foreground=black,% DEFAULT + /tikz/foreground/.forward to=/tikz/trackschematic/foreground,% + %% color \background + background/.store in=\background,% + background=white,% DEFAULT + /tikz/background/.forward to=/tikz/trackschematic/background,% + %% face + face/.value required,% forward OR backward + face/.store in=\face,% forward OR backward + /tikz/face/.forward to=/tikz/trackschematic/face,% + /tikz/forward/.code={\pgfkeys{/tikz/trackschematic/face=forward}},% + /tikz/backward/.code={\pgfkeys{/tikz/trackschematic/face=backward}},% + /tikz/bidirectional/.code={\pgfkeys{/tikz/trackschematic/face=bidirectional}},% + %% traffic practice + traffic practice/.value required,% left OR right + traffic practice/.store in=\trafficpractice,% + traffic practice=right,% DEFAULT + /tikz/traffic practice/.forward to=/tikz/trackschematic/traffic practice,% + /tikz/position/.forward to=/tikz/trackschematic/traffic practice,% + %% label + shift label/.store in=\labelcoord,% (coord) + shift label=(none),% DEFAULT + /tikz/shift label/.forward to=/tikz/trackschematic/shift label,% +}% +% +\pgfkeys{% + /tikz/trackschematic/trafficcontrol/.is family,% + /tikz/trackschematic/trafficcontrol/.cd,% + %% type + type/.value required,% balise OR loop + type/.store in=\type,% balise OR loop + /tikz/type/.forward to=/tikz/trackschematic/trafficcontrol/type,% + %% block signal type + block type/.value forbidden,% + block type/.code={\settoggle{is_block_type}{true}},% + /tikz/block/.forward to=/tikz/trackschematic/trafficcontrol/block type,% + %% route signal type + route type/.value forbidden,% + route type/.code={\settoggle{is_route_type}{true}},% + /tikz/route/.forward to=/tikz/trackschematic/trafficcontrol/route type,% +}% +% options +\newtoggle{is_block_type}\settoggle{is_block_type}{false}% +\newtoggle{is_route_type}\settoggle{is_route_type}{false}% +%%%%%%%%%%%%%%% +% symbol signal +%%%%%%%%%%%%%%% +% command +\newcommand\signal{}% just for safety +\def\signal[#1]#2(#3)#4(#5){% \signal[options] at (coord) label (name); + \pic[#1] at (#3) {signal={#2/#4/#5}}% symbol +}% +\newcommand\distantsignal{}% just for safety +\def\distantsignal[#1]#2(#3)#4(#5){% \distantsignal[options] at (coord) label (name); + \pic[distant,#1] at (#3) {signal={#2/#4/#5}}% symbol +}% +\newcommand\speedsign{}% just for safety +\def\speedsign[#1]#2(#3)#4(#5){% \speedsign[options] at (coord) label (name); + \pic[speed type,#1] at (#3) {signal={#2/#4/#5}}% symbol +}% +\newcommand\speedsignal{}% just for safety +\def\speedsignal[#1]#2(#3)#4(#5){% \speedsignal[options] at (coord) label (name); + \pic[speed type,#1] at (#3) {signal={#2/#4/#5}}% symbol +}% +\newcommand\speeddistantsignal{}% just for safety +\def\speeddistantsignal[#1]#2(#3)#4(#5){% \speedsignal[options] at (coord) label (name); + \pic[speed type,distant,#1] at (#3) {signal={#2/#4/#5}}% symbol +}% +\newcommand\blocksignal{}% just for safety +\def\blocksignal[#1]#2(#3)#4(#5){% \blocksignal[options] at (coord) label (name); + \pic[block,#1] at (#3) {signal={#2/#4/#5}}% symbol +}% +\newcommand\routesignal{}% just for safety +\def\routesignal[#1]#2(#3)#4(#5){% \routesignal[options] at (coord) label (name); + \pic[route,#1] at (#3) {signal={#2/#4/#5}}% symbol +}% +\newcommand\shuntsignal{}% just for safety +\def\shuntsignal[#1]#2(#3)#4(#5){% \shuntsignal[options] at (coord) label (name); + \pic[shunting,#1] at (#3) {signal={#2/#4/#5}}% symbol +}% +\newcommand\shuntlimit{}% just for safety +\def\shuntlimit[#1]#2(#3)#4(#5){% \shuntlimit[options] at (coord) label (name); + \pic[shunt limit,#1] at (#3) {signal={#2/#4/#5}}% symbol +}% +\newcommand\berthsignal{}% just for safety +\def\berthsignal[#1]#2(#3)#4(#5){% \berthsignal[options] at (coord) label (name); + \pic[berth,#1] at (#3) {signal={#2/#4/#5}}% symbol +}% +\newcommand\berthsign{}% just for safety +\def\berthsign[#1]#2(#3)#4(#5){% \berthsign[options] at (coord) label (name); + \pic[berth,#1] at (#3) {signal={#2/#4/#5}}% symbol +}% +% tikz keys +\pgfkeys{% + /tikz/trackschematic/trafficcontrol/signal/.is family,% + /tikz/trackschematic/trafficcontrol/signal/.cd,% + %% distant signal type + distant type/.value forbidden,% + distant type/.code={\settoggle{is_distant_type}{true}},% + /tikz/distant/.forward to=/tikz/trackschematic/trafficcontrol/signal/distant type,% + %% block signal type + speed type/.value forbidden,% + speed type/.code={\settoggle{is_speed_type}{true}},% + /tikz/speed type/.forward to=/tikz/trackschematic/trafficcontrol/signal/speed type,% + %% shunting signal type + shunting type/.value forbidden,% + shunting type/.code={\settoggle{is_shunting_type}{true}},% + /tikz/shunting/.forward to=/tikz/trackschematic/trafficcontrol/signal/shunting type,% + %% shunting signal type + shunt limit/.value forbidden,% + shunt limit/.code={\settoggle{is_shunt_limit}{true}},% + /tikz/shunt limit/.forward to=/tikz/trackschematic/trafficcontrol/signal/shunt limit,% + %% berth signal type + berth type/.value forbidden,% + berth type/.code={\settoggle{is_berth_type}{true}},% + /tikz/berth/.forward to=/tikz/trackschematic/trafficcontrol/signal/berth type,% + %% speed value + speed/.store in=\speed,% number + speed=,% number + /tikz/speed/.forward to=/tikz/trackschematic/trafficcontrol/signal/speed,% + %% speed value + distant speed/.store in=\distantspeed,% number + distant speed=,% number + /tikz/distant speed/.forward to=/tikz/trackschematic/trafficcontrol/signal/distant speed,% + %% locked signal + locked/.value forbidden,% + locked/.code={\settoggle{is_locked}{true}},% + /tikz/locked/.forward to=/tikz/trackschematic/trafficcontrol/signal/locked,% +}% +% options +\newtoggle{is_distant_type}\settoggle{is_distant_type}{false}% +\newtoggle{is_speed_type}\settoggle{is_speed_type}{false}% +\newtoggle{is_shunting_type}\settoggle{is_shunting_type}{false}% +\newtoggle{is_shunt_limit}\settoggle{is_shunt_limit}{false}% +\newtoggle{is_berth_type}\settoggle{is_berth_type}{false}% +\newtoggle{is_locked}\settoggle{is_locked}{false}% +% symbol definition +\tikzset{% generic symbol + pics/signal/.default=,% + pics/signal/.style args={#1/#2/#3}{code={% + %% settings + \def\coordcommand{#1}% beware of leading and tailing spaces! + \def\labelcommand{#2}% beware of leading and tailing spaces! + \def\labelcontent{#3}% + % + %% traffic practice setup + \ifdefstring{\trafficpractice}{left}{% branch + \pgfmathsetmacro{\trafficfactor}{-1}% + }{% + \ifdefstring{\trafficpractice}{right}{% branch + \pgfmathsetmacro{\trafficfactor}{1}% + }{% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/trafficcontrol/traffic practice}{“left“ OR “right“ as key required}}% + }% + }% end \ifdefstring{\trafficpractice} + %% face setup + \ifdefstring{\face}{forward}{% face + \pgfmathsetmacro{\facefactor}{1}% + \def\align{left}% + \def\rotate{-90}% + }{% + \ifdefstring{\face}{backward}{% face + \pgfmathsetmacro{\facefactor}{-1}% + \def\align{right}% + \def\rotate{90}% + }{% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/face}{“forward“ OR “backward“ as key required}}% + }% + }% end \ifdefstring{\face} + \tikzset{every path/.style={draw=\foreground,line width=1pt}};% + \tikzset{every node/.style={text=\foreground,inner sep=1pt}};% + %% signal pole + \path (0,0) -- ++($\trafficfactor*\facefactor*(0,-0.4)$) -- ++($\facefactor*(0.7,0)$);% signal pole + % + %% label + \ifdefstring{\labelcontent}{}{}{% label NOT empty + \coordinate (ts-s-l) at ($\trafficfactor*\facefactor*(0,-0.4)$);% + \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default + \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% + \coordinate (ts-s-l) at ($(ts-s-l)+(\labelcoordX,\labelcoordY)$);% + }% + \node[\align] at (ts-s-l) {\footnotesize \labelcontent};% + }% + \tikzset{every path/.style={draw=\foreground,line width=1pt,fill=\background},rounded corners=0.1pt};% + %% signal marker + \iftoggle{is_distant_type}{% marker for distant signal + \path ($\trafficfactor*\facefactor*(0,-0.4) + \facefactor*(0.35,0)$) --% + ++($\trafficfactor*\facefactor*(0,-0.2) + \facefactor*(0.35,0)$) --% + ++($\trafficfactor*\facefactor*(0, 0.4)$) -- cycle;% signal marker + % + }{}% + \iftoggle{is_speed_type}{% marker for speed signal + \path ($\trafficfactor*\facefactor*(0,-0.2) + \facefactor*(0.35,0)$) --% + ++($\trafficfactor*\facefactor*(0,-0.4)$) --% + ++($\trafficfactor*\facefactor*(0, 0.2) + \facefactor*(0.35,0)$) -- cycle;% signal marker + % + }{}% + \iftoggle{is_block_type}{% marker for block signal + \path ($\trafficfactor*\facefactor*(0,-0.6) + \facefactor*(0.7,0)$) rectangle% + ++($\trafficfactor*\facefactor*(0, 0.4) + \facefactor*(0.4,0)$);% signal marker + % + }{}% + \iftoggle{is_route_type}{% marker for route signal + \path ($\trafficfactor*\facefactor*(0,-0.4) + \facefactor*(0.9,0)$) circle (0.2);% signal marker + % + }{}% + \iftoggle{is_shunting_type}{% marker for shunting signal + \path ($\trafficfactor*\facefactor*(0,-0.3) + \facefactor*(0.6,0)$) circle (0.1);% signal marker + % + }{}% + \iftoggle{is_shunt_limit}{% marker for shunting signal + \tikzset{semicircle/.pic={\path (0,0) arc (180:0:0.1) -- cycle;};}% + \pgfmathsetmacro{\trafficfactorTEST}{-1}% + \ifdefequal{\trafficfactor}{\trafficfactorTEST}{% + \pgfmathsetmacro{\trafficfactorX}{-2}% + }{% + \pgfmathsetmacro{\trafficfactorX}{1}% + }% + \pic[rotate=\rotate] at ($\trafficfactorX*\facefactor*(0,-0.2) + \facefactor*(0.6,0)$) {semicircle}; % signal marker + % + }{}% + \iftoggle{is_berth_type}{% marker for berth signal + \path ($\trafficfactor*\facefactor*(0,-0.575) + \facefactor*(0.3,0)$) rectangle% + ++($\trafficfactor*\facefactor*(0, 0.35 ) + \facefactor*(0.5,0)$);% % signal marker + \path[line width=0.75pt] ($\trafficfactor*\facefactor*(0,-0.3) + \facefactor*(0.375,0)$) -- ++($\facefactor*(0.35,0)$);% + \path[line width=0.75pt] ($\trafficfactor*\facefactor*(0,-0.5) + \facefactor*(0.55 ,0)$) -- ++($\trafficfactor*\facefactor*(0,0.2)$);% + \path[line width=0.75pt] ($\trafficfactor*\facefactor*(0,-0.5) + \facefactor*(0.375,0)$) -- ++($\facefactor*(0.35,0)$);% + % + }{}% + %% speed indicator + \ifdefstring{\speed}{}{}{% speed NOT empty + \tikzset{every node/.style={font=\sffamily,text=\foreground}};% + \iftoggle{is_speed_type}{% marker for speed signal + \node[rotate=\rotate] at ($\trafficfactor*\facefactor*(0,-0.4) + \facefactor*(0.85,0)$) {\speed};% + }{% + \iftoggle{is_shunting_type}{}{% is NOT shunting tyoe + \node[rotate=\rotate] at ($\trafficfactor*\facefactor*(0,-0.4) + \facefactor*(1.3,0)$) {\speed};% + }% + }% + }% + \ifdefstring{\distantspeed}{}{}{% distant speed NOT empty + \tikzset{every node/.style={font=\sffamily,text=\foreground,fill=\background,inner sep=0.5pt}};% + \node[rotate=\rotate] at ($\trafficfactor*\facefactor*(0,-0.4) + \facefactor*(0.2,0)$) {\distantspeed};% + }% + %% locked + \iftoggle{is_locked}{% marker for route signal + \iftoggle{is_block_type}{% marker for block signal + \path ($\trafficfactor*\facefactor*(0,-0.2) + \facefactor*(0.9,0)$) --% + ++($\trafficfactor*\facefactor*(0,-0.4)$);% signal aspect + }{}% + \iftoggle{is_route_type}{% marker for route signal + \path ($\trafficfactor*\facefactor*(0,-0.2) + \facefactor*(0.9,0)$) --% + ++($\trafficfactor*\facefactor*(0,-0.4)$);% signal aspect + }{}% + \iftoggle{is_shunting_type}{% + \path ($\trafficfactor*\facefactor*(0,-0.2) + \facefactor*(0.6,0)$) --% + ++($\trafficfactor*\facefactor*(0,-0.2)$);% signal aspect + }{}% + }{}% + }},% end pics/signal/.style args={#1/#2/#3} +}% +% +%%%%%%%%%%%%%%% +% symbol clearing point +%%%%%%%%%%%%%%% +% command +\newcommand\clearingpoint{}% just for safety +\def\clearingpoint[#1]#2(#3)#4(#5){% \clearingpoint[options] at (coord) label (name); + \pic[standard,#1] at (#3) {clearing_point={#2/#4/#5}}% symbol +}% +\newcommand\blockclearing{}% just for safety +\def\blockclearing[#1]#2(#3)#4(#5){% \blockclearing[options] at (coord) label (name); + \pic[block,#1] at (#3) {clearing_point={#2/#4/#5}}% symbol +}% +\newcommand\routeclearing{}% just for safety +\def\routeclearing[#1]#2(#3)#4(#5){% \routeclearing[options] at (coord) label (name); + \pic[route,#1] at (#3) {clearing_point={#2/#4/#5}}% symbol +}% +\pgfkeys{% + /tikz/trackschematic/trafficcontrol/clearing point/.is family,% + /tikz/trackschematic/trafficcontrol/clearing point/.cd,% + %% standard type + standard type/.value forbidden,% + standard type/.code={\settoggle{is_standard_type}{true}},% + /tikz/standard/.forward to=/tikz/trackschematic/trafficcontrol/clearing point/standard type,% +}% +% options +\newtoggle{is_standard_type}\settoggle{is_standard_type}{false}% +% symbol definition +\tikzset{% + pics/clearing_point/.default=,% + pics/clearing_point/.style args={#1/#2/#3}{code={% + %% settings + \def\coordcommand{#1}% beware of leading and tailing spaces! + \def\labelcommand{#2}% beware of leading and tailing spaces! + \def\labelcontent{#3}% + % + %% traffic practice setup + \ifdefstring{\trafficpractice}{left}{% branch + \pgfmathsetmacro{\trafficfactor}{-1}% + }{% + \ifdefstring{\trafficpractice}{right}{% branch + \pgfmathsetmacro{\trafficfactor}{1}% + }{% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/trafficcontrol/traffic practice}{“left“ OR “right“ as key required}}% + }% + }% end \ifdefstring{\trafficpractice} + %% face setup + \ifdefstring{\face}{backward}{% face + \pgfmathsetmacro{\facefactor}{-1}% + }{% default case + \pgfmathsetmacro{\facefactor}{1}% + }% end \ifdefstring{\face} + \tikzset{every path/.style={draw=\foreground,line width=1pt}};% + %% marker + \path ($\trafficfactor*\facefactor*(0,-0.1)$) -- ++($\trafficfactor*\facefactor*(0,0.2)$);% marker + %% sign + \iftoggle{is_standard_type}{% marker for block signal + \path ($\trafficfactor*\facefactor*(0,-0.1) + \facefactor*(0.1,0)$) -- ++($\facefactor*(-0.2,0)$);% sign + }{}% + \iftoggle{is_block_type}{% marker for block signal + \path ($\trafficfactor*\facefactor*(0,-0.1)$) --% + ++($\trafficfactor*\facefactor*(0,-0.1) + \facefactor*(-0.1,0)$) --% + ++($\trafficfactor*\facefactor*(0,-0.1) + \facefactor*( 0.1,0)$) --% + ++($\trafficfactor*\facefactor*(0, 0.1) + \facefactor*( 0.1,0)$) -- cycle;% sign + }{}% + \iftoggle{is_route_type}{% marker for route signal + \path ($\trafficfactor*\facefactor*(0,-0.2)$) circle (0.1);% sign + }{}% + %% label + \ifdefstring{\labelcontent}{}{}{% label NOT empty + \tikzset{every node/.style={font=\sffamily,text=\foreground}};% + \coordinate (ts-cp-l) at ($\trafficfactor*\facefactor*(0,0.25)$);% + \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default + \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% + \coordinate (ts-cp-l) at ($(ts-cp-l)+(\labelcoordX,\labelcoordY)$);% + }% + \node at (ts-cp-l) {\footnotesize \labelcontent};% + }% + }},% end pics/clearing_point/.style args={#1/#2/#3} +}% +% +%%%%%%%%%%%%%%% +% symbol transmitter +%%%%%%%%%%%%%%% +% command +\newcommand\transmitter{}% just for safety +\def\transmitter[#1]#2(#3)#4(#5){% \transmitter[options] at (coord) label (name); + \pic[#1] at (#3) {transmitter={#2/#4/#5}}% symbol +}% +\newcommand\balise{}% just for safety +\def\balise[#1]#2(#3)#4(#5){% \balise[options] at (coord) label (name); + \pic[type=balise,#1] at (#3) {transmitter={#2/#4/#5}}% symbol +}% +\newcommand\trackloop{}% just for safety +\def\trackloop[#1]#2(#3)#4(#5){% \trackloop[options] at (coord) label (name); + \pic[type=loop,#1] at (#3) {transmitter={#2/#4/#5}}% symbol +}% +% symbol definition +\tikzset{% + pics/transmitter/.default=,% + pics/transmitter/.style args={#1/#2/#3}{code={% + %% settings + \def\coordcommand{#1}% beware of leading and tailing spaces! + \def\labelcommand{#2}% beware of leading and tailing spaces! + \def\labelcontent{#3}% + %% traffic practice setup + \ifdefstring{\trafficpractice}{left}{% branch + \pgfmathsetmacro{\trafficfactor}{-1}% + }{% + \ifdefstring{\trafficpractice}{right}{% branch + \pgfmathsetmacro{\trafficfactor}{1}% + }{% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/trafficcontrol/traffic practice}{“left“ OR “right“ as key required}}% + }% + }% end \ifdefstring{\trafficpractice} + %% marker + \tikzset{every path/.style={draw=\foreground}};% + \ifdefstring{\type}{balise}{% type balise + \path[line width=1pt,fill=\background] ($(-0.25,0)$) rectangle% + ($\trafficfactor*(0,-0.25) + (0.25,0)$);% balise marker + \ifdefstring{\face}{forward}{% face + \path ($\trafficfactor*(0,-0.05) + (0.1,0)$) -- ($\trafficfactor*(0,-0.125) + (0.2,0)$) --% + ($\trafficfactor*(0,-0.2) + (0.1,0)$) -- cycle;% arrow forward + }{% + \ifdefstring{\face}{backward}{% face + \path ($\trafficfactor*(0,-0.05) + (-0.1,0)$) -- ($\trafficfactor*(0,-0.125) + (-0.2,0)$) --% + ($\trafficfactor*(0,-0.2) + (-0.1,0)$) -- cycle;% arrow backward + }{ + \ifdefstring{\face}{bidirectional}{% face + \path ($\trafficfactor*(0,-0.05) + (0.1,0)$) -- ($\trafficfactor*(0,-0.125) + (0.2,0)$) --% + ($\trafficfactor*(0,-0.2) + (0.1,0)$) -- cycle;% arrow forward + \path ($\trafficfactor*(0,-0.05) + (-0.1,0)$) -- ($\trafficfactor*(0,-0.125) + (-0.2,0)$) --% + ($\trafficfactor*(0,-0.2) + (-0.1,0)$) -- cycle;% arrow backward + }{}% + }% + }% end \ifdefstring{\face} + }{% + \ifdefstring{\type}{loop}{% type loop + \path[line width=1pt] ($\trafficfactor*(0,-0.175)$) -- ++(-0.0625,-0.0625) -- ++(-0.2,0) -- ++(-0.125,0.125) -- ++(-0.1,0) -- ++(0,-0.125) -- ++(0.1,0) -- ++(0.125,0.125) -- ++(0.2,0) -- ++(0.125,-0.125) -- ++(0.2,0) -- ++(0.125,0.125) -- ++(0.1,0) -- ++(0,-0.125) -- ++(-0.1,0) -- ++(-0.125,0.125) -- ++(-0.2,0) -- cycle;% loop marker + }{% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/trafficcontrol/transmitter/type}{“balise“ OR “loop“ as key required}}% + }% + }% end \ifdefstring{\type} + %% label + \ifdefstring{\labelcontent}{}{}{% label NOT empty + \tikzset{every node/.style={font=\sffamily,text=\foreground}};% + \coordinate (ts-tm-l) at ($\trafficfactor*(0,0.25)$);% + \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default + \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% + \coordinate (ts-tm-l) at ($(ts-tm-l) + (\labelcoordX,\labelcoordY)$);% + }% + \node at (ts-tm-l) {\footnotesize \labelcontent};% + }% + }},% end pics/transmitter/.style args={#1/#2/#3} +}% +% +%%%%%%%%%%%%%%% +% symbol view point +%%%%%%%%%%%%%%% +% command +\newcommand\viewpoint{}% just for safety +\def\viewpoint[#1]#2(#3){% \viewpoint[options] at (coord); + \pic[#1] at (#3) {view_point={#2}};% symbol +}% +% symbol definition +\tikzset{% + pics/view_point/.default=,% + pics/view_point/.style args={#1}{code={% + %% face setup + \ifdefstring{\face}{forward}{% face + \pgfmathsetmacro{\facefactor}{1}% + }{% + \ifdefstring{\face}{backward}{% face + \pgfmathsetmacro{\facefactor}{-1}% + }{% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/face}{“forward“ OR “backward“ as key required}}% + }% + }% end \ifdefstring{\face} + %% traffic practice setup + \ifdefstring{\trafficpractice}{left}{% branch + \pgfmathsetmacro{\trafficfactor}{-1}% + }{% + \ifdefstring{\trafficpractice}{right}{% branch + \pgfmathsetmacro{\trafficfactor}{1}% + }{% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/trafficcontrol/traffic practice}{“left“ OR “right“ as key required}}% + }% + }% end \ifdefstring{\trafficpractice} + %% arrow + \path[draw=\foreground,<-,>=latex,line width=1pt]% + ($\facefactor*\trafficfactor*(0,-0.1)$) -- ++($\facefactor*\trafficfactor*(0,-0.3)$) -- ++($\facefactor*(0.2,0)$);% arrow + %% eye + \filldraw[\foreground] ($\facefactor*(0.4,0) + \facefactor*\trafficfactor*(0,-0.4)$) circle (0.1);% pupil + \path[draw=\foreground, line width=1pt]% eye contour + ($\facefactor*(0.4, 0) + \facefactor*\trafficfactor*(0,-0.15)$) .. controls% + ($\facefactor*(0.25,0) + \facefactor*\trafficfactor*(0,-0.25)$) and% + ($\facefactor*(0.25,0) + \facefactor*\trafficfactor*(0,-0.55)$) ..% + ($\facefactor*(0.4, 0) + \facefactor*\trafficfactor*(0,-0.65)$) .. controls% + ($\facefactor*(0.55,0) + \facefactor*\trafficfactor*(0,-0.55)$) and% + ($\facefactor*(0.55,0) + \facefactor*\trafficfactor*(0,-0.25)$) ..% + ($\facefactor*(0.4, 0) + \facefactor*\trafficfactor*(0,-0.15)$) --cycle;% eye contour + }},% +}% +% +%%%%%%%%%%%%%%% +% symbol end of authority marker +%%%%%%%%%%%%%%% +% command +\newcommand\movementauthority{}% just for safety +\def\movementauthority[#1]#2(#3)#4(#5){% \movementauthority[options] at (coord) label (name); + \pic[#1] at (#3) {movement_authority_marker={#2/#4/#5}}% symbol +}% +% tikz keys +\pgfkeys{% + /tikz/trackschematic/trafficcontrol/EoA/.is family,% + /tikz/trackschematic/trafficcontrol/EoA/.cd,% + %% option \directionarrow + direction arrow/.store in=\directionarrow,% true or false + direction arrow=true,% true or false + /tikz/direction arrow/.forward to=/tikz/trackschematic/trafficcontrol/EoA/direction arrow,% +}% +% symbol definition +\tikzset{% + pics/movement_authority_marker/.default=,% + pics/movement_authority_marker/.style args={#1/#2/#3}{code={% + %% settings + \def\coordcommand{#1}% beware of leading and tailing spaces! + \def\labelcommand{#2}% beware of leading and tailing spaces! + \def\labelcontent{#3}% + % + %% traffic practice setup + \ifdefstring{\trafficpractice}{left}{% branch + \pgfmathsetmacro{\trafficfactor}{-1}% + }{% + \ifdefstring{\trafficpractice}{right}{% branch + \pgfmathsetmacro{\trafficfactor}{1}% + }{% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/trafficcontrol/traffic practice}{“left“ OR “right“ as key required}}% + }% + }% end \ifdefstring{\trafficpractice} + %% face setup + \ifdefstring{\face}{forward}{% face + \pgfmathsetmacro{\facefactor}{1}% + \def\align{left}% + }{% + \ifdefstring{\face}{backward}{% face + \pgfmathsetmacro{\facefactor}{-1}% + \def\align{right}% + }{% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/face}{“forward“ OR “backward“ as key required}}% + }% + }% end \ifdefstring{\face} + \tikzset{every path/.style={draw=\foreground,line width=1pt}};% + %% marker + \path (0,0) -- ++($\trafficfactor*\facefactor*(0,-0.5)$);% marker + \path ($\trafficfactor*\facefactor*(0,-0.7) + \facefactor*(-0.1,0)$) rectangle% + ++($\trafficfactor*\facefactor*(0, 0.2) + \facefactor*(0.2,0)$);% sign + %% arrow + \ifdefstring{\directionarrow}{true}{% + \path[line width=0.5pt] ($\trafficfactor*\facefactor*(0,-0.2) + \facefactor*(-0.2,0)$) --% + ++($\facefactor*(0.2,0)$);% arrow body + \path[draw=none,fill=\foreground]% arrow tip + ($\trafficfactor*\facefactor*(0,-0.2)$) --% + ++($\trafficfactor*\facefactor*(0,-0.04) + \facefactor*(-0.1,0)$) -- ++($\trafficfactor*\facefactor*(0,0.08)$) -- cycle;% + }{% error message + \ifdefstring{\directionarrow}{false}{}{% + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/trafficcontrol/EoA/direction arrow}{'true' OR 'false' as key required}}% + }% + }% + %% label + \ifdefstring{\labelcontent}{}{}{% label NOT empty + \tikzset{every node/.style={font=\sffamily,text=\foreground}};% + \coordinate (ts-ma-l) at ($\trafficfactor*\facefactor*(0,-0.6) + \facefactor*(-0.05,0)$);% + \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default + \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% + \coordinate (ts-ma-l) at ($(ts-ma-l) + (\labelcoordX,\labelcoordY)$);% + }% + \node[\align] at (ts-ma-l) {\footnotesize \labelcontent};% + }% + }},% end pics/movement_authority_marker/.style args={#1/#2/#3} +}% +% +%%%%%%%%%%%%%%% +% symbol route +%%%%%%%%%%%%%%% +% command +\newcommand\route{}% just for safety +\def\route[#1]#2(#3){% \route[options] at (coord); + \pic[#1] at (#3) {route={#2}}% symbol +}% +% symbol definition +\tikzset{% + pics/route/.default=,% + pics/route/.style args={#1}{code={% + %% settings + \def\coordcommand{#1} % beware of leading and tailing spaces! + %% face setup + \ifdefstring{\face}{forward}{% face + \pgfmathsetmacro{\facefactor}{1}% + }{% + \ifdefstring{\face}{backward}{% face + \pgfmathsetmacro{\facefactor}{-1}% + }{% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/face}{“forward“ OR “backward“ as key required}}% + }% + }% end \ifdefstring{\face} + %% symbol + \fill[\foreground] ($\facefactor*(-0.175,0)+(0,-0.15)$) --% + ($\facefactor*(-0.175,0)+(0, 0.15)$) --% + ($\facefactor*( 0.175,0)+(0, 0 )$) -- cycle;% + }},% +}% +% +%%%%%%%%%%%%%%% +\endinput% +% \ No newline at end of file diff --git a/src/tikzlibrarytrackschematic.vehicles.code.tex b/src/tikzlibrarytrackschematic.vehicles.code.tex index 262dfb7..8ba0aea 100644 --- a/src/tikzlibrarytrackschematic.vehicles.code.tex +++ b/src/tikzlibrarytrackschematic.vehicles.code.tex @@ -1,216 +1,457 @@ %% symbol library for TikZ track schematics % -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -\ProvidesFileRCS{tikzlibrarytrackschematic.vehicles.code.tex} - -\colorlet{background}{white} -\colorlet{foreground}{black} - -\tikzset{ - pics/vehicles/.default=4, - pics/vehicles/.style args={#1}{ - code={ - \path[draw=foreground, double, line width=0.3pt, fill=background] (0,-0.3) -- ++(#1,0) -- ++(0,0.6) -- ++(-#1,0) -- cycle; % train shape - % \node at (-2,0) {\emph{#2}}; %label of train - } - }, -} - -\tikzset{ - pics/train_moving_forward/.default=4, - pics/train_moving_forward/.style args={#1}{ - code={ - \fill[fill=background] (-0.3,0.3) -- ( 0.1,0.3) -- (0.4,0) -- ( 0.1,-0.3) -- (-0.3,-0.3) -- cycle; - \path[draw=foreground, line width=1pt] (-0.15,0.3) -- (-0.1,0.3) -- (0.2,0) -- (-0.1,-0.3) -- (-0.15,-0.3); % arrow shape part 1 - \path[draw=foreground, line width=1pt] ( 0.05,0.3) -- ( 0.1,0.3) -- (0.4,0) -- ( 0.1,-0.3) -- ( 0.05,-0.3); % arrow shape part 2 - % - \path[draw=foreground, line width=1pt, fill=background] (0,0) -- +(-0.3,0.3) -- +(-#1,0.3) -- +(-#1,-0.3) -- +(-0.3,-0.3) -- cycle; % train shape - % \node at (-2,0) {\emph{#2}}; %label of train - } - }, -} - -\tikzset{ - pics/train_moving_backward/.default=4, - pics/train_moving_backward/.style args={#1}{ - code={ - \fill[fill=background] ( 0.3 ,0.3) -- (-0.1,0.3) -- (-0.4,0) -- (-0.1,-0.3) -- ( 0.3 ,-0.3) -- cycle; - \path[draw=foreground, line width=1pt] ( 0.15,0.3) -- ( 0.1,0.3) -- (-0.2,0) -- ( 0.1,-0.3) -- ( 0.15,-0.3); % arrow shape part 1 - \path[draw=foreground, line width=1pt] (-0.05,0.3) -- (-0.1,0.3) -- (-0.4,0) -- (-0.1,-0.3) -- (-0.05,-0.3); % arrow shape part 2 - % - \path[draw=foreground, line width=1pt, fill=background] (0,0) -- +(0.3,-0.3) -- +(#1,-0.3) -- +(#1,0.3) -- +(0.3,0.3) -- cycle; % train shape - % \node at (-2,0) {\emph{#2}}; %label of train - } - }, -} - -\tikzset{ - pics/train_moving_slow_forward/.default=4, - pics/train_moving_slow_forward/.style args={#1}{ - code={ - \fill[fill=background] (-0.3 ,0.3) -- (-0.1,0.3) -- (0.2,0) -- (-0.1,-0.3) -- (-0.3 ,-0.3) -- cycle; - \path[draw=foreground, line width=1pt] (-0.15,0.3) -- (-0.1,0.3) -- (0.2,0) -- (-0.1,-0.3) -- (-0.15,-0.3); % arrow shape part 1 - % - \path[draw=foreground, line width=1pt, fill=background] (0,0) -- +(-0.3,0.3) -- +(-#1,0.3) -- +(-#1,-0.3) -- +(-0.3,-0.3) -- cycle; % train shape - % \node at (-2,0) {\emph{#2}}; %label of train - } - }, -} - -\tikzset{ - pics/train_moving_slow_backward/.default=4, - pics/train_moving_slow_backward/.style args={#1}{ - code={ - \fill[fill=background] ( 0.3 ,0.3) -- ( 0.1,0.3) -- (-0.2,0) -- ( 0.1,-0.3) -- ( 0.3 ,-0.3) -- cycle; - \path[draw=foreground, line width=1pt] ( 0.15,0.3) -- ( 0.1,0.3) -- (-0.2,0) -- ( 0.1,-0.3) -- ( 0.15,-0.3); % arrow shape part 1 - % - \path[draw=foreground, line width=1pt, fill=background] (0,0) -- +(0.3,-0.3) -- +(#1,-0.3) -- +(#1,0.3) -- +(0.3,0.3) -- cycle; % train shape - % \node at (-2,0) {\emph{#2}}; %label of train - } - }, -} - -\tikzset{ - pics/train_moving_fast_forward/.default=4, - pics/train_moving_fast_forward/.style args={#1}{ - code={ - \fill[fill=background] (-0.3 ,0.3) -- ( 0.3,0.3) -- (0.6,0) -- ( 0.3,-0.3) -- (-0.3 ,-0.3) -- cycle; - \path[draw=foreground, line width=1pt] (-0.15,0.3) -- (-0.1,0.3) -- (0.2,0) -- (-0.1,-0.3) -- (-0.15,-0.3); % arrow shape part 1 - \path[draw=foreground, line width=1pt] ( 0.05,0.3) -- ( 0.1,0.3) -- (0.4,0) -- ( 0.1,-0.3) -- ( 0.05,-0.3); % arrow shape part 2 - \path[draw=foreground, line width=1pt] ( 0.25,0.3) -- ( 0.3,0.3) -- (0.6,0) -- ( 0.3,-0.3) -- ( 0.25,-0.3); % arrow shape part 3 - % - \path[draw=foreground, line width=1pt, fill=background] (0,0) -- +(-0.3,0.3) -- +(-#1,0.3) -- +(-#1,-0.3) -- +(-0.3,-0.3) -- cycle; % train shape - % \node at (-2,0) {\emph{#2}}; %label of train - } - }, -} - -\tikzset{ - pics/train_moving_fast_backward/.default=4, - pics/train_moving_fast_backward/.style args={#1}{ - code={ - \fill[fill=background] ( 0.3 ,0.3) -- (-0.3,0.3) -- (-0.6,0) -- (-0.3,-0.3) -- ( 0.3 ,-0.3) -- cycle; - \path[draw=foreground, line width=1pt] ( 0.15,0.3) -- ( 0.1,0.3) -- (-0.2,0) -- ( 0.1,-0.3) -- ( 0.15,-0.3); % arrow shape part 1 - \path[draw=foreground, line width=1pt] (-0.05,0.3) -- (-0.1,0.3) -- (-0.4,0) -- (-0.1,-0.3) -- (-0.05,-0.3); % arrow shape part 2 - \path[draw=foreground, line width=1pt] (-0.25,0.3) -- (-0.3,0.3) -- (-0.6,0) -- (-0.3,-0.3) -- (-0.25,-0.3); % arrow shape part 3 - % - \path[draw=foreground, line width=1pt, fill=background] (0,0) -- +(0.3,-0.3) -- +(#1,-0.3) -- +(#1,0.3) -- +(0.3,0.3) -- cycle; % train shape - % \node at (-2,0) {\emph{#2}}; %label of train - } - }, -} - -\tikzset{ - pics/train_direction_forward/.default=4, - pics/train_direction_forward/.style args={#1}{ - code={ - \path[draw=foreground, line width=1pt, fill=background] (0,0) -- +(-0.3,0.3) -- +(-#1,0.3) -- +(-#1,-0.3) -- +(-0.3,-0.3) -- cycle; % train shape - % \node at (-2,0) {\emph{#2}}; %label of train - } - }, -} - -\tikzset{ - pics/train_direction_backward/.default=4, - pics/train_direction_backward/.style args={#1}{ - code={ - \path[draw=foreground, line width=1pt, fill=background] (0,0) -- +(0.3,-0.3) -- +(#1,-0.3) -- +(#1,0.3) -- +(0.3,0.3) -- cycle; % train shape - % \node at (-2,0) {\emph{#2}}; %label of train - } - }, -} - -\tikzset{ - pics/ghost_train_direction_forward/.default=4, - pics/ghost_train_direction_forward/.style args={#1}{ - code={ - \path[draw=foreground, line width=1pt, dashed] (0,0) -- +(-0.3,0.3) -- +(-#1,0.3) -- +(-#1,-0.3) -- +(-0.3,-0.3) -- cycle; % train shape - % \node at (-2,0) {\emph{#2}}; %label of train - } - }, -} - -\tikzset{ - pics/ghost_train_direction_backward/.default=4, - pics/ghost_train_direction_backward/.style args={#1}{ - code={ - \path[draw=foreground, line width=1pt, dashed] (0,0) -- +(0.3,-0.3) -- +(#1,-0.3) -- +(#1,0.3) -- +(0.3,0.3) -- cycle; % train shape - % \node at (-2,0) {\emph{#2}}; %label of train - } - }, -} - -\tikzset{ - pics/train_shunt_mode_forward/.default=4, - pics/train_shunt_mode_forward/.style args={#1}{ - code={ - \path[draw=foreground, double, line width=0.3pt, fill=background] (0,0) -- +(-0.3,0.3) -- +(-#1,0.3) -- +(-#1,-0.3) -- +(-0.3,-0.3) -- cycle; % train shape - % \node at (-2,0) {\emph{#2}}; %label of train - } - }, -} - -\tikzset{ - pics/train_shunt_mode_backward/.default=4, - pics/train_shunt_mode_backward/.style args={#1}{ - code={ - \path[draw=foreground, double, line width=0.3pt, fill=background] (0,0) -- +(0.3,-0.3) -- +(#1,-0.3) -- +(#1,0.3) -- +(0.3,0.3) -- cycle; % train shape - % \node at (-2,0) {\emph{#2}}; %label of train - } - }, -} - -\tikzset{ - pics/train_shunting_forward/.default=4, - pics/train_shunting_forward/.style args={#1}{ - code={ - \fill[fill=background] (-0.3 ,0.3) -- (-0.1,0.3) -- (0.2,0) -- (-0.1,-0.3) -- (-0.3 ,-0.3) -- cycle; - \path[draw=foreground, double, line width=0.3pt] (-0.15,0.3) -- (-0.1,0.3) -- (0.2,0) -- (-0.1,-0.3) -- (-0.15,-0.3); % arrow shape part 1 - % - \path[draw=foreground, double, line width=0.3pt, fill=background] (0,0) -- +(-0.3,0.3) -- +(-#1,0.3) -- +(-#1,-0.3) -- +(-0.3,-0.3) -- cycle; % train shape - % \node at (-2,0) {\emph{#2}}; %label of train - } - }, -} - -\tikzset{ - pics/train_shunting_backward/.default=4, - pics/train_shunting_backward/.style args={#1}{ - code={ - \fill[fill=background] ( 0.3 ,0.3) -- ( 0.1,0.3) -- (-0.2,0) -- ( 0.1,-0.3) -- ( 0.3 ,-0.3) -- cycle; - \path[draw=foreground, double, line width=0.3pt] ( 0.15,0.3) -- ( 0.1,0.3) -- (-0.2,0) -- ( 0.1,-0.3) -- ( 0.15,-0.3); % arrow shape part 1 - % - \path[draw=foreground, double, line width=0.3pt, fill=background] (0,0) -- +(0.3,-0.3) -- +(#1,-0.3) -- +(#1,0.3) -- +(0.3,0.3) -- cycle; % train shape - % \node at (-2,0) {\emph{#2}}; %label of train - } - }, -} - -\tikzset{ - train_automatic_forward/.pic={ - \path[draw=foreground, fill] (-0.15,0) -- ++(-0.15,0.15) -- ++(0,-0.3) -- cycle; % triangle - }; -} - -\tikzset{ - train_automatic_backward/.pic={ - \path[draw=foreground, fill] (0.15,0) -- ++(0.15,0.15) -- ++(0,-0.3) -- cycle; % triangle - }; -} - -\tikzset{ - train_human_forward/.pic={ - \path[draw=foreground, fill] (-0.4,0) circle (0.15); % dot - }; -} - -\tikzset{ - train_human_backward/.pic={ - \path[draw=foreground, fill] (0.4,0) circle (0.15); % dot - }; -} - -\endinput +% +\ProvidesFileRCS{tikzlibrarytrackschematic.vehicles.code.tex}% +% +%%%%%%%%%%%%%%% +% Requirements +%%%%%%%%%%%%%%% +\RequirePackage{tikz,etoolbox,lmodern}% +\usetikzlibrary{calc}% +% +% https://tex.stackexchange.com/questions/56353/extract-x-y-coordinate-of-an-arbitrary-point-on-curve-in-tikz +\providecommand{\gettikzxy}[3]{% + \tikz@scan@one@point\pgfutil@firstofone#1\relax% + \edef#2{\the\pgf@x}% + \edef#3{\the\pgf@y}% +}% +% +\ifdeflength{\objectlength}{}{% Not defined, so define it! + \newlength{\objectlength}% +}% +\setlength{\objectlength}{4cm}% +% +%%%%%%%%%%%%%%% +% tikz keys for multiple use +%%%%%%%%%%%%%%% +\pgfkeys{% + /tikz/trackschematic/.is family,% + /tikz/trackschematic/.cd,% + %% color foreground + foreground/.store in=\foreground,% + foreground=black,% DEFAULT + /tikz/foreground/.forward to=/tikz/trackschematic/foreground,% + %% color background + background/.store in=\background,% + background=white,% DEFAULT + /tikz/background/.forward to=/tikz/trackschematic/background,% + %% face + face/.value required,% forward OR backward + face/.store in=\face,% + /tikz/face/.forward to=/tikz/trackschematic/face,% + /tikz/forward/.code={\pgfkeys{/tikz/trackschematic/face=forward}},% + /tikz/backward/.code={\pgfkeys{/tikz/trackschematic/face=backward}},% + /tikz/bidirectional/.code={\pgfkeys{/tikz/trackschematic/face=bidirectional}},% + %% operation + operation mode/.store in=\operationmode,% manual, automatic OR undefined + operation mode=none,% DEFAULT + /tikz/operation/.forward to=/tikz/trackschematic/operation mode,% + %% length + length/.store in=\objectlength,% default length 4cm + /tikz/length/.forward to=/tikz/trackschematic/length,% + %% label + shift label/.store in=\labelcoord,% (coord) + shift label=(none),% DEFAULT + /tikz/shift label/.forward to=/tikz/trackschematic/shift label,% +}% +% +%%%%%%%%%%%%%%% +% commands +%%%%%%%%%%%%%%% +% +%% command: parked vehicles +\newcommand\parkedvehicles{}% just for safety +\def\parkedvehicles[#1]#2(#3)#4(#5){% \parkedvehicles[options] at (coord) label (name); + \pic[parked,operation=undefined,#1] at (#3) {vehicles={#2/#4/#5}}% symbol +}% +%% command: shunting movements +\newcommand\shunting{}% just for safety +\def\shunting[#1]#2(#3)#4(#5){% \shunting[options] at (coord) label (name); + \pic[shunting mode,operation=undefined,#1] at (#3) {vehicles={#2/#4/#5}}% symbol +}% +%% command: train run +\newcommand\train{}% just for safety +\def\train[#1]#2(#3)#4(#5){% \train[options] at (coord) label (name); + \pic[train mode,operation=undefined,#1] at (#3) {vehicles={#2/#4/#5}}% symbol +}% +% +%%%%%%%%%%%%%%% +% tikz keys +%%%%%%%%%%%%%%% +\pgfkeys{% + /tikz/trackschematic/vehicles/.is family,% + /tikz/trackschematic/vehicles/.cd,% + %% parked vehicles + parked/.value forbidden,% + parked/.code={\settoggle{is_parked}{true}},% + /tikz/parked/.forward to=/tikz/trackschematic/vehicles/parked,% + %% shunting mode + shunting mode/.value forbidden,% + shunting mode/.code={\settoggle{in_shunting_mode}{true}},% + /tikz/shunting mode/.forward to=/tikz/trackschematic/vehicles/shunting mode,% + %% shunting movement + movement/.value forbidden,% + movement/.code={\settoggle{is_shunting}{true}},% + /tikz/movement/.forward to=/tikz/trackschematic/vehicles/movement,% + %% train mode + train mode/.value forbidden,% + train mode/.code={\settoggle{in_train_mode}{true}},% + /tikz/train mode/.forward to=/tikz/trackschematic/vehicles/train mode,% + %% ghost train + ghost train/.value forbidden,% + ghost train/.code={\settoggle{train_is_a_ghost}{true}},% + /tikz/ghost/.forward to=/tikz/trackschematic/vehicles/ghost train,% + %% train run + run/.store in=\trainrun,% slow, normal, fast OR none + run=none,% DEFAULT + /tikz/run/.forward to=/tikz/trackschematic/vehicles/run,% + %% label + label align/.store in=\labelalign,% (coord) + label align=center,% DEFAULT + /tikz/label align/.forward to=/tikz/trackschematic/vehicles/label align,% + %% train bend + bend right at/.store in=\bendrightcoord,% (coord) + bend right at=(none),% DEFAULT + /tikz/bend right at/.forward to=/tikz/trackschematic/vehicles/bend right at,% + bend left at/.store in=\bendleftcoord,% (coord) + bend left at=(none),% DEFAULT + /tikz/bend left at/.forward to=/tikz/trackschematic/vehicles/bend left at,% +}% +% options +\newtoggle{is_parked}\settoggle{is_parked}{false}% +\newtoggle{in_shunting_mode}\settoggle{in_shunting_mode}{false}% +\newtoggle{is_shunting}\settoggle{is_shunting}{false}% +\newtoggle{in_train_mode}\settoggle{in_train_mode}{false}% +\newtoggle{train_is_a_ghost}\settoggle{train_is_a_ghost}{false}% +\newtoggle{bend}\settoggle{bend}{false}% +\newtoggle{double_bend}\settoggle{double_bend}{false}% +% +%%%%%%%%%%%%%%% +% symbol definition +%%%%%%%%%%%%%%% +% +\tikzset{% + pics/vehicles/.default=,% + pics/vehicles/.style args={#1/#2/#3}{code={% + %% settings + \def\coordcommand{#1}% beware of leading and tailing spaces! + \def\labelcommand{#2}% beware of leading and tailing spaces! + \def\labelcontent{#3}% + %% bend + % determine number of bends and + % find front and back bend from head to tail + \ifdefstring{\bendrightcoord}{(none)}{}{% initialize if NOT default + \gettikzxy{\bendrightcoord}{\bendrightX}{\bendrightY}% + \settoggle{bend}{true}% + \ifdefstring{\face}{forward}{% + \pgfmathsetlengthmacro\forwardbendX{\bendrightX}% + \pgfmathsetlengthmacro\forwardbendY{\bendrightY}% + \pgfmathsetlengthmacro\bendlength{\objectlength + \bendrightX}% + \pgfmathsetmacro\forwardbendTYPE{1}% + }{% face backward + \pgfmathsetlengthmacro\backwardbendX{\bendrightX}% + \pgfmathsetlengthmacro\backwardbendY{\bendrightY}% + \pgfmathsetlengthmacro\bendlength{\objectlength - \bendrightX}% + \pgfmathsetmacro\backwardbendTYPE{1}% + }% END \ifdefstring{\face}{forward} + }% + \ifdefstring{\bendleftcoord}{(none)}{}{% initialize if NOT default + \gettikzxy{\bendleftcoord}{\bendleftX}{\bendleftY}% + \iftoggle{bend}{% + \settoggle{double_bend}{true}% + \ifdefstring{\face}{forward}{% + \ifdimcomp{\bendrightX}{>}{\bendleftX}{% + \pgfmathsetlengthmacro\forwardbendX{\bendrightX}% + \pgfmathsetmacro\forwardbendTYPE{1}% + \pgfmathsetlengthmacro\backwardbendX{\bendleftX}% + \pgfmathsetlengthmacro\backwardbendY{\bendleftY}% + \pgfmathsetmacro\backwardbendTYPE{-1}% + }{% {\bendrightX}{<}{\bendleftX} + \pgfmathsetlengthmacro\forwardbendX{\bendleftX}% + \pgfmathsetmacro\forwardbendTYPE{-1}% + \pgfmathsetlengthmacro\backwardbendX{\bendrightX}% + \pgfmathsetlengthmacro\backwardbendY{\bendrightY}% + \pgfmathsetmacro\backwardbendTYPE{1} + }% + }{% face backward + \ifdimcomp{\bendrightX}{<}{\bendleftX}{% + \pgfmathsetlengthmacro\backwardbendX{\bendrightX}% + \pgfmathsetmacro\backwardbendTYPE{-1}% + \pgfmathsetlengthmacro\forwardbendX{\bendleftX}% + \pgfmathsetlengthmacro\forwardbendY{\bendleftY}% + \pgfmathsetmacro\forwardbendTYPE{1}% + }{% {\bendrightX}{>}{\bendleftX} + \pgfmathsetlengthmacro\backwardbendX{\bendleftX}% + \pgfmathsetmacro\backwardbendTYPE{1}% + \pgfmathsetlengthmacro\forwardbendX{\bendrightX}% + \pgfmathsetlengthmacro\forwardbendY{\bendrightY}% + \pgfmathsetmacro\forwardbendTYPE{-1}% + }% + }% + }{% NOT double bend + \settoggle{bend}{true}% + \ifdefstring{\face}{forward}{% + \pgfmathsetlengthmacro\forwardbendX{\bendleftX}% + \pgfmathsetlengthmacro\forwardbendY{\bendleftY}% + \pgfmathsetlengthmacro\bendlength{\objectlength + \bendleftX}% + \pgfmathsetmacro\forwardbendTYPE{-1}% + }{% face backward + \pgfmathsetlengthmacro\backwardbendX{\bendleftX}% + \pgfmathsetlengthmacro\backwardbendY{\bendleftY}% + \pgfmathsetlengthmacro\bendlength{\objectlength - \bendleftX}% + \pgfmathsetmacro\backwardbendTYPE{-1}% + }% END \ifdefstring{\face}{forward} + }% + }% + %% + %% calculation of vehicle coordinates + %% + %% backward bend forward bend + %% (ts-b-b1) (ts-b-f1) + %% (ts-v-4)•_______•_______•_______•(ts-v-1) + %% / \ + %% backward (ts-v-r)• label•(ts-v-l) •(ts-v-f) forward + %% \_______ _______ _______/ + %% (ts-v-3)• • • •(ts-v-2) + %% (ts-b-b2) (ts-b-f2) + %% + \iftoggle{is_parked}{% vehicle parked + \coordinate (ts-v-1) at ($ 0.5*(\objectlength,0) + (0, 0.3)$);% + \coordinate (ts-v-2) at ($ 0.5*(\objectlength,0) + (0,-0.3)$);% + \coordinate (ts-v-3) at ($-0.5*(\objectlength,0) + (0,-0.3)$);% + \coordinate (ts-v-4) at ($-0.5*(\objectlength,0) + (0, 0.3)$);% + \coordinate (ts-v-f) at ($ 0.5*(\objectlength,0) + (0, 0 )$);% + \coordinate (ts-v-r) at ($-0.5*(\objectlength,0) + (0, 0 )$);% + \iftoggle{bend}{% currently not supported for parked vehicles + % \coordinate (ts-b-f1) at (ts-v-1);% + % \coordinate (ts-b-f2) at (ts-v-2);% + % \coordinate (ts-b-b1) at (ts-v-4);% + % \coordinate (ts-b-b2) at (ts-v-3);% + }{% NOT bend + \coordinate (ts-b-f1) at (ts-v-1);% + \coordinate (ts-b-f2) at (ts-v-2);% + \coordinate (ts-b-b1) at (ts-v-4);% + \coordinate (ts-b-b2) at (ts-v-3);% + }% + \ifdefstring{\labelcoord}{(none)}{% + \coordinate (ts-v-l) at (0,0);% + }{% initialize if NOT default + \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% + \coordinate (ts-v-l) at (\labelcoordX,\labelcoordY);% + }% + }{% vehicle NOT parked + \ifdefstring{\face}{forward}{% face + \pgfmathsetmacro{\facefactor}{1}% + \coordinate (ts-v-1) at (-0.3, 0.3);% + \coordinate (ts-v-2) at (-0.3,-0.3);% + \coordinate (ts-v-f) at (0,0);% + \iftoggle{double_bend}{% + \coordinate (ts-v-3) at ($(-\objectlength,-0.3) + (0,\backwardbendY)$);% + \coordinate (ts-v-4) at ($(-\objectlength, 0.3) + (0,\backwardbendY)$);% + \coordinate (ts-v-r) at ($(-\objectlength, 0 ) + (0,\backwardbendY)$);% + \coordinate (ts-b-f1) at ($( \forwardbendX, 0.3) + \forwardbendTYPE*(-0.1,0)$);% + \coordinate (ts-b-f2) at ($( \forwardbendX,-0.3) + \forwardbendTYPE*( 0.1,0)$);% + \coordinate (ts-b-b1) at ($(\backwardbendX, 0.3) + \backwardbendTYPE*( 0.1,0) + (0,\backwardbendY)$);% + \coordinate (ts-b-b2) at ($(\backwardbendX,-0.3) + \backwardbendTYPE*(-0.1,0) + (0,\backwardbendY)$);% + }{% NOT double bend + \iftoggle{bend}{% + \coordinate (ts-b-f1) at ($( \forwardbendX, 0.3) + \forwardbendTYPE*(-0.1,0)$);% + \coordinate (ts-b-f2) at ($( \forwardbendX,-0.3) + \forwardbendTYPE*( 0.1,0)$);% + \coordinate (ts-b-b1) at (ts-b-f1);% + \coordinate (ts-b-b2) at (ts-b-f2);% + \coordinate (ts-v-3) at ($(-\objectlength,-0.2) + \forwardbendTYPE*(0,-\bendlength) + \forwardbendTYPE*( 0.2,0)$);% + \coordinate (ts-v-4) at ($(-\objectlength, 0.2) + \forwardbendTYPE*(0,-\bendlength) + \forwardbendTYPE*(-0.2,0)$);% + \coordinate (ts-v-r) at ($(-\objectlength, 0 ) + \forwardbendTYPE*(0,-\bendlength)$);% + }{% NOT bend + \coordinate (ts-b-f1) at (ts-v-1);% + \coordinate (ts-b-f2) at (ts-v-2);% + \coordinate (ts-v-3) at ($(-\objectlength,0) + (0,-0.3)$);% + \coordinate (ts-v-4) at ($(-\objectlength,0) + (0, 0.3)$);% + \coordinate (ts-b-b1) at (ts-v-4);% + \coordinate (ts-b-b2) at (ts-v-3);% + \coordinate (ts-v-r) at ($(-\objectlength,0)$);% + }% + }% + }{% + \ifdefstring{\face}{backward}{% face + \pgfmathsetmacro{\facefactor}{-1}% + \coordinate (ts-v-3) at (0.3,-0.3);% + \coordinate (ts-v-4) at (0.3, 0.3);% + \coordinate (ts-v-r) at (0,0);% + \iftoggle{double_bend}{% + \coordinate (ts-v-1) at ($( \objectlength, 0.3) + (0,\forwardbendY)$);% + \coordinate (ts-v-2) at ($( \objectlength,-0.3) + (0,\forwardbendY)$);% + \coordinate (ts-v-f) at ($( \objectlength, 0 ) + (0,\forwardbendY)$);% + \coordinate (ts-b-f1) at ($( \forwardbendX, 0.3) + \forwardbendTYPE*( 0.1,0) + (0,\forwardbendY)$);% + \coordinate (ts-b-f2) at ($( \forwardbendX,-0.3) + \forwardbendTYPE*(-0.1,0) + (0,\forwardbendY)$);% + \coordinate (ts-b-b1) at ($(\backwardbendX, 0.3) + \backwardbendTYPE*(-0.1,0)$);% + \coordinate (ts-b-b2) at ($(\backwardbendX,-0.3) + \backwardbendTYPE*( 0.1,0)$);% + }{% NOT double bend + \iftoggle{bend}{% + \coordinate (ts-b-b1) at ($( \backwardbendX, 0.3) + \backwardbendTYPE*( 0.1,0)$);% + \coordinate (ts-b-b2) at ($( \backwardbendX,-0.3) + \backwardbendTYPE*(-0.1,0)$);% + \coordinate (ts-b-f1) at (ts-b-b1);% + \coordinate (ts-b-f2) at (ts-b-b2);% + \coordinate (ts-v-1) at ($( \objectlength, 0.2) + \backwardbendTYPE*(0,-\bendlength) + \backwardbendTYPE*( 0.2,0)$);% + \coordinate (ts-v-2) at ($( \objectlength,-0.2) + \backwardbendTYPE*(0,-\bendlength) + \backwardbendTYPE*(-0.2,0)$);% + \coordinate (ts-v-f) at ($( \objectlength, 0 ) + \backwardbendTYPE*(0,-\bendlength)$);% + }{% NOT bend + \coordinate (ts-b-b1) at (ts-v-4);% + \coordinate (ts-b-b2) at (ts-v-3);% + \coordinate (ts-v-1) at ($(\objectlength,0) + (0, 0.3)$);% + \coordinate (ts-v-2) at ($(\objectlength,0) + (0,-0.3)$);% + \coordinate (ts-b-f1) at (ts-v-1);% + \coordinate (ts-b-f2) at (ts-v-2);% + \coordinate (ts-v-f) at ($(\objectlength,0)$);% + }% + }% + }{% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/face}{“forward“ OR “backward“ as key required}}% + }% + }% end \ifdefstring{\face} + %% label coord for NOT parked + \ifdefstring{\labelcoord}{(none)}{% + \coordinate (ts-v-l) at ($\facefactor*-0.5*(\objectlength,0) + (0,0)$);% + }{% initialize if NOT default + \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% + \coordinate (ts-v-l) at (\labelcoordX,\labelcoordY);% + }% + }% + % + %% vehicle style + \iftoggle{in_train_mode}{% train mode + \iftoggle{train_is_a_ghost}{% ghost train + \tikzset{every path/.style={draw=\foreground, line width=0.8pt, dashed}};% + \coordinate (ts-v-l) at ($(ts-v-l) + (0,0.16)$);% + }{% normal train + \tikzset{every path/.style={draw=\foreground, line width=1pt, fill=\background}};% + }% + }{% shunting mode + \tikzset{every path/.style={draw=\foreground, double, double distance=0.5mm, line width=0.3pt, fill=\background}};% + }% + % + %% arrow shapes + \iftoggle{is_shunting}{% arrow for shunting + \iftoggle{in_shunting_mode}{% shunting mode + \fill[draw=none,fill=\background] ($\facefactor*(-0.3, 0.3)$) --% + ($\facefactor*(-0.1, 0.3)$) --% + ($\facefactor*( 0.2, 0 )$) --% + ($\facefactor*(-0.1,-0.3)$) --% + ($\facefactor*(-0.3,-0.3)$) -- cycle;% \background fill + \path[line cap=rect,fill=none] ($\facefactor*(-0.1, 0.3)$) --% + ($\facefactor*( 0.2, 0 )$) --% + ($\facefactor*(-0.1,-0.3)$);% arrow shape + }{% train mode + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/vehicle/movement}{movement can only be combined with shunting}}% + }% + }{}% end \iftoggle{shunting_movement} + \ifdefstring{\trainrun}{none}{}{% arrow for train + \iftoggle{in_train_mode}{% train mode + \ifdefstring{\trainrun}{slow}{% + \fill[draw=none,fill=\background] ($\facefactor*(-0.3, 0.3)$) --% + ($\facefactor*(-0.1, 0.3)$) --% + ($\facefactor*( 0.2, 0 )$) --% + ($\facefactor*(-0.1,-0.3)$) --% + ($\facefactor*(-0.3,-0.3)$) -- cycle;% \background fill + \path[fill=none] ($\facefactor*(-0.15, 0.3)$) --% + ($\facefactor*(-0.1 , 0.3)$) --% + ($\facefactor*( 0.2 , 0 )$) --% + ($\facefactor*(-0.1 ,-0.3)$) --% + ($\facefactor*(-0.15,-0.3)$);% arrow shape + }{% + \ifdefstring{\trainrun}{normal}{% + \fill[draw=none,fill=\background] ($\facefactor*(-0.3, 0.3)$) --% + ($\facefactor*( 0.1, 0.3)$) --% + ($\facefactor*( 0.4, 0 )$) --% + ($\facefactor*( 0.1,-0.3)$) --% + ($\facefactor*(-0.3,-0.3)$) -- cycle;% \background fill + \path[fill=none] ($\facefactor*(-0.15, 0.3)$) --% + ($\facefactor*(-0.1 , 0.3)$) --% + ($\facefactor*( 0.2 , 0 )$) --% + ($\facefactor*(-0.1 ,-0.3)$) --% + ($\facefactor*(-0.15,-0.3)$);% arrow shape part 1 + \path[fill=none] ($\facefactor*( 0.05, 0.3)$) --% + ($\facefactor*( 0.1 , 0.3)$) --% + ($\facefactor*( 0.4 , 0 )$) --% + ($\facefactor*( 0.1 ,-0.3)$) --% + ($\facefactor*( 0.05,-0.3)$);% arrow shape part 2 + % + }{% + \ifdefstring{\trainrun}{fast}{% + \fill[draw=none,fill=\background] ($\facefactor*(-0.3, 0.3)$) --% + ($\facefactor*( 0.3, 0.3)$) --% + ($\facefactor*( 0.6, 0 )$) --% + ($\facefactor*( 0.3,-0.3)$) --% + ($\facefactor*(-0.3,-0.3)$) -- cycle;% \background fill + \path[fill=none] ($\facefactor*(-0.15, 0.3)$) --% + ($\facefactor*(-0.1 , 0.3)$) --% + ($\facefactor*( 0.2 , 0 )$) --% + ($\facefactor*(-0.1 ,-0.3)$) --% + ($\facefactor*(-0.15,-0.3)$);% arrow shape part 1 + \path[fill=none] ($\facefactor*( 0.05, 0.3)$) --% + ($\facefactor*( 0.1 , 0.3)$) --% + ($\facefactor*( 0.4 , 0 )$) --% + ($\facefactor*( 0.1 ,-0.3)$) --% + ($\facefactor*( 0.05,-0.3)$);% arrow shape part 2 + \path[fill=none] ($\facefactor*( 0.25, 0.3)$) --% + ($\facefactor*( 0.3 , 0.3)$) --% + ($\facefactor*( 0.6 , 0 )$) --% + ($\facefactor*( 0.3 ,-0.3)$) --% + ($\facefactor*( 0.25,-0.3)$);% arrow shape part 3 + % + }{%error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/vehicles/run}{“normal“, “slow“, “fast“ OR “none“ as key required}}% + }% + }% + }% + }{% shunting mode + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/vehicle/run}{run can only be combined with train}}% + }% end \iftoggle{in_train_mode} + }% end \ifdefstring{\trainrun}{none} % end arrow shapes + % + %% vehicle shape + \path (ts-v-1) -- (ts-v-f) -- (ts-v-2) -- (ts-b-f2) -- (ts-b-b2) -- (ts-v-3) -- (ts-v-r) -- (ts-v-4) -- (ts-b-b1) -- (ts-b-f1) -- cycle;% vehicle shape + % + %% operated + \iftoggle{is_parked}{}{% vehicle NOT parked + \ifdefstring{\operationmode}{manual}{% + \path[draw=none, fill=\foreground] ($\facefactor*(-0.4,0)$) circle (0.15);% dot + \coordinate (ts-v-l) at ($(ts-v-l) + \facefactor*(-0.25,0)$);% + }{ + \ifdefstring{\operationmode}{automatic}{% + \path[draw=none, fill=\foreground] ($\facefactor*(-0.15,0)$) -- ++($\facefactor*(-0.15,0) +(0,0.15)$) -- ++(0,-0.3) -- cycle;% triangle + \coordinate (ts-v-l) at ($(ts-v-l) + \facefactor*(-0.15,0)$);% + }{% + \ifdefstring{\operationmode}{undefined}{}{% + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/operation}{“manual“, “automatic“ OR “undefined“ as key required}}% + }% + }% end automatically_operated + }% end manually_operated + }% + % + %% label + \ifdefstring{\labelcontent}{}{}{% label NOT empty + \ifdefstring{\labelalign}{center}{% label align default + \def\labelanchor{center} + }{% label align NOT default + \ifdefstring{\labelalign}{left}{% label align left + \def\labelanchor{east} + }{% + \ifdefstring{\labelalign}{right}{% label align left + \def\labelanchor{west} + }{% NOT center, left, or right + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/label align}{“center“, “left“ OR “right“ as key required}}% + }% \ifdefstring{\labelalign}{right} + }% \ifdefstring{\labelalign}{left} + }% \ifdefstring{\labelalign}{center} + \node[text=\foreground,anchor=\labelanchor,align=\labelalign] at (ts-v-l) {\footnotesize\emph{\labelcontent}};% label + }% + }},% +}% +% +%%%%%%%%%%%%%%% +\endinput% +% \ No newline at end of file diff --git a/test/bend_vehicles.tikz b/test/bend_vehicles.tikz new file mode 100644 index 0000000..6385037 --- /dev/null +++ b/test/bend_vehicles.tikz @@ -0,0 +1,53 @@ +%!TEX TS-program = pdflatexmk +%!TEX root = test.tex + +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\node[blue] at (4,0) {\large test bend vehicles}; + +\foreach \i in {1,2,...,6}{% base coordinate + \coordinate (A\i) at ($(-1,0) + (0,-\i)$); + \coordinate (B\i) at ($( 9,0) + (0,-\i)$); +} + +\foreach \i in {1,2,...,6}{% draw main tracks on base coordinate + \maintrack (A\i) -- (B\i); +} + +\foreach \i in {1,2,...,6}{% coordinates for testing symbols + \coordinate (T\i-0) at ($(0,0) + (0,-\i)$); + \coordinate (T\i-1) at ($(1,0) + (0,-\i)$); + \coordinate (T\i-2) at ($(2,0) + (0,-\i)$); + \coordinate (T\i-3) at ($(3,0) + (0,-\i)$); + \coordinate (T\i-4) at ($(4,0) + (0,-\i)$); + \coordinate (T\i-5) at ($(5,0) + (0,-\i)$); + \coordinate (T\i-6) at ($(6,0) + (0,-\i)$); + \coordinate (T\i-7) at ($(7,0) + (0,-\i)$); + \coordinate (T\i-8) at ($(8,0) + (0,-\i)$); +} + +\train[forward, length=5cm, + bend right at={(T1-6)}, bend left at={(T2-7)}, + shift label={(T1-6)}, label align=left] at (T2-8) label (T2 T2 T1 bend); +\train[forward, length=5cm, + bend left at={(T4-6)},bend right at={(T3-7)}, + shift label={(T4-6)}, label align=left] at (T3-8) label (T3 T3 T4 bend); +\train[backward, length=5cm, + bend right at={(T1-1)}, bend left at={(T2-2)}, + shift label={(T2-2)}, label align=right] at (T1-0) label (T1 T1 T2 bend); +\train[backward, length=5cm, + bend left at={(T4-1)},bend right at={(T3-2)}, + shift label={(T3-2)}, label align=right] at (T4-0) label (T4 T3 T3 bend); +\train[backward, length=2cm, + bend left at={(T6-1)}, + shift label={(T6-1)}, label align=left] at (T6-0) label (A6 T6 bend); +\train[forward, length=2cm, + bend right at={(T5-3)}, + shift label={(T5-2)}, label align=right] at (T5-4) label (T5 T5 bend); +\train[backward, length=2cm, + bend right at={(T5-5)}, + shift label={(T5-6)}, label align=left] at (T5-4) label (T5 T5 bend); +\train[forward, length=2cm, + bend left at={(T6-7)}, + shift label={(T6-7)}, label align=left] at (T6-8) label (B6 T6 bend); diff --git a/test/berth.tikz b/test/berth.tikz new file mode 100644 index 0000000..4207ceb --- /dev/null +++ b/test/berth.tikz @@ -0,0 +1,39 @@ +%!TEX TS-program = pdflatexmk +%!TEX root = test.tex + +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\node[blue] at (4,0) {\large test berth symbols}; + +\foreach \i in {1,2,...,4}{% base coordinate + \coordinate (A\i) at ($(0,0) + 2*(0,-\i)$);% base coordinate + \coordinate (B\i) at ($(8,0) + 2*(0,-\i)$);% base coordinate +} + +\foreach \i in {1,2,...,4}{% draw main tracks on base coordinate + \maintrack (A\i) -- (B\i); +} + +\foreach \i in {1,2,...,4}{% coordinates for testing symbols + \coordinate (X\i-1) at ($(1,0) + 2*(0,-\i)$); + \coordinate (X\i-2) at ($(3,0) + 2*(0,-\i)$); + \coordinate (X\i-3) at ($(5,0) + 2*(0,-\i)$); + \coordinate (X\i-4) at ($(7,0) + 2*(0,-\i)$); +} + +\train[backward] at (X1-1) label (X1-1); + +\berth[bidirectional] at (X1-2) length (X1-2); +\berth[forward,length=1.5cm] at (X1-4) length (X1-4-f); +\berth[backward,length=1cm] at (X1-4) length (X1-4-b); + +\berth[forward,length=2cm] at (X2-2) length (230); +\berth[backward,length=1.5cm] at ([shift={(-0.25,0)}] X2-2) length (180); +\berth[forward,length=1.5cm] at ([shift={( 0.25,0)}] X2-3) length (\SI{50}{\metre}); +\berth[backward,length=2cm] at (X2-3) length (\SI{60}{\metre}); + +\berth[backward] at (X3-2) length (); +\berth[position=left,backward] at (X3-3) length (); +\berth[forward] at (X4-2) length (); +\berth[position=left,forward] at (X4-3) length (); \ No newline at end of file diff --git a/test/bridge.tikz b/test/bridge.tikz new file mode 100644 index 0000000..765e0ac --- /dev/null +++ b/test/bridge.tikz @@ -0,0 +1,32 @@ +%!TEX TS-program = pdflatexmk +%!TEX root = test.tex + +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\node[blue] at (4,0) {\large test bridge symbol}; + +\foreach \i in {1,2,...,4}{% base coordinate + \coordinate (A\i) at ($(0,0) + 2*(0,-\i)$);% base coordinate + \coordinate (B\i) at ($(8,0) + 2*(0,-\i)$);% base coordinate +} + + +\foreach \i in {1,2,...,4}{% coordinates for testing symbols + \coordinate (X\i-1) at ($(1,0) + 2*(0,-\i)$); + \coordinate (X\i-2) at ($(3,0) + 2*(0,-\i)$); + \coordinate (X\i-3) at ($(5,0) + 2*(0,-\i)$); + \coordinate (X\i-4) at ($(7,0) + 2*(0,-\i)$); +} + +\bridge[length=2cm,width=1cm] at (X3-1); +\maintrack (A3) -- (B3); +\bridge[rotate=-45,shift left=0.75cm] at (X3-3); +\maintrack (X1-1) -- (X4-4); +\bridge[length=2cm,shift right=0.75cm] at (X2-2); +\bridge[length=2cm,width=1.5cm] at (7,-3); +\maintrack (A2) -- (B2); +\maintrack (X1-2) -- (B1); + +\bridge[no background,length=1cm,side=right] at (X1-2); +\bridge[no background,length=1cm,side=left] at (X1-3); \ No newline at end of file diff --git a/test/clearingpoints.tikz b/test/clearingpoints.tikz new file mode 100644 index 0000000..ca3f6d2 --- /dev/null +++ b/test/clearingpoints.tikz @@ -0,0 +1,43 @@ +%!TEX TS-program = pdflatexmk +%!TEX root = test.tex + +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\node[blue] at (4,0) {\large test clearing points symbols}; + +\foreach \i in {1,2,...,4}{% base coordinate + \coordinate (A\i) at ($(0,0) + 2*(0,-\i)$);% base coordinate + \coordinate (B\i) at ($(8,0) + 2*(0,-\i)$);% base coordinate +} + +\foreach \i in {1,2,...,4}{% draw main tracks on base coordinate + \maintrack (A\i) -- (B\i); +} + +\foreach \i in {1,2,...,4}{% coordinates for testing symbols + \coordinate (X\i-1) at ($(1,0) + 2*(0,-\i)$); + \coordinate (X\i-2) at ($(3,0) + 2*(0,-\i)$); + \coordinate (X\i-3) at ($(5,0) + 2*(0,-\i)$); + \coordinate (X\i-4) at ($(7,0) + 2*(0,-\i)$); +} + +\clearingpoint[] at (X1-1) label (X1-1); +\clearingpoint[backward] at (X1-2) label (X1-2); +\clearingpoint[forward ,position=left] at (X1-3) label (X1-3); +\clearingpoint[backward,position=left] at (X1-4) label (X1-4); + +\blockclearing[] at (X2-1) label (X2-1); +\blockclearing[backward] at (X2-2) label (X2-2); +\blockclearing[forward ,position=left] at (X2-3) label (X2-3); +\blockclearing[backward,position=left] at (X2-4) label (X2-4); + +\routeclearing[] at (X3-1) label (X3-1); +\routeclearing[backward] at (X3-2) label (X3-2); +\routeclearing[forward ,position=left] at (X3-3) label (X3-3); +\routeclearing[backward,position=left] at (X3-4) label (X3-4); + +\clearingpoint[standard,route,block,forward ] at (X4-1) label (X4-1); +\clearingpoint[standard,route,block,backward] at (X4-2) label (X4-2); +\clearingpoint[standard,route,block,forward ,position=left] at (X4-3) label (X4-3); +\clearingpoint[standard,route,block,backward,position=left] at (X4-4) label (X4-4); \ No newline at end of file diff --git a/test/crossing.tikz b/test/crossing.tikz index 080c0c8..1120f12 100644 --- a/test/crossing.tikz +++ b/test/crossing.tikz @@ -1,7 +1,7 @@ %!TEX TS-program = pdflatexmk %!TEX root = test.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. \node[blue] at (4,0) {\large test crossings}; diff --git a/test/level_crossing.tikz b/test/level_crossing.tikz new file mode 100644 index 0000000..660eafc --- /dev/null +++ b/test/level_crossing.tikz @@ -0,0 +1,40 @@ +%!TEX TS-program = pdflatexmk +%!TEX root = test.tex + +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\node[blue] at (4,0) {\large test level crossing symbols}; + +\foreach \i in {1,2,...,5}{% base coordinate + \coordinate (A\i) at ($(0,0) + (0,-\i)$);% base coordinate + \coordinate (B\i) at ($(8,0) + (0,-\i)$);% base coordinate +} + +\foreach \i in {1,2,...,5}{% draw main tracks on base coordinate + \maintrack (A\i) -- (B\i); +} + +\foreach \i in {1,2,...,5}{% coordinates for testing symbols + \coordinate (X\i-1) at ($(1,0) + (0,-\i)$); + \coordinate (X\i-2) at ($(3,0) + (0,-\i)$); + \coordinate (X\i-3) at ($(5,0) + (0,-\i)$); + \coordinate (X\i-4) at ($(7,0) + (0,-\i)$); +} + +\levelcrossing[] at (X1-1); +\levelcrossing[no road,barrier=semi] at (X1-2); +\levelcrossing[road width=1cm] at (X1-3); +\levelcrossing[width=0.2cm] at (X1-4); + +\levelcrossing[barrier=semi] at (X2-2); +\levelcrossing[barrier=semi,position=left] at (X2-3); + +\levelcrossing[barrier=full] at (X3-1); +\levelcrossing[barrier=full,position=left] at (X3-4); + +\levelcrossing[barrier=semi,side=left] at (X4-2); +\levelcrossing[barrier=semi,side=right] at (X5-2); + +\levelcrossing[road width=1cm,barrier=full,side=left] at (X4-3); +\levelcrossing[road width=1cm,barrier=full,side=right] at (X5-3); \ No newline at end of file diff --git a/test/messure.tikz b/test/messure.tikz new file mode 100644 index 0000000..5d8e42f --- /dev/null +++ b/test/messure.tikz @@ -0,0 +1,32 @@ +%!TEX TS-program = pdflatexmk +%!TEX root = test.tex + +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\node[blue] at (4,0) {\large test messure symbols}; + +\foreach \i in {1,2,3}{% base coordinate + \coordinate (A\i) at ($(0,0) + 2*(0,-\i)$);% base coordinate + \coordinate (B\i) at ($(8,0) + 2*(0,-\i)$);% base coordinate +} + +\foreach \i in {1,2}{% draw main tracks on base coordinate + \maintrack (A\i) -- (B\i); +} + +\foreach \i in {1,2}{% coordinates for testing symbols + \coordinate (X\i-1) at ($(1,0) + 2*(0,-\i)$); + \coordinate (X\i-2) at ($(3,0) + 2*(0,-\i)$); + \coordinate (X\i-3) at ($(5,0) + 2*(0,-\i)$); + \coordinate (X\i-4) at ($(7,0) + 2*(0,-\i)$); +} + +\trackdistance between (3,-1) and (X1-2) label (4,50); +\trackdistance between (X1-2) and (X2-3) label (\SI[math-rm=\mathsf]{6,50}{\metre}); +\trackdistance between (X1-4) and (X2-4) label (5,50); + +\tikzset{hectometer base={(A3)},orientation=right}; +\hectometer[] at (X2-1) mileage (\SI[math-rm=\mathsf]{6,505}{\kilo\metre}); +\hectometer[shift label={(0.3,-1)}] at (X2-2) mileage (name); +% \messureline between (a) and (b); \ No newline at end of file diff --git a/test/misc_topology.tikz b/test/misc_topology.tikz index 29fd88c..701ff1e 100644 --- a/test/misc_topology.tikz +++ b/test/misc_topology.tikz @@ -1,25 +1,25 @@ %!TEX TS-program = pdflatexmk %!TEX root = test.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. \node[blue] at (4,0) {\large test misc. topology symbols}; -\foreach \i in {1,2,...,3}{% base coordinate +\foreach \i in {1,2,...,5}{% base coordinate \coordinate (A\i) at ($(0,0) + 2*(0,-\i)$);% base coordinate \coordinate (B\i) at ($(8,0) + 2*(0,-\i)$);% base coordinate } -\foreach \i in {1}{% draw main tracks on base coordinate +\foreach \i in {1,4}{% draw main tracks on base coordinate \maintrack (A\i) -- (B\i); } -\foreach \i in {2,3}{% draw secondary tracks on base coordinate +\foreach \i in {2,3,5}{% draw secondary tracks on base coordinate \secondarytrack (A\i) -- (B\i); } -\foreach \i in {1,2,...,3}{% coordinates for testing symbols +\foreach \i in {1,2,...,5}{% coordinates for testing symbols \coordinate (X\i-1) at ($(1,0) + 2*(0,-\i)$); \coordinate (X\i-2) at ($(3,0) + 2*(0,-\i)$); \coordinate (X\i-3) at ($(5,0) + 2*(0,-\i)$); @@ -29,8 +29,6 @@ \tracklabel at (X1-1) label (12); \tracklabel at (X1-3) label (really long text); \tracklabel at (X2-2) label (22); -\trackdistance between (X1-2) and (X2-3) label (\SI[math-rm=\mathsf]{6,50}{\metre}); -\trackdistance between (X1-4) and (X2-4) label (4,50); \derailer[forward ,branch=left ] at (X3-1) label (X3-1); \derailer[backward,branch=left ] at (X3-2) label (X3-2); @@ -42,4 +40,9 @@ \bufferstop[backward,friction=.5] at (A2); \bufferstop[forward ,friction=.5] at (B2); \bufferstop[backward] at (A3); -\bufferstop[forward] at (B3); \ No newline at end of file +\bufferstop[forward] at (B3); + +\trackclosure at (A4); +\trackclosure at (B4); +\trackclosure at (A5); +\trackclosure at (B5); diff --git a/test/platform.tikz b/test/platform.tikz new file mode 100644 index 0000000..bd51ce2 --- /dev/null +++ b/test/platform.tikz @@ -0,0 +1,34 @@ +%!TEX TS-program = pdflatexmk +%!TEX root = test.tex + +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\node[blue] at (4,0) {\large test platform symbols}; + +\foreach \i in {1,2,...,3}{% base coordinate + \coordinate (A\i) at ($(0,0) + (0,-\i)$);% base coordinate + \coordinate (B\i) at ($(8,0) + (0,-\i)$);% base coordinate +} + +\foreach \i in {1,2,...,3}{% draw main tracks on base coordinate + \maintrack (A\i) -- (B\i); +} + +\foreach \i in {1,2,...,3}{% coordinates for testing symbols + \coordinate (X\i-1) at ($(1,0) + (0,-\i)$); + \coordinate (X\i-2) at ($(3,0) + (0,-\i)$); + \coordinate (X\i-3) at ($(5,0) + (0,-\i)$); + \coordinate (X\i-4) at ($(7,0) + (0,-\i)$); +} + +\platform[side=left,length=2cm] at (X1-1); +\platform[side=left,width=1cm] at (X1-3); + +\platform[side=left,length=1cm,rotate=45] at (X2-2); + +\platform[side=right,length=2cm] at (X2-1); +\platform[side=right] at (X2-3); + +\platform[side=both,length=2cm] at (X3-1); +\platform[side=both] at (X3-3); diff --git a/test/shunting.tikz b/test/shunting.tikz new file mode 100644 index 0000000..79f6fa3 --- /dev/null +++ b/test/shunting.tikz @@ -0,0 +1,46 @@ +%!TEX TS-program = pdflatexmk +%!TEX root = test.tex + +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\node[blue] at (4,0) {\large test shunting movements}; + +\foreach \i in {1,2,...,9}{% base coordinate + \coordinate (A\i) at ($(-1,0) + 2*(0,-\i)$); + \coordinate (B\i) at ($( 9,0) + 2*(0,-\i)$); +} + +\foreach \i in {1,2,...,9}{% draw main tracks on base coordinate + \secondarytrack (A\i) -- (B\i); +} + +\foreach \i in {1,2,...,9}{% coordinates for testing symbols + \coordinate (T\i-1) at ($(1,0) + 2*(0,-\i)$); + \coordinate (T\i-2) at ($(4,0) + 2*(0,-\i)$); + \coordinate (T\i-3) at ($(7,0) + 2*(0,-\i)$); +} + +\parkedvehicles[length=0.5cm] at (T1-1) label (T1-1); +\parkedvehicles[] at (T1-2) label (T1-2); +\parkedvehicles[length=1.5cm] at (T1-3) label (T1-3); + +\shunting[forward] at (T2-2) label (T2-2); +\shunting[forward ,length=2.5cm] at (T2-3) label (T2-3); +\shunting[backward,length=2.5cm] at (T3-1) label (T3-1); +\shunting[backward] at (T3-2) label (T3-2); + +\shunting[movement,forward] at (T4-2) label (T4-2); +\shunting[movement,forward ,length=2.5cm] at (T4-3) label (T4-3); +\shunting[movement,backward,length=2.5cm] at (T5-1) label (T5-1); +\shunting[movement,backward] at (T5-2) label (T5-2); + +\shunting[operation=manual,movement,forward] at (T6-2) label (T6-2); +\shunting[operation=manual,movement,forward ,length=2.5cm] at (T6-3) label (T6-3); +\shunting[operation=manual,movement,backward,length=2.5cm] at (T7-1) label (T7-1); +\shunting[operation=manual,movement,backward] at (T7-2) label (T7-2); + +\shunting[operation=automatic,movement,forward] at (T8-2) label (T8-2); +\shunting[operation=automatic,movement,forward ,length=2.5cm] at (T8-3) label (T8-3); +\shunting[operation=automatic,movement,backward,length=2.5cm] at (T9-1) label (T9-1); +\shunting[operation=automatic,movement,backward] at (T9-2) label (T9-2); diff --git a/test/signals.tikz b/test/signals.tikz new file mode 100644 index 0000000..64de66c --- /dev/null +++ b/test/signals.tikz @@ -0,0 +1,78 @@ +%!TEX TS-program = pdflatexmk +%!TEX root = test.tex + +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\node[blue] at (4,0) {\large test signal symbols}; + +\foreach \i in {1,2,...,11}{% base coordinate + \coordinate (A\i) at ($(0,0) + 2*(0,-\i)$);% base coordinate + \coordinate (B\i) at ($(8,0) + 2*(0,-\i)$);% base coordinate +} + +\foreach \i in {1,2,...,11}{% draw main tracks on base coordinate + \maintrack (A\i) -- (B\i); +} + +\foreach \i in {1,2,...,11}{% coordinates for testing symbols + \coordinate (X\i-1) at ($(1,0) + 2*(0,-\i)$); + \coordinate (X\i-2) at ($(3,0) + 2*(0,-\i)$); + \coordinate (X\i-3) at ($(5,0) + 2*(0,-\i)$); + \coordinate (X\i-4) at ($(7,0) + 2*(0,-\i)$); +} + +\viewpoint[forward ] at (X1-1); +\viewpoint[forward ,position=left] at (X1-2); +\viewpoint[backward,position=left] at (X1-3); +\viewpoint[backward] at (X1-4); + +\distantsignal[forward ,distant speed=5] at (X2-1) label (X2-1); +\distantsignal[forward ,distant speed=5,position=left] at (X2-2) label (X2-2); +\distantsignal[backward,distant speed=5,position=left] at (X2-3) label (X2-3); +\distantsignal[backward,distant speed=5] at (X2-4) label (X2-4); + +\speedsignal[forward ,speed=5] at (X3-1) label (X3-1); +\speedsignal[forward ,speed=5,position=left] at (X3-2) label (X3-2); +\speedsignal[backward,speed=5,position=left] at (X3-3) label (X3-3); +\speedsignal[backward,speed=5] at (X3-4) label (X3-4); + +\blocksignal[forward ,locked,speed=5] at (X4-1) label (X4-1); +\blocksignal[forward ,locked,speed=5,position=left] at (X4-2) label (X4-2); +\blocksignal[backward,locked,speed=5,position=left] at (X4-3) label (X4-3); +\blocksignal[backward,locked,speed=5] at (X4-4) label (X4-4); + +\routesignal[forward ,locked,speed=5] at (X5-1) label (X5-1); +\routesignal[forward ,locked,speed=5,position=left] at (X5-2) label (X5-2); +\routesignal[backward,locked,speed=5,position=left] at (X5-3) label (X5-3); +\routesignal[backward,locked,speed=5] at (X5-4) label (X5-4); + +\shuntsignal[forward ,locked] at (X6-1) label (X6-1); +\shuntsignal[forward ,locked,position=left] at (X6-2) label (X6-2); +\shuntsignal[backward,locked,position=left] at (X6-3) label (X6-3); +\shuntsignal[backward,locked] at (X6-4) label (X6-4); + +\signal[forward ,distant,block,route,distant speed=5,speed=5] at (X7-1) label (X7-1); +\signal[forward ,distant,block,route,distant speed=5,speed=5,position=left] at (X7-2) label (X7-2); +\signal[backward,distant,block,route,distant speed=5,speed=5,position=left] at (X7-3) label (X7-3); +\signal[backward,distant,block,route,distant speed=5,speed=5] at (X7-4) label (X7-4); + +\shuntlimit[forward ] at (X8-1) label (X8-1); +\shuntlimit[forward ,position=left] at (X8-2) label (X8-2); +\shuntlimit[backward,position=left] at (X8-3) label (X8-3); +\shuntlimit[backward] at (X8-4) label (X8-4); + +\berthsignal[forward ] at (X9-1) label (X9-1); +\berthsignal[forward ,position=left] at (X9-2) label (X9-2); +\berthsignal[backward,position=left] at (X9-3) label (X9-3); +\berthsignal[backward] at (X9-4) label (X9-4); + +\movementauthority[forward ] at (X10-1) label (X10-1); +\movementauthority[forward ,position=left] at (X10-2) label (X10-2); +\movementauthority[backward,position=left,direction arrow=false] at (X10-3) label (X10-3); +\movementauthority[backward] at (X10-4) label (X10-4); + +\signal[forward ,block,shunting] at (X11-1) label (X11-1); +\signal[forward ,route,shunting] at (X11-2) label (X11-2); +\signal[backward,route,shunting] at (X11-3) label (X11-3); +\signal[backward,block,shunting] at (X11-4) label (X11-4); diff --git a/test/slipturnout.tikz b/test/slipturnout.tikz index d064b60..f813699 100644 --- a/test/slipturnout.tikz +++ b/test/slipturnout.tikz @@ -1,7 +1,7 @@ %!TEX TS-program = pdflatexmk %!TEX root = test.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. \node[blue] at (4,0) {\large test slip turnouts}; @@ -75,18 +75,18 @@ \slipturnout[branch=right,forward points=moving,backward points=moving] at (X6-1) label (X6-1a)(X6-1b); \slipturnout[branch=left ,forward points=moving,backward points=moving] at (X6-2) label (X6-2a)(X6-2b); -\slipturnout[branch=right,manual operated] at (X6-3) label (X6-3a)(X6-3b); -\slipturnout[branch=left ,manual operated] at (X6-4) label (X6-4a)(X6-4b); +\slipturnout[branch=right,operation=manual] at (X6-3) label (X6-3a)(X6-3b); +\slipturnout[branch=left ,operation=manual] at (X6-4) label (X6-4a)(X6-4b); -\slipturnout[branch=right,manual operated] at (X7-1) label (X7-1a)(X7-1b); -\slipturnout[branch=left ,manual operated] at (X7-2) label (X7-2a)(X7-2b); -\slipturnout[branch=right,manual operated,fouling point] at (X7-3) label (X7-3a)(X7-3b); -\slipturnout[branch=left ,manual operated,fouling point] at (X7-4) label (X7-4a)(X7-4b); +\slipturnout[branch=right,operation=manual] at (X7-1) label (X7-1a)(X7-1b); +\slipturnout[branch=left ,operation=manual] at (X7-2) label (X7-2a)(X7-2b); +\slipturnout[branch=right,operation=manual,fouling point] at (X7-3) label (X7-3a)(X7-3b); +\slipturnout[branch=left ,operation=manual,fouling point] at (X7-4) label (X7-4a)(X7-4b); -\slipturnout[branch=right,manual operated,slip=right] at (X8-1) label (X8-1a)(X8-1b); -\slipturnout[branch=left ,manual operated,slip=right] at (X8-2) label (X8-2a)(X8-2b); -\slipturnout[branch=right,manual operated,slip=left ] at (X8-3) label (X8-3a)(X8-3b); -\slipturnout[branch=left ,manual operated,slip=left ] at (X8-4) label (X8-4a)(X8-4b); +\slipturnout[branch=right,operation=manual,slip=right] at (X8-1) label (X8-1a)(X8-1b); +\slipturnout[branch=left ,operation=manual,slip=right] at (X8-2) label (X8-2a)(X8-2b); +\slipturnout[branch=right,operation=manual,slip=left ] at (X8-3) label (X8-3a)(X8-3b); +\slipturnout[branch=left ,operation=manual,slip=left ] at (X8-4) label (X8-4a)(X8-4b); \slipturnout[branch=right,slip=right] at (X9-1) label (X9-1a)(X9-1b); \slipturnout[branch=left ,slip=right] at (X9-2) label (X9-2a)(X9-2b); diff --git a/test/test.pdf b/test/test.pdf index 37d20b4..32ca67a 100644 Binary files a/test/test.pdf and b/test/test.pdf differ diff --git a/test/test.tex b/test/test.tex index 8ed633e..af3ef50 100644 --- a/test/test.tex +++ b/test/test.tex @@ -1,11 +1,11 @@ %!TEX TS-program = pdflatexmk -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. \documentclass[tikz,border=2]{standalone} -\usepackage{lmodern,siunitx} +\usepackage{siunitx} \usepackage[prefix=]{xcolor-solarized} \usetikzlibrary{trackschematic} @@ -23,4 +23,37 @@ \begin{tikzpicture}[font=\sffamily] \input{misc_topology.tikz} \end{tikzpicture} + \begin{tikzpicture}[font=\sffamily] + \input{shunting.tikz} + \end{tikzpicture} + \begin{tikzpicture}[font=\sffamily] + \input{train.tikz} + \end{tikzpicture} + \begin{tikzpicture}[font=\sffamily] + \input{bend_vehicles.tikz} + \end{tikzpicture} + \begin{tikzpicture}[font=\sffamily] + \input{signals.tikz} + \end{tikzpicture} + \begin{tikzpicture}[font=\sffamily] + \input{clearingpoints.tikz} + \end{tikzpicture} + \begin{tikzpicture}[font=\sffamily] + \input{transmitter.tikz} + \end{tikzpicture} + \begin{tikzpicture}[font=\sffamily] + \input{platform.tikz} + \end{tikzpicture} + \begin{tikzpicture}[font=\sffamily] + \input{level_crossing.tikz} + \end{tikzpicture} + \begin{tikzpicture}[font=\sffamily] + \input{bridge.tikz} + \end{tikzpicture} + \begin{tikzpicture}[font=\sffamily] + \input{berth.tikz} + \end{tikzpicture} + \begin{tikzpicture}[font=\sffamily] + \input{messure.tikz} + \end{tikzpicture} \end{document} \ No newline at end of file diff --git a/test/train.tikz b/test/train.tikz new file mode 100644 index 0000000..579d46f --- /dev/null +++ b/test/train.tikz @@ -0,0 +1,57 @@ +%!TEX TS-program = pdflatexmk +%!TEX root = test.tex + +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\node[blue] at (4,0) {\large test train run}; + +\foreach \i in {1,2,...,14}{% base coordinate + \coordinate (A\i) at ($(-1,0) + 2*(0,-\i)$); + \coordinate (B\i) at ($( 9,0) + 2*(0,-\i)$); +} + +\foreach \i in {1,2,...,14}{% draw main tracks on base coordinate + \maintrack (A\i) -- (B\i); +} + +\foreach \i in {1,2,...,14}{% coordinates for testing symbols + \coordinate (T\i-1) at ($(1,0) + 2*(0,-\i)$); + \coordinate (T\i-2) at ($(4,0) + 2*(0,-\i)$); + \coordinate (T\i-3) at ($(7,0) + 2*(0,-\i)$); +} + +\train[forward] at (T1-2) label (T1-2); +\train[forward ,length=2.5cm] at (T1-3) label (T1-3); +\train[backward,length=2.5cm] at (T2-1) label (T2-1); +\train[backward] at (T2-2) label (T2-2); + +\train[run=normal,forward] at (T3-2) label (T3-2); +\train[run=normal,forward ,length=2.5cm] at (T3-3) label (T3-3); +\train[run=normal,backward,length=2.5cm] at (T4-1) label (T4-1); +\train[run=normal,backward] at (T4-2) label (T4-2); + +\train[run=slow,forward] at (T5-2) label (T5-2); +\train[run=slow,forward ,length=2.5cm] at (T5-3) label (T5-3); +\train[run=slow,backward,length=2.5cm] at (T6-1) label (T6-1); +\train[run=slow,backward] at (T6-2) label (T6-2); + +\train[run=fast,forward] at (T7-2) label (T7-2); +\train[run=fast,forward ,length=2.5cm] at (T7-3) label (T7-3); +\train[run=fast,backward,length=2.5cm] at (T8-1) label (T8-1); +\train[run=fast,backward] at (T8-2) label (T8-2); + +\train[ghost,forward] at (T9-2) label (T9-2); +\train[ghost,forward ,length=2.5cm] at (T9-3) label (T9-3); +\train[ghost,backward,length=2.5cm] at (T10-1) label (T10-1); +\train[ghost,backward] at (T10-2) label (T10-2); + +\train[operation=manual,forward] at (T11-2) label (T11-2); +\train[operation=manual,forward ,length=2.5cm] at (T11-3) label (T11-3); +\train[operation=manual,backward,length=2.5cm] at (T12-1) label (T12-1); +\train[operation=manual,backward] at (T12-2) label (T12-2); + +\train[operation=automatic,forward] at (T13-2) label (T13-2); +\train[operation=automatic,forward ,length=2.5cm] at (T13-3) label (T13-3); +\train[operation=automatic,backward,length=2.5cm] at (T14-1) label (T14-1); +\train[operation=automatic,backward] at (T14-2) label (T14-2); diff --git a/test/transmitter.tikz b/test/transmitter.tikz new file mode 100644 index 0000000..d2de3dc --- /dev/null +++ b/test/transmitter.tikz @@ -0,0 +1,36 @@ +%!TEX TS-program = pdflatexmk +%!TEX root = test.tex + +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) +% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +\node[blue] at (4,0) {\large test transmitter symbols}; + +\foreach \i in {1,2,...,3}{% base coordinate + \coordinate (A\i) at ($(0,0) + 2*(0,-\i)$);% base coordinate + \coordinate (B\i) at ($(8,0) + 2*(0,-\i)$);% base coordinate +} + +\foreach \i in {1,2,...,3}{% draw main tracks on base coordinate + \maintrack (A\i) -- (B\i); +} + +\foreach \i in {1,2,...,3}{% coordinates for testing symbols + \coordinate (X\i-1) at ($(1,0) + 2*(0,-\i)$); + \coordinate (X\i-2) at ($(3,0) + 2*(0,-\i)$); + \coordinate (X\i-3) at ($(5,0) + 2*(0,-\i)$); + \coordinate (X\i-4) at ($(7,0) + 2*(0,-\i)$); +} + +\balise[] at (X1-1) label (X1-1); +\balise[position=left] at (X1-2) label (X1-2); +\balise[forward] at (X1-3) label (X1-3); +\balise[forward,position=left] at (X1-4) label (X1-4); + +\balise[backward] at (X2-1) label (X2-1); +\balise[backward,position=left] at (X2-2) label (X2-2); +\balise[bidirectional] at (X2-3) label (X2-3); +\balise[bidirectional,position=left] at (X2-4) label (X2-4); + +\trackloop[] at (X3-1) label (X3-1); +\trackloop[position=left] at (X3-2) label (X3-2); \ No newline at end of file diff --git a/test/turnout.tikz b/test/turnout.tikz index 398e1ed..c39456e 100644 --- a/test/turnout.tikz +++ b/test/turnout.tikz @@ -1,7 +1,7 @@ %!TEX TS-program = pdflatexmk %!TEX root = test.tex -% Copyright 2019 Martin Scheidt (ISC license) +% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license) % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. \node[blue] at (4,0) {\large test turnouts}; @@ -28,16 +28,16 @@ \foreach \i in {1,2,...,5}{% coordinates for testing symbols \maintrack (Y\i-1) -- ++( 0.75, 0.75); - \maintrack (Y\i-2) -- ++(-0.75,-0.75); + \maintrack (Y\i-2) -- ++(-0.75, 0.75); \maintrack (Y\i-3) -- ++( 0.75,-0.75); - \maintrack (Y\i-4) -- ++(-0.75, 0.75); + \maintrack (Y\i-4) -- ++(-0.75,-0.75); } \foreach \i in {6,7,...,10}{% coordinates for testing symbols \secondarytrack (Y\i-1) -- ++( 0.75, 0.75); - \secondarytrack (Y\i-2) -- ++(-0.75,-0.75); + \secondarytrack (Y\i-2) -- ++(-0.75, 0.75); \secondarytrack (Y\i-3) -- ++( 0.75,-0.75); - \secondarytrack (Y\i-4) -- ++(-0.75, 0.75); + \secondarytrack (Y\i-4) -- ++(-0.75,-0.75); } \turnout[forward ,branch=left ] at (Y1-1) label (Y1-1); @@ -61,23 +61,23 @@ \turnout[forward ,branch=right,points=moving] at (Y5-3) label (Y5-3); \turnout[backward,branch=right,points=moving] at (Y5-4) label (Y5-4); -\turnout[forward ,branch=left ,manual operated] at (Y6-1) label (Y6-1); -\turnout[backward,branch=left ,manual operated] at (Y6-2) label (Y6-2); -\turnout[forward ,branch=right,manual operated] at (Y6-3) label (Y6-3); -\turnout[backward,branch=right,manual operated] at (Y6-4) label (Y6-4); -\turnout[forward ,branch=left ,manual operated,fouling point] at (Y7-1) label (Y7-1); -\turnout[backward,branch=left ,manual operated,fouling point] at (Y7-2) label (Y7-2); -\turnout[forward ,branch=right,manual operated,fouling point] at (Y7-3) label (Y7-3); -\turnout[backward,branch=right,manual operated,fouling point] at (Y7-4) label (Y7-4); -\turnout[forward ,branch=left ,manual operated,points=right] at (Y8-1) label (Y8-1); -\turnout[backward,branch=left ,manual operated,points=right] at (Y8-2) label (Y8-2); -\turnout[forward ,branch=right,manual operated,points=right] at (Y8-3) label (Y8-3); -\turnout[backward,branch=right,manual operated,points=right] at (Y8-4) label (Y8-4); -\turnout[forward ,branch=left ,manual operated,points=left ] at (Y9-1) label (Y9-1); -\turnout[backward,branch=left ,manual operated,points=left ] at (Y9-2) label (Y9-2); -\turnout[forward ,branch=right,manual operated,points=left ] at (Y9-3) label (Y9-3); -\turnout[backward,branch=right,manual operated,points=left ] at (Y9-4) label (Y9-4); -\turnout[forward ,branch=left ,manual operated,points=moving] at (Y10-1) label (Y10-1); -\turnout[backward,branch=left ,manual operated,points=moving] at (Y10-2) label (Y10-2); -\turnout[forward ,branch=right,manual operated,points=moving] at (Y10-3) label (Y10-3); -\turnout[backward,branch=right,manual operated,points=moving] at (Y10-4) label (Y10-4); +\turnout[forward ,branch=left ,operation=manual] at (Y6-1) label (Y6-1); +\turnout[backward,branch=left ,operation=manual] at (Y6-2) label (Y6-2); +\turnout[forward ,branch=right,operation=manual] at (Y6-3) label (Y6-3); +\turnout[backward,branch=right,operation=manual] at (Y6-4) label (Y6-4); +\turnout[forward ,branch=left ,operation=manual,fouling point] at (Y7-1) label (Y7-1); +\turnout[backward,branch=left ,operation=manual,fouling point] at (Y7-2) label (Y7-2); +\turnout[forward ,branch=right,operation=manual,fouling point] at (Y7-3) label (Y7-3); +\turnout[backward,branch=right,operation=manual,fouling point] at (Y7-4) label (Y7-4); +\turnout[forward ,branch=left ,operation=manual,points=right] at (Y8-1) label (Y8-1); +\turnout[backward,branch=left ,operation=manual,points=right] at (Y8-2) label (Y8-2); +\turnout[forward ,branch=right,operation=manual,points=right] at (Y8-3) label (Y8-3); +\turnout[backward,branch=right,operation=manual,points=right] at (Y8-4) label (Y8-4); +\turnout[forward ,branch=left ,operation=manual,points=left ] at (Y9-1) label (Y9-1); +\turnout[backward,branch=left ,operation=manual,points=left ] at (Y9-2) label (Y9-2); +\turnout[forward ,branch=right,operation=manual,points=left ] at (Y9-3) label (Y9-3); +\turnout[backward,branch=right,operation=manual,points=left ] at (Y9-4) label (Y9-4); +\turnout[forward ,branch=left ,operation=manual,points=moving] at (Y10-1) label (Y10-1); +\turnout[backward,branch=left ,operation=manual,points=moving] at (Y10-2) label (Y10-2); +\turnout[forward ,branch=right,operation=manual,points=moving] at (Y10-3) label (Y10-3); +\turnout[backward,branch=right,operation=manual,points=moving] at (Y10-4) label (Y10-4);