]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling/scl/Simantics/Typicals.scl
Fixed Simantics/Diagram/setElements to resolve attachment relations
[simantics/platform.git] / bundles / org.simantics.modeling / scl / Simantics / Typicals.scl
index a16ea6c0a15d6413097533fa33b56255a7c68d54..255e88580b0282d6b33b5ca509a35e66bd669488 100644 (file)
@@ -1,55 +1,55 @@
-import "Simantics/Ontologies"\r
-import "Simantics/Model"\r
-\r
-@private\r
-toDiagrams composites = map (flip singleObject MOD.CompositeToDiagram) composites\r
-\r
-@private\r
-importJava "org.simantics.modeling.typicals.SyncTypicalTemplatesToInstances" where\r
-    syncTypicals :: Boolean -> [Resource] -> [Resource] -> <WriteGraph> ()\r
-\r
-"""\r
-    syncAllTypicals False currentModel\r
-\r
-Synchronizes all typical master diagrams in the specified model with all\r
-instances of the found typical master diagrams.\r
-\r
-The first argument controls whether a log of the synchronization will be\r
-stored in the database, in the model's Documents folder.\r
-"""\r
-syncAllTypicals :: Boolean -> Resource -> <Proc> ()\r
-syncAllTypicals log model = syncInstancesOfTypicalMasters log masterComposites\r
-    where\r
-        masterComposites = lift2Read searchByTypeShallow model MOD.MasterTypicalCompositeType\r
-\r
-"""\r
-    syncInstancesOfTypicalMasters False [aMasterTypicalComposite]\r
-\r
-Synchronizes all instances of the specified typical master diagram(s).\r
-\r
-The first argument controls whether a log of the synchronization will be\r
-stored in the database, in the model's Documents folder.\r
-\r
-The second argument expects diagram configuration composite resources.\r
-"""\r
-syncInstancesOfTypicalMasters :: Boolean -> [Resource] -> <Proc> ()\r
-syncInstancesOfTypicalMasters log typicalMasterComposites = syncWrite (\_ -> syncTypicals log masterDiagrams [])\r
-    where\r
-        masterDiagrams = lift1Read toDiagrams typicalMasterComposites\r
-\r
-"""\r
-    syncTypicalInstances False [aTypicalInstance]\r
-\r
-Synchronizes the specified typical instance diagram(s) with their master\r
-diagrams.\r
-\r
-The first argument controls whether a log of the synchronization will be\r
-stored in the database, in the model's Documents folder.\r
-\r
-The second argument expects diagram configuration composite resources.\r
-"""\r
-syncTypicalInstances :: Boolean -> [Resource] -> <Proc> ()\r
-syncTypicalInstances log typicalInstanceComposites = let\r
-        instanceDiagrams = lift1Read toDiagrams typicalInstanceComposites\r
-    in\r
-        syncWrite (\_ -> syncTypicals log [] instanceDiagrams)\r
+import "Simantics/Ontologies"
+import "Simantics/Model"
+
+@private
+toDiagrams composites = map (flip singleObject MOD.CompositeToDiagram) composites
+
+@private
+importJava "org.simantics.modeling.typicals.SyncTypicalTemplatesToInstances" where
+    syncTypicals :: Boolean -> [Resource] -> [Resource] -> <WriteGraph> ()
+
+"""
+    syncAllTypicals False currentModel
+
+Synchronizes all typical master diagrams in the specified model with all
+instances of the found typical master diagrams.
+
+The first argument controls whether a log of the synchronization will be
+stored in the database, in the model's Documents folder.
+"""
+syncAllTypicals :: Boolean -> Resource -> <Proc> ()
+syncAllTypicals log model = syncInstancesOfTypicalMasters log masterComposites
+    where
+        masterComposites = lift2Read searchByTypeShallow model MOD.MasterTypicalCompositeType
+
+"""
+    syncInstancesOfTypicalMasters False [aMasterTypicalComposite]
+
+Synchronizes all instances of the specified typical master diagram(s).
+
+The first argument controls whether a log of the synchronization will be
+stored in the database, in the model's Documents folder.
+
+The second argument expects diagram configuration composite resources.
+"""
+syncInstancesOfTypicalMasters :: Boolean -> [Resource] -> <Proc> ()
+syncInstancesOfTypicalMasters log typicalMasterComposites = syncWrite (\_ -> syncTypicals log masterDiagrams [])
+    where
+        masterDiagrams = lift1Read toDiagrams typicalMasterComposites
+
+"""
+    syncTypicalInstances False [aTypicalInstance]
+
+Synchronizes the specified typical instance diagram(s) with their master
+diagrams.
+
+The first argument controls whether a log of the synchronization will be
+stored in the database, in the model's Documents folder.
+
+The second argument expects diagram configuration composite resources.
+"""
+syncTypicalInstances :: Boolean -> [Resource] -> <Proc> ()
+syncTypicalInstances log typicalInstanceComposites = let
+        instanceDiagrams = lift1Read toDiagrams typicalInstanceComposites
+    in
+        syncWrite (\_ -> syncTypicals log [] instanceDiagrams)