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