mirror of
http://172.16.0.230/r/SIF/TowerOptoSifAndSpectral.git
synced 2025-10-20 03:49:43 +08:00
重大更新
1.添加了对双通道光闸系统的支持。 2.针对QEPro系列硬件添加了非线性矫正 3.进行了完整的实际采集测试,通过。 4.优化统一了ATP基类内置自动曝光函数。
This commit is contained in:
@ -122,14 +122,45 @@ int CMainDataGrabber::InitLS()
|
||||
//SetupMsgPipelines_RunTime();
|
||||
//StartWorkers();
|
||||
|
||||
if (m_struLinearShutterContext.strInterface=="GPIO")
|
||||
{
|
||||
qDebug() << "Debugging GPIO Init Started";
|
||||
|
||||
PortInfo piTemp;
|
||||
piTemp.qstrFullPortName = QString::fromStdString(m_struLinearShutterContext.strInterface);
|
||||
m_ctrlLS.ILMES_InitializeComm(piTemp, m_struLinearShutterContext.ucProtocolType, m_struLinearShutterContext.ucCmdID);
|
||||
ControllerParams cpTemp;
|
||||
bool res = m_ctrlLS.ILMES_InitializeParams(cpTemp);
|
||||
m_vecDSS.clear();
|
||||
|
||||
m_ctrlLS.ILMES_SetPosition(m_struAcqPosSetting.iPosition, m_struAcqPosSetting.iTotalPosition);
|
||||
if (m_struLinearShutterContext.ucProtocolType == 100)
|
||||
{
|
||||
DSStatus DSSOne;
|
||||
|
||||
QString qstrChannel = QString::number(m_struLinearShutterContext.usCmdID, 10);
|
||||
if (qstrChannel.size() != 2)
|
||||
{
|
||||
qDebug() << "Dual Shutter Channel Parse Err.";
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
DSSOne.strChannelA = qstrChannel.toStdString()[0];
|
||||
DSSOne.strChannelB = qstrChannel.toStdString()[1];
|
||||
DSSOne.iChannelA = 1;
|
||||
DSSOne.iChannelB = 1;
|
||||
}
|
||||
|
||||
m_vecDSS.push_back(DSSOne);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
PortInfo piTemp;
|
||||
piTemp.qstrFullPortName = QString::fromStdString(m_struLinearShutterContext.strInterface);
|
||||
m_ctrlLS.ILMES_InitializeComm(piTemp, m_struLinearShutterContext.ucProtocolType, m_struLinearShutterContext.usCmdID);
|
||||
ControllerParams cpTemp;
|
||||
bool res = m_ctrlLS.ILMES_InitializeParams(cpTemp);
|
||||
m_ctrlLS.ILMES_SetPosition(m_struAcqPosSetting.iPosition, m_struAcqPosSetting.iTotalPosition);
|
||||
}
|
||||
|
||||
|
||||
//m_ctrlLS.ILMES_MoveToPos(2);
|
||||
return 0;
|
||||
@ -428,6 +459,9 @@ int CMainDataGrabber::GrabOnceFinished()
|
||||
|
||||
int CMainDataGrabber::OnTimeCounter()
|
||||
{
|
||||
bool bRes;
|
||||
QString qstrCMD_A,qstrCMD_B,qstrCMD_Temp;
|
||||
|
||||
if (m_iFlagIsCapturing)
|
||||
{
|
||||
qDebug() << "Fatal Warning.Last capture not finished.New acquisition will not start";
|
||||
@ -445,30 +479,84 @@ int CMainDataGrabber::GrabOnceFinished()
|
||||
}
|
||||
|
||||
|
||||
////hold current
|
||||
bool bRes = m_ctrlLS.SetHoldCurrent(0.4f);
|
||||
if (!bRes)
|
||||
|
||||
if (m_struLinearShutterContext.strInterface == "GPIO")
|
||||
{
|
||||
qDebug() << "SetHoldCurrent 0.4 Failed";
|
||||
}
|
||||
Delay_MSec(1000);
|
||||
////
|
||||
else
|
||||
{
|
||||
////hold current
|
||||
bRes = m_ctrlLS.SetHoldCurrent(0.4f);
|
||||
if (!bRes)
|
||||
{
|
||||
qDebug() << "SetHoldCurrent 0.4 Failed";
|
||||
}
|
||||
Delay_MSec(1000);
|
||||
////
|
||||
}
|
||||
|
||||
for (int i=0;i< m_struAcqPosSetting.iTotalPosition-1;i++)
|
||||
{
|
||||
ResetThreadStatus();
|
||||
////move to
|
||||
qDebug()<<"Start ILMES_MoveToPos:"<<i+1;
|
||||
if (i==0)
|
||||
|
||||
////move to start
|
||||
if (m_struLinearShutterContext.strInterface == "GPIO")
|
||||
{
|
||||
m_ctrlLS.ILMES_MoveToPos(i + 1);
|
||||
if (m_struLinearShutterContext.ucProtocolType == 100)
|
||||
{
|
||||
if (i==0)
|
||||
{
|
||||
qstrCMD_Temp = QString::fromStdString(m_vecDSS[0].strChannelA);
|
||||
qstrCMD_A = "gpio write " + qstrCMD_Temp + " 1";
|
||||
|
||||
qstrCMD_Temp = QString::fromStdString(m_vecDSS[0].strChannelB);
|
||||
qstrCMD_B = "gpio write " + qstrCMD_Temp + " 0";
|
||||
|
||||
system(qstrCMD_A.toLatin1());
|
||||
system(qstrCMD_B.toLatin1());
|
||||
|
||||
qDebug() << qstrCMD_A;
|
||||
qDebug() << qstrCMD_B;
|
||||
|
||||
Delay_MSec(500);
|
||||
}
|
||||
if (i==1)
|
||||
{
|
||||
qstrCMD_Temp = QString::fromStdString(m_vecDSS[0].strChannelA);
|
||||
qstrCMD_A = "gpio write " + qstrCMD_Temp + " 0";
|
||||
|
||||
qstrCMD_Temp = QString::fromStdString(m_vecDSS[0].strChannelB);
|
||||
qstrCMD_B = "gpio write " + qstrCMD_Temp + " 1";
|
||||
|
||||
system(qstrCMD_A.toLatin1());
|
||||
system(qstrCMD_B.toLatin1());
|
||||
|
||||
qDebug() << qstrCMD_A;
|
||||
qDebug() << qstrCMD_B;
|
||||
|
||||
Delay_MSec(500);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ctrlLS.MoveTo(m_struAcqPosSetting.iPosition[1]);
|
||||
qDebug() << "Start ILMES_MoveToPos:" << i + 1;
|
||||
if (i == 0)
|
||||
{
|
||||
m_ctrlLS.ILMES_MoveToPos(i + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ctrlLS.MoveTo(m_struAcqPosSetting.iPosition[1]);
|
||||
}
|
||||
m_ctrlLS.ILMES_MoveToPos(i + 1);
|
||||
qDebug() << "Stop ILMES_MoveToPos:" << i + 1;
|
||||
}
|
||||
m_ctrlLS.ILMES_MoveToPos(i+1);
|
||||
////
|
||||
qDebug() << "Stop ILMES_MoveToPos:" << i + 1;
|
||||
////move to end
|
||||
|
||||
|
||||
// m_struAcqPosSetting.iPosition[i + 1];
|
||||
m_iFlagIsCapturing_Signal = 1;
|
||||
emit SignalStartGrabOnce_Signal();
|
||||
@ -479,9 +567,30 @@ int CMainDataGrabber::GrabOnceFinished()
|
||||
|
||||
|
||||
////move to
|
||||
qDebug() << "Start ILMES_MoveToPos:" << 0;
|
||||
m_ctrlLS.ILMES_MoveToPos(0);
|
||||
qDebug() << "Stop ILMES_MoveToPos:" << 0;
|
||||
if (m_struLinearShutterContext.strInterface == "GPIO")
|
||||
{
|
||||
if (m_struLinearShutterContext.ucProtocolType == 100)
|
||||
{
|
||||
qstrCMD_Temp = QString::fromStdString(m_vecDSS[0].strChannelA);
|
||||
qstrCMD_A = "gpio write " + qstrCMD_Temp + " 0";
|
||||
|
||||
qstrCMD_Temp = QString::fromStdString(m_vecDSS[0].strChannelB);
|
||||
qstrCMD_B = "gpio write " + qstrCMD_Temp + " 0";
|
||||
|
||||
system(qstrCMD_A.toLatin1());
|
||||
system(qstrCMD_B.toLatin1());
|
||||
|
||||
qDebug() << qstrCMD_A;
|
||||
qDebug() << qstrCMD_B;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "Start ILMES_MoveToPos:" << 0;
|
||||
m_ctrlLS.ILMES_MoveToPos(0);
|
||||
qDebug() << "Stop ILMES_MoveToPos:" << 0;
|
||||
}
|
||||
|
||||
//m_struAcqPosSetting.iPosition[0];
|
||||
m_iFlagIsCapturing_Dark = 1;
|
||||
emit SignalStartGrabOnce_Dark();
|
||||
@ -490,14 +599,22 @@ int CMainDataGrabber::GrabOnceFinished()
|
||||
Delay_MSec(1000);
|
||||
}
|
||||
}
|
||||
////hold current
|
||||
bRes = m_ctrlLS.SetHoldCurrent(0);
|
||||
if (!bRes)
|
||||
|
||||
if (m_struLinearShutterContext.strInterface == "GPIO")
|
||||
{
|
||||
qDebug() << "SetHoldCurrent 0 Failed";
|
||||
}
|
||||
Delay_MSec(1000);
|
||||
////
|
||||
else
|
||||
{
|
||||
////hold current
|
||||
bRes = m_ctrlLS.SetHoldCurrent(0);
|
||||
if (!bRes)
|
||||
{
|
||||
qDebug() << "SetHoldCurrent 0 Failed";
|
||||
}
|
||||
Delay_MSec(1000);
|
||||
////
|
||||
}
|
||||
|
||||
std::vector<std::vector<DataFrame>> vecData;
|
||||
|
||||
for (ZZ_U8 i = 0; i < m_struDeviceContext.ucDeviceNumber; i++)
|
||||
|
Reference in New Issue
Block a user