Class TagHistoryPenDatasource
- java.lang.Object
-
- com.inductiveautomation.factorypmi.application.components.chart.easychart.AbstractChartQuery
-
- com.inductiveautomation.factorypmi.application.components.chart.easychart.TagHistoryPenDatasource
-
- All Implemented Interfaces:
IPenDatasource
,IQueryResponseListener
,TagHistoryQueryParams
public class TagHistoryPenDatasource extends AbstractChartQuery implements IPenDatasource, TagHistoryQueryParams
-
-
Field Summary
-
Fields inherited from class com.inductiveautomation.factorypmi.application.components.chart.easychart.AbstractChartQuery
badQuality, chart, data, log, showWarnings
-
-
Constructor Summary
Constructors Constructor Description TagHistoryPenDatasource(AggregationMode aggMode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPen(PenData penData)
Adds a pen to this datasource.Aggregate
getAggregationMode()
Specifies how aggregation should occur.java.util.List<java.lang.String>
getAliases()
If not null, must be a 1-to-1 list corresponding to tag paths.java.util.List<Aggregate>
getColumnAggregationModes()
If not null, must be 1-to-1 list corresponding to tag paths, specifying the aggregation mode for the column.Dataset
getDataset()
The underlying dataset that drives this datasourcejava.util.Date
getEndDate()
The ending range of the query.int
getNumDatapoints()
Return the number of datapoints currently loaded in this sourcejava.util.List<? extends Path>
getPaths()
The paths to query.protected java.lang.String
getQuasiPropertyName()
Generate a unique string for the query, independent of any values that may change (date ranges, for example.) Used as the "property key" for the quality system in case the query fails.Flags
getQueryFlags()
Optional flags that provide additional query settings.ReturnFormat
getReturnFormat()
Always returns Wide, because I don't think easy charts can handle Tall format.int
getReturnSize()
How many results are desired.java.util.Date
getStartDate()
The starting range of the query.void
initRefs(java.util.Map<java.lang.String,PenData> allPens)
Gives the datasource a chance to install references to other pensboolean
isZoomTracking()
True if this datasource should be restarted when the zoom level changes.protected java.lang.Object
registerQuery(int pollTime, boolean runOnce)
Register this query with the QueryManager.protected void
setChart(PMIEasyChart chart)
protected void
setData(Dataset data)
java.lang.String
toString()
-
Methods inherited from class com.inductiveautomation.factorypmi.application.components.chart.easychart.AbstractChartQuery
getData, getTargetFullPath, handleQueryReturnedError, handleQueryReturnedNoRows, handleQueryReturnedValue, notifyQueryRunning, shutdown, startup, warn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.inductiveautomation.factorypmi.application.components.chart.easychart.IPenDatasource
shutdown, startup
-
-
-
-
Constructor Detail
-
TagHistoryPenDatasource
public TagHistoryPenDatasource(AggregationMode aggMode)
-
-
Method Detail
-
addPen
public void addPen(PenData penData)
Description copied from interface:IPenDatasource
Adds a pen to this datasource. All pens will be added before startup() is called for the first time.- Specified by:
addPen
in interfaceIPenDatasource
-
initRefs
public void initRefs(java.util.Map<java.lang.String,PenData> allPens)
Description copied from interface:IPenDatasource
Gives the datasource a chance to install references to other pens- Specified by:
initRefs
in interfaceIPenDatasource
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getQuasiPropertyName
protected java.lang.String getQuasiPropertyName()
Description copied from class:AbstractChartQuery
Generate a unique string for the query, independent of any values that may change (date ranges, for example.) Used as the "property key" for the quality system in case the query fails.- Specified by:
getQuasiPropertyName
in classAbstractChartQuery
-
registerQuery
protected java.lang.Object registerQuery(int pollTime, boolean runOnce)
Description copied from class:AbstractChartQuery
Register this query with the QueryManager. Called by AbstractchartQuery duringAbstractChartQuery.startup(PMIEasyChart)
- Specified by:
registerQuery
in classAbstractChartQuery
- Returns:
- The key object that the query manager gave back.
-
getDataset
public Dataset getDataset()
Description copied from interface:IPenDatasource
The underlying dataset that drives this datasource- Specified by:
getDataset
in interfaceIPenDatasource
-
getNumDatapoints
public int getNumDatapoints()
Description copied from interface:IPenDatasource
Return the number of datapoints currently loaded in this source- Specified by:
getNumDatapoints
in interfaceIPenDatasource
-
setData
protected void setData(Dataset data)
- Overrides:
setData
in classAbstractChartQuery
-
setChart
protected void setChart(PMIEasyChart chart)
- Overrides:
setChart
in classAbstractChartQuery
-
isZoomTracking
public boolean isZoomTracking()
Description copied from interface:IPenDatasource
True if this datasource should be restarted when the zoom level changes.- Specified by:
isZoomTracking
in interfaceIPenDatasource
-
getAggregationMode
public Aggregate getAggregationMode()
Description copied from interface:TagHistoryQueryParams
Specifies how aggregation should occur. Aggregation is how data is handled when multiple values exist for a certain window of time. The window is defined as the time range divided by the number of results, and therefore this setting doesn't apply when using raw result mode.- Specified by:
getAggregationMode
in interfaceTagHistoryQueryParams
-
getColumnAggregationModes
public java.util.List<Aggregate> getColumnAggregationModes()
Description copied from interface:TagHistoryQueryParams
If not null, must be 1-to-1 list corresponding to tag paths, specifying the aggregation mode for the column. If the list is null, or a particular entry is null, the general aggregation mode will be used instead.- Specified by:
getColumnAggregationModes
in interfaceTagHistoryQueryParams
-
getReturnFormat
public ReturnFormat getReturnFormat()
Always returns Wide, because I don't think easy charts can handle Tall format.- Specified by:
getReturnFormat
in interfaceTagHistoryQueryParams
-
getPaths
public java.util.List<? extends Path> getPaths()
Description copied from interface:TagHistoryQueryParams
The paths to query. The "source" field of the tag path is the historical provider that contains the tag. Tags from multiple providers may be requested at the same time.- Specified by:
getPaths
in interfaceTagHistoryQueryParams
-
getAliases
public java.util.List<java.lang.String> getAliases()
Description copied from interface:TagHistoryQueryParams
If not null, must be a 1-to-1 list corresponding to tag paths. Specifies names that will be used when representing the tag instead of the tag path. In other words, these are the values that will be used for column names in Wide return mode, or "Tag names" in tall return mode.- Specified by:
getAliases
in interfaceTagHistoryQueryParams
-
getReturnSize
public int getReturnSize()
Description copied from interface:TagHistoryQueryParams
How many results are desired. -1 means "raw", 0 means "natural", and positive numbers are fixed rows. The definitions of "-1" and "0" may vary according to provider.- Specified by:
getReturnSize
in interfaceTagHistoryQueryParams
-
getStartDate
public java.util.Date getStartDate()
Description copied from interface:TagHistoryQueryParams
The starting range of the query.- Specified by:
getStartDate
in interfaceTagHistoryQueryParams
-
getEndDate
public java.util.Date getEndDate()
Description copied from interface:TagHistoryQueryParams
The ending range of the query. If null, the query will be considered "realtime", and will cover up to the current time.- Specified by:
getEndDate
in interfaceTagHistoryQueryParams
-
getQueryFlags
public Flags getQueryFlags()
Description copied from interface:TagHistoryQueryParams
Optional flags that provide additional query settings. Tag provider dependent, though some reserved flags are defined inTagHistoryQueryFlags
- Specified by:
getQueryFlags
in interfaceTagHistoryQueryParams
-
-