2023-03-14 22:52:38 +08:00
|
|
|
|
#include "resononImager.h"
|
|
|
|
|
|
|
2024-12-11 13:50:03 +08:00
|
|
|
|
ResononPicaLImager::ResononPicaLImager()
|
2023-03-14 22:52:38 +08:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-11 13:50:03 +08:00
|
|
|
|
ResononPicaLImager::~ResononPicaLImager()
|
2023-03-14 22:52:38 +08:00
|
|
|
|
{
|
|
|
|
|
|
if (buffer != nullptr)
|
|
|
|
|
|
{
|
|
|
|
|
|
std::cout << "<EFBFBD>ͷŶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>" << std::endl;
|
|
|
|
|
|
free(buffer);
|
|
|
|
|
|
free(dark);
|
|
|
|
|
|
free(white);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-11 13:50:03 +08:00
|
|
|
|
double ResononPicaLImager::getFramerate()
|
2023-03-14 22:52:38 +08:00
|
|
|
|
{
|
2024-12-11 13:50:03 +08:00
|
|
|
|
return m_ResononPicaLImager.get_framerate();
|
2023-03-14 22:52:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-11 13:50:03 +08:00
|
|
|
|
double ResononPicaLImager::getIntegrationTime()
|
2023-03-14 22:52:38 +08:00
|
|
|
|
{
|
2024-12-11 13:50:03 +08:00
|
|
|
|
return m_ResononPicaLImager.get_integration_time();
|
2023-03-14 22:52:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-11 13:50:03 +08:00
|
|
|
|
double ResononPicaLImager::getGain()
|
2023-03-14 22:52:38 +08:00
|
|
|
|
{
|
2024-12-11 13:50:03 +08:00
|
|
|
|
return m_ResononPicaLImager.get_gain();
|
2023-03-14 22:52:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-11 13:50:03 +08:00
|
|
|
|
void ResononPicaLImager::setGain(const double gain)
|
2023-03-14 22:52:38 +08:00
|
|
|
|
{
|
2024-12-11 13:50:03 +08:00
|
|
|
|
m_ResononPicaLImager.set_gain(gain);
|
2023-03-14 22:52:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-11 13:50:03 +08:00
|
|
|
|
void ResononPicaLImager::setFramerate(const double frames_per_second)
|
2023-03-14 22:52:38 +08:00
|
|
|
|
{
|
2024-12-11 13:50:03 +08:00
|
|
|
|
m_ResononPicaLImager.set_framerate(frames_per_second);
|
|
|
|
|
|
m_RgbImage->m_iFramerate = frames_per_second;
|
2023-03-14 22:52:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-11 13:50:03 +08:00
|
|
|
|
void ResononPicaLImager::setIntegrationTime(const double milliseconds)
|
2023-03-14 22:52:38 +08:00
|
|
|
|
{
|
2024-12-11 13:50:03 +08:00
|
|
|
|
m_ResononPicaLImager.set_integration_time(milliseconds);
|
2023-03-14 22:52:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-11 13:50:03 +08:00
|
|
|
|
int ResononPicaLImager::getStartBand()
|
2023-03-14 22:52:38 +08:00
|
|
|
|
{
|
2024-12-11 13:50:03 +08:00
|
|
|
|
return m_ResononPicaLImager.get_start_band();
|
2023-03-14 22:52:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-11 13:50:03 +08:00
|
|
|
|
int ResononPicaLImager::getEndBand()
|
2023-03-14 22:52:38 +08:00
|
|
|
|
{
|
2024-12-11 13:50:03 +08:00
|
|
|
|
return m_ResononPicaLImager.get_end_band();
|
2023-03-14 22:52:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-11 13:50:03 +08:00
|
|
|
|
void ResononPicaLImager::connectImager(const char* camera_sn)
|
2023-03-14 22:52:38 +08:00
|
|
|
|
{
|
2024-12-11 13:50:03 +08:00
|
|
|
|
m_ResononPicaLImager.connect();
|
2023-03-14 22:52:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-11 13:50:03 +08:00
|
|
|
|
void ResononPicaLImager::disconnectImager()
|
2023-03-14 22:52:38 +08:00
|
|
|
|
{
|
2024-12-11 13:50:03 +08:00
|
|
|
|
m_ResononPicaLImager.disconnect();
|
2023-03-14 22:52:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-11 13:50:03 +08:00
|
|
|
|
void ResononPicaLImager::imagerStartCollect()
|
2023-03-14 22:52:38 +08:00
|
|
|
|
{
|
2024-12-11 13:50:03 +08:00
|
|
|
|
m_ResononPicaLImager.start();
|
2023-03-14 22:52:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-11 13:50:03 +08:00
|
|
|
|
void ResononPicaLImager::imagerStopCollect()
|
2023-03-14 22:52:38 +08:00
|
|
|
|
{
|
2024-12-11 13:50:03 +08:00
|
|
|
|
m_ResononPicaLImager.stop();
|
2023-03-14 22:52:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-11 13:50:03 +08:00
|
|
|
|
unsigned short* ResononPicaLImager::getFrame(unsigned short* buffer)
|
2023-03-14 22:52:38 +08:00
|
|
|
|
{
|
2024-12-11 13:50:03 +08:00
|
|
|
|
m_ResononPicaLImager.get_frame(buffer);
|
2023-03-14 22:52:38 +08:00
|
|
|
|
|
2024-12-11 13:50:03 +08:00
|
|
|
|
return buffer;
|
2023-03-14 22:52:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-11 13:50:03 +08:00
|
|
|
|
void ResononPicaLImager::setSpectraBin(int new_spectral_bin)
|
2023-03-14 22:52:38 +08:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-11 13:50:03 +08:00
|
|
|
|
double ResononPicaLImager::getWavelengthAtBand(int band)
|
2023-03-14 22:52:38 +08:00
|
|
|
|
{
|
2024-12-11 13:50:03 +08:00
|
|
|
|
return m_ResononPicaLImager.get_wavelength_at_band(band);
|
2023-03-14 22:52:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-11 13:50:03 +08:00
|
|
|
|
int ResononPicaLImager::getBandCount()
|
2023-03-14 22:52:38 +08:00
|
|
|
|
{
|
2024-12-11 13:50:03 +08:00
|
|
|
|
return m_ResononPicaLImager.get_band_count();
|
2023-03-14 22:52:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-11 13:50:03 +08:00
|
|
|
|
int ResononPicaLImager::getSampleCount()
|
2023-03-14 22:52:38 +08:00
|
|
|
|
{
|
2024-12-11 13:50:03 +08:00
|
|
|
|
return m_ResononPicaLImager.get_sample_count();
|
2023-03-14 22:52:38 +08:00
|
|
|
|
}
|