41 #define _MDP_STANDALONE 42 #define _DATUM_DEFINED 83 char* pPI = (
char*)(&(dgm->partition.
dgmNum));
92 char *pSOD = (
char*)dgm;
135 char* pPI = (
char*)(&(dgm->partition.
dgmNum));
153 char *pSOD = (
char*)dgm;
196 char* pPI = (
char*)(&(dgm->partition.
dgmNum));
213 pch += (nBytesTx * numTxSectors);
219 char *pSOD = (
char*)dgm;
262 char* pPI = (
char*)(&(dgm->partition.
dgmNum));
279 pch += (nBytesTx * numTxSectors);
292 char *pSOD = (
char*)dgm;
306 static void help(
char* progname)
308 cout <<
"\n\nUsage: " << progname <<
"\n";
309 cout <<
" -h (gives this help)\n";
310 cout <<
" -f <filename>\n";
313 int main(
int argc,
char *argv[])
316 bool helpNeeded =
false;
321 if (argc == 1) helpNeeded =
true;
322 string h = string(
"-h");
323 string f = string(
"-f");
324 for (
int i = 1; i < argc; i++)
326 if (h.compare(
string(argv[i])) == 0)
331 if (f.compare(argv[i]) == 0)
339 filename.assign(argv[i]);
340 ifstream fexists(filename);
341 if (fexists.good() ==
false)
343 cout <<
"Filename " << filename <<
" does not exist.\n";
356 cout <<
"Filename: " << filename <<
"\n";
361 ifstream kmall(filename, ios::in | ios::binary);
365 memset(&mrz, 0,
sizeof(mrz));
366 memset(&header, 0,
sizeof(header));
368 kmall.read((
char*)&header,
sizeof(header));
369 if (kmall.gcount() !=
sizeof(header))
374 if (header.dgmType[0] ==
'#' && header.dgmType[1] ==
'M' && header.dgmType[2] ==
'R' && header.dgmType[3] ==
'Z')
378 memcpy(p, (
char*)&header,
sizeof(header));
381 kmall.read(p, header.numBytesDgm -
sizeof(header));
382 if (kmall.gcount() != header.numBytesDgm -
sizeof(header))
387 tmptime = header.time_sec;
389 tmptime += (header.time_nanosec / 1000000);
394 char* pData = (
char*)(&(depths->sectorInfo[depths->pingInfo.
numTxSectors]));
395 unsigned short numExtraDet = ((
pEMdgmMRZ_rxInfo)(pData))->numExtraDetectionClasses;
406 double dlat = (depthList + i)->deltaLatitude_deg;
407 double dlon = (depthList + i)->deltaLongitude_deg;
408 double depthRefPoint = (depthList + i)->z_reRefPoint_m;
409 double lat = blat + dlat;
410 double lon = blon + dlon;
412 cout << std::fixed << std::setprecision(8) << lat <<
" ";
413 cout << std::fixed << std::setprecision(8) << lon <<
" ";
414 cout << std::fixed << std::setprecision(2) << depthReWaterline <<
" ";
415 cout << tmptime <<
"\n";
420 kmall.seekg(header.numBytesDgm -
sizeof(header), ios::cur);
#MRZ - sector information.
char * getMRZRxInfo(void *tgm)
uint16_t numBytesInfoData
float z_waterLevelReRefPoint_m
#MRZ - Multibeam Raw Range and Depth datagram. The datagram also contains seabed image data...
char * getMRZSectorInfo(void *tgm)
#MRZ - Data for each sounding, e.g. XYZ, reflectivity, two way travel time etc.
uint16_t numSoundingsMaxMain
uint16_t numExtraDetectionClasses
uint16_t numBytesPerTxSector
#MRZ - ping info. Information on vessel/system level, i.e. information common to all beams in the cur...
char * getMRZSoundings(void *tgm)
#MRZ - receiver specific information.
char * getMRZPingInfo(void *tgm)