]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@21738 ac1ea38d-2e2b...
authorniemisto <niemisto@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Mon, 15 Aug 2011 12:48:20 +0000 (12:48 +0000)
committerniemisto <niemisto@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Mon, 15 Aug 2011 12:48:20 +0000 (12:48 +0000)
23 files changed:
org.simantics.sysdyn.ontology/graph.tg
org.simantics.sysdyn.ontology/graph/Sysdyn.pgraph
org.simantics.sysdyn.ontology/graph/WorkModel.pgraph
org.simantics.sysdyn.ontology/src/org/simantics/sysdyn/SysdynResource.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/actions/ConsumeUnnecessaryEntersAction.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/actions/NewModuleTypeAction.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/InputLabeler.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/Model.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/ModuleLabeler.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/VariableLabeler.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/OpenDiagramFromConfigurationAdapter.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynCreationInstruction.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynEditorInput.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/ImportModelHandler.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/NewModuleNodeHandler.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/project/DefaultRealizationVirtualGraph.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/project/DefaultVariable.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/project/SysdynProject.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/wizards/WizardModelsImportPage.java
org.simantics.sysdyn/src/org/simantics/sysdyn/adapter/ChildVariable.java
org.simantics.sysdyn/src/org/simantics/sysdyn/adapter/RunVariable.java
org.simantics.sysdyn/src/org/simantics/sysdyn/mdlImport/mdlElements/Model.java
org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Variable.java

index 50737066d533b6ca417e6051edf380abf017d515..f9a83dc7cdb6e5cbba3696e0f7c55b67a900823a 100644 (file)
Binary files a/org.simantics.sysdyn.ontology/graph.tg and b/org.simantics.sysdyn.ontology/graph.tg differ
index 7f8b35c652fe121f36b9ce812fc2c34f48ddc277..02064f748a326267580477738491912d7af591be 100644 (file)
@@ -1,4 +1,5 @@
 L0 = <http://www.simantics.org/Layer0-1.0>
+L0X = <http://www.simantics.org/Layer0X-1.0>
 G2D = <http://www.simantics.org/G2D-1.0>
 STR = <http://www.simantics.org/Structural-1.0>
 DIA = <http://www.simantics.org/Diagram-2.0>
@@ -57,7 +58,7 @@ SYSDYN.HasSolver <R L0.HasProperty : L0.FunctionalRelation
 SYSDYN.Symbols : L0.Library
 SYSDYN.SysdynConnectionType : STR.ConnectionType
 
-SYSDYN.DiagramToCompositeMapping <T L0.Trigger
+SYSDYN.DiagramToCompositeMapping <T L0X.Trigger
 
 SYSDYN.ConfigurationDiagram <T DIA.Diagram
     @L0.assert STR.HasModelingRules SYSDYN.SysdynDiagramModelingRules 
@@ -74,21 +75,24 @@ SYSDYN.SysdynDiagramModelingRules : MOD.MappedModelingRules
 SYSDYN.SymbolReferences : DIA.SymbolReferenceLibrary
 BasicSymbols = SYSDYN.SymbolReferences.BasicSymbols : DIA.SymbolReferenceLibrary
 
-SYSDYN.Configuration <T STR.Composite <T L0.Realization
+SYSDYN.Configuration <T STR.Composite <T L0X.Realization
     // TODO [L0.ConsistsOf all (Variable or Dependency or Module)]
 
-SYSDYN.HistoryRealization <T L0.Realization
-SYSDYN.DefaultRealization <T L0.Realization
+SYSDYN.HistoryRealization <T L0X.Realization
+SYSDYN.DefaultRealization <T L0X.Realization
 
 //#####################################################################
 // Variables
 //#####################################################################
 
 SYSDYN.Variable <T STR.Component    
-    @L0.singleProperty L0.HasType
+    @L0.singleProperty SYSDYN.Variable.Type
     @L0.optionalProperty SYSDYN.HasArrayIndexes    
     @L0.optionalProperty SYSDYN.HasExpressions    
     @L0.assert L0.HasDataType $Double
+SYSDYN.Variable.Type <R L0.HasProperty
+    L0.HasDomain SYSDYN.Variable
+    L0.HasRange L0.String    
 
 SYSDYN.HasExpressions <R L0.DependsOn : L0.FunctionalRelation
     L0.HasDomain SYSDYN.Variable
@@ -115,13 +119,13 @@ SYSDYN.IndependentVariable <T SYSDYN.Variable
     @L0.singleProperty SYSDYN.HasExpressions
 
 SYSDYN.Auxiliary <T SYSDYN.IndependentVariable
-    @L0.assert L0.HasType "Real"
+    @L0.assert SYSDYN.Variable.Type "Real"
 
 SYSDYN.Valve <T SYSDYN.IndependentVariable
-    @L0.assert L0.HasType "Real"
+    @L0.assert SYSDYN.Variable.Type "Real"
                 
 SYSDYN.Stock <T SYSDYN.IndependentVariable
-    @L0.assert L0.HasType "Real"
+    @L0.assert SYSDYN.Variable.Type "Real"
                 
 SYSDYN.Cloud <T SYSDYN.Variable
 
@@ -130,11 +134,11 @@ SYSDYN.Input <T SYSDYN.Variable
     @L0.optionalProperty L0.HasDescription
     @L0.optionalProperty SYSDYN.HasUnit
     @L0.assert SYSDYN.HasDefaultInputValue 0.0
