@LcdService(service=ILcdModelDecoder.class, priority=20000) public class TLcdARINCModelDecoder extends Object implements ILcdModelDecoder, ILcdInputStreamFactoryCapable, ILcdStatusSource
TLcdARINCDecoder
can be used.
File | Required | Entry point | Description |
---|---|---|---|
*.txt | x | x | TXT file containing the ARINC data |
*.dat | x | x | DAT file containing the ARINC data |
*.pc | x | x | PC file containing the ARINC data |
*.ari | x | x | ARI file containing the ARINC data |
ILcdInputStreamFactory
of this decoder.model list
with a model
for each data type in the input.ILcd2DBoundsIndexedModel
.TLcdARINC...Descriptor
.ARINC
.ILcdGeodeticReference
.ARINC data type
.
For more information about the model and its elements, see the com.luciad.format.arinc.model
package
and its sub-packages.
ILcdModelDecoder decoder = new TLcdARINCModelDecoder();
ILcdModel model = decoder.decode( "arinc_data.dat" );
ARINC data can be supplied with respect to different geodetic datums. The LuciadLightspeed ARINC package supports the following geodetic datums (specified by their three character representation as used in the ARINC specification): ADI, AFG, AGD, AGE, ANS, AIN, AIO, ARF, ARS, AUA, AUG, BAT, BEL, BER, BOO, BRN, BUR, CAI, CAP, CGE, CHI, CHU, COA, DGI, EUR, EUS, EUT, FAH, GEO, GRK, GRX, GUA, HEN, HJO, HTN, IGF, INF, INH, IDN, IRL, KAN, KEA, LEH, LIB, LUZ, MIK, MAH, MAS, MER, MOD, MIN, NAH, NAP, NAS, NAU, NAW, NAR, NSD, NTH, OEG, OGB, PIE, POT, PTN, PRD, PRP, PUK, QAT, QUO, ROM, SAP, SCK, SAN, SAD, STO, TAN, TIL, TOY, TOK, TRI, U (WGS84), VOI, VOR, WGC, WGE, YAC, ZAN.
Objects containing data given in an unsupported datum, will be ignored by the decoder and thus not be added to the model.
Constructor and Description |
---|
TLcdARINCModelDecoder()
Creates a new model decoder that handles all types.
|
Modifier and Type | Method and Description |
---|---|
void |
addStatusListener(ILcdStatusListener aListener)
Registers the given listener so it will receive status events from this source.
|
boolean |
canDecodeSource(String aSourceName)
Checks whether this model decoder can decode the specified data source.
|
ILcdModel |
decode(String aSourceName)
Creates a new model from the given data source.
|
ILcdBounds |
getBoundsToFilterOn()
Returns the (geodetic) bounds that will be used as a filter on the model created by this mode decoder.
|
String |
getDisplayName()
Returns a short, displayable name for the format that is decoded by this
ILcdModelDecoder . |
ILcdInputStreamFactory |
getInputStreamFactory()
Returns the input stream factory that is used.
|
void |
removeStatusListener(ILcdStatusListener aListener)
Removes the specified listener so it is no longer notified.
|
void |
setBoundsToFilterOn(ILcdBounds aBoundsToFilterOn)
Specifies (geodetic) bounds that will be used as a filter on the model created by this model decoder.
|
void |
setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
Sets the input stream factory to be used.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
public TLcdARINCModelDecoder()
public void setBoundsToFilterOn(ILcdBounds aBoundsToFilterOn)
If this bounds is null
, all objects found in the data source will be inserted into the model.
If this bounds is not null
, only the objects whose bounds interact with the specified bounds will be
inserted into the model.
aBoundsToFilterOn
- the bounds to be used as a filtergetBoundsToFilterOn()
,
TLcdARINCDecoder.setBoundsToFilterOn(com.luciad.shape.ILcdBounds)
public ILcdBounds getBoundsToFilterOn()
setBoundsToFilterOn(com.luciad.shape.ILcdBounds)
,
TLcdARINCDecoder.setBoundsToFilterOn(com.luciad.shape.ILcdBounds)
public void setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
ILcdInputStreamFactoryCapable
setInputStreamFactory
in interface ILcdInputStreamFactoryCapable
aInputStreamFactory
- the input stream factory to be used.public ILcdInputStreamFactory getInputStreamFactory()
ILcdInputStreamFactoryCapable
getInputStreamFactory
in interface ILcdInputStreamFactoryCapable
public String getDisplayName()
ILcdModelDecoder
ILcdModelDecoder
.getDisplayName
in interface ILcdModelDecoder
ILcdModelDecoder
.public boolean canDecodeSource(String aSourceName)
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.
By default, the implementation of this method only accepts files with one of the following extensions:".txt", ".dat", ".pc", ".ari"
. In order to accept more source names, this method can be overridden. This
can for example be done to implement a more robust (but slower) check to see if a file is a valid ARINC
file, see for example TLcdARINCDecoder.canDecodeSource(String)
.canDecodeSource
in interface ILcdModelDecoder
aSourceName
- the data source to be verified; typically a file name or a URL.true
if this decoder can likely decode the data specified by the source name, false
otherwise.ILcdModelDecoder.decode(String)
,
ILcdModelDecoder.decodeModelMetadata(String)
public ILcdModel decode(String aSourceName) throws IOException
ILcdModelDecoder
decode
in interface ILcdModelDecoder
aSourceName
- the data source to be decoded; typically a file name or a URL.null
is allowed, implementors are advised to throw an error instead.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);
}
}
InterruptedIOException
- When the thread on which this method is called is interrupted: it is recommended to stop the decoding
and throw an InterruptedIOException
.
This same exception can also be used if the decoder shows UI to the user, and the user cancels the decoding
through the UI.ILcdModelDecoder.canDecodeSource(String)
public void addStatusListener(ILcdStatusListener aListener)
ILcdStatusSource
Registers the given listener so it will receive status events from this source.
In case you need to register a listener which keeps a reference to an object with a shorter life-time than this status source,
you can use a ALcdWeakStatusListener
instance as status listener.
addStatusListener
in interface ILcdStatusSource
aListener
- The listener to be notified when the status has changed.public void removeStatusListener(ILcdStatusListener aListener)
ILcdStatusSource
removeStatusListener
in interface ILcdStatusSource
aListener
- The listener to remove.