/* ---------------------------------------------------------------------- */ 
/* SidescanDefs.h                                                         */ 
/* ---------------------------------------------------------------------- */ 
/*                                                                        */ 
/* (c) Copyright 1999  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.                             */ 
/*                                                                        */ 
/* ---------------------------------------------------------------------- */ 

#ifndef __SIDESCANDEFS_H__
#define __SIDESCANDEFS_H__


/* ---------------------------------------------------------------------- */ 
/* includes                                                               */ 
/* ---------------------------------------------------------------------- */ 

#include "SegyDefs.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                           */ 
  /*   1 = 2 shorts per sample  - stored as real(1), imag(1),             */ 
  /*   2 = 1 short  per sample  - before matched filter (raw)             */ 
  /*   3 = 1 short  per sample  - real part analytic signal               */ 
  /*   NOTE: For type = 1, the total number of bytes of data to follow is */ 
  /*   4 * samples.  For all other types the total bytes is 2 * samples.  */ 
  unsigned short int dataFormat;

  /*  38 -  39 : Reserved field to round up to a 32-bit word boundary     */ 
  unsigned short int 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;        


  /* -------------------------------------------------------------------- */ 
  /* Auxillary sensor information                                         */ 
  /* -------------------------------------------------------------------- */ 

  /*  54 -  55 : Compass heading (minutes)                                */ 
  short int heading;       

  /*  56 -  57 : Pitch (minutes)                                          */ 
  short int pitch;         

  /*  58 -  59 : Roll (minutes)                                           */ 
  short int roll;          

  /*  60 -  61 : Heave (centimeters)                                      */ 
  short int heave;   

  /*  62 -  63 : Yaw (minutes)                                            */ 
  short int yaw;   

  /*  64 -  67 : Vehicle depth (centimeters)                              */ 
  unsigned long int depth;   

  /*  68 -  69 : Temperature (degrees Celsius X 10)                       */ 
  short int temperature;   

  /*  70 -  79 : Reserved for future use                                  */ 
  char reserved2[10];   


  /* -------------------------------------------------------------------- */ 
  /* Data area begins here                                                */ 
  /* -------------------------------------------------------------------- */ 
  /* Data begins at byte 80.                                              */ 
  /* short int data[];                                                    */ 
  /* -------------------------------------------------------------------- */ 

} SidescanHeaderType;


/* ---------------------------------------------------------------------- */ 

#endif  /* end Not __SIDESCANDEFS_H__ */ 

/* ---------------------------------------------------------------------- */ 
/*                         end SidescanDefs.h                             */ 
/* ---------------------------------------------------------------------- */ 

