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

Development

parent de81422f
No related branches found
No related tags found
1 merge request!1Development
.nse_depinfo*
bin
obj
# Eclipse
.cproject
.project
.settings
*.launch
NAME_SRV = e2sextupole-srv
CXXFLAGS += -I /usr/include/eigen3 -I /runtime/include
LDFLAGS += -L /runtime/lib -lMagnetModel
include ../makefiles/Make-9.3.6.in
# E2Sextupole
Elettra 2.0 sextupole magnet device
## Getting started
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
## Add your files
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
```
cd existing_repo
git remote add origin https://gitlab.elettra.eu/dt/ds/e2sextupole.git
git branch -M main
git push -uf origin main
```
## Integrate with your tools
- [ ] [Set up project integrations](https://gitlab.elettra.eu/dt/ds/e2sextupole/-/settings/integrations)
## Collaborate with your team
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
## Test and Deploy
Use the built-in continuous integration in GitLab.
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
***
# Editing this README
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
## Name
Choose a self-explaining name for your project.
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
## License
For open source projects, say how it is licensed.
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
##
Calibration is a CSV file
TODO 0 → 100644
check and fix ResonanceStrength handling
fix units
\ No newline at end of file
CLASS/E2Sextupole->CalibrationPath: "/homelocal/claudio/src/gitlab/dt/machine/calibration/magnetmodel"
CLASS/E2Sextupole->Description: "Elettra 2.0 sextupole magnet device",\
"Use calibration table handle current/strgenght converstions.",\
"The magnet device is connected to a power supply tango device , real or simulated.",\
"",\
"Based on ESRF EBSmagnet concepts and libraries."
CLASS/E2Sextupole->InheritedFrom: TANGO_BASE_CLASS
CLASS/E2Sextupole->ProjectTitle: "Elettra 2.0 pure corrector magnet device"
# CLASS E2Sextupole attribute properties
#
# Resource backup , created Fri Oct 18 15:37:19 CEST 2024
#
#---------------------------------------------------------
# SERVER e2sextupole-srv/test, E2Sextupole device declaration
#---------------------------------------------------------
e2sextupole-srv/test/DEVICE/E2Sextupole: "test/magnet/s16",\
"test/magnet/s20"
# --- test/magnet/s16 properties
test/magnet/s16->CalibrationFileName: Strength.csv
test/magnet/s16->CurrentDevice: "test/power_supply/pss16"
test/magnet/s16->MagnetName: 0
test/magnet/s16->Model: no_relevant
test/magnet/s16->ParameterFileName: MAG_params.csv
test/magnet/s16->SerialNumber: 1
test/magnet/s16->__SubDevices: "test/power_supply/pss16",\
"dserver/simulatede2ps-srv/test"
# --- test/magnet/s16 attribute properties
# --- test/magnet/s20 properties
test/magnet/s20->CalibrationFileName: Strength.csv
test/magnet/s20->CurrentDevice: "test/power_supply/pss20"
test/magnet/s20->MagnetName: 0
test/magnet/s20->Model: not_relevant
test/magnet/s20->ParameterFileName: MAG_params.csv
test/magnet/s20->SerialNumber: 1
test/magnet/s20->__SubDevices: "test/power_supply/pss20",\
"dserver/simulatede2ps-srv/test"
# --- test/magnet/s20 attribute properties
#---------------------------------------------------------
# CLASS E2Sextupole properties
#---------------------------------------------------------
CLASS/E2Sextupole->CalibrationPath: "/homelocal/claudio/src/gitlab/dt/machine/calibration/magnetmodel"
CLASS/E2Sextupole->Description: "Elettra 2.0 sextupole magnet device",\
"Use calibration table handle current/strgenght converstions.",\
"The magnet device is connected to a power supply tango device , real or simulated.",\
"",\
"Based on ESRF EBSmagnet concepts and libraries."
CLASS/E2Sextupole->InheritedFrom: TANGO_BASE_CLASS
CLASS/E2Sextupole->ProjectTitle: "Elettra 2.0 pure corrector magnet device"
# CLASS E2Sextupole attribute properties
/*----- PROTECTED REGION ID(E2Sextupole::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 : Elettra 2.0 pure corrector magnet device
//
// 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/>.
//
//
// Elettra - Sincrotrone Trieste S.c.p.A.
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#include <tango/tango.h>
#include "E2SextupoleClass.h"
// Add class header files if needed
/**
* Create E2Sextupole Class singleton and store it in DServer object.
*/
void Tango::DServer::class_factory()
{
// Add method class init if needed
add_class(E2Sextupole_ns::E2SextupoleClass::init("E2Sextupole"));
}
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // E2Sextupole::ClassFactory.cpp
This diff is collapsed.
/*----- PROTECTED REGION ID(E2Sextupole.h) ENABLED START -----*/
/* clang-format on */
//=============================================================================
//
// file : E2Sextupole.h
//
// description : Include file for the E2Sextupole class
//
// project : Elettra 2.0 pure corrector magnet device
//
// 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/>.
//
//
// Elettra - Sincrotrone Trieste S.c.p.A.
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#ifndef E2Sextupole_H
#define E2Sextupole_H
#include <tango/tango.h>
#include <PureSextupole.h>
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // E2Sextupole.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
/**
* E2Sextupole class description:
* Elettra 2.0 sextupole magnet device
* Use calibration table handle current/strgenght converstions.
* The magnet device is connected to a power supply tango device , real or simulated.
*
* Based on ESRF EBSmagnet concepts and libraries.
*/
namespace E2Sextupole_ns
{
/*----- PROTECTED REGION ID(E2Sextupole::Additional Class Declarations) ENABLED START -----*/
/* clang-format on */
// Additional Class Declarations
const double default_beam_energy = 2.4e9; // default electron beam energy in GeV
const double E0 = 510998.94999999995; // electron rest mass in eV
const double c_light = 299792458.0; // speed of light m/s
//class Corrector;
class CurrentEventCallback;
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // E2Sextupole::Additional Class Declarations
class E2Sextupole : public TANGO_BASE_CLASS
{
/*----- PROTECTED REGION ID(E2Sextupole::Data Members) ENABLED START -----*/
/* clang-format on */
// Add your own data members
MagnetModel::PureSextupole* sextupole; //magnet model
double magnet_rigidity;
double magnet_rigidity_inv;
Tango::DeviceProxy *current_dev;
CurrentEventCallback *current_cb;
int current_event_id;
int current_set_event_id;
int state_event_id;
Tango::WAttribute *cursetAtt;
Tango::WAttribute *strengthAtt;
Tango::WAttribute *correctionAtt;
Tango::WAttribute *resonanceAtt;
std::vector<double> set_current; //the actual set point of the current (from the power supply) used for strength calculations
std::vector<double> set_strength; //the strength set point
bool design_strength_initialized; //true whe design strenfght has been called at least one , first call is to init valude from DB
public:
omni_mutex iomutex; //guard for event and write interference
Tango::DevDouble wValCorrStrength; //last CorrectionStrength write value
Tango::DevDouble wValResStrength; //last ResonanceStrength write value
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // E2Sextupole::Data Members
// Device property data members
public:
// CurrentDevice: power supply tango device name
std::string currentDevice;
// Model: corrector model (part number)
std::string model;
// SerialNumber: serial number of the magnet
std::string serialNumber;
// MagnetName: Name of magnet
std::string magnetName;
// CalibrationFileName: name of calibration table file name
std::string calibrationFileName;
// CalibrationPath: path of calibration and parameter files
std::string calibrationPath;
// ParameterFileName: name of auxiliary parametr file name
// (EBSmagnet compatibility)
std::string parameterFileName;
bool mandatoryNotDefined;
// Attribute data members
public:
Tango::DevDouble *attr_Strength_read;
Tango::DevDouble *attr_CorrectionStrength_read;
Tango::DevDouble *attr_ResonanceStrength_read;
Tango::DevDouble *attr_Current_read;
Tango::DevDouble *attr_BeamEnergy_read;
Tango::DevDouble *attr_DesignStrength_read;
// Constructors and destructors
public:
/**
* Constructs a newly device object.
*
* @param cl Class.
* @param s Device Name
*/
E2Sextupole(Tango::DeviceClass *cl,std::string &s);
/**
* Constructs a newly device object.
*
* @param cl Class.
* @param s Device Name
*/
E2Sextupole(Tango::DeviceClass *cl,const char *s);
/**
* Constructs a newly device object.
*
* @param cl Class.
* @param s Device name
* @param d Device description.
*/
E2Sextupole(Tango::DeviceClass *cl,const char *s,const char *d);
/**
* The device object destructor.
*/
~E2Sextupole();
// 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();
/*
* Check if mandatory property has been set
*/
void check_mandatory_property(Tango::DbDatum &class_prop, Tango::DbDatum &dev_prop);
// Attribute methods
public:
//--------------------------------------------------------
/*
* Method : E2Sextupole::read_attr_hardware()
* Description: Hardware acquisition for attributes.
*/
//--------------------------------------------------------
virtual void read_attr_hardware(std::vector<long> &attr_list);
//--------------------------------------------------------
/*
* Method : E2Sextupole::write_attr_hardware()
* Description: Hardware writing for attributes.
*/
//--------------------------------------------------------
virtual void write_attr_hardware(std::vector<long> &attr_list);
/**
* Attribute Strength related methods
* Description: sextupole strength 1/m^3 ( m-3)
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
virtual void read_Strength(Tango::Attribute &attr);
virtual void write_Strength(Tango::WAttribute &attr);
virtual bool is_Strength_allowed(Tango::AttReqType type);
/**
* Attribute CorrectionStrength related methods
*
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
virtual void read_CorrectionStrength(Tango::Attribute &attr);
virtual void write_CorrectionStrength(Tango::WAttribute &attr);
virtual bool is_CorrectionStrength_allowed(Tango::AttReqType type);
/**
* Attribute ResonanceStrength related methods
*
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
virtual void read_ResonanceStrength(Tango::Attribute &attr);
virtual void write_ResonanceStrength(Tango::WAttribute &attr);
virtual bool is_ResonanceStrength_allowed(Tango::AttReqType type);
/**
* Attribute Current related methods
*
*
* 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 BeamEnergy related methods
* Description: Electron beam energy in eV. Used to calculate magnetic rigidity in strength calculations.
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
virtual void read_BeamEnergy(Tango::Attribute &attr);
virtual void write_BeamEnergy(Tango::WAttribute &attr);
virtual bool is_BeamEnergy_allowed(Tango::AttReqType type);
/**
* Attribute DesignStrength related methods
* Description: sextupole design strength 1/m^3 ( m-3). The strenght reqiured by the nominal optic
* The attribute is memorized , expert only.
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
virtual void read_DesignStrength(Tango::Attribute &attr);
virtual void write_DesignStrength(Tango::WAttribute &attr);
virtual bool is_DesignStrength_allowed(Tango::AttReqType type);
//--------------------------------------------------------
/**
* Method : E2Sextupole::add_dynamic_attributes()
* Description: Add dynamic attributes if any.
*/
//--------------------------------------------------------
void add_dynamic_attributes();
// Command related methods
public:
/**
* Command Reset related method
* Description: reset the corrector
*
*/
virtual void reset();
virtual bool is_Reset_allowed(const CORBA::Any &any);
/**
* Command ResetResonanceStrength related method
* Description: Reset ResonanceStrength to 0
*
*/
virtual void reset_resonance_strength();
virtual bool is_ResetResonanceStrength_allowed(const CORBA::Any &any);
/**
* Command ApplyDesignStrength related method
* Description: Apply the memorized DesignStrength strenght to the magnet.
*
*/
virtual void apply_design_strength();
virtual bool is_ApplyDesignStrength_allowed(const CORBA::Any &any);
//--------------------------------------------------------
/**
* Method : E2Sextupole::add_dynamic_commands()
* Description: Add dynamic commands if any.
*/
//--------------------------------------------------------
void add_dynamic_commands();
/*----- PROTECTED REGION ID(E2Sextupole::Additional Method prototypes) ENABLED START -----*/
/* clang-format on */
// Additional Method prototypes
void calc_rigidity(const double& energy);
void set_current_write(const double& curr);
void update_values_write(void); //update internal calculated values when current write value is updated;
void update_values_read(void); //update internal calculated values when current read value is updated;
void update_values_state(void); //update internal calculated values when power supply state is updated;
void init_strengths(void); // initialize strengths from power supply values
void subscribe_events(void); //subcribe events to power supply
//void delayed_subscribe(int delayedMs);
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // E2Sextupole::Additional Method prototypes
};
/*----- PROTECTED REGION ID(E2Sextupole::Additional Classes Definitions) ENABLED START -----*/
/* clang-format on */
// Additional Classes Definitions
class CurrentEventCallback : public Tango::CallBack
{
public:
CurrentEventCallback(E2Sextupole*);
void push_event(Tango::EventData* ev);
protected:
E2Sextupole* e2_sext;
};
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // E2Sextupole::Additional Classes Definitions
} // End of namespace
#endif // E2Sextupole_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="E2Sextupole" pogoRevision="9.9">
<description description="Elettra 2.0 sextupole magnet device&#xA;Use calibration table handle current/strgenght converstions.&#xA;The magnet device is connected to a power supply tango device , real or simulated.&#xA;&#xA;Based on ESRF EBSmagnet concepts and libraries." title="Elettra 2.0 pure corrector magnet device" sourcePath="/homelocal/claudio/src/gitlab/dt/ds/e2sextupole/src" language="Cpp" filestogenerate="XMI file,Code files,Protected Regions" license="GPL" copyright="Elettra - Sincrotrone Trieste S.c.p.A." hasMandatoryProperty="true" 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="MagneticDevices" siteSpecific="" platform="Unix Like" bus="Not Applicable" manufacturer="none" reference="">
<keyWords>magnet</keyWords>
<keyWords>pure corrector</keyWords>
<keyWords>fast corrector</keyWords>
<keyWords>Elettra 2.0</keyWords>
<keyWords>calibartion</keyWords>
</identification>
</description>
<classProperties name="BeamEnergy" description="default electron beam energy, in GeV.&#xA;Use to initialize all magnet istances BeamEnergy attribute.">
<type xsi:type="pogoDsl:DoubleType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<DefaultPropValue>2.4</DefaultPropValue>
</classProperties>
<classProperties name="CalibrationPath" description="path of calibration and parameter files">
<type xsi:type="pogoDsl:StringType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</classProperties>
<deviceProperties name="CurrentDevice" description="power supply tango device name">
<type xsi:type="pogoDsl:StringType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</deviceProperties>
<deviceProperties name="Model" description="corrector model (part number)">
<type xsi:type="pogoDsl:StringType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</deviceProperties>
<deviceProperties name="SerialNumber" description="serial number of the magnet">
<type xsi:type="pogoDsl:StringType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</deviceProperties>
<deviceProperties name="MagnetName" description="Name of magnet">
<type xsi:type="pogoDsl:StringType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</deviceProperties>
<deviceProperties name="CalibrationFileName" mandatory="true" description="name of calibration table file name">
<type xsi:type="pogoDsl:StringType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</deviceProperties>
<deviceProperties name="CalibrationPath" description="path of calibration and parameter files">
<type xsi:type="pogoDsl:StringType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</deviceProperties>
<deviceProperties name="ParameterFileName" mandatory="true" description="name of auxiliary parametr file name&#xA;(EBSmagnet compatibility)">
<type xsi:type="pogoDsl:StringType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</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="Reset" description="reset the corrector" 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"/>
</commands>
<commands name="ResetResonanceStrength" description="Reset ResonanceStrength to 0" execMethod="reset_resonance_strength" 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"/>
</commands>
<commands name="ApplyDesignStrength" description="Apply the memorized DesignStrength strenght to the magnet." execMethod="apply_design_strength" 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"/>
</commands>
<attributes name="Strength" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" 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="sextupole strength 1/m^3 ( m-3)" label="strength" unit="m-3" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="CorrectionStrength" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" 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="" label="correction strength" unit="m-3" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="ResonanceStrength" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" 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="" label="resonance strength" unit="m-3" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<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="" label="" unit="A" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="BeamEnergy" attType="Scalar" rwType="READ_WRITE" displayLevel="EXPERT" polledPeriod="0" maxX="" maxY="" allocReadMember="true" 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="Electron beam energy in eV. Used to calculate magnetic rigidity in strength calculations." label="electron beam ebergy [eV]" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="DesignStrength" attType="Scalar" rwType="READ_WRITE" displayLevel="EXPERT" polledPeriod="0" maxX="" maxY="" memorized="true" memorizedAtInit="true" allocReadMember="true" 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="sextupole design strength 1/m^3 ( m-3). The strenght reqiured by the nominal optic&#xA;The attribute is memorized , expert only." label="design strength" unit="m-3" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<preferences docHome="./doc_html" makefileHome="$(TANGO_HOME)"/>
</classes>
</pogoDsl:PogoSystem>
This diff is collapsed.
/*----- PROTECTED REGION ID(E2SextupoleClass.h) ENABLED START -----*/
/* clang-format on */
//=============================================================================
//
// file : E2SextupoleClass.h
//
// description : Include for the E2Sextupole root class.
// This class is the singleton class for
// the E2Sextupole device class.
// It contains all properties and methods which the
// E2Sextupole requires only once e.g. the commands.
//
// project : Elettra 2.0 pure corrector magnet device
//
// 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/>.
//
//
// Elettra - Sincrotrone Trieste S.c.p.A.
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#ifndef E2SextupoleClass_H
#define E2SextupoleClass_H
#include <tango/tango.h>
#include "E2Sextupole.h"
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // E2SextupoleClass.h
namespace E2Sextupole_ns
{
/*----- PROTECTED REGION ID(E2SextupoleClass::classes for dynamic creation) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // E2SextupoleClass::classes for dynamic creation
//=========================================
// Define classes for attributes
//=========================================
// Attribute Strength class definition
class StrengthAttrib: public Tango::Attr
{
public:
StrengthAttrib():Attr("Strength",
Tango::DEV_DOUBLE, Tango::READ_WRITE) {}
~StrengthAttrib() {}
virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att)
{(static_cast<E2Sextupole *>(dev))->read_Strength(att);}
virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att)
{(static_cast<E2Sextupole *>(dev))->write_Strength(att);}
virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty)
{return (static_cast<E2Sextupole *>(dev))->is_Strength_allowed(ty);}
};
// Attribute CorrectionStrength class definition
class CorrectionStrengthAttrib: public Tango::Attr
{
public:
CorrectionStrengthAttrib():Attr("CorrectionStrength",
Tango::DEV_DOUBLE, Tango::READ_WRITE) {}
~CorrectionStrengthAttrib() {}
virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att)
{(static_cast<E2Sextupole *>(dev))->read_CorrectionStrength(att);}
virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att)
{(static_cast<E2Sextupole *>(dev))->write_CorrectionStrength(att);}
virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty)
{return (static_cast<E2Sextupole *>(dev))->is_CorrectionStrength_allowed(ty);}
};
// Attribute ResonanceStrength class definition
class ResonanceStrengthAttrib: public Tango::Attr
{
public:
ResonanceStrengthAttrib():Attr("ResonanceStrength",
Tango::DEV_DOUBLE, Tango::READ_WRITE) {}
~ResonanceStrengthAttrib() {}
virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att)
{(static_cast<E2Sextupole *>(dev))->read_ResonanceStrength(att);}
virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att)
{(static_cast<E2Sextupole *>(dev))->write_ResonanceStrength(att);}
virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty)
{return (static_cast<E2Sextupole *>(dev))->is_ResonanceStrength_allowed(ty);}
};
// 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<E2Sextupole *>(dev))->read_Current(att);}
virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att)
{(static_cast<E2Sextupole *>(dev))->write_Current(att);}
virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty)
{return (static_cast<E2Sextupole *>(dev))->is_Current_allowed(ty);}
};
// Attribute BeamEnergy class definition
class BeamEnergyAttrib: public Tango::Attr
{
public:
BeamEnergyAttrib():Attr("BeamEnergy",
Tango::DEV_DOUBLE, Tango::READ_WRITE) {}
~BeamEnergyAttrib() {}
virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att)
{(static_cast<E2Sextupole *>(dev))->read_BeamEnergy(att);}
virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att)
{(static_cast<E2Sextupole *>(dev))->write_BeamEnergy(att);}
virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty)
{return (static_cast<E2Sextupole *>(dev))->is_BeamEnergy_allowed(ty);}
};
// Attribute DesignStrength class definition
class DesignStrengthAttrib: public Tango::Attr
{
public:
DesignStrengthAttrib():Attr("DesignStrength",
Tango::DEV_DOUBLE, Tango::READ_WRITE) {}
~DesignStrengthAttrib() {}
virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att)
{(static_cast<E2Sextupole *>(dev))->read_DesignStrength(att);}
virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att)
{(static_cast<E2Sextupole *>(dev))->write_DesignStrength(att);}
virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty)
{return (static_cast<E2Sextupole *>(dev))->is_DesignStrength_allowed(ty);}
};
//=========================================
// Define classes for commands
//=========================================
// 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<E2Sextupole *>(dev))->is_Reset_allowed(any);}
};
// Command ResetResonanceStrength class definition
class ResetResonanceStrengthClass : public Tango::Command
{
public:
ResetResonanceStrengthClass(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) {}
ResetResonanceStrengthClass(const char *cmd_name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(cmd_name,in,out) {}
~ResetResonanceStrengthClass() {}
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<E2Sextupole *>(dev))->is_ResetResonanceStrength_allowed(any);}
};
// Command ApplyDesignStrength class definition
class ApplyDesignStrengthClass : public Tango::Command
{
public:
ApplyDesignStrengthClass(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) {}
ApplyDesignStrengthClass(const char *cmd_name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(cmd_name,in,out) {}
~ApplyDesignStrengthClass() {}
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<E2Sextupole *>(dev))->is_ApplyDesignStrength_allowed(any);}
};
/**
* The E2SextupoleClass singleton definition
*/
#ifdef _TG_WINDOWS_
class __declspec(dllexport) E2SextupoleClass : public Tango::DeviceClass
#else
class E2SextupoleClass : public Tango::DeviceClass
#endif
{
/*----- PROTECTED REGION ID(E2SextupoleClass::Additional DServer data members) ENABLED START -----*/
/* clang-format on */
// Add your own code
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // E2SextupoleClass::Additional DServer data members
public:
// Class properties data members
// BeamEnergy: default electron beam energy, in GeV.
// Use to initialize all magnet istances BeamEnergy attribute.
Tango::DevDouble beamEnergy;
// CalibrationPath: path of calibration and parameter files
std::string calibrationPath;
// write class properties data members
Tango::DbData cl_prop;
Tango::DbData cl_def_prop;
Tango::DbData dev_def_prop;
// Method prototypes
static E2SextupoleClass *init(const char *);
static E2SextupoleClass *instance();
~E2SextupoleClass();
Tango::DbDatum get_class_property(std::string &);
Tango::DbDatum get_default_device_property(std::string &);
Tango::DbDatum get_default_class_property(std::string &);
protected:
E2SextupoleClass(std::string &);
static E2SextupoleClass *_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 // E2Sextupole_H
/*----- PROTECTED REGION ID(E2SextupoleStateMachine.cpp) ENABLED START -----*/
/* clang-format on */
//=============================================================================
//
// file : E2SextupoleStateMachine.cpp
//
// description : State machine file for the E2Sextupole class
//
// project : Elettra 2.0 pure corrector magnet device
//
// 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/>.
//
//
// Elettra - Sincrotrone Trieste S.c.p.A.
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#include "E2Sextupole.h"
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // E2Sextupole::E2SextupoleStateMachine.cpp
//================================================================
// States | Description
//================================================================
namespace E2Sextupole_ns
{
//=================================================
// Attributes Allowed Methods
//=================================================
//--------------------------------------------------------
/**
* Method : E2Sextupole::is_Strength_allowed()
* Description: Execution allowed for Strength attribute
*/
//--------------------------------------------------------
bool E2Sextupole::is_Strength_allowed(TANGO_UNUSED(Tango::AttReqType type))
{
// Not any excluded states for Strength attribute in Write access.
/*----- PROTECTED REGION ID(E2Sextupole::StrengthStateAllowed_WRITE) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // E2Sextupole::StrengthStateAllowed_WRITE
// Not any excluded states for Strength attribute in read access.
/*----- PROTECTED REGION ID(E2Sextupole::StrengthStateAllowed_READ) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // E2Sextupole::StrengthStateAllowed_READ
return true;
}
//--------------------------------------------------------
/**
* Method : E2Sextupole::is_CorrectionStrength_allowed()
* Description: Execution allowed for CorrectionStrength attribute
*/
//--------------------------------------------------------
bool E2Sextupole::is_CorrectionStrength_allowed(TANGO_UNUSED(Tango::AttReqType type))
{
// Not any excluded states for CorrectionStrength attribute in Write access.
/*----- PROTECTED REGION ID(E2Sextupole::CorrectionStrengthStateAllowed_WRITE) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // E2Sextupole::CorrectionStrengthStateAllowed_WRITE
// Not any excluded states for CorrectionStrength attribute in read access.
/*----- PROTECTED REGION ID(E2Sextupole::CorrectionStrengthStateAllowed_READ) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // E2Sextupole::CorrectionStrengthStateAllowed_READ
return true;
}
//--------------------------------------------------------
/**
* Method : E2Sextupole::is_ResonanceStrength_allowed()
* Description: Execution allowed for ResonanceStrength attribute
*/
//--------------------------------------------------------
bool E2Sextupole::is_ResonanceStrength_allowed(TANGO_UNUSED(Tango::AttReqType type))
{
// Not any excluded states for ResonanceStrength attribute in Write access.
/*----- PROTECTED REGION ID(E2Sextupole::ResonanceStrengthStateAllowed_WRITE) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // E2Sextupole::ResonanceStrengthStateAllowed_WRITE
// Not any excluded states for ResonanceStrength attribute in read access.
/*----- PROTECTED REGION ID(E2Sextupole::ResonanceStrengthStateAllowed_READ) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // E2Sextupole::ResonanceStrengthStateAllowed_READ
return true;
}
//--------------------------------------------------------
/**
* Method : E2Sextupole::is_Current_allowed()
* Description: Execution allowed for Current attribute
*/
//--------------------------------------------------------
bool E2Sextupole::is_Current_allowed(TANGO_UNUSED(Tango::AttReqType type))
{
// Not any excluded states for Current attribute in Write access.
/*----- PROTECTED REGION ID(E2Sextupole::CurrentStateAllowed_WRITE) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // E2Sextupole::CurrentStateAllowed_WRITE
// Not any excluded states for Current attribute in read access.
/*----- PROTECTED REGION ID(E2Sextupole::CurrentStateAllowed_READ) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // E2Sextupole::CurrentStateAllowed_READ
return true;
}
//--------------------------------------------------------
/**
* Method : E2Sextupole::is_BeamEnergy_allowed()
* Description: Execution allowed for BeamEnergy attribute
*/
//--------------------------------------------------------
bool E2Sextupole::is_BeamEnergy_allowed(TANGO_UNUSED(Tango::AttReqType type))
{
// Not any excluded states for BeamEnergy attribute in Write access.
/*----- PROTECTED REGION ID(E2Sextupole::BeamEnergyStateAllowed_WRITE) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // E2Sextupole::BeamEnergyStateAllowed_WRITE
// Not any excluded states for BeamEnergy attribute in read access.
/*----- PROTECTED REGION ID(E2Sextupole::BeamEnergyStateAllowed_READ) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // E2Sextupole::BeamEnergyStateAllowed_READ
return true;
}
//--------------------------------------------------------
/**
* Method : E2Sextupole::is_DesignStrength_allowed()
* Description: Execution allowed for DesignStrength attribute
*/
//--------------------------------------------------------
bool E2Sextupole::is_DesignStrength_allowed(TANGO_UNUSED(Tango::AttReqType type))
{
// Not any excluded states for DesignStrength attribute in Write access.
/*----- PROTECTED REGION ID(E2Sextupole::DesignStrengthStateAllowed_WRITE) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // E2Sextupole::DesignStrengthStateAllowed_WRITE
// Not any excluded states for DesignStrength attribute in read access.
/*----- PROTECTED REGION ID(E2Sextupole::DesignStrengthStateAllowed_READ) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // E2Sextupole::DesignStrengthStateAllowed_READ
return true;
}
//=================================================
// Commands Allowed Methods
//=================================================
//--------------------------------------------------------
/**
* Method : E2Sextupole::is_Reset_allowed()
* Description: Execution allowed for Reset attribute
*/
//--------------------------------------------------------
bool E2Sextupole::is_Reset_allowed(TANGO_UNUSED(const CORBA::Any &any))
{
// Not any excluded states for Reset command.
/*----- PROTECTED REGION ID(E2Sextupole::ResetStateAllowed) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // E2Sextupole::ResetStateAllowed
return true;
}
//--------------------------------------------------------
/**
* Method : E2Sextupole::is_ResetResonanceStrength_allowed()
* Description: Execution allowed for ResetResonanceStrength attribute
*/
//--------------------------------------------------------
bool E2Sextupole::is_ResetResonanceStrength_allowed(TANGO_UNUSED(const CORBA::Any &any))
{
// Not any excluded states for ResetResonanceStrength command.
/*----- PROTECTED REGION ID(E2Sextupole::ResetResonanceStrengthStateAllowed) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // E2Sextupole::ResetResonanceStrengthStateAllowed
return true;
}
//--------------------------------------------------------
/**
* Method : E2Sextupole::is_ApplyDesignStrength_allowed()
* Description: Execution allowed for ApplyDesignStrength attribute
*/
//--------------------------------------------------------
bool E2Sextupole::is_ApplyDesignStrength_allowed(TANGO_UNUSED(const CORBA::Any &any))
{
// Not any excluded states for ApplyDesignStrength command.
/*----- PROTECTED REGION ID(E2Sextupole::ApplyDesignStrengthStateAllowed) ENABLED START -----*/
/* clang-format on */
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // E2Sextupole::ApplyDesignStrengthStateAllowed
return true;
}
/*----- PROTECTED REGION ID(E2Sextupole::E2SextupoleStateAllowed.AdditionalMethods) ENABLED START -----*/
/* clang-format on */
// Additional Methods
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // E2Sextupole::E2SextupoleStateAllowed.AdditionalMethods
} // End of namespace
/*----- PROTECTED REGION ID(E2Sextupole::main.cpp) ENABLED START -----*/
/* clang-format on */
//=============================================================================
//
// file : main.cpp
//
// description : C++ source for the E2Sextupole 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 : Elettra 2.0 pure corrector magnet device
//
// 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/>.
//
//
// Elettra - Sincrotrone Trieste S.c.p.A.
//
//=============================================================================
// 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;
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 -----*/ // E2Sextupole::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