#include "AbstractFSController.h"
CAbstractFSController::CAbstractFSController(QObject* parent /*= nullptr*/)
{
	m_pFSCtrl = NULL;
	m_iThreadID = -1;
}

CAbstractFSController::~CAbstractFSController()
{
	if (m_pFSCtrl!= 0 )
	{
		delete m_pFSCtrl;
	}
}

int CAbstractFSController::SetRunParas(int iThreadID, FSInfo fsInfo)
{
	m_iThreadID = iThreadID;
	m_fsInfo = fsInfo;
	return 0;
}



int CAbstractFSController::InitializeFSControl()
{
	using namespace ZZ_MISCDEF::IRIS;
	if (m_iThreadID == -1/*|| m_iDeviceType == -1*/)
	{
		qDebug() << "Params Err. Call SetRunParas first";
		return 1;
	}
	switch (m_fsInfo.ucDeviceModel)
	{
	case DeviceModel::OSIFAlpha:  
		
		break;
	case DeviceModel::OSIFBeta:
		break;
	case DeviceModel::ISIF: 
		m_pFSCtrl = new ZZ_ATPControl_Serial_Qt;
		m_pFSCtrl->Initialize(false, m_fsInfo.iInterface, NULL);
		break;
	case DeviceModel::IS1:
		m_pFSCtrl = new ZZ_ATPControl_Serial_Qt;
		m_pFSCtrl->Initialize(false, m_fsInfo.iInterface, NULL);
		break;
	case DeviceModel::IS2:
		m_pFSCtrl = new ZZ_ATPControl_Serial_Qt;
		m_pFSCtrl->Initialize(false, m_fsInfo.iInterface, NULL);
		break;
	default: 
		break;
	}
	return 0;
}

int CAbstractFSController::StartAcquisition()
{
	//
	qDebug() << "Starting acq" << " Thread ID:" << m_iThreadID;
	QThread::msleep(5000);
	qDebug() << "Stop acq" << " Thread ID:" << m_iThreadID;
	emit SignalAcqFinished(m_iThreadID, 1);
	return 0;
}

int CAbstractFSController::StopAcquisition()
{
	
	return 0;
}


