2021-01-02 14:04:05 +01:00
%!TEX TS-program = pdflatexmk
%!TEX root = ../test/test.tex
%
2018-09-14 21:04:15 +02:00
%% symbol library for TikZ track schematics
%
2021-01-02 14:04:05 +01:00
% Copyright (c) 2018 - 2021, Martin Scheidt (ISC license)
2019-07-21 19:28:30 +02:00
%
2018-09-14 21:04:15 +02:00
% 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.
2020-01-14 17:11:10 +01:00
%
\ProvidesFileRCS { tikzlibrarytrackschematic.trafficcontrol.code.tex} %
%
%%%%%%%%%%%%%%%
% Requirements
%%%%%%%%%%%%%%%
2021-09-30 12:37:31 +02:00
\RequirePackage { tikz,etoolbox} %
2020-01-14 17:11:10 +01:00
\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}
2021-01-02 14:04:05 +01:00
% symbology entry
symbology_ distant_ signal/.pic = { %
\maintrack (0,0) -- (6,0);%
\distantsignal [forward] at (3,0) label ();%
} ,%
% symbology entry
symbology_ distant_ speed_ signal/.pic = { %
\maintrack (0,0) -- (6,0);%
\distantsignal [forward,distant speed={s}] at (3,0) label ();%
} ,%
% symbology entry
symbology_ speed_ signal/.pic = { %
\maintrack (0,0) -- (6,0);%
\speedsignal [forward,speed={s}] at (3,0) label ();%
} ,%
% symbology entry
symbology_ block_ signal/.pic = { %
\maintrack (0,0) -- (6,0);%
\blocksignal [forward] at (3,0) label ();%
} ,%
% symbology entry
symbology_ route_ signal/.pic = { %
\maintrack (0,0) -- (6,0);%
\routesignal [forward] at (3,0) label ();%
} ,%
% symbology entry
symbology_ combined_ signal/.pic = { %
\maintrack (0,0) -- (6,0);%
\signal [distant,block,route,forward,distant speed={ds},speed={s}] at (3,0) label ();%
} ,%
% symbology entry
symbology_ shunt_ signal/.pic = { %
\maintrack (0,0) -- (6,0);%
\shuntsignal [forward] at (3,0) label ();%
} ,%
% symbology entry
symbology_ locked_ shunt_ signal/.pic = { %
\maintrack (0,0) -- (6,0);%
\shuntsignal [forward,locked] at (3,0) label ();%
} ,%
% symbology entry
symbology_ shunt_ limit/.pic = { %
\maintrack (0,0) -- (6,0);%
\shuntlimit [forward] at (3,0) label ();%
} ,%
% symbology entry
symbology_ train_ berth_ sign/.pic = { %
\maintrack (0,0) -- (6,0);%
\berthsignal [forward] at (3,0) label ();%
} ,%
2020-01-14 17:11:10 +01:00
} %
%
%%%%%%%%%%%%%%%
% 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}
2021-01-02 14:04:05 +01:00
% symbology entry
symbology_ clearing_ point/.pic = { %
\maintrack (0,0) -- (6,0);%
\clearingpoint [forward] at (3,0) label ();%
} ,%
% symbology entry
symbology_ block_ clearing_ point/.pic = { %
\maintrack (0,0) -- (6,0);%
\blockclearing [forward] at (3,0) label ();%
} ,%
% symbology entry
symbology_ route_ clearing_ point/.pic = { %
\maintrack (0,0) -- (6,0);%
\routeclearing [forward] at (3,0) label ();%
} ,%
2020-01-14 17:11:10 +01:00
} %
%
%%%%%%%%%%%%%%%
% 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}
2021-01-02 14:04:05 +01:00
% symbology entry
symbology_ transmitter/.pic = { %
\maintrack (0,0) -- (6,0);%
\balise [] at (3,0) label ();%
} ,%
% symbology entry
symbology_ transmitter_ forward/.pic = { %
\maintrack (0,0) -- (6,0);%
\balise [forward] at (3,0) label ();%
} ,%
% symbology entry
symbology_ transmitter_ bidirectional/.pic = { %
\maintrack (0,0) -- (6,0);%
\balise [bidirectional] at (3,0) label ();%
} ,%
% symbology entry
symbology_ loop_ transmitter/.pic = { %
\maintrack (0,0) -- (6,0);%
\transmitter [type=loop] at (3,0) label ();%
} ,%
2020-01-14 17:11:10 +01:00
} %
%
%%%%%%%%%%%%%%%
% 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
2021-01-02 14:04:05 +01:00
} } ,% END pics/view_point/.style args={#1}
% symbology entry
symbology_ view_ point/.pic = { %
\maintrack (0,0) -- (6,0);%
\viewpoint [forward] at (3,0);%
} ,%
2020-01-14 17:11:10 +01:00
} %
%
%%%%%%%%%%%%%%%
% 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
} %
% 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
2020-02-10 15:16:44 +01:00
\path ($ \trafficfactor * \facefactor * ( 0 , - 0 . 55 ) + \facefactor * ( 0 . 3 , 0 ) $ ) rectangle%
++($ \trafficfactor * \facefactor * ( 0 , 0 . 3 ) + \facefactor * ( 0 . 3 , 0 ) $ );%
2020-01-14 17:11:10 +01:00
%% arrow
2020-02-10 15:16:44 +01:00
\path [draw=\foreground,<-,>=latex,line width=1pt] %
($ \facefactor * \trafficfactor * ( 0 , - 0 . 1 ) $ ) -- ++($ \facefactor * \trafficfactor * ( 0 , - 0 . 3 ) $ ) -- ++($ \facefactor * ( 0 . 2 , 0 ) $ );% arrow
2020-01-14 17:11:10 +01:00
%% label
\ifdefstring { \labelcontent } { } { } { % label NOT empty
\tikzset { every node/.style={ font=\sffamily ,text=\foreground } } ;%
2020-02-10 15:16:44 +01:00
\coordinate (ts-ma-l) at ($ \trafficfactor * \facefactor * ( 0 , - 0 . 6 ) + \facefactor * ( 0 . 3 , 0 ) $ );%
2020-01-14 17:11:10 +01:00
\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 } ;%
} %
2021-01-02 14:04:05 +01:00
} } ,% END pics/movement_authority_marker/.style args={#1/#2/#3}
% symbology entry
symbology_ end_ of_ authority/.pic = { %
\maintrack (0,0) -- (6,0);%
\movementauthority [forward] at (3,0) label ();%
} ,%
2020-02-10 15:16:44 +01:00
} %
%
%%%%%%%%%%%%%%%
% symbol braking point
%%%%%%%%%%%%%%%
% command
\newcommand \brakingpoint { } % just for safety
\def \brakingpoint [#1] #2(#3)#4(#5){ % \brakingpoint[options] at (coord) label (name);
\pic [#1] at (#3) { braking_ point_ marker={ #2/#4/#5} } % symbol
} %
% symbol definition
\tikzset { %
pics/braking_ point_ marker/.default=,%
pics/braking_ point_ 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 ($ \trafficfactor * \facefactor * ( 0 , - 0 . 4 ) + \facefactor * ( 0 . 3 , 0 ) $ ) --%
++($ \trafficfactor * \facefactor * ( 0 , - 0 . 15 ) + \facefactor * ( 0 . 25 , 0 ) $ ) --%
++($ \trafficfactor * \facefactor * ( 0 , 0 . 3 ) $ ) -- cycle;% signal marker
%% arrow
\path [draw=\foreground,<-,>=latex,line width=1pt] %
($ \facefactor * \trafficfactor * ( 0 , - 0 . 1 ) $ ) -- ++($ \facefactor * \trafficfactor * ( 0 , - 0 . 3 ) $ ) -- ++($ \facefactor * ( 0 . 2 , 0 ) $ );% arrow
%% label
\ifdefstring { \labelcontent } { } { } { % label NOT empty
\tikzset { every node/.style={ font=\sffamily ,text=\foreground } } ;%
\coordinate (ts-bp-l) at ($ \trafficfactor * \facefactor * ( 0 , - 0 . 6 ) + \facefactor * ( 0 . 3 , 0 ) $ );%
\ifdefstring { \labelcoord } { (none)} { } { % initialize if NOT default
\gettikzxy { \labelcoord } { \labelcoordX } { \labelcoordY } %
\coordinate (ts-bp-l) at ($ ( ts - bp - l ) + ( \labelcoordX , \labelcoordY ) $ );%
} %
\node [\align] at (ts-bp-l) { \footnotesize \labelcontent } ;%
} %
2021-01-02 14:04:05 +01:00
} } ,% END pics/braking_point_marker/.style args={#1/#2/#3}
% symbology entry
symbology_ braking_ point/.pic = { %
\maintrack (0,0) -- (6,0);%
\brakingpoint [forward] at (3,0) label ();%
} ,%
2020-02-10 15:16:44 +01:00
} %
%
%%%%%%%%%%%%%%%
% symbol danger point
%%%%%%%%%%%%%%%
% command
\newcommand \dangerpoint { } % just for safety
\def \dangerpoint [#1] #2(#3)#4(#5){ % \dangerpoint[options] at (coord) label (name);
\pic [#1] at (#3) { danger_ point_ marker={ #2/#4/#5} } % symbol
} %
% symbol definition
\tikzset { %
pics/danger_ point_ marker/.default=,%
pics/danger_ point_ 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 ($ \trafficfactor * \facefactor * ( 0 , - 0 . 4 ) $ ) --%
++($ \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
%% arrow
\path [draw=\foreground,<-,>=latex,line width=1pt] %
($ \facefactor * \trafficfactor * ( 0 , - 0 . 1 ) $ ) -- ++($ \facefactor * \trafficfactor * ( 0 , - 0 . 25 ) $ );% arrow
%% label
\ifdefstring { \labelcontent } { } { } { % label NOT empty
\tikzset { every node/.style={ font=\sffamily ,text=\foreground } } ;%
\coordinate (ts-dp-l) at ($ \trafficfactor * \facefactor * ( 0 , 0 . 25 ) $ );%
\ifdefstring { \labelcoord } { (none)} { } { % initialize if NOT default
\gettikzxy { \labelcoord } { \labelcoordX } { \labelcoordY } %
\coordinate (ts-dp-l) at ($ ( ts - dp - l ) + ( \labelcoordX , \labelcoordY ) $ );%
} %
\node at (ts-dp-l) { \footnotesize \labelcontent } ;%
} %
2021-01-02 14:04:05 +01:00
} } ,% END pics/danger_point_marker/.style args={#1/#2/#3}
% symbology entry
symbology_ danger_ point/.pic = { %
\maintrack (0,0) -- (6,0);%
\dangerpoint [forward] at (3,0) label ();%
} ,%
2020-01-14 17:11:10 +01:00
} %
%
%%%%%%%%%%%%%%%
% 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;%
2021-01-02 14:04:05 +01:00
} } ,% END pics/route/.style args={#1}
% symbology entry
symbology_ route/.pic = { %
\maintrack (0,0) -- (6,0);%
\route [forward] at (3,0);%
} ,%
} %
%
%%%%%%%%%%%%%%%
% symbol direction control
%%%%%%%%%%%%%%%
% command
\newcommand \directioncontrol { } % just for safety
\def \directioncontrol [#1] #2(#3){ % \directioncontrol[options] at (coord);
\pic [#1] at (#3) { direction_ control={ #2} } % symbol
} %
% symbol definition
\tikzset { %
pics/direction_ control/.default=,%
pics/direction_ control/.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}
%
%% face setup
\ifdefstring { \face } { forward} { % face
\path [draw=\foreground,line width=0.5pt,densely dotted] %
($ \trafficfactor * ( 0 , 0 . 1 ) + ( - 0 . 0125 , 0 ) $ ) -- ($ \trafficfactor * ( 0 , 0 . 25 ) + ( - 0 . 2125 , 0 ) $ ) -- ($ \trafficfactor * ( 0 , 0 . 4 ) + ( - 0 . 0125 , 0 ) $ ) --%
($ \trafficfactor * ( 0 , 0 . 325 ) + ( - 0 . 0125 , 0 ) $ ) -- ($ \trafficfactor * ( 0 , 0 . 325 ) + ( 0 . 1875 , 0 ) $ ) -- ($ \trafficfactor * ( 0 , 0 . 175 ) + ( 0 . 1875 , 0 ) $ ) --%
($ \trafficfactor * ( 0 , 0 . 175 ) + ( - 0 . 0125 , 0 ) $ ) -- cycle;% arrow backward
\fill [\foreground] %
($ \trafficfactor * ( 0 , - 0 . 1 ) + ( 0 . 0125 , 0 ) $ ) -- ($ \trafficfactor * ( 0 , - 0 . 25 ) + ( 0 . 2125 , 0 ) $ ) -- ($ \trafficfactor * ( 0 , - 0 . 4 ) + ( 0 . 0125 , 0 ) $ ) --%
($ \trafficfactor * ( 0 , - 0 . 325 ) + ( 0 . 0125 , 0 ) $ ) -- ($ \trafficfactor * ( 0 , - 0 . 325 ) + ( - 0 . 1875 , 0 ) $ ) -- ($ \trafficfactor * ( 0 , - 0 . 175 ) + ( - 0 . 1875 , 0 ) $ ) --%
($ \trafficfactor * ( 0 , - 0 . 175 ) + ( 0 . 0125 , 0 ) $ ) -- cycle;% arrow forward
} { %
\ifdefstring { \face } { backward} { % face
\fill [\foreground] %
($ \trafficfactor * ( 0 , 0 . 1 ) + ( - 0 . 0125 , 0 ) $ ) -- ($ \trafficfactor * ( 0 , 0 . 25 ) + ( - 0 . 2125 , 0 ) $ ) -- ($ \trafficfactor * ( 0 , 0 . 4 ) + ( - 0 . 0125 , 0 ) $ ) --%
($ \trafficfactor * ( 0 , 0 . 325 ) + ( - 0 . 0125 , 0 ) $ ) -- ($ \trafficfactor * ( 0 , 0 . 325 ) + ( 0 . 1875 , 0 ) $ ) -- ($ \trafficfactor * ( 0 , 0 . 175 ) + ( 0 . 1875 , 0 ) $ ) --%
($ \trafficfactor * ( 0 , 0 . 175 ) + ( - 0 . 0125 , 0 ) $ ) -- cycle;% arrow backward
\path [draw=\foreground,line width=0.5pt,densely dotted] %
($ \trafficfactor * ( 0 , - 0 . 1 ) + ( 0 . 0125 , 0 ) $ ) -- ($ \trafficfactor * ( 0 , - 0 . 25 ) + ( 0 . 2125 , 0 ) $ ) -- ($ \trafficfactor * ( 0 , - 0 . 4 ) + ( 0 . 0125 , 0 ) $ ) --%
($ \trafficfactor * ( 0 , - 0 . 325 ) + ( 0 . 0125 , 0 ) $ ) -- ($ \trafficfactor * ( 0 , - 0 . 325 ) + ( - 0 . 1875 , 0 ) $ ) -- ($ \trafficfactor * ( 0 , - 0 . 175 ) + ( - 0 . 1875 , 0 ) $ ) --%
($ \trafficfactor * ( 0 , - 0 . 175 ) + ( 0 . 0125 , 0 ) $ ) -- cycle;% arrow forward
} {
\ifdefstring { \face } { bidirectional} { % face
\path [draw=\foreground,line width=0.5pt] %
($ \trafficfactor * ( 0 , 0 . 1 ) + ( - 0 . 0125 , 0 ) $ ) -- ($ \trafficfactor * ( 0 , 0 . 25 ) + ( - 0 . 2125 , 0 ) $ ) -- ($ \trafficfactor * ( 0 , 0 . 4 ) + ( - 0 . 0125 , 0 ) $ ) --%
($ \trafficfactor * ( 0 , 0 . 325 ) + ( - 0 . 0125 , 0 ) $ ) -- ($ \trafficfactor * ( 0 , 0 . 325 ) + ( 0 . 1875 , 0 ) $ ) -- ($ \trafficfactor * ( 0 , 0 . 175 ) + ( 0 . 1875 , 0 ) $ ) --%
($ \trafficfactor * ( 0 , 0 . 175 ) + ( - 0 . 0125 , 0 ) $ ) -- cycle;% arrow backward
\path [draw=\foreground,line width=0.5pt] %
($ \trafficfactor * ( 0 , - 0 . 1 ) + ( 0 . 0125 , 0 ) $ ) -- ($ \trafficfactor * ( 0 , - 0 . 25 ) + ( 0 . 2125 , 0 ) $ ) -- ($ \trafficfactor * ( 0 , - 0 . 4 ) + ( 0 . 0125 , 0 ) $ ) --%
($ \trafficfactor * ( 0 , - 0 . 325 ) + ( 0 . 0125 , 0 ) $ ) -- ($ \trafficfactor * ( 0 , - 0 . 325 ) + ( - 0 . 1875 , 0 ) $ ) -- ($ \trafficfactor * ( 0 , - 0 . 175 ) + ( - 0 . 1875 , 0 ) $ ) --%
($ \trafficfactor * ( 0 , - 0 . 175 ) + ( 0 . 0125 , 0 ) $ ) -- cycle;% arrow forward
} { % error message
\pgfkeys { /errors/unknown choice value={ /tikz/trackschematic/face} { “forward“, “backward“ OR “bidirectional“ as key required} } %
} %
} %
} % end \ifdefstring{\face}
%% frame
% \path[draw=\foreground,line width=0.5pt]%
% (-0.3, 0.1) -- (-0.3, 0.5) -- (0.3, 0.5) -- (0.3, 0.1)
% (-0.3,-0.1) -- (-0.3,-0.5) -- (0.3,-0.5) -- (0.3,-0.1);
} } ,% END pics/direction_control/.style args={#1}
% symbology entry
symbology_ direction_ control/.pic = { %
\maintrack (0,0) -- (2.9,0);%
\maintrack (3.1,0) -- (6,0);%
\directioncontrol [bidirectional] at (2,0);%
\directioncontrol [forward] at (4,0);%
} ,%
2020-01-14 17:11:10 +01:00
} %
%
%%%%%%%%%%%%%%%
\endinput %
%