Package Acquisition
Class AcquisitionControl
java.lang.Object
PamController.PamControlledUnit
PamController.RawInputControlledUnit
Acquisition.AcquisitionControl
- All Implemented Interfaces:
 DataInputStore,DataStoreInfoHolder,OfflineDataStore,OfflineFileDataStore,PamSettings,SettingsNameProvider
- Direct Known Subclasses:
 STAcquisitionControl
public class AcquisitionControl
extends RawInputControlledUnit
implements PamSettings, OfflineFileDataStore, DataInputStore
Main data acquisition control to get audio data from sound cards,
 NI cards (via UDP), files, directories of files, etc.
 
Uses a plug in architecture to allow new types to be added. This is done through RegisterDaqType().
- Author:
 - Doug Gillespie
 - See Also:
 
- 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AcquisitionControlprotected AcquisitionProcessprotected DAQChannelListManagerprotected MenuItemEnablerprotected FileDateprotected FolderInputSystemprotected OfflineFileServerprotected PamControllerprotected SoundFileTypesprotected Componentstatic final StringFields inherited from class PamController.RawInputControlledUnit
RAW_INPUT_FILEARCHIVE, RAW_INPUT_REALTIME, RAW_INPUT_UNKNOWNFields inherited from class PamController.PamControlledUnit
isMixed, isViewer - 
Constructor Summary
ConstructorsConstructorDescriptionAcquisitionControl(String name) Main control unit for audio data acquisition.AcquisitionControl(String name, boolean isSimulator) AcquisitionControl(String type, String name) Overloaded constructor - used by the STAcquisitionControl class as a way to call the PamController.PamControlledUnit constructor without all of the AcquisitionControl code above - 
Method Summary
Modifier and TypeMethodDescriptionintChannelsToHydrophones(int channels) booleanCheck array channels have corresponding hydrophones in the array manager.booleancheckArrayChannels(Frame parentFrame) Run a check to see that all read out channels are connected to a hydrophone and if not, do something about it.createDetectionMenu(Frame parentFrame) Create a JMenu object containing MenuItems associated with PamProcessesvoidcreateOfflineDataMap(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.findDaqSystem(String systemType) Finds a reference to a given DAQ system based on it's type (e.g.intfindHydrophoneChannel(int hydrophoneId) finds the ADC channel for a given hydrophone.Getter for acquisition parameters.Very specific command handler for batch status which will only work with the folderinputSystem.intgetChannelHydrophone(int channel) static ArrayList<AcquisitionControl> Get a summary of the daq settings for the QA module.Get the data location.Get the data source namegetGUI(int flag) Get the GUI for the PAMControlled unit.int[]Return a list of which channels are connected to which hydrophones in the currentarray.getModuleSummary(boolean clear) Get a module summary text string for shorthand output to anyting wanting a short summary of data state / numbers of detections.doublegetPeak2PeakVoltage(int swChannel) intType of data input, which can be one of RAW_INPUT_UNKNOWN (0), RAW_INPUT_FILEARCHIVE (1), or RAW_INPUT_REALTIME (2)longGet a tooltip for the default action of the start button.protected ComponentgetStoreInfo(PamWorkMonitor workMonitor, boolean detail) Get information about the input store (e.g.Get the SUD processing notification manager.Get the available DAQ systemsbooleanbooleanloadData(PamDataBlock dataBlock, OfflineDataLoadInfo offlineLoadDataInfo, ViewLoadObserver loadObserver) Load data for a given datablock between two time limits.voidLoad any classes that were found in the plugins folder and implement the DaqSystemInterface interfacevoidnotifyModelChanged(int changeType) General notification when the PAMGAURD model changes.voidCalled for all controlled units after Pam acquisition has stoppedvoidregisterDaqSystem(DaqSystem daqSystem) Registered new DAQ systems and makes them available via the AcquisitionCialogbooleanCalled to remove a unit.booleanrestoreSettings(PamControlledUnitSettings pamControlledUnitSettings) booleanrewriteIndexFile(PamDataBlock dataBlock, OfflineDataMapPoint dmp) Moved this function over from binary data store.booleansaveData(PamDataBlock dataBlock) Save data previously loaded from the store during offline viewing.booleansetAnalysisStartTime(long startTime) Set an analysis start time.voidSet the acquisition parameters.voidsetDaqProcess(AcquisitionProcess acquisitionProcess) voidsetHydrophoneList(int[] hydrophoneList) Sets the list of hydrophone numbers.voidvoidsetStatusBarLevel(double peakValue) Sets a level meter on the status barvoidcalled for all PamControlledUnits after all units have been created.protected voidvoidstartButtonXtraActions(Component component, AWTEvent e) Start button extra actions.tellModule(String command) Handle a module specific command sent by the tellmodule command.toString()Methods inherited from class PamController.PamControlledUnit
addOfflineTaskGroup, addOtherRelatedMenuItems, addPamProcess, addPamProcess, addRelatedMenuItems, canClose, canPlayViewerSound, createDisplayMenu, createFileMenu, createHelpMenu, flushDataBlockBuffers, getBackupInformation, getFrameNumber, getGuiFrame, getInstanceIndex, getModuleStatus, getModuleStatusManager, getModuleSummary, getNumOfflineTaskGroups, getNumPamProcesses, getOfflineState, getOfflineTaskGroup, getPamConfiguration, getPamController, getPamModuleInfo, getPamProcess, getPamView, getPlugin, getShortUnitType, getSidePanel, getTabClipCopier, getTabPanel, getTabSpecificMenuBar, getToolbarComponent, getUnitName, getUnitTaskManager, getUnitTaskManager, getUnitType, getVerboseLevel, gotoTab, isInMainConfiguration, isNetRx, isViewer, pamClose, pamToStart, playViewerSound, removePamProcess, rename, saveViewerData, setFrameNumber, setModuleStatusManager, setPamConfiguration, setPamController, setPamModuleInfo, setPamView, setSidePanel, setTabPanel, setToolbarComponent, setUnitTaskManager, stopViewerSound, terminalPrint, terminalPrintlnMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface PamController.OfflineFileDataStore
getUnitNameMethods inherited from interface PamController.PamSettings
getUnitTypeMethods inherited from interface PamController.SettingsNameProvider
getUnitName 
- 
Field Details
- 
systemList
 - 
acquisitionParameters
 - 
acquisitionProcess
 - 
daqMenuEnabler
 - 
offlineFileServer
 - 
unitType
- See Also:
 
 - 
acquisitionControl
 - 
statusBarComponent
 - 
pamController
 - 
daqChannelListManager
 - 
folderSystem
 - 
fileDate
 - 
soundFileTypes
 
 - 
 - 
Constructor Details
- 
AcquisitionControl
Main control unit for audio data acquisition.It is possible to instantiate several instances of this, preferably with different names to simultaneously acquire sound from a number of sources such as multiple sound cards, fast ADC boards, etc.
Each different acquisition device must implement the DaqSystem interface and register with each AcquisitionControl.
- Parameters:
 name- name of the Acquisition control that will appear in menus. These should be different for each instance of AcquistionControl since the names are used by PamProcesses to find the correct data blocks.- See Also:
 
 - 
AcquisitionControl
 - 
AcquisitionControl
Overloaded constructor - used by the STAcquisitionControl class as a way to call the PamController.PamControlledUnit constructor without all of the AcquisitionControl code above- Parameters:
 type- the type of unitname- the name of the unit
 
 - 
 - 
Method Details
- 
getStatusBarComponent
 - 
registerDaqSystem
Registered new DAQ systems and makes them available via the AcquisitionCialog- Parameters:
 daqSystem-
 - 
getControllers
 - 
getDataLocation
Description copied from interface:OfflineDataStoreGet 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:
 getDataLocationin interfaceOfflineDataStore- Returns:
 - store locations
 
 - 
getDaqProcess
 - 
setDaqProcess
 - 
findDaqSystem
Finds a reference to a given DAQ system based on it's type (e.g. sound card, file, etc.- Parameters:
 systemType-- Returns:
 - reference to a DaqSystem object
 
 - 
createDetectionMenu
Description copied from class:PamControlledUnitCreate a JMenu object containing MenuItems associated with PamProcesses- Overrides:
 createDetectionMenuin 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.
 
 - 
setSelectedSystem
public void setSelectedSystem() - 
checkArrayChannels
public boolean checkArrayChannels()Check array channels have corresponding hydrophones in the array manager. Does not open a dialog to warn or fix.- Returns:
 - check array channel. False if array manager
 
 - 
checkArrayChannels
Run a check to see that all read out channels are connected to a hydrophone and if not, do something about it.- Returns:
 - true if OK, or problem resolved.
 
 - 
toString
- Overrides:
 toStringin classPamControlledUnit
 - 
setStatusBarLevel
public void setStatusBarLevel(double peakValue) Sets a level meter on the status bar- Parameters:
 peakValue- Maximum amplitude fom AcquisitionProcess
 - 
setupStatusBar
protected void setupStatusBar() - 
getSettingsReference
- Specified by:
 getSettingsReferencein interfacePamSettings- Returns:
 - The serialisable object that will be stored
 
 - 
getSettingsVersion
public long getSettingsVersion()- Specified by:
 getSettingsVersionin interfacePamSettings- Returns:
 - An integer version number for the settings
 
 - 
restoreSettings
- Specified by:
 restoreSettingsin interfacePamSettings- Parameters:
 pamControlledUnitSettings-- 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
 
 - 
setupControlledUnit
public void setupControlledUnit()Description copied from class:PamControlledUnitcalled for all PamControlledUnits after all units have been created. This is a good time for the controlled units and processes to find and check their source data and the configuration generally since most onjects (i.e. output data blocks) should be in place- Overrides:
 setupControlledUnitin classPamControlledUnit
 - 
ChannelsToHydrophones
public int ChannelsToHydrophones(int channels)  - 
getHydrophoneList
public int[] getHydrophoneList()Return a list of which channels are connected to which hydrophones in the currentarray.- Returns:
 - List of hydrophone numbers.
 
 - 
setHydrophoneList
public void setHydrophoneList(int[] hydrophoneList) Sets the list of hydrophone numbers.- Parameters:
 hydrophoneList- List of hydrophone numbers in channel order
 - 
findHydrophoneChannel
public int findHydrophoneChannel(int hydrophoneId) finds the ADC channel for a given hydrophone. Will return -1 if no ADC channel uses this hydrophone- Parameters:
 hydrophoneId- Number of a hydrophone in a PamArray- Returns:
 - the ADC channel for the given hydrophone
 
 - 
getChannelHydrophone
public int getChannelHydrophone(int channel)  - 
getPeak2PeakVoltage
public double getPeak2PeakVoltage(int swChannel)  - 
removeUnit
public boolean removeUnit()Description copied from class:PamControlledUnitCalled to remove a unit.- Overrides:
 removeUnitin classPamControlledUnit- Returns:
 - try (not used)
 
 - 
getAcquisitionParameters
Getter for acquisition parameters.- Returns:
 - data acquisition parameters.
 
 - 
getAcquisitionProcess
 - 
getDaqChannelListManager
 - 
getOfflineFileServer
- Specified by:
 getOfflineFileServerin interfaceOfflineFileDataStore- Returns:
 - the offlineFileServer
 
 - 
notifyModelChanged
public void notifyModelChanged(int changeType) Description copied from class:PamControlledUnitGeneral notification when the PAMGAURD model changes.- Overrides:
 notifyModelChangedin classPamControlledUnit- Parameters:
 changeType- type of change
 - 
getFolderSystem
 - 
createOfflineDataMap
Description copied from interface:OfflineDataStoreCreate 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:
 createOfflineDataMapin interfaceOfflineDataStore
 - 
getDataSourceName
Description copied from interface:OfflineDataStoreGet the data source name- Specified by:
 getDataSourceNamein interfaceOfflineDataStore- Returns:
 - data source name
 
 - 
loadData
public boolean loadData(PamDataBlock dataBlock, OfflineDataLoadInfo offlineLoadDataInfo, ViewLoadObserver loadObserver) Description copied from interface:OfflineDataStoreLoad data for a given datablock between two time limits.- Specified by:
 loadDatain interfaceOfflineDataStore- Parameters:
 dataBlock- datablock owner of the dataloadObserver-- Returns:
 - true if load successful.
 
 - 
saveData
Description copied from interface:OfflineDataStoreSave data previously loaded from the store during offline viewing.- Specified by:
 saveDatain interfaceOfflineDataStore- Parameters:
 dataBlock- datablock owner of the data- Returns:
 - true if saved or save not needed. False if an error prevents saving.
 
 - 
getRawDataBlock
- Specified by:
 getRawDataBlockin interfaceOfflineFileDataStore
 - 
getParentProcess
- Specified by:
 getParentProcessin interfaceOfflineFileDataStore
 - 
isStalled
public boolean isStalled() - 
rewriteIndexFile
Description copied from interface:OfflineDataStoreMoved this function over from binary data store. Many storage systems may not be able to do this, but some might !- Specified by:
 rewriteIndexFilein interfaceOfflineDataStore- Parameters:
 dataBlock-dmp-- Returns:
 
 - 
getDatagramManager
- Specified by:
 getDatagramManagerin interfaceOfflineDataStore- Returns:
 - the datagramManager
 
 - 
getFileDate
 - 
loadExternalDaqSystems
public void loadExternalDaqSystems()Load any classes that were found in the plugins folder and implement the DaqSystemInterface interface - 
getSystemList
Get the available DAQ systems- Returns:
 
 - 
setAquisitionParams
Set the acquisition parameters.- Parameters:
 params- - the acquisition params to set.
 - 
getGUI
Description copied from class:PamControlledUnitGet the GUI for the PAMControlled unit. This has multiple GUI options which are instantiated depending on the view type.- Overrides:
 getGUIin classPamControlledUnit- Parameters:
 flag- . The GUI type flag defined in PAMGuiManager.- Returns:
 - the GUI for the PamControlledUnit unit.
 
 - 
getDaqSummary
Get a summary of the daq settings for the QA module.- Returns:
 - summary of DAQ settings.
 
 - 
tellModule
Description copied from class:PamControlledUnitHandle a module specific command sent by the tellmodule command.- Overrides:
 tellModulein classPamControlledUnit- Parameters:
 command- command line (stripped of the command and the module type and name)- Returns:
 - response to command
 
 - 
pamHasStopped
public void pamHasStopped()Description copied from class:PamControlledUnitCalled for all controlled units after Pam acquisition has stopped- Overrides:
 pamHasStoppedin classPamControlledUnit
 - 
getModuleSummary
Description copied from class:PamControlledUnitGet a module summary text string for shorthand output to anyting wanting a short summary of data state / numbers of detections.- Overrides:
 getModuleSummaryin classPamControlledUnit- Parameters:
 clear- clear data after generating string, so that counts of detections, etc. start again from 0.- Returns:
 - module summary string - goings on since the last call to this function
 
 - 
getSUDNotificationManager
Get the SUD processing notification manager.- Returns:
 - SUD processing notification manager.
 
 - 
getRawInputType
public int getRawInputType()Description copied from class:RawInputControlledUnitType of data input, which can be one of RAW_INPUT_UNKNOWN (0), RAW_INPUT_FILEARCHIVE (1), or RAW_INPUT_REALTIME (2)- Specified by:
 getRawInputTypein classRawInputControlledUnit- Returns:
 
 - 
getStoreInfo
Description copied from interface:DataStoreInfoHolderGet information about the input store (e.g. start times of all files).- Specified by:
 getStoreInfoin interfaceDataStoreInfoHolder- Parameters:
 workMonitor- monitor for work progress, should be called whenever a task is likely to take a long time so that a progress bar can update.detail- get detail of all files.- Returns:
 - information about data input.
 
 - 
setAnalysisStartTime
public boolean setAnalysisStartTime(long startTime) Description copied from interface:DataInputStoreSet an analysis start time. This might get called just before processing starts, in which case- Specified by:
 setAnalysisStartTimein interfaceDataInputStore- Parameters:
 startTime-- Returns:
 - ok if no problems.
 
 - 
getBatchStatus
Very specific command handler for batch status which will only work with the folderinputSystem.- Specified by:
 getBatchStatusin interfaceDataInputStore- Returns:
 
 - 
startButtonXtraActions
Description copied from class:RawInputControlledUnitStart button extra actions. e.g. to process from first file, continue from current position, etc.- Overrides:
 startButtonXtraActionsin classRawInputControlledUnit- Parameters:
 component- The start buttone- input event, might be a MouseEvent or a ActionEvent from a button
 - 
getStartButtonToolTip
Description copied from class:RawInputControlledUnitGet a tooltip for the default action of the start button. Return null for default "start processing" tip.- Overrides:
 getStartButtonToolTipin classRawInputControlledUnit- Returns:
 
 
 -