public class TLcdDAFIFProcedureDecoder extends ALcdDAFIFSingleModelDecoder
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.
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:
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:
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).
DAFIF_PROP_EXTENSION, fRecordCount
Constructor and Description |
---|
TLcdDAFIFProcedureDecoder(ALcdAISObjectFactory aDomainFactory)
Deprecated.
|
TLcdDAFIFProcedureDecoder(ALcdAISObjectFactory aDomainFactory,
Properties aDAFIFProperties)
Deprecated.
|
TLcdDAFIFProcedureDecoder(TLcdAISDataObjectFactory aFactory)
Creates a new
TLcdDAFIFProcedureDecoder object. |
TLcdDAFIFProcedureDecoder(TLcdAISDataObjectFactory aFactory,
Properties aDAFIFProperties)
Creates a new
TLcdDAFIFProcedureDecoder object. |
Modifier and Type | Method and Description |
---|---|
void |
addErrorReport(String aMessage)
Overwrites the
addErrorReport method of the
ALcdDAFIFDecoder class. |
protected ILcdModelDescriptor |
createModelDescriptor(String aSource)
Creates and returns the model descriptor to be set on the model returned in the
decode method. |
void |
createRequiredIndices(ILcdFeatureIndexedAnd2DBoundsIndexedModel aModel)
Adds an index on the specified model.
|
void |
createRequiredIndices(TLcdModelList aModelList)
Adds an index on the submodels of the specified modelList.
|
ILcdModel |
decode(String aSource)
Calls the decode method of
ALcdDAFIFSingleModelDecoder . |
String |
getDecodeFileName()
Returns the name of the file to be decoded.
|
String |
getDisplayName()
Returns a short, displayable name for the format that is decoded by this
ILcdModelDecoder . |
int |
getMaxNumberOfErrorReports()
Returns the number of error reports to be added to the error message.
|
protected void |
handleRecord(int aFormat,
char[] aRecord)
Deals with one record of input.
|
void |
removeRequiredIndices(TLcdModelList aModelList)
Removes the indices created by the
createRequiredIndices 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 the
decode method. |
void |
setRunwayModel(ILcdFeatureIndexedAnd2DBoundsIndexedModel aRunwayModel)
Specifies a model of runways.
|
void |
setWaypointModel(ILcdFeatureIndexedAnd2DBoundsIndexedModel aWaypointModel)
Specifies a model of waypoints.
|
cleanUp, setKeyFeatureNames
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
@Deprecated public TLcdDAFIFProcedureDecoder(ALcdAISObjectFactory aDomainFactory)
TLcdDAFIFProcedureDecoder
object. The user
should specify which domainFactory he or she wants to use to create the procedures.aDomainFactory
- the factory to be used to create the model objectspublic TLcdDAFIFProcedureDecoder(TLcdAISDataObjectFactory aFactory)
TLcdDAFIFProcedureDecoder
object. The user
should specify which factory he or she wants to use to create the procedures.aFactory
- the factory to be used to create the model objects@Deprecated public TLcdDAFIFProcedureDecoder(ALcdAISObjectFactory aDomainFactory, Properties aDAFIFProperties)
TLcdDAFIFProcedureDecoder
object. The user
should specify which domainFactory he or she wants to use to create the procedures.aDomainFactory
- the factory to be used to create the model objectsaDAFIFProperties
- a Properties
object that contains for each domain object
the appropriate file namepublic TLcdDAFIFProcedureDecoder(TLcdAISDataObjectFactory aFactory, Properties aDAFIFProperties)
TLcdDAFIFProcedureDecoder
object. The user
should specify which factory he or she wants to use to create the procedures.aFactory
- the factory to be used to create the model objectsaDAFIFProperties
- a Properties
object that contains for each domain object
the appropriate file namepublic String getDecodeFileName()
ILcdDAFIFDecoder
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.
public String getDisplayName()
ILcdModelDecoder
ILcdModelDecoder
.getDisplayName
in interface ILcdModelDecoder
getDisplayName
in class ALcdDAFIFDecoder
ILcdModelDecoder
.public void addErrorReport(String aMessage)
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.addErrorReport
in class ALcdDAFIFDecoder
aMessage
- the report about an error occurred during the decode processprotected ILcdModelDescriptor createModelDescriptor(String aSource)
ALcdDAFIFSingleModelDecoder
decode
method.createModelDescriptor
in class ALcdDAFIFSingleModelDecoder
aSource
- the source that will be used to decodepublic ILcdModel decode(String aSource) throws IOException
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.decode
in interface ILcdModelDecoder
decode
in class ALcdDAFIFSingleModelDecoder
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)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 specifiedILcdModelDecoder.canDecodeSource(String)
protected final void handleRecord(int aFormat, char[] aRecord)
ALcdDAFIFSingleModelDecoder
handleRecord
in class ALcdDAFIFSingleModelDecoder
aFormat
- the format of the recordaRecord
- the recordpublic void setProcedureDefaultDisplayNameIndex(int aIndex)
aIndex
- the index of the feature to be used as display namepublic void setProcedureFeaturesToBeDecoded(String[] aProcedureFeaturesToBeDecoded)
decode
method.
Please make sure that the DESIGNATOR
, AERODROME_IDENTIFIER
and TYPE
features are in your list.
aProcedureFeaturesToBeDecoded
- a list of features that should be decoded into the procedure objectspublic int getMaxNumberOfErrorReports()
setMaxNumberOfErrorReports(int)
public void setMaxNumberOfErrorReports(int aMaxNumberOfErrorReports)
aMaxNumberOfErrorReports
- the maximum number of error reports to be added to the error messagegetMaxNumberOfErrorReports()
public void setAirportModel(ILcdFeatureIndexedAnd2DBoundsIndexedModel aAirportModel)
aAirportModel
- the aerodrome model to be used to create the procedurescreateRequiredIndices(com.luciad.model.TLcdModelList)
public void setHeliportModel(ILcdFeatureIndexedAnd2DBoundsIndexedModel aHeliportModel)
aHeliportModel
- the heliport model to be used to create the procedurescreateRequiredIndices(com.luciad.model.TLcdModelList)
public void setWaypointModel(ILcdFeatureIndexedAnd2DBoundsIndexedModel aWaypointModel)
aWaypointModel
- the waypoint model to be used to create the procedurescreateRequiredIndices(com.luciad.model.TLcdModelList)
public void setNavaidModel(TLcdModelList aNavaidsModelList)
aNavaidsModelList
- the navaid modelList to be used to create the procedurescreateRequiredIndices(com.luciad.model.TLcdModelList)
public void setILSModel(TLcdModelList aILSModelList)
aILSModelList
- the ILS modelList to be used to create the procedurescreateRequiredIndices(com.luciad.model.TLcdModelList)
public void setRunwayModel(ILcdFeatureIndexedAnd2DBoundsIndexedModel aRunwayModel)
As a side effect, the index of the runway direction identifier will be initialized.
aRunwayModel
- the runway model to be used to create the procedurescreateRequiredIndices(com.luciad.model.TLcdModelList)
public void createRequiredIndices(TLcdModelList aModelList)
setILSModel
method
or the setNavaidModel
method.
Please make sure that the following features were decoded into the model objects of the
Navaid submodels:
aModelList
- a modelList either with ILS objects or navaidssetNavaidModel(com.luciad.model.TLcdModelList)
,
setILSModel(com.luciad.model.TLcdModelList)
public void createRequiredIndices(ILcdFeatureIndexedAnd2DBoundsIndexedModel aModel)
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:
aModel
- a model containing the waypoints, aerodromes, runways or heliportssetWaypointModel(com.luciad.model.ILcdFeatureIndexedAnd2DBoundsIndexedModel)
,
setAirportModel(com.luciad.model.ILcdFeatureIndexedAnd2DBoundsIndexedModel)
,
setRunwayModel(com.luciad.model.ILcdFeatureIndexedAnd2DBoundsIndexedModel)
,
setHeliportModel(com.luciad.model.ILcdFeatureIndexedAnd2DBoundsIndexedModel)
public void removeRequiredIndices(TLcdModelList aModelList)
createRequiredIndices
method.
Be careful when using this method: it might remove an index that is still used by another decoder!
aModelList
- a modelList either with ILS objects or navaids