VP = <http://www.simantics.org/Viewpoint-1.1>\r
SYSDYN = <http://www.simantics.org/Sysdyn-1.1>\r
\r
+/////////////////////////////////\r
+/// History datasets\r
+/////////////////////////////////\r
HDBC = SYSDYN.HistoryDataset.HistoryDatasetVariablesBrowseContext : VP.BrowseContext\r
\r
HDBC.StringNodeType <T VP.NodeType\r
VP.VisualsContribution.HasNodeType SYSDYN.HistoryDataset\r
VP.VisualsContribution.HasRule VP.PassThruSorterRule\r
\r
+/////////////////////////////////\r
+/// Module parameters\r
+/////////////////////////////////\r
+\r
+POBC = SYSDYN.Module.ParameterOverrideBrowseContext : VP.BrowseContext\r
+\r
+POBC.NodeType <T VP.NodeType\r
+ @L0.assert VP.HasContentType "java.lang.Object"\r
+\r
+POBC.ParameterChildRule : VP.ChildRule\r
+POBC.ParameterLabelRule : VP.LabelRule\r
+POBC.ParameterLabelDecorationRule : VP.LabelDecorationRule\r
+POBC.ParameterModifierRule : VP.ModifierRule\r
+\r
+POBC\r
+ @VP.customChildRule L0.Entity POBC.ParameterChildRule\r
+ POBC.Node : POBC.NodeType\r
+\r
+POBC \r
+ @VP.customLabelRule POBC.Node POBC.ParameterLabelRule\r
+ \r
+POBC \r
+ @VP.customModifierRule POBC.Node POBC.ParameterModifierRule\r
+ \r
+POBC \r
+ @VP.customLabelDecorationRule POBC.Node POBC.ParameterLabelDecorationRule \r
+
\ No newline at end of file
SYSDYN.Module <T STR.Component
>-- SYSDYN.Module.redeclaration --> SYSDYN.Redeclaration <R L0.IsComposedOf
+ >-- SYSDYN.Module.parameterOverride --> SYSDYN.Module.ParameterOverride <R L0.IsComposedOf
SYSDYN.ModuleSymbol <T DIA.FontProvider <T DIA.ColorProvider
@MOD.defSymbol "ModuleSymbol" SYSDYN.Module
_ : SYSDYN.SysdynTerminal
@MOD.terminal SYSDYN.ModuleSymbol SYSDYN.IsTailOfTerminal
+SYSDYN.Module.ParameterOverride <T L0.Entity
+ >-- SYSDYN.Module.ParameterOverride.overriddenParameter --> SYSDYN.IndependentVariable <R L0.IsWeaklyRelatedTo : L0.FunctionalRelation
+ >-- SYSDYN.Module.ParameterOverride.overrideExpression --> L0.String <R L0.HasProperty : L0.FunctionalRelation
+
SYSDYN.IsOutput <R L0.IsRelatedTo : L0.Tag
@L0.symmetric
public final Resource ModelBrowser;\r
public final Resource Module;\r
public final Resource ModuleSymbol;\r
+ public final Resource Module_ParameterOverride;\r
+ public final Resource Module_ParameterOverrideBrowseContext;\r
+ public final Resource Module_ParameterOverrideBrowseContext_Node;\r
+ public final Resource Module_ParameterOverrideBrowseContext_NodeType;\r
+ public final Resource Module_ParameterOverrideBrowseContext_ParameterChildRule;\r
+ public final Resource Module_ParameterOverrideBrowseContext_ParameterLabelDecorationRule;\r
+ public final Resource Module_ParameterOverrideBrowseContext_ParameterLabelRule;\r
+ public final Resource Module_ParameterOverrideBrowseContext_ParameterModifierRule;\r
+ public final Resource Module_ParameterOverride_overriddenParameter;\r
+ public final Resource Module_ParameterOverride_overrideExpression;\r
+ public final Resource Module_ParameterOverride_overrideExpression_Inverse;\r
+ public final Resource Module_parameterOverride;\r
+ public final Resource Module_parameterOverride_Inverse;\r
public final Resource Module_redeclaration;\r
public final Resource Module_redeclaration_Inverse;\r
public final Resource NormalExpression;\r
public static final String ModelBrowser = "http://www.simantics.org/Sysdyn-1.1/ModelBrowser";\r
public static final String Module = "http://www.simantics.org/Sysdyn-1.1/Module";\r
public static final String ModuleSymbol = "http://www.simantics.org/Sysdyn-1.1/ModuleSymbol";\r
+ public static final String Module_ParameterOverride = "http://www.simantics.org/Sysdyn-1.1/Module/ParameterOverride";\r
+ public static final String Module_ParameterOverrideBrowseContext = "http://www.simantics.org/Sysdyn-1.1/Module/ParameterOverrideBrowseContext";\r
+ public static final String Module_ParameterOverrideBrowseContext_Node = "http://www.simantics.org/Sysdyn-1.1/Module/ParameterOverrideBrowseContext/Node";\r
+ public static final String Module_ParameterOverrideBrowseContext_NodeType = "http://www.simantics.org/Sysdyn-1.1/Module/ParameterOverrideBrowseContext/NodeType";\r
+ public static final String Module_ParameterOverrideBrowseContext_ParameterChildRule = "http://www.simantics.org/Sysdyn-1.1/Module/ParameterOverrideBrowseContext/ParameterChildRule";\r
+ public static final String Module_ParameterOverrideBrowseContext_ParameterLabelDecorationRule = "http://www.simantics.org/Sysdyn-1.1/Module/ParameterOverrideBrowseContext/ParameterLabelDecorationRule";\r
+ public static final String Module_ParameterOverrideBrowseContext_ParameterLabelRule = "http://www.simantics.org/Sysdyn-1.1/Module/ParameterOverrideBrowseContext/ParameterLabelRule";\r
+ public static final String Module_ParameterOverrideBrowseContext_ParameterModifierRule = "http://www.simantics.org/Sysdyn-1.1/Module/ParameterOverrideBrowseContext/ParameterModifierRule";\r
+ public static final String Module_ParameterOverride_overriddenParameter = "http://www.simantics.org/Sysdyn-1.1/Module/ParameterOverride/overriddenParameter";\r
+ public static final String Module_ParameterOverride_overrideExpression = "http://www.simantics.org/Sysdyn-1.1/Module/ParameterOverride/overrideExpression";\r
+ public static final String Module_ParameterOverride_overrideExpression_Inverse = "http://www.simantics.org/Sysdyn-1.1/Module/ParameterOverride/overrideExpression/Inverse";\r
+ public static final String Module_parameterOverride = "http://www.simantics.org/Sysdyn-1.1/Module/parameterOverride";\r
+ public static final String Module_parameterOverride_Inverse = "http://www.simantics.org/Sysdyn-1.1/Module/parameterOverride/Inverse";\r
public static final String Module_redeclaration = "http://www.simantics.org/Sysdyn-1.1/Module/redeclaration";\r
public static final String Module_redeclaration_Inverse = "http://www.simantics.org/Sysdyn-1.1/Module/redeclaration/Inverse";\r
public static final String NormalExpression = "http://www.simantics.org/Sysdyn-1.1/NormalExpression";\r
ModelBrowser = getResourceOrNull(graph, URIs.ModelBrowser);\r
Module = getResourceOrNull(graph, URIs.Module);\r
ModuleSymbol = getResourceOrNull(graph, URIs.ModuleSymbol);\r
+ Module_ParameterOverride = getResourceOrNull(graph, URIs.Module_ParameterOverride);\r
+ Module_ParameterOverrideBrowseContext = getResourceOrNull(graph, URIs.Module_ParameterOverrideBrowseContext);\r
+ Module_ParameterOverrideBrowseContext_Node = getResourceOrNull(graph, URIs.Module_ParameterOverrideBrowseContext_Node);\r
+ Module_ParameterOverrideBrowseContext_NodeType = getResourceOrNull(graph, URIs.Module_ParameterOverrideBrowseContext_NodeType);\r
+ Module_ParameterOverrideBrowseContext_ParameterChildRule = getResourceOrNull(graph, URIs.Module_ParameterOverrideBrowseContext_ParameterChildRule);\r
+ Module_ParameterOverrideBrowseContext_ParameterLabelDecorationRule = getResourceOrNull(graph, URIs.Module_ParameterOverrideBrowseContext_ParameterLabelDecorationRule);\r
+ Module_ParameterOverrideBrowseContext_ParameterLabelRule = getResourceOrNull(graph, URIs.Module_ParameterOverrideBrowseContext_ParameterLabelRule);\r
+ Module_ParameterOverrideBrowseContext_ParameterModifierRule = getResourceOrNull(graph, URIs.Module_ParameterOverrideBrowseContext_ParameterModifierRule);\r
+ Module_ParameterOverride_overriddenParameter = getResourceOrNull(graph, URIs.Module_ParameterOverride_overriddenParameter);\r
+ Module_ParameterOverride_overrideExpression = getResourceOrNull(graph, URIs.Module_ParameterOverride_overrideExpression);\r
+ Module_ParameterOverride_overrideExpression_Inverse = getResourceOrNull(graph, URIs.Module_ParameterOverride_overrideExpression_Inverse);\r
+ Module_parameterOverride = getResourceOrNull(graph, URIs.Module_parameterOverride);\r
+ Module_parameterOverride_Inverse = getResourceOrNull(graph, URIs.Module_parameterOverride_Inverse);\r
Module_redeclaration = getResourceOrNull(graph, URIs.Module_redeclaration);\r
Module_redeclaration_Inverse = getResourceOrNull(graph, URIs.Module_redeclaration_Inverse);\r
NormalExpression = getResourceOrNull(graph, URIs.NormalExpression);\r
VTT Technical Research Centre of Finland - initial API and implementation\r
-->\r
-<adapters>\r\r <target interface="org.simantics.db.layer0.adapter.Realization">\r <type uri="http://www.simantics.org/Sysdyn-0.0/Module"\r class="org.simantics.structural2.realization.StructuralRealization">\r <this />\r </type>\r </target>\r\r <target interface="org.simantics.layer0.utils.triggers.ITrigger">\r <type uri = "http://www.simantics.org/Sysdyn-0.0/DiagramToCompositeMapping"\r class = "org.simantics.sysdyn.ui.editor.DiagramToCompositeMapping3">\r <graph/>\r <this />\r </type>\r </target>\r \r <target interface="org.simantics.structural.ui.modelBrowser.nodes.AbstractNode">\r <type uri="http://www.simantics.org/Sysdyn-0.0/SysdynModel"\r class="org.simantics.structural.ui.modelBrowser.nodes.ModelNode">\r <this />\r </type>\r </target> \r \r\r <target\r interface="org.simantics.browsing.ui.common.node.AbstractNode">\r <type\r uri="http://www.simantics.org/Sysdyn-0.0/SysdynModel"\r class="org.simantics.sysdyn.ui.browser.nodes.ModelNode">\r <this />\r </type>\r\r <resource\r uri="http://www.simantics.org/Sysdyn-0.0/ModuleSymbol"\r class="org.simantics.sysdyn.ui.browser.nodes.SymbolNode">\r <this />\r </resource>\r\r <type\r uri="http://www.simantics.org/Simulation-1.0/Experiment"\r class="org.simantics.sysdyn.ui.browser.nodes.ExperimentNode">\r <this />\r </type>\r \r <type\r uri="http://www.simantics.org/Sysdyn-0.0/Result"\r class="org.simantics.sysdyn.ui.browser.nodes.SimulationResultNode">\r <this />\r </type>\r \r </target>\r\r <!-- Inject default connection routing algorithm for sysdyn diagrams -->\r <target interface="org.simantics.g2d.diagram.DiagramClass">\r <adapter uri="http://www.simantics.org/Sysdyn-0.0/ConfigurationDiagram"\r adapterClass="org.simantics.sysdyn.ui.elements2.ConfigurationDiagramClassAdapter" />\r </target>\r\r <!-- Sysdyn symbols -->\r <target interface="org.simantics.diagram.adapter.ElementFactory">\r <resource uri="http://www.simantics.org/Sysdyn-0.0/StockSymbol"\r class="org.simantics.sysdyn.ui.elements2.StockFactory" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModuleSymbol"\r class="org.simantics.sysdyn.ui.elements2.ModuleFactory" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ValveSymbol"\r class="org.simantics.sysdyn.ui.elements2.ValveFactory" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/AuxiliarySymbol"\r class="org.simantics.sysdyn.ui.elements2.AuxiliaryFactory" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/CloudSymbol"\r class="org.simantics.sysdyn.ui.elements2.CloudFactory" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/InputSymbol"\r class="org.simantics.sysdyn.ui.elements2.InputFactory" />\r\r <type uri="http://www.simantics.org/Sysdyn-0.0/StockSymbol"\r class="org.simantics.sysdyn.ui.elements2.StockFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/ModuleSymbol"\r class="org.simantics.sysdyn.ui.elements2.ModuleFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/ValveSymbol"\r class="org.simantics.sysdyn.ui.elements2.ValveFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/AuxiliarySymbol"\r class="org.simantics.sysdyn.ui.elements2.AuxiliaryFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/CloudSymbol"\r class="org.simantics.sysdyn.ui.elements2.CloudFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/InputSymbol"\r class="org.simantics.sysdyn.ui.elements2.InputFactory" /> \r </target>\r \r <!-- Sysdyn connections -->\r <target interface="org.simantics.diagram.adapter.ElementFactory">\r <!-- Edges --> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/FlowConnection"\r class="org.simantics.sysdyn.ui.elements2.connections.RouteFlowEdgeFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/FlowConnection"\r class="org.simantics.sysdyn.ui.elements2.connections.RouteFlowEdgeFactory" /> \r <type uri="http://www.simantics.org/Sysdyn-0.0/FlowConnection"\r class="org.simantics.sysdyn.ui.elements2.connections.RouteFlowConnectionFactory">\r <graph/>\r </type> \r \r <resource uri="http://www.simantics.org/Sysdyn-0.0/DependencyConnection"\r class="org.simantics.sysdyn.ui.elements2.connections.DependencyEdgeFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/DependencyConnection"\r class="org.simantics.sysdyn.ui.elements2.connections.DependencyEdgeFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/DependencyConnection"\r class="org.simantics.sysdyn.ui.elements2.connections.DependencyConnectionFactory" />\r </target>\r \r <target interface="org.simantics.g2d.connection.EdgeVisualsConfigurer">\r <baseType uri="http://www.simantics.org/Diagram-0.0/HasConnector" />\r <resource uri="http://www.simantics.org/Diagram-0.0/HasPlainConnector"\r class="org.simantics.diagram.content.ArrowConfigurer">\r <string>none 0</string>\r </resource>\r <resource uri="http://www.simantics.org/Diagram-0.0/HasArrowConnector"\r class="org.simantics.diagram.content.ArrowConfigurer">\r <string>fill 1</string>\r </resource>\r </target>\r \r <!-- ModelBrowser2 -->\r \r <target interface="org.simantics.browsing.ui.model.children.ChildRule">\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ProjectBrowseContext/ModuleTypeChildRule"\r class="org.simantics.sysdyn.ui.browser.childrules.ModuleTypeChildRule"/>\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ProjectBrowseContext/ModuleContentChildRule"\r class="org.simantics.sysdyn.ui.browser.childrules.ModuleContentChildRule"/> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/ChartAxisAndVariablesBrowseContext/AxisChildRule"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.AxisChildRule"/> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/ChartAxisAndVariablesBrowseContext/VariableChildRule"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.VariableChildRule"/> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/BarSeriesBrowseContext/SeriesChildRule"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesChildRule"/> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/PieSeriesBrowseContext/SeriesChildRule"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesChildRule"/> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/HistoryDataset/HistoryDatasetVariablesBrowseContext/VariableChildRule"\r class="org.simantics.sysdyn.ui.properties.widgets.historyDataset.VariableChildRule"/> \r </target>\r \r <target interface="org.simantics.browsing.ui.model.visuals.VisualsRule">\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ProjectBrowseContext/ModuleTypeLabelRule"\r class="org.simantics.sysdyn.ui.browser.labelrules.ModuleTypeLabelRule"/>\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ChartAxisAndVariablesBrowseContext/SeriesLabelRule"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesLabelRule"/> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/ChartAxisAndVariablesBrowseContext/AxisLabelRule"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.AxisLabelRule"/> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/BarSeriesBrowseContext/SeriesLabelRule"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesLabelRule"/> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/PieSeriesBrowseContext/SeriesLabelRule"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesLabelRule"/> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/HistoryDataset/HistoryDatasetVariablesBrowseContext/VariableLabelRule"\r class="org.simantics.sysdyn.ui.properties.widgets.historyDataset.VariableLabelRule"/> \r \r \r <resource uri="http://www.simantics.org/Sysdyn-0.0/ChartAxisAndVariablesBrowseContext/SeriesLabelDecorationRule"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesLabelDecorationRule"/> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/BarSeriesBrowseContext/SeriesLabelDecorationRule"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesLabelDecorationRule"/> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/PieSeriesBrowseContext/SeriesLabelDecorationRule"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesLabelDecorationRule"/> \r </target> \r \r <target interface="org.simantics.db.layer0.adapter.ActionFactory">\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ProjectActionContext/Actions/NewModuleType"\r class="org.simantics.sysdyn.ui.browser.actions.NewModuleTypeAction" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ProjectActionContext/Actions/NewEnumeration"\r class="org.simantics.sysdyn.ui.browser.actions.NewEnumerationAction" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ProjectActionContext/Actions/OpenWorkbook"\r class="org.simantics.sysdyn.ui.browser.actions.OpenWorkbookAction" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ProjectActionContext/Actions/NewFunction"\r class="org.simantics.sysdyn.ui.browser.actions.NewFunctionAction" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ProjectActionContext/Actions/NewFunctionLibrary"\r class="org.simantics.sysdyn.ui.browser.actions.NewFunctionLibraryAction" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ProjectActionContext/Actions/NewSharedFunctionLibrary"\r class="org.simantics.sysdyn.ui.browser.actions.NewSharedFunctionLibraryAction" /> \r </target> \r \r <target interface="org.simantics.db.layer0.adapter.DropActionFactory">\r <resource\r uri="http://www.simantics.org/Sysdyn-0.0/ChartAxisAndVariablesActionContext/Actions/SeriesDropAction"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesDropAction" />\r <resource\r uri="http://www.simantics.org/Sysdyn-0.0/ChartAxisAndVariablesActionContext/Actions/AxisDropAction"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.AxisDropAction" /> \r \r <resource\r uri="http://www.simantics.org/Sysdyn-0.0/BarSeriesActionContext/Actions/SeriesDropAction"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesDropAction" />\r <resource\r uri="http://www.simantics.org/Sysdyn-0.0/PieSeriesActionContext/Actions/SeriesDropAction"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesDropAction" /> \r </target> \r \r <!-- PROFILES -->\r <target interface="org.simantics.scenegraph.profile.Style">\r <resource uri="http://www.simantics.org/Sysdyn-0.0/SimulationPlaybackStyle"\r class="org.simantics.sysdyn.ui.elements2.profiles.SimulationPlaybackStyle">\r </resource>\r <resource uri="http://www.simantics.org/Sysdyn-0.0/IssueStyle"\r class="org.simantics.sysdyn.ui.elements2.profiles.IssueDecorationStyle">\r </resource>\r </target>\r \r <!-- Charts -->\r <target interface="org.simantics.diagram.adapter.ElementFactory">\r <resource uri="http://www.simantics.org/JFreeChart-1.0/ChartElement"\r class="org.simantics.sysdyn.ui.trend.chart.element.ChartElementFactory" />\r \r <type uri="http://www.simantics.org/JFreeChart-1.0/ChartElement"\r class="org.simantics.sysdyn.ui.trend.chart.element.ChartElementFactory" />\r </target>\r \r <target interface="org.simantics.diagram.synchronization.graph.ElementWriter">\r <resource uri="http://www.simantics.org/JFreeChart-1.0/ChartElement"\r class="org.simantics.sysdyn.ui.trend.chart.element.ChartElementWriter" />\r </target>\r \r <target interface="org.simantics.sysdyn.ui.trend.chart.IJFreeChart">\r <type uri="http://www.simantics.org/JFreeChart-1.0/Chart"\r class="org.simantics.sysdyn.ui.trend.chart.JFreeChart">\r <graph />\r <this />\r </type>\r </target> \r \r <target interface="org.simantics.sysdyn.ui.trend.chart.IDataset">\r <type uri="http://www.simantics.org/JFreeChart-1.0/XYDataset"\r class="org.simantics.sysdyn.ui.trend.chart.XYDataset">\r <graph />\r <this />\r </type>\r <type uri="http://www.simantics.org/JFreeChart-1.0/CategoryDataset"\r class="org.simantics.sysdyn.ui.trend.chart.CategoryDataset">\r <graph />\r <this />\r </type> \r <type uri="http://www.simantics.org/JFreeChart-1.0/PieDataset"\r class="org.simantics.sysdyn.ui.trend.chart.PieDataset">\r <graph />\r <this />\r </type> \r </target>\r \r <target interface="org.simantics.sysdyn.ui.trend.chart.ITitle">\r <type uri="http://www.simantics.org/JFreeChart-1.0/TextTitle"\r class="org.simantics.sysdyn.ui.trend.chart.TextTitle">\r <graph />\r <this />\r </type>\r </target>\r \r <target interface="org.simantics.sysdyn.ui.trend.chart.IAxis">\r <type uri="http://www.simantics.org/JFreeChart-1.0/NumberAxis"\r class="org.simantics.sysdyn.ui.trend.chart.NumberAxis">\r <graph />\r <this />\r </type>\r <type uri="http://www.simantics.org/JFreeChart-1.0/CategoryAxis"\r class="org.simantics.sysdyn.ui.trend.chart.CategoryAxis">\r <graph />\r <this />\r </type> \r </target>\r \r <target interface="org.simantics.sysdyn.ui.trend.chart.IPlot">\r <type uri="http://www.simantics.org/JFreeChart-1.0/XYPlot"\r class="org.simantics.sysdyn.ui.trend.chart.XYPlot">\r <graph />\r <this />\r </type>\r <type uri="http://www.simantics.org/JFreeChart-1.0/CategoryPlot"\r class="org.simantics.sysdyn.ui.trend.chart.CategoryPlot">\r <graph />\r <this />\r </type> \r <type uri="http://www.simantics.org/JFreeChart-1.0/PiePlot"\r class="org.simantics.sysdyn.ui.trend.chart.PiePlot">\r <graph />\r <this />\r </type> \r </target>\r \r <target interface="org.simantics.sysdyn.ui.trend.chart.IRenderer">\r \r <type uri="http://www.simantics.org/JFreeChart-1.0/XYLineRenderer"\r class="org.simantics.sysdyn.ui.trend.chart.XYLineRenderer">\r <graph />\r <this />\r </type> \r <type uri="http://www.simantics.org/JFreeChart-1.0/XYAreaRenderer"\r class="org.simantics.sysdyn.ui.trend.chart.XYAreaRenderer">\r <graph />\r <this />\r </type> \r \r <type uri="http://www.simantics.org/JFreeChart-1.0/BarRenderer"\r class="org.simantics.sysdyn.ui.trend.chart.BarRenderer">\r <graph />\r <this />\r </type>\r <type uri="http://www.simantics.org/JFreeChart-1.0/StackedBarRenderer"\r class="org.simantics.sysdyn.ui.trend.chart.StackedBarRenderer">\r <graph />\r <this />\r </type> \r </target> \r \r
+<adapters>\r\r <target interface="org.simantics.db.layer0.adapter.Realization">\r <type uri="http://www.simantics.org/Sysdyn-0.0/Module"\r class="org.simantics.structural2.realization.StructuralRealization">\r <this />\r </type>\r </target>\r\r <target interface="org.simantics.layer0.utils.triggers.ITrigger">\r <type uri = "http://www.simantics.org/Sysdyn-0.0/DiagramToCompositeMapping"\r class = "org.simantics.sysdyn.ui.editor.DiagramToCompositeMapping3">\r <graph/>\r <this />\r </type>\r </target>\r \r <target interface="org.simantics.structural.ui.modelBrowser.nodes.AbstractNode">\r <type uri="http://www.simantics.org/Sysdyn-0.0/SysdynModel"\r class="org.simantics.structural.ui.modelBrowser.nodes.ModelNode">\r <this />\r </type>\r </target> \r \r\r <target\r interface="org.simantics.browsing.ui.common.node.AbstractNode">\r <type\r uri="http://www.simantics.org/Sysdyn-0.0/SysdynModel"\r class="org.simantics.sysdyn.ui.browser.nodes.ModelNode">\r <this />\r </type>\r\r <resource\r uri="http://www.simantics.org/Sysdyn-0.0/ModuleSymbol"\r class="org.simantics.sysdyn.ui.browser.nodes.SymbolNode">\r <this />\r </resource>\r\r <type\r uri="http://www.simantics.org/Simulation-1.0/Experiment"\r class="org.simantics.sysdyn.ui.browser.nodes.ExperimentNode">\r <this />\r </type>\r \r <type\r uri="http://www.simantics.org/Sysdyn-0.0/Result"\r class="org.simantics.sysdyn.ui.browser.nodes.SimulationResultNode">\r <this />\r </type>\r \r </target>\r\r <!-- Inject default connection routing algorithm for sysdyn diagrams -->\r <target interface="org.simantics.g2d.diagram.DiagramClass">\r <adapter uri="http://www.simantics.org/Sysdyn-0.0/ConfigurationDiagram"\r adapterClass="org.simantics.sysdyn.ui.elements2.ConfigurationDiagramClassAdapter" />\r </target>\r\r <!-- Sysdyn symbols -->\r <target interface="org.simantics.diagram.adapter.ElementFactory">\r <resource uri="http://www.simantics.org/Sysdyn-0.0/StockSymbol"\r class="org.simantics.sysdyn.ui.elements2.StockFactory" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ModuleSymbol"\r class="org.simantics.sysdyn.ui.elements2.ModuleFactory" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ValveSymbol"\r class="org.simantics.sysdyn.ui.elements2.ValveFactory" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/AuxiliarySymbol"\r class="org.simantics.sysdyn.ui.elements2.AuxiliaryFactory" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/CloudSymbol"\r class="org.simantics.sysdyn.ui.elements2.CloudFactory" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/InputSymbol"\r class="org.simantics.sysdyn.ui.elements2.InputFactory" />\r\r <type uri="http://www.simantics.org/Sysdyn-0.0/StockSymbol"\r class="org.simantics.sysdyn.ui.elements2.StockFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/ModuleSymbol"\r class="org.simantics.sysdyn.ui.elements2.ModuleFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/ValveSymbol"\r class="org.simantics.sysdyn.ui.elements2.ValveFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/AuxiliarySymbol"\r class="org.simantics.sysdyn.ui.elements2.AuxiliaryFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/CloudSymbol"\r class="org.simantics.sysdyn.ui.elements2.CloudFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/InputSymbol"\r class="org.simantics.sysdyn.ui.elements2.InputFactory" /> \r </target>\r \r <!-- Sysdyn connections -->\r <target interface="org.simantics.diagram.adapter.ElementFactory">\r <!-- Edges --> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/FlowConnection"\r class="org.simantics.sysdyn.ui.elements2.connections.RouteFlowEdgeFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/FlowConnection"\r class="org.simantics.sysdyn.ui.elements2.connections.RouteFlowEdgeFactory" /> \r <type uri="http://www.simantics.org/Sysdyn-0.0/FlowConnection"\r class="org.simantics.sysdyn.ui.elements2.connections.RouteFlowConnectionFactory">\r <graph/>\r </type> \r \r <resource uri="http://www.simantics.org/Sysdyn-0.0/DependencyConnection"\r class="org.simantics.sysdyn.ui.elements2.connections.DependencyEdgeFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/DependencyConnection"\r class="org.simantics.sysdyn.ui.elements2.connections.DependencyEdgeFactory" />\r <type uri="http://www.simantics.org/Sysdyn-0.0/DependencyConnection"\r class="org.simantics.sysdyn.ui.elements2.connections.DependencyConnectionFactory" />\r </target>\r \r <target interface="org.simantics.g2d.connection.EdgeVisualsConfigurer">\r <baseType uri="http://www.simantics.org/Diagram-0.0/HasConnector" />\r <resource uri="http://www.simantics.org/Diagram-0.0/HasPlainConnector"\r class="org.simantics.diagram.content.ArrowConfigurer">\r <string>none 0</string>\r </resource>\r <resource uri="http://www.simantics.org/Diagram-0.0/HasArrowConnector"\r class="org.simantics.diagram.content.ArrowConfigurer">\r <string>fill 1</string>\r </resource>\r </target>\r \r <!-- ModelBrowser2 -->\r \r <target interface="org.simantics.browsing.ui.model.children.ChildRule">\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ProjectBrowseContext/ModuleTypeChildRule"\r class="org.simantics.sysdyn.ui.browser.childrules.ModuleTypeChildRule"/>\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ProjectBrowseContext/ModuleContentChildRule"\r class="org.simantics.sysdyn.ui.browser.childrules.ModuleContentChildRule"/> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/ChartAxisAndVariablesBrowseContext/AxisChildRule"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.AxisChildRule"/> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/ChartAxisAndVariablesBrowseContext/VariableChildRule"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.VariableChildRule"/> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/BarSeriesBrowseContext/SeriesChildRule"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesChildRule"/> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/PieSeriesBrowseContext/SeriesChildRule"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesChildRule"/> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/HistoryDataset/HistoryDatasetVariablesBrowseContext/VariableChildRule"\r class="org.simantics.sysdyn.ui.properties.widgets.historyDataset.VariableChildRule"/> \r <resource uri=" http://www.simantics.org/Sysdyn-1.1/Module/ParameterOverrideBrowseContext/ParameterChildRule"\r class="org.simantics.sysdyn.ui.properties.widgets.modules.ParameterChildRule"/> \r </target>\r \r <target interface="org.simantics.browsing.ui.model.visuals.VisualsRule">\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ProjectBrowseContext/ModuleTypeLabelRule"\r class="org.simantics.sysdyn.ui.browser.labelrules.ModuleTypeLabelRule"/>\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ChartAxisAndVariablesBrowseContext/SeriesLabelRule"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesLabelRule"/> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/ChartAxisAndVariablesBrowseContext/AxisLabelRule"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.AxisLabelRule"/> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/BarSeriesBrowseContext/SeriesLabelRule"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesLabelRule"/> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/PieSeriesBrowseContext/SeriesLabelRule"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesLabelRule"/> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/HistoryDataset/HistoryDatasetVariablesBrowseContext/VariableLabelRule"\r class="org.simantics.sysdyn.ui.properties.widgets.historyDataset.VariableLabelRule"/> \r \r \r <resource uri="http://www.simantics.org/Sysdyn-0.0/ChartAxisAndVariablesBrowseContext/SeriesLabelDecorationRule"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesLabelDecorationRule"/> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/BarSeriesBrowseContext/SeriesLabelDecorationRule"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesLabelDecorationRule"/> \r <resource uri="http://www.simantics.org/Sysdyn-0.0/PieSeriesBrowseContext/SeriesLabelDecorationRule"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesLabelDecorationRule"/> \r \r <resource uri=" http://www.simantics.org/Sysdyn-1.1/Module/ParameterOverrideBrowseContext/ParameterLabelRule"\r class="org.simantics.sysdyn.ui.properties.widgets.modules.ParameterLabelRule"/> \r <resource uri=" http://www.simantics.org/Sysdyn-1.1/Module/ParameterOverrideBrowseContext/ParameterLabelDecorationRule"\r class="org.simantics.sysdyn.ui.properties.widgets.modules.ParameterLabelDecorationRule"/> \r <resource uri=" http://www.simantics.org/Sysdyn-1.1/Module/ParameterOverrideBrowseContext/ParameterModifierRule"\r class="org.simantics.sysdyn.ui.properties.widgets.modules.ParameterModifierRule"/> \r </target> \r \r <target interface="org.simantics.db.layer0.adapter.ActionFactory">\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ProjectActionContext/Actions/NewModuleType"\r class="org.simantics.sysdyn.ui.browser.actions.NewModuleTypeAction" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ProjectActionContext/Actions/NewEnumeration"\r class="org.simantics.sysdyn.ui.browser.actions.NewEnumerationAction" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ProjectActionContext/Actions/OpenWorkbook"\r class="org.simantics.sysdyn.ui.browser.actions.OpenWorkbookAction" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ProjectActionContext/Actions/NewFunction"\r class="org.simantics.sysdyn.ui.browser.actions.NewFunctionAction" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ProjectActionContext/Actions/NewFunctionLibrary"\r class="org.simantics.sysdyn.ui.browser.actions.NewFunctionLibraryAction" />\r <resource uri="http://www.simantics.org/Sysdyn-0.0/ProjectActionContext/Actions/NewSharedFunctionLibrary"\r class="org.simantics.sysdyn.ui.browser.actions.NewSharedFunctionLibraryAction" /> \r </target> \r \r <target interface="org.simantics.db.layer0.adapter.DropActionFactory">\r <resource\r uri="http://www.simantics.org/Sysdyn-0.0/ChartAxisAndVariablesActionContext/Actions/SeriesDropAction"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesDropAction" />\r <resource\r uri="http://www.simantics.org/Sysdyn-0.0/ChartAxisAndVariablesActionContext/Actions/AxisDropAction"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.AxisDropAction" /> \r \r <resource\r uri="http://www.simantics.org/Sysdyn-0.0/BarSeriesActionContext/Actions/SeriesDropAction"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesDropAction" />\r <resource\r uri="http://www.simantics.org/Sysdyn-0.0/PieSeriesActionContext/Actions/SeriesDropAction"\r class="org.simantics.sysdyn.ui.trend.chart.graphexplorer.SeriesDropAction" /> \r </target> \r \r <!-- PROFILES -->\r <target interface="org.simantics.scenegraph.profile.Style">\r <resource uri="http://www.simantics.org/Sysdyn-0.0/SimulationPlaybackStyle"\r class="org.simantics.sysdyn.ui.elements2.profiles.SimulationPlaybackStyle">\r </resource>\r <resource uri="http://www.simantics.org/Sysdyn-0.0/IssueStyle"\r class="org.simantics.sysdyn.ui.elements2.profiles.IssueDecorationStyle">\r </resource>\r </target>\r \r <!-- Charts -->\r <target interface="org.simantics.diagram.adapter.ElementFactory">\r <resource uri="http://www.simantics.org/JFreeChart-1.0/ChartElement"\r class="org.simantics.sysdyn.ui.trend.chart.element.ChartElementFactory" />\r \r <type uri="http://www.simantics.org/JFreeChart-1.0/ChartElement"\r class="org.simantics.sysdyn.ui.trend.chart.element.ChartElementFactory" />\r </target>\r \r <target interface="org.simantics.diagram.synchronization.graph.ElementWriter">\r <resource uri="http://www.simantics.org/JFreeChart-1.0/ChartElement"\r class="org.simantics.sysdyn.ui.trend.chart.element.ChartElementWriter" />\r </target>\r \r <target interface="org.simantics.sysdyn.ui.trend.chart.IJFreeChart">\r <type uri="http://www.simantics.org/JFreeChart-1.0/Chart"\r class="org.simantics.sysdyn.ui.trend.chart.JFreeChart">\r <graph />\r <this />\r </type>\r </target> \r \r <target interface="org.simantics.sysdyn.ui.trend.chart.IDataset">\r <type uri="http://www.simantics.org/JFreeChart-1.0/XYDataset"\r class="org.simantics.sysdyn.ui.trend.chart.XYDataset">\r <graph />\r <this />\r </type>\r <type uri="http://www.simantics.org/JFreeChart-1.0/CategoryDataset"\r class="org.simantics.sysdyn.ui.trend.chart.CategoryDataset">\r <graph />\r <this />\r </type> \r <type uri="http://www.simantics.org/JFreeChart-1.0/PieDataset"\r class="org.simantics.sysdyn.ui.trend.chart.PieDataset">\r <graph />\r <this />\r </type> \r </target>\r \r <target interface="org.simantics.sysdyn.ui.trend.chart.ITitle">\r <type uri="http://www.simantics.org/JFreeChart-1.0/TextTitle"\r class="org.simantics.sysdyn.ui.trend.chart.TextTitle">\r <graph />\r <this />\r </type>\r </target>\r \r <target interface="org.simantics.sysdyn.ui.trend.chart.IAxis">\r <type uri="http://www.simantics.org/JFreeChart-1.0/NumberAxis"\r class="org.simantics.sysdyn.ui.trend.chart.NumberAxis">\r <graph />\r <this />\r </type>\r <type uri="http://www.simantics.org/JFreeChart-1.0/CategoryAxis"\r class="org.simantics.sysdyn.ui.trend.chart.CategoryAxis">\r <graph />\r <this />\r </type> \r </target>\r \r <target interface="org.simantics.sysdyn.ui.trend.chart.IPlot">\r <type uri="http://www.simantics.org/JFreeChart-1.0/XYPlot"\r class="org.simantics.sysdyn.ui.trend.chart.XYPlot">\r <graph />\r <this />\r </type>\r <type uri="http://www.simantics.org/JFreeChart-1.0/CategoryPlot"\r class="org.simantics.sysdyn.ui.trend.chart.CategoryPlot">\r <graph />\r <this />\r </type> \r <type uri="http://www.simantics.org/JFreeChart-1.0/PiePlot"\r class="org.simantics.sysdyn.ui.trend.chart.PiePlot">\r <graph />\r <this />\r </type> \r </target>\r \r <target interface="org.simantics.sysdyn.ui.trend.chart.IRenderer">\r \r <type uri="http://www.simantics.org/JFreeChart-1.0/XYLineRenderer"\r class="org.simantics.sysdyn.ui.trend.chart.XYLineRenderer">\r <graph />\r <this />\r </type> \r <type uri="http://www.simantics.org/JFreeChart-1.0/XYAreaRenderer"\r class="org.simantics.sysdyn.ui.trend.chart.XYAreaRenderer">\r <graph />\r <this />\r </type> \r \r <type uri="http://www.simantics.org/JFreeChart-1.0/BarRenderer"\r class="org.simantics.sysdyn.ui.trend.chart.BarRenderer">\r <graph />\r <this />\r </type>\r <type uri="http://www.simantics.org/JFreeChart-1.0/StackedBarRenderer"\r class="org.simantics.sysdyn.ui.trend.chart.StackedBarRenderer">\r <graph />\r <this />\r </type> \r </target> \r \r
</adapters>
\ No newline at end of file
/*******************************************************************************\r
- * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Copyright (c) 2010, 2012 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
import org.simantics.layer0.Layer0;\r
import org.simantics.structural.stubs.StructuralResource2;\r
import org.simantics.sysdyn.SysdynResource;\r
-import org.simantics.sysdyn.ui.properties.widgets.ModuleInputEditingSupport;\r
-import org.simantics.sysdyn.ui.properties.widgets.ReferenceRow;\r
-import org.simantics.sysdyn.ui.properties.widgets.ReferenceRowLabelProvider;\r
-import org.simantics.sysdyn.ui.properties.widgets.ReferenceTable;\r
-import org.simantics.sysdyn.ui.properties.widgets.RowProvider;\r
+import org.simantics.sysdyn.ui.properties.widgets.modules.ModuleInputEditingSupport;\r
+import org.simantics.sysdyn.ui.properties.widgets.modules.ReferenceRow;\r
+import org.simantics.sysdyn.ui.properties.widgets.modules.ReferenceRowLabelProvider;\r
+import org.simantics.sysdyn.ui.properties.widgets.modules.ReferenceTable;\r
+import org.simantics.sysdyn.ui.properties.widgets.modules.RowProvider;\r
\r
public class ModuleInputTab extends LabelPropertyTabContributor {\r
\r
/*******************************************************************************\r
- * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Copyright (c) 2010, 2012 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
import org.simantics.layer0.Layer0;\r
import org.simantics.structural.stubs.StructuralResource2;\r
import org.simantics.sysdyn.SysdynResource;\r
-import org.simantics.sysdyn.ui.properties.widgets.ModuleOutputEditingSupport;\r
-import org.simantics.sysdyn.ui.properties.widgets.ReferenceRow;\r
-import org.simantics.sysdyn.ui.properties.widgets.ReferenceRowLabelProvider;\r
-import org.simantics.sysdyn.ui.properties.widgets.ReferenceTable;\r
-import org.simantics.sysdyn.ui.properties.widgets.RowProvider;\r
+import org.simantics.sysdyn.ui.properties.widgets.modules.ModuleOutputEditingSupport;\r
+import org.simantics.sysdyn.ui.properties.widgets.modules.ReferenceRow;\r
+import org.simantics.sysdyn.ui.properties.widgets.modules.ReferenceRowLabelProvider;\r
+import org.simantics.sysdyn.ui.properties.widgets.modules.ReferenceTable;\r
+import org.simantics.sysdyn.ui.properties.widgets.modules.RowProvider;\r
\r
public class ModuleOutputTab extends LabelPropertyTabContributor {\r
\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012 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.properties;\r
+\r
+import org.eclipse.jface.layout.GridDataFactory;\r
+import org.eclipse.jface.layout.GridLayoutFactory;\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.swt.widgets.Control;\r
+import org.eclipse.swt.widgets.Tree;\r
+import org.eclipse.ui.IWorkbenchSite;\r
+import org.simantics.browsing.ui.swt.SingleSelectionInputSource;\r
+import org.simantics.browsing.ui.swt.widgets.GraphExplorerComposite;\r
+import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.management.ISessionContext;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.ui.properties.widgets.ColumnKeys;\r
+import org.simantics.utils.datastructures.ArrayMap;\r
+\r
+public class ModuleParameterTab extends LabelPropertyTabContributor {\r
+\r
+ GraphExplorerComposite explorer;\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).applyTo(composite);\r
+ \r
+ explorer = new GraphExplorerComposite(ArrayMap.keys(\r
+ "displaySelectors", "displayFilter").values(false, false), site, composite, support, SWT.FULL_SELECTION | SWT.BORDER);\r
+ \r
+ explorer.setBrowseContexts(SysdynResource.URIs.Module_ParameterOverrideBrowseContext);\r
+ explorer.setColumns(ColumnKeys.MODULE_PARAMETER_COLUMNS);\r
+ explorer.setInputSource(new SingleSelectionInputSource(\r
+ Resource.class));\r
+\r
+ explorer.finish();\r
+\r
+ GridDataFactory.fillDefaults().grab(true, true).applyTo(\r
+ explorer);\r
+ \r
+ Control c = explorer.getExplorerControl();\r
+ if (c instanceof Tree)\r
+ ((Tree) c).setLinesVisible(true);\r
+ }\r
+}\r
if (backend.isInstanceOf(r, sr.Module)){\r
tabs.add(new ComparableTabContributor(\r
new ModuleTab(),\r
- 3,\r
+ 10,\r
r,\r
"Module Properties"));\r
+ tabs.add(new ComparableTabContributor(\r
+ new ModuleParameterTab(),\r
+ 9,\r
+ r,\r
+ "Parameters"));\r
tabs.add(new ComparableTabContributor(\r
new ModuleInputTab(),\r
2,\r
/*******************************************************************************\r
- * Copyright (c) 2007, 2011 Association for Decentralized Information Management in\r
+ * Copyright (c) 2007, 2012 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
\r
public class ColumnKeys {\r
\r
- public static final String ENUMERATION = "Enumeration";\r
- public static final String INDEXES = "Indexes";\r
- public static final String SHOW_IN_CHARTS = "ShowInCharts";\r
- public static final String REPLACED_WITH = "Replaced with";\r
+ public static final String ENUMERATION = "Enumeration";\r
+ public static final String INDEXES = "Indexes";\r
+ public static final String SHOW_IN_CHARTS = "ShowInCharts";\r
+ public static final String REPLACED_WITH = "Replaced with";\r
+ public static final String MODULE_PARAMETER = "Parameter in Module";\r
+ public static final String VALUE = "Value";\r
\r
public static String[] ENUMERATION_COLUMNS_KEYS = { ENUMERATION, INDEXES };\r
public static Column[] ENUMERATION_TABLE_COLUMNS = new Column[] {\r
new Column(REPLACED_WITH, Align.LEFT, 200, "Replaced with", true),\r
};\r
\r
+ public static String[] MODULE_PARAMETER_KEYS = { MODULE_PARAMETER, VALUE };\r
+ public static Column[] MODULE_PARAMETER_COLUMNS = new Column[] {\r
+ new Column(MODULE_PARAMETER, Align.LEFT, 200, MODULE_PARAMETER, false),\r
+ new Column(VALUE, Align.LEFT, 200, VALUE, true),\r
+ };\r
+ \r
}\r
/*******************************************************************************\r
- * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Copyright (c) 2010, 2012 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
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package org.simantics.sysdyn.ui.properties.widgets;\r
+package org.simantics.sysdyn.ui.properties.widgets.modules;\r
\r
import java.util.HashMap;\r
\r
/*******************************************************************************\r
- * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Copyright (c) 2010, 2012 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
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package org.simantics.sysdyn.ui.properties.widgets;\r
+package org.simantics.sysdyn.ui.properties.widgets.modules;\r
\r
import java.util.HashMap;\r
\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012 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.properties.widgets.modules;\r
+\r
+import java.util.List;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.common.request.ObjectsWithType;\r
+import org.simantics.db.common.utils.OrderedSetUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+/**\r
+ * Utilities for module parameter override functionalities\r
+ * \r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+public class ModuleParameterOverrideUtils {\r
+\r
+ /**\r
+ * Get the parameter expression of a variable or null, if it does not contain a parameter expression,\r
+ * or there are many parameter expressions\r
+ * @param graph ReadGraph\r
+ * @param variable Resource of a variable\r
+ * @return parameter expression or null\r
+ * @throws DatabaseException\r
+ */\r
+ public static String getParameterExpression(ReadGraph graph, Resource variable) throws DatabaseException {\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ \r
+ String result = null;\r
+ Resource expressionsResource = graph.getPossibleObject(variable, sr.Variable_expressions);\r
+ if(expressionsResource != null) {\r
+ List<Resource> expressions = OrderedSetUtils.toList(graph, expressionsResource);\r
+ if(expressions.size() == 1 && graph.isInstanceOf(expressions.get(0), sr.ParameterExpression)) {\r
+ result = graph.getPossibleRelatedValue(expressions.get(0), sr.Expression_equation);\r
+ }\r
+ }\r
+ return result;\r
+ }\r
+ \r
+ /**\r
+ * Get the expression, or the overriding expression, of a parameter\r
+ * @param graph ReadGraph\r
+ * @param parent Parent resource\r
+ * @param variable Variable resource\r
+ * @return Overriding expression, or the default parameter expression, or null\r
+ * @throws DatabaseException\r
+ */\r
+ public static String getParameterExpressionOrOverride(ReadGraph graph, Resource parent, Resource variable)\r
+ throws DatabaseException {\r
+ String result = null;\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+\r
+ // Get possible override\r
+ for(Resource r : graph.syncRequest(new ObjectsWithType(parent, L0.ConsistsOf, sr.Module_ParameterOverride))) {\r
+ if(variable.equals(graph.getPossibleObject(r, sr.Module_ParameterOverride_overriddenParameter))) {\r
+ result = graph.getPossibleRelatedValue(r, sr.Module_ParameterOverride_overrideExpression);\r
+ }\r
+ }\r
+ \r
+ if(result == null) {\r
+ // Parameter is not overridden, find the actual expression\r
+ result = getParameterExpression(graph, variable);\r
+ }\r
+ return result;\r
+ }\r
+ \r
+ /**\r
+ * Find out if a variable has a single parameter expression \r
+ * @param graph ReadGraph\r
+ * @param variable Variable\r
+ * @return does the variable have a single parameter expression\r
+ * @throws DatabaseException\r
+ */\r
+ public static boolean hasParameterExpression(ReadGraph graph, Resource variable) throws DatabaseException {\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ boolean result = false;\r
+ Resource expressionsResource = graph.getPossibleObject(variable, sr.Variable_expressions);\r
+ if(expressionsResource != null) {\r
+ List<Resource> expressions = OrderedSetUtils.toList(graph, expressionsResource);\r
+ if(expressions.size() == 1 && graph.isInstanceOf(expressions.get(0), sr.ParameterExpression)) {\r
+ result = true;\r
+ }\r
+ }\r
+ return result;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012 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.properties.widgets.modules;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Collection;\r
+\r
+import org.simantics.browsing.ui.model.children.ChildRule;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.common.request.ObjectsWithType;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.structural.stubs.StructuralResource2;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+public class ParameterChildRule implements ChildRule {\r
+\r
+ @Override\r
+ public boolean isCompatible(Class<?> contentType) {\r
+ return contentType.equals(Resource.class);\r
+ }\r
+\r
+ @Override\r
+ public Collection<?> getChildren(ReadGraph graph, Object parent) throws DatabaseException {\r
+ ArrayList<ParameterNode> result = new ArrayList<ParameterNode>();\r
+ if(!(parent instanceof Resource))\r
+ return result;\r
+ \r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+ StructuralResource2 STR = StructuralResource2.getInstance(graph);\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ \r
+ Resource moduleInstance = (Resource) parent;\r
+ \r
+ Resource type = graph.getSingleObject(moduleInstance, L0.InstanceOf);\r
+ Resource configuration = graph.getSingleObject(type, STR.IsDefinedBy);\r
+ \r
+ for(Resource variable : graph.syncRequest(new ObjectsWithType(configuration, L0.ConsistsOf, sr.IndependentVariable))) {\r
+ if(ModuleParameterOverrideUtils.hasParameterExpression(graph, variable))\r
+ result.add(new ParameterNode(moduleInstance, variable));\r
+ }\r
+ \r
+ return result;\r
+\r
+\r
+ }\r
+\r
+ @Override\r
+ public Collection<?> getParents(ReadGraph graph, Object child) throws DatabaseException {\r
+ return new ArrayList<Resource>();\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.ui.properties.widgets.modules;\r
+\r
+import org.eclipse.jface.resource.ColorDescriptor;\r
+import org.eclipse.swt.graphics.RGB;\r
+import org.simantics.browsing.ui.content.LabelDecorator;\r
+import org.simantics.browsing.ui.model.labeldecorators.LabelDecorationRule;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.sysdyn.ui.properties.widgets.ColumnKeys;\r
+\r
+public class ParameterLabelDecorationRule implements LabelDecorationRule {\r
+\r
+ @Override\r
+ public boolean isCompatible(Class<?> contentType) {\r
+ return contentType.equals(Object.class);\r
+ }\r
+\r
+ @Override\r
+ public LabelDecorator getLabelDecorator(ReadGraph graph, Object content) throws DatabaseException {\r
+ if(content instanceof ParameterNode) {\r
+ ParameterNode node = (ParameterNode) content;\r
+ String notOverriding = ModuleParameterOverrideUtils.getParameterExpression(graph, node.getVariable());\r
+ String overriding = ModuleParameterOverrideUtils.getParameterExpressionOrOverride(graph, node.getParent(), node.getVariable());\r
+\r
+ if(notOverriding == null)\r
+ return null;\r
+\r
+ final boolean original = notOverriding.equals(overriding);\r
+\r
+ return new LabelDecorator.Stub() {\r
+ @Override\r
+ public String decorateLabel(String label, String column, int itemIndex) {\r
+ if(ColumnKeys.VALUE.equals(column)) {\r
+ return original ? label : label + " [Overridden]";\r
+ } else {\r
+ return label;\r
+ }\r
+ }\r
+\r
+ @SuppressWarnings("unchecked")\r
+ @Override\r
+ public <Color> Color decorateForeground(Color color, String column, int itemIndex) {\r
+ Color result = null;\r
+ if(ColumnKeys.VALUE.equals(column)) {\r
+ if(original)\r
+ result = (Color) ColorDescriptor.createFrom(new RGB(125,125,125));\r
+ else\r
+ result = (Color) ColorDescriptor.createFrom(new RGB(0,0,0));\r
+ }\r
+ return result;\r
+ }\r
+ };\r
+ }\r
+ return null;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012 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.properties.widgets.modules;\r
+\r
+import java.util.HashMap;\r
+import java.util.Map;\r
+\r
+import org.simantics.browsing.ui.model.labels.LabelRule;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.common.utils.NameUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.sysdyn.ui.properties.widgets.ColumnKeys;\r
+\r
+public class ParameterLabelRule implements LabelRule {\r
+\r
+ @Override\r
+ public boolean isCompatible(Class<?> contentType) {\r
+ return contentType.equals(Object.class);\r
+ }\r
+\r
+ @Override\r
+ public Map<String, String> getLabel(ReadGraph graph, Object content) throws DatabaseException {\r
+ Map<String, String> result = new HashMap<String, String>();\r
+\r
+ if(content instanceof ParameterNode) {\r
+ ParameterNode node = (ParameterNode) content;\r
+ String parameterExpression = ModuleParameterOverrideUtils.getParameterExpressionOrOverride(graph, node.getParent(), node.getVariable());\r
+ String name = NameUtils.getSafeName(graph, node.getVariable());\r
+\r
+ result.put(ColumnKeys.MODULE_PARAMETER, name);\r
+ result.put(ColumnKeys.VALUE, parameterExpression);\r
+ }\r
+ return result;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012 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.properties.widgets.modules;\r
+\r
+import org.simantics.browsing.ui.content.Labeler.Modifier;\r
+import org.simantics.browsing.ui.model.modifiers.ModifierRule;\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.ObjectsWithType;\r
+import org.simantics.db.common.request.WriteRequest;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.util.RemoverUtil;\r
+import org.simantics.db.request.Read;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.layer0.utils.direct.GraphUtils;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.ui.properties.widgets.ColumnKeys;\r
+import org.simantics.ui.SimanticsUI;\r
+\r
+public class ParameterModifierRule implements ModifierRule {\r
+\r
+ @Override\r
+ public boolean isCompatible(Class<?> contentType) {\r
+ return contentType.equals(Object.class);\r
+ }\r
+\r
+ @Override\r
+ public Modifier getModifier(ReadGraph graph, Object content, String columnKey) throws DatabaseException {\r
+ if(content instanceof ParameterNode && ColumnKeys.VALUE.equals(columnKey)) {\r
+ final ParameterNode node = (ParameterNode) content;\r
+ return new Modifier() {\r
+\r
+ @Override\r
+ public String getValue() {\r
+ Read<String> request =\r
+ new Read<String>() {\r
+\r
+ @Override\r
+ public String perform(ReadGraph graph) throws DatabaseException {\r
+ String parameterExpression = ModuleParameterOverrideUtils.getParameterExpressionOrOverride(\r
+ graph, \r
+ node.getParent(), \r
+ node.getVariable());\r
+\r
+ return parameterExpression != null ? parameterExpression : "";\r
+ }\r
+\r
+ };\r
+ try {\r
+ return SimanticsUI.getSession().syncRequest(request);\r
+ } catch (DatabaseException e) {\r
+ e.printStackTrace();\r
+ return "";\r
+ }\r
+ }\r
+\r
+ @Override\r
+ public String isValid(String label) {\r
+ if(label.isEmpty())\r
+ return null;\r
+ \r
+ try {\r
+ Double.parseDouble(label);\r
+ } catch (NumberFormatException e) {\r
+ return "Not valid";\r
+ }\r
+ return null;\r
+ }\r
+\r
+ @Override\r
+ public void modify(final String label) {\r
+ SimanticsUI.getSession().asyncRequest(new WriteRequest() {\r
+ @Override\r
+ public void perform(WriteGraph graph) throws DatabaseException {\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+\r
+ // Remove possible old override\r
+ for(Resource r : graph.syncRequest(new ObjectsWithType(node.getParent(), L0.ConsistsOf, sr.Module_ParameterOverride))) {\r
+ if(node.getVariable().equals(graph.getPossibleObject(r, sr.Module_ParameterOverride_overriddenParameter))) {\r
+ RemoverUtil.remove(graph, r);\r
+ break;\r
+ }\r
+ }\r
+\r
+ // Write the new override, if there is one\r
+ if(label != null && !label.isEmpty()) {\r
+ GraphUtils.create2(graph, sr.Module_ParameterOverride,\r
+ sr.Module_ParameterOverride_overriddenParameter, node.getVariable(),\r
+ sr.Module_ParameterOverride_overrideExpression, label,\r
+ L0.PartOf, node.getParent()\r
+ );\r
+ }\r
+ }\r
+ });\r
+ }\r
+\r
+ };\r
+ } else {\r
+ return null;\r
+ }\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.ui.properties.widgets.modules;\r
+\r
+import org.simantics.db.Resource;\r
+\r
+public class ParameterNode {\r
+ \r
+ private Resource moduleInstance;\r
+ private Resource variable;\r
+ \r
+ public ParameterNode(Resource parent, Resource variable) {\r
+ this.moduleInstance = parent;\r
+ this.variable = variable;\r
+ }\r
+\r
+ public Resource getParent() {\r
+ return moduleInstance;\r
+ }\r
+\r
+ public Resource getVariable() {\r
+ return variable;\r
+ }\r
+ \r
+ \r
+\r
+}\r
/*******************************************************************************\r
- * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Copyright (c) 2010, 2012 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
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package org.simantics.sysdyn.ui.properties.widgets;\r
+package org.simantics.sysdyn.ui.properties.widgets.modules;\r
\r
import org.simantics.databoard.Bindings;\r
import org.simantics.db.ReadGraph;\r
/*******************************************************************************\r
- * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Copyright (c) 2010, 2012 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
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package org.simantics.sysdyn.ui.properties.widgets;\r
+package org.simantics.sysdyn.ui.properties.widgets.modules;\r
\r
import org.eclipse.jface.viewers.ITableLabelProvider;\r
import org.eclipse.jface.viewers.LabelProvider;\r
/*******************************************************************************\r
- * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Copyright (c) 2010, 2012 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
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package org.simantics.sysdyn.ui.properties.widgets;\r
+package org.simantics.sysdyn.ui.properties.widgets.modules;\r
\r
import java.util.ArrayList;\r
import org.eclipse.jface.layout.GridDataFactory;\r
/*******************************************************************************\r
- * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Copyright (c) 2010, 2012 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
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package org.simantics.sysdyn.ui.properties.widgets;\r
+package org.simantics.sysdyn.ui.properties.widgets.modules;\r
\r
import java.util.ArrayList;\r
\r
import org.simantics.objmap.annotations.RelatedElements;\r
import org.simantics.objmap.annotations.RelatedValue;\r
import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.representation.expressions.IExpression;\r
+import org.simantics.sysdyn.representation.expressions.ParameterExpression;\r
import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid;\r
import org.simantics.utils.datastructures.Pair;\r
\r
@RelatedElements(SysdynResource.URIs.Module_redeclaration)\r
private List<Redeclaration> redeclarations;\r
\r
+ @RelatedElements(Layer0.URIs.ConsistsOf)\r
+ private List<Entity> consistsOf;\r
+ \r
@Override\r
public void accept(IElementVisitorVoid v) {\r
v.visit(this);\r
\r
String enumerationRedeclarations = getEnumerationRedeclarations();\r
Pair<String, String> inputRedeclarations = getInputRedeclarations();\r
+ String parameterOverrides = getParameterOverrides();\r
\r
StringBuilder redeclarations = new StringBuilder();\r
\r
- if(!enumerationRedeclarations.isEmpty() || !inputRedeclarations.first.isEmpty()) {\r
+ if(!enumerationRedeclarations.isEmpty() || !inputRedeclarations.first.isEmpty() || !parameterOverrides.isEmpty()) {\r
redeclarations.append("(");\r
redeclarations.append(enumerationRedeclarations);\r
\r
// remove first ", " if no enumeration redeclarations\r
ir = inputRedeclarations.first.substring(2); \r
redeclarations.append(ir);\r
+ \r
+ if(!parameterOverrides.isEmpty()) {\r
+ if(redeclarations.length() > 1)\r
+ redeclarations.append(", ");\r
+ redeclarations.append(parameterOverrides);\r
+ }\r
\r
redeclarations.append(")");\r
}\r
}\r
return redeclarations;\r
}\r
+ \r
+ \r
+ /**\r
+ * Get all parameter override elements for this module instance\r
+ * @return parameter overrides\r
+ */\r
+ public String getParameterOverrides() {\r
+ String result = "";\r
+ \r
+ if(consistsOf != null) {\r
+ for(Entity e : consistsOf) {\r
+ if(e instanceof ParameterOverride) {\r
+ ParameterOverride po = (ParameterOverride) e;\r
+ IndependentVariable var = po.getVariable();\r
+ if(var != null && var.getExpressions() != null) {\r
+ List<IExpression> expressions = var.getExpressions().getExpressions();\r
+ if(expressions.size() == 1 && expressions.get(0) instanceof ParameterExpression) {\r
+ if(!result.isEmpty())\r
+ result += ", ";\r
+ \r
+ result += po.getOverride();\r
+ }\r
+ }\r
+ \r
+ }\r
+ }\r
+ }\r
+ \r
+ return result;\r
+ }\r
\r
}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012 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.representation;\r
+\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.objmap.annotations.RelatedElement;\r
+import org.simantics.objmap.annotations.RelatedValue;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+\r
+/**\r
+ * Representation of a parameter override\r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+@GraphType(SysdynResource.URIs.Module_ParameterOverride)\r
+public class ParameterOverride extends Entity {\r
+ \r
+ @RelatedElement(SysdynResource.URIs.Module_ParameterOverride_overriddenParameter)\r
+ private IndependentVariable variable;\r
+ \r
+ @RelatedValue(SysdynResource.URIs.Module_ParameterOverride_overrideExpression)\r
+ private String expression;\r
+ \r
+ /**\r
+ * Get the parameter variable to be overridden\r
+ * @return parameter variable to be overridden\r
+ */\r
+ public IndependentVariable getVariable() {\r
+ return variable;\r
+ }\r
+ \r
+ /**\r
+ * Get the overriding expression\r
+ * @return overriding expression\r
+ */\r
+ public String getExpression() {\r
+ return expression;\r
+ }\r
+ \r
+ /**\r
+ * Get the complete override equation: "variable = overridingExpression"\r
+ * @return override equation\r
+ */\r
+ public String getOverride() {\r
+ return variable.getName() + " = " + expression;\r
+ }\r
+\r
+}\r
addLinkType(MappingSchemas.fromAnnotations(g, SharedFunctionLibrary.class));\r
addLinkType(MappingSchemas.fromAnnotations(g, Function.class));\r
addLinkType(MappingSchemas.fromAnnotations(g, Entity.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, ParameterOverride.class));\r
} catch (DatabaseException e) {\r
e.printStackTrace();\r
} catch (InstantiationException e) {\r