Module Simantics/RouteGraph

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

CANBEMADELEGAL :: ConnectionJudgementType

The connection points may not be connected as they are, but the connection would become legal if more connection points were added to it.

ConnectionPoint :: String -> String -> ConnectorIdentification
CreateLine :: Double -> Boolean -> RouteGraphModification
Element :: String -> ConnectorIdentification
ILLEGAL :: ConnectionJudgementType

The connection points may not be connected to each other.

RemoveNode :: Integer -> RouteGraphModification
RouteGraphStructure :: Resource -> [ConnectorIdentification] -> Integer -> [Integer] -> RouteGraphStructure
UpdateLine :: Integer -> Double -> Boolean -> RouteGraphModification
canTerminalBeConnected :: Resource -> Resource -> Resource -> <ReadGraph,Proc> Boolean
canTerminalBeConnected diagram component terminal

Returns True if the modeling rules of the given diagram resource judge a connection to the given terminal of the given component to be legal. Returns False if such a connection would not be legal and also if the diagram has no modeling rules.

getModelingRules :: Resource -> <ReadGraph,Proc> Maybe IModelingRules

Returns the modeling rules of the given diagram resource, or Nothing if the diagram has no modeling rules.

judgeConnection :: IModelingRules -> [IConnectionPoint] -> <ReadGraph,Proc> ConnectionJudgement
judgeConnection modelingRules connectionPoints

Tells whether the given connection points may be connected to each other under the given modeling rules and what the type of the connection would be.

makeIConnectionPoint :: Resource -> Resource -> <Proc> IConnectionPoint
makeIConnectionPoint component terminal

Returns the connection point that consists of the given component and the given terminal relation of it, for use with judgeConnection.

matchRouteGraph :: [Resource] -> Integer -> [Integer] -> <ReadGraph> Maybe [Resource]
matchRouteGraph connectors routeLineCount links

Resolves the route nodes of one connection. The nodes are numbered so that the given connectors come first and the routeLineCount interior route lines of the connection after them, and links gives the links between the nodes as consecutive pairs of node numbers. Returns the resource of every node in that numbering, or Nothing if the route lines cannot be resolved unambiguously from the given structure.

modifyRouteGraph :: RouteGraphStructure -> [RouteGraphModification] -> <Proc,WriteGraph> [Resource]
modifyRouteGraph structure modifications

Resolves the connection that structure describes and executes the given modifications on it in the given order. Returns the resources of all the route nodes of the connection in the numbering of the structure, with the route lines created by the modifications appended in creation order. Fails if the structure does not match any connection.