Class TLcdDAFIFProcedureDecoder

All Implemented Interfaces:
ILcdDAFIFDecoder, ILcdInputStreamFactoryCapable, ILcdModelDecoder
Direct Known Subclasses:
TLcdDAFIFIndependentProcedureDecoder

public class TLcdDAFIFProcedureDecoder extends ALcdDAFIFSingleModelDecoder
This extension of the ALcdDAFIFSingleModelDecoder decodes procedures from a DAFIF source file. 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 TLcdDAFIFDataTypes.Procedure, which can also be retrieved through ILcdDataObject.getDataType(). The available properties of the objects are defined in TLcdDAFIFProcedureDataProperties. 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 DAFIF features are decoded into the featured model objects.

If no features to be decoded are specified, all features will be decoded.

The following fields (taken from the National Imagery and Mapping Agency (NIMA) Product Specifications for Digital Aeronautical Flight Information File (DAFIF), Seventh Edition, May 2001) are supported by the decoder. The list indicates into which feature the fields are decoded.

  • AIRPORT OR HELIPORT IDENTIFICATION: ILcdDAFIFProcedureFeature.AERODROME_IDENTIFIER
  • PROCEDURE: ILcdDAFIFProcedureFeature.TYPE
  • IDENTIFIER: ILcdProcedureFeature.DESIGNATOR

DAFIF 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:

  • AIRPORT OR HELIPORT IDENTIFICATION: ILcdDAFIFProcedureFeature.AERODROME_IDENTIFIER
  • PROCEDURE: ILcdDAFIFProcedureFeature.TYPE
  • IDENTIFIER: ILcdProcedureFeature.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 TLcdDAFIFProcedureDecoder class does not decode the model objects necessary to construct the procedures. The models should be specified using the setAirportModel method, the setHeliportModel method, the setWaypointModel method, the setNavaidModel method, the setILSModel method and the setRunwayModel method.

To identify the model objects uniquely within their model, a unique index on some key feature should be added. These 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 glide path 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
    The createRequiredIndices methods can be used to add indices on key features.

    NOTE: The createRequiredIndices methods should be called before setting the models (and the latter should be done before calling the decode method of course).

