]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.history/src/org/simantics/history/HistoryItem.java
Rest API for Historian data
[simantics/platform.git] / bundles / org.simantics.history / src / org / simantics / history / HistoryItem.java
1 package org.simantics.history;
2
3 import org.simantics.databoard.annotations.Identifier;
4 import org.simantics.databoard.type.Datatype;
5 import org.simantics.databoard.util.Bean;
6
7 /**
8  * (Utility Class) Item format for HistoryItem.
9  *
10  * @author toni.kalajainen@semantum.fi
11  */
12 public class HistoryItem extends Bean.Id  {
13
14         /** 
15          * Unique identifier of the item.
16          */
17         public @Identifier String id;
18         
19         /** 
20          * Describes the format of the packed sample. The sample must be a record.
21          * The record must have any combination of the following named fields.
22          * The field types must one of: byte, integer, long, float, double.
23          * 
24          * time, endTime, value - are mandatory fields.
25          * 
26          *  time      -  Region start time, the time of the 1st sample included into the band
27          *  endTime   -  Region end time, the time of the last sample included into the band
28          *  
29          *  value     -  First value in the band
30          *  lastValue -  Last value in the band
31          *  avg       -  Average value of all included samples
32          *  median    -  Median value of all samples in the band
33          *  min       -  Lowest value in the band
34          *  max       -  Highest value in the band
35          *  
36          *  quality   -  0 = Good, -1 = No value
37          *  count     -  The number of included samples in the band
38          */
39         public Datatype format;
40         
41         public HistoryItem(String id, Datatype format) {
42                 super();
43                 this.id = id;
44                 this.format = format;
45         }
46         
47 }