]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.district.network.ontology/graph/DistrictNetwork.pgraph
Fix variable exceptions for certain properties in district diagram
[simantics/district.git] / org.simantics.district.network.ontology / graph / DistrictNetwork.pgraph
index a4144a808f895333c6ef14b09fd21fb8bc564048..64c1b6cd8328f9ad63218bb7a28ef2d953c8b10b 100644 (file)
@@ -6,20 +6,103 @@ VP = <http://www.simantics.org/Viewpoint-1.2>
 IMAGE = <http://www.simantics.org/Image2-1.2>
 SEL = <http://www.simantics.org/SelectionView-1.2>
 SEL_UI = <http://www.simantics.org/SelectionViewUI-1.1>
+G2D = <http://www.simantics.org/G2D-1.1>
 
 DN = <http://www.simantics.org/DistrictNetwork-1.0> : L0.Ontology
     @L0.new
     L0.Ontology.global true
     L0.HasResourceClass "org.simantics.district.network.ontology.DistrictNetworkResource"
 
+// ----------------------------------------------------------------------------
+
+DN.SCLMain : L0.SCLModule
+    L0.SCLModule.definition
+        """
+include "Simantics/District/SCLMain"
+"""
+
+// ----------------------------------------------------------------------------
+
+defProperty : L0.Template
+    @template %subject %label %range
+        %subject <R L0.HasProperty : SEL.GenericParameterType
+            L0.HasLabel %label : L0.String
+            L0.HasRange %range
+
+// ----------------------------------------------------------------------------
+
+DN.Diagram <T DIA.Diagram
 DN.Layer <T DIA.Layer
+DN.Connection <T DIA.Connection
+DN.Element <T DIA.Element : L0.Type
+
+DN.Vertex <T DN.Element
+    >-- DN.Vertex.HasElevation
+        @defProperty "Elevation" L0.Double
+    >-- DN.Vertex.HasAddress
+        @defProperty "Address" L0.String
+    >-- DN.Vertex.HasSupplyTemperature
+        @defProperty "Supply Temperature" L0.Double 
+    >-- DN.Vertex.HasReturnTemperature 
+        @defProperty "Return Temperature" L0.Double
+    >-- DN.Vertex.HasSupplyPressure
+        @defProperty "Supply Pressure" L0.Double 
+    >-- DN.Vertex.HasReturnPressure
+        @defProperty "Return Pressure" L0.Double 
+    >-- DN.Vertex.HasDeltaPressure
+        @defProperty "Delta pressure" L0.Double 
+    >-- DN.Vertex.HasDeltaTemperature
+        @defProperty "Delta temperature" L0.Double 
+    >-- DN.Vertex.HasHeatPower
+        @defProperty "Heat Power" L0.Double 
+    >-- DN.Vertex.HasNominalHeadM
+        @defProperty "NominalHeadM" L0.Double 
+    >-- DN.Vertex.HasNominalHeadB
+        @defProperty "NominalHeadB" L0.Double 
+    >-- DN.Vertex.HasNominalFlow
+        @defProperty "Nominal Flow" L0.Double 
+    >-- DN.Vertex.HasMaximumHeadM
+        @defProperty "Maximum head M" L0.Double 
+    >-- DN.Vertex.HasHeatLoadDs
+        @defProperty "Heat Load ds" L0.Double 
+    >-- DN.Vertex.HasMassFlow
+        @defProperty "Mass Flow" L0.Double 
+    >-- DN.Vertex.HasVolFlow
+        @defProperty "Vol Flow" L0.Double 
+    >-- DN.Vertex.HasVelocity
+        @defProperty "Velocity" L0.Double 
+    >-- DN.Vertex.HasFlowArea
+        @defProperty "Flow Area" L0.Double 
+    >-- DN.Vertex.HasValvePosition
+        @defProperty "Valve position" L0.Double 
+    >-- DN.Vertex.HasNominalPressureLoss
+        @defProperty "Nominal Pressure Loss" L0.Double 
+    @L0.assert DN.Vertex.HasElevation 0.0
 
-DN.Edge <T DIA.Element : L0.Type
+DN.Edge <T DN.Element
+    >-- DN.Edge.HasElevation
+        @defProperty "Elevation" L0.Double
+    >-- DN.Edge.HasLength 
+        @defProperty "Length" L0.Double
+        L0.readOnly true
+    >-- DN.Edge.HasDiameter
+        @defProperty "Diameter" L0.Double
+    >-- DN.Edge.HasOuterDiameter
+        @defProperty "Outer Diameter" L0.Double
+    >-- DN.Edge.HasNominalMassFlow
+        @defProperty "Nominal Mass Flow" L0.Double
+    >-- DN.Edge.HasFlowArea
+        @defProperty "Flow Area" L0.Double
+    >-- DN.Edge.HasKReturn
+        @defProperty "K Return" L0.Double
+    >-- DN.Edge.HasKSupply
+        @defProperty "K Supply" L0.Double
+    >-- DN.Edge.HasTGround
+        @defProperty "T Ground" L0.Double
     @L0.assert DN.Edge.HasDiameter 0.1
     @L0.assert DN.Edge.HasOuterDiameter 0.11
 
-DN.Vertex <T DIA.Element : L0.Type
-    @L0.assert DN.Vertex.HasElevation 0.0
+// ----------------------------------------------------------------------------
 
 DN.EdgeDefaultMapping <R L0.HasProperty : DN.EdgeMappingParameterType
     L0.HasLabel "Default Edge mapping"
@@ -27,6 +110,8 @@ DN.EdgeDefaultMapping <R L0.HasProperty : DN.EdgeMappingParameterType
 DN.VertexDefaultMapping <R L0.HasProperty : DN.VertexMappingParameterType
     L0.HasLabel "Default Vertex mapping"
 
+// ----------------------------------------------------------------------------
+
 DN.Functions : L0.Library
 
 DN.VertexMappingParameterType <T SEL.GenericParameterType
@@ -47,22 +132,13 @@ DN.MappingParameterType <T SEL.GenericParameterType
       SEL.HasEnumerationValues DN.Functions.enumerationValues
       SEL.HasCustomModifier DN.Functions.mappingModifier : L0.Function
 
+// ----------------------------------------------------------------------------
+
 DN.HasMapping <R L0.HasProperty : DN.MappingParameterType
     L0.HasLabel "Mapping"
 
-DN.Edge.HasDiameter <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "Diameter"
-    L0.HasRange L0.Double
-    L0.readOnly false
-
-DN.Vertex.HasElevation <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "Elevation"
-    L0.HasRange L0.Double
-    L0.readOnly false
-
-DN.Edge.HasOuterDiameter <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "Outer Diameter"
-    L0.HasRange L0.Double
+DN.HasId --> L0.String <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "Id"
     L0.readOnly false
 
 DN.InLayer
@@ -72,25 +148,24 @@ DN.InLayer
 DN.HasInLayerTag <R L0.HasProperty
     L0.HasRange L0.Tag
 
-DN.Connection <T DIA.Connection
-
+// For associating typical diagram source and instance structures with each other
 DN.Diagram.MappedDiagram <R L0.IsWeaklyRelatedTo
+    L0.InverseOf DN.Diagram.MappedFromDiagram <R L0.IsWeaklyRelatedTo
 DN.MappedComponent <R L0.IsWeaklyRelatedTo
-
-DN.Diagram <T DIA.Diagram
+    L0.InverseOf DN.MappedFromElement <R L0.IsWeaklyRelatedTo
 
 DN.AddLayerToDNDiagramTemplate <T L0.Template
 
 DN.EPSG_4326 : DN.SpatialRefSystem
     L0.HasLabel "EPSG:4326"
     DN.HasSRID 4326
-    DN.HasSRTEXT _ : L0.String
-        @L0.loadString "epsg/EPSG_4326"
 
-DN.SpatialRefSystem <T L0.Entity
+DN.SpatialRefSystem <T L0.Property
+    L0.readOnly true
 
-DN.HasSpatialRefSystem <R L0.HasProperty
+DN.HasSpatialRefSystem <R L0.HasProperty : SEL.GenericParameterType
     L0.HasRange DN.SpatialRefSystem
+    L0.HasLabel "Spatial Reference System"
 
 DN.HasSRID <R L0.HasProperty
     L0.HasRange L0.Integer
@@ -118,40 +193,7 @@ DN.HasEndVertex <R L0.DependsOn
     L0.HasRange DN.Vertex
     L0.InverseOf DN.HasEndVertex_Inverse <R L0.IsRelatedTo
 
