Commit 91441ce8 authored by Alessandro Abrami's avatar Alessandro Abrami
Browse files

12/06/2020:

	Import da CVS:b_r01a-Andor4Presto
	Modificati Tag CVS
	Modifiche su Makefile
parent 90a43788
MYNOTES.txt
MSG.txt
NAME_SRV = pespccdstage-srv
CXXFLAGS =
LDFLAGS = -litpp
#CXXFLAGS += -D_DBG_INIT
CXXFLAGS += -D_DBG_PARAMETERS
#CXXFLAGS += -D_DBG_TARDISTAGE
#CXXFLAGS += -D_DBG_UPDATTR
#CXXFLAGS += -D_DBG_CALCNL2XZ
#CXXFLAGS += -D_DBG_CALCXZ2BR
#CXXFLAGS += -D_DBG_ROTCENTER
#CXXFLAGS += -D_DBG_DYNATTR
#CXXFLAGS += -D_DBG_CALCXZ2NL
#CXXFLAGS += -D_DBG_XZ2NL
#CXXFLAGS += -D_DBG_PP2P
#CXXFLAGS += -D_DONT_WRITECENTERX
#CXXFLAGS += -D_DONT_WRITE_BR
#CXXFLAGS += -D_DBG_CALCBR2XZ
#CXXFLAGS += -D_WITHOUT_DIPLACEMENT
##----------------------------------------------------------------------------
#
#
ifeq ($(HOME), /home/abrami)
DO_LOCAL ?= yes
else
DO_LOCAL = no
endif
SITE = $(shell a=`lsb_release -si`; b=`lsb_release -sr`; c=`uname -m`; echo $$a"_"$$b"_"$$c)
LOCAL_BASE = $(shell echo $$HOME)/my_runtime
LOCAL_INC = $(LOCAL_BASE)/include
LOCAL_LIB = $(LOCAL_BASE)/site/$(SITE)/lib
LOCAL_BIN = $(LOCAL_BASE)/site/$(SITE)/bin
ifeq ($(DO_LOCAL), yes)
CXXFLAGS += -I $(LOCAL_INC)
LDFLAGS += -L $(LOCAL_LIB)
endif
#
#
##----------------------------------------------------------------------------
HAVE_SAFETYMANGER=no
ifeq ($(HAVE_SAFETYMANGER), yes)
CXXFLAGS += -DHAVE_SAFETYMANAGER
ifeq ($(DO_LOCAL), yes)
CXXFLAGS += -I $(LOCAL_INC)/libsafetymanager
else
CXXFLAGS += -I /runtime/include/libsafetymanager
endif
endif
ifeq ($(DO_LOCAL), yes)
CXXFLAGS += -I $(LOCAL_INC)/libaxisutils
else
CXXFLAGS += -I /runtime/include/libaxisutils
endif
RELEASE := GIT:: $(shell git describe --dirty)
CXXFLAGS += -D'RELEASE="$(RELEASE)"'
REPO := GIT:: $(shell git config --get remote.origin.url)
LOC_REPO := GIT:: $(shell git rev-parse --show-toplevel)
CXXFLAGS += -D'REPO="$(LOC_REPO)"'
include ../makefiles/Make-9.3.3.in
LDFLAGS += -laxisutils
ifeq ($(HAVE_SAFETYMANGER), yes)
LDFLAGS += -lsafetymanager
endif
.PHONY: install
install:
@[ $(DO_LOCAL) = yes ] && cp -f bin/$(NAME_SRV) $(LOCAL_BIN)
/*----- PROTECTED REGION ID(PespCCDStage::ClassFactory.cpp) ENABLED START -----*/
//+=============================================================================
//
// file : ClassFactory.cpp
//
// description : C++ source for the class_factory method of the DServer
// device class. This method is responsible to create
// all class singletin for a device server. It is called
// at device server startup
//
// project : TANGO Device Server
//
// $Author: abrami $
//
//
// copyleft : European Synchrotron Radiation Facility
// BP 220, Grenoble 38043
// FRANCE
//
//-=============================================================================
//
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//
// (c) - Software Engineering Group - ESRF
//=============================================================================
#include <tango.h>
#include <PespCCDStageClass.h>
/**
* Create PespCCDStageClass singleton and store it in DServer object.
*/
void Tango::DServer::class_factory()
{
add_class(PespCCDStage_ns::PespCCDStageClass::init("PespCCDStage"));
}
/*----- PROTECTED REGION END -----*/ // PespCCDStage::ClassFactory.cpp
This diff is collapsed.
/*----- PROTECTED REGION ID(PespCCDStage.h) ENABLED START -----*/
//=============================================================================
//
// file : PespCCDStage.h
//
// description : Include file for the PespCCDStage class
//
// project : PespCCDStage
//
// This file is part of Tango device class.
//
// Tango is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Tango is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Tango. If not, see <http://www.gnu.org/licenses/>.
//
// $Author: abrami $
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#ifndef PespCCDStage_H
#define PespCCDStage_H
#include <tango.h>
#include <itpp/itbase.h>
#include <itpp/itcomm.h>
#include <math.h>
#include "PespStage.h"
#define PI 3.14159265
typedef struct {
string dev;
string move_attr;
string move_dflt; // default value when dev in not configured
double move_dflt_value;
string stop_cmd;
bool configured;
Tango::DeviceProxy *dp;
Tango::DevState state;
long tmo;
double m; // value = m * reading + q
double q;
} mover_t;
/*----- PROTECTED REGION END -----*/ // PespCCDStage.h
/**
* PespCCDStage class description:
*
*/
namespace PespCCDStage_ns
{
/*----- PROTECTED REGION ID(PespCCDStage::Additional Class Declarations) ENABLED START -----*/
// Additional Class Declarations
/*----- PROTECTED REGION END -----*/ // PespCCDStage::Additional Class Declarations
class PespCCDStage : public TANGO_BASE_CLASS
{
/*----- PROTECTED REGION ID(PespCCDStage::Data Members) ENABLED START -----*/
// Add your own data members
public:
mover_t ccdstageN;
mover_t ccdstageL;
mover_t gridX;
mover_t gridZ;
mover_t gridpic;
itpp::vec chamber; //chamber
double pitch;
itpp::vec ccd; //ccd
itpp::mat rot;
itpp::vec q; //ccd origin in x,z
itpp::vec p; //yag center in x,z
itpp::vec br; //yag center in b,r
itpp::vec offset; //yag offset in n,l
itpp::vec r; //retta per centro yag e centro specchio/chamber in x,z
itpp::mat mr;
itpp::vec qr;
PespStage_ns::PespStage *pstage;
bool first_write_YagSelector;
bool first_write_BeamOnYagDisplacement;
bool attr_UpdateOnSelector;
/*----- PROTECTED REGION END -----*/ // PespCCDStage::Data Members
// Device property data members
public:
// OriginNL: Coordinate di Q in XZ: x,z
vector<Tango::DevDouble> originNL;
// YagCenterNL: Centro Yag in coord. NL
vector<Tango::DevDouble> yagCenterNL;
// RotationXN: Angolo (radianti) da N+ a X+
Tango::DevDouble rotationXN;
// GridChamber: Device proxy
// AttributoX
// DefaultX
// Device proxy
// AttributoZ
// DefaultZ
//
// Coordinata X portareticolo o da device o da default:
// device, default
vector<string> gridChamber;
// GridPitch: Device proxy
// AttributoX
// DefaultX
// Valore pitch
vector<string> gridPitch;
// CCDStageAxis: device proxy
// Attributo N
// device proxy
// Attributo L
vector<string> cCDStageAxis;
// StageType: Presto
// Tardi
string stageType;
// YagsCenterOffsets: Offsets (d) Yag da centro di rotazione tavola lungo retta RQ`
vector<Tango::DevDouble> yagsCenterOffsets;
// RotationCenterXZ: Centro di rotazione (del naso) in coord. xOz
vector<Tango::DevDouble> rotationCenterXZ;
bool mandatoryNotDefined;
// Attribute data members
public:
Tango::DevString *attr_StageType_read;
Tango::DevDouble *attr_FocusX_read;
Tango::DevDouble *attr_FocusZ_read;
Tango::DevDouble *attr_FocusDistance_read;
Tango::DevDouble *attr_FocusAngle_read;
Tango::DevDouble *attr_Pitch_read;
Tango::DevDouble *attr_BeamOnYagDisplacement_read;
Tango::DevBoolean *attr_UpdateOnDisplacement_read;
// Constructors and destructors
public:
/**
* Constructs a newly device object.
*
* @param cl Class.
* @param s Device Name
*/
PespCCDStage(Tango::DeviceClass *cl,string &s);
/**
* Constructs a newly device object.
*
* @param cl Class.
* @param s Device Name
*/
PespCCDStage(Tango::DeviceClass *cl,const char *s);
/**
* Constructs a newly device object.
*
* @param cl Class.
* @param s Device name
* @param d Device description.
*/
PespCCDStage(Tango::DeviceClass *cl,const char *s,const char *d);
/**
* The device object destructor.
*/
~PespCCDStage() {delete_device();};
// 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 : PespCCDStage::read_attr_hardware()
* Description : Hardware acquisition for attributes.
*/
//--------------------------------------------------------
virtual void read_attr_hardware(vector<long> &attr_list);
//--------------------------------------------------------
/*
* Method : PespCCDStage::write_attr_hardware()
* Description : Hardware writing for attributes.
*/
//--------------------------------------------------------
virtual void write_attr_hardware(vector<long> &attr_list);
/**
* Attribute StageType related methods
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
virtual void read_StageType(Tango::Attribute &attr);
virtual bool is_StageType_allowed(Tango::AttReqType type);
/**
* Attribute FocusX related methods
* Description:
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
virtual void read_FocusX(Tango::Attribute &attr);
virtual void write_FocusX(Tango::WAttribute &attr);
virtual bool is_FocusX_allowed(Tango::AttReqType type);
/**
* Attribute FocusZ related methods
* Description:
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
virtual void read_FocusZ(Tango::Attribute &attr);
virtual void write_FocusZ(Tango::WAttribute &attr);
virtual bool is_FocusZ_allowed(Tango::AttReqType type);
/**
* Attribute FocusDistance related methods
* Description:
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
virtual void read_FocusDistance(Tango::Attribute &attr);
virtual void write_FocusDistance(Tango::WAttribute &attr);
virtual bool is_FocusDistance_allowed(Tango::AttReqType type);
/**
* Attribute FocusAngle related methods
* Description:
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
virtual void read_FocusAngle(Tango::Attribute &attr);
virtual void write_FocusAngle(Tango::WAttribute &attr);
virtual bool is_FocusAngle_allowed(Tango::AttReqType type);
/**
* Attribute Pitch related methods
* Description:
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
virtual void read_Pitch(Tango::Attribute &attr);
virtual bool is_Pitch_allowed(Tango::AttReqType type);
/**
* Attribute BeamOnYagDisplacement related methods
* Description:
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
virtual void read_BeamOnYagDisplacement(Tango::Attribute &attr);
virtual void write_BeamOnYagDisplacement(Tango::WAttribute &attr);
virtual bool is_BeamOnYagDisplacement_allowed(Tango::AttReqType type);
/**
* Attribute UpdateOnDisplacement related methods
* Description:
*
* Data type: Tango::DevBoolean
* Attr type: Scalar
*/
virtual void read_UpdateOnDisplacement(Tango::Attribute &attr);
virtual void write_UpdateOnDisplacement(Tango::WAttribute &attr);
virtual bool is_UpdateOnDisplacement_allowed(Tango::AttReqType type);
// Dynamic attribute methods
public:
/**
* Attribute YagSelector related methods
* Description:
*
* Data type: Tango::DevUShort
* Attr type: Scalar
*/
virtual void read_YagSelector(Tango::Attribute &attr);
virtual void write_YagSelector(Tango::WAttribute &attr);
virtual bool is_YagSelector_allowed(Tango::AttReqType type);
void add_YagSelector_dynamic_attribute(string attname);
void remove_YagSelector_dynamic_attribute(string attname);
Tango::DevUShort *get_YagSelector_data_ptr(string &name);
map<string,Tango::DevUShort> YagSelector_data;
/**
* Attribute UpdateOnSelector related methods
* Description:
*
* Data type: Tango::DevBoolean
* Attr type: Scalar
*/
virtual void read_UpdateOnSelector(Tango::Attribute &attr);
virtual void write_UpdateOnSelector(Tango::WAttribute &attr);
virtual bool is_UpdateOnSelector_allowed(Tango::AttReqType type);
void add_UpdateOnSelector_dynamic_attribute(string attname);
void remove_UpdateOnSelector_dynamic_attribute(string attname);
Tango::DevBoolean *get_UpdateOnSelector_data_ptr(string &name);
map<string,Tango::DevBoolean> UpdateOnSelector_data;
//--------------------------------------------------------
/**
* Method : PespCCDStage::add_dynamic_attributes()
* Description : Add dynamic attributes if any.
*/
//--------------------------------------------------------
void add_dynamic_attributes();
// Command related methods
public:
/**
* Command SetAngleDistance related method
* Description:
*
* @param argin
* @returns
*/
virtual Tango::DevBoolean set_angle_distance(const Tango::DevVarDoubleArray *argin);
virtual bool is_SetAngleDistance_allowed(const CORBA::Any &any);
/**
* Command Stop related method
* Description:
*
*/
virtual void stop();
virtual bool is_Stop_allowed(const CORBA::Any &any);
/**
* Command GetInstrumentList related method
* Description: Se ritorna ``zero`` stringhe, allora non c`e` nemmeno il corrispondente ``selector``
*
* @returns
*/
virtual Tango::DevVarStringArray *get_instrument_list();
virtual bool is_GetInstrumentList_allowed(const CORBA::Any &any);
//--------------------------------------------------------
/**
* Method : PespCCDStage::add_dynamic_commands()
* Description : Add dynamic commands if any.
*/
//--------------------------------------------------------
void add_dynamic_commands();
/*----- PROTECTED REGION ID(PespCCDStage::Additional Method prototypes) ENABLED START -----*/
// Additional Method prototypes
protected :
//
void updateattributes();
void updatestatus();
/*----- PROTECTED REGION END -----*/ // PespCCDStage::Additional Method prototypes
};
/*----- PROTECTED REGION ID(PespCCDStage::Additional Classes Definitions) ENABLED START -----*/
// Additional Classes Definitions
/*----- PROTECTED REGION END -----*/ // PespCCDStage::Additional Classes Definitions
} // End of namespace
#endif // PespCCDStage_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://www.esrf.fr/tango/pogo/PogoDsl">
<classes name="PespCCDStage" pogoRevision="9.4">
<description description="" title="" sourcePath="/home/abrami/devel-T9/fermi/servers/pespccdstage/src" language="Cpp" filestogenerate="XMI file,Code files,Protected Regions" license="GPL" hasMandatoryProperty="true" hasConcreteProperty="true" hasAbstractCommand="false" hasAbstractAttribute="false">
<inheritances classname="Device_Impl" sourcePath=""/>
<identification contact="at elettra.trieste.it - alessandro.abrami" author="alessandro.abrami" emailDomain="elettra.trieste.it" classFamily="BeamlineComponents" siteSpecific="" platform="All Platforms" bus="Not Applicable" manufacturer="none" reference=""/>
</description>
<deviceProperties name="OriginNL" mandatory="true" description="Coordinate di Q in XZ: x,z">
<type xsi:type="pogoDsl:DoubleVectorType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</deviceProperties>
<deviceProperties name="YagCenterNL" description="Centro Yag in coord. NL">
<type xsi:type="pogoDsl:DoubleVectorType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</deviceProperties>
<deviceProperties name="RotationXN" mandatory="true" description="Angolo (radianti) da N+ a X+">
<type xsi:type="pogoDsl:DoubleType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</deviceProperties>
<deviceProperties name="GridChamber" mandatory="true" description="Device proxy&#xA;AttributoX&#xA;DefaultX&#xA;Device proxy&#xA;AttributoZ&#xA;DefaultZ&#xA;&#xA;Coordinata X portareticolo o da device o da default:&#xA;device, default">
<type xsi:type="pogoDsl:StringVectorType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</deviceProperties>
<deviceProperties name="GridPitch" mandatory="true" description="Device proxy&#xA;AttributoX&#xA;DefaultX&#xA;Valore pitch">
<type xsi:type="pogoDsl:StringVectorType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</deviceProperties>
<deviceProperties name="CCDStageAxis" description="device proxy&#xA;Attributo N&#xA;device proxy&#xA;Attributo L">
<type xsi:type="pogoDsl:StringVectorType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</deviceProperties>
<deviceProperties name="StageType" mandatory="true" description="Presto&#xA;Tardi">
<type xsi:type="pogoDsl:StringType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</deviceProperties>
<deviceProperties name="YagsCenterOffsets" description="Offsets (d) Yag da centro di rotazione tavola lungo retta RQ`">
<type xsi:type="pogoDsl:DoubleVectorType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</deviceProperties>
<deviceProperties name="RotationCenterXZ" description="Centro di rotazione (del naso) in coord. xOz">
<type xsi:type="pogoDsl:DoubleVectorType"/>
<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="SetAngleDistance" description="" execMethod="set_angle_distance" displayLevel="OPERATOR" polledPeriod="0">
<argin description="">
<type xsi:type="pogoDsl:DoubleArrayType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:BooleanType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</commands>
<commands name="Stop" description="" execMethod="stop" displayLevel="OPERATOR" polledPeriod="0">
<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="GetInstrumentList" description="Se ritorna ``zero`` stringhe, allora non c`e` nemmeno il corrispondente ``selector``" execMethod="get_instrument_list" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false">
<argin description="">
<type xsi:type="pogoDsl:VoidType"/>
</argin>
<argout description="">