Class TLcdDAFIFTProcedureDecoder

java.lang.Object
com.luciad.format.dafift.decoder.ALcdDAFIFTModelDecoder
com.luciad.format.dafift.decoder.TLcdDAFIFTProcedureDecoder
All Implemented Interfaces:
ILcdInputStreamFactoryCapable, ILcdModelDecoder
Direct Known Subclasses:
TLcdDAFIFTIndependentProcedureDecoder

public class TLcdDAFIFTProcedureDecoder extends ALcdDAFIFTModelDecoder
Implementation of ILcdModelDecoder that decodes DAFIFT procedure objects from the specified source directory. The decoded models have as model descriptor an instance of TLcdDAFIFProcedureTrajectoryModelDescriptor.

The objects in decoded models are based on the AIS domain objects available in com.luciad.ais.model, which all implement ILcdDataObject. This interface provides a generic and format-independent way of accessing the type and properties (features) of a domain object.

For this decoder, the type of the decoded objects is TLcdDAFIFTDataTypes.Procedure, which can also be retrieved through ILcdDataObject.getDataType(). The available properties of the objects are defined in TLcdDAFIFTProcedureDataProperties. The values for these properties can be retrieved through ILcdDataObject.getValue(com.luciad.datamodel.TLcdDataProperty).

Next to ILcdDataObject, the objects in decoded models also implement ILcdFeatured, the former interface to access the properties (features) of a domain object. This is still fully supported, and explained in the following comments.

The setProcedureFeaturesToBeDecoded method allows the user to specify which DAFIFT features are to be decoded into the featured model objects. If no features are specified, all features will be decoded.

The following fields (which are taken from the National Imagery and Mapping Agency (NIMA) Product Specifications for Digital Aeronautical Flight Information File (DAFIF), Eight Edition, January 2005) are supported by the decoder. The list indicates into which feature the fields are decoded. For the procedure objects:

All DAFIFT decoders rely on a specific set of key features that uniquely define an object. This set of features must always be included in the set of features to be decoded. For procedures, the key features are:

  • ILcdDAFIFProcedureFeature.AERODROME_IDENTIFIER
  • ILcdDAFIFProcedureFeature.TYPE
  • ILcdDAFIFProcedureFeature.DESIGNATOR

Procedures are based on a fix, which may be a navaid, a waypoint, a runway, an airport, a heliport or an ILS component. The TLcdDAFIFTProcedureDecoder class does not decode the model objects necessary to construct the procedures. The models should be specified using the appropriate setModel methods.

To identify the model objects uniquely within the waypoint model, a unique index on the key features is added in the setModel methods. The used key features are:

  • for the waypoint model:
    • ILcdWayPointFeature.IDENTIFIER,
    • ILcdWayPointFeature.COUNTRY_CODE.

  • for the runway model:
    • ILcdRunwayFeature.AERODROME_IDENTIFICATION,
    • ILcdRunwayFeature.HIGH_END_IDENTIFIER,
    • ILcdRunwayFeature.LOW_END_IDENTIFIER.

  • for the airport and heliport model:
    • ILcdAerodromeFeature.IDENTIFICATION

  • for the navaid models:
    • ILcdNavaidFeature.IDENTIFIER
    • ILcdNavaidFeature.TYPE
    • ILcdNavaidFeature.COUNTRY_CODE
    • ILcdNavaidFeature.KEY_CODE

  • for the localizer model:
    • ILcdLocalizerFeature.AIRPORT_ID
    • ILcdLocalizerFeature.RUNWAY_ID
    • ILcdLocalizerFeature.COMPONENT_TYPE

    • for the glidepath model:
      • ILcdGlidePathFeature.AIRPORT_ID
      • ILcdGlidePathFeature.RUNWAY_ID
      • ILcdGlidePathFeature.COMPONENT_TYPE

    • for the marker model:
      • ILcdMarkerFeature.AIRPORT_ID
      • ILcdMarkerFeature.RUNWAY_ID
      • ILcdMarkerFeature.COMPONENT_TYPE

    • for the ILS-DME model:
      • ILcdDMEFeature.AIRPORT_ID
      • ILcdDMEFeature.RUNWAY_ID
      • ILcdDMEFeature.COMPONENT_TYPE
