diff --git a/doc/doc_html/Properties.html b/doc/doc_html/Properties.html index 388a56248f2e70d9f938fcba1ca06732088d501b..b0ca154d0bb3d692ca8b8140e4764919782f5c2d 100755 --- a/doc/doc_html/Properties.html +++ b/doc/doc_html/Properties.html @@ -56,16 +56,34 @@ <Font Size=-1>Tango::DEV_STRING</Font> </Td> <Td> - <Font Size=-1>The board type [MAO_xxxx - where <xxxx> is the ADlink board identifier - e.g. MAO_6208 - no - default value]</Font> + <Font Size=-1>The board type [MAO_xxxx - where <xxxx> is the ADlink board identifier - e.g. MAO_6208 - no default value]</Font> </Td> </Tr> - </Table> + <Tr> + <Td><b><a href=#Dev_DefaultValues>EnableRamps </a></b></Td> + <Td> + <Font Size=-1>Tango::DEV_BOOLEAN</Font> + </Td> + <Td> + <Font Size=-1>Whether to enable or disable the ramp generation on the board output channels. If false, the speedX and initialX dynamic attributes will not be created for every channel, and the changes will happen instantly. [true/false - default value is true]</Font> + </Td> + + </Tr> + <Tr> + <Td><b><a href=#Dev_DefaultValues>WriteMemorizedValuesAtInit </a></b></Td> + <Td> + <Font Size=-1>Tango::DEV_BOOLEAN</Font> + </Td> + <Td> + <Font Size=-1>Whether to write the memorized values to the board at the device initialization. [true/false - default value is false]</Font> + </Td> + </Tr> + </Table> + </Center> - <A name=Dev_DefaultValues><!--- ---></a> <Font Size=+1>Device Properties Default Values:</Font><Br> <Table Border=2 Cellpadding=2 CELLSPACING=2> <tr BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> @@ -80,6 +98,14 @@ <Td>BoardType</Td> <td>No default value</td> </Tr> + <Tr> + <Td>EnableRamps</Td> + <td>true</td> + </Tr> + <Tr> + <Td>WriteMemorizedValuesAtInit</Td> + <td>false</td> + </Tr> </Table> <Br><Br><Br> diff --git a/src/SingleShotAO.cpp b/src/SingleShotAO.cpp index 96a72ba280a17738ad9cc6e82c68bb244d04616e..56cb44dd817a7e444ba19a96b3d0102da063bdfd 100755 --- a/src/SingleShotAO.cpp +++ b/src/SingleShotAO.cpp @@ -582,6 +582,8 @@ void SingleShotAO::get_device_property() Tango::DbData dev_prop; dev_prop.push_back(Tango::DbDatum("BoardNum")); dev_prop.push_back(Tango::DbDatum("BoardType")); + dev_prop.push_back(Tango::DbDatum("EnableRamps")); + dev_prop.push_back(Tango::DbDatum("WriteMemorizedValuesAtInit")); // Call database and extract values //-------------------------------------------- @@ -592,6 +594,7 @@ void SingleShotAO::get_device_property() SingleShotAOClass *ds_class = (static_cast<SingleShotAOClass *>(get_device_class())); int i = -1; + //- <BoardNum> ----------------------- // Try to initialize BoardNum from class property cl_prop = ds_class->get_class_property(dev_prop[++i].name); if (cl_prop.is_empty()==false) cl_prop >> boardNum; @@ -603,6 +606,7 @@ void SingleShotAO::get_device_property() // And try to extract BoardNum value from database if (dev_prop[i].is_empty()==false) dev_prop[i] >> boardNum; + //- <BoardType> ----------------------- // Try to initialize BoardType from class property cl_prop = ds_class->get_class_property(dev_prop[++i].name); if (cl_prop.is_empty()==false) cl_prop >> boardType; @@ -614,6 +618,33 @@ void SingleShotAO::get_device_property() // And try to extract BoardType value from database if (dev_prop[i].is_empty()==false) dev_prop[i] >> boardType; + //- <EnableRamps> ----------------------- + // Try to initialize EnableRamps from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty() == false) cl_prop >> enableRamps; + else + { + // Try to initialize EnableRamps from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty() == false) def_prop >> enableRamps; + } + // And try to extract EnableRamps value from database + if (dev_prop[i].is_empty() == false) dev_prop[i] >> enableRamps; + + //- <WriteMemorizedValuesAtInit> ----------------------- + // Try to initialize WriteMemorizedValuesAtInit from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty() == false) cl_prop >> writeMemorizedValuesAtInit; + else + { + // Try to initialize WriteMemorizedValuesAtInit from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty() == false) def_prop >> writeMemorizedValuesAtInit; + } + // And try to extract WriteMemorizedValuesAtInit value from database + if (dev_prop[i].is_empty() == false) dev_prop[i] >> writeMemorizedValuesAtInit; + + // Check critical properties being present //-------------------------------------------- diff --git a/src/SingleShotAO.h b/src/SingleShotAO.h index 7faa1820a7fe1e2260d2f13899c7b71dbe420bbf..f77367ee78da4a89afcd626b0730cc7d8dfb8084 100755 --- a/src/SingleShotAO.h +++ b/src/SingleShotAO.h @@ -110,6 +110,14 @@ public : * The board type [MAO_xxxx - where <xxxx> is the ADlink board identifier - e.g. MAO_6208 - no default value] */ string boardType; +/** + * Whether to enable or disable the ramp generation on the board output channels. If false, the speedX and initialX dynamic attributes will not be created for every channel, and the changes will happen instantly. [true/false - default value is true] + */ + Tango::DevBoolean enableRamps; +/** + * Whether to write the memorized values to the board at the device initialization. [true/false - default value is false] + */ + Tango::DevBoolean writeMemorizedValuesAtInit; //@} /** diff --git a/src/SingleShotAOClass.cpp b/src/SingleShotAOClass.cpp index e93187a49bbddf85c1b6bd09b993937ab31c7516..87816ebf788b8fc7117a888b03b4f48fb086d5d0 100755 --- a/src/SingleShotAOClass.cpp +++ b/src/SingleShotAOClass.cpp @@ -369,10 +369,14 @@ void SingleShotAOClass::set_default_property() string prop_def; vector<string> vect_data; + // Set Default Class Properties + // ... + // Set Default Device Properties + //- <BoardNum> ----------------------- prop_name = "BoardNum"; - prop_desc = "The the board identifier in the cPCI crate [valid range is 0...7 - no default value] ."; + prop_desc = "The board identifier in the cPCI crate [valid range is 0...7 - no default value]."; prop_def = ""; vect_data.clear(); if (prop_def.length()>0) @@ -385,6 +389,7 @@ void SingleShotAOClass::set_default_property() else add_wiz_dev_prop(prop_name, prop_desc); + //- <BoardType> ----------------------- prop_name = "BoardType"; prop_desc = "The board type [MAO_xxxx - where <xxxx> is the ADlink board identifier - e.g. MAO_6208 - no default value]"; prop_def = ""; @@ -399,7 +404,40 @@ void SingleShotAOClass::set_default_property() else add_wiz_dev_prop(prop_name, prop_desc); + //- <EnableRamps> ----------------------- + prop_name = "EnableRamps"; + prop_desc = "Whether to enable or disable the ramp generation on the board output channels. If false, the speedX and initialX dynamic attributes will not be created for every channel, and the changes will happen instantly. [true/false - default value is true]"; + prop_def = "true"; + vect_data.clear(); + vect_data.push_back("true"); + 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); + + //- <WriteMemorizedValuesAt> ----------------------- + prop_name = "WriteMemorizedValuesAtInit"; + prop_desc = "Whether to write the memorized values to the board at the device initialization. [true/false - default value is false]"; + prop_def = "false"; + vect_data.clear(); + vect_data.push_back("false"); + 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); } + + //+---------------------------------------------------------------------------- // // method : SingleShotAOClass::write_class_property @@ -431,107 +469,6 @@ void SingleShotAOClass::write_class_property() str_desc.push_back("ADLink boards support for single shot AO operations [PCI-6208 and compatible boards]"); description << str_desc; data.push_back(description); - - // put cvs or svn location - string filename(classname); - 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) - { - end = src_path.find(filename); - if (end>start) - { - string strloc = src_path.substr(start, end-start); - // Check if specific repository - start = strloc.find("/cvsroot/"); - if (start!=string::npos && start>0) - { - string repository = strloc.substr(0, start); - if (repository.find("/segfs/")!=string::npos) - strloc = "ESRF:" + strloc.substr(start, strloc.length()-start); - } - Tango::DbDatum cvs_loc("cvs_location"); - cvs_loc << strloc; - 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 - - // CVS tag - string tagname(TagName); - header = "$Name: "; - start = header.length(); - string endstr(" $"); - - end = tagname.find(endstr); - if (end!=string::npos && end>start) - { - string strtag = tagname.substr(start, end-start); - Tango::DbDatum cvs_tag("cvs_tag"); - cvs_tag << strtag; - 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 - string httpServ(HttpServer); - if (httpServ.length()>0) - { - Tango::DbDatum db_doc_url("doc_url"); - db_doc_url << httpServ; - data.push_back(db_doc_url); - } // Put inheritance Tango::DbDatum inher_datum("InheritedFrom"); @@ -540,8 +477,7 @@ void SingleShotAOClass::write_class_property() inher_datum << inheritance; data.push_back(inher_datum); - // Call database and and values - //-------------------------------------------- + // Call database and add values get_db_class()->put_property(data); }