最新更改
This commit is contained in:
@ -31,7 +31,8 @@ int CAbsFSController::Initialize()
|
||||
m_pFSCtrl = new OceanOptics_lib;
|
||||
if (m_pFSCtrl->Initialize(false, m_struFSParam.strInterface, m_struFSParam.strSN) != 0)
|
||||
{
|
||||
qDebug() << "Flame Not Opened";
|
||||
//qDebug() << "Flame Not Opened";
|
||||
printf("Flame Not Opened");
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
@ -65,7 +66,8 @@ int CAbsFSController::Initialize()
|
||||
//m_pFSCtrl->Initialize(false, m_struFSParam.strInterface, NULL);
|
||||
if (m_pFSCtrl->Initialize(false, m_struFSParam.strInterface, m_struFSParam.strSN) != 0)
|
||||
{
|
||||
qDebug() << "IS1 Not Opened";
|
||||
//qDebug() << "IS1 Not Opened";
|
||||
printf("IS1 Not Opened");
|
||||
return 3;
|
||||
}
|
||||
break;
|
||||
@ -86,8 +88,16 @@ int CAbsFSController::Initialize()
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "GetDeviceAttribute Failed" << iRes;
|
||||
printf("GetDeviceAttribute Failed");
|
||||
return 4;
|
||||
}
|
||||
else//mark by zz
|
||||
{
|
||||
if (m_struFSParam.ucDeviceModel== DeviceModel::IS2)
|
||||
{
|
||||
m_struDeviceAttr.iMinIntegrationTimeInMS = 10;
|
||||
}
|
||||
}
|
||||
|
||||
iRes = m_pFSCtrl->SetDeviceTemperature(0);
|
||||
if (iRes != 0)
|
||||
@ -124,7 +134,8 @@ int CAbsFSController::SingleShot(DataFrame& struSingleFrame)
|
||||
int iRes = m_pFSCtrl->SingleShot(m_struSingleFrame);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err. SingleShot";
|
||||
//qDebug() << "Err. SingleShot";
|
||||
printf("Err. SingleShot");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -133,7 +144,8 @@ int CAbsFSController::SingleShot(DataFrame& struSingleFrame)
|
||||
int iRes = m_pFSCtrl->SingleShot(m_struSingleFrame);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err. SingleShot";
|
||||
//qDebug() << "Err. SingleShot";
|
||||
printf("Err. SingleShot");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -209,7 +221,8 @@ int CAbsFSController::PerformAutoExposure()
|
||||
int iRes = m_pFSCtrl->SingleShot(dfTemp);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:PerformAutoExposure Failed.Exit Code:2";
|
||||
//qDebug() << "Err:PerformAutoExposure Failed.Exit Code:2";
|
||||
printf("Err:PerformAutoExposure Failed,SingleShot Failed.Exit Code:2");
|
||||
return 2;
|
||||
}
|
||||
|
||||
@ -284,7 +297,8 @@ int CAbsFSController::PerformAutoExposure()
|
||||
iRes = m_pFSCtrl->SetExposureTime(m_struDeviceAttr.iMinIntegrationTimeInMS);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:PerformAutoExposure Failed.Exit Code:3" ;
|
||||
//qDebug() << "Err:PerformAutoExposure Failed.Exit Code:3" ;
|
||||
printf("Err:PerformAutoExposure Failed,SetExposureTime Failed.Exit Code:2");
|
||||
return 3;
|
||||
}
|
||||
else
|
||||
@ -304,7 +318,8 @@ int CAbsFSController::PerformAutoExposure()
|
||||
iRes = m_pFSCtrl->SetExposureTime(m_struDeviceAttr.iMaxIntegrationTimeInMS - 1);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:PerformAutoExposure Failed.Exit Code:3";
|
||||
//qDebug() << "Err:PerformAutoExposure Failed.Exit Code:3";
|
||||
printf("Err:PerformAutoExposure Failed,SetExposureTime Failed.Exit Code:3");
|
||||
return 3;
|
||||
}
|
||||
else
|
||||
@ -318,7 +333,8 @@ int CAbsFSController::PerformAutoExposure()
|
||||
iRes = m_pFSCtrl->SetExposureTime((int)iExposureTime);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:PerformAutoExposure Failed.Exit Code:4" ;
|
||||
//qDebug() << "Err:PerformAutoExposure Failed.Exit Code:4" ;
|
||||
printf("Err:PerformAutoExposure Failed,SetExposureTime Failed.Exit Code:4");
|
||||
return 3;
|
||||
}
|
||||
else
|
||||
@ -342,7 +358,8 @@ int CAbsFSController::CheckAndAdjust_Fast()
|
||||
int iRes = m_pFSCtrl->GetExposureTime(iExposureTime);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err. SingleShot";
|
||||
//qDebug() << "Err. SingleShot";
|
||||
printf("CheckAndAdjust_Fast,Err. SingleShot");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -24,12 +24,15 @@ int CMainGrabber::SetContext(BD357Controller &pctrlGPS, DataFileProcessor &dfpDa
|
||||
{
|
||||
if (&pctrlGPS == NULL)
|
||||
{
|
||||
qDebug() << "GPS Not Initialized";
|
||||
//qDebug() << "GPS Not Initialized";
|
||||
printf("GPS Not Initialized");
|
||||
return 1;
|
||||
}
|
||||
|
||||
m_pctrlGPS = &pctrlGPS;
|
||||
m_dfpDataSaver = &dfpDataSaver;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CMainGrabber::Initialize()
|
||||
@ -40,6 +43,8 @@ int CMainGrabber::Initialize()
|
||||
|
||||
int CMainGrabber::StartGrab()
|
||||
{
|
||||
system("gpio write 5 1");
|
||||
m_dfpDataSaver->GenerateFilePath();
|
||||
m_pctrlFS->PerformAutoExposure();
|
||||
DataFrame dfTemp;
|
||||
m_iFlagIsCapture = 1;
|
||||
@ -50,20 +55,26 @@ int CMainGrabber::StartGrab()
|
||||
qtTime.start();
|
||||
|
||||
////////////
|
||||
system("gpio write 5 0");
|
||||
qDebug() << "system IO";
|
||||
m_pctrlFS->SingleShot(dfTemp);
|
||||
qDebug() << "SingleShot";
|
||||
RemoveBackground(dfTemp);
|
||||
CheckExposureTime(dfTemp);
|
||||
m_dfpDataSaver->WriteData(dfTemp);
|
||||
system("gpio write 5 1");
|
||||
////////////
|
||||
|
||||
//int iMillisec = qtTime.elapsed();
|
||||
int iSleep =m_struFSRunParams.dMinSamplingInterval - qtTime.elapsed();
|
||||
if (iSleep>0)
|
||||
{
|
||||
Delay_MSec(iSleep);
|
||||
}
|
||||
qDebug() << "Delay_MSec"<<iSleep;
|
||||
int iSleep =m_struFSRunParams.dMinSamplingInterval - qtTime.elapsed();
|
||||
if (iSleep>0)
|
||||
{
|
||||
Delay_MSec(iSleep);
|
||||
}
|
||||
qDebug() << "Delay_MSec"<< iSleep;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CMainGrabber::Initialize_Self()
|
||||
@ -73,6 +84,8 @@ int CMainGrabber::Initialize_Self()
|
||||
LoadDCT();
|
||||
|
||||
emit Signal_InitFinished();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CMainGrabber::Delay_MSec(ZZ_U16 usMS)
|
||||
@ -100,7 +113,6 @@ int CMainGrabber::InitializeWorkers()
|
||||
Delay_MSec(1000);
|
||||
}
|
||||
m_pctrlFS->GetDeviceAttr(m_struDeviceAttr);
|
||||
m_dfpDataSaver->GenerateFilePath();
|
||||
m_dfpDataSaver->WriteWavelengthInfo(m_struDeviceAttr.fWaveLengthInNM, m_struDeviceAttr.iPixels);
|
||||
return 0;
|
||||
}
|
||||
@ -120,6 +132,8 @@ int CMainGrabber::LoadDCT()
|
||||
m_DCTable.Initialize_Part();
|
||||
m_DCTable.LoadTable();
|
||||
m_DCTable.GetDCTable(m_vecDataFrame);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CMainGrabber::CheckExposureTime(DataFrame dfTemp)
|
||||
@ -164,9 +178,20 @@ int CMainGrabber::CheckExposureTime(DataFrame dfTemp)
|
||||
|
||||
if ((dExpTimeMS <= m_struDeviceAttr.iMinIntegrationTimeInMS)|| (dExpTimeMS > m_struDeviceAttr.iMaxIntegrationTimeInMS - 1))
|
||||
{
|
||||
qDebug() << "SetExposureTime out of range";
|
||||
return 1;
|
||||
if ((dExpTimeMS <= m_struDeviceAttr.iMinIntegrationTimeInMS))
|
||||
{
|
||||
dExpTimeMS = m_struDeviceAttr.iMinIntegrationTimeInMS;
|
||||
qDebug() << "SetExposureTime out of range-Min";
|
||||
return 1;
|
||||
}
|
||||
if ((dExpTimeMS > m_struDeviceAttr.iMaxIntegrationTimeInMS - 1))
|
||||
{
|
||||
dExpTimeMS = m_struDeviceAttr.iMaxIntegrationTimeInMS - 1;
|
||||
qDebug() << "SetExposureTime out of range-Max";
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
m_pctrlFS->SetExposureTime((int)dExpTimeMS);
|
||||
|
Reference in New Issue
Block a user