]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Enabled parameter overrides for normal experiments. A flattened model is created...
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 8 Feb 2013 12:50:49 +0000 (12:50 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 8 Feb 2013 12:50:49 +0000 (12:50 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@26743 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn/src/org/simantics/sysdyn/modelica/ModelicaWriter.java
org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Module.java
org.simantics.sysdyn/src/org/simantics/sysdyn/representation/utils/FormatUtils.java

index 2335933421e49d07ff5259d3d3ab9a27bd6bedb9..2ced39d8571b358645c10f08c095bf0c673b0a4f 100644 (file)
@@ -11,7 +11,6 @@
  *******************************************************************************/\r
 package org.simantics.sysdyn.modelica;\r
 \r
-import java.io.IOException;\r
 import java.util.ArrayList;\r
 import java.util.Collection;\r
 import java.util.Collections;\r
@@ -88,10 +87,7 @@ public class ModelicaWriter {
         \r
         // Insert spreadsheets\r
         String version = null;\r
-        try {\r
-            version = ModelicaManager.getOMCVersion();\r
-        } catch (IOException e) {\r
-        }\r
+        version = ModelicaManager.getOMCVersion();\r
         if(version != null && version.startsWith("1.9")) {\r
             b.insert(spreadsheetlocation, getGlobalSpreadSheets(configurations));\r
         } else {\r
index d9b329eff0ee1262a1c1d10bc25c220fbbeb3645..15a8b729ad4402f992802e7b41aaa56e21f9ba2e 100644 (file)
@@ -23,7 +23,6 @@ import org.simantics.objmap.annotations.RelatedElement;
 import org.simantics.objmap.annotations.RelatedElements;\r
 import org.simantics.objmap.annotations.RelatedValue;\r
 import org.simantics.sysdyn.SysdynResource;\r
-import org.simantics.sysdyn.representation.utils.RepresentationUtils;\r
 import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid;\r
 import org.simantics.utils.datastructures.Pair;\r
 \r
@@ -226,24 +225,20 @@ public class Module implements IElement {
 \r
        /**\r
         * Get all parameter override elements for this module instance as a string "param = value, param2 = value2, ..."\r
-        * <p>\r
-        * Only used with game experiments. Other experiments use inits-file.\r
         * @return parameter overrides\r
         */\r
        public String getParameterOverrideString() {\r
-               String result = "";\r
+           String result = "";\r
 \r
-               if(RepresentationUtils.isPartOfGameExperiment(this)) {\r
-                       for(ParameterOverride po : getParameterOverrides()) {\r
-                               IndependentVariable var = po.getVariable();\r
-                               if(!Variability.CONTINUOUS.equals(Variability.getVariability(var, false, parentConfiguration))) {\r
-                                       if(!result.isEmpty())\r
-                                               result += ", ";\r
+           for(ParameterOverride po : getParameterOverrides()) {\r
+               IndependentVariable var = po.getVariable();\r
+               if(!Variability.CONTINUOUS.equals(Variability.getVariability(var, false, parentConfiguration))) {\r
+                   if(!result.isEmpty())\r
+                       result += ", ";\r
 \r
-                                       result += po.getOverride();\r
-                               }\r
-                       }\r
-               }\r
+                   result += po.getOverride();\r
+               }\r
+           }\r
 \r
                return result;\r
        }\r
index 0427225a7f2f7c216567681f4033886e6a1a2316..bb2d136aa367803ae4d5b5d3d7c141856dd6532a 100644 (file)
@@ -86,7 +86,7 @@ public class FormatUtils {
                                } else {\r
                        if(array)\r
                            refName = "sum(" + refName + ")";\r
-                                       condition= "if initial() or " + refName + " < 0 or " +\r
+                                       condition= "if " + refName + " < 0 or " +\r
                                                refName + " >= 0 then (";\r
                                }\r
                                \r