28class PCLR2SonicWCLoader;
168 const std::string &
sep=
" ",
280 std::string prefix=
"",
281 const std::string &
sep=
" ")
const;
436 std::string prefix=
"",
437 const std::string &
sep=
" ",
Project global and OS specific declarations.
#define MLPCLR2SonicWCLoader_EXPORT
DLL export macro definition.
Base class to implement raw data loaders which need byte swapping and basic file access on byte or ra...
ML Module class to load a point cloud from the Point Cloud Library from a file.
Class to read R2Sonic water column sonar data.
A structure describing the A1 section of a WaterColumn data package containing float beam angles,...
MLuint64 read(ByteDataReader &reader, MLuint64 &fileReadPos, size_t numH0Beams)
Read section from a file with help of ByteDataReader reader and increase fileReadPos appropriately.
std::string getAsString(std::string prefix, const std::string &sep=" ", const MLint maxBeams=-1) const
See WaterColumnDataSet.getAsString for documentation.
std::vector< MLfloat > A1_BeamAngle
size=[H0_Beams]; [radians] angle of beam relative to array centerline, ordered from port to starboard...
void reset() override
Resets all members to construction state.
~WaterColumnA1() override
Default destructor.
std::string getSectionName() const override
Get name of section as std::string.
MLuint16 A1_SectionSize
[bytes] size of this entire section
WaterColumnA1()
Default constructor.
MLuint16 A1_SectionName
'A1'
Class managing all sections belonging to the same ping.
virtual ~WaterColumnDataSetPing()
Default destructor.
MLuint32 pingNumber
The number of the ping the sections belong to.
WaterColumnDataSetPing()
Default constructor.
virtual void reset()
Resets all members to construction state.
const WaterColumnH0 * h0Section
Pointer to H0 section for the ping.
const WaterColumnA1 * a1Section
Pointer to A1 section for the ping.
std::list< const WaterColumnM1OrM2 * > mSectionPointers
List of M sections belonging to the ping (unsorted).
bool isValid() const
Returns true if the ping data structure contain all what is needed for a full and valid ping.
const WaterColumnPacket * wcd0Section
Pointer to WCD0 section for the ping.
Class describing the common data header of a WaterColumn data package.
std::string mostRecentSectionIntro
The first two chars of the most recently read section or "" otherwise.
WaterColumnSectionBase * mostRecentSection
Set most recently read section or nullptr otherwise.
WaterColumnM1OrM2 * firstM1Section
Set to the first found M1 section, nullptr otherwise.
WaterColumnA1 * firstA1Section
Set to the first found A1 section, nullptr otherwise.
std::string unknownSection
Intro of first found unknown section.
size_t numH0Sections
Set to number of found H0 sections after initialization, otherwise 0.
size_t numM1Sections
Set to number of found M1 sections after initialization, otherwise 0.
std::map< MLuint32, WaterColumnDataSetPing > validPingSections
The subset of pings of allPingSections which contains only those ones where WCD0, H0,...
size_t numA1Sections
Set to number of found A1 sections after initialization, otherwise 0.
WaterColumnM1OrM2 * firstMxSection
Set to the first found M1 or M2 section, nullptr otherwise.
std::map< MLuint32, WaterColumnDataSetPing > allPingSections
A map allowing the direct access to all sections belonging to a specific ping number.
size_t numWCD0Sections
Set to number of found WCD0 sections after initialization, otherwise 0.
WaterColumnPacket * firstWaterColumnPacket
Set to the first found waterColumnPacket, nullptr otherwise.
size_t numM2Sections
Set to number of found M2 sections after initialization, otherwise 0.
size_t numUnknownSections
Set to number of found unknown sections after initialization, otherwise 0.
WaterColumnH0 * firstH0Section
Set to the first found H0 section, nullptr otherwise.
std::vector< MLuint32 > allPingNumbers
An array containing all ping numbers found in file, and sorted.
MLuint64 getWorkingMemoryHint() const
Set working memory hints in bytes.
size_t numValidPingNumbers
Set to the number of different ping numbers in file which have valid H0, A1, WCD0,...
virtual void reset()
Resets all members to construction state.
void setWorkingMemoryHint(MLuint64 numBytes)
Set working memory hints in bytes.
WaterColumnM1OrM2 * firstM2Section
Set to the first found M2 section, nullptr otherwise.
MLuint64 read(R2SonicWCLoader &reader, MLuint64 &fileReadPos, PCLR2SonicWCLoader &updateObject)
Read all data section from a file with help of ByteDataReader reader and increase fileReadPos appropr...
size_t numOrphanedMSections
Set to number of found M sections where no WCD0, H0 or A1 section is found, otherwise 0.
std::string getAsString(const MLint maxSections=-1, const MLint maxBeams=-1, const MLint maxSamplesPerBeam=-1, std::string prefix="", const std::string &sep=" ", const bool showFirstOfEachPacketTypeOnly=false) const
Convert content to a human readable string with the prefix prefix before all lines and separator sep ...
virtual ~WaterColumnDataSet()
Default destructor.
MLuint64 _workingMemoryHint
Working memory hint in bytes.
WaterColumnDataSet()
Default constructor.
size_t numSamplesInFile
Set to number of samples in entire file, otherwise 0.
size_t numTotalPingNumbers
Set to the number of different ping numbers in file including those which have missing or invalid H0,...
std::list< WaterColumnSectionBase * > sectionList
List of all packets, must be deallocated.
bool isValid() const
Returns true if the file looks valid, otherwise false.
A structure describing the H0 section of a WaterColumn data package (only one per ping).
MLfloat H0_RxSampleRate
[hertz] sample rate of data acquisition and signal processing
MLuint32 H0_PingNumber
pings since power-up or reboot
MLuint16 H0_TxMiscInfo
reserved for future use
MLfloat H0_RxBandwidth
[hertz]
MLfloat H0_TxSteeringHoriz
[radians]
std::string getAsString(std::string prefix) const
See WaterColumnDataSet.getAsString for documentation.
std::string getSectionName() const override
Get name of section as std::string.
MLfloat H0_RxMountTilt
[radians]
MLfloat H0_RxAbsorption
[dB per kilometer]
MLint16 H0_VTX_Plus_Offset
[hundredths of a dB] transmit voltage offset at time of ping (divide value by 100 to get dB)
MLfloat H0_TxPower
[dB re 1 uPa at 1 meter]
MLfloat H0_TxSteeringVert
[radians]
MLuint32 H0_RxMiscInfo
reserved for future use
MLfloat H0_PingPeriod
[seconds] time between most recent two pings
MLfloat H0_TxBeamwidthHoriz
[radians]
MLuint16 H0_SectionSize
[bytes] size of this entire section
MLuint16 H0_SectionName
'H0'
MLuint16 H0_reserved
reserved for future use
MLfloat H0_RxSpreading
[dB (times log range in meters)]
MLuint32 H0_TimeSeconds
[seconds] ping time relative to 0000 hours 1-Jan-1970, integer part
~WaterColumnH0() override
Default destructor.
MLfloat H0_TxPulseWidth
[seconds]
MLfloat H0_Frequency
[hertz] sonar center frequency
MLfloat H0_RxRange
[meters] sonar range setting
WaterColumnH0()
Default constructor.
MLuint32 H0_TimeNanoseconds
[nanoseconds] ping time relative to 0000 hours 1-Jan-1970, fraction part
std::string getModelNumber() const
Get model number as std::string.
MLuint64 read(ByteDataReader &reader, MLuint64 &fileReadPos)
Read section from a file with help of ByteDataReader reader and increase fileReadPos appropriately.
std::string getSerialNumber() const
Get serial number as std::string.
MLfloat H0_RxGain
[multiply by two for relative dB]
MLfloat H0_SoundSpeed
[meters per second]
MLfloat H0_TxBeamwidthVert
[radians]
MLuint16 H0_Beams
number of beams
void reset() override
Resets all members to construction state.
A structure describing the common data header of an M1_Data and an M2_Data section of a WaterColumn d...
virtual std::string getSectionName() const
Get name of section as std::string.
MLuint16 M1OrM2_SectionSize
[bytes] size of this entire section
std::string getAsString(std::string prefix) const
See WaterColumnDataSet.getAsString for documentation.
MLuint16 M1OrM2_TotalBeams
beams (always a multiple of 2) (typically columns in your memory buffer)
MLuint32 M1OrM2_TotalSamples
range samples in entire ping, sample rate is H0_RxSampleRate
MLuint32 M1OrM2_reserved0
reserved for future use
MLuint16 M1OrM2_Samples
number of samples in this section
MLuint32 M1OrM2_PingNumber
pings since power-up or reboot
MLuint16 M1OrM2_Beams
number of beams in this section (always a multiple of 2)
virtual ~WaterColumnM1AndM2Header()
Default destructor.
MLuint64 read(ByteDataReader &reader, MLuint64 &fileReadPos)
Read section from a file with help of ByteDataReader reader and increase fileReadPos appropriately.
MLuint32 M1OrM2_reserved1
reserved for future use
MLuint16 M1OrM2_FirstBeam
first beam of this section (always a multiple of 2)
MLfloat M1OrM2_ScalingFactor
reserved for future use
virtual void reset()
Resets all members to construction state.
WaterColumnM1AndM2Header()
Default constructor.
MLuint32 M1OrM2_FirstSample
first sample of this section
MLuint16 M1OrM2_SectionName
'M1' or 'M2'.
A structure describing the common data header of an M1_Data and an M2_Data section of a WaterColumn d...
MLuint64 read(R2SonicWCLoader &reader, MLuint64 &fileReadPos)
Read section from a file with help of ByteDataReader reader and increase fileReadPos appropriately.
MLuint64 fileDataReadPos
Location of M1/M2 data in file.
void mapMxSectionData() const
Actually load the M1/M2 section data.
void reset() override
Resets all members to construction state.
std::vector< MLuint16 > magnitudeData
Values 0 to 65535 map non-linearly (due to TVG scaling and possible gain compression) to signal ampli...
WaterColumnM1OrM2()
Default constructor.
std::vector< DoubleMLint16 > magnitudePhaseData
Magnitude and phase data (typical example: 256 beams each containing 36 four-byte structs,...
std::string getSectionName() const override
Get name of section as std::string.
std::string getAsString(const MLint maxBeams=-1, const MLint maxSamplesPerBeam=-1, std::string prefix="", const std::string &sep=" ") const
See WaterColumnDataSet.getAsString for documentation.
void clearMxSectionData() const
Unload magnitude and/or phase data from arrays and really try to unmap the array memory.
R2SonicWCLoader * _reader
Pointer to the reader which loaded this file; it must (and must be valid during entire life time) to ...
void unmapMxSectionDataHint() const
If memory saving mode is enabled then unload magnitude and/or phase data from arrays; may be ignored ...
WaterColumnM1AndM2Header m1OrM2CommonHeader
Common part of M1 and M2 section data.
bool saveMemory
Flag to indicate whether memory save mode is enabled or not.
~WaterColumnM1OrM2() override
Default destructor.
Class describing a introducing data packet of a WaterColumn data package.
MLuint32 PacketSize
[bytes] size of this entire packet
std::string getAsString(std::string prefix="") const
See WaterColumnDataSet.getAsString for documentation.
~WaterColumnPacket() override
Default destructor.
std::string getSectionName() const override
Get name of section as std::string.
void reset() override
Resets all members to construction state.
MLuint32 DataStreamID
reserved for future use
MLuint64 read(ByteDataReader &reader, MLuint64 &fileReadPos)
Read section from a file with help of ByteDataReader reader and increase fileReadPos appropriately.
MLuint32 PacketName
'WCD0'
WaterColumnPacket()
Default constructor.
A base class for all WaterColumn section formats.
MLuint16 sectionName
'WC', 'H0', 'A1', 'M1', 'M2'
virtual ~WaterColumnSectionBase()
Default destructor.
virtual std::string getSectionName() const =0
Get name of section as std::string.
MLuint64 posInFile
Location of section in file.
WaterColumnSectionBase()
Default constructor.
virtual void reset()
Set all members to 0.
Basic binary data loader class.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
UINT64 MLuint64
Introduce platform independent 64 bit unsigned integer type.
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
MLPCLR2SonicWCLoader_EXPORT std::string convertBytesToReadableString(const char *chars, size_t numChars, bool revert)
Read a n-byte string reversely from memory into a human readable string or an empty string on nullptr...
Vector entry for storage for data from M2 sections.
MLint16 phase
Phase component.
MLuint16 magnitude
Magnitude component.