claimRelatedValue script STR.ComponentTypeScript.type scriptType
claimRelatedValue script STR.ComponentTypeScript.code scriptCode
+@private
+componentTypeScriptsWithName :: Resource -> String -> <ReadGraph> [Resource]
+componentTypeScriptsWithName userComponent scriptName =
+ filter (\r -> nameOf r == scriptName)
+ (userComponent # STR.ComponentType.hasScript)
+
+"""
+`setUserComponentScriptExecutionPeriod userComponent scriptName (Just N)`
+sets the execution period of the specified `userComponent`s SCL scripts
+with the specified `scriptName` to N seconds.
+
+To disable the execution period setting for a script/scripts specify
+`executionPeriod` `Nothing` or `(Just 0)`.
+"""
+setUserComponentScriptExecutionPeriod :: Resource -> String -> Maybe Double -> <Proc,WriteGraph> ()
+setUserComponentScriptExecutionPeriod userComponent scriptName executionPeriod =
+ iter setExecutionPeriod
+ (componentTypeScriptsWithName userComponent scriptName)
+ where
+ setExecutionPeriod script = match executionPeriod with
+ Just ep -> claimRelatedValue script STR.ComponentTypeScript.executionPeriod ep
+ Nothing -> denyByPredicate script STR.ComponentTypeScript.executionPeriod
+
+"""
+`userComponentScriptExecutionPeriod userComponent scriptName`
+gets the execution periods of all user SCL scripts of the specified
+`userComponent` with the name `scriptName`.
+"""
+userComponentScriptExecutionPeriod :: Resource -> String -> <ReadGraph> [Double]
+userComponentScriptExecutionPeriod userComponent scriptName =
+ map executionPeriod
+ (componentTypeScriptsWithName userComponent scriptName)
+ where
+ executionPeriod script = fromMaybe 0 (possibleRelatedValue script STR.ComponentTypeScript.executionPeriod)
+
@private
possibleSubstructure :: Resource -> <ReadGraph> Maybe Resource
possibleSubstructure element = do