test_sdk/hw/ADCCluster/singlestack.h

36 lines
920 B
C++

#ifndef SINGLESTACK_H
#define SINGLESTACK_H
#include <QObject>
#include "adcchannel.h"
#include "stpdefine.h"
#include <QDebug>
#define DATA_OFFSET 4 // смещение из-за 4 байт спереди - номер пакета
class singleStack : public QObject
{
Q_OBJECT
public:
explicit singleStack(uint32_t firstPacketIndex, ADC_ns::bitDepth bitDepth, QList<ADCChannel *> * channelsConfig, int channelOffset, QObject *parent = nullptr);
void insert(int index, QByteArray packet);
double getValue(int packet, uint8_t channel, int point);
bool getTachoValue(int packet, int point);
int getFirstPacketIndex() { return _firstPacketIndex; }
private:
QByteArray _packets[45];
ADC_ns::bitDepth _bitDepth;
double _channelFactors[4];
int _channelsCount;
int _tachoOffset;
uint8_t _bytesInSample;
uint32_t _firstPacketIndex;
signals:
};
#endif // SINGLESTACK_H