Skip to content
Snippets Groups Projects
Commit 915889e1 authored by Alexandre MALFREYT's avatar Alexandre MALFREYT Committed by Florent LANGLOIS
Browse files

fix: rename get_device_properties back to get_device_property for consistency (+ add comments)

parent 3d756be1
No related branches found
No related tags found
2 merge requests!4develop -> main,!3EnableRamps and OutputMemorizedChannelsAtInit properties
......@@ -247,7 +247,7 @@ void SingleShotAO::init_device()
//--------------------------------------------
try
{
get_device_properties();
get_device_property();
}
catch (const Tango::DevFailed& df)
{
......@@ -570,17 +570,14 @@ void SingleShotAO::init_device()
//+----------------------------------------------------------------------------
//
// method : SingleShotAO::get_device_properties()
// method : SingleShotAO::get_device_property()
//
// description : Read the device properties from database.
//
//-----------------------------------------------------------------------------
void SingleShotAO::get_device_properties()
void SingleShotAO::get_device_property()
{
// Initialize your default values here (if not done with POGO).
//------------------------------------------------------------------
// Read device properties from database.(Automatic code generation)
// Read device properties from database
//------------------------------------------------------------------
Tango::DbData dev_prop;
dev_prop.push_back(Tango::DbDatum("BoardNum"));
......@@ -588,11 +585,11 @@ void SingleShotAO::get_device_properties()
// Call database and extract values
//--------------------------------------------
if (Tango::Util::instance()->_UseDb==true)
if (Tango::Util::instance()->_UseDb==true) {
get_db_device()->get_property(dev_prop);
}
Tango::DbDatum def_prop, cl_prop;
SingleShotAOClass *ds_class =
(static_cast<SingleShotAOClass *>(get_device_class()));
SingleShotAOClass *ds_class = (static_cast<SingleShotAOClass *>(get_device_class()));
int i = -1;
// Try to initialize BoardNum from class property
......@@ -617,10 +614,8 @@ void SingleShotAO::get_device_properties()
// And try to extract BoardType value from database
if (dev_prop[i].is_empty()==false) dev_prop[i] >> boardType;
// End of Automatic code generation
//------------------------------------------------------------------
// Check critical properties being present
//--------------------------------------------
critical_properties_missing = false;
......@@ -639,8 +634,11 @@ void SingleShotAO::get_device_properties()
return;
}
// Check critical properties being valid
//--------------------------------------------
//- <BoardNum> -----------------------
if (boardNum > 7)
if (boardNum < 0 || boardNum > 7)
{
boardNum = 0;
ERROR_STREAM << "device property <BoardNum> is invalid. Valid range is [0..7]" << endl;
......@@ -665,7 +663,6 @@ void SingleShotAO::get_device_properties()
ERROR_STREAM << "device property <BoardType> is invalid [supported hw: MAO_6208 or MAO_6216]" << endl;
critical_properties_missing = true;
}
}
......
......@@ -219,7 +219,7 @@ public :
/**
* Read the device properties from database
*/
void get_device_properties();
void get_device_property();
//@}
// Here is the end of the automatic code generation part
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment