#pragma once
#include "pch.h"
#include "ZZ_Types.h"
using namespace ZZ_MISCDEF::ZZ_RUNPARAMS;
using namespace ZZ_MISCDEF::ZZ_DATAFILE;
using namespace ZZ_MISCDEF::MISC_DETECTOR;
class ZZ_SysConfigger :public QObject
{
	Q_OBJECT

public:
	ZZ_SysConfigger(QObject *parent = nullptr);
	virtual ~ZZ_SysConfigger();
public:
	int Initialize();
	int GetGrabberRunParams(RunTimeGrabberParams &struGrabberRTParams);
	int GetECParams(EContext &struEC);
	int GetMECParams(MEContext &struMEC);
	int GetMiscParams(HumitureDeviceInfo &struHDI);
	int GetParams(RunTimeGrabberParams &struGrabberRTParams, EContext &struEC, MEContext &struMEC, HumitureDeviceInfo &struHDI);
	    
	int LoadSettingsFromFile_IS1();
	int LoadSettingsFromFile_iSIF();
	int LoadSettingsFromFile_System();
	int LoadSettingsFromFile_MISC();
	int LoadSettings_Test();
public:
	enum ConfiggerDeviceModel
	{
		OSIFAlpha = 0,
		OSIFBeta,
		ISIF,
		IS1,
		IS2,
		Null
	};
	Q_ENUM(ConfiggerDeviceModel);
	//////////////////////////////////////////////////////////////////////////run-time settings
	AcqTimeSettings      m_struAcqTime;
	LSContext            m_struLSContext;
	FSContext            m_struFSContext;
	AcqPosSettings       m_struAcqPosition;
	HumitureDeviceInfo   m_struHumitureDeviceInfo;
	//////////////////////////////////////////////////////////////////////////
	EContext        m_struEC;
	MEContext       m_struMEC;
	IS1Info         m_struIS1Info;
	ISIFInfo        m_struISIFInfo;
	
private:
	QString m_qstrDeviceConfigFilePath;
	QString m_qstrJSONConfigFilePath;
	QFile qfJConfig/*,qfDeviceConfig*/;
	QSettings *m_qsDeviceConfig;

	QByteArray m_qbaJData;
	QJsonParseError m_qjpeJErr;
	QJsonObject m_qjoJObj;
	QJsonDocument m_qjdJDoc;

	

};