From d235492f9cb5aad0b6400980c7baa5015ca9f075 Mon Sep 17 00:00:00 2001 From: jkauttio Date: Tue, 1 Apr 2014 11:28:48 +0000 Subject: [PATCH] Clean up vensim import, finalize rename refs #2924 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/branches/dev-jkauttio@29235 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../sysdyn/ui/handlers/imports/ImportMdlHandler.java | 6 +++--- .../sysdyn/ui/wizards/mdl/WizardMdlImportPage.java | 6 +++--- .../modelImport/{MdlParser2.java => MdlParser.java} | 8 ++++---- .../sysdyn/modelImport/model/{Model2.java => Model.java} | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) rename org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/{MdlParser2.java => MdlParser.java} (95%) rename org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/{Model2.java => Model.java} (95%) diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/imports/ImportMdlHandler.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/imports/ImportMdlHandler.java index c30a9c79..9aa51437 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/imports/ImportMdlHandler.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/imports/ImportMdlHandler.java @@ -25,8 +25,8 @@ import org.simantics.db.Resource; import org.simantics.db.WriteGraph; import org.simantics.db.common.request.WriteRequest; import org.simantics.db.exception.DatabaseException; -import org.simantics.sysdyn.modelImport.MdlParser2; -import org.simantics.sysdyn.modelImport.model.Model2; +import org.simantics.sysdyn.modelImport.MdlParser; +import org.simantics.sysdyn.modelImport.model.Model; import org.simantics.sysdyn.modelImport.model.WriteContext; import org.simantics.sysdyn.ui.Activator; import org.simantics.ui.SimanticsUI; @@ -66,7 +66,7 @@ public class ImportMdlHandler extends AbstractHandler { Activator.getDefault().getPreferenceStore().setValue(IMPORTMDLTPATH, (new File(selected)).getParent()); // Convert Vensim model to Simantics SysDyn format using MdlParser - final Model2 model = MdlParser2.parse(file); + final Model model = MdlParser.parse(file); SimanticsUI.getSession().asyncRequest(new WriteRequest() { diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/wizards/mdl/WizardMdlImportPage.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/wizards/mdl/WizardMdlImportPage.java index 475ee264..94bf2f7d 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/wizards/mdl/WizardMdlImportPage.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/wizards/mdl/WizardMdlImportPage.java @@ -23,8 +23,8 @@ import org.simantics.db.Resource; import org.simantics.db.WriteGraph; import org.simantics.db.common.request.WriteRequest; import org.simantics.db.exception.DatabaseException; -import org.simantics.sysdyn.modelImport.MdlParser2; -import org.simantics.sysdyn.modelImport.model.Model2; +import org.simantics.sysdyn.modelImport.MdlParser; +import org.simantics.sysdyn.modelImport.model.Model; import org.simantics.sysdyn.modelImport.model.WriteContext; import org.simantics.ui.SimanticsUI; @@ -179,7 +179,7 @@ public class WizardMdlImportPage extends WizardPage{ File file = new File(selected); - final Model2 model = MdlParser2.parse(file); + final Model model = MdlParser.parse(file); SimanticsUI.getSession().asyncRequest(new WriteRequest() { diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/MdlParser2.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/MdlParser.java similarity index 95% rename from org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/MdlParser2.java rename to org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/MdlParser.java index abf8caf3..e4b6e4ef 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/MdlParser2.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/MdlParser.java @@ -29,7 +29,7 @@ import org.simantics.sysdyn.modelImport.mdl.SketchObject; import org.simantics.sysdyn.modelImport.mdl.SketchValve; import org.simantics.sysdyn.modelImport.mdl.SketchVariable; import org.simantics.sysdyn.modelImport.mdl.Subscript2; -import org.simantics.sysdyn.modelImport.model.Model2; +import org.simantics.sysdyn.modelImport.model.Model; import org.simantics.sysdyn.modelImport.model.element.Auxiliary; import org.simantics.sysdyn.modelImport.model.element.Cloud; import org.simantics.sysdyn.modelImport.model.element.Comment; @@ -41,7 +41,7 @@ import org.simantics.sysdyn.modelImport.model.element.Valve; import org.simantics.sysdyn.modelImport.model.expression.IntegralExpression; import org.simantics.sysdyn.modelImport.model.support.Variable; -public class MdlParser2 { +public class MdlParser { private static final String UTF_8 = "{UTF-8}"; private static final String SKETCH_VERSION = "V300"; @@ -56,7 +56,7 @@ public class MdlParser2 { private static final double H_SPACE = 0; private static final double V_SPACE = 10; - public static Model2 parse(File file) { + public static Model parse(File file) { // generate a mdl model based on the contents of the file MdlModel mdl; try { @@ -68,7 +68,7 @@ public class MdlParser2 { } // generate a sysdyn model from the mdl model - Model2 model = new Model2(file.getName()); + Model model = new Model(file.getName()); double offset = 0; diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/Model2.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/Model.java similarity index 95% rename from org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/Model2.java rename to org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/Model.java index bdc5a19f..733b16a2 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/Model2.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/Model.java @@ -31,7 +31,7 @@ import org.simantics.sysdyn.modelImport.model.element.Shadow; import org.simantics.sysdyn.modelImport.model.support.Enumeration; import org.simantics.sysdyn.utils.ModelUtils; -public class Model2 implements IWriteableObject { +public class Model implements IWriteableObject { private String name; // necessary simulation parameters @@ -45,7 +45,7 @@ public class Model2 implements IWriteableObject { private ArrayList shadows; private ArrayList connections; - public Model2(String name) { + public Model(String name) { this.name = name; enumerations = new HashMap(); -- 2.47.1