|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectPamguardMVC.PamObservable
PamguardMVC.PamDataBlock<Tunit>
public class PamDataBlock<Tunit extends PamDataUnit>
PamDataBlocks manage the data from PamProcesses.
New data, either from external sources (sound cards, GPS, etc.) or detector output (clicks or whistles, etc.) are placed in PamDataUnits. The job of a PamDataBlock is to manage those PamDataUnits.
Processes that require the data from a PamDataBlock must implement PamObserver and subscribe as listeners to the PamDataBlock. When a new PamDataUnit is added to a data block, all listeners will be notified and sent references both to the data block and the data unit.
Each PamDatablock is also responsible for deleting old data. Since only the observers of PamDataBlocks know how much historical data is required, before deleting any data each PamDataBlock asks all the PamObservers for their required data history in milliseconds and takes the maximum value returned by all observers. The PamDataBlock will then calculate the time of the first required data unit and delete all preceding units. This operation takes place approximately once per second.
For example, a whistle detector, while searching for whistles, may only require the last two or three data units from the data block containing FFT data, but when it's found a complete whistle, it may need to go back and look at the FFT data from other channels in order to calculate a location, or it may require the raw data in order to look at the original waveform. As another example, the map panel may want to hold several hours of data in memory for display purposes.
It is essential that PamProcesses are realistic about how much data they can ask a PamDataBlock to hold - if they consistently ask for too much data to be stored, the computer will run out of memory.
PamDataUnit,
PamProcess| Nested Class Summary | |
|---|---|
(package private) class |
PamDataBlock.OrderData
|
| Field Summary | |
|---|---|
private boolean |
acousticData
|
private java.util.Vector<Annotation> |
annotations
|
private BinaryDataSource |
binaryDataSource
|
(package private) int |
channelMap
|
private long |
currentViewDataEnd
|
private long |
currentViewDataStart
|
protected java.lang.String |
dataName
|
private boolean |
isViewer
|
static int |
ITERATOR_END
|
private PamObserver |
lastEndUser
|
private int |
lastRequestAnswer
|
private long |
lastRequestEnd
|
private PamObserver |
lastRequestObserver
|
private long |
lastRequestStart
|
private boolean |
linkGpsData
|
private int |
localisationContents
Flags from AbstractLocalisation to say what localisation information may be present in data in this class. |
private SQLLogging |
logging
|
static int |
MATCH_AFTER
If there is not exact time match, set the iterator so that the first element it returns will be the element after the requested time. |
static int |
MATCH_BEFORE
If there is not exact time match, set the iterator so that the first element it returns will be the element before the requested time. |
static int |
MATCH_EXACT
Only accept an iterator for a unit that matches the time exactly |
static int |
MIX_DONOTHING
|
static int |
MIX_INTODATABASE
|
static int |
MIX_OUTOFDATABASE
|
private int |
mixedDirection
when Pamguard is running in mixed mode, some data are being reanalysed and are being written back into the database, others are being taken out of the database. |
protected int |
naturalLifetime
Natural lifetime of data in seconds. |
static int |
NOTIFY_NEW_DATA
if possible, loads old data back in from a database or other storage space. |
static int |
NOTIFY_UPDATE_DATA
|
static int |
OFFLINE_DATA_CANCEL
|
static int |
OFFLINE_DATA_INTERRUPT
|
static int |
OFFLINE_DATA_WAIT
|
private java.util.Vector<OfflineDataMap> |
offlineDataMaps
|
private PamDataBlock.OrderData |
orderData
|
java.lang.Object |
orderLock
|
protected java.util.List<Tunit> |
pamDataUnits
|
protected PamProcess |
parentProcess
|
static int |
POSITION_AFTER
Set the iterator so that a call to next() will give the first wanted element |
static int |
POSITION_BEFORE
Set the iterator so that a call to previous() will give the first wanted element |
private java.util.Vector<Tunit> |
recycledUnits
|
private boolean |
recycling
Allow recycling within this data block |
private int |
recyclingStoreLength
Max length for the recycling store. |
static int |
REFERENCE_ABSOLUTE
When getting a DataUnit from the Datablock, get the absolute data unit, i.e. |
static int |
REFERENCE_CURRENT
When getting a DataUnit from the Datablock, get the current data unit, i.e. |
private java.util.List<Tunit> |
removedItems
Only used in viewer mode to store a list of items which may need to be deleted from file or the databse. |
static int |
REQUEST_DATA_LOADED
Data loaded for requested time period. |
static int |
REQUEST_DATA_PARTIAL_LOAD
Data partially loaded for requested time period |
static int |
REQUEST_EXCEPTION
The request threw an exception of some sort. |
static int |
REQUEST_INTERRUPTED
The request was interrupted (in multi thread load) |
static int |
REQUEST_NO_DATA
No data available for offline loading. |
static int |
REQUEST_SAME_REQUEST
this is exactly the same data as requested last time. |
private java.util.Vector<PamObserver> |
requestingObservers
Used in offine analysis when data arebeing reloaded. |
private boolean |
shouldLog
|
(package private) javax.swing.Timer |
t
|
private java.lang.Class |
unitClass
|
protected int |
unitsAdded
|
protected int |
unitsRemoved
|
protected int |
unitsUpdated
|
| Fields inherited from class PamguardMVC.PamObservable |
|---|
masterClockSample, objectChanged, overlayDraw, pamObservers, pamProfiler, totalCalls |
| Constructor Summary | |
|---|---|
PamDataBlock(java.lang.Class unitClass,
java.lang.String dataName,
PamProcess parentProcess,
int channelMap)
PamDataBlock constructor. |
|
| Method Summary | |
|---|---|
void |
addLocalisationContents(int localisationContents)
|
void |
addObserver(PamObserver o)
Adds a PamObserver, which will then receive notifications when data is added. |
void |
addObserver(PamObserver o,
boolean reThread)
|
void |
addOfflineDataMap(OfflineDataMap offlineDataMap)
Adds a new offline datamap to the data block |
void |
addPamData(Tunit pamDataUnit)
Adds a new PamDataUnit to the PamDataBlock. |
private void |
addRequestingObserver(PamObserver observer)
Add observer to requesting observer list which is used to distribute data to selected observers when it's reloaded in offline viewer mode. |
void |
autoSetDataBlockMixMode()
|
void |
clearAll()
Clears all PamDataUnits from memory |
void |
clearDeletedList()
|
private int |
createAllAnnotations()
Gets all the annotations from the parent process and all upstream processes. |
int |
createAnnotations(PamDataBlock sourceData,
Annotator newAnnotations)
Copies all annotations over from the source DataBlock, then adds in the new ones from the new datablock. |
int |
createAnnotations(PamDataBlock sourceData,
Annotator newAnnotations,
boolean notifyDownstream)
Copies all annotations over from the source DataBlock, then adds in the new ones from the new datablock. |
void |
dumpBlockContents()
|
Annotation |
findAnnotation(Annotation template)
Finds an annotation with the same type and name as the template annotation |
Annotation |
findAnnotation(java.lang.String type,
java.lang.String name)
Finds an annotation with the given type and name |
Tunit |
findByDatabaseIndex(int databaseIndex)
Find a dataunit based on it's database index. |
Tunit |
findDataUnit(long timeMS,
int channels)
Find a data unit. |
Tunit |
findDataUnit(long timeMS,
int channels,
int absStartPos)
Find a unit that starts at a specific time. |
private Tunit |
findDataUnitBackwards(long timeMS,
int channels)
|
protected Tunit |
getAbsoluteDataUnit(int absReference)
Gets a specific data unit using an absolute reference system which keeps track of data units that have been removed. |
java.util.Vector<Annotation> |
getAnnotations()
|
BinaryDataSource |
getBinaryDataSource()
|
boolean |
getCanLog()
|
int |
getChannelMap()
|
Tunit |
getClosestUnitMillis(long startTime)
Find the closest data unit to a given time. |
private Tunit |
getCurrentDataUnit(int ref)
|
long |
getCurrentViewDataEnd()
|
long |
getCurrentViewDataStart()
|
double |
getDataGain(int iChan)
Return the gain applied to any data created into this datablock. |
java.lang.String |
getDataName()
|
Tunit |
getDataUnit(int ref,
int refType)
Gets a reference to a data unit. |
Tunit |
getFirstUnit()
Gets the first data unit stored |
Tunit |
getFirstUnitAfter(long timems)
Return the first DataUnit that is on or after the given time |
Tunit |
getLastUnit()
Gets the last data unit stored |
java.util.ListIterator<Tunit> |
getListIterator(int whereFrom)
|
java.util.ListIterator<Tunit> |
getListIterator(long startTimeMillis,
int channels,
int match,
int position)
|
java.util.ListIterator<Tunit> |
getListIteratorFromEnd(long startTime,
int channels,
int match,
int position)
|
java.util.ListIterator<Tunit> |
getListIteratorFromStart(long startTime,
int channels,
int match,
int position)
|
int |
getLocalisationContents()
|
SQLLogging |
getLogging()
|
java.lang.String |
getLoggingName()
|
java.lang.String |
getLongDataName()
|
int |
getMixedDirection()
|
int |
getNaturalLifetime()
|
int |
getNaturalLifetimeMillis()
|
long |
getNextDataStart(long timeMillis)
Get the next data start point. |
int |
getNumOfflineDataMaps()
|
int |
getOfflineData(PamObserver observer,
PamObserver endUser,
long startMillis,
long endMillis)
Gets data for offline display, playback, etc. |
int |
getOfflineData(PamObserver observer,
PamObserver endUser,
long startMillis,
long endMillis,
boolean allowRepeats)
Gets data for offline display, playback, etc. |
OfflineDataMap |
getOfflineDataMap(int iMap)
|
OfflineDataMap |
getOfflineDataMap(OfflineDataStore dataSource)
|
boolean |
getOrderStatus()
|
PamProcess |
getParentProcess()
|
Tunit |
getPreceedingUnit(java.util.ListIterator<Tunit> listIterator,
long startTime)
Finds the data unit before the given start time. |
Tunit |
getPreceedingUnit(java.util.ListIterator<Tunit> listIterator,
long startTime,
int channelMap)
Finds the data unit before the given start time that has the same channel map. |
Tunit |
getPreceedingUnit(long startTime)
Simple function to find the data unit at or before the given start time. |
Tunit |
getPreceedingUnit(long startTime,
int channelMap)
Simple function to find the data unit at or before the given start time that has a given channel bitmap |
long |
getPrevDataEnd(long timeMillis)
Get the previous data end point. |
OfflineDataMap |
getPrimaryDataMap()
Get the data map which has the most data in it |
PamRawDataBlock |
getRawSourceDataBlock()
|
Tunit |
getRecycledUnit()
Gets a recycled data unit if one is available. |
int |
getRecyclingStoreLength()
|
java.util.List<Tunit> |
getRemovedItems()
|
float |
getSampleRate()
|
SaveRequirements |
getSaveRequirements(OfflineDataStore dataStore)
Work out some basic information about the elements that need saving from these data. |
boolean |
getShouldLog(PamDataUnit pamDataUnit)
|
PamDataBlock |
getSourceDataBlock()
|
PamProcess |
getSourceProcess()
|
java.lang.Class |
getUnitClass()
|
int |
getUnitIndex(Tunit dataUnit)
|
int |
getUnitsCount()
|
int |
getUnitsCountFromTime(long countStart)
|
boolean |
isLinkGpsData()
|
boolean |
isRecycling()
|
boolean |
loadViewerData(long dataStart,
long dataEnd)
Instruction from the viewer scroll manager to load new data. |
void |
masterClockUpdate(long milliSeconds,
long clockSample)
|
void |
noteNewSettings()
Tell all observers of this datablock that some control parameters have changed. |
void |
notifyModelChanged(int changeType)
Receive notifications from the main PamController. |
private void |
notifyOfflineObservers(Tunit pamDataUnit)
|
void |
orderOfflineData(PamObserver dataObserver,
LoadObserver loadObserver,
long startMillis,
long endMillis,
int interrupt)
Similar functionality to getOfflineData, but this will launch a separate worker thread to do the actual work getting the data. |
void |
orderOfflineData(PamObserver dataObserver,
LoadObserver loadObserver,
long startMillis,
long endMillis,
int interrupt,
boolean allowRepeats)
Similar functionality to getOfflineData, but this will launch a separate worker thread to do the actual work getting the data. |
void |
remove()
|
boolean |
remove(Tunit aDataUnit)
|
private void |
removeOfflineDataMap(OfflineDataStore dataSource)
remove a no longer needed offline data map. |
protected int |
removeOldUnitsS(long mastrClockSample)
|
protected int |
removeOldUnitsT(long currentTimeMS)
Removes olderPamDataUnits from memory, starting at the first unit and continuing until if finds one with data coming earlier than the given time in milliseconds. |
private void |
removeRequestingObserver(PamObserver observer)
Remove observer from requesting observer list which is used to distribute data to selected observers when it's reloaded in offline viewer mode. |
boolean |
saveViewerData()
Saves data in this data block in offline viewer mode. |
private Tunit |
searchFirstUnitAfter(long timems)
Search through data units, starting at the last on the assumption that we'll be more interested in more recent data. |
void |
setBinaryDataSource(BinaryDataSource binaryDataSource)
|
void |
setChannelMap(int channelMap)
|
void |
setDataName(java.lang.String dataName)
|
void |
setLinkGpsData(boolean linkGpsData)
|
void |
setLocalisationContents(int localisationContents)
|
void |
SetLogging(SQLLogging logging)
|
void |
setMixedDirection(int mixedDirection)
|
void |
setNaturalLifetime(int naturalLifetime)
Set the natural lifetime of the data if there are no observers asking to keep it for longer |
void |
setNaturalLifetimeMillis(int naturalLifetime)
|
void |
setRecycling(boolean recycling)
|
void |
setRecyclingStoreLength(int recyclingStoreLength)
|
void |
setSampleRate(float sampleRate,
boolean notify)
Sets the sample rate for the block (e.g. |
void |
setShouldLog(boolean shouldLog)
|
private boolean |
shouldDelete()
|
boolean |
shouldNotify()
|
private Tunit |
slowFindByDatabaseIndex(int databaseIndex)
Search all units in reverse order. |
java.lang.String |
toString()
|
void |
updatePamData(Tunit pamDataUnit,
long timeMillis)
|
| Methods inherited from class PamguardMVC.PamObservable |
|---|
canDraw, clearchanged, countObservers, createKeyItem, deleteObserver, deleteObservers, drawDataUnit, findThreadedObserver, getCPUPercent, getCPUPercent, getHoverText, getLongestObserver, getPamObservers, getRequiredHistory, notifyObservers, notifyObservers, setChanged, setOverlayDraw, waitForThreadedObservers |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int REFERENCE_ABSOLUTE
public static final int REFERENCE_CURRENT
private int mixedDirection
These flags tell each individual datablock what it should do.
public static final int MIX_DONOTHING
public static final int MIX_OUTOFDATABASE
public static final int MIX_INTODATABASE
protected java.lang.String dataName
public static final int REQUEST_NO_DATA
public static final int REQUEST_DATA_LOADED
public static final int REQUEST_DATA_PARTIAL_LOAD
public static final int REQUEST_SAME_REQUEST
This flag will be used with one of the other three.
public static final int REQUEST_INTERRUPTED
public static final int REQUEST_EXCEPTION
protected java.util.List<Tunit extends PamDataUnit> pamDataUnits
private java.util.List<Tunit extends PamDataUnit> removedItems
private boolean isViewer
protected PamProcess parentProcess
private BinaryDataSource binaryDataSource
private int localisationContents
private java.util.Vector<PamObserver> requestingObservers
protected int naturalLifetime
protected int unitsRemoved
protected int unitsAdded
protected int unitsUpdated
int channelMap
private boolean linkGpsData
private java.lang.Class unitClass
private boolean acousticData
private boolean recycling
private int recyclingStoreLength
private java.util.Vector<Tunit extends PamDataUnit> recycledUnits
javax.swing.Timer t
private long currentViewDataStart
private long currentViewDataEnd
public static final int NOTIFY_NEW_DATA
public static final int NOTIFY_UPDATE_DATA
public static final int ITERATOR_END
public static final int MATCH_EXACT
public static final int MATCH_BEFORE
public static final int MATCH_AFTER
public static final int POSITION_BEFORE
public static final int POSITION_AFTER
private java.util.Vector<Annotation> annotations
private java.util.Vector<OfflineDataMap> offlineDataMaps
private SQLLogging logging
private boolean shouldLog
public static final int OFFLINE_DATA_INTERRUPT
public static final int OFFLINE_DATA_WAIT
public static final int OFFLINE_DATA_CANCEL
private volatile PamDataBlock.OrderData orderData
public java.lang.Object orderLock
private int lastRequestAnswer
private long lastRequestStart
private long lastRequestEnd
private PamObserver lastRequestObserver
private PamObserver lastEndUser
| Constructor Detail |
|---|
public PamDataBlock(java.lang.Class unitClass,
java.lang.String dataName,
PamProcess parentProcess,
int channelMap)
unitClass - class of data unit to hold in this data blockdataName - name of data blockparentProcess - parent PamProcesschannelMap - bitmap of channels which may be represented in data units in this data block.| Method Detail |
|---|
private boolean shouldDelete()
public void remove()
public int getUnitsCount()
public int getUnitsCountFromTime(long countStart)
public java.util.List<Tunit> getRemovedItems()
public Tunit getFirstUnitAfter(long timems)
timems - Milliseconds - UTC in standard Java epoch
public Tunit findDataUnit(long timeMS,
int channels,
int absStartPos)
timeMS - start time of data unitchannels - channel bitmap of data unitabsStartPos - start position for search, -1 if you
want to start searching backwards from the end.
private Tunit findDataUnitBackwards(long timeMS,
int channels)
public Tunit findDataUnit(long timeMS,
int channels)
timeMS - start time of PamDataUnitchannels - channel bitmap of PamDataUnit
public int getUnitIndex(Tunit dataUnit)
public Tunit findByDatabaseIndex(int databaseIndex)
databaseIndex - Index to search for.
private Tunit slowFindByDatabaseIndex(int databaseIndex)
databaseIndex - Database index to search for
private Tunit searchFirstUnitAfter(long timems)
timems - search time
public void clearAll()
In viewer mode, data are also re-saved.
public long getCurrentViewDataStart()
public long getCurrentViewDataEnd()
public boolean loadViewerData(long dataStart,
long dataEnd)
dataStart - data start time in millisdataEnd - data end time in millis.public boolean saveViewerData()
public void addPamData(Tunit pamDataUnit)
pamDataUnit - Reference to a PamDataUnitprivate void notifyOfflineObservers(Tunit pamDataUnit)
public void updatePamData(Tunit pamDataUnit,
long timeMillis)
public boolean shouldNotify()
public boolean remove(Tunit aDataUnit)
protected int removeOldUnitsT(long currentTimeMS)
If the data are acoustic, it tries to find the data source and looks to see how much data has been placed in the source data unit and does the calculation in samples.
currentTimeMS - Time in milliseconds of the first data which must be kept
protected int removeOldUnitsS(long mastrClockSample)
public Tunit getRecycledUnit()
public PamDataBlock getSourceDataBlock()
public Tunit getDataUnit(int ref,
int refType)
ref - number of the data unitrefType - REFERENCE_ABSOLUTE or REFERENCE_CURRENT
protected Tunit getAbsoluteDataUnit(int absReference)
absReference - Absolute reference to the data unit
private Tunit getCurrentDataUnit(int ref)
public Tunit getLastUnit()
public Tunit getFirstUnit()
public Tunit getPreceedingUnit(java.util.ListIterator<Tunit> listIterator,
long startTime)
This implementation is passed an iterator which has already been initialised to be at the END of the list. In this way, the calling function has access to the iterator and can access nearby elements.
listIterator - pre initialised ListIteratorstartTime - search time in milliseconds
ListIterator
public Tunit getPreceedingUnit(java.util.ListIterator<Tunit> listIterator,
long startTime,
int channelMap)
This implementation is passed an iterator which has already been initialised to be at the END of the list. In this way, the calling function has access to the iterator and can access nearby elements.
listIterator - pre initialised ListIteratorstartTime - search time in millisecondschannelMap - Channel bitmap
ListIteratorpublic Tunit getPreceedingUnit(long startTime)
startTime - search time in milliseconds
public Tunit getPreceedingUnit(long startTime,
int channelMap)
startTime - search time in millisecondschannelMap - Channel bitmap
public Tunit getClosestUnitMillis(long startTime)
startTime - Start time of data unit (milliseconds)
public float getSampleRate()
public java.lang.String getDataName()
public java.lang.String getLongDataName()
public void setSampleRate(float sampleRate,
boolean notify)
sampleRate - The new sample rate in Hz.notify - set true if Observers should be notified
public void masterClockUpdate(long milliSeconds,
long clockSample)
public void noteNewSettings()
public java.lang.String toString()
toString in class java.lang.Objectpublic int getNaturalLifetime()
public void setNaturalLifetimeMillis(int naturalLifetime)
public int getNaturalLifetimeMillis()
public void setNaturalLifetime(int naturalLifetime)
naturalLifetime - in seconds (NOT milliseconds)public boolean isLinkGpsData()
public void setLinkGpsData(boolean linkGpsData)
public int getChannelMap()
public double getDataGain(int iChan)
Example 1: The amplifier module will just return it's gain
Example 2: The FFT module will return the loss due to windowing the data.
To convert to dB use 20*log10(Math.abs(getDataGain()));
iChan - channel number
public void setChannelMap(int channelMap)
public void setDataName(java.lang.String dataName)
dataName - The dataName to set.public java.lang.String getLoggingName()
public PamProcess getParentProcess()
public PamProcess getSourceProcess()
public PamRawDataBlock getRawSourceDataBlock()
public void addObserver(PamObserver o)
PamObservable
addObserver in class PamObservableo - Reference to the observer
public void addObserver(PamObserver o,
boolean reThread)
addObserver in class PamObservablepublic java.lang.Class getUnitClass()
public void autoSetDataBlockMixMode()
public int getMixedDirection()
public void setMixedDirection(int mixedDirection)
public int getLocalisationContents()
public void setLocalisationContents(int localisationContents)
public void addLocalisationContents(int localisationContents)
public java.util.ListIterator<Tunit> getListIterator(int whereFrom)
public java.util.ListIterator<Tunit> getListIterator(long startTimeMillis,
int channels,
int match,
int position)
public java.util.ListIterator<Tunit> getListIteratorFromStart(long startTime,
int channels,
int match,
int position)
public void dumpBlockContents()
public java.util.ListIterator<Tunit> getListIteratorFromEnd(long startTime,
int channels,
int match,
int position)
public java.util.Vector<Annotation> getAnnotations()
private int createAllAnnotations()
public int createAnnotations(PamDataBlock sourceData,
Annotator newAnnotations)
sourceData - source DatablocknewAnnotations - source of new annotations
public int createAnnotations(PamDataBlock sourceData,
Annotator newAnnotations,
boolean notifyDownstream)
sourceData - source DatablocknewAnnotations - source of new annotationsnotifydownstream - notify downstream modules.
public Annotation findAnnotation(java.lang.String type,
java.lang.String name)
type - annotation typename - annotation name
public Annotation findAnnotation(Annotation template)
template - template annotation
public void setRecycling(boolean recycling)
recycling - the recycling to setpublic boolean isRecycling()
public void setRecyclingStoreLength(int recyclingStoreLength)
recyclingStoreLength - the recyclingStoreLength to setpublic int getRecyclingStoreLength()
public void notifyModelChanged(int changeType)
changeType - public void setBinaryDataSource(BinaryDataSource binaryDataSource)
siterBinaryDataSource - the siterBinaryDataSource to setpublic BinaryDataSource getBinaryDataSource()
public void SetLogging(SQLLogging logging)
public SQLLogging getLogging()
public final boolean getCanLog()
public boolean getShouldLog(PamDataUnit pamDataUnit)
public final void setShouldLog(boolean shouldLog)
public void addOfflineDataMap(OfflineDataMap offlineDataMap)
Note that there may be several maps from different types of storage (although only one should have anything in it in a sensible world).
It's also possible that these will be recreated during a run, and we don't want two of the same type in the same datablock, so check that there isn't already one and remove it
offlineDataMap - public int getNumOfflineDataMaps()
public OfflineDataMap getOfflineDataMap(int iMap)
iMap - index of map (see getNumOfflineDataMaps)
public OfflineDataMap getOfflineDataMap(OfflineDataStore dataSource)
dataSource - an offline data source (e.g. binaray storage, database storage, etc.
public OfflineDataMap getPrimaryDataMap()
private void removeOfflineDataMap(OfflineDataStore dataSource)
dataSource - data source (e.g. binary, database, raw data, etc.public SaveRequirements getSaveRequirements(OfflineDataStore dataStore)
dataStore - data source that want's to save the data.
public void orderOfflineData(PamObserver dataObserver,
LoadObserver loadObserver,
long startMillis,
long endMillis,
int interrupt)
getOfflineData will probably (if not overridden) be sending data to the update member function of the observer, but from the worker thread. Once it's complete, it will send a message to say that data are loaded.
It's possible that the user will do something which causes this to be called again before the previous thread completed execution, in which case there are three options:
OFFLINE_DATA_INTERRUPT - previous thread will be terminated
OFFLINE_DATA_WAIT - wait for previous thread to terminate, then start this load
OFFLINE_DATA_CANCEL - give up and return
dataObserver - observer of the loaded dataloadObserver - observer to get status information on the load.startMillis - data start time in imillisecondsendMillis - data end time in milliseconds.interrupt - interrupt options.
public void orderOfflineData(PamObserver dataObserver,
LoadObserver loadObserver,
long startMillis,
long endMillis,
int interrupt,
boolean allowRepeats)
getOfflineData will probably (if not overridden) be sending data to the update member function of the observer, but from the worker thread. Once it's complete, it will send a message to say that data are loaded.
It's possible that the user will do something which causes this to be called again before the previous thread completed execution, in which case there are three options:
OFFLINE_DATA_INTERRUPT - previous thread will be terminated
OFFLINE_DATA_WAIT - wait for previous thread to terminate, then start this load
OFFLINE_DATA_CANCEL - give up and return
dataObserver - observer of the loaded dataloadObserver - observer to get status information on the load.startMillis - data start time in imillisecondsendMillis - data end time in milliseconds.interrupt - interrupt options.allowRepeats - allow repeated loads of exactly the same data.public boolean getOrderStatus()
public int getOfflineData(PamObserver observer,
PamObserver endUser,
long startMillis,
long endMillis)
This is used to get data from some upstream process which is quite different to the function loadViewerData(...) which loads data directly associated with this data block.
For example, this might be called in the FFT data block by the spectrogram which wants some data to display. The FFT data block does not have this data, so it passes the request up to it's process which will in turn pass the request on until it reaches a module which is capable of loading data into data units and sending them back down the line.
Thsi will not cause the same data to be reloaded for the same observer a second time - use the full version with extra paramter if you need this.
observer - data observer which will receive the datastartMillis - start time in millisecondsendMillis - end time in millisecondsallowRepeats - allow the same data to be loaded a second time.
public int getOfflineData(PamObserver observer,
PamObserver endUser,
long startMillis,
long endMillis,
boolean allowRepeats)
This is used to get data from some upstream process which is quite different to the function loadViewerData(...) which loads data directly associated with this data block.
For example, this might be called in the FFT data block by the spectrogram which wants some data to display. The FFT data block does not have this data, so it passes the request up to it's process which will in turn pass the request on until it reaches a module which is capable of loading data into data units and sending them back down the line.
observer - data observer which will receive the datastartMillis - start time in millisecondsendMillis - end time in millisecondsallowRepeats - allow the same data to be loaded a second time.
private void addRequestingObserver(PamObserver observer)
observer - observerprivate void removeRequestingObserver(PamObserver observer)
observer - observerpublic void clearDeletedList()
public long getNextDataStart(long timeMillis)
timeMillis - current time in milliseconds
public long getPrevDataEnd(long timeMillis)
timeMillis - current time in milliseconds
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||