Package generalDatabase
Class SuperDetLogging
java.lang.Object
generalDatabase.SQLLogging
generalDatabase.SuperDetLogging
- Direct Known Subclasses:
ClickTrainDetLogging
,CPODClickTrainLogging
,DetectionGroupLogging
,Group3DLogging
,MarkGroupSQLLogging
,OfflineEventLogging
,QASequenceLogging
,QATestLogging
Extensions to SQLLogging to be used with datablocks that log sub detections. All
such blocks will be instances of SuperDetDatablock
- Author:
- Dougl
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
When loading sub table data, load data using a clause which will guarantee loading of all sub detections of loaded super detections based around database indexes.static final int
When loading sub table data, load data using a clause which will guarantee loading of all sub detections of loaded super detections based around UID'sstatic final int
When loading sub table data, load data using the same between times clause as was applied to the super datablockFields inherited from class generalDatabase.SQLLogging
UPDATE_POLICY_OVERWRITE, UPDATE_POLICY_WRITENEW
-
Method Summary
Modifier and TypeMethodDescriptionanySubTableItems
(PAMSelectClause mainTableClause, PAMSelectClause subTableClause) find if any sub table items that satisfy a particular clause.int
checkSubTableCount
(int databaseIndex) Check the number of entries in the sub table which have this database index.countSubTableItems
(PAMSelectClause mainTableClause, PAMSelectClause subTableClause) Count the number of sub table items that satisfy a particular clause.boolean
boolean
deleteIndexedItems
(PamConnection connection, int[] deleteIndexes) Delete one or more rows from the database based on their indexes.void
int
boolean
boolean
loadViewData
(PamConnection con, PamViewParameters pamViewParameters, ViewLoadObserver loadObserver) Load viewer data for a single datablock.boolean
logData
(PamConnection con, PamDataUnit dataUnit, PamDataUnit superDetection) Called when a new PamDataUnit is added to a PamDataBlock to write those data to the database.boolean
reLogData
(PamConnection con, PamDataUnit dataUnit, PamDataUnit superDetection) Called when an old PamDataUnit is updated.boolean
saveOfflineData
(DBControlUnit dbControlUnit, PamConnection connection) Save offline data in viewer mode.void
setCreateDataUnits
(boolean createDataUnits) void
setEventEndTimeItem
(PamTableItem eventEndTimeItem) void
setSubLogging
(SQLLogging subLogging) void
setSubTableClausePolicy
(int subTableClausePolicy) Methods inherited from class generalDatabase.SQLLogging
addAddOn, clearAllAddOns, countTableItems, countTableItems, createInClause, deleteData, deleteData, doExtraChecks, double2Float, findClosestDataPoint, findLogger, getBaseTableDefinition, getEarlyLoadClause, getIdListUpdatClause, getLastLoadIndex, getLastLoadUID, getLastTime, getLoggingAddOns, getPamDataBlock, getTableDefinition, getTimesUpdateClause, getUIDMatchClause, getUpdatePolicy, getViewerCursorFinder, getViewerEverythingClause, getViewerLessThanClause, getViewerLoadClause, getViewerOverlapClause, getViewerUpdateClause, isCanView, isLoadViewData, loadDataFrom, loadEarlyData, loadEarlyData, loadLastDataUnit, loadSubtableData, loadSubtableData, loadViewData, loadViewerData, logData, prepareEmulation, prepareForMixedMode, readLastData, readMixedModeData, readNextEmulation, reCheckTable, reLogData, removeAddOn, removeAddOn, reset, setCanView, setColumnData, setLoadViewData, setTableData, setTableDefinition, setUpdatePolicy, transferDataFromResult
-
Field Details
-
SUBTABLECLAUSE_TIME
public static final int SUBTABLECLAUSE_TIMEWhen loading sub table data, load data using the same between times clause as was applied to the super datablock- See Also:
-
SUBTABLECLAUSE_PARENTUID
public static final int SUBTABLECLAUSE_PARENTUIDWhen loading sub table data, load data using a clause which will guarantee loading of all sub detections of loaded super detections based around UID's- See Also:
-
SUBTABLECLAUSE_PARENTDATABASEID
public static final int SUBTABLECLAUSE_PARENTDATABASEIDWhen loading sub table data, load data using a clause which will guarantee loading of all sub detections of loaded super detections based around database indexes.- See Also:
-
-
Method Details
-
getSubLogging
- Returns:
- the subLogging
-
setSubLogging
- Parameters:
subLogging
- the subLogging to set
-
logData
Description copied from class:SQLLogging
Called when a new PamDataUnit is added to a PamDataBlock to write those data to the database. Functionality moved down to PamCursor so that exact writing method can become database specific if necessary.- Overrides:
logData
in classSQLLogging
- Parameters:
con
- Database ConnectiondataUnit
- Pamguard Data unit.superDetection
- reference to a super detection so additional cross referencing can be filled- Returns:
- true if written and new index of dataUnit retrieved OK
- See Also:
-
reLogData
Description copied from class:SQLLogging
Called when an old PamDataUnit is updated. The record is either updated or a new record is written, but cross referenced to the old unit for bookkeeping purposes based on the updatePolicy flag.- Overrides:
reLogData
in classSQLLogging
- Parameters:
con
- Database ConnectiondataUnit
- Pamguard Data unit.superDetection
- reference to a super detection so additional cross referencing can be filled- Returns:
- the number of rows written to the database.
- See Also:
-
saveOfflineData
Description copied from class:SQLLogging
Save offline data in viewer mode.This is a pretty basic function which assumes pretty much a 1:1 correspondence between data loaded into the viewer and data to be saved.
Three types of saving to do
- Pre existing 1:1 correspondence between data in memory and database
- Viewer will have added or removed data (e.g. map comments may easily have added data)
- Weird stuff like in the click detector where the database is only holding information about a subset of clicks held in the binary data files
Should be able to deal with first two here, but functions must override for 3.
- Overrides:
saveOfflineData
in classSQLLogging
- Returns:
-
loadViewData
public boolean loadViewData(PamConnection con, PamViewParameters pamViewParameters, ViewLoadObserver loadObserver) Description copied from class:SQLLogging
Load viewer data for a single datablock.this executes in a Swing Worker thread, so needs to send notification objects to that thread, and not direct to the Controller so that they can be published back in the AWT thread.
- Overrides:
loadViewData
in classSQLLogging
- Parameters:
con
- database connectionpamViewParameters
- viewer parameters.- Returns:
-
deleteData
- Overrides:
deleteData
in classSQLLogging
-
deleteIndexedItems
Description copied from class:SQLLogging
Delete one or more rows from the database based on their indexes.- Overrides:
deleteIndexedItems
in classSQLLogging
- Parameters:
deleteIndexes
- list of Id's- Returns:
- true if no exception
-
checkSubTableCount
public int checkSubTableCount(int databaseIndex) Check the number of entries in the sub table which have this database index.- Parameters:
databaseIndex
-- Returns:
- number of sub detections.
-
anySubTableItems
find if any sub table items that satisfy a particular clause.- Parameters:
mainTableClause
-subTableClause
-- Returns:
- true if any items satisfy clause.
-
countSubTableItems
Count the number of sub table items that satisfy a particular clause.- Parameters:
mainTableClause
-subTableClause
-- Returns:
- count of items.
-
getSubTableClausePolicy
public int getSubTableClausePolicy()- Returns:
- the subTableClausePolicy
- See Also:
-
setSubTableClausePolicy
public void setSubTableClausePolicy(int subTableClausePolicy) - Parameters:
subTableClausePolicy
- the subTableClausePolicy to set- See Also:
-
doSubTableUIDRepairs
public void doSubTableUIDRepairs() -
getEventEndTimeItem
- Returns:
- the eventEndTimeItem
-
setEventEndTimeItem
- Parameters:
eventEndTimeItem
- the eventEndTimeItem to set
-
isCreateDataUnits
public boolean isCreateDataUnits()- Returns:
- the createDataUnits
-
setCreateDataUnits
public void setCreateDataUnits(boolean createDataUnits) - Parameters:
createDataUnits
- the createDataUnits to set
-