Since:
7.2
See Also:
  • Constructor Details

    • TLcdDAFIFTProcedureDecoder

      @Deprecated public TLcdDAFIFTProcedureDecoder(ALcdAISObjectFactory aDomainFactory)
      Deprecated.
      Constructs a new TLcdDAFIFTProcedureDecoder object. The user should specify which aDomainFactory he or she wants to use to create the procedures.
      Parameters:
      aDomainFactory - The factory to be used to create the model objects.
    • TLcdDAFIFTProcedureDecoder

      public TLcdDAFIFTProcedureDecoder(TLcdAISDataObjectFactory aDataFactory)
      Constructs a new TLcdDAFIFTProcedureDecoder object. The user should specify which factory he or she wants to use to create the procedures.
      Parameters:
      aDataFactory - The factory to be used to create the model objects.
  • Method Details

    • 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
      Overrides:
      getDisplayName in class ALcdDAFIFTModelDecoder
      Returns:
      the displayable name of this ILcdModelDecoder.
    • decode

      public ILcdModel decode(String aSource) throws IOException
      Checks whether a airport model is set before starting the decode process. If no airport model is specified, an IllegalStateException object will be thrown.

      Returns a model containing the domain objects read from the given source file.

      The model will be build by looping through the records found in the source file. Each record that passes the record filter (getRecordFilter()) will be decoded. A decoded record needs to pass two additional filters (a model filter getModelFilter() and a bounds filter getDecodingBounds()) before it can be added to the model.

      Furthermore, an error message will be initialized and filled with reports about errors occurred during the decode process. By default, all reports will be added into the error message. The method setMaxNumberOfErrorReports(int) can be used to adjust this setting.

      Specified by:
      decode in interface ILcdModelDecoder
      Parameters:
      aSource - Either the directory containing the DAFIFT source file to decode or the DAFIFT source file itself.
      Returns:
      the model build by reading the file found with the given source.
      Throws:
      IOException - if an error occurs during the reading process.
      IllegalStateException - if no airport model has been specified.
      See Also:
    • setProcedureDefaultDisplayNameIndex

      public void setProcedureDefaultDisplayNameIndex(int aIndex)
      Specifies the index of the feature to be the procedure display name.
      Parameters:
      aIndex - The index of the feature to be the procedure display name.
    • setProcedureFeaturesToBeDecoded

      public void setProcedureFeaturesToBeDecoded(String[] aFeaturesToBeDecoded)
      Specifies the procedure features to be decoded into the model objects.

      Please make sure that the DESIGNATOR, AERODROME_IDENTIFIER and TYPE features are in your list of features to be decoded!

      Parameters:
      aFeaturesToBeDecoded - A list of features that should be decoded into the procedure model objects.
    • setAirportModel

      public void setAirportModel(ILcdFeatureIndexedModel aAirportModel)
      Specifies the model containing the aerodrome objects this decoder should use.
      Parameters:
      aAirportModel - A model containing aerodrome objects.
    • setHeliportModel

      public void setHeliportModel(ILcdFeatureIndexedModel aHeliportModel)
      Specifies the model containing the heliport objects this decoder should use.
      Parameters:
      aHeliportModel - A model containing heliport objects.
    • setWaypointModel

      public void setWaypointModel(ILcdFeatureIndexedModel aWaypointModel)
      Specifies the model containing the waypoint objects this decoder should use.
      Parameters:
      aWaypointModel - A model containing waypoint objects.
    • setRunwayModel

      public void setRunwayModel(ILcdFeatureIndexedModel aRunwayModel)
      Specifies the model containing the runway objects this decoder should use.
      Parameters:
      aRunwayModel - A model containing runway objects.
    • setNavaidModel

      public void setNavaidModel(TLcdModelList aNavaidModel)
      Specifies the model list containing the navaid objects this decoder should use.
      Parameters:
      aNavaidModel - A model list containing navaid objects.
    • setILSModel

      public void setILSModel(TLcdModelList aILSModel)
      Specifies the model list containing the ILS objects this decoder should use.
      Parameters:
      aILSModel - A model list containing ILS objects.
    • getUniqueKeyFeatureNames

      public String[] getUniqueKeyFeatureNames()
      Returns the array of String objects containing the names of the features that will be used as a unique key to insert objects into the model.
      Returns:
      the array of String objects containing the names of the features that will be used as a unique key to insert objects into the model.
    • canDecodeSource

      public boolean canDecodeSource(String aSource)
      Returns true if the specified source is:
      • A file with the specific name corresponding to the object type of this decoder
      • A directory containing such a file
      • A .toc file in a directory, pointing to such a file
      Parameters:
      aSource - the name of the source file or directory that you want to decode
      Returns:
      a boolean indicating whether the given source can be decoded
    • getDomainFactory

      @Deprecated public ALcdAISObjectFactory getDomainFactory()
      Deprecated.
      Returns the factory that is used to create domain objects.
      Returns:
      the factory that is used to create domain objects.
      See Also:
    • setDomainFactory

      @Deprecated public void setDomainFactory(ALcdAISObjectFactory aDomainFactory)
      Specifies the domain factory.

      The domain factory will be used to create the domain objects decoded by this DAFIFT decoder.

      Parameters:
      aDomainFactory - The factory that will be used to create domain objects.
      See Also:
    • getDataObjectFactory

      public TLcdAISDataObjectFactory getDataObjectFactory()
      Returns the factory that is used to create domain objects.
      Returns:
      the factory that is used to create domain objects.
      See Also:
    • setDataObjectFactory

      public void setDataObjectFactory(TLcdAISDataObjectFactory aFactory)
      Specifies the data factory.

      The data factory will be used to create the domain objects decoded by this DAFIFT decoder.

      Decoders equipped with a data object factory that is not null, will NOT use their associated domain factory (see getDomainFactory()).

      Parameters:
      aFactory - The factory that will be used to create domain objects.
      See Also:
    • getInputStreamFactory

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

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

      public ILcdDAFIFTRecordFilter getRecordFilter()
      Returns the record filter that is currently used.
      Returns:
      the record filter that is currently used.
      See Also:
    • setRecordFilter

      public void setRecordFilter(ILcdDAFIFTRecordFilter aRecordFilter)
      Specifies a filter to be used while creating the model. Only records that pass through this filter will be decoded into model objects.
      Parameters:
      aRecordFilter - The record filter that should be passed before a record can be decoded.
      See Also:
    • getMaxNumberOfErrorReports

      public int getMaxNumberOfErrorReports()
      Returns the number of error reports to be added to the error message. If there are more errors than the maxNumberOfErrorReports property, they won't be stored and you won't be able to see these errors in the error message after the decoding process.
      Returns:
      the number of error reports to be added to the error message.
      See Also:
    • setMaxNumberOfErrorReports

      public void setMaxNumberOfErrorReports(int aMaxNumberOfErrorReports)
      Specifies a value for the maximum number of error reports. If a negative value is set, all reported errors will be added to the error message.
      Parameters:
      aMaxNumberOfErrorReports - The maximum number of error reports to be added to the error message.
      See Also:
    • getErrorMessage

      public String getErrorMessage()
      Returns the error message of the last decode call.

      Note that the error message can only be retrieved once after a decode call.

      Returns:
      a String object containing the errors occurred during the last decode process.