-    @L0.assert L0.HasType "Real"
+    @L0.assert SYSDYN.Variable.Type "Real"
     
 SYSDYN.Enumeration <T SYSDYN.Variable
     @L0.singleProperty SYSDYN.HasEnumerationIndexes
-    @L0.assert L0.HasType "type"
+    @L0.assert SYSDYN.Variable.Type "type"
     @L0.assert SYSDYN.IsReplaceable false
     
 
index 7d715409bf542bf7446c93c67375ed8d3d014afe..4f68f6607c8e3c922173bd0eb6715f39f01edf8d 100644 (file)
@@ -1,4 +1,5 @@
 L0 = <http://www.simantics.org/Layer0-1.0>\r
+L0X = <http://www.simantics.org/Layer0X-1.0>\r
 G2D = <http://www.simantics.org/G2D-1.0>\r
 STR = <http://www.simantics.org/Structural-1.0>\r
 DIA = <http://www.simantics.org/Diagram-2.0>\r
@@ -198,7 +199,7 @@ WorkModelConfigurationDiagram : SYSDYN.ConfigurationDiagram <R L0.HasNext
             @L0.symmetric\r
         DIA.HasVisibleTag TAGS.AdminIsVisible <R DIA.IsVisible\r
             @L0.symmetric\r
-    L0.HasTrigger _ : SYSDYN.DiagramToCompositeMapping\r
+    L0X.HasTrigger _ : SYSDYN.DiagramToCompositeMapping\r
 // DIA.NavigationEnabled "false" \r
     @L0.list\r
         WorkforceElement : WM.WorkforceSymbol\r
@@ -468,7 +469,7 @@ WorkModuleConfigurationDiagram : SYSDYN.ConfigurationDiagram <R L0.HasNext
         DIA.HasFocusableTag TAGS.AdminIsFocusable\r
         DIA.HasVisibleTag TAGS.AdminIsVisible\r
 */\r
-    L0.HasTrigger _ : SYSDYN.DiagramToCompositeMapping\r
+    L0X.HasTrigger _ : SYSDYN.DiagramToCompositeMapping\r
     @L0.list\r
         WorkCompletionTimeInputElement : SYSDYN.InputSymbol\r
             MOD.ElementToComponent WMC.WorkCompletionTimeInput\r
@@ -702,7 +703,7 @@ WorkforceModuleConfigurationDiagram : SYSDYN.ConfigurationDiagram <R L0.HasNext
     DIA.HasFocusableTag TAGS.AdminIsFocusable\r
     DIA.HasVisibleTag TAGS.AdminIsVisible\r
 */\r
-    L0.HasTrigger _ : SYSDYN.DiagramToCompositeMapping\r
+    L0X.HasTrigger _ : SYSDYN.DiagramToCompositeMapping\r
   \r
     @L0.list\r
         TimeToAllocateResourcesElement : SYSDYN.AuxiliarySymbol\r
