diff --git a/conanfile.py b/conanfile.py index 78264b4f94cf9e926fcf7bf0fa3f7aae147051b5..5fc7995a502e358835d3eeed4ae6ccc5c7b54b12 100644 --- a/conanfile.py +++ b/conanfile.py @@ -3,7 +3,7 @@ from conan import ConanFile class Lakeshore_336Recipe(ConanFile): name = "lakeshore_336" executable = "ds_Lakeshore_336" - version = "1.0.6" + version = "1.0.7" package_type = "application" user = "soleil" python_requires = "base/[>=1.0]@soleil/stable" diff --git a/pom.xml b/pom.xml index 25b73164fb10ab478885767855a824acad92aaa2..9264a526d612a82f3c09505b1287152d19f38598 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ </parent> <groupId>fr.soleil.device</groupId> <artifactId>Lakeshore_336-${aol}-${mode}</artifactId> - <version>1.0.6</version> + <version>1.0.7</version> <packaging>nar</packaging> <name>Lakeshore_336</name> <developers> diff --git a/src/ClassFactory.cpp.old b/src/ClassFactory.cpp.old deleted file mode 100644 index 8c5e155ec31733e86392ed4bfca080c9812d4791..0000000000000000000000000000000000000000 --- a/src/ClassFactory.cpp.old +++ /dev/null @@ -1,50 +0,0 @@ -static const char *RcsId = "$Id: ClassFactory.cpp.old,v 1.1 2010-11-05 10:36:03 olivierroux Exp $"; -//+============================================================================= -// -// file : ClassFactory.cpp -// -// description : C++ source for the class_factory method of the DServer -// device class. This method is responsible for the creation of -// all class singleton for a device server. It is called -// at device server startup -// -// project : TANGO Device Server -// -// $Author: olivierroux $ -// -// $Revision: 1.1 $ -// $Date: 2010-11-05 10:36:03 $ -// -// SVN only: -// $HeadURL: $ -// -// CVS only: -// $Source: /users/chaize/newsvn/cvsroot/Instrumentation/Lakeshore_336/src/ClassFactory.cpp.old,v $ -// $Log: not supported by cvs2svn $ -// -// copyleft : European Synchrotron Radiation Facility -// BP 220, Grenoble 38043 -// FRANCE -// -//-============================================================================= -// -// This file is generated by POGO -// (Program Obviously used to Generate tango Object) -// -// (c) - Software Engineering Group - ESRF -//============================================================================= - - -#include <tango.h> -#include <Lakeshore_336Class.h> - -/** - * Create Lakeshore_336Class singleton and store it in DServer object. - */ - -void Tango::DServer::class_factory() -{ - - add_class(Lakeshore_336_ns::Lakeshore_336Class::init("Lakeshore_336")); - -} diff --git a/src/Lakeshore_336.cpp b/src/Lakeshore_336.cpp index 3078b3c4d96de2e074d9bb4fc78348f8ad9dc452..a0d01844e4e808c4dbb04b8a0d50673a3bcb913a 100644 --- a/src/Lakeshore_336.cpp +++ b/src/Lakeshore_336.cpp @@ -46,6 +46,9 @@ static const char *RcsId = "$Id: $"; #include "Lakeshore_336Class.h" #include <PogoHelper.h> #include <yat/Portability.h> //- NaN +#include <yat4tango/DeviceInfo.h> +#include <yat4tango/Logging.h> +#include <yat4tango/PropertyHelper.h> /*----- PROTECTED REGION END -----*/ // Lakeshore_336.cpp @@ -153,6 +156,9 @@ void Lakeshore_336::delete_device() //- the polling thread m_hwp.reset(); + yat4tango::DeviceInfo::release(this); + yat4tango::Logging::release(this); + /*----- PROTECTED REGION END -----*/ // Lakeshore_336::delete_device } @@ -175,6 +181,9 @@ void Lakeshore_336::init_device() try { + yat4tango::DeviceInfo::initialize( this, YAT_XSTR(PROJECT_NAME), YAT_XSTR(PROJECT_VERSION) ); + yat4tango::Logging::initialize(this); + CREATE_SCALAR_ATTRIBUTE(attr_temperature_read); CREATE_SCALAR_ATTRIBUTE(attr_output_read); CREATE_SCALAR_ATTRIBUTE(attr_range_read); @@ -373,42 +382,47 @@ void Lakeshore_336::get_device_property() /*----- PROTECTED REGION ID(Lakeshore_336::get_device_property_after) ENABLED START -----*/ // Check device property data members init - Tango::DbData data_put; - if (dev_prop[0].is_empty()==true || comDeviceProxy.find ("must be defined") != std::string::npos) - { - m_properties_missing = true; - m_status_str = "Communication Device Proxy Property not defined [fix and restart device]"; - Tango::DbDatum property("ComDeviceProxy"); - property << comDeviceProxy; - data_put.push_back(property); - FATAL_STREAM << "Lakeshore_336::get_properties() missing property url -set here the IP Address" << endl; - } - if (dev_prop[1].is_empty() == true) - { - Tango::DbDatum property("TimeInDeadBand"); - property << timeInDeadBand; - data_put.push_back(property); - INFO_STREAM << "Lakeshore_336::get_properties() missing property TimeInDeadband -set to default " << timeInDeadBand << " sec " << endl; - } - if (dev_prop[2].is_empty() == true) - { - Tango::DbDatum property("Period"); - property << period; - data_put.push_back(property); - INFO_STREAM << "Lakeshore_336::get_properties() missing property Period -set to default 1000 msec value " << period << endl; - } - if (dev_prop[3].is_empty() == true) - { - Tango::DbDatum property("LoopNumber"); - property << loopNumber; - data_put.push_back(property); - INFO_STREAM << "Lakeshore_336::get_properties() missing property LoopNumber -set to default 1 value " << period << endl; - } - - if(!data_put.empty()) - { - get_db_device()->put_property(data_put); - } + yat4tango::PropertyHelper::create_property_if_empty(this, dev_prop, "", "ComDeviceProxy"); + yat4tango::PropertyHelper::create_property_if_empty(this, dev_prop, "60", "TimeInDeadBand"); + yat4tango::PropertyHelper::create_property_if_empty(this, dev_prop, "1000", "Period"); + yat4tango::PropertyHelper::create_property_if_empty(this, dev_prop, "1", "LoopNumber"); + + // Tango::DbData data_put; + // if (dev_prop[0].is_empty()==true || comDeviceProxy.find ("must be defined") != std::string::npos) + // { + // m_properties_missing = true; + // m_status_str = "Communication Device Proxy Property not defined [fix and restart device]"; + // Tango::DbDatum property("ComDeviceProxy"); + // property << comDeviceProxy; + // data_put.push_back(property); + // FATAL_STREAM << "Lakeshore_336::get_properties() missing property url -set here the IP Address" << endl; + // } + // if (dev_prop[1].is_empty() == true) + // { + // Tango::DbDatum property("TimeInDeadBand"); + // property << timeInDeadBand; + // data_put.push_back(property); + // INFO_STREAM << "Lakeshore_336::get_properties() missing property TimeInDeadband -set to default " << timeInDeadBand << " sec " << endl; + // } + // if (dev_prop[2].is_empty() == true) + // { + // Tango::DbDatum property("Period"); + // property << period; + // data_put.push_back(property); + // INFO_STREAM << "Lakeshore_336::get_properties() missing property Period -set to default 1000 msec value " << period << endl; + // } + // if (dev_prop[3].is_empty() == true) + // { + // Tango::DbDatum property("LoopNumber"); + // property << loopNumber; + // data_put.push_back(property); + // INFO_STREAM << "Lakeshore_336::get_properties() missing property LoopNumber -set to default 1 value " << period << endl; + // } + + // if(!data_put.empty()) + // { + // get_db_device()->put_property(data_put); + // } /*----- PROTECTED REGION END -----*/ // Lakeshore_336::get_device_property_after } diff --git a/src/Lakeshore_336.cpp.old b/src/Lakeshore_336.cpp.old deleted file mode 100644 index 852c95cd090c57341f73d59cd6a1d64704db9653..0000000000000000000000000000000000000000 --- a/src/Lakeshore_336.cpp.old +++ /dev/null @@ -1,603 +0,0 @@ -static const char *RcsId = "$Id: Lakeshore_336.cpp.old,v 1.1 2010-11-05 10:36:03 olivierroux Exp $"; -//+============================================================================= -// -// file : Lakeshore_336.cpp -// -// description : C++ source for the Lakeshore_336 and its commands. -// The class is derived from Device. It represents the -// CORBA servant object which will be accessed from the -// network. All commands which can be executed on the -// Lakeshore_336 are implemented in this file. -// -// project : TANGO Device Server -// -// $Author: olivierroux $ -// -// $Revision: 1.1 $ -// -// $Revision: 1.1 $ -// $Date: 2010-11-05 10:36:03 $ -// -// SVN only: -// $HeadURL: $ -// -// CVS only: -// $Source: /users/chaize/newsvn/cvsroot/Instrumentation/Lakeshore_336/src/Lakeshore_336.cpp.old,v $ -// $Log: not supported by cvs2svn $ -// -// copyleft : Synchrotron SOLEIL -// L'Orme des merisiers - Saint Aubin -// BP48 - 91192 Gif sur Yvette -// FRANCE -// -//-============================================================================= -// -// This file is generated by POGO -// (Program Obviously used to Generate tango Object) -// -// (c) - Software Engineering Group - ESRF -//============================================================================= - - - -//=================================================================== -// -// The following table gives the correspondence -// between commands and method name. -// -// Command name | Method name -// ---------------------------------------- -// State | dev_state() -// Status | dev_status() -// GetInputAlarmStatus | get_input_alarm_status() -// Off | off() -// Low | low() -// Medium | medium() -// High | high() -// Local | local() -// Remote | remote() -// LoopSelectInput | loop_select_input() -// IORaw | ioraw() -// RampON | ramp_on() -// RampOFF | ramp_off() -// -//=================================================================== - - -#include <tango.h> -#include <Lakeshore_336.h> -#include <Lakeshore_336Class.h> - -namespace Lakeshore_336_ns -{ - -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::Lakeshore_336(string &s) -// -// description : constructor for simulated Lakeshore_336 -// -// in : - cl : Pointer to the DeviceClass object -// - s : Device name -// -//----------------------------------------------------------------------------- -Lakeshore_336::Lakeshore_336(Tango::DeviceClass *cl,string &s) -:Tango::Device_4Impl(cl,s.c_str()) -{ - init_device(); -} - -Lakeshore_336::Lakeshore_336(Tango::DeviceClass *cl,const char *s) -:Tango::Device_4Impl(cl,s) -{ - init_device(); -} - -Lakeshore_336::Lakeshore_336(Tango::DeviceClass *cl,const char *s,const char *d) -:Tango::Device_4Impl(cl,s,d) -{ - init_device(); -} -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::delete_device() -// -// description : will be called at device destruction or at init command. -// -//----------------------------------------------------------------------------- -void Lakeshore_336::delete_device() -{ - // Delete device allocated objects -} - -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::init_device() -// -// description : will be called at device initialization. -// -//----------------------------------------------------------------------------- -void Lakeshore_336::init_device() -{ - INFO_STREAM << "Lakeshore_336::Lakeshore_336() create device " << device_name << endl; - - // Initialise variables to default values - //-------------------------------------------- - get_device_property(); -} - - -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::get_device_property() -// -// description : Read the device properties from database. -// -//----------------------------------------------------------------------------- -void Lakeshore_336::get_device_property() -{ - // Initialize your default values here (if not done with POGO). - //------------------------------------------------------------------ - - // Read device properties from database.(Automatic code generation) - //------------------------------------------------------------------ - Tango::DbData dev_prop; - dev_prop.push_back(Tango::DbDatum("ComDeviceProxy")); - dev_prop.push_back(Tango::DbDatum("TimeInDeadBand")); - dev_prop.push_back(Tango::DbDatum("LoopNumber")); - - // Call database and extract values - //-------------------------------------------- - if (Tango::Util::instance()->_UseDb==true) - get_db_device()->get_property(dev_prop); - Tango::DbDatum def_prop, cl_prop; - Lakeshore_336Class *ds_class = - (static_cast<Lakeshore_336Class *>(get_device_class())); - int i = -1; - - // Try to initialize ComDeviceProxy from class property - cl_prop = ds_class->get_class_property(dev_prop[++i].name); - if (cl_prop.is_empty()==false) cl_prop >> comDeviceProxy; - else { - // Try to initialize ComDeviceProxy from default device value - def_prop = ds_class->get_default_device_property(dev_prop[i].name); - if (def_prop.is_empty()==false) def_prop >> comDeviceProxy; - } - // And try to extract ComDeviceProxy value from database - if (dev_prop[i].is_empty()==false) dev_prop[i] >> comDeviceProxy; - - // Try to initialize TimeInDeadBand from class property - cl_prop = ds_class->get_class_property(dev_prop[++i].name); - if (cl_prop.is_empty()==false) cl_prop >> timeInDeadBand; - else { - // Try to initialize TimeInDeadBand from default device value - def_prop = ds_class->get_default_device_property(dev_prop[i].name); - if (def_prop.is_empty()==false) def_prop >> timeInDeadBand; - } - // And try to extract TimeInDeadBand value from database - if (dev_prop[i].is_empty()==false) dev_prop[i] >> timeInDeadBand; - - // Try to initialize LoopNumber from class property - cl_prop = ds_class->get_class_property(dev_prop[++i].name); - if (cl_prop.is_empty()==false) cl_prop >> loopNumber; - else { - // Try to initialize LoopNumber from default device value - def_prop = ds_class->get_default_device_property(dev_prop[i].name); - if (def_prop.is_empty()==false) def_prop >> loopNumber; - } - // And try to extract LoopNumber value from database - if (dev_prop[i].is_empty()==false) dev_prop[i] >> loopNumber; - - - - // End of Automatic code generation - //------------------------------------------------------------------ - -} -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::always_executed_hook() -// -// description : method always executed before any command is executed -// -//----------------------------------------------------------------------------- -void Lakeshore_336::always_executed_hook() -{ - -} -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::read_attr_hardware -// -// description : Hardware acquisition for attributes. -// -//----------------------------------------------------------------------------- -void Lakeshore_336::read_attr_hardware(vector<long> &attr_list) -{ - DEBUG_STREAM << "Lakeshore_336::read_attr_hardware(vector<long> &attr_list) entering... "<< endl; - // Add your own code here -} - -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::read_temperature -// -// description : Extract real attribute values for temperature acquisition result. -// -//----------------------------------------------------------------------------- -void Lakeshore_336::read_temperature(Tango::Attribute &attr) -{ - DEBUG_STREAM << "Lakeshore_336::read_temperature(Tango::Attribute &attr) entering... "<< endl; -} - -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::write_temperature -// -// description : Write temperature attribute values to hardware. -// -//----------------------------------------------------------------------------- -void Lakeshore_336::write_temperature(Tango::WAttribute &attr) -{ - DEBUG_STREAM << "Lakeshore_336::write_temperature(Tango::WAttribute &attr) entering... "<< endl; -} - -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::read_output -// -// description : Extract real attribute values for output acquisition result. -// -//----------------------------------------------------------------------------- -void Lakeshore_336::read_output(Tango::Attribute &attr) -{ - DEBUG_STREAM << "Lakeshore_336::read_output(Tango::Attribute &attr) entering... "<< endl; -} - -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::read_range -// -// description : Extract real attribute values for range acquisition result. -// -//----------------------------------------------------------------------------- -void Lakeshore_336::read_range(Tango::Attribute &attr) -{ - DEBUG_STREAM << "Lakeshore_336::read_range(Tango::Attribute &attr) entering... "<< endl; -} - -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::read_deadBand -// -// description : Extract real attribute values for deadBand acquisition result. -// -//----------------------------------------------------------------------------- -void Lakeshore_336::read_deadBand(Tango::Attribute &attr) -{ - DEBUG_STREAM << "Lakeshore_336::read_deadBand(Tango::Attribute &attr) entering... "<< endl; -} - -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::write_deadBand -// -// description : Write deadBand attribute values to hardware. -// -//----------------------------------------------------------------------------- -void Lakeshore_336::write_deadBand(Tango::WAttribute &attr) -{ - DEBUG_STREAM << "Lakeshore_336::write_deadBand(Tango::WAttribute &attr) entering... "<< endl; -} - -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::read_inputA -// -// description : Extract real attribute values for inputA acquisition result. -// -//----------------------------------------------------------------------------- -void Lakeshore_336::read_inputA(Tango::Attribute &attr) -{ - DEBUG_STREAM << "Lakeshore_336::read_inputA(Tango::Attribute &attr) entering... "<< endl; -} - -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::read_inputB -// -// description : Extract real attribute values for inputB acquisition result. -// -//----------------------------------------------------------------------------- -void Lakeshore_336::read_inputB(Tango::Attribute &attr) -{ - DEBUG_STREAM << "Lakeshore_336::read_inputB(Tango::Attribute &attr) entering... "<< endl; -} - -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::read_inputC -// -// description : Extract real attribute values for inputC acquisition result. -// -//----------------------------------------------------------------------------- -void Lakeshore_336::read_inputC(Tango::Attribute &attr) -{ - DEBUG_STREAM << "Lakeshore_336::read_inputC(Tango::Attribute &attr) entering... "<< endl; -} - -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::read_inputD -// -// description : Extract real attribute values for inputD acquisition result. -// -//----------------------------------------------------------------------------- -void Lakeshore_336::read_inputD(Tango::Attribute &attr) -{ - DEBUG_STREAM << "Lakeshore_336::read_inputD(Tango::Attribute &attr) entering... "<< endl; -} - -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::read_rampRate -// -// description : Extract real attribute values for rampRate acquisition result. -// -//----------------------------------------------------------------------------- -void Lakeshore_336::read_rampRate(Tango::Attribute &attr) -{ - DEBUG_STREAM << "Lakeshore_336::read_rampRate(Tango::Attribute &attr) entering... "<< endl; -} - -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::write_rampRate -// -// description : Write rampRate attribute values to hardware. -// -//----------------------------------------------------------------------------- -void Lakeshore_336::write_rampRate(Tango::WAttribute &attr) -{ - DEBUG_STREAM << "Lakeshore_336::write_rampRate(Tango::WAttribute &attr) entering... "<< endl; -} - -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::read_rampActive -// -// description : Extract real attribute values for rampActive acquisition result. -// -//----------------------------------------------------------------------------- -void Lakeshore_336::read_rampActive(Tango::Attribute &attr) -{ - DEBUG_STREAM << "Lakeshore_336::read_rampActive(Tango::Attribute &attr) entering... "<< endl; -} - - - -//+------------------------------------------------------------------ -/** - * method: Lakeshore_336::get_input_alarm_status - * - * description: method to execute "GetInputAlarmStatus" - * - * @return status of alarms - * - */ -//+------------------------------------------------------------------ -Tango::DevString Lakeshore_336::get_input_alarm_status() -{ - // POGO has generated a method core with argout allocation. - // If you would like to use a static reference without copying, - // See "TANGO Device Server Programmer's Manual" - // (chapter : Writing a TANGO DS / Exchanging data) - //------------------------------------------------------------ - Tango::DevString argout = new char[6]; - strcpy(argout, "dummy"); - DEBUG_STREAM << "Lakeshore_336::get_input_alarm_status(): entering... !" << endl; - - // Add your own code to control device here - - return argout; -} - -//+------------------------------------------------------------------ -/** - * method: Lakeshore_336::off - * - * description: method to execute "Off" - * turns OFF the temperature regulation : range set to 0 - * - * - */ -//+------------------------------------------------------------------ -void Lakeshore_336::off() -{ - DEBUG_STREAM << "Lakeshore_336::off(): entering... !" << endl; - - // Add your own code to control device here - -} - -//+------------------------------------------------------------------ -/** - * method: Lakeshore_336::low - * - * description: method to execute "Low" - * turns ON the temperature regulation - * the range is set to 1 (0.01%, 0.005W max) - * - * - */ -//+------------------------------------------------------------------ -void Lakeshore_336::low() -{ - DEBUG_STREAM << "Lakeshore_336::low(): entering... !" << endl; - - // Add your own code to control device here - -} - - -//+------------------------------------------------------------------ -/** - * method: Lakeshore_336::medium - * - * description: method to execute "Medium" - * turns the temperature regulation ON - * the range is set to 3 (1%, 0.5W max) - * - * - */ -//+------------------------------------------------------------------ -void Lakeshore_336::medium() -{ - DEBUG_STREAM << "Lakeshore_336::medium(): entering... !" << endl; - - // Add your own code to control device here - -} - - -//+------------------------------------------------------------------ -/** - * method: Lakeshore_336::high - * - * description: method to execute "High" - * turns the temperature regulation ON - * the range is set to 3 (100%, 50W max) - * - * - */ -//+------------------------------------------------------------------ -void Lakeshore_336::high() -{ - DEBUG_STREAM << "Lakeshore_336::high(): entering... !" << endl; - - // Add your own code to control device here - -} - -//+------------------------------------------------------------------ -/** - * method: Lakeshore_336::local - * - * description: method to execute "Local" - * turns the control mode to LOCAL : local keyboard enabled - * - * - */ -//+------------------------------------------------------------------ -void Lakeshore_336::local() -{ - DEBUG_STREAM << "Lakeshore_336::local(): entering... !" << endl; - - // Add your own code to control device here - -} - -//+------------------------------------------------------------------ -/** - * method: Lakeshore_336::remote - * - * description: method to execute "Remote" - * turns the control mode to REMOTE (via GPIB, enables the device control) - * - * - */ -//+------------------------------------------------------------------ -void Lakeshore_336::remote() -{ - DEBUG_STREAM << "Lakeshore_336::remote(): entering... !" << endl; - - // Add your own code to control device here - -} - -//+------------------------------------------------------------------ -/** - * method: Lakeshore_336::loop_select_input - * - * description: method to execute "LoopSelectInput" - * selects the input for this loop - * - * @param argin input to associate with the loop [1|2|3|4] - * - */ -//+------------------------------------------------------------------ -void Lakeshore_336::loop_select_input(Tango::DevShort argin) -{ - DEBUG_STREAM << "Lakeshore_336::loop_select_input(): entering... !" << endl; - - // Add your own code to control device here - -} - -//+------------------------------------------------------------------ -/** - * method: Lakeshore_336::ioraw - * - * description: method to execute "IORaw" - * sends a command (if no "?") - * requests a value (if "?") - * - * @param argin - * @return - * - */ -//+------------------------------------------------------------------ -Tango::DevString Lakeshore_336::ioraw(Tango::DevString argin) -{ - // POGO has generated a method core with argout allocation. - // If you would like to use a static reference without copying, - // See "TANGO Device Server Programmer's Manual" - // (chapter : Writing a TANGO DS / Exchanging data) - //------------------------------------------------------------ - Tango::DevString argout = new char[6]; - strcpy(argout, "dummy"); - DEBUG_STREAM << "Lakeshore_336::ioraw(): entering... !" << endl; - - // Add your own code to control device here - - return argout; -} - -//+------------------------------------------------------------------ -/** - * method: Lakeshore_336::ramp_on - * - * description: method to execute "RampON" - * turns Lakeshore internal ramp ON for the loop the device controls - * - * - */ -//+------------------------------------------------------------------ -void Lakeshore_336::ramp_on() -{ - DEBUG_STREAM << "Lakeshore_336::ramp_on(): entering... !" << endl; - - // Add your own code to control device here - -} - -//+------------------------------------------------------------------ -/** - * method: Lakeshore_336::ramp_off - * - * description: method to execute "RampOFF" - * turns the internal Lakeshore ramp OFF for the loop controlled by the device - * - * - */ -//+------------------------------------------------------------------ -void Lakeshore_336::ramp_off() -{ - DEBUG_STREAM << "Lakeshore_336::ramp_off(): entering... !" << endl; - - // Add your own code to control device here - -} - - -} // namespace diff --git a/src/Lakeshore_336.h.old b/src/Lakeshore_336.h.old deleted file mode 100644 index 685612745a4abaf8b36c90051514f56780c6db00..0000000000000000000000000000000000000000 --- a/src/Lakeshore_336.h.old +++ /dev/null @@ -1,434 +0,0 @@ -//============================================================================= -// -// file : Lakeshore_336.h -// -// description : Include for the Lakeshore_336 class. -// -// project : Lakeshore_336 -// -// $Author: olivierroux $ -// -// $Revision: 1.1 $ -// $Date: 2010-11-05 10:36:03 $ -// -// SVN only: -// $HeadURL: $ -// -// CVS only: -// $Source: /users/chaize/newsvn/cvsroot/Instrumentation/Lakeshore_336/src/Lakeshore_336.h.old,v $ -// $Log: not supported by cvs2svn $ -// -// copyleft : Synchrotron SOLEIL -// L'Orme des merisiers - Saint Aubin -// BP48 - 91192 Gif sur Yvette -// FRANCE -// -//============================================================================= -// -// This file is generated by POGO -// (Program Obviously used to Generate tango Object) -// -// (c) - Software Engineering Group - ESRF -//============================================================================= -#ifndef _LAKESHORE_336_H -#define _LAKESHORE_336_H - -#include <tango.h> -#include "task/HWProxy.h" - -//using namespace Tango; - -/** - * @author $Author: olivierroux $ - * @version $Revision: 1.1 $ - */ - - // Add your own constant definitions here. - //----------------------------------------------- - - -namespace Lakeshore_336_ns -{ - -/** - * Class Description: - * basic interface for the Lakeshore Model 336 Temperature controller, - * GPIB/Ethernet interface. - * reads 4 temperatures, outputs, alarms. - */ - -/* - * Device States Description: -* Tango::ON : everything ok -* Tango::UNKNOWN : comunication broken -* Tango::FAULT : parameterisation or blocking fault -* Tango::ALARM : at least 1 relay is ON -* Tango::MOVING : the controller tries to reach the set point - * (this state is used by scanserver to control the scans) -* Tango::STANDBY : the controller has reached the setpoint - * (this state is used by ScanServer to control the scan) - */ - - -class Lakeshore_336: public Tango::Device_4Impl -{ -public : - // Add your own data members here - //----------------------------------------- - - - // Here is the Start of the automatic code generation part - //------------------------------------------------------------- -/** - * @name attributes - * Attribute member data. - */ -//@{ - Tango::DevDouble *attr_temperature_read; - Tango::DevDouble attr_temperature_write; - Tango::DevDouble *attr_output_read; - Tango::DevString *attr_range_read; - Tango::DevDouble *attr_deadBand_read; - Tango::DevDouble attr_deadBand_write; - Tango::DevDouble *attr_inputA_read; - Tango::DevDouble *attr_inputB_read; - Tango::DevDouble *attr_inputC_read; - Tango::DevDouble *attr_inputD_read; - Tango::DevDouble *attr_rampRate_read; - Tango::DevDouble attr_rampRate_write; - Tango::DevBoolean *attr_rampActive_read; -//@} - -/** - * @name Device properties - * Device properties member data. - */ -//@{ -/** - * the Tango name of the communication device proxy (Ethernet or GPIB) - */ - string comDeviceProxy; -/** - * if temperature stays in deadband around setpoint for TimeInDeadBand seconds, - * the regulation is considered as successfull (the setpoint is reached, the stability is correct) - * The state of the device goes from RUNNING (blue color) to STANDBY (yellow) - * - */ - Tango::DevLong timeInDeadBand; -/** - * Loop number. possible values : 1 or 2. - * Default : 1 - */ - Tango::DevShort loopNumber; -//@} - -/** - * @name Device properties - * Device property member data. - */ -//@{ -//@} - -/**@name Constructors - * Miscellaneous constructors */ -//@{ -/** - * Constructs a newly allocated Command object. - * - * @param cl Class. - * @param s Device Name - */ - Lakeshore_336(Tango::DeviceClass *cl,string &s); -/** - * Constructs a newly allocated Command object. - * - * @param cl Class. - * @param s Device Name - */ - Lakeshore_336(Tango::DeviceClass *cl,const char *s); -/** - * Constructs a newly allocated Command object. - * - * @param cl Class. - * @param s Device name - * @param d Device description. - */ - Lakeshore_336(Tango::DeviceClass *cl,const char *s,const char *d); -//@} - -/**@name Destructor - * Only one destructor is defined for this class */ -//@{ -/** - * The object destructor. - */ - ~Lakeshore_336() {delete_device();}; -/** - * will be called at device destruction or at init command. - */ - void delete_device(); -//@} - - -/**@name Miscellaneous methods */ -//@{ -/** - * Initialize the device - */ - virtual void init_device(); -/** - * Always executed method before execution command method. - */ - virtual void always_executed_hook(); - -//@} - -/** - * @name Lakeshore_336 methods prototypes - */ - -//@{ -/** - * Hardware acquisition for attributes. - */ - virtual void read_attr_hardware(vector<long> &attr_list); -/** - * Extract real attribute values for temperature acquisition result. - */ - virtual void read_temperature(Tango::Attribute &attr); -/** - * Write temperature attribute values to hardware. - */ - virtual void write_temperature(Tango::WAttribute &attr); -/** - * Extract real attribute values for output acquisition result. - */ - virtual void read_output(Tango::Attribute &attr); -/** - * Extract real attribute values for range acquisition result. - */ - virtual void read_range(Tango::Attribute &attr); -/** - * Extract real attribute values for deadBand acquisition result. - */ - virtual void read_deadBand(Tango::Attribute &attr); -/** - * Write deadBand attribute values to hardware. - */ - virtual void write_deadBand(Tango::WAttribute &attr); -/** - * Extract real attribute values for inputA acquisition result. - */ - virtual void read_inputA(Tango::Attribute &attr); -/** - * Extract real attribute values for inputB acquisition result. - */ - virtual void read_inputB(Tango::Attribute &attr); -/** - * Extract real attribute values for inputC acquisition result. - */ - virtual void read_inputC(Tango::Attribute &attr); -/** - * Extract real attribute values for inputD acquisition result. - */ - virtual void read_inputD(Tango::Attribute &attr); -/** - * Extract real attribute values for rampRate acquisition result. - */ - virtual void read_rampRate(Tango::Attribute &attr); -/** - * Write rampRate attribute values to hardware. - */ - virtual void write_rampRate(Tango::WAttribute &attr); -/** - * Extract real attribute values for rampActive acquisition result. - */ - virtual void read_rampActive(Tango::Attribute &attr); -/** - * Read/Write allowed for temperature attribute. - */ - virtual bool is_temperature_allowed(Tango::AttReqType type); -/** - * Read/Write allowed for output attribute. - */ - virtual bool is_output_allowed(Tango::AttReqType type); -/** - * Read/Write allowed for range attribute. - */ - virtual bool is_range_allowed(Tango::AttReqType type); -/** - * Read/Write allowed for deadBand attribute. - */ - virtual bool is_deadBand_allowed(Tango::AttReqType type); -/** - * Read/Write allowed for inputA attribute. - */ - virtual bool is_inputA_allowed(Tango::AttReqType type); -/** - * Read/Write allowed for inputB attribute. - */ - virtual bool is_inputB_allowed(Tango::AttReqType type); -/** - * Read/Write allowed for inputC attribute. - */ - virtual bool is_inputC_allowed(Tango::AttReqType type); -/** - * Read/Write allowed for inputD attribute. - */ - virtual bool is_inputD_allowed(Tango::AttReqType type); -/** - * Read/Write allowed for rampRate attribute. - */ - virtual bool is_rampRate_allowed(Tango::AttReqType type); -/** - * Read/Write allowed for rampActive attribute. - */ - virtual bool is_rampActive_allowed(Tango::AttReqType type); -/** - * Execution allowed for GetInputAlarmStatus command. - */ - virtual bool is_GetInputAlarmStatus_allowed(const CORBA::Any &any); -/** - * Execution allowed for Off command. - */ - virtual bool is_Off_allowed(const CORBA::Any &any); -/** - * Execution allowed for Low command. - */ - virtual bool is_Low_allowed(const CORBA::Any &any); -/** - * Execution allowed for Medium command. - */ - virtual bool is_Medium_allowed(const CORBA::Any &any); -/** - * Execution allowed for High command. - */ - virtual bool is_High_allowed(const CORBA::Any &any); -/** - * Execution allowed for Local command. - */ - virtual bool is_Local_allowed(const CORBA::Any &any); -/** - * Execution allowed for Remote command. - */ - virtual bool is_Remote_allowed(const CORBA::Any &any); -/** - * Execution allowed for LoopSelectInput command. - */ - virtual bool is_LoopSelectInput_allowed(const CORBA::Any &any); -/** - * Execution allowed for IORaw command. - */ - virtual bool is_IORaw_allowed(const CORBA::Any &any); -/** - * Execution allowed for RampON command. - */ - virtual bool is_RampON_allowed(const CORBA::Any &any); -/** - * Execution allowed for RampOFF command. - */ - virtual bool is_RampOFF_allowed(const CORBA::Any &any); -/** - * This command gets the device state (stored in its <i>device_state</i> data member) and returns it to the caller. - * @return State Code - * @exception DevFailed - */ - virtual Tango::DevState dev_state(); -/** - * This command gets the device status (stored in its <i>device_status</i> data member) and returns it to the caller. - * @return Status description - * @exception DevFailed - */ - virtual Tango::ConstDevString dev_status(); -/** - * - * @return status of alarms - * @exception DevFailed - */ - Tango::DevString get_input_alarm_status(); -/** - * turns OFF the temperature regulation : range set to 0 - * @exception DevFailed - */ - void off(); -/** - * turns ON the temperature regulation - * the range is set to 1 (0.01%, 0.005W max) - * @exception DevFailed - */ - void low(); -/** - * turns the temperature regulation ON - * the range is set to 2 (1%, 0.5W max) - * @exception DevFailed - */ - void medium(); -/** - * turns the temperature regulation ON - * the range is set to 3 (100%, 50W max) - * @exception DevFailed - */ - void high(); -/** - * turns the control mode to LOCAL : local keyboard enabled - * @exception DevFailed - */ - void local(); -/** - * turns the control mode to REMOTE (via GPIB, enables the device control) - * @exception DevFailed - */ - void remote(); -/** - * selects the input for this loop - * @param argin input to associate with the loop [1|2|3|4] - * @exception DevFailed - */ - void loop_select_input(Tango::DevShort); -/** - * sends a command (if no "?") - * requests a value (if "?") - * @param argin - * @return - * @exception DevFailed - */ - Tango::DevString ioraw(Tango::DevString); -/** - * turns Lakeshore internal ramp ON for the loop the device controls - * @exception DevFailed - */ - void ramp_on(); -/** - * turns the internal Lakeshore ramp OFF for the loop controlled by the device - * @exception DevFailed - */ - void ramp_off(); - -/** - * Read the device properties from database - */ - void get_device_property(); -//@} - - // Here is the end of the automatic code generation part - //------------------------------------------------------------- - - - -protected : - // Add your own data members here - //----------------------------------------- - HWProxy_ns::HWProxy * hwp; - - bool properties_missing; - bool init_device_done; - bool communication_error; - - std::string status_str; - std::string last_error; - -}; - -} // namespace_ns - -#endif // _LAKESHORE_336_H diff --git a/src/Lakeshore_336Class.cpp.old b/src/Lakeshore_336Class.cpp.old deleted file mode 100644 index 7a72a4acac732a96fe1a97b4a3d67419be73f4a1..0000000000000000000000000000000000000000 --- a/src/Lakeshore_336Class.cpp.old +++ /dev/null @@ -1,903 +0,0 @@ -static const char *ClassId = "$Id: Lakeshore_336Class.cpp.old,v 1.1 2010-11-05 10:36:03 olivierroux Exp $"; -static const char *TagName = "$Name: not supported by cvs2svn $"; -static const char *CvsPath = "$Source: /users/chaize/newsvn/cvsroot/Instrumentation/Lakeshore_336/src/Lakeshore_336Class.cpp.old,v $"; -static const char *SvnPath = "$HeadURL: $"; -static const char *HttpServer = "http://www.esrf.fr/computing/cs/tango/tango_doc/ds_doc/"; -//+============================================================================= -// -// file : Lakeshore_336Class.cpp -// -// description : C++ source for the Lakeshore_336Class. A singleton -// class derived from DeviceClass. It implements the -// command list and all properties and methods required -// by the Lakeshore_336 once per process. -// -// project : TANGO Device Server -// -// $Author: olivierroux $ -// -// $Revision: 1.1 $ -// -// $Log: not supported by cvs2svn $ -// -// copyleft : European Synchrotron Radiation Facility -// BP 220, Grenoble 38043 -// FRANCE -// -//-============================================================================= -// -// This file is generated by POGO -// (Program Obviously used to Generate tango Object) -// -// (c) - Software Engineering Group - ESRF -//============================================================================= - - -#include <tango.h> - -#include <Lakeshore_336.h> -#include <Lakeshore_336Class.h> - - -//+---------------------------------------------------------------------------- -/** - * Create Lakeshore_336Class singleton and return it in a C function for Python usage - */ -//+---------------------------------------------------------------------------- -extern "C" { -#ifdef WIN32 - -__declspec(dllexport) - -#endif - - Tango::DeviceClass *_create_Lakeshore_336_class(const char *name) { - return Lakeshore_336_ns::Lakeshore_336Class::init(name); - } -} - - -namespace Lakeshore_336_ns -{ - -//+---------------------------------------------------------------------------- -// -// method : GetInputAlarmStatusCmd::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be executed -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *GetInputAlarmStatusCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "GetInputAlarmStatusCmd::execute(): arrived" << endl; - - return insert((static_cast<Lakeshore_336 *>(device))->get_input_alarm_status()); -} - -//+---------------------------------------------------------------------------- -// -// method : OffClass::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be executed -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *OffClass::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "OffClass::execute(): arrived" << endl; - - ((static_cast<Lakeshore_336 *>(device))->off()); - return new CORBA::Any(); -} - -//+---------------------------------------------------------------------------- -// -// method : LowCmd::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be executed -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *LowCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "LowCmd::execute(): arrived" << endl; - - ((static_cast<Lakeshore_336 *>(device))->low()); - return new CORBA::Any(); -} - - -//+---------------------------------------------------------------------------- -// -// method : MediumCmd::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be executed -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *MediumCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "MediumCmd::execute(): arrived" << endl; - - ((static_cast<Lakeshore_336 *>(device))->medium()); - return new CORBA::Any(); -} - - -//+---------------------------------------------------------------------------- -// -// method : HighCmd::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be executed -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *HighCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "HighCmd::execute(): arrived" << endl; - - ((static_cast<Lakeshore_336 *>(device))->high()); - return new CORBA::Any(); -} - -//+---------------------------------------------------------------------------- -// -// method : LocalClass::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be executed -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *LocalClass::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "LocalClass::execute(): arrived" << endl; - - ((static_cast<Lakeshore_336 *>(device))->local()); - return new CORBA::Any(); -} - -//+---------------------------------------------------------------------------- -// -// method : RemoteClass::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be executed -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *RemoteClass::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "RemoteClass::execute(): arrived" << endl; - - ((static_cast<Lakeshore_336 *>(device))->remote()); - return new CORBA::Any(); -} - -//+---------------------------------------------------------------------------- -// -// method : LoopSelectInputCmd::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be executed -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *LoopSelectInputCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "LoopSelectInputCmd::execute(): arrived" << endl; - - Tango::DevShort argin; - extract(in_any, argin); - - ((static_cast<Lakeshore_336 *>(device))->loop_select_input(argin)); - return new CORBA::Any(); -} - -//+---------------------------------------------------------------------------- -// -// method : IORawClass::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be executed -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *IORawClass::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "IORawClass::execute(): arrived" << endl; - - Tango::DevString argin; - extract(in_any, argin); - - return insert((static_cast<Lakeshore_336 *>(device))->ioraw(argin)); -} - -//+---------------------------------------------------------------------------- -// -// method : RampONClass::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be executed -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *RampONClass::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "RampONClass::execute(): arrived" << endl; - - ((static_cast<Lakeshore_336 *>(device))->ramp_on()); - return new CORBA::Any(); -} - -//+---------------------------------------------------------------------------- -// -// method : RampOFFClass::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be executed -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *RampOFFClass::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "RampOFFClass::execute(): arrived" << endl; - - ((static_cast<Lakeshore_336 *>(device))->ramp_off()); - return new CORBA::Any(); -} - - -// -//---------------------------------------------------------------- -// Initialize pointer for singleton pattern -//---------------------------------------------------------------- -// -Lakeshore_336Class *Lakeshore_336Class::_instance = NULL; - -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336Class::Lakeshore_336Class(string &s) -// -// description : constructor for the Lakeshore_336Class -// -// in : - s : The class name -// -//----------------------------------------------------------------------------- -Lakeshore_336Class::Lakeshore_336Class(string &s):DeviceClass(s) -{ - - cout2 << "Entering Lakeshore_336Class constructor" << endl; - set_default_property(); - get_class_property(); - write_class_property(); - - cout2 << "Leaving Lakeshore_336Class constructor" << endl; - -} -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336Class::~Lakeshore_336Class() -// -// description : destructor for the Lakeshore_336Class -// -//----------------------------------------------------------------------------- -Lakeshore_336Class::~Lakeshore_336Class() -{ - _instance = NULL; -} - -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336Class::instance -// -// description : Create the object if not already done. Otherwise, just -// return a pointer to the object -// -// in : - name : The class name -// -//----------------------------------------------------------------------------- -Lakeshore_336Class *Lakeshore_336Class::init(const char *name) -{ - if (_instance == NULL) - { - try - { - string s(name); - _instance = new Lakeshore_336Class(s); - } - catch (bad_alloc) - { - throw; - } - } - return _instance; -} - -Lakeshore_336Class *Lakeshore_336Class::instance() -{ - if (_instance == NULL) - { - cerr << "Class is not initialised !!" << endl; - exit(-1); - } - return _instance; -} - -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336Class::command_factory -// -// description : Create the command object(s) and store them in the -// command list -// -//----------------------------------------------------------------------------- -void Lakeshore_336Class::command_factory() -{ - command_list.push_back(new GetInputAlarmStatusCmd("GetInputAlarmStatus", - Tango::DEV_VOID, Tango::DEV_STRING, - "", - "status of alarms", - Tango::OPERATOR)); - command_list.push_back(new OffClass("Off", - Tango::DEV_VOID, Tango::DEV_VOID, - "", - "", - Tango::OPERATOR)); - command_list.push_back(new LowCmd("Low", - Tango::DEV_VOID, Tango::DEV_VOID, - "", - "", - Tango::OPERATOR)); - command_list.push_back(new MediumCmd("Medium", - Tango::DEV_VOID, Tango::DEV_VOID, - "", - "", - Tango::OPERATOR)); - command_list.push_back(new HighCmd("High", - Tango::DEV_VOID, Tango::DEV_VOID, - "", - "", - Tango::OPERATOR)); - command_list.push_back(new LocalClass("Local", - Tango::DEV_VOID, Tango::DEV_VOID, - "", - "", - Tango::OPERATOR)); - command_list.push_back(new RemoteClass("Remote", - Tango::DEV_VOID, Tango::DEV_VOID, - "", - "", - Tango::OPERATOR)); - command_list.push_back(new LoopSelectInputCmd("LoopSelectInput", - Tango::DEV_SHORT, Tango::DEV_VOID, - "input to associate with the loop [1|2|3|4]", - "", - Tango::OPERATOR)); - command_list.push_back(new IORawClass("IORaw", - Tango::DEV_STRING, Tango::DEV_STRING, - "", - "", - Tango::OPERATOR)); - command_list.push_back(new RampONClass("RampON", - Tango::DEV_VOID, Tango::DEV_VOID, - "", - "", - Tango::OPERATOR)); - command_list.push_back(new RampOFFClass("RampOFF", - Tango::DEV_VOID, Tango::DEV_VOID, - "", - "", - Tango::OPERATOR)); - - // add polling if any - for (unsigned int i=0 ; i<command_list.size(); i++) - { - } -} - -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336Class::get_class_property -// -// description : Get the class property for specified name. -// -// in : string name : The property name -// -//+---------------------------------------------------------------------------- -Tango::DbDatum Lakeshore_336Class::get_class_property(string &prop_name) -{ - for (unsigned int i=0 ; i<cl_prop.size() ; i++) - if (cl_prop[i].name == prop_name) - return cl_prop[i]; - // if not found, return an empty DbDatum - return Tango::DbDatum(prop_name); -} -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336Class::get_default_device_property() -// -// description : Return the default value for device property. -// -//----------------------------------------------------------------------------- -Tango::DbDatum Lakeshore_336Class::get_default_device_property(string &prop_name) -{ - for (unsigned int i=0 ; i<dev_def_prop.size() ; i++) - if (dev_def_prop[i].name == prop_name) - return dev_def_prop[i]; - // if not found, return an empty DbDatum - return Tango::DbDatum(prop_name); -} - -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336Class::get_default_class_property() -// -// description : Return the default value for class property. -// -//----------------------------------------------------------------------------- -Tango::DbDatum Lakeshore_336Class::get_default_class_property(string &prop_name) -{ - for (unsigned int i=0 ; i<cl_def_prop.size() ; i++) - if (cl_def_prop[i].name == prop_name) - return cl_def_prop[i]; - // if not found, return an empty DbDatum - return Tango::DbDatum(prop_name); -} -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336Class::device_factory -// -// description : Create the device object(s) and store them in the -// device list -// -// in : Tango::DevVarStringArray *devlist_ptr : The device name list -// -//----------------------------------------------------------------------------- -void Lakeshore_336Class::device_factory(const Tango::DevVarStringArray *devlist_ptr) -{ - - // Create all devices.(Automatic code generation) - //------------------------------------------------------------- - for (unsigned long i=0 ; i < devlist_ptr->length() ; i++) - { - cout4 << "Device name : " << (*devlist_ptr)[i].in() << endl; - - // Create devices and add it into the device list - //---------------------------------------------------- - device_list.push_back(new Lakeshore_336(this, (*devlist_ptr)[i])); - - // Export device to the outside world - // Check before if database used. - //--------------------------------------------- - if ((Tango::Util::_UseDb == true) && (Tango::Util::_FileDb == false)) - export_device(device_list.back()); - else - export_device(device_list.back(), (*devlist_ptr)[i]); - } - // End of Automatic code generation - //------------------------------------------------------------- - -} -//+---------------------------------------------------------------------------- -// Method: Lakeshore_336Class::attribute_factory(vector<Tango::Attr *> &att_list) -//----------------------------------------------------------------------------- -void Lakeshore_336Class::attribute_factory(vector<Tango::Attr *> &att_list) -{ - // Attribute : temperature - temperatureAttrib *temperature = new temperatureAttrib(); - Tango::UserDefaultAttrProp temperature_prop; - temperature_prop.set_label("temperature "); - temperature_prop.set_unit("K"); - temperature_prop.set_standard_unit("Kelvin"); - temperature_prop.set_format("%4.3f"); - temperature_prop.set_description("temperature voie principale en Kelvin\nread : temperature courante\nwrite : nouvelle consigne\nAttribut polle pour controler si la consigne est atteinte\npolling par defaut : 250 ms\n(si on passe 3 fois par consigne = temperature \nsans depassement d'1 Delta Temperature)"); - temperature->set_default_properties(temperature_prop); - temperature->set_polling_period(250); - att_list.push_back(temperature); - - // Attribute : output - outputAttrib *output = new outputAttrib(); - Tango::UserDefaultAttrProp output_prop; - output_prop.set_label("output"); - output_prop.set_unit("%"); - output_prop.set_standard_unit("%"); - output_prop.set_display_unit("%"); - output_prop.set_format("%5.2f"); - output_prop.set_description("output value of regulation from 0 to 100 %"); - output->set_default_properties(output_prop); - output->set_disp_level(Tango::EXPERT); - att_list.push_back(output); - - // Attribute : range - rangeAttrib *range = new rangeAttrib(); - Tango::UserDefaultAttrProp range_prop; - range_prop.set_label("range"); - range_prop.set_format("%s"); - range_prop.set_description("current range\ncan be Low(0.01) Medium(0.1) High(1)"); - range->set_default_properties(range_prop); - range->set_disp_level(Tango::EXPERT); - att_list.push_back(range); - - // Attribute : deadBand - deadBandAttrib *dead_band = new deadBandAttrib(); - Tango::UserDefaultAttrProp dead_band_prop; - dead_band_prop.set_label("dead band"); - dead_band_prop.set_unit("�K"); - dead_band_prop.set_standard_unit("�K"); - dead_band_prop.set_display_unit("�K"); - dead_band_prop.set_format("%2.2f"); - dead_band_prop.set_description("dead band in witch we consider that setpoint is reached : \nif dead band is 0.5 e.g. \nif setpoint is 12 �K and temp is 12.4 -> OK\nif setpoint is 12 �K and temp is 11.6 -> OK\nif setpoint is 12 �K and temp is 11.4 -> KO\n"); - dead_band->set_default_properties(dead_band_prop); - dead_band->set_disp_level(Tango::EXPERT); - dead_band->set_memorized(); - dead_band->set_memorized_init(true); - att_list.push_back(dead_band); - - // Attribute : inputA - inputAAttrib *input_a = new inputAAttrib(); - Tango::UserDefaultAttrProp input_a_prop; - input_a_prop.set_label("input A"); - input_a_prop.set_unit("K"); - input_a_prop.set_standard_unit("K"); - input_a_prop.set_display_unit("�K"); - input_a_prop.set_format("%4.1f"); - input_a_prop.set_description("temperature in Kelvin for Input A"); - input_a->set_default_properties(input_a_prop); - input_a->set_disp_level(Tango::EXPERT); - att_list.push_back(input_a); - - // Attribute : inputB - inputBAttrib *input_b = new inputBAttrib(); - Tango::UserDefaultAttrProp input_b_prop; - input_b_prop.set_label("input B"); - input_b_prop.set_unit("K"); - input_b_prop.set_standard_unit("K"); - input_b_prop.set_display_unit("�K"); - input_b_prop.set_format("%4.1f"); - input_b_prop.set_description("temperature in Kelvin for Input B"); - input_b->set_default_properties(input_b_prop); - input_b->set_disp_level(Tango::EXPERT); - att_list.push_back(input_b); - - // Attribute : inputC - inputCAttrib *input_c = new inputCAttrib(); - Tango::UserDefaultAttrProp input_c_prop; - input_c_prop.set_label("input C"); - input_c_prop.set_unit("K"); - input_c_prop.set_standard_unit("K"); - input_c_prop.set_display_unit("�K"); - input_c_prop.set_format("%4.1f"); - input_c_prop.set_description("temperature in Kelvin for Input C"); - input_c->set_default_properties(input_c_prop); - input_c->set_disp_level(Tango::EXPERT); - att_list.push_back(input_c); - - // Attribute : inputD - inputDAttrib *input_d = new inputDAttrib(); - Tango::UserDefaultAttrProp input_d_prop; - input_d_prop.set_label("input D"); - input_d_prop.set_unit("K"); - input_d_prop.set_standard_unit("K"); - input_d_prop.set_display_unit("�K"); - input_d_prop.set_format("%4.1f"); - input_d_prop.set_description("temperature in Kelvin for Input D"); - input_d->set_default_properties(input_d_prop); - input_d->set_disp_level(Tango::EXPERT); - att_list.push_back(input_d); - - // Attribute : rampRate - rampRateAttrib *ramp_rate = new rampRateAttrib(); - ramp_rate->set_disp_level(Tango::EXPERT); - ramp_rate->set_memorized(); - ramp_rate->set_memorized_init(false); - att_list.push_back(ramp_rate); - - // Attribute : rampActive - rampActiveAttrib *ramp_active = new rampActiveAttrib(); - att_list.push_back(ramp_active); - - // End of Automatic code generation - //------------------------------------------------------------- -} - -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336Class::get_class_property() -// -// description : Read the class properties from database. -// -//----------------------------------------------------------------------------- -void Lakeshore_336Class::get_class_property() -{ - // Initialize your default values here (if not done with POGO). - //------------------------------------------------------------------ - - // Read class properties from database.(Automatic code generation) - //------------------------------------------------------------------ - - // Call database and extract values - //-------------------------------------------- - if (Tango::Util::instance()->_UseDb==true) - get_db_class()->get_property(cl_prop); - Tango::DbDatum def_prop; - int i = -1; - - - // End of Automatic code generation - //------------------------------------------------------------------ - -} - -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336Class::set_default_property -// -// description: Set default property (class and device) for wizard. -// For each property, add to wizard property name and description -// If default value has been set, add it to wizard property and -// store it in a DbDatum. -// -//----------------------------------------------------------------------------- -void Lakeshore_336Class::set_default_property() -{ - string prop_name; - string prop_desc; - string prop_def; - - vector<string> vect_data; - // Set Default Class Properties - // Set Default Device Properties - prop_name = "ComDeviceProxy"; - prop_desc = "the Tango name of the communication device proxy (Ethernet or GPIB)"; - prop_def = ""; - vect_data.clear(); - if (prop_def.length()>0) - { - Tango::DbDatum data(prop_name); - data << vect_data ; - dev_def_prop.push_back(data); - add_wiz_dev_prop(prop_name, prop_desc, prop_def); - } - else - add_wiz_dev_prop(prop_name, prop_desc); - - prop_name = "TimeInDeadBand"; - prop_desc = "if temperature stays in deadband around setpoint for TimeInDeadBand seconds,\nthe regulation is considered as successfull (the setpoint is reached, the stability is correct)\nThe state of the device goes from RUNNING (blue color) to STANDBY (yellow)\n"; - prop_def = "60"; - vect_data.clear(); - vect_data.push_back("60"); - if (prop_def.length()>0) - { - Tango::DbDatum data(prop_name); - data << vect_data ; - dev_def_prop.push_back(data); - add_wiz_dev_prop(prop_name, prop_desc, prop_def); - } - else - add_wiz_dev_prop(prop_name, prop_desc); - - prop_name = "LoopNumber"; - prop_desc = "Loop number. possible values : 1 or 2.\nDefault : 1"; - prop_def = ""; - vect_data.clear(); - if (prop_def.length()>0) - { - Tango::DbDatum data(prop_name); - data << vect_data ; - dev_def_prop.push_back(data); - add_wiz_dev_prop(prop_name, prop_desc, prop_def); - } - else - add_wiz_dev_prop(prop_name, prop_desc); - -} -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336Class::write_class_property -// -// description : Set class description as property in database -// -//----------------------------------------------------------------------------- -void Lakeshore_336Class::write_class_property() -{ - // First time, check if database used - //-------------------------------------------- - if (Tango::Util::_UseDb == false) - return; - - Tango::DbData data; - string classname = get_name(); - string header; - string::size_type start, end; - - // Put title - Tango::DbDatum title("ProjectTitle"); - string str_title("Lakeshore_336"); - title << str_title; - data.push_back(title); - - // Put Description - Tango::DbDatum description("Description"); - vector<string> str_desc; - str_desc.push_back("basic interface for the Lakeshore Model 336 Temperature controller,"); - str_desc.push_back("GPIB/Ethernet interface."); - str_desc.push_back("reads 4 temperatures, outputs, alarms."); - description << str_desc; - data.push_back(description); - - // put cvs or svn location - string filename(classname); - filename += "Class.cpp"; - - // Create a string with the class ID to - // get the string into the binary - string class_id(ClassId); - - // check for cvs information - string src_path(CvsPath); - start = src_path.find("/"); - if (start!=string::npos) - { - end = src_path.find(filename); - if (end>start) - { - string strloc = src_path.substr(start, end-start); - // Check if specific repository - start = strloc.find("/cvsroot/"); - if (start!=string::npos && start>0) - { - string repository = strloc.substr(0, start); - if (repository.find("/segfs/")!=string::npos) - strloc = "ESRF:" + strloc.substr(start, strloc.length()-start); - } - Tango::DbDatum cvs_loc("cvs_location"); - cvs_loc << strloc; - data.push_back(cvs_loc); - } - } - // check for svn information - else - { - string src_path(SvnPath); - start = src_path.find("://"); - if (start!=string::npos) - { - end = src_path.find(filename); - if (end>start) - { - header = "$HeadURL: "; - start = header.length(); - string strloc = src_path.substr(start, (end-start)); - - Tango::DbDatum svn_loc("svn_location"); - svn_loc << strloc; - data.push_back(svn_loc); - } - } - } - - // Get CVS or SVN revision tag - - // CVS tag - string tagname(TagName); - header = "$Name: "; - start = header.length(); - string endstr(" $"); - - end = tagname.find(endstr); - if (end!=string::npos && end>start) - { - string strtag = tagname.substr(start, end-start); - Tango::DbDatum cvs_tag("cvs_tag"); - cvs_tag << strtag; - data.push_back(cvs_tag); - } - - // SVN tag - string svnpath(SvnPath); - header = "$HeadURL: "; - start = header.length(); - - end = svnpath.find(endstr); - if (end!=string::npos && end>start) - { - string strloc = svnpath.substr(start, end-start); - - string tagstr ("/tags/"); - start = strloc.find(tagstr); - if ( start!=string::npos ) - { - start = start + tagstr.length(); - end = strloc.find(filename); - string strtag = strloc.substr(start, end-start-1); - - Tango::DbDatum svn_tag("svn_tag"); - svn_tag << strtag; - data.push_back(svn_tag); - } - } - - // Get URL location - string httpServ(HttpServer); - if (httpServ.length()>0) - { - Tango::DbDatum db_doc_url("doc_url"); - db_doc_url << httpServ; - data.push_back(db_doc_url); - } - - // Put inheritance - Tango::DbDatum inher_datum("InheritedFrom"); - vector<string> inheritance; - inheritance.push_back("Device_4Impl"); - inher_datum << inheritance; - data.push_back(inher_datum); - - // Call database and and values - //-------------------------------------------- - get_db_class()->put_property(data); -} - -} // namespace diff --git a/src/Lakeshore_336Class.h.old b/src/Lakeshore_336Class.h.old deleted file mode 100644 index d12b9f2ce2d82256004bb4587439ebbde6da97db..0000000000000000000000000000000000000000 --- a/src/Lakeshore_336Class.h.old +++ /dev/null @@ -1,488 +0,0 @@ -//============================================================================= -// -// file : Lakeshore_336Class.h -// -// description : Include for the Lakeshore_336Class root class. -// This class is the singleton class for -// the Lakeshore_336 device class. -// It contains all properties and methods which the -// Lakeshore_336 requires only once e.g. the commands. -// -// project : TANGO Device Server -// -// $Author: olivierroux $ -// -// $Revision: 1.1 $ -// $Date: 2010-11-05 10:36:03 $ -// -// SVN only: -// $HeadURL: $ -// -// CVS only: -// $Source: /users/chaize/newsvn/cvsroot/Instrumentation/Lakeshore_336/src/Lakeshore_336Class.h.old,v $ -// $Log: not supported by cvs2svn $ -// -// copyleft : European Synchrotron Radiation Facility -// BP 220, Grenoble 38043 -// FRANCE -// -//============================================================================= -// -// This file is generated by POGO -// (Program Obviously used to Generate tango Object) -// -// (c) - Software Engineering Group - ESRF -//============================================================================= - -#ifndef _LAKESHORE_336CLASS_H -#define _LAKESHORE_336CLASS_H - -#include <tango.h> -#include <Lakeshore_336.h> - - -namespace Lakeshore_336_ns -{//===================================== -// Define classes for attributes -//===================================== -class rampActiveAttrib: public Tango::Attr -{ -public: - rampActiveAttrib():Attr("rampActive", Tango::DEV_BOOLEAN, Tango::READ) {}; - ~rampActiveAttrib() {}; - - virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) - {(static_cast<Lakeshore_336 *>(dev))->read_rampActive(att);} - virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) - {return (static_cast<Lakeshore_336 *>(dev))->is_rampActive_allowed(ty);} -}; - -class rampRateAttrib: public Tango::Attr -{ -public: - rampRateAttrib():Attr("rampRate", Tango::DEV_DOUBLE, Tango::READ_WRITE) {}; - ~rampRateAttrib() {}; - - virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) - {(static_cast<Lakeshore_336 *>(dev))->read_rampRate(att);} - virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) - {(static_cast<Lakeshore_336 *>(dev))->write_rampRate(att);} - virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) - {return (static_cast<Lakeshore_336 *>(dev))->is_rampRate_allowed(ty);} -}; - -class inputDAttrib: public Tango::Attr -{ -public: - inputDAttrib():Attr("inputD", Tango::DEV_DOUBLE, Tango::READ) {}; - ~inputDAttrib() {}; - - virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) - {(static_cast<Lakeshore_336 *>(dev))->read_inputD(att);} - virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) - {return (static_cast<Lakeshore_336 *>(dev))->is_inputD_allowed(ty);} -}; - -class inputCAttrib: public Tango::Attr -{ -public: - inputCAttrib():Attr("inputC", Tango::DEV_DOUBLE, Tango::READ) {}; - ~inputCAttrib() {}; - - virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) - {(static_cast<Lakeshore_336 *>(dev))->read_inputC(att);} - virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) - {return (static_cast<Lakeshore_336 *>(dev))->is_inputC_allowed(ty);} -}; - -class inputBAttrib: public Tango::Attr -{ -public: - inputBAttrib():Attr("inputB", Tango::DEV_DOUBLE, Tango::READ) {}; - ~inputBAttrib() {}; - - virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) - {(static_cast<Lakeshore_336 *>(dev))->read_inputB(att);} - virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) - {return (static_cast<Lakeshore_336 *>(dev))->is_inputB_allowed(ty);} -}; - -class inputAAttrib: public Tango::Attr -{ -public: - inputAAttrib():Attr("inputA", Tango::DEV_DOUBLE, Tango::READ) {}; - ~inputAAttrib() {}; - - virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) - {(static_cast<Lakeshore_336 *>(dev))->read_inputA(att);} - virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) - {return (static_cast<Lakeshore_336 *>(dev))->is_inputA_allowed(ty);} -}; - -class deadBandAttrib: public Tango::Attr -{ -public: - deadBandAttrib():Attr("deadBand", Tango::DEV_DOUBLE, Tango::READ_WRITE) {}; - ~deadBandAttrib() {}; - - virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) - {(static_cast<Lakeshore_336 *>(dev))->read_deadBand(att);} - virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) - {(static_cast<Lakeshore_336 *>(dev))->write_deadBand(att);} - virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) - {return (static_cast<Lakeshore_336 *>(dev))->is_deadBand_allowed(ty);} -}; - -class rangeAttrib: public Tango::Attr -{ -public: - rangeAttrib():Attr("range", Tango::DEV_STRING, Tango::READ) {}; - ~rangeAttrib() {}; - - virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) - {(static_cast<Lakeshore_336 *>(dev))->read_range(att);} - virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) - {return (static_cast<Lakeshore_336 *>(dev))->is_range_allowed(ty);} -}; - -class outputAttrib: public Tango::Attr -{ -public: - outputAttrib():Attr("output", Tango::DEV_DOUBLE, Tango::READ) {}; - ~outputAttrib() {}; - - virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) - {(static_cast<Lakeshore_336 *>(dev))->read_output(att);} - virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) - {return (static_cast<Lakeshore_336 *>(dev))->is_output_allowed(ty);} -}; - -class temperatureAttrib: public Tango::Attr -{ -public: - temperatureAttrib():Attr("temperature", Tango::DEV_DOUBLE, Tango::READ_WRITE) {}; - ~temperatureAttrib() {}; - - virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) - {(static_cast<Lakeshore_336 *>(dev))->read_temperature(att);} - virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) - {(static_cast<Lakeshore_336 *>(dev))->write_temperature(att);} - virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) - {return (static_cast<Lakeshore_336 *>(dev))->is_temperature_allowed(ty);} -}; - -//========================================= -// Define classes for commands -//========================================= -class RampOFFClass : public Tango::Command -{ -public: - RampOFFClass(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out, - const char *in_desc, - const char *out_desc, - Tango::DispLevel level) - :Command(name,in,out,in_desc,out_desc, level) {}; - - RampOFFClass(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~RampOFFClass() {}; - - virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any); - virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any) - {return (static_cast<Lakeshore_336 *>(dev))->is_RampOFF_allowed(any);} -}; - - - -class RampONClass : public Tango::Command -{ -public: - RampONClass(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out, - const char *in_desc, - const char *out_desc, - Tango::DispLevel level) - :Command(name,in,out,in_desc,out_desc, level) {}; - - RampONClass(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~RampONClass() {}; - - virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any); - virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any) - {return (static_cast<Lakeshore_336 *>(dev))->is_RampON_allowed(any);} -}; - - - -class IORawClass : public Tango::Command -{ -public: - IORawClass(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out, - const char *in_desc, - const char *out_desc, - Tango::DispLevel level) - :Command(name,in,out,in_desc,out_desc, level) {}; - - IORawClass(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~IORawClass() {}; - - virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any); - virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any) - {return (static_cast<Lakeshore_336 *>(dev))->is_IORaw_allowed(any);} -}; - - - -class LoopSelectInputCmd : public Tango::Command -{ -public: - LoopSelectInputCmd(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out, - const char *in_desc, - const char *out_desc, - Tango::DispLevel level) - :Command(name,in,out,in_desc,out_desc, level) {}; - - LoopSelectInputCmd(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~LoopSelectInputCmd() {}; - - virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any); - virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any) - {return (static_cast<Lakeshore_336 *>(dev))->is_LoopSelectInput_allowed(any);} -}; - - - -class RemoteClass : public Tango::Command -{ -public: - RemoteClass(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out, - const char *in_desc, - const char *out_desc, - Tango::DispLevel level) - :Command(name,in,out,in_desc,out_desc, level) {}; - - RemoteClass(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~RemoteClass() {}; - - virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any); - virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any) - {return (static_cast<Lakeshore_336 *>(dev))->is_Remote_allowed(any);} -}; - - - -class LocalClass : public Tango::Command -{ -public: - LocalClass(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out, - const char *in_desc, - const char *out_desc, - Tango::DispLevel level) - :Command(name,in,out,in_desc,out_desc, level) {}; - - LocalClass(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~LocalClass() {}; - - virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any); - virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any) - {return (static_cast<Lakeshore_336 *>(dev))->is_Local_allowed(any);} -}; - - - -class HighCmd : public Tango::Command -{ -public: - HighCmd(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out, - const char *in_desc, - const char *out_desc, - Tango::DispLevel level) - :Command(name,in,out,in_desc,out_desc, level) {}; - - HighCmd(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~HighCmd() {}; - - virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any); - virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any) - {return (static_cast<Lakeshore_336 *>(dev))->is_High_allowed(any);} -}; - - - -class MediumCmd : public Tango::Command -{ -public: - MediumCmd(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out, - const char *in_desc, - const char *out_desc, - Tango::DispLevel level) - :Command(name,in,out,in_desc,out_desc, level) {}; - - MediumCmd(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~MediumCmd() {}; - - virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any); - virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any) - {return (static_cast<Lakeshore_336 *>(dev))->is_Medium_allowed(any);} -}; - - - -class LowCmd : public Tango::Command -{ -public: - LowCmd(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out, - const char *in_desc, - const char *out_desc, - Tango::DispLevel level) - :Command(name,in,out,in_desc,out_desc, level) {}; - - LowCmd(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~LowCmd() {}; - - virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any); - virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any) - {return (static_cast<Lakeshore_336 *>(dev))->is_Low_allowed(any);} -}; - - - -class OffClass : public Tango::Command -{ -public: - OffClass(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out, - const char *in_desc, - const char *out_desc, - Tango::DispLevel level) - :Command(name,in,out,in_desc,out_desc, level) {}; - - OffClass(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~OffClass() {}; - - virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any); - virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any) - {return (static_cast<Lakeshore_336 *>(dev))->is_Off_allowed(any);} -}; - - - -class GetInputAlarmStatusCmd : public Tango::Command -{ -public: - GetInputAlarmStatusCmd(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out, - const char *in_desc, - const char *out_desc, - Tango::DispLevel level) - :Command(name,in,out,in_desc,out_desc, level) {}; - - GetInputAlarmStatusCmd(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~GetInputAlarmStatusCmd() {}; - - virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any); - virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any) - {return (static_cast<Lakeshore_336 *>(dev))->is_GetInputAlarmStatus_allowed(any);} -}; - - - -// -// The Lakeshore_336Class singleton definition -// - -class -#ifdef WIN32 - __declspec(dllexport) -#endif - Lakeshore_336Class : public Tango::DeviceClass -{ -public: -// properties member data - -// add your own data members here -//------------------------------------ - -public: - Tango::DbData cl_prop; - Tango::DbData cl_def_prop; - Tango::DbData dev_def_prop; - -// Method prototypes - static Lakeshore_336Class *init(const char *); - static Lakeshore_336Class *instance(); - ~Lakeshore_336Class(); - Tango::DbDatum get_class_property(string &); - Tango::DbDatum get_default_device_property(string &); - Tango::DbDatum get_default_class_property(string &); - -protected: - Lakeshore_336Class(string &); - static Lakeshore_336Class *_instance; - void command_factory(); - void get_class_property(); - void attribute_factory(vector<Tango::Attr *> &); - void write_class_property(); - void set_default_property(); - string get_cvstag(); - string get_cvsroot(); - -private: - void device_factory(const Tango::DevVarStringArray *); -}; - - -} // namespace Lakeshore_336_ns - -#endif // _LAKESHORE_336CLASS_H diff --git a/src/Lakeshore_336StateMachine.cpp.old b/src/Lakeshore_336StateMachine.cpp.old deleted file mode 100644 index 3259b4496cdc055b23adca05d4c096bdc5e7d477..0000000000000000000000000000000000000000 --- a/src/Lakeshore_336StateMachine.cpp.old +++ /dev/null @@ -1,357 +0,0 @@ -static const char *RcsId = "$Id $"; -//+============================================================================= -// -// file : Lakeshore_336StateMachine.cpp -// -// description : C++ source for the Lakeshore_336 and its alowed -// methods for commands and attributes -// -// project : TANGO Device Server -// -// $Author: olivierroux $ -// -// $Revision: 1.1 $ -// $Date: 2010-11-05 10:36:03 $ -// -// SVN only: -// $HeadURL: $ -// -// CVS only: -// $Source: /users/chaize/newsvn/cvsroot/Instrumentation/Lakeshore_336/src/Lakeshore_336StateMachine.cpp.old,v $ -// $Log: not supported by cvs2svn $ -// -// copyleft : European Synchrotron Radiation Facility -// BP 220, Grenoble 38043 -// FRANCE -// -//-============================================================================= -// -// This file is generated by POGO -// (Program Obviously used to Generate tango Object) -// -// (c) - Software Engineering Group - ESRF -//============================================================================= - -#include <tango.h> -#include <Lakeshore_336.h> -#include <Lakeshore_336Class.h> - -/*==================================================================== - * This file contains the methods to allow commands and attributes - * read or write execution. - * - * If you wand to add your own code, add it between - * the "End/Re-Start of Generated Code" comments. - * - * If you want, you can also add your own methods. - *==================================================================== - */ - -namespace Lakeshore_336_ns -{ - -//================================================= -// Attributes Allowed Methods -//================================================= - -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::is_temperature_allowed -// -// description : Read/Write allowed for temperature attribute. -// -//----------------------------------------------------------------------------- -bool Lakeshore_336::is_temperature_allowed(Tango::AttReqType type) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::is_output_allowed -// -// description : Read/Write allowed for output attribute. -// -//----------------------------------------------------------------------------- -bool Lakeshore_336::is_output_allowed(Tango::AttReqType type) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::is_range_allowed -// -// description : Read/Write allowed for range attribute. -// -//----------------------------------------------------------------------------- -bool Lakeshore_336::is_range_allowed(Tango::AttReqType type) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::is_deadBand_allowed -// -// description : Read/Write allowed for deadBand attribute. -// -//----------------------------------------------------------------------------- -bool Lakeshore_336::is_deadBand_allowed(Tango::AttReqType type) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::is_inputA_allowed -// -// description : Read/Write allowed for inputA attribute. -// -//----------------------------------------------------------------------------- -bool Lakeshore_336::is_inputA_allowed(Tango::AttReqType type) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::is_inputB_allowed -// -// description : Read/Write allowed for inputB attribute. -// -//----------------------------------------------------------------------------- -bool Lakeshore_336::is_inputB_allowed(Tango::AttReqType type) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::is_inputC_allowed -// -// description : Read/Write allowed for inputC attribute. -// -//----------------------------------------------------------------------------- -bool Lakeshore_336::is_inputC_allowed(Tango::AttReqType type) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::is_inputD_allowed -// -// description : Read/Write allowed for inputD attribute. -// -//----------------------------------------------------------------------------- -bool Lakeshore_336::is_inputD_allowed(Tango::AttReqType type) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::is_rampRate_allowed -// -// description : Read/Write allowed for rampRate attribute. -// -//----------------------------------------------------------------------------- -bool Lakeshore_336::is_rampRate_allowed(Tango::AttReqType type) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::is_rampActive_allowed -// -// description : Read/Write allowed for rampActive attribute. -// -//----------------------------------------------------------------------------- -bool Lakeshore_336::is_rampActive_allowed(Tango::AttReqType type) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} - -//================================================= -// Commands Allowed Methods -//================================================= - -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::is_GetInputAlarmStatus_allowed -// -// description : Execution allowed for GetInputAlarmStatus command. -// -//----------------------------------------------------------------------------- -bool Lakeshore_336::is_GetInputAlarmStatus_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::is_Off_allowed -// -// description : Execution allowed for Off command. -// -//----------------------------------------------------------------------------- -bool Lakeshore_336::is_Off_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::is_Low_allowed -// -// description : Execution allowed for Low command. -// -//----------------------------------------------------------------------------- -bool Lakeshore_336::is_Low_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::is_Medium_allowed -// -// description : Execution allowed for Medium command. -// -//----------------------------------------------------------------------------- -bool Lakeshore_336::is_Medium_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::is_High_allowed -// -// description : Execution allowed for High command. -// -//----------------------------------------------------------------------------- -bool Lakeshore_336::is_High_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::is_Local_allowed -// -// description : Execution allowed for Local command. -// -//----------------------------------------------------------------------------- -bool Lakeshore_336::is_Local_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::is_Remote_allowed -// -// description : Execution allowed for Remote command. -// -//----------------------------------------------------------------------------- -bool Lakeshore_336::is_Remote_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::is_LoopSelectInput_allowed -// -// description : Execution allowed for LoopSelectInput command. -// -//----------------------------------------------------------------------------- -bool Lakeshore_336::is_LoopSelectInput_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::is_IORaw_allowed -// -// description : Execution allowed for IORaw command. -// -//----------------------------------------------------------------------------- -bool Lakeshore_336::is_IORaw_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::is_RampON_allowed -// -// description : Execution allowed for RampON command. -// -//----------------------------------------------------------------------------- -bool Lakeshore_336::is_RampON_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : Lakeshore_336::is_RampOFF_allowed -// -// description : Execution allowed for RampOFF command. -// -//----------------------------------------------------------------------------- -bool Lakeshore_336::is_RampOFF_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} - -} // namespace Lakeshore_336_ns diff --git a/src/main.cpp.old b/src/main.cpp.old deleted file mode 100644 index 5b1b66ab1273a47a1a91f4f15fda5118a0f0f1c0..0000000000000000000000000000000000000000 --- a/src/main.cpp.old +++ /dev/null @@ -1,74 +0,0 @@ -static const char *RcsId = "$Id $"; -//+============================================================================= -// -// file : main.cpp -// -// description : C++ source for a TANGO device server main. -// The main rule is to initialise (and create) the Tango -// system and to create the DServerClass singleton. -// The main should be the same for every Tango device server. -// -// project : TANGO Device Server -// -// $Author: olivierroux $ -// -// $Revision: 1.1 $ $ -// $Date: 2010-11-05 10:36:03 $ -// -// SVN only: -// $HeadURL: $ -// -// CVS only: -// $Source: /users/chaize/newsvn/cvsroot/Instrumentation/Lakeshore_336/src/main.cpp.old,v $ -// $Log: not supported by cvs2svn $ -// -// copyleft : European Synchrotron Radiation Facility -// BP 220, Grenoble 38043 -// FRANCE -// -//-============================================================================= -// -// This file is generated by POGO -// (Program Obviously used to Generate tango Object) -// -// (c) - Software Engineering Group - ESRF -//============================================================================= - -#include <tango.h> - - -int main(int argc,char *argv[]) -{ - - Tango::Util *tg; - try - { - // Initialise the device server - //---------------------------------------- - tg = Tango::Util::init(argc,argv); - - // Create the device server singleton - // which will create everything - //---------------------------------------- - tg->server_init(false); - - // Run the endless loop - //---------------------------------------- - cout << "Ready to accept request" << endl; - tg->server_run(); - } - catch (bad_alloc) - { - cout << "Can't allocate memory to store device object !!!" << endl; - cout << "Exiting" << endl; - } - catch (CORBA::Exception &e) - { - Tango::Except::print_exception(e); - - cout << "Received a CORBA_Exception" << endl; - cout << "Exiting" << endl; - } - tg->server_cleanup(); - return(0); -} diff --git a/src/task/HWProxy.cpp b/src/task/HWProxy.cpp index e17c5bd1c3cbf97e54386f110570e777e45934de..21729b362830d0eb1c8dfcdb9082c609911602b8 100644 --- a/src/task/HWProxy.cpp +++ b/src/task/HWProxy.cpp @@ -110,22 +110,16 @@ HWProxy::HWProxy (Tango::DeviceImpl * _host_device, Config & _conf) : catch (Tango::DevFailed &e) { m_comproxy = 0; - ERROR_STREAM << "could not connect to " << m_conf.com_device_proxy << " server DevFailed caught [" << e.errors[0].desc << "]" << std::endl; m_com_state = HWP_INITIALIZATION_ERROR; - m_last_error = std::string ("could not connect to ") + - m_conf.com_device_proxy + - std::string (" server DevFailed caught [") + - std::string (e.errors[0].desc) + - std::string ("]\n"); + m_last_error = "could not connect to " + m_conf.com_device_proxy + " server DevFailed caught [" + std::string (e.errors[0].desc) + "]\n"; + ERROR_STREAM << m_last_error << std::endl; } catch (...) { m_comproxy = 0; - ERROR_STREAM << "could not connect to " << m_conf.com_device_proxy << " server (...) caught" << std::endl; - m_last_error = std::string ("could not connect to ") + - m_conf.com_device_proxy + - std::string (" (...) caught\n"); m_com_state = HWP_INITIALIZATION_ERROR; + m_last_error = "could not connect to " + m_conf.com_device_proxy + " (...) caught\n"; + ERROR_STREAM << m_last_error << std::endl; } //- RampingStateManager for state management (scan functionalities) @@ -177,7 +171,6 @@ void HWProxy::process_message (yat::Message& _msg) if (m_com_state == HWP_INITIALIZATION_ERROR) { ERROR_STREAM << "HWProxy::handle_message::TASK_INIT DO NOTHING REASON : INITIALIZATION_ERROR" << std::endl; - // INFO_STREAM << "HWProxy::handle_message::TASK_INIT::m_com_state = " << int (m_com_state) << " str = " << com_state_enum_str [m_com_state] << m_com_state<< std::endl; return; } @@ -197,7 +190,6 @@ void HWProxy::process_message (yat::Message& _msg) m_last_error = "Error TASK_INIT Error trying to read HW parameters [try to restart devicce]\n"; ERROR_STREAM << "HWProxy::process_message::TASK_INIT Error trying read HW parameters" << std::endl; } - } break; //- TASK_EXIT ======================= @@ -233,7 +225,7 @@ void HWProxy::process_message (yat::Message& _msg) //- get the current setpoint read_setpoint (); - } + } break; //- TASK_TIMEOUT =================== case yat::TASK_TIMEOUT: @@ -259,17 +251,17 @@ void HWProxy::process_message (yat::Message& _msg) } break; case SET_DEADBAND_MSG: + { + DEBUG_STREAM << "HWProxy::handle_message handling SET_DEADBAND_MSG msg" << std::endl; + double * double_value = 0; + //- bool wr_ok = false; + _msg.detach_data(double_value); + if (double_value) { - DEBUG_STREAM << "HWProxy::handle_message handling SET_DEADBAND_MSG msg" << std::endl; - double * double_value = 0; - //- bool wr_ok = false; - _msg.detach_data(double_value); - if (double_value) - { - reg_manager->set_deadband (*double_value); - } + reg_manager->set_deadband (*double_value); } - break; + } + break; //- the way to set SETPOINT for loop [1|2] case SET_SETPOINT_MSG: { @@ -300,12 +292,12 @@ void HWProxy::process_message (yat::Message& _msg) //- force the setpoints loop 1 and loop 2 to the current value yat::Message * msg = 0; msg = new yat::Message(HWProxy_ns::SET_SETPOINT_MSG); - if (msg == 0) + if ( !msg ) { ERROR_STREAM << "HWProxy::Stop error trying to create msg "<< endl; - Tango::Except::throw_exception (_CPTC ("OUT_OF_MEMORY"), - _CPTC ("yat::Message allocation failed"), - _CPTC ("HWProxy::process_message::STOP_MSG")); + Tango::Except::throw_exception ("OUT_OF_MEMORY", + "yat::Message allocation failed", + "HWProxy::process_message::STOP_MSG"); } //- to stop write setpoint to the temperature value double val = m_temperature_read [m_input_number -1]; @@ -326,9 +318,9 @@ void HWProxy::process_message (yat::Message& _msg) if (*val < 0 || *val > 5) { ERROR_STREAM << "HWProxy::process_messsage::LOOP_SELECT_INPUT_MSG OUT_OF_RANGE input must be in [1...4] "<< endl; - Tango::Except::throw_exception (_CPTC ("OUT_OF_RANGE"), - _CPTC ("input must be in [1...4] "), - _CPTC ("HWProxy::process_messsage::LOOP_SELECT_INPUT_MSG")); + Tango::Except::throw_exception ("OUT_OF_RANGE", + "input must be in [1...4] ", + "HWProxy::process_messsage::LOOP_SELECT_INPUT_MSG"); } std::stringstream s; @@ -359,9 +351,9 @@ void HWProxy::process_message (yat::Message& _msg) if (*val < 0 || *val > 3) { ERROR_STREAM << "HWProxy::process_messsage::LOOP_SELECT_RANGE_MSG OUT_OF_RANGE input must be in [0...3] "<< endl; - Tango::Except::throw_exception (_CPTC ("OUT_OF_RANGE"), - _CPTC ("input must be in [0...3] "), - _CPTC ("HWProxy::process_messsage::LOOP_SELECT_RANGE_MSG")); + Tango::Except::throw_exception ("OUT_OF_RANGE", + "input must be in [0...3] ", + "HWProxy::process_messsage::LOOP_SELECT_RANGE_MSG"); } std::stringstream s; @@ -413,7 +405,6 @@ bool HWProxy::read_temperatures () { ERROR_STREAM << "HWProxy::read_temperatures () error reading temperature" << std::endl; m_com_state = HWP_COMMAND_ERROR; - // command_error ++; return false; } else @@ -435,7 +426,6 @@ bool HWProxy::read_temperatures () } } } - // command_ok ++; return true; } @@ -587,7 +577,6 @@ bool HWProxy::read_outmode () m_com_state = HWP_NO_ERROR; - // command_ok ++; return true; } @@ -786,10 +775,10 @@ Tango::DevState HWProxy::get_lakeshore_state (void) return Tango::ALARM; } //- bit 5 Autotune Error | bit 6 Calibration Error | bit 7 Processor Com Error - else if (((m_opstr_state & ATUNE) != 0) || - ((m_opstr_state & CAL) != 0) || - ((m_opstr_state & COM) != 0) || - (m_htrst_state != 0)) + else if (((m_opstr_state & ATUNE) != 0) || + ((m_opstr_state & CAL) != 0) || + ((m_opstr_state & COM) != 0) || + (m_htrst_state != 0)) { return Tango::FAULT; } @@ -825,45 +814,79 @@ std::string HWProxy::get_lakeshore_status (void) //- Operation Status Register if (m_opstr_state != 0) + { m_status_str += "OPSTR Status : \n"; + } if ((m_opstr_state & ALARM) != 0) + { m_status_str += "Lakeshore in ALARM\n"; + } if ((m_opstr_state & OVLD) != 0) + { m_status_str += "Lakeshore Overload\n"; + } if ((m_opstr_state & RAMP1_DONE) != 0) + { m_status_str += "Ramp 1 Done\n"; + } if ((m_opstr_state & RAMP2_DONE) != 0) + { m_status_str += "Ramp 2 Done\n"; + } if ((m_opstr_state & NDRV) != 0) + { m_status_str += "New Sensor Reading\n"; + } if ((m_opstr_state & ATUNE) != 0) + { m_status_str += "Autotune Error\n"; + } if ((m_opstr_state & CAL) != 0) + { m_status_str += "Caibration Error\n"; + } if ((m_opstr_state & CAL) != 0) + { m_status_str += "Processor Com Error\n"; + } //- Heater Status m_status_str += "Heater Status :\n"; if (m_htrst_state == 0) - m_status_str += "No error\n"; + { + m_status_str += "No error\n"; + } else if (m_htrst_state == 1) - m_status_str += "Heater Open Load\n"; + { + m_status_str += "Heater Open Load\n"; + } else if (m_htrst_state == 2) - m_status_str += "Heater Short Circuit\n"; + { + m_status_str += "Heater Short Circuit\n"; + } //- Input Reading Status m_status_str += "Input Status RDGST :\n"; if ((m_rdgst_state & INVALID_READING) != 0) + { m_status_str += "Invalid Reading\n"; + } if ((m_rdgst_state & TEMP_UNDR) != 0) + { m_status_str += "Temperature Under Range\n"; + } if ((m_rdgst_state & TEMP_OVR) != 0) + { m_status_str += "Temperature Over Range\n"; + } if ((m_rdgst_state & SENSOR_UNITS_0) != 0) + { m_status_str += "Sensor Units Zero\n"; + } if ((m_rdgst_state & SENSOR_UNITS_OVR) != 0) + { m_status_str += "Sensor Units Over Range\n"; + } //- ramp state m_status_str += reg_manager->get_status (); @@ -893,7 +916,7 @@ bool HWProxy::write_read (std::string cmd, std::string & response) response.clear (); DEBUG_STREAM << "HWProxy::write_read try to send command [" << cmd << "]" << std::endl; - Tango::DevString ds; + Tango::DevString ds = 0; ds = CORBA::string_dup (cmd.c_str ()); dd_in << ds; dd_out = m_comproxy->command_inout("WriteRead", dd_in);