Class TLcdASDIModelDecoder

java.lang.Object
com.luciad.format.asdi.ALcdASDIDecoder
com.luciad.format.asdi.TLcdASDIModelDecoder
All Implemented Interfaces:
ILcdInputStreamFactoryCapable, ILcdModelDecoder

This decoder reads data from an ASDI feed and returns the information in a TLcdModelList, allowing for easy manipulation of that data, such as replaying, analysis, etc.

An ASDI file can contain a <set time > MM/dd/yyyy HH:mm:ss command at the first line. If this is the case the corresponding date is used as the start time for the decoder, the start time set by ALcdASDIDecoder.setStartTime(long) is ignored then.

Input files

File Required Entry point Description
*.asdi x x ASDI file containing an ASDI formatted data

Supported file transfer protocols

  • This model decoder supports all transfer protocols that are supported by the ILcdInputStreamFactory of this decoder.

Model structure

  • This model decoder returns a model list with a model for each data type in the input.
  • The model list contains different ILcdModel objects, depending on the type of messages in the ASDI feed.
  • All models returned by this model decoder implement ILcd2DBoundsIndexedModel.

Model descriptor

  • All ILcdModel objects have an ILcdModelDescriptor that is an ALcdASDIModelDescriptor. The method ALcdASDIModelDescriptor.getDataType() allows to distinguish between the different models.

Model reference

Model elements

All domain objects decoded with this decoder implement the ILcdDataObject interface. This interface allows you to retrieve information on each of the domain models of ASDI in a uniform way. The data models and types can be obtained from either the domain objects or from the TLcdASDIDataTypes class. 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 TLcdASDITrajectory DATA_TYPE_TZ_TRACK
TO tracks TO TLcdASDITrajectory DATA_TYPE_TO_TRACK
Flight plan data FZ, AF, DZ, UZ, AZ, RZ and RT TLcdASDIFlightPlanHistory DATA_TYPE_FLIGHT_PLAN

The domain objects group messages that belong together.

Sample code


 ILcdModelDecoder decoder = new TLcdASDIModelDecoder();
 ILcdModel model = decoder.decode( "asdi_data.asdi" );
 

Performance tips

Thread safety

  • The decoding of models is thread-safe, as long as no properties are changed during the decoding.
  • The decoded models are thread-safe for read access.

Supported versions

  • This decoder supports version 5.4 of the ASDI standard.
  • Constructor Details

    • TLcdASDIModelDecoder

      public TLcdASDIModelDecoder()
      Creates a TLcdASDIModelDecoder, a model decoder for decoding ASDI data.
  • Method Details

    • setInputStreamFactory

      public void setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
      Sets the input stream factory that will be used for creating input streams given source names.
      Specified by:
      setInputStreamFactory in interface ILcdInputStreamFactoryCapable
      Parameters:
      aInputStreamFactory - the input stream factory to be used.
    • getInputStreamFactory

      public ILcdInputStreamFactory getInputStreamFactory()
      Returns the input stream factory that is currently used for creating input streams given source names.
      Specified by:
      getInputStreamFactory in interface ILcdInputStreamFactoryCapable
      Returns:
      the input stream factory that is currently used.
    • getDisplayName

      public String getDisplayName()
      Description copied from interface: ILcdModelDecoder
      Returns a short, displayable name for the format that is decoded by this ILcdModelDecoder.
      Specified by:
      getDisplayName in interface ILcdModelDecoder
      Returns:
      the displayable name of this ILcdModelDecoder.
    • canDecodeSource

      public boolean canDecodeSource(String aSourceName)
      Description copied from interface: ILcdModelDecoder
      Checks whether this model decoder can decode the specified data source. It is acceptable for this method to return true for a source name while decode throws an exception for that same source name.

      For performance reasons, we strongly recommend that this will only be a simple test. For example: check the file extension of a file, but not that the file exists or contains expected content.

      Specified by:
      canDecodeSource in interface ILcdModelDecoder
      Parameters:
      aSourceName - the data source to be verified; typically a file name or a URL.
      Returns:
      true if this decoder can likely decode the data specified by the source name, false otherwise.
      See Also:
    • decode

      public ILcdModel decode(String aSourceName) throws IOException
      Description copied from interface: ILcdModelDecoder
      Creates a new model from the given data source.
      Specified by:
      decode in interface ILcdModelDecoder
      Parameters:
      aSourceName - the data source to be decoded; typically a file name or a URL.
      Returns:
      A model containing the decoded data. While null is allowed, implementors are advised to throw an error instead.
      Throws:
      IOException - for any exceptions caused by IO problems or invalid data. Since decoding invalid data almost always results in RunTimeExceptions (NullPointerException, IndexOutOfBoundsException, IllegalArgumentException, ...) on unexpected places, implementations are advised to catch RuntimeExceptions in their decode() method, and wrap them into an IOException, as illustrated in the code snippet below.
      
         public ILcdModel decode( String aSourceName ) throws IOException {
            try (InputStream input = fInputStreamFactory.createInputStream(aSourceName)) {
               // Perform decoding ...
            } catch (RuntimeException e) {
               throw new IOException(e);
            }
         }
       
      See Also: