From: jkauttio Date: Fri, 6 Mar 2015 14:41:49 +0000 (+0000) Subject: Add documentation support to Xmile import / export X-Git-Tag: v1.29.0~112 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=3e9c6ea7ab210fc0d50fffd30827aaa7b76e841f;p=simantics%2Fsysdyn.git Add documentation support to Xmile import / export THIS IS VERY WORK IN PROGRESS AND NOT FUNCTIONAL AT THE MOMENT. refs #5645 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@31049 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/Expression.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/Expression.java index 98c51a57..005af14c 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/Expression.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/Expression.java @@ -89,4 +89,12 @@ public abstract class Expression implements IExpression { public String getDocumentationExpression(ReadGraph graph) throws DatabaseException { return getEquation(); } + + public String[] getArrayIndices() { + String tmp = range; + if (tmp.startsWith("[") && tmp.endsWith("]")) { + tmp = tmp.substring(1, tmp.length() - 1); + } + return tmp.split(","); + } } diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/IExpression.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/IExpression.java index 58de03cc..434aae85 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/IExpression.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/IExpression.java @@ -84,4 +84,6 @@ public interface IExpression { * @return */ String getDocumentationExpression(ReadGraph graph) throws DatabaseException; + + String[] getArrayIndices(); }