Class DatasourceQueryExecutor.PreprocessedHistoryGroup
- java.lang.Object
-
- com.inductiveautomation.gateway.tags.history.query.DatasourceQueryExecutor.PreprocessedHistoryGroup
-
- All Implemented Interfaces:
HistoricalValue
,HistoricalValueGroup<IdentifiedHistoricalValue<java.lang.Integer>>
,IdentifiedHistoricalValue<java.lang.Integer>
,java.lang.Comparable<HistoricalValue>
- Enclosing class:
- DatasourceQueryExecutor
protected static class DatasourceQueryExecutor.PreprocessedHistoryGroup extends java.lang.Object implements HistoricalValueGroup<IdentifiedHistoricalValue<java.lang.Integer>>, IdentifiedHistoricalValue<java.lang.Integer>
We implement our own history group here in hopes of being as efficient as possible. Even though value roles might be packed together, we still assign them to specific spots in the array (so, a value might be in two spots).
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
AVG
protected static int
ENTRY
protected static int
EXIT
protected static int
MAX
protected static int
MIN
-
Fields inherited from interface com.inductiveautomation.ignition.gateway.sqltags.history.query.HistoricalValue
FLAG_DIRECT_AVG, FLAG_ENTRY, FLAG_EXIT, FLAG_FIRST_VAL, FLAG_MAX, FLAG_MIN
-
-
Constructor Summary
Constructors Constructor Description PreprocessedHistoryGroup(long blockSizeMS, long blockStart)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addValue(IdentifiedHistoricalValue<java.lang.Integer> v)
protected IdentifiedHistoricalValue<java.lang.Integer>
changeTimestamp(IdentifiedHistoricalValue<java.lang.Integer> v, long timestamp)
int
compareTo(HistoricalValue o)
IdentifiedHistoricalValue<java.lang.Integer>
get(int ndx)
IdentifiedHistoricalValue<java.lang.Integer>
getAvg()
long
getBlockEnd()
long
getBlockSizeMS()
long
getBlockStart()
DataTypeClass
getDataType()
int
getFlags()
Flags are implementation dependent markers for the value.QualityCode
getQuality()
java.lang.Integer
getTagID()
long
getTimestamp()
java.lang.Object
getValue()
IdentifiedHistoricalValue<java.lang.Integer>[]
getValuesToProcess()
This transforms the processed values we've received into something we can pass to the columns.protected boolean
hasAvg()
int
length()
These two functions are here for historical reasons.java.lang.String
toString()
-
-
-
Field Detail
-
ENTRY
protected static final int ENTRY
- See Also:
- Constant Field Values
-
EXIT
protected static final int EXIT
- See Also:
- Constant Field Values
-
AVG
protected static final int AVG
- See Also:
- Constant Field Values
-
MIN
protected static final int MIN
- See Also:
- Constant Field Values
-
MAX
protected static final int MAX
- See Also:
- Constant Field Values
-
-
Method Detail
-
getBlockSizeMS
public long getBlockSizeMS()
-
getBlockStart
public long getBlockStart()
-
getBlockEnd
public long getBlockEnd()
-
getTagID
public java.lang.Integer getTagID()
- Specified by:
getTagID
in interfaceIdentifiedHistoricalValue<java.lang.Integer>
-
changeTimestamp
protected IdentifiedHistoricalValue<java.lang.Integer> changeTimestamp(IdentifiedHistoricalValue<java.lang.Integer> v, long timestamp)
-
addValue
public void addValue(IdentifiedHistoricalValue<java.lang.Integer> v)
-
getValuesToProcess
public IdentifiedHistoricalValue<java.lang.Integer>[] getValuesToProcess()
This transforms the processed values we've received into something we can pass to the columns. Our block here represents the time span [blockStart, blockStart+blockSize]. We want, at minimum, to return two values: one for start, and one for stop. But, based on what we've gotten, we might need to return a min and max as well, and MAYBE another point that helps us achieve the average that was reported.
-
hasAvg
protected boolean hasAvg()
-
getAvg
public IdentifiedHistoricalValue<java.lang.Integer> getAvg()
-
getValue
public java.lang.Object getValue()
- Specified by:
getValue
in interfaceHistoricalValue
-
getQuality
public QualityCode getQuality()
- Specified by:
getQuality
in interfaceHistoricalValue
-
getTimestamp
public long getTimestamp()
- Specified by:
getTimestamp
in interfaceHistoricalValue
-
getDataType
public DataTypeClass getDataType()
- Specified by:
getDataType
in interfaceHistoricalValue
-
getFlags
public int getFlags()
Description copied from interface:HistoricalValue
Flags are implementation dependent markers for the value.- Specified by:
getFlags
in interfaceHistoricalValue
-
compareTo
public int compareTo(HistoricalValue o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<HistoricalValue>
-
length
public int length()
These two functions are here for historical reasons. They are not used as of 7.8- but they are used by the "legacy tag provider". The way size was calculated before was different, which is why this looks weird.- Specified by:
length
in interfaceHistoricalValueGroup<IdentifiedHistoricalValue<java.lang.Integer>>
-
get
public IdentifiedHistoricalValue<java.lang.Integer> get(int ndx)
- Specified by:
get
in interfaceHistoricalValueGroup<IdentifiedHistoricalValue<java.lang.Integer>>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-