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

Merge branch 'development' into 'main'

start in OFF state

See merge request !1
parents ae1aa7cf 193b94f7
No related branches found
No related tags found
1 merge request!1start in OFF state
.nse_depinfo*
bin
obj
# Eclipse
.cproject
.project
.settings
NAME_SRV = simulatede2ps-srv
include ../makefiles/Make-9.3.6.in
#
# Resource backup , created Wed Oct 16 17:04:36 CEST 2024
#
#---------------------------------------------------------
# SERVER simulatede2ps-srv/test, SimulatedE2PS device declaration
#---------------------------------------------------------
simulatede2ps-srv/test/DEVICE/SimulatedE2PS: "test/power_supply/psceh16",\
"test/power_supply/psceh20",\
"test/power_supply/pscev16",\
"test/power_supply/pscev20",\
"test/power_supply/psq13",\
"test/power_supply/psq24",\
"test/power_supply/pss16",\
"test/power_supply/pss20"
# --- test/power_supply/psceh16 properties
test/power_supply/psceh16->polled_attr: current,\
500,\
currentset,\
500,\
state,\
3000
# --- test/power_supply/psceh16 attribute properties
test/power_supply/psceh16/current->abs_change: -1e-05,\
1e-05
test/power_supply/psceh16/current->max_value: 25.0
test/power_supply/psceh16/current->min_value: -25.0
test/power_supply/psceh16/currentSet->abs_change: -1e-05,\
1e-05
test/power_supply/psceh16/currentSet->max_value: 25.0
test/power_supply/psceh16/currentSet->min_value: -25.0
# --- test/power_supply/psceh20 properties
test/power_supply/psceh20->polled_attr: current,\
500,\
currentset,\
500,\
state,\
3000
# --- test/power_supply/psceh20 attribute properties
test/power_supply/psceh20/current->abs_change: -1e-05,\
1e-05
test/power_supply/psceh20/current->max_value: 25.0
test/power_supply/psceh20/current->min_value: -25.0
test/power_supply/psceh20/currentSet->abs_change: -1e-05,\
1e-05
test/power_supply/psceh20/currentSet->max_value: 25.0
test/power_supply/psceh20/currentSet->min_value: -25.0
# --- test/power_supply/pscev16 properties
test/power_supply/pscev16->polled_attr: current,\
500,\
currentset,\
500,\
state,\
3000
# --- test/power_supply/pscev16 attribute properties
test/power_supply/pscev16/current->abs_change: -1e-05,\
1e-05
test/power_supply/pscev16/current->max_value: 25.0
test/power_supply/pscev16/current->min_value: -25.0
test/power_supply/pscev16/currentSet->abs_change: -1e-05,\
1e-05
test/power_supply/pscev16/currentSet->max_value: 25.0
test/power_supply/pscev16/currentSet->min_value: -25.0
# --- test/power_supply/pscev20 properties
test/power_supply/pscev20->polled_attr: current,\
500,\
currentset,\
500,\
state,\
3000
# --- test/power_supply/pscev20 attribute properties
test/power_supply/pscev20/current->abs_change: -1e-05,\
1e-05
test/power_supply/pscev20/current->max_value: 25.0
test/power_supply/pscev20/current->min_value: -25.0
test/power_supply/pscev20/currentSet->abs_change: -1e-05,\
1e-05
test/power_supply/pscev20/currentSet->max_value: 25.0
test/power_supply/pscev20/currentSet->min_value: -25.0
# --- test/power_supply/psq13 properties
test/power_supply/psq13->polled_attr: current,\
500,\
currentset,\
500,\
state,\
3000
# --- test/power_supply/psq13 attribute properties
test/power_supply/psq13/current->abs_change: -1e-05,\
1e-05
test/power_supply/psq13/current->max_value: 100.0
test/power_supply/psq13/current->min_value: -100.0
test/power_supply/psq13/currentSet->abs_change: -1e-05,\
1e-05
test/power_supply/psq13/currentSet->max_value: 25.0
test/power_supply/psq13/currentSet->min_value: -25.0
# --- test/power_supply/psq24 properties
test/power_supply/psq24->polled_attr: current,\
500,\
currentset,\
500,\
state,\
3000
# --- test/power_supply/psq24 attribute properties
test/power_supply/psq24/current->abs_change: -1e-05,\
1e-05
test/power_supply/psq24/current->max_value: 100.0
test/power_supply/psq24/current->min_value: -100.0
test/power_supply/psq24/currentSet->abs_change: -1e-05,\
1e-05
test/power_supply/psq24/currentSet->max_value: 25.0
test/power_supply/psq24/currentSet->min_value: -25.0
# --- test/power_supply/pss16 properties
test/power_supply/pss16->polled_attr: current,\
500,\
currentset,\
500,\
state,\
3000
# --- test/power_supply/pss16 attribute properties
test/power_supply/pss16/current->abs_change: -1e-05,\
1e-05
test/power_supply/pss16/current->max_value: 100.0
test/power_supply/pss16/current->min_value: -100.0
test/power_supply/pss16/currentSet->abs_change: -1e-05,\
1e-05
test/power_supply/pss16/currentSet->max_value: 25.0
test/power_supply/pss16/currentSet->min_value: -25.0
# --- test/power_supply/pss20 properties
test/power_supply/pss20->polled_attr: current,\
500,\
currentset,\
500,\
state,\
3000
# --- test/power_supply/pss20 attribute properties
test/power_supply/pss20/current->abs_change: -1e-05,\
1e-05
test/power_supply/pss20/current->max_value: 100.0
test/power_supply/pss20/current->min_value: -100.0
test/power_supply/pss20/currentSet->abs_change: -1e-05,\
1e-05
test/power_supply/pss20/currentSet->max_value: 25.0
test/power_supply/pss20/currentSet->min_value: -25.0
#---------------------------------------------------------
# CLASS SimulatedE2PS properties
#---------------------------------------------------------
CLASS/SimulatedE2PS->Description: "Simulated power supply for Elettra 2.0 tests (digiltal twin).",\
"Tango interface Loosely based on NGPS tango device"
CLASS/SimulatedE2PS->InheritedFrom: TANGO_BASE_CLASS
CLASS/SimulatedE2PS->ProjectTitle: SimulatedE2PS
# CLASS SimulatedE2PS attribute properties
# --- dserver/simulatede2ps-srv/test properties
dserver/simulatede2ps-srv/test->polling_threads_pool_conf: "test/power_supply/psq13,test/power_supply/psq24,test/power_supply/pss16,test/power_supply/pss20,test/power_supply/psceh16,test/power_supply/psceh20,test/power_supply/pscev16,test/power_supply/pscev20"
/*----- PROTECTED REGION ID(SimulatedE2PS::ClassFactory.cpp) ENABLED START -----*/
/* clang-format on */
//=============================================================================
//
// 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 : SimulatedE2PS
//
// This file is part of Tango device class.
//
// Tango is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Tango is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Tango. If not, see <http://www.gnu.org/licenses/>.
//
//
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#include <tango/tango.h>
#include "SimulatedE2PSClass.h"
// Add class header files if needed
/**
* Create SimulatedE2PS Class singleton and store it in DServer object.
*/
void Tango::DServer::class_factory()
{
// Add method class init if needed
add_class(SimulatedE2PS_ns::SimulatedE2PSClass::init("SimulatedE2PS"));
}
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::ClassFactory.cpp
This diff is collapsed.
/*----- PROTECTED REGION ID(SimulatedE2PS.h) ENABLED START -----*/
/* clang-format on */
//=============================================================================
//
// file : SimulatedE2PS.h
//
// description : Include file for the SimulatedE2PS class
//
// project : SimulatedE2PS
//
// This file is part of Tango device class.
//
// Tango is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Tango is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Tango. If not, see <http://www.gnu.org/licenses/>.
//
//
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#ifndef SimulatedE2PS_H
#define SimulatedE2PS_H
#include <tango/tango.h>
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS.h
#ifdef TANGO_LOG
// cppTango after c934adea (Merge branch 'remove-cout-definition' into 'main', 2022-05-23)
// nothing to do
#else
// cppTango 9.3-backports and older
#define TANGO_LOG cout
#define TANGO_LOG_INFO cout2
#define TANGO_LOG_DEBUG cout3
#endif // TANGO_LOG
/**
* SimulatedE2PS class description:
* Simulated power supply for Elettra 2.0 tests (digiltal twin).
* Tango interface Loosely based on NGPS tango device
*/
namespace SimulatedE2PS_ns
{
/*----- PROTECTED REGION ID(SimulatedE2PS::Additional Class Declarations) ENABLED START -----*/
/* clang-format on */
// Additional Class Declarations
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::Additional Class Declarations
class SimulatedE2PS : public TANGO_BASE_CLASS
{
/*----- PROTECTED REGION ID(SimulatedE2PS::Data Members) ENABLED START -----*/
/* clang-format on */
// Add your own data members
friend class cyclethread;
protected :
double _current;
double _current_read;
double _current_ripple;
double _voltage;
double _ohm;
bool _busy;
bool _add_ripple;
unsigned int rand_r_seed;
class cyclethread *cycleloop;
bool thread_running;
bool abortflag;
//void psdelay();
Tango::WAttribute *attr_current;
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::Data Members
// Device property data members
public:
// CurrentRipple: Residual current oscillation [A]
//
// The simulator adds noise of CurrenRipple amplitude to the reading
Tango::DevDouble currentRipple;
// Attribute data members
public:
Tango::DevDouble *attr_current_read;
Tango::DevDouble *attr_voltage_read;
Tango::DevDouble *attr_currentSet_read;
Tango::DevDouble *attr_CurrentRipple_read;
Tango::DevBoolean *attr_AddRipple_read;
// Constructors and destructors
public:
/**
* Constructs a newly device object.
*
* @param cl Class.
* @param s Device Name
*/
SimulatedE2PS(Tango::DeviceClass *cl,std::string &s);
/**
* Constructs a newly device object.
*
* @param cl Class.
* @param s Device Name
*/
SimulatedE2PS(Tango::DeviceClass *cl,const char *s);
/**
* Constructs a newly device object.
*
* @param cl Class.
* @param s Device name
* @param d Device description.
*/
SimulatedE2PS(Tango::DeviceClass *cl,const char *s,const char *d);
/**
* The device object destructor.
*/
~SimulatedE2PS();
// Miscellaneous methods
public:
/*
* will be called at device destruction or at init command.
*/
void delete_device();
/*
* Initialize the device
*/
virtual void init_device();
/*
* Read the device properties from database
*/
void get_device_property();
/*
* Always executed method before execution command method.
*/
virtual void always_executed_hook();
// Attribute methods
public:
//--------------------------------------------------------
/*
* Method : SimulatedE2PS::read_attr_hardware()
* Description: Hardware acquisition for attributes.
*/
//--------------------------------------------------------
virtual void read_attr_hardware(std::vector<long> &attr_list);
//--------------------------------------------------------
/*
* Method : SimulatedE2PS::write_attr_hardware()
* Description: Hardware writing for attributes.
*/
//--------------------------------------------------------
virtual void write_attr_hardware(std::vector<long> &attr_list);
/**
* Attribute current related methods
* Description: The powersupply current setting in amps
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
virtual void read_current(Tango::Attribute &attr);
virtual void write_current(Tango::WAttribute &attr);
virtual bool is_current_allowed(Tango::AttReqType type);
/**
* Attribute voltage related methods
* Description: The powersupply voltage in volts.
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
virtual void read_voltage(Tango::Attribute &attr);
virtual bool is_voltage_allowed(Tango::AttReqType type);
/**
* Attribute currentSet related methods
* Description: The current set value as stored in the powersupply.
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
virtual void read_currentSet(Tango::Attribute &attr);
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()
* Description: Add dynamic attributes if any.
*/
//--------------------------------------------------------
void add_dynamic_attributes();
// Command related methods
public:
/**
* Command On related method
* Description: Switch powersupply ON.
*
*/
virtual void on();
virtual bool is_On_allowed(const CORBA::Any &any);
/**
* Command Off related method
* Description: Switch power supply OFF.
*
*/
virtual void off();
virtual bool is_Off_allowed(const CORBA::Any &any);
/**
* Command Reset related method
* Description: Reset the powersupply to a well known state.
*
*/
virtual void reset();
virtual bool is_Reset_allowed(const CORBA::Any &any);
/**
* Command StartCycling related method
*
*
*/
virtual void start_cycling();
virtual bool is_StartCycling_allowed(const CORBA::Any &any);
/**
* Command Abort related method
* Description: stop ramp or cycling
*
*/
virtual void abort();
virtual bool is_Abort_allowed(const CORBA::Any &any);
/**
* Command Fault related method
* Description: Force a simulated faulty condtion
*
*/
virtual void fault();
virtual bool is_Fault_allowed(const CORBA::Any &any);
//--------------------------------------------------------
/**
* Method : SimulatedE2PS::add_dynamic_commands()
* Description: Add dynamic commands if any.
*/
//--------------------------------------------------------
void add_dynamic_commands();
/*----- PROTECTED REGION ID(SimulatedE2PS::Additional Method prototypes) ENABLED START -----*/
/* clang-format on */
// Additional Method prototypes
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::Additional Method prototypes
};
/*----- PROTECTED REGION ID(SimulatedE2PS::Additional Classes Definitions) ENABLED START -----*/
/* clang-format on */
// Additional Classes Definitions
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::Additional Classes Definitions
} // End of namespace
#endif // SimulatedE2PS_H
<?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://tango.org/pogo/PogoDsl">
<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="/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=""/>
<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>simulator</keyWords>
<keyWords>Elettra 2.0</keyWords>
<keyWords>Digital twin</keyWords>
</identification>
</description>
<deviceProperties name="CurrentRipple" description="Residual current oscillation [A]&#xA;&#xA;The simulator adds noise of CurrenRipple amplitude to the reading">
<type xsi:type="pogoDsl:DoubleType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<DefaultPropValue>0.0025</DefaultPropValue>
</deviceProperties>
<commands name="State" description="This command gets the device state (stored in its device_state data member) and returns it to the caller." execMethod="dev_state" displayLevel="OPERATOR" polledPeriod="0">
<argin description="none">
<type xsi:type="pogoDsl:VoidType"/>
</argin>
<argout description="Device state">
<type xsi:type="pogoDsl:StateType"/>
</argout>
<status abstract="true" inherited="true" concrete="true"/>
</commands>
<commands name="Status" description="This command gets the device status (stored in its device_status data member) and returns it to the caller." execMethod="dev_status" displayLevel="OPERATOR" polledPeriod="0">
<argin description="none">
<type xsi:type="pogoDsl:VoidType"/>
</argin>
<argout description="Device status">
<type xsi:type="pogoDsl:ConstStringType"/>
</argout>
<status abstract="true" inherited="true" concrete="true"/>
</commands>
<commands name="On" description="Switch powersupply ON." execMethod="on" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false">
<argin description="">
<type xsi:type="pogoDsl:VoidType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<excludedStates>UNKNOWN</excludedStates>
<excludedStates>FAULT</excludedStates>
</commands>
<commands name="Off" description="Switch power supply OFF." execMethod="off" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false">
<argin description="">
<type xsi:type="pogoDsl:VoidType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<excludedStates>UNKNOWN</excludedStates>
<excludedStates>FAULT</excludedStates>
</commands>
<commands name="Reset" description="Reset the powersupply to a well known state." execMethod="reset" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false">
<argin description="">
<type xsi:type="pogoDsl:VoidType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<excludedStates>UNKNOWN</excludedStates>
</commands>
<commands name="StartCycling" description="" execMethod="start_cycling" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false">
<argin description="">
<type xsi:type="pogoDsl:VoidType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<excludedStates>UNKNOWN</excludedStates>
<excludedStates>FAULT</excludedStates>
</commands>
<commands name="Abort" description="stop ramp or cycling" execMethod="abort" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false">
<argin description="">
<type xsi:type="pogoDsl:VoidType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<excludedStates>UNKNOWN</excludedStates>
<excludedStates>FAULT</excludedStates>
</commands>
<commands name="Fault" description="Force a simulated faulty condtion" execMethod="fault" displayLevel="EXPERT" polledPeriod="0" isDynamic="false">
<argin description="">
<type xsi:type="pogoDsl:VoidType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</commands>
<attributes name="current" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" 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="The powersupply current setting in amps" label="current" unit="A" standardUnit="1" displayUnit="A" format="%6.4f" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
<readExcludedStates>UNKNOWN</readExcludedStates>
<readExcludedStates>FAULT</readExcludedStates>
<writeExcludedStates>UNKNOWN</writeExcludedStates>
<writeExcludedStates>FAULT</writeExcludedStates>
<writeExcludedStates>RUNNING</writeExcludedStates>
<writeExcludedStates>MOVING</writeExcludedStates>
<writeExcludedStates>OFF</writeExcludedStates>
</attributes>
<attributes name="voltage" attType="Scalar" rwType="READ" displayLevel="OPERATOR" 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="The powersupply voltage in volts." label="" unit="V" standardUnit="1" displayUnit="V" format="%6.4f" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
<readExcludedStates>UNKNOWN</readExcludedStates>
</attributes>
<attributes name="currentSet" attType="Scalar" rwType="READ" displayLevel="OPERATOR" 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="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>
</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">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states>
<states name="ON" description="power supply on">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states>
<states name="FAULT" description="power supply in fault - not sourcing cuurent">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states>
<states name="RUNNING" description="magnet cycling running">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states>
<states name="MOVING" description="output current changing">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states>
<states name="OFF" description="power supply off , not sourcing current">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states>
<preferences docHome="./doc_html" makefileHome="$(TANGO_HOME)"/>
</classes>
</pogoDsl:PogoSystem>
This diff is collapsed.
/*----- PROTECTED REGION ID(SimulatedE2PSClass.h) ENABLED START -----*/
/* clang-format on */
//=============================================================================
//
// file : SimulatedE2PSClass.h
//
// description : Include for the SimulatedE2PS root class.
// This class is the singleton class for
// the SimulatedE2PS device class.
// It contains all properties and methods which the
// SimulatedE2PS requires only once e.g. the commands.
//
// project : SimulatedE2PS
//
// This file is part of Tango device class.
//
// Tango is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Tango is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Tango. If not, see <http://www.gnu.org/licenses/>.
//
//
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#ifndef SimulatedE2PSClass_H
#define SimulatedE2PSClass_H
#include <tango/tango.h>
#include "SimulatedE2PS.h"
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PSClass.h
namespace SimulatedE2PS_ns
{
/*----- PROTECTED REGION ID(SimulatedE2PSClass::classes for dynamic creation) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PSClass::classes for dynamic creation
//=========================================
// Define classes for attributes
//=========================================
// Attribute current class definition
class currentAttrib: public Tango::Attr
{
public:
currentAttrib():Attr("current",
Tango::DEV_DOUBLE, Tango::READ_WRITE) {}
~currentAttrib() {}
virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att)
{(static_cast<SimulatedE2PS *>(dev))->read_current(att);}
virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att)
{(static_cast<SimulatedE2PS *>(dev))->write_current(att);}
virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty)
{return (static_cast<SimulatedE2PS *>(dev))->is_current_allowed(ty);}
};
// Attribute voltage class definition
class voltageAttrib: public Tango::Attr
{
public:
voltageAttrib():Attr("voltage",
Tango::DEV_DOUBLE, Tango::READ) {}
~voltageAttrib() {}
virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att)
{(static_cast<SimulatedE2PS *>(dev))->read_voltage(att);}
virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty)
{return (static_cast<SimulatedE2PS *>(dev))->is_voltage_allowed(ty);}
};
// Attribute currentSet class definition
class currentSetAttrib: public Tango::Attr
{
public:
currentSetAttrib():Attr("currentSet",
Tango::DEV_DOUBLE, Tango::READ) {}
~currentSetAttrib() {}
virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att)
{(static_cast<SimulatedE2PS *>(dev))->read_currentSet(att);}
virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType 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
//=========================================
// Command On class definition
class OnClass : public Tango::Command
{
public:
OnClass(const char *cmd_name,
Tango::CmdArgType in,
Tango::CmdArgType out,
const char *in_desc,
const char *out_desc,
Tango::DispLevel level)
:Command(cmd_name,in,out,in_desc,out_desc, level) {}
OnClass(const char *cmd_name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(cmd_name,in,out) {}
~OnClass() {}
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<SimulatedE2PS *>(dev))->is_On_allowed(any);}
};
// Command Off class definition
class OffClass : public Tango::Command
{
public:
OffClass(const char *cmd_name,
Tango::CmdArgType in,
Tango::CmdArgType out,
const char *in_desc,
const char *out_desc,
Tango::DispLevel level)
:Command(cmd_name,in,out,in_desc,out_desc, level) {}
OffClass(const char *cmd_name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(cmd_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<SimulatedE2PS *>(dev))->is_Off_allowed(any);}
};
// Command Reset class definition
class ResetClass : public Tango::Command
{
public:
ResetClass(const char *cmd_name,
Tango::CmdArgType in,
Tango::CmdArgType out,
const char *in_desc,
const char *out_desc,
Tango::DispLevel level)
:Command(cmd_name,in,out,in_desc,out_desc, level) {}
ResetClass(const char *cmd_name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(cmd_name,in,out) {}
~ResetClass() {}
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<SimulatedE2PS *>(dev))->is_Reset_allowed(any);}
};
// Command StartCycling class definition
class StartCyclingClass : public Tango::Command
{
public:
StartCyclingClass(const char *cmd_name,
Tango::CmdArgType in,
Tango::CmdArgType out,
const char *in_desc,
const char *out_desc,
Tango::DispLevel level)
:Command(cmd_name,in,out,in_desc,out_desc, level) {}
StartCyclingClass(const char *cmd_name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(cmd_name,in,out) {}
~StartCyclingClass() {}
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<SimulatedE2PS *>(dev))->is_StartCycling_allowed(any);}
};
// Command Abort class definition
class AbortClass : public Tango::Command
{
public:
AbortClass(const char *cmd_name,
Tango::CmdArgType in,
Tango::CmdArgType out,
const char *in_desc,
const char *out_desc,
Tango::DispLevel level)
:Command(cmd_name,in,out,in_desc,out_desc, level) {}
AbortClass(const char *cmd_name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(cmd_name,in,out) {}
~AbortClass() {}
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<SimulatedE2PS *>(dev))->is_Abort_allowed(any);}
};
// Command Fault class definition
class FaultClass : public Tango::Command
{
public:
FaultClass(const char *cmd_name,
Tango::CmdArgType in,
Tango::CmdArgType out,
const char *in_desc,
const char *out_desc,
Tango::DispLevel level)
:Command(cmd_name,in,out,in_desc,out_desc, level) {}
FaultClass(const char *cmd_name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(cmd_name,in,out) {}
~FaultClass() {}
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<SimulatedE2PS *>(dev))->is_Fault_allowed(any);}
};
/**
* The SimulatedE2PSClass singleton definition
*/
#ifdef _TG_WINDOWS_
class __declspec(dllexport) SimulatedE2PSClass : public Tango::DeviceClass
#else
class SimulatedE2PSClass : public Tango::DeviceClass
#endif
{
/*----- PROTECTED REGION ID(SimulatedE2PSClass::Additional DServer data members) ENABLED START -----*/
/* clang-format on */
// Add your own code
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PSClass::Additional DServer data members
public:
// write class properties data members
Tango::DbData cl_prop;
Tango::DbData cl_def_prop;
Tango::DbData dev_def_prop;
// Method prototypes
static SimulatedE2PSClass *init(const char *);
static SimulatedE2PSClass *instance();
~SimulatedE2PSClass();
Tango::DbDatum get_class_property(std::string &);
Tango::DbDatum get_default_device_property(std::string &);
Tango::DbDatum get_default_class_property(std::string &);
protected:
SimulatedE2PSClass(std::string &);
static SimulatedE2PSClass *_instance;
void command_factory();
void attribute_factory(std::vector<Tango::Attr *> &);
void pipe_factory();
void write_class_property();
void set_default_property();
void get_class_property();
std::string get_cvstag();
std::string get_cvsroot();
private:
void device_factory(TANGO_UNUSED(const Tango::DevVarStringArray *));
void create_static_attribute_list(std::vector<Tango::Attr *> &);
void erase_dynamic_attributes(const Tango::DevVarStringArray *,std::vector<Tango::Attr *> &);
std::vector<std::string> defaultAttList;
Tango::Attr *get_attr_object_by_name(std::vector<Tango::Attr *> &att_list, std::string attname);
};
} // End of namespace
#endif // SimulatedE2PS_H
/*----- PROTECTED REGION ID(SimulatedE2PSStateMachine.cpp) ENABLED START -----*/
/* clang-format on */
//=============================================================================
//
// file : SimulatedE2PSStateMachine.cpp
//
// description : State machine file for the SimulatedE2PS class
//
// project : SimulatedE2PS
//
// This file is part of Tango device class.
//
// Tango is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Tango is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Tango. If not, see <http://www.gnu.org/licenses/>.
//
//
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#include "SimulatedE2PS.h"
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::SimulatedE2PSStateMachine.cpp
//================================================================
// States | Description
//================================================================
// UNKNOWN | initialization failed or incomlete
// ON | power supply on
// FAULT | power supply in fault - not sourcing cuurent
// RUNNING | magnet cycling running
// MOVING | output current changing
// OFF | power supply off , not sourcing current
namespace SimulatedE2PS_ns
{
//=================================================
// Attributes Allowed Methods
//=================================================
//--------------------------------------------------------
/**
* Method : SimulatedE2PS::is_current_allowed()
* Description: Execution allowed for current attribute
*/
//--------------------------------------------------------
bool SimulatedE2PS::is_current_allowed(TANGO_UNUSED(Tango::AttReqType type))
{
// Check access type.
if ( type!=Tango::READ_REQ )
{
// Compare device state with not allowed states for WRITE
if (get_state()==Tango::UNKNOWN ||
get_state()==Tango::FAULT ||
get_state()==Tango::RUNNING ||
get_state()==Tango::MOVING ||
get_state()==Tango::OFF)
{
/*----- PROTECTED REGION ID(SimulatedE2PS::currentStateAllowed_WRITE) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::currentStateAllowed_WRITE
return false;
}
return true;
}
else
// Check access type.
if ( type==Tango::READ_REQ )
{
// Compare device state with not allowed states for READ
if (get_state()==Tango::UNKNOWN ||
get_state()==Tango::FAULT)
{
/*----- PROTECTED REGION ID(SimulatedE2PS::currentStateAllowed_READ) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::currentStateAllowed_READ
return false;
}
return true;
}
return true;
}
//--------------------------------------------------------
/**
* Method : SimulatedE2PS::is_voltage_allowed()
* Description: Execution allowed for voltage attribute
*/
//--------------------------------------------------------
bool SimulatedE2PS::is_voltage_allowed(TANGO_UNUSED(Tango::AttReqType type))
{
// Check access type.
if ( type==Tango::READ_REQ )
{
// Compare device state with not allowed states for READ
if (get_state()==Tango::UNKNOWN)
{
/*----- PROTECTED REGION ID(SimulatedE2PS::voltageStateAllowed_READ) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::voltageStateAllowed_READ
return false;
}
return true;
}
return true;
}
//--------------------------------------------------------
/**
* Method : SimulatedE2PS::is_currentSet_allowed()
* Description: Execution allowed for currentSet attribute
*/
//--------------------------------------------------------
bool SimulatedE2PS::is_currentSet_allowed(TANGO_UNUSED(Tango::AttReqType type))
{
// Check access type.
if ( type==Tango::READ_REQ )
{
// Compare device state with not allowed states for READ
if (get_state()==Tango::UNKNOWN)
{
/*----- PROTECTED REGION ID(SimulatedE2PS::currentSetStateAllowed_READ) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::currentSetStateAllowed_READ
return false;
}
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
//=================================================
//--------------------------------------------------------
/**
* Method : SimulatedE2PS::is_On_allowed()
* Description: Execution allowed for On attribute
*/
//--------------------------------------------------------
bool SimulatedE2PS::is_On_allowed(TANGO_UNUSED(const CORBA::Any &any))
{
// Compare device state with not allowed states.
if (get_state()==Tango::UNKNOWN ||
get_state()==Tango::FAULT)
{
/*----- PROTECTED REGION ID(SimulatedE2PS::OnStateAllowed) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::OnStateAllowed
return false;
}
return true;
}
//--------------------------------------------------------
/**
* Method : SimulatedE2PS::is_Off_allowed()
* Description: Execution allowed for Off attribute
*/
//--------------------------------------------------------
bool SimulatedE2PS::is_Off_allowed(TANGO_UNUSED(const CORBA::Any &any))
{
// Compare device state with not allowed states.
if (get_state()==Tango::UNKNOWN ||
get_state()==Tango::FAULT)
{
/*----- PROTECTED REGION ID(SimulatedE2PS::OffStateAllowed) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::OffStateAllowed
return false;
}
return true;
}
//--------------------------------------------------------
/**
* Method : SimulatedE2PS::is_Reset_allowed()
* Description: Execution allowed for Reset attribute
*/
//--------------------------------------------------------
bool SimulatedE2PS::is_Reset_allowed(TANGO_UNUSED(const CORBA::Any &any))
{
// Compare device state with not allowed states.
if (get_state()==Tango::UNKNOWN)
{
/*----- PROTECTED REGION ID(SimulatedE2PS::ResetStateAllowed) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::ResetStateAllowed
return false;
}
return true;
}
//--------------------------------------------------------
/**
* Method : SimulatedE2PS::is_StartCycling_allowed()
* Description: Execution allowed for StartCycling attribute
*/
//--------------------------------------------------------
bool SimulatedE2PS::is_StartCycling_allowed(TANGO_UNUSED(const CORBA::Any &any))
{
// Compare device state with not allowed states.
if (get_state()==Tango::UNKNOWN ||
get_state()==Tango::FAULT)
{
/*----- PROTECTED REGION ID(SimulatedE2PS::StartCyclingStateAllowed) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::StartCyclingStateAllowed
return false;
}
return true;
}
//--------------------------------------------------------
/**
* Method : SimulatedE2PS::is_Abort_allowed()
* Description: Execution allowed for Abort attribute
*/
//--------------------------------------------------------
bool SimulatedE2PS::is_Abort_allowed(TANGO_UNUSED(const CORBA::Any &any))
{
// Compare device state with not allowed states.
if (get_state()==Tango::UNKNOWN ||
get_state()==Tango::FAULT)
{
/*----- PROTECTED REGION ID(SimulatedE2PS::AbortStateAllowed) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::AbortStateAllowed
return false;
}
return true;
}
//--------------------------------------------------------
/**
* Method : SimulatedE2PS::is_Fault_allowed()
* Description: Execution allowed for Fault attribute
*/
//--------------------------------------------------------
bool SimulatedE2PS::is_Fault_allowed(TANGO_UNUSED(const CORBA::Any &any))
{
// Not any excluded states for Fault command.
/*----- PROTECTED REGION ID(SimulatedE2PS::FaultStateAllowed) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::FaultStateAllowed
return true;
}
/*----- PROTECTED REGION ID(SimulatedE2PS::SimulatedE2PSStateAllowed.AdditionalMethods) ENABLED START -----*/
/* clang-format on */
// Additional Methods
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::SimulatedE2PSStateAllowed.AdditionalMethods
} // End of namespace
/*----- PROTECTED REGION ID(SimulatedE2PS::main.cpp) ENABLED START -----*/
/* clang-format on */
//=============================================================================
//
// file : main.cpp
//
// description : C++ source for the SimulatedE2PS 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 : SimulatedE2PS
//
// This file is part of Tango device class.
//
// Tango is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Tango is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Tango. If not, see <http://www.gnu.org/licenses/>.
//
//
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#include <tango/tango.h>
// Check if crash reporting is used.
#if defined(ENABLE_CRASH_REPORT)
# include <crashreporting/crash_report.h>
#else
# define DECLARE_CRASH_HANDLER
# define INSTALL_CRASH_HANDLER
#endif
DECLARE_CRASH_HANDLER
int main(int argc,char *argv[])
{
INSTALL_CRASH_HANDLER
Tango::Util *tg = nullptr;
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
//----------------------------------------
std::cout << "Ready to accept request" << std::endl;
tg->server_run();
}
catch (std::bad_alloc &)
{
std::cout << "Can't allocate memory to store device object !!!" << std::endl;
std::cout << "Exiting" << std::endl;
}
catch (CORBA::Exception &e)
{
Tango::Except::print_exception(e);
std::cout << "Received a CORBA_Exception" << std::endl;
std::cout << "Exiting" << std::endl;
}
if(tg)
{
tg->server_cleanup();
}
return(0);
}
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // SimulatedE2PS::main.cpp
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