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: false
ThebyteOrder
option (default isBIG_ENDIAN
) is used by some implementing classes to decode parts of the header.The
timeEncoding
is used to convert the extracted time to Yamcs time.epoch
can be one of TAI, J2000, UNIX, GPS, CUSTOM.If CUSTOM is specified, the
epochUTC
has 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
timeIncludesLeapSeconds
istrue
(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: UNIX
If 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 class
AbstractPacketPreprocessor.TimeEpochs
-
Field Summary
Fields Modifier and Type Field Description protected ByteOrder
byteOrder
protected static String
CONFIG_KEY_ERROR_DETECTION
protected static String
CONFIG_KEY_TCO_SERVICE
protected static String
CONFIG_KEY_TIME_ENCODING
protected long
customEpoch
protected boolean
customEpochIncludeLeapSecond
protected ErrorDetectionWordCalculator
errorDetectionCalculator
protected EventProducer
eventProducer
protected Log
log
protected TimeCorrelationService
tcoService
protected TimeDecoder
timeDecoder
protected AbstractPacketPreprocessor.TimeEpochs
timeEpoch
protected TimeService
timeService
protected boolean
useLocalGenerationTime
If true, do not extract time from packets but use the local generation time.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractPacketPreprocessor(String yamcsInstance, YConfiguration config)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ErrorDetectionWordCalculator
getErrorDetectionWordCalculator(YConfiguration config)
protected long
shiftFromEpoch(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
-
CONFIG_KEY_TCO_SERVICE
protected static final String CONFIG_KEY_TCO_SERVICE
- 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
-
tcoService
protected TimeCorrelationService tcoService
-
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)
-
-