X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.modeling%2Fscl%2FSimantics%2FTypicals.scl;h=255e88580b0282d6b33b5ca509a35e66bd669488;hp=a16ea6c0a15d6413097533fa33b56255a7c68d54;hb=77d7e2176bf9b031dbe216339568d316066bcfc1;hpb=873afce76b92cb7cf9094fe60e407278f220e5ed diff --git a/bundles/org.simantics.modeling/scl/Simantics/Typicals.scl b/bundles/org.simantics.modeling/scl/Simantics/Typicals.scl index a16ea6c0a..255e88580 100644 --- a/bundles/org.simantics.modeling/scl/Simantics/Typicals.scl +++ b/bundles/org.simantics.modeling/scl/Simantics/Typicals.scl @@ -1,55 +1,55 @@ -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] -> () - -""" - 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 -> () -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] -> () -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] -> () -syncTypicalInstances log typicalInstanceComposites = let - instanceDiagrams = lift1Read toDiagrams typicalInstanceComposites - in - syncWrite (\_ -> syncTypicals log [] instanceDiagrams) +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] -> () + +""" + 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 -> () +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] -> () +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] -> () +syncTypicalInstances log typicalInstanceComposites = let + instanceDiagrams = lift1Read toDiagrams typicalInstanceComposites + in + syncWrite (\_ -> syncTypicals log [] instanceDiagrams)