]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling/scl/Simantics/Model.scl
Removed uses of deprecated functions
[simantics/platform.git] / bundles / org.simantics.modeling / scl / Simantics / Model.scl
index a2531e3e07a7060e02d9e5cab2a505611e771b8d..c631d399e99e18a4a17825538b312bd41f634ab4 100644 (file)
@@ -11,7 +11,7 @@ Returns an existing model in the current project with the given `name`
 """
 model :: String -> <ReadGraph> Model
 model name = match possibleResourceChild (currentProject ()) name with
-    Just m -> fromResource m
+    Just m -> m
     Nothing -> fail $ "Didn't find a model " + name + "." 
 
 """
@@ -21,15 +21,13 @@ Returns the configuration of the given `model`
 and returns the `configuration` resource
 """
 configurationOf :: Model -> <ReadGraph> Configuration
-configurationOf m = do
-    conf = singleObject (toResource m) SIMU.HasConfiguration 
-    fromResource conf
+configurationOf m = singleObject m SIMU.HasConfiguration
 
 """
 Returns the list of all models in the current project.
 """
 allModels :: () -> <ReadGraph> [Model]
-allModels _ = map fromResource $ objectsWithType (currentProject ()) L0.ConsistsOf SIMU.Model
+allModels _ = objectsWithType (currentProject ()) L0.ConsistsOf SIMU.Model
 
 importJava "org.simantics.modeling.ModelingUtils" where
     """Removes the index associated with the model."""