1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2011 Association for Decentralized Information Management in
\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
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.history;
\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
20 * (Utility class) Item format for both HistoryManager and Collector.
\r
22 * SubscriptionItem describes how to read one Datasource Item and how to write to one History Item.
\r
24 * @author toni.kalajainen
\r
26 public class HistoryAndCollectorItem extends Bean.Id {
\r
28 /** A reference to an item in Datasource */
\r
29 public String variableId;
\r
31 /** History item reference */
\r
32 public @Identifier String id;
\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
39 * time, endTime, value - are mandatory fields.
\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
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
51 * quality - 0 = Good, -1 = No value
\r
52 * count - The number of included samples in the region
\r
54 * See {@link SamplingFormat} for example formats.
\r
56 public Datatype format;
\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