Class TLcdDAFIFProcedureDecoder
- All Implemented Interfaces:
ILcdDAFIFDecoder
,ILcdInputStreamFactoryCapable
,ILcdModelDecoder
- Direct Known Subclasses:
TLcdDAFIFIndependentProcedureDecoder
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.
- ILcdRunwayFeature.AERODROME_IDENTIFICATION,
- ILcdRunwayFeature.HIGH_END_IDENTIFIER,
- ILcdRunwayFeature.LOW_END_IDENTIFIER.
- ILcdAerodromeFeature.IDENTIFICATION
- ILcdNavaidFeature.IDENTIFIER
- ILcdNavaidFeature.TYPE
- ILcdNavaidFeature.COUNTRY_CODE
- ILcdNavaidFeature.KEY_CODE
- ILcdLocalizerFeature.AIRPORT_ID
- ILcdLocalizerFeature.RUNWAY_ID
- ILcdLocalizerFeature.COMPONENT_TYPE for the glide path model:
- ILcdGlidePathFeature.AIRPORT_ID
- ILcdGlidePathFeature.RUNWAY_ID
- ILcdGlidePathFeature.COMPONENT_TYPE
- ILcdMarkerFeature.AIRPORT_ID
- ILcdMarkerFeature.RUNWAY_ID
- ILcdMarkerFeature.COMPONENT_TYPE
- ILcdDMEFeature.AIRPORT_ID
- ILcdDMEFeature.RUNWAY_ID
- ILcdDMEFeature.COMPONENT_TYPE
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:
-
Field Summary
Fields inherited from class com.luciad.format.dafif.decoder.ALcdDAFIFDecoder
DAFIF_PROP_EXTENSION, fRecordCount
-
Constructor Summary
ConstructorDescriptionTLcdDAFIFProcedureDecoder
(ALcdAISObjectFactory aDomainFactory) Deprecated.TLcdDAFIFProcedureDecoder
(ALcdAISObjectFactory aDomainFactory, Properties aDAFIFProperties) Deprecated.Creates a newTLcdDAFIFProcedureDecoder
object.TLcdDAFIFProcedureDecoder
(TLcdAISDataObjectFactory aFactory, Properties aDAFIFProperties) Creates a newTLcdDAFIFProcedureDecoder
object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addErrorReport
(String aMessage) Overwrites theaddErrorReport
method of theALcdDAFIFDecoder
class.protected ILcdModelDescriptor
createModelDescriptor
(String aSource) Creates and returns the model descriptor to be set on the model returned in thedecode
method.void
Adds an index on the specified model.void
createRequiredIndices
(TLcdModelList aModelList) Adds an index on the submodels of the specified modelList.Calls the decode method ofALcdDAFIFSingleModelDecoder
.Returns the name of the file to be decoded.Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder
.int
Returns the number of error reports to be added to the error message.protected final void
handleRecord
(int aFormat, char[] aRecord) Deals with one record of input.void
removeRequiredIndices
(TLcdModelList aModelList) Removes the indices created by thecreateRequiredIndices
method.void
setAirportModel
(ILcdFeatureIndexedAnd2DBoundsIndexedModel aAirportModel) Specifies a model of aerodromes.void
setHeliportModel
(ILcdFeatureIndexedAnd2DBoundsIndexedModel aHeliportModel) Specifies a model of heliports.void
setILSModel
(TLcdModelList aILSModelList) Specifies a model of ILS objects.void
setMaxNumberOfErrorReports
(int aMaxNumberOfErrorReports) Specifies a value for the maximum number of error reports.void
setNavaidModel
(TLcdModelList aNavaidsModelList) Specifies a model of navaids.void
setProcedureDefaultDisplayNameIndex
(int aIndex) Specifies the index of the feature to be the procedure display name.void
setProcedureFeaturesToBeDecoded
(String[] aProcedureFeaturesToBeDecoded) Specifies the features that should be decoded into the procedure objects of the model that will be returned by thedecode
method.void
setRunwayModel
(ILcdFeatureIndexedAnd2DBoundsIndexedModel aRunwayModel) Specifies a model of runways.void
setWaypointModel
(ILcdFeatureIndexedAnd2DBoundsIndexedModel aWaypointModel) Specifies a model of waypoints.Methods inherited from class com.luciad.format.dafif.decoder.ALcdDAFIFSingleModelDecoder
cleanUp, setKeyFeatureNames
Methods inherited from class com.luciad.format.dafif.decoder.ALcdDAFIFDecoder
canDecodeSource, getAltitudeType, getBearingTypeForChar, getBounds, getDAFIFProperties, getDataObjectFactory, getDecodingBounds, getDomainFactory, getErrorMessage, getInputStream, getInputStreamFactory, getLocalHorizontalDatum, getModelFilter, getRecordCount, initializeErrorMessage, isStoreOriginalReference, isTraceOn, loadCFGProperties, read, readExactValue, readFormat, readMinLength, readRecord, setBounds, setDAFIFModelFilter, setDAFIFProperties, setDataObjectFactory, setDecodingBounds, setDomainFactory, setInputStreamFactory, setStoreOriginalReference, setTraceOn, transformPointToReferenceDatumSFCT
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.model.ILcdModelDecoder
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
-
Constructor Details
-
TLcdDAFIFProcedureDecoder
Deprecated.Creates a newTLcdDAFIFProcedureDecoder
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
Creates a newTLcdDAFIFProcedureDecoder
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 newTLcdDAFIFProcedureDecoder
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 objectsaDAFIFProperties
- aProperties
object that contains for each domain object the appropriate file name
-
TLcdDAFIFProcedureDecoder
Creates a newTLcdDAFIFProcedureDecoder
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 objectsaDAFIFProperties
- aProperties
object that contains for each domain object the appropriate file name
-
-
Method Details
-
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
Description copied from interface:ILcdModelDecoder
Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder
.- Specified by:
getDisplayName
in interfaceILcdModelDecoder
- Overrides:
getDisplayName
in classALcdDAFIFDecoder
- Returns:
- the displayable name of this
ILcdModelDecoder
.
-
addErrorReport
Overwrites theaddErrorReport
method of theALcdDAFIFDecoder
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 classALcdDAFIFDecoder
- Parameters:
aMessage
- the report about an error occurred during the decode process
-
createModelDescriptor
Description copied from class:ALcdDAFIFSingleModelDecoder
Creates and returns the model descriptor to be set on the model returned in thedecode
method.- Specified by:
createModelDescriptor
in classALcdDAFIFSingleModelDecoder
- 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
Calls the decode method ofALcdDAFIFSingleModelDecoder
. 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, anIllegalStateException
will be thrown.- Specified by:
decode
in interfaceILcdModelDecoder
- Overrides:
decode
in classALcdDAFIFSingleModelDecoder
- 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 processIllegalStateException
- 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 classALcdDAFIFSingleModelDecoder
- Parameters:
aFormat
- the format of the recordaRecord
- 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
Specifies the features that should be decoded into the procedure objects of the model that will be returned by thedecode
method.Please make sure that the
DESIGNATOR
,AERODROME_IDENTIFIER
andTYPE
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
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
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
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:
-
setILSModel
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
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
Adds an index on the submodels of the specified modelList. This method should be called before you call thesetILSModel
method or thesetNavaidModel
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
- ILcdLocalizerFeature.AIRPORT_ID
- ILcdLocalizerFeature.RUNWAY_ID
- ILcdLocalizerFeature.COMPONENT_TYPE Glidepath model:
- ILcdGlidePathFeature.AIRPORT_ID
- ILcdGlidePathFeature.RUNWAY_ID
- ILcdGlidePathFeature.COMPONENT_TYPE
- ILcdMarkerFeature.AIRPORT_ID
- ILcdMarkerFeature.RUNWAY_ID
- ILcdMarkerFeature.COMPONENT_TYPE
- ILcdDMEFeature.AIRPORT_ID
- ILcdDMEFeature.RUNWAY_ID
- ILcdDMEFeature.COMPONENT_TYPE
- Parameters:
aModelList
- a modelList either with ILS objects or navaids- See Also:
-
createRequiredIndices
Adds an index on the specified model. This method should be called before calling thesetWaypointModel
, thesetRunwayModel
, thesetAirportModel
or thesetHeliportModel
method.Please make sure that the following features were decoded into the model objects of the
Waypoint model:- ILcdWayPointFeature.IDENTIFIER,
- ILcdWayPointFeature.COUNTRY_CODE.
- ILcdRunwayFeature.AERODROME_IDENTIFICATION,
- ILcdRunwayFeature.HIGH_END_IDENTIFIER,
- ILcdRunwayFeature.LOW_END_IDENTIFIER.
- ILcdAerodromeFeature.IDENTIFICATION
- Parameters:
aModel
- a model containing the waypoints, aerodromes, runways or heliports- See Also:
-
removeRequiredIndices
Removes the indices created by thecreateRequiredIndices
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
-