]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.charts.ontology/graph/Chart.pgraph
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.charts.ontology / graph / Chart.pgraph
1 L0 = <http://www.simantics.org/Layer0-1.1>
2 L0X = <http://www.simantics.org/Layer0X-1.1>
3 G2D = <http://www.simantics.org/G2D-1.1>
4 DIA = <http://www.simantics.org/Diagram-2.2>
5 MOD = <http://www.simantics.org/Modeling-1.2>
6 SEL = <http://www.simantics.org/SelectionView-1.2>
7
8 CHART = <http://www.simantics.org/Charts-1.2> : L0.Ontology
9     @L0.new
10     L0.HasResourceClass "org.simantics.charts.ontology.ChartResource"
11
12 // -----------------------------------------------------------------------
13 // Charts
14
15 CHART.Chart <T L0.Entity : MOD.TypeWithChangeInformation
16     L0.HasDescription "Abstract base type for all chart types."
17     @L0.tag L0.Abstract
18
19 CHART.ChartGroup <T CHART.Chart : MOD.TypeWithChangeInformation
20     L0.HasDescription "A grouping of several charts. Intended to be viewed in a row."
21     @L0.property L0.ConsistsOf
22     //TODO: [L0.ConsistsOf all Chart]
23
24 // -----------------------------------------------------------------------
25 // TimeSeriesChart and TrendSpec
26
27 CHART.TimeSeriesChart <T CHART.Chart
28     L0.HasDescription "2D chart for viewing time series data."
29     @L0.singlePropertyDefault L0.HasName "Time Series Chart"
30     @L0.singlePropertyDefault CHART.Chart.YAxisMode CHART.YAxisMode.MultiAxis
31     @L0.singlePropertyDefault CHART.Chart.ShowMilestones true
32 //    @L0.singlePropertyDefault CHART.Chart.TimeFormat CHART.TimeFormat.Time
33     @L0.optionalProperty CHART.Chart.TimeWindowStart
34     @L0.optionalProperty CHART.Chart.TimeWindowLength
35     @L0.optionalProperty CHART.Chart.TimeWindowIncrement
36     @L0.assert CHART.Chart.TimeWindowStart
37         _ : CHART.ObtainedDouble
38     @L0.assert CHART.Chart.TimeWindowLength
39         _ : CHART.ObtainedDouble
40     @L0.assert CHART.Chart.TimeWindowIncrement
41         _ : CHART.ObtainedDouble
42     @L0.property L0.ConsistsOf
43     @L0.assert CHART.Chart.trackExperimentTime false
44     @L0.assert CHART.Chart.valueViewPosition
45         // Default value is top-right corner
46         [1.0, 0.0] : L0.DoubleArray
47     @L0.assert CHART.Chart.backgroundColor
48         [0.98, 0.98, 0.98, 0.8941, 0.8941, 0.9725] : L0.FloatArray
49     @L0.assert CHART.Chart.showGrid true
50     @L0.assert CHART.Chart.gridColor
51         [0.7451, 0.7451, 0.8627] : L0.FloatArray
52
53 // Y-Axis Mode
54 CHART.Chart.YAxisMode <R L0.IsRelatedTo : L0.FunctionalRelation
55     L0.HasLabel "Axis Mode"
56     L0.HasRange CHART.YAxisMode
57 CHART.YAxisMode <T L0.Property
58     L0.HasDescription "Setting how Y-Axis is shown between plots"
59     @L0.tag L0.Enumeration
60 CHART.YAxisMode.SingleAxis : CHART.YAxisMode
61     L0.HasLabel "Single Axis"
62 CHART.YAxisMode.MultiAxis : CHART.YAxisMode
63     L0.HasLabel "Multi Axis"
64
65 // Value Format (For Y-Axis)
66 //CHART.Chart.Item.ValueFormat <R L0.IsRelatedTo : L0.FunctionalRelation
67 //    L0.HasLabel "Value Format"
68 //    L0.HasRange CHART.ValueMode
69 //CHART.ValueFormat <T L0.Property
70 //    L0.HasDescription "Setting how the value is formatted in the Y-Axis"
71 //    @L0.property CHART.ValueFormat.Pattern
72 //    @L0.tag L0.Enumeration
73 //CHART.ValueFormat.Currency : CHART.ValueFormat
74 //    L0.HasLabel "Currency Format"
75 //    CHART.ValueFormat.Pattern "###,###.##############"
76 //CHART.ValueFormat.Engineering : CHART.ValueFormat
77 //    L0.HasLabel "Engineering Format"
78 //    CHART.ValueFormat.Pattern "##0.###E0"
79 //CHART.ValueFormat.Scientific : CHART.ValueFormat
80 //    L0.HasLabel "Scientific Format"
81 //    CHART.ValueFormat.Pattern "0.###E0"
82 //CHART.ValueFormat.Pattern <R L0.HasProperty
83 //    L0.HasLabel "Pattern"
84 //    L0.HasRange L0.String
85
86 CHART.HasColor <R L0.HasProperty : L0.FunctionalRelation
87     L0.HasLabel "Color"
88     L0.HasRange L0.Integer
89
90 // -----------------------------------------------------------------------
91 // ViewProfile
92
93 CHART.Chart.ShowMilestones <R L0.HasProperty : L0.FunctionalRelation : SEL.GenericParameterType
94     L0.HasLabel "Show Milestones"
95     ==> "Boolean" --> L0.Boolean
96
97 CHART.Chart.showGrid <R L0.HasProperty : L0.FunctionalRelation : SEL.GenericParameterType
98     L0.HasLabel "Show Grid"
99     ==> "Boolean" --> L0.Boolean
100
101 CHART.Chart.TimeWindowStart <R L0.HasProperty : L0.FunctionalRelation
102     L0.HasLabel "Time Window Start"
103     ==> "Double"
104 CHART.Chart.TimeWindowLength <R L0.HasProperty : L0.FunctionalRelation
105     L0.HasLabel "Time Window Length"
106     ==> "Double"
107 CHART.Chart.TimeWindowIncrement <R L0.HasProperty : L0.FunctionalRelation
108     L0.HasDescription "Percent of how much window is grown once end is reached"
109     L0.HasLabel "Time Window Increment"
110     ==> "Double"
111 CHART.Chart.trackExperimentTime <R L0.HasProperty : L0.FunctionalRelation : SEL.GenericParameterType
112     L0.HasDescription "If true, chart hairline view shall track current experiment time."
113     L0.HasLabel "Track Experiment Time"
114     ==> "Boolean" --> L0.Boolean 
115 CHART.Chart.valueViewPosition <R L0.HasProperty : L0.FunctionalRelation : SEL.GenericParameterType
116     L0.HasDescription "Relation position [x,y] of the momentary value view. The values of x and y are between 0 and 1 where 0 means the top/left and 1 bottom/right."
117     L0.HasLabel "Value View Position"
118     ==> "Vector Double" --> L0.DoubleArray 
119 CHART.Chart.backgroundColor <R L0.HasProperty : L0.FunctionalRelation : SEL.GenericParameterType
120     L0.HasDescription "An array of (r,g,b) floating point triples to describe either a single color or a color gradient."
121     L0.HasLabel "Background Colors"
122     ==> "Vector Float" --> L0.FloatArray 
123 CHART.Chart.gridColor <R L0.HasProperty : L0.FunctionalRelation : SEL.GenericParameterType
124     L0.HasDescription "An (r,g,b) floating point triple to describe a single color."
125     L0.HasLabel "Grid Color"
126     ==> "Vector Float" --> L0.FloatArray 
127
128 // -----------------------------------------------------------------------
129 // Chart.Item
130 CHART.Chart.Item <T L0.Entity : MOD.TypeWithChangeInformation
131     @L0.property CHART.Chart.Item.HasSubscriptionItem
132     @L0.singleProperty CHART.Chart.Item.Index
133     @L0.assert CHART.Chart.Item.Index 0
134     //@L0.assert L0.HasLabel ""
135     // Subscription UUID  
136     //@L0.singlePropertyDefault CHART.Chart.Item.LineMode CHART.LineMode.LinearInterpolation
137     @L0.singlePropertyDefault CHART.Chart.Item.DrawMode CHART.DrawMode.Line
138     @L0.singlePropertyDefault CHART.Chart.Item.Renderer CHART.Renderer.Analog
139     @L0.singlePropertyDefault CHART.Chart.Item.ScaleMode CHART.ScaleMode.AutoScale
140     //@L0.optionalProperty CHART.HasScale
141     //@L0.assert CHART.Hascale CHART.DefaultScale
142     @L0.singleProperty CHART.Chart.Item.ScaleMode.Min
143     @L0.assert CHART.Chart.Item.ScaleMode.Min 0.0
144     @L0.singleProperty CHART.Chart.Item.ScaleMode.Max
145     @L0.assert CHART.Chart.Item.ScaleMode.Max 120.0
146     @L0.singleProperty CHART.Chart.Item.Index
147     //@L0.assert CHART.Chart.Item.ValueFormat CHART.ValueFormat.Currency
148     //@L0.singleProperty CHART.Chart.Item.ValueFormat
149     @L0.assert L0.HasLabel 
150       _ : L0.Value
151         L0.ConvertsToValueWith CHART.Functions.chartItemLabel
152         L0.readOnly true
153     >-- CHART.Chart.Item.subscriptionInfo ==> "String" --> L0.Value <R L0.HasProperty : L0.FunctionalRelation : SEL.GenericParameterType
154         L0.HasLabel "Subscription Info"
155     @L0.assert CHART.Chart.Item.subscriptionInfo
156       _ : L0.Value
157         L0.ConvertsToValueWith CHART.Functions.chartItemSubscriptionInfo
158         L0.readOnly true
159     >-- CHART.Chart.Item.hidden ==> "Boolean" --> L0.Boolean <R L0.HasProperty : L0.FunctionalRelation : SEL.GenericParameterType
160         L0.HasLabel "Hidden"
161         L0.HasDescription "Used for marking chart items hidden."
162     @L0.assert CHART.Chart.Item.hidden false
163     @L0.optionalProperty G2D.HasStrokeWidth
164     @L0.optionalProperty G2D.HasColor
165
166 CHART.Chart.Item.HasSubscriptionItem <R L0.IsRelatedTo
167     --> MOD.Subscription.Item
168     L0.InverseOf CHART.Chart.Item.HasChartItem <R L0.IsWeaklyRelatedTo
169         --> CHART.Chart.Item
170
171 CHART.Chart.Item.Index <R L0.HasProperty : L0.FunctionalRelation
172     L0.HasLabel "Position and color index"
173     --> L0.Integer
174
175
176 //CHART.DefaultScale = { min = 0, max = 120.0 } : CHART.DoubleRange
177 //CHART.Chart.Item.LineMode <R L0.IsRelatedTo : L0.FunctionalRelation
178 //    L0.HasLabel "Line Mode"
179 //    L0.HasRange CHART.LineMode
180 //CHART.LineMode <T L0.Property
181 //    L0.HasDescription "Describes how the plot line is drawn between the dots, i.e. the data samples."
182 //    @L0.tag L0.Enumeration
183 //CHART.LineMode.LinearInterpolation : CHART.LineMode
184 //    L0.HasLabel "Line"
185 //CHART.LineMode.StepWise : CHART.LineMode
186 //    L0.HasLabel "Step"
187
188 CHART.Chart.Item.Renderer <R L0.IsRelatedTo: L0.FunctionalRelation
189     L0.HasLabel "Renderer"
190     L0.HasRange CHART.Renderer
191 CHART.Renderer <T L0.Property
192     L0.HasDescription "Describes the renderer to use for drawing the 2d plot."
193     @L0.tag L0.Enumeration
194 CHART.Renderer.Binary : CHART.Renderer
195     L0.HasLabel "Binary"
196 CHART.Renderer.Analog : CHART.Renderer
197     L0.HasLabel "Analog"
198
199 // Scale Mode
200 CHART.Chart.Item.ScaleMode <R L0.IsRelatedTo : L0.FunctionalRelation
201     L0.HasLabel "Scale"
202     L0.HasRange CHART.ScaleMode
203 CHART.ScaleMode <T L0.Property
204     L0.HasDescription "The mode how a plot is scaled to the viewport."
205     @L0.tag L0.Enumeration
206 CHART.ScaleMode.ManualScale : CHART.ScaleMode
207     L0.HasLabel "Manual scale"
208     @L0.singlePropertyDefault CHART.Chart.Item.ScaleMode.Min 0.0
209     @L0.singlePropertyDefault CHART.Chart.Item.ScaleMode.Max 120.0
210 CHART.ScaleMode.AutoScale : CHART.ScaleMode
211     L0.HasLabel "Auto scale" // Fit all samples
212
213 CHART.Chart.Item.ScaleMode.Min <R L0.HasProperty : L0.FunctionalRelation : SEL.GenericParameterType
214     L0.HasLabel "Manual Scale Min"
215     L0.HasRange L0.Double
216 CHART.Chart.Item.ScaleMode.Max <R L0.HasProperty : L0.FunctionalRelation : SEL.GenericParameterType
217     L0.HasLabel "Manual Scale Max"
218     L0.HasRange L0.Double
219
220
221 // Time Format
222 //CHART.Chart.TimeFormat <R L0.IsRelatedTo : L0.FunctionalRelation
223 //    L0.HasLabel "Time Format"
224 //    L0.HasRange CHART.TimeFormat
225 //CHART.TimeFormat <T L0.Property
226 //    L0.HasDescription "The format how time axis is printed."
227 //    @L0.tag L0.Enumeration
228 //CHART.TimeFormat.Time : CHART.TimeFormat
229 //    L0.HasLabel "Time HH:mm:ss.SSS"
230 //CHART.TimeFormat.Decimal : CHART.TimeFormat
231 //    L0.HasLabel "Decimal"
232
233 /*
234 CHART.HasScale <R L0.HasProperty
235     L0.HasLabel "Scale Values"
236     L0.HasRange CHART.DoubleRange
237 CHART.DoubleRange <T L0.Literal
238     @L0.assert L0.HasDataType ${
239         min : Double,
240         max : Double
241     }
242 */
243
244 CHART.Chart.Item.DrawMode <R L0.IsRelatedTo : L0.FunctionalRelation
245     L0.HasLabel "Draw Mode"
246     L0.HasRange CHART.DrawMode
247 CHART.DrawMode <T L0.Property
248     @L0.tag L0.Enumeration
249     
250 CHART.DrawMode.DeviationAndAverage : CHART.DrawMode
251     L0.HasLabel "Average and Deviation"
252 CHART.DrawMode.DeviationAndLine : CHART.DrawMode
253     L0.HasLabel "Line and Deviation"
254 CHART.DrawMode.DeviationAndSample : CHART.DrawMode
255     L0.HasLabel "Sample and Deviation"
256 CHART.DrawMode.Sample : CHART.DrawMode
257     L0.HasLabel "Sample"
258 CHART.DrawMode.Average : CHART.DrawMode
259     L0.HasLabel "Average"
260 CHART.DrawMode.Line : CHART.DrawMode
261     L0.HasLabel "Line"
262 CHART.DrawMode.Deviation : CHART.DrawMode
263     L0.HasLabel "Deviation"
264 //CHART.DrawMode.DeviationAndMedian : CHART.DrawMode
265 //    L0.HasLabel "Median and Deviation"
266 //CHART.DrawMode.Median : CHART.DrawMode
267 //    L0.HasLabel "Median"
268
269 // -----------------------------------------------------------------------
270 //// USEFUL ?
271
272 /*
273 CHART.HasTimeSegment <R L0.HasProperty : L0.FunctionalRelation
274     L0.HasRange CHART.TimeSegment
275
276 CHART.TimeSegment <T L0.Entity
277     @L0.singleProperty CHART.HasStartTime
278     @L0.singleProperty CHART.HasEndTime
279 CHART.HasStartTime <R L0.HasProperty : L0.FunctionalRelation
280     L0.HasRange L0.Double
281 CHART.HasEndTime <R L0.HasProperty : L0.FunctionalRelation
282     L0.HasRange L0.Double 
283
284 CHART.HasTimePresentation <R L0.IsRelatedTo : L0.FunctionalRelation
285     L0.HasRange CHART.TimePresentation
286 CHART.TimePresentation <T L0.Property
287     L0.HasDescription "Setting how time is shown on UI"
288     @L0.tag L0.Enumeration
289 CHART.TimePresentation.Absolute : CHART.TimePresentation
290 CHART.TimePresentation.Relative : CHART.TimePresentation
291
292 CHART.HasGridMode <R L0.HasProperty : L0.FunctionalRelation
293     L0.HasRange CHART.GridMode
294 CHART.GridMode <T L0.Property
295     L0.HasDescription "The mode how grid lines are drawn"
296     @L0.tag L0.Abstract
297 CHART.DisabledGrid <T CHART.GridMode
298 CHART.AdaptiveGrid <T CHART.GridMode
299     @L0.singleProperty CHART.HasSpacing
300 CHART.ManualGrid <T CHART.GridMode
301     @L0.singleProperty CHART.HasXLines
302     @L0.singleProperty CHART.HasYLines
303 CHART.HasXLines <R L0.HasProperty : L0.FunctionalRelation
304     L0.HasRange L0.Double
305 CHART.HasYLines <R L0.HasProperty : L0.FunctionalRelation
306     L0.HasRange L0.Double
307 CHART.HasSpacing <R L0.HasProperty : L0.FunctionalRelation
308     L0.HasRange L0.Double
309 */
310
311 //---------------------------
312 // Templates
313
314 CHART.ChartTemplate <T L0.Entity
315 CHART.HasDefaultChartTemplate <R L0.DependsOn : L0.FunctionalRelation
316 CHART.ObtainedDouble <T L0.Value
317
318 //---------------------------
319 // Simple templates
320
321 CHART.WholeHistoryChartTemplate : CHART.ChartTemplate
322   L0.HasLabel "Whole history"
323   CHART.Chart.TimeWindowIncrement 50.0
324
325 CHART.Last60SecondsChartTemplate : CHART.ChartTemplate
326   L0.HasLabel "Last 60 seconds"
327   CHART.Chart.TimeWindowLength 60.0
328   CHART.Chart.TimeWindowIncrement 50.0
329
330 CHART.Last10MinutesChartTemplate : CHART.ChartTemplate
331   L0.HasLabel "Last 10 minutes"
332   CHART.Chart.TimeWindowLength 600.0
333   CHART.Chart.TimeWindowIncrement 50.0
334
335
336 CHART.Functions : L0.Library
337 CHART.Functions.chartItemLabel : L0.ExternalValue
338 CHART.Functions.chartItemSubscriptionInfo : L0.ExternalValue