Module Simantics/Flag

This module is undocumented. This is a list of its definitions.

expandAllFlagsInDiagram :: Resource -> <WriteGraph> ()

Expands every merged flag of the given diagram configuration composite, i.e. replaces each flag that is joined by more than one connection join with one separate flag per join. The opposite of mergeAllFlagsInDiagram.

expandFlag :: Resource -> <WriteGraph> Vector Resource

Expands one merged flag without recording the operation in the change set metadata: the flag is replaced by one flag per connection join that joins it, and those flags are returned. Returns an empty vector if the flag is joined by at most one join or is not connected to anything.

flagToElement :: Resource -> Resource

Returns its argument unchanged; both Flag and Element are other names for Resource.

getFlagByName :: Resource -> String -> <ReadGraph> [Resource]
getFlagByName diagram name

Returns the flags of the given diagram configuration composite whose element name is name. The result is empty if there is no such flag. Note that the name matched here is the L0.HasName of the flag element, not the label that is shown on the diagram.

getFlags :: Resource -> <ReadGraph> [Resource]

Returns the flag elements of the diagram of the given configuration composite.

joinFlags :: Resource -> Resource -> <WriteGraph> ()

Joins two flags.

mergeAllFlagsInDiagram :: Resource -> <WriteGraph> String

Merges the flags of the given diagram configuration composite. Flags that are joined into the same connection and have the same flag type and connection type are replaced by a single flag: the joins of the other flags are moved to the first one of the group and the other flags are removed, so that one flag continues several connections. Returns a message that names the diagram that was processed.

mergeFlags :: [Resource] -> <WriteGraph> String

Merges the given flags the way mergeAllFlagsInDiagram does, without recording the operation in the change set metadata. The flags are grouped by their flag type and the type of the connection attached to them and every group of more than one flag is merged. Returns an error message, or an empty string if the merge succeeded.

setFlagExternal :: [Resource] -> Boolean -> <WriteGraph> [Resource]
setFlagExternal flags external

Tags the given flags as external flows when external is True and removes the tag when it is False. An external flow cannot be continued on this or on any other diagram of the same model. Returns the given flags.

toFlag :: Resource -> Resource

Returns its argument unchanged; Flag is another name for Resource.