From 3b065a95a1ee0bd541d025ffc33aa56c18f1bb4c Mon Sep 17 00:00:00 2001 From: villberg Date: Mon, 25 Aug 2014 16:23:03 +0000 Subject: [PATCH] refs #5224 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@30131 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../src/fi/semantum/sysdyn/solver/Variable.java | 6 +++--- .../src/fi/semantum/sysdyn/solver/VariableBase.java | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Variable.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Variable.java index 9420424b..05ac71fd 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Variable.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Variable.java @@ -128,7 +128,7 @@ public class Variable implements IExpression { if(value == null) return; - if(base.isStoredAsArray()) return; + if(base.isStoredAsArray(env)) return; int fullDimension = base.dimension(); if(fullDimension == 1) { @@ -169,13 +169,13 @@ public class Variable implements IExpression { validateSize(env, subscripts, value); if(value instanceof Array) { - if(base.isStoredAsArray()) { + if(base.isStoredAsArray(env)) { env.put(base.index(env, subscripts), value); } else { assignArray(env, base.index(env, subscripts), (Array)value, 0); } } else { - if(base.isStoredAsArray()) { + if(base.isStoredAsArray(env)) { Object _existing = env.getValue(base.index); Array existing = (Array)_existing; if(existing == null) { diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/VariableBase.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/VariableBase.java index 842cb93a..355c7919 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/VariableBase.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/VariableBase.java @@ -80,10 +80,10 @@ public class VariableBase { for(int d : dimensions) result *= d; return result; } - public boolean isStoredAsArray() { + public boolean isStoredAsArray(IEnvironment env) { if(dimensions == null) return false; for(int d : dimensions) if(d == -1) return true; - return false; + return (env instanceof Frame); } VariableBase withBase(String prefix) { @@ -161,7 +161,7 @@ public class VariableBase { public int getConstantIndex(IEnvironment environment, IExpression[] subscripts) { - if(isStoredAsArray()) { + if(isStoredAsArray(environment)) { return -1; } else { @@ -210,7 +210,7 @@ public class VariableBase { } } - if(isStoredAsArray()) { + if(isStoredAsArray(environment)) { Array array = (Array)environment.getValue(index); if(hasScalarSubscript(subscripts)) { -- 2.47.1