Class TLcdASDILiveDecoder
TLcdModelList
with it.
Depending on the type of messages in the ASDI feed different ILcdModel
objects are added to the TLcdModelList
. All ILcdModel
objects have an ILcdModelDescriptor
that is an
ALcdASDIModelDescriptor
. The method ALcdASDIModelDescriptor.getDataType()
allows to distinct between the different models.
Following table gives an overview of the different models in the TLcdModelList
,
specifying for each a description, the messages taken into account,
the domain objects in the model and the value returned from
ALcdASDIModelDescriptor.getDataType()
:
Model description | ASDI messages | Domain objects | ALcdASDIModelDescriptor.getDataType() |
---|---|---|---|
TZ tracks | TZ | TLcdASDITrack |
DATA_TYPE_TZ_TRACK |
TO tracks | TO | TLcdASDITrack |
DATA_TYPE_TO_TRACK |
Flight plan data | FZ, AF, DZ, UZ, AZ, RZ and RT | TLcdASDIFlightPlan |
DATA_TYPE_FLIGHT_PLAN |
The domain objects group messages that belong together.
The amount of points kept for the TLcdASDITrajectory
objects associated
with each TLcdASDITrack
can be limited with
the setHistoryLength(int)
.
Users of the live decoder that read the data in the TLcdModelList
,
for instance for displaying it on a map, must be sure the data is consistent when using it.
This requires some synchronization.
Therefore, whenever the decoder adds a sub model to the
given TLcdModelList
, it takes a write lock on the TLcdModelList
(see com.luciad.util.concurrent.TLcdLockUtil
).
Whenever it makes a modification to one of the elements of a sub model, it takes
a write lock on the sub model. Users of the live decoder can and should then take the
appropriate read locks to avoid synchronization problems.
The decoder can also be used to replay recorded ASDI data. The input stream given to the
decodeSFCT
method should be a TLcdASDIFileReplayInputStream
to achieve this.
- See Also:
-
Constructor Summary
ConstructorDescriptionCreates aTLcdASDILiveDecoder
, a decoder for decoding live ASDI data. -
Method Summary
Modifier and TypeMethodDescriptionvoid
decodeSFCT
(InputStream aStream, int aFireEventMode, TLcdModelList aModelSFCT) Modifies an existingTLcdModelList
to contain new ASDI data read from the givenInputStream
.int
Returns the history length.void
setHistoryLength
(int aHistoryLength) Sets the history length to the given length.Methods inherited from class com.luciad.format.asdi.ALcdASDIDecoder
getMessageFilter, getStartTime, setMessageFilter, setStartTime
-
Constructor Details
-
TLcdASDILiveDecoder
public TLcdASDILiveDecoder()Creates aTLcdASDILiveDecoder
, a decoder for decoding live ASDI data.
-
-
Method Details
-
setHistoryLength
public void setHistoryLength(int aHistoryLength) Sets the history length to the given length. This will limit the amount of points kept for theTLcdASDITrajectory
objects associated with eachTLcdASDITrack
to the given length.- Parameters:
aHistoryLength
- The maximum amount of points that are kept in the history, 1 <= aHistoryLength, isInteger.MAX_VALUE
by default meaning all points are kept.
-
getHistoryLength
public int getHistoryLength()Returns the history length. Please refer tosetHistoryLength(int)
for details.- Returns:
- the history length.
-
decodeSFCT
public void decodeSFCT(InputStream aStream, int aFireEventMode, TLcdModelList aModelSFCT) throws IOException Modifies an existingTLcdModelList
to contain new ASDI data read from the givenInputStream
. This method does not return until all data is read. It is therefore advised to call it from a dedicated thread. To stop the decoding process, useThread.interrupt()
.- Parameters:
aStream
- The stream to read an ASDI message from.aFireEventMode
- One ofILcdFireEventMode.FIRE_NOW
,ILcdFireEventMode.FIRE_LATER
orILcdFireEventMode.NO_EVENT
. It allows to specify when and if any model events need to be fired when the model is changed by this decoder. IfFIRE_NOW
is used, changes are immediately propagated, and the user of this method does not need to do anything else. If for exampleFIRE_LATER
is used, the events are collected. It is than up the the user of this method to fire those collected changes once in a while usingILcdModel.fireCollectedModelChanges()
onaModelSFCT
.aModelSFCT
- The model to modify.- Throws:
IOException
- In case of IO failure.
-