DUNE: Uniform Navigational Environment  2.6.0-rc1
Sensors::Imagenex837B::Frame Class Reference

Detailed Description

Data logger to Imagenex .837 format.

Public Types

enum  HeaderIndices {
  HDR_IDX_N_TO_READ, HDR_IDX_TBYTES_HI, HDR_IDX_TBYTES_LO, HDR_IDX_BYTES_TO_READ_HI,
  HDR_IDX_BYTES_TO_READ_LO, HDR_IDX_DATE, HDR_IDX_TIME, HDR_IDX_TIME_HSEC,
  HDR_IDX_VIDEO_FRAME, HDR_IDX_DISPLAY_MODE, HDR_IDX_START_GAIN, HDR_IDX_PROFILE,
  HDR_IDX_PINGS_AVG, HDR_IDX_PULSE_LENGTH, HDR_IDX_SOUND_SPEED, HDR_IDX_LATITUDE,
  HDR_IDX_LONGITUDE, HDR_IDX_SPEED, HDR_IDX_COURSE, HDR_IDX_FREQUENCY,
  HDR_IDX_PITCH, HDR_IDX_ROLL, HDR_IDX_HEADING, HDR_IDX_REP_RATE,
  HDR_IDX_DISPLAY_GAIN, HDR_IDX_MILLI, HDR_IDX_MODE_I, HDR_IDX_MODE_UV,
  HDR_IDX_MODE_X, HDR_IDX_HEAD_ID, HDR_IDX_SERIAL_STATUS, HDR_IDX_PACKET_NUM,
  HDR_IDX_VERSION, HDR_IDX_RANGE, HDR_IDX_DATA_BYTES_HI, HDR_IDX_DATA_BYTES_LO
}
 
enum  FooterIndices {
  FTR_IDX_TYPE, FTR_IDX_PITCH, FTR_IDX_ROLL, FTR_IDX_HEADING,
  FTR_IDX_AZIMUTH_UP
}
 

Public Member Functions

 Frame (void)
 
uint8_t * getData (void)
 
uint8_t * getMessageData (void)
 
uint8_t * getFooterData (void)
 
unsigned getSize (void) const
 
uint32_t getMessageSize (void) const
 
uint32_t getFooterSize (void) const
 
void setTotalBytes (void)
 
void setBytesToRead (void)
 
void setStartGain (uint8_t gain)
 
void setRange (uint8_t range)
 
void setProfileTiltAngle (float angle)
 
void setPulseLength (uint8_t length)
 
void setSoundVelocity (float speed)
 
void setSpeed (float speed)
 
void setCourse (float course)
 
void setRoll (float roll)
 
void setPitch (float pitch)
 
void setHeading (float heading)
 
void setRepRate (uint16_t rate)
 
void setDisplayGain (uint8_t gain)
 
void setDisplayMode (bool xdcr)
 
void setGpsData (double lat, double lon)
 
void setDateTime (uint64_t now)
 
void setExtendedDataPoints (bool mode)
 
void setSerialStatus (uint8_t status)
 
void setFirmwareVersion (uint8_t version)
 

Member Enumeration Documentation

837 Footer Indices.

Enumerator
FTR_IDX_TYPE 
FTR_IDX_PITCH 
FTR_IDX_ROLL 
FTR_IDX_HEADING 
FTR_IDX_AZIMUTH_UP 

837 Header Indices.

Enumerator
HDR_IDX_N_TO_READ 
HDR_IDX_TBYTES_HI 
HDR_IDX_TBYTES_LO 
HDR_IDX_BYTES_TO_READ_HI 
HDR_IDX_BYTES_TO_READ_LO 
HDR_IDX_DATE 
HDR_IDX_TIME 
HDR_IDX_TIME_HSEC 
HDR_IDX_VIDEO_FRAME 
HDR_IDX_DISPLAY_MODE 
HDR_IDX_START_GAIN 
HDR_IDX_PROFILE 
HDR_IDX_PINGS_AVG 
HDR_IDX_PULSE_LENGTH 
HDR_IDX_SOUND_SPEED 
HDR_IDX_LATITUDE 
HDR_IDX_LONGITUDE 
HDR_IDX_SPEED 
HDR_IDX_COURSE 
HDR_IDX_FREQUENCY 
HDR_IDX_PITCH 
HDR_IDX_ROLL 
HDR_IDX_HEADING 
HDR_IDX_REP_RATE 
HDR_IDX_DISPLAY_GAIN 
HDR_IDX_MILLI 
HDR_IDX_MODE_I 
HDR_IDX_MODE_UV 
HDR_IDX_MODE_X 
HDR_IDX_HEAD_ID 
HDR_IDX_SERIAL_STATUS 
HDR_IDX_PACKET_NUM 
HDR_IDX_VERSION 
HDR_IDX_RANGE 
HDR_IDX_DATA_BYTES_HI 
HDR_IDX_DATA_BYTES_LO 

Constructor & Destructor Documentation

Sensors::Imagenex837B::Frame::Frame ( void  )
inline

Constructor.

Member Function Documentation

uint8_t* Sensors::Imagenex837B::Frame::getData ( void  )
inline
uint8_t* Sensors::Imagenex837B::Frame::getFooterData ( void  )
inline

Get footer start address.

Returns
pointer to address.

References getMessageSize().

Referenced by setHeading(), setPitch(), and setRoll().

uint32_t Sensors::Imagenex837B::Frame::getFooterSize ( void  ) const
inline

Retrieve footer size.

Returns
footer size.

Referenced by getSize().

uint8_t* Sensors::Imagenex837B::Frame::getMessageData ( void  )
inline

Get data start address.

Returns
pointer to address.

Referenced by Sensors::Imagenex837B::Task::ping().

uint32_t Sensors::Imagenex837B::Frame::getMessageSize ( void  ) const
inline

Retrieve message size.

Returns
message size.

Referenced by getFooterData(), and getSize().

unsigned Sensors::Imagenex837B::Frame::getSize ( void  ) const
inline

Retrieve the size of the frame.

Returns
frame size.

References getFooterSize(), and getMessageSize().

Referenced by Sensors::Imagenex837B::Task::handleSonarData().

void Sensors::Imagenex837B::Frame::setBytesToRead ( void  )
inline

Define number of bytes to read in header.

References HDR_IDX_BYTES_TO_READ_HI, and HDR_IDX_BYTES_TO_READ_LO.

Referenced by setExtendedDataPoints().

void Sensors::Imagenex837B::Frame::setCourse ( float  course)
inline

Set GNSS ships course.

Parameters
[in]coursecourse.

References getData(), and HDR_IDX_COURSE.

Referenced by Sensors::Imagenex837B::Task::updateState().

void Sensors::Imagenex837B::Frame::setDateTime ( uint64_t  now)
inline

Set frame date and time.

Parameters
[in]nowmillisecond since epoch.

References HDR_IDX_DATE, HDR_IDX_MILLI, HDR_IDX_TIME, and HDR_IDX_TIME_HSEC.

Referenced by Sensors::Imagenex837B::Task::handleSonarData().

void Sensors::Imagenex837B::Frame::setDisplayGain ( uint8_t  gain)
inline

Set display gain.

Parameters
[in]gaindisplay gain.

References HDR_IDX_DISPLAY_GAIN.

void Sensors::Imagenex837B::Frame::setDisplayMode ( bool  xdcr)
inline

Set display mode.

References HDR_IDX_DISPLAY_MODE.

Referenced by Sensors::Imagenex837B::Task::setNadirAngle().

void Sensors::Imagenex837B::Frame::setExtendedDataPoints ( bool  mode)
inline

Change mode according with data points.

References setBytesToRead(), and setTotalBytes().

Referenced by Sensors::Imagenex837B::Task::setDataPoints().

void Sensors::Imagenex837B::Frame::setFirmwareVersion ( uint8_t  version)
inline

