GUI API (experimental)

OMFrontend.GUI_API is an API for graphical model editors: load a model, read its diagram (components, placements, connections), edit placements and connections as text patches of the source, save, and compile or simulate through delegates. It is experimental.

Types

Functions

OMFrontend.GUI_API.setExecutionDelegates! — Function
setExecutionDelegates!(; compileModel = nothing, simulateModel = nothing, exportFlatModelica = nothing)

Register callbacks used by compileModel, simulateModel, and exportFlatModelica. Each callback receives (classPath, tempPath; kwargs...).

source
OMFrontend.GUI_API.validateModel — Function
validateModel(session::ModelSession, classPath::String) -> ValidationResult

Return the current validation result for classPath in a loaded session.

source
OMFrontend.GUI_API.getDiagram — Function
getDiagram(session::ModelSession, classPath::String; view = :Diagram) -> DiagramModel

Extract component placements and connections for the requested class view. Use view = :Icon to read icon placements instead of diagram placements.

source
OMFrontend.GUI_API.updateComponentPlacement — Function
updateComponentPlacement(session::ModelSession, componentPath::String, placementPatch) -> OperationResult

Merge placementPatch into a component's Placement annotation and update the session source text.

source
OMFrontend.GUI_API.createConnection — Function
createConnection(session::ModelSession, fromConnector::String, toConnector::String; classPath = nothing, linePatch = nothing) -> OperationResult

Insert a connect(...) equation and optional Line annotation into the owning class.

source

Index