1、在界面上实现选择相机类型的功能; 2、创建了一个光谱仪操作的纯虚基类(ImagerOperationBase)并实现了大部分的操作,具体类型的光谱仪应继承此类并实现纯虚函数; 3、添加了 resonon 的 nir 320 相机,修改 resonon 的 pica l 相机的实现:继承 ImagerOperationBase; 4、重构类 QMotorDoubleSlider,提高其通用性,所有马达相关的 slider 都使用此类; 5、适配 resonon nir 320 显微镜使用的 2 轴线性平台,有些特殊的马达参数设置(setMotorParamMicroscope 函数)绑定了 nir 的相机类型参数; 6、修改:将线性平台的量程信息保存在cfg配置文件中,并修改配置文件读写类来读写此量程信息;
106 lines
1.9 KiB
C++
106 lines
1.9 KiB
C++
#include "resononImager.h"
|
|
|
|
ResononPicaLImager::ResononPicaLImager()
|
|
{
|
|
|
|
}
|
|
|
|
ResononPicaLImager::~ResononPicaLImager()
|
|
{
|
|
if (buffer != nullptr)
|
|
{
|
|
std::cout << "ÊͷŶÑÉÏÄÚ´æ" << std::endl;
|
|
free(buffer);
|
|
free(dark);
|
|
free(white);
|
|
}
|
|
}
|
|
|
|
double ResononPicaLImager::getFramerate()
|
|
{
|
|
return m_ResononPicaLImager.get_framerate();
|
|
}
|
|
|
|
double ResononPicaLImager::getIntegrationTime()
|
|
{
|
|
return m_ResononPicaLImager.get_integration_time();
|
|
}
|
|
|
|
double ResononPicaLImager::getGain()
|
|
{
|
|
return m_ResononPicaLImager.get_gain();
|
|
}
|
|
|
|
void ResononPicaLImager::setGain(const double gain)
|
|
{
|
|
m_ResononPicaLImager.set_gain(gain);
|
|
}
|
|
|
|
void ResononPicaLImager::setFramerate(const double frames_per_second)
|
|
{
|
|
m_ResononPicaLImager.set_framerate(frames_per_second);
|
|
m_RgbImage->m_iFramerate = frames_per_second;
|
|
}
|
|
|
|
void ResononPicaLImager::setIntegrationTime(const double milliseconds)
|
|
{
|
|
m_ResononPicaLImager.set_integration_time(milliseconds);
|
|
}
|
|
|
|
int ResononPicaLImager::getStartBand()
|
|
{
|
|
return m_ResononPicaLImager.get_start_band();
|
|
}
|
|
|
|
int ResononPicaLImager::getEndBand()
|
|
{
|
|
return m_ResononPicaLImager.get_end_band();
|
|
}
|
|
|
|
void ResononPicaLImager::connectImager(const char* camera_sn)
|
|
{
|
|
m_ResononPicaLImager.connect();
|
|
}
|
|
|
|
void ResononPicaLImager::disconnectImager()
|
|
{
|
|
m_ResononPicaLImager.disconnect();
|
|
}
|
|
|
|
void ResononPicaLImager::imagerStartCollect()
|
|
{
|
|
m_ResononPicaLImager.start();
|
|
}
|
|
|
|
void ResononPicaLImager::imagerStopCollect()
|
|
{
|
|
m_ResononPicaLImager.stop();
|
|
}
|
|
|
|
unsigned short* ResononPicaLImager::getFrame(unsigned short* buffer)
|
|
{
|
|
m_ResononPicaLImager.get_frame(buffer);
|
|
|
|
return buffer;
|
|
}
|
|
|
|
void ResononPicaLImager::setSpectraBin(int new_spectral_bin)
|
|
{
|
|
|
|
}
|
|
|
|
double ResononPicaLImager::getWavelengthAtBand(int band)
|
|
{
|
|
return m_ResononPicaLImager.get_wavelength_at_band(band);
|
|
}
|
|
|
|
int ResononPicaLImager::getBandCount()
|
|
{
|
|
return m_ResononPicaLImager.get_band_count();
|
|
}
|
|
|
|
int ResononPicaLImager::getSampleCount()
|
|
{
|
|
return m_ResononPicaLImager.get_sample_count();
|
|
}
|