#pragma once
#include <qthread.h>
//#include <QFileDialog>
#include <QDateTime>

#include <iostream>
#include <fstream>

#include "ATPControl_Serial_QT.h"
#include "FiberSpectrometerOperationBase.h"

class ATPFiberImager :public QObject,public FiberSpectrometerOperationBase
{
Q_OBJECT

public:
    ATPFiberImager(bool bIsUSBMode, std::string ucPortNumber, std::string strDeviceName);
    ~ATPFiberImager();

    ZZ_ATPControl_Serial_Qt * m_FiberSpectrometer;

    void connectFiberSpectrometer(QString& sn, QString& pixelCount, QString& wavelengthInfo);
    void disconnectFiberSpectrometer();
    void getDeviceAttribute(DeviceAttribute& deviceAttribute);
    void getDeviceInfo(DeviceInfo& deviceInfo);

    void setExposureTime(int iExposureTimeInMS);

    void getExposureTime(int &iExposureTimeInMS);//ok
    void getDeviceTemperature(float &fTemperature);//ok

    void singleShot(DataFrame &dfData);

    void getNonlinearityCoeffs(coeffsFrame &coeffs);

    ZZ_S32 GetMaxValue(ZZ_S32 * dark, int number);

//	DataFrame m_IntegratingSphereData;
//	DataFrame m_DarkData;
protected:
private:
    std::string mUcPortNumber;

//	ZZ_U32 m_MaxValueOfFiberSpectrometer;

public slots:
    void recordDark(QString path);
    void recordTarget(int recordTimes, QString path);
    void autoExpose();

signals:
    void sendExposureTimeSignal(int exposureTime);
};