home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_11_11 / feeney / myheader.h < prev    next >
C/C++ Source or Header  |  1993-05-21  |  2KB  |  69 lines

  1.                  LISTING 1
  2.                 HEADER FILE
  3. /*
  4.  MyHeader.h     Constants.
  5. */
  6. #define InfoMsg 0
  7. #define VerMsg  1
  8. #define WarnMsg 2
  9. #define ErrMsg  3
  10. #define BadMsg  4
  11. #define TimMsg  ("COULD NOT SETUP TIMER")
  12. #define TryMsg  ("COULD NOT SAMPLE POINT")
  13. /* 
  14.   Retry sampling data maximum of 5 times if
  15.   any errors are encountered.
  16. */
  17. #define _nDATATRIES     5
  18.  
  19. // Memory space will be available for 10 scans max.
  20. #define nSETs   10
  21.  
  22. #define SetSampleTimer ( SetTimer(hWnd, IDM_SAMPLE, 
  23.              Dat.TimeDelay, 0L) )
  24. #define SetPeriodTimer ( SetTimer(hWnd, IDM_PERIOD, 
  25.              Dat.ScanTime, 0L) )
  26.  
  27. #define _Wavelength     0
  28. #define _TimeDrive      1
  29. /*
  30.   Data
  31. */
  32. struct MyData {
  33.   int  Mode,      // Time-drive or Wavelenght? 
  34.        iScan,     // Array Index to current scan.
  35.        iPnt,      // Data Array index being acquiring.
  36.        Points,    // Maximum # of points to acquire.
  37.        pts[nSETs];// # of points in each loaded scan.
  38.   long TimeDelay, // Sampling delay between points.
  39.        ScanTime;  // Max acq. time at wavelength.
  40.   float Position, // Current point, time or wavelength.
  41.     Start, Stop, // 1st and Last Wavelength 
  42.              //   in nanometers (nm).
  43.     Step,     // Wavelength Increment in nm.
  44.           // Time-drive only parameters
  45.           // in seconds (s)
  46.     TDStart,  // Time to begin, usually 0
  47.     TDStop,   // Time to stop scan, e.g. 300
  48.     TDStep;   // Time increment, e.g. 0.25
  49. } Dat = {
  50.   _Wavelength, 0, 0, nPOINTs, {0, NULL}, 250, 2000,
  51.   (float) 400, (float) 700, (float) 2,  (float) 0, 
  52.   (float) 300, (float) 0.5
  53. };
  54. /*
  55.   Function prototypes.
  56. */
  57. BOOL  yes_no( char * );
  58. BOOL  Sleep( long );
  59. BOOL  Timer( long );
  60. BOOL  SampleTimer(HWND,unsigned,WORD,LONG);
  61. BOOL  SampleTimerExpired(HWND,unsigned,WORD,LONG);
  62. BOOL  SampleTimerTicked(HWND,unsigned,WORD,LONG);
  63. BOOL  StartScan(HWND,unsigned,WORD,LONG);
  64. BOOL  StopScan(HWND,unsigned,WORD,LONG);
  65. BOOL  ShowBox(HWND,FARPROC,LPSTR);
  66.  
  67. long FAR PASCAL MainWndProc(HWND,unsigned,WORD,LONG);
  68.  
  69.