/*----- PROTECTED REGION ID(TangoTest::DynAttrUtils.cpp) ENABLED START -----*/
static const char *RcsId = "$Id: $";
//=============================================================================
//
// file : TangoTestDynAttrUtils.cpp
//
// description : Dynamic attributes utilities file for the TangoTest class
//
// project : TANGO Device Server for testing generic clients
//
// 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 .
//
// $Author: $
//
// $Revision: $
// $Date: $
//
// $HeadURL: $
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#include
#include
/*----- PROTECTED REGION END -----*/ // TangoTest::DynAttrUtils.cpp
//================================================================
// Attributes managed is:
//================================================================
// low_double_scalar_rw | Tango::DevDouble Scalar
//================================================================
// For compatibility reason, this file (TangoTestDynAttrUtils)
// manage also the dynamic command utilities.
//================================================================
// The following table gives the correspondence
// between command and method names.
//
// Command name | Method name
//================================================================
//================================================================
namespace TangoTest_ns
{
//=============================================================
// Add/Remove dynamic attribute methods
//=============================================================
//--------------------------------------------------------
/**
* Add a low_double_scalar_rw dynamic attribute.
*
* parameter attname: attribute name to be cretated and added.
*/
//--------------------------------------------------------
void TangoTest::add_low_double_scalar_rw_dynamic_attribute(string attname)
{
// Attribute : low_double_scalar_rw
low_double_scalar_rwAttrib *low_double_scalar_rw = new low_double_scalar_rwAttrib(attname);
Tango::UserDefaultAttrProp low_double_scalar_rw_prop;
// description not set for low_double_scalar_rw
// label not set for low_double_scalar_rw
// unit not set for low_double_scalar_rw
// standard_unit not set for low_double_scalar_rw
// display_unit not set for low_double_scalar_rw
// format not set for low_double_scalar_rw
// max_value not set for low_double_scalar_rw
// min_value not set for low_double_scalar_rw
// max_alarm not set for low_double_scalar_rw
// min_alarm not set for low_double_scalar_rw
// max_warning not set for low_double_scalar_rw
// min_warning not set for low_double_scalar_rw
// delta_t not set for low_double_scalar_rw
// delta_val not set for low_double_scalar_rw
/*----- PROTECTED REGION ID(TangoTest::att_low_double_scalar_rw_dynamic_attribute) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // TangoTest::att_low_double_scalar_rw_dynamic_attribute
low_double_scalar_rw->set_default_properties(low_double_scalar_rw_prop);
// Not Polled
low_double_scalar_rw->set_disp_level(Tango::OPERATOR);
// Not Memorized
low_double_scalar_rw_data.insert(make_pair(attname, 0.0));
add_attribute(low_double_scalar_rw);
}
//--------------------------------------------------------
/**
* remove a low_double_scalar_rw dynamic attribute.
*
* parameter attname: attribute name to be removed.
*/
//--------------------------------------------------------
void TangoTest::remove_low_double_scalar_rw_dynamic_attribute(string attname)
{
remove_attribute(attname, true);
map::iterator ite;
if ((ite=low_double_scalar_rw_data.find(attname))!=low_double_scalar_rw_data.end())
{
/*----- PROTECTED REGION ID(TangoTest::remove_low_double_scalar_rw_dynamic_attribute) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // TangoTest::remove_low_double_scalar_rw_dynamic_attribute
low_double_scalar_rw_data.erase(ite);
}
}
//============================================================
// Tool methods to get pointer on attribute data buffer
//============================================================
//--------------------------------------------------------
/**
* Return a pointer on low_double_scalar_rw data.
*
* parameter attname: the specified attribute name.
*/
//--------------------------------------------------------
Tango::DevDouble *TangoTest::get_low_double_scalar_rw_data_ptr(string &name)
{
map::iterator ite;
if ((ite=low_double_scalar_rw_data.find(name))==low_double_scalar_rw_data.end())
{
TangoSys_OMemStream tms;
tms << "Dynamic attribute " << name << " has not been created";
Tango::Except::throw_exception(
(const char *)"ATTRIBUTE_NOT_FOUND",
tms.str().c_str(),
(const char *)"TangoTest::get_low_double_scalar_rw_data_ptr()");
}
return &(ite->second);
}
//=============================================================
// Add/Remove dynamic command methods
//=============================================================
} // namespace