]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.district.network.ontology/graph/DistrictNetwork.pgraph
Add default mappings for right/left click & prevent edge drawing
[simantics/district.git] / org.simantics.district.network.ontology / graph / DistrictNetwork.pgraph
1 L0 = <http://www.simantics.org/Layer0-1.1>
2 DIA = <http://www.simantics.org/Diagram-2.2>
3 STR = <http://www.simantics.org/Structural-1.2>
4 MOD = <http://www.simantics.org/Modeling-1.2>
5 VP = <http://www.simantics.org/Viewpoint-1.2>
6 IMAGE = <http://www.simantics.org/Image2-1.2>
7 SEL = <http://www.simantics.org/SelectionView-1.2>
8 SEL_UI = <http://www.simantics.org/SelectionViewUI-1.1>
9 G2D = <http://www.simantics.org/G2D-1.1>
10
11 DN = <http://www.simantics.org/DistrictNetwork-1.0> : L0.Ontology
12     @L0.new
13     L0.Ontology.global true
14     L0.HasResourceClass "org.simantics.district.network.ontology.DistrictNetworkResource"
15
16 // ----------------------------------------------------------------------------
17
18 DN.SCLMain : L0.SCLModule
19     L0.SCLModule.definition
20         """
21 include "Simantics/District/SCLMain"
22 """
23
24 // ----------------------------------------------------------------------------
25
26 defProperty : L0.Template
27     @template %subject %label %range
28         %subject <R L0.HasProperty : SEL.GenericParameterType
29             L0.HasLabel %label : L0.String
30             L0.HasRange %range
31
32 // ----------------------------------------------------------------------------
33
34 DN.Diagram <T DIA.Diagram
35 DN.Layer <T DIA.Layer
36 DN.Connection <T DIA.Connection
37 DN.Element <T DIA.Element : L0.Type
38
39 DN.Vertex <T DN.Element
40     >-- DN.Vertex.HasElevation
41         @defProperty "Elevation" L0.Double
42     >-- DN.Vertex.HasAddress
43         @defProperty "Address" L0.String
44     >-- DN.Vertex.HasSupplyTemperature
45         @defProperty "Supply Temperature" L0.Double 
46     >-- DN.Vertex.HasReturnTemperature 
47         @defProperty "Return Temperature" L0.Double
48     >-- DN.Vertex.HasSupplyPressure
49         @defProperty "Supply Pressure" L0.Double 
50     >-- DN.Vertex.HasReturnPressure
51         @defProperty "Return Pressure" L0.Double 
52     >-- DN.Vertex.HasDeltaPressure
53         @defProperty "Delta pressure" L0.Double 
54     >-- DN.Vertex.HasDeltaTemperature
55         @defProperty "Delta temperature" L0.Double 
56     >-- DN.Vertex.HasHeatPower
57         @defProperty "Heat Power" L0.Double 
58     >-- DN.Vertex.HasNominalHeadM
59         @defProperty "NominalHeadM" L0.Double 
60     >-- DN.Vertex.HasNominalHeadB
61         @defProperty "NominalHeadB" L0.Double 
62     >-- DN.Vertex.HasNominalFlow
63         @defProperty "Nominal Flow" L0.Double 
64     >-- DN.Vertex.HasMaximumHeadM
65         @defProperty "Maximum head M" L0.Double 
66     >-- DN.Vertex.HasHeatLoadDs
67         @defProperty "Heat Load ds" L0.Double 
68     >-- DN.Vertex.HasMassFlow
69         @defProperty "Mass Flow" L0.Double 
70     >-- DN.Vertex.HasVolFlow
71         @defProperty "Vol Flow" L0.Double 
72     >-- DN.Vertex.HasVelocity
73         @defProperty "Velocity" L0.Double 
74     >-- DN.Vertex.HasFlowArea
75         @defProperty "Flow Area" L0.Double 
76     >-- DN.Vertex.HasValvePosition
77         @defProperty "Valve position" L0.Double 
78     >-- DN.Vertex.HasNominalPressureLoss
79         @defProperty "Nominal Pressure Loss" L0.Double 
80     @L0.assert DN.Vertex.HasElevation 0.0
81
82 DN.Edge <T DN.Element
83     >-- DN.Edge.HasElevation
84         @defProperty "Elevation" L0.Double
85     >-- DN.Edge.HasLength 
86         @defProperty "Length" L0.Double
87         L0.readOnly true
88     >-- DN.Edge.HasGeometry
89         @defProperty "Detailed Geometry" L0.DoubleArray
90     >-- DN.Edge.HasDiameter
91         @defProperty "Diameter" L0.Double
92     >-- DN.Edge.HasOuterDiameter
93         @defProperty "Outer Diameter" L0.Double
94     >-- DN.Edge.HasNominalMassFlow
95         @defProperty "Nominal Mass Flow" L0.Double
96     >-- DN.Edge.HasFlowArea
97         @defProperty "Flow Area" L0.Double
98     >-- DN.Edge.HasKReturn
99         @defProperty "K Return" L0.Double
100     >-- DN.Edge.HasKSupply
101         @defProperty "K Supply" L0.Double
102     >-- DN.Edge.HasTGround
103         @defProperty "T Ground" L0.Double
104     @L0.assert DN.Edge.HasDiameter 0.1
105     @L0.assert DN.Edge.HasOuterDiameter 0.11
106
107 // ----------------------------------------------------------------------------
108
109 DN.EdgeDefaultMapping <R L0.HasProperty : DN.EdgeMappingParameterType
110     L0.HasLabel "Default Edge mapping"
111
112 DN.VertexDefaultMapping <R L0.HasProperty : DN.VertexMappingParameterType
113     L0.HasLabel "Default Vertex mapping"
114
115 DN.RightClickDefaultMapping <R L0.HasProperty : DN.VertexMappingParameterType
116     L0.HasLabel "Right click Vertex mapping"
117
118 DN.LeftClickDefaultMapping <R L0.HasProperty : DN.VertexMappingParameterType
119     L0.HasLabel "Left click Vertex mapping"
120
121 // ----------------------------------------------------------------------------
122
123 DN.Functions : L0.Library
124
125 DN.VertexMappingParameterType <T SEL.GenericParameterType
126   @L0.assert SEL.HasDisplayValue
127     _ : SEL.DisplayValue
128       SEL.HasEnumerationValues DN.Functions.enumerationValues : L0.Function
129       SEL.HasCustomModifier DN.Functions.defaultVertexMappingModifier : L0.Function
130
131 DN.EdgeMappingParameterType <T SEL.GenericParameterType
132   @L0.assert SEL.HasDisplayValue
133     _ : SEL.DisplayValue
134       SEL.HasEnumerationValues DN.Functions.enumerationValues
135       SEL.HasCustomModifier DN.Functions.defaultEdgeMappingModifier : L0.Function
136
137 DN.MappingParameterType <T SEL.GenericParameterType
138   @L0.assert SEL.HasDisplayValue
139     _ : SEL.DisplayValue
140       SEL.HasEnumerationValues DN.Functions.enumerationValues
141       SEL.HasCustomModifier DN.Functions.mappingModifier : L0.Function
142
143 // ----------------------------------------------------------------------------
144
145 DN.HasMapping <R L0.HasProperty : DN.MappingParameterType
146     L0.HasLabel "Mapping"
147
148 DN.HasId --> L0.String <R L0.HasProperty : SEL.GenericParameterType
149     L0.HasLabel "Id"
150     L0.readOnly false
151
152 DN.InLayer
153     @L0.defTag 
154     @L0.tag L0.Abstract
155
156 DN.HasInLayerTag <R L0.HasProperty
157     L0.HasRange L0.Tag
158
159 // For associating typical diagram source and instance structures with each other
160 DN.Diagram.MappedDiagram <R L0.IsWeaklyRelatedTo
161     L0.InverseOf DN.Diagram.MappedFromDiagram <R L0.IsWeaklyRelatedTo
162 DN.MappedComponent <R L0.IsWeaklyRelatedTo
163     L0.InverseOf DN.MappedFromElement <R L0.IsWeaklyRelatedTo
164
165 DN.Diagram.trackChangesEnabled <R L0.HasProperty : SEL.GenericParameterType
166     L0.HasRange L0.Boolean
167     L0.HasLabel "Track changes"
168
169 DN.Diagram.splitToMultipleEnabled <R L0.HasProperty : SEL.GenericParameterType
170     L0.HasRange L0.Boolean
171     L0.HasLabel "Split To Multiple Diagrams"
172
173 DN.AddLayerToDNDiagramTemplate <T L0.Template
174
175 DN.EPSG_4326 : DN.SpatialRefSystem
176     L0.HasLabel "EPSG:4326"
177     DN.HasSRID 4326
178
179 DN.SpatialRefSystem <T L0.Property
180     L0.readOnly true
181
182 DN.HasSpatialRefSystem <R L0.HasProperty : SEL.GenericParameterType
183     L0.HasRange DN.SpatialRefSystem
184     L0.HasLabel "Spatial Reference System"
185
186 DN.HasSRID <R L0.HasProperty
187     L0.HasRange L0.Integer
188
189 DN.HasSRTEXT <R L0.HasProperty
190     L0.HasRange L0.String
191
192 DN.Functions.compositeInstantiator : L0.ExternalValue
193
194 DN.Composite <T STR.Composite
195     STR.Composite.instantiationFunction DN.Functions.compositeInstantiator
196     @L0.assert MOD.HasModelingTemplate
197         _ : MOD.DiagramTemplate
198             MOD.HasDiagramType DN.Diagram
199     @L0.assert MOD.HasModelingTemplate
200         _ : DN.AddLayerToDNDiagramTemplate
201
202 DN.HasStartVertex <R L0.DependsOn
203     L0.HasDomain DN.Edge
204     L0.HasRange DN.Vertex
205     L0.InverseOf DN.HasStartVertex_Inverse <R L0.IsRelatedTo
206
207 DN.HasEndVertex <R L0.DependsOn
208     L0.HasDomain DN.Edge
209     L0.HasRange DN.Vertex
210     L0.InverseOf DN.HasEndVertex_Inverse <R L0.IsRelatedTo
211
212 // ----------------------------------------------------------------------------
213
214 // Component MAPPING
215 DN.Mapping <T L0.Library
216
217 DN.Functions.convertToValue : L0.ExternalValue
218
219 DN.Mapping.Base <T L0.Value
220   >-- DN.Mapping.Id --> L0.String <R L0.HasProperty
221   >-- DN.Mapping.ComponentType --> STR.ComponentType <R L0.DependsOn
222   >-- DN.Mapping.Terminals --> DN.Mapping.TerminalPair <R L0.HasProperty
223   @L0.assert L0.ConvertsToValueWith DN.Functions.convertToValue
224
225 DN.Mapping.Terminal <T L0.Entity
226     L0.HasRange L0.String
227
228 DN.Mapping.TerminalPair <T L0.Property
229     >-- DN.Mapping.InputTerminal --> DN.Mapping.Terminal <R L0.HasProperty
230     >-- DN.Mapping.OutputTerminal --> DN.Mapping.Terminal <R L0.HasProperty
231
232 DN.Mapping.VertexMapping <T DN.Mapping.Base
233     // Common
234     >-- DN.Mapping.VertexMapping.ElevationAttribute --> L0.String <R L0.HasProperty
235     >-- DN.Mapping.VertexMapping.SupplyTemperatureAttribute --> L0.String <R L0.HasProperty
236     >-- DN.Mapping.VertexMapping.ReturnTemperatureAttribute --> L0.String <R L0.HasProperty
237     >-- DN.Mapping.VertexMapping.SupplyPressureAttribute --> L0.String <R L0.HasProperty
238     >-- DN.Mapping.VertexMapping.ReturnPressureAttribute --> L0.String <R L0.HasProperty
239     >-- DN.Mapping.VertexMapping.DeltaPressureAttribute --> L0.String <R L0.HasProperty
240     >-- DN.Mapping.VertexMapping.DeltaTemperatureAttribute --> L0.String <R L0.HasProperty
241     >-- DN.Mapping.VertexMapping.XAttribute --> L0.String <R L0.HasProperty
242     >-- DN.Mapping.VertexMapping.YAttribute --> L0.String <R L0.HasProperty
243     // Production
244     >-- DN.Mapping.VertexMapping.dpAttribute --> L0.String <R L0.HasProperty
245     >-- DN.Mapping.VertexMapping.dtAttribute --> L0.String <R L0.HasProperty
246     >-- DN.Mapping.VertexMapping.HeatPowerAttribute --> L0.String <R L0.HasProperty
247     >-- DN.Mapping.VertexMapping.NominalHeadMAttribute --> L0.String <R L0.HasProperty
248     >-- DN.Mapping.VertexMapping.NominalHeadBAttribute --> L0.String <R L0.HasProperty
249     >-- DN.Mapping.VertexMapping.NominalFlowAttribute --> L0.String <R L0.HasProperty
250     >-- DN.Mapping.VertexMapping.MaximumHeadMAttribute --> L0.String <R L0.HasProperty
251     // Consumers
252     >-- DN.Mapping.VertexMapping.HeatLoadDsAttribute --> L0.String <R L0.HasProperty
253     >-- DN.Mapping.VertexMapping.AddressAttribute --> L0.String <R L0.HasProperty
254     >-- DN.Mapping.VertexMapping.MassFlowAttribute --> L0.String <R L0.HasProperty
255     >-- DN.Mapping.VertexMapping.VolFlowAttribute --> L0.String <R L0.HasProperty
256     >-- DN.Mapping.VertexMapping.VelocityAttribute --> L0.String <R L0.HasProperty
257     >-- DN.Mapping.VertexMapping.FlowAreaAttribute --> L0.String <R L0.HasProperty
258     >-- DN.Mapping.VertexMapping.ValvePositionAttribute --> L0.String <R L0.HasProperty
259     >-- DN.Mapping.VertexMapping.NominalPressureLossAttribute --> L0.String <R L0.HasProperty
260     >-- DN.Mapping.VertexMapping.NominalMassFlowAttribute --> L0.String <R L0.HasProperty
261
262 DN.Mapping.EdgeMapping <T DN.Mapping.Base
263     >-- DN.Mapping.EdgeMapping.LengthAttribute --> L0.String <R L0.HasProperty
264     >-- DN.Mapping.EdgeMapping.DiameterAttribute --> L0.String <R L0.HasProperty
265     >-- DN.Mapping.EdgeMapping.OuterDiameterAttribute --> L0.String <R L0.HasProperty
266     >-- DN.Mapping.EdgeMapping.NominalMassFlowAttribute --> L0.String <R L0.HasProperty
267     >-- DN.Mapping.EdgeMapping.FlowAreaAttribute --> L0.String <R L0.HasProperty
268     >-- DN.Mapping.EdgeMapping.KReturnAttribute --> L0.String <R L0.HasProperty
269     >-- DN.Mapping.EdgeMapping.KSupplyAttribute --> L0.String <R L0.HasProperty
270     >-- DN.Mapping.EdgeMapping.TGroundAttribute --> L0.String <R L0.HasProperty
271     >-- DN.Mapping.EdgeMapping.ElevationAttribute --> L0.String <R L0.HasProperty
272
273
274 // Allowed connection types
275 DN.SupplyConnectionType <T STR.ConnectionType
276
277 DN.SupplyInConnectionType : DN.SupplyConnectionType : STR.InputDirection
278     STR.SupportsDirection DN.SupplyOutConnectionType
279     STR.ConnectionType.isUserSelectable true
280
281 DN.SupplyOutConnectionType : DN.SupplyConnectionType : STR.OutputDirection
282     STR.SupportsDirection DN.SupplyInConnectionType
283     STR.ConnectionType.isUserSelectable true
284
285 DN.ReturnConnectionType <T STR.ConnectionType
286
287 DN.ReturnInConnectionType : DN.ReturnConnectionType : STR.InputDirection
288     STR.SupportsDirection DN.ReturnOutConnectionType
289     STR.ConnectionType.isUserSelectable true
290
291 DN.ReturnOutConnectionType : DN.ReturnConnectionType : STR.OutputDirection
292     STR.SupportsDirection DN.ReturnInConnectionType
293     STR.ConnectionType.isUserSelectable true