From 3fb478f40b723ddef4fbf76ef600d9c940516b6a Mon Sep 17 00:00:00 2001 From: lempinen Date: Mon, 19 Jul 2010 10:18:45 +0000 Subject: [PATCH] git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@16693 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../properties/widgets/ExpressionTypes.java | 4 +- .../properties/widgets/ExpressionWidget.java | 3 + .../widgets/expressions/InputExpression.java | 80 +++++++++++++++++++ sysdyn_ontologies/sysdyn.graph | 12 +-- 4 files changed, 92 insertions(+), 7 deletions(-) create mode 100644 org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/expressions/InputExpression.java diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ExpressionTypes.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ExpressionTypes.java index 3741a34e..a26ebdfd 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ExpressionTypes.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ExpressionTypes.java @@ -9,7 +9,7 @@ import org.simantics.ui.SimanticsUI; public class ExpressionTypes { - public static enum ExpressionType {Auxiliary, Parameter, Constant, Lookup, WithLookup, Stock, Delay, Empty}; + public static enum ExpressionType {Auxiliary, Parameter, Constant, Lookup, WithLookup, Stock, Delay, Empty, Input}; public static ExpressionType[] auxiliaryExpressions = new ExpressionType[] { ExpressionType.Parameter, @@ -75,6 +75,8 @@ public class ExpressionTypes { et = ExpressionType.Lookup; } else if (graph.isInstanceOf(expression, sr.WithLookupExpression)) { et = ExpressionType.WithLookup; + } else if (graph.isInstanceOf(expression, sr.InputExpression)) { + et = ExpressionType.Input; } else { et = ExpressionType.Empty; } diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ExpressionWidget.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ExpressionWidget.java index 94643afa..b7e7bf7f 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ExpressionWidget.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ExpressionWidget.java @@ -26,6 +26,7 @@ import org.simantics.sysdyn.ui.properties.widgets.expressions.DelayExpression; import org.simantics.sysdyn.ui.properties.widgets.expressions.EmptyExpression; import org.simantics.sysdyn.ui.properties.widgets.expressions.ExpressionValidation; import org.simantics.sysdyn.ui.properties.widgets.expressions.IExpression; +import org.simantics.sysdyn.ui.properties.widgets.expressions.InputExpression; import org.simantics.sysdyn.ui.properties.widgets.expressions.LookupExpression; import org.simantics.sysdyn.ui.properties.widgets.expressions.ParameterExpression; import org.simantics.sysdyn.ui.properties.widgets.expressions.StockExpression; @@ -90,6 +91,8 @@ public class ExpressionWidget implements Widget { exp = new StockExpression(); break; case Delay: exp = new DelayExpression(); break; + case Input: + exp = new InputExpression(); break; default: exp = new EmptyExpression(); } diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/expressions/InputExpression.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/expressions/InputExpression.java new file mode 100644 index 00000000..384182d8 --- /dev/null +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/expressions/InputExpression.java @@ -0,0 +1,80 @@ +package org.simantics.sysdyn.ui.properties.widgets.expressions; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import org.eclipse.jface.layout.GridLayoutFactory; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.FocusListener; +import org.eclipse.swt.events.KeyListener; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.simantics.db.Resource; + +public class InputExpression implements IExpression { + + @Override + public void createExpressionFields(Composite parent, Map data) { + GridLayoutFactory.fillDefaults().applyTo(parent); + Label label = new Label(parent, SWT.NONE); + label.setText("Input"); + } + + @Override + public void readData(Resource variable, Map data) { + // TODO Auto-generated method stub + + } + + @Override + public void save(Resource variable, Map data) { + // TODO Auto-generated method stub + + } + + @Override + public void focus() { + // TODO Auto-generated method stub + + } + + @Override + public void replaceSelection(String var) { + // TODO Auto-generated method stub + + } + + @Override + public void updateData(Map data) { + // TODO Auto-generated method stub + + } + + @SuppressWarnings("unchecked") + @Override + public List getExpressionFields() { + // TODO Auto-generated method stub + return Collections.EMPTY_LIST; + } + + @Override + public void addModifyListener(ModifyListener listener) { + // TODO Auto-generated method stub + + } + + @Override + public void addKeyListener(KeyListener listener) { + // TODO Auto-generated method stub + + } + + @Override + public void addFocusListener(FocusListener listener) { + // TODO Auto-generated method stub + + } + +} diff --git a/sysdyn_ontologies/sysdyn.graph b/sysdyn_ontologies/sysdyn.graph index cd8e3fb6..83bd0ed6 100644 --- a/sysdyn_ontologies/sysdyn.graph +++ b/sysdyn_ontologies/sysdyn.graph @@ -444,7 +444,7 @@ ModuleModel @ "ModuleModel" : SysdynModel ModuleConfiguration @ "ModuleConfiguration" : Configuration L0.HasLabel "Mallikonfiguraatio" : L0.String HasStartTime "0.0" : L0.Double - HasStopTime "10.0" : L0.Double + HasStopTime "100.0" : L0.Double L0.ConsistsOf Moduuli1 @ "Moduuli1" : Module1 L0.HasLabel "EkaModuuli" : L0.String @@ -700,7 +700,7 @@ RootConfigurationDiagram : ConfigurationDiagram