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

first git import based on CVS release_09

parent d998b105
No related branches found
No related tags found
No related merge requests found
.pydevproject
.project
.cproject
.settings
obj
bin
core*
*~
*.pyc
*.so
*.so*
.pylintrc
.metadata
.idea
.cvsignore
.nse_depinfo
software
oldsrc
LICENSE 0 → 100644
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
NAME_SRV = vg-srv
CXXFLAGS =
LDFLAGS =
include ../makefiles/Make-9.3.3.in
# Project Name
vg
## Description
Tango device server for Vacuum Gauge
## Installation
See your institue guidelines for deploying and configuring a Tango device server.
## Usage
The server is designed for controlling remotely a a Vacuum Gauge as used in atypical particle accelerator
## History
2019-12-10 : project created on gitlab, derived from CVS release_09
## Credits
Elettra-Sincrotrone Trieste S.C.p.A. di interesse nazionale
Strada Statale 14 - km 163,5 in AREA Science Park
34149 Basovizza, Trieste ITALY
## License
GPL 3
/*----- PROTECTED REGION ID(Vg::ClassFactory.cpp) ENABLED START -----*/
static const char *RcsId = "$Id: ClassFactory.cpp,v 1.2 2012-07-18 09:59:24 mdm Exp $";
//=============================================================================
//
// 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 : Vg.
//
// $Author: mdm $
//
// $Revision: 1.2 $
// $Date: 2012-07-18 09:59:24 $
//
// SVN only:
// $HeadURL: $
//
// CVS only:
// $Source: /home/cvsadm/cvsroot/fermi/servers/vg/src/ClassFactory.cpp,v $
// $Log: ClassFactory.cpp,v $
// Revision 1.2 2012-07-18 09:59:24 mdm
// New version, before test
//
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#include <tango.h>
#include <VgClass.h>
// Add class header files if needed
/**
* Create Vg Class singleton and store it in DServer object.
*/
void Tango::DServer::class_factory()
{
// Add method class init if needed
add_class(Vg_ns::VgClass::init("Vg"));
}
/*----- PROTECTED REGION END -----*/
/*----- PROTECTED REGION ID(Vg.cpp) ENABLED START -----*/
static const char *RcsId = "$Id: Vg.cpp,v 1.10 2016-10-18 16:06:08 claudio Exp $";
//=============================================================================
//
// file : Vg.cpp
//
// description : C++ source for the Vg and its commands.
// The class is derived from Device. It represents the
// CORBA servant object which will be accessed from the
// network. All commands which can be executed on the
// Vg are implemented in this file.
//
// project : Vg.
//
// $Author: claudio $
//
// $Revision: 1.10 $
// $Date: 2016-10-18 16:06:08 $
//
// SVN only:
// $HeadURL: $
//
// CVS only:
// $Source: /home/cvsadm/cvsroot/fermi/servers/vg/src/Vg.cpp,v $
// $Log: Vg.cpp,v $
// Revision 1.10 2016-10-18 16:06:08 claudio
// tango9
//
// Revision 1.9 2013-06-17 10:30:32 lorenzo
// Added DeviceState attribute
//
// Revision 1.8 2013-06-05 15:41:02 lorenzo
// Tango 8.0.5
//
// Revision 1.7 2012-09-10 08:07:44 mdm
// Unregister name fix
//
// Revision 1.6 2012-07-18 09:59:24 mdm
// New version, before test
//
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#include <Vg.h>
#include <VgClass.h>
#include "devicestate.h"
/*----- PROTECTED REGION END -----*/
/**
* Vg class description:
*
*/
//================================================================
//
// The following table gives the correspondence
// between command and method names.
//
// Command name | Method name
//----------------------------------------------------------------
// State | Inherited (no method)
// Status | Inherited (no method)
// On | on
// Off | off
//================================================================
namespace Vg_ns
{
/*----- PROTECTED REGION ID(Vg::namespace_starting) ENABLED START -----*/
// static initializations
/*----- PROTECTED REGION END -----*/ // Vg::namespace_starting
//--------------------------------------------------------
/**
* Method : Vg::Vg()
* Description : Constructors for a Tango device
* implementing the class Vg
*/
//--------------------------------------------------------
Vg::Vg(Tango::DeviceClass *cl, string &s)
: TANGO_BASE_CLASS(cl, s.c_str())
{
/*----- PROTECTED REGION ID(Vg::constructor_1) ENABLED START -----*/
init_device();
/*----- PROTECTED REGION END -----*/ // Vg::constructor_1
}
//--------------------------------------------------------
Vg::Vg(Tango::DeviceClass *cl, const char *s)
: TANGO_BASE_CLASS(cl, s)
{
/*----- PROTECTED REGION ID(Vg::constructor_2) ENABLED START -----*/
init_device();
/*----- PROTECTED REGION END -----*/ // Vg::constructor_2
}
//--------------------------------------------------------
Vg::Vg(Tango::DeviceClass *cl, const char *s, const char *d)
: TANGO_BASE_CLASS(cl, s, d)
{
/*----- PROTECTED REGION ID(Vg::constructor_3) ENABLED START -----*/
init_device();
/*----- PROTECTED REGION END -----*/ // Vg::constructor_3
}
//--------------------------------------------------------
/**
* Method : Vg::delete_device()()
* Description : will be called at device destruction or at init command
*/
//--------------------------------------------------------
void Vg::delete_device()
{
/*----- PROTECTED REGION ID(Vg::delete_device) ENABLED START -----*/
if(init_completed)
{
try
{
unregister_name();
}
catch (Tango::DevFailed &ex)
{
exception_handler(ex, Tango::FAULT, "Vg::delete_device");
}
}
if(tpg_proxy)
{
delete tpg_proxy;
tpg_proxy = 0;
}
/*----- PROTECTED REGION END -----*/ // Vg::delete_device
delete[] attr_Pressure_read;
delete[] attr_DeviceState_read;
}
//--------------------------------------------------------
/**
* Method : Vg::init_device()
* Description : // will be called at device initialization.
*/
//--------------------------------------------------------
void Vg::init_device()
{
DEBUG_STREAM << "Vg::init_device() create device " << device_name << endl;
/*----- PROTECTED REGION ID(Vg::init_device_before) ENABLED START -----*/
set_state(Tango::INIT);
set_status("Device initialization");
tpg_proxy = 0;
init_completed = false;
current_back_off = 1;
last_exception_t = 0;
/*----- PROTECTED REGION END -----*/ // Vg::init_device_before
// Get the device properties (if any) from database
get_device_property();
attr_Pressure_read = new Tango::DevDouble[1];
attr_DeviceState_read = new Tango::DevUChar[1];
/*----- PROTECTED REGION ID(Vg::init_device) ENABLED START -----*/
if(get_state() != Tango::FAULT)
{
try
{
tpg_proxy = new Tango::DeviceProxy(tpgDevice);
tpg_proxy->set_timeout_millis(timeout);
register_name();
init_completed = true;
}
catch (Tango::DevFailed &ex)
{
exception_handler(ex, Tango::FAULT, "Vg::init_device");
}
}
/*----- PROTECTED REGION END -----*/ // Vg::init_device
}
//--------------------------------------------------------
/**
* Method : Vg::get_device_property()
* Description : // Add your own code to initialize
*/
//--------------------------------------------------------
void Vg::get_device_property()
{
/*----- PROTECTED REGION ID(Vg::get_device_property_before) ENABLED START -----*/
// Initialize property data members
/*----- PROTECTED REGION END -----*/ // Vg::get_device_property_before
// Read device properties from database.
Tango::DbData dev_prop;
dev_prop.push_back(Tango::DbDatum("TpgDevice"));
dev_prop.push_back(Tango::DbDatum("Channel"));
dev_prop.push_back(Tango::DbDatum("Timeout"));
dev_prop.push_back(Tango::DbDatum("MaxBackOff"));
// is there at least one property to be read ?
if (dev_prop.size()>0)
{
// Call database and extract values
if (Tango::Util::instance()->_UseDb==true)
get_db_device()->get_property(dev_prop);
// get instance on VgClass to get class property
Tango::DbDatum def_prop, cl_prop;
VgClass *ds_class =
(static_cast<VgClass *>(get_device_class()));
int i = -1;
// Try to initialize TpgDevice from class property
cl_prop = ds_class->get_class_property(dev_prop[++i].name);
if (cl_prop.is_empty()==false) cl_prop >> tpgDevice;
else {
// Try to initialize TpgDevice from default device value
def_prop = ds_class->get_default_device_property(dev_prop[i].name);
if (def_prop.is_empty()==false) def_prop >> tpgDevice;
}
// And try to extract TpgDevice value from database
if (dev_prop[i].is_empty()==false) dev_prop[i] >> tpgDevice;
// Try to initialize Channel from class property
cl_prop = ds_class->get_class_property(dev_prop[++i].name);
if (cl_prop.is_empty()==false) cl_prop >> channel;
else {
// Try to initialize Channel from default device value
def_prop = ds_class->get_default_device_property(dev_prop[i].name);
if (def_prop.is_empty()==false) def_prop >> channel;
}
// And try to extract Channel value from database
if (dev_prop[i].is_empty()==false) dev_prop[i] >> channel;
// Try to initialize Timeout from class property
cl_prop = ds_class->get_class_property(dev_prop[++i].name);
if (cl_prop.is_empty()==false) cl_prop >> timeout;
else {
// Try to initialize Timeout from default device value
def_prop = ds_class->get_default_device_property(dev_prop[i].name);
if (def_prop.is_empty()==false) def_prop >> timeout;
}
// And try to extract Timeout value from database
if (dev_prop[i].is_empty()==false) dev_prop[i] >> timeout;
// Try to initialize MaxBackOff from class property
cl_prop = ds_class->get_class_property(dev_prop[++i].name);
if (cl_prop.is_empty()==false) cl_prop >> maxBackOff;
else {
// Try to initialize MaxBackOff from default device value
def_prop = ds_class->get_default_device_property(dev_prop[i].name);
if (def_prop.is_empty()==false) def_prop >> maxBackOff;
}
// And try to extract MaxBackOff value from database
if (dev_prop[i].is_empty()==false) dev_prop[i] >> maxBackOff;
}
/*----- PROTECTED REGION ID(Vg::get_device_property_after) ENABLED START -----*/
if(dev_prop[0].is_empty())
{
set_state(Tango::FAULT);
set_status("TpgDevice property not defined");
return;
}
if(tpgDevice.empty() || tpgDevice.compare("undefined") == 0)
{
set_state(Tango::FAULT);
set_status("TpgDevice property is empty");
return;
}
if(dev_prop[1].is_empty())
{
set_state(Tango::FAULT);
set_status("Channel property not defined");
return;
}
if(channel == -1)
{
set_state(Tango::FAULT);
set_status("Channel property is empty");
return;
}
if(dev_prop[2].is_empty())
{
WARN_STREAM << "Timeout property not defined, default: " << timeout << endl;
}
if(timeout < 1 || timeout > 10000)
{
set_state(Tango::FAULT);
set_status("Timeout invalid value, valid range [1,10000]");
return;
}
if(dev_prop[3].is_empty())
{
WARN_STREAM << "MaxBackOff property not defined, default: " << maxBackOff << endl;
}
if(maxBackOff < 0 || maxBackOff > 600)
{
set_state(Tango::FAULT);
set_status("MaxBackOff invalid value, valid range [0,600]");
return;
}
/*----- PROTECTED REGION END -----*/ // Vg::get_device_property_after
}
//--------------------------------------------------------
/**
* Method : Vg::always_executed_hook()
* Description : method always executed before any command is executed
*/
//--------------------------------------------------------
void Vg::always_executed_hook()
{
INFO_STREAM << "Vg::always_executed_hook() " << device_name << endl;
/*----- PROTECTED REGION ID(Vg::always_executed_hook) ENABLED START -----*/
if(update_allowed())
{
update_state();
}
/*----- PROTECTED REGION END -----*/ // Vg::always_executed_hook
}
//--------------------------------------------------------
/**
* Method : Vg::read_attr_hardware()
* Description : Hardware acquisition for attributes.
*/
//--------------------------------------------------------
void Vg::read_attr_hardware(vector<long> &attr_list)
{
DEBUG_STREAM << "Vg::read_attr_hardware(vector<long> &attr_list) entering... " << endl;
/*----- PROTECTED REGION ID(Vg::read_attr_hardware) ENABLED START -----*/
// Add your own code
/*----- PROTECTED REGION END -----*/ // Vg::read_attr_hardware
}
//--------------------------------------------------------
/**
* Read Pressure attribute
* Description:
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
//--------------------------------------------------------
void Vg::read_Pressure(Tango::Attribute &attr)
{
DEBUG_STREAM << "Vg::read_Pressure(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(Vg::read_Pressure) ENABLED START -----*/
try
{
stringstream attr_name;
attr_name << "Pressure_" << channel;
tpg_proxy->read_attribute(attr_name.str().c_str()) >> *attr_Pressure_read;
attr.set_value(attr_Pressure_read);
}
catch (Tango::DevFailed &ex)
{
exception_handler(ex, Tango::FAULT, "Vg::read_Pressure");
}
/*----- PROTECTED REGION END -----*/ // Vg::read_Pressure
}
//--------------------------------------------------------
/**
* Read DeviceState attribute
* Description:
*
* Data type: Tango::DevUChar
* Attr type: Scalar
*/
//--------------------------------------------------------
void Vg::read_DeviceState(Tango::Attribute &attr)
{
DEBUG_STREAM << "Vg::read_DeviceState(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(Vg::read_DeviceState) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_DeviceState_read);
/*----- PROTECTED REGION END -----*/ // Vg::read_DeviceState
}
//--------------------------------------------------------
/**
* Write DeviceState attribute values to hardware.
*
* Data type: Tango::DevUChar
* Attr type: Scalar
*/
//--------------------------------------------------------
void Vg::write_DeviceState(Tango::WAttribute &attr)
{
DEBUG_STREAM << "Vg::write_DeviceState(Tango::Attribute &attr) entering... " << endl;
// Retrieve write value
Tango::DevUChar w_val;
attr.get_write_value(w_val);
/*----- PROTECTED REGION ID(Vg::write_DeviceState) ENABLED START -----*/
if (w_val >= DEVICESTATE_T_SIZE) {
Tango::Except::throw_exception("", "Value out of range", \
"Vg::write_DeviceState()");
}
*attr_DeviceState_read = w_val;
/*----- PROTECTED REGION END -----*/ // Vg::write_DeviceState
}
//--------------------------------------------------------
/**
* Method : Vg::VgClass::add_dynamic_attributes()
* Description : Create the dynamic attributes if any
* for specified device.
*/
//--------------------------------------------------------
void Vg::add_dynamic_attributes()
{
/*----- PROTECTED REGION ID(Vg::Class::add_dynamic_attributes) ENABLED START -----*/
// Add your own code to create and add dynamic attributes if any
/*----- PROTECTED REGION END -----*/ // Vg::Class::add_dynamic_attributes
}
//========================================================
// Command execution methods
//========================================================
//--------------------------------------------------------
/**
* Execute the On command:
* Description:
*
* @param argin
* @returns
*/
//--------------------------------------------------------
void Vg::on()
{
DEBUG_STREAM << "Vg::On() - " << device_name << endl;
/*----- PROTECTED REGION ID(Vg::on) ENABLED START -----*/
try
{
Tango::DeviceData dev_data;
dev_data << channel;
tpg_proxy->command_inout("SensorOn", dev_data);
}
catch (Tango::DevFailed &ex)
{
exception_handler(ex, Tango::FAULT, "Vg::on");
}
/*----- PROTECTED REGION END -----*/ // Vg::on
}
//--------------------------------------------------------
/**
* Execute the Off command:
* Description:
*
* @param argin
* @returns
*/
//--------------------------------------------------------
void Vg::off()
{
DEBUG_STREAM << "Vg::Off() - " << device_name << endl;
/*----- PROTECTED REGION ID(Vg::off) ENABLED START -----*/
try
{
Tango::DeviceData dev_data;
dev_data << channel;
tpg_proxy->command_inout("SensorOff", dev_data);
}
catch (Tango::DevFailed &ex)
{
exception_handler(ex, Tango::FAULT, "Vg::off");
}
/*----- PROTECTED REGION END -----*/ // Vg::off
}
/*----- PROTECTED REGION ID(Vg::namespace_ending) ENABLED START -----*/
//========================================================
// Private methods
//========================================================
//+------------------------------------------------------------------
/**
* method: Vg::is_update_state_allowed
*/
//+------------------------------------------------------------------
bool Vg::update_allowed()
{
DEBUG_STREAM << "Vg::update_allowed() - " << device_name << endl;
bool is_allowed = false;
if(init_completed)
{
if(get_state() == Tango::FAULT)
{
time_t now;
time(&now);
double elapsed_t = difftime(now, last_exception_t);
WARN_STREAM << "Back off: " << elapsed_t << "/" << current_back_off << " : " << maxBackOff << endl;
if(elapsed_t >= current_back_off)
{
is_allowed = true;
current_back_off = current_back_off * 2;
if(current_back_off > maxBackOff)
{
current_back_off = maxBackOff;
}
}
}
else
{
current_back_off = 1;
is_allowed = true;
}
}
return is_allowed;
}
//+------------------------------------------------------------------
/**
* method: Vg::update_channel_state
*/
//+------------------------------------------------------------------
void Vg::update_state()
{
DEBUG_STREAM << "Vg::update_state() - " << device_name << endl;
try
{
Tango::DevState old_state = get_state();
stringstream attr_name;
attr_name << "State_" << channel;
Tango::DeviceAttribute dev_attr = tpg_proxy->read_attribute(attr_name.str().c_str());
Tango::DevState new_state;
dev_attr >> new_state;
if(old_state == Tango::FAULT &&
new_state != Tango::FAULT)
register_name();
set_state(new_state);
attr_name.str("");
attr_name << "Status_" << channel;
dev_attr = tpg_proxy->read_attribute(attr_name.str().c_str());
string new_status;
dev_attr >> new_status;
set_status(new_status);
}
catch (Tango::DevFailed &ex)
{
exception_handler(ex, Tango::FAULT, "Vg::update_state");
}
}
//+------------------------------------------------------------------
/**
* method: Vg::register_name
*/
//+------------------------------------------------------------------
void Vg::register_name() throw(Tango::DevFailed)
{
INFO_STREAM << "Vg::register_name(" << device_name << ","
<< channel << ") - " << device_name << endl;
Tango::DevVarLongStringArray* array = new Tango::DevVarLongStringArray();
array->lvalue.length(1);
array->lvalue[0] = channel;
array->svalue.length(1);
array->svalue[0] = CORBA::string_dup(device_name.c_str());
Tango::DeviceData dev_data;
dev_data << array;
tpg_proxy->command_inout("RegisterName", dev_data);
}
//+------------------------------------------------------------------
/**
* method: Vg::unregister_name
*/
//+------------------------------------------------------------------
void Vg::unregister_name() throw(Tango::DevFailed)
{
INFO_STREAM << "Vg::unregister_name(" << device_name << ","
<< channel << ") - " << device_name << endl;
Tango::DeviceData dev_data;
dev_data << channel;
tpg_proxy->command_inout("UnregisterName", dev_data);
}
//+------------------------------------------------------------------
/**
* method: Vg::exception_handler
*/
//+------------------------------------------------------------------
void Vg::exception_handler(Tango::DevFailed &ex, Tango::DevState new_state, const std::string base_msg)
{
time(&last_exception_t);
std::stringstream msg;
msg << base_msg << " : ";
for (unsigned int i=0; i<ex.errors.length(); i++)
{
msg << ex.errors[i].reason.in() << endl;
msg << ex.errors[i].desc.in() << endl;
msg << ex.errors[i].origin.in() << endl;
}
msg << ends;
ERROR_STREAM << msg.str() << endl;
set_state(new_state);
set_status(msg.str());
}
// //--------------------------------------------------------
// /**
// * Read DeviceStatus attribute
// * Description:
// *
// * Data type: Tango::DevString
// * Attr type: Scalar
// */
// //--------------------------------------------------------
// void Vg::read_DeviceStatus(Tango::Attribute &attr)
// {
// DEBUG_STREAM << "Vg::read_DeviceStatus(Tango::Attribute &attr) entering... " << endl;
// // Set the attribute value
// attr.set_value(attr_DeviceStatus_read);
// }
/*----- PROTECTED REGION END -----*/ // Vg::namespace_ending
} // namespace
src/Vg.h 0 → 100644
/*----- PROTECTED REGION ID(Vg.h) ENABLED START -----*/
//=============================================================================
//
// file : Vg.h
//
// description : Include for the Vg class.
//
// project : Vg.
//
// $Author: claudio $
//
// $Revision: 1.8 $
// $Date: 2016-10-18 16:06:08 $
//
// SVN only:
// $HeadURL: $
//
// CVS only:
// $Source: /home/cvsadm/cvsroot/fermi/servers/vg/src/Vg.h,v $
// $Log: Vg.h,v $
// Revision 1.8 2016-10-18 16:06:08 claudio
// tango9
//
// Revision 1.7 2013-06-17 10:30:32 lorenzo
// Added DeviceState attribute
//
// Revision 1.6 2013-06-05 15:41:02 lorenzo
// Tango 8.0.5
//
// Revision 1.5 2012-07-18 09:59:24 mdm
// New version, before test
//
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#ifndef VG_H
#define VG_H
#include <tango.h>
/*----- PROTECTED REGION END -----*/
/**
* Vg class Description:
*
*/
namespace Vg_ns
{
/*----- PROTECTED REGION ID(Vg::Additional Class Declarations) ENABLED START -----*/
// Additional Class Declarations
/*----- PROTECTED REGION END -----*/ // Vg::Additional Class Declarations
class Vg : public TANGO_BASE_CLASS
{
/*----- PROTECTED REGION ID(Vg::Data Members) ENABLED START -----*/
static const size_t STRING_SIZE = 1024;
Tango::DeviceProxy *tpg_proxy;
bool init_completed;
double current_back_off;
time_t last_exception_t;
/*----- PROTECTED REGION END -----*/ // Vg::Data Members
// Device property data members
public: // TpgDevice:
string tpgDevice;
// Channel:
Tango::DevShort channel;
// Timeout:
Tango::DevLong timeout;
// MaxBackOff:
Tango::DevLong maxBackOff;
// Attribute data members
public:
Tango::DevDouble *attr_Pressure_read;
Tango::DevUChar *attr_DeviceState_read;
// Constructors and destructors
public:
/**
* Constructs a newly allocated Command object.
*
* @param cl Class.
* @param s Device Name
*/
Vg(Tango::DeviceClass *cl,string &s);
/**
* Constructs a newly allocated Command object.
*
* @param cl Class.
* @param s Device Name
*/
Vg(Tango::DeviceClass *cl,const char *s);
/**
* Constructs a newly allocated Command object.
*
* @param cl Class.
* @param s Device name
* @param d Device description.
*/
Vg(Tango::DeviceClass *cl,const char *s,const char *d);
/**
* The object destructor.
*/
~Vg() {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();
// Attribute methods
public:
/**
* Method : Vg::read_attr_hardware()
* Description : Hardware acquisition for attributes.
*/
virtual void read_attr_hardware(vector<long> &attr_list);
/**
* Pressure attribute related methods.
* Description:
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
virtual void read_Pressure(Tango::Attribute &attr);
virtual bool is_Pressure_allowed(Tango::AttReqType type);
/**
* DeviceState attribute related methods.
* Description:
*
* Data type: Tango::DevUChar
* Attr type: Scalar
*/
virtual void read_DeviceState(Tango::Attribute &attr);
virtual void write_DeviceState(Tango::WAttribute &attr);
virtual bool is_DeviceState_allowed(Tango::AttReqType type);
/**
* Method : Vg::add_dynamic_attributes()
* Description : Add dynamic attributes if any.
*/
void add_dynamic_attributes();
// Command related methods
public:
/**
* Command On related methods.
*/
void on();
virtual bool is_On_allowed(const CORBA::Any &any);
/**
* Command Off related methods.
*/
void off();
virtual bool is_Off_allowed(const CORBA::Any &any);
/*----- PROTECTED REGION ID(Vg::Additional Method prototypes) ENABLED START -----*/
bool update_allowed();
void update_state();
void register_name() throw(Tango::DevFailed);
void unregister_name() throw(Tango::DevFailed);
void exception_handler(Tango::DevFailed &, Tango::DevState, const std::string);
/*----- PROTECTED REGION END -----*/ // Vg::Additional Method prototypes
};
/*----- PROTECTED REGION ID(Vg::Additional Classes Definitions) ENABLED START -----*/
// Additional Classes definitions
/*----- PROTECTED REGION END -----*/ // Vg::Additional Classes Definitions
} // namespace
#endif // VG_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="Vg">
<description description="" title="Vg" sourcePath="/home/lorenzo/src/a/fermi/servers/vg/src" language="Cpp" filestogenerate="XMI file,Code files" 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="Vacuum" siteSpecific="" platform="Unix Like" bus="TCP/UDP" manufacturer="none" reference=""/>
<comments commandsTable="//================================================================&#xA;//&#xA;// The following table gives the correspondence&#xA;// between command and method names.&#xA;//&#xA;// Command name | Method name&#xA;//----------------------------------------------------------------&#xA;// State | Inherited (no method)&#xA;// Status | Inherited (no method)&#xA;// On | on&#xA;// Off | off&#xA;//================================================================"/>
</description>
<deviceProperties name="TpgDevice" description="">
<type xsi:type="pogoDsl:StringType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<DefaultPropValue>undefined</DefaultPropValue>
</deviceProperties>
<deviceProperties name="Channel" description="">
<type xsi:type="pogoDsl:ShortType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<DefaultPropValue>-1</DefaultPropValue>
</deviceProperties>
<deviceProperties name="Timeout" description="">
<type xsi:type="pogoDsl:IntType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<DefaultPropValue>3000</DefaultPropValue>
</deviceProperties>
<deviceProperties name="MaxBackOff" description="">
<type xsi:type="pogoDsl:IntType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<DefaultPropValue>60</DefaultPropValue>
</deviceProperties>
<commands name="State" description="This command gets the device state (stored in its device_state data member) and returns it to the caller." execMethod="dev_state" displayLevel="OPERATOR">
<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">
<argin description="none">
<type xsi:type="pogoDsl:VoidType"/>
</argin>
<argout description="Device status">
<type xsi:type="pogoDsl:ConstStringType"/>
</argout>
<status abstract="true" inherited="true" concrete="true"/>
</commands>
<commands name="On" description="" execMethod="on" displayLevel="EXPERT">
<argin description="">
<type xsi:type="pogoDsl:VoidType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<excludedStates>ON</excludedStates>
<excludedStates>DISABLE</excludedStates>
<excludedStates>FAULT</excludedStates>
</commands>
<commands name="Off" description="" execMethod="off" displayLevel="EXPERT">
<argin description="">
<type xsi:type="pogoDsl:VoidType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<excludedStates>OFF</excludedStates>
<excludedStates>DISABLE</excludedStates>
<excludedStates>FAULT</excludedStates>
</commands>
<attributes name="Pressure" attType="Scalar" rwType="READ" displayLevel="OPERATOR" maxX="" maxY="" allocReadMember="true">
<dataType xsi:type="pogoDsl:DoubleType"/>
<changeEvent fire="false" libCheckCriteria="true"/>
<archiveEvent fire="false" libCheckCriteria="true"/>
<dataReadyEvent fire="false" libCheckCriteria="true"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="" label="" unit="mbar" standardUnit="mbar" displayUnit="mbar" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
<readExcludedStates>OFF</readExcludedStates>
<readExcludedStates>DISABLE</readExcludedStates>
<readExcludedStates>FAULT</readExcludedStates>
</attributes>
<attributes name="DeviceState" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" maxX="" maxY="" memorized="true" allocReadMember="true">
<dataType xsi:type="pogoDsl:UCharType"/>
<changeEvent fire="false" libCheckCriteria="true"/>
<archiveEvent fire="false" libCheckCriteria="true"/>
<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=""/>
</attributes>
<states name="ON" description="">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states>
<states name="OFF" description="">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states>
<states name="ALARM" description="">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states>
<states name="DISABLE" 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>
<preferences docHome="./doc_html" makefileHome="/usr/local/tango-7.2.6/share/pogo/preferences"/>
</classes>
</pogoDsl:PogoSystem>
This diff is collapsed.
/*----- PROTECTED REGION ID(VgClass.h) ENABLED START -----*/
//=============================================================================
//
// file : VgClass.h
//
// description : Include for the VgClass root class.
// This class is the singleton class for.
// the Vg device class..
// It contains all properties and methods which the .
// Vg requires only once e.g. the commands.
//
// project : Vg.
//
// $Author: lorenzo $
//
// $Revision: 1.6 $
// $Date: 2013-06-17 10:30:33 $
//
// SVN only:
// $HeadURL: $
//
// CVS only:
// $Source: /home/cvsadm/cvsroot/fermi/servers/vg/src/VgClass.h,v $
// $Log: VgClass.h,v $
// Revision 1.6 2013-06-17 10:30:33 lorenzo
// Added DeviceState attribute
//
// Revision 1.5 2013-06-05 15:41:02 lorenzo
// Tango 8.0.5
//
// Revision 1.4 2012-07-18 09:59:24 mdm
// New version, before test
//
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#ifndef VGCLASS_H
#define VGCLASS_H
#include <tango.h>
#include <Vg.h>
/*----- PROTECTED REGION END -----*/
namespace Vg_ns
{
/*----- PROTECTED REGION ID(Vg::classes for dynamic creation) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // Vg::classes for dynamic creation
//=========================================
// Define classes for attributes
//=========================================
// Attribute Pressure class definition
class PressureAttrib: public Tango::Attr
{
public:
PressureAttrib():Attr("Pressure",
Tango::DEV_DOUBLE, Tango::READ) {};
~PressureAttrib() {};
virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att)
{(static_cast<Vg *>(dev))->read_Pressure(att);}
virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty)
{return (static_cast<Vg *>(dev))->is_Pressure_allowed(ty);}
};
// Attribute DeviceState class definition
class DeviceStateAttrib: public Tango::Attr
{
public:
DeviceStateAttrib():Attr("DeviceState",
Tango::DEV_UCHAR, Tango::READ_WRITE) {};
~DeviceStateAttrib() {};
virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att)
{(static_cast<Vg *>(dev))->read_DeviceState(att);}
virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att)
{(static_cast<Vg *>(dev))->write_DeviceState(att);}
virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty)
{return (static_cast<Vg *>(dev))->is_DeviceState_allowed(ty);}
};
//=========================================
// Define classes for commands
//=========================================
// Command On class definition
class OnClass : public Tango::Command
{
public:
OnClass(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out,
const char *in_desc,
const char *out_desc,
Tango::DispLevel level)
:Command(name,in,out,in_desc,out_desc, level) {};
OnClass(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(name,in,out) {};
~OnClass() {};
virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any);
virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any)
{return (static_cast<Vg *>(dev))->is_On_allowed(any);}
};
// Command Off class definition
class OffClass : public Tango::Command
{
public:
OffClass(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out,
const char *in_desc,
const char *out_desc,
Tango::DispLevel level)
:Command(name,in,out,in_desc,out_desc, level) {};
OffClass(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(name,in,out) {};
~OffClass() {};
virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any);
virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any)
{return (static_cast<Vg *>(dev))->is_Off_allowed(any);}
};
/**
* The TemplateDevServClass singleton definition
*/
class
#ifdef _TG_WINDOWS_
__declspec(dllexport)
#endif
VgClass : public Tango::DeviceClass
{
/*----- PROTECTED REGION ID(Vg::Additionnal DServer data members) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // Vg::Additionnal DServer data members
public:
// write class properties data members
Tango::DbData cl_prop;
Tango::DbData cl_def_prop;
Tango::DbData dev_def_prop;
// Method prototypes
static VgClass *init(const char *);
static VgClass *instance();
~VgClass();
Tango::DbDatum get_class_property(string &);
Tango::DbDatum get_default_device_property(string &);
Tango::DbDatum get_default_class_property(string &);
protected:
VgClass(string &);
static VgClass *_instance;
void command_factory();
void attribute_factory(vector<Tango::Attr *> &);
void write_class_property();
void set_default_property();
void get_class_property();
string get_cvstag();
string get_cvsroot();
private:
void device_factory(const Tango::DevVarStringArray *);
void create_static_attribute_list(vector<Tango::Attr *> &);
void erase_dynamic_attributes(const Tango::DevVarStringArray *,vector<Tango::Attr *> &);
vector<string> defaultAttList;
};
} // namespace
#endif // VGCLASS_H
/*----- PROTECTED REGION ID(VgStateMachine.cpp) ENABLED START -----*/
static const char *RcsId = "$Id: VgStateMachine.cpp,v 1.6 2013-06-17 10:30:33 lorenzo Exp $";
//=============================================================================
//
// file : VgStateMachine.cpp
//
// description : C++ source for the «name» and its alowed
// methods for commands and attributes
//
// project : Vg.
//
// $Author: lorenzo $
//
// $Revision: 1.6 $
// $Date: 2013-06-17 10:30:33 $
//
// SVN only:
// $HeadURL: $
//
// CVS only:
// $Source: /home/cvsadm/cvsroot/fermi/servers/vg/src/VgStateMachine.cpp,v $
// $Log: VgStateMachine.cpp,v $
// Revision 1.6 2013-06-17 10:30:33 lorenzo
// Added DeviceState attribute
//
// Revision 1.5 2013-06-05 15:41:02 lorenzo
// Tango 8.0.5
//
// Revision 1.4 2012-07-18 09:59:24 mdm
// New version, before test
//
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#include <Vg.h>
#include <VgClass.h>
/*----- PROTECTED REGION END -----*/
/*
* Vg states description:
*
* ON :
* OFF :
* ALARM :
* DISABLE :
* FAULT :
*/
namespace Vg_ns
{
//=================================================
// Attributes Allowed Methods
//=================================================
//--------------------------------------------------------
/**
* Method : Vg::is_PressureState_allowed()
* Description : Execution allowed for Pressure attribute.
*/
//--------------------------------------------------------
bool Vg::is_Pressure_allowed(Tango::AttReqType type)
{
if ( // Compare device state with not allowed states for READ
get_state() == Tango::OFF ||
get_state() == Tango::DISABLE ||
get_state() == Tango::FAULT)
{
/*----- PROTECTED REGION ID(Vg::read_PressureStateAllowed_READ) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // Vg::read_PressureStateAllowed_READ
return false;
}
return true;
}
//--------------------------------------------------------
/**
* Method : Vg::is_DeviceStateState_allowed()
* Description : Execution allowed for DeviceState attribute.
*/
//--------------------------------------------------------
bool Vg::is_DeviceState_allowed(Tango::AttReqType type)
{
// Check if access type.
if ( type!=Tango::READ_REQ )
{
// Not any excluded states for DeviceState attribute in WRITE access.
/*----- PROTECTED REGION ID(Vg::DeviceStateStateAllowed_WRITE) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // Vg::DeviceStateStateAllowed_WRITE
return true;
}
else
// Not any excluded states for DeviceState attribute in READ access.
/*----- PROTECTED REGION ID(Vg::read_DeviceStateStateAllowed_READ) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // Vg::read_DeviceStateStateAllowed_READ
return true;
}
/*----- PROTECTED REGION ID(Vg::are_dynamic_attributes_allowed) ENABLED START -----*/
// Add your code to check if dynamic attributes are alowed
/*----- PROTECTED REGION END -----*/ // Vg::are_dynamic_attributes_allowed
//=================================================
// Commands Allowed Methods
//=================================================
//--------------------------------------------------------
/**
* Method : Vg::is_OnState_allowed()
* Description : Execution allowed for On command.
*/
//--------------------------------------------------------
bool Vg::is_On_allowed(const CORBA::Any &any)
{
if ( // Compare device state with not allowed states for command
get_state() == Tango::ON ||
get_state() == Tango::DISABLE ||
get_state() == Tango::FAULT)
{
/*----- PROTECTED REGION ID(Vg::OnStateAllowed) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // Vg::OnStateAllowed
return false;
}
return true;
}
//--------------------------------------------------------
/**
* Method : Vg::is_OffState_allowed()
* Description : Execution allowed for Off command.
*/
//--------------------------------------------------------
bool Vg::is_Off_allowed(const CORBA::Any &any)
{
if ( // Compare device state with not allowed states for command
get_state() == Tango::OFF ||
get_state() == Tango::DISABLE ||
get_state() == Tango::FAULT)
{
/*----- PROTECTED REGION ID(Vg::OffStateAllowed) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // Vg::OffStateAllowed
return false;
}
return true;
}
/*----- PROTECTED REGION ID(Vg::are_dynamic_commands_allowed) ENABLED START -----*/
// Add your code to check if dynamic commands are alowed
/*----- PROTECTED REGION END -----*/ // Vg::are_dynamic_commands_allowed
} // namespace Vg_ns
/*
* devicestate.h
*
* LP - 2013.01.03
*/
#ifndef DEVICESTATE_H
#define DEVICESTATE_H
typedef enum {
UNKNOWN,
ONLINE,
OFFLINE,
SERVICE,
TEST,
DEVICESTATE_T_SIZE
} devicestate_t;
#endif /* DEVICESTATE_H */
/* EOF */
/*PROTECTED REGION ID(Vg::main.cpp) ENABLED START*/
static const char *RcsId = "$Id: main.cpp,v 1.2 2012-07-18 09:59:24 mdm Exp $";
//=============================================================================
//
// file : Vg.cpp
//
// description : C++ source for the Vg 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 : Vg.
//
// $Author: mdm $
//
// $Revision: 1.2 $
// $Date: 2012-07-18 09:59:24 $
//
// SVN only:
// $HeadURL: $
//
// CVS only:
// $Source: /home/cvsadm/cvsroot/fermi/servers/vg/src/main.cpp,v $
// $Log: main.cpp,v $
// Revision 1.2 2012-07-18 09:59:24 mdm
// New version, before test
//
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#include <tango.h>
int main(int argc,char *argv[])
{
Tango::Util *tg = NULL;
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
//----------------------------------------
cout << "Ready to accept request" << endl;
tg->server_run();
}
catch (bad_alloc)
{
cout << "Can't allocate memory to store device object !!!" << endl;
cout << "Exiting" << endl;
}
catch (CORBA::Exception &e)
{
Tango::Except::print_exception(e);
cout << "Received a CORBA_Exception" << endl;
cout << "Exiting" << endl;
}
if (tg!=NULL)
tg->server_cleanup();
return(0);
}
/*PROTECTED REGION END*/
//========================================================
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