The mid-level file communication class.
The class uses CMT level 1, but does not inherit from it. If software needs to access the level 1 component, it needs to be done through the getCmt1f() function.
#include <xSens_MT3/cmt2.h>
Public Member Functions | |
Cmt2f () | |
Default constructor. More... | |
~Cmt2f () | |
Destructor. More... | |
XsensResultValue | close (void) |
Close the file. More... | |
XsensResultValue | closeAndDelete (void) |
Close the file and delete it. More... | |
XsensResultValue | create (const char *filename) |
Create a new file with level 2 header. More... | |
XsensResultValue | create (const wchar_t *filename) |
Create a new file with level 2 header. More... | |
Cmt1f * | getCmt1f (void) |
Get a reference to the embedded Cmt1f object. More... | |
XsensResultValue | getLastResult (void) const |
Return the error code of the last operation. More... | |
XsensResultValue | getName (char *filename) const |
Retrieve the filename that was last successfully opened. More... | |
XsensResultValue | getName (wchar_t *filename) const |
Retrieve the filename that was last successfully opened. More... | |
bool | isOpen (void) const |
Return whether the file is open or not. More... | |
XsensResultValue | open (const char *filename, const bool readOnly=false) |
Open a file and read the header. More... | |
XsensResultValue | open (const wchar_t *filename, const bool readOnly=false) |
Open a file and read the header. More... | |
XsensResultValue | readMessage (Message *msg, const uint8_t msgId=0) |
Read the next message from the file, when msgId is non-zero, the first matching message will be returned. More... | |
CmtFilePos | getFileSize (void) |
Get the current file size. More... | |
CmtFilePos | getReadPosition (void) |
Get the current read position. More... | |
XsensResultValue | setReadPosition (CmtFilePos pos) |
Set the read position to the given position. More... | |
XsensResultValue | writeMessage (const Message *msg) |
Write a message to the end of the file. More... | |
Protected Attributes | |
Cmt1f | m_cmt1f |
The Cmt1f object that is used for the low-level operations. More... | |
XsensResultValue | m_lastResult |
The last result of an operation. More... | |
bool | m_readOnly |
When set to true, the file is read-only and attempts to write to it will fail. More... | |
Private Member Functions | |
Cmt2f (const Cmt2f &ref) | |
This object cannot be copied, so this function is not implemented. More... | |
|
private |
This object cannot be copied, so this function is not implemented.
xsens::Cmt2f::Cmt2f | ( | ) |
Default constructor.
Definition at line 586 of file cmt2.cpp.
References m_lastResult, m_readOnly, and XRV_OK.
XsensResultValue xsens::Cmt2f::close | ( | void | ) |
Close the file.
Definition at line 601 of file cmt2.cpp.
References xsens::Cmt1f::close(), xsens::Cmt1f::isOpen(), m_cmt1f, m_lastResult, m_readOnly, XRV_NOFILEOPEN, and XRV_OK.
Referenced by xsens::Cmt3::closeLogFile(), xsens::Cmt3::openLogFile(), ~Cmt2f(), and xsens::Cmt3::~Cmt3().
XsensResultValue xsens::Cmt2f::closeAndDelete | ( | void | ) |
Close the file and delete it.
Definition at line 615 of file cmt2.cpp.
References xsens::Cmt1f::closeAndDelete(), xsens::Cmt1f::isOpen(), m_cmt1f, m_lastResult, m_readOnly, XRV_NOFILEOPEN, and XRV_OK.
Referenced by xsens::Cmt3::closeLogFile(), and xsens::Cmt3::createLogFile().
XsensResultValue xsens::Cmt2f::create | ( | const char * | filename | ) |
Create a new file with level 2 header.
Definition at line 628 of file cmt2.cpp.
References xsens::Cmt1f::close(), xsens::Cmt1f::create(), xsens::Cmt1f::deleteData(), xsens::Cmt1f::isOpen(), m_cmt1f, m_lastResult, m_readOnly, xsens::Cmt1f::writeData(), XRV_ALREADYOPEN, and XRV_OK.
Referenced by xsens::Cmt3::createLogFile().
XsensResultValue xsens::Cmt2f::create | ( | const wchar_t * | filename | ) |
Create a new file with level 2 header.
Definition at line 651 of file cmt2.cpp.
References xsens::Cmt1f::close(), xsens::Cmt1f::create(), xsens::Cmt1f::deleteData(), xsens::Cmt1f::isOpen(), m_cmt1f, m_lastResult, m_readOnly, xsens::Cmt1f::writeData(), XRV_ALREADYOPEN, and XRV_OK.
CmtFilePos xsens::Cmt2f::getFileSize | ( | void | ) |
Get the current file size.
Definition at line 808 of file cmt2.cpp.
References xsens::Cmt1f::getFileSize(), and m_cmt1f.
Referenced by xsens::Cmt3::getLogFileSize().
XsensResultValue xsens::Cmt2f::getLastResult | ( | void | ) | const |
Return the error code of the last operation.
Definition at line 680 of file cmt2.cpp.
References m_lastResult.
XsensResultValue xsens::Cmt2f::getName | ( | char * | filename | ) | const |
Retrieve the filename that was last successfully opened.
Definition at line 687 of file cmt2.cpp.
References xsens::Cmt1f::getName(), m_cmt1f, and m_lastResult.
Referenced by xsens::Cmt3::getLogFileName(), and xsens::Cmt3::isLogFileOpen().
XsensResultValue xsens::Cmt2f::getName | ( | wchar_t * | filename | ) | const |
Retrieve the filename that was last successfully opened.
Definition at line 694 of file cmt2.cpp.
References xsens::Cmt1f::getName(), m_cmt1f, and m_lastResult.
CmtFilePos xsens::Cmt2f::getReadPosition | ( | void | ) |
Get the current read position.
Definition at line 815 of file cmt2.cpp.
References xsens::Cmt1f::getReadPos(), and m_cmt1f.
Referenced by xsens::Cmt3::getLogFileReadPosition(), and xsens::Cmt3::peekLogMessageId().
bool xsens::Cmt2f::isOpen | ( | void | ) | const |
Return whether the file is open or not.
Definition at line 701 of file cmt2.cpp.
References xsens::Cmt1f::isOpen(), and m_cmt1f.
Referenced by xsens::Cmt3::closeLogFile(), xsens::Cmt3::closePort(), xsens::Cmt3::createLogFile(), xsens::Cmt3::getConfiguration(), xsens::Cmt3::getDeviceCount(), xsens::Cmt3::getEMtsData(), xsens::Cmt3::getLogFileName(), xsens::Cmt3::getLogFileReadPosition(), xsens::Cmt3::getLogFileSize(), xsens::Cmt3::getMasterId(), xsens::Cmt3::getMtCount(), xsens::Cmt3::isLogFileOpen(), xsens::Cmt3::openLogFile(), xsens::Cmt3::openPort(), xsens::Cmt3::refreshCache(), xsens::Cmt3::setDataSource(), xsens::Cmt3::setLogMode(), and xsens::Cmt3::writeMessageToLogFile().
XsensResultValue xsens::Cmt2f::open | ( | const char * | filename, |
const bool | readOnly = false |
||
) |
Open a file and read the header.
Definition at line 708 of file cmt2.cpp.
References xsens::Cmt1f::isOpen(), m_cmt1f, m_lastResult, m_readOnly, xsens::Cmt1f::open(), and XRV_ALREADYOPEN.
Referenced by xsens::Cmt3::openLogFile().
XsensResultValue xsens::Cmt2f::open | ( | const wchar_t * | filename, |
const bool | readOnly = false |
||
) |
Open a file and read the header.
Definition at line 719 of file cmt2.cpp.
References xsens::Cmt1f::isOpen(), m_cmt1f, m_lastResult, m_readOnly, xsens::Cmt1f::open(), and XRV_ALREADYOPEN.
XsensResultValue xsens::Cmt2f::readMessage | ( | Message * | msg, |
const uint8_t | msgId = 0 |
||
) |
Read the next message from the file, when msgId is non-zero, the first matching message will be returned.
Definition at line 730 of file cmt2.cpp.
References xsens::Message::clear(), CMT_EXTLENCODE, CMT_LEN_MSGEXTHEADERCS, CMT_LEN_MSGHEADERCS, CMT_MAXDATALEN, CMT_MAXMSGLEN, CMT_PREAMBLE, xsens::Cmt1f::find(), xsens::Message::getMessageId(), xsens::Message::loadFromString(), m_cmt1f, xsens::MessageHeader::m_datlen, xsens::MessageHeader::_mdl::m_extended, xsens::MessageHeader::_mdl::_mextd::_mlen::m_high, m_lastResult, xsens::MessageHeader::m_length, xsens::MessageHeader::_mdl::_mextd::m_length, xsens::MessageHeader::_mdl::_mextd::_mlen::m_low, xsens::Cmt1f::readData(), xsens::Cmt1f::setReadPos(), and XRV_OK.
Referenced by xsens::Cmt3::getEMtsData(), xsens::Cmt3::peekLogMessageId(), xsens::Cmt3::readDataPacket(), and xsens::Cmt3::refreshCache().
XsensResultValue xsens::Cmt2f::setReadPosition | ( | CmtFilePos | pos | ) |
Set the read position to the given position.
Definition at line 822 of file cmt2.cpp.
References m_cmt1f, m_lastResult, and xsens::Cmt1f::setReadPos().
Referenced by xsens::Cmt3::peekLogMessageId(), and xsens::Cmt3::resetLogFileReadPos().
XsensResultValue xsens::Cmt2f::writeMessage | ( | const Message * | msg | ) |
Write a message to the end of the file.
Definition at line 829 of file cmt2.cpp.
References xsens::Cmt1f::appendData(), xsens::Message::getMessageStart(), xsens::Message::getTotalMessageSize(), m_cmt1f, m_lastResult, m_readOnly, and XRV_READONLY.
Referenced by xsens::Cmt3::getEMtsData(), xsens::Cmt3::getSyncInMode(), xsens::Cmt3::getSyncInOffset(), xsens::Cmt3::getSyncInSettings(), xsens::Cmt3::getSyncInSkipFactor(), xsens::Cmt3::getSyncOutMode(), xsens::Cmt3::getSyncOutOffset(), xsens::Cmt3::getSyncOutPulseWidth(), xsens::Cmt3::getSyncOutSettings(), xsens::Cmt3::getSyncOutSkipFactor(), xsens::Cmt3::gotoConfig(), xsens::Cmt3::gotoMeasurement(), xsens::Cmt3::readDataPacket(), xsens::Cmt3::refreshCache(), xsens::Cmt3::reset(), xsens::Cmt3::setBaudrate(), xsens::Cmt3::setDeviceMode2(), xsens::Cmt3::setGpsLeverArm(), xsens::Cmt3::setSyncInMode(), xsens::Cmt3::setSyncInOffset(), xsens::Cmt3::setSyncInSettings(), xsens::Cmt3::setSyncInSkipFactor(), xsens::Cmt3::setSyncOutMode(), xsens::Cmt3::setSyncOutOffset(), xsens::Cmt3::setSyncOutPulseWidth(), xsens::Cmt3::setSyncOutSettings(), xsens::Cmt3::setSyncOutSkipFactor(), xsens::Cmt3::storeXkfState(), xsens::Cmt3::waitForDataMessage(), and xsens::Cmt3::writeMessageToLogFile().
|
protected |
The Cmt1f object that is used for the low-level operations.
Definition at line 172 of file cmt2.h.
Referenced by close(), closeAndDelete(), create(), getCmt1f(), getFileSize(), getName(), getReadPosition(), isOpen(), open(), readMessage(), setReadPosition(), and writeMessage().
|
mutableprotected |
The last result of an operation.
Definition at line 174 of file cmt2.h.
Referenced by close(), closeAndDelete(), Cmt2f(), create(), getLastResult(), getName(), open(), readMessage(), setReadPosition(), and writeMessage().
|
protected |
When set to true, the file is read-only and attempts to write to it will fail.
Definition at line 176 of file cmt2.h.
Referenced by close(), closeAndDelete(), Cmt2f(), create(), open(), and writeMessage().
Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019 |