--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2011 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.history;\r
+\r
+import org.simantics.databoard.annotations.Identifier;\r
+import org.simantics.databoard.type.Datatype;\r
+import org.simantics.databoard.util.Bean;\r
+import org.simantics.history.util.subscription.SamplingFormat;\r
+\r
+/**\r
+ * (Utility class) Item format for both HistoryManager and Collector.\r
+ * \r
+ * SubscriptionItem describes how to read one Datasource Item and how to write to one History Item.\r
+ * \r
+ * @author toni.kalajainen\r
+ */\r
+public class HistoryAndCollectorItem extends Bean.Id {\r
+ \r
+ /** A reference to an item in Datasource */\r
+ public String variableId;\r
+ \r
+ /** History item reference */\r
+ public @Identifier String id;\r
+ \r
+ /** \r
+ * Describes the format of the packed sample. The sample must be a record.\r
+ * The record must have any combination of the following named fields.\r
+ * The field types must one of: byte, integer, long, float, double.\r
+ * \r
+ * time, endTime, value - are mandatory fields.\r
+ * \r
+ * time - Region start time, the time of the 1st included sample\r
+ * endTime - Region end time, the time of the last included sample\r
+ * \r
+ * value - First value in the region\r
+ * lastValue - Last value in the region\r
+ * avg - Average value of all included samples\r
+ * median - Median value of all samples in the region\r
+ * min - Lowest value in the region\r
+ * max - Highest value in the region\r
+ * \r
+ * quality - 0 = Good, -1 = No value\r
+ * count - The number of included samples in the region\r
+ * \r
+ * See {@link SamplingFormat} for example formats. \r
+ */\r
+ public Datatype format;\r
+ \r
+ // Subscription parameters\r
+ public double deadband = Double.NaN;\r
+ public double interval = Double.NaN;\r
+ public double gain = 1.0;\r
+ public double bias = 0.0;\r
+ public boolean enabled = true;\r
+ \r
+}\r