1 Star 0 Fork 0

xiongqiumin/DataGather

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
GatherData9982.h 1.57 KB
一键复制 编辑 原始数据 按行查看 历史
xiongqiumin 提交于 2020-12-23 17:45 . init
#ifndef GATHER_DATA_9982_H_
#define GATHER_DATA_9982_H_
#include "Config.h"
#include <QVector>
#include <QAtomicInt>
#include <QSharedPointer>
#include <QMap>
#include <QFile>
#include <QDateTime>
struct GatherDataBuffer
{
public:
GatherDataBuffer(int size);
float sum;
float *data();
int size();
bool attach();
void detach();
QVector<float> buffer;
QAtomicInt flag;
};
typedef QSharedPointer<GatherDataBuffer> GatherBufferPtr;
class GatherDataBufferManager
{
public:
GatherDataBufferManager();
void init(int size);
int size();
GatherDataBuffer *getBuffer();
protected:
GatherBufferPtr malloc(int size);
QVector<GatherBufferPtr> m_buffers;
int m_size;
};
struct GatherFile
{
struct FrameInfo{
qint64 offset;
int size;
float sum;
QDateTime time;
};
GatherFile();
void beignSave(QString filepath, Param_USB9982 gatherParam);
void endSave();
void load(QString filepath);
void close();
bool isOpen();
bool isSave();
void append(QDateTime cur,float sum,const QByteArray &data);
bool getFrame(int index,QDateTime &time, QVector<float> &data);
void calcBuffer(const QByteArray &buffer, QVector<float> &data);
Param_USB9982 param;
QVector<FrameInfo> frameInfo;
qint64 saveSize;
qint64 maxSize;
QFile file;
bool bSave;
QByteArray m_buffer;
QByteArray m_zipBuffer;
};
static_assert(sizeof(Param_USB9982) + sizeof(GatherFile::FrameInfo) * 10000 < 1024 * 1024, "size is to big");
#endif
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xiongqiumin/DataGather.git
[email protected]:xiongqiumin/DataGather.git
xiongqiumin
DataGather
DataGather
master

搜索帮助