Class TagHistoryTables.ScanclassExecutions
- java.lang.Object
-
- com.inductiveautomation.gateway.tags.history.storage.TagHistoryTables.ScanclassExecutions
-
- Enclosing class:
- TagHistoryTables
public static class TagHistoryTables.ScanclassExecutions extends java.lang.Object
The SCE (scan class execution) table is an important table which tracks when scan classes run. As long as the SC continues to execute, the END date is updated. After a period of non execution, a new row is inserted. It is therefore possible to calculate whether an interpolated value should be good or bad, based on whether in occured while the SC was running or not.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
END
static java.lang.String
RATE
static java.lang.String
SC_ID
static java.lang.String
START
static java.lang.String
TABLE_NAME
-
Constructor Summary
Constructors Constructor Description ScanclassExecutions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
queryDeleteOldAllDrivers()
static java.lang.String
queryGetCountSCToUpdate()
Returns the count of rows that would match the UpdateEndTime query.static java.lang.String
queryInsertExec()
Params: scid, start, end, ratestatic java.lang.String
queryUpdateEndTime()
Returns the query which will update the END time of a SCE to INTIME where INTIME>StartTime and ENDTIME>INTIME-2*RATE.
-
-
-
Field Detail
-
TABLE_NAME
public static final java.lang.String TABLE_NAME
- See Also:
- Constant Field Values
-
SC_ID
public static final java.lang.String SC_ID
- See Also:
- Constant Field Values
-
START
public static final java.lang.String START
- See Also:
- Constant Field Values
-
END
public static final java.lang.String END
- See Also:
- Constant Field Values
-
RATE
public static final java.lang.String RATE
- See Also:
- Constant Field Values
-
-
Method Detail
-
queryUpdateEndTime
public static java.lang.String queryUpdateEndTime()
Returns the query which will update the END time of a SCE to INTIME where INTIME>StartTime and ENDTIME>INTIME-2*RATE. (but the query doesn't encode that equation. Params: intime (for new end), SCID, Rate, intime (for start compare), intime-2*Rate (for end compare).
-
queryGetCountSCToUpdate
public static java.lang.String queryGetCountSCToUpdate()
Returns the count of rows that would match the UpdateEndTime query. Due to problems with some db drivers not properly returning update counts, we have to use this method.
SELECT count(*) FROM table WHERE {SCID},{RATE},{START},{END}
-
queryDeleteOldAllDrivers
public static java.lang.String queryDeleteOldAllDrivers()
-
queryInsertExec
public static java.lang.String queryInsertExec()
Params: scid, start, end, rate
-
-