index 5308d589877b3fcd47d14ad7c085713e7371c995..c64e7d5122799256464444cbcc87da86a8e15eef 100644 (file)
@@ -183,6 +183,8 @@ public class SysdynResource {
     public final Resource Valve;\r
     public final Resource ValveSymbol;\r
     public final Resource Variable;\r
+    public final Resource Variable_Type;\r
+    public final Resource Variable_Type_Inverse;\r
     public final Resource WithLookupExpression;\r
     public final Resource angle;\r
     public final Resource angle_Inverse;\r
@@ -363,6 +365,8 @@ public class SysdynResource {
         public static final String Valve = "http://www.simantics.org/Sysdyn-1.0/Valve";\r
         public static final String ValveSymbol = "http://www.simantics.org/Sysdyn-1.0/ValveSymbol";\r
         public static final String Variable = "http://www.simantics.org/Sysdyn-1.0/Variable";\r
+        public static final String Variable_Type = "http://www.simantics.org/Sysdyn-1.0/Variable/Type";\r
+        public static final String Variable_Type_Inverse = "http://www.simantics.org/Sysdyn-1.0/Variable/Type/Inverse";\r
         public static final String WithLookupExpression = "http://www.simantics.org/Sysdyn-1.0/WithLookupExpression";\r
         public static final String angle = "http://www.simantics.org/Sysdyn-1.0/angle";\r
         public static final String angle_Inverse = "http://www.simantics.org/Sysdyn-1.0/angle/Inverse";\r
@@ -553,6 +557,8 @@ public class SysdynResource {
         Valve = getResourceOrNull(graph, URIs.Valve);\r
         ValveSymbol = getResourceOrNull(graph, URIs.ValveSymbol);\r
         Variable = getResourceOrNull(graph, URIs.Variable);\r
+        Variable_Type = getResourceOrNull(graph, URIs.Variable_Type);\r
+        Variable_Type_Inverse = getResourceOrNull(graph, URIs.Variable_Type_Inverse);\r
         WithLookupExpression = getResourceOrNull(graph, URIs.WithLookupExpression);\r
         angle = getResourceOrNull(graph, URIs.angle);\r
         angle_Inverse = getResourceOrNull(graph, URIs.angle_Inverse);\r
index cd162df3bdf0eeef957aea396c73c01bbc0fd688..e984ef152865a5a6273e618410cd916c8fe123bb 100644 (file)
@@ -15,6 +15,7 @@ import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;\r
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.layer0.Layer0;\r
+import org.simantics.operation.Layer0X;\r
 import org.simantics.sysdyn.SysdynResource;\r
 import org.simantics.ui.DoubleClickEvent;\r
 import org.simantics.ui.IDoubleClickAction;\r
@@ -27,6 +28,7 @@ public class ConsumeUnnecessaryEntersAction implements IDoubleClickAction {
        public void doubleClickEvent(DoubleClickEvent e) throws DatabaseException {\r
         ReadGraph g = e.getGraph();\r
         Layer0 l0 = Layer0.getInstance(g);\r
+        Layer0X L0X = Layer0X.getInstance(g);\r
         final Resource resource = ResourceAdaptionUtils.toSingleResource(e.getResource());\r
         if(resource == null)\r
                return;\r
@@ -34,8 +36,8 @@ public class ConsumeUnnecessaryEntersAction implements IDoubleClickAction {
                \r
                if(g.isInstanceOf(resource, sr.SysdynModel) || g.isInstanceOf(resource, sr.Variable)) {\r
                        consume(e);\r
-               } else if(g.hasStatement(resource, l0.Represents)){\r
-                       Resource represents = g.getSingleObject(resource, l0.Represents);       \r
+               } else if(g.hasStatement(resource, L0X.Represents)){\r
+                       Resource represents = g.getSingleObject(resource, L0X.Represents);      \r
                        if (g.isInstanceOf(represents, sr.Variable)) {\r
                                consume(e);\r
                        }\r
index 81a7a21a85433c5f93e8e4bf388a00c9881de387..0670d0d487a5e392883d8bc54eb166f7d3546669 100644 (file)
@@ -12,6 +12,7 @@ import org.simantics.diagram.stubs.DiagramResource;
 import org.simantics.layer0.Layer0;\r
 import org.simantics.layer0.utils.direct.GraphUtils;\r
 import org.simantics.modeling.ModelingResources;\r
+import org.simantics.operation.Layer0X;\r
 import org.simantics.structural.stubs.StructuralResource2;\r
 import org.simantics.sysdyn.SysdynResource;\r
 import org.simantics.ui.SimanticsUI;\r
@@ -35,6 +36,7 @@ public class NewModuleTypeAction implements ActionFactory{
                         // Same as in SysdynProject.java. Should use the same code, not copy.\r
                         SysdynResource sr = SysdynResource.getInstance(g);\r
                         Layer0 l0 = Layer0.getInstance(g);\r
+                        Layer0X L0X = Layer0X.getInstance(g);\r
                         ModelingResources mr = ModelingResources.getInstance(g);\r
                         StructuralResource2 sr2 = StructuralResource2.getInstance(g);\r
                         DiagramResource dr = DiagramResource.getInstance(g);\r
@@ -62,14 +64,14 @@ public class NewModuleTypeAction implements ActionFactory{
                         \r
                         \r
                         // Remove default mapping and add sysdyn mapping\r
-                        for(Resource trigger : g.getObjects(diagram, l0.HasTrigger)) {\r
+                        for(Resource trigger : g.getObjects(diagram, L0X.HasTrigger)) {\r
                             if(g.isInstanceOf(trigger, mr.DiagramToCompositeMapping)) {\r
-                                g.deny(diagram, l0.HasTrigger, trigger);\r
+                                g.deny(diagram, L0X.HasTrigger, trigger);\r
                             }\r
                         }\r
                         Resource mapping = g.newResource();\r
                         g.claim(mapping, l0.InstanceOf, null, sr.DiagramToCompositeMapping);\r
-                        g.claim(diagram, l0.HasTrigger, mapping);\r
+                        g.claim(diagram, L0X.HasTrigger, mapping);\r
                         \r
                         Resource moduleSymbol = g.newResource();\r
                         g.claimLiteral(moduleSymbol, l0.HasName, name + " Symbol");\r
index b814234a3ac154a6394fa98c2db867fbf31b6a5a..7d34ce2c3f04665433ed929d2b3978c07fa7d008 100644 (file)
@@ -16,6 +16,7 @@ import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;\r
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.layer0.Layer0;\r
+import org.simantics.operation.Layer0X;\r
 import org.simantics.sysdyn.ui.browser.nodes.InputNode;\r
 \r
 public class InputLabeler extends LabelerContributor<InputNode>{\r
@@ -23,12 +24,13 @@ public class InputLabeler extends LabelerContributor<InputNode>{
     @Override\r
     public String getLabel(ReadGraph graph, InputNode var) throws DatabaseException {\r
        Layer0 l0 = Layer0.getInstance(graph);\r
+       Layer0X L0X = Layer0X.getInstance(graph);\r
         Resource varres = var.data;\r
         StringBuilder sb = new StringBuilder();\r
         for(Resource r : graph.getObjects(varres, l0.HasName))\r
             sb.append(graph.getValue(r));\r
-               if(graph.isInstanceOf(varres, l0.Realization)) {\r
-                       varres = graph.getPossibleObject(varres, l0.Represents);\r
+               if(graph.isInstanceOf(varres, L0X.Realization)) {\r
+                       varres = graph.getPossibleObject(varres, L0X.Represents);\r
                        if(varres == null) return sb.toString();\r
                }\r
                sb.append(" : ");\r
index 2c89a4b2a2c1d30a4c85b06b355e798987f676c9..0ff5841195e7cfed4e43166f834f0b4489d12cda 100644 (file)
@@ -37,7 +37,7 @@ public class Model  extends ViewpointContributor<ModelNode> {
         ArrayList<AbstractNode<Resource>> result = new ArrayList<AbstractNode<Resource>>();\r
         \r
         Layer0 l0 = Layer0.getInstance(graph);\r
-        Resource baseRealization = graph.syncRequest(new PossibleObject(model.data, l0.HasBaseRealization));\r
+        Resource baseRealization = graph.syncRequest(new PossibleObject(model.data, L0X.HasBaseRealization));\r
         if (baseRealization != null) {\r
                try {\r
                        String URI = graph.getURI(baseRealization);\r
index 41e82c005609fdf2fded8f5343e9f4728744c644..6c2680984e505c64d38971d18407a9ab8b700d19 100644 (file)
@@ -16,6 +16,7 @@ import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;\r
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.layer0.Layer0;\r
+import org.simantics.operation.Layer0X;\r
 import org.simantics.sysdyn.ui.browser.nodes.ModuleNode;\r
 \r
 public class ModuleLabeler  extends LabelerContributor<ModuleNode>{\r
@@ -23,12 +24,13 @@ public class ModuleLabeler  extends LabelerContributor<ModuleNode>{
     @Override\r
     public String getLabel(ReadGraph graph, ModuleNode module) throws DatabaseException {\r
        Layer0 l0 = Layer0.getInstance(graph);\r
+       Layer0X L0X = Layer0X.getInstance(graph);\r
         Resource resource = module.data;\r
         StringBuilder sb = new StringBuilder();\r
         for(Resource r : graph.getObjects(resource, l0.HasName))\r
             sb.append(graph.getValue(r));\r
-               if(graph.isInstanceOf(resource, l0.Realization)) {\r
-                       resource = graph.getPossibleObject(resource, l0.Represents);\r
+               if(graph.isInstanceOf(resource, L0X.Realization)) {\r
+                       resource = graph.getPossibleObject(resource, L0X.Represents);\r
                        if(resource == null) return sb.toString();\r
                }\r
                sb.append(" : ");\r
index 625f67d3830d70810a21c7e7c4826aa7debf4527..6302ad0d922fc30f239f7038113119819875d563 100644 (file)
@@ -16,6 +16,7 @@ import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;\r
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.layer0.Layer0;\r
+import org.simantics.operation.Layer0X;\r
 import org.simantics.sysdyn.ui.browser.nodes.VariableNode;\r
 \r
 public class VariableLabeler  extends LabelerContributor<VariableNode<Resource>>{\r
@@ -23,12 +24,13 @@ public class VariableLabeler  extends LabelerContributor<VariableNode<Resource>>
        @Override\r
        public String getLabel(ReadGraph graph, VariableNode<Resource> var) throws DatabaseException {\r
                Layer0 l0 = Layer0.getInstance(graph);\r
+               Layer0X L0X = Layer0X.getInstance(graph);\r
                Resource varres = var.data;\r
                StringBuilder sb = new StringBuilder();\r
                for(Resource r : graph.getObjects(varres, l0.HasName))\r
                        sb.append(graph.getValue(r));\r
-               if(graph.isInstanceOf(varres, l0.Realization)) {\r
-                       varres = graph.getPossibleObject(varres, l0.Represents);\r
+               if(graph.isInstanceOf(varres, L0X.Realization)) {\r
+                       varres = graph.getPossibleObject(varres, L0X.Represents);\r
                        if(varres == null) return sb.toString();\r
                }\r
                sb.append(" : ");\r
index 90c4b542d70bf5283d0da77876263d725a23195d..433a3b36d047a3e4c63989ec142099c3c59013db 100644 (file)
@@ -22,6 +22,7 @@ import org.simantics.layer0.Layer0;
 import org.simantics.modeling.ComponentUtils;\r
 import org.simantics.modeling.ModelingResources;\r
 import org.simantics.modeling.ui.Activator;\r
+import org.simantics.operation.Layer0X;\r
 import org.simantics.structural.stubs.StructuralResource2;\r
 import org.simantics.structural2.StructuralVariables;\r
 import org.simantics.sysdyn.SysdynResource;\r
@@ -51,8 +52,8 @@ public class OpenDiagramFromConfigurationAdapter extends AbstractResourceEditorA
                        Resource componentType = g.getSingleObject(r, mr.SymbolToComponentType);\r
                        r = g.getSingleObject(componentType, sr2.IsDefinedBy);\r
                }\r
-               Layer0 l0 = Layer0.getInstance(g);\r
-               Resource represents = g.getPossibleObject(r, l0.Represents);\r
+               Layer0X L0X = Layer0X.getInstance(g);\r
+               Resource represents = g.getPossibleObject(r, L0X.Represents);\r
                if(represents != null){\r
                        if(g.isInstanceOf(represents, sr.Configuration)) {\r
                                r = represents;\r
@@ -69,7 +70,7 @@ public class OpenDiagramFromConfigurationAdapter extends AbstractResourceEditorA
             @Override\r
             public void run(ReadGraph g) throws DatabaseException {\r
                Resource cr = r;\r
-                               Layer0 l0 = Layer0.getInstance(g);\r
+                               Layer0X L0X = Layer0X.getInstance(g);\r
                                if(g.isInheritedFrom(r, SysdynResource.getInstance(g).ModuleSymbol)) {\r
                                        ModelingResources mr = ModelingResources.getInstance(g);\r
                                        StructuralResource2 sr2 = StructuralResource2.getInstance(g);\r
@@ -77,7 +78,7 @@ public class OpenDiagramFromConfigurationAdapter extends AbstractResourceEditorA
                                        Resource configuration = g.getSingleObject(componentType, sr2.IsDefinedBy);\r
                                        cr = configuration;\r
                                } else {     \r
-                                       Resource represents = g.getPossibleObject(r, l0.Represents);\r
+                                       Resource represents = g.getPossibleObject(r, L0X.Represents);\r
                                        if(represents != null && g.isInstanceOf(represents, SysdynResource.getInstance(g).Configuration)){\r
                                                cr = represents;\r
                                        } else {\r
index 3eb1ffe065eaa4686f6fccd1976ae44cf5ba28bd..f465a16ee022729a7662014036a50353c7a3f3c0 100644 (file)
@@ -22,6 +22,7 @@ import org.simantics.layer0.utils.direct.GraphUtils;
 import org.simantics.mapping.constraint.instructions.TypedBracketInstruction.CreationInstruction;\r
 import org.simantics.modeling.services.ComponentNamingUtil;\r
 import org.simantics.modeling.services.NamingException;\r
+import org.simantics.operation.Layer0X;\r
 import org.simantics.project.IProject;\r
 \r
 public class SysdynCreationInstruction extends CreationInstruction {\r
@@ -46,13 +47,14 @@ public class SysdynCreationInstruction extends CreationInstruction {
         Resource configuration = (Resource) bindings[lConfiguration];\r
 \r
         Layer0 l0 = Layer0.getInstance(g);\r
-\r
+        Layer0X L0X = Layer0X.getInstance(g);\r
+        \r
         try {\r
             String proposition = URIStringUtils.escape(ComponentNamingUtil.findFreshInstanceName(g, project, configurationRoot, configuration, componentType));\r
             Resource result = GraphUtils.create(g,\r
                     l0.HasName, proposition\r
             );\r
-            g.claim(result, l0.Represents, result);\r
+            g.claim(result, L0X.Represents, result);\r
             return result;\r
         } catch (NamingException e1) {\r
             throw new DatabaseException(e1);\r
index 7789c2af89e0b75b4c01f87b9a63b05fd6ff2d15..67b642d2bbdcb2c803c2df315d61035c065b37b1 100644 (file)
@@ -18,6 +18,7 @@ import org.simantics.db.layer0.variable.Variables;
 import org.simantics.db.service.LifecycleSupport;\r
 import org.simantics.db.service.SerialisationSupport;\r
 import org.simantics.layer0.Layer0;\r
+import org.simantics.operation.Layer0X;\r
 import org.simantics.ui.SimanticsUI;\r
 import org.simantics.ui.icons.ImageDescriptorProvider;\r
 import org.simantics.ui.workbench.ResourceEditorInput2;\r
@@ -381,9 +382,11 @@ public class SysdynEditorInput extends ResourceEditorInput2 {
         Layer0 L0 = Layer0.getInstance(g);\r
         // 2. Validate modelURI\r
         if (getModelURI() != null) {\r
+            Layer0X L0X = Layer0X.getInstance(g);\r
+            \r
             // 3. Validate RVI\r
             Resource model = g.getResource(modelURI);\r
-            Resource baseRealization = g.getPossibleObject(model, L0.HasBaseRealization);\r
+            Resource baseRealization = g.getPossibleObject(model, L0X.HasBaseRealization);\r
             Variable modelVariable = Variables.getVariable(g, g.getURI(baseRealization));\r
             modelVariable.browse(g, getRVI());\r
         }\r
index 36870aa5f2a691052b9947b41ee62b8c7fba84ec..6676e96524b53e7d76daab0fbcfb32aa069537cd 100644 (file)
@@ -40,6 +40,7 @@ import org.simantics.graph.representation.TransferableGraph1;
 import org.simantics.layer0.Layer0;\r
 import org.simantics.layer0.utils.direct.GraphUtils;\r
 import org.simantics.modeling.ModelingResources;\r
+import org.simantics.operation.Layer0X;\r
 import org.simantics.simulation.ontology.SimulationResource;\r
 import org.simantics.spreadsheet.resource.SpreadsheetResource;\r
 import org.simantics.structural.stubs.StructuralResource2;\r
@@ -157,11 +158,11 @@ public class ImportModelHandler extends AbstractHandler {
         * @param model Imported model\r
         */\r
        private static void updateOldConfigurationToBaseRealization(WriteGraph graph, Resource model) {\r
-               Layer0 l0 = Layer0.getInstance(graph);\r
+               Layer0X L0X = Layer0X.getInstance(graph);\r
                try {\r
                        Resource configuration = graph.getPossibleObject(model, SimulationResource.getInstance(graph).HasConfiguration);\r
-                       if(configuration != null && !graph.hasStatement(configuration, l0.IsBaseRealizationOf, model))\r
-                               graph.claim(configuration, l0.IsBaseRealizationOf, model);\r
+                       if(configuration != null && !graph.hasStatement(configuration, L0X.IsBaseRealizationOf, model))\r
+                               graph.claim(configuration, L0X.IsBaseRealizationOf, model);\r
                } catch (DatabaseException e) {\r
                        e.printStackTrace();\r
                }\r
index a6c4e6c04e6aa7593c070de33397bd5ab1829fc3..e6ec15a6a8e86142740873d53bff9e4ad66a3d83 100644 (file)
@@ -27,6 +27,7 @@ import org.simantics.diagram.stubs.DiagramResource;
 import org.simantics.layer0.Layer0;\r
 import org.simantics.layer0.utils.direct.GraphUtils;\r
 import org.simantics.modeling.ModelingResources;\r
+import org.simantics.operation.Layer0X;\r
 import org.simantics.structural.stubs.StructuralResource2;\r
 import org.simantics.sysdyn.SysdynResource;\r
 import org.simantics.sysdyn.ui.browser.nodes.ModulesNode;\r
@@ -54,6 +55,7 @@ public class NewModuleNodeHandler extends AbstractHandler {
                 // Same as in SysdynProject.java. Should use the same code, not copy.\r
                 SysdynResource sr = SysdynResource.getInstance(g);\r
                 Layer0 l0 = Layer0.getInstance(g);\r
+                Layer0X L0X = Layer0X.getInstance(g);\r
                 ModelingResources mr = ModelingResources.getInstance(g);\r
                 StructuralResource2 sr2 = StructuralResource2.getInstance(g);\r
                 DiagramResource dr = DiagramResource.getInstance(g);\r
@@ -81,14 +83,14 @@ public class NewModuleNodeHandler extends AbstractHandler {
                 \r
                 \r
                 // Remove default mapping and add sysdyn mapping\r
-                for(Resource trigger : g.getObjects(diagram, l0.HasTrigger)) {\r
+                for(Resource trigger : g.getObjects(diagram, L0X.HasTrigger)) {\r
                        if(g.isInstanceOf(trigger, mr.DiagramToCompositeMapping)) {\r
-                               g.deny(diagram, l0.HasTrigger, trigger);\r
+                               g.deny(diagram, L0X.HasTrigger, trigger);\r
                        }\r
                 }\r
                 Resource mapping = g.newResource();\r
                 g.claim(mapping, l0.InstanceOf, null, sr.DiagramToCompositeMapping);\r
-                g.claim(diagram, l0.HasTrigger, mapping);\r
+                g.claim(diagram, L0X.HasTrigger, mapping);\r
                 \r
                 Resource moduleSymbol = g.newResource();\r
                 g.claimLiteral(moduleSymbol, l0.HasName, name + " Symbol");\r
index f8b1cc35c6dd44cc608ceec87f58128938a4a608..653aa2e1e46d514474c7b779e1163419d7fb821c 100644 (file)
@@ -36,7 +36,7 @@ public class DefaultRealizationVirtualGraph extends RealizationVirtualGraph {
                int modelNode = context.getIndex(model);\r
                int defaultsNode = context.getIndex(defaultsResource);\r
                graph.claim(model, L0.ConsistsOf, null, defaultsResource);\r
-               graph.claim(model, L0.HasBaseRealization, null, defaultsResource);\r
+               graph.claim(model, L0X.HasBaseRealization, null, defaultsResource);\r
                \r
 //             undiscovered.put(defaultsNode, new ResourceData(modelNode, configuration, L0.Realization, "BaseRealization", null, null));\r
                \r
index c2c3f30f40f47cc1f1f8ed2a48cfab95462434bf..57d52457d7aaf5e5c142e9ba9e0275d91dedca0e 100644 (file)
@@ -24,6 +24,7 @@ import org.simantics.db.common.utils.OrderedSetUtils;
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.db.layer0.variable.ResourceVariable;\r
 import org.simantics.layer0.Layer0;\r
+import org.simantics.operation.Layer0X;\r
 import org.simantics.sysdyn.SysdynResource;\r
 \r
 public class DefaultVariable extends ResourceVariable {\r
@@ -35,9 +36,9 @@ public class DefaultVariable extends ResourceVariable {
        @SuppressWarnings("unchecked")\r
        @Override\r
        public <T> T getValue(ReadGraph graph) throws DatabaseException {\r
-               Layer0 b = Layer0.getInstance(graph);\r
+               Layer0X L0X = Layer0X.getInstance(graph);\r
                SysdynResource sr = SysdynResource.getInstance(graph);\r
-               Resource represents = graph.getPossibleObject(resource, b.Represents);\r
+               Resource represents = graph.getPossibleObject(resource, L0X.Represents);\r
                if(represents == null) return null;\r
                //FIXME: doesn't support multiple expressions\r
                Resource expressions = graph.getPossibleObject(represents, sr.HasExpressions);\r
@@ -61,10 +62,11 @@ public class DefaultVariable extends ResourceVariable {
        @Override\r
        public void setValue(WriteGraph graph, Object object, Binding binding) throws DatabaseException {\r
                Layer0 l0 = Layer0.getInstance(graph);\r
+               Layer0X L0X = Layer0X.getInstance(graph);\r
                SysdynResource sr = SysdynResource.getInstance(graph);\r
 //             if(!Bindings.DOUBLE.equals(binding)) return;\r
 //             if(!MutableDoubleBinding.INSTANCE.equals(binding)) return;\r
-               Resource represents = graph.getPossibleObject(resource, l0.Represents);\r
+               Resource represents = graph.getPossibleObject(resource, L0X.Represents);\r
                if(represents == null) return;\r
                //FIXME: doesn't support multiple expressions\r
                Resource expressions = graph.getPossibleObject(represents, sr.HasExpressions);\r
index a5e75d8695cf91421c0df529b5f2f044a6c8b412..a4c3175d20f63aa4d93818187aaf1188b1944202 100644 (file)
@@ -46,6 +46,7 @@ import org.simantics.modeling.ModelingResources;
 import org.simantics.modeling.ModelingUtils;\r
 import org.simantics.modeling.services.CaseInsensitiveComponentNamingStrategy2;\r
 import org.simantics.modeling.services.ComponentNamingStrategy;\r
+import org.simantics.operation.Layer0X;\r
 import org.simantics.project.IProject;\r
 import org.simantics.project.ProjectElementType;\r
 import org.simantics.project.ProjectElements;\r
@@ -113,6 +114,7 @@ public class SysdynProject extends AbstractProjectFeature {
         public void run(WriteGraph g, Resource library, Callback<Resource> callback, Callback<Throwable> errorCallback) {\r
             try {\r
                 Layer0 l0 = Layer0.getInstance(g);\r
+                Layer0X L0X = Layer0X.getInstance(g);\r
                 SysdynResource sr = SysdynResource.getInstance(g);\r
                 SpreadsheetResource SHEET = SpreadsheetResource.getInstance(g);\r
                 ModelingUtils mu = new ModelingUtils(g);\r
@@ -129,7 +131,7 @@ public class SysdynProject extends AbstractProjectFeature {
                 Resource conf = GraphUtils.create2(g,\r
                         sr.Configuration,\r
                         l0.PartOf, model,\r
-                        l0.IsBaseRealizationOf, model,\r
+                        L0X.IsBaseRealizationOf, model,\r
                         l0.HasName, modelName\r
                 );\r
                 \r
@@ -153,14 +155,14 @@ public class SysdynProject extends AbstractProjectFeature {
                 \r
                 ModelingResources mr = ModelingResources.getInstance(g);\r
                 // Remove default mapping and add sysdyn mapping\r
-                for(Resource trigger : g.getObjects(diagram, l0.HasTrigger)) {\r
+                for(Resource trigger : g.getObjects(diagram, L0X.HasTrigger)) {\r
                        if(g.isInstanceOf(trigger, mr.DiagramToCompositeMapping)) {\r
-                               g.deny(diagram, l0.HasTrigger, trigger);\r
+                               g.deny(diagram, L0X.HasTrigger, trigger);\r
                        }\r
                 }\r
                 Resource mapping = g.newResource();\r
                 g.claim(mapping, l0.InstanceOf, null, sr.DiagramToCompositeMapping);\r
-                g.claim(diagram, l0.HasTrigger, mapping);\r
+                g.claim(diagram, L0X.HasTrigger, mapping);\r
 \r
                 Resource report = GraphUtils.create2(g, DOC.Report,  DOC.HasDocumentation, "===Report===");\r
 \r
index 62f43b54c08d51a03815fb9f09705341edf04e38..e7c447f6984ae9f1c0b7eab9770ce091a56e064f 100644 (file)
@@ -38,6 +38,7 @@ import org.simantics.graph.representation.TransferableGraph1;
 import org.simantics.layer0.Layer0;\r
 import org.simantics.layer0.utils.direct.GraphUtils;\r
 import org.simantics.modeling.ModelingResources;\r
+import org.simantics.operation.Layer0X;\r
 import org.simantics.simulation.ontology.SimulationResource;\r
 import org.simantics.spreadsheet.resource.SpreadsheetResource;\r
 import org.simantics.structural.stubs.StructuralResource2;\r
@@ -282,11 +283,11 @@ public class WizardModelsImportPage extends WizardPage{
         * @param model Imported model\r
         */\r
        private static void updateOldConfigurationToBaseRealization(WriteGraph graph, Resource model) {\r
-               Layer0 l0 = Layer0.getInstance(graph);\r
+               Layer0X L0X = Layer0X.getInstance(graph);\r
                try {\r
                        Resource configuration = graph.getPossibleObject(model, SimulationResource.getInstance(graph).HasConfiguration);\r
-                       if(configuration != null && !graph.hasStatement(configuration, l0.IsBaseRealizationOf, model))\r
-                               graph.claim(configuration, l0.IsBaseRealizationOf, model);\r
+                       if(configuration != null && !graph.hasStatement(configuration, L0X.IsBaseRealizationOf, model))\r
+                               graph.claim(configuration, L0X.IsBaseRealizationOf, model);\r
                } catch (DatabaseException e) {\r
                        e.printStackTrace();\r
                }\r
@@ -392,6 +393,7 @@ public class WizardModelsImportPage extends WizardPage{
     private static Resource createSheet(WriteGraph graph, Resource book, String name, String[] colNames, int[] colWidths) throws DatabaseException {\r
 \r
         Layer0 L0 = Layer0.getInstance(graph);\r
+        Layer0X L0X = Layer0X.getInstance(graph);\r
         SpreadsheetResource sr = SpreadsheetResource.getInstance(graph);\r
 \r
         Resource result = graph.newResource();\r
@@ -433,7 +435,7 @@ public class WizardModelsImportPage extends WizardPage{
             graph.addLiteral(newCell, sr.DoubleArrayCell_HasWidth, sr.DoubleArrayCell_HasWidth_Inverse, L0.Integer, 10, Bindings.INTEGER);\r
             graph.addLiteral(newCell, sr.HasLocation, sr.HasLocation_Inverse, L0.String, "B2", Bindings.STRING);\r
             graph.addLiteral(newCell, sr.DoubleArrayCell_HasDoubleArray, sr.DoubleArrayCell_HasDoubleArray_Inverse, L0.DoubleArray, doubles, Bindings.DOUBLE_ARRAY);\r
-            graph.claim(result, L0.HasChildVariables, L0.HasChildVariables_Inverse, newCell);\r
+            graph.claim(result, L0X.HasChildVariables, L0X.HasChildVariables_Inverse, newCell);\r
             \r
         }\r
         \r
index 8e93bdfaa51c43b2369b26b69dd2c17f04bb5217..a68c2eef5e21c0ade3344372ed0a20b5c2b9f90b 100644 (file)
@@ -28,6 +28,7 @@ import org.simantics.db.layer0.variable.DatatypePropertyVariable;
 import org.simantics.db.layer0.variable.Variable;\r
 import org.simantics.db.layer0.variable.Variables;\r
 import org.simantics.layer0.Layer0;\r
+import org.simantics.operation.Layer0X;\r
 import org.simantics.sysdyn.SysdynResource;\r
 \r
 public class ChildVariable extends AbstractChildVariable {\r
@@ -105,8 +106,8 @@ public class ChildVariable extends AbstractChildVariable {
     \r
     @Override\r
     public Resource getRepresents(ReadGraph graph) throws DatabaseException {\r
-       Layer0 L0 = Layer0.getInstance(graph);\r
-       Resource represents = graph.getPossibleObject(resource, L0.Represents);\r
+       Layer0X L0X = Layer0X.getInstance(graph);\r
+       Resource represents = graph.getPossibleObject(resource, L0X.Represents);\r
        if(represents != null) return represents;\r
        else return resource;\r
     }\r
index c847527bd17614b165e3e24a58c0656be36e497a..867e9dfe268936b666b9c30f91a7721b599df45c 100644 (file)
@@ -22,6 +22,7 @@ import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.layer0.variable.StandardGraphChildVariable;\r
 import org.simantics.db.layer0.variable.Variable;\r
 import org.simantics.layer0.Layer0;\r
+import org.simantics.operation.Layer0X;\r
 \r
 public class RunVariable extends StandardGraphChildVariable {\r
 \r
@@ -53,9 +54,10 @@ public class RunVariable extends StandardGraphChildVariable {
 \r
        Resource getConfiguration(ReadGraph graph) throws DatabaseException {\r
                Layer0 L0 = Layer0.getInstance(graph);\r
+               Layer0X L0X = Layer0X.getInstance(graph);\r
                Resource experiment = graph.getPossibleObject(resource, L0.PartOf);\r
                Resource model = graph.getPossibleObject(experiment, L0.PartOf);\r
-               return graph.getPossibleObject(model, L0.HasBaseRealization);\r
+               return graph.getPossibleObject(model, L0X.HasBaseRealization);\r
        }\r
        \r
 }\r
index 1782b213850b896b79ea028c2fdc67dbccb2615b..017d9d7701e5582a4b6bc5e6d9b66e137f2f55c1 100644 (file)
@@ -23,6 +23,7 @@ import org.simantics.document.DocumentResource;
 import org.simantics.layer0.Layer0;\r
 import org.simantics.layer0.utils.direct.GraphUtils;\r
 import org.simantics.modeling.ModelingResources;\r
+import org.simantics.operation.Layer0X;\r
 import org.simantics.simulation.ontology.SimulationResource;\r
 import org.simantics.sysdyn.SysdynResource;\r
 import org.simantics.utils.datastructures.ArrayMap;\r
@@ -217,6 +218,7 @@ public class Model implements IWriteableMDLObject {
                try {\r
                        SysdynResource sr = SysdynResource.getInstance(graph);\r
                        Layer0 l0 = Layer0.getInstance(graph);\r
+                       Layer0X L0X = Layer0X.getInstance(graph);\r
                        SimulationResource simu = SimulationResource.getInstance(graph);\r
                        DocumentResource DOC = DocumentResource.getInstance(graph);\r
 \r
@@ -255,17 +257,17 @@ public class Model implements IWriteableMDLObject {
             \r
             ModelingResources mr = ModelingResources.getInstance(graph);\r
             // Remove default mapping and add sysdyn mapping\r
-            for(Resource trigger : graph.getObjects(diagram, l0.HasTrigger)) {\r
+            for(Resource trigger : graph.getObjects(diagram, L0X.HasTrigger)) {\r
                if(graph.isInstanceOf(trigger, mr.DiagramToCompositeMapping)) {\r
-                       graph.deny(diagram, l0.HasTrigger, trigger);\r
+                       graph.deny(diagram, L0X.HasTrigger, trigger);\r
                }\r
             }\r
             Resource mapping = graph.newResource();\r
             graph.claim(mapping, l0.InstanceOf, null, sr.DiagramToCompositeMapping);\r
-            graph.claim(diagram, l0.HasTrigger, mapping);\r
+            graph.claim(diagram, L0X.HasTrigger, mapping);\r
 \r
                        graph.claim(model, simu.HasConfiguration, conf);\r
-                       graph.claim(model, l0.HasBaseRealization, conf);\r
+                       graph.claim(model, L0X.HasBaseRealization, conf);\r
 \r
                        Resource report = GraphUtils.create2(graph, DOC.Report,  DOC.HasDocumentation, "===Report===");\r
 \r
index 6ec5f47f2148dcab5cc6dc41c1d5badaa617e8a8..b7f37b951757ac0147cd0bd328df8968c51faca3 100644 (file)
@@ -17,7 +17,7 @@ import org.simantics.sysdyn.representation.expressions.Expressions;
 \r
 public abstract class Variable implements IElement {\r
     \r
-    @RelatedValue("http://www.simantics.org/Layer0-1.0/HasType")\r
+    @RelatedValue("http://www.simantics.org/Sysdyn-1.0/Variable/Type")\r
     protected String type;\r
     \r
     @RelatedValue("http://www.simantics.org/Layer0-1.0/HasName")\r