test_sdk/hw/d002/device_d002.h

45 lines
796 B
C
Raw Permalink Normal View History

#ifndef DEVICE_D002_H
#define DEVICE_D002_H
#include <QDateTime>
#include <QDebug>
#include "usbdask64.h"
#include "hw/gtl_hw_device.h"
class device_d002 : public gtl::hw::device
{
Q_OBJECT
public:
device_d002(QObject *parent);
~device_d002();
virtual QString type() const override;
virtual bool start(QString id, qreal rate);
virtual bool stop();
virtual int channels() { return 4 * (int)_modules.size(); }
virtual qreal max_amplitude() const { return 10; }
private:
std::map<int, int> _ids;
std::vector<U16> _modules;
std::vector<std::vector<I16>> _buffer;
std::vector<qreal> _buffer_send;
std::vector<std::vector<U16>> _buffer_read;
private:
void run();
void send_data();
U16 get_channel_config(int channel) const;
};
#endif // ADLINK2405_H