The mid-level file communication class. More...
#include <Robots/SeaBeeIII/IMUDataServer/cmt2.h>
Public Member Functions | |
Cmt2f () | |
Default constructor. | |
~Cmt2f () | |
Destructor. | |
XsensResultValue | close (void) |
Close the file. | |
XsensResultValue | closeAndDelete (void) |
Close the file and delete it. | |
XsensResultValue | create (const char *filename) |
Create a new file with level 2 header. | |
XsensResultValue | create (const wchar_t *filename) |
Create a new file with level 2 header. | |
Cmt1f * | getCmt1f (void) |
Get a reference to the embedded Cmt1f object. | |
XsensResultValue | getLastResult (void) const |
Return the error code of the last operation. | |
XsensResultValue | getName (char *filename) const |
Retrieve the filename that was last successfully opened. | |
XsensResultValue | getName (wchar_t *filename) const |
Retrieve the filename that was last successfully opened. | |
bool | isOpen (void) const |
Return whether the file is open or not. | |
XsensResultValue | open (const char *filename, const bool readOnly=false) |
Open a file and read the header. | |
XsensResultValue | open (const wchar_t *filename, const bool readOnly=false) |
Open a file and read the header. | |
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. | |
CmtFilePos | getFileSize (void) |
Get the current file size. | |
CmtFilePos | getReadPosition (void) |
Get the current read position. | |
XsensResultValue | setReadPosition (CmtFilePos pos) |
Set the read position to the given position. | |
XsensResultValue | writeMessage (const Message *msg) |
Write a message to the end of the file. | |
Protected Attributes | |
Cmt1f | m_cmt1f |
The Cmt1f object that is used for the low-level operations. | |
XsensResultValue | m_lastResult |
The last result of an operation. | |
bool | m_readOnly |
When set to true, the file is read-only and attempts to write to it will fail. |
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.
Definition at line 180 of file cmt2.h.
xsens::Cmt2f::Cmt2f | ( | ) |
Default constructor.
Definition at line 577 of file cmt2.cpp.
References m_lastResult, and m_readOnly.
XsensResultValue xsens::Cmt2f::close | ( | void | ) |
Close the file.
Definition at line 592 of file cmt2.cpp.
References xsens::Cmt1f::close(), xsens::Cmt1f::isOpen(), m_cmt1f, m_lastResult, and m_readOnly.
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 606 of file cmt2.cpp.
References xsens::Cmt1f::closeAndDelete(), xsens::Cmt1f::isOpen(), m_cmt1f, m_lastResult, and m_readOnly.
Referenced by xsens::Cmt3::closeLogFile(), and xsens::Cmt3::createLogFile().
XsensResultValue xsens::Cmt2f::create | ( | const wchar_t * | filename | ) |
Create a new file with level 2 header.
Definition at line 642 of file cmt2.cpp.
References xsens::Cmt1f::close(), xsens::Cmt1f::create(), xsens::Cmt1f::deleteData(), xsens::Cmt1f::isOpen(), m_cmt1f, m_lastResult, m_readOnly, and xsens::Cmt1f::writeData().
XsensResultValue xsens::Cmt2f::create | ( | const char * | filename | ) |
Create a new file with level 2 header.
Definition at line 619 of file cmt2.cpp.
References xsens::Cmt1f::close(), xsens::Cmt1f::create(), xsens::Cmt1f::deleteData(), xsens::Cmt1f::isOpen(), m_cmt1f, m_lastResult, m_readOnly, and xsens::Cmt1f::writeData().
Referenced by xsens::Cmt3::createLogFile().
Cmt1f * xsens::Cmt2f::getCmt1f | ( | void | ) |
Get a reference to the embedded Cmt1f object.
Definition at line 664 of file cmt2.cpp.
References m_cmt1f.
Referenced by xsens::Cmt3::openLogFile().
CmtFilePos xsens::Cmt2f::getFileSize | ( | void | ) |
Get the current file size.
Definition at line 799 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 671 of file cmt2.cpp.
References m_lastResult.
XsensResultValue xsens::Cmt2f::getName | ( | wchar_t * | filename | ) | const |
Retrieve the filename that was last successfully opened.
Definition at line 685 of file cmt2.cpp.
References xsens::Cmt1f::getName(), m_cmt1f, and m_lastResult.
XsensResultValue xsens::Cmt2f::getName | ( | char * | filename | ) | const |
Retrieve the filename that was last successfully opened.
Definition at line 678 of file cmt2.cpp.
References xsens::Cmt1f::getName(), m_cmt1f, and m_lastResult.
Referenced by xsens::Cmt3::getLogFileName(), and xsens::Cmt3::isLogFileOpen().
CmtFilePos xsens::Cmt2f::getReadPosition | ( | void | ) |
Get the current read position.
Definition at line 806 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 692 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::getMtCount(), xsens::Cmt3::isLogFileOpen(), xsens::Cmt3::openLogFile(), xsens::Cmt3::refreshCache(), xsens::Cmt3::setDataSource(), and xsens::Cmt3::setLogMode().
XsensResultValue xsens::Cmt2f::open | ( | const wchar_t * | filename, | |
const bool | readOnly = false | |||
) |
Open a file and read the header.
Definition at line 710 of file cmt2.cpp.
References xsens::Cmt1f::isOpen(), m_cmt1f, m_lastResult, m_readOnly, and xsens::Cmt1f::open().
XsensResultValue xsens::Cmt2f::open | ( | const char * | filename, | |
const bool | readOnly = false | |||
) |
Open a file and read the header.
Definition at line 699 of file cmt2.cpp.
References xsens::Cmt1f::isOpen(), m_cmt1f, m_lastResult, m_readOnly, and xsens::Cmt1f::open().
Referenced by xsens::Cmt3::openLogFile().
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 721 of file cmt2.cpp.
References xsens::Message::clear(), xsens::Cmt1f::find(), xsens::Message::getMessageId(), xsens::Message::loadFromString(), m_cmt1f, m_lastResult, xsens::Cmt1f::readData(), and xsens::Cmt1f::setReadPos().
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 813 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 820 of file cmt2.cpp.
References xsens::Cmt1f::appendData(), xsens::Message::getMessageStart(), xsens::Message::getTotalMessageSize(), m_cmt1f, m_lastResult, and m_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::setLatLonAlt(), xsens::Cmt3::setObjectAlignmentMatrix(), 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(), and xsens::Cmt3::waitForDataMessage().
Cmt1f xsens::Cmt2f::m_cmt1f [protected] |
The Cmt1f object that is used for the low-level operations.
Definition at line 187 of file cmt2.h.
Referenced by close(), closeAndDelete(), create(), getCmt1f(), getFileSize(), getName(), getReadPosition(), isOpen(), open(), readMessage(), setReadPosition(), and writeMessage().
XsensResultValue xsens::Cmt2f::m_lastResult [mutable, protected] |
The last result of an operation.
Definition at line 189 of file cmt2.h.
Referenced by close(), closeAndDelete(), Cmt2f(), create(), getLastResult(), getName(), open(), readMessage(), setReadPosition(), and writeMessage().
bool xsens::Cmt2f::m_readOnly [protected] |
When set to true, the file is read-only and attempts to write to it will fail.
Definition at line 191 of file cmt2.h.
Referenced by close(), closeAndDelete(), Cmt2f(), create(), open(), and writeMessage().