Index file format for RAW data files
A dedicated index file is created to improve the access to the individual ping data in the raw data file. This index file is used when you navigate forward or backwards in the file by means of the Replay bar. The file extension for the index file is .idx.
File structure
The index file contains a file header with a Configuration XML datagram, and a number of Index binary datagrams. There is one Index binary datagram for each transmission ("ping").
•  The Configuration XML datagram in the header is a copy of the Configuration XML datagram in the corresponding raw data file.
•  Each Index binary datagram contains key information about the ping, as well as a pointer (FileOffset) to the location of the ping data in the corresponding raw data file.
File structure:
•  Configuration XML datagram (The type is XML0.)
•  Index binary datagrams with FileOffset pointers (There is one for each transmission ("ping").):
1 Index binary datagram (The type is IDX0.)
2 Index binary datagram
3 Index binary datagram
...There is one for each transmission ("ping")....
Format
struct IndexFileDatagram
  {
  StructDatagramHeader DgHeader;
  ULONG PingNumber;
  double VesselDistance;
  double Latitude;
  double Longitude;
  DWORD FileOffset;
  };
The FileOffset pointer
When a raw file is opened, all datagrams up to the FileOffset for the first "ping" are read. The FileOffset for the first "ping" in the index file points to the first datagram after the file header in the raw data file. This can be any of the following datagrams since they may appear in different order in each "ping".
•  Sensor data and sample data for each channel and ping:
a Parameter XML datagram
b Sample binary datagram
c NMEA text datagram (Asynchronously)
d Annotation text (ASCII) datagram (Asynchronously)
e Motion binary datagram (Asynchronously)
The FileOffset pointer for ping "n" will point to the first datagram after the Sample binary datagram for ping "n-1". Consequently, for ping "n", you need the datagrams in the raw file between fileOffset in the Index binary datagram number "n" and fileOffset in the Index binary datagram number "n + 1". This may be the end of last ping file.
With this change, previous motion reference unit (MRU) and other data will be used for playback of ping "n", instead of the subsequent ones.
This will give the same result if you play back a single ping, or the ping is played back in a sequence of multiple pings. The Parameter XML datagram for ping "n" is always located before the Sample binary datagram, and will therefore always be included in the datagram you read from the raw data file.
The index files will start with XML0 / Version datagram, followed by a list of IDX0 datagrams. With multiple subsequent changes that all indicate that the file should be split, all within a second, you will lose the storage of ping data.
The time format for the files is 1 second resolution. If more files are required within the same second, the file will be overwritten and the last ping data will be stored in the file.