cumbia-tango 1.x
C++ multi threaded library based on cumbia and the Tango control system
|
#include <cutango-world.h>
Public Member Functions | |
CuTangoWorld () | |
virtual | ~CuTangoWorld () |
std::string | strerror (const Tango::DevFailed &e) |
std::string | strerror (const Tango::DevErrorList &e) |
void | fillThreadInfo (CuData &d, const CuActivity *a) |
void | extractData (Tango::DeviceAttribute *p_da, CuData &d) |
void | extractData (Tango::DeviceData *dd, CuData &d) |
extracts data from Tango::DeviceData and puts it into the CuData bundle More... | |
Tango::DeviceData | toDeviceData (const CuVariant &argins, const CuData &cmdinfo) |
Tango::DeviceData | toDeviceData (const std::vector< std::string > &argins, const CuData &cmdinfo) |
Tango::DeviceAttribute | toDeviceAttribute (const std::string &name, const CuVariant &argin, const CuData &attinfo) |
Tango::DeviceAttribute | toDeviceAttribute (const std::string &aname, const std::vector< std::string > &argins, const CuData &attinfo) |
void | fillFromAttributeConfig (const Tango::AttributeInfoEx &ai, CuData &d) |
void | fillFromCommandInfo (const Tango::CommandInfo &cu, CuData &d) |
bool | cmd_inout (Tango::DeviceProxy *dev, const std::string &cmd, Tango::DeviceData &din, bool has_argout, CuData &data) |
bool | cmd_inout (Tango::DeviceProxy *dev, const std::string &cmd, CuData &data) |
bool | read_att (Tango::DeviceProxy *dev, const std::string &attribute, CuData &res) |
bool | read_atts (Tango::DeviceProxy *dev, std::vector< std::string > &p_v_an, std::vector< CuData > &v_a, std::vector< CuData > &reslist, int da_updpo) |
bool | write_att (Tango::DeviceProxy *dev, const std::string &attnam, const CuVariant &argins, const CuData &point_info, CuData &data) |
bool | get_att_config (Tango::DeviceProxy *dev, const std::string &attribute, CuData &res, bool skip_read_att=false) |
bool | get_command_info (Tango::DeviceProxy *dev, const std::string &cmd, CuData &cmd_info) |
Get Tango CommandInfo data and save it into a CuData. More... | |
bool | get_att_props (Tango::DeviceProxy *dev, const std::string &attribute, CuData &res, const std::vector< std::string > props) |
bool | get_properties (const std::vector< CuData > &in_list, CuData &res, const std::string &dbhost="") |
CuTangoWorld::get_properties. More... | |
bool | db_get (const TSource &tsrc, CuData &res) |
bool | source_valid (const std::string &src) |
const char * | source_valid_pattern () const |
std::string | getLastMessage () const |
std::string | formatToStr (Tango::AttrDataFormat f) const |
returns a string representation of the attribute data format to be used in the CuData "dfs" property. More... | |
std::string | cmdArgTypeToDataFormat (Tango::CmdArgType t) const |
Returns a string representation of the Tango::CmdArgType. More... | |
bool | error () const |
void | setSrcPatterns (const std::vector< std::string > &pat_regex) |
std::vector< std::string > | srcPatterns () const |
Tango::Database * | getTangoDb (const std::string &dbhost) |
void | putDateTime (const Tango::TimeVal &ttv, CuData &data) |
std::string | dateTimeToStr (time_t *tp) const |
if the time_t parameter is not null, use it to format the date/time into a std:string, otherwise get system time and use the current date/time More... | |
CuDataQuality | toCuQuality (Tango::AttrQuality q) const |
CuTangoWorld::toCuQuality. More... | |
std::string | make_fqdn_src (const std::string &src) const |
given a source, replace the tango host section with its FQDN name More... | |
std::string | prepend_tgproto (const std::string &s) const |
prepend "tango://" protocol string to src if not already specified More... | |
CuTangoWorld::CuTangoWorld | ( | ) |
|
virtual |
bool CuTangoWorld::cmd_inout | ( | Tango::DeviceProxy * | dev, |
const std::string & | cmd, | ||
CuData & | data | ||
) |
References cmd_inout(), and toDeviceData().
bool CuTangoWorld::cmd_inout | ( | Tango::DeviceProxy * | dev, |
const std::string & | cmd, | ||
Tango::DeviceData & | din, | ||
bool | has_argout, | ||
CuData & | data | ||
) |
References extractData(), and strerror().
Referenced by cmd_inout(), CuPollingActivity::execute(), CuTConfigActivity::execute(), and CuWriteActivity::execute().
string CuTangoWorld::cmdArgTypeToDataFormat | ( | Tango::CmdArgType | t | ) | const |
Returns a string representation of the Tango::CmdArgType.
valid values for compatibility: scalar, vector
CuData "dfs" property
Referenced by db_get(), and extractData().
std::string CuTangoWorld::dateTimeToStr | ( | time_t * | tp | ) | const |
if the time_t parameter is not null, use it to format the date/time into a std:string, otherwise get system time and use the current date/time
tp | if not null, it is used to provide a string representation of the local time, otherwise get the system date and time |
bool CuTangoWorld::db_get | ( | const TSource & | tsrc, |
CuData & | res | ||
) |
References cmdArgTypeToDataFormat(), TSource::getDeviceName(), TSource::getDeviceNameOnly(), TSource::getExportedDevSearchPattern(), TSource::getFreePropNam(), TSource::getFreePropObj(), TSource::getPoint(), TSource::getPropClassNam(), TSource::getPropNames(), TSource::getSearchPattern(), getTangoDb(), TSource::getTangoHost(), TSource::getType(), TSource::getTypeName(), TSource::SrcAttr, TSource::SrcCmd, TSource::SrcDbAProp, TSource::SrcDbAttInfo, TSource::SrcDbAtts, TSource::SrcDbClassProp, TSource::SrcDbClassProps, TSource::SrcDbCmds, TSource::SrcDbDevProp, TSource::SrcDbDevProps, TSource::SrcDbDoma, TSource::SrcDbFam, TSource::SrcDbFreeProp, TSource::SrcDbGetCmdI, TSource::SrcDbMem, TSource::SrcEndTypes, TSource::SrcExportedDevs, TSource::SrcInvalid, and strerror().
Referenced by CuTaDbActivity::execute().
bool CuTangoWorld::error | ( | ) | const |
Referenced by CuTConfigActivity::execute(), CuWriteActivity::execute(), and CuEventActivity::push_event().
void CuTangoWorld::extractData | ( | Tango::DeviceAttribute * | p_da, |
CuData & | d | ||
) |
References formatToStr(), putDateTime(), CuTangoWorldConfig::stateColorName(), CuTangoWorldConfig::stateString(), strerror(), and toCuQuality().
Referenced by cmd_inout(), CuEventActivity::push_event(), read_att(), and read_atts().
void CuTangoWorld::extractData | ( | Tango::DeviceData * | data, |
CuData & | da | ||
) |
extracts data from Tango::DeviceData and puts it into the CuData bundle
References cmdArgTypeToDataFormat(), CuTangoWorldConfig::stateColorName(), CuTangoWorldConfig::stateString(), and strerror().
void CuTangoWorld::fillFromAttributeConfig | ( | const Tango::AttributeInfoEx & | ai, |
CuData & | d | ||
) |
References formatToStr().
Referenced by get_att_config().
void CuTangoWorld::fillFromCommandInfo | ( | const Tango::CommandInfo & | cu, |
CuData & | d | ||
) |
References formatToStr().
Referenced by get_command_info().
void CuTangoWorld::fillThreadInfo | ( | CuData & | d, |
const CuActivity * | a | ||
) |
Referenced by CuWriteActivity::execute().
string CuTangoWorld::formatToStr | ( | Tango::AttrDataFormat | f | ) | const |
returns a string representation of the attribute data format to be used in the CuData "dfs" property.
Valid return values are scalar, vector and matrix
Referenced by extractData(), fillFromAttributeConfig(), and fillFromCommandInfo().
bool CuTangoWorld::get_att_config | ( | Tango::DeviceProxy * | dev, |
const std::string & | attribute, | ||
CuData & | res, | ||
bool | skip_read_att = false |
||
) |
References fillFromAttributeConfig(), read_att(), and strerror().
Referenced by CuWriteActivity::execute(), and CuTConfigActivityExecutor_Default::get_att_config().
bool CuTangoWorld::get_att_props | ( | Tango::DeviceProxy * | dev, |
const std::string & | attribute, | ||
CuData & | res, | ||
const std::vector< std::string > | props | ||
) |
References strerror().
Referenced by CuTConfigActivity::execute().
bool CuTangoWorld::get_command_info | ( | Tango::DeviceProxy * | dev, |
const std::string & | cmd, | ||
CuData & | cmd_info | ||
) |
Get Tango CommandInfo data and save it into a CuData.
dev | a pre allocated DeviceProxy |
cmd | the name of the command |
cmd_info | a non const reference to a CuData that will contain the Tango::CommandInfo fields. If an error occurs, the exception message is stored into the error parameter and cmd_info is left untouched. |
References fillFromCommandInfo(), and strerror().
Referenced by CuPollingActivity::execute(), CuWriteActivity::execute(), and CuTConfigActivityExecutor_Default::get_command_info().
bool CuTangoWorld::get_properties | ( | const std::vector< CuData > & | in_list, |
CuData & | res, | ||
const std::string & | dbhost = "" |
||
) |
in_list | list of properties to fetch, described with a CuData bundle |
res | the result of the database query |
References getTangoDb(), and strerror().
Referenced by CuGetTDbPropActivity::execute().
string CuTangoWorld::getLastMessage | ( | ) | const |
Tango::Database * CuTangoWorld::getTangoDb | ( | const std::string & | dbhost | ) |
References strerror().
Referenced by db_get(), and get_properties().
std::string CuTangoWorld::make_fqdn_src | ( | const std::string & | src | ) | const |
given a source, replace the tango host section with its FQDN name
src | any source |
if
The returned string will leave intact the "tango://" protocol prefix in the source, if present.
std::string CuTangoWorld::prepend_tgproto | ( | const std::string & | src | ) | const |
prepend "tango://" protocol string to src if not already specified
src | the input source |
void CuTangoWorld::putDateTime | ( | const Tango::TimeVal & | ttv, |
CuData & | data | ||
) |
Referenced by extractData().
bool CuTangoWorld::read_att | ( | Tango::DeviceProxy * | dev, |
const std::string & | attribute, | ||
CuData & | res | ||
) |
References extractData(), and strerror().
Referenced by CuTConfigActivity::execute(), and get_att_config().
bool CuTangoWorld::read_atts | ( | Tango::DeviceProxy * | dev, |
std::vector< std::string > & | p_v_an, | ||
std::vector< CuData > & | v_a, | ||
std::vector< CuData > & | reslist, | ||
int | da_updpo | ||
) |
References extractData(), and strerror().
Referenced by CuPollingActivity::execute().
void CuTangoWorld::setSrcPatterns | ( | const std::vector< std::string > & | pat_regex | ) |
bool CuTangoWorld::source_valid | ( | const std::string & | src | ) |
const char * CuTangoWorld::source_valid_pattern | ( | ) | const |
std::vector< string > CuTangoWorld::srcPatterns | ( | ) | const |
std::string CuTangoWorld::strerror | ( | const Tango::DevErrorList & | e | ) |
std::string CuTangoWorld::strerror | ( | const Tango::DevFailed & | e | ) |
References strerror().
Referenced by cmd_inout(), db_get(), CuEventActivity::execute(), extractData(), get_att_config(), get_att_props(), get_command_info(), get_properties(), getTangoDb(), CuEventActivity::onExit(), CuEventActivity::push_event(), read_att(), read_atts(), strerror(), TDevice::TDevice(), and write_att().
CuDataQuality CuTangoWorld::toCuQuality | ( | Tango::AttrQuality | q | ) | const |
q | the input Tango::AttrQuality enum value |
Referenced by extractData().
Tango::DeviceAttribute CuTangoWorld::toDeviceAttribute | ( | const std::string & | aname, |
const std::vector< std::string > & | argins, | ||
const CuData & | attinfo | ||
) |
Tango::DeviceAttribute CuTangoWorld::toDeviceAttribute | ( | const std::string & | name, |
const CuVariant & | argin, | ||
const CuData & | attinfo | ||
) |
Referenced by write_att().
Tango::DeviceData CuTangoWorld::toDeviceData | ( | const CuVariant & | argins, |
const CuData & | cmdinfo | ||
) |
References toDeviceData().
Referenced by cmd_inout(), CuPollingActivity::execute(), CuWriteActivity::execute(), and toDeviceData().
Tango::DeviceData CuTangoWorld::toDeviceData | ( | const std::vector< std::string > & | argins, |
const CuData & | cmdinfo | ||
) |
bool CuTangoWorld::write_att | ( | Tango::DeviceProxy * | dev, |
const std::string & | attnam, | ||
const CuVariant & | argins, | ||
const CuData & | point_info, | ||
CuData & | data | ||
) |
References strerror(), and toDeviceAttribute().
Referenced by CuWriteActivity::execute().