home *** CD-ROM | disk | FTP | other *** search
/ nisttime.carsoncity.k12.mi.us / nisttime.carsoncity.k12.mi.us.tar / nisttime.carsoncity.k12.mi.us / pub / lockclock / lock.h < prev    next >
C/C++ Source or Header  |  1996-11-18  |  2KB  |  54 lines

  1. /*
  2.     include file lock.h defines structure of each
  3.     lock record
  4. */
  5. #include "sizint.h"
  6. struct lockst        /*structure for lock state*/
  7.     {
  8.     LONG  day;        /*MJD of data*/
  9.     LONG  fday;        /*time in seconds after midnight*/
  10.     int mode;        /*current mode -- see comments*/
  11.     double x;        /*time difference measured in s*/
  12.     double y;        /*rate difference estimated in s/s*/
  13.     double d;        /*drift of local rate in s/s**2  */
  14.     int flags;        /*state flags -- see comments*/
  15.     int waitn;    /*nominal delay until next time in sec*/
  16.     int waitx;    /*actual delay since last time in sec*/
  17.     double errx;    /*error in time prediction */
  18.     double ybar;    /*average of rate difference y */
  19.     double sumerr;    /*integral of errx */
  20. } ;
  21. struct lockpm
  22.     {
  23.     float xsigma;            /*measurement noise in s*/
  24.     int flags;            /*flag word*/
  25.     int wait0;            /*initial delay between cycles*/
  26.     int iavgt;            /*time constant for freq avg. */
  27.     float xoffst;            /*offset bias for time data */
  28. } ;
  29. /*
  30.     the flags word is treated as a series of bits with the
  31.     following meanings:
  32.  
  33.     bit 0 (least sig. bit)  = 0    do not advance to mode 4
  34.                 = 1    advance to mode 4 and lock clock
  35.  
  36.     bit 1                   = 0     do not copy lock file when full
  37.                                 = 1     copy lock file when almost full
  38.  
  39.     bit 2            = 0    clock is to be set using adjtime
  40.                 = 1    clock is set in 1 step using 
  41.                          settimeofday()
  42.     bit 3            = 0    stay in mode 6 and use acts
  43.                 = 1    advance to mode 7 and use CTS
  44.                     pulses.
  45.     bit 4            = 0    leap seconds via slew
  46.                 = 1    leap second via call to David 
  47.                     Mills kernel entry point
  48. */
  49. /*
  50.     parameter NUMSTATES sets the size of the push-down stack
  51.     of state vectors that are saved
  52. */
  53. #define NUMSTATES 750
  54.