You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
write_flow_element() in src/simlin-engine/src/mdl/writer.rs (line 909) emits only two lines per flow:
Type 11 (valve): position and visual properties
Type 10 (attached variable): name and label position
It does not use flow.points to emit the type 1 connector lines that represent the pipe geometry -- the line segments connecting stocks/clouds to the valve. This means stock/cloud attachments at flow endpoints are lost during MDL roundtrip. The MDL reader correctly parses these type 1 lines (see view/elements.rs:201), so the data is available on the Flow struct's points field, but the writer never consumes it.
Impact
Visual fidelity: Flow pipe paths (start/end connections, intermediate waypoints) are lost in written MDL sketches. Flows appear as isolated valves with no visible connections.
Equation semantics: Not affected. Flow equations and stock linkages are preserved correctly through the equation section of the MDL file.
Component(s) affected
src/simlin-engine/src/mdl/writer.rs -- write_flow_element() function (line 909)
Possible approach
For each flow element, in addition to the existing type 11 and type 10 lines, emit type 1 connector lines derived from flow.points. Each point pair defines a pipe segment. The from/to UIDs for the first and last segments should reference the connected stock/cloud UIDs (available via flow.points), and intermediate segments reference the valve UID. The connector line format is documented in view/elements.rs:201-203.
Activity