From 29be390ecea5d84c31927b18299779ff8dd738c6 Mon Sep 17 00:00:00 2001 From: zhangzhuo Date: Tue, 1 Mar 2022 11:39:48 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E4=BC=98=E5=8C=96=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=9B=9D=E5=85=89=E6=97=B6=E4=BA=A7=E7=94=9F=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/CaptureThread/AbstractFSController.cpp | 61 +++++++++++++++---- 1 file changed, 49 insertions(+), 12 deletions(-) diff --git a/source/CaptureThread/AbstractFSController.cpp b/source/CaptureThread/AbstractFSController.cpp index 84e9ba8..78453f8 100644 --- a/source/CaptureThread/AbstractFSController.cpp +++ b/source/CaptureThread/AbstractFSController.cpp @@ -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);