]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.district.network.ontology/graph/DistrictNetwork.pgraph
Stash for edge styling & import progress monitoring
[simantics/district.git] / org.simantics.district.network.ontology / graph / DistrictNetwork.pgraph
index 612fb30323812abd03502ef3869ee94fcb439dca..64dbb60f89f6be5c06e581af81842d59145eed79 100644 (file)
@@ -4,32 +4,247 @@ STR = <http://www.simantics.org/Structural-1.2>
 MOD = <http://www.simantics.org/Modeling-1.2>
 VP = <http://www.simantics.org/Viewpoint-1.2>
 IMAGE = <http://www.simantics.org/Image2-1.2>
-
-MBC = MOD.ModelingBrowseContext
+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.Layer <T DIA.Layer
+
 DN.Edge <T DIA.Element : L0.Type
+    @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"
+
+DN.VertexDefaultMapping <R L0.HasProperty : DN.VertexMappingParameterType
+    L0.HasLabel "Default Vertex mapping"
+
+DN.Functions : L0.Library
+
+DN.VertexMappingParameterType <T SEL.GenericParameterType
+  @L0.assert SEL.HasDisplayValue
+    _ : SEL.DisplayValue
+      SEL.HasEnumerationValues DN.Functions.enumerationValues : L0.Function
+      SEL.HasCustomModifier DN.Functions.defaultVertexMappingModifier : L0.Function
+
+DN.EdgeMappingParameterType <T SEL.GenericParameterType
+  @L0.assert SEL.HasDisplayValue
+    _ : SEL.DisplayValue
+      SEL.HasEnumerationValues DN.Functions.enumerationValues
+      SEL.HasCustomModifier DN.Functions.defaultEdgeMappingModifier : L0.Function
+
+DN.MappingParameterType <T SEL.GenericParameterType
+  @L0.assert SEL.HasDisplayValue
+    _ : SEL.DisplayValue
+      SEL.HasEnumerationValues DN.Functions.enumerationValues
+      SEL.HasCustomModifier DN.Functions.mappingModifier : L0.Function
+
+DN.HasMapping <R L0.HasProperty : DN.MappingParameterType
+    L0.HasLabel "Mapping"
+
+DN.HasId <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "Id"
+    L0.HasRange L0.String
+    L0.readOnly false
+
+DN.Vertex.HasElevation <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "Elevation"
+    L0.HasRange L0.Double
+    L0.readOnly false
+
+DN.Vertex.HasSupplyTemperature <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "Supply Temperature"
+    L0.HasRange L0.Double
+    L0.readOnly false
+
+DN.Vertex.HasReturnTemperature <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "Return Temperature"
+    L0.HasRange L0.Double
+    L0.readOnly false
+
+DN.Vertex.HasSupplyPressure <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "Supply Pressure"
+    L0.HasRange L0.Double
+    L0.readOnly false
+
+DN.Vertex.HasReturnPressure <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "Return Pressure"
+    L0.HasRange L0.Double
+    L0.readOnly false
+
+DN.Vertex.HasDeltaPressure <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "Delta pressure"
+    L0.HasRange L0.Double
+    L0.readOnly false
+
+DN.Vertex.HasDeltaTemperature <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "Delta temperature"
+    L0.HasRange L0.Double
+    L0.readOnly false
+
+DN.Vertex.HasHeatPower <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "Heat Power"
+    L0.HasRange L0.Double
+    L0.readOnly false
+
+DN.Vertex.HasNominalHeadM <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "NominalHeadM"
+    L0.HasRange L0.Double
+    L0.readOnly false
+
+DN.Vertex.HasNominalHeadB <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "NominalHeadB"
+    L0.HasRange L0.Double
+    L0.readOnly false
+
+DN.Vertex.HasNominalFlow <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "Nominal Flow"
+    L0.HasRange L0.Double
+    L0.readOnly false
+
+DN.Vertex.HasMaximumHeadM <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "Maximum head M"
+    L0.HasRange L0.Double
+    L0.readOnly false
+
+DN.Vertex.HasHeatLoadDs <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "Heat Load ds"
+    L0.HasRange L0.Double
+    L0.readOnly false
+
+DN.Vertex.HasMassFlow <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "Mass Flow"
+    L0.HasRange L0.Double
+    L0.readOnly false
+
+DN.Vertex.HasVolFlow <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "Vol Flow"
+    L0.HasRange L0.Double
+    L0.readOnly false
+
+DN.Vertex.HasVelocity <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "Velocity"
+    L0.HasRange L0.Double
+    L0.readOnly false
+
+DN.Vertex.HasFlowArea <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "Flow Area"
+    L0.HasRange L0.Double
+    L0.readOnly false
+
+DN.Vertex.HasValvePosition <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "Valve position"
+    L0.HasRange L0.Double
+    L0.readOnly false
+
+DN.Vertex.HasNominalPressureLoss <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "Nominal Pressure Loss"
+    L0.HasRange L0.Double
+    L0.readOnly false
+
+DN.Edge.HasLength <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "Length"
+    L0.HasRange L0.Double
+    L0.readOnly true
+
+DN.Edge.HasDiameter <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "Diameter"
+    L0.HasRange L0.Double
+    L0.readOnly false
+
+DN.Edge.HasOuterDiameter <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "Outer Diameter"
+    L0.HasRange L0.Double
+    L0.readOnly false
+
+DN.Edge.HasNominalMassFlow <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "Nominal Mass Flow"
+    L0.HasRange L0.Double
+    L0.readOnly false
+
+DN.Edge.HasFlowArea <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "Flow Area"
+    L0.HasRange L0.Double
+    L0.readOnly false
+
+DN.Edge.HasKReturn <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "K Return"
+    L0.HasRange L0.Double
+    L0.readOnly false
+
+DN.Edge.HasKSupply <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "K Supply"
+    L0.HasRange L0.Double
+    L0.readOnly false
+
+DN.Edge.HasTGround <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "T Ground"
+    L0.HasRange L0.Double
+    L0.readOnly false
+
+DN.InLayer
+    @L0.defTag 
+    @L0.tag L0.Abstract
+
+DN.HasInLayerTag <R L0.HasProperty
+    L0.HasRange L0.Tag
 
 DN.Connection <T DIA.Connection
 
