From 4267f09d203f7dcc5fd19a2802dc272d45150710 Mon Sep 17 00:00:00 2001
From: Arafat Nourredine <arafat.nourredine@synchrotron-soleil.fr>
Date: Thu, 22 Feb 2018 08:59:54 +0000
Subject: [PATCH] minor changes : Rename a data member
---
src/MythenPool.cpp | 60 ++++++++++++++++++++++------------------------
src/MythenPool.h | 51 ++++++++++++++++++++-------------------
2 files changed, 54 insertions(+), 57 deletions(-)
diff --git a/src/MythenPool.cpp b/src/MythenPool.cpp
index acb4573..36c2247 100644
--- a/src/MythenPool.cpp
+++ b/src/MythenPool.cpp
@@ -25,7 +25,6 @@
namespace MythenWAXS_ns
{
-
//----------------------------------------------------------------------------------------------------------------------
//- MythenPool Ctor
//----------------------------------------------------------------------------------------------------------------------
@@ -65,7 +64,6 @@ void MythenPool::set_state(Tango::DevState state)
}
}
-
//----------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------
@@ -79,7 +77,6 @@ Tango::DevState MythenPool::get_state()
}
}
-
//----------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------
@@ -273,7 +270,7 @@ void MythenPool::stop()
const std::vector<float>& MythenPool::get_frame_x()
{
yat::MutexLock scoped_lock(m_proxy_lock);
- return m_x_values;
+ return m_frame_x_values;
}
//----------------------------------------------------------------------------------------------------------------------
@@ -282,7 +279,7 @@ const std::vector<float>& MythenPool::get_frame_x()
const std::vector<float>& MythenPool::get_frame_y()
{
yat::MutexLock scoped_lock(m_proxy_lock);
- return m_y_values;
+ return m_frame_y_values;
}
//----------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------
@@ -291,8 +288,8 @@ void MythenPool::compute_frame_xy()
{
yat::MutexLock scoped_lock(m_proxy_lock);
- m_x_values.clear();
- m_y_values.clear();
+ m_frame_x_values.clear();
+ m_frame_y_values.clear();
unsigned nb_total_modules = 0;
//get the motor position tth2C
double theta_position;
@@ -318,16 +315,16 @@ void MythenPool::compute_frame_xy()
for (unsigned k = 0;k < frame.size();k++)
{
double twotheta = theta_position -
- m_deltas.at(nb_total_modules + j) +
- (180.0 / M_PI) * atan((m_centers.at(nb_total_modules + j)-(1279 - k)) * m_prop.pixel_size / m_distances.at(nb_total_modules + j));
+ m_deltas.at(nb_total_modules + j) +
+ (180.0 / M_PI) * atan((m_centers.at(nb_total_modules + j)-(1279 - k)) * m_prop.pixel_size / m_distances.at(nb_total_modules + j));
//NB: Mythen modules are mounted in opposite sens, why we use (1279-k) instead of k !!
- m_x_values.push_back(twotheta);
- m_y_values.push_back(frame.at(k) * m_scales.at(nb_total_modules + j));
+ m_frame_x_values.push_back(twotheta);
+ m_frame_y_values.push_back(frame.at(k) * m_scales.at(nb_total_modules + j));
}
}
- INFO_STREAM << "m_x_values.size() = " << m_x_values.size() << std::endl;
- INFO_STREAM << "m_y_values.size() = " << m_y_values.size() << std::endl;
+ INFO_STREAM << "m_frame_x_values.size() = " << m_frame_x_values.size() << std::endl;
+ INFO_STREAM << "m_frame_y_values.size() = " << m_frame_y_values.size() << std::endl;
nb_total_modules += nb_modules;
INFO_STREAM << "\n" << std::endl;
INFO_STREAM << "nb_total_modules = " << nb_total_modules << std::endl;
@@ -355,8 +352,8 @@ void MythenPool::decode_equation_parameters()
if (line.count() != 4)
{
Tango::Except::throw_exception( "LOGIC_ERROR",
- "Check the format of the 'EquationParameters' Device Property !",
- "MythenPool::decode_equation_parameters()");
+ "Check the format of the 'EquationParameters' Device Property !",
+ "MythenPool::decode_equation_parameters()");
}
for (unsigned itoken = 0; itoken < line.count(); itoken++)
@@ -370,8 +367,8 @@ void MythenPool::decode_equation_parameters()
if (field.count() != 2)
{
Tango::Except::throw_exception( "LOGIC_ERROR",
- "Check the format of the 'EquationParameters' Device Property !",
- "MythenPool::decode_equation_parameters()");
+ "Check the format of the 'EquationParameters' Device Property !",
+ "MythenPool::decode_equation_parameters()");
}
item_name = field[0];
@@ -429,8 +426,8 @@ void MythenPool::decode_equation_parameters()
ostringstream ossMsgErr;
ossMsgErr << e.what();
Tango::Except::throw_exception("LOGIC_ERROR",
- ossMsgErr.str().c_str(),
- "MythenPool::decode_equation_parameters()");
+ ossMsgErr.str().c_str(),
+ "MythenPool::decode_equation_parameters()");
}
}
//----------------------------------------------------------------------------------------------------------------------
@@ -453,7 +450,6 @@ void MythenPool::compute_state_status()
if (m_state != Tango::INIT)
{
//////////////////////////////////////////////////////////
-
try
{
//more than one proxy mythen devices
@@ -488,7 +484,7 @@ void MythenPool::compute_state_status()
break;
case Tango::RUNNING:
running_count++;
- break;
+ break;
default:
fault_count++;
break; //NOP
@@ -529,7 +525,7 @@ void MythenPool::compute_state_status()
status.str("");
status << "At least one Device is in FAULTy state !\n";
status << "---------------------------------------------------\n";
- status<< proxy_status.str();
+ status << proxy_status.str();
set_status(status.str());
DEBUG_STREAM << "MythenPool::compute_state_status() - [END]" << endl;
return;
@@ -543,7 +539,7 @@ void MythenPool::compute_state_status()
status.str("");
status << "Acquisition is Running ...\n";
status << "---------------------------------------------------\n";
- status<< proxy_status.str();
+ status << proxy_status.str();
set_status(status.str());
DEBUG_STREAM << "MythenPool::compute_state_status() - [END]" << endl;
return;
@@ -557,7 +553,7 @@ void MythenPool::compute_state_status()
status.str("");
status << "Waiting for request ...\n";
status << "---------------------------------------------------\n";
- status<< proxy_status.str();
+ status << proxy_status.str();
set_status(status.str());
DEBUG_STREAM << "MythenPool::compute_state_status() - [END]" << endl;
return;
@@ -571,7 +567,7 @@ void MythenPool::compute_state_status()
status.str("");
status << "At least one Device is not in the expected state !\n";
status << "---------------------------------------------------\n";
- status<< proxy_status.str();
+ status << proxy_status.str();
set_status(status.str());
DEBUG_STREAM << "MythenPool::compute_state_status() - [END]" << endl;
return;
@@ -620,9 +616,9 @@ void MythenPool::process_message(yat::Message& msg) throw (Tango::DevFailed)
{
ERROR_STREAM << e.what() << ENDLOG;
std::stringstream status;
- status << "Unable to create proxy to ( " << proxy_name << " ) :\n"
- << "--> Memory allocation exception.\n"
- << endl;
+ status << "Unable to create proxy to ( " << proxy_name << " ) :\n"
+ << "--> Memory allocation exception.\n"
+ << endl;
set_state(Tango::INIT);
set_status(status.str());
return;
@@ -631,10 +627,10 @@ void MythenPool::process_message(yat::Message& msg) throw (Tango::DevFailed)
{
ERROR_STREAM << e << ENDLOG;
std::stringstream status;
- status << "Unable to create proxy to ( " << proxy_name << " ) :\n"
- << "--> check the value of the 'ProxiesNames' property.\n"
- << "--> check the state of the device ( " << proxy_name << " ).\n"
- << endl;
+ status << "Unable to create proxy to ( " << proxy_name << " ) :\n"
+ << "--> check the value of the 'ProxiesNames' property.\n"
+ << "--> check the state of the device ( " << proxy_name << " ).\n"
+ << endl;
set_state(Tango::INIT);
set_status(status.str());
return;
diff --git a/src/MythenPool.h b/src/MythenPool.h
index 415f71b..b84c3d0 100644
--- a/src/MythenPool.h
+++ b/src/MythenPool.h
@@ -89,54 +89,52 @@ public:
/// dtor
virtual ~MythenPool();
- /// get the last state of the task
+ /// get the last state
Tango::DevState get_state();
- /// get the last status of the task
+ /// get the last status
std::string get_status();
- /// start the acquisition
+ /// start the acquisition on all Mythen2Detector devices
void snap();
- /// stop the acquisition
+ /// stop the acquisition on all Mythen2Detector devices
void stop();
- /// write energy
+ /// write energy on all modules of all Mythen2Detector devices
void write_energy(float);
- /// get the last status of the task
+ /// write threshold on all modules of all Mythen2Detector devices
void write_threshold(float);
- /// write threshold
+ /// write exposure on all Mythen2Detector devices
void write_exposure_time(double);
- /// write nbFrames
+ /// write nbFrames on all Mythen2Detector devices
void write_nb_frames(long);
- /// write flatfield correctyion flag
+ /// write flatfield correction flag on all Mythen2Detector devices
void write_flatfield_correction(bool);
- /// write rate correction flag
+ /// write rate correction flag on all Mythen2Detector devices
void write_rate_correction(bool);
- /// write badchannel interpolation flag
+ /// write badchannel interpolation flag on all Mythen2Detector devices
void write_badchannel_interpolation(bool);
- /// read the total nb of modules
+ /// read the total nb of modules of all Mythen2Detector devices
long get_nb_modules();
- /// read the total nb of channels
+ /// read the total nb of channels of all Mythen2Detector devices
long get_nb_channels();
- /// read the frame (x)
+ /// read the frame (x) (twotheta angle in degrees)
const std::vector<float>& get_frame_x();
- /// read the frame (x)
- const std::vector<float>& get_frame_y();
-
- /// compute the frame
- void compute_frame_xy();
+ /// read the frame (y) (intensity)
+ const std::vector<float>& get_frame_y();
+
protected:
/// [yat4tango::DeviceTask implementation]
void process_message(yat::Message& msg) throw(Tango::DevFailed);
@@ -147,19 +145,22 @@ protected:
/// fix the status in a scoped_lock
void set_status(const std::string& status);
- /// compute internal state/status of task
+ /// compute internal state/status
void compute_state_status();
- /// decode property coefs
+ /// decode equation parameters property
void decode_equation_parameters();
+ /// compute the frameX & frameY
+ void compute_frame_xy();
+
///owner device server
Tango::DeviceImpl* m_device;
- /// task state
+ /// state
Tango::DevState m_state;
- /// task status
+ /// status
std::stringstream m_status;
/// lock for general state
@@ -172,8 +173,8 @@ protected:
std::vector< yat::SharedPtr<yat4tango::DeviceProxyHelper> > m_proxy_mythens;
yat::SharedPtr<yat4tango::DeviceProxyHelper> m_proxy_motor;
- std::vector<float> m_x_values;
- std::vector<float> m_y_values;
+ std::vector<float> m_frame_x_values;
+ std::vector<float> m_frame_y_values;
std::vector<float> m_deltas;
std::vector<float> m_centers;
std::vector<float> m_distances;
--
GitLab