From 28e7f77399182dc64062d81a6e018f0eed9c5022 Mon Sep 17 00:00:00 2001
From: Arafat Nourredine <arafat.nourredine@synchrotron-soleil.fr>
Date: Mon, 12 Feb 2018 09:26:30 +0000
Subject: [PATCH] - Add attributes : flatFieldCorrection, rateCorrection,
 badChannelInterpolation, nbModules, nbChannels

---
 src/MythenPool.cpp             |  94 +++++++++++--
 src/MythenPool.h               |  16 +++
 src/MythenWAXS.cpp             | 104 +++++++++++++++
 src/MythenWAXS.h               | 233 ++++++++++++++++++++-------------
 src/MythenWAXSClass.cpp        | 123 +++++++++++++++++
 src/MythenWAXSClass.h          | 171 ++++++++++++++++--------
 src/MythenWAXSStateMachine.cpp | 166 +++++++++++++++++------
 7 files changed, 705 insertions(+), 202 deletions(-)

diff --git a/src/MythenPool.cpp b/src/MythenPool.cpp
index 6b83152..95e8f59 100644
--- a/src/MythenPool.cpp
+++ b/src/MythenPool.cpp
@@ -2,7 +2,7 @@
 //
 // file :        MythenPool.cpp
 //
-// description : Monitoring Pilatus Sensors through the device Lima Pilatus
+// description : Manage access to a set of MythenDetector device
 //
 // project :	MythenWAXS Project
 //
@@ -25,7 +25,6 @@
 
 //@@@@TODO
 //temporary and only for simulation 
-const int CHANNEL_SIZE = 5;
 const int PIXEL_SIZE = 0.05;
 //////////////////////////////
 
@@ -120,9 +119,9 @@ void MythenPool::write_energy(double value)
 	yat::MutexLock scoped_lock(m_proxy_lock);
 	for (unsigned i = 0; i < m_prop.proxy_mythen_names.size(); i++)
 	{
-		long nb_channels = 0;
-		m_proxy_mythens.at(i)->read_attribute("nbChannels", nb_channels, m_prop.proxy_nb_retry);
-		for (unsigned j = 0; j < nb_channels; j++)
+		long nb_modules = 0;
+		m_proxy_mythens.at(i)->read_attribute("nbModules", nb_modules, m_prop.proxy_nb_retry);
+		for (unsigned j = 0; j < nb_modules; j++)
 		{
 			stringstream ss("");
 			std::string name("");
@@ -141,9 +140,9 @@ void MythenPool::write_threshold(double value)
 	yat::MutexLock scoped_lock(m_proxy_lock);
 	for (unsigned i = 0; i < m_prop.proxy_mythen_names.size(); i++)
 	{
-		long nb_channels = 0;
-		m_proxy_mythens.at(i)->read_attribute("nbChannels", nb_channels, m_prop.proxy_nb_retry);
-		for (unsigned j = 0; j < nb_channels; j++)
+		long nb_modules = 0;
+		m_proxy_mythens.at(i)->read_attribute("nbModules", nb_modules, m_prop.proxy_nb_retry);
+		for (unsigned j = 0; j < nb_modules; j++)
 		{
 			stringstream ss("");
 			std::string name("");
@@ -181,6 +180,73 @@ void MythenPool::write_nb_frames(long value)
 //----------------------------------------------------------------------------------------------------------------------
 //----------------------------------------------------------------------------------------------------------------------
 
+void MythenPool::write_flatfield_correction(bool flag)
+{
+	yat::MutexLock scoped_lock(m_proxy_lock);
+	for (unsigned i = 0; i < m_prop.proxy_mythen_names.size(); i++)
+	{
+		m_proxy_mythens.at(i)->write_attribute("flatFieldCorrection", flag, m_prop.proxy_nb_retry);
+	}	
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+//----------------------------------------------------------------------------------------------------------------------
+
+void MythenPool::write_rate_correction(bool flag)
+{
+	yat::MutexLock scoped_lock(m_proxy_lock);
+	for (unsigned i = 0; i < m_prop.proxy_mythen_names.size(); i++)
+	{
+		m_proxy_mythens.at(i)->write_attribute("rateCorrection", flag, m_prop.proxy_nb_retry);
+	}		
+}
+//----------------------------------------------------------------------------------------------------------------------
+//----------------------------------------------------------------------------------------------------------------------
+
+void MythenPool::write_badchannel_interpolation(bool flag)
+{
+	yat::MutexLock scoped_lock(m_proxy_lock);
+	for (unsigned i = 0; i < m_prop.proxy_mythen_names.size(); i++)
+	{
+		m_proxy_mythens.at(i)->write_attribute("badChannelInterpolation", flag, m_prop.proxy_nb_retry);
+	}	
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+//----------------------------------------------------------------------------------------------------------------------
+
+long MythenPool::get_nb_modules()
+{
+	yat::MutexLock scoped_lock(m_proxy_lock);
+	long nb_total_modules = 0;
+	for (unsigned i = 0; i < m_prop.proxy_mythen_names.size(); i++)
+	{
+		long nb_modules = 0;
+		m_proxy_mythens.at(i)->read_attribute("nbModules", nb_modules, m_prop.proxy_nb_retry);
+		nb_total_modules += nb_modules;
+	}
+	return nb_total_modules;
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+//----------------------------------------------------------------------------------------------------------------------
+
+long MythenPool::get_nb_channels()
+{
+	yat::MutexLock scoped_lock(m_proxy_lock);	
+	long nb_total_channels = 0;
+	for (unsigned i = 0; i < m_prop.proxy_mythen_names.size(); i++)
+	{
+		long nb_channels = 0;
+		m_proxy_mythens.at(i)->read_attribute("nbChannels", nb_channels, m_prop.proxy_nb_retry);
+		nb_total_channels += nb_channels;
+	}
+	return nb_total_channels;
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+//----------------------------------------------------------------------------------------------------------------------
+
 void MythenPool::snap()
 {
 	yat::MutexLock scoped_lock(m_proxy_lock);
@@ -237,9 +303,11 @@ void MythenPool::compute_frame_xy()
 	//compute tth
 	for (unsigned i = 0; i < m_prop.proxy_mythen_names.size(); i++)
 	{
+		long nb_modules = 0;
+		m_proxy_mythens.at(i)->read_attribute("nbModules", nb_modules, m_prop.proxy_nb_retry);
 		long nb_channels = 0;
 		m_proxy_mythens.at(i)->read_attribute("nbChannels", nb_channels, m_prop.proxy_nb_retry);
-		for (unsigned j = 0; j < nb_channels; j++)
+		for (unsigned j = 0; j < nb_modules; j++)
 		{
 			std::vector<double> frame;
 			stringstream ss("");
@@ -247,13 +315,13 @@ void MythenPool::compute_frame_xy()
 			name = "frame";
 			ss << name << std::setfill('0') << std::setw(2) << j + 1;//index of threshold start with '01'
 			m_proxy_mythens.at(i)->read_attribute(ss.str(), frame, m_prop.proxy_nb_retry);
-			for (unsigned k = 0;k < CHANNEL_SIZE;k++)
+			for (unsigned k = 0;k < nb_channels;k++)
 			{
 				double twotheta =	theta_position -
 									m_deltas.at(nb_total_channel + j) -
 									atan((k - m_centers.at(nb_total_channel + j)) * PIXEL_SIZE / (m_distances.at(nb_total_channel + j)));
-				
-				m_x_values.push_back(twotheta*(180.0/M_PI));
+
+				m_x_values.push_back(twotheta * (180.0 / M_PI));
 				m_y_values.push_back(frame.at(k));
 			}
 		}
@@ -584,6 +652,7 @@ void MythenPool::process_message(yat::Message& msg) throw (Tango::DevFailed)
 				Tango::DevState state = get_state();
 				if (state == Tango::STANDBY)
 				{
+					enable_periodic_msg(false);
 					DEBUG_STREAM << " " << std::endl;
 					DEBUG_STREAM << "--------------------------------------------" << std::endl;
 					DEBUG_STREAM << "-> MythenPool::TASK_PERIODIC" << endl;
@@ -594,7 +663,6 @@ void MythenPool::process_message(yat::Message& msg) throw (Tango::DevFailed)
 						INFO_STREAM << "Compute frameX & frameY" << endl;
 						INFO_STREAM << "--------------------------------------------" << std::endl;
 						compute_frame_xy();
-						enable_periodic_msg(false);
 					}
 					catch (Tango::DevFailed &df)
 					{
diff --git a/src/MythenPool.h b/src/MythenPool.h
index e58ca80..39d9284 100644
--- a/src/MythenPool.h
+++ b/src/MythenPool.h
@@ -112,6 +112,22 @@ public:
     /// write nbFrames
     void write_nb_frames(long);        
     
+    /// write flatfield correctyion flag
+    void write_flatfield_correction(bool);
+
+    /// write rate correction flag
+    void write_rate_correction(bool);
+    
+    /// write badchannel interpolation flag
+    void write_badchannel_interpolation(bool);
+    
+    /// read the total nb of modules
+    long get_nb_modules();
+    
+    /// read the total nb of channels
+    long get_nb_channels();
+    
+    
     /// read the frame (x)
     const std::vector<double>& get_frame_x();
         /// read the frame (x)
diff --git a/src/MythenWAXS.cpp b/src/MythenWAXS.cpp
index 3ddb8b8..7901bbf 100644
--- a/src/MythenWAXS.cpp
+++ b/src/MythenWAXS.cpp
@@ -71,6 +71,11 @@ static const char *RcsId = "$Id:  $";
 //  threshold     |  Tango::DevDouble	Scalar
 //  exposureTime  |  Tango::DevDouble	Scalar
 //  nbFrames      |  Tango::DevLong	Scalar
+//  flatFieldCorrection      |  Tango::DevBoolean	Scalar
+//  rateCorrection           |  Tango::DevBoolean	Scalar
+//  badChannelInterpolation  |  Tango::DevBoolean	Scalar
+//  nbModules                |  Tango::DevLong	Scalar
+//  nbChannels               |  Tango::DevLong	Scalar
 //  frameX        |  Tango::DevDouble	Spectrum  ( max = 100000)
 //  frameY        |  Tango::DevDouble	Spectrum  ( max = 100000)
 //================================================================
@@ -146,6 +151,8 @@ void MythenWAXS::delete_device()
     yat4tango::YatLogAdapter::release();
 
 	/*----- PROTECTED REGION END -----*/	//	MythenWAXS::delete_device
+	delete[] attr_nbModules_read;
+	delete[] attr_nbChannels_read;
 	delete[] attr_frameX_read;
 	delete[] attr_frameY_read;
 }
@@ -194,6 +201,8 @@ void MythenWAXS::init_device()
 	//	Get the device properties from database
 	get_device_property();
 	
+	attr_nbModules_read = new Tango::DevLong[1];
+	attr_nbChannels_read = new Tango::DevLong[1];
 	attr_frameX_read = new Tango::DevDouble[100000];
 	attr_frameY_read = new Tango::DevDouble[100000];
 
@@ -462,6 +471,101 @@ void MythenWAXS::write_nbFrames(Tango::WAttribute &attr)
 	/*----- PROTECTED REGION END -----*/	//	MythenWAXS::write_nbFrames
 }
 //--------------------------------------------------------
+/**
+ *	Write attribute flatFieldCorrection related method
+ *	Description: 
+ *
+ *	Data type:	Tango::DevBoolean
+ *	Attr type:	Scalar
+ */
+//--------------------------------------------------------
+void MythenWAXS::write_flatFieldCorrection(Tango::WAttribute &attr)
+{
+	DEBUG_STREAM << "MythenWAXS::write_flatFieldCorrection(Tango::WAttribute &attr) entering... " << endl;
+	//	Retrieve write value
+	Tango::DevBoolean	w_val;
+	attr.get_write_value(w_val);
+	/*----- PROTECTED REGION ID(MythenWAXS::write_flatFieldCorrection) ENABLED START -----*/	
+	m_mythen_pool->write_flatfield_correction(w_val);
+	/*----- PROTECTED REGION END -----*/	//	MythenWAXS::write_flatFieldCorrection
+}
+//--------------------------------------------------------
+/**
+ *	Write attribute rateCorrection related method
+ *	Description: 
+ *
+ *	Data type:	Tango::DevBoolean
+ *	Attr type:	Scalar
+ */
+//--------------------------------------------------------
+void MythenWAXS::write_rateCorrection(Tango::WAttribute &attr)
+{
+	DEBUG_STREAM << "MythenWAXS::write_rateCorrection(Tango::WAttribute &attr) entering... " << endl;
+	//	Retrieve write value
+	Tango::DevBoolean	w_val;
+	attr.get_write_value(w_val);
+	/*----- PROTECTED REGION ID(MythenWAXS::write_rateCorrection) ENABLED START -----*/
+	m_mythen_pool->write_rate_correction(w_val);
+	/*----- PROTECTED REGION END -----*/	//	MythenWAXS::write_rateCorrection
+}
+//--------------------------------------------------------
+/**
+ *	Write attribute badChannelInterpolation related method
+ *	Description: 
+ *
+ *	Data type:	Tango::DevBoolean
+ *	Attr type:	Scalar
+ */
+//--------------------------------------------------------
+void MythenWAXS::write_badChannelInterpolation(Tango::WAttribute &attr)
+{
+	DEBUG_STREAM << "MythenWAXS::write_badChannelInterpolation(Tango::WAttribute &attr) entering... " << endl;
+	//	Retrieve write value
+	Tango::DevBoolean	w_val;
+	attr.get_write_value(w_val);
+	/*----- PROTECTED REGION ID(MythenWAXS::write_badChannelInterpolation) ENABLED START -----*/
+	m_mythen_pool->write_badchannel_interpolation(w_val);	
+	/*----- PROTECTED REGION END -----*/	//	MythenWAXS::write_badChannelInterpolation
+}
+//--------------------------------------------------------
+/**
+ *	Read attribute nbModules related method
+ *	Description: 
+ *
+ *	Data type:	Tango::DevLong
+ *	Attr type:	Scalar
+ */
+//--------------------------------------------------------
+void MythenWAXS::read_nbModules(Tango::Attribute &attr)
+{
+	DEBUG_STREAM << "MythenWAXS::read_nbModules(Tango::Attribute &attr) entering... " << endl;
+	/*----- PROTECTED REGION ID(MythenWAXS::read_nbModules) ENABLED START -----*/
+	//	Set the attribute value
+	*attr_nbModules_read = m_mythen_pool->get_nb_modules();
+	attr.set_value(attr_nbModules_read);
+	
+	/*----- PROTECTED REGION END -----*/	//	MythenWAXS::read_nbModules
+}
+//--------------------------------------------------------
+/**
+ *	Read attribute nbChannels related method
+ *	Description: 
+ *
+ *	Data type:	Tango::DevLong
+ *	Attr type:	Scalar
+ */
+//--------------------------------------------------------
+void MythenWAXS::read_nbChannels(Tango::Attribute &attr)
+{
+	DEBUG_STREAM << "MythenWAXS::read_nbChannels(Tango::Attribute &attr) entering... " << endl;
+	/*----- PROTECTED REGION ID(MythenWAXS::read_nbChannels) ENABLED START -----*/
+	//	Set the attribute value
+	*attr_nbChannels_read = m_mythen_pool->get_nb_channels();
+	attr.set_value(attr_nbChannels_read);
+	
+	/*----- PROTECTED REGION END -----*/	//	MythenWAXS::read_nbChannels
+}
+//--------------------------------------------------------
 /**
  *	Read attribute frameX related method
  *	Description: 
diff --git a/src/MythenWAXS.h b/src/MythenWAXS.h
index 0ef89d7..90ea799 100644
--- a/src/MythenWAXS.h
+++ b/src/MythenWAXS.h
@@ -1,59 +1,59 @@
-/*----- PROTECTED REGION ID(MythenWAXS.h) ENABLED START -----*/
-//=============================================================================
-//
-// file :        MythenWAXS.h
-//
-// description : Include file for the MythenWAXS class
-//
-// project :     Mythen Wide Angular Xray
-//
-// This file is part of Tango device class.
-// 
-// Tango is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-// 
-// Tango is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with Tango.  If not, see <http://www.gnu.org/licenses/>.
-// 
-// $Author:  $
-//
-// $Revision:  $
-// $Date:  $
-//
-// $HeadURL:  $
-//
-//=============================================================================
-//                This file is generated by POGO
-//        (Program Obviously used to Generate tango Object)
-//=============================================================================
-
-
-#ifndef MythenWAXS_H
-#define MythenWAXS_H
-
-#include <tango.h>
-#include <yat/utils/Logging.h>
-#include <yat4tango/PropertyHelper.h>
-#include <yat4tango/InnerAppender.h>
-#include <yat4tango/YatLogAdapter.h>
-#include <yat4tango/DynamicInterfaceManager.h>
-#include <yat/memory/UniquePtr.h>
-#include <yat/memory/SharedPtr.h>
-#include <yat/threading/Mutex.h>
-#include <yat4tango/DeviceTask.h>
-#include "MythenPool.h"
-
-
-
-
-
+/*----- PROTECTED REGION ID(MythenWAXS.h) ENABLED START -----*/
+//=============================================================================
+//
+// file :        MythenWAXS.h
+//
+// description : Include file for the MythenWAXS class
+//
+// project :     Mythen Wide Angular Xray
+//
+// This file is part of Tango device class.
+// 
+// Tango is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+// 
+// Tango is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// 
+// You should have received a copy of the GNU General Public License
+// along with Tango.  If not, see <http://www.gnu.org/licenses/>.
+// 
+// $Author:  $
+//
+// $Revision:  $
+// $Date:  $
+//
+// $HeadURL:  $
+//
+//=============================================================================
+//                This file is generated by POGO
+//        (Program Obviously used to Generate tango Object)
+//=============================================================================
+
+
+#ifndef MythenWAXS_H
+#define MythenWAXS_H
+
+#include <tango.h>
+#include <yat/utils/Logging.h>
+#include <yat4tango/PropertyHelper.h>
+#include <yat4tango/InnerAppender.h>
+#include <yat4tango/YatLogAdapter.h>
+#include <yat4tango/DynamicInterfaceManager.h>
+#include <yat/memory/UniquePtr.h>
+#include <yat/memory/SharedPtr.h>
+#include <yat/threading/Mutex.h>
+#include <yat4tango/DeviceTask.h>
+#include "MythenPool.h"
+
+
+
+
+
 /*----- PROTECTED REGION END -----*/	//	MythenWAXS.h
 
 /**
@@ -63,22 +63,22 @@
 
 namespace MythenWAXS_ns
 {
-/*----- PROTECTED REGION ID(MythenWAXS::Additional Class Declarations) ENABLED START -----*/
-
-//	Additional Class Declarations
-
+/*----- PROTECTED REGION ID(MythenWAXS::Additional Class Declarations) ENABLED START -----*/
+
+//	Additional Class Declarations
+
 /*----- PROTECTED REGION END -----*/	//	MythenWAXS::Additional Class Declarations
 
 class MythenWAXS : public Tango::Device_4Impl
 {
 
-/*----- PROTECTED REGION ID(MythenWAXS::Data Members) ENABLED START -----*/
-
-//	Add your own data members
-public:
-
-
-
+/*----- PROTECTED REGION ID(MythenWAXS::Data Members) ENABLED START -----*/
+
+//	Add your own data members
+public:
+
+
+
 /*----- PROTECTED REGION END -----*/	//	MythenWAXS::Data Members
 
 //	Device property data members
@@ -94,6 +94,8 @@ public:
 
 //	Attribute data members
 public:
+	Tango::DevLong	*attr_nbModules_read;
+	Tango::DevLong	*attr_nbChannels_read;
 	Tango::DevDouble	*attr_frameX_read;
 	Tango::DevDouble	*attr_frameY_read;
 
@@ -193,6 +195,51 @@ public:
  */
 	virtual void write_nbFrames(Tango::WAttribute &attr);
 	virtual bool is_nbFrames_allowed(Tango::AttReqType type);
+/**
+ *	Attribute flatFieldCorrection related methods
+ *	Description: 
+ *
+ *	Data type:	Tango::DevBoolean
+ *	Attr type:	Scalar
+ */
+	virtual void write_flatFieldCorrection(Tango::WAttribute &attr);
+	virtual bool is_flatFieldCorrection_allowed(Tango::AttReqType type);
+/**
+ *	Attribute rateCorrection related methods
+ *	Description: 
+ *
+ *	Data type:	Tango::DevBoolean
+ *	Attr type:	Scalar
+ */
+	virtual void write_rateCorrection(Tango::WAttribute &attr);
+	virtual bool is_rateCorrection_allowed(Tango::AttReqType type);
+/**
+ *	Attribute badChannelInterpolation related methods
+ *	Description: 
+ *
+ *	Data type:	Tango::DevBoolean
+ *	Attr type:	Scalar
+ */
+	virtual void write_badChannelInterpolation(Tango::WAttribute &attr);
+	virtual bool is_badChannelInterpolation_allowed(Tango::AttReqType type);
+/**
+ *	Attribute nbModules related methods
+ *	Description: 
+ *
+ *	Data type:	Tango::DevLong
+ *	Attr type:	Scalar
+ */
+	virtual void read_nbModules(Tango::Attribute &attr);
+	virtual bool is_nbModules_allowed(Tango::AttReqType type);
+/**
+ *	Attribute nbChannels related methods
+ *	Description: 
+ *
+ *	Data type:	Tango::DevLong
+ *	Attr type:	Scalar
+ */
+	virtual void read_nbChannels(Tango::Attribute &attr);
+	virtual bool is_nbChannels_allowed(Tango::AttReqType type);
 /**
  *	Attribute frameX related methods
  *	Description: 
@@ -248,35 +295,35 @@ public:
 	virtual bool is_Stop_allowed(const CORBA::Any &any);
 
 
-/*----- PROTECTED REGION ID(MythenWAXS::Additional Method prototypes) ENABLED START -----*/
-
-//	Additional Method prototypes
-protected :	
-    //- used to create all dynamic interface
-    bool create_all_dynamic_interface();
-   
-    //- return true if the device is correctly initialized in init_device
-    bool is_device_initialized();
-
-    //- state & status stuff
-    bool m_is_device_initialized;
-    std::stringstream m_status_message;
-    
-    //- yat image Dynamic Attribute
-    yat4tango::DynamicInterfaceManager m_dim;     
-    
-    
-    //monitor task
-    yat::SharedPtr<MythenPool> m_mythen_pool;
-    std::vector<double> m_twotheta_values;
-
+/*----- PROTECTED REGION ID(MythenWAXS::Additional Method prototypes) ENABLED START -----*/
+
+//	Additional Method prototypes
+protected :	
+    //- used to create all dynamic interface
+    bool create_all_dynamic_interface();
+   
+    //- return true if the device is correctly initialized in init_device
+    bool is_device_initialized();
+
+    //- state & status stuff
+    bool m_is_device_initialized;
+    std::stringstream m_status_message;
+    
+    //- yat image Dynamic Attribute
+    yat4tango::DynamicInterfaceManager m_dim;     
+    
+    
+    //monitor task
+    yat::SharedPtr<MythenPool> m_mythen_pool;
+    std::vector<double> m_twotheta_values;
+
 /*----- PROTECTED REGION END -----*/	//	MythenWAXS::Additional Method prototypes
 };
 
-/*----- PROTECTED REGION ID(MythenWAXS::Additional Classes Definitions) ENABLED START -----*/
-
-//	Additional Classes Definitions
-
+/*----- PROTECTED REGION ID(MythenWAXS::Additional Classes Definitions) ENABLED START -----*/
+
+//	Additional Classes Definitions
+
 /*----- PROTECTED REGION END -----*/	//	MythenWAXS::Additional Classes Definitions
 
 }	//	End of namespace
diff --git a/src/MythenWAXSClass.cpp b/src/MythenWAXSClass.cpp
index 1f603f1..830d535 100644
--- a/src/MythenWAXSClass.cpp
+++ b/src/MythenWAXSClass.cpp
@@ -635,6 +635,129 @@ void MythenWAXSClass::attribute_factory(vector<Tango::Attr *> &att_list)
 	nbframes->set_memorized_init(true);
 	att_list.push_back(nbframes);
 
+	//	Attribute : flatFieldCorrection
+	flatFieldCorrectionAttrib	*flatfieldcorrection = new flatFieldCorrectionAttrib();
+	Tango::UserDefaultAttrProp	flatfieldcorrection_prop;
+	//	description	not set for flatFieldCorrection
+	//	label	not set for flatFieldCorrection
+	//	unit	not set for flatFieldCorrection
+	//	standard_unit	not set for flatFieldCorrection
+	//	display_unit	not set for flatFieldCorrection
+	//	format	not set for flatFieldCorrection
+	//	max_value	not set for flatFieldCorrection
+	//	min_value	not set for flatFieldCorrection
+	//	max_alarm	not set for flatFieldCorrection
+	//	min_alarm	not set for flatFieldCorrection
+	//	max_warning	not set for flatFieldCorrection
+	//	min_warning	not set for flatFieldCorrection
+	//	delta_t	not set for flatFieldCorrection
+	//	delta_val	not set for flatFieldCorrection
+	
+	flatfieldcorrection->set_default_properties(flatfieldcorrection_prop);
+	//	Not Polled
+	flatfieldcorrection->set_disp_level(Tango::OPERATOR);
+	flatfieldcorrection->set_memorized();
+	flatfieldcorrection->set_memorized_init(true);
+	att_list.push_back(flatfieldcorrection);
+
+	//	Attribute : rateCorrection
+	rateCorrectionAttrib	*ratecorrection = new rateCorrectionAttrib();
+	Tango::UserDefaultAttrProp	ratecorrection_prop;
+	//	description	not set for rateCorrection
+	//	label	not set for rateCorrection
+	//	unit	not set for rateCorrection
+	//	standard_unit	not set for rateCorrection
+	//	display_unit	not set for rateCorrection
+	//	format	not set for rateCorrection
+	//	max_value	not set for rateCorrection
+	//	min_value	not set for rateCorrection
+	//	max_alarm	not set for rateCorrection
+	//	min_alarm	not set for rateCorrection
+	//	max_warning	not set for rateCorrection
+	//	min_warning	not set for rateCorrection
+	//	delta_t	not set for rateCorrection
+	//	delta_val	not set for rateCorrection
+	
+	ratecorrection->set_default_properties(ratecorrection_prop);
+	//	Not Polled
+	ratecorrection->set_disp_level(Tango::OPERATOR);
+	ratecorrection->set_memorized();
+	ratecorrection->set_memorized_init(true);
+	att_list.push_back(ratecorrection);
+
+	//	Attribute : badChannelInterpolation
+	badChannelInterpolationAttrib	*badchannelinterpolation = new badChannelInterpolationAttrib();
+	Tango::UserDefaultAttrProp	badchannelinterpolation_prop;
+	//	description	not set for badChannelInterpolation
+	//	label	not set for badChannelInterpolation
+	//	unit	not set for badChannelInterpolation
+	//	standard_unit	not set for badChannelInterpolation
+	//	display_unit	not set for badChannelInterpolation
+	//	format	not set for badChannelInterpolation
+	//	max_value	not set for badChannelInterpolation
+	//	min_value	not set for badChannelInterpolation
+	//	max_alarm	not set for badChannelInterpolation
+	//	min_alarm	not set for badChannelInterpolation
+	//	max_warning	not set for badChannelInterpolation
+	//	min_warning	not set for badChannelInterpolation
+	//	delta_t	not set for badChannelInterpolation
+	//	delta_val	not set for badChannelInterpolation
+	
+	badchannelinterpolation->set_default_properties(badchannelinterpolation_prop);
+	//	Not Polled
+	badchannelinterpolation->set_disp_level(Tango::OPERATOR);
+	badchannelinterpolation->set_memorized();
+	badchannelinterpolation->set_memorized_init(true);
+	att_list.push_back(badchannelinterpolation);
+
+	//	Attribute : nbModules
+	nbModulesAttrib	*nbmodules = new nbModulesAttrib();
+	Tango::UserDefaultAttrProp	nbmodules_prop;
+	//	description	not set for nbModules
+	//	label	not set for nbModules
+	//	unit	not set for nbModules
+	//	standard_unit	not set for nbModules
+	//	display_unit	not set for nbModules
+	//	format	not set for nbModules
+	//	max_value	not set for nbModules
+	//	min_value	not set for nbModules
+	//	max_alarm	not set for nbModules
+	//	min_alarm	not set for nbModules
+	//	max_warning	not set for nbModules
+	//	min_warning	not set for nbModules
+	//	delta_t	not set for nbModules
+	//	delta_val	not set for nbModules
+	
+	nbmodules->set_default_properties(nbmodules_prop);
+	//	Not Polled
+	nbmodules->set_disp_level(Tango::OPERATOR);
+	//	Not Memorized
+	att_list.push_back(nbmodules);
+
+	//	Attribute : nbChannels
+	nbChannelsAttrib	*nbchannels = new nbChannelsAttrib();
+	Tango::UserDefaultAttrProp	nbchannels_prop;
+	//	description	not set for nbChannels
+	//	label	not set for nbChannels
+	//	unit	not set for nbChannels
+	//	standard_unit	not set for nbChannels
+	//	display_unit	not set for nbChannels
+	//	format	not set for nbChannels
+	//	max_value	not set for nbChannels
+	//	min_value	not set for nbChannels
+	//	max_alarm	not set for nbChannels
+	//	min_alarm	not set for nbChannels
+	//	max_warning	not set for nbChannels
+	//	min_warning	not set for nbChannels
+	//	delta_t	not set for nbChannels
+	//	delta_val	not set for nbChannels
+	
+	nbchannels->set_default_properties(nbchannels_prop);
+	//	Not Polled
+	nbchannels->set_disp_level(Tango::OPERATOR);
+	//	Not Memorized
+	att_list.push_back(nbchannels);
+
 	//	Attribute : frameX
 	frameXAttrib	*framex = new frameXAttrib();
 	Tango::UserDefaultAttrProp	framex_prop;
diff --git a/src/MythenWAXSClass.h b/src/MythenWAXSClass.h
index 11ef0cf..3961fce 100644
--- a/src/MythenWAXSClass.h
+++ b/src/MythenWAXSClass.h
@@ -1,58 +1,58 @@
-/*----- PROTECTED REGION ID(MythenWAXSClass.h) ENABLED START -----*/
-//=============================================================================
-//
-// file :        MythenWAXSClass.h
-//
-// description : Include for the MythenWAXS root class.
-//               This class is the singleton class for
-//                the MythenWAXS device class.
-//               It contains all properties and methods which the 
-//               MythenWAXS requires only once e.g. the commands.
-//
-// project :     Mythen Wide Angular Xray
-//
-// This file is part of Tango device class.
-// 
-// Tango is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-// 
-// Tango is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with Tango.  If not, see <http://www.gnu.org/licenses/>.
-// 
-// $Author:  $
-//
-// $Revision:  $
-// $Date:  $
-//
-// $HeadURL:  $
-//
-//=============================================================================
-//                This file is generated by POGO
-//        (Program Obviously used to Generate tango Object)
-//=============================================================================
-
-
-#ifndef MythenWAXSClass_H
-#define MythenWAXSClass_H
-
-#include <tango.h>
-#include <MythenWAXS.h>
-
+/*----- PROTECTED REGION ID(MythenWAXSClass.h) ENABLED START -----*/
+//=============================================================================
+//
+// file :        MythenWAXSClass.h
+//
+// description : Include for the MythenWAXS root class.
+//               This class is the singleton class for
+//                the MythenWAXS device class.
+//               It contains all properties and methods which the 
+//               MythenWAXS requires only once e.g. the commands.
+//
+// project :     Mythen Wide Angular Xray
+//
+// This file is part of Tango device class.
+// 
+// Tango is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+// 
+// Tango is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// 
+// You should have received a copy of the GNU General Public License
+// along with Tango.  If not, see <http://www.gnu.org/licenses/>.
+// 
+// $Author:  $
+//
+// $Revision:  $
+// $Date:  $
+//
+// $HeadURL:  $
+//
+//=============================================================================
+//                This file is generated by POGO
+//        (Program Obviously used to Generate tango Object)
+//=============================================================================
+
+
+#ifndef MythenWAXSClass_H
+#define MythenWAXSClass_H
+
+#include <tango.h>
+#include <MythenWAXS.h>
+
 /*----- PROTECTED REGION END -----*/	//	MythenWAXSClass.h
 
 
 namespace MythenWAXS_ns
 {
-/*----- PROTECTED REGION ID(MythenWAXSClass::classes for dynamic creation) ENABLED START -----*/
-
-
+/*----- PROTECTED REGION ID(MythenWAXSClass::classes for dynamic creation) ENABLED START -----*/
+
+
 /*----- PROTECTED REGION END -----*/	//	MythenWAXSClass::classes for dynamic creation
 
 //=========================================
@@ -110,6 +110,71 @@ public:
 		{return (static_cast<MythenWAXS *>(dev))->is_nbFrames_allowed(ty);}
 };
 
+//	Attribute flatFieldCorrection class definition
+class flatFieldCorrectionAttrib: public Tango::Attr
+{
+public:
+	flatFieldCorrectionAttrib():Attr("flatFieldCorrection",
+			Tango::DEV_BOOLEAN, Tango::WRITE) {};
+	~flatFieldCorrectionAttrib() {};
+	virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att)
+		{(static_cast<MythenWAXS *>(dev))->write_flatFieldCorrection(att);}
+	virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty)
+		{return (static_cast<MythenWAXS *>(dev))->is_flatFieldCorrection_allowed(ty);}
+};
+
+//	Attribute rateCorrection class definition
+class rateCorrectionAttrib: public Tango::Attr
+{
+public:
+	rateCorrectionAttrib():Attr("rateCorrection",
+			Tango::DEV_BOOLEAN, Tango::WRITE) {};
+	~rateCorrectionAttrib() {};
+	virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att)
+		{(static_cast<MythenWAXS *>(dev))->write_rateCorrection(att);}
+	virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty)
+		{return (static_cast<MythenWAXS *>(dev))->is_rateCorrection_allowed(ty);}
+};
+
+//	Attribute badChannelInterpolation class definition
+class badChannelInterpolationAttrib: public Tango::Attr
+{
+public:
+	badChannelInterpolationAttrib():Attr("badChannelInterpolation",
+			Tango::DEV_BOOLEAN, Tango::WRITE) {};
+	~badChannelInterpolationAttrib() {};
+	virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att)
+		{(static_cast<MythenWAXS *>(dev))->write_badChannelInterpolation(att);}
+	virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty)
+		{return (static_cast<MythenWAXS *>(dev))->is_badChannelInterpolation_allowed(ty);}
+};
+
+//	Attribute nbModules class definition
+class nbModulesAttrib: public Tango::Attr
+{
+public:
+	nbModulesAttrib():Attr("nbModules",
+			Tango::DEV_LONG, Tango::READ) {};
+	~nbModulesAttrib() {};
+	virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att)
+		{(static_cast<MythenWAXS *>(dev))->read_nbModules(att);}
+	virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty)
+		{return (static_cast<MythenWAXS *>(dev))->is_nbModules_allowed(ty);}
+};
+
+//	Attribute nbChannels class definition
+class nbChannelsAttrib: public Tango::Attr
+{
+public:
+	nbChannelsAttrib():Attr("nbChannels",
+			Tango::DEV_LONG, Tango::READ) {};
+	~nbChannelsAttrib() {};
+	virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att)
+		{(static_cast<MythenWAXS *>(dev))->read_nbChannels(att);}
+	virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty)
+		{return (static_cast<MythenWAXS *>(dev))->is_nbChannels_allowed(ty);}
+};
+
 //	Attribute frameX class definition
 class frameXAttrib: public Tango::SpectrumAttr
 {
@@ -197,9 +262,9 @@ class __declspec(dllexport)  MythenWAXSClass : public Tango::DeviceClass
 class MythenWAXSClass : public Tango::DeviceClass
 #endif
 {
-	/*----- PROTECTED REGION ID(MythenWAXSClass::Additionnal DServer data members) ENABLED START -----*/
-	
-	
+	/*----- PROTECTED REGION ID(MythenWAXSClass::Additionnal DServer data members) ENABLED START -----*/
+	
+	
 	/*----- PROTECTED REGION END -----*/	//	MythenWAXSClass::Additionnal DServer data members
 
 	public:
diff --git a/src/MythenWAXSStateMachine.cpp b/src/MythenWAXSStateMachine.cpp
index 7531bc7..200548c 100644
--- a/src/MythenWAXSStateMachine.cpp
+++ b/src/MythenWAXSStateMachine.cpp
@@ -1,42 +1,42 @@
-/*----- PROTECTED REGION ID(MythenWAXSStateMachine.cpp) ENABLED START -----*/
-static const char *RcsId = "$Id:  $";
-//=============================================================================
-//
-// file :        MythenWAXSStateMachine.cpp
-//
-// description : State machine file for the MythenWAXS class
-//
-// project :     Mythen Wide Angular Xray
-//
-// This file is part of Tango device class.
-// 
-// Tango is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-// 
-// Tango is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with Tango.  If not, see <http://www.gnu.org/licenses/>.
-// 
-// $Author:  $
-//
-// $Revision:  $
-// $Date:  $
-//
-// $HeadURL:  $
-//
-//=============================================================================
-//                This file is generated by POGO
-//        (Program Obviously used to Generate tango Object)
-//=============================================================================
-
-#include <MythenWAXS.h>
-
+/*----- PROTECTED REGION ID(MythenWAXSStateMachine.cpp) ENABLED START -----*/
+static const char *RcsId = "$Id:  $";
+//=============================================================================
+//
+// file :        MythenWAXSStateMachine.cpp
+//
+// description : State machine file for the MythenWAXS class
+//
+// project :     Mythen Wide Angular Xray
+//
+// This file is part of Tango device class.
+// 
+// Tango is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+// 
+// Tango is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// 
+// You should have received a copy of the GNU General Public License
+// along with Tango.  If not, see <http://www.gnu.org/licenses/>.
+// 
+// $Author:  $
+//
+// $Revision:  $
+// $Date:  $
+//
+// $HeadURL:  $
+//
+//=============================================================================
+//                This file is generated by POGO
+//        (Program Obviously used to Generate tango Object)
+//=============================================================================
+
+#include <MythenWAXS.h>
+
 /*----- PROTECTED REGION END -----*/	//	MythenWAXS::MythenWAXSStateMachine.cpp
 
 //================================================================
@@ -118,6 +118,86 @@ bool MythenWAXS::is_nbFrames_allowed(TANGO_UNUSED(Tango::AttReqType type))
 	return true;
 }
 
+//--------------------------------------------------------
+/**
+ *	Method      : MythenWAXS::is_flatFieldCorrection_allowed()
+ *	Description : Execution allowed for flatFieldCorrection attribute
+ */
+//--------------------------------------------------------
+bool MythenWAXS::is_flatFieldCorrection_allowed(TANGO_UNUSED(Tango::AttReqType type))
+{
+	//	Not any excluded states for flatFieldCorrection attribute in Write access.
+	/*----- PROTECTED REGION ID(MythenWAXS::flatFieldCorrectionStateAllowed_WRITE) ENABLED START -----*/
+	
+	/*----- PROTECTED REGION END -----*/	//	MythenWAXS::flatFieldCorrectionStateAllowed_WRITE
+
+	return true;
+}
+
+//--------------------------------------------------------
+/**
+ *	Method      : MythenWAXS::is_rateCorrection_allowed()
+ *	Description : Execution allowed for rateCorrection attribute
+ */
+//--------------------------------------------------------
+bool MythenWAXS::is_rateCorrection_allowed(TANGO_UNUSED(Tango::AttReqType type))
+{
+	//	Not any excluded states for rateCorrection attribute in Write access.
+	/*----- PROTECTED REGION ID(MythenWAXS::rateCorrectionStateAllowed_WRITE) ENABLED START -----*/
+	
+	/*----- PROTECTED REGION END -----*/	//	MythenWAXS::rateCorrectionStateAllowed_WRITE
+
+	return true;
+}
+
+//--------------------------------------------------------
+/**
+ *	Method      : MythenWAXS::is_badChannelInterpolation_allowed()
+ *	Description : Execution allowed for badChannelInterpolation attribute
+ */
+//--------------------------------------------------------
+bool MythenWAXS::is_badChannelInterpolation_allowed(TANGO_UNUSED(Tango::AttReqType type))
+{
+	//	Not any excluded states for badChannelInterpolation attribute in Write access.
+	/*----- PROTECTED REGION ID(MythenWAXS::badChannelInterpolationStateAllowed_WRITE) ENABLED START -----*/
+	
+	/*----- PROTECTED REGION END -----*/	//	MythenWAXS::badChannelInterpolationStateAllowed_WRITE
+
+	return true;
+}
+
+//--------------------------------------------------------
+/**
+ *	Method      : MythenWAXS::is_nbModules_allowed()
+ *	Description : Execution allowed for nbModules attribute
+ */
+//--------------------------------------------------------
+bool MythenWAXS::is_nbModules_allowed(TANGO_UNUSED(Tango::AttReqType type))
+{
+
+	//	Not any excluded states for nbModules attribute in read access.
+	/*----- PROTECTED REGION ID(MythenWAXS::nbModulesStateAllowed_READ) ENABLED START -----*/
+	
+	/*----- PROTECTED REGION END -----*/	//	MythenWAXS::nbModulesStateAllowed_READ
+	return true;
+}
+
+//--------------------------------------------------------
+/**
+ *	Method      : MythenWAXS::is_nbChannels_allowed()
+ *	Description : Execution allowed for nbChannels attribute
+ */
+//--------------------------------------------------------
+bool MythenWAXS::is_nbChannels_allowed(TANGO_UNUSED(Tango::AttReqType type))
+{
+
+	//	Not any excluded states for nbChannels attribute in read access.
+	/*----- PROTECTED REGION ID(MythenWAXS::nbChannelsStateAllowed_READ) ENABLED START -----*/
+	
+	/*----- PROTECTED REGION END -----*/	//	MythenWAXS::nbChannelsStateAllowed_READ
+	return true;
+}
+
 //--------------------------------------------------------
 /**
  *	Method      : MythenWAXS::is_frameX_allowed()
@@ -166,8 +246,8 @@ bool MythenWAXS::is_Snap_allowed(TANGO_UNUSED(const CORBA::Any &any))
 	if (get_state()==Tango::FAULT ||
 		get_state()==Tango::INIT)
 	{
-	/*----- PROTECTED REGION ID(MythenWAXS::SnapStateAllowed) ENABLED START -----*/
-	
+	/*----- PROTECTED REGION ID(MythenWAXS::SnapStateAllowed) ENABLED START -----*/
+	
 	/*----- PROTECTED REGION END -----*/	//	MythenWAXS::SnapStateAllowed
 		return false;
 	}
@@ -183,8 +263,8 @@ bool MythenWAXS::is_Snap_allowed(TANGO_UNUSED(const CORBA::Any &any))
 bool MythenWAXS::is_Stop_allowed(TANGO_UNUSED(const CORBA::Any &any))
 {
 	//	Not any excluded states for Stop command.
-	/*----- PROTECTED REGION ID(MythenWAXS::StopStateAllowed) ENABLED START -----*/
-	
+	/*----- PROTECTED REGION ID(MythenWAXS::StopStateAllowed) ENABLED START -----*/
+	
 	/*----- PROTECTED REGION END -----*/	//	MythenWAXS::StopStateAllowed
 	return true;
 }
-- 
GitLab