From: lempinen Date: Fri, 2 Sep 2011 07:50:18 +0000 (+0000) Subject: Fix undefined input variable in root configuration to use the default variable X-Git-Tag: simantics-1.5~46 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=09acb1dc4931bc3a281814dcd19e894fab40d6bb;p=simantics%2Fsysdyn.git Fix undefined input variable in root configuration to use the default variable git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@22033 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/modelica/ModelicaWriter.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/modelica/ModelicaWriter.java index ec94c803..a9a7be8b 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/modelica/ModelicaWriter.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/modelica/ModelicaWriter.java @@ -154,6 +154,18 @@ public class ModelicaWriter { b.append(" " + variable.getName() + " = " + module.getName() + "." + reference.getName() + ";\n"); else b.append(" " + variable.getName() + " = " + variable.getDefaultInputValue() + ";\n"); + + if(configuration.getModel() != null) { + // Root configuration + inputs.remove(variable); + } + } + + // Set root configuration input defaults + if(configuration.getModel() != null) { + for(Input i : inputs) { + b.append(" " + i.getName() + " = " + i.getDefaultInputValue() + ";\n"); + } } b.append("// Outputs\n");