Commit Graph

9 Commits

Author SHA1 Message Date
m.stangl 7b677f6bb5 neuer Schalter dazu 2026-09-07 09:36:35 +02:00
s.ayadi 22b08cc0ce Merge branch 'master' of https://gitea.schoenenberger.de/Schoenenberger_Systeme_GmbH/sps_skel 2026-09-04 15:22:20 +02:00
s.ayadi a0cb28725b last changes 2026-09-04 14:57:30 +02:00
m.stangl e165beeaa8 Group parallel Gefaellestrecken in the material-flow diagram
A bank of gravity lanes between the same two Kreisel (same slope) was
drawn as one box per lane, making large storage banks unreadable.
render_dot now collapses such lanes into a single Gefaellestrecke-styled
block with a double border, labelled with the id range and combined
Separator/Scanner ranges. Purely visual - the graph, --doc report and
--connect output still list every lane individually.
2026-08-21 12:08:21 +02:00
s.ayadi d7edc55116 latest changes 2026-08-20 11:38:51 +02:00
s.ayadi 5dcaa8b8fa Take the conveying direction from the element's own height change
The new export fills Hoehe_Von_mm / Hoehe_Bis_mm, so the direction of a transport
element no longer has to be guessed from its neighbours. drive_uphill() now
decides in this order:

  1. Hoehe_Von_mm -> Hoehe_Bis_mm: the rise of the element itself. Only the sign
     is read, since the values are absolute on a Gefaellestrecke (1941 -> 1466)
     but relative on a Strecke (0 -> 474).
  2. Antriebfahrtrichtung "Auf" (up) or "Ab" (down).
  3. A Gefaellestrecke without either runs downhill by definition.

Previously a Gefaellestrecke was assumed downhill outright and everything else
depended on Antriebfahrtrichtung alone; now both are backed by the height data
and the fallback order is explicit.

The node label states what was read and what follows from it, e.g.
"0 -> 474 mm (+474) = aufwaerts", so the arrow can be checked against the export
without opening the CSV.

Adds a plausibility check for the case where Antriebfahrtrichtung and the height
change disagree. The height wins and the conflict is reported, rather than one of
the two silently deciding.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 14:08:58 +02:00
s.ayadi 0392114e10 Orient the carousel arrows from Drehrichtung (UZS / GUZ)
Until now the two lanes of a Kreisel were joined by a pair of edges in both
directions, because the travel direction was unknown. The CSV does carry it in
the Drehrichtung merkmal, so the arrow inside a Kreisel is now directed:

  UZS  clockwise         -> material runs right to left, R -> L
  GUZ  counter-clockwise -> material runs left to right, L -> R

If the merkmal is missing or holds anything else, the circuit stays bidirectional
and that is reported as a warning, so an unknown value cannot silently invent a
direction.

The direction is visible in the drawing: the edge carries the rotation as its
label and the Kreisel cluster header states it in words, e.g.
"Kreisel Kreisel3 [0009] UZS (rechts nach links)".

Since a Kreisel is now traversed one way only, lanes can end up without an
outgoing or without an incoming connection. build_graph reports both cases,
naming the separators that sit on the affected lane, because such a lane means
carriers can either not leave or not reach it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:38:46 +02:00
s.ayadi 035c86ced9 Draw the TRO flow to scale with neato via --use-cords
Adds a --use-cords switch to tro_flow.py (--use-coords accepted too). With it,
every TRO node carries its plant coordinate as a pos attribute and the SVG is
produced by "neato -n" instead of dot, so the diagram looks like the plant
layout rather than a computed left-to-right flow.

Scale is 0.25 pt/mm (COORD_SCALE), which turns the ~11 x 20 m plant into roughly
2800 x 5000 pt - large enough that the TRO boxes do not overlap. Without the
switch the pos attributes stay in the DOT as information only, at 1:100, and dot
ignores them; the default layout is unchanged.

Two details neato -n needs: the legend gets a position of its own, placed below
left of the plant bounding box, because with -n a node without pos would land at
0,0 in the middle of the drawing. And the switch is refused with a clear message
if any TRO has no coordinate, since -n cannot lay out a graph with missing
positions.

Verified that neato -n reproduces the given coordinates: the positions it reports
back differ from the input by a constant offset only (spread 0.08 pt, from
Graphviz moving the drawing into the positive quadrant), and no node distance
changes by more than 0.08 pt over spans of up to 3600 pt.

graph_to_svg() in material_flow.py replaces dot_to_svg() to take an engine and
the no-op flag; dot_to_svg() stays as a thin wrapper. It now also treats output
on stderr as an error, so neato's "node has no position" warnings do not pass
silently.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:24:14 +02:00
s.ayadi 4454af5165 Add material flow generator for the mechanical layout
Reads the CSV export of the plant objects (ILS 2.0) from SKEL_DATA and builds a
directed graph of the material flow, written as Graphviz DOT and optionally SVG
into SKEL_RESULTS.

Node model: one node per Gefaellestrecke and Strecke; a Kreisel becomes two
nodes (-L / -R) wired into a circle, since it is a carousel with one lane per
travel direction. Separators and scanners are no nodes of their own; they are
shown on the label of the object they are assigned to.

Edge direction is not in the CSV - the Nachbarn column is symmetric. It is
derived from geometry instead: a Gefaellestrecke runs downhill away from its
highest neighbour, a driven Strecke follows Antriebfahrtrichtung ("Auf" uphill,
"Ab" downhill). Connections that stay ambiguous, e.g. between two Kreisel at the
same height, are drawn as bidirectional edges and reported.

The lane suffix of a Kreisel is always stated in the *partner's* row, so both
viewpoints of a link are merged before orienting it.

Switches:
  --file   name of the CSV in SKEL_DATA, or a full path
  --tosvg  render the DOT via Graphviz
  --doc    write a Markdown documentation of the plant objects

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:01 +02:00