mirror of
http://172.16.0.230/r/SIF/TowerOptoSifAndSpectral.git
synced 2025-10-19 19:49:42 +08:00
更新:
(1)基于非线性校正的数据 生成 定标文件; (2)将非线性定标参数写到文件中,给卓哥用;
This commit is contained in:
@ -512,7 +512,7 @@ int ZZ_ATPControl_Serial_Qt::PerformAutoExposure(float fMinScaleFactor, float fM
|
||||
double fLastExposureTime = 0.1;
|
||||
int iRepeatCount = 0;
|
||||
|
||||
int iRes = SetExposureTime(2000);//need change to load from files
|
||||
int iRes = SetExposureTime(m_daDeviceAttr.iMinIntegrationTimeInMS);//need change to load from files
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:PerformAutoExposure Failed.Exit Code:1";
|
||||
@ -527,16 +527,20 @@ int ZZ_ATPControl_Serial_Qt::PerformAutoExposure(float fMinScaleFactor, float fM
|
||||
{
|
||||
bFlagIsAutoExposureFailed = true;
|
||||
bFlagIsOverTrying = true;
|
||||
qDebug() << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>30<EFBFBD><EFBFBD>"<<endl;
|
||||
break;
|
||||
}
|
||||
|
||||
fExposureTime = (float)m_daDeviceAttr.iMinIntegrationTimeInMS;
|
||||
// fExposureTime = (float)m_daDeviceAttr.iMinIntegrationTimeInMS;
|
||||
int tc_tmp;
|
||||
GetExposureTime(tc_tmp);
|
||||
fExposureTime=tc_tmp;
|
||||
fTempExposureTime = fExposureTime;
|
||||
|
||||
iRes = SingleShot(dfTemp);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:PerformAutoExposure Failed.Exit Code:2";
|
||||
qDebug() << "Err:PerformAutoExposure Failed.Exit Code:2"<<endl;
|
||||
return 2;
|
||||
}
|
||||
|
||||
@ -549,6 +553,8 @@ int ZZ_ATPControl_Serial_Qt::PerformAutoExposure(float fMinScaleFactor, float fM
|
||||
dSum += dfTemp.lData[i];
|
||||
}
|
||||
double dTemp = dSum / iCount;
|
||||
qDebug() << "1111111111111111111111111111111" << dTemp << endl;
|
||||
|
||||
|
||||
if (dTemp >= iDeviceDepth * 0.99)
|
||||
{
|
||||
@ -566,6 +572,7 @@ int ZZ_ATPControl_Serial_Qt::PerformAutoExposure(float fMinScaleFactor, float fM
|
||||
else if (iDeviceDepth * fMaxScaleFactor >= dTemp && dTemp >= iDeviceDepth * fMinScaleFactor)
|
||||
{
|
||||
bFlagIsAutoExposureOK = 1;
|
||||
continue;
|
||||
}
|
||||
else if (dTemp > iDeviceDepth * fMaxScaleFactor)
|
||||
{
|
||||
@ -592,12 +599,15 @@ int ZZ_ATPControl_Serial_Qt::PerformAutoExposure(float fMinScaleFactor, float fM
|
||||
dFactor = dTemp / (iDeviceDepth * fMaxScaleFactor);
|
||||
fExposureTime = (float)(fExposureTime / dFactor);
|
||||
}
|
||||
if (/*fExposureTime > 100 || */fExposureTime < 10)
|
||||
if (fExposureTime < m_daDeviceAttr.iMinIntegrationTimeInMS)
|
||||
{
|
||||
bFlagIsAutoExposureOK = false;
|
||||
bFlagIsAutoExposureFailed = true;
|
||||
bFlagIsLowerMinExposureTime = true;
|
||||
|
||||
qDebug() << "lower-----------------------"<<endl;
|
||||
}
|
||||
|
||||
}
|
||||
bIsLastValueOverflow = bIsValueOverflow;
|
||||
fLastExposureTime = fTempExposureTime;
|
||||
@ -669,7 +679,7 @@ int ZZ_ATPControl_Serial_Qt::SetExposureTime(int iExposureTimeInMS)
|
||||
if ((ZZ_U8)qbRecv[0] != 0)
|
||||
{
|
||||
qDebug() << "Err:SetExposureTime Failed.Exit Code:1";
|
||||
return 1;
|
||||
//return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -720,6 +730,9 @@ int ZZ_ATPControl_Serial_Qt::SingleShot(DataFrame &dfData)
|
||||
// qbSend[2] = 0x01;
|
||||
qbSend[1] = m_iExposureTime >> 8;;
|
||||
qbSend[2] = m_iExposureTime & 0xFF;
|
||||
|
||||
qDebug() << "-------------"<<m_iExposureTime<<endl;
|
||||
|
||||
int iRes = SendCommand(qbSend);
|
||||
if (iRes != 0)
|
||||
{
|
||||
|
Reference in New Issue
Block a user