1.修改优化自动曝光时产生的问题

This commit is contained in:
2022-03-01 11:39:48 +08:00
committed by xin
parent abaa2d7aa6
commit 8674cda5b1

View File

@ -231,13 +231,37 @@ int CAbstractFSController::PerformAutoExposure()
bIsLastValueOverflow = bIsValueOverflow;
fLastExposureTime = fTempExposureTime;
if (/*fExposureTime > 100 || */iExposureTime <= m_daDeviceAttr.iMinIntegrationTimeInMS)
{
bFlagIsAutoExposureOK = false;
bFlagIsAutoExposureFailed = true;
bFlagIsLowerMinExposureTime = true;
qDebug() << "Warning:PerformAutoExposure lower than min integration time.Will be limited to " << m_daDeviceAttr.iMaxIntegrationTimeInMS - 1 << "MS" << " Thread ID:" << m_iThreadID;
// qDebug() << "Warning:PerformAutoExposure lower than min integration time.Will be limited to " << m_daDeviceAttr.iMinIntegrationTimeInMS - 1 << "MS" << " Thread ID:" << m_iThreadID;
// iRes = m_pFSCtrl->SetExposureTime((int)iExposureTime);
// if (iRes != 0)
// {
// qDebug() << "Err:PerformAutoExposure Failed.Exit Code:4" << " Thread ID:" << m_iThreadID;
// return 3;
// }
// else
// {
// qDebug() << "Success:PerformAutoExposure. Value" << iExposureTime << " Thread ID:" << m_iThreadID;
// }
iRes = m_pFSCtrl->SetExposureTime(m_daDeviceAttr.iMinIntegrationTimeInMS);
if (iRes != 0)
{
qDebug() << "Err:PerformAutoExposure Failed.Exit Code:3" << " Thread ID:" << m_iThreadID;
return 3;
}
else
{
qDebug() << "Warning:PerformAutoExposure lower than min integration time.Will be limited to " << m_daDeviceAttr.iMinIntegrationTimeInMS << "MS" << " Thread ID:" << m_iThreadID;
}
break;
}
@ -256,21 +280,34 @@ int CAbstractFSController::PerformAutoExposure()
//else
//{
//qDebug() << "Warning:PerformAutoExposure exceed max integration time.Will be limited to 30sec";
qDebug() << "Warning:PerformAutoExposure exceed max integration time.Will be limited to " << m_daDeviceAttr.iMaxIntegrationTimeInMS-1 << "MS" << " Thread ID:" << m_iThreadID;
//}
iRes = m_pFSCtrl->SetExposureTime(m_daDeviceAttr.iMaxIntegrationTimeInMS - 1);
if (iRes != 0)
{
qDebug() << "Err:PerformAutoExposure Failed.Exit Code:3" << " Thread ID:" << m_iThreadID;
return 3;
}
else
{
qDebug() << "Warning:PerformAutoExposure exceed max integration time.Will be limited to " << m_daDeviceAttr.iMaxIntegrationTimeInMS - 1 << "MS" << " Thread ID:" << m_iThreadID;
}
break;
}
iRes = m_pFSCtrl->SetExposureTime((int)iExposureTime);
if (iRes != 0)
{
qDebug() << "Err:PerformAutoExposure Failed.Exit Code:4" << " Thread ID:" << m_iThreadID;
return 3;
}
else
{
qDebug() << "Success:PerformAutoExposure. Value" << iExposureTime << " Thread ID:" << m_iThreadID;
}
}
iRes = m_pFSCtrl->SetExposureTime((int)iExposureTime);
if (iRes != 0)
{
qDebug() << "Err:PerformAutoExposure Failed.Exit Code:4" << " Thread ID:" << m_iThreadID;
return 3;
}
else
{
qDebug() << "Success:PerformAutoExposure. Value" << iExposureTime << " Thread ID:" << m_iThreadID;
}
fPredictedExposureTime = iExposureTime;
qDebug() << "--------------------------Stop PerformAutoExposure" << " Thread ID:" << m_iThreadID;
//emit SignalAcqFinished(m_iThreadID, 1);