#ifndef ISPINDELDEVICE_H
#define ISPINDELDEVICE_H


#include <QObject>
#include <QTcpServer>
#include <QTcpSocket>
#include "IspindelData.h"
#include "IspindelDataLogger.h"
#include <QList>

class CIspindelDevice:  public QObject
{
    Q_OBJECT
public:
    CIspindelDevice();
    ~CIspindelDevice();

    QTcpServer *mISpindelServer;
    QTcpSocket *mIspindelClientConnection;
    QList<CIspindelData*> mIspindelLog;
    CIspindelDataLogger mDataLogger;

    CIspindelData *GetLastestIspindelData();
    QList<CIspindelData*> *GetAllData(){return &mIspindelLog;}
    QByteArray GetAllDataBuffer();
    QByteArray GetLastestIspindelDataBuffer();
    bool DeleteSampleRequest(int SampleIndex);


public slots:
    void IspindelClientConnected();
    void IspindelClientDataAvail();
    void IspindelClientDisconnected();

signals:
    void NewIspindelDataReceived();
};

#endif // ISPINDELDEVICE_H
