1.修改了海阳光学光谱仪派生类,以支持暗像素信息的获取。
2.针对FLAME设备添加了新的实时暗背景扣除函数。 3.修改了部分系统执行逻辑,以支持FLAME的正确运行。
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "OControl_USB.h"
|
||||
#include <iostream>
|
||||
#include <cstring>
|
||||
@ -86,6 +87,27 @@ int OceanOptics_lib::Initialize(bool bIsUSBMode, std::string ucPortNumber, std::
|
||||
|
||||
SetExposureTime(minimum_time / 1000);
|
||||
|
||||
m_vecDarkPixels.clear();
|
||||
int* piIndex = new int[64];
|
||||
int iCount = seabreeze_get_electric_dark_pixel_indices(m_iSpectralmeterHandle, &error, piIndex, 64);
|
||||
for (int i = 0; i < iCount; i++)
|
||||
{
|
||||
m_vecDarkPixels.push_back(piIndex[i]);
|
||||
}
|
||||
delete[] piIndex;
|
||||
|
||||
qDebug() << "from lib" << iCount;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/*CString cstrTemp, cstrTemp1;
|
||||
for (int i=0;i< m_vecDarkPixels.size();i++)
|
||||
{
|
||||
cstrTemp1.Format(_T("%d"), m_vecDarkPixels[i]);
|
||||
cstrTemp = cstrTemp+L"-"+cstrTemp1;
|
||||
}
|
||||
|
||||
AfxMessageBox(cstrTemp);*/
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -146,6 +168,27 @@ int OceanOptics_lib::Initialize()
|
||||
|
||||
SetExposureTime(minimum_time / 1000);
|
||||
|
||||
m_vecDarkPixels.clear();
|
||||
int *piIndex=new int[64];
|
||||
int iCount = seabreeze_get_electric_dark_pixel_indices(m_iSpectralmeterHandle,&error, piIndex,64);
|
||||
for (int i=0;i< iCount;i++)
|
||||
{
|
||||
m_vecDarkPixels.push_back(piIndex[i]);
|
||||
}
|
||||
delete[] piIndex;
|
||||
|
||||
qDebug() << "from lib" << iCount;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/*CString cstrTemp, cstrTemp1;
|
||||
for (int i=0;i< m_vecDarkPixels.size();i++)
|
||||
{
|
||||
cstrTemp1.Format(_T("%d"), m_vecDarkPixels[i]);
|
||||
cstrTemp = cstrTemp+L"-"+cstrTemp1;
|
||||
}
|
||||
|
||||
AfxMessageBox(cstrTemp);*/
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -286,7 +329,7 @@ int OceanOptics_lib::SingleShot(DataFrame &dfData)
|
||||
|
||||
for (int tmp = 0; tmp < spec_length; tmp++)
|
||||
{
|
||||
dfData.lData[tmp] = spectrum[tmp];
|
||||
dfData.lData[tmp] = (unsigned int)spectrum[tmp];
|
||||
}
|
||||
|
||||
int exposureTimeInMS;
|
||||
@ -416,7 +459,7 @@ int OceanOptics_lib::GetDeviceTemperature(float &fTemperature)
|
||||
return 1;
|
||||
}
|
||||
|
||||
fTemperature = temp;
|
||||
fTemperature = (float)temp;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -484,7 +527,7 @@ int OceanOptics_lib::GetDeviceAttribute(DeviceAttribute &Attr)
|
||||
|
||||
for (int tmp = 0; tmp < spec_length; tmp++)
|
||||
{
|
||||
Attr.fWaveLengthInNM[tmp] = wls[tmp];
|
||||
Attr.fWaveLengthInNM[tmp] = (float)wls[tmp];
|
||||
}
|
||||
|
||||
free(wls);
|
||||
|
Reference in New Issue
Block a user