]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling/scl/Simantics/Query.scl
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.modeling / scl / Simantics / Query.scl
index 16878f499cd661e011783dd59c384df29f600b2e..d2809ff65d51219dd8a15c4f1cb3ea1fd0347988 100644 (file)
@@ -1,64 +1,64 @@
-include "Simantics/DB"\r
-include "Simantics/Ontologies"\r
-include "Simantics/Variables"\r
-include "Spreadsheet/All"\r
-\r
-createSCLQueryAction :: Resource -> <Proc> ()\r
-createSCLQueryAction res = do\r
-  syncWrite (\() -> createSCLQueryDefault res) \r
-  ()\r
-\r
-createSCLQueryTypeAction :: Resource -> <Proc> ()\r
-createSCLQueryTypeAction res = do\r
-  syncWrite (\() -> createSCLQueryTypeDefault res) \r
-  ()\r
-\r
-createSCLQueryDefault :: Resource -> Resource -> <WriteGraph> Resource\r
-createSCLQueryDefault library queryType = createSCLQuery library queryType $ findFreshEscapedName "Query" library \r
-\r
-createSCLQuery :: Resource -> Resource -> String -> <WriteGraph> Resource\r
-createSCLQuery library queryType name = do\r
-    markUndoPoint ()\r
-    module = newResource ()\r
-    claim module L0.InstanceOf queryType\r
-    claimRelatedValue module L0.HasName name\r
-    claim module L0.PartOf library\r
-    sheet = createSheet module "Sheet"\r
-    range = createRange sheet SHEET.ExpressionRange "Range1" "queryCells $ sheetQueryValue self input"\r
-    addCommentMetadata ("Created SCL Query " + name)\r
-    module\r
-\r
-createSCLQueryTypeDefault :: Resource -> <WriteGraph> Resource\r
-createSCLQueryTypeDefault library = createSCLQueryType library $ findFreshEscapedName "QueryType" library \r
-\r
-createSCLQueryType :: Resource -> String -> <WriteGraph> Resource\r
-createSCLQueryType library name = do\r
-    markUndoPoint ()\r
-    queryType = newResource ()\r
-    claim queryType L0.Inherits MOD.SCLQuery\r
-    claimRelatedValue queryType L0.HasName name\r
-    claimAssertion MOD.SCLQuery.values $ createSCLValueIndependent MOD.SCLQuery.Value "[]"\r
-    claim queryType L0.PartOf library\r
-    addCommentMetadata ("Created SCL Query Type " + name)\r
-    queryType\r
-\r
-queryValue :: Variable -> Variable -> <ReadGraph> a\r
-queryValue variable input = do\r
-    untypedValue $ browse (makeProxyVariable variable input) "#values" \r
-\r
-sheetQueryVariable :: Variable -> Variable -> <ReadGraph> Variable\r
-sheetQueryVariable self input = do\r
-    query = variableParent $ proxyVariableBase self\r
-    makeProxyVariable query input\r
-\r
-sheetQueryValue :: Variable -> Variable -> <ReadGraph> a\r
-sheetQueryValue self input = do\r
-    var = sheetQueryVariable self input\r
-    untypedValue $ browse var "#values"\r
-\r
-importJava "org.simantics.db.layer0.variable.ProxyVariables" where\r
-    inputVariable :: Variable -> <ReadGraph> Variable\r
-    sessionVariable :: Variable -> <ReadGraph> Variable\r
-    proxyVariableBase :: Variable -> <ReadGraph> Variable\r
-    makeProxyVariable :: Variable -> Variable -> <ReadGraph> Variable\r
+include "Simantics/DB"
+include "Simantics/Ontologies"
+include "Simantics/Variables"
+include "Spreadsheet/All"
+
+createSCLQueryAction :: Resource -> <Proc> ()
+createSCLQueryAction res = do
+  syncWrite (\() -> createSCLQueryDefault res) 
+  ()
+
+createSCLQueryTypeAction :: Resource -> <Proc> ()
+createSCLQueryTypeAction res = do
+  syncWrite (\() -> createSCLQueryTypeDefault res) 
+  ()
+
+createSCLQueryDefault :: Resource -> Resource -> <WriteGraph> Resource
+createSCLQueryDefault library queryType = createSCLQuery library queryType $ findFreshEscapedName "Query" library 
+
+createSCLQuery :: Resource -> Resource -> String -> <WriteGraph> Resource
+createSCLQuery library queryType name = do
+    markUndoPoint ()
+    module = newResource ()
+    claim module L0.InstanceOf queryType
+    claimRelatedValue module L0.HasName name
+    claim module L0.PartOf library
+    sheet = createSheet module "Sheet"
+    range = createRange sheet SHEET.ExpressionRange "Range1" "queryCells $ sheetQueryValue self input"
+    addCommentMetadata ("Created SCL Query " + name)
+    module
+
+createSCLQueryTypeDefault :: Resource -> <WriteGraph> Resource
+createSCLQueryTypeDefault library = createSCLQueryType library $ findFreshEscapedName "QueryType" library 
+
+createSCLQueryType :: Resource -> String -> <WriteGraph> Resource
+createSCLQueryType library name = do
+    markUndoPoint ()
+    queryType = newResource ()
+    claim queryType L0.Inherits MOD.SCLQuery
+    claimRelatedValue queryType L0.HasName name
+    claimAssertion MOD.SCLQuery.values $ createSCLValueIndependent MOD.SCLQuery.Value "[]"
+    claim queryType L0.PartOf library
+    addCommentMetadata ("Created SCL Query Type " + name)
+    queryType
+
+queryValue :: Variable -> Variable -> <ReadGraph> a
+queryValue variable input = do
+    untypedValue $ browse (makeProxyVariable variable input) "#values" 
+
+sheetQueryVariable :: Variable -> Variable -> <ReadGraph> Variable
+sheetQueryVariable self input = do
+    query = variableParent $ proxyVariableBase self
+    makeProxyVariable query input
+
+sheetQueryValue :: Variable -> Variable -> <ReadGraph> a
+sheetQueryValue self input = do
+    var = sheetQueryVariable self input
+    untypedValue $ browse var "#values"
+
+importJava "org.simantics.db.layer0.variable.ProxyVariables" where
+    inputVariable :: Variable -> <ReadGraph> Variable
+    sessionVariable :: Variable -> <ReadGraph> Variable
+    proxyVariableBase :: Variable -> <ReadGraph> Variable
+    makeProxyVariable :: Variable -> Variable -> <ReadGraph> Variable
     
\ No newline at end of file