]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.charts.ontology/graph/Chart.pgraph
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.charts.ontology / graph / Chart.pgraph
diff --git a/bundles/org.simantics.charts.ontology/graph/Chart.pgraph b/bundles/org.simantics.charts.ontology/graph/Chart.pgraph
new file mode 100644 (file)
index 0000000..f077a12
--- /dev/null
@@ -0,0 +1,338 @@
+L0 = <http://www.simantics.org/Layer0-1.1>\r
+L0X = <http://www.simantics.org/Layer0X-1.1>\r
+G2D = <http://www.simantics.org/G2D-1.1>\r
+DIA = <http://www.simantics.org/Diagram-2.2>\r
+MOD = <http://www.simantics.org/Modeling-1.2>\r
+SEL = <http://www.simantics.org/SelectionView-1.2>\r
+\r
+CHART = <http://www.simantics.org/Charts-1.2> : L0.Ontology\r
+    @L0.new\r
+    L0.HasResourceClass "org.simantics.charts.ontology.ChartResource"\r
+\r
+// -----------------------------------------------------------------------\r
+// Charts\r
+\r
+CHART.Chart <T L0.Entity : MOD.TypeWithChangeInformation\r
+    L0.HasDescription "Abstract base type for all chart types."\r
+    @L0.tag L0.Abstract\r
+\r
+CHART.ChartGroup <T CHART.Chart : MOD.TypeWithChangeInformation\r
+    L0.HasDescription "A grouping of several charts. Intended to be viewed in a row."\r
+    @L0.property L0.ConsistsOf\r
+    //TODO: [L0.ConsistsOf all Chart]\r
+\r
+// -----------------------------------------------------------------------\r
+// TimeSeriesChart and TrendSpec\r
+\r
+CHART.TimeSeriesChart <T CHART.Chart\r
+    L0.HasDescription "2D chart for viewing time series data."\r
+    @L0.singlePropertyDefault L0.HasName "Time Series Chart"\r
+    @L0.singlePropertyDefault CHART.Chart.YAxisMode CHART.YAxisMode.MultiAxis\r
+    @L0.singlePropertyDefault CHART.Chart.ShowMilestones true\r
+//    @L0.singlePropertyDefault CHART.Chart.TimeFormat CHART.TimeFormat.Time\r
+    @L0.optionalProperty CHART.Chart.TimeWindowStart\r
+    @L0.optionalProperty CHART.Chart.TimeWindowLength\r
+    @L0.optionalProperty CHART.Chart.TimeWindowIncrement\r
+    @L0.assert CHART.Chart.TimeWindowStart\r
+        _ : CHART.ObtainedDouble\r
+    @L0.assert CHART.Chart.TimeWindowLength\r
+        _ : CHART.ObtainedDouble\r
+    @L0.assert CHART.Chart.TimeWindowIncrement\r
+        _ : CHART.ObtainedDouble\r
+    @L0.property L0.ConsistsOf\r
+    @L0.assert CHART.Chart.trackExperimentTime false\r
+    @L0.assert CHART.Chart.valueViewPosition\r
+        // Default value is top-right corner\r
+        [1.0, 0.0] : L0.DoubleArray\r
+    @L0.assert CHART.Chart.backgroundColor\r
+        [0.98, 0.98, 0.98, 0.8941, 0.8941, 0.9725] : L0.FloatArray\r
+    @L0.assert CHART.Chart.showGrid true\r
+    @L0.assert CHART.Chart.gridColor\r
+        [0.7451, 0.7451, 0.8627] : L0.FloatArray\r
+\r
+// Y-Axis Mode\r
+CHART.Chart.YAxisMode <R L0.IsRelatedTo : L0.FunctionalRelation\r
+    L0.HasLabel "Axis Mode"\r
+    L0.HasRange CHART.YAxisMode\r
+CHART.YAxisMode <T L0.Property\r
+    L0.HasDescription "Setting how Y-Axis is shown between plots"\r
+    @L0.tag L0.Enumeration\r
+CHART.YAxisMode.SingleAxis : CHART.YAxisMode\r
+    L0.HasLabel "Single Axis"\r
+CHART.YAxisMode.MultiAxis : CHART.YAxisMode\r
+    L0.HasLabel "Multi Axis"\r
+\r
+// Value Format (For Y-Axis)\r
+//CHART.Chart.Item.ValueFormat <R L0.IsRelatedTo : L0.FunctionalRelation\r
+//    L0.HasLabel "Value Format"\r
+//    L0.HasRange CHART.ValueMode\r
+//CHART.ValueFormat <T L0.Property\r
+//    L0.HasDescription "Setting how the value is formatted in the Y-Axis"\r
+//    @L0.property CHART.ValueFormat.Pattern\r
+//    @L0.tag L0.Enumeration\r
+//CHART.ValueFormat.Currency : CHART.ValueFormat\r
+//    L0.HasLabel "Currency Format"\r
+//    CHART.ValueFormat.Pattern "###,###.##############"\r
+//CHART.ValueFormat.Engineering : CHART.ValueFormat\r
+//    L0.HasLabel "Engineering Format"\r
+//    CHART.ValueFormat.Pattern "##0.###E0"\r
+//CHART.ValueFormat.Scientific : CHART.ValueFormat\r
+//    L0.HasLabel "Scientific Format"\r
+//    CHART.ValueFormat.Pattern "0.###E0"\r
+//CHART.ValueFormat.Pattern <R L0.HasProperty\r
+//    L0.HasLabel "Pattern"\r
+//    L0.HasRange L0.String\r
+\r
+CHART.HasColor <R L0.HasProperty : L0.FunctionalRelation\r
+    L0.HasLabel "Color"\r
+    L0.HasRange L0.Integer\r
+\r
+// -----------------------------------------------------------------------\r
+// ViewProfile\r
+\r
+CHART.Chart.ShowMilestones <R L0.HasProperty : L0.FunctionalRelation : SEL.GenericParameterType\r
+    L0.HasLabel "Show Milestones"\r
+    ==> "Boolean" --> L0.Boolean\r
+\r
+CHART.Chart.showGrid <R L0.HasProperty : L0.FunctionalRelation : SEL.GenericParameterType\r
+    L0.HasLabel "Show Grid"\r
+    ==> "Boolean" --> L0.Boolean\r
+\r
+CHART.Chart.TimeWindowStart <R L0.HasProperty : L0.FunctionalRelation\r
+    L0.HasLabel "Time Window Start"\r
+    ==> "Double"\r
+CHART.Chart.TimeWindowLength <R L0.HasProperty : L0.FunctionalRelation\r
+    L0.HasLabel "Time Window Length"\r
+    ==> "Double"\r
+CHART.Chart.TimeWindowIncrement <R L0.HasProperty : L0.FunctionalRelation\r
+    L0.HasDescription "Percent of how much window is grown once end is reached"\r
+    L0.HasLabel "Time Window Increment"\r
+    ==> "Double"\r
+CHART.Chart.trackExperimentTime <R L0.HasProperty : L0.FunctionalRelation : SEL.GenericParameterType\r
+    L0.HasDescription "If true, chart hairline view shall track current experiment time."\r
+    L0.HasLabel "Track Experiment Time"\r
+    ==> "Boolean" --> L0.Boolean \r
+CHART.Chart.valueViewPosition <R L0.HasProperty : L0.FunctionalRelation : SEL.GenericParameterType\r
+    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."\r
+    L0.HasLabel "Value View Position"\r
+    ==> "Vector Double" --> L0.DoubleArray \r
+CHART.Chart.backgroundColor <R L0.HasProperty : L0.FunctionalRelation : SEL.GenericParameterType\r
+    L0.HasDescription "An array of (r,g,b) floating point triples to describe either a single color or a color gradient."\r
+    L0.HasLabel "Background Colors"\r
+    ==> "Vector Float" --> L0.FloatArray \r
+CHART.Chart.gridColor <R L0.HasProperty : L0.FunctionalRelation : SEL.GenericParameterType\r
+    L0.HasDescription "An (r,g,b) floating point triple to describe a single color."\r
+    L0.HasLabel "Grid Color"\r
+    ==> "Vector Float" --> L0.FloatArray \r
+\r
+// -----------------------------------------------------------------------\r
+// Chart.Item\r
+CHART.Chart.Item <T L0.Entity : MOD.TypeWithChangeInformation\r
+    @L0.property CHART.Chart.Item.HasSubscriptionItem\r
+    @L0.singleProperty CHART.Chart.Item.Index\r
+    @L0.assert CHART.Chart.Item.Index 0\r
+    //@L0.assert L0.HasLabel ""\r
+    // Subscription UUID  \r
+    //@L0.singlePropertyDefault CHART.Chart.Item.LineMode CHART.LineMode.LinearInterpolation\r
+    @L0.singlePropertyDefault CHART.Chart.Item.DrawMode CHART.DrawMode.Line\r
+    @L0.singlePropertyDefault CHART.Chart.Item.Renderer CHART.Renderer.Analog\r
+    @L0.singlePropertyDefault CHART.Chart.Item.ScaleMode CHART.ScaleMode.AutoScale\r
+    //@L0.optionalProperty CHART.HasScale\r
+    //@L0.assert CHART.Hascale CHART.DefaultScale\r
+    @L0.singleProperty CHART.Chart.Item.ScaleMode.Min\r
+    @L0.assert CHART.Chart.Item.ScaleMode.Min 0.0\r
+    @L0.singleProperty CHART.Chart.Item.ScaleMode.Max\r
+    @L0.assert CHART.Chart.Item.ScaleMode.Max 120.0\r
+    @L0.singleProperty CHART.Chart.Item.Index\r
+    //@L0.assert CHART.Chart.Item.ValueFormat CHART.ValueFormat.Currency\r
+    //@L0.singleProperty CHART.Chart.Item.ValueFormat\r
+    @L0.assert L0.HasLabel \r
+      _ : L0.Value\r
+        L0.ConvertsToValueWith CHART.Functions.chartItemLabel\r
+        L0.readOnly true\r
+    >-- CHART.Chart.Item.subscriptionInfo ==> "String" --> L0.Value <R L0.HasProperty : L0.FunctionalRelation : SEL.GenericParameterType\r
+        L0.HasLabel "Subscription Info"\r
+    @L0.assert CHART.Chart.Item.subscriptionInfo\r
+      _ : L0.Value\r
+        L0.ConvertsToValueWith CHART.Functions.chartItemSubscriptionInfo\r
+        L0.readOnly true\r
+    >-- CHART.Chart.Item.hidden ==> "Boolean" --> L0.Boolean <R L0.HasProperty : L0.FunctionalRelation : SEL.GenericParameterType\r
+        L0.HasLabel "Hidden"\r
+        L0.HasDescription "Used for marking chart items hidden."\r
+    @L0.assert CHART.Chart.Item.hidden false\r
+    @L0.optionalProperty G2D.HasStrokeWidth\r
+    @L0.optionalProperty G2D.HasColor\r
+\r
+CHART.Chart.Item.HasSubscriptionItem <R L0.IsRelatedTo\r
+    --> MOD.Subscription.Item\r
+    L0.InverseOf CHART.Chart.Item.HasChartItem <R L0.IsWeaklyRelatedTo\r
+        --> CHART.Chart.Item\r
+\r
+CHART.Chart.Item.Index <R L0.HasProperty : L0.FunctionalRelation\r
+    L0.HasLabel "Position and color index"\r
+    --> L0.Integer\r
+\r
+\r
+//CHART.DefaultScale = { min = 0, max = 120.0 } : CHART.DoubleRange\r
+//CHART.Chart.Item.LineMode <R L0.IsRelatedTo : L0.FunctionalRelation\r
+//    L0.HasLabel "Line Mode"\r
+//    L0.HasRange CHART.LineMode\r
+//CHART.LineMode <T L0.Property\r
+//    L0.HasDescription "Describes how the plot line is drawn between the dots, i.e. the data samples."\r
+//    @L0.tag L0.Enumeration\r
+//CHART.LineMode.LinearInterpolation : CHART.LineMode\r
+//    L0.HasLabel "Line"\r
+//CHART.LineMode.StepWise : CHART.LineMode\r
+//    L0.HasLabel "Step"\r
+\r
+CHART.Chart.Item.Renderer <R L0.IsRelatedTo: L0.FunctionalRelation\r
+    L0.HasLabel "Renderer"\r
+    L0.HasRange CHART.Renderer\r
+CHART.Renderer <T L0.Property\r
+    L0.HasDescription "Describes the renderer to use for drawing the 2d plot."\r
+    @L0.tag L0.Enumeration\r
+CHART.Renderer.Binary : CHART.Renderer\r
+    L0.HasLabel "Binary"\r
+CHART.Renderer.Analog : CHART.Renderer\r
+    L0.HasLabel "Analog"\r
+\r
+// Scale Mode\r
+CHART.Chart.Item.ScaleMode <R L0.IsRelatedTo : L0.FunctionalRelation\r
+    L0.HasLabel "Scale"\r
+    L0.HasRange CHART.ScaleMode\r
+CHART.ScaleMode <T L0.Property\r
+    L0.HasDescription "The mode how a plot is scaled to the viewport."\r
+    @L0.tag L0.Enumeration\r
+CHART.ScaleMode.ManualScale : CHART.ScaleMode\r
+    L0.HasLabel "Manual scale"\r
+    @L0.singlePropertyDefault CHART.Chart.Item.ScaleMode.Min 0.0\r
+    @L0.singlePropertyDefault CHART.Chart.Item.ScaleMode.Max 120.0\r
+CHART.ScaleMode.AutoScale : CHART.ScaleMode\r
+    L0.HasLabel "Auto scale" // Fit all samples\r
+\r
+CHART.Chart.Item.ScaleMode.Min <R L0.HasProperty : L0.FunctionalRelation : SEL.GenericParameterType\r
+    L0.HasLabel "Manual Scale Min"\r
+    L0.HasRange L0.Double\r
+CHART.Chart.Item.ScaleMode.Max <R L0.HasProperty : L0.FunctionalRelation : SEL.GenericParameterType\r
+    L0.HasLabel "Manual Scale Max"\r
+    L0.HasRange L0.Double\r
+\r
+\r
+// Time Format\r
+//CHART.Chart.TimeFormat <R L0.IsRelatedTo : L0.FunctionalRelation\r
+//    L0.HasLabel "Time Format"\r
+//    L0.HasRange CHART.TimeFormat\r
+//CHART.TimeFormat <T L0.Property\r
+//    L0.HasDescription "The format how time axis is printed."\r
+//    @L0.tag L0.Enumeration\r
+//CHART.TimeFormat.Time : CHART.TimeFormat\r
+//    L0.HasLabel "Time HH:mm:ss.SSS"\r
+//CHART.TimeFormat.Decimal : CHART.TimeFormat\r
+//    L0.HasLabel "Decimal"\r
+\r
+/*\r
+CHART.HasScale <R L0.HasProperty\r
+    L0.HasLabel "Scale Values"\r
+    L0.HasRange CHART.DoubleRange\r
+CHART.DoubleRange <T L0.Literal\r
+    @L0.assert L0.HasDataType ${\r
+        min : Double,\r
+        max : Double\r
+    }\r
+*/\r
+\r
+CHART.Chart.Item.DrawMode <R L0.IsRelatedTo : L0.FunctionalRelation\r
+    L0.HasLabel "Draw Mode"\r
+    L0.HasRange CHART.DrawMode\r
+CHART.DrawMode <T L0.Property\r
+    @L0.tag L0.Enumeration\r
+    \r
+CHART.DrawMode.DeviationAndAverage : CHART.DrawMode\r
+    L0.HasLabel "Average and Deviation"\r
+CHART.DrawMode.DeviationAndLine : CHART.DrawMode\r
+    L0.HasLabel "Line and Deviation"\r
+CHART.DrawMode.DeviationAndSample : CHART.DrawMode\r
+    L0.HasLabel "Sample and Deviation"\r
+CHART.DrawMode.Sample : CHART.DrawMode\r
+    L0.HasLabel "Sample"\r
+CHART.DrawMode.Average : CHART.DrawMode\r
+    L0.HasLabel "Average"\r
+CHART.DrawMode.Line : CHART.DrawMode\r
+    L0.HasLabel "Line"\r
+CHART.DrawMode.Deviation : CHART.DrawMode\r
+    L0.HasLabel "Deviation"\r
+//CHART.DrawMode.DeviationAndMedian : CHART.DrawMode\r
+//    L0.HasLabel "Median and Deviation"\r
+//CHART.DrawMode.Median : CHART.DrawMode\r
+//    L0.HasLabel "Median"\r
+\r
+// -----------------------------------------------------------------------\r
+//// USEFUL ?\r
+\r
+/*\r
+CHART.HasTimeSegment <R L0.HasProperty : L0.FunctionalRelation\r
+    L0.HasRange CHART.TimeSegment\r
+\r
+CHART.TimeSegment <T L0.Entity\r
+    @L0.singleProperty CHART.HasStartTime\r
+    @L0.singleProperty CHART.HasEndTime\r
+CHART.HasStartTime <R L0.HasProperty : L0.FunctionalRelation\r
+    L0.HasRange L0.Double\r
+CHART.HasEndTime <R L0.HasProperty : L0.FunctionalRelation\r
+    L0.HasRange L0.Double \r
+\r
+CHART.HasTimePresentation <R L0.IsRelatedTo : L0.FunctionalRelation\r
+    L0.HasRange CHART.TimePresentation\r
+CHART.TimePresentation <T L0.Property\r
+    L0.HasDescription "Setting how time is shown on UI"\r
+    @L0.tag L0.Enumeration\r
+CHART.TimePresentation.Absolute : CHART.TimePresentation\r
+CHART.TimePresentation.Relative : CHART.TimePresentation\r
+\r
+CHART.HasGridMode <R L0.HasProperty : L0.FunctionalRelation\r
+    L0.HasRange CHART.GridMode\r
+CHART.GridMode <T L0.Property\r
+    L0.HasDescription "The mode how grid lines are drawn"\r
+    @L0.tag L0.Abstract\r
+CHART.DisabledGrid <T CHART.GridMode\r
+CHART.AdaptiveGrid <T CHART.GridMode\r
+    @L0.singleProperty CHART.HasSpacing\r
+CHART.ManualGrid <T CHART.GridMode\r
+    @L0.singleProperty CHART.HasXLines\r
+    @L0.singleProperty CHART.HasYLines\r
+CHART.HasXLines <R L0.HasProperty : L0.FunctionalRelation\r
+    L0.HasRange L0.Double\r
+CHART.HasYLines <R L0.HasProperty : L0.FunctionalRelation\r
+    L0.HasRange L0.Double\r
+CHART.HasSpacing <R L0.HasProperty : L0.FunctionalRelation\r
+    L0.HasRange L0.Double\r
+*/\r
+\r
+//---------------------------\r
+// Templates\r
+\r
+CHART.ChartTemplate <T L0.Entity\r
+CHART.HasDefaultChartTemplate <R L0.DependsOn : L0.FunctionalRelation\r
+CHART.ObtainedDouble <T L0.Value\r
+\r
+//---------------------------\r
+// Simple templates\r
+\r
+CHART.WholeHistoryChartTemplate : CHART.ChartTemplate\r
+  L0.HasLabel "Whole history"\r
+  CHART.Chart.TimeWindowIncrement 50.0\r
+\r
+CHART.Last60SecondsChartTemplate : CHART.ChartTemplate\r
+  L0.HasLabel "Last 60 seconds"\r
+  CHART.Chart.TimeWindowLength 60.0\r
+  CHART.Chart.TimeWindowIncrement 50.0\r
+\r
+CHART.Last10MinutesChartTemplate : CHART.ChartTemplate\r
+  L0.HasLabel "Last 10 minutes"\r
+  CHART.Chart.TimeWindowLength 600.0\r
+  CHART.Chart.TimeWindowIncrement 50.0\r
+\r
+\r
+CHART.Functions : L0.Library\r
+CHART.Functions.chartItemLabel : L0.ExternalValue\r
+CHART.Functions.chartItemSubscriptionInfo : L0.ExternalValue\r