Class SCExecRecord
- java.lang.Object
-
- com.inductiveautomation.gateway.tags.history.query.SCExecRecord
-
public class SCExecRecord extends java.lang.Object
This class keeps an ordered list of scan class executions. It is expected that the calls to isGood will be called in order with increasing times (in order to optimize finding the right segment).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
SCExecRecord.Segment
-
Field Summary
Fields Modifier and Type Field Description static double
ALLOWANCE
-
Constructor Summary
Constructors Constructor Description SCExecRecord()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRecord(long start, long end, int rate)
void
addToTimeline(Timeline timeline)
long
badUntil(long time)
Returns the next time that the scan class stop being bad.int
getFastestRate()
int
getRate(long time)
long
goodUntil(long startTime)
Giving the start time, this function returns when the next bad time would be.boolean
isGoodAt(long time)
Returns true if the time falls inside of an execution record, as well as within some amount of the end (set by constant, currently 1*rate).boolean
isGoodFor(long startTime, long endTime)
Returns whether the value is good for the entire duration between start to end time.java.lang.String
toString()
-
-
-
Field Detail
-
ALLOWANCE
public static final double ALLOWANCE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getFastestRate
public int getFastestRate()
-
isGoodAt
public boolean isGoodAt(long time)
Returns true if the time falls inside of an execution record, as well as within some amount of the end (set by constant, currently 1*rate).
Expects constantly increasing time parameter.
-
isGoodFor
public boolean isGoodFor(long startTime, long endTime)
Returns whether the value is good for the entire duration between start to end time. Used for extrapolation, to check that a derived value would have been good the whole time.
-
getRate
public int getRate(long time)
-
goodUntil
public long goodUntil(long startTime)
Giving the start time, this function returns when the next bad time would be. It caps at the current time.
-
badUntil
public long badUntil(long time)
Returns the next time that the scan class stop being bad. If the time passed in is actually good, returns the previous time that it stopped being bad (the start of the current exec record).
-
addRecord
public void addRecord(long start, long end, int rate)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
addToTimeline
public void addToTimeline(Timeline timeline)
-
-