See Also:
  • Constructor Details

    • TLcdDAFIFProcedureDecoder

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

      public TLcdDAFIFProcedureDecoder(TLcdAISDataObjectFactory aFactory)
      Creates a new TLcdDAFIFProcedureDecoder object. The user should specify which factory he or she wants to use to create the procedures.
      Parameters:
      aFactory - the factory to be used to create the model objects
    • TLcdDAFIFProcedureDecoder

      @Deprecated public TLcdDAFIFProcedureDecoder(ALcdAISObjectFactory aDomainFactory, Properties aDAFIFProperties)
      Deprecated.
      Creates a new TLcdDAFIFProcedureDecoder object. The user should specify which domainFactory he or she wants to use to create the procedures.
      Parameters:
      aDomainFactory - the factory to be used to create the model objects
      aDAFIFProperties - a Properties object that contains for each domain object the appropriate file name
    • TLcdDAFIFProcedureDecoder

      public TLcdDAFIFProcedureDecoder(TLcdAISDataObjectFactory aFactory, Properties aDAFIFProperties)
      Creates a new TLcdDAFIFProcedureDecoder object. The user should specify which factory he or she wants to use to create the procedures.
      Parameters:
      aFactory - the factory to be used to create the model objects
      aDAFIFProperties - a Properties object that contains for each domain object the appropriate file name
  • Method Details

    • getDecodeFileName

      public String getDecodeFileName()
      Description copied from interface: ILcdDAFIFDecoder
      Returns the name of the file to be decoded.

      Each domain object has its own file name. This method returns the name of the data file for the domain objects decoded by this DAFIF decoder.

      Returns:
      the name of the source file
    • 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 ALcdDAFIFDecoder
      Returns:
      the displayable name of this ILcdModelDecoder.
    • addErrorReport

      public void addErrorReport(String aMessage)
      Overwrites the addErrorReport method of the ALcdDAFIFDecoder class. This version checks whether the number of error messages does not exceed the maximum number of error messages yet. If not, the message is added and the number of error messages is increased. If the maximum number of error messages is reached, the message won't be append.
      Overrides:
      addErrorReport in class ALcdDAFIFDecoder
      Parameters:
      aMessage - the report about an error occurred during the decode process
    • createModelDescriptor

      protected ILcdModelDescriptor createModelDescriptor(String aSource)
      Description copied from class: ALcdDAFIFSingleModelDecoder
      Creates and returns the model descriptor to be set on the model returned in the decode method.
      Specified by:
      createModelDescriptor in class ALcdDAFIFSingleModelDecoder
      Parameters:
      aSource - the source that will be used to decode
      Returns:
      a model descriptor describing the data in the model created in the decode method
    • decode

      public ILcdModel decode(String aSource) throws IOException
      Calls the decode method of ALcdDAFIFSingleModelDecoder. Checks whether the aerodrome model, the runway model, the ILS model, the navaid model and the waypoint model have been set before starting the decode process. If one of these models hasn't been specified, an IllegalStateException will be thrown.
      Specified by:
      decode in interface ILcdModelDecoder
      Overrides:
      decode in class ALcdDAFIFSingleModelDecoder
      Parameters:
      aSource - either the directory containing the Dafif source file to decode (if you did not specify a properties file in the constructor, the default file name will be used) or a .toc file containing the Dafif properties (the data file should be in the same directory as the .toc file)
      Returns:
      the model build by reading the file found with aSource
      Throws:
      IOException - if an error occurs during the reading process
      IllegalStateException - if the aerodrome model, the runway model, the ILS model, the navaid model or the waypoint model has not been specified
      See Also:
    • handleRecord

      protected final void handleRecord(int aFormat, char[] aRecord)
      Description copied from class: ALcdDAFIFSingleModelDecoder
      Deals with one record of input.
      Specified by:
      handleRecord in class ALcdDAFIFSingleModelDecoder
      Parameters:
      aFormat - the format of the record
      aRecord - the record
    • 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 used as display name
    • setProcedureFeaturesToBeDecoded

      public void setProcedureFeaturesToBeDecoded(String[] aProcedureFeaturesToBeDecoded)
      Specifies the features that should be decoded into the procedure objects of the model that will be returned by the decode method.

      Please make sure that the DESIGNATOR, AERODROME_IDENTIFIER and TYPE features are in your list.

      Parameters:
      aProcedureFeaturesToBeDecoded - a list of features that should be decoded into the procedure objects
    • 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, 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 stored
      See Also:
    • setMaxNumberOfErrorReports

      public void setMaxNumberOfErrorReports(int aMaxNumberOfErrorReports)
      Specifies a value for the maximum number of error reports.
      Parameters:
      aMaxNumberOfErrorReports - the maximum number of error reports to be added to the error message
      See Also:
    • setAirportModel

      public void setAirportModel(ILcdFeatureIndexedAnd2DBoundsIndexedModel aAirportModel)
      Specifies a model of aerodromes. Please make sure there is a unique index on ILcdAerodromeFeature.IDENTIFICATION!
      Parameters:
      aAirportModel - the aerodrome model to be used to create the procedures
      See Also:
    • setHeliportModel

      public void setHeliportModel(ILcdFeatureIndexedAnd2DBoundsIndexedModel aHeliportModel)
      Specifies a model of heliports. Please make sure there is a unique index on ILcdAerodromeFeature.IDENTIFICATION!
      Parameters:
      aHeliportModel - the heliport model to be used to create the procedures
      See Also:
    • setWaypointModel

      public void setWaypointModel(ILcdFeatureIndexedAnd2DBoundsIndexedModel aWaypointModel)
      Specifies a model of waypoints. Please make sure there is a unique index on ILcdWayPointFeature.IDENTIFIER and ILcdWayPointFeature.COUNTRY_CODE!
      Parameters:
      aWaypointModel - the waypoint model to be used to create the procedures
      See Also:
    • setNavaidModel

      public void setNavaidModel(TLcdModelList aNavaidsModelList)
      Specifies a model of navaids. Please make sure there is a unique index on ILcdNavaidFeature.IDENTIFIER, ILcdNavaidFeature.TYPE, ILcdNavaidFeature.COUNTRY_CODE and ILcdNavaidFeature.KEY_CODE!
      Parameters:
      aNavaidsModelList - the navaid modelList to be used to create the procedures
      See Also:
    • setILSModel

      public void setILSModel(TLcdModelList aILSModelList)
      Specifies a model of ILS objects. Please make sure there is a unique index on AIRPORT_ID, RUNWAY_ID and COMPONENT_TYPE!
      Parameters:
      aILSModelList - the ILS modelList to be used to create the procedures
      See Also:
    • setRunwayModel

      public void setRunwayModel(ILcdFeatureIndexedAnd2DBoundsIndexedModel aRunwayModel)
      Specifies a model of runways. Please make sure there is an index on ILcdRunwayFeature.AERODROME_IDENTIFICATION and ILcdRunwayFeature.HIGH_END_IDENTIFIER and another index on ILcdRunwayFeature.AERODROME_IDENTIFICATION and ILcdRunwayFeature.LOW_END_IDENTIFIER.

      As a side effect, the index of the runway direction identifier will be initialized.

      Parameters:
      aRunwayModel - the runway model to be used to create the procedures
      See Also:
    • createRequiredIndices

      public void createRequiredIndices(TLcdModelList aModelList)
      Adds an index on the submodels of the specified modelList. This method should be called before you call the setILSModel method or the setNavaidModel method.

      Please make sure that the following features were decoded into the model objects of the
      Navaid submodels:

      • ILcdNavaidFeature.IDENTIFIER
      • ILcdNavaidFeature.TYPE
      • ILcdNavaidFeature.COUNTRY_CODE
      • ILcdNavaidFeature.KEY_CODE
      Localizer model:
      • ILcdLocalizerFeature.AIRPORT_ID
      • ILcdLocalizerFeature.RUNWAY_ID
      • ILcdLocalizerFeature.COMPONENT_TYPE
      • Glidepath model:
        • ILcdGlidePathFeature.AIRPORT_ID
        • ILcdGlidePathFeature.RUNWAY_ID
        • ILcdGlidePathFeature.COMPONENT_TYPE
        Marker model:
        • ILcdMarkerFeature.AIRPORT_ID
        • ILcdMarkerFeature.RUNWAY_ID
        • ILcdMarkerFeature.COMPONENT_TYPE
        ILS-DME model:
        • ILcdDMEFeature.AIRPORT_ID
        • ILcdDMEFeature.RUNWAY_ID
        • ILcdDMEFeature.COMPONENT_TYPE
        If the features mentioned above weren't decoded into the submodels of the specified modelList, this method will cause exceptions to be thrown!
      Parameters:
      aModelList - a modelList either with ILS objects or navaids
      See Also:
    • createRequiredIndices

      public void createRequiredIndices(ILcdFeatureIndexedAnd2DBoundsIndexedModel aModel)
      Adds an index on the specified model. This method should be called before calling the setWaypointModel, the setRunwayModel, the setAirportModel or the setHeliportModel method.

      Please make sure that the following features were decoded into the model objects of the
      Waypoint model:

      • ILcdWayPointFeature.IDENTIFIER,
      • ILcdWayPointFeature.COUNTRY_CODE.
      Runway model:
      • ILcdRunwayFeature.AERODROME_IDENTIFICATION,
      • ILcdRunwayFeature.HIGH_END_IDENTIFIER,
      • ILcdRunwayFeature.LOW_END_IDENTIFIER.
      Airport and heliport model:
      • ILcdAerodromeFeature.IDENTIFICATION
      If the features mentioned above weren't decoded into the specified model, this method will cause exceptions to be thrown!
      Parameters:
      aModel - a model containing the waypoints, aerodromes, runways or heliports
      See Also:
    • removeRequiredIndices

      public void removeRequiredIndices(TLcdModelList aModelList)
      Removes the indices created by the createRequiredIndices method.

      Be careful when using this method: it might remove an index that is still used by another decoder!

      Parameters:
      aModelList - a modelList either with ILS objects or navaids