This library can generate PlanPro files. Therefor this library can either be used as a library as part of another program or as a stand-alone program.
Currently, it's generating PlanPro 1.9 files, but 1.10 is upcoming.
To use the generator as a library, install it via:
pip3 install git+https://github.com/arneboockmeyer/planpro-generatorAfterwards you can import it to your application with:
from planprogenerator import Generator, Node, Edge, SignalTo create the objects, use:
node = Node(<identifier>, <x>, <y>, <description>)
edge = Edge(<node_a>, <node_b>)
signal = Signal(<edge>, <distance>, <effective_direction>, <function>, <kind>, [<name>])So far, only nodes, edges and signals are supported. The signal function must be one of Einfahr_Signal, Ausfahr_Signal, Blocksignal or andere and the signal kind has to be one of Hauptsignal, Mehrabschnittssignal, Vorsignal, Sperrsignal, Hauptsperrsignal or andere. The effective direction is either in or gegen.
To add intermediate geo nodes, use the following:
geo_node = GeoNode(x, y)
edge.intermediate_geo_nodes.append(geo_node)To generate the file, run:
generator = Generator()
generator.generate(<list of nodes>, <list of edges>, <list of signals>, <filename>)To use the stand-alone version of this library, just run the generatorcli.py with Python3:
python3 generatorcli.pyAfterwards a CLI will guide you through the process of creating PlanPro files. Start with entering the filename and afterwards create your objects:
node <id> <x> <y> <description>
edge <node id a> <node id b> [coords x1,y1 [x2,y2 ...]]
signal <node id from> <node id to> <distance to node from> <function> <kind> [<name>]
So far, only nodes, edges and signals are supported. The signal function must be one of Einfahr_Signal, Ausfahr_Signal, Blocksignal or andere and the signal kind has to be one of Hauptsignal, Mehrabschnittssignal, Vorsignal, Sperrsignal, Hauptsperrsignal or andere.
To add intermediate geo nodes, add a list of space separated coordinates after the keyword coords.
To generate the file, run the command generate. To exit before, just use exit.
This library was used by the Digital Rail Summer School in the project ORM-PlanPro-Converter.
Feel free to create pull requests to this repository :)