GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> PBS / dev > pbs / linux-gcc
#include <PBI/Endianness.h>
Classes | |
struct | _WCT_time_sat_s |
This defines Spectrum Astro Standard Time (SAT) as a structure. More... | |
struct | _WCT_time_sat_u |
This defines Spectrum Astro Standard Time (SAT) as a union between the structure and the long long representation. More... | |
Defines | |
#define | WCT_K_NSECS_IN_A_SEC 1000000000 |
Convenience symbol for 1,000,000,000. | |
#define | WCT_K_NSECS_IN_A_MSEC 1000000 |
Convenience symbol for 1,000,000, could come in handy; besides it completes the suite. | |
#define | WCT_K_NSECS_IN_A_USEC 1000 |
Convenience symbol for 1000, used when converting time specified in seconds.usecs to nanoseconds. | |
#define | WCT_EXTRACT_SECS_NSECS(_wct, _secs, _nsecs) |
Extracts the number of seconds/nanoseconds. | |
#define | WCT_SECS(_wct) ( (_wct) / WCT_K_NSECS_IN_A_SEC) |
Returns the number of full seconds in the specified time. | |
#define | WCT_NSECS(_wct) ( (_wct) % WCT_K_NSECS_IN_A_SEC) |
Returns the fractional number of nanoseconds in the specified time. | |
#define | WCT_USECS(_wct) (WCT_NSECS(_wct) / WCT_K_NSECS_IN_A_USEC) |
Returns the fractional number of microseconds in the specified time. | |
#define | WCT_MSECS(_wct) (WCT_NSECS(_wct) / WCT_K_NSECS_IN_A_MSEC) |
Returns the fractional number of milliseconds in the specified time. | |
#define | WCT_K_UTB_OFFSET_IN_SECS 0x3a4fc880 |
The difference, in seconds, of the LAT epoch (Jan 1, 2001) and the traditional UNIX epoch (Jan 1, 1970). | |
#define | WCT_K_UTB_OFFSET_IN_NSECS |
The difference, in nanoseconds, of the LAT epoch (Jan 1, 2001) and the traditional UNIX epoch (Jan 1, 1970). | |
Typedefs | |
typedef int | WCT_tick |
Typedef for differential time in Wall Clock Time units. | |
typedef signed long long | WCT_time |
Representation for an absolute Wall Clock Time time. | |
typedef signed long long int | WCT_time_sat |
The Spectrum-Astro time as a long long int. | |
typedef struct _WCT_time_sat_s | WCT_time_sat_s |
Typedef for struct _WCT_time_sat_s. | |
typedef union _WCT_time_sat_u | WCT_time_sat_u |
Typedef for struct _WCT_time_sat_u. | |
Functions | |
long long int | WCT_set (register WCT_time atime, unsigned int ptime, unsigned int aticks, unsigned int pticks) |
Sets both the absolute time and the information needed to convert back and forth from WCT_atick and WCT_ptick. | |
WCT_time | WCT_get (void) |
Retrieves the current time in absolute time units. | |
unsigned int | WCT_update (void) |
Reset the time bases that tie the PTIME and ATIME. | |
WCT_time | WCT_utb_get (void) |
Retrieves the current time in absolute time units. | |
WCT_time | WCT_to_utb (WCT_time lat_epoch_time) |
Converts a wall clock time specified with a base of the LAT epoch to a wall clock time specified with a base of the tradional UNIX epoch. | |
WCT_time | WCT_from_utb (WCT_time unix_epoch_time) |
Converts a wall clock time specified with a base of the LAT epoch to a wall clock time specified with a base of the tradional UNIX epoch. | |
WCT_time_sat | WCT_sat_get (void) |
Retrieves the current time in absolute time units. The format is in Spectrum-Astro Standard Time format. | |
WCT_time_sat | WCT_to_sat (WCT_time lat_epoch_time) |
Converts a wall clock time specified with Spectrum-Astro Standard Format. | |
WCT_time | WCT_from_sat (WCT_time_sat sat_time) |
Converts a Spectrum Astro Time Format to LAT format. |
CVS $Id: WCT.h,v 1.7 2011/03/24 23:05:44 apw Exp $
#define WCT_EXTRACT_SECS_NSECS | ( | _wct, | |||
_secs, | |||||
_nsecs | ) |
Value:
{ \ _secs = (_wct) / WCT_K_NSECS_IN_A_SEC; \ _nsecs = (_wct) - WCT_K_NSECS_IN_A_SEC * (_secs); \ }
_wct | The WCT_time to break down | |
_secs | The number of full seconds in the specified time | |
_nsecs | The number of nanoseconds remaining after the full seconds |
Referenced by WCT__to_sat().
#define WCT_K_UTB_OFFSET_IN_NSECS |
Value:
((unsigned long long)(WCT_K_UTB_OFFSET_IN_SECS) * \ (unsigned long long)(WCT_K_NSECS_IN_A_SEC))
Referenced by WCT__from_utb(), and WCT__to_utb().
#define WCT_MSECS | ( | _wct | ) | (WCT_NSECS(_wct) / WCT_K_NSECS_IN_A_MSEC) |
Returns the fractional number of milliseconds in the specified time.
_wct | The time |
#define WCT_NSECS | ( | _wct | ) | ( (_wct) % WCT_K_NSECS_IN_A_SEC) |
Returns the fractional number of nanoseconds in the specified time.
_wct | The time |
#define WCT_SECS | ( | _wct | ) | ( (_wct) / WCT_K_NSECS_IN_A_SEC) |
Returns the number of full seconds in the specified time.
_wct | The time |
#define WCT_USECS | ( | _wct | ) | (WCT_NSECS(_wct) / WCT_K_NSECS_IN_A_USEC) |
Returns the fractional number of microseconds in the specified time.
_wct | The time |
Typedef for differential time in Wall Clock Time units.
Absolute units are typically nanoseconds, but the WCT facility does not impose this. The representation is 32 bits, so with nanoseconds one can specify a delta time of +/- 2*31 nanoseconds or approximately +/- 2 seconds.
Representation for an absolute Wall Clock Time time.
WCT_time WCT_from_sat | ( | WCT_time_sat | sat_time | ) |
Converts a Spectrum Astro Time Format to LAT format.
sat_time | The wall clock time in Spectrum-Astro Format |
Converts a wall clock time specified with a base of the LAT epoch to a wall clock time specified with a base of the tradional UNIX epoch.
unix_epoch_time | The wall clock time using the LAT epoch as a base |
WCT_time WCT_get | ( | void | ) |
Retrieves the current time in absolute time units.
This routine is coded to be a cheap call on the PowerPC, involving less than 20 cycles. Other implementations may be more expensive.
Referenced by WCT__sat_get().
long long int WCT_set | ( | register WCT_time | atime, | |
unsigned int | ptime, | |||
unsigned int | aticks, | |||
unsigned int | pticks | |||
) |
Sets both the absolute time and the information needed to convert back and forth from WCT_atick and WCT_ptick.
Referenced by PBS_initialize2().
WCT_time_sat WCT_to_sat | ( | WCT_time | lat_epoch_time | ) |
Converts a wall clock time specified with Spectrum-Astro Standard Format.
lat_epoch_time | The wall clock time using the LAT epoch as a base |
Converts a wall clock time specified with a base of the LAT epoch to a wall clock time specified with a base of the tradional UNIX epoch.
lat_epoch_time | The wall clock time using the LAT epoch as a base |
unsigned WCT_update | ( | void | ) |
Reset the time bases that tie the PTIME and ATIME.
WCT_time WCT_utb_get | ( | void | ) |
Retrieves the current time in absolute time units.
This routine is coded to be a cheap call on the PowerPC, involving less than 20 cycles. Other implementations may be more expensive.