public class Tools extends Object
| Modifier and Type | Field and Description |
|---|---|
static long |
UTC_SECONDS_YEAR_2000 |
| Constructor and Description |
|---|
Tools() |
| Modifier and Type | Method and Description |
|---|---|
static Duration |
fromDcDuration(long dcNanos)
Converts EtherCat time interval, assumed to be the difference of two DC time values,
into a
Duration. |
static org.lsst.ccs.utilities.taitime.CCSTimeStamp |
fromDcTime64(long dctime64,
int dtai)
Converts a TwinCAT absolute timestamp to a CCSTimeStamp.
|
static boolean |
getBoolean(ByteBuffer data)
Gets a PLC BOOL value from a byte buffer and converts it to a boolean value.
|
static void |
main(String[] args) |
static void |
putBoolean(ByteBuffer data,
boolean b)
Appends to a byte buffer the PLC BOOL value equivalent to a Java boolean.
|
static long |
toDcDuration(Duration interval)
Reverses the transformation performed by
toDcDuration(java.time.Duration). |
static long |
toDcTime64(org.lsst.ccs.utilities.taitime.CCSTimeStamp ccsTime)
Converts a CCS timestamp to a T_DCTIME64 value.
|
public static boolean getBoolean(ByteBuffer data)
data - Holds the data.public static void putBoolean(ByteBuffer data, boolean b)
data - Holds the data.b - The boolean value to convert and append.public static org.lsst.ccs.utilities.taitime.CCSTimeStamp fromDcTime64(long dctime64,
int dtai)
T_DCTIME64 timestamps are like TAI64N timestamps but have a couple of peculiarities. A value of zero nanoseconds denotes 0 hours on Jan 1 2000 UTC, not any of the standard epochs. Even so, the timestamp has the full, current count of leap seconds even though many of those occurred before the year 2000. Therefore producing a true TAI64N value must be done with care in order to avoid double-counting those earlier leap seconds.
dctime64 - The T_DCTIME64 value.dtai - What the observatory calls the the number of seconds that a
"TAI Instant" is ahead of a standard Instant. It's effectively the current number
of leap seconds, 37 as of November 2023.public static long toDcTime64(org.lsst.ccs.utilities.taitime.CCSTimeStamp ccsTime)
fromDcTime64(long, int) except that the DTAI value is not supplied. It has to be
calculated from the CCS timestamp itself since we need the value of DTAI as it was
when the timestamp was created, not the current value.ccsTime - The CCS timestamp.public static Duration fromDcDuration(long dcNanos)
Duration.dcNanos - The DC time difference, a count of nanoseconds.Duration value.public static long toDcDuration(Duration interval)
toDcDuration(java.time.Duration).interval - The time interval to convert.public static void main(String[] args)
Copyright © 2024 LSST. All rights reserved.