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