From a945b26335d3a54c77e1da916bca8a68b4696420 Mon Sep 17 00:00:00 2001 From: lehtonen Date: Fri, 12 Jul 2013 17:41:45 +0000 Subject: [PATCH] Added importModel function to Sysdyn SCL module. refs #3511 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@27707 ac1ea38d-2e2b-0410-8846-a27921b304fc --- org.simantics.sysdyn/scl/Sysdyn.scl | 3 ++- .../simantics/sysdyn/utils/DocumentationUtils.java | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/org.simantics.sysdyn/scl/Sysdyn.scl b/org.simantics.sysdyn/scl/Sysdyn.scl index d0c69402..fb63e325 100644 --- a/org.simantics.sysdyn/scl/Sysdyn.scl +++ b/org.simantics.sysdyn/scl/Sysdyn.scl @@ -83,5 +83,6 @@ importJava "org.simantics.sysdyn.utils.DocumentationUtils" where @JavaName formatDate formatDate :: Long -> String - + @JavaName importModel + importModel :: String -> () \ No newline at end of file diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/utils/DocumentationUtils.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/utils/DocumentationUtils.java index 17c5aa35..2e5a5c64 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/utils/DocumentationUtils.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/utils/DocumentationUtils.java @@ -7,6 +7,7 @@ import java.util.Comparator; import java.util.Date; import java.util.List; +import org.eclipse.core.runtime.NullProgressMonitor; import org.simantics.databoard.Bindings; import org.simantics.databoard.util.Base64; import org.simantics.db.ReadGraph; @@ -30,6 +31,7 @@ import org.simantics.sysdyn.representation.Shadow; import org.simantics.sysdyn.representation.Stock; import org.simantics.sysdyn.representation.Variability; import org.simantics.sysdyn.representation.Variable; +import org.simantics.sysdyn.utils.imports.ImportUtils; public class DocumentationUtils { @@ -459,4 +461,15 @@ public class DocumentationUtils { String result = DateFormat.getDateInstance().format(date); return result; } + + /** + * Supports importing Sysdyn models into the current project from TG files + * in SCL. + * + * @param path + */ + public static void importModel(String path) { + ImportUtils.importModelFile(path, new NullProgressMonitor()); + } + } -- 2.47.1