public class AISDataBlock extends PamDataBlock<AISDataUnit> implements NMEAEmulator
ITERATOR_END, MATCH_AFTER, MATCH_BEFORE, MATCH_EXACT, MIX_DONOTHING, MIX_INTODATABASE, MIX_OUTOFDATABASE, NOTIFY_NEW_DATA, NOTIFY_UPDATE_DATA, OFFLINE_DATA_CANCEL, OFFLINE_DATA_INTERRUPT, OFFLINE_DATA_WAIT, orderLock, POSITION_AFTER, POSITION_BEFORE, REFERENCE_ABSOLUTE, REFERENCE_CURRENT, REQUEST_DATA_LOADED, REQUEST_DATA_PARTIAL_LOAD, REQUEST_EXCEPTION, REQUEST_INTERRUPTED, REQUEST_NO_DATA, REQUEST_SAME_REQUEST
Constructor and Description |
---|
AISDataBlock(AISControl aisControl,
PamProcess parentProcess) |
Modifier and Type | Method and Description |
---|---|
boolean |
addAISData(AISDataUnit newAISUnit)
aisDataUnit is always a new unit extracted from a
group of AIS strings, but with a single lot of data.
|
AISDataUnit |
findAISDataUnit(int mmsiNumber)
Find and AIS unit based on it's MMSI Number.
|
EmulatedData |
getNextData() |
boolean |
loadViewerData(long dataStart,
long dataEnd,
ViewLoadObserver loadObserver)
Instruction from the viewer scroll manager to load new data.
|
boolean |
prepareDataSource(long[] timeLimits,
long timeOffset)
Prepare the data to be read into the emulator.
|
addDataAnnotationType, addLocalisationContents, addObserver, addObserver, addOfflineDataMap, addPamData, autoSetDataBlockMixMode, cancelDataOrder, clearAll, clearChannelIterators, clearDeletedList, createProcessAnnotations, createProcessAnnotations, dumpBlockContents, findAnnotation, findAnnotation, findByDatabaseIndex, findDataUnit, findDataUnit, findUnitsinInterval, getBinaryDataSource, getCanLog, getChannelIterator, getChannelIteratorCount, getChannelMap, getClosestUnitMillis, getClosestUnitMillis, getCurrentViewDataEnd, getCurrentViewDataStart, getDataAnnotationType, getDataGain, getDatagrammedMap, getDatagramProvider, getDataName, getDataSelectCreator, getDataSelector, getDataUnit, getFirstUnit, getFirstUnit, getFirstUnitAfter, getLastUnit, getLastUnit, getListIterator, getListIterator, getListIteratorFromEnd, getListIteratorFromStart, getLocalisationContents, getLogging, getLoggingName, getLongDataName, getMixedDirection, getNaturalLifetime, getNaturalLifetimeMillis, getNextDataStart, getNextUnit, getNextUnit, getNumDataAnnotationTypes, getNumOfflineDataMaps, getNumRequiredBeforeLoadTime, getOfflineData, getOfflineDataMap, getOfflineDataMap, getOrderStatus, getParentProcess, getPreceedingUnit, getPreceedingUnit, getPreceedingUnit, getPreceedingUnit, getPrevDataEnd, getPrimaryDataMap, getProcessAnnotations, getQuickId, getRawSourceDataBlock, getRawSourceDataBlock2, getRecycledUnit, getRecyclingStoreLength, getRemovedItems, getReverseChannelIterator, getSampleRate, getSaveRequirements, getShouldBinary, getShouldLog, getSourceDataBlock, getSourceProcess, getUnitClass, getUnitIndex, getUnitsCount, getUnitsCountFromTime, isCanClipGenerate, isClearAtStart, isLinkGpsData, isRecycling, masterClockUpdate, noteNewSettings, notifyModelChanged, orderOfflineData, orderOfflineData, remove, remove, removeOfflineDataMap, reset, saveViewerData, setBinaryDataSource, setCanClipGenerate, setChannelMap, setClearAtStart, setDatagramProvider, setDataName, setLinkGpsData, setLocalisationContents, SetLogging, setMixedDirection, setNaturalLifetime, setNaturalLifetimeMillis, setRecordingTrigger, setRecycling, setRecyclingStoreLength, setSampleRate, setShouldBinary, setShouldLog, shouldNotify, sortData, toString, updatePamData
canDraw, clearchanged, countObservers, createKeyItem, deleteObserver, deleteObservers, drawDataUnit, findThreadedObserver, getCPUPercent, getCPUPercent, getHoverText, getLongestObserver, getPamObservers, getRequiredHistory, hasOptionsDialog, notifyObservers, notifyObservers, setChanged, setOverlayDraw, showOptions, waitForThreadedObservers
public AISDataBlock(AISControl aisControl, PamProcess parentProcess)
public boolean addAISData(AISDataUnit newAISUnit)
Whether or not we actually want this data is a complicated question.
If there is no limitation to range, we want it.
If range is limited and the new data is a position report we want it if it's in range.
If it's static data and does not match an existing set of data we don't want it since we don't know if it's in range or not.
If it's static data and matches existing data, then we want it.
If a new unit is created, notifications are sent out automatically. otherwise, generate one to notify observers.
newAISUnit
- new AIS data unitpublic AISDataUnit findAISDataUnit(int mmsiNumber)
mmsiNumber
- public EmulatedData getNextData()
getNextData
in interface NMEAEmulator
public boolean prepareDataSource(long[] timeLimits, long timeOffset)
NMEAEmulator
The task may be as simple as setting up an interator to go through the data already read into the datablock or it may involve setting up a new database query to get back to raw data.
prepareDataSource
in interface NMEAEmulator
timeLimits
- time limits for the emulationtimeOffset
- time offset - between when the data
were collected and the time they should be emulated at.public boolean loadViewerData(long dataStart, long dataEnd, ViewLoadObserver loadObserver)
PamDataBlock
loadViewerData
in class PamDataBlock<AISDataUnit>
dataStart
- data start time in millisdataEnd
- data end time in millis.