From 3e9c6ea7ab210fc0d50fffd30827aaa7b76e841f Mon Sep 17 00:00:00 2001 From: jkauttio Date: Fri, 6 Mar 2015 14:41:49 +0000 Subject: [PATCH] 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 --- .../sysdyn/representation/expressions/Expression.java | 8 ++++++++ .../sysdyn/representation/expressions/IExpression.java | 2 ++ 2 files changed, 10 insertions(+) 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(); } -- 2.47.1