Commit Graph
17 Commits
Author SHA1 Message Date
Michael StanglandClaude Opus 5.5 a1bba2b20d material_flow: --show-bbs [flow|all] mit Legende und Tooltips
- neuer Wert fuer --show-bbs: 'flow' (Default, auch ohne Wert) blendet
  die VF/GF-Einzelbausteine (Bogen, Streckenelement, Motor-/Umlenkstation)
  aus, 'all' zeichnet jede CSV-Zeile
- eigene Farben fuer die Einzelbausteine, Legende mit Anzahl je Objektart,
  Tooltip je Rechteck (Zeile, TeileId, TeileArt, Bezeichnung)
- genutzt von dxfmakros/bin/show_exportcsv.bat

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 20:25:38 +02:00
Samer AyadiandClaude Sonnet 5 0477f05180 Materialfluss: --graphtype fuer --chain-graph (coarsebox/compound/subgraph)
--chain-graph zeichnete bisher immer nur die groben Objekte (Kreisel-Bahnen,
Strecke/Gefaellestrecke). Neuer Schalter --graphtype waehlt die Methode:
coarsebox (bisheriges Verhalten, unveraendert), compound (dieselbe
massstabsgetreue SVG, zusaetzlich die Anbauteile - Separator, Scanner,
Ausschleus-/Einschleuselement, Weiche - verschachtelt im Container an ihrer
echten Position, verbunden ueber die bereits aufgeloesten TrackGraph-Kanten)
und subgraph (dieselbe Verschachtelung als geschachtelte Graphviz-Cluster,
schematisch statt lagerichtig, <name>_chain.dot / mit --tosvg auch .svg).

_container_children() liest die Anbauteile direkt aus Element.track_ids -
derselben Quelle, die build_track_graph()/--track schon nutzt - statt sie wie
im Prototyp data/gen_chain_svg.py erneut aus der Nachbarn-Spalte herzuleiten.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 16:26:02 +02:00
Samer Ayadi 60f855fff5 merge des aktuelllen Standes 2026-09-17 13:23:37 +02:00
Samer AyadiandClaude Sonnet 5 80e7acc8dd neuer Schalter --chain-graph, BTMT Eingang/Ausgang erkannt, Foerderer-Merkmal in tro_flow
--chain-graph zeichnet einen massstabsgetreuen Chain-/Lageplan der groben
Objekte (Kreisel-Bahnhaelften, Strecke/Gefaellestrecke) als <name>_chain.svg,
ohne Graphviz. BTMT-Stationen werden jetzt auch an "Eingang"/"Ausgang" statt
nur "Beladung"/"Entladung" erkannt und bevorzugt ueber TrackIds statt Nachbarn
verbunden. tro_flow.py erkennt bei Aus-/Einschleuselementen jetzt auch
"Foerderer" als Merkmal-Schreibweise fuer die Strecke, nicht nur "Strecke".

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-17 13:15:50 +02:00
Michael StanglandClaude Opus 4.8 117cd8914b Materialfluss: VF/GF-Richtung, Stations-Bahn und Eingang/Ausgang-Merge
- _apply_transfers liest die andockende Strecke auch aus dem Merkmal
  "Foerderer"/"Förderer" (nicht nur "Strecke"), damit VF/GF gerichtet
  Kreisel->AS->..->ES->Kreisel gezeichnet werden (Ruecklauf = zwei Pfeile
  auf die beiden Kreisel-Bahnen) statt "unbestimmt".

- _attach_stations haengt BTMT/Eingang/Ausgang an die Kreisel-Bahn, in
  deren TrackIds-Umlauf sie liegen (Bahn aus der Drehrichtung); Nachbarn,
  die keine Flussobjekte sind, werden uebersprungen - keine
  Station<->Station-Kanten mehr.

- Eingang/Ausgang sind die generischen Symbole fuer Beladung/Entladung.
  Liegt ein Symbol deckungsgleich (<= STATION_MERGE_MM = 600 mm) ueber
  einer BTMT-Station gleicher Rolle, wird es verschluckt
  (_merge_station_symbols) - nur ein Knoten, in grobem Graph UND --track
  (dort auch aus den TrackIds gestrichen). Einzelne Symbole bleiben eigener
  gruener/roter Knoten.

- drive_uphill: die Hoehe bestimmt die Richtung NUR bei einer reinen
  Gefaellestrecke (Schwerkraft, bergab). Ein Foerderer/gemischte Strecke
  kann hoch oder runter foerdern - dort zaehlt nur eine eindeutige
  Antriebfahrtrichtung, sonst kommt die Richtung aus AS/ES.

Doku in doc/Python_Scripts.md und doc/track.md nachgezogen.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-09-17 12:54:44 +02:00
Michael StanglandClaude Opus 4.8 516f30278b --track: Bahnzusammenhang aus der TrackIds-Spalte statt aus Nachbarn
build_track_graph baut die Fein-Adjazenz jetzt direkt aus der geordneten
TrackIds-Spalte je Container (Element.track_ids): Kreisel als zirkulaerer
Umlauf in Drehrichtung (Export-Sortierung), Strecke/Gefaelle als lineare
Kette AS -> SEP.. -> ES. Gemeinsame AS/ES-/Weiche-Knoten verketten die
Container automatisch - die Rueckmeldungs-/Rollen-Heuristik aus der
Nachbarn-Spalte (_transfer_kreisel_lane, _wire_weiche,
_orient_separator_links) entfaellt komplett.

_attach_track_symbols misst offene Bahnenden jetzt am feinen Graphen statt
am groben; das behebt die vereinzelten Falsch-Eingaenge an voll verketteten
Bahnen (HundM05: Bahn 0001-0004, 0006-R).

Doku in doc/Python_Scripts.md und doc/track.md nachgezogen.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-09-17 09:59:09 +02:00
Samer Ayadi 04f9ba456c neuer Schalter Switch hinzugefügt 2026-09-10 13:17:09 +02:00
Samer Ayadi 4bab45705d TRO flow svg file can be created. 2026-09-10 11:29:22 +02:00
Michael Stangl 7b677f6bb5 neuer Schalter dazu 2026-09-07 09:36:35 +02:00
Samer Ayadi 22b08cc0ce Merge branch 'master' of https://gitea.schoenenberger.de/Schoenenberger_Systeme_GmbH/sps_skel 2026-09-04 15:22:20 +02:00
Samer Ayadi a0cb28725b last changes 2026-09-04 14:57:30 +02:00
Michael 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
Samer Ayadi d7edc55116 latest changes 2026-08-20 11:38:51 +02:00
Samer AyadiandClaude Opus 5 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
Samer AyadiandClaude Opus 5 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
Samer AyadiandClaude Opus 5 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
Samer AyadiandClaude Opus 5 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