Simantics/SCL

This module contains functions closely related to SCL and storing SCL related constructs in the Simantics database.

SCL Command Session

data CommandResponse
CommandResponse :: String -> Boolean -> CommandResponse
createTextAndErrors :: String -> [CompilationError] -> TextAndErrors
execute :: String -> <SCL,Proc> ()
isSuccessful :: CommandResponse -> Boolean

SCL Realm

getOrCreateSCLRealm :: String -> <Proc> SCLRealm
readSCLRealm :: Resource -> <ReadGraph,Proc> SCLRealm
refreshVariables :: SCLRealm -> <Proc> ()
sclRealmById :: String -> <Proc> Maybe SCLRealm
syncExec :: SCLRealm -> <SCL,Proc> a -> <Proc> a

Command Session Variable Access

setVariable :: String -> Type -> a -> <SCL> ()
variableValue :: String -> <SCL> a

SCL Values

createSCLValue :: Resource -> Resource -> Resource -> String -> <WriteGraph> Resource
createSCLValueIndependent :: Resource -> String -> <WriteGraph> Resource
setExpression :: Variable -> String -> <WriteGraph> ()

SCL Modules

createSCLModuleAction :: Resource -> <Proc> ()
createSCLModuleDefault :: Resource -> <WriteGraph> ()
createSCLModule :: Resource -> String -> <WriteGraph> ()

Use createSCLModuleR instead.

createSCLModuleR :: Resource -> String -> <WriteGraph> Resource

createSCLModuleR container name creates a new empty SCL module under the specified container with the specified name and returns the created module's Resource.

createSCLModuleWithDefinition :: Resource -> String -> String -> <WriteGraph> Resource

createSCLModuleWithDefinition container name definition creates a new SCL module under the specified container with the specified name and definition and returns the created module's Resource.

setSCLModuleDefinition :: Resource -> String -> <WriteGraph> Resource

setSCLModuleDefinition module definition sets the textual definition of the specified SCL module.

SCL Scripts

createSCLScriptAction :: Resource -> <Proc> ()
createSCLScriptDefault :: Resource -> <WriteGraph> ()
createSCLScript :: Resource -> String -> <WriteGraph> ()

Use createSCLScriptR instead.

createSCLScriptR :: Resource -> String -> <WriteGraph> Resource

createSCLScriptR container name creates a new empty SCL script under the specified container with the specified name and returns the created script's Resource.

createSCLScriptWithDefinition :: Resource -> String -> String -> <WriteGraph> Resource

createSCLScriptWithDefinition container name definition creates a new SCL script under the specified container with the specified name and definition and returns the created script's Resource.

executeSCLScript :: Resource -> <Proc> ()

executeSCLScript scriptResource executes the SCL script stored in the configuration database as scriptResource.

The output will be delegated primarily to the reporting handler attached to the current SCL execution context.

Secondarily, if the platform UI workbench is running, output will be pushed to SCL Script Output view.

Otherwise output will be pushed to the default logging reporter.

setSCLScriptDefinition :: Resource -> String -> <WriteGraph> Resource

setSCLScriptDefinition module definition sets the textual definition of the specified SCL module.

Ontology definitions (PGraphs)

PGraph (partial graph) is a textual format for specifying ontologies for Simantics. For more information on the format, see this documentation.

createPGraphAction :: Resource -> <Proc> ()
createPGraphDefault :: Resource -> <WriteGraph> ()
createPGraph :: Resource -> String -> <WriteGraph> ()

Use createPGraphR instead.

createPGraphR :: Resource -> String -> <WriteGraph> Resource

createPGraphR container name creates a new empty partial graph ontology definition (PGraph) under the specified container with the specified name and returns the created ontology definition's Resource.

setPGraphDefinition :: Resource -> String -> <WriteGraph> Resource