Skip to content

Scretch9/planpro-generator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PlanPro-Generator

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.

Usage as library

To use the generator as a library, install it via:

pip3 install git+https://github.com/arneboockmeyer/planpro-generator

Afterwards you can import it to your application with:

from planprogenerator import Generator, Node, Edge, Signal

To 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>)

Usage as stand-alone program

To use the stand-alone version of this library, just run the generatorcli.py with Python3:

python3 generatorcli.py

Afterwards 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.

Users

This library was used by the Digital Rail Summer School in the project ORM-PlanPro-Converter.

Contributors

Feel free to create pull requests to this repository :)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%