
/*

   FILE:  initadcp.c

	  Routines for initializing the fields of the adcp.h structures.
	  Values have been selected for consistency with loadping.

*/
#include <common.h>
#include <adcp.h>

#if PROTOTYPE_ALLOWED
void init_ancil1(ANCILLARY_1_TYPE *a)
#else
void init_ancil1(a)
   ANCILLARY_1_TYPE *a;
#endif
{
   a->tr_temp = a->snd_spd_used = a->best_snd_spd = a->mn_heading = BADFLOAT;
   a->pgs_sample = a->anc6 = a->anc7 = a->anc8 = a->anc9 = a->anc10 = BADSHORT;
}

#if PROTOTYPE_ALLOWED
void init_ancil2(ANCILLARY_2_TYPE *a)
#else
void init_ancil2(a)
   ANCILLARY_2_TYPE *a;
#endif
{
   a->watrk_hd_misalign = a->botrk_hd_misalign = 
      a->pit_misalign = a->rol_misalign = 0.0;
   a->watrk_scale_factor = a->botrk_scale_factor = 1.0;
   a->unused1 = 
      a->last_temp = a->last_heading = a->last_pitch = a->last_roll = 
      a->mn_pitch = a->mn_roll = 
      a->std_temp = a->std_heading = a->std_pitch = a->std_roll = BADFLOAT;
   a->ocean_depth = a->max_amp_bin = 
      a->anc21 = a->anc22 = a->anc23 = BADSHORT;
   /* a->last_good_bin must be set to conf.num_bins in fill_ancil2 */
}

#if PROTOTYPE_ALLOWED
void init_access_var(ACCESS_VARIABLES_TYPE *acc)
#else
void init_access_var(acc)
   ACCESS_VARIABLES_TYPE *acc;
#endif
{
   acc->first_good_bin = 1;
   acc->U_ship_absolute = acc->V_ship_absolute = BADFLOAT;
   acc->user_flag_1 = acc->user_flag_2 = acc->user_flag_3 = acc->user_flag_4 = BADSHORT;
   /* acc->last_good_bin must be set to conf.num_bins elsewhere, prior to DBADD */
}
