From: lempinen Date: Fri, 15 Feb 2013 14:59:51 +0000 (+0000) Subject: Fixed Stock initialization with single number fill(number, size) to use dynamic Enume... X-Git-Tag: simantics-1.10.1~35 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=f2877c3432aea0762de1e038f28cb785e708667d;p=simantics%2Fsysdyn.git Fixed Stock initialization with single number fill(number, size) to use dynamic EnumerationName.size instead of getting the size from the number of indexes defined to enumeration. This way it works also with overridden enumerations (fixes #4073) git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@26786 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/StockExpression.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/StockExpression.java index 19f56201..13ee73ea 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/StockExpression.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/StockExpression.java @@ -71,7 +71,7 @@ public class StockExpression extends Expression { } else { b.append(" zeros("); for(int i = 0; i < enumerations.size(); i++) { - b.append(enumerations.get(i).getEnumerationIndexes().size()); + b.append(enumerations.get(i).getName() + ".size"); if(i != enumerations.size() - 1) b.append(", "); }