public class XTCECcsdsCucTimeHandler extends Object implements XTCEAbsoluteTimeType
CCSDS CUC time format is composed of three identification fields. These are the P-FIELD, the T-FIELD, and an optional second P-FIELD providing additional information to the first. This implementation supports the capability of the first P-FIELD and the T-FIELD only. The default number of octets is 7 where 4 octets are used for the seconds and 3 octets are used for the seconds fraction. This corresponds to bits 4,5,6,7 of the P-FIELD definition. The default epoch is TAI, although any epoch can be specified.
This class is applicable to AbsoluteTimeType XTCE specifications when three conditions are met by the XML document:
Although the CCSDS specification carries as low as 2^-24 second counts, the basic demo Java implementation here uses the basic libraries and will only act as far as the milliseconds. A production grade version of this would need a better underlying time library.
| Constructor and Description |
|---|
XTCECcsdsCucTimeHandler()
Default constructor to initialize a handler with the default time
format and time zone.
|
XTCECcsdsCucTimeHandler(String timeFormat,
String timeZone,
String epoch,
int numSecBytes,
int numFracBytes)
Constructor that permits changing the default time format and the
time zone information.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getCalibratedFromUncalibrated(String uncalValue)
Retrieve the EU calibrated value of this time item, which can be a
Parameter or Argument, when given the uncalibrated value.
|
BitSet |
getRawFromUncalibrated(String uncalValue)
Retrieve the raw binary bits for encoding of this time item, which can
be a Parameter or Argument, when given the uncalibrated value.
|
String |
getUncalibratedFromCalibrated(String euValue)
Retrieve the uncalibrated value for this time item, which can be a
Parameter or Argument, when given the EU calibrated value.
|
String |
getUncalibratedFromRaw(BitSet rawValue)
Retrieve the uncalibrated value of this time item, which can be a
Parameter or Argument, when given the raw binary value.
|
boolean |
isApplicable(org.omg.space.xtce.AbsoluteTimeDataType instance)
Method to determine if an XTCE AbsoluteTimeType, either Parameter or
Argument, is handled by this implementation of the interface.
|
public XTCECcsdsCucTimeHandler()
The default time output format is UTC ISO8601 text. This is in the form of YYYY-MM-dd HH:MM:ss.SSS
public XTCECcsdsCucTimeHandler(String timeFormat, String timeZone, String epoch, int numSecBytes, int numFracBytes)
timeFormat - String containing the time format string suitable
for the Java SimpleDateFormat formatter.timeZone - String containing the time zone identifier string,
suitable for the TimeZone.getTimeZone method in Java.epoch - String containing the epoch date in the form "yyyy-MM-dd"
or the string "TAI".numSecBytes - integer containing the number of bytes to use for the
seconds field in the CCSDS CUC T-FIELD high bytes.numFracBytes - integer containing the number of bytes to use for
the fractional seconds field in the CCSDS CUC T-FIELD low bytes.public boolean isApplicable(org.omg.space.xtce.AbsoluteTimeDataType instance)
This method returns true when three conditions are met by the XML that is represented by the JAXB AbsoluteTimeDataType object instance passed by the caller:
isApplicable in interface XTCEAbsoluteTimeTypeinstance - AbsoluteTimeDataType object from the JAXB representation
of the XTCE XML document.public String getUncalibratedFromRaw(BitSet rawValue)
This conversion uses only system time capabilities, and as a result is not leap second corrected.
getUncalibratedFromRaw in interface XTCEAbsoluteTimeTyperawValue - BitSet containing the raw binary value that would
be encoded on the wire or bitfield. The raw binary is always expected
to be in the order read from the stream.public String getCalibratedFromUncalibrated(String uncalValue)
The uncalibrated input string contains an integral number of microseconds since the UNIX epoch. The output string is the UTC string in the form of ISO8601 (YYYY-MM-DD HH:MM:SS.sssss). The timezone is always UTC/GMT.
getCalibratedFromUncalibrated in interface XTCEAbsoluteTimeTypeuncalValue - String containing the uncalibrated value that is
derived from the encoded value on the wire or bitfield.NumberFormatException - in the event that the uncalibrated value
cannot be converted to an integral number.public BitSet getRawFromUncalibrated(String uncalValue)
This conversion uses only system time capabilities, and as a result is not leap second corrected.
getRawFromUncalibrated in interface XTCEAbsoluteTimeTypeuncalValue - String containing the uncalibrated representation of
the value.NumberFormatException - in the event that the uncalibrated value
cannot be converted to an integral number.public String getUncalibratedFromCalibrated(String euValue)
The uncalibrated output string contains an integral number of microseconds since the UNIX epoch. The input string is the UTC string in the form of ISO8601 (YYYY-MM-DD HH:MM:SS.sssss).
getUncalibratedFromCalibrated in interface XTCEAbsoluteTimeTypeeuValue - String containing a value of this item represented in
EU/calibrated form.RuntimeException - in the event that a checked exception is caught
by this function, with the parsing error text copied.Copyright © 2015–2019. All rights reserved.