]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
First take on module instances with individual parameter values. Applicable only...
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Tue, 13 Mar 2012 13:54:58 +0000 (13:54 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Tue, 13 Mar 2012 13:54:58 +0000 (13:54 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@24419 ac1ea38d-2e2b-0410-8846-a27921b304fc

25 files changed:
org.simantics.sysdyn.ontology/graph.tg
org.simantics.sysdyn.ontology/graph/PropertyViewpoints.pgraph
org.simantics.sysdyn.ontology/graph/Sysdyn.pgraph
org.simantics.sysdyn.ontology/src/org/simantics/sysdyn/SysdynResource.java
org.simantics.sysdyn.ui/adapters.xml
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModuleInputTab.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModuleOutputTab.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModuleParameterTab.java [new file with mode: 0644]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ResourceSelectionProcessor.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ColumnKeys.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/ModuleInputEditingSupport.java [moved from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ModuleInputEditingSupport.java with 94% similarity]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/ModuleOutputEditingSupport.java [moved from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ModuleOutputEditingSupport.java with 95% similarity]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/ModuleParameterOverrideUtils.java [new file with mode: 0644]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/ParameterChildRule.java [new file with mode: 0644]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/ParameterLabelDecorationRule.java [new file with mode: 0644]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/ParameterLabelRule.java [new file with mode: 0644]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/ParameterModifierRule.java [new file with mode: 0644]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/ParameterNode.java [new file with mode: 0644]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/ReferenceRow.java [moved from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ReferenceRow.java with 94% similarity]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/ReferenceRowLabelProvider.java [moved from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ReferenceRowLabelProvider.java with 87% similarity]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/ReferenceTable.java [moved from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ReferenceTable.java with 94% similarity]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/RowProvider.java [moved from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/RowProvider.java with 83% similarity]
org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Module.java
org.simantics.sysdyn/src/org/simantics/sysdyn/representation/ParameterOverride.java [new file with mode: 0644]
org.simantics.sysdyn/src/org/simantics/sysdyn/representation/SysdynSchema.java

index bb8b1f48baca7664d8af54eb4ccbd1efac04087c..735898e4accae0457dc9856b34445ea5e5d38a3a 100644 (file)
Binary files a/org.simantics.sysdyn.ontology/graph.tg and b/org.simantics.sysdyn.ontology/graph.tg differ
index 3d939280c61d8e194c544af10bf3c6075a46ec5c..ca6fea3c841656499d3e8d3e265389499ecee78f 100644 (file)
@@ -2,6 +2,9 @@ L0 = <http://www.simantics.org/Layer0-1.0>
 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
@@ -22,3 +25,30 @@ HDBC
         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
index 99219f2aa064980eae908e8035ce80fa061aa0c0..74f88326d5b6e8b2a88b65bfdc06ec540592fd55 100644 (file)
@@ -141,6 +141,7 @@ SYSDYN.Enumeration <T SYSDYN.Variable
 
 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
@@ -151,6 +152,10 @@ SYSDYN.ModuleSymbol <T DIA.FontProvider <T DIA.ColorProvider
             _ : 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
 
index 7a12eda3d8c79b7d397688f335f02abb2d0495f4..ca03c02bcb39f86b70a49dc52d643d1592345903 100644 (file)
@@ -181,6 +181,19 @@ public class SysdynResource {
     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
@@ -497,6 +510,19 @@ public class SysdynResource {
         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
@@ -823,6 +849,19 @@ public class SysdynResource {
         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
index 6c3dcbee8620e51aa853ba8b5dadd67a8b9baaac..2155befd66f8c4f0897153ba32598f8ea7c93509 100644 (file)
@@ -10,5 +10,5 @@
         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
index 2ee0ac0f39399859317ce79ff55634367709d6db..b29c03573dd155fd8a0113ad9362e75c39532c86 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************\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
@@ -27,11 +27,11 @@ import org.simantics.db.management.ISessionContext;
 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
index 24e08266067ffa71cfc0675d44275596edb8c40d..47a114e7684f3ad3f8f180e7dd2ba516abb97310 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************\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
@@ -27,11 +27,11 @@ import org.simantics.db.management.ISessionContext;
 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
diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModuleParameterTab.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModuleParameterTab.java
new file mode 100644 (file)
index 0000000..4222066
--- /dev/null
@@ -0,0 +1,57 @@
+/*******************************************************************************\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
index 35f0299ff9004320b2a9121184e6e17e2a0da593..c01f4733f96de27348e7876e3c568e180e99b037 100644 (file)
@@ -212,9 +212,14 @@ public class ResourceSelectionProcessor implements SelectionProcessor<Object, Re
             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
index 06168d1998c6d3edf25bb0ea5b91feed5cc843dd..1a9dda4bc8c9fbfe938d67262ec030ebc7c14311 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************\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
@@ -16,10 +16,12 @@ import org.simantics.browsing.ui.Column.Align;
 \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
@@ -40,4 +42,10 @@ public class ColumnKeys {
         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
similarity index 94%
rename from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ModuleInputEditingSupport.java
rename to org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/ModuleInputEditingSupport.java
index 2491d6e2e271ca8ac84a9cc17026f1eeb0b57a18..66ba15a6cd1c47ff202ea5955824ad00828a390e 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************\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
@@ -9,7 +9,7 @@
  * 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
similarity index 95%
rename from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ModuleOutputEditingSupport.java
rename to org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/ModuleOutputEditingSupport.java
index 91d3c4871d577d955b9be1a7aaa8318c9bb9f0c9..30f17cfcefdefc83158a3cf714ad231a7c2093ea 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************\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
@@ -9,7 +9,7 @@
  * 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
diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/ModuleParameterOverrideUtils.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/ModuleParameterOverrideUtils.java
new file mode 100644 (file)
index 0000000..0990d03
--- /dev/null
@@ -0,0 +1,102 @@
+/*******************************************************************************\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
diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/ParameterChildRule.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/ParameterChildRule.java
new file mode 100644 (file)
index 0000000..263ffd3
--- /dev/null
@@ -0,0 +1,63 @@
+/*******************************************************************************\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
diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/ParameterLabelDecorationRule.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/ParameterLabelDecorationRule.java
new file mode 100644 (file)
index 0000000..c9f7f69
--- /dev/null
@@ -0,0 +1,57 @@
+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
diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/ParameterLabelRule.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/ParameterLabelRule.java
new file mode 100644 (file)
index 0000000..0b539ae
--- /dev/null
@@ -0,0 +1,45 @@
+/*******************************************************************************\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
diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/ParameterModifierRule.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/ParameterModifierRule.java
new file mode 100644 (file)
index 0000000..da19b2b
--- /dev/null
@@ -0,0 +1,114 @@
+/*******************************************************************************\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
diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/ParameterNode.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/ParameterNode.java
new file mode 100644 (file)
index 0000000..4c75940
--- /dev/null
@@ -0,0 +1,25 @@
+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
similarity index 94%
rename from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ReferenceRow.java
rename to org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/ReferenceRow.java
index 6bebab0ef3f65c803ea5acaabac2b6db8cbc79a2..0340048119ac1168652b124d0c00a7a27f2707be 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************\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
@@ -9,7 +9,7 @@
  * 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
similarity index 87%
rename from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ReferenceRowLabelProvider.java
rename to org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/ReferenceRowLabelProvider.java
index b44432a0f39b9b5c9ab17a392693097bc26a79b7..763e8411374a249693257145e94150a45e008eb9 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************\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
@@ -9,7 +9,7 @@
  * 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
similarity index 94%
rename from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ReferenceTable.java
rename to org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/ReferenceTable.java
index 29066345155db5d00269027dbd3edead00853611..aeb5dafdc8301e6bef83eead4a40693709491873 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************\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
@@ -9,7 +9,7 @@
  * 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
similarity index 83%
rename from org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/RowProvider.java
rename to org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/modules/RowProvider.java
index cd36f387957fac2192764108b5794ed18a6f8558..9b424d26b07cc31f38a9a672e8936d67f7b679ba 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************\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
@@ -9,7 +9,7 @@
  * 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
index 415fdc05d309a0dcf6613060eece6eadac26aa98..f4487ebf2b0df0e82ccb659df06572863054590d 100644 (file)
@@ -21,6 +21,8 @@ import org.simantics.objmap.annotations.RelatedElement;
 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
@@ -44,6 +46,9 @@ public class Module implements IElement {
     @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
@@ -77,10 +82,11 @@ public class Module implements IElement {
 \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
@@ -89,6 +95,12 @@ public class Module implements IElement {
                 // 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
@@ -202,5 +214,35 @@ public class Module implements IElement {
         }\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
diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/ParameterOverride.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/ParameterOverride.java
new file mode 100644 (file)
index 0000000..c9f1b2f
--- /dev/null
@@ -0,0 +1,58 @@
+/*******************************************************************************\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
index 0621f8304a3c51a2ada2de0c5661583e07eddd4b..5b8812b04ee134dd87dcaaf8a91d8e03159771fe 100644 (file)
@@ -60,6 +60,7 @@ public class SysdynSchema extends SimpleSchema {
             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