/**---------------------------------------------------------------------------
 ** 
 ** avg_.h -- 
 ** 
 ** Author          : Pierre Jaccard
 ** Created On      : 1999/07/31 21:22:06
 ** Last Modified By: Pierre Jaccard
 ** Last Modified On: 1999/07/31 21:23:27
 ** Update Count    : 1
 ** Directory       : /home/pego/pcd1/codas3c/gfi/src/apps/nbr/
 ** Version         : 0.0
 ** Status          : Unknown
 ** ---------------------------------------------------------------------- ** 
 ** DESCRIPTION: 
 ** 
 **    Undocumented.
 ** 
 ** ---------------------------------------------------------------------- ** 
 ** REVISIONS: 
 ** ---------------------------------------------------------------------- ** 
 ** CHANGES: 
 **------------------------------------------------------------------------**/

#ifndef  avg__already_included
#define  avg__already_included

/* ------------------------------------------------------------------
	 -Types:

   The [[AVG_NUM_POS_TIME_TYPE]] structure is used to keep ensemble definition
   data from different ensembles. These structures are grouped into the
   [[AVG_NPT_TYPE]], and can be filled with the [[set_avg_time]] function,
   using the codes defined for this purpose (see below).

   WARNING: the struture to store [[stop]] ensemble information is read from
            the values stored in the [[prev]] one (not the [[curr]], see the
            [[set_avg_time]] function). 
	 ------------------------------------------------------------------ */

typedef struct
{
	double yd;
	ULONG  hun;
} AVG_TIME_TYPE;

typedef struct
{
	USHORT         number;
	AVG_TIME_TYPE  time;
	DOUBLE_LL_TYPE pos;
} AVG_NUM_POS_TIME_TYPE;

typedef struct
{
	AVG_NUM_POS_TIME_TYPE  curr;
	AVG_NUM_POS_TIME_TYPE  prev;
	AVG_NUM_POS_TIME_TYPE  start;
	AVG_NUM_POS_TIME_TYPE  stop;
	AVG_NUM_POS_TIME_TYPE  db;
} AVG_NPT_TYPE;

/* ------------------------------------------------------------------
	 -Codes:
	 ------------------------------------------------------------------ */
#define CURRENT_NPT_CODE    0
#define PREVIOUS_NPT_CODE   1
#define START_NPT_CODE      2
#define STOP_NPT_CODE       3
#define DB_NPT_CODE         4

#define NORMAL_AVERAGE_CODE    1
#define FORCE_AVERAGE_CODE   	 2
#define LAST_AVERAGE_CODE      3
#define ABORT_AVERAGE_CODE    -1


#endif /* avg__already_included */
