Class DexpiDiagramBridge
java.lang.Object
neqsim.process.processmodel.diagram.DexpiDiagramBridge
- All Implemented Interfaces:
Serializable
Bridge between DEXPI XML data exchange and PFD visualization.
This class provides integration utilities for:
- Creating diagram exporters optimized for DEXPI-imported processes
- Importing DEXPI XML files and generating PFD diagrams
- Exporting ProcessSystem to DEXPI XML with embedded layout coordinates
- Round-trip: DEXPI → NeqSim simulation → PFD → DEXPI with preserved context
Example usage:
// Import DEXPI and create diagram
ProcessDiagramExporter exporter =
DexpiDiagramBridge.importAndCreateExporter(Paths.get("plant.xml"), templateStream);
exporter.exportAsDOT(Paths.get("diagram.dot"));
// Create exporter optimized for DEXPI content
ProcessDiagramExporter exporter = DexpiDiagramBridge.createExporter(system);
- Version:
- 1.0
- Author:
- NeqSim
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static StreamCreates a default template stream with methane/ethane composition.static ProcessDiagramExportercreateDetailedExporter(ProcessSystem processSystem) Creates a diagram exporter with full detail for DEXPI-imported processes.static ProcessDiagramExportercreateExporter(ProcessSystem processSystem) Creates a diagram exporter optimized for DEXPI-imported processes.static voidexportToDexpi(ProcessSystem processSystem, Path outputFile) Exports a ProcessSystem to DEXPI XML format.static ProcessDiagramExporterimportAndCreateExporter(Path dexpiXmlFile) Imports a DEXPI XML file and creates a diagram exporter.static ProcessDiagramExporterimportAndCreateExporter(Path dexpiXmlFile, Stream templateStream) Imports a DEXPI XML file with a custom template stream and creates a diagram exporter.static ProcessSystemimportDexpi(Path dexpiXmlFile) Imports a DEXPI XML file into a ProcessSystem.static ProcessSystemimportDexpi(Path dexpiXmlFile, Stream templateStream) Imports a DEXPI XML file into a ProcessSystem with a custom template.static ProcessSystemPerforms a complete round-trip: import DEXPI, generate diagram, export back to DEXPI.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
DexpiDiagramBridge
private DexpiDiagramBridge()
-
-
Method Details
-
createExporter
Creates a diagram exporter optimized for DEXPI-imported processes.The exporter is configured with:
- DEXPI metadata display enabled (line numbers, fluid codes)
- Detailed labels for P&ID cross-referencing
- Legend enabled for phase identification
- Parameters:
processSystem- the process system (typically imported from DEXPI)- Returns:
- configured diagram exporter
-
createDetailedExporter
Creates a diagram exporter with full detail for DEXPI-imported processes.Includes all available information: operating conditions, flow rates, and DEXPI metadata.
- Parameters:
processSystem- the process system- Returns:
- configured diagram exporter with detailed labels
-
importAndCreateExporter
public static ProcessDiagramExporter importAndCreateExporter(Path dexpiXmlFile) throws IOException, DexpiXmlReaderException Imports a DEXPI XML file and creates a diagram exporter.Uses a default methane/ethane fluid template for stream thermodynamics.
- Parameters:
dexpiXmlFile- path to the DEXPI XML file- Returns:
- diagram exporter for the imported process
- Throws:
IOException- if the file cannot be readDexpiXmlReaderException- if the XML is invalid
-
importAndCreateExporter
public static ProcessDiagramExporter importAndCreateExporter(Path dexpiXmlFile, Stream templateStream) throws IOException, DexpiXmlReaderException Imports a DEXPI XML file with a custom template stream and creates a diagram exporter.- Parameters:
dexpiXmlFile- path to the DEXPI XML filetemplateStream- stream template for thermodynamic properties- Returns:
- diagram exporter for the imported process
- Throws:
IOException- if the file cannot be readDexpiXmlReaderException- if the XML is invalid
-
importDexpi
public static ProcessSystem importDexpi(Path dexpiXmlFile) throws IOException, DexpiXmlReaderException Imports a DEXPI XML file into a ProcessSystem.Convenience wrapper around
DexpiXmlReader.read(File, Stream)with a default template.- Parameters:
dexpiXmlFile- path to the DEXPI XML file- Returns:
- the imported process system
- Throws:
IOException- if the file cannot be readDexpiXmlReaderException- if the XML is invalid
-
importDexpi
public static ProcessSystem importDexpi(Path dexpiXmlFile, Stream templateStream) throws IOException, DexpiXmlReaderException Imports a DEXPI XML file into a ProcessSystem with a custom template.- Parameters:
dexpiXmlFile- path to the DEXPI XML filetemplateStream- stream template for thermodynamic properties- Returns:
- the imported process system
- Throws:
IOException- if the file cannot be readDexpiXmlReaderException- if the XML is invalid
-
exportToDexpi
Exports a ProcessSystem to DEXPI XML format.The exported XML preserves DEXPI metadata (tag names, line numbers, fluid codes) and includes operating conditions (pressure, temperature, flow) as generic attributes.
- Parameters:
processSystem- the process system to exportoutputFile- the output file path- Throws:
IOException- if the file cannot be written
-
roundTrip
public static ProcessSystem roundTrip(Path inputDexpi, Path outputDot, Path outputDexpi) throws IOException, DexpiXmlReaderException Performs a complete round-trip: import DEXPI, generate diagram, export back to DEXPI.This is useful for:
- Validating DEXPI import/export fidelity
- Generating diagrams from existing P&ID data
- Enriching DEXPI files with simulation results
- Parameters:
inputDexpi- path to input DEXPI XML fileoutputDot- path for output DOT diagram fileoutputDexpi- path for re-exported DEXPI XML file- Returns:
- the processed system
- Throws:
IOException- if file operations failDexpiXmlReaderException- if the input XML is invalid
-
createDefaultTemplate
Creates a default template stream with methane/ethane composition.- Returns:
- default stream template
-