]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Fix undefined input variable in root configuration to use the default variable
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 2 Sep 2011 07:50:18 +0000 (07:50 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 2 Sep 2011 07:50:18 +0000 (07:50 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@22033 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn/src/org/simantics/sysdyn/modelica/ModelicaWriter.java

index ec94c8031d6d7ca9958595d18a911b135fbb626e..a9a7be8ba1af5b1512a3992096046bb8d9f3ba17 100644 (file)
@@ -154,6 +154,18 @@ public class ModelicaWriter {
                b.append("    " + variable.getName() + " = " + module.getName() + "." + reference.getName() + ";\n");\r
             else\r
                b.append("    " + variable.getName() + " = " + variable.getDefaultInputValue() + ";\n");\r
+            \r
+            if(configuration.getModel() != null) {\r
+                // Root configuration\r
+                inputs.remove(variable);\r
+            }\r
+        }\r
+        \r
+        // Set root configuration input defaults\r
+        if(configuration.getModel() != null) {\r
+            for(Input i : inputs) {\r
+                b.append("    " + i.getName() + " = " + i.getDefaultInputValue() + ";\n");\r
+            }\r
         }\r
 \r
         b.append("// Outputs\n");\r