Package generalDatabase
Class DBControlUnit
java.lang.Object
PamController.PamControlledUnit
generalDatabase.DBControl
generalDatabase.DBControlUnit
- All Implemented Interfaces:
DataOutputStore
,OfflineDataStore
,PamSettings
,PamSettingsSource
,SettingsNameProvider
Version of DBControl for normal use while PAMGUARD is running
- reading and writing of data
- Author:
- Doug Gillespie
- See Also:
-
Field Summary
Fields inherited from class generalDatabase.DBControl
GlobalDatabaseNameArg
-
Constructor Summary
ConstructorDescriptionDBControlUnit
(String unitName) DBControlUnit
(PamConfiguration pamConfiguration, String unitName) -
Method Summary
Modifier and TypeMethodDescriptionvoid
createOfflineDataMap
(Window parentFrame) Create a basic map of the data including first and last times and some kind of data/unit time count plus ideally some kind of start and stop time list of where there are gaps in the data.void
createOfflineDataMap
(Window parentFrame, PamControlledUnit pamControlledUnit) 1 Create offline datamap when modules are added in viewer mode AFTER initialisation.boolean
deleteDataFrom
(long timeMillis) Delete all data from a given time, in all data streams.static PamConnection
Find the database connectionstatic DBControlUnit
Find the database controllerGet the data location.Get the data source nameGet a data integrity checker.Quick convenient way of getting the module status.int
Get the offline state of this module.getStoreStatus
(boolean getDetail) Get the store status, i.e.boolean
loadData
(PamDataBlock dataBlock, OfflineDataLoadInfo offlineDataLoadInfo, ViewLoadObserver loadObserver) Load data for a given datablock between two time limits.void
mapNewDataBlock
(Window parentFrame, ArrayList<PamDataBlock> dataBlocks) Map a list of data blocks.void
mapNewDataBlock
(Window parentFrame, PamDataBlock dataBlock) Function to map a single new datablock.void
notifyModelChanged
(int changeType) General notification when the PAMGAURD model changes.boolean
rewriteIndexFile
(PamDataBlock dataBlock, OfflineDataMapPoint dmp) Moved this function over from binary data store.boolean
saveData
(PamDataBlock dataBlock) Save data previously loaded from the store during offline viewing.boolean
selectSystem
(int systemNumber, boolean openDatabase) Select a database systemvoid
updateDataMap
(ArrayList<PamDataBlock> pamDataBlocks) Update the data map for an array list of data blocks.void
updateDataMap
(PamDataBlock pamDataBlock) update the datamap for a single data block.Methods inherited from class generalDatabase.DBControl
browseDatabases, canClose, commitChanges, createFileMenu, createPamCursor, fillSettingsStore, getConnection, getDatabaseName, getDatabaseSystem, getDatabaseSystems, getDbParameters, getDbProcess, getDbUnitType, getGUI, getLastErrorCount, getLongDatabaseName, getNumSettings, getSettings, getSettingsReference, getSettingsSourceName, getSettingsVersion, getSidePanel, getSystem, isFullTablesCheck, openDatabase, pamClose, reOpenConnection, restoreSettings, saveEndSettings, saveSettingsToDB, saveStartSettings, selectDatabase, selectSystem, selectSystem, setDBParameters, setFullTablesCheck
Methods inherited from class PamController.PamControlledUnit
addOfflineTaskGroup, addOtherRelatedMenuItems, addPamProcess, addPamProcess, addRelatedMenuItems, canPlayViewerSound, createDetectionMenu, createDisplayMenu, createHelpMenu, flushDataBlockBuffers, getFrameNumber, getGuiFrame, getInstanceIndex, getModuleStatusManager, getModuleSummary, getModuleSummary, getNumOfflineTaskGroups, getNumPamProcesses, getOfflineTaskGroup, getPamConfiguration, getPamController, getPamModuleInfo, getPamProcess, getPamView, getPlugin, getShortUnitType, getTabClipCopier, getTabPanel, getTabSpecificMenuBar, getToolbarComponent, getUnitName, getUnitType, getVerboseLevel, gotoTab, isInMainConfiguration, isNetRx, isViewer, pamHasStopped, pamToStart, playViewerSound, removePamProcess, removeUnit, rename, saveViewerData, setFrameNumber, setModuleStatusManager, setPamConfiguration, setPamController, setPamModuleInfo, setPamView, setSidePanel, setTabPanel, setToolbarComponent, setupControlledUnit, stopViewerSound, tellModule, terminalPrint, terminalPrintln, toString
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface PamController.PamSettings
getUnitType
Methods inherited from interface PamController.SettingsNameProvider
getUnitName
-
Constructor Details
-
DBControlUnit
-
DBControlUnit
-
-
Method Details
-
selectSystem
public boolean selectSystem(int systemNumber, boolean openDatabase) Description copied from class:DBControl
Select a database system- Overrides:
selectSystem
in classDBControl
- Parameters:
systemNumber
- index of the database systemopenDatabase
- flag to immediately open the database- Returns:
- true if all ok
-
notifyModelChanged
public void notifyModelChanged(int changeType) Description copied from class:PamControlledUnit
General notification when the PAMGAURD model changes.- Overrides:
notifyModelChanged
in classDBControl
- Parameters:
changeType
- type of change
-
updateDataMap
update the datamap for a single data block.- Parameters:
pamDataBlock
-
-
updateDataMap
Update the data map for an array list of data blocks.- Parameters:
pamDataBlock
-
-
createOfflineDataMap
Description copied from interface:OfflineDataStore
Create a basic map of the data including first and last times and some kind of data/unit time count plus ideally some kind of start and stop time list of where there are gaps in the data.- Specified by:
createOfflineDataMap
in interfaceOfflineDataStore
-
createOfflineDataMap
1 Create offline datamap when modules are added in viewer mode AFTER initialisation.- Parameters:
parentFrame
- not usedpamControlledUnit
- unit added.
-
mapNewDataBlock
Function to map a single new datablock.- Parameters:
parentFrame
- parent frame for dialogdataBlock
- datablock to map.
-
mapNewDataBlock
Map a list of data blocks.- Parameters:
parentFrame
- parent frame for dialogdataBlocks
- Array list of datablocks.
-
getDataSourceName
Description copied from interface:OfflineDataStore
Get the data source name- Specified by:
getDataSourceName
in interfaceOfflineDataStore
- Returns:
- data source name
-
getDataLocation
Description copied from interface:OfflineDataStore
Get the data location. This may be a specific file, or might be a folder if data are in many files, a URI, etc.- Specified by:
getDataLocation
in interfaceOfflineDataStore
- Returns:
- store locations
-
loadData
public boolean loadData(PamDataBlock dataBlock, OfflineDataLoadInfo offlineDataLoadInfo, ViewLoadObserver loadObserver) Description copied from interface:OfflineDataStore
Load data for a given datablock between two time limits.- Specified by:
loadData
in interfaceOfflineDataStore
- Parameters:
dataBlock
- datablock owner of the data- Returns:
- true if load successful.
-
saveData
Description copied from interface:OfflineDataStore
Save data previously loaded from the store during offline viewing.- Specified by:
saveData
in interfaceOfflineDataStore
- Parameters:
dataBlock
- datablock owner of the data- Returns:
- true if saved or save not needed. False if an error prevents saving.
-
findConnection
Find the database connection- Returns:
- the database connection or null if there is either no database module loaded or no open database.
-
findDatabaseControl
Find the database controller- Returns:
- database controller, or null if no database module loaded.
-
rewriteIndexFile
Description copied from interface:OfflineDataStore
Moved this function over from binary data store. Many storage systems may not be able to do this, but some might !- Specified by:
rewriteIndexFile
in interfaceOfflineDataStore
- Returns:
-
getDatagramManager
- Specified by:
getDatagramManager
in interfaceOfflineDataStore
- Returns:
- the datagramManager
-
getModuleStatus
Description copied from class:PamControlledUnit
Quick convenient way of getting the module status.- Overrides:
getModuleStatus
in classPamControlledUnit
- Returns:
- Module Status or null if no status manager present.
-
getBackupInformation
- Overrides:
getBackupInformation
in classPamControlledUnit
-
getStoreStatus
Description copied from interface:DataOutputStore
Get the store status, i.e. does it exist, does it contain data, if so over what date range, etc.- Specified by:
getStoreStatus
in interfaceDataOutputStore
- Returns:
-
deleteDataFrom
public boolean deleteDataFrom(long timeMillis) Description copied from interface:DataOutputStore
Delete all data from a given time, in all data streams.- Specified by:
deleteDataFrom
in interfaceDataOutputStore
- Parameters:
timeMillis
- time to delete from (anything >= this time)- Returns:
- true if it seems to have worked OK. False if any errors (e.g. database or file system error).
-
getOfflineState
public int getOfflineState()Description copied from class:PamControlledUnit
Get the offline state of this module. This can generally be idle, but can be a higher state when map making at startup and when running an offline task.- Overrides:
getOfflineState
in classPamControlledUnit
- Returns:
-
getInegrityChecker
Description copied from interface:DataOutputStore
Get a data integrity checker. This can be called at startup to see if there is a problem.- Specified by:
getInegrityChecker
in interfaceDataOutputStore
- Returns:
-