Class HistoryColumn
- java.lang.Object
-
- com.inductiveautomation.ignition.gateway.sqltags.history.query.AbstractHistoryNode
-
- com.inductiveautomation.gateway.tags.history.query.columns.HistoryColumn
-
- All Implemented Interfaces:
DSHistoryColumn
,HistoryNode
public class HistoryColumn extends AbstractHistoryNode implements DSHistoryColumn
-
-
Field Summary
-
Fields inherited from class com.inductiveautomation.ignition.gateway.sqltags.history.query.AbstractHistoryNode
type
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
HistoryColumn(java.lang.String name, DataTypeClass type)
Protected because it should only be called by value-generating subclasses (like timestamp).protected
HistoryColumn(java.lang.String name, DataTypeClass type, LoggerEx queryLogger)
HistoryColumn(java.lang.String name, LoggerEx queryLogger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
adjustDataBlocksTo(long blockId)
protected boolean
canInterpolate()
protected DataWindow
createAggregationWindow(long blockId, long windowSize)
DataTypeClass
getDataType()
Returns the type class of the column, or INTEGER if type has not been set.protected InterpolationMode
getInterpolationModeAt(long time)
Returns the registered interpolation mode at the given time, or Discreet if canInterpolate() returns false.QualityCode
getQuality()
Gets the quality that corresponds to the last call to getValueprotected SCExecRecord
getScanClassRecordAt(long time)
java.lang.Object
getValue(long blockId, int level)
Gets the value at the given time.boolean
hasMore()
Indicates there are more values to return that can be retrieved through subsequent calls to getValue.protected boolean
isSeedValue(long time)
void
setAggregationMode(Aggregate mode)
void
setDataType(DataTypeClass value)
void
setErrored(QualityCode code)
void
setInterpolationModeTimeline(TimelineList<InterpolationMode> value)
void
setQueryController(QueryController controller)
void
setScanClassExecutionMap(SCExecMap map)
void
setScanClassIdTimeline(TimelineList<java.lang.Integer> value)
void
updateValue(HistoricalValue value)
boolean
wasValueInterpolated()
Returns whether the the last value provided by getValue was purely interpolated- not based on any actual data.-
Methods inherited from class com.inductiveautomation.ignition.gateway.sqltags.history.query.AbstractHistoryNode
getErrorCode, getName, getNext, getPrevious, isErrored, markCompleted, maxAvailableTime, setNext, setNextAvailableTime, setPrevious, sortNode, swapNodes
-
-
-
-
Constructor Detail
-
HistoryColumn
public HistoryColumn(java.lang.String name, LoggerEx queryLogger)
-
HistoryColumn
protected HistoryColumn(java.lang.String name, DataTypeClass type, LoggerEx queryLogger)
-
HistoryColumn
protected HistoryColumn(java.lang.String name, DataTypeClass type)
Protected because it should only be called by value-generating subclasses (like timestamp). Otherwise we want to enforce that a logger is passed in.
-
-
Method Detail
-
setQueryController
public void setQueryController(QueryController controller)
-
setInterpolationModeTimeline
public void setInterpolationModeTimeline(TimelineList<InterpolationMode> value)
- Specified by:
setInterpolationModeTimeline
in interfaceDSHistoryColumn
-
setScanClassIdTimeline
public void setScanClassIdTimeline(TimelineList<java.lang.Integer> value)
- Specified by:
setScanClassIdTimeline
in interfaceDSHistoryColumn
-
setScanClassExecutionMap
public void setScanClassExecutionMap(SCExecMap map)
- Specified by:
setScanClassExecutionMap
in interfaceDSHistoryColumn
-
getDataType
public DataTypeClass getDataType()
Returns the type class of the column, or INTEGER if type has not been set. Therefore, it's not appropriate to use inside of this class, where we actually care if the type is null or not.
It returns Integer for unknown, because 1) If type is unknown, it really means that there will be no data and 2) Integer reduces the chances of errors if using the query in a chart- charts don't like string types.- Specified by:
getDataType
in interfaceDSHistoryColumn
- Specified by:
getDataType
in interfaceHistoryNode
- Overrides:
getDataType
in classAbstractHistoryNode
-
setDataType
public void setDataType(DataTypeClass value)
- Specified by:
setDataType
in interfaceDSHistoryColumn
- Overrides:
setDataType
in classAbstractHistoryNode
-
isSeedValue
protected boolean isSeedValue(long time)
-
canInterpolate
protected boolean canInterpolate()
-
setErrored
public void setErrored(QualityCode code)
- Overrides:
setErrored
in classAbstractHistoryNode
-
setAggregationMode
public void setAggregationMode(Aggregate mode)
-
getInterpolationModeAt
protected InterpolationMode getInterpolationModeAt(long time)
Returns the registered interpolation mode at the given time, or Discreet if canInterpolate() returns false.
-
getScanClassRecordAt
protected SCExecRecord getScanClassRecordAt(long time)
-
createAggregationWindow
protected DataWindow createAggregationWindow(long blockId, long windowSize)
-
updateValue
public void updateValue(HistoricalValue value)
- Specified by:
updateValue
in interfaceDSHistoryColumn
-
adjustDataBlocksTo
protected void adjustDataBlocksTo(long blockId)
-
wasValueInterpolated
public boolean wasValueInterpolated()
Description copied from interface:HistoryNode
Returns whether the the last value provided by getValue was purely interpolated- not based on any actual data.- Specified by:
wasValueInterpolated
in interfaceHistoryNode
-
getValue
public java.lang.Object getValue(long blockId, int level)
Gets the value at the given time. Timestamp should be less than nextAvailableTime, otherwise the value will be null and the quality will be UNKNOWN.- Specified by:
getValue
in interfaceHistoryNode
- Parameters:
level
- the level of value to get. Usually 0 for the first value, but should be incremented each time hasMore is true.
-
getQuality
public QualityCode getQuality()
Description copied from interface:HistoryNode
Gets the quality that corresponds to the last call to getValue- Specified by:
getQuality
in interfaceHistoryNode
-
hasMore
public boolean hasMore()
Indicates there are more values to return that can be retrieved through subsequent calls to getValue. Used for min/max values.- Specified by:
hasMore
in interfaceHistoryNode
-
-