]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.history/src/org/simantics/history/HistoryAndCollectorItem.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.history / src / org / simantics / history / HistoryAndCollectorItem.java
1 /*******************************************************************************\r
2  * Copyright (c) 2007, 2011 Association for Decentralized Information Management in\r
3  * Industry THTH ry.\r
4  * All rights reserved. This program and the accompanying materials\r
5  * are made available under the terms of the Eclipse Public License v1.0\r
6  * which accompanies this distribution, and is available at\r
7  * http://www.eclipse.org/legal/epl-v10.html\r
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.history;\r
13 \r
14 import org.simantics.databoard.annotations.Identifier;\r
15 import org.simantics.databoard.type.Datatype;\r
16 import org.simantics.databoard.util.Bean;\r
17 import org.simantics.history.util.subscription.SamplingFormat;\r
18 \r
19 /**\r
20  * (Utility class) Item format for both HistoryManager and Collector.\r
21  * \r
22  * SubscriptionItem describes how to read one Datasource Item and how to write to one History Item.\r
23  * \r
24  * @author toni.kalajainen\r
25  */\r
26 public class HistoryAndCollectorItem extends Bean.Id {\r
27         \r
28         /** A reference to an item in Datasource */\r
29         public String variableId;\r
30         \r
31         /** History item reference */\r
32         public @Identifier String id;\r
33         \r
34         /** \r
35          * Describes the format of the packed sample. The sample must be a record.\r
36          * The record must have any combination of the following named fields.\r
37          * The field types must one of: byte, integer, long, float, double.\r
38          * \r
39          * time, endTime, value - are mandatory fields.\r
40          * \r
41          *  time      -  Region start time, the time of the 1st included sample\r
42          *  endTime   -  Region end time, the time of the last included sample\r
43          *  \r
44          *  value     -  First value in the region\r
45          *  lastValue -  Last value in the region\r
46          *  avg       -  Average value of all included samples\r
47          *  median    -  Median value of all samples in the region\r
48          *  min       -  Lowest value in the region\r
49          *  max       -  Highest value in the region\r
50          *  \r
51          *  quality   -  0 = Good, -1 = No value\r
52          *  count     -  The number of included samples in the region\r
53          *  \r
54          * See {@link SamplingFormat} for example formats. \r
55          */\r
56         public Datatype format;\r
57                         \r
58         // Subscription parameters\r
59         public double deadband = Double.NaN;\r
60         public double interval = Double.NaN;\r
61         public double gain = 1.0;\r
62         public double bias = 0.0;\r
63         public boolean enabled = true;\r
64         \r
65 }\r