Set Firmware version.

References HDR_IDX_VERSION.

Referenced by Sensors::Imagenex837B::Task::handleSonarData().

void Sensors::Imagenex837B::Frame::setGpsData ( double  lat,
double  lon 
)
inline

Define frame GPS data.

Parameters
[in]latlatitude.
[in]lonlongitude.

References DUNE::Math::Angles::degrees(), HDR_IDX_LATITUDE, HDR_IDX_LONGITUDE, and DUNE::Math::min().

Referenced by Sensors::Imagenex837B::Task::updateState().

void Sensors::Imagenex837B::Frame::setHeading ( float  heading)
inline

Set heading.

Parameters
[in]headingheading angle.

References FTR_IDX_HEADING, getData(), getFooterData(), and HDR_IDX_HEADING.

Referenced by Sensors::Imagenex837B::Task::updateState().

void Sensors::Imagenex837B::Frame::setPitch ( float  pitch)
inline

Set pitch.

Parameters
[in]pitchpitch angle.

References FTR_IDX_PITCH, getData(), getFooterData(), and HDR_IDX_PITCH.

Referenced by Sensors::Imagenex837B::Task::updateState().

void Sensors::Imagenex837B::Frame::setProfileTiltAngle ( float  angle)
inline

Set profile tilt angle.

Parameters
[in]angleprofile tilt angle.

References getData(), and HDR_IDX_PROFILE.

Referenced by Sensors::Imagenex837B::Task::onUpdateParameters().

void Sensors::Imagenex837B::Frame::setPulseLength ( uint8_t  length)
inline

Set pulse length.

Parameters
[in]lengthpulse length.

References HDR_IDX_PULSE_LENGTH.

Referenced by Sensors::Imagenex837B::Task::setRange().

void Sensors::Imagenex837B::Frame::setRange ( uint8_t  range)
inline

Set sonar range.

Parameters
[in]rangerange.

References HDR_IDX_RANGE.

Referenced by Sensors::Imagenex837B::Task::setRange().

void Sensors::Imagenex837B::Frame::setRepRate ( uint16_t  rate)
inline

Set repetition rate.

Parameters
[in]raterepetition rate.

References getData(), and HDR_IDX_REP_RATE.

Referenced by Sensors::Imagenex837B::Task::setRange().

void Sensors::Imagenex837B::Frame::setRoll ( float  roll)
inline

Set roll.

Parameters
[in]rollroll angle.

References FTR_IDX_ROLL, getData(), getFooterData(), and HDR_IDX_ROLL.

Referenced by Sensors::Imagenex837B::Task::updateState().

void Sensors::Imagenex837B::Frame::setSerialStatus ( uint8_t  status)
inline

Set serial status.

References HDR_IDX_SERIAL_STATUS.

Referenced by Sensors::Imagenex837B::Task::handleSonarData().

void Sensors::Imagenex837B::Frame::setSoundVelocity ( float  speed)
inline

Set sound velocity.

Parameters
[in]speedsound velocity

References getData(), and HDR_IDX_SOUND_SPEED.

Referenced by Sensors::Imagenex837B::Task::consume().

void Sensors::Imagenex837B::Frame::setSpeed ( float  speed)
inline

Set GNSS ships speed.

Parameters
[in]speedspeed.

References HDR_IDX_SPEED.

Referenced by Sensors::Imagenex837B::Task::updateState().

void Sensors::Imagenex837B::Frame::setStartGain ( uint8_t  gain)
inline

Set start gain.

Parameters
[in]gainstart gain.

References HDR_IDX_START_GAIN.

Referenced by Sensors::Imagenex837B::Task::setStartGain().

void Sensors::Imagenex837B::Frame::setTotalBytes ( void  )
inline

Define total bytes in header.

References HDR_IDX_TBYTES_HI, and HDR_IDX_TBYTES_LO.

Referenced by setExtendedDataPoints().

Collaboration diagram for Sensors::Imagenex837B::Frame:
Collaboration graph