Bundle-Vendor: Semantum Oy
Require-Bundle: org.eclipse.core.runtime,
org.simantics.utils;bundle-version="1.1.0",
- org.simantics.databoard;bundle-version="0.6.5"
+ org.simantics.databoard;bundle-version="0.6.5",
+ org.simantics.utils.datastructures;bundle-version="1.1.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Export-Package: fi.semantum.sysdyn.solver
return this;\r
}\r
\r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ visitor.visit(this);\r
+ exp1.accept(visitor);\r
+ exp2.accept(visitor);\r
+ }\r
+ \r
}\r
import java.util.ArrayList;\r
import java.util.Map;\r
\r
+import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
+\r
public class And implements IExpression {\r
\r
public IExpression[] exps;\r
return this;\r
}\r
\r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ visitor.visit(this);\r
+ for(IExpression exp : exps) exp.accept(visitor);\r
+ }\r
+ \r
}\r
\r
import java.util.Map;\r
\r
+import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
+\r
public class Application implements IExpression {\r
\r
public String name;\r
return this;\r
}\r
\r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ visitor.visit(this);\r
+ for(Argument a : args.args)\r
+ a.modification.accept(visitor);\r
+ }\r
+ \r
}\r
\r
import java.util.Map;\r
\r
+import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
+\r
public class Argument implements IExpression {\r
\r
public String name;\r
return this;\r
}\r
\r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ visitor.visit(this);\r
+ modification.accept(visitor);\r
+ }\r
+ \r
}\r
import java.util.Iterator;\r
import java.util.Map;\r
\r
+import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
import fi.semantum.sysdyn.solver.SolverUtils.Slice;\r
\r
public class Array implements IExpression {\r
return result;\r
}\r
\r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ visitor.visit(this);\r
+ for(int i=0;i<elements.size();i++) {\r
+ Object element = elements.get(i);\r
+ if(element instanceof IExpression) {\r
+ ((IExpression)element).accept(visitor);\r
+ }\r
+ }\r
+ }\r
+ \r
}\r
\r
import java.util.Map;\r
\r
+import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
+\r
public class ArraySliceExpression implements IExpression {\r
\r
public IExpression start;\r
return this;\r
}\r
\r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ visitor.visit(this);\r
+ start.accept(visitor);\r
+ end.accept(visitor);\r
+ }\r
+ \r
}\r
*******************************************************************************/\r
package fi.semantum.sysdyn.solver;\r
\r
-import org.omg.PortableInterceptor.SUCCESSFUL;\r
+import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
\r
public class Assignment {\r
\r
\r
import java.util.Map;\r
\r
+import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
+\r
public class Constant implements IExpression {\r
\r
public Object value;\r
return this;\r
}\r
\r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ visitor.visit(this);\r
+ }\r
+ \r
}\r
\r
*******************************************************************************/\r
package fi.semantum.sysdyn.solver;\r
\r
+import java.nio.channels.UnsupportedAddressTypeException;\r
import java.util.Map;\r
\r
+import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
+\r
public class Declaration implements IExpression {\r
\r
public Variable variable;\r
throw new UnsupportedOperationException();\r
}\r
\r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ throw new UnsupportedOperationException();\r
+ }\r
+\r
}\r
\r
import java.util.Map;\r
\r
+import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
+\r
public class Derivate implements IExpression {\r
\r
private Variable variable;\r
private IExpression[] subscripts;\r
- private IExpression e;\r
+ public IExpression e;\r
\r
public Derivate(Variable variable, IExpression[] subscripts, IExpression e) {\r
this.variable = variable;\r
return this;\r
}\r
\r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ visitor.visit(this);\r
+ if(subscripts != null) {\r
+ for(int i=0;i<subscripts.length;i++)\r
+ subscripts[i].accept(visitor);\r
+ }\r
+ e.accept(visitor);\r
+ }\r
+ \r
}\r
throw new UnsupportedOperationException();\r
}\r
\r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ throw new UnsupportedOperationException();\r
+ }\r
+ \r
}\r
\r
import java.util.Map;\r
\r
+import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
+\r
public class Division implements IExpression {\r
\r
public IExpression exp1;\r
return this;\r
}\r
\r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ visitor.visit(this);\r
+ exp1.accept(visitor);\r
+ exp2.accept(visitor);\r
+ }\r
+ \r
}\r
import java.util.Iterator;\r
import java.util.Map;\r
\r
+import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
+\r
public class ElementwiseProduct implements IExpression {\r
\r
public IExpression exp1;\r
return this;\r
}\r
\r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ visitor.visit(this);\r
+ exp1.accept(visitor);\r
+ exp2.accept(visitor);\r
+ }\r
+ \r
}\r
\r
import java.util.Map;\r
\r
+import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
+\r
public class Equals implements IExpression {\r
\r
public IExpression exp1;\r
return this;\r
}\r
\r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ visitor.visit(this);\r
+ exp1.accept(visitor);\r
+ exp2.accept(visitor);\r
+ }\r
+ \r
}\r
import java.util.Collection;\r
import java.util.Map;\r
\r
+import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
+\r
public class ForArray implements IExpression {\r
\r
private ArrayList<Object> elements = new ArrayList<Object>();\r
return this;\r
}\r
\r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ visitor.visit(this);\r
+ for(int i=0;i<elements.size();i++) {\r
+ Object o = elements.get(i);\r
+ if(o instanceof IExpression) {\r
+ ((IExpression)o).accept(visitor);\r
+ }\r
+ }\r
+ }\r
+ \r
}\r
\r
import java.util.Map;\r
\r
+import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
+\r
public class GreaterOrEqualThan implements IExpression {\r
\r
public IExpression exp1;\r
return this;\r
}\r
\r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ visitor.visit(this);\r
+ exp1.accept(visitor);\r
+ exp2.accept(visitor);\r
+ }\r
+ \r
}\r
\r
import java.util.Map;\r
\r
+import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
+\r
public class GreaterThan implements IExpression {\r
\r
public IExpression exp1;\r
return this;\r
}\r
\r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ visitor.visit(this);\r
+ exp1.accept(visitor);\r
+ exp2.accept(visitor);\r
+ }\r
+ \r
}\r
\r
public interface IExpression {\r
\r
+ public interface ExpressionVisitor {\r
+ void visit(IExpression expression);\r
+ }\r
+ \r
public Object evaluate(IEnvironment environment);\r
public IExpression withBase(IFrame frame, String prefix);\r
public Object getPossibleConstant();\r
public IExpression rewrite(IFrame frame, Map<String, VariableBase> copies);\r
+ public void accept(ExpressionVisitor visitor);\r
\r
}\r
\r
import java.util.Map;\r
\r
+import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
+\r
public class IfThenElse implements IExpression {\r
\r
public IExpression exp;\r
return this;\r
}\r
\r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ visitor.visit(this);\r
+ exp.accept(visitor);\r
+ t.accept(visitor);\r
+ e.accept(visitor);\r
+ }\r
+\r
}\r
\r
import java.util.Map;\r
\r
+import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
+\r
public class LessOrEqualThan implements IExpression {\r
\r
public IExpression exp1;\r
return this;\r
}\r
\r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ visitor.visit(this);\r
+ exp1.accept(visitor);\r
+ exp2.accept(visitor);\r
+ }\r
+ \r
}\r
\r
import java.util.Map;\r
\r
+import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
+\r
public class LessThan implements IExpression {\r
\r
public IExpression exp1;\r
return this;\r
}\r
\r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ visitor.visit(this);\r
+ exp1.accept(visitor);\r
+ exp2.accept(visitor);\r
+ }\r
+ \r
}\r
\r
import java.util.Map;\r
\r
+import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
+\r
public class Multiplication implements IExpression {\r
\r
public IExpression exp1;\r
return this;\r
}\r
\r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ visitor.visit(this);\r
+ exp1.accept(visitor);\r
+ exp2.accept(visitor);\r
+ }\r
+ \r
}\r
\r
import java.util.Map;\r
\r
+import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
+\r
public class Negation implements IExpression {\r
\r
public IExpression exp;\r
return this;\r
}\r
\r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ visitor.visit(this);\r
+ exp.accept(visitor);\r
+ }\r
+ \r
}\r
\r
import java.util.Map;\r
\r
+import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
+\r
public class NotEquals implements IExpression {\r
\r
public IExpression exp1;\r
return this;\r
}\r
\r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ visitor.visit(this);\r
+ exp1.accept(visitor);\r
+ exp2.accept(visitor);\r
+ }\r
+ \r
}\r
public IExpression rewrite(IFrame frame, Map<String, VariableBase> copies) {\r
return this;\r
}\r
+ \r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ visitor.visit(this);\r
+ }\r
\r
}\r
import java.util.ArrayList;\r
import java.util.Map;\r
\r
+import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
+\r
public class Or implements IExpression {\r
\r
public IExpression[] exps;\r
return this;\r
}\r
\r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ visitor.visit(this);\r
+ for(IExpression exp : exps) exp.accept(visitor);\r
+ }\r
+ \r
}\r
throw new UnsupportedOperationException();\r
}\r
\r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ throw new UnsupportedOperationException();\r
+ }\r
+ \r
}\r
\r
import java.io.StringReader;\r
import java.util.ArrayList;\r
+import java.util.Collections;\r
+import java.util.Comparator;\r
+import java.util.HashSet;\r
+import java.util.List;\r
+import java.util.Set;\r
\r
+import org.simantics.utils.datastructures.MapList;\r
+\r
+import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
import fi.semantum.sysdyn.solver.Model.Globals;\r
import fi.semantum.sysdyn.solver.parser.ModelParser;\r
import fi.semantum.sysdyn.solver.parser.SimpleNode;\r
private Environment env;\r
\r
private Object[] newValues;\r
+ private Object[] derivatives;\r
\r
private double step;\r
private double start;\r
ready = false;\r
}\r
\r
+ private void sortAssignments() {\r
+\r
+ final MapList<String,Assignment> asses = new MapList<String,Assignment>();\r
+ for(Assignment ass : model.assignments) asses.add(ass.target.base.name, ass);\r
+ \r
+ final List<VariableBase> found = new ArrayList<VariableBase>();\r
+ final Set<String> visited = new HashSet<String>();\r
+\r
+ ExpressionVisitor sortVisitor = new ExpressionVisitor() {\r
+ @Override\r
+ public void visit(IExpression expression) {\r
+ if(expression instanceof Variable) {\r
+ Variable var = (Variable)expression;\r
+ if(visited.add(var.base.name)) {\r
+ for(Assignment ass : asses.getValues(var.base.name)) {\r
+ ass.expression.accept(this);\r
+ if(ass.subscripts != null)\r
+ for(IExpression e : ass.subscripts) e.accept(this);\r
+ }\r
+ found.add(var.base);\r
+ }\r
+ }\r
+ }\r
+ };\r
+ \r
+ // Sort assignments\r
+ for(Assignment ass : model.assignments) {\r
+ ass.target.accept(sortVisitor);\r
+ }\r
+\r
+ Collections.sort(model.assignments, new Comparator<Assignment>() {\r
+\r
+ @Override\r
+ public int compare(Assignment o1, Assignment o2) {\r
+ int i1 = found.indexOf(o1.target.base); \r
+ int i2 = found.indexOf(o2.target.base);\r
+ if(i1 < i2) return -1;\r
+ else if (i1 > i2) return 1;\r
+ return 0;\r
+ }\r
+\r
+ \r
+ });\r
+ \r
+ }\r
+ \r
public void prepare(String input) throws Exception {\r
\r
long startNanos = System.nanoTime();\r
\r
env.valueTable = new Object[size+STACK_SIZE];\r
\r
+ sortAssignments();\r
+ \r
model.assignmentArray = model.assignments.toArray(new Assignment[model.assignments.size()]);\r
model.derivativeArray = model.derivatives.toArray(new Assignment[model.derivatives.size()]);\r
model.parameterArray = model.parameters.toArray(new ParameterDeclaration[model.parameters.size()]);\r
\r
newValues = new Object[Math.max(model.assignments.size(),model.derivatives.size())];\r
+ derivatives = new Object[model.derivatives.size()];\r
\r
int condition = 1;\r
int loops = 0;\r
return env.getValueArray();\r
}\r
\r
+ \r
+ \r
public void step() {\r
// TODO: do something more sensible if the solver is not ready\r
if (!ready) return;\r
Assignment[] assignments = model.assignmentArray;\r
Assignment[] derivatives = model.derivativeArray;\r
\r
- // should probably be wrapped inside a method or something\r
- env.time += env.step;\r
- \r
- // Solve algebraic equations\r
- for(int i=0;i<assignments.length;i++) {\r
- newValues[i] = assignments[i].expression.evaluate(env);\r
- }\r
- for(int i=0;i<model.assignments.size();i++) {\r
- assignments[i].target.assign(env, assignments[i].subscripts, newValues[i]);\r
- }\r
-\r
- // Solve derivatives\r
+ // first we evaluate, integrate and assign derivatives at previous time step\r
for(int i=0;i<model.derivatives.size();i++) {\r
newValues[i] = derivatives[i].expression.evaluate(env);\r
}\r
for(int i=0;i<model.derivatives.size();i++) {\r
derivatives[i].target.assign(env, assignments[i].subscripts, newValues[i]);\r
}\r
+\r
+ // Increment time\r
+ // should probably be wrapped inside a method or something\r
+ env.time += env.step;\r
+\r
+ // Next solve algebraic equations\r
+ for(int i=0;i<assignments.length;i++) {\r
+ Object value = assignments[i].expression.evaluate(env);\r
+ assignments[i].target.assign(env, assignments[i].subscripts, value);\r
+ }\r
+\r
}\r
\r
// TODO: implement some on the fly parameter change stuff for different experiment types\r
\r
import java.util.Map;\r
\r
+import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
+\r
public class Subtraction implements IExpression {\r
\r
public IExpression exp1;\r
return this;\r
}\r
\r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ visitor.visit(this);\r
+ exp1.accept(visitor);\r
+ exp2.accept(visitor);\r
+ }\r
+ \r
}\r
\r
import java.util.Map;\r
\r
+import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
+\r
public class TimeVariable implements IExpression {\r
\r
@Override\r
return this;\r
}\r
\r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ visitor.visit(this);\r
+ }\r
+ \r
}\r
\r
import java.util.Map;\r
\r
+import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
+\r
\r
\r
public class Variable implements IExpression {\r
\r
}\r
\r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ visitor.visit(this);\r
+ }\r
+ \r
}\r
*******************************************************************************/\r
package fi.semantum.sysdyn.solver;\r
\r
-import java.util.Arrays;\r
-\r
import fi.semantum.sysdyn.solver.SolverUtils.Slice;\r
\r
public class VariableBase {\r
\r
import java.util.Map;\r
\r
+import fi.semantum.sysdyn.solver.IExpression.ExpressionVisitor;\r
+\r
\r
public class VariableDeclaration implements IExpression {\r
\r
throw new UnsupportedOperationException();\r
}\r
\r
+ @Override\r
+ public void accept(ExpressionVisitor visitor) {\r
+ throw new UnsupportedOperationException();\r
+ }\r
+ \r
}\r
case 47:\r
case 50:\r
case 61:\r
- case 94:\r
case 95:\r
+ case 96:\r
;\r
break;\r
default:\r
case 17:\r
jj_consume_token(17);\r
break;\r
- case 94:\r
- jj_consume_token(94);\r
- break;\r
case 95:\r
jj_consume_token(95);\r
break;\r
+ case 96:\r
+ jj_consume_token(96);\r
+ break;\r
default:\r
jj_la1[7] = jj_gen;\r
jj_consume_token(-1);\r
case 61:\r
case 68:\r
case IDENT:\r
- case 94:\r
case 95:\r
+ case 96:\r
;\r
break;\r
default:\r
case 61:\r
case 68:\r
case IDENT:\r
- case 94:\r
case 95:\r
+ case 96:\r
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
case 8:\r
jj_consume_token(8);\r
case 61:\r
case 68:\r
case IDENT:\r
- case 94:\r
case 95:\r
+ case 96:\r
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
case 7:\r
case 17:\r
case 47:\r
case 50:\r
case 61:\r
- case 94:\r
case 95:\r
+ case 96:\r
class_definition();\r
break;\r
case 5:\r
case 47:\r
case 50:\r
case 61:\r
- case 94:\r
case 95:\r
+ case 96:\r
class_definition();\r
break;\r
case 5:\r
case 61:\r
case 68:\r
case IDENT:\r
- case 94:\r
case 95:\r
+ case 96:\r
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
case 7:\r
case 17:\r
case 47:\r
case 50:\r
case 61:\r
- case 94:\r
case 95:\r
+ case 96:\r
class_definition();\r
break;\r
case 5:\r
case 47:\r
case 50:\r
case 61:\r
- case 94:\r
case 95:\r
+ case 96:\r
class_definition();\r
break;\r
case 5:\r
jj_scanpos = xsp;\r
if (jj_scan_token(17)) {\r
jj_scanpos = xsp;\r
- if (jj_scan_token(94)) {\r
+ if (jj_scan_token(95)) {\r
jj_scanpos = xsp;\r
- if (jj_scan_token(95)) return true;\r
+ if (jj_scan_token(96)) return true;\r
}\r
}\r
}\r
static private int[] jj_la1_0;\r
static private int[] jj_la1_1;\r
static private int[] jj_la1_2;\r
+ static private int[] jj_la1_3;\r
static {\r
jj_la1_init_0();\r
jj_la1_init_1();\r
jj_la1_init_2();\r
+ jj_la1_init_3();\r
}\r
private static void jj_la1_init_0() {\r
jj_la1_0 = new int[] {0x0,0x0,0x45020880,0x800,0x40000000,0x0,0x0,0x5020080,0x0,0x0,0x0,0x0,0x0,0x10,0x10,0x0,0x0,0x4000,0x0,0x4000,0x0,0x80001040,0x4d8329a0,0x100,0x800,0x0,0x8000000,0x458300a0,0x458300a0,0x0,0x458320a0,0x4d8329a0,0x0,0x0,0x0,0x4000,0x0,0x0,0x810000,0x810000,0x20,0x20,0x0,0x0,0x0,0x80000000,0x0,0x0,0x0,0x0,0x2d00,0x0,0x2d00,0x400,0x800,0x2000,0x0,0x400,0x800,0x458300a0,0x458320a0,0x458300a0,0x0,0x0,0x0,0xa0240000,0x80200000,0x0,0xa0240000,0x80201040,0x100000,0x80201040,0x80201040,0x8000,0xa0240000,0x100000,0xa0240000,0xa0240000,0x8000,0x80201040,0xa0240000,0x0,0x0,0xa0240000,0x80201040,0x2000000,0x80201040,0xa0240000,0x2000000,0xa0240000,0x100000,0x80001040,0x100000,0x80001040,0x0,0x0,0x400000,0x200,0x1000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80001040,0x200000,0x200000,0x0,0x0,0x80001040,0x0,0x80001040,0x0,0x0,0x80001040,0x4000,0x0,0x0,};\r
jj_la1_1 = new int[] {0x0,0x200000,0x20049064,0x0,0x0,0x8000,0x40000,0x20041064,0x0,0x40000000,0x0,0x0,0x0,0x2106000,0x106000,0x0,0x0,0x0,0x8000000,0x0,0x0,0x4400400a,0x218e9475,0x0,0x0,0x80000,0x0,0x21069465,0x21069465,0x400000,0x21069465,0x218e9475,0x0,0x0,0x40000000,0x0,0x40000000,0x0,0x0,0x0,0x20400,0x20400,0x1000001,0x1000001,0x0,0x0,0x0,0x40000000,0x0,0x40000000,0x0,0x0,0x0,0x0,0x0,0x0,0x40000000,0x0,0x0,0x21069465,0x21069465,0x21069465,0x400000,0x4000,0x4000,0x40010800,0x880,0x40000000,0x40010800,0x4400488a,0x0,0x4400488a,0x4400488a,0x0,0x40010800,0x0,0x40010800,0x40010800,0x0,0x4400488a,0x40010800,0x0,0x200,0x40010800,0x4400488a,0x0,0x4400488a,0x40010800,0x0,0x40010800,0x0,0x4400400a,0x0,0x4400400a,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4004000,0x0,0x2,0x40000008,0x0,0x0,0x0,0x0,0x0,0x0,0x4400400a,0x0,0x0,0x0,0x0,0x4400400a,0x0,0x4400400a,0x0,0x0,0x4400400a,0x0,0x0,0x0,};\r
}\r
private static void jj_la1_init_2() {\r
- jj_la1_2 = new int[] {0x4000010,0x0,0xc0000000,0x0,0x0,0x0,0x0,0xc0000000,0x4,0x0,0x80,0x4000000,0x80,0x0,0x0,0x8000000,0x4000010,0x0,0x0,0x0,0x4000010,0x3c03c015,0xc4000010,0x0,0x0,0x0,0x0,0xc4000010,0xc4000010,0x0,0xc4000010,0xc4000010,0x10,0x4000010,0x0,0x0,0x0,0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0x0,0x4,0x3000000,0x1000000,0x3000000,0x4000010,0x80,0x4000010,0x0,0x0,0x4000010,0x3000000,0x0,0x0,0xc4000010,0xc4000010,0xc4000010,0x0,0x0,0x0,0x4000010,0x4000000,0x2000000,0x4000010,0x3c03c015,0x0,0x3c03c015,0x3c03c015,0x0,0x4000010,0x0,0x4000010,0x4000010,0x0,0x3c03c015,0x4000010,0x80,0x0,0x4000010,0x3c03c015,0x0,0x3c03c015,0x4000010,0x0,0x4000010,0x0,0x3c03c015,0x0,0x3c03c015,0x20,0x20,0x0,0x0,0x0,0x3f00,0x3f00,0x3c000,0x3c000,0x3c000,0x3c0000,0x3c0000,0xc00000,0xc00000,0x4000010,0x40,0x38000000,0x4000015,0x10,0x10,0x10,0x4,0x10,0x4,0x3c03c015,0x80,0x80,0x4000000,0x80,0x3c03c015,0x80,0x3c03c015,0x80,0x80,0x3c03c035,0x0,0x4000,0x8000000,};\r
+ jj_la1_2 = new int[] {0x4000010,0x0,0x80000000,0x0,0x0,0x0,0x0,0x80000000,0x4,0x0,0x80,0x4000000,0x80,0x0,0x0,0x8000000,0x4000010,0x0,0x0,0x0,0x4000010,0x6c03c015,0x84000010,0x0,0x0,0x0,0x0,0x84000010,0x84000010,0x0,0x84000010,0x84000010,0x10,0x4000010,0x0,0x0,0x0,0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0x0,0x4,0x3000000,0x1000000,0x3000000,0x4000010,0x80,0x4000010,0x0,0x0,0x4000010,0x3000000,0x0,0x0,0x84000010,0x84000010,0x84000010,0x0,0x0,0x0,0x4000010,0x4000000,0x2000000,0x4000010,0x6c03c015,0x0,0x6c03c015,0x6c03c015,0x0,0x4000010,0x0,0x4000010,0x4000010,0x0,0x6c03c015,0x4000010,0x80,0x0,0x4000010,0x6c03c015,0x0,0x6c03c015,0x4000010,0x0,0x4000010,0x0,0x6c03c015,0x0,0x6c03c015,0x20,0x20,0x0,0x0,0x0,0x3f00,0x3f00,0x3c000,0x3c000,0x3c000,0x3c0000,0x3c0000,0xc00000,0xc00000,0x4000010,0x40,0x68000000,0x4000015,0x10,0x10,0x10,0x4,0x10,0x4,0x6c03c015,0x80,0x80,0x4000000,0x80,0x6c03c015,0x80,0x6c03c015,0x80,0x80,0x6c03c035,0x0,0x4000,0x8000000,};\r
+ }\r
+ private static void jj_la1_init_3() {\r
+ jj_la1_3 = new int[] {0x0,0x0,0x1,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,0x1,0x1,0x0,0x1,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x1,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,};\r
}\r
final private JJCalls[] jj_2_rtns = new JJCalls[10];\r
private boolean jj_rescan = false;\r
/** Generate ParseException. */\r
public ParseException generateParseException() {\r
jj_expentries.clear();\r
- boolean[] la1tokens = new boolean[96];\r
+ boolean[] la1tokens = new boolean[97];\r
if (jj_kind >= 0) {\r
la1tokens[jj_kind] = true;\r
jj_kind = -1;\r
if ((jj_la1_2[i] & (1<<j)) != 0) {\r
la1tokens[64+j] = true;\r
}\r
+ if ((jj_la1_3[i] & (1<<j)) != 0) {\r
+ la1tokens[96+j] = true;\r
+ }\r
}\r
}\r
}\r
- for (int i = 0; i < 96; i++) {\r
+ for (int i = 0; i < 97; i++) {\r
if (la1tokens[i]) {\r
jj_expentry = new int[1];\r
jj_expentry[0] = i;\r
/** RegularExpression Id. */\r
int STRING = 91;\r
/** RegularExpression Id. */\r
- int UNSIGNED_INTEGER = 92;\r
+ int EXP = 92;\r
/** RegularExpression Id. */\r
- int UNSIGNED_NUMBER = 93;\r
+ int UNSIGNED_INTEGER = 93;\r
+ /** RegularExpression Id. */\r
+ int UNSIGNED_NUMBER = 94;\r
\r
/** Lexical state. */\r
int DEFAULT = 0;\r
"\":=\"",\r
"<IDENT>",\r
"<STRING>",\r
+ "<EXP>",\r
"<UNSIGNED_INTEGER>",\r
"<UNSIGNED_NUMBER>",\r
"\"operator function\"",\r
switch (pos)
{\r
case 0:\r
- if ((active0 & 0x3ffffffffffffff0L) != 0L || (active1 & 0xc0000000L) != 0L)\r
+ if ((active1 & 0x80000L) != 0L)\r
+ return 20;\r
+ if ((active0 & 0x377bdef7bdef7bf0L) != 0L || (active1 & 0x180000000L) != 0L)\r
{\r
jjmatchedKind = 90;\r
return 2;\r
}\r
- if ((active1 & 0x80000L) != 0L)\r
- return 13;\r
if ((active1 & 0xb30010L) != 0L)\r
- return 9;\r
+ return 13;\r
+ if ((active0 & 0x884210842108400L) != 0L)\r
+ {\r
+ jjmatchedKind = 90;\r
+ return 44;\r
+ }\r
return -1;\r
case 1:\r
if ((active0 & 0x108420080400000L) != 0L)\r
return 2;\r
- if ((active0 & 0x3ef7bdff7fbffff0L) != 0L || (active1 & 0xc0000000L) != 0L)\r
+ if ((active0 & 0x3ef7bdff7fbffff0L) != 0L || (active1 & 0x180000000L) != 0L)\r
{\r
if (jjmatchedPos != 1)\r
{\r
case 2:\r
if ((active0 & 0x400000800201200L) != 0L)\r
return 2;\r
- if ((active0 & 0x3bfffdf77f9fedf0L) != 0L || (active1 & 0xc0000000L) != 0L)\r
+ if ((active0 & 0x3bfffdf77f9fedf0L) != 0L || (active1 & 0x180000000L) != 0L)\r
{\r
jjmatchedKind = 90;\r
jjmatchedPos = 2;\r
case 3:\r
if ((active0 & 0x1000084212118400L) != 0L)\r
return 2;\r
- if ((active0 & 0x2bfff5b56d8e69f0L) != 0L || (active1 & 0xc0000000L) != 0L)\r
+ if ((active0 & 0x2bfff5b56d8e69f0L) != 0L || (active1 & 0x180000000L) != 0L)\r
{\r
if (jjmatchedPos != 3)\r
{\r
case 4:\r
if ((active0 & 0x1090004290008c0L) != 0L)\r
return 2;\r
- if ((active0 & 0x2af6f5b1469e6130L) != 0L || (active1 & 0xc0000000L) != 0L)\r
+ if ((active0 & 0x2af6f5b1469e6130L) != 0L || (active1 & 0x180000000L) != 0L)\r
{\r
jjmatchedKind = 90;\r
jjmatchedPos = 4;\r
case 5:\r
if ((active0 & 0x22200011009c0000L) != 0L)\r
return 2;\r
- if ((active0 & 0x8d6f5a046026130L) != 0L || (active1 & 0xc0000000L) != 0L)\r
+ if ((active0 & 0x8d6f5a046026130L) != 0L || (active1 & 0x180000000L) != 0L)\r
{\r
jjmatchedKind = 90;\r
jjmatchedPos = 5;\r
case 6:\r
if ((active0 & 0x80d0a000000000L) != 0L)\r
return 2;\r
- if ((active0 & 0x856250046026130L) != 0L || (active1 & 0xc0000000L) != 0L)\r
+ if ((active0 & 0x856250046026130L) != 0L || (active1 & 0x180000000L) != 0L)\r
{\r
if (jjmatchedPos != 6)\r
{\r
}\r
return 2;\r
}\r
- if ((active0 & 0x802200006020020L) != 0L || (active1 & 0xc0000000L) != 0L)\r
+ if ((active0 & 0x802200006020020L) != 0L || (active1 & 0x180000000L) != 0L)\r
return 2;\r
return -1;\r
case 8:\r
jjmatchedKind = 68;\r
return jjMoveStringLiteralDfa1_0(0x0L, 0xb30000L);\r
case 47:\r
- return jjStartNfaWithStates_0(0, 83, 13);\r
+ return jjStartNfaWithStates_0(0, 83, 20);\r
case 58:\r
jjmatchedKind = 69;\r
return jjMoveStringLiteralDfa1_0(0x0L, 0x2000000L);\r
case 110:\r
return jjMoveStringLiteralDfa1_0(0x1000L, 0x0L);\r
case 111:\r
- return jjMoveStringLiteralDfa1_0(0x108420000L, 0xc0000000L);\r
+ return jjMoveStringLiteralDfa1_0(0x108420000L, 0x180000000L);\r
case 112:\r
return jjMoveStringLiteralDfa1_0(0x210842000000000L, 0x0L);\r
case 114:\r
case 111:\r
return jjMoveStringLiteralDfa2_0(active0, 0x1042108000201080L, active1, 0L);\r
case 112:\r
- return jjMoveStringLiteralDfa2_0(active0, 0x20000L, active1, 0xc0000000L);\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x20000L, active1, 0x180000000L);\r
case 113:\r
return jjMoveStringLiteralDfa2_0(active0, 0x200000000000L, active1, 0L);\r
case 114:\r
return jjStartNfaWithStates_0(2, 35, 2);\r
return jjMoveStringLiteralDfa3_0(active0, 0x180L, active1, 0L);\r
case 101:\r
- return jjMoveStringLiteralDfa3_0(active0, 0x80030020000L, active1, 0xc0000000L);\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x80030020000L, active1, 0x180000000L);\r
case 103:\r
return jjMoveStringLiteralDfa3_0(active0, 0x10L, active1, 0L);\r
case 105:\r
return jjStartNfaWithStates_0(3, 60, 2);\r
return jjMoveStringLiteralDfa4_0(active0, 0x100000000L, active1, 0L);\r
case 114:\r
- return jjMoveStringLiteralDfa4_0(active0, 0x20000L, active1, 0xc0000000L);\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x20000L, active1, 0x180000000L);\r
case 115:\r
return jjMoveStringLiteralDfa4_0(active0, 0x42000400000040L, active1, 0L);\r
case 116:\r
switch(curChar)\r
{\r
case 97:\r
- return jjMoveStringLiteralDfa5_0(active0, 0x2000822000L, active1, 0xc0000000L);\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x2000822000L, active1, 0x180000000L);\r
case 99:\r
return jjMoveStringLiteralDfa5_0(active0, 0x100L, active1, 0L);\r
case 101:\r
return jjStartNfaWithStates_0(5, 32, 2);\r
else if ((active0 & 0x1000000000L) != 0L)\r
return jjStartNfaWithStates_0(5, 36, 2);\r
- return jjMoveStringLiteralDfa6_0(active0, 0x20000L, active1, 0xc0000000L);\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x20000L, active1, 0x180000000L);\r
default :\r
break;\r
}\r
case 110:\r
return jjMoveStringLiteralDfa7_0(active0, 0x2000000000000L, active1, 0L);\r
case 111:\r
- return jjMoveStringLiteralDfa7_0(active0, 0x200004020000L, active1, 0xc0000000L);\r
+ return jjMoveStringLiteralDfa7_0(active0, 0x200004020000L, active1, 0x180000000L);\r
case 115:\r
if ((active0 & 0x80000000000000L) != 0L)\r
return jjStartNfaWithStates_0(6, 55, 2);\r
jjmatchedKind = 17;\r
jjmatchedPos = 7;\r
}\r
- return jjMoveStringLiteralDfa8_0(active0, 0x100L, active1, 0xc0000000L);\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x100L, active1, 0x180000000L);\r
case 116:\r
if ((active0 & 0x2000000000000L) != 0L)\r
return jjStartNfaWithStates_0(7, 49, 2);\r
switch(curChar)\r
{\r
case 32:\r
- return jjMoveStringLiteralDfa9_0(active0, 0L, active1, 0xc0000000L);\r
+ return jjMoveStringLiteralDfa9_0(active0, 0L, active1, 0x180000000L);\r
case 97:\r
return jjMoveStringLiteralDfa9_0(active0, 0x40000000L, active1, 0L);\r
case 98:\r
return jjStartNfaWithStates_0(9, 50, 2);\r
return jjMoveStringLiteralDfa10_0(active0, 0x40000000000000L, active1, 0L);\r
case 102:\r
- return jjMoveStringLiteralDfa10_0(active0, 0L, active1, 0x40000000L);\r
+ return jjMoveStringLiteralDfa10_0(active0, 0L, active1, 0x80000000L);\r
case 108:\r
return jjMoveStringLiteralDfa10_0(active0, 0x2000L, active1, 0L);\r
case 110:\r
case 111:\r
return jjMoveStringLiteralDfa10_0(active0, 0x10000000000L, active1, 0L);\r
case 114:\r
- return jjMoveStringLiteralDfa10_0(active0, 0L, active1, 0x80000000L);\r
+ return jjMoveStringLiteralDfa10_0(active0, 0L, active1, 0x100000000L);\r
case 116:\r
return jjMoveStringLiteralDfa10_0(active0, 0x40000000L, active1, 0L);\r
default :\r
case 101:\r
if ((active0 & 0x2000L) != 0L)\r
return jjStartNfaWithStates_0(10, 13, 2);\r
- return jjMoveStringLiteralDfa11_0(active0, 0x40000000L, active1, 0x80000000L);\r
+ return jjMoveStringLiteralDfa11_0(active0, 0x40000000L, active1, 0x100000000L);\r
case 110:\r
if ((active0 & 0x10000000000L) != 0L)\r
return jjStartNfaWithStates_0(10, 40, 2);\r
break;\r
case 117:\r
- return jjMoveStringLiteralDfa11_0(active0, 0L, active1, 0x40000000L);\r
+ return jjMoveStringLiteralDfa11_0(active0, 0L, active1, 0x80000000L);\r
default :\r
break;\r
}\r
case 98:\r
return jjMoveStringLiteralDfa12_0(active0, 0x40000000000000L, active1, 0L);\r
case 99:\r
- return jjMoveStringLiteralDfa12_0(active0, 0L, active1, 0x80000000L);\r
+ return jjMoveStringLiteralDfa12_0(active0, 0L, active1, 0x100000000L);\r
case 100:\r
if ((active0 & 0x40000000L) != 0L)\r
return jjStartNfaWithStates_0(11, 30, 2);\r
break;\r
case 110:\r
- return jjMoveStringLiteralDfa12_0(active0, 0L, active1, 0x40000000L);\r
+ return jjMoveStringLiteralDfa12_0(active0, 0L, active1, 0x80000000L);\r
default :\r
break;\r
}\r
switch(curChar)\r
{\r
case 99:\r
- return jjMoveStringLiteralDfa13_0(active0, 0L, active1, 0x40000000L);\r
- case 111:\r
return jjMoveStringLiteralDfa13_0(active0, 0L, active1, 0x80000000L);\r
+ case 111:\r
+ return jjMoveStringLiteralDfa13_0(active0, 0L, active1, 0x100000000L);\r
case 121:\r
if ((active0 & 0x40000000000000L) != 0L)\r
return jjStartNfaWithStates_0(12, 54, 2);\r
switch(curChar)\r
{\r
case 114:\r
- return jjMoveStringLiteralDfa14_0(active1, 0x80000000L);\r
+ return jjMoveStringLiteralDfa14_0(active1, 0x100000000L);\r
case 116:\r
- return jjMoveStringLiteralDfa14_0(active1, 0x40000000L);\r
+ return jjMoveStringLiteralDfa14_0(active1, 0x80000000L);\r
default :\r
break;\r
}\r
switch(curChar)\r
{\r
case 100:\r
- if ((active1 & 0x80000000L) != 0L)\r
- return jjStopAtPos(14, 95);\r
+ if ((active1 & 0x100000000L) != 0L)\r
+ return jjStopAtPos(14, 96);\r
break;\r
case 105:\r
- return jjMoveStringLiteralDfa15_0(active1, 0x40000000L);\r
+ return jjMoveStringLiteralDfa15_0(active1, 0x80000000L);\r
default :\r
break;\r
}\r
switch(curChar)\r
{\r
case 111:\r
- return jjMoveStringLiteralDfa16_0(active1, 0x40000000L);\r
+ return jjMoveStringLiteralDfa16_0(active1, 0x80000000L);\r
default :\r
break;\r
}\r
switch(curChar)\r
{\r
case 110:\r
- if ((active1 & 0x40000000L) != 0L)\r
- return jjStopAtPos(16, 94);\r
+ if ((active1 & 0x80000000L) != 0L)\r
+ return jjStopAtPos(16, 95);\r
break;\r
default :\r
break;\r
private int jjMoveNfa_0(int startState, int curPos)\r
{\r
int startsAt = 0;\r
- jjnewStateCnt = 31;\r
+ jjnewStateCnt = 44;\r
int i = 1;\r
jjstateSet[0] = startState;\r
int kind = 0x7fffffff;\r
{\r
switch(jjstateSet[--i])\r
{\r
- case 13:\r
- if (curChar == 47)\r
- {\r
- if (kind > 3)\r
- kind = 3;\r
- jjCheckNAdd(20);\r
- }\r
- else if (curChar == 42)\r
- jjCheckNAddStates(0, 2);\r
- break;\r
case 0:\r
if ((0x3ff000000000000L & l) != 0L)\r
{\r
- if (kind > 92)\r
- kind = 92;\r
- jjCheckNAddStates(3, 7);\r
+ if (kind > 93)\r
+ kind = 93;\r
+ jjCheckNAddStates(0, 6);\r
}\r
else if ((0x100002600L & l) != 0L)\r
{\r
kind = 1;\r
}\r
else if (curChar == 47)\r
- jjAddStates(8, 9);\r
+ jjAddStates(7, 8);\r
else if (curChar == 46)\r
- jjCheckNAdd(9);\r
+ jjCheckNAdd(13);\r
else if (curChar == 34)\r
- jjCheckNAddStates(10, 12);\r
+ jjCheckNAddStates(9, 11);\r
+ break;\r
+ case 44:\r
+ if ((0x3ff400000000000L & l) != 0L)\r
+ {\r
+ if (kind > 90)\r
+ kind = 90;\r
+ jjCheckNAdd(2);\r
+ }\r
+ else if (curChar == 45)\r
+ {\r
+ if (kind > 92)\r
+ kind = 92;\r
+ }\r
+ break;\r
+ case 20:\r
+ if (curChar == 47)\r
+ {\r
+ if (kind > 3)\r
+ kind = 3;\r
+ jjCheckNAdd(27);\r
+ }\r
+ else if (curChar == 42)\r
+ jjCheckNAddStates(12, 14);\r
break;\r
case 2:\r
if ((0x3ff400000000000L & l) == 0L)\r
break;\r
if (kind > 90)\r
kind = 90;\r
- jjstateSet[jjnewStateCnt++] = 2;\r
+ jjCheckNAdd(2);\r
break;\r
case 3:\r
if (curChar == 34)\r
- jjCheckNAddStates(10, 12);\r
+ jjCheckNAddStates(9, 11);\r
break;\r
case 4:\r
if ((0xfffffffbfffffbffL & l) != 0L)\r
- jjCheckNAddStates(10, 12);\r
+ jjCheckNAddStates(9, 11);\r
break;\r
case 6:\r
if ((0xfffffffffffffbffL & l) != 0L)\r
- jjCheckNAddStates(10, 12);\r
+ jjCheckNAddStates(9, 11);\r
break;\r
case 7:\r
if (curChar == 34 && kind > 91)\r
kind = 91;\r
break;\r
- case 8:\r
+ case 9:\r
+ if (curChar == 45 && kind > 92)\r
+ kind = 92;\r
+ break;\r
+ case 12:\r
if (curChar == 46)\r
- jjCheckNAdd(9);\r
+ jjCheckNAdd(13);\r
break;\r
- case 9:\r
+ case 13:\r
if ((0x3ff000000000000L & l) == 0L)\r
break;\r
- if (kind > 93)\r
- kind = 93;\r
- jjCheckNAddTwoStates(9, 10);\r
+ if (kind > 94)\r
+ kind = 94;\r
+ jjCheckNAddStates(15, 18);\r
break;\r
- case 11:\r
+ case 15:\r
if ((0x3ff000000000000L & l) == 0L)\r
break;\r
- if (kind > 93)\r
- kind = 93;\r
- jjstateSet[jjnewStateCnt++] = 11;\r
+ if (kind > 94)\r
+ kind = 94;\r
+ jjCheckNAdd(15);\r
break;\r
- case 12:\r
+ case 16:\r
+ if (curChar == 45)\r
+ jjCheckNAdd(15);\r
+ break;\r
+ case 19:\r
if (curChar == 47)\r
- jjAddStates(8, 9);\r
+ jjAddStates(7, 8);\r
break;\r
- case 14:\r
+ case 21:\r
if ((0xfffffbffffffffffL & l) != 0L)\r
- jjCheckNAddStates(0, 2);\r
+ jjCheckNAddStates(12, 14);\r
break;\r
- case 15:\r
+ case 22:\r
if (curChar == 42)\r
- jjstateSet[jjnewStateCnt++] = 16;\r
+ jjstateSet[jjnewStateCnt++] = 23;\r
break;\r
- case 16:\r
+ case 23:\r
if ((0xffff7fffffffffffL & l) != 0L)\r
- jjCheckNAddStates(0, 2);\r
+ jjCheckNAddStates(12, 14);\r
break;\r
- case 17:\r
+ case 24:\r
if (curChar == 47 && kind > 2)\r
kind = 2;\r
break;\r
- case 18:\r
+ case 25:\r
if (curChar == 42)\r
- jjstateSet[jjnewStateCnt++] = 17;\r
+ jjstateSet[jjnewStateCnt++] = 24;\r
break;\r
- case 19:\r
+ case 26:\r
if (curChar != 47)\r
break;\r
if (kind > 3)\r
kind = 3;\r
- jjCheckNAdd(20);\r
+ jjCheckNAdd(27);\r
break;\r
- case 20:\r
+ case 27:\r
if ((0xfffffffffffffbffL & l) == 0L)\r
break;\r
if (kind > 3)\r
kind = 3;\r
- jjCheckNAdd(20);\r
+ jjCheckNAdd(27);\r
break;\r
- case 21:\r
+ case 28:\r
if ((0x3ff000000000000L & l) == 0L)\r
break;\r
- if (kind > 92)\r
- kind = 92;\r
- jjCheckNAddStates(3, 7);\r
+ if (kind > 93)\r
+ kind = 93;\r
+ jjCheckNAddStates(0, 6);\r
break;\r
- case 22:\r
+ case 29:\r
if ((0x3ff000000000000L & l) == 0L)\r
break;\r
- if (kind > 92)\r
- kind = 92;\r
- jjCheckNAdd(22);\r
+ if (kind > 93)\r
+ kind = 93;\r
+ jjCheckNAdd(29);\r
break;\r
- case 23:\r
+ case 30:\r
if ((0x3ff000000000000L & l) != 0L)\r
- jjCheckNAddTwoStates(23, 24);\r
+ jjCheckNAddTwoStates(30, 31);\r
break;\r
- case 24:\r
+ case 31:\r
if (curChar != 46)\r
break;\r
- if (kind > 93)\r
- kind = 93;\r
- jjCheckNAddTwoStates(25, 26);\r
+ if (kind > 94)\r
+ kind = 94;\r
+ jjCheckNAddStates(19, 22);\r
break;\r
- case 25:\r
+ case 32:\r
if ((0x3ff000000000000L & l) == 0L)\r
break;\r
- if (kind > 93)\r
- kind = 93;\r
- jjCheckNAddTwoStates(25, 26);\r
+ if (kind > 94)\r
+ kind = 94;\r
+ jjCheckNAddStates(19, 22);\r
break;\r
- case 27:\r
+ case 34:\r
if ((0x3ff000000000000L & l) == 0L)\r
break;\r
- if (kind > 93)\r
- kind = 93;\r
- jjstateSet[jjnewStateCnt++] = 27;\r
+ if (kind > 94)\r
+ kind = 94;\r
+ jjCheckNAdd(34);\r
break;\r
- case 28:\r
+ case 35:\r
+ if (curChar == 45)\r
+ jjCheckNAdd(34);\r
+ break;\r
+ case 38:\r
if ((0x3ff000000000000L & l) != 0L)\r
- jjCheckNAddTwoStates(28, 29);\r
+ jjCheckNAddStates(23, 26);\r
break;\r
- case 30:\r
+ case 40:\r
if ((0x3ff000000000000L & l) == 0L)\r
break;\r
- if (kind > 93)\r
- kind = 93;\r
- jjstateSet[jjnewStateCnt++] = 30;\r
+ if (kind > 94)\r
+ kind = 94;\r
+ jjCheckNAdd(40);\r
+ break;\r
+ case 41:\r
+ if (curChar == 45)\r
+ jjCheckNAdd(40);\r
break;\r
default : break;\r
}\r
switch(jjstateSet[--i])\r
{\r
case 0:\r
+ if ((0x7fffffe87fffffeL & l) != 0L)\r
+ {\r
+ if (kind > 90)\r
+ kind = 90;\r
+ jjCheckNAdd(2);\r
+ }\r
+ if ((0x2000000020L & l) != 0L)\r
+ {\r
+ if (kind > 92)\r
+ kind = 92;\r
+ }\r
+ if (curChar == 69)\r
+ jjCheckNAdd(9);\r
+ else if (curChar == 101)\r
+ jjCheckNAdd(9);\r
+ break;\r
+ case 44:\r
case 2:\r
if ((0x7fffffe87fffffeL & l) == 0L)\r
break;\r
kind = 90;\r
jjCheckNAdd(2);\r
break;\r
+ case 1:\r
+ if ((0x7fffffe87fffffeL & l) == 0L)\r
+ break;\r
+ if (kind > 90)\r
+ kind = 90;\r
+ jjCheckNAdd(2);\r
+ break;\r
case 4:\r
if ((0xffffffffefffffffL & l) != 0L)\r
- jjCheckNAddStates(10, 12);\r
+ jjCheckNAddStates(9, 11);\r
break;\r
case 5:\r
if (curChar == 92)\r
jjstateSet[jjnewStateCnt++] = 6;\r
break;\r
case 6:\r
- jjCheckNAddStates(10, 12);\r
+ jjCheckNAddStates(9, 11);\r
+ break;\r
+ case 8:\r
+ if ((0x2000000020L & l) != 0L && kind > 92)\r
+ kind = 92;\r
break;\r
case 10:\r
- if ((0x2000000020L & l) != 0L)\r
- jjstateSet[jjnewStateCnt++] = 11;\r
+ if (curChar == 101)\r
+ jjCheckNAdd(9);\r
+ break;\r
+ case 11:\r
+ if (curChar == 69)\r
+ jjCheckNAdd(9);\r
break;\r
case 14:\r
- case 16:\r
- jjCheckNAddStates(0, 2);\r
+ if ((0x2000000020L & l) != 0L)\r
+ jjstateSet[jjnewStateCnt++] = 15;\r
break;\r
- case 20:\r
+ case 17:\r
+ if (curChar == 101)\r
+ jjCheckNAdd(16);\r
+ break;\r
+ case 18:\r
+ if (curChar == 69)\r
+ jjCheckNAdd(16);\r
+ break;\r
+ case 21:\r
+ case 23:\r
+ jjCheckNAddStates(12, 14);\r
+ break;\r
+ case 27:\r
if (kind > 3)\r
kind = 3;\r
- jjstateSet[jjnewStateCnt++] = 20;\r
+ jjstateSet[jjnewStateCnt++] = 27;\r
break;\r
- case 26:\r
+ case 33:\r
if ((0x2000000020L & l) != 0L)\r
- jjstateSet[jjnewStateCnt++] = 27;\r
+ jjstateSet[jjnewStateCnt++] = 34;\r
break;\r
- case 29:\r
+ case 36:\r
+ if (curChar == 101)\r
+ jjCheckNAdd(35);\r
+ break;\r
+ case 37:\r
+ if (curChar == 69)\r
+ jjCheckNAdd(35);\r
+ break;\r
+ case 39:\r
if ((0x2000000020L & l) != 0L)\r
- jjstateSet[jjnewStateCnt++] = 30;\r
+ jjstateSet[jjnewStateCnt++] = 40;\r
+ break;\r
+ case 42:\r
+ if (curChar == 101)\r
+ jjCheckNAdd(41);\r
+ break;\r
+ case 43:\r
+ if (curChar == 69)\r
+ jjCheckNAdd(41);\r
break;\r
default : break;\r
}\r
case 4:\r
case 6:\r
if ((jjbitVec0[i2] & l2) != 0L)\r
- jjCheckNAddStates(10, 12);\r
+ jjCheckNAddStates(9, 11);\r
break;\r
- case 14:\r
- case 16:\r
+ case 21:\r
+ case 23:\r
if ((jjbitVec0[i2] & l2) != 0L)\r
- jjCheckNAddStates(0, 2);\r
+ jjCheckNAddStates(12, 14);\r
break;\r
- case 20:\r
+ case 27:\r
if ((jjbitVec0[i2] & l2) == 0L)\r
break;\r
if (kind > 3)\r
kind = 3;\r
- jjstateSet[jjnewStateCnt++] = 20;\r
+ jjstateSet[jjnewStateCnt++] = 27;\r
break;\r
default : break;\r
}\r
kind = 0x7fffffff;\r
}\r
++curPos;\r
- if ((i = jjnewStateCnt) == (startsAt = 31 - (jjnewStateCnt = startsAt)))\r
+ if ((i = jjnewStateCnt) == (startsAt = 44 - (jjnewStateCnt = startsAt)))\r
return curPos;\r
try { curChar = input_stream.readChar(); }\r
catch(java.io.IOException e) { return curPos; }\r
}\r
}\r
static final int[] jjnextStates = {
- 14, 15, 18, 22, 23, 24, 28, 29, 13, 19, 4, 5, 7,
+ 29, 30, 31, 38, 39, 42, 43, 20, 26, 4, 5, 7, 21, 22, 25, 13,
+ 14, 17, 18, 32, 33, 36, 37, 38, 39, 42, 43,
};\r
\r
/** Token literal values. */\r
"\145\170\164\145\162\156\141\154", "\154\157\157\160", "\162\145\143\157\162\144", "\50", "\51", "\173", "\175", \r
"\133", "\135", "\56", "\72", "\73", "\54", "\74", "\74\75", "\76", "\76\75", \r
"\75\75", "\74\76", "\53", "\55", "\56\53", "\56\55", "\52", "\57", "\56\52", "\56\57", \r
-"\136", "\56\136", "\75", "\72\75", null, null, null, null, \r
+"\136", "\56\136", "\75", "\72\75", null, null, null, null, null, \r
"\157\160\145\162\141\164\157\162\40\146\165\156\143\164\151\157\156", "\157\160\145\162\141\164\157\162\40\162\145\143\157\162\144", };\r
\r
/** Lexer state names. */\r
"DEFAULT",\r
};\r
static final long[] jjtoToken = {
- 0xfffffffffffffff1L, 0xffffffffL,
+ 0xfffffffffffffff1L, 0x1ffffffffL,
};\r
static final long[] jjtoSkip = {
0xeL, 0x0L,
};\r
protected SimpleCharStream input_stream;\r
-private final int[] jjrounds = new int[31];\r
-private final int[] jjstateSet = new int[62];\r
+private final int[] jjrounds = new int[44];\r
+private final int[] jjstateSet = new int[88];\r
private final StringBuilder jjimage = new StringBuilder();\r
private StringBuilder image = jjimage;\r
private int jjimageLen;\r
{\r
int i;\r
jjround = 0x80000001;\r
- for (i = 31; i-- > 0;)\r
+ for (i = 44; i-- > 0;)\r
jjrounds[i] = 0x80000000;\r
}\r
\r
| <IDENT: ["a"-"z","A"-"Z","_"] (["a"-"z","A"-"Z","_",".", "0"-"9"])* >\r
| <STRING: "\"" (~["\"", "\\", "\n"] | "\\" ~["\n"])* "\"">\r
{ matchedToken.image = matchedToken.image.substring(1,matchedToken.image.length()-1); }\r
+| <EXP: "e" | "e-" | "E" | "E-" >\r
| <UNSIGNED_INTEGER: (["0"-"9"])+ >\r
| <UNSIGNED_NUMBER: \r
- ( <UNSIGNED_INTEGER> "." (<UNSIGNED_INTEGER>)? (["e","E"] <UNSIGNED_INTEGER>)?\r
- | "." <UNSIGNED_INTEGER> (["e","E"] <UNSIGNED_INTEGER>)?\r
- | <UNSIGNED_INTEGER> ["e","E"] <UNSIGNED_INTEGER>\r
+ ( <UNSIGNED_INTEGER> "." (<UNSIGNED_INTEGER>)? (<EXP> <UNSIGNED_INTEGER>)?\r
+ | "." <UNSIGNED_INTEGER> (<EXP> <UNSIGNED_INTEGER>)?\r
+ | <UNSIGNED_INTEGER> <EXP> <UNSIGNED_INTEGER>\r
) >\r
}\r
\r
| <IDENT: ["a"-"z","A"-"Z","_"] (["a"-"z","A"-"Z","_",".", "0"-"9"])* >\r
| <STRING: "\"" (~["\"", "\\", "\n"] | "\\" ~["\n"])* "\"">\r
{ matchedToken.image = matchedToken.image.substring(1,matchedToken.image.length()-1); }\r
+| <EXP: "e" | "e-" | "E" | "E-" >\r
| <UNSIGNED_INTEGER: (["0"-"9"])+ >\r
| <UNSIGNED_NUMBER: \r
- ( <UNSIGNED_INTEGER> "." (<UNSIGNED_INTEGER>)? (["e","E"] <UNSIGNED_INTEGER>)?\r
- | "." <UNSIGNED_INTEGER> (["e","E"] <UNSIGNED_INTEGER>)?\r
- | <UNSIGNED_INTEGER> ["e","E"] <UNSIGNED_INTEGER>\r
+ ( <UNSIGNED_INTEGER> "." (<UNSIGNED_INTEGER>)? (<EXP> <UNSIGNED_INTEGER>)?\r
+ | "." <UNSIGNED_INTEGER> (<EXP> <UNSIGNED_INTEGER>)?\r
+ | <UNSIGNED_INTEGER> <EXP> <UNSIGNED_INTEGER>\r
) >\r
}\r
\r
private Composite spp;\r
private ControlListener controlListener;\r
private static final int WIDE_SCREEN_WIDTH = 1100;\r
+ protected Composite composite;\r
\r
@Override\r
public void createControls(Composite body, IWorkbenchSite site, ISessionContext context, WidgetSupport _support) {\r
\r
@Override\r
public void controlResized(ControlEvent e) {\r
- createLayout(); \r
+ createLayout();\r
}\r
});\r
\r
* Create layout for controls.\r
*/\r
protected void createLayout() {\r
+ if (composite == null || composite.isDisposed())\r
+ return;\r
+ \r
Point size = spp.getSize();\r
if (size.x > size.y) {\r
createControlLayoutHorizontal((size.x > WIDE_SCREEN_WIDTH));\r
*/\r
protected abstract void createControlLayoutHorizontal(boolean wideScreen);\r
\r
- @Override\r
- public void dispose() {\r
- if(controlListener != null && spp != null)\r
- spp.removeControlListener(controlListener);\r
- }\r
+// @Override\r
+// public void dispose() {\r
+// if(controlListener != null && spp != null)\r
+// spp.removeControlListener(controlListener);\r
+// }\r
\r
}\r
package org.simantics.jfreechart.chart.properties;\r
\r
import org.eclipse.jface.viewers.ISelection;\r
-import org.eclipse.swt.events.DisposeEvent;\r
-import org.eclipse.swt.events.DisposeListener;\r
-import org.eclipse.swt.widgets.Composite;\r
-import org.eclipse.ui.IWorkbenchSite;\r
-import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupportImpl;\r
-import org.simantics.db.AsyncReadGraph;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.db.layer0.variable.Variable;\r
-import org.simantics.db.management.ISessionContext;\r
-import org.simantics.db.procedure.AsyncListener;\r
import org.simantics.db.request.Read;\r
import org.simantics.layer0.Layer0;\r
import org.simantics.modeling.ModelingResources;\r
import org.simantics.selectionview.PropertyTabContributorImpl;\r
-import org.simantics.ui.SimanticsUI;\r
-import org.simantics.utils.datastructures.Callback;\r
import org.simantics.utils.ui.AdaptionUtils;\r
\r
public abstract class LabelPropertyTabContributor extends PropertyTabContributorImpl {\r
\r
- private boolean isDisposed = false;\r
-\r
-\r
- public void createControl(Composite parent, final IWorkbenchSite site, final ISessionContext context, final WidgetSupportImpl support) {\r
- super.createControl(parent, site, context, support);\r
-\r
- // Add dispose listener to make sure name listening receives the correct isDisposed -value\r
- parent.addDisposeListener(new DisposeListener() {\r
-\r
- @Override\r
- public void widgetDisposed(DisposeEvent e) {\r
- LabelPropertyTabContributor.this.dispose();\r
- }\r
- });\r
- }\r
-\r
@Override\r
- public void updatePartName(ISelection forSelection, final Callback<String> updateCallback) {\r
- final Variable variable = AdaptionUtils.adaptToSingle(forSelection, Variable.class);\r
- final Resource resource = AdaptionUtils.adaptToSingle(forSelection, Resource.class);\r
- if(resource == null && variable == null) {\r
- updateCallback.run("Selection properties");\r
- return;\r
- }\r
+ public Read<String> getPartNameReadRequest(final ISelection forSelection) {\r
\r
- SimanticsUI.getSession().asyncRequest(new Read<String>() {\r
+ return new Read<String>() {\r
\r
@Override\r
public String perform(ReadGraph graph) throws DatabaseException {\r
Layer0 l0 = Layer0.getInstance(graph);\r
ModelingResources mr = ModelingResources.getInstance(graph);\r
+\r
+ final Variable variable = AdaptionUtils.adaptToSingle(forSelection, Variable.class);\r
+ final Resource resource = AdaptionUtils.adaptToSingle(forSelection, Resource.class);\r
+ if(resource == null && variable == null) {\r
+ return "Selection";\r
+ }\r
\r
Resource r;\r
if(variable != null) {\r
return label;\r
return "No name for selection";\r
}\r
- }, new AsyncListener<String>() {\r
-\r
- @Override\r
- public void execute(AsyncReadGraph graph, String result) {\r
- updateCallback.run(result);\r
- }\r
-\r
- @Override\r
- public void exception(AsyncReadGraph graph, Throwable throwable) {\r
-\r
- }\r
-\r
- @Override\r
- public boolean isDisposed() {\r
- return isDisposed;\r
- }\r
- });\r
+ \r
+ };\r
+ \r
}\r
\r
- @Override\r
- protected void dispose() {\r
- this.isDisposed = true;\r
- }\r
}\r
private WidgetSupportImpl rangeAxisSupport = new WidgetSupportImpl();\r
private TrackedText rangelabel, rangemin, rangemax;\r
private ScrolledComposite sc;\r
- private Composite composite;\r
private Group domainGroup;\r
private Label labelLabel;\r
private AxisHidePropertyComposite axisHide;\r
public class BarGeneralPropertiesTab extends AdjustableTab {\r
\r
private ScrolledComposite sc;\r
- private Composite composite;\r
private Button hgrid, htitle, hlegend;\r
private TrackedText name, title, time;\r
private TrackedCombo type;\r
private Resource chartResource;\r
private BarSeriesPropertyComposite spc;\r
private int options;\r
- private Composite composite;\r
private Composite buttonComposite;\r
\r
public BarSeriesTab(int options) {\r
public class PieGeneralPropertiesTab extends AdjustableTab {\r
\r
private ScrolledComposite sc;\r
- private Composite composite;\r
private Button htitle, hlegend, hlabels;\r
private TrackedText name, title, time;\r
\r
private Button add, remove;\r
private Resource chartResource;\r
private int options;\r
- private Composite composite;\r
private Composite buttonComposite;\r
\r
public PieSeriesTab(int options) {\r
private ScrolledComposite propertyContainer;\r
private Button addAxis, addVariable, remove;\r
private WidgetSupportImpl additionalSupport;\r
- private Composite composite;\r
private Composite buttonComposite;\r
\r
public XYLineAxisAndVariablesTab() {\r
public class XYLineGeneralPropertiesTab extends AdjustableTab implements Widget {\r
\r
private ScrolledComposite sc;\r
- private Composite composite;\r
private TrackedText name, title, xlabel, xvariable, xmin, xmax;\r
private TrackedCombo type;\r
private Button hgrid, htitle, hlegend;\r
FROM16TO17.Spreadsheets\r
FROM16TO17.SysdynChanges\r
FROM16TO17.OrderedSetsToLists\r
+ FROM16TO17.Custom : L0.MigrationStep\r
\r
FROM16TO17.Ontologies : L0.NamespaceMigrationStep\r
@L0.list\r
_\r
@move"http://www.simantics.org/User-" "1.0" "1.1"\r
_\r
- @move"http://www.simantics.org/Documentation-" "1.0" "1.1"\r
+ @move"http://" "www.simantics.org/Documentation-1.1/Components" "www.semantum.fi/Simupedia-1.0/Components"\r
+ _\r
+ @move"http://" "www.simantics.org/Documentation-1.1/Symbols" "www.semantum.fi/Simupedia-1.0/Symbols"\r
+ _\r
+ @move"http://" "www.simantics.org/Documentation-1.1/Properties" "www.semantum.fi/Simupedia-1.0/Properties"\r
+ _\r
+ @move"http://" "www.simantics.org/Documentation-1.1/DiagramRelations" "www.simantics.org/Documentation-1.2/DiagramRelations"\r
+ _\r
+ @move"http://" "www.simantics.org/Documentation-1.1/Relations" "www.simantics.org/Documentation-1.2/Relations"\r
+ _\r
+ @move"http://" "www.simantics.org/Documentation-1.1/Terminals" "www.simantics.org/Documentation-1.2/Terminals"\r
+ _\r
+ @move"http://" "www.simantics.org/Documentation-1.1/Role" "www.semantum.fi/Simupedia-1.0/Role"\r
+ _\r
+ @move"http://" "www.simantics.org/Documentation-1.1/RelationTypeConstraint" "www.simantics.org/Documentation-1.2/RelationTypeConstraint"\r
+ _\r
+ @move"http://" "www.simantics.org/Documentation-1.1/Component" "www.semantum.fi/Simupedia-1.0/Components/Component"\r
+ _\r
+ @move"http://" "www.simantics.org/Documentation-1.1/DocumentComponent" "www.simantics.org/Documentation-1.2/DocumentComponent"\r
+ _\r
+ @move"http://" "www.simantics.org/Documentation-1.1/roleList" "www.semantum.fi/Simupedia-1.0/roleList"\r
+ _\r
+ @move"http://" "www.simantics.org/Documentation-1.1/CommandConnectionType" "www.simantics.org/Documentation-1.2/CommandConnectionType"\r
+ _\r
+ @move"http://" "www.simantics.org/Documentation-1.1/DataDefinitionConnectionType" "www.simantics.org/Documentation-1.2/DataDefinitionConnectionType"\r
+ _\r
+ @move"http://" "www.simantics.org/Documentation-1.1/DataConnectionType" "www.simantics.org/Documentation-1.2/DataConnectionType"\r
+ _\r
+ @move"http://" "www.simantics.org/Documentation-1.1/Functions" "www.semantum.fi/Simupedia-1.0/Functions"\r
+ _\r
+ @move"http://" "www.simantics.org/Documentation-1.1/DocumentDiagram" "www.simantics.org/Documentation-1.2/DocumentDiagram"\r
+ _\r
+ @move"http://" "www.simantics.org/Documentation-1.1/ConnectionType" "www.simantics.org/Documentation-1.2/ConnectionType"\r
+ _\r
+ @move"http://" "www.simantics.org/Documentation-1.1/Document/IsConnectedToChild" "www.simantics.org/Documentation-1.2/Document/IsConnectedToChild"\r
+ _\r
+ @move"http://" "www.simantics.org/Documentation-1.1/Document" "www.semantum.fi/Simupedia-1.0/Document"\r
+ _\r
+ @move"http://" "www.simantics.org/Documentation-1.1" "www.simantics.org/Documentation-1.2"\r
+ _\r
+ @move"http://" "www.simantics.org/DocumentWorkbench-1.0" "www.semantum.fi/SimupediaWorkbench-1.0"\r
+ \r
+ \r
+ \r
_\r
@move"http://www.simantics.org/Document-" "1.1" "1.2"\r
_\r
_ : L0.Value
L0.domainProperties FUNCTIONS.valuePropertyProperties : L0.ExternalValue
L0.valueAccessor FUNCTIONS.valuePropertyValue : L0.ExternalValue
+
+ >-- SYSDYN.Variable.equation <R L0.HasProperty : L0.FunctionalRelation
+ L0.valueAccessor FUNCTIONS.equationPropertyValue : L0.ExternalValue
+ @L0.assert SYSDYN.Variable.equation
+ _ : L0.Value
+
FUNCTIONS.runChildren : L0.ExternalValue
MOD.DiagramConnectionTypeToConnectionType
SYSDYN.Dependency
@L0.assert G2D.HasFont SYSDYN.DefaultFont
- @L0.assert G2D.HasColor
- [0.0,0.0,1.0,1.0] : G2D.Color
// TODO: Browser URIs
public final Resource FlowConnection_width_Inverse;\r
public final Resource FunctionTree;\r
public final Resource Functions;\r
+ public final Resource Functions_equationPropertyValue;\r
public final Resource Functions_runChildren;\r
public final Resource Functions_runProperties;\r
public final Resource Functions_valuePropertyProperties;\r
public final Resource Loop_Items_Inverse;\r
public final Resource Migration;\r
public final Resource Migration_from1$6to1$7;\r
+ public final Resource Migration_from1$6to1$7_Custom;\r
public final Resource Migration_from1$6to1$7_Ontologies;\r
public final Resource Migration_from1$6to1$7_OrderedSetsToLists;\r
public final Resource Migration_from1$6to1$7_Spreadsheets;\r
public final Resource Variable_arrayIndexesList;\r
public final Resource Variable_arrayIndexesList_Inverse;\r
public final Resource Variable_arrayIndexes_Inverse;\r
+ public final Resource Variable_equation;\r
+ public final Resource Variable_equation_Inverse;\r
public final Resource Variable_expressionList;\r
public final Resource Variable_expressionList_Inverse;\r
public final Resource Variable_expressions;\r
public static final String FlowConnection_width_Inverse = "http://www.simantics.org/Sysdyn-1.1/FlowConnection/width/Inverse";\r
public static final String FunctionTree = "http://www.simantics.org/Sysdyn-1.1/FunctionTree";\r
public static final String Functions = "http://www.simantics.org/Sysdyn-1.1/Functions";\r
+ public static final String Functions_equationPropertyValue = "http://www.simantics.org/Sysdyn-1.1/Functions/equationPropertyValue";\r
public static final String Functions_runChildren = "http://www.simantics.org/Sysdyn-1.1/Functions/runChildren";\r
public static final String Functions_runProperties = "http://www.simantics.org/Sysdyn-1.1/Functions/runProperties";\r
public static final String Functions_valuePropertyProperties = "http://www.simantics.org/Sysdyn-1.1/Functions/valuePropertyProperties";\r
public static final String Loop_Items_Inverse = "http://www.simantics.org/Sysdyn-1.1/Loop/Items/Inverse";\r
public static final String Migration = "http://www.simantics.org/Sysdyn-1.1/Migration";\r
public static final String Migration_from1$6to1$7 = "http://www.simantics.org/Sysdyn-1.1/Migration/from1.6to1.7";\r
+ public static final String Migration_from1$6to1$7_Custom = "http://www.simantics.org/Sysdyn-1.1/Migration/from1.6to1.7/Custom";\r
public static final String Migration_from1$6to1$7_Ontologies = "http://www.simantics.org/Sysdyn-1.1/Migration/from1.6to1.7/Ontologies";\r
public static final String Migration_from1$6to1$7_OrderedSetsToLists = "http://www.simantics.org/Sysdyn-1.1/Migration/from1.6to1.7/OrderedSetsToLists";\r
public static final String Migration_from1$6to1$7_Spreadsheets = "http://www.simantics.org/Sysdyn-1.1/Migration/from1.6to1.7/Spreadsheets";\r
public static final String Variable_arrayIndexesList = "http://www.simantics.org/Sysdyn-1.1/Variable/arrayIndexesList";\r
public static final String Variable_arrayIndexesList_Inverse = "http://www.simantics.org/Sysdyn-1.1/Variable/arrayIndexesList/Inverse";\r
public static final String Variable_arrayIndexes_Inverse = "http://www.simantics.org/Sysdyn-1.1/Variable/arrayIndexes/Inverse";\r
+ public static final String Variable_equation = "http://www.simantics.org/Sysdyn-1.1/Variable/equation";\r
+ public static final String Variable_equation_Inverse = "http://www.simantics.org/Sysdyn-1.1/Variable/equation/Inverse";\r
public static final String Variable_expressionList = "http://www.simantics.org/Sysdyn-1.1/Variable/expressionList";\r
public static final String Variable_expressionList_Inverse = "http://www.simantics.org/Sysdyn-1.1/Variable/expressionList/Inverse";\r
public static final String Variable_expressions = "http://www.simantics.org/Sysdyn-1.1/Variable/expressions";\r
FlowConnection_width_Inverse = getResourceOrNull(graph, URIs.FlowConnection_width_Inverse);\r
FunctionTree = getResourceOrNull(graph, URIs.FunctionTree);\r
Functions = getResourceOrNull(graph, URIs.Functions);\r
+ Functions_equationPropertyValue = getResourceOrNull(graph, URIs.Functions_equationPropertyValue);\r
Functions_runChildren = getResourceOrNull(graph, URIs.Functions_runChildren);\r
Functions_runProperties = getResourceOrNull(graph, URIs.Functions_runProperties);\r
Functions_valuePropertyProperties = getResourceOrNull(graph, URIs.Functions_valuePropertyProperties);\r
Loop_Items_Inverse = getResourceOrNull(graph, URIs.Loop_Items_Inverse);\r
Migration = getResourceOrNull(graph, URIs.Migration);\r
Migration_from1$6to1$7 = getResourceOrNull(graph, URIs.Migration_from1$6to1$7);\r
+ Migration_from1$6to1$7_Custom = getResourceOrNull(graph, URIs.Migration_from1$6to1$7_Custom);\r
Migration_from1$6to1$7_Ontologies = getResourceOrNull(graph, URIs.Migration_from1$6to1$7_Ontologies);\r
Migration_from1$6to1$7_OrderedSetsToLists = getResourceOrNull(graph, URIs.Migration_from1$6to1$7_OrderedSetsToLists);\r
Migration_from1$6to1$7_Spreadsheets = getResourceOrNull(graph, URIs.Migration_from1$6to1$7_Spreadsheets);\r
Variable_arrayIndexesList = getResourceOrNull(graph, URIs.Variable_arrayIndexesList);\r
Variable_arrayIndexesList_Inverse = getResourceOrNull(graph, URIs.Variable_arrayIndexesList_Inverse);\r
Variable_arrayIndexes_Inverse = getResourceOrNull(graph, URIs.Variable_arrayIndexes_Inverse);\r
+ Variable_equation = getResourceOrNull(graph, URIs.Variable_equation);\r
+ Variable_equation_Inverse = getResourceOrNull(graph, URIs.Variable_equation_Inverse);\r
Variable_expressionList = getResourceOrNull(graph, URIs.Variable_expressionList);\r
Variable_expressionList_Inverse = getResourceOrNull(graph, URIs.Variable_expressionList_Inverse);\r
Variable_expressions = getResourceOrNull(graph, URIs.Variable_expressions);\r
</equals>\r
</iterate>\r
<and>\r
- <not>\r
- <count\r
- value="0">\r
- </count>\r
- </not>\r
+ <count\r
+ value="0">\r
+ </count>\r
</and>\r
</with>\r
</visibleWhen>\r
<command\r
commandId="org.simantics.sysdyn.ui.newModuleNode"\r
id="org.simantics.sysdyn.ui.browser.newModule"\r
- label="Module"\r
+ label="Module type"\r
style="push">\r
<visibleWhen\r
checkEnabled="true">\r
</visibleWhen>\r
</command>\r
<command\r
- commandId="org.simantics.sysdyn.ui.newBarChart"\r
- icon="platform:/plugin/com.famfamfam.silk/icons/chart_bar.png"\r
- id="org.simantics.sysdyn.ui.browser.newBarChart"\r
- label="Bar Chart"\r
+ commandId="org.simantics.sysdyn.ui.newSensitivityChart"\r
+ icon="platform:/plugin/com.famfamfam.silk/icons/rainbow.png"\r
+ id="org.simantics.sysdyn.ui.browser.newSensitivityChart"\r
+ label="Sensitivity Chart"\r
style="push">\r
<visibleWhen\r
checkEnabled="true">\r
</visibleWhen>\r
</command>\r
<command\r
- commandId="org.simantics.sysdyn.ui.newPieChart"\r
- icon="platform:/plugin/com.famfamfam.silk/icons/chart_pie.png"\r
- id="org.simantics.sysdyn.ui.browser.newPieChart"\r
- label="Pie Chart"\r
+ commandId="org.simantics.sysdyn.ui.newBarChart"\r
+ icon="platform:/plugin/com.famfamfam.silk/icons/chart_bar.png"\r
+ id="org.simantics.sysdyn.ui.browser.newBarChart"\r
+ label="Bar Chart"\r
style="push">\r
<visibleWhen\r
checkEnabled="true">\r
</visibleWhen>\r
</command>\r
<command\r
- commandId="org.simantics.sysdyn.ui.newSensitivityChart"\r
- icon="platform:/plugin/com.famfamfam.silk/icons/rainbow.png"\r
- id="org.simantics.sysdyn.ui.browser.newSensitivityChart"\r
- label="Sensitivity Chart"\r
+ commandId="org.simantics.sysdyn.ui.newPieChart"\r
+ icon="platform:/plugin/com.famfamfam.silk/icons/chart_pie.png"\r
+ id="org.simantics.sysdyn.ui.browser.newPieChart"\r
+ label="Pie Chart"\r
style="push">\r
<visibleWhen\r
checkEnabled="true">\r
type="radio"\r
value="flow">\r
</command>\r
+ <!--<command\r
+ commandId="org.simantics.sysdyn.ui.diagramTool"\r
+ image="platform:/plugin/com.famfamfam.silk/icons/textfield_add.png"\r
+ name="Create Auxiliary (Shift+A)"\r
+ toolbarId="org.simantics.sysdyn.ui.diagramToolbar"\r
+ type="radio"\r
+ value="auxiliary">\r
+ </command>-->\r
</extension>\r
<extension\r
point="org.simantics.project.feature">\r
result.add(new ModulesNode(model.data));\r
result.add(new FunctionsFolder(model.data));\r
result.add(new ChartsFolder(model.data));\r
-// result.add(new SCLModulesFolder(model.data));\r
+ result.add(new SCLModulesFolder(model.data));\r
return result;\r
}\r
\r
Alignment alignment = Alignment.CENTER;\r
\r
name.setTransform(at2);\r
- if(alignment != null)\r
+ if(alignment != null) {\r
name.setHorizontalAlignment((byte) alignment.ordinal());\r
+ name.setVerticalAlignment((byte) alignment.ordinal());\r
+ }\r
}\r
}\r
}\r
\r
private static double getYCoordShift(IElement e) {\r
//String location = e.getHint(SysdynElementHints.KEY_LOCATION);\r
- return 10.7;\r
+ return 9.7;\r
}\r
\r
@Override\r
import org.simantics.db.WriteGraph;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.db.management.ISessionContext;\r
-import org.simantics.jfreechart.chart.properties.LabelPropertyTabContributor;\r
+import org.simantics.jfreechart.chart.properties.AdjustableTab;\r
import org.simantics.sysdyn.SysdynResource;\r
import org.simantics.sysdyn.ui.elements.connections.DependencyEdgeClass;\r
import org.simantics.sysdyn.ui.elements.connections.DependencyNode;\r
* @author Tuomas Miettinen\r
*\r
*/\r
-public class ArrayDependencyTab extends LabelPropertyTabContributor {\r
+public class ArrayDependencyTab extends AdjustableTab {\r
\r
Button none, plus, minus, other, inside, outside;\r
TrackedText polarityText, polarityLocationText;\r
private DelayMarkWidget delayMark;\r
private ArrowHeadWidget arrowhead;\r
private Scale lineThicknessScale;\r
- \r
- @Override\r
- public void createControls(Composite body, IWorkbenchSite site, ISessionContext context, WidgetSupport support) {\r
- Composite composite = new Composite(body, SWT.NONE);\r
- GridDataFactory.fillDefaults().grab(true, true).applyTo(composite);\r
- GridLayoutFactory.fillDefaults().margins(3, 3).numColumns(2).applyTo(composite);\r
- \r
- /* Add a dummy button at the begin to suck in the nonsense selection events that\r
- * the first radio button in the group of ALL the radio buttons receives when no\r
- * radio is selected and then one is selected in other group than where the first \r
- * radio button lies. \r
- */\r
- Group hiddenDefaultbuttonGroup = new Group(composite, SWT.NONE);\r
- GridDataFactory.fillDefaults().exclude(true).applyTo(hiddenDefaultbuttonGroup);\r
- GridLayoutFactory.fillDefaults().applyTo(hiddenDefaultbuttonGroup);\r
- new Button(hiddenDefaultbuttonGroup, support, SWT.RADIO);\r
- \r
- Group polarityGroup = new Group(composite, SWT.NONE);\r
- polarityGroup.setText("Polarity");\r
- GridDataFactory.fillDefaults().grab(true, false).applyTo(polarityGroup);\r
- GridLayoutFactory.fillDefaults().numColumns(5).applyTo(polarityGroup);\r
- \r
- none = new Button(polarityGroup, support, SWT.RADIO);\r
- none.setText("None");\r
- none.setSelectionFactory(new PolarityRadioSelectionFactory(""));\r
- none.addSelectionListener(new PolaritySelectionListener(context, ""));\r
- \r
- plus = new Button(polarityGroup, support, SWT.RADIO);\r
- plus.setText("+");\r
- plus.setSelectionFactory(new PolarityRadioSelectionFactory("+"));\r
- plus.addSelectionListener(new PolaritySelectionListener(context, "+"));\r
- \r
- minus = new Button(polarityGroup, support, SWT.RADIO);\r
- minus.setText("-");\r
- minus.setSelectionFactory(new PolarityRadioSelectionFactory("-"));\r
- minus.addSelectionListener(new PolaritySelectionListener(context, "-"));\r
- \r
- other = new Button(polarityGroup, support, SWT.RADIO);\r
- other.setText("other");\r
- other.setSelectionFactory(new OtherPolaritySelectionFactory(new String[] {null, "+", "-", ""}));\r
- \r
- polarityText = new TrackedText(polarityGroup, support, SWT.BORDER);\r
- polarityText.setTextFactory(new OtherPolarityStringPropertyFactory());\r
- polarityText.addModifyListener(new OtherPolarityStringPropertyModifier());\r
- GridDataFactory.fillDefaults().grab(true, false).applyTo(polarityText.getWidget());\r
- \r
- Group locationGroup = new Group(composite, SWT.NONE);\r
- GridDataFactory.fillDefaults().applyTo(locationGroup);\r
- GridLayoutFactory.fillDefaults().applyTo(locationGroup);\r
- locationGroup.setText("Location");\r
- \r
- inside = new Button(locationGroup, support, SWT.RADIO);\r
- inside.setText("Inside");\r
- inside.setSelectionFactory(new PolarityLocationRadioSelectionFactory(DependencyNode.INSIDE));\r
- inside.addSelectionListener(new PolarityLocationSelectionListener(context, DependencyNode.INSIDE));\r
- \r
- outside = new Button(locationGroup, support, SWT.RADIO);\r
- outside.setText("Outside");\r
- outside.setSelectionFactory(new PolarityLocationRadioSelectionFactory(DependencyNode.OUTSIDE));\r
- outside.addSelectionListener(new PolarityLocationSelectionListener(context, DependencyNode.OUTSIDE));\r
-\r
- Composite misc = new Composite(composite, SWT.NONE);\r
- GridDataFactory.fillDefaults().grab(true, true).applyTo(misc);\r
- GridLayoutFactory.fillDefaults().numColumns(3).applyTo(misc);\r
- \r
- arrowhead = new ArrowHeadWidget(misc, support, SWT.NULL);\r
- GridDataFactory.fillDefaults().applyTo(arrowhead.getWidget());\r
- delayMark = new DelayMarkWidget(misc, support, SWT.NULL);\r
- GridDataFactory.fillDefaults().applyTo(delayMark.getWidget());\r
- \r
- Group lineThicknessGroup = new Group(misc, SWT.NONE);\r
- GridDataFactory.fillDefaults().applyTo(lineThicknessGroup);\r
- GridLayoutFactory.fillDefaults().applyTo(lineThicknessGroup);\r
- lineThicknessGroup.setText("Line thickness:");\r
- lineThicknessScale = new Scale(lineThicknessGroup, support, SWT.HORIZONTAL);\r
- lineThicknessScale.getWidget().setMinimum(1);\r
- lineThicknessScale.getWidget().setMaximum(15);\r
- lineThicknessScale.getWidget().setPageIncrement(1);\r
- lineThicknessScale.getWidget().setIncrement(1);\r
- lineThicknessScale.setSelectionFactory(new LineThicknessRadioSelectionFactory());\r
- lineThicknessScale.addSelectionListener(new LineThicknessSelectionListener(context, lineThicknessScale));\r
- }\r
+ private Group hiddenDefaultbuttonGroup;\r
+ private Group polarityGroup;\r
+ private Group locationGroup;\r
+ private Composite misc;\r
+ private Group lineThicknessGroup;\r
\r
class LineThicknessSelectionListener extends SelectionListenerImpl<ArrayList<Resource>> {\r
Scale scale;\r
}\r
}\r
\r
+ @Override\r
+ protected void createAndAddControls(Composite body, IWorkbenchSite site,\r
+ ISessionContext context, WidgetSupport support) {\r
+ composite = new Composite(body, SWT.NONE);\r
+ \r
+ /* Add a dummy button at the begin to suck in the nonsense selection events that\r
+ * the first radio button in the group of ALL the radio buttons receives when no\r
+ * radio is selected and then one is selected in other group than where the first \r
+ * radio button lies. \r
+ */\r
+ hiddenDefaultbuttonGroup = new Group(composite, SWT.NONE);\r
+ new Button(hiddenDefaultbuttonGroup, support, SWT.RADIO);\r
+ \r
+ polarityGroup = new Group(composite, SWT.NONE);\r
+ polarityGroup.setText("Polarity");\r
+ \r
+ none = new Button(polarityGroup, support, SWT.RADIO);\r
+ none.setText("None");\r
+ none.setSelectionFactory(new PolarityRadioSelectionFactory(""));\r
+ none.addSelectionListener(new PolaritySelectionListener(context, ""));\r
+ \r
+ plus = new Button(polarityGroup, support, SWT.RADIO);\r
+ plus.setText("+");\r
+ plus.setSelectionFactory(new PolarityRadioSelectionFactory("+"));\r
+ plus.addSelectionListener(new PolaritySelectionListener(context, "+"));\r
+ \r
+ minus = new Button(polarityGroup, support, SWT.RADIO);\r
+ minus.setText("-");\r
+ minus.setSelectionFactory(new PolarityRadioSelectionFactory("-"));\r
+ minus.addSelectionListener(new PolaritySelectionListener(context, "-"));\r
+ \r
+ other = new Button(polarityGroup, support, SWT.RADIO);\r
+ other.setText("other");\r
+ other.setSelectionFactory(new OtherPolaritySelectionFactory(new String[] {null, "+", "-", ""}));\r
+ \r
+ polarityText = new TrackedText(polarityGroup, support, SWT.BORDER);\r
+ polarityText.setTextFactory(new OtherPolarityStringPropertyFactory());\r
+ polarityText.addModifyListener(new OtherPolarityStringPropertyModifier());\r
+ \r
+ locationGroup = new Group(composite, SWT.NONE);\r
+ locationGroup.setText("Location");\r
+ \r
+ inside = new Button(locationGroup, support, SWT.RADIO);\r
+ inside.setText("Inside");\r
+ inside.setSelectionFactory(new PolarityLocationRadioSelectionFactory(DependencyNode.INSIDE));\r
+ inside.addSelectionListener(new PolarityLocationSelectionListener(context, DependencyNode.INSIDE));\r
+ \r
+ outside = new Button(locationGroup, support, SWT.RADIO);\r
+ outside.setText("Outside");\r
+ outside.setSelectionFactory(new PolarityLocationRadioSelectionFactory(DependencyNode.OUTSIDE));\r
+ outside.addSelectionListener(new PolarityLocationSelectionListener(context, DependencyNode.OUTSIDE));\r
+\r
+ misc = new Composite(composite, SWT.NONE);\r
+ \r
+ arrowhead = new ArrowHeadWidget(misc, support, SWT.NULL);\r
+ delayMark = new DelayMarkWidget(misc, support, SWT.NULL);\r
+ \r
+ lineThicknessGroup = new Group(misc, SWT.NONE);\r
+ lineThicknessGroup.setText("Line thickness:");\r
+ lineThicknessScale = new Scale(lineThicknessGroup, support, SWT.HORIZONTAL);\r
+ lineThicknessScale.getWidget().setMinimum(1);\r
+ lineThicknessScale.getWidget().setMaximum(15);\r
+ lineThicknessScale.getWidget().setPageIncrement(1);\r
+ lineThicknessScale.getWidget().setIncrement(1);\r
+ lineThicknessScale.setSelectionFactory(new LineThicknessRadioSelectionFactory());\r
+ lineThicknessScale.addSelectionListener(new LineThicknessSelectionListener(context, lineThicknessScale));\r
+ }\r
+\r
+ @Override\r
+ protected void createControlLayoutVertical() {\r
+ GridDataFactory.fillDefaults().grab(true, true).applyTo(composite);\r
+ GridLayoutFactory.fillDefaults().margins(3, 3).numColumns(1).applyTo(composite);\r
+ \r
+ GridDataFactory.fillDefaults().exclude(true).applyTo(hiddenDefaultbuttonGroup);\r
+ GridLayoutFactory.fillDefaults().applyTo(hiddenDefaultbuttonGroup);\r
+ \r
+ GridDataFactory.fillDefaults().grab(true, false).applyTo(polarityGroup);\r
+ GridLayoutFactory.fillDefaults().numColumns(5).applyTo(polarityGroup);\r
+ \r
+ GridDataFactory.fillDefaults().grab(true, false).applyTo(polarityText.getWidget());\r
+ \r
+ GridDataFactory.fillDefaults().applyTo(locationGroup);\r
+ GridLayoutFactory.fillDefaults().applyTo(locationGroup);\r
+ \r
+ GridDataFactory.fillDefaults().grab(true, true).applyTo(misc);\r
+ GridLayoutFactory.fillDefaults().numColumns(2).applyTo(misc);\r
+\r
+ GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.BEGINNING).applyTo(arrowhead.getWidget());\r
+ GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.BEGINNING).applyTo(delayMark.getWidget());\r
+ \r
+ GridDataFactory.fillDefaults().span(2, 1).applyTo(lineThicknessGroup);\r
+ GridLayoutFactory.fillDefaults().applyTo(lineThicknessGroup);\r
+ }\r
+\r
+ @Override\r
+ protected void createControlLayoutHorizontal(boolean wideScreen) {\r
+ GridDataFactory.fillDefaults().grab(true, true).applyTo(composite);\r
+ GridLayoutFactory.fillDefaults().margins(3, 3).numColumns(2).applyTo(composite);\r
+ \r
+ GridDataFactory.fillDefaults().exclude(true).applyTo(hiddenDefaultbuttonGroup);\r
+ GridLayoutFactory.fillDefaults().applyTo(hiddenDefaultbuttonGroup);\r
+ \r
+ GridDataFactory.fillDefaults().grab(true, false).applyTo(polarityGroup);\r
+ GridLayoutFactory.fillDefaults().numColumns(5).applyTo(polarityGroup);\r
+ \r
+ GridDataFactory.fillDefaults().grab(true, false).applyTo(polarityText.getWidget());\r
+ \r
+ GridDataFactory.fillDefaults().applyTo(locationGroup);\r
+ GridLayoutFactory.fillDefaults().applyTo(locationGroup);\r
+ \r
+ GridDataFactory.fillDefaults().grab(true, true).applyTo(misc);\r
+ GridLayoutFactory.fillDefaults().numColumns(3).applyTo(misc);\r
+\r
+ GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.BEGINNING).applyTo(arrowhead.getWidget());\r
+ GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.BEGINNING).applyTo(delayMark.getWidget());\r
+ \r
+ GridDataFactory.fillDefaults().span(1, 1).applyTo(lineThicknessGroup);\r
+ GridLayoutFactory.fillDefaults().applyTo(lineThicknessGroup);\r
+ }\r
+\r
}\r
import org.simantics.db.management.ISessionContext;\r
import org.simantics.diagram.stubs.DiagramResource;\r
import org.simantics.jfreechart.chart.properties.LabelPropertyTabContributor;\r
-import org.simantics.utils.datastructures.Callback;\r
\r
/**\r
* Tab for editing diagram comments\r
*/\r
public class CommentTab extends LabelPropertyTabContributor {\r
\r
- @Override\r
- public void updatePartName(ISelection forSelection, final Callback<String> updateCallback) {\r
- updateCallback.run("Comment");\r
- }\r
+ @Override\r
+ public String getPartName(ISelection forSelection) {\r
+ return "Comment";\r
+ }\r
\r
@Override\r
public void createControls(Composite body, IWorkbenchSite site, ISessionContext context, WidgetSupport support) {\r
public class ConfigurationTab extends AdjustableTab {\r
\r
private ScrolledComposite sc;\r
- private Composite composite;\r
private Label nameLabel, startTimeLabel, stopTimeLabel, stepLengthLabel, \r
outputIntervalLabel, methodLabel, toleranceLabel, variableFilterLabel;\r
private TrackedText name, startTime, stopTime, stepLength, outputInterval, tolerance, variableFilter;\r
"To include variables Auxiliary1, Auxiliary2 and Auxiliary3: \n" +\r
"Auxiliary[1-3]\n" +\r
"or\n" +\r
- "Auxiliary1|Auxiliary2|Auxiliary3");\r
+ "Auxiliary1|Auxiliary2|Auxiliary3\n" +\r
+ "NOTE: whitespace must be replaced with an underscore ('_') character" +\r
+ "e.g. 'Growth Rate' -> 'Growth_Rate'");\r
\r
variableFilter = new TrackedText(composite, support, SWT.BORDER);\r
variableFilter.setTextFactory(new StringPropertyFactory(SysdynResource.URIs.SysdynModel_variableFilter, ""));\r
"To include variables Auxiliary1, Auxiliary2 and Auxiliary3: \n" +\r
"Auxiliary[1-3]\n" +\r
"or\n" +\r
- "Auxiliary1|Auxiliary2|Auxiliary3");\r
+ "Auxiliary1|Auxiliary2|Auxiliary3\n" +\r
+ "NOTE: whitespace must be replaced with an underscore ('_') character" +\r
+ "e.g. 'Growth Rate' -> 'Growth_Rate'");\r
\r
sc.setExpandHorizontal(true);\r
sc.setExpandVertical(true);\r
Scale lineThicknessScale;\r
private DelayMarkWidget delayMark;\r
private ArrowHeadWidget arrowhead;\r
- private Composite composite;\r
private Group polarityGroup;\r
private Group locationGroup;\r
private Composite misc;\r
private WidgetSupportImpl support;\r
private ExpressionComposite expressionComposite;\r
private final WidgetSupportImpl expressionSupport = new WidgetSupportImpl();\r
- private Composite composite;\r
private Composite nameComposite;\r
private Composite TypeAndUnit;\r
private Label typeLabel;\r
public class FunctionTab extends AdjustableTab {\r
\r
ExpressionField modelicaCode;\r
- private Composite composite;\r
private TrackedText nameText;\r
private Group modelicaGroup;\r
private Label startLabel;\r
private TrackedCombo loopItemsDropdown;\r
Button auto, balancing, reinforcing, other, inside, outside;\r
TrackedText loopComment, polarityLocationText;\r
- Composite composite, loopItems;\r
+ Composite loopItems;\r
Group commentGroup, rotationGroup;\r
protected Resource resource;\r
public static final String AUTO = "$$AUTO$$";\r
import org.simantics.db.layer0.variable.Variable;\r
import org.simantics.diagram.stubs.DiagramResource;\r
import org.simantics.jfreechart.ChartSelectionTabContributor;\r
+import org.simantics.jfreechart.chart.properties.ChartTab;\r
import org.simantics.jfreechart.chart.properties.xyline.XYLineGeneralPropertiesTab;\r
import org.simantics.layer0.Layer0;\r
import org.simantics.modeling.ModelingResources;\r
9,\r
r,\r
"Axis and Variables"));\r
+ tabs.add(new ComparableTabContributor(\r
+ new ChartTab(),\r
+ 1,\r
+ r,\r
+ "Chart"));\r
return true;\r
}\r
}\r
private boolean dirtyMethod = false;\r
\r
private DisposableListener<Collection<Resource>> contentListener;\r
- private RemoveFocusBeforeExperimentComposite composite;\r
private Composite labelComposite;\r
private Label labelName;\r
private Label labelNumber;\r
}\r
\r
private Read<Pair<Font, Color>> fontAndColorRead;\r
- private Composite composite;\r
private Group informationGroup;\r
private TrackedText information;\r
private Group rangeGroup;\r
import org.eclipse.jface.dialogs.Dialog;\r
import org.eclipse.jface.layout.GridDataFactory;\r
import org.eclipse.jface.layout.GridLayoutFactory;\r
+import org.eclipse.jface.preference.IPreferenceStore;\r
+import org.eclipse.jface.preference.PreferenceConverter;\r
import org.eclipse.jface.resource.FontDescriptor;\r
import org.eclipse.jface.resource.JFaceResources;\r
import org.eclipse.jface.resource.LocalResourceManager;\r
import org.eclipse.swt.widgets.Shell;\r
import org.eclipse.swt.widgets.Table;\r
import org.eclipse.swt.widgets.TableItem;\r
+import org.simantics.sysdyn.ui.Activator;\r
+import org.simantics.sysdyn.ui.preferences.SysdynDiagramPreferences;\r
import org.simantics.utils.ui.gfx.ColorImageDescriptor;\r
\r
/**\r
int code;\r
RGB color;\r
Display display = Display.getCurrent();\r
+ \r
+ //IWorkbenchPage iwp = SysdynWorkbenchUtils.getActivePageOfEditor();\r
+ //final ICanvasContext context = (ICanvasContext)iwp.getActiveEditor().getAdapter(ICanvasContext.class);\r
+ \r
+ IPreferenceStore store = Activator.getDefault().getPreferenceStore();\r
+ color = PreferenceConverter.getColor(store, SysdynDiagramPreferences.ARROW_COLOR);\r
+ image = resourceManager.createImage(new ColorImageDescriptor(color.red, color.green, color.blue, 25, 15, false));\r
+ \r
+ ti = new TableItem(table, SWT.NONE);\r
+ ti.setImage(0, image);\r
+ ti.setText(1, "Default Arrow");\r
+ ti.setForeground(display.getSystemColor(SWT.COLOR_BLACK));\r
+ ti.setData(color);\r
+ \r
for(String text : systemColors.keySet()) {\r
code = systemColors.get(text);\r
color = display.getSystemColor(code).getRGB();\r
private GraphExplorerComposite explorer;\r
private ScrolledComposite propertyContainer;\r
private WidgetSupportImpl additionalSupport;\r
- private Composite composite;\r
\r
public SensitivityChartAxisAndVariablesTab() {\r
additionalSupport = new WidgetSupportImpl();\r
protected void createAndAddControls(Composite body, IWorkbenchSite site,\r
final ISessionContext context, WidgetSupport support) {\r
composite = new Composite(body, SWT.NONE);\r
- GridDataFactory.fillDefaults().grab(true, true).applyTo(composite);\r
- GridLayoutFactory.fillDefaults().numColumns(2).margins(3, 3).applyTo(composite);\r
\r
// (Ontology-based) GraphExplorer displaying range axis and variables mapped to those axis\r
explorer = new AxisAndVariablesExplorerComposite(ArrayMap.keys(\r
updateSelection(context);\r
}\r
});\r
- GridDataFactory.fillDefaults().hint(250, SWT.DEFAULT).grab(false, true).applyTo(explorer);\r
\r
// Scrolled composite for displaying properties of a selection in explorer\r
propertyContainer = new ScrolledComposite(composite, SWT.H_SCROLL | SWT.V_SCROLL);\r
- GridDataFactory.fillDefaults().span(1, 2).grab(true, true).applyTo(propertyContainer);\r
- GridLayoutFactory.fillDefaults().applyTo(propertyContainer);\r
propertyContainer.setExpandHorizontal(true);\r
propertyContainer.setExpandVertical(true);\r
\r
+/*******************************************************************************\r
+ * Copyright (c) 2010, 2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
package org.simantics.sysdyn.ui.utils;\r
\r
import java.util.ArrayList;\r
result.put(elements.length > 0 ? elements.length - 1 : 0, error);\r
}\r
\r
-\r
for(int i = 0; i < elements.length && i < enumerations.size(); i++) {\r
- if(elements[i].trim().equals(":"))\r
- continue;\r
- if(elements[i].indexOf(":") != elements[i].lastIndexOf(":")) {\r
+ String trimmedElement = elements[i].trim();\r
+ if (trimmedElement.charAt(0) == '{' && trimmedElement.charAt(trimmedElement.length() - 1) == '}') {\r
+ // Something like "{a, b, c}"\r
+ String[] rangeComponents = trimmedElement.substring(1, trimmedElement.length() - 1).split(",");\r
+ // Single range component, equals to the enumeration at that index\r
+ if(rangeComponents.length == 1 && rangeComponents[0].trim().equals(enumerations.get(i).getName()))\r
+ continue;\r
+ // more than one range component, they all equal to individual indexes in the enumeration\r
+ result.putAll(areRangeComponentsValid(rangeComponents, enumerations, i));\r
+ } else if(trimmedElement.equals(":")) {\r
+ continue; // Just a ":"\r
+ } else if(elements[i].indexOf(":") != elements[i].lastIndexOf(":")) {\r
+ // Something like "a : b : c"\r
error = new SyntaxError();\r
error.setMessage( "Too many ':' elements");\r
error.setType(ExpressionField.SYNTAX_ERROR);\r
result.put(i, error);\r
continue;\r
+ } else {\r
+ // Something like "a : c" OR "a"\r
+ String[] rangeComponents = elements[i].split(":");\r
+ if(rangeComponents.length > 2){\r
+ error = new SyntaxError();\r
+ error.setMessage( "Too many ':' elements");\r
+ error.setType(ExpressionField.SYNTAX_ERROR);\r
+ result.put(i, error);\r
+ continue;\r
+ }\r
+ // Single range component, equals to the enumeration at that index\r
+ if(rangeComponents.length == 1 && rangeComponents[0].trim().equals(enumerations.get(i).getName()))\r
+ continue;\r
+ // one or two range components, they all equal to individual indexes in the enumeration\r
+ result.putAll(areRangeComponentsValid(rangeComponents, enumerations, i));\r
}\r
+ }\r
+ if(result.isEmpty())\r
+ return null;\r
+ else\r
+ return result;\r
+ }\r
\r
- String[] rangeComponents = elements[i].split(":");\r
- if(rangeComponents.length > 2){\r
- error = new SyntaxError();\r
- error.setMessage( "Too many ':' elements");\r
- error.setType(ExpressionField.SYNTAX_ERROR);\r
- result.put(i, error);\r
- continue;\r
+ private static Map<Integer, SyntaxError> areRangeComponentsValid(String[] rangeComponents, ArrayList<Enumeration> enumerations, int i) {\r
+ SyntaxError error;\r
+ Map<Integer, SyntaxError> result = new HashMap<Integer, SyntaxError>();\r
+ for(String r : rangeComponents) {\r
+ r = r.trim();\r
+ boolean componentIsValid = false;\r
+ Enumeration enumeration = enumerations.get(i);\r
+ for(EnumerationIndex ei : enumeration.getEnumerationIndexes()) {\r
+ if(ei.getName().equals(r)) {\r
+ componentIsValid = true;\r
+ break;\r
+ }\r
}\r
- // Single range component, equals to the enumeration at that index\r
- if(rangeComponents.length == 1 && rangeComponents[0].trim().equals(enumerations.get(i).getName()))\r
- continue;\r
- // one or two range components, they all equal to individual indexes in the enumeration\r
- for(String r : rangeComponents) {\r
- r = r.trim();\r
- boolean componentIsValid = false;\r
- Enumeration enumeration = enumerations.get(i);\r
- for(EnumerationIndex ei : enumeration.getEnumerationIndexes()) {\r
- if(ei.getName().equals(r)) {\r
+ if(!componentIsValid && r.length() > 0) {\r
+ // Check if the range is an integer that is between 0 and enumeration indexes size\r
+ try {\r
+ int index = Integer.parseInt(r);\r
+ int min = 1;\r
+ int max = enumeration.getEnumerationIndexes().size();\r
+ if(index >= min && index <= max || enumeration.isReplaceable()) {\r
componentIsValid = true;\r
- break;\r
- }\r
- }\r
- if(!componentIsValid && r.length() > 0) {\r
- // Check if the range is an integer that is between 0 and enumeration indexes size\r
- try {\r
- int index = Integer.parseInt(r);\r
- int min = 1;\r
- int max = enumeration.getEnumerationIndexes().size();\r
- if(index >= min && index <= max || enumeration.isReplaceable()) {\r
- componentIsValid = true;\r
- error = new SyntaxError();\r
- error.setMessage("Using numbers as array indexes is not encouraged");\r
- error.setType(ExpressionField.SYNTAX_WARNING);\r
- result.put(i, error);\r
- } else {\r
- error = new SyntaxError();\r
- error.setMessage("Invalid array index " + index + ". Numbered index must be between " + min + " and " + max);\r
- error.setType(ExpressionField.SYNTAX_ERROR);\r
- result.put(i, error);\r
- }\r
- } catch (NumberFormatException e) {\r
error = new SyntaxError();\r
- error.setMessage("Invalid range");\r
+ error.setMessage("Using numbers as array indexes is not encouraged");\r
+ error.setType(ExpressionField.SYNTAX_WARNING);\r
+ result.put(i, error);\r
+ } else {\r
+ error = new SyntaxError();\r
+ error.setMessage("Invalid array index " + index + ". Numbered index must be between " + min + " and " + max);\r
error.setType(ExpressionField.SYNTAX_ERROR);\r
result.put(i, error);\r
}\r
+ } catch (NumberFormatException e) {\r
+ error = new SyntaxError();\r
+ error.setMessage("Invalid range");\r
+ error.setType(ExpressionField.SYNTAX_ERROR);\r
+ result.put(i, error);\r
}\r
}\r
}\r
- if(result.isEmpty())\r
- return null;\r
- else\r
- return result;\r
- }\r
+ return result;\r
+ }\r
\r
- /**\r
+ /**\r
* Checks if the given range can be applied to the given variable.\r
* \r
* @param graph ReadGraph\r
if(variable == null)\r
return true;\r
String[] elements = range.split(",");\r
+ // Connect arrays, e.g. {a,b,c}\r
+ ArrayList<String> connectedElements = new ArrayList<String>();\r
+ for (int i = 0; i < elements.length; ++i) {\r
+ String lastElement = elements[i];\r
+ String fullElement = new String();\r
+ if (lastElement.length() > 0 && lastElement.charAt(0) == '{') {\r
+ while (lastElement.charAt(lastElement.length() - 1) != '}' && i < elements.length - 1) {\r
+ fullElement += lastElement + ",";\r
+ ++i;\r
+ lastElement = elements[i];\r
+ }\r
+ }\r
+ fullElement += lastElement;\r
+ connectedElements.add(fullElement);\r
+ }\r
+ String fullElements[] = connectedElements.toArray(new String[connectedElements.size()]);\r
+ \r
SysdynModel model = ModelUtils.getModel(graph, variable);\r
if(model == null)\r
return false;\r
IElement e = model.getElement(variable);\r
if(e != null && e instanceof Variable) {\r
Variable v = (Variable) e;\r
- if(isRangeValid(graph, v, elements) == null)\r
+ if(isRangeValid(graph, v, fullElements) == null)\r
return true;\r
else\r
return false;\r
adapterClass="org.simantics.sysdyn.adapter.RunVariableAdapter"/>\r
</target>\r
-->\r
+\r
+ <target\r
+ interface="org.simantics.db.layer0.migration.MigrationStep">\r
+ <resource\r
+ uri="http://www.simantics.org/Sysdyn-0.0/Migration/from1.6to1.7/Custom"\r
+ class="org.simantics.sysdyn.adapter.CustomMigrationStep">\r
+ </resource>\r
+ </target>\r
\r
</adapters>
\ No newline at end of file
isParameter :: Variable -> <ReadGraph> Boolean\r
\r
lastValue :: Resource -> String -> String -> Double\r
+ lastValue2 :: Variable -> String -> <ReadGraph> Variable\r
+ equation :: Variable -> String -> <ReadGraph> Variable\r
\r
importJava "org.simantics.sysdyn.manager.SysdynExperiments" where\r
\r
package org.simantics.sysdyn;\r
\r
+import java.util.Collection;\r
import java.util.HashMap;\r
import java.util.Map;\r
\r
+import org.simantics.databoard.Bindings;\r
import org.simantics.databoard.binding.Binding;\r
+import org.simantics.databoard.binding.mutable.Variant;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
import org.simantics.db.WriteGraph;\r
import org.simantics.db.common.request.ResourceRead;\r
import org.simantics.db.common.uri.UnescapedChildMapOfResource;\r
+import org.simantics.db.common.utils.ListUtils;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.db.layer0.function.All;\r
import org.simantics.db.layer0.variable.StandardGraphChildVariable;\r
import org.simantics.sysdyn.adapter.TimeIndexVariable;\r
import org.simantics.sysdyn.adapter.TimesIndexVariable;\r
import org.simantics.sysdyn.adapter.ValueIndexVariable;\r
+import org.simantics.sysdyn.adapter.ValueIndexVariableI;\r
import org.simantics.sysdyn.adapter.ValuesIndexVariable;\r
\r
public class Functions {\r
}\r
\r
};\r
+\r
+ @SCLValue(type = "ValueAccessor")\r
+ public static ValueAccessor equationPropertyValue = new ValueAccessor() {\r
+\r
+ @Override\r
+ public Object getValue(ReadGraph graph, Variable context) throws DatabaseException {\r
+ return getValue(graph, context, Bindings.STRING);\r
+ }\r
+\r
+ @Override\r
+ public Object getValue(ReadGraph graph, Variable context, Binding binding) throws DatabaseException {\r
+ \r
+ Variable v = context.getParent(graph);\r
+ \r
+ Resource represents = v.getPossibleRepresents(graph);\r
+ if(represents != null) {\r
+ SysdynResource SYSDYN = SysdynResource.getInstance(graph);\r
+ Collection<Resource> res = ListUtils.toList(graph, graph.getSingleObject(represents, SYSDYN.Variable_expressionList));\r
+ if(res.size() == 1) {\r
+ Resource exp = res.iterator().next();\r
+ String text = graph.getRelatedValue(exp, SYSDYN.Expression_equation, Bindings.STRING);\r
+ return text;\r
+ }\r
+ }\r
+\r
+ return null;\r
+ \r
+ }\r
+\r
+ @Override\r
+ public void setValue(WriteGraph graph, Variable context, Object value) throws DatabaseException {\r
+ \r
+ if(value instanceof Variant) value = ((Variant)value).getValue();\r
+ \r
+ if(!(value instanceof String)) throw new DatabaseException("Unexpected value " + value + ", expected String");\r
+ \r
+ setValue(graph, context, value, Bindings.STRING);\r
+ \r
+ }\r
+\r
+ @Override\r
+ public void setValue(WriteGraph graph, Variable context, Object value, Binding binding) throws DatabaseException {\r
+ \r
+ if(value instanceof Variant) value = ((Variant)value).getValue();\r
+ \r
+ if(!(value instanceof String)) throw new DatabaseException("Unexpected value " + value + ", expected String");\r
+\r
+ Variable v = context.getParent(graph);\r
+ \r
+ Resource represents = v.getPossibleRepresents(graph);\r
+ if(represents != null) {\r
+ SysdynResource SYSDYN = SysdynResource.getInstance(graph);\r
+ Collection<Resource> res = ListUtils.toList(graph, graph.getSingleObject(represents, SYSDYN.Variable_expressionList));\r
+ if(res.size() == 1) {\r
+ Resource exp = res.iterator().next();\r
+ graph.claimLiteral(exp, SYSDYN.Expression_equation, value, Bindings.STRING);\r
+ }\r
+ }\r
+ \r
+ }\r
+ \r
+ };\r
\r
\r
@SCLValue(type = "VariableMap")\r
\r
String property = context.getName(graph);\r
if(VALUE.equals(property))\r
- return new ValueIndexVariable(graph, context, name);\r
+ if(name.startsWith("$")) {\r
+ Integer index = Integer.parseInt(name.substring(1));\r
+ return new ValueIndexVariableI(graph, context, index);\r
+ } else {\r
+ return new ValueIndexVariable(graph, context, name);\r
+ }\r
else if(VALUES.equals(property))\r
return new ValuesIndexVariable(graph, context, name);\r
else if(TIMES.equals(property))\r
--- /dev/null
+package org.simantics.sysdyn.adapter;\r
+\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.Session;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.request.ObjectsWithType;\r
+import org.simantics.db.common.request.WriteRequest;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.migration.MigrationState;\r
+import org.simantics.db.layer0.migration.MigrationStateKeys;\r
+import org.simantics.db.layer0.migration.MigrationStep;\r
+import org.simantics.db.layer0.util.Layer0Utils;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.layer0.utils.direct.GraphUtils;\r
+import org.simantics.simulation.ontology.SimulationResource;\r
+import org.simantics.spreadsheet.resource.SpreadsheetResource;\r
+\r
+public class CustomMigrationStep implements MigrationStep {\r
+\r
+ @Override\r
+ public void applyTo(IProgressMonitor monitor, Session session, MigrationState state) throws DatabaseException {\r
+ \r
+ final Resource res = state.getProperty(MigrationStateKeys.CURRENT_RESOURCE);\r
+ \r
+ session.syncRequest(new WriteRequest() {\r
+\r
+ @Override\r
+ public void perform(WriteGraph graph) throws DatabaseException {\r
+\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ SimulationResource SIMU = SimulationResource.getInstance(graph);\r
+\r
+ for(Resource model : graph.syncRequest(new ObjectsWithType(res, l0.ConsistsOf, SIMU.Model))) {\r
+\r
+ Resource sheetExperiment = Layer0Utils.getPossibleChild(graph, model, "SheetExperiment");\r
+ if(sheetExperiment != null) return;\r
+ \r
+ SpreadsheetResource SHEET = SpreadsheetResource.getInstance(graph);\r
+ sheetExperiment = GraphUtils.create2(graph, SHEET.Experiment,\r
+ l0.HasName, "SheetExperiment",\r
+ l0.HasLabel, "Sheet Experiment",\r
+ l0.PartOf, model);\r
+ \r
+ Resource sheetRun = GraphUtils.create2(graph, SHEET.Run,\r
+ l0.HasName, "Default",\r
+ l0.PartOf, sheetExperiment);\r
+ \r
+\r
+ }\r
+ \r
+ }\r
+ \r
+ });\r
+ \r
+ }\r
+\r
+}\r
package org.simantics.sysdyn.adapter;\r
\r
-import java.util.ArrayList;\r
-import java.util.Collection;\r
-\r
import org.simantics.db.ReadGraph;\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.WriteGraph;\r
-import org.simantics.db.common.utils.NameUtils;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.db.layer0.variable.Variable;\r
-import org.simantics.fmu.FMUControlJNI;\r
-import org.simantics.fmu.FMUJNIException;\r
-import org.simantics.simulation.experiment.ExperimentState;\r
-import org.simantics.sysdyn.SysdynResource;\r
-import org.simantics.sysdyn.manager.SysdynDataSet;\r
-import org.simantics.sysdyn.manager.SysdynGameExperiment;\r
-import org.simantics.sysdyn.manager.SysdynResult;\r
\r
-public class ValueIndexVariable extends IndexVariable<double[]> {\r
+public class ValueIndexVariable extends ValueIndexVariableBase<double[]> {\r
\r
public ValueIndexVariable(ReadGraph graph, Variable parent, String indexes)\r
throws DatabaseException {\r
super(graph, parent, indexes);\r
}\r
-\r
- public static double[] UNRESOLVED = new double[0];\r
\r
@Override\r
public double[] getValue() {\r
- if(experiment == null)\r
- return UNRESOLVED;\r
-\r
- Collection<SysdynResult> results = experiment.getActiveResults();\r
- ArrayList<String> variableNames = getVariableNamesWithIndexNumbers();\r
-\r
- double[] result = new double[variableNames.size()];\r
- for(int i = 0; i < variableNames.size(); i++) {\r
- for(SysdynResult r : results) { \r
- if(experiment instanceof SysdynGameExperiment) {\r
- Double d = ((SysdynGameExperiment)experiment).getCurrentValue(variableNames.get(i)); \r
- result[i] = d != null ? d : 0;\r
- } else {\r
- SysdynDataSet ds = r.getDataSet(variableNames.get(i));\r
- if(ds != null && ds.values != null && ds.values.length > 0) {\r
- result[i] = ds.values[ds.values.length-1];\r
- } else {\r
- return UNRESOLVED;\r
- }\r
- }\r
- }\r
- }\r
- return result;\r
+ return getValueFull();\r
}\r
-\r
- @Override\r
- public void setIndexedValue(WriteGraph graph, Object value)\r
- throws DatabaseException {\r
- Variable var = parent.getParent(graph);\r
- Resource resource = var.getRepresents(graph);\r
- \r
- if(!(value instanceof double[]) || resource == null)\r
- return;\r
- \r
- double[] values = (double[]) value;\r
- \r
- FMUControlJNI control = null;\r
- if(experiment instanceof SysdynGameExperiment) { // Support only game experiments for now..\r
- \r
- SysdynGameExperiment exp = (SysdynGameExperiment)experiment;\r
- ExperimentState state = exp.getSysdynExperimentState();\r
- // Set value to control only if the simulation is running or stopped, not before initialization\r
- if(!(ExperimentState.RUNNING.equals(state) || ExperimentState.STOPPED.equals(state)))\r
- return;\r
- \r
- control = ((SysdynGameExperiment)this.experiment).getFMUControl();\r
- if(control == null) \r
- return;\r
- \r
- \r
-\r
- ArrayList<String> variableNames = getVariableNamesWithIndexNumbers();\r
- for(int i = 0; i < variableNames.size() && i < values.length; i++) {\r
- if(values[i] == Double.NaN)\r
- continue;\r
- \r
- try {\r
- String name = variableNames.get(i);\r
- control.setRealValue(name, values[i]);\r
- \r
- // Set value for all referred variables in modules\r
- SysdynResource sr = SysdynResource.getInstance(graph);\r
- for(Resource dependency : graph.getObjects(resource, sr.Variable_isTailOf)) {\r
- Resource head = graph.getPossibleObject(dependency, sr.Variable_HasHead);\r
- Resource ref = graph.getPossibleObject(dependency, sr.Dependency_refersTo);\r
- if(ref != null && head != null) {\r
- String module = "";\r
- if(name.indexOf(".") > 0)\r
- module = name.substring(0, name.lastIndexOf(".") + 1);\r
- String refName = module + NameUtils.getSafeName(graph, head) + "." + NameUtils.getSafeName(graph, ref);\r
- control.setRealValue(refName, values[i]);\r
- } \r
- }\r
- } catch (FMUJNIException e) {\r
- }\r
- }\r
- exp.updateSubscriptions();\r
- }\r
- }\r
-\r
+ \r
}\r
--- /dev/null
+package org.simantics.sysdyn.adapter;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Collection;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.utils.NameUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.variable.Variable;\r
+import org.simantics.fmu.FMUControlJNI;\r
+import org.simantics.fmu.FMUJNIException;\r
+import org.simantics.simulation.experiment.ExperimentState;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.manager.SysdynDataSet;\r
+import org.simantics.sysdyn.manager.SysdynGameExperiment;\r
+import org.simantics.sysdyn.manager.SysdynResult;\r
+\r
+abstract public class ValueIndexVariableBase<T> extends IndexVariable<T> {\r
+\r
+ public ValueIndexVariableBase(ReadGraph graph, Variable parent, String indexes)\r
+ throws DatabaseException {\r
+ super(graph, parent, indexes);\r
+ }\r
+\r
+ public static double[] UNRESOLVED = new double[0];\r
+ \r
+ public double[] getValueFull() {\r
+ if(experiment == null)\r
+ return UNRESOLVED;\r
+\r
+ Collection<SysdynResult> results = experiment.getActiveResults();\r
+ ArrayList<String> variableNames = getVariableNamesWithIndexNumbers();\r
+\r
+ double[] result = new double[variableNames.size()];\r
+ for(int i = 0; i < variableNames.size(); i++) {\r
+ for(SysdynResult r : results) { \r
+ if(experiment instanceof SysdynGameExperiment) {\r
+ Double d = ((SysdynGameExperiment)experiment).getCurrentValue(variableNames.get(i)); \r
+ result[i] = d != null ? d : 0;\r
+ } else {\r
+ SysdynDataSet ds = r.getDataSet(variableNames.get(i));\r
+ if(ds != null && ds.values != null && ds.values.length > 0) {\r
+ result[i] = ds.values[ds.values.length-1];\r
+ } else {\r
+ return UNRESOLVED;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ return result;\r
+ }\r
+\r
+ @Override\r
+ public void setIndexedValue(WriteGraph graph, Object value)\r
+ throws DatabaseException {\r
+ Variable var = parent.getParent(graph);\r
+ Resource resource = var.getRepresents(graph);\r
+ \r
+ if(!(value instanceof double[]) || resource == null)\r
+ return;\r
+ \r
+ double[] values = (double[]) value;\r
+ \r
+ FMUControlJNI control = null;\r
+ if(experiment instanceof SysdynGameExperiment) { // Support only game experiments for now..\r
+ \r
+ SysdynGameExperiment exp = (SysdynGameExperiment)experiment;\r
+ ExperimentState state = exp.getSysdynExperimentState();\r
+ // Set value to control only if the simulation is running or stopped, not before initialization\r
+ if(!(ExperimentState.RUNNING.equals(state) || ExperimentState.STOPPED.equals(state)))\r
+ return;\r
+ \r
+ control = ((SysdynGameExperiment)this.experiment).getFMUControl();\r
+ if(control == null) \r
+ return;\r
+ \r
+ \r
+\r
+ ArrayList<String> variableNames = getVariableNamesWithIndexNumbers();\r
+ for(int i = 0; i < variableNames.size() && i < values.length; i++) {\r
+ if(values[i] == Double.NaN)\r
+ continue;\r
+ \r
+ try {\r
+ String name = variableNames.get(i);\r
+ control.setRealValue(name, values[i]);\r
+ \r
+ // Set value for all referred variables in modules\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ for(Resource dependency : graph.getObjects(resource, sr.Variable_isTailOf)) {\r
+ Resource head = graph.getPossibleObject(dependency, sr.Variable_HasHead);\r
+ Resource ref = graph.getPossibleObject(dependency, sr.Dependency_refersTo);\r
+ if(ref != null && head != null) {\r
+ String module = "";\r
+ if(name.indexOf(".") > 0)\r
+ module = name.substring(0, name.lastIndexOf(".") + 1);\r
+ String refName = module + NameUtils.getSafeName(graph, head) + "." + NameUtils.getSafeName(graph, ref);\r
+ control.setRealValue(refName, values[i]);\r
+ } \r
+ }\r
+ } catch (FMUJNIException e) {\r
+ }\r
+ }\r
+ exp.updateSubscriptions();\r
+ }\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.adapter;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.variable.Variable;\r
+\r
+public class ValueIndexVariableI extends ValueIndexVariableBase<Double> {\r
+\r
+ final int index;\r
+ \r
+ public ValueIndexVariableI(ReadGraph graph, Variable parent, int index) throws DatabaseException {\r
+ super(graph, parent, "");\r
+ this.index = index;\r
+ }\r
+ \r
+ @Override\r
+ public Double getValue() {\r
+ double[] array = getValueFull();\r
+ if(array == null || array.length < index+1) return Double.NaN;\r
+ return array[0];\r
+ }\r
+ \r
+}\r
String name = child.getName(g);\r
try {\r
SpreadsheetUtils.decodeCellAbsolute(name);\r
- Variant value = child.getPropertyValue(g, SheetVariables.CONTENT, Bindings.VARIANT);\r
- newCells.put(name, value.getValue());\r
+ Object value = child.getPropertyValue(g, SheetVariables.CONTENT);\r
+ if(value instanceof Variant) {\r
+ newCells.put(name, ((Variant)value).getValue());\r
+ }\r
} catch (CellParseException e) {\r
} catch (MissingVariableException e) {\r
System.out.println("missing content for: " + name);\r
/*******************************************************************************\r
- * Copyright (c) 2007, 2011 Association for Decentralized Information Management in\r
+ * Copyright (c) 2007, 2011, 2014 Association for Decentralized Information Management in\r
* Industry THTH ry.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
if(variable.getArrayIndexes() == null || range == null)\r
return "";\r
ArrayList<Enumeration> enumerations = variable.getArrayIndexes();\r
- StringTokenizer st = new StringTokenizer(range, "[]:,", true);\r
+ StringTokenizer st = new StringTokenizer(range, "{}[]:,", true);\r
int index = 0;\r
+ boolean insideCurlyBrackets = false;\r
while(st.hasMoreTokens()) {\r
String rangeToken = st.nextToken().trim();\r
if(rangeToken.matches("[\\[\\]:]")) {\r
sb.append(rangeToken);\r
+ } else if(rangeToken.matches("[\\{]")) {\r
+ sb.append(rangeToken);\r
+ insideCurlyBrackets = true;\r
+ } else if(rangeToken.matches("[\\}]")) {\r
+ sb.append(rangeToken);\r
+ insideCurlyBrackets = false;\r
} else if (rangeToken.equals(",")) {\r
sb.append(rangeToken);\r
- index++;\r
+ if (!insideCurlyBrackets) {\r
+ index++;\r
+ }\r
} else if(index < enumerations.size()) {\r
if(rangeToken.equals(enumerations.get(index).getName())) {\r
sb.append(":");\r
}\r
\r
}\r
+\r
+ public static org.simantics.db.layer0.variable.Variable lastValue2(ReadGraph graph, org.simantics.db.layer0.variable.Variable run, String path) throws DatabaseException {\r
+ \r
+ if(run == null) return null;\r
+\r
+ org.simantics.db.layer0.variable.Variable v = run.browsePossible(graph, "/" + path);\r
+ if(v == null) return null;\r
+\r
+ org.simantics.db.layer0.variable.Variable p = v.browsePossible(graph, "#value#$0");\r
+ if(p == null) return null;\r
+ \r
+ return p;\r
+ \r
+ }\r
+\r
+ public static org.simantics.db.layer0.variable.Variable equation(ReadGraph graph, org.simantics.db.layer0.variable.Variable run, String path) throws DatabaseException {\r
+\r
+ if(run == null) return null;\r
+ \r
+ org.simantics.db.layer0.variable.Variable v = run.browsePossible(graph, "/" + path);\r
+ if(v == null) return null;\r
+\r
+ org.simantics.db.layer0.variable.Variable p = v.browsePossible(graph, "#equation");\r
+ if(p == null) return null;\r
+ \r
+ return p;\r
+ \r
+ }\r
\r
}\r
import org.simantics.db.Resource;\r
import org.simantics.db.common.utils.ListUtils;\r
import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.exception.NoSingleResultException;\r
import org.simantics.db.exception.ServiceException;\r
import org.simantics.db.request.Read;\r
import org.simantics.layer0.Layer0;\r
}\r
skipBackwardFlows = true;\r
\r
- Resource dependencyConnection = graph.getSingleObject(dependency, mod.ConnectionToDiagramConnection);\r
- String polarity = (String)graph.getPossibleRelatedValue(dependencyConnection, sr.DependencyConnection_polarity, Bindings.STRING);\r
+ Resource dependencyConnection;\r
+ try {\r
+ dependencyConnection = graph.getSingleObject(dependency, mod.ConnectionToDiagramConnection);\r
+ } catch (NoSingleResultException e) {\r
+ return LoopType.UNDEFINED;\r
+ }\r
+ String polarity = (String)graph.getPossibleRelatedValue(dependencyConnection, sr.DependencyConnection_polarity, Bindings.STRING);\r
if ("-".equals(polarity)) {\r
oddNumberOfNegativeCausalities = !oddNumberOfNegativeCausalities;\r
} else if (polarity != null \r
DOC.HasReportFactory, report,\r
l0.PartOf, model);\r
\r
+ Resource sheetExperiment = GraphUtils.create2(g, SHEET.Experiment,\r
+ l0.HasName, "SheetExperiment",\r
+ l0.HasLabel, "Sheet Experiment",\r
+ l0.PartOf, model);\r
+\r
+ Resource sheetRun = GraphUtils.create2(g, SHEET.Run,\r
+ l0.HasName, "Default",\r
+ l0.PartOf, sheetExperiment);\r
+\r
ProjectResource PROJ = ProjectResource.getInstance(g);\r
for(Resource dep : g.getObjects(library, l0.IsLinkedTo)) {\r
if(g.isInstanceOf(dep, PROJ.NamespaceRequirement)) {\r
import org.simantics.diagram.profile.Profiles;\r
import org.simantics.diagram.stubs.DiagramResource;\r
import org.simantics.layer0.Layer0;\r
+import org.simantics.simulation.ontology.SimulationResource;\r
import org.simantics.sysdyn.SysdynResource;\r
\r
public class ProfileEntries {\r
// public void perform(WriteGraph graph) throws DatabaseException {\r
// DiagramResource DIA = DiagramResource.getInstance(graph);\r
graph.claim(model, DIA.HasActiveProfile, defaultProfile);\r
+ SimulationResource SIMU = SimulationResource.getInstance(graph);\r
+ graph.claim(defaultProfile, SIMU.IsActive, null, sr.Profiles_IssueWarnings);\r
+ graph.claim(defaultProfile, SIMU.IsActive, null, sr.Profiles_ShadowVisualizations);\r
+ graph.claim(model, DIA.HasActiveProfile, simulationPlaybackProfile);\r
+ graph.claim(simulationPlaybackProfile, SIMU.IsActive, null, sr.Profiles_SimulationPlaybackColours);\r
+ \r
// }\r
// });\r
\r