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

feat: add logging for parsed device properties in get_device_property method

parent 9547d4ba
No related branches found
No related tags found
2 merge requests!4develop -> main,!3EnableRamps and OutputMemorizedChannelsAtInit properties
......@@ -601,6 +601,7 @@ void SingleShotAO::get_device_property()
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()));
int i = -1;
......@@ -616,6 +617,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;
INFO_STREAM << "Raw BoardNum parsed: " << boardNum << endl;
//- <BoardType> -----------------------
// Try to initialize BoardType from class property
......@@ -628,39 +630,37 @@ void SingleShotAO::get_device_property()
}
// And try to extract BoardType value from database
if (dev_prop[i].is_empty()==false) dev_prop[i] >> boardType;
INFO_STREAM << "Raw BoardType parsed: " << boardType << endl;
//- <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
{
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;
INFO_STREAM << "EnableRamps parsed: " << (enableRamps ? "true" : "false") << endl;
//- <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
{
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;
INFO_STREAM << "WriteMemorizedValuesAtInit parsed: " << (writeMemorizedValuesAtInit ? "true" : "false") << endl;
// Check critical properties being present
//--------------------------------------------
critical_properties_missing = false;
if (dev_prop[0].is_empty())
{
ERROR_STREAM << "Required device property <BoardNum> is missing" << endl;
......@@ -671,20 +671,20 @@ void SingleShotAO::get_device_property()
ERROR_STREAM << "Required device property <BoardType> is missing" << endl;
critical_properties_missing = true;
}
if (critical_properties_missing) {
return;
}
// Check critical properties being valid
//--------------------------------------------
//- <BoardNum> -----------------------
if (boardNum < 0 || boardNum > 7)
{
boardNum = 0;
ERROR_STREAM << "device property <BoardNum> is invalid. Valid range is [0..7]" << endl;
critical_properties_missing = true;
} else {
INFO_STREAM << "BoardNum resolved to " << boardNum << endl;
}
//- <BoardType> -----------------------
......@@ -692,11 +692,13 @@ void SingleShotAO::get_device_property()
{
boardType = k6208_BOARD_TYPE;
boardTypeId = adl::PCI6208;
INFO_STREAM << "BoardType resolved to PCI6208" << endl;
}
else if (boardType == "MAO_6216")
{
boardType = k6216_BOARD_TYPE;
boardTypeId = adl::PCI6216;
INFO_STREAM << "BoardType resolved to PCI6216" << endl;
}
else
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment