Class ProcessFlowDiagramExporter
java.lang.Object
neqsim.process.processmodel.ProcessFlowDiagramExporter
- All Implemented Interfaces:
Serializable
Exports a
ProcessSystem topology to Graphviz DOT format for PFD generation.
The exporter walks all unit operations, queries their inlet and outlet streams via
ProcessEquipmentInterface.getInletStreams() and
ProcessEquipmentInterface.getOutletStreams(), and infers edges wherever two equipment
units share a stream object. Explicit ProcessConnection metadata is also rendered as
edges.
Usage:
ProcessSystem process = ...; ProcessFlowDiagramExporter exporter = new ProcessFlowDiagramExporter(process); String dot = exporter.toDot();
- Version:
- 1.0
- Author:
- Even Solbraa
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ProcessSystemThe process system to export.private static final longSerialization version UID.private StringGraph title. -
Constructor Summary
ConstructorsConstructorDescriptionProcessFlowDiagramExporter(ProcessSystem processSystem) Creates an exporter for the given process system. -
Method Summary
Modifier and TypeMethodDescriptionprivate StringEscapes double quotes in strings for DOT format.private StringReturns an appropriate Graphviz shape for the equipment class.private StringsanitizeId(String name) Sanitizes a name for use as a Graphviz node ID by replacing non-alphanumeric characters with underscores.voidSets the title shown in the DOT graph.toDot()Generates the Graphviz DOT representation of the process topology.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
processSystem
The process system to export. -
title
Graph title.
-
-
Constructor Details
-
ProcessFlowDiagramExporter
Creates an exporter for the given process system.- Parameters:
processSystem- the process system to export
-
-
Method Details
-
setTitle
Sets the title shown in the DOT graph.- Parameters:
title- graph title string
-
toDot
Generates the Graphviz DOT representation of the process topology.Equipment becomes graph nodes, streams become edges. The method first discovers topology from stream sharing, then adds explicit connections from
ProcessSystem.getConnections().- Returns:
- DOT-format string
-
getShapeForEquipment
Returns an appropriate Graphviz shape for the equipment class.- Parameters:
equip- the equipment- Returns:
- Graphviz shape string
-
sanitizeId
-
escapeQuotes
-