import org.simantics.db.exception.DatabaseException;\r
import org.simantics.objmap.schema.MappingSchemas;\r
import org.simantics.objmap.schema.SimpleSchema;\r
+import org.simantics.sysdyn.representation.expressions.ConstantExpression;\r
+import org.simantics.sysdyn.representation.expressions.LookupExpression;\r
import org.simantics.sysdyn.representation.expressions.NormalExpression;\r
import org.simantics.sysdyn.representation.expressions.ParameterExpression;\r
import org.simantics.sysdyn.representation.expressions.StockExpression;\r
+import org.simantics.sysdyn.representation.expressions.WithLookupExpression;\r
\r
public class SysdynSchema extends SimpleSchema {\r
\r
addLinkType(MappingSchemas.fromAnnotations(g, NormalExpression.class));\r
addLinkType(MappingSchemas.fromAnnotations(g, ParameterExpression.class));\r
addLinkType(MappingSchemas.fromAnnotations(g, StockExpression.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, ConstantExpression.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, WithLookupExpression.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, LookupExpression.class));\r
+ \r
\r
} catch (DatabaseException e) {\r
// TODO Auto-generated catch block\r
--- /dev/null
+package org.simantics.sysdyn.representation.expressions;\r
+\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.objmap.annotations.RelatedValue;\r
+import org.simantics.sysdyn.representation.Variable;\r
+\r
+@GraphType("http://www.simantics.org/Sysdyn#ConstantExpression")\r
+public class ConstantExpression extends Expression {\r
+ \r
+ @RelatedValue("http://www.simantics.org/Sysdyn#HasEquation")\r
+ private String equation;\r
+ \r
+ @Override\r
+ public String getDeclaration(Variable variable) {\r
+ return " constant " + variable.getType() + " " + variable.getName() + " = " + equation + ";\n";\r
+ }\r
+\r
+}\r