public class AcquisitionControl extends PamControlledUnit implements PamSettings, OfflineRawDataStore
Uses a plug in architecture to allow new types to be added. This is done through RegisterDaqType()
DaqSystem
Modifier and Type | Field and Description |
---|---|
AcquisitionParameters |
acquisitionParameters |
static java.lang.String |
unitType |
Constructor and Description |
---|
AcquisitionControl(java.lang.String name)
Main control unit for audio data acquisition.
|
AcquisitionControl(java.lang.String name,
boolean isSimulator) |
Modifier and Type | Method and Description |
---|---|
int |
ChannelsToHydrophones(int channels) |
boolean |
checkArrayChannels(java.awt.Frame parentFrame)
Run a check to see that all read out channels are connected to
a hydrophone and if not, do something about it.
|
javax.swing.JMenuItem |
createDetectionMenu(java.awt.Frame parentFrame)
Create a JMenu object containing MenuItems associated with PamProcesses
|
void |
createOfflineDataMap(java.awt.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.
|
DaqSystem |
findDaqSystem(java.lang.String systemType)
Finds a reference to a given DAQ system based on it's type (e.g.
|
int |
findHydrophoneChannel(int hydrophoneId)
finds the ADC channel for a given hydrophone.
|
AcquisitionParameters |
getAcquisitionParameters()
Getter for acquisition parameters.
|
AcquisitionProcess |
getAcquisitionProcess() |
int |
getChannelHydrophone(int channel) |
static java.util.ArrayList<AcquisitionControl> |
getControllers() |
DAQChannelListManager |
getDaqChannelListManager() |
AcquisitionProcess |
getDaqProcess() |
DatagramManager |
getDatagramManager() |
java.lang.String |
getDataSourceName()
Get the data source name
|
int[] |
getHydrophoneList()
Return a list of which channels are connected to which hydrophones in
the currentarray.
|
OfflineFileServer |
getOfflineFileServer() |
PamProcess |
getParentProcess() |
double |
getPeak2PeakVoltage(int swChannel) |
PamRawDataBlock |
getRawDataBlock() |
java.io.Serializable |
getSettingsReference() |
long |
getSettingsVersion() |
boolean |
isStalled() |
boolean |
loadData(PamDataBlock dataBlock,
long dataStart,
long dataEnd,
RequestCancellationObject cancellationObject,
ViewLoadObserver loadObserver)
Load data for a given datablock between two time limits.
|
void |
notifyModelChanged(int changeType)
General notification when the PAMGAURD model changes.
|
void |
registerDaqSystem(DaqSystem daqSystem)
Registered new DAQ systems and makes them available via the AcquisitionCialog
|
boolean |
removeUnit()
Called to remove a unit.
|
boolean |
restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) |
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.
|
void |
setDaqProcess(AcquisitionProcess acquisitionProcess) |
void |
setHydrophoneList(int[] hydrophoneList)
Sets the list of hydrophone numbers.
|
void |
setStatusBarLevel(double peakValue)
Sets a level meter on the status bar
|
void |
setupControlledUnit()
called for all PamControlledUnits after all units have been created.
|
java.lang.String |
toString() |
addOfflineTaskGroup, addOtherRelatedMenuItems, addPamProcess, addRelatedMenuItems, addXMLParameter, addXMLParameter, addXMLParameter, addXMLParameter, canClose, canPlayViewerSound, createDisplayMenu, createFileMenu, createHelpMenu, fillXMLElement, flushDataBlockBuffers, getFrameNumber, getGuiFrame, getModuleSummary, getNumOfflineTaskGroups, getNumPamProcesses, getOfflineTaskGroup, getPamController, getPamModuleInfo, getPamProcess, getPamView, getShortUnitType, getSidePanel, getTabClipCopier, getTabPanel, getTabSpecificMenuBar, getToolbarComponent, getUnitName, getUnitType, getVerboseLevel, gotoTab, isViewer, pamClose, pamHasStopped, pamToStart, playViewerSound, removePamProcess, rename, saveViewerData, setFrameNumber, setPamController, setPamModuleInfo, setPamView, setSidePanel, setTabPanel, stopViewerSound, terminalPrint, terminalPrintln
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getUnitName, getUnitType
getUnitName
public AcquisitionParameters acquisitionParameters
public static final java.lang.String unitType
public AcquisitionControl(java.lang.String name)
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.
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.DaqSystem
public AcquisitionControl(java.lang.String name, boolean isSimulator)
public void registerDaqSystem(DaqSystem daqSystem)
daqSystem
- public static java.util.ArrayList<AcquisitionControl> getControllers()
public AcquisitionProcess getDaqProcess()
public void setDaqProcess(AcquisitionProcess acquisitionProcess)
public DaqSystem findDaqSystem(java.lang.String systemType)
systemType
- public javax.swing.JMenuItem createDetectionMenu(java.awt.Frame parentFrame)
PamControlledUnit
createDetectionMenu
in class PamControlledUnit
parentFrame
- The owner frame of the menuNote 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.
public boolean checkArrayChannels(java.awt.Frame parentFrame)
public java.lang.String toString()
toString
in class PamControlledUnit
public void setStatusBarLevel(double peakValue)
peakValue
- Maximum amplitude fom AcquisitionProcesspublic java.io.Serializable getSettingsReference()
getSettingsReference
in interface PamSettings
public long getSettingsVersion()
getSettingsVersion
in interface PamSettings
public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
restoreSettings
in interface PamSettings
public void setupControlledUnit()
PamControlledUnit
setupControlledUnit
in class PamControlledUnit
public int ChannelsToHydrophones(int channels)
public int[] getHydrophoneList()
public void setHydrophoneList(int[] hydrophoneList)
hydrophoneList
- List of hydrophone numbers in channel orderpublic int findHydrophoneChannel(int hydrophoneId)
hydrophoneId
- Number of a hydrophone in a PamArraypublic int getChannelHydrophone(int channel)
public double getPeak2PeakVoltage(int swChannel)
public boolean removeUnit()
PamControlledUnit
removeUnit
in class PamControlledUnit
public AcquisitionParameters getAcquisitionParameters()
public AcquisitionProcess getAcquisitionProcess()
public DAQChannelListManager getDaqChannelListManager()
public OfflineFileServer getOfflineFileServer()
getOfflineFileServer
in interface OfflineRawDataStore
public void notifyModelChanged(int changeType)
PamControlledUnit
notifyModelChanged
in class PamControlledUnit
changeType
- type of changepublic void createOfflineDataMap(java.awt.Window parentFrame)
OfflineDataStore
createOfflineDataMap
in interface OfflineDataStore
public java.lang.String getDataSourceName()
OfflineDataStore
getDataSourceName
in interface OfflineDataStore
public boolean loadData(PamDataBlock dataBlock, long dataStart, long dataEnd, RequestCancellationObject cancellationObject, ViewLoadObserver loadObserver)
OfflineDataStore
loadData
in interface OfflineDataStore
dataBlock
- datablock owner of the datadataStart
- start time in millisecondsdataEnd
- end time in millisecondspublic boolean saveData(PamDataBlock dataBlock)
OfflineDataStore
saveData
in interface OfflineDataStore
dataBlock
- datablock owner of the datapublic PamRawDataBlock getRawDataBlock()
getRawDataBlock
in interface OfflineRawDataStore
public PamProcess getParentProcess()
getParentProcess
in interface OfflineRawDataStore
public boolean isStalled()
public boolean rewriteIndexFile(PamDataBlock dataBlock, OfflineDataMapPoint dmp)
OfflineDataStore
rewriteIndexFile
in interface OfflineDataStore
public DatagramManager getDatagramManager()
getDatagramManager
in interface OfflineDataStore