Class AbstractPacketPreprocessor
- java.lang.Object
-
- org.yamcs.tctm.AbstractPacketPreprocessor
-
- All Implemented Interfaces:
PacketPreprocessor
- Direct Known Subclasses:
CfsPacketPreprocessor,GenericPacketPreprocessor,IssPacketPreprocessor,PusPacketPreprocessor
public abstract class AbstractPacketPreprocessor extends Object implements PacketPreprocessor
This class provides some common facilities for the packet preprocessors. Options:dataLinks: ... packetPreprocessor: org.yamcs.tctm.concrete_classname packetPreprocessorArgs: byteOrder: LITTLE_ENDIAN timeEncoding: epoch: CUSTOM epochUTC: 1970-01-01T00:00:00Z timeIncludesLeapSeconds: falseThebyteOrderoption (default isBIG_ENDIAN) is used by some implementing classes to decode parts of the header.The
timeEncodingis used to convert the extracted time to Yamcs time.epochcan be one of TAI, J2000, UNIX, GPS, CUSTOM.If CUSTOM is specified, the
epochUTChas to be used to specify the UTC time which is used as an epoch (UTC is used here loosely because strictly speaking UTC has been only introduced in 1972 so it does not make sense for the times before).The time read from the packet is interpreted as delta from
epochUTC.If
timeIncludesLeapSecondsistrue(default), the delta time is considered as having the leap seconds included (practically it is the real time that passed).TAI, J2000 and GPS have the leap seconds included, UNIX does not.
The example above is equivalent with:
timeEncoding: epoch: UNIXIf this option is not configured, the default will be different for each pre-processor.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractPacketPreprocessor.TimeEpochs
-
Field Summary
Fields Modifier and Type Field Description protected ByteOrderbyteOrderprotected static StringCONFIG_KEY_ERROR_DETECTIONprotected static StringCONFIG_KEY_TIME_ENCODINGprotected longcustomEpochprotected booleancustomEpochIncludeLeapSecondprotected ErrorDetectionWordCalculatorerrorDetectionCalculatorprotected EventProducereventProducerprotected Loglogprotected TimeDecodertimeDecoderprotected AbstractPacketPreprocessor.TimeEpochstimeEpochprotected TimeServicetimeServiceprotected booleanuseLocalGenerationTimeIf true, do not extract time from packets but use the local generation time.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractPacketPreprocessor(String yamcsInstance, YConfiguration config)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ErrorDetectionWordCalculatorgetErrorDetectionWordCalculator(YConfiguration config)protected longshiftFromEpoch(long t)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.yamcs.tctm.PacketPreprocessor
checkForSequenceDiscontinuity, process, process
-
-
-
-
Field Detail
-
CONFIG_KEY_ERROR_DETECTION
protected static final String CONFIG_KEY_ERROR_DETECTION
- See Also:
- Constant Field Values
-
CONFIG_KEY_TIME_ENCODING
protected static final String CONFIG_KEY_TIME_ENCODING
- See Also:
- Constant Field Values
-
errorDetectionCalculator
protected ErrorDetectionWordCalculator errorDetectionCalculator
-
eventProducer
protected EventProducer eventProducer
-
timeService
protected TimeService timeService
-
timeEpoch
protected AbstractPacketPreprocessor.TimeEpochs timeEpoch
-
customEpoch
protected long customEpoch
-
customEpochIncludeLeapSecond
protected boolean customEpochIncludeLeapSecond
-
timeDecoder
protected TimeDecoder timeDecoder
-
byteOrder
protected ByteOrder byteOrder
-
useLocalGenerationTime
protected boolean useLocalGenerationTime
If true, do not extract time from packets but use the local generation time.It is a good idea to set the
TmPacket.setLocalGenTime()flag to indicate it.The flag has to be set by the pre-processor!
-
log
protected final Log log
-
-
Constructor Detail
-
AbstractPacketPreprocessor
protected AbstractPacketPreprocessor(String yamcsInstance, YConfiguration config)
-
-
Method Detail
-
getErrorDetectionWordCalculator
public static ErrorDetectionWordCalculator getErrorDetectionWordCalculator(YConfiguration config)
-
shiftFromEpoch
protected long shiftFromEpoch(long t)
-
-