+DN.Diagram.MappedDiagram <R L0.IsWeaklyRelatedTo
+DN.MappedComponent <R L0.IsWeaklyRelatedTo
+
 DN.Diagram <T DIA.Diagram
 
+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.HasSpatialRefSystem <R L0.HasProperty
+    L0.HasRange DN.SpatialRefSystem
+
+DN.HasSRID <R L0.HasProperty
+    L0.HasRange L0.Integer
+
+DN.HasSRTEXT <R L0.HasProperty
+    L0.HasRange L0.String
+
+DN.Functions.compositeInstantiator : L0.ExternalValue
 
 DN.Composite <T STR.Composite
+    STR.Composite.instantiationFunction DN.Functions.compositeInstantiator
     @L0.assert MOD.HasModelingTemplate
         _ : MOD.DiagramTemplate
             MOD.HasDiagramType DN.Diagram
+    @L0.assert MOD.HasModelingTemplate
+        _ : DN.AddLayerToDNDiagramTemplate
 
-DN.HasStartVertex <R L0.HasProperty
+DN.HasStartVertex <R L0.DependsOn
+    L0.HasDomain DN.Edge
     L0.HasRange DN.Vertex
+    L0.InverseOf DN.HasStartVertex_Inverse <R L0.IsRelatedTo
 
-DN.HasEndVertex <R L0.HasProperty
+DN.HasEndVertex <R L0.DependsOn
+    L0.HasDomain DN.Edge
     L0.HasRange DN.Vertex
+    L0.InverseOf DN.HasEndVertex_Inverse <R L0.IsRelatedTo
+
+MBC = MOD.ModelingBrowseContext
 
 DNAC.newDiagramContribution : L0.Template
     @template %actionContext %label %image %action
@@ -43,15 +258,142 @@ DNAC.newDiagramContribution : L0.Template
 
 DNAC = DN.ActionContext : VP.BrowseContext
     VP.BrowseContext.IsIncludedIn MOD.ModelingActionContext