-MBC = MOD.ModelingBrowseContext
-
-DNAC.newDiagramContribution : L0.Template
-    @template %actionContext %label %image %action
-        %actionContext
-            VP.BrowseContext.HasActionContribution _ : VP.ActionContribution
-                L0.HasLabel %label
-                VP.ActionContribution.HasImage %image
-                VP.ActionContribution.HasCategory VP.NewActionCategory
-                VP.ActionContribution.HasNodeType MBC.Configuration
-                VP.ActionContribution.HasAction %action
-
-DNAC = DN.ActionContext : VP.BrowseContext
-    VP.BrowseContext.IsIncludedIn MOD.ModelingActionContext
-    @DNAC.newDiagramContribution "Network Diagram" IMAGES.MapImage ACTIONS.NewDNDiagram
-
-DNBC = DN.BrowseContext : VP.BrowseContext
-    VP.BrowseContext.IsIncludedIn MOD.ModelingBrowseContext
-    VP.BrowseContext.Includes SEL_UI.StandardPropertiesBase.BrowseContext
-    
-    @VP.customModifierRule    DN.Edge    VP.ResourceLabelModifierRule
-    @VP.constantImageRule     DN.Composite   IMAGES.MapImage
-
-
-ACTIONS = DN.Actions : L0.Library
-
-ACTIONS.NewDNDiagram : MOD.NewComposite
-    MOD.NewComposite.HasCompositeType DN.Composite
-    MOD.NewComposite.HasDefaultName "NewDNComposite"
-
-IMAGES = DN.Images : L0.Library
-
-IMAGES.MapImage : IMAGE.PngImage
-    @L0.loadBytes "images/map.png"
+// ----------------------------------------------------------------------------
 
 // Component MAPPING
 DN.Mapping <T L0.Library
@@ -159,21 +201,55 @@ DN.Mapping <T L0.Library
 DN.Functions.convertToValue : L0.ExternalValue
 
 DN.Mapping.Base <T L0.Value
+  >-- DN.Mapping.Id --> L0.String <R L0.HasProperty
+  >-- DN.Mapping.ComponentType --> STR.ComponentType <R L0.DependsOn
+  >-- DN.Mapping.Terminals --> DN.Mapping.TerminalPair <R L0.HasProperty
   @L0.assert L0.ConvertsToValueWith DN.Functions.convertToValue
 
 DN.Mapping.Terminal <T L0.Entity
+    L0.HasRange L0.String
 
-DN.Mapping.TerminalPair <T L0.Entity
+DN.Mapping.TerminalPair <T L0.Property
     >-- DN.Mapping.InputTerminal --> DN.Mapping.Terminal <R L0.HasProperty
     >-- DN.Mapping.OutputTerminal --> DN.Mapping.Terminal <R L0.HasProperty
 
 DN.Mapping.VertexMapping <T DN.Mapping.Base
-    >-- DN.Mapping.ComponentType --> STR.ComponentType <R L0.DependsOn
+    // Common
     >-- DN.Mapping.VertexMapping.ElevationAttribute --> L0.String <R L0.HasProperty
-    >-- DN.Mapping.Terminals --> DN.Mapping.TerminalPair <R L0.HasProperty
+    >-- DN.Mapping.VertexMapping.SupplyTemperatureAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.VertexMapping.ReturnTemperatureAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.VertexMapping.SupplyPressureAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.VertexMapping.ReturnPressureAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.VertexMapping.DeltaPressureAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.VertexMapping.DeltaTemperatureAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.VertexMapping.XAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.VertexMapping.YAttribute --> L0.String <R L0.HasProperty
+    // Production
+    >-- DN.Mapping.VertexMapping.dpAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.VertexMapping.dtAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.VertexMapping.HeatPowerAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.VertexMapping.NominalHeadMAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.VertexMapping.NominalHeadBAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.VertexMapping.NominalFlowAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.VertexMapping.MaximumHeadMAttribute --> L0.String <R L0.HasProperty
+    // Consumers
+    >-- DN.Mapping.VertexMapping.HeatLoadDsAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.VertexMapping.AddressAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.VertexMapping.MassFlowAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.VertexMapping.VolFlowAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.VertexMapping.VelocityAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.VertexMapping.FlowAreaAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.VertexMapping.ValvePositionAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.VertexMapping.NominalPressureLossAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.VertexMapping.NominalMassFlowAttribute --> L0.String <R L0.HasProperty
 
 DN.Mapping.EdgeMapping <T DN.Mapping.Base
-    >-- DN.Mapping.ComponentType
     >-- DN.Mapping.EdgeMapping.LengthAttribute --> L0.String <R L0.HasProperty
     >-- DN.Mapping.EdgeMapping.DiameterAttribute --> L0.String <R L0.HasProperty
-    >-- DN.Mapping.Terminals
+    >-- DN.Mapping.EdgeMapping.OuterDiameterAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.EdgeMapping.NominalMassFlowAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.EdgeMapping.FlowAreaAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.EdgeMapping.KReturnAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.EdgeMapping.KSupplyAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.EdgeMapping.TGroundAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.EdgeMapping.ElevationAttribute --> L0.String <R L0.HasProperty