/* ---------------------------------------------------------------------- */ 
/* SidescanDefs.h                                                         */ 
/* ---------------------------------------------------------------------- */ 
/*                                                                        */ 
/* (c) Copyright 1999 - 2002, 2007, 2008, 2010, 2011  EdgeTech,           */ 
/*                                                                        */ 
/* This file contains proprietary information, and trade secrets of       */ 
/* EdgeTech, and may not be disclosed or reproduced without the prior     */ 
/* written consent of EdgeTech.                                           */ 
/*                                                                        */ 
/* EdgeTech is not responsible for the consequences of the use or misuse  */ 
/* of this software, even if they result from defects in it.              */ 
/*                                                                        */ 
/* ---------------------------------------------------------------------- */ 
/*                                                                        */ 
/* EdgeTech sidescan data format description.                             */ 
/*                                                                        */ 
/* This format is no longer used.                                         */ 
/*                                                                        */ 
/* ---------------------------------------------------------------------- */ 

#ifndef __SIDESCANDEFS_H__
#define __SIDESCANDEFS_H__


/* ---------------------------------------------------------------------- */ 
/* Each record of data has a 80 byte header.  The content of which is     */ 
/* defined below.                                                         */ 
/*                                                                        */ 
/* Unused fields should be set to 0                                       */ 
/* ---------------------------------------------------------------------- */ 

typedef struct 
{
  /*   0 -   1 : Subsystem (0 .. n)                                       */ 
  unsigned short int subsystem;    
  
  /*   2 -   3 : Channel Number (0 .. n)                                  */ 
  unsigned short int channelNum;     

  /*   4 -   7 : Ping number (increments with ping)                       */ 
  unsigned long int  pingNum;        

  /*   8 -   9 : Packet number (1..n) Each ping starts with packet 1      */ 
  unsigned short int packetNum;     

  /*  10 -  11 : TriggerSource (0 = internal, 1 = external)               */ 
  unsigned short int trigSource;    

  /*  12 -  15 : Samples in this packet                                   */ 
  unsigned long int  samples;       

  /*  16 -  19 : Sample interval in ns of stored data                     */ 
  unsigned long int  sampleInterval;

  /*  20 -  23 : starting Depth (window offset) in samples                */ 
  unsigned long int  startDepth;       

  /*  24 -  25 : -- defined as 2 -N volts for lsb                         */ 
  short int          weightingFactor;

  /*  26 -  27 : Gain factor of ADC                                       */ 
  unsigned short int ADCGain;       

  /*  28 -  29 : Maximum absolute value for ADC samples for this packet   */ 
  unsigned short int ADCMax;        

  /*  30 -  31 : Range Setting (meters X 10)                              */ 
  unsigned short int rangeSetting;    
    
  /*  32 -  33 : Unique pulse identifier                                  */ 
  unsigned short int pulseID;

  /*  34 -  35 : Mark Number (0 = no mark)                                */ 
  unsigned short int markNumber;    

  /*  36 -  37 : Data format                                              */ 
  /*   0 = 1 short  per sample  - envelope data                           */ 
  /* the total number of bytes of data to follow is  2 * samples.         */ 
  /*   1 = 2 shorts per sample  - stored as real(1), imag(1),             */ 
  /* the total number of bytes of data to follow is  4 * samples.         */ 
  /*   2 = 1 short  per sample  - before matched filter (raw)             */ 
  /* the total number of bytes of data to follow is  2 * samples.         */ 
  /*   3 = 1 short  per sample  - real part analytic signal               */ 
  /* the total number of bytes of data to follow is  2 * samples.         */ 
  /*   4 = 1 short  per sample  - pixel data / ceros data                 */ 
  /* the total number of bytes of data to follow is  2 * samples.         */ 
  /*   5 = 1 byte   per sample  - pixel data                              */ 
  /* the total number of bytes of data to follow is  1 * samples.         */ 
  /*   6 = 1 long   per sample  - raw data                                */ 
  /* the total number of bytes of data to follow is  4 * samples.         */ 
  /*   7 = 2 floats per sample  - stored as real(1), imag(1),             */ 
  /* the total number of bytes of data to follow is  8 * samples.         */ 
  /*   8 = 1 float  per sample  - envelope data                           */ 
  /* the total number of bytes of data to follow is  4 * samples.         */ 
  /* -----                                                                */ 
  /* NOTE: Values greater than 255 indicate that the data to follow is    */ 
  /* compressed and must be decompressed prior to use via the             */ 
  /* decompressiondll or other means.                                     */ 
  unsigned short int dataFormat;

  /*  38 -  38 : number of pulses in the water                            */ 
  unsigned char      numPulses;    

  /*  39 -  39 : Reserved field to round up to a 32-bit word boundary     */ 
  unsigned char      reserved;    
  

  /* -------------------------------------------------------------------- */ 
  /* computer date / time data acquired                                   */ 
  /* -------------------------------------------------------------------- */ 

  /*  40 -  43 : Millieconds today                                        */ 
  unsigned long int  millisecondsToday;

  /*  44 -  45 : Year                                                     */ 
  short int          year;          

  /*  46 -  47 : Day of year (1 - 366)                                    */ 
  unsigned short int day;           

  /*  48 -  49 : Hour of day (0 - 23)                                     */ 
  unsigned short int hour;          

  /*  50 -  51 : Minute (0 - 59)                                          */ 
  unsigned short int minute;        

  /*  52 -  53 : Second (0 - 59)                                          */ 
  unsigned short int second;        


  /* -------------------------------------------------------------------- */ 
  /* Auxiliary sensor information                                         */ 
  /* -------------------------------------------------------------------- */ 

  /*  54 -  55 : Compass heading (minutes)                                */ 
  unsigned short int heading;       

  /*  56 -  57 : Pitch (minutes) - bow up is positive                     */ 
  short int          pitch;         

  /*  58 -  59 : Roll (minutes)  - port up is positive                    */ 
  short int          roll;          

  /*  60 -  61 : Heave (centimeters)                                      */ 
  short int          heave;   

  /*  62 -  63 : Yaw (minutes)                                            */ 
  short int          yaw;   

  /*  64 - 67  : Pressure in PSI * 1000                                   */ 
  unsigned long int  pressure;

  /*  68 -  69 : Temperature (degrees Celsius X 10)                       */ 
  short int          temperature;   

  /*  70 -  71 : Water Temperature (10 * degrees C)                       */ 
  short int          waterTemperature;

  /*  72 -  75 : Altitude in mm (or -1 if no valid reading                */ 
  long               altitude;

  /*  76 -  79 : Reserved for future use                                  */ 
  char               reserved3[4];   

  /* -------------------------------------------------------------------- */ 
  /* Data area begins here                                                */ 
  /* -------------------------------------------------------------------- */ 
  /* Data begins at byte 80.                                              */ 
  /* short int data[];                                                    */ 
  /* -------------------------------------------------------------------- */ 

} SidescanHeaderType;


/* ---------------------------------------------------------------------- */ 

#endif  /* end Not __SIDESCANDEFS_H__ */ 


/* ---------------------------------------------------------------------- */ 
/*                         end SidescanDefs.h                             */ 
/* ---------------------------------------------------------------------- */ 