-    @DNAC.newDiagramContribution "DN Diagram" IMAGES.ConfigurationFolder ACTIONS.NewDNDiagram
+    @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"
+    MOD.NewComposite.HasDefaultName "NewNetworkDiagram"
 
 IMAGES = DN.Images : L0.Library
 
-IMAGES.ConfigurationFolder : IMAGE.PngImage
-    @L0.loadBytes "images/Configuration.png"
+IMAGES.MapImage : IMAGE.PngImage
+    @L0.loadBytes "images/map.png"
+
+// Component MAPPING
+DN.Mapping <T L0.Library
+
+DN.Functions.convertToValue : L0.ExternalValue
+
+DN.Mapping.Base <T L0.Value
+  @L0.assert L0.ConvertsToValueWith DN.Functions.convertToValue
+
+DN.Mapping.Terminal <T L0.Entity
+
+DN.Mapping.TerminalPair <T L0.Entity
+    >-- 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
+    // Common
+    >-- DN.Mapping.Id --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.ComponentType --> STR.ComponentType <R L0.DependsOn
+    >-- DN.Mapping.VertexMapping.ElevationAttribute --> L0.String <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.Terminals --> DN.Mapping.TerminalPair <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.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.Id
+    >-- DN.Mapping.ComponentType
+    >-- DN.Mapping.EdgeMapping.LengthAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.EdgeMapping.DiameterAttribute --> L0.String <R L0.HasProperty
+    >-- 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.Terminals
+
+DN.SCLMain : L0.SCLModule
+    L0.SCLModule.definition
+        """
+        include "Simantics/District/SCLMain"
+        """
+
+DN.DistrictProfile : DIA.Profile
+    L0.HasLabel "District Network Profile"
+    DIA.Profile.priority 0.0
+    DIA.HasEntries
+      _ : DIA.Profile
+        @L0.list
+          DN.DistrictProfile.entry
+            L0.HasLabel "Component names"
+            @DIA.groupStyleProfileEntry DN.ComponentNameStyle DN.Groups.ElementGroup
+          DN.DistrictProfile.entry1
+            L0.HasLabel "Id"
+            @DIA.groupStyleProfileEntry DN.ComponentIdStyle DN.Groups.ElementGroup
+          DN.DistrictProfile.entry2
+            L0.HasLabel "Edge Node Styling"
+            @DIA.groupStyleProfileEntry DN.EdgeNodeStyle DN.Groups.ElementGroup
+
+DN.Groups : L0.Library
+
+DN.Groups.ElementGroup : DIA.TypeGroup
+  DIA.TypeGroup.HasType DIA.Element
+
+DN.ComponentNameStyle : DIA.ResourceSCLTextGridStyle
+    @MOD.scl DIA.ResourceSCLTextGridStyle.texts 
+        """
+        districtNetworkProfileStyle "http://www.simantics.org/Layer0-1.1/HasName"
+        """
+        "String -> Variable -> <ReadGraph> (String, String, String)"
+    @G2D.fontProperty DIA.TextElement.font "Arial" 30 G2D.FontStyle.normal_font_style
+
+DN.ComponentIdStyle : DIA.ResourceSCLTextGridStyle
+    @MOD.scl DIA.ResourceSCLTextGridStyle.texts 
+        """
+        districtNetworkProfileStyle "http://www.simantics.org/Layer0-1.1/HasName" 
+        """
+        "String -> Variable -> <ReadGraph> (String, String, String)"
+    @G2D.fontProperty DIA.TextElement.font "Arial" 30 G2D.FontStyle.normal_font_style
+
+//DN.EdgeNodeGroup : DIA.Group
+
+//DN.Profiles : L0.Library
+
+DN.EdgeNodeStyle : DIA.Style
+
+// Templates
+
+//groupStyleEntry : L0.Template
+//    @template %subject %style %group
+//        %subject : DIA.GroupStyleProfileEntry
+//            DIA.ProfileEntry.HasStyle %style
+//            DIA.ProfileEntry.HasGroup %group
+
+
+//DN.Profiles.EdgeNodeStyle
+//    L0.HasLabel "Edge Node Style"
+//    @groupStyleEntry DN.EdgeNodeStyle DN.EdgeNodeGroup