#pragma once
#include "pch.h"
#include <vector>
#include "ZZ_Types.h"
#include "DataFileTransfer.h"
#include "RadianceConverter.h"

using namespace std;
using namespace ZZ_MISCDEF::ZZ_DATAFILE;
using namespace ZZ_MISCDEF::ZZ_RUNPARAMS;
using namespace ZZ_MISCDEF::IRIS::FS;

class CMainDataUploader :public QObject
{
	Q_OBJECT
public:
	CMainDataUploader(QObject* parent = nullptr);
	~CMainDataUploader();
public:
public:
	
	//set attributes
	void SetErr(ErrInfo struErrInfo);
	void SetData(vector<vector<DataFrame>> vecData);
	void SetRTGP(RunTimeGrabberParams struGrabberRTParams);
	void SetContext(EContext struEC, MEContext struMEC);

	//load calibration file after set attributes
	int  Initialize();
	//int  Init_Self();

	void Calibration();

	int UploadInfo();
	int UploadErr();
	int UploadData();
	
public:
	RadConverter *m_pRadConverter = NULL;
	ZZ_HttpTransfer *m_pTransfer = NULL;
private:
	//ErrInfo                       m_struErrInfo;
	EContext                      m_struEC;
	MEContext                     m_struMEC;
	RunTimeGrabberParams          m_struGrabberRTParams;
	vector<vector<DataFrame>>     m_vecData;
	vector<vector<CalFrame>>      m_vecCalData;
	vector<vector<CalDataFrame>>  m_vecCalcedData;

	QString                       m_qstrGrabDate;
public slots:
	//int SlotPushOneDataFrame(vector<vector<DataFrame>> vecData);
	int SlotPushOneDataFrame();
	int SlotUpdateErrorInfo();
	
signals:
	//void SignalInit_Self();
	
};