]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.history/src-isv/trend_collector.mediawiki
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.history / src-isv / trend_collector.mediawiki
1 =History and Collector in Charts and Trends=
2 There is a specified way how trend manages the items in the history. 
3 The "id"-field of an history item has the following format: "subscriptionId-variableId-formatId". 
4 Therefore the files are named in the same notation (appended with the different extensions ".data", ".txt", ".index").
5
6 The trend's history item format has the following record:
7  {
8      id : String,
9      variableId : String,         // Simantics RVI
10      format : Datatype,
11      deadband : Double,           // NaN = No deadband
12      interval : Double,
13      gain : Double,
14      bias : Double,
15      enabled : Boolean,
16      groupId : String,            // Subscription Id
17      groupItemId : String,        // Subscription Item Id
18      formatId : String            // One of: "all", "100ms", "1s", "10s", "60s", or "minmax"
19  }
20
21
22 Each datasource variable is sampled into 5-6 separated files with different interval. 
23 The sampling formats are named. Some formats may be omited if subscription configuration suggests so. For example, if "subscription interval = 250ms" then, the files "all" and "100ms" are omited.
24 {| border="1" cellpadding="3" cellspacing="0" align="center"
25 |- style="background-color: #f9f9f9;"
26 |'''SamplingFormat-Id'''
27 |'''Description'''
28 |- 
29 |"all"
30 |All datasource samples are stored here.
31 |-
32 |"100ms"
33 |Samples are written with (atleast) 100ms interval.   
34 |-
35 |"1s"
36 |Samples are written with (atleast) 1000ms interval.
37 |-
38 |"10s"
39 |Samples are written with (atleast) 10000ms interval.
40 |-
41 |"60s"
42 |Samples are written with (atleast) 60000ms interval.
43 |-
44 |"minmax"
45 |File contains only one sample and it has fields { time, value, endTime, min, max }. Not used for with binary variable.
46 |}
47
48 The file format for analog variables is the following:
49 {| border="1" cellpadding="3" cellspacing="0" align="center"
50 |- style="background-color: #f9f9f9;"
51 |'''SamplingFormat-Id'''
52 |'''Sample RecordType'''
53 |- 
54 |"all"
55 |{ time:Double, endTime:Double, value:Double, quality:Byte }
56 |-
57 |"100ms"
58 |{ time:Double, endTime:Double, value:Double, min:Double, max:Double, avg:Double, quality:Byte }   
59 |-
60 |"1s"
61 |{ time:Double, endTime:Double, value:Double, min:Double, max:Double, avg:Double, quality:Byte }
62 |-
63 |"10s"
64 |{ time:Double, endTime:Double, value:Double, min:Double, max:Double, avg:Double, quality:Byte }
65 |-
66 |"60s"
67 |{ time:Double, endTime:Double, value:Double, min:Double, max:Double, avg:Double, quality:Byte }
68 |-
69 |"minmax"
70 |{ time:Double, endTime:Double, value:Double, min:Double, max:Double }
71 |}
72
73 The file format for binary variables is the following:
74 {| border="1" cellpadding="3" cellspacing="0" align="center"
75 |- style="background-color: #f9f9f9;"
76 |'''SamplingFormat-Id'''
77 |'''Sample RecordType'''
78 |-
79 |"all"
80 |{ time:Double, endTime:Double, value:Byte, quality:Byte }
81 |-
82 |"100ms"
83 |{ time:Double, endTime:Double, value:Byte, max:Byte, quality:Byte }   
84 |-
85 |"1s"
86 |{ time:Double, endTime:Double, value:Byte, max:Byte, quality:Byte }
87 |-
88 |"10s"
89 |{ time:Double, endTime:Double, value:Byte, max:Byte, quality:Byte }
90 |-
91 |"60s"
92 |{ time:Double, endTime:Double, value:Byte, max:Byte, quality:Byte }
93 |}
94