Commit 1a061fe1 authored by Yuelong Yu's avatar Yuelong Yu
Browse files

remove wrong commit

parent a46f45a3
/*----- PROTECTED REGION ID(AGIPDMC.cpp) ENABLED START -----*/
static const char *RcsId = "$Id: $";
//=============================================================================
//
// file : AGIPDMC.cpp
//
// description : C++ source for the AGIPDMC class 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
// AGIPDMC are implemented in this file.
//
// project : AGIPDMC
//
// 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: $
//
// $Revision: $
// $Date: $
//
// $HeadURL: $
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#include <AGIPDMC.h>
#include <AGIPDMCClass.h>
/*----- PROTECTED REGION END -----*/ // AGIPDMC.cpp
/**
* AGIPDMC class description:
* A tango server used to communicate with AGIPD microcontroller. One TINE server
* is running on microcontroller. TTTGW tango server is used to communicate with the
* TINE server. This tango server communicates with TTTGW tango server and read out
* related data returned by TTTGW tango server.
*/
//================================================================
// The following table gives the correspondence
// between command and method names.
//
// Command name | Method name
//================================================================
// State | dev_state
// Status | dev_status
// Start | start
// Stop | stop
//================================================================
//================================================================
// Attributes managed is:
//================================================================
// RawMatrix | Tango::DevShort Spectrum ( max = 6000)
//================================================================
namespace AGIPDMC_ns
{
/*----- PROTECTED REGION ID(AGIPDMC::namespace_starting) ENABLED START -----*/
// static initializations
/*----- PROTECTED REGION END -----*/ // AGIPDMC::namespace_starting
//--------------------------------------------------------
/**
* Method : AGIPDMC::AGIPDMC()
* Description : Constructors for a Tango device
* implementing the classAGIPDMC
*/
//--------------------------------------------------------
AGIPDMC::AGIPDMC(Tango::DeviceClass *cl, string &s)
: TANGO_BASE_CLASS(cl, s.c_str())
{
/*----- PROTECTED REGION ID(AGIPDMC::constructor_1) ENABLED START -----*/
init_device();
/*----- PROTECTED REGION END -----*/ // AGIPDMC::constructor_1
}
//--------------------------------------------------------
AGIPDMC::AGIPDMC(Tango::DeviceClass *cl, const char *s)
: TANGO_BASE_CLASS(cl, s)
{
/*----- PROTECTED REGION ID(AGIPDMC::constructor_2) ENABLED START -----*/
init_device();
/*----- PROTECTED REGION END -----*/ // AGIPDMC::constructor_2
}
//--------------------------------------------------------
AGIPDMC::AGIPDMC(Tango::DeviceClass *cl, const char *s, const char *d)
: TANGO_BASE_CLASS(cl, s, d)
{
/*----- PROTECTED REGION ID(AGIPDMC::constructor_3) ENABLED START -----*/
init_device();
/*----- PROTECTED REGION END -----*/ // AGIPDMC::constructor_3
}
//--------------------------------------------------------
/**
* Method : AGIPDMC::delete_device()
* Description : will be called at device destruction or at init command
*/
//--------------------------------------------------------
void AGIPDMC::delete_device()
{
DEBUG_STREAM << "AGIPDMC::delete_device() " << device_name << endl;
/*----- PROTECTED REGION ID(AGIPDMC::delete_device) ENABLED START -----*/
// Delete device allocated objects
/*----- PROTECTED REGION END -----*/ // AGIPDMC::delete_device
delete[] attr_RawMatrix_read;
}
//--------------------------------------------------------
/**
* Method : AGIPDMC::init_device()
* Description : will be called at device initialization.
*/
//--------------------------------------------------------
void AGIPDMC::init_device()
{
DEBUG_STREAM << "AGIPDMC::init_device() create device " << device_name << endl;
/*----- PROTECTED REGION ID(AGIPDMC::init_device_before) ENABLED START -----*/
// Initialization before get_device_property() call
/*----- PROTECTED REGION END -----*/ // AGIPDMC::init_device_before
// Get the device properties from database
get_device_property();
attr_RawMatrix_read = new Tango::DevShort[6000];
/*----- PROTECTED REGION ID(AGIPDMC::init_device) ENABLED START -----*/
// Initialize device
/*----- PROTECTED REGION END -----*/ // AGIPDMC::init_device
}
//--------------------------------------------------------
/**
* Method : AGIPDMC::get_device_property()
* Description : Read database to initialize property data members.
*/
//--------------------------------------------------------
void AGIPDMC::get_device_property()
{
/*----- PROTECTED REGION ID(AGIPDMC::get_device_property_before) ENABLED START -----*/
// Initialize property data members
/*----- PROTECTED REGION END -----*/ // AGIPDMC::get_device_property_before
// Read device properties from database.
Tango::DbData dev_prop;
dev_prop.push_back(Tango::DbDatum("TTTGWDeviceName"));
// 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 AGIPDMCClass to get class property
Tango::DbDatum def_prop, cl_prop;
AGIPDMCClass *ds_class =
(static_cast<AGIPDMCClass *>(get_device_class()));
int i = -1;
// Try to initialize TTTGWDeviceName from class property
cl_prop = ds_class->get_class_property(dev_prop[++i].name);
if (cl_prop.is_empty()==false) cl_prop >> tTTGWDeviceName;
else {
// Try to initialize TTTGWDeviceName from default device value
def_prop = ds_class->get_default_device_property(dev_prop[i].name);
if (def_prop.is_empty()==false) def_prop >> tTTGWDeviceName;
}
// And try to extract TTTGWDeviceName value from database
if (dev_prop[i].is_empty()==false) dev_prop[i] >> tTTGWDeviceName;
}
/*----- PROTECTED REGION ID(AGIPDMC::get_device_property_after) ENABLED START -----*/
// Check device property data members init
/*----- PROTECTED REGION END -----*/ // AGIPDMC::get_device_property_after
}
//--------------------------------------------------------
/**
* Method : AGIPDMC::always_executed_hook()
* Description : method always executed before any command is executed
*/
//--------------------------------------------------------
void AGIPDMC::always_executed_hook()
{
INFO_STREAM << "AGIPDMC::always_executed_hook() " << device_name << endl;
/*----- PROTECTED REGION ID(AGIPDMC::always_executed_hook) ENABLED START -----*/
// code always executed before all requests
/*----- PROTECTED REGION END -----*/ // AGIPDMC::always_executed_hook
}
//--------------------------------------------------------
/**
* Method : AGIPDMC::read_attr_hardware()
* Description : Hardware acquisition for attributes
*/
//--------------------------------------------------------
void AGIPDMC::read_attr_hardware(TANGO_UNUSED(vector<long> &attr_list))
{
DEBUG_STREAM << "AGIPDMC::read_attr_hardware(vector<long> &attr_list) entering... " << endl;
/*----- PROTECTED REGION ID(AGIPDMC::read_attr_hardware) ENABLED START -----*/
// Add your own code
/*----- PROTECTED REGION END -----*/ // AGIPDMC::read_attr_hardware
}
//--------------------------------------------------------
/**
* Read attribute RawMatrix related method
* Description:
*
* Data type: Tango::DevShort
* Attr type: Spectrum max = 6000
*/
//--------------------------------------------------------
void AGIPDMC::read_RawMatrix(Tango::Attribute &attr)
{
DEBUG_STREAM << "AGIPDMC::read_RawMatrix(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(AGIPDMC::read_RawMatrix) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_Matrix_read, 6000);
/*----- PROTECTED REGION END -----*/ // AGIPDMC::read_RawMatrix
}
//--------------------------------------------------------
/**
* Method : AGIPDMC::add_dynamic_attributes()
* Description : Create the dynamic attributes if any
* for specified device.
*/
//--------------------------------------------------------
void AGIPDMC::add_dynamic_attributes()
{
/*----- PROTECTED REGION ID(AGIPDMC::add_dynamic_attributes) ENABLED START -----*/
// Add your own code to create and add dynamic attributes if any
/*----- PROTECTED REGION END -----*/ // AGIPDMC::add_dynamic_attributes
}
//--------------------------------------------------------
/**
* Command State related method
* Description: This command gets the device state (stored in its device_state data member) and returns it to the caller.
*
* @returns Device state
*/
//--------------------------------------------------------
Tango::DevState AGIPDMC::dev_state()
{
DEBUG_STREAM << "AGIPDMC::State() - " << device_name << endl;
/*----- PROTECTED REGION ID(AGIPDMC::dev_state) ENABLED START -----*/
Tango::DevState argout = Tango::UNKNOWN; // replace by your own algorithm
// Add your own code
/*----- PROTECTED REGION END -----*/ // AGIPDMC::dev_state
set_state(argout); // Give the state to Tango.
if (argout!=Tango::ALARM)
DeviceImpl::dev_state();
return get_state(); // Return it after Tango management.
}
//--------------------------------------------------------
/**
* Command Status related method
* Description: This command gets the device status (stored in its device_status data member) and returns it to the caller.
*
* @returns Device status
*/
//--------------------------------------------------------
Tango::ConstDevString AGIPDMC::dev_status()
{
DEBUG_STREAM << "AGIPDMC::Status() - " << device_name << endl;
/*----- PROTECTED REGION ID(AGIPDMC::dev_status) ENABLED START -----*/
string status = "Device is OK";
// Add your own code
/*----- PROTECTED REGION END -----*/ // AGIPDMC::dev_status
set_status(status); // Give the status to Tango.
return DeviceImpl::dev_status(); // Return it.
}
//--------------------------------------------------------
/**
* Command Start related method
* Description: start update the data returned by TTTGW tango server
*
*/
//--------------------------------------------------------
void AGIPDMC::start()
{
DEBUG_STREAM << "AGIPDMC::Start() - " << device_name << endl;
/*----- PROTECTED REGION ID(AGIPDMC::start) ENABLED START -----*/
// Add your own code
/*----- PROTECTED REGION END -----*/ // AGIPDMC::start
}
//--------------------------------------------------------
/**
* Command Stop related method
* Description: stop update the data returned by TTTGW tango server
*
*/
//--------------------------------------------------------
void AGIPDMC::stop()
{
DEBUG_STREAM << "AGIPDMC::Stop() - " << device_name << endl;
/*----- PROTECTED REGION ID(AGIPDMC::stop) ENABLED START -----*/
// Add your own code
/*----- PROTECTED REGION END -----*/ // AGIPDMC::stop
}
/*----- PROTECTED REGION ID(AGIPDMC::namespace_ending) ENABLED START -----*/
// Additional Methods
/*----- PROTECTED REGION END -----*/ // AGIPDMC::namespace_ending
} // namespace
/*----- PROTECTED REGION ID(AGIPDMC.h) ENABLED START -----*/
//=============================================================================
//
// file : AGIPDMC.h
//
// description : Include file for the AGIPDMC class
//
// project : AGIPDMC
//
// 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: $
//
// $Revision: $
// $Date: $
//
// $HeadURL: $
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#ifndef AGIPDMC_H
#define AGIPDMC_H
#include <tango.h>
/*----- PROTECTED REGION END -----*/ // AGIPDMC.h
/**
* AGIPDMC class description:
* A tango server used to communicate with AGIPD microcontroller. One TINE server
* is running on microcontroller. TTTGW tango server is used to communicate with the
* TINE server. This tango server communicates with TTTGW tango server and read out
* related data returned by TTTGW tango server.
*/
namespace AGIPDMC_ns
{
/*----- PROTECTED REGION ID(AGIPDMC::Additional Class Declarations) ENABLED START -----*/
// Additional Class Declarations
/*----- PROTECTED REGION END -----*/ // AGIPDMC::Additional Class Declarations
class AGIPDMC : public TANGO_BASE_CLASS
{
/*----- PROTECTED REGION ID(AGIPDMC::Data Members) ENABLED START -----*/
// Add your own data members
/*----- PROTECTED REGION END -----*/ // AGIPDMC::Data Members
// Device property data members
public:
// TTTGWDeviceName:
string tTTGWDeviceName;
// Attribute data members
public:
Tango::DevShort *attr_RawMatrix_read;
// Constructors and destructors
public:
/**
* Constructs a newly device object.
*
* @param cl Class.
* @param s Device Name
*/
AGIPDMC(Tango::DeviceClass *cl,string &s);
/**
* Constructs a newly device object.
*
* @param cl Class.
* @param s Device Name
*/
AGIPDMC(Tango::DeviceClass *cl,const char *s);
/**
* Constructs a newly device object.
*
* @param cl Class.
* @param s Device name
* @param d Device description.
*/
AGIPDMC(Tango::DeviceClass *cl,const char *s,const char *d);
/**
* The device object destructor.
*/
~AGIPDMC() {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 : AGIPDMC::read_attr_hardware()
* Description : Hardware acquisition for attributes.
*/
//--------------------------------------------------------
virtual void read_attr_hardware(vector<long> &attr_list);
/**
* Attribute RawMatrix related methods
* Description:
*
* Data type: Tango::DevShort
* Attr type: Spectrum max = 6000
*/
virtual void read_RawMatrix(Tango::Attribute &attr);
virtual bool is_RawMatrix_allowed(Tango::AttReqType type);
//--------------------------------------------------------
/**
* Method : AGIPDMC::add_dynamic_attributes()
* Description : Add dynamic attributes if any.
*/
//--------------------------------------------------------
void add_dynamic_attributes();
// Command related methods
public:
/**
* Command State related method
* Description: This command gets the device state (stored in its device_state data member) and returns it to the caller.
*
* @returns Device state
*/
virtual Tango::DevState dev_state();
/**
* Command Status related method
* Description: This command gets the device status (stored in its device_status data member) and returns it to the caller.
*
* @returns Device status
*/
virtual Tango::ConstDevString dev_status();
/**
* Command Start related method
* Description: start update the data returned by TTTGW tango server
*
*/
virtual void start();
virtual bool is_Start_allowed(const CORBA::Any &any);
/**
* Command Stop related method
* Description: stop update the data returned by TTTGW tango server
*
*/
virtual void stop();
virtual bool is_Stop_allowed(const CORBA::Any &any);
/*----- PROTECTED REGION ID(AGIPDMC::Additional Method prototypes) ENABLED START -----*/
// Additional Method prototypes
/*----- PROTECTED REGION END -----*/ // AGIPDMC::Additional Method prototypes
};
/*----- PROTECTED REGION ID(AGIPDMC::Additional Classes Definitions) ENABLED START -----*/
// Additional Classes Definitions
/*----- PROTECTED REGION END -----*/ // AGIPDMC::Additional Classes Definitions
} // End of namespace
#endif // AGIPDMC_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="AGIPDMC" pogoRevision="8.1">
<description description="A tango server used to communicate with AGIPD microcontroller. One TINE server&#xA;is running on microcontroller. TTTGW tango server is used to communicate with the&#xA;TINE server. This tango server communicates with TTTGW tango server and read out&#xA;related data returned by TTTGW tango server." title="AGIPDMC" sourcePath="/home/yuelong/src/gitrepo/detsoftware/tango/agipdmc" language="Cpp" filestogenerate="XMI file,Code files,Makefile,html Pages" license="GPL" hasMandatoryProperty="false" hasConcreteProperty="true" hasAbstractCommand="false" hasAbstractAttribute="false" descriptionHtmlExists="false">
<inheritances classname="Device_Impl" sourcePath=""/>
<identification contact="at desy.de - yuelong.yu" author="yuelong.yu" emailDomain="desy.de" classFamily="Acquisition" siteSpecific="" platform="Unix Like" bus="Not Applicable" manufacturer="none" reference=""/>
</description>
<deviceProperties name="TTTGWDeviceName" 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" concreteHere="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" concreteHere="true"/>
</commands>
<commands name="Start" description="start update the data returned by TTTGW tango server" execMethod="start" 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="Stop" description="stop update the data returned by TTTGW tango server" 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>
<attributes name="RawMatrix" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="6000" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:ShortType"/>
<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=""/>
</attributes>
<states name="ON" description="">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states>
<states name="MOVING" description="">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states>
<preferences docHome="./doc_html" makefileHome="/usr/share/pogo/preferences"/>