78 lines
2.0 KiB
C++
78 lines
2.0 KiB
C++
#ifndef SBGRECORDER_H
|
|
#define SBGRECORDER_H
|
|
|
|
#include <QtSerialPort/QSerialPort>
|
|
#include <QtSerialPort/QSerialPortInfo>
|
|
|
|
#include "sbgerrorcodes.h"
|
|
#include "sbgbuffer.h"
|
|
#include "sbglogparse.h"
|
|
#include "sbgcrc.h"
|
|
|
|
#include "utility_tc.h"
|
|
|
|
|
|
namespace sbgtc
|
|
{
|
|
class SbgRecorder:public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
SbgRecorder();
|
|
|
|
QByteArray merge(QByteArray sbgMessage);
|
|
bool verify(int index,QByteArray sbgMessage);
|
|
SbgErrorCode extractOneValidFrame(rawBuffer *pHandle, uint8_t *pMsgClass, uint8_t *pMsg, void *pData, size_t *pSize, size_t maxSize);
|
|
SbgErrorCode sbgBinaryLogParse(SbgEComClass msgClass, SbgEComMsgId msg, const void *pPayload, size_t payloadSize, SbgBinaryLogData *pOutputData);
|
|
void parseSbgMessage(QByteArray * sbgMessage);
|
|
|
|
|
|
double calculateTimeDifferenceBetweenSystemAndSbg(SbgBinaryLogData logData);
|
|
|
|
int getSbgState() const;
|
|
|
|
private:
|
|
//0:没有惯导可用串口;1:惯导对应的串口打开成功,但是波特率等参数设置失败;2:惯导对应的串口打开成功;3:正在采集;
|
|
int m_iSbgState;
|
|
|
|
QSerialPort * m_serial;
|
|
bool m_bRecordControl;
|
|
|
|
bool m_bIsSbgReady;
|
|
bool m_bIsRecordHyperspecatralImage;
|
|
bool m_bIsNAV_POSITION_MODE;
|
|
bool m_bIsAccuracyLessThan7;
|
|
bool m_bIsSyncSystemTimeBaseGpstime;
|
|
|
|
uint32_t m_iSolutionMode;
|
|
int m_iSolutionModeCounter;
|
|
|
|
QString m_baseFileName;
|
|
|
|
public slots:
|
|
void openSerialPort();
|
|
void closeSerialPort();
|
|
|
|
void onSbgReady(double second,QString baseFileName);
|
|
|
|
void startRecordSbg();
|
|
void stopRecordSbg();
|
|
|
|
void startRecordHyperspectral();
|
|
void stopRecordHyperspectral();
|
|
|
|
|
|
signals:
|
|
void sbgReady(double second,QString baseFileName);
|
|
void serialPortStatus(int);
|
|
|
|
void sbgSolutionModeSignal(int);
|
|
|
|
void sbgAccuracySignal(int, int);
|
|
};
|
|
|
|
}
|
|
|
|
#endif // SBGRECORDER_H
|