Skip to content
Snippets Groups Projects
Commit ca33b376 authored by Sonia Minolli's avatar Sonia Minolli
Browse files

Move frequency property to device attribute (TANGODEVIC-239)

parent ab91ad8f
Branches
Tags
No related merge requests found
...@@ -210,6 +210,12 @@ void RetrigAO::init_device() ...@@ -210,6 +210,12 @@ void RetrigAO::init_device()
attr_bufferDepth.set_write_value(bufferDepth); attr_bufferDepth.set_write_value(bufferDepth);
write_bufferDepth(attr_bufferDepth); write_bufferDepth(attr_bufferDepth);
//- get the memorized value of frequency (property) and put it into frequency (attribute)
Tango::WAttribute &attr_frequency = dev_attr->get_w_attr_by_name("frequency");
INFO_STREAM<<"frequency = "<<frequency<<std::endl;
attr_frequency.set_write_value(frequency);
write_frequency(attr_frequency);
this->init_board(); this->init_board();
} }
...@@ -1090,6 +1096,34 @@ void RetrigAO::read_attr_hardware(vector<long> &attr_list) ...@@ -1090,6 +1096,34 @@ void RetrigAO::read_attr_hardware(vector<long> &attr_list)
ao->unlock_data(); ao->unlock_data();
} }
//+----------------------------------------------------------------------------
//
// method : RetrigAO::read_frequency
//
// description : Extract real attribute values for Frequency acquisition result.
//
//-----------------------------------------------------------------------------
void RetrigAO::read_frequency(Tango::Attribute &attr)
{
DEBUG_STREAM << "RetrigAO::read_frequency(Tango::Attribute &attr) entering... "<< endl;
attr.set_value(&frequency);
}
//+----------------------------------------------------------------------------
//
// method : RetrigAO::write_frequency
//
// description : Write Frequency attribute values to hardware.
//
//-----------------------------------------------------------------------------
void RetrigAO::write_frequency(Tango::WAttribute &attr)
{
DEBUG_STREAM << "RetrigAO::write_frequency(Tango::WAttribute &attr) entering... "<< endl;
attr.get_write_value(frequency);
store_value_as_property(frequency, "Frequency");
this->init_board();
}
//+---------------------------------------------------------------------------- //+----------------------------------------------------------------------------
// //
// method : RetrigAO::read_bufferDepth // method : RetrigAO::read_bufferDepth
...@@ -2386,4 +2420,5 @@ int RetrigAO::FindIndexFromPropertyName(Tango::DbData& dev_prop, string property ...@@ -2386,4 +2420,5 @@ int RetrigAO::FindIndexFromPropertyName(Tango::DbData& dev_prop, string property
} // namespace } // namespace
...@@ -117,6 +117,8 @@ public : ...@@ -117,6 +117,8 @@ public :
Tango::DevShort *attr_channel5Enable_read; Tango::DevShort *attr_channel5Enable_read;
Tango::DevShort *attr_channel6Enable_read; Tango::DevShort *attr_channel6Enable_read;
Tango::DevShort *attr_channel7Enable_read; Tango::DevShort *attr_channel7Enable_read;
Tango::DevDouble *attr_Frequency_read;
Tango::DevDouble attr_Frequency_write;
Tango::DevDouble *attr_channel0_read; Tango::DevDouble *attr_channel0_read;
Tango::DevDouble *attr_channel1_read; Tango::DevDouble *attr_channel1_read;
Tango::DevDouble *attr_channel2_read; Tango::DevDouble *attr_channel2_read;
...@@ -373,6 +375,14 @@ public : ...@@ -373,6 +375,14 @@ public :
* Extract real attribute values for channel7Enable acquisition result. * Extract real attribute values for channel7Enable acquisition result.
*/ */
virtual void read_channel7Enable(Tango::Attribute &attr); virtual void read_channel7Enable(Tango::Attribute &attr);
/**
* Extract real attribute values for Frequency acquisition result.
*/
virtual void read_frequency(Tango::Attribute &attr);
/**
* Write Frequency attribute values to hardware.
*/
virtual void write_frequency(Tango::WAttribute &attr);
/** /**
* Extract real attribute values for channel0 acquisition result. * Extract real attribute values for channel0 acquisition result.
*/ */
...@@ -449,6 +459,10 @@ public : ...@@ -449,6 +459,10 @@ public :
* Read/Write allowed for channel7Enable attribute. * Read/Write allowed for channel7Enable attribute.
*/ */
virtual bool is_channel7Enable_allowed(Tango::AttReqType type); virtual bool is_channel7Enable_allowed(Tango::AttReqType type);
/**
* Read/Write allowed for Frequency attribute.
*/
virtual bool is_frequency_allowed(Tango::AttReqType type);
/** /**
* Read/Write allowed for channel0 attribute. * Read/Write allowed for channel0 attribute.
*/ */
......
static const char *ClassId = "$Id: $";
static const char *CvsPath = "$Source: $";
static const char *SvnPath = "$HeadURL: $";
static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/InputOutput/ADLINK/RetrigAO/src/RetrigAOClass.cpp,v 1.4 2010-03-26 09:41:54 vince_soleil Exp $"; static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/InputOutput/ADLINK/RetrigAO/src/RetrigAOClass.cpp,v 1.4 2010-03-26 09:41:54 vince_soleil Exp $";
static const char *TagName = "$Name: not supported by cvs2svn $"; static const char *TagName = "$Name: not supported by cvs2svn $";
...@@ -372,6 +375,16 @@ void RetrigAOClass::attribute_factory(vector<Tango::Attr *> &att_list) ...@@ -372,6 +375,16 @@ void RetrigAOClass::attribute_factory(vector<Tango::Attr *> &att_list)
channel7EnableAttrib *channel7_enable = new channel7EnableAttrib(); channel7EnableAttrib *channel7_enable = new channel7EnableAttrib();
att_list.push_back(channel7_enable); att_list.push_back(channel7_enable);
// Attribute : frequency
frequencyAttrib *frequency = new frequencyAttrib();
Tango::UserDefaultAttrProp frequency_prop;
frequency_prop.set_unit("Hz");
frequency_prop.set_display_unit("Hz");
frequency_prop.set_min_value("0");
frequency_prop.set_description("The output frequency (the rate the samples are outputed).");
frequency->set_default_properties(frequency_prop);
att_list.push_back(frequency);
// Attribute : channel0 // Attribute : channel0
channel0Attrib *channel0 = new channel0Attrib(); channel0Attrib *channel0 = new channel0Attrib();
att_list.push_back(channel0); att_list.push_back(channel0);
...@@ -467,6 +480,7 @@ void RetrigAOClass::set_default_property() ...@@ -467,6 +480,7 @@ void RetrigAOClass::set_default_property()
prop_name = "BoardNum"; prop_name = "BoardNum";
prop_desc = "The number of the board in the chassis cPCI."; prop_desc = "The number of the board in the chassis cPCI.";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -480,6 +494,7 @@ void RetrigAOClass::set_default_property() ...@@ -480,6 +494,7 @@ void RetrigAOClass::set_default_property()
prop_name = "Frequency"; prop_name = "Frequency";
prop_desc = "The output frequency (the rate the samples are outputed)."; prop_desc = "The output frequency (the rate the samples are outputed).";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -493,6 +508,7 @@ void RetrigAOClass::set_default_property() ...@@ -493,6 +508,7 @@ void RetrigAOClass::set_default_property()
prop_name = "TriggerMode"; prop_name = "TriggerMode";
prop_desc = "Trigger mode: POST trigger or DELAY trigger."; prop_desc = "Trigger mode: POST trigger or DELAY trigger.";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -506,6 +522,7 @@ void RetrigAOClass::set_default_property() ...@@ -506,6 +522,7 @@ void RetrigAOClass::set_default_property()
prop_name = "TriggerSource"; prop_name = "TriggerSource";
prop_desc = "The trigger source.The possible values are internal trigger INTRIG, digital trigger\nDTRIG or analog trigger ATRIG."; prop_desc = "The trigger source.The possible values are internal trigger INTRIG, digital trigger\nDTRIG or analog trigger ATRIG.";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -519,6 +536,7 @@ void RetrigAOClass::set_default_property() ...@@ -519,6 +536,7 @@ void RetrigAOClass::set_default_property()
prop_name = "ATRIGSelection"; prop_name = "ATRIGSelection";
prop_desc = "select the type of analog trigger. Can be BELOW (trigger occurs below ATRIGLevel)\nor can be ABOVE (trigger occurs above ATRIGLevel)."; prop_desc = "select the type of analog trigger. Can be BELOW (trigger occurs below ATRIGLevel)\nor can be ABOVE (trigger occurs above ATRIGLevel).";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -532,6 +550,7 @@ void RetrigAOClass::set_default_property() ...@@ -532,6 +550,7 @@ void RetrigAOClass::set_default_property()
prop_name = "ATRIGLevel"; prop_name = "ATRIGLevel";
prop_desc = "The analog trigger level in volts."; prop_desc = "The analog trigger level in volts.";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -545,6 +564,7 @@ void RetrigAOClass::set_default_property() ...@@ -545,6 +564,7 @@ void RetrigAOClass::set_default_property()
prop_name = "DTRIGPolarity"; prop_name = "DTRIGPolarity";
prop_desc = "The edges on which the trigger are detected. Can be RISING or FALLING."; prop_desc = "The edges on which the trigger are detected. Can be RISING or FALLING.";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -558,6 +578,7 @@ void RetrigAOClass::set_default_property() ...@@ -558,6 +578,7 @@ void RetrigAOClass::set_default_property()
prop_name = "AORefA"; prop_name = "AORefA";
prop_desc = "The value of the reference voltage gave on pin AORefA."; prop_desc = "The value of the reference voltage gave on pin AORefA.";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -571,6 +592,7 @@ void RetrigAOClass::set_default_property() ...@@ -571,6 +592,7 @@ void RetrigAOClass::set_default_property()
prop_name = "AORefB"; prop_name = "AORefB";
prop_desc = "The value of the reference voltage gave on pin AORefB."; prop_desc = "The value of the reference voltage gave on pin AORefB.";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -584,6 +606,7 @@ void RetrigAOClass::set_default_property() ...@@ -584,6 +606,7 @@ void RetrigAOClass::set_default_property()
prop_name = "Polarity"; prop_name = "Polarity";
prop_desc = "BP for unipolar outputs or UP for bipolar outputs."; prop_desc = "BP for unipolar outputs or UP for bipolar outputs.";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -597,6 +620,7 @@ void RetrigAOClass::set_default_property() ...@@ -597,6 +620,7 @@ void RetrigAOClass::set_default_property()
prop_name = "AORefSource"; prop_name = "AORefSource";
prop_desc = "Select the internal reference (10.0 volts) with INTERN or the external references\nAORefA and AORefB with EXTERN."; prop_desc = "Select the internal reference (10.0 volts) with INTERN or the external references\nAORefA and AORefB with EXTERN.";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -610,6 +634,7 @@ void RetrigAOClass::set_default_property() ...@@ -610,6 +634,7 @@ void RetrigAOClass::set_default_property()
prop_name = "Channel0Enable"; prop_name = "Channel0Enable";
prop_desc = "1 if enable channel 0, 0 otherwise."; prop_desc = "1 if enable channel 0, 0 otherwise.";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -623,6 +648,7 @@ void RetrigAOClass::set_default_property() ...@@ -623,6 +648,7 @@ void RetrigAOClass::set_default_property()
prop_name = "Channel1Enable"; prop_name = "Channel1Enable";
prop_desc = "1 if enable channel 1, 0 otherwise."; prop_desc = "1 if enable channel 1, 0 otherwise.";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -636,6 +662,7 @@ void RetrigAOClass::set_default_property() ...@@ -636,6 +662,7 @@ void RetrigAOClass::set_default_property()
prop_name = "Channel2Enable"; prop_name = "Channel2Enable";
prop_desc = "1 if enable channel 2, 0 otherwise."; prop_desc = "1 if enable channel 2, 0 otherwise.";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -649,6 +676,7 @@ void RetrigAOClass::set_default_property() ...@@ -649,6 +676,7 @@ void RetrigAOClass::set_default_property()
prop_name = "Channel3Enable"; prop_name = "Channel3Enable";
prop_desc = "1 if enable channel 3, 0 otherwise."; prop_desc = "1 if enable channel 3, 0 otherwise.";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -662,6 +690,7 @@ void RetrigAOClass::set_default_property() ...@@ -662,6 +690,7 @@ void RetrigAOClass::set_default_property()
prop_name = "Channel4Enable"; prop_name = "Channel4Enable";
prop_desc = "1 if enable channel 4, 0 otherwise."; prop_desc = "1 if enable channel 4, 0 otherwise.";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -675,6 +704,7 @@ void RetrigAOClass::set_default_property() ...@@ -675,6 +704,7 @@ void RetrigAOClass::set_default_property()
prop_name = "Channel5Enable"; prop_name = "Channel5Enable";
prop_desc = "1 if enable channel 5, 0 otherwise."; prop_desc = "1 if enable channel 5, 0 otherwise.";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -688,6 +718,7 @@ void RetrigAOClass::set_default_property() ...@@ -688,6 +718,7 @@ void RetrigAOClass::set_default_property()
prop_name = "Channel6Enable"; prop_name = "Channel6Enable";
prop_desc = "1 if enable channel 6, 0 otherwise."; prop_desc = "1 if enable channel 6, 0 otherwise.";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -701,6 +732,7 @@ void RetrigAOClass::set_default_property() ...@@ -701,6 +732,7 @@ void RetrigAOClass::set_default_property()
prop_name = "Channel7Enable"; prop_name = "Channel7Enable";
prop_desc = "1 if enable channel 7, 0 otherwise."; prop_desc = "1 if enable channel 7, 0 otherwise.";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -714,6 +746,21 @@ void RetrigAOClass::set_default_property() ...@@ -714,6 +746,21 @@ void RetrigAOClass::set_default_property()
prop_name = "Delay"; prop_name = "Delay";
prop_desc = "If trigger mode is delay, configure the delay in seconds."; prop_desc = "If trigger mode is delay, configure the delay in seconds.";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0)
{
Tango::DbDatum data(prop_name);
data << vect_data ;
dev_def_prop.push_back(data);
add_wiz_dev_prop(prop_name, prop_desc, prop_def);
}
else
add_wiz_dev_prop(prop_name, prop_desc);
prop_name = "BufferDepth";
prop_desc = "The buffer depth for <b>one channel</b>";
prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -727,6 +774,7 @@ void RetrigAOClass::set_default_property() ...@@ -727,6 +774,7 @@ void RetrigAOClass::set_default_property()
prop_name = "Channel0Waveform"; prop_name = "Channel0Waveform";
prop_desc = "The waveform for channel 0 (attribute persistency)."; prop_desc = "The waveform for channel 0 (attribute persistency).";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -740,6 +788,7 @@ void RetrigAOClass::set_default_property() ...@@ -740,6 +788,7 @@ void RetrigAOClass::set_default_property()
prop_name = "Channel1Waveform"; prop_name = "Channel1Waveform";
prop_desc = "The waveform for channel 1 (attribute persistency)."; prop_desc = "The waveform for channel 1 (attribute persistency).";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -753,6 +802,7 @@ void RetrigAOClass::set_default_property() ...@@ -753,6 +802,7 @@ void RetrigAOClass::set_default_property()
prop_name = "Channel2Waveform"; prop_name = "Channel2Waveform";
prop_desc = "The waveform for channel 2 (attribute persistency)."; prop_desc = "The waveform for channel 2 (attribute persistency).";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -766,6 +816,7 @@ void RetrigAOClass::set_default_property() ...@@ -766,6 +816,7 @@ void RetrigAOClass::set_default_property()
prop_name = "Channel3Waveform"; prop_name = "Channel3Waveform";
prop_desc = "The waveform for channel 3 (attribute persistency)."; prop_desc = "The waveform for channel 3 (attribute persistency).";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -779,6 +830,7 @@ void RetrigAOClass::set_default_property() ...@@ -779,6 +830,7 @@ void RetrigAOClass::set_default_property()
prop_name = "Channel4Waveform"; prop_name = "Channel4Waveform";
prop_desc = "The waveform for channel 4 (attribute persistency)."; prop_desc = "The waveform for channel 4 (attribute persistency).";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -792,6 +844,7 @@ void RetrigAOClass::set_default_property() ...@@ -792,6 +844,7 @@ void RetrigAOClass::set_default_property()
prop_name = "Channel5Waveform"; prop_name = "Channel5Waveform";
prop_desc = "The waveform for channel 5 (attribute persistency)."; prop_desc = "The waveform for channel 5 (attribute persistency).";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -805,6 +858,7 @@ void RetrigAOClass::set_default_property() ...@@ -805,6 +858,7 @@ void RetrigAOClass::set_default_property()
prop_name = "Channel6Waveform"; prop_name = "Channel6Waveform";
prop_desc = "The waveform for channel 6 (attribute persistency)."; prop_desc = "The waveform for channel 6 (attribute persistency).";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -818,6 +872,7 @@ void RetrigAOClass::set_default_property() ...@@ -818,6 +872,7 @@ void RetrigAOClass::set_default_property()
prop_name = "Channel7Waveform"; prop_name = "Channel7Waveform";
prop_desc = "The waveform for channel 7 (attribute persistency)."; prop_desc = "The waveform for channel 7 (attribute persistency).";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -831,6 +886,7 @@ void RetrigAOClass::set_default_property() ...@@ -831,6 +886,7 @@ void RetrigAOClass::set_default_property()
prop_name = "FilePath"; prop_name = "FilePath";
prop_desc = "The path to waveforms persistancy files"; prop_desc = "The path to waveforms persistancy files";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -844,6 +900,7 @@ void RetrigAOClass::set_default_property() ...@@ -844,6 +900,7 @@ void RetrigAOClass::set_default_property()
prop_name = "ConversionSource"; prop_name = "ConversionSource";
prop_desc = "Set the AO conversion signal source (i.e. DAC sampling source).\nUse one of the following: INTERNAL, EXTSAMPLING."; prop_desc = "Set the AO conversion signal source (i.e. DAC sampling source).\nUse one of the following: INTERNAL, EXTSAMPLING.";
prop_def = ""; prop_def = "";
vect_data.clear();
if (prop_def.length()>0) if (prop_def.length()>0)
{ {
Tango::DbDatum data(prop_name); Tango::DbDatum data(prop_name);
...@@ -887,17 +944,23 @@ void RetrigAOClass::write_class_property() ...@@ -887,17 +944,23 @@ void RetrigAOClass::write_class_property()
description << str_desc; description << str_desc;
data.push_back(description); data.push_back(description);
// put cvs location // put cvs or svn location
string rcsId(RcsId);
string filename(classname); string filename(classname);
start = rcsId.find("/"); filename += "Class.cpp";
// Create a string with the class ID to
// get the string into the binary
string class_id(ClassId);
// check for cvs information
string src_path(CvsPath);
start = src_path.find("/");
if (start!=string::npos) if (start!=string::npos)
{ {
filename += "Class.cpp"; end = src_path.find(filename);
end = rcsId.find(filename);
if (end>start) if (end>start)
{ {
string strloc = rcsId.substr(start, end-start); string strloc = src_path.substr(start, end-start);
// Check if specific repository // Check if specific repository
start = strloc.find("/cvsroot/"); start = strloc.find("/cvsroot/");
if (start!=string::npos && start>0) if (start!=string::npos && start>0)
...@@ -911,12 +974,35 @@ void RetrigAOClass::write_class_property() ...@@ -911,12 +974,35 @@ void RetrigAOClass::write_class_property()
data.push_back(cvs_loc); data.push_back(cvs_loc);
} }
} }
// check for svn information
else
{
string src_path(SvnPath);
start = src_path.find("://");
if (start!=string::npos)
{
end = src_path.find(filename);
if (end>start)
{
header = "$HeadURL: ";
start = header.length();
string strloc = src_path.substr(start, (end-start));
Tango::DbDatum svn_loc("svn_location");
svn_loc << strloc;
data.push_back(svn_loc);
}
}
}
// Get CVS or SVN revision tag
// Get CVS tag revision // CVS tag
string tagname(TagName); string tagname(TagName);
header = "$Name: "; header = "$Name: ";
start = header.length(); start = header.length();
string endstr(" $"); string endstr(" $");
end = tagname.find(endstr); end = tagname.find(endstr);
if (end!=string::npos && end>start) if (end!=string::npos && end>start)
{ {
...@@ -926,6 +1012,30 @@ void RetrigAOClass::write_class_property() ...@@ -926,6 +1012,30 @@ void RetrigAOClass::write_class_property()
data.push_back(cvs_tag); data.push_back(cvs_tag);
} }
// SVN tag
string svnpath(SvnPath);
header = "$HeadURL: ";
start = header.length();
end = svnpath.find(endstr);
if (end!=string::npos && end>start)
{
string strloc = svnpath.substr(start, end-start);
string tagstr ("/tags/");
start = strloc.find(tagstr);
if ( start!=string::npos )
{
start = start + tagstr.length();
end = strloc.find(filename);
string strtag = strloc.substr(start, end-start-1);
Tango::DbDatum svn_tag("svn_tag");
svn_tag << strtag;
data.push_back(svn_tag);
}
}
// Get URL location // Get URL location
string httpServ(HttpServer); string httpServ(HttpServer);
if (httpServ.length()>0) if (httpServ.length()>0)
......
...@@ -137,6 +137,20 @@ public: ...@@ -137,6 +137,20 @@ public:
{return (static_cast<RetrigAO *>(dev))->is_channel0_allowed(ty);} {return (static_cast<RetrigAO *>(dev))->is_channel0_allowed(ty);}
}; };
class frequencyAttrib: public Tango::Attr
{
public:
frequencyAttrib():Attr("frequency", Tango::DEV_DOUBLE, Tango::READ_WRITE) {};
~frequencyAttrib() {};
virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att)
{(static_cast<RetrigAO *>(dev))->read_frequency(att);}
virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att)
{(static_cast<RetrigAO *>(dev))->write_frequency(att);}
virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty)
{return (static_cast<RetrigAO *>(dev))->is_frequency_allowed(ty);}
};
class channel7EnableAttrib: public Tango::Attr class channel7EnableAttrib: public Tango::Attr
{ {
public: public:
...@@ -350,7 +364,11 @@ public: ...@@ -350,7 +364,11 @@ public:
// The RetrigAOClass singleton definition // The RetrigAOClass singleton definition
// //
class RetrigAOClass : public Tango::DeviceClass class
#ifdef _TG_WINDOWS_
__declspec(dllexport)
#endif
RetrigAOClass : public Tango::DeviceClass
{ {
public: public:
// properties member data // properties member data
...@@ -379,6 +397,8 @@ protected: ...@@ -379,6 +397,8 @@ protected:
void attribute_factory(vector<Tango::Attr *> &); void attribute_factory(vector<Tango::Attr *> &);
void write_class_property(); void write_class_property();
void set_default_property(); void set_default_property();
string get_cvstag();
string get_cvsroot();
private: private:
void device_factory(const Tango::DevVarStringArray *); void device_factory(const Tango::DevVarStringArray *);
......
...@@ -314,6 +314,20 @@ bool RetrigAO::is_bufferDepth_allowed(Tango::AttReqType type) ...@@ -314,6 +314,20 @@ bool RetrigAO::is_bufferDepth_allowed(Tango::AttReqType type)
// Re-Start of Generated Code // Re-Start of Generated Code
return true; return true;
} }
//+----------------------------------------------------------------------------
//
// method : RetrigAO::is_frequency_allowed
//
// description : Read/Write allowed for frequency attribute.
//
//-----------------------------------------------------------------------------
bool RetrigAO::is_frequency_allowed(Tango::AttReqType type)
{
// End of Generated Code
// Re-Start of Generated Code
return true;
}
//================================================= //=================================================
// Commands Allowed Methods // Commands Allowed Methods
......
/**
* Device Class Identification:
*
* Class Name : RetrigAO
* Contact : sebastien.gara@nexeya.com
* Class Family : Miscellaneous
* Platform : All Platforms
* Bus : Not Applicable
* Manufacturer : none
* Reference :
*/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment