Skip to content
Snippets Groups Projects
Commit 3ed81cca authored by Claudio Scafuri's avatar Claudio Scafuri :speech_balloon:
Browse files

add possiblity to change current ripple amplitude and switch ripple on/off

parent 8b7596bc
No related branches found
No related tags found
1 merge request!1start in OFF state
...@@ -65,9 +65,11 @@ ...@@ -65,9 +65,11 @@
//================================================================ //================================================================
// Attributes managed are: // Attributes managed are:
//================================================================ //================================================================
// current | Tango::DevDouble Scalar // current | Tango::DevDouble Scalar
// voltage | Tango::DevDouble Scalar // voltage | Tango::DevDouble Scalar
// currentSet | Tango::DevDouble Scalar // currentSet | Tango::DevDouble Scalar
// CurrentRipple | Tango::DevDouble Scalar
// AddRipple | Tango::DevBoolean Scalar
//================================================================ //================================================================
namespace SimulatedE2PS_ns namespace SimulatedE2PS_ns
...@@ -80,8 +82,8 @@ namespace SimulatedE2PS_ns ...@@ -80,8 +82,8 @@ namespace SimulatedE2PS_ns
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PS::SimulatedE2PS() * Method : SimulatedE2PS::SimulatedE2PS()
* Description: Constructors for a Tango device * Description: Constructors for a Tango device
* implementing the classSimulatedE2PS * implementing the classSimulatedE2PS
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
...@@ -122,8 +124,8 @@ SimulatedE2PS::~SimulatedE2PS() ...@@ -122,8 +124,8 @@ SimulatedE2PS::~SimulatedE2PS()
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PS::delete_device() * Method : SimulatedE2PS::delete_device()
* Description: will be called at device destruction or at init command * Description: will be called at device destruction or at init command
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
void SimulatedE2PS::delete_device() void SimulatedE2PS::delete_device()
...@@ -138,8 +140,8 @@ void SimulatedE2PS::delete_device() ...@@ -138,8 +140,8 @@ void SimulatedE2PS::delete_device()
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PS::init_device() * Method : SimulatedE2PS::init_device()
* Description: will be called at device initialization. * Description: will be called at device initialization.
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
void SimulatedE2PS::init_device() void SimulatedE2PS::init_device()
...@@ -162,6 +164,8 @@ void SimulatedE2PS::init_device() ...@@ -162,6 +164,8 @@ void SimulatedE2PS::init_device()
_current= 0.0; _current= 0.0;
_current_read= 0.0; _current_read= 0.0;
_voltage= 0.1; _voltage= 0.1;
_current_ripple = currentRipple;
_add_ripple = false;
_ohm = 0.2; // load resistance in ohm _ohm = 0.2; // load resistance in ohm
_busy = false; _busy = false;
thread_running=false; thread_running=false;
...@@ -180,8 +184,8 @@ void SimulatedE2PS::init_device() ...@@ -180,8 +184,8 @@ void SimulatedE2PS::init_device()
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PS::get_device_property() * Method : SimulatedE2PS::get_device_property()
* Description: Read database to initialize property data members. * Description: Read database to initialize property data members.
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
void SimulatedE2PS::get_device_property() void SimulatedE2PS::get_device_property()
...@@ -232,8 +236,8 @@ void SimulatedE2PS::get_device_property() ...@@ -232,8 +236,8 @@ void SimulatedE2PS::get_device_property()
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PS::always_executed_hook() * Method : SimulatedE2PS::always_executed_hook()
* Description: method always executed before any command is executed * Description: method always executed before any command is executed
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
void SimulatedE2PS::always_executed_hook() void SimulatedE2PS::always_executed_hook()
...@@ -248,8 +252,8 @@ void SimulatedE2PS::always_executed_hook() ...@@ -248,8 +252,8 @@ void SimulatedE2PS::always_executed_hook()
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PS::read_attr_hardware() * Method : SimulatedE2PS::read_attr_hardware()
* Description: Hardware acquisition for attributes * Description: Hardware acquisition for attributes
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
void SimulatedE2PS::read_attr_hardware(TANGO_UNUSED(std::vector<long> &attr_list)) void SimulatedE2PS::read_attr_hardware(TANGO_UNUSED(std::vector<long> &attr_list))
...@@ -263,8 +267,8 @@ void SimulatedE2PS::read_attr_hardware(TANGO_UNUSED(std::vector<long> &attr_list ...@@ -263,8 +267,8 @@ void SimulatedE2PS::read_attr_hardware(TANGO_UNUSED(std::vector<long> &attr_list
} }
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PS::write_attr_hardware() * Method : SimulatedE2PS::write_attr_hardware()
* Description: Hardware writing for attributes * Description: Hardware writing for attributes
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
void SimulatedE2PS::write_attr_hardware(TANGO_UNUSED(std::vector<long> &attr_list)) void SimulatedE2PS::write_attr_hardware(TANGO_UNUSED(std::vector<long> &attr_list))
...@@ -280,7 +284,7 @@ void SimulatedE2PS::write_attr_hardware(TANGO_UNUSED(std::vector<long> &attr_lis ...@@ -280,7 +284,7 @@ void SimulatedE2PS::write_attr_hardware(TANGO_UNUSED(std::vector<long> &attr_lis
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Read attribute current related method * Read attribute current related method
* Description: The powersupply current setting in amps * Description: The powersupply current setting in amps
* *
* Data type: Tango::DevDouble * Data type: Tango::DevDouble
* Attr type: Scalar * Attr type: Scalar
...@@ -292,13 +296,18 @@ void SimulatedE2PS::read_current(Tango::Attribute &attr) ...@@ -292,13 +296,18 @@ void SimulatedE2PS::read_current(Tango::Attribute &attr)
/*----- PROTECTED REGION ID(SimulatedE2PS::read_current) ENABLED START -----*/ /*----- PROTECTED REGION ID(SimulatedE2PS::read_current) ENABLED START -----*/
/* clang-format on */ /* clang-format on */
// Set the attribute value // Set the attribute value
double delta=drand48()-0.5;
double delta;
if (_add_ripple)
delta = drand48()-0.5; // use anothe random distribution?
else
delta = 0.0;
if(get_state() == Tango::OFF){ if(get_state() == Tango::OFF){
_current_read = delta * currentRipple; _current_read = 0.0; //delta * _current_ripple;
} }
else{ else{
_current_read = _current +( delta * currentRipple ); _current_read = _current +( delta * _current_ripple );
} }
attr.set_value(&_current_read); attr.set_value(&_current_read);
/* clang-format off */ /* clang-format off */
...@@ -307,7 +316,7 @@ void SimulatedE2PS::read_current(Tango::Attribute &attr) ...@@ -307,7 +316,7 @@ void SimulatedE2PS::read_current(Tango::Attribute &attr)
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Write attribute current related method * Write attribute current related method
* Description: The powersupply current setting in amps * Description: The powersupply current setting in amps
* *
* Data type: Tango::DevDouble * Data type: Tango::DevDouble
* Attr type: Scalar * Attr type: Scalar
...@@ -329,7 +338,7 @@ void SimulatedE2PS::write_current(Tango::WAttribute &attr) ...@@ -329,7 +338,7 @@ void SimulatedE2PS::write_current(Tango::WAttribute &attr)
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Read attribute voltage related method * Read attribute voltage related method
* Description: The powersupply voltage in volts. * Description: The powersupply voltage in volts.
* *
* Data type: Tango::DevDouble * Data type: Tango::DevDouble
* Attr type: Scalar * Attr type: Scalar
...@@ -348,7 +357,7 @@ void SimulatedE2PS::read_voltage(Tango::Attribute &attr) ...@@ -348,7 +357,7 @@ void SimulatedE2PS::read_voltage(Tango::Attribute &attr)
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Read attribute currentSet related method * Read attribute currentSet related method
* Description: The current set value as stored in the powersupply. * Description: The current set value as stored in the powersupply.
* *
* Data type: Tango::DevDouble * Data type: Tango::DevDouble
* Attr type: Scalar * Attr type: Scalar
...@@ -364,11 +373,95 @@ void SimulatedE2PS::read_currentSet(Tango::Attribute &attr) ...@@ -364,11 +373,95 @@ void SimulatedE2PS::read_currentSet(Tango::Attribute &attr)
/* clang-format off */ /* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::read_currentSet /*----- PROTECTED REGION END -----*/ // SimulatedE2PS::read_currentSet
} }
//--------------------------------------------------------
/**
* Read attribute CurrentRipple related method
* Description: Amplitude of current ripple (noise) added to output.
* Initial value from property CurrentRipple
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
//--------------------------------------------------------
void SimulatedE2PS::read_CurrentRipple(Tango::Attribute &attr)
{
DEBUG_STREAM << "SimulatedE2PS::read_CurrentRipple(Tango::Attribute &attr) entering... " << std::endl;
/*----- PROTECTED REGION ID(SimulatedE2PS::read_CurrentRipple) ENABLED START -----*/
/* clang-format on */
// Set the attribute value
attr.set_value(&_current_ripple);
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::read_CurrentRipple
}
//--------------------------------------------------------
/**
* Write attribute CurrentRipple related method
* Description: Amplitude of current ripple (noise) added to output.
* Initial value from property CurrentRipple
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
//--------------------------------------------------------
void SimulatedE2PS::write_CurrentRipple(Tango::WAttribute &attr)
{
DEBUG_STREAM << "SimulatedE2PS::write_CurrentRipple(Tango::WAttribute &attr) entering... " << std::endl;
// Retrieve write value
Tango::DevDouble w_val;
attr.get_write_value(w_val);
/*----- PROTECTED REGION ID(SimulatedE2PS::write_CurrentRipple) ENABLED START -----*/
/* clang-format on */
// Add your own code
_current_ripple = w_val;
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::write_CurrentRipple
}
//--------------------------------------------------------
/**
* Read attribute AddRipple related method
* Description: Switch on/off current ripple. If False the power supply is ideal :no noise.
*
* Data type: Tango::DevBoolean
* Attr type: Scalar
*/
//--------------------------------------------------------
void SimulatedE2PS::read_AddRipple(Tango::Attribute &attr)
{
DEBUG_STREAM << "SimulatedE2PS::read_AddRipple(Tango::Attribute &attr) entering... " << std::endl;
/*----- PROTECTED REGION ID(SimulatedE2PS::read_AddRipple) ENABLED START -----*/
/* clang-format on */
// Set the attribute value
attr.set_value(&_add_ripple);
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::read_AddRipple
}
//--------------------------------------------------------
/**
* Write attribute AddRipple related method
* Description: Switch on/off current ripple. If False the power supply is ideal :no noise.
*
* Data type: Tango::DevBoolean
* Attr type: Scalar
*/
//--------------------------------------------------------
void SimulatedE2PS::write_AddRipple(Tango::WAttribute &attr)
{
DEBUG_STREAM << "SimulatedE2PS::write_AddRipple(Tango::WAttribute &attr) entering... " << std::endl;
// Retrieve write value
Tango::DevBoolean w_val;
attr.get_write_value(w_val);
/*----- PROTECTED REGION ID(SimulatedE2PS::write_AddRipple) ENABLED START -----*/
/* clang-format on */
// Add your own code
_add_ripple = w_val;
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::write_AddRipple
}
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PS::add_dynamic_attributes() * Method : SimulatedE2PS::add_dynamic_attributes()
* Description: Create the dynamic attributes if any * Description: Create the dynamic attributes if any
* for specified device. * for specified device.
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
...@@ -384,7 +477,7 @@ void SimulatedE2PS::add_dynamic_attributes() ...@@ -384,7 +477,7 @@ void SimulatedE2PS::add_dynamic_attributes()
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Command On related method * Command On related method
* Description: Switch powersupply ON. * Description: Switch powersupply ON.
* *
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
...@@ -405,7 +498,7 @@ void SimulatedE2PS::on() ...@@ -405,7 +498,7 @@ void SimulatedE2PS::on()
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Command Off related method * Command Off related method
* Description: Switch power supply OFF. * Description: Switch power supply OFF.
* *
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
...@@ -432,7 +525,7 @@ void SimulatedE2PS::off() ...@@ -432,7 +525,7 @@ void SimulatedE2PS::off()
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Command Reset related method * Command Reset related method
* Description: Reset the powersupply to a well known state. * Description: Reset the powersupply to a well known state.
* *
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
...@@ -473,7 +566,7 @@ void SimulatedE2PS::start_cycling() ...@@ -473,7 +566,7 @@ void SimulatedE2PS::start_cycling()
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Command Abort related method * Command Abort related method
* Description: stop ramp or cycling * Description: stop ramp or cycling
* *
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
...@@ -491,7 +584,7 @@ void SimulatedE2PS::abort() ...@@ -491,7 +584,7 @@ void SimulatedE2PS::abort()
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Command Fault related method * Command Fault related method
* Description: Force a simulated faulty condtion * Description: Force a simulated faulty condtion
* *
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
...@@ -517,8 +610,8 @@ void SimulatedE2PS::fault() ...@@ -517,8 +610,8 @@ void SimulatedE2PS::fault()
} }
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PS::add_dynamic_commands() * Method : SimulatedE2PS::add_dynamic_commands()
* Description: Create the dynamic commands if any * Description: Create the dynamic commands if any
* for specified device. * for specified device.
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
......
...@@ -74,9 +74,11 @@ class SimulatedE2PS : public TANGO_BASE_CLASS ...@@ -74,9 +74,11 @@ class SimulatedE2PS : public TANGO_BASE_CLASS
protected : protected :
double _current; double _current;
double _current_read; double _current_read;
double _current_ripple;
double _voltage; double _voltage;
double _ohm; double _ohm;
bool _busy; bool _busy;
bool _add_ripple;
unsigned int rand_r_seed; unsigned int rand_r_seed;
class cyclethread *cycleloop; class cyclethread *cycleloop;
bool thread_running; bool thread_running;
...@@ -98,6 +100,8 @@ public: ...@@ -98,6 +100,8 @@ public:
Tango::DevDouble *attr_current_read; Tango::DevDouble *attr_current_read;
Tango::DevDouble *attr_voltage_read; Tango::DevDouble *attr_voltage_read;
Tango::DevDouble *attr_currentSet_read; Tango::DevDouble *attr_currentSet_read;
Tango::DevDouble *attr_CurrentRipple_read;
Tango::DevBoolean *attr_AddRipple_read;
// Constructors and destructors // Constructors and destructors
public: public:
...@@ -153,24 +157,24 @@ public: ...@@ -153,24 +157,24 @@ public:
public: public:
//-------------------------------------------------------- //--------------------------------------------------------
/* /*
* Method : SimulatedE2PS::read_attr_hardware() * Method : SimulatedE2PS::read_attr_hardware()
* Description: Hardware acquisition for attributes. * Description: Hardware acquisition for attributes.
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
virtual void read_attr_hardware(std::vector<long> &attr_list); virtual void read_attr_hardware(std::vector<long> &attr_list);
//-------------------------------------------------------- //--------------------------------------------------------
/* /*
* Method : SimulatedE2PS::write_attr_hardware() * Method : SimulatedE2PS::write_attr_hardware()
* Description: Hardware writing for attributes. * Description: Hardware writing for attributes.
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
virtual void write_attr_hardware(std::vector<long> &attr_list); virtual void write_attr_hardware(std::vector<long> &attr_list);
/** /**
* Attribute current related methods * Attribute current related methods
* Description: The powersupply current setting in amps * Description: The powersupply current setting in amps
* *
* Data type: Tango::DevDouble * Data type: Tango::DevDouble
* Attr type: Scalar * Attr type: Scalar
*/ */
virtual void read_current(Tango::Attribute &attr); virtual void read_current(Tango::Attribute &attr);
...@@ -178,28 +182,49 @@ public: ...@@ -178,28 +182,49 @@ public:
virtual bool is_current_allowed(Tango::AttReqType type); virtual bool is_current_allowed(Tango::AttReqType type);
/** /**
* Attribute voltage related methods * Attribute voltage related methods
* Description: The powersupply voltage in volts. * Description: The powersupply voltage in volts.
* *
* Data type: Tango::DevDouble * Data type: Tango::DevDouble
* Attr type: Scalar * Attr type: Scalar
*/ */
virtual void read_voltage(Tango::Attribute &attr); virtual void read_voltage(Tango::Attribute &attr);
virtual bool is_voltage_allowed(Tango::AttReqType type); virtual bool is_voltage_allowed(Tango::AttReqType type);
/** /**
* Attribute currentSet related methods * Attribute currentSet related methods
* Description: The current set value as stored in the powersupply. * Description: The current set value as stored in the powersupply.
* *
* Data type: Tango::DevDouble * Data type: Tango::DevDouble
* Attr type: Scalar * Attr type: Scalar
*/ */
virtual void read_currentSet(Tango::Attribute &attr); virtual void read_currentSet(Tango::Attribute &attr);
virtual bool is_currentSet_allowed(Tango::AttReqType type); virtual bool is_currentSet_allowed(Tango::AttReqType type);
/**
* Attribute CurrentRipple related methods
* Description: Amplitude of current ripple (noise) added to output.
* Initial value from property CurrentRipple
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
virtual void read_CurrentRipple(Tango::Attribute &attr);
virtual void write_CurrentRipple(Tango::WAttribute &attr);
virtual bool is_CurrentRipple_allowed(Tango::AttReqType type);
/**
* Attribute AddRipple related methods
* Description: Switch on/off current ripple. If False the power supply is ideal :no noise.
*
* Data type: Tango::DevBoolean
* Attr type: Scalar
*/
virtual void read_AddRipple(Tango::Attribute &attr);
virtual void write_AddRipple(Tango::WAttribute &attr);
virtual bool is_AddRipple_allowed(Tango::AttReqType type);
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PS::add_dynamic_attributes() * Method : SimulatedE2PS::add_dynamic_attributes()
* Description: Add dynamic attributes if any. * Description: Add dynamic attributes if any.
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
void add_dynamic_attributes(); void add_dynamic_attributes();
...@@ -211,21 +236,21 @@ public: ...@@ -211,21 +236,21 @@ public:
public: public:
/** /**
* Command On related method * Command On related method
* Description: Switch powersupply ON. * Description: Switch powersupply ON.
* *
*/ */
virtual void on(); virtual void on();
virtual bool is_On_allowed(const CORBA::Any &any); virtual bool is_On_allowed(const CORBA::Any &any);
/** /**
* Command Off related method * Command Off related method
* Description: Switch power supply OFF. * Description: Switch power supply OFF.
* *
*/ */
virtual void off(); virtual void off();
virtual bool is_Off_allowed(const CORBA::Any &any); virtual bool is_Off_allowed(const CORBA::Any &any);
/** /**
* Command Reset related method * Command Reset related method
* Description: Reset the powersupply to a well known state. * Description: Reset the powersupply to a well known state.
* *
*/ */
virtual void reset(); virtual void reset();
...@@ -239,14 +264,14 @@ public: ...@@ -239,14 +264,14 @@ public:
virtual bool is_StartCycling_allowed(const CORBA::Any &any); virtual bool is_StartCycling_allowed(const CORBA::Any &any);
/** /**
* Command Abort related method * Command Abort related method
* Description: stop ramp or cycling * Description: stop ramp or cycling
* *
*/ */
virtual void abort(); virtual void abort();
virtual bool is_Abort_allowed(const CORBA::Any &any); virtual bool is_Abort_allowed(const CORBA::Any &any);
/** /**
* Command Fault related method * Command Fault related method
* Description: Force a simulated faulty condtion * Description: Force a simulated faulty condtion
* *
*/ */
virtual void fault(); virtual void fault();
...@@ -255,8 +280,8 @@ public: ...@@ -255,8 +280,8 @@ public:
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PS::add_dynamic_commands() * Method : SimulatedE2PS::add_dynamic_commands()
* Description: Add dynamic commands if any. * Description: Add dynamic commands if any.
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
void add_dynamic_commands(); void add_dynamic_commands();
......
<?xml version="1.0" encoding="ASCII"?> <?xml version="1.0" encoding="ASCII"?>
<pogoDsl:PogoSystem xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:pogoDsl="http://www.esrf.fr/tango/pogo/PogoDsl"> <pogoDsl:PogoSystem xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:pogoDsl="http://tango.org/pogo/PogoDsl">
<classes name="SimulatedE2PS" pogoRevision="9.8"> <classes name="SimulatedE2PS" pogoRevision="9.9">
<description description="Simulated power supply for Elettra 2.0 tests (digiltal twin).&#xA;Tango interface Loosely based on NGPS tango device" title="SimulatedE2PS" sourcePath="/homelocal/claudio/src/gitlab/dt/ds/simulatede2ps/src" language="Cpp" filestogenerate="XMI file,Code files,Protected Regions" license="GPL" copyright="" hasMandatoryProperty="false" hasConcreteProperty="true" hasAbstractCommand="false" hasAbstractAttribute="false"> <description description="Simulated power supply for Elettra 2.0 tests (digiltal twin).&#xA;Tango interface Loosely based on NGPS tango device" title="SimulatedE2PS" sourcePath="/home/claudio/src/gitlab/dt/ds/simulatede2ps/src" language="Cpp" filestogenerate="XMI file,Code files,Protected Regions" license="GPL" copyright="" hasMandatoryProperty="false" hasConcreteProperty="true" hasAbstractCommand="false" hasAbstractAttribute="false">
<inheritances classname="Device_Impl" sourcePath=""/> <inheritances classname="Device_Impl" sourcePath=""/>
<identification contact="at elettra.eu - claudio.scafuri" author="claudio.scafuri" emailDomain="elettra.eu" classFamily="Simulators" siteSpecific="" platform="All Platforms" bus="Not Applicable" manufacturer="none" reference=""> <identification contact="at elettra.eu - claudio.scafuri" author="claudio.scafuri" emailDomain="elettra.eu" classFamily="Simulators" siteSpecific="" platform="All Platforms" bus="Not Applicable" manufacturer="none" reference="">
<keyWords>Power supply</keyWords> <keyWords>Power supply</keyWords>
...@@ -129,6 +129,22 @@ ...@@ -129,6 +129,22 @@
<properties description="The current set value as stored in the powersupply." label="" unit="A" standardUnit="1" displayUnit="A" format="%6.4f" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> <properties description="The current set value as stored in the powersupply." label="" unit="A" standardUnit="1" displayUnit="A" format="%6.4f" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
<readExcludedStates>UNKNOWN</readExcludedStates> <readExcludedStates>UNKNOWN</readExcludedStates>
</attributes> </attributes>
<attributes name="CurrentRipple" attType="Scalar" rwType="READ_WRITE" displayLevel="EXPERT" polledPeriod="0" maxX="" maxY="" allocReadMember="false" isDynamic="false">
<dataType xsi:type="pogoDsl:DoubleType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
<dataReadyEvent fire="false" libCheckCriteria="true"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="Amplitude of current ripple (noise) added to output.&#xA;Initial value from property CurrentRipple" label="current ripple (noise)" unit="A" standardUnit="1" displayUnit="A" format="%6.6f" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="AddRipple" attType="Scalar" rwType="READ_WRITE" displayLevel="EXPERT" polledPeriod="0" maxX="" maxY="" allocReadMember="false" isDynamic="false">
<dataType xsi:type="pogoDsl:BooleanType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
<dataReadyEvent fire="false" libCheckCriteria="true"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="Switch on/off current ripple. If False the power supply is ideal :no noise." label="add current ripple" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<states name="UNKNOWN" description="initialization failed or incomlete"> <states name="UNKNOWN" description="initialization failed or incomlete">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/> <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states> </states>
...@@ -147,6 +163,6 @@ ...@@ -147,6 +163,6 @@
<states name="OFF" description="power supply off , not sourcing current"> <states name="OFF" description="power supply off , not sourcing current">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/> <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states> </states>
<preferences docHome="./doc_html" makefileHome="/usr/local/tango-9.3.6/share/pogo/preferences"/> <preferences docHome="./doc_html" makefileHome="$(TANGO_HOME)"/>
</classes> </classes>
</pogoDsl:PogoSystem> </pogoDsl:PogoSystem>
...@@ -143,7 +143,7 @@ SimulatedE2PSClass *SimulatedE2PSClass::instance() ...@@ -143,7 +143,7 @@ SimulatedE2PSClass *SimulatedE2PSClass::instance()
{ {
if (_instance == NULL) if (_instance == NULL)
{ {
std::cerr << "Class is not initialised !!" << std::endl; std::cerr << "Class is not initialized !!" << std::endl;
exit(-1); exit(-1);
} }
return _instance; return _instance;
...@@ -268,8 +268,8 @@ CORBA::Any *FaultClass::execute(Tango::DeviceImpl *device, TANGO_UNUSED(const CO ...@@ -268,8 +268,8 @@ CORBA::Any *FaultClass::execute(Tango::DeviceImpl *device, TANGO_UNUSED(const CO
//=================================================================== //===================================================================
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PSClass::get_class_property() * Method : SimulatedE2PSClass::get_class_property()
* Description: Get the class property for specified name. * Description: Get the class property for specified name.
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
Tango::DbDatum SimulatedE2PSClass::get_class_property(std::string &prop_name) Tango::DbDatum SimulatedE2PSClass::get_class_property(std::string &prop_name)
...@@ -283,8 +283,8 @@ Tango::DbDatum SimulatedE2PSClass::get_class_property(std::string &prop_name) ...@@ -283,8 +283,8 @@ Tango::DbDatum SimulatedE2PSClass::get_class_property(std::string &prop_name)
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PSClass::get_default_device_property() * Method : SimulatedE2PSClass::get_default_device_property()
* Description: Return the default value for device property. * Description: Return the default value for device property.
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
Tango::DbDatum SimulatedE2PSClass::get_default_device_property(std::string &prop_name) Tango::DbDatum SimulatedE2PSClass::get_default_device_property(std::string &prop_name)
...@@ -298,8 +298,8 @@ Tango::DbDatum SimulatedE2PSClass::get_default_device_property(std::string &prop ...@@ -298,8 +298,8 @@ Tango::DbDatum SimulatedE2PSClass::get_default_device_property(std::string &prop
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PSClass::get_default_class_property() * Method : SimulatedE2PSClass::get_default_class_property()
* Description: Return the default value for class property. * Description: Return the default value for class property.
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
Tango::DbDatum SimulatedE2PSClass::get_default_class_property(std::string &prop_name) Tango::DbDatum SimulatedE2PSClass::get_default_class_property(std::string &prop_name)
...@@ -314,8 +314,8 @@ Tango::DbDatum SimulatedE2PSClass::get_default_class_property(std::string &prop_ ...@@ -314,8 +314,8 @@ Tango::DbDatum SimulatedE2PSClass::get_default_class_property(std::string &prop_
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PSClass::set_default_property() * Method : SimulatedE2PSClass::set_default_property()
* Description: Set default property (class and device) for wizard. * Description: Set default property (class and device) for wizard.
* For each property, add to wizard property name and description. * For each property, add to wizard property name and description.
* If default value has been set, add it to wizard property and * If default value has been set, add it to wizard property and
* store it in a DbDatum. * store it in a DbDatum.
...@@ -349,43 +349,43 @@ void SimulatedE2PSClass::set_default_property() ...@@ -349,43 +349,43 @@ void SimulatedE2PSClass::set_default_property()
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PSClass::write_class_property() * Method : SimulatedE2PSClass::write_class_property()
* Description: Set class description fields as property in database * Description: Set class description fields as property in database
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
void SimulatedE2PSClass::write_class_property() void SimulatedE2PSClass::write_class_property()
{ {
// First time, check if database used // First time, check if database used
if (Tango::Util::_UseDb == false) if (Tango::Util::_UseDb == false)
return; return;
Tango::DbData data; Tango::DbData data;
std::string classname = get_name(); std::string classname = get_name();
std::string header; std::string header;
// Put title // Put title
Tango::DbDatum title("ProjectTitle"); Tango::DbDatum title("ProjectTitle");
std::string str_title("SimulatedE2PS"); std::string str_title("SimulatedE2PS");
title << str_title; title << str_title;
data.push_back(title); data.push_back(title);
// Put Description // Put Description
Tango::DbDatum description("Description"); Tango::DbDatum description("Description");
std::vector<std::string> str_desc; std::vector<std::string> str_desc;
str_desc.push_back("Simulated power supply for Elettra 2.0 tests (digiltal twin)."); str_desc.push_back("Simulated power supply for Elettra 2.0 tests (digiltal twin).");
str_desc.push_back("Tango interface Loosely based on NGPS tango device"); str_desc.push_back("Tango interface Loosely based on NGPS tango device");
description << str_desc; description << str_desc;
data.push_back(description); data.push_back(description);
// Put inheritance // Put inheritance
Tango::DbDatum inher_datum("InheritedFrom"); Tango::DbDatum inher_datum("InheritedFrom");
std::vector<std::string> inheritance; std::vector<std::string> inheritance;
inheritance.push_back("TANGO_BASE_CLASS"); inheritance.push_back("TANGO_BASE_CLASS");
inher_datum << inheritance; inher_datum << inheritance;
data.push_back(inher_datum); data.push_back(inher_datum);
// Call database and and values // Call database and and values
get_db_class()->put_property(data); get_db_class()->put_property(data);
} }
//=================================================================== //===================================================================
...@@ -394,44 +394,44 @@ get_db_class()->put_property(data); ...@@ -394,44 +394,44 @@ get_db_class()->put_property(data);
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PSClass::device_factory() * Method : SimulatedE2PSClass::device_factory()
* Description: Create the device object(s) * Description: Create the device object(s)
* and store them in the device list * and store them in the device list
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
void SimulatedE2PSClass::device_factory(const Tango::DevVarStringArray *devlist_ptr) void SimulatedE2PSClass::device_factory(const Tango::DevVarStringArray *devlist_ptr)
{ {
/*----- PROTECTED REGION ID(SimulatedE2PSClass::device_factory_before) ENABLED START -----*/ /*----- PROTECTED REGION ID(SimulatedE2PSClass::device_factory_before) ENABLED START -----*/
/* clang-format on */ /* clang-format on */
// Add your own code // Add your own code
/* clang-format off */ /* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PSClass::device_factory_before /*----- PROTECTED REGION END -----*/ // SimulatedE2PSClass::device_factory_before
// Create devices and add it into the device list // Create devices and add it into the device list
for (unsigned long i=0 ; i<devlist_ptr->length() ; i++) for (unsigned long i=0 ; i<devlist_ptr->length() ; i++)
{ {
TANGO_LOG_DEBUG << "Device name : " << (*devlist_ptr)[i].in() << std::endl; TANGO_LOG_DEBUG << "Device name : " << (*devlist_ptr)[i].in() << std::endl;
device_list.push_back(new SimulatedE2PS(this, (*devlist_ptr)[i])); device_list.push_back(new SimulatedE2PS(this, (*devlist_ptr)[i]));
} }
// Manage dynamic attributes if any
erase_dynamic_attributes(devlist_ptr, get_class_attr()->get_attr_list());
// Export devices to the outside world // Manage dynamic attributes if any
for (unsigned long i=1 ; i<=devlist_ptr->length() ; i++) erase_dynamic_attributes(devlist_ptr, get_class_attr()->get_attr_list());
{
// Add dynamic attributes if any
SimulatedE2PS *dev = static_cast<SimulatedE2PS *>(device_list[device_list.size()-i]);
dev->add_dynamic_attributes();
// Check before if database used. // Export devices to the outside world
if ((Tango::Util::_UseDb == true) && (Tango::Util::_FileDb == false)) for (unsigned long i=1 ; i<=devlist_ptr->length() ; i++)
export_device(dev); {
else // Add dynamic attributes if any
export_device(dev, dev->get_name().c_str()); SimulatedE2PS *dev = static_cast<SimulatedE2PS *>(device_list[device_list.size()-i]);
} dev->add_dynamic_attributes();
// Check before if database used.
if ((Tango::Util::_UseDb == true) && (Tango::Util::_FileDb == false))
export_device(dev);
else
export_device(dev, dev->get_name().c_str());
}
/*----- PROTECTED REGION ID(SimulatedE2PSClass::device_factory_after) ENABLED START -----*/ /*----- PROTECTED REGION ID(SimulatedE2PSClass::device_factory_after) ENABLED START -----*/
/* clang-format on */ /* clang-format on */
// Add your own code // Add your own code
/* clang-format off */ /* clang-format off */
...@@ -439,8 +439,8 @@ for (unsigned long i=1 ; i<=devlist_ptr->length() ; i++) ...@@ -439,8 +439,8 @@ for (unsigned long i=1 ; i<=devlist_ptr->length() ; i++)
} }
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PSClass::attribute_factory() * Method : SimulatedE2PSClass::attribute_factory()
* Description: Create the attribute object(s) * Description: Create the attribute object(s)
* and store them in the attribute list * and store them in the attribute list
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
...@@ -520,6 +520,52 @@ void SimulatedE2PSClass::attribute_factory(std::vector<Tango::Attr *> &att_list) ...@@ -520,6 +520,52 @@ void SimulatedE2PSClass::attribute_factory(std::vector<Tango::Attr *> &att_list)
// Not Memorized // Not Memorized
att_list.push_back(currentset); att_list.push_back(currentset);
// Attribute : CurrentRipple
CurrentRippleAttrib *currentripple = new CurrentRippleAttrib();
Tango::UserDefaultAttrProp currentripple_prop;
currentripple_prop.set_description("Amplitude of current ripple (noise) added to output.\nInitial value from property CurrentRipple");
currentripple_prop.set_label("current ripple (noise)");
currentripple_prop.set_unit("A");
currentripple_prop.set_standard_unit("1");
currentripple_prop.set_display_unit("A");
currentripple_prop.set_format("%6.6f");
// max_value not set for CurrentRipple
// min_value not set for CurrentRipple
// max_alarm not set for CurrentRipple
// min_alarm not set for CurrentRipple
// max_warning not set for CurrentRipple
// min_warning not set for CurrentRipple
// delta_t not set for CurrentRipple
// delta_val not set for CurrentRipple
currentripple->set_default_properties(currentripple_prop);
// Not Polled
currentripple->set_disp_level(Tango::EXPERT);
// Not Memorized
att_list.push_back(currentripple);
// Attribute : AddRipple
AddRippleAttrib *addripple = new AddRippleAttrib();
Tango::UserDefaultAttrProp addripple_prop;
addripple_prop.set_description("Switch on/off current ripple. If False the power supply is ideal :no noise.");
addripple_prop.set_label("add current ripple");
// unit not set for AddRipple
// standard_unit not set for AddRipple
// display_unit not set for AddRipple
// format not set for AddRipple
// max_value not set for AddRipple
// min_value not set for AddRipple
// max_alarm not set for AddRipple
// min_alarm not set for AddRipple
// max_warning not set for AddRipple
// min_warning not set for AddRipple
// delta_t not set for AddRipple
// delta_val not set for AddRipple
addripple->set_default_properties(addripple_prop);
// Not Polled
addripple->set_disp_level(Tango::EXPERT);
// Not Memorized
att_list.push_back(addripple);
// Create a list of static attributes // Create a list of static attributes
create_static_attribute_list(get_class_attr()->get_attr_list()); create_static_attribute_list(get_class_attr()->get_attr_list());
...@@ -531,8 +577,8 @@ void SimulatedE2PSClass::attribute_factory(std::vector<Tango::Attr *> &att_list) ...@@ -531,8 +577,8 @@ void SimulatedE2PSClass::attribute_factory(std::vector<Tango::Attr *> &att_list)
} }
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PSClass::pipe_factory() * Method : SimulatedE2PSClass::pipe_factory()
* Description: Create the pipe object(s) * Description: Create the pipe object(s)
* and store them in the pipe list * and store them in the pipe list
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
...@@ -551,8 +597,8 @@ void SimulatedE2PSClass::pipe_factory() ...@@ -551,8 +597,8 @@ void SimulatedE2PSClass::pipe_factory()
} }
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PSClass::command_factory() * Method : SimulatedE2PSClass::command_factory()
* Description: Create the command object(s) * Description: Create the command object(s)
* and store them in the command list * and store them in the command list
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
...@@ -643,7 +689,7 @@ void SimulatedE2PSClass::create_static_attribute_list(std::vector<Tango::Attr *> ...@@ -643,7 +689,7 @@ void SimulatedE2PSClass::create_static_attribute_list(std::vector<Tango::Attr *>
for (unsigned long i=0 ; i<att_list.size() ; i++) for (unsigned long i=0 ; i<att_list.size() ; i++)
{ {
std::string att_name(att_list[i]->get_name()); std::string att_name(att_list[i]->get_name());
transform(att_name.begin(), att_name.end(), att_name.begin(), ::tolower); std::transform(att_name.begin(), att_name.end(), att_name.begin(), ::tolower);
defaultAttList.push_back(att_name); defaultAttList.push_back(att_name);
} }
...@@ -699,8 +745,8 @@ void SimulatedE2PSClass::erase_dynamic_attributes(const Tango::DevVarStringArray ...@@ -699,8 +745,8 @@ void SimulatedE2PSClass::erase_dynamic_attributes(const Tango::DevVarStringArray
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PSClass::get_attr_object_by_name() * Method : SimulatedE2PSClass::get_attr_object_by_name()
* Description: returns Tango::Attr * object found by name * Description: returns Tango::Attr * object found by name
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
Tango::Attr *SimulatedE2PSClass::get_attr_object_by_name(std::vector<Tango::Attr *> &att_list, std::string attname) Tango::Attr *SimulatedE2PSClass::get_attr_object_by_name(std::vector<Tango::Attr *> &att_list, std::string attname)
......
...@@ -61,8 +61,8 @@ class currentAttrib: public Tango::Attr ...@@ -61,8 +61,8 @@ class currentAttrib: public Tango::Attr
{ {
public: public:
currentAttrib():Attr("current", currentAttrib():Attr("current",
Tango::DEV_DOUBLE, Tango::READ_WRITE) {}; Tango::DEV_DOUBLE, Tango::READ_WRITE) {}
~currentAttrib() {}; ~currentAttrib() {}
virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att)
{(static_cast<SimulatedE2PS *>(dev))->read_current(att);} {(static_cast<SimulatedE2PS *>(dev))->read_current(att);}
virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att)
...@@ -76,8 +76,8 @@ class voltageAttrib: public Tango::Attr ...@@ -76,8 +76,8 @@ class voltageAttrib: public Tango::Attr
{ {
public: public:
voltageAttrib():Attr("voltage", voltageAttrib():Attr("voltage",
Tango::DEV_DOUBLE, Tango::READ) {}; Tango::DEV_DOUBLE, Tango::READ) {}
~voltageAttrib() {}; ~voltageAttrib() {}
virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att)
{(static_cast<SimulatedE2PS *>(dev))->read_voltage(att);} {(static_cast<SimulatedE2PS *>(dev))->read_voltage(att);}
virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty)
...@@ -89,14 +89,44 @@ class currentSetAttrib: public Tango::Attr ...@@ -89,14 +89,44 @@ class currentSetAttrib: public Tango::Attr
{ {
public: public:
currentSetAttrib():Attr("currentSet", currentSetAttrib():Attr("currentSet",
Tango::DEV_DOUBLE, Tango::READ) {}; Tango::DEV_DOUBLE, Tango::READ) {}
~currentSetAttrib() {}; ~currentSetAttrib() {}
virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att)
{(static_cast<SimulatedE2PS *>(dev))->read_currentSet(att);} {(static_cast<SimulatedE2PS *>(dev))->read_currentSet(att);}
virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty)
{return (static_cast<SimulatedE2PS *>(dev))->is_currentSet_allowed(ty);} {return (static_cast<SimulatedE2PS *>(dev))->is_currentSet_allowed(ty);}
}; };
// Attribute CurrentRipple class definition
class CurrentRippleAttrib: public Tango::Attr
{
public:
CurrentRippleAttrib():Attr("CurrentRipple",
Tango::DEV_DOUBLE, Tango::READ_WRITE) {}
~CurrentRippleAttrib() {}
virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att)
{(static_cast<SimulatedE2PS *>(dev))->read_CurrentRipple(att);}
virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att)
{(static_cast<SimulatedE2PS *>(dev))->write_CurrentRipple(att);}
virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty)
{return (static_cast<SimulatedE2PS *>(dev))->is_CurrentRipple_allowed(ty);}
};
// Attribute AddRipple class definition
class AddRippleAttrib: public Tango::Attr
{
public:
AddRippleAttrib():Attr("AddRipple",
Tango::DEV_BOOLEAN, Tango::READ_WRITE) {}
~AddRippleAttrib() {}
virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att)
{(static_cast<SimulatedE2PS *>(dev))->read_AddRipple(att);}
virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att)
{(static_cast<SimulatedE2PS *>(dev))->write_AddRipple(att);}
virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty)
{return (static_cast<SimulatedE2PS *>(dev))->is_AddRipple_allowed(ty);}
};
//========================================= //=========================================
// Define classes for commands // Define classes for commands
...@@ -111,13 +141,13 @@ public: ...@@ -111,13 +141,13 @@ public:
const char *in_desc, const char *in_desc,
const char *out_desc, const char *out_desc,
Tango::DispLevel level) Tango::DispLevel level)
:Command(cmd_name,in,out,in_desc,out_desc, level) {}; :Command(cmd_name,in,out,in_desc,out_desc, level) {}
OnClass(const char *cmd_name, OnClass(const char *cmd_name,
Tango::CmdArgType in, Tango::CmdArgType in,
Tango::CmdArgType out) Tango::CmdArgType out)
:Command(cmd_name,in,out) {}; :Command(cmd_name,in,out) {}
~OnClass() {}; ~OnClass() {}
virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any); virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any);
virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any) virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any)
...@@ -134,13 +164,13 @@ public: ...@@ -134,13 +164,13 @@ public:
const char *in_desc, const char *in_desc,
const char *out_desc, const char *out_desc,
Tango::DispLevel level) Tango::DispLevel level)
:Command(cmd_name,in,out,in_desc,out_desc, level) {}; :Command(cmd_name,in,out,in_desc,out_desc, level) {}
OffClass(const char *cmd_name, OffClass(const char *cmd_name,
Tango::CmdArgType in, Tango::CmdArgType in,
Tango::CmdArgType out) Tango::CmdArgType out)
:Command(cmd_name,in,out) {}; :Command(cmd_name,in,out) {}
~OffClass() {}; ~OffClass() {}
virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any); virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any);
virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any) virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any)
...@@ -157,13 +187,13 @@ public: ...@@ -157,13 +187,13 @@ public:
const char *in_desc, const char *in_desc,
const char *out_desc, const char *out_desc,
Tango::DispLevel level) Tango::DispLevel level)
:Command(cmd_name,in,out,in_desc,out_desc, level) {}; :Command(cmd_name,in,out,in_desc,out_desc, level) {}
ResetClass(const char *cmd_name, ResetClass(const char *cmd_name,
Tango::CmdArgType in, Tango::CmdArgType in,
Tango::CmdArgType out) Tango::CmdArgType out)
:Command(cmd_name,in,out) {}; :Command(cmd_name,in,out) {}
~ResetClass() {}; ~ResetClass() {}
virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any); virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any);
virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any) virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any)
...@@ -180,13 +210,13 @@ public: ...@@ -180,13 +210,13 @@ public:
const char *in_desc, const char *in_desc,
const char *out_desc, const char *out_desc,
Tango::DispLevel level) Tango::DispLevel level)
:Command(cmd_name,in,out,in_desc,out_desc, level) {}; :Command(cmd_name,in,out,in_desc,out_desc, level) {}
StartCyclingClass(const char *cmd_name, StartCyclingClass(const char *cmd_name,
Tango::CmdArgType in, Tango::CmdArgType in,
Tango::CmdArgType out) Tango::CmdArgType out)
:Command(cmd_name,in,out) {}; :Command(cmd_name,in,out) {}
~StartCyclingClass() {}; ~StartCyclingClass() {}
virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any); virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any);
virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any) virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any)
...@@ -203,13 +233,13 @@ public: ...@@ -203,13 +233,13 @@ public:
const char *in_desc, const char *in_desc,
const char *out_desc, const char *out_desc,
Tango::DispLevel level) Tango::DispLevel level)
:Command(cmd_name,in,out,in_desc,out_desc, level) {}; :Command(cmd_name,in,out,in_desc,out_desc, level) {}
AbortClass(const char *cmd_name, AbortClass(const char *cmd_name,
Tango::CmdArgType in, Tango::CmdArgType in,
Tango::CmdArgType out) Tango::CmdArgType out)
:Command(cmd_name,in,out) {}; :Command(cmd_name,in,out) {}
~AbortClass() {}; ~AbortClass() {}
virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any); virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any);
virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any) virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any)
...@@ -226,13 +256,13 @@ public: ...@@ -226,13 +256,13 @@ public:
const char *in_desc, const char *in_desc,
const char *out_desc, const char *out_desc,
Tango::DispLevel level) Tango::DispLevel level)
:Command(cmd_name,in,out,in_desc,out_desc, level) {}; :Command(cmd_name,in,out,in_desc,out_desc, level) {}
FaultClass(const char *cmd_name, FaultClass(const char *cmd_name,
Tango::CmdArgType in, Tango::CmdArgType in,
Tango::CmdArgType out) Tango::CmdArgType out)
:Command(cmd_name,in,out) {}; :Command(cmd_name,in,out) {}
~FaultClass() {}; ~FaultClass() {}
virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any); virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any);
virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any) virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any)
......
...@@ -54,8 +54,8 @@ namespace SimulatedE2PS_ns ...@@ -54,8 +54,8 @@ namespace SimulatedE2PS_ns
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PS::is_current_allowed() * Method : SimulatedE2PS::is_current_allowed()
* Description: Execution allowed for current attribute * Description: Execution allowed for current attribute
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
bool SimulatedE2PS::is_current_allowed(TANGO_UNUSED(Tango::AttReqType type)) bool SimulatedE2PS::is_current_allowed(TANGO_UNUSED(Tango::AttReqType type))
...@@ -100,8 +100,8 @@ bool SimulatedE2PS::is_current_allowed(TANGO_UNUSED(Tango::AttReqType type)) ...@@ -100,8 +100,8 @@ bool SimulatedE2PS::is_current_allowed(TANGO_UNUSED(Tango::AttReqType type))
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PS::is_voltage_allowed() * Method : SimulatedE2PS::is_voltage_allowed()
* Description: Execution allowed for voltage attribute * Description: Execution allowed for voltage attribute
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
bool SimulatedE2PS::is_voltage_allowed(TANGO_UNUSED(Tango::AttReqType type)) bool SimulatedE2PS::is_voltage_allowed(TANGO_UNUSED(Tango::AttReqType type))
...@@ -126,8 +126,8 @@ bool SimulatedE2PS::is_voltage_allowed(TANGO_UNUSED(Tango::AttReqType type)) ...@@ -126,8 +126,8 @@ bool SimulatedE2PS::is_voltage_allowed(TANGO_UNUSED(Tango::AttReqType type))
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PS::is_currentSet_allowed() * Method : SimulatedE2PS::is_currentSet_allowed()
* Description: Execution allowed for currentSet attribute * Description: Execution allowed for currentSet attribute
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
bool SimulatedE2PS::is_currentSet_allowed(TANGO_UNUSED(Tango::AttReqType type)) bool SimulatedE2PS::is_currentSet_allowed(TANGO_UNUSED(Tango::AttReqType type))
...@@ -150,6 +150,50 @@ bool SimulatedE2PS::is_currentSet_allowed(TANGO_UNUSED(Tango::AttReqType type)) ...@@ -150,6 +150,50 @@ bool SimulatedE2PS::is_currentSet_allowed(TANGO_UNUSED(Tango::AttReqType type))
return true; return true;
} }
//--------------------------------------------------------
/**
* Method : SimulatedE2PS::is_CurrentRipple_allowed()
* Description: Execution allowed for CurrentRipple attribute
*/
//--------------------------------------------------------
bool SimulatedE2PS::is_CurrentRipple_allowed(TANGO_UNUSED(Tango::AttReqType type))
{
// Not any excluded states for CurrentRipple attribute in Write access.
/*----- PROTECTED REGION ID(SimulatedE2PS::CurrentRippleStateAllowed_WRITE) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::CurrentRippleStateAllowed_WRITE
// Not any excluded states for CurrentRipple attribute in read access.
/*----- PROTECTED REGION ID(SimulatedE2PS::CurrentRippleStateAllowed_READ) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::CurrentRippleStateAllowed_READ
return true;
}
//--------------------------------------------------------
/**
* Method : SimulatedE2PS::is_AddRipple_allowed()
* Description: Execution allowed for AddRipple attribute
*/
//--------------------------------------------------------
bool SimulatedE2PS::is_AddRipple_allowed(TANGO_UNUSED(Tango::AttReqType type))
{
// Not any excluded states for AddRipple attribute in Write access.
/*----- PROTECTED REGION ID(SimulatedE2PS::AddRippleStateAllowed_WRITE) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::AddRippleStateAllowed_WRITE
// Not any excluded states for AddRipple attribute in read access.
/*----- PROTECTED REGION ID(SimulatedE2PS::AddRippleStateAllowed_READ) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::AddRippleStateAllowed_READ
return true;
}
//================================================= //=================================================
// Commands Allowed Methods // Commands Allowed Methods
...@@ -157,8 +201,8 @@ bool SimulatedE2PS::is_currentSet_allowed(TANGO_UNUSED(Tango::AttReqType type)) ...@@ -157,8 +201,8 @@ bool SimulatedE2PS::is_currentSet_allowed(TANGO_UNUSED(Tango::AttReqType type))
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PS::is_On_allowed() * Method : SimulatedE2PS::is_On_allowed()
* Description: Execution allowed for On attribute * Description: Execution allowed for On attribute
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
bool SimulatedE2PS::is_On_allowed(TANGO_UNUSED(const CORBA::Any &any)) bool SimulatedE2PS::is_On_allowed(TANGO_UNUSED(const CORBA::Any &any))
...@@ -178,8 +222,8 @@ bool SimulatedE2PS::is_On_allowed(TANGO_UNUSED(const CORBA::Any &any)) ...@@ -178,8 +222,8 @@ bool SimulatedE2PS::is_On_allowed(TANGO_UNUSED(const CORBA::Any &any))
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PS::is_Off_allowed() * Method : SimulatedE2PS::is_Off_allowed()
* Description: Execution allowed for Off attribute * Description: Execution allowed for Off attribute
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
bool SimulatedE2PS::is_Off_allowed(TANGO_UNUSED(const CORBA::Any &any)) bool SimulatedE2PS::is_Off_allowed(TANGO_UNUSED(const CORBA::Any &any))
...@@ -199,8 +243,8 @@ bool SimulatedE2PS::is_Off_allowed(TANGO_UNUSED(const CORBA::Any &any)) ...@@ -199,8 +243,8 @@ bool SimulatedE2PS::is_Off_allowed(TANGO_UNUSED(const CORBA::Any &any))
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PS::is_Reset_allowed() * Method : SimulatedE2PS::is_Reset_allowed()
* Description: Execution allowed for Reset attribute * Description: Execution allowed for Reset attribute
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
bool SimulatedE2PS::is_Reset_allowed(TANGO_UNUSED(const CORBA::Any &any)) bool SimulatedE2PS::is_Reset_allowed(TANGO_UNUSED(const CORBA::Any &any))
...@@ -219,8 +263,8 @@ bool SimulatedE2PS::is_Reset_allowed(TANGO_UNUSED(const CORBA::Any &any)) ...@@ -219,8 +263,8 @@ bool SimulatedE2PS::is_Reset_allowed(TANGO_UNUSED(const CORBA::Any &any))
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PS::is_StartCycling_allowed() * Method : SimulatedE2PS::is_StartCycling_allowed()
* Description: Execution allowed for StartCycling attribute * Description: Execution allowed for StartCycling attribute
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
bool SimulatedE2PS::is_StartCycling_allowed(TANGO_UNUSED(const CORBA::Any &any)) bool SimulatedE2PS::is_StartCycling_allowed(TANGO_UNUSED(const CORBA::Any &any))
...@@ -240,8 +284,8 @@ bool SimulatedE2PS::is_StartCycling_allowed(TANGO_UNUSED(const CORBA::Any &any)) ...@@ -240,8 +284,8 @@ bool SimulatedE2PS::is_StartCycling_allowed(TANGO_UNUSED(const CORBA::Any &any))
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PS::is_Abort_allowed() * Method : SimulatedE2PS::is_Abort_allowed()
* Description: Execution allowed for Abort attribute * Description: Execution allowed for Abort attribute
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
bool SimulatedE2PS::is_Abort_allowed(TANGO_UNUSED(const CORBA::Any &any)) bool SimulatedE2PS::is_Abort_allowed(TANGO_UNUSED(const CORBA::Any &any))
...@@ -261,8 +305,8 @@ bool SimulatedE2PS::is_Abort_allowed(TANGO_UNUSED(const CORBA::Any &any)) ...@@ -261,8 +305,8 @@ bool SimulatedE2PS::is_Abort_allowed(TANGO_UNUSED(const CORBA::Any &any))
//-------------------------------------------------------- //--------------------------------------------------------
/** /**
* Method : SimulatedE2PS::is_Fault_allowed() * Method : SimulatedE2PS::is_Fault_allowed()
* Description: Execution allowed for Fault attribute * Description: Execution allowed for Fault attribute
*/ */
//-------------------------------------------------------- //--------------------------------------------------------
bool SimulatedE2PS::is_Fault_allowed(TANGO_UNUSED(const CORBA::Any &any)) bool SimulatedE2PS::is_Fault_allowed(TANGO_UNUSED(const CORBA::Any &any))
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment