Commit c5796542 authored by Laurent Claustre's avatar Laurent Claustre

Fixed incompatibility with Zyla camera model

parent 274901fa
......@@ -147,9 +147,11 @@ namespace lima
// -- andor3 specific, LIMA don't worry about it !
void initialiseController();
void setAdcGain(A3_Gain iGain); // à exporter (avec le get)
// AdcGain is deprecated, should use SimpleGain (Zyla does not have AdcGain feature).
void setAdcGain(A3_Gain iGain);
void getAdcGain(A3_Gain &oGain) const;
void getAdcGainString(std::string &oGainString) const;
void setAdcRate(A3_ReadOutRate iRate); // à exporter (avec le get)
void getAdcRate(A3_ReadOutRate &oRate) const;
void getAdcRateString(std::string &oRateString) const;
......@@ -257,27 +259,27 @@ namespace lima
// -- Members
// LIMA / Acquisition (thread) related :
_BufferCtrlObj* m_buffer_ctrl_obj;
_BufferCtrlObj* m_buffer_ctrl_obj;
// Pure thread and signals :
_AcqThread* m_acq_thread; // The thread retieving frame buffers from the SDK
Cond m_cond; // Waiting condition for inter thread signaling
volatile bool m_acq_thread_waiting; // The m_acq_thread is waiting (main uses it to tell it to stop waiting)
volatile bool m_acq_thread_running; // The m_acq_thread is running (main uses it to accept stopAcq)
volatile bool m_acq_thread_should_quit; // The main thread signals to m_acq_thread that it should quit.
_AcqThread* m_acq_thread; // The thread retieving frame buffers from the SDK
Cond m_cond; // Waiting condition for inter thread signaling
volatile bool m_acq_thread_waiting; // The m_acq_thread is waiting (main uses it to tell it to stop waiting)
volatile bool m_acq_thread_running; // The m_acq_thread is running (main uses it to accept stopAcq)
volatile bool m_acq_thread_should_quit;// The main thread signals to m_acq_thread that it should quit.
// A bit more general :
size_t m_nb_frames_to_collect; // The number of frames to collect in current sequence
size_t m_image_index; // The index in the current sequence of the next image to retrieve
bool m_buffer_ringing; // Should the buffer be considered as a ring buffer rather than a single use buffer.
Status m_status; // The current status of the camera
size_t m_nb_frames_to_collect; // The number of frames to collect in current sequence
size_t m_image_index; // The index in the current sequence of the next image to retrieve
bool m_buffer_ringing; // Should the buffer be considered as a ring buffer rather than a single use buffer.
Status m_status; // The current status of the camera
// LIMA / Not directly acquisition related :
bool m_real_camera; // Set to false for CameraModel == "SIMCAM CMOS"
bool m_real_camera; // Set to false for CameraModel == "SIMCAM CMOS"
std::string m_detector_model;
std::string m_detector_type;
std::string m_detector_serial;
Size m_detector_size;
double m_exp_time;
std::string m_detector_serial;
Size m_detector_size;
double m_exp_time;
// -- andor3 SDK stuff
std::string m_bitflow_path;
......@@ -285,17 +287,18 @@ namespace lima
AT_H m_camera_handle;
mutable std::string m_camera_error_str;
mutable int m_camera_error;
A3_Gain m_adc_gain;
A3_ReadOutRate m_adc_rate;
A3_ShutterMode m_electronic_shutter_mode;
A3_Gain m_adc_gain;
A3_SimpleGain m_simple_gain;
A3_ReadOutRate m_adc_rate;
A3_ShutterMode m_electronic_shutter_mode;
A3_BitDepth m_bit_depth;
A3_TriggerMode m_trig_mode;
A3_TriggerMode m_trig_mode;
bool m_cooler;
double m_temperature_sp;
// std::map<TrigMode, int> m_trig_mode_maps;
std::map<int, std::string> m_andor3_error_maps;
static bool sAndorSDK3Initted;
static bool sAndorSDK3Initted;
bool m_destride_active;
bool m_maximage_size_cb_active;
......
......@@ -183,6 +183,7 @@ m_bitflow_path(bitflow_path),
m_camera_number(camera_number),
m_camera_handle(AT_HANDLE_UNINITIALISED),
m_adc_gain(Gain1_Gain4),
m_simple_gain(b16_lh_gain),
m_adc_rate(MHz100),
m_electronic_shutter_mode(Rolling),
m_bit_depth(b16),
......@@ -443,7 +444,7 @@ lima::Andor3::Camera::prepareAcq()
else {
DEB_TRACE() << "m_nb_frames_to_collect=" << m_nb_frames_to_collect << " : setting the camera in fixed number of frame mode";
//setEnumString(andor3::CycleMode, L"Fixed");
// LOLO TEST
// Better to use continuous mode, smaller ring-buffer allocated by SDK. L.Claustre
// Try in continuous mode
setEnumString(andor3::CycleMode, L"Continuous");
//DEB_TRACE() << "Then setting the number of frame appropriatly";
......@@ -1130,14 +1131,14 @@ void
lima::Andor3::Camera::initialiseController()
{
DEB_MEMBER_FUNCT();
A3_BitDepth the_bd = m_bit_depth;
A3_Gain the_gain = m_adc_gain;
A3_BitDepth the_bd = m_bit_depth;
A3_SimpleGain the_simple_gain = m_simple_gain;
A3_ReadOutRate the_rate = m_adc_rate;
// Carefully crafting the order, since some are affecting others...
setElectronicShutterMode(m_electronic_shutter_mode);
setTriggerMode(m_trig_mode);
setAdcGain(the_gain);
setSimpleGain(the_simple_gain);
setAdcRate(the_rate);
setBitDepth(the_bd);
setCooler(m_cooler);
......@@ -1288,9 +1289,9 @@ lima::Andor3::Camera::setElectronicShutterMode(A3_ShutterMode iMode)
// Setting the trigger mode might change the ADCGain and ADCRate :
int the_gain, the_rate;
getEnumIndex(andor3::PreAmpGainControl, &the_gain);
getEnumIndex(andor3::SimplePreAmpGainControl, &the_gain);
getEnumIndex(andor3::PixelReadoutRate, &the_rate);
setAdcGain(static_cast<A3_Gain>(the_gain));
setSimpleGain(static_cast<A3_SimpleGain>(the_gain));
setAdcRate(static_cast<A3_ReadOutRate>(the_rate));
}
......@@ -1424,13 +1425,19 @@ void
lima::Andor3::Camera::setTemperatureSP(double temp)
{
DEB_MEMBER_FUNCT();
setFloat(andor3::TargetSensorTemperature, temp);
getFloat(andor3::TargetSensorTemperature, &m_temperature_sp);
if ( abs(m_temperature_sp - temp) > 0.1) {
DEB_ERROR() << "Proof-reading temperature set-point : "
<< "\n\tproof-read = " << m_temperature_sp
<< "\n\twhile asked to be = " << temp;
THROW_HW_ERROR(Error) << "Failed on setting temperature set-point";
// Zyla-5.5 camera is supposed to not have this feature, but propImplemented returned True !!!
if ( propImplemented(andor3::TargetSensorTemperature) && m_detector_model.find("ZYLA5.5")==std::string::npos ) {
setFloat(andor3::TargetSensorTemperature, temp);
getFloat(andor3::TargetSensorTemperature, &m_temperature_sp);
if ( abs(m_temperature_sp - temp) > 0.1) {
DEB_ERROR() << "Proof-reading temperature set-point : "
<< "\n\tproof-read = " << m_temperature_sp
<< "\n\twhile asked to be = " << temp;
THROW_HW_ERROR(Error) << "Failed on setting temperature set-point";
}
}
else {
DEB_ALWAYS() << "The camera has no temperature control... Do nothing !";
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment