Commit fae82011 authored by Laurent Claustre's avatar Laurent Claustre

* Changed for get/setBaselineClamp() now using BaseLineClamp Enumerate to...

* Changed for get/setBaselineClamp() now using  BaseLineClamp Enumerate to manage UNSUPPORTED capability like for HighCapacity and FanMode.
* Improved doc/index.rst documentation
parent bb5586c3
......@@ -12,7 +12,7 @@ Andor Technology manufactuer offers a large catalogue of scientific cameras. Cov
Andor is providing a unique Software Development Tool (SDK) for both Windows and Linux, supporting different interface buses such as USB, CameraLink and also some specific acquisition PCI board.
The Lima module as been tested only with this cameras models:
- IKon-M (USB interface, Linux OS)
- IKon-M and IKon-L (USB interface, Linux OS debian 6)
- IKon-L (USB interface, Windows XP - 32bits)
Prerequisite Linux OS
......@@ -93,6 +93,15 @@ can be applied with -1 as passed value:
set/getADCSpeed()
Some other methods are available but they can not be supported depending on which camera model you are using:
set/getHighCapacity()
set/getFanMode()
set/getBaselineClamp()
The above parameters, only support enumerate type for values.
Std capabilites
................
......@@ -151,7 +160,7 @@ This is a python code example for a simple test:
cam = Andor.Camera("/usr/local/etc/andor", 0)
hwint = Andor.Interface(cam)
ct = Core.control(hwint)
ct = Core.CtControl(hwint)
acq = ct.acquisition()
......@@ -160,7 +169,11 @@ This is a python code example for a simple test:
hwint.setCooler(True)
.... wait here for cooling
# set some low level configuration
hwint.setPGain(2)
hwint.setFanMode(FAN_ON_FULL)
hwint.setHighCapacity(HIGH_SENSITIVITY)
hwint.setBaselineClamp(BLCLAMP_ENABLED)
# setting new file parameters and autosaving mode
......@@ -195,6 +208,14 @@ This is a python code example for a simple test:
ct.prepareAcq()
ct.startAcq()
# wait for last image (#9) ready
lastimg = control.getStatus().ImageCounters.LastImageReady
while lastimg !=9:
time.sleep(1)
lastimg = control.getStatus().ImageCounters.LastImageReady
# read a image
im0 = control.ReadImage(0)
......@@ -131,6 +131,13 @@ namespace lima
FAN_ON_LOW,
FAN_OFF,
};
enum BaselineClamp
{
BLCLAMP_UNSUPPORTED = -1,
BLCLAMP_ENABLED = 0,
BLCLAMP_DISABLED = 1
};
/*******************************************************************
* \class Camera
......@@ -247,8 +254,8 @@ namespace lima
void getFanMode(FanMode& mode);
void setGateMode(GateMode mode);
//void setReadMode(ReadMode mode);
void setBaselineClamp(bool enable);
void getBaselineClamp(bool& enable);
void setBaselineClamp(BaselineClamp mode);
void getBaselineClamp(BaselineClamp& mode);
private:
class _AcqThread;
......@@ -284,6 +291,7 @@ namespace lima
int m_detector_serial;
FanMode m_fan_mode;
HighCapacityMode m_high_capacity;
BaselineClamp m_baseline_clamp;
//- andor SDK stuff
string m_config_path;
......
......@@ -91,8 +91,8 @@ namespace lima
void setGateMode(GateMode mode);
//! get the camera object to access it directly from client
Camera& getCamera() { return m_cam;}
void setBaselineClamp(bool enable);
void getBaselineClamp(bool& enable);
void setBaselineClamp(BaselineClamp mode);
void getBaselineClamp(BaselineClamp& mode);
private:
Camera& m_cam;
......
......@@ -50,6 +50,13 @@ namespace Andor
FAN_OFF
};
enum BaselineClamp
{
BLCLAMP_UNSUPPORTED = -1,
BLCLAMP_ENABLED = 0,
BLCLAMP_DISABLED = 1
};
class Camera
{
%TypeHeaderCode
......@@ -155,8 +162,8 @@ namespace Andor
void getFanMode(Andor::FanMode& mode /Out/);
//void setReadMode(Andor::ReadMode mode);
void setBaselineClamp(bool enable);
void getBaselineClamp(bool& enable /Out/);
void setBaselineClamp(Andor::BaselineClamp mode);
void getBaselineClamp(Andor::BaselineClamp& mode /Out/);
};
......
......@@ -49,7 +49,7 @@ namespace Andor
void setGateMode(Andor::GateMode mode);
void setFanMode(Andor::FanMode mode);
void getFanMode(Andor::FanMode& mode /Out/);
void setBaselineClamp(bool enable);
void getBaselineClamp(bool& enable /Out/);
void setBaselineClamp(Andor::BaselineClamp mode);
void getBaselineClamp(Andor::BaselineClamp& mode /Out/);
};
};
......@@ -75,6 +75,7 @@ Camera::Camera(const std::string& config_path,int camera_number)
m_shutter_state(false),
m_fan_mode(FAN_UNSUPPORTED),
m_high_capacity(HC_UNSUPPORTED),
m_baseline_clamp(BLCLAMP_UNSUPPORTED),
m_camera_handle(0),
m_adc_speed_number(0),
m_adc_speed_max(0),
......@@ -166,11 +167,13 @@ Camera::Camera(const std::string& config_path,int camera_number)
// --- Initialise deeper parameters of the controller
initialiseController();
// Fan off and HighCapacity mode as default if supported
// Fan off, HighCapacity mode and Baseline clamping off as default if supported
if (m_camera_capabilities.ulSetFunctions & AC_SETFUNCTION_HIGHCAPACITY)
setHighCapacity(HIGH_CAPACITY);
if (m_camera_capabilities.ulFeatures & AC_FEATURES_FANCONTROL)
setFanMode(FAN_OFF);
if (m_camera_capabilities.ulSetFunctions & AC_SETFUNCTION_BASELINECLAMP)
setBaselineClamp(BLCLAMP_DISABLED);
//--- Set detector for single image acquisition and get max binning
m_read_mode = 4;
......@@ -1750,37 +1753,31 @@ void Camera::setGateMode(GateMode mode)
//-----------------------------------------------------
// @brief set enable (true) or disable (false) the baseline clamping
// @param enable true or false
// @brief set on or off the baseline clamping
// @param BLCLAMP_OFF or BLCLAMP_ON
//
//-----------------------------------------------------
void Camera::setBaselineClamp(bool enable)
void Camera::setBaselineClamp(BaselineClamp mode)
{
DEB_MEMBER_FUNCT();
if (m_camera_capabilities.ulSetFunctions & AC_SETFUNCTION_BASELINECLAMP)
{
THROW_IF_NOT_SUCCESS(SetBaselineClamp((enable)?1:0), "Error while setting gate mode");
THROW_IF_NOT_SUCCESS(SetBaselineClamp(mode), "Error while setting Baseline Clamp");
}
else
THROW_HW_ERROR(Error) << "Baseline Clamp control not supported for this camera model";
m_baseline_clamp = mode;
}
//-----------------------------------------------------
// @brief get baseline clamp status
// @param enable true or false
// @brief get baseline clamp mode
// @param BLCLAMP_UNSUPPORTED, BLCLAMP_ON or BLCLAMP_OFF
//
//-----------------------------------------------------
void Camera::getBaselineClamp(bool& enable)
void Camera::getBaselineClamp(BaselineClamp& mode)
{
DEB_MEMBER_FUNCT();
int state;
if (m_camera_capabilities.ulFeatures & AC_FEATURES_FANCONTROL)
{
THROW_IF_NOT_SUCCESS(GetBaselineClamp(&state), "Error while setting gate mode");
}
else
THROW_HW_ERROR(Error) << "Baseline Clamp control not supported for this camera model";
enable = (state==1)? true: false;
mode = m_baseline_clamp;
}
......
......@@ -395,24 +395,24 @@ void Interface::setGateMode(GateMode mode)
}
//-----------------------------------------------------
// @brief Gets the baseline clamp status
// @param enable enable (true) or disable (false)
// @brief get baseline clamp mode
// @param BLCLAMP_UNSUPPORTED, BLCLAMP_ON or BLCLAMP_OFF
//
//-----------------------------------------------------
void Interface::getBaselineClamp(bool& enable)
void Interface::getBaselineClamp(BaselineClamp& mode)
{
m_cam.getBaselineClamp(enable);
m_cam.getBaselineClamp(mode);
}
//-----------------------------------------------------
// @brief Sets the gate mode
// @param enable enable (true) or disable (false)
// @brief set on or off the baseline clamping
// @param BLCLAMP_OFF or BLCLAMP_ON
//
//-----------------------------------------------------
void Interface::setBaselineClamp(bool enable)
void Interface::setBaselineClamp(BaselineClamp mode)
{
m_cam.setBaselineClamp(enable);
m_cam.setBaselineClamp(mode);
}
//-----------------------------------------------------
......
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