Commit f0d1a83f authored by Alessandro Abrami's avatar Alessandro Abrami
Browse files

09/06/2020:

	Makefile modificato per prima compilazione
	Sorgenti come da CVS+release_05
parent 9a4f0c50
NAME_SRV = galildio-srv
EXTRAFLAGS =
##----------------------------------------------------------------------------
#
#
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(Galildio::ClassFactory.cpp) ENABLED START -----*/
//=============================================================================
//
// 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 : Galil digital I/O
//
// 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.h>
#include <GalildioClass.h>
// Add class header files if needed
/**
* Create Galildio Class singleton and store it in DServer object.
*/
void Tango::DServer::class_factory()
{
// Add method class init if needed
add_class(Galildio_ns::GalildioClass::init("Galildio"));
}
/*----- PROTECTED REGION END -----*/ // Galildio::ClassFactory.cpp
This diff is collapsed.
/*----- PROTECTED REGION ID(Galildio.h) ENABLED START -----*/
//=============================================================================
//
// file : Galildio.h
//
// description : Include file for the Galildio class
//
// project : Galil digital I/O
//
// 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 Galildio_H
#define Galildio_H
#include <tango.h>
#include "GalildioTypes.h"
#include "libaxisutils.h"
#include <stdexcept>
/*----- PROTECTED REGION END -----*/ // Galildio.h
/**
* Galildio class description:
*
*/
namespace Galildio_ns
{
/*----- PROTECTED REGION ID(Galildio::Additional Class Declarations) ENABLED START -----*/
// Additional Class Declarations
/*----- PROTECTED REGION END -----*/ // Galildio::Additional Class Declarations
class Galildio : public TANGO_BASE_CLASS
{
/*----- PROTECTED REGION ID(Galildio::Data Members) ENABLED START -----*/
// Add your own data members
private:
Tango::DeviceProxy *dp;
vector<bit_t> bits_ro;
vector<bit_t> bits_rw;
map<string, int> nick2idx_ro;
map<string, int> nick2idx_rw;
/*----- PROTECTED REGION END -----*/ // Galildio::Data Members
// Device property data members
public:
// Driver: Galil device
string driver;
// InputBitList:
vector<string> inputBitList;
// OutputBitList:
vector<string> outputBitList;
// CameraResetParam:
string cameraResetParam;
bool mandatoryNotDefined;
// Constructors and destructors
public:
/**
* Constructs a newly device object.
*
* @param cl Class.
* @param s Device Name
*/
Galildio(Tango::DeviceClass *cl,string &s);
/**
* Constructs a newly device object.
*
* @param cl Class.
* @param s Device Name
*/
Galildio(Tango::DeviceClass *cl,const char *s);
/**
* Constructs a newly device object.
*
* @param cl Class.
* @param s Device name
* @param d Device description.
*/
Galildio(Tango::DeviceClass *cl,const char *s,const char *d);
/**
* The device object destructor.
*/
~Galildio() {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 : Galildio::read_attr_hardware()
* Description : Hardware acquisition for attributes.
*/
//--------------------------------------------------------
virtual void read_attr_hardware(vector<long> &attr_list);
// Dynamic attribute methods
public:
/**
* Attribute ReadBitList related methods
* Description:
*
* Data type: Tango::DevBoolean
* Attr type: Scalar
*/
virtual void read_ReadBitList(Tango::Attribute &attr);
virtual bool is_ReadBitList_allowed(Tango::AttReqType type);
void add_ReadBitList_dynamic_attribute(string attname);
void remove_ReadBitList_dynamic_attribute(string attname);
Tango::DevBoolean *get_ReadBitList_data_ptr(string &name);
map<string,Tango::DevBoolean> ReadBitList_data;
/**
* Attribute ReadWriteBitList related methods
* Description:
*
* Data type: Tango::DevBoolean
* Attr type: Scalar
*/
virtual void read_ReadWriteBitList(Tango::Attribute &attr);
virtual void write_ReadWriteBitList(Tango::WAttribute &attr);
virtual bool is_ReadWriteBitList_allowed(Tango::AttReqType type);
void add_ReadWriteBitList_dynamic_attribute(string attname);
void remove_ReadWriteBitList_dynamic_attribute(string attname);
Tango::DevBoolean *get_ReadWriteBitList_data_ptr(string &name);
map<string,Tango::DevBoolean> ReadWriteBitList_data;
//--------------------------------------------------------
/**
* Method : Galildio::add_dynamic_attributes()
* Description : Add dynamic attributes if any.
*/
//--------------------------------------------------------
void add_dynamic_attributes();
// Command related methods
public:
/**
* Command Toggle related method
* Description:
*
* @param argin
*/
virtual void toggle(Tango::DevString argin);
virtual bool is_Toggle_allowed(const CORBA::Any &any);
/**
* Command Pulse related method
* Description:
*
* @param argin
*/
virtual void pulse(Tango::DevString argin);
virtual bool is_Pulse_allowed(const CORBA::Any &any);
// Dynamic commands methods
public:
/**
* Command CameraResetDynCmd related method
* Description: esegue pulse(CameraResetParam) se VoidVoidCmdParam esiste.
*
*/
virtual void camera_reset_dyn_cmd(Tango::Command &command);
virtual bool is_CameraResetDynCmd_allowed(const CORBA::Any &any);
void add_CameraResetDynCmd_dynamic_command(string cmdname, bool device);
void remove_CameraResetDynCmd_dynamic_command(string cmdname);
//--------------------------------------------------------
/**
* Method : Galildio::add_dynamic_commands()
* Description : Add dynamic commands if any.
*/
//--------------------------------------------------------
void add_dynamic_commands();
/*----- PROTECTED REGION ID(Galildio::Additional Method prototypes) ENABLED START -----*/
// Additional Method prototypes
bool parseBitList(vector<string>& BitList, vector<bit_t>& bits, map<string, int>& nick2idx, bool rw);
bool readBit(short bit, bool rw);
void setBit(short bit, bool val);
/*----- PROTECTED REGION END -----*/ // Galildio::Additional Method prototypes
};
/*----- PROTECTED REGION ID(Galildio::Additional Classes Definitions) ENABLED START -----*/
// Additional Classes Definitions
/*----- PROTECTED REGION END -----*/ // Galildio::Additional Classes Definitions
} // End of namespace
#endif // Galildio_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="Galildio" pogoRevision="9.4">
<description description="" title="Galil digital I/O" sourcePath="/home/abrami/devel-T9/fermi/servers/galildio/src" language="Cpp" filestogenerate="XMI file,Code files,Protected Regions" hasMandatoryProperty="true" hasConcreteProperty="true" hasAbstractCommand="false" hasAbstractAttribute="false">
<inheritances classname="Device_Impl" sourcePath=""/>
<identification contact="at elettra.trieste.it - marco.demarco" author="marco.demarco" emailDomain="elettra.trieste.it" classFamily="InputOutput" siteSpecific="" platform="Unix Like" bus="Not Applicable" manufacturer="Galil" reference=""/>
</description>
<deviceProperties name="Driver" mandatory="true" description="Galil device">
<type xsi:type="pogoDsl:StringType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</deviceProperties>
<deviceProperties name="InputBitList" description="">
<type xsi:type="pogoDsl:StringVectorType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</deviceProperties>
<deviceProperties name="OutputBitList" description="">
<type xsi:type="pogoDsl:StringVectorType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</deviceProperties>
<deviceProperties name="CameraResetParam" description="">
<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="Toggle" description="" execMethod="toggle" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false">
<argin description="">
<type xsi:type="pogoDsl:StringType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</commands>
<commands name="Pulse" description="" execMethod="pulse" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false">
<argin description="">
<type xsi:type="pogoDsl:StringType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</commands>
<dynamicCommands name="CameraResetDynCmd" description="esegue pulse(CameraResetParam) se VoidVoidCmdParam esiste." execMethod="camera_reset_dyn_cmd" displayLevel="OPERATOR" polledPeriod="0" isDynamic="true">
<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"/>
</dynamicCommands>
<dynamicAttributes name="ReadBitList" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="true">
<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="" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</dynamicAttributes>
<dynamicAttributes name="ReadWriteBitList" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true" isDynamic="true">
<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="" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</dynamicAttributes>
<states name="INIT" description="">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states>
<states name="FAULT" description="">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states>
<states name="STANDBY" description="">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states>
<preferences docHome="./doc_html" makefileHome="/usr/local/tango-9.2.5a/share/pogo/preferences"/>
</classes>
</pogoDsl:PogoSystem>
/*----- PROTECTED REGION ID(GalildioClass.cpp) ENABLED START -----*/
//=============================================================================
//
// file : GalildioClass.cpp
//
// description : C++ source for the GalildioClass.
// A singleton class derived from DeviceClass.
// It implements the command and attribute list
// and all properties and methods required
// by the Galildio once per process.
//
// project : Galil digital I/O
//
// 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 <GalildioClass.h>
/*----- PROTECTED REGION END -----*/ // GalildioClass.cpp
//-------------------------------------------------------------------
/**
* Create GalildioClass singleton and
* return it in a C function for Python usage
*/
//-------------------------------------------------------------------
extern "C" {
#ifdef _TG_WINDOWS_
__declspec(dllexport)
#endif
Tango::DeviceClass *_create_Galildio_class(const char *name) {
return Galildio_ns::GalildioClass::init(name);
}
}
namespace Galildio_ns
{
//===================================================================
// Initialize pointer for singleton pattern
//===================================================================
GalildioClass *GalildioClass::_instance = NULL;
//--------------------------------------------------------
/**
* method : GalildioClass::GalildioClass(string &s)
* description : constructor for the GalildioClass
*
* @param s The class name
*/
//--------------------------------------------------------
GalildioClass::GalildioClass(string &s):Tango::DeviceClass(s)
{
cout2 << "Entering GalildioClass constructor" << endl;
set_default_property();
write_class_property();
/*----- PROTECTED REGION ID(GalildioClass::constructor) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // GalildioClass::constructor
cout2 << "Leaving GalildioClass constructor" << endl;
}
//--------------------------------------------------------
/**
* method : GalildioClass::~GalildioClass()
* description : destructor for the GalildioClass
*/
//--------------------------------------------------------
GalildioClass::~GalildioClass()
{
/*----- PROTECTED REGION ID(GalildioClass::destructor) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // GalildioClass::destructor
_instance = NULL;
}
//--------------------------------------------------------
/**
* method : GalildioClass::init
* description : Create the object if not already done.
* Otherwise, just return a pointer to the object
*
* @param name The class name
*/
//--------------------------------------------------------
GalildioClass *GalildioClass::init(const char *name)
{
if (_instance == NULL)
{
try
{
string s(name);
_instance = new GalildioClass(s);
}
catch (bad_alloc &)
{
throw;
}
}
return _instance;
}
//--------------------------------------------------------
/**
* method : GalildioClass::instance
* description : Check if object already created,
* and return a pointer to the object
*/
//--------------------------------------------------------
GalildioClass *GalildioClass::instance()
{
if (_instance == NULL)
{
cerr << "Class is not initialised !!" << endl;
exit(-1);
}
return _instance;
}
//===================================================================
// Command execution method calls
//===================================================================
//--------------------------------------------------------
/**
* method : ToggleClass::execute()
* description : method to trigger the execution of the command.
*
* @param device The device on which the command must be executed
* @param in_any The command input data
*
* returns The command output data (packed in the Any object)
*/
//--------------------------------------------------------
CORBA::Any *