Skip to content
Snippets Groups Projects
Commit 983a5953 authored by Alain BUTEAU's avatar Alain BUTEAU
Browse files

fichiers temporaires inutiles

parent aeb5af3f
No related branches found
No related tags found
No related merge requests found
//=============================================================================
// DynamicAttributes.cpp
//=============================================================================
// abstraction.......XPS Group generic device
// class.............DynamicAttribute
// original author...N.Leclercq - SOLEIL modifi� par j.coquet
//=============================================================================
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// THIS IS NOT USED - THIS IS NOT USED - THIS IS NOT USED - THIS IS NOT USED
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// ============================================================================
// DEPENDENCIES
// ============================================================================
#include "DynamicAttributes.h"
#include "math.h"
// ============================================================================
// Some defines and constants
// ============================================================================
const double __NAN__ = static_cast<double>(::sqrt(-1.));
//- non standard VC libraries for is equal to __NAN__ test (see isnan)
#if (_MSC_VER)
#include <cfloat>
#define isnan _isnan
#endif
namespace xpsg
{
// ============================================================================
// Config::Config
// ============================================================================
DynamicXPSGroupAttribute::Config::Config ()
{
m_hwp = 0;
m_host = 0;
m_name = "Not Initialised";
m_posit_name = "Not Initialised";
m_posit_number = -1;
}
DynamicXPSGroupAttribute::Config::Config (const Config & _src)
{
*this = _src;
}
// ============================================================================
// Config::operator =
// ============================================================================
void DynamicXPSGroupAttribute::Config::operator = (const Config & _src)
{
m_hwp = _src.m_hwp;
m_host = _src.m_host;
m_name = _src.m_name;
m_posit_name = _src.m_posit_name;
m_posit_number = _src.m_posit_number;
}
// ======================================================================
// DynamicAttribute::DynamicAttribute
// ======================================================================
DynamicAttribute::DynamicAttribute (HWProxy * hwp, Tango::DeviceImpl * host)
: Tango::LogAdapter(host), m_hwp(hwp)
{
//- noop
}
// ======================================================================
// DynamicAttribute::~DynamicAttribute
// ======================================================================
DynamicAttribute::~DynamicAttribute ()
{
//- noop
}
// ======================================================================
// DynamicXPSGroupAttribute::DynamicXPSGroupAttribute
// ======================================================================
DynamicXPSGroupAttribute::DynamicXPSGroupAttribute (const Config& _cfg)
: DynamicAttribute (_cfg.m_hwp, _cfg.m_host),
Tango::Attr (_cfg.m_name.c_str(), Tango::DEV_DOUBLE, Tango::READ_WRITE),
cfg (_cfg)
{
//- TODO : insert calls to set attribute properties like format, min, max...
up.set_format ("%7.4d");
//- TODO : set value to __NAN__
this->m_position = __NAN__;
}
// ======================================================================
// DynamicXPSGroupAttribute::~DynamicXPSGroupAttribute
// ======================================================================
DynamicXPSGroupAttribute::~DynamicXPSGroupAttribute ()
{
//- noop
}
// ============================================================================
// DynamicXPSGroupAttribute::read
// ============================================================================
void DynamicXPSGroupAttribute::read (Tango::DeviceImpl * dev, Tango::Attribute &attr)
{
//- std::cout << "DynamicXPSGroupAttribute::read <-" << std::endl;
if (this->cfg.m_hwp == 0)
{
ERROR_STREAM << "DynamicXPSGroupAttribute::read pointer to reading thread = 0!" << std::endl;
return;
}
m_position = m_hwp->get_position (this->cfg.m_posit_number);
attr.set_value (& m_position);
return;
}
// ============================================================================
// DynamicXPSGroupAttribute::write
// ============================================================================
void DynamicXPSGroupAttribute::write (Tango::DeviceImpl * dev, Tango::WAttribute &attr)
{
DEBUG_ASSERT(this->cfg.m_hwp != 0);
//- get write value
Tango::DevDouble src;
attr.get_write_value(src);
m_hwp->set_position (this->cfg.m_posit_number, src);
return;
}
} // namespace xpsg
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment