Package tethys
Class TethysControl
java.lang.Object
PamController.PamControlledUnit
tethys.TethysControl
- All Implemented Interfaces:
PamSettings
,SettingsNameProvider
,TethysStateObserver
Quick play with a simple system for outputting data to Tethys. At it's start
this is simply going to offer a dialog and have a few functions which show how
to access data within PAMGuard.
- Author:
- dg50
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addStateObserver
(TethysStateObserver stateObserver) Add a new state observer.Check the server.createDetectionMenu
(Frame parentFrame) Create a JMenu object containing MenuItems associated with PamProcessescreateFileMenu
(JFrame parentFrame) createTethysMenu
(Frame parentFrame) Make a menu.void
deletedDetections
(PamDataBlock dataBlock) void
displayDocument
(String collection, String documentId) Load a document from the database and display it in a popup windowvoid
displayDocument
(DocumentInfo docInfo) void
exportDocument
(String collection, String documentId) Load a document from the database and write to a file selected by the uservoid
exportedDetections
(PamDataBlock dataBlock) Called when a detections document has been exported.findDatablockSynchInfo
(PamDataBlock dataBlock) A name for any deta selectors.Get DBXML Connector.One stop place to get Deployment information.nilus.Deployment
Get global deployment data.long
Get the synchronisation info for all datablocks.Gets a reference to a panel to be added to a viewboolean
Quick way for any controls to see that the server is probably OK without actually pinging it.void
notifyModelChanged
(int changeType) General notification when the PAMGAURD model changes.void
openCollectionInBrowser
(String collectionName) void
openCollectionInPAMGuard
(Collection collection) void
open client in the default web browservoid
openTethysCollection
(Collection collection) open client in the default web browserboolean
removeStateObserver
(TethysStateObserver stateObserver) Remove a state observer.boolean
restoreSettings
(PamControlledUnitSettings pamControlledUnitSettings) void
sendStateUpdate
(TethysState tethysState) Send state updates around to all state observers.void
showException
(TethysException tethysException) void
void
updateState
(TethysState tethysState) Receive state updates when Tethys has done something (made a connection, moved some data, etc.)
Note that this is for RECEIVING state updates, not for sending them.Methods inherited from class PamController.PamControlledUnit
addOfflineTaskGroup, addOtherRelatedMenuItems, addPamProcess, addPamProcess, addRelatedMenuItems, canClose, canPlayViewerSound, createDisplayMenu, createHelpMenu, flushDataBlockBuffers, getBackupInformation, getFrameNumber, getGUI, getGuiFrame, getInstanceIndex, getModuleStatus, getModuleStatusManager, getModuleSummary, getModuleSummary, getNumOfflineTaskGroups, getNumPamProcesses, getOfflineState, getOfflineTaskGroup, getPamConfiguration, getPamController, getPamModuleInfo, getPamProcess, getPamView, getPlugin, getShortUnitType, getSidePanel, getTabClipCopier, getTabSpecificMenuBar, getToolbarComponent, getUnitName, getUnitType, getVerboseLevel, gotoTab, isInMainConfiguration, isNetRx, isViewer, pamClose, 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
-
Field Details
-
unitType
- See Also:
-
defaultName
-
xmlNameSpace
-
-
Constructor Details
-
TethysControl
-
-
Method Details
-
getDbxmlConnect
Get DBXML Connector. This class contains all the functions that are needed to talk to the database.- Returns:
- DBXML functions.
-
createDetectionMenu
Description copied from class:PamControlledUnit
Create a JMenu object containing MenuItems associated with PamProcesses- Overrides:
createDetectionMenu
in classPamControlledUnit
- Parameters:
parentFrame
- The owner frame of the menu- Returns:
- reference to a JMenu which can be added to an existing menu or
menu bar
Note that if multiple views are to use the same menu, then they should each create a new menu (by setting Create to true) the first time they call this method.
-
createFileMenu
- Overrides:
createFileMenu
in classPamControlledUnit
- Parameters:
parentFrame
- parent frame for the menu- Returns:
- the file menu item
-
createTethysMenu
Make a menu. Can go either in File or Settings. TBD.- Parameters:
parentFrame
-- Returns:
-
showProjectDeploymentsDialog
public void showProjectDeploymentsDialog() -
getExportableDataBlocks
-
getSynchronisationInfos
Get the synchronisation info for all datablocks. This list should be static, but check it in case something has been added or removed.- Returns:
-
findDatablockSynchInfo
-
openTethysClient
public void openTethysClient()open client in the default web browser -
openTethysCollection
open client in the default web browser -
openCollectionInPAMGuard
-
openCollectionInBrowser
-
getTabPanel
Description copied from class:PamControlledUnit
Gets a reference to a panel to be added to a view- Overrides:
getTabPanel
in classPamControlledUnit
- Returns:
- reference to a PamTabPanel object
- See Also:
-
getTethysExportParams
- Returns:
- the tethysExportParams
-
getGlobalDeplopymentData
public nilus.Deployment getGlobalDeplopymentData()Get global deployment data. This is a bit of a mess, trying to use a separate module so that the rest of PAMGuard can use it, but creating the- Returns:
-
addStateObserver
Add a new state observer.- Parameters:
stateObserver
-
-
removeStateObserver
Remove a state observer.- Parameters:
stateObserver
-- Returns:
- true if it existed.
-
sendStateUpdate
Send state updates around to all state observers.- Parameters:
tethysState
-
-
getDataSelectName
A name for any deta selectors.- Returns:
-
getDbxmlQueries
-
notifyModelChanged
public void notifyModelChanged(int changeType) Description copied from class:PamControlledUnit
General notification when the PAMGAURD model changes.- Overrides:
notifyModelChanged
in classPamControlledUnit
- Parameters:
changeType
- type of change
-
checkServer
Check the server. This will send around a notification if the state has changed since the last call to this function, so it's unlikely you'll need to use the return value- Returns:
- server status.
-
getSettingsReference
- Specified by:
getSettingsReference
in interfacePamSettings
- Returns:
- The serialisable object that will be stored
-
getSettingsVersion
public long getSettingsVersion()- Specified by:
getSettingsVersion
in interfacePamSettings
- Returns:
- An integer version number for the settings
-
restoreSettings
- Specified by:
restoreSettings
in interfacePamSettings
- Returns:
- true if successful The object performs final checks (if needed) and then casts the settings data pamcontrolledunitSettings.settings into the correct type and uses as required
-
updateState
Description copied from interface:TethysStateObserver
Receive state updates when Tethys has done something (made a connection, moved some data, etc.)
Note that this is for RECEIVING state updates, not for sending them. To avoid infinite notifications loops, use tethysControl.sendStateUpdate(TethysState) to send out state notifications.- Specified by:
updateState
in interfaceTethysStateObserver
-
getDeploymentHandler
One stop place to get Deployment information. Will provide both information on record periods in PAMGuard and also Deployment docs in Tethys.- Returns:
- set of functions for handling deployments.
-
getDetectionsHandler
-
getLocalizationHandler
- Returns:
- the localizationHandler
-
showException
-
displayDocument
-
displayDocument
Load a document from the database and display it in a popup window- Parameters:
collection
-documentId
-
-
exportDocument
Load a document from the database and write to a file selected by the user- Parameters:
collection
-documentId
-
-
getItisFunctions
- Returns:
- the itisFunctions
-
exportedDetections
Called when a detections document has been exported.- Parameters:
dataBlock
-
-
deletedDetections
-
getCalibrationHandler
- Returns:
- the calibrationHandler
-
getLastServerStatus
- Returns:
- the lastServerStatus
-
isServerOk
public boolean isServerOk()Quick way for any controls to see that the server is probably OK without actually pinging it.- Returns:
- true if last ping of server was OK
-