Commit e3e10f86 authored by Alejandro Homs Puron's avatar Alejandro Homs Puron Committed by Alejandro Homs Puron

* Added getHwBitDepth, checking for non-implemented GetBitDepth functionality

  in simulated cameras and returning a default value (b16)
parent 3c54d6ff
......@@ -196,6 +196,8 @@ namespace lima
private:
int getHwBitDepth(int *bit_depth);
// -- some internals :
// Stopping an acquisition, iForce : without waiting the end of frame buffer retrieval by m_acq_thread
void _stopAcq(bool iImmediate);
......
......@@ -372,7 +372,7 @@ lima::Andor3::Camera::prepareAcq()
getEnumString(andor3::BitDepth, the_bit_depth_wc, 255);
the_bit_depth = WStringToString(std::wstring(the_bit_depth_wc));
getEnumIndex(andor3::BitDepth, &the_bit_depth_index);
getHwBitDepth(&the_bit_depth_index);
DEB_TRACE() << "The bit depth of the image is " << the_bit_depth << " (index : " << the_bit_depth_index << ").";
if ( b11 == the_bit_depth_index ) {
......@@ -421,6 +421,8 @@ lima::Andor3::Camera::prepareAcq()
the_frame_dim.setImageType(Bpp16);
break;
default:
DEB_ERROR() << "Trouble: the_bit_depth_index=" << the_bit_depth_index
<< "(b11=" << b11 << ", b16=" << b16 << ")";
//! TODO : again trouble (signal to user), we don't know how to do that.
break;
}
......@@ -1262,9 +1264,8 @@ lima::Andor3::Camera::setAdcGain(A3_Gain iGain)
int the_bit_depth; // Pixel encoding will be reset appropriately in the setBitDepth method
// int the_px_encoding;
getEnumIndex(andor3::BitDepth, &the_bit_depth);
getHwBitDepth(&the_bit_depth);
// getEnumIndex(andor3::PixelEncoding, &the_px_encoding);
setBitDepth(static_cast<A3_BitDepth>(the_bit_depth));
}
......@@ -1375,7 +1376,7 @@ lima::Andor3::Camera::setBitDepth(A3_BitDepth iMode)
DEB_MEMBER_FUNCT();
int the_mode;
setEnumIndex(andor3::BitDepth, static_cast<int>(iMode));
getEnumIndex(andor3::BitDepth, &the_mode);
getHwBitDepth(&the_mode);
m_bit_depth = static_cast<A3_BitDepth>(the_mode);
if ( m_bit_depth != iMode ) {
DEB_ERROR() << "Proof-reading the image bit-depth :"
......@@ -2452,6 +2453,19 @@ lima::Andor3::Camera::sendCommand(const AT_WC* Feature)
return andor3Error(AT_Command(m_camera_handle, Feature));
}
int lima::Andor3::Camera::getHwBitDepth(int *bit_depth)
{
DEB_MEMBER_FUNCT();
int the_err_code = getEnumIndex(andor3::BitDepth, bit_depth);
if ( (the_err_code != AT_ERR_NOTIMPLEMENTED) || m_real_camera )
return the_err_code;
DEB_WARNING() << "Get BitDepth not implemented for simulated camera: "
<< "fixing b16";
*bit_depth = b16;
return AT_SUCCESS;
}
//-----------------------------------------------------
// Taking care of the imptrlementation of the acquisition thread (_AcqThread / m_acq_thread)
//-----------------------------------------------------
......
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