Commit 6d7ade15 authored by Emmanuel Papillon's avatar Emmanuel Papillon
Browse files

use temperature/humidity instead of board_000/th0_temp which are deprecated

add method to get api version string
add 2 attributes on server to get api version and detector dcu ip
parent 49da9069
Pipeline #41598 passed with stages
in 12 minutes and 35 seconds
......@@ -119,6 +119,7 @@ class LIBEIGER Camera : public HwMaxImageSizeCallbackGen, public EventCallbackGe
// -- Eiger specific
void getApiGeneration(ApiGeneration&);
void getApiVersion(std::string&);
void getTemperature(double&);
void getHumidity(double&);
......@@ -239,6 +240,7 @@ class LIBEIGER Camera : public HwMaxImageSizeCallbackGen, public EventCallbackGe
//- camera stuff
ApiGeneration m_api;
std::string m_api_version;
std::string m_detector_model;
std::string m_detector_type;
unsigned int m_maxImageWidth, m_maxImageHeight;
......
......@@ -103,8 +103,8 @@ struct ParamIndex
ParamIndex ParamDescription[] = {
// Detector Read only values
{Requests::TEMP, {"board_000/th0_temp",CSTR_SUBSYSTEMDETECTOR,CSTR_EIGERSTATUS}},
{Requests::HUMIDITY, {"board_000/th0_humidity",CSTR_SUBSYSTEMDETECTOR,CSTR_EIGERSTATUS}},
{Requests::TEMP, {"temperature",CSTR_SUBSYSTEMDETECTOR,CSTR_EIGERSTATUS}},
{Requests::HUMIDITY, {"humidity",CSTR_SUBSYSTEMDETECTOR,CSTR_EIGERSTATUS}},
{Requests::HVSTATE, {"high_voltage/state",CSTR_SUBSYSTEMDETECTOR,CSTR_EIGERSTATUS}},
{Requests::DETECTOR_STATUS, {"state",CSTR_SUBSYSTEMDETECTOR,CSTR_EIGERSTATUS}},
{Requests::PIXELDEPTH, {"bit_depth_readout"}},
......
......@@ -78,6 +78,7 @@ namespace Eiger
// -- Eiger specific
void getApiGeneration(ApiGeneration& /Out/);
void getApiVersion(std::string& /Out/);
void getTemperature(double& /Out/);
void getHumidity(double& /Out/);
......
......@@ -140,14 +140,14 @@ Camera::Camera(const std::string& host, int http_port, int stream_port) ///< [in
m_requests = new Requests(http_address);
// Detect EigerAPI version
std::string api_version = m_requests->get_api_version();
DEB_TRACE() << DEB_VAR1(api_version);
if (api_version == "1.6.0")
m_api_version = m_requests->get_api_version();
DEB_TRACE() << DEB_VAR1(m_api_version);
if (m_api_version == "1.6.0")
m_api = Eiger1;
else if (api_version == "1.8.0")
else if (m_api_version == "1.8.0")
m_api = Eiger2;
else
THROW_HW_ERROR(Error) << "Unknown " << DEB_VAR1(api_version);
THROW_HW_ERROR(Error) << "Unknown " << DEB_VAR1(m_api_version);
DEB_TRACE() << DEB_VAR1(m_api);
// Init EigerAPI
......@@ -812,7 +812,7 @@ bool Camera::allFramesAcquired()
//-----------------------------------------------------------------------------
/// Returns the API generation of the detector
/*!
@return temperature value
@return API generation (eiger1, eiger2)
*/
//-----------------------------------------------------------------------------
void Camera::getApiGeneration(ApiGeneration& api)
......@@ -822,6 +822,18 @@ void Camera::getApiGeneration(ApiGeneration& api)
DEB_RETURN() << DEB_VAR1(api);
}
//-----------------------------------------------------------------------------
/// Returns the API version of the detector
/*!
@return api version string (1.6.0/1.8.0)
*/
//-----------------------------------------------------------------------------
void Camera::getApiVersion(std::string& api)
{
DEB_MEMBER_FUNCT();
api = m_api_version;
DEB_RETURN() << DEB_VAR1(api);
}
//-----------------------------------------------------------------------------
/// Returns the temperature of the detector
/*!
......
......@@ -154,6 +154,14 @@ class Eiger(PyTango.Device_4Impl):
stream_stats_arr = self.latchStreamStatistics(False)
attr.set_value(stream_stats_arr)
@Core.DEB_MEMBER_FUNCT
def read_detector_ip(self, attr):
ip_addr = self.detector_ip_address
ip_addr = ip_addr.replace("100ge1", "")
ip_addr = ip_addr.replace("10ge1", "")
ip_addr = ip_addr.replace("ge1", "")
attr.set_value(ip_addr)
#==================================================================
#
# Eiger command methods
......@@ -244,6 +252,14 @@ class EigerClass(PyTango.DeviceClass):
[[PyTango.DevString,
PyTango.SCALAR,
PyTango.READ]],
'api_version':
[[PyTango.DevString,
PyTango.SCALAR,
PyTango.READ]],
'detector_ip':
[[PyTango.DevString,
PyTango.SCALAR,
PyTango.READ]],
'temperature':
[[PyTango.DevFloat,
PyTango.SCALAR,
......
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