com.ionetrics.lib.annotatorcomm
Class IrigBTimestamp

java.lang.Object
  extended by com.ionetrics.lib.annotatorcomm.Timestamp
      extended by com.ionetrics.lib.annotatorcomm.IrigBTimestamp
All Implemented Interfaces:
java.lang.Comparable<Timestamp>

public class IrigBTimestamp
extends Timestamp

IrigBTimestamp is a timestamp containing the exact bit stream of an Irig B source. The stream includes BCD seconds, minutes, hours, days, and years, straight binary time of day in seconds, and control functions for field testing and use.


Field Summary
static int CONTROL_FUNCTION_BITS
          Irig-B timestamps contain 19 control function bits.
static int LENGTH
          Irig-B timestamps are 10 bytes long.
 
Constructor Summary
IrigBTimestamp(byte[] timestamp)
          Construct a new IrigBTimestamp.
 
Method Summary
 int getControlFunctions()
          Get the control function bits.
 int getDayOfYear()
          Get the day of year value from the BCD Day of Year field.
 java.lang.String getExtendedFormatTime()
          Get the formatted time the BCD time of day and control functions appended.
 java.lang.String getFormattedControlFunctions()
          Get the control function bits as a String of 0's and 1's.
 int getHourOfDay()
          Get the hour of day (24 hour day).
 int getMicrosecond()
          Zero is always returned as Irig B doesn't carry microsecond accuracy directly.
 int getMinuteOfHour()
          Get the minute of the hour.
 int getSBS()
          Get the second of day value from the SB Second of Day field.
 int getSecondOfDay()
          Get the second of the day.
 int getSecondOfMinute()
          Get the second of the minute.
 byte[] getTimestampBytes()
          Get an array containing the timestamp bytes.
 int getYear()
          Get the year value from the BCD Year field.
 
Methods inherited from class com.ionetrics.lib.annotatorcomm.Timestamp
compareTo, equals, getFormattedTime, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

LENGTH

public static final int LENGTH
Irig-B timestamps are 10 bytes long.

See Also:
Constant Field Values

CONTROL_FUNCTION_BITS

public static final int CONTROL_FUNCTION_BITS
Irig-B timestamps contain 19 control function bits.

See Also:
Constant Field Values
Constructor Detail

IrigBTimestamp

public IrigBTimestamp(byte[] timestamp)
Construct a new IrigBTimestamp.

Parameters:
timestamp - timestamp bytes
Throws:
java.lang.IllegalArgumentException - thrown on incorrect timestamp length
Method Detail

getYear

public int getYear()
Get the year value from the BCD Year field.

Specified by:
getYear in class Timestamp
Returns:
year

getDayOfYear

public int getDayOfYear()
Get the day of year value from the BCD Day of Year field.

Specified by:
getDayOfYear in class Timestamp
Returns:
day of year

getSBS

public int getSBS()
Get the second of day value from the SB Second of Day field.

Returns:
second of day

getMicrosecond

public int getMicrosecond()
Zero is always returned as Irig B doesn't carry microsecond accuracy directly.

Specified by:
getMicrosecond in class Timestamp
Returns:
0

getHourOfDay

public int getHourOfDay()
Get the hour of day (24 hour day).

Overrides:
getHourOfDay in class Timestamp
Returns:
hour

getMinuteOfHour

public int getMinuteOfHour()
Get the minute of the hour.

Overrides:
getMinuteOfHour in class Timestamp
Returns:
minute

getSecondOfMinute

public int getSecondOfMinute()
Get the second of the minute.

Overrides:
getSecondOfMinute in class Timestamp
Returns:
second

getSecondOfDay

public int getSecondOfDay()
Description copied from class: Timestamp
Get the second of the day.

Specified by:
getSecondOfDay in class Timestamp
Returns:
second

getControlFunctions

public int getControlFunctions()
Get the control function bits. The bits (normally spread through the stream) are collected in bits 0-18 in the same order as Irig B transmits.

Returns:
control functions

getFormattedControlFunctions

public java.lang.String getFormattedControlFunctions()
Get the control function bits as a String of 0's and 1's.

Returns:
control functions

getExtendedFormatTime

public java.lang.String getExtendedFormatTime()
Get the formatted time the BCD time of day and control functions appended.

Overrides:
getExtendedFormatTime in class Timestamp
Returns:
extended formatted time

getTimestampBytes

public byte[] getTimestampBytes()
Get an array containing the timestamp bytes. The bits are mapped in the exact order as received from the Irig B stream. A padding of 6 bits has been added at the end to align on a byte boundary. They contain no data and may be safely ignored.

Returns:
timestamp bytes


Copyright © 2006 Ionetrics Corp. All Rights Reserved.