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

Fix write & read bias on lucum pb (TANGODEVIC-135)

parent 352132c4
Branches
Tags
No related merge requests found
......@@ -789,10 +789,10 @@ Tango::DevString LoCuM_4::send_locum4_command(Tango::DevString argin)
// check current bias & property (if set)
if (_biasDefinedOk)
{
if (bias.compare(_biasValue) != 0)
if (!this->compare_bias()) // compare bias setpoint (property) & current bias value
{
// current bias value differs from property => force new bias value
std::string l_bias = "CONF:BIAS:SOURCE:" + this->bias;
std::string l_bias = "$01:CONF:BIAS:SOURCE " + this->bias;
_DEV_TRY(
write_read(l_bias,false),
......@@ -973,7 +973,7 @@ Tango::DevString LoCuM_4::send_locum4_command(Tango::DevString argin)
// check bias value (if defined)
if (_biasDefinedOk)
{
if (bias.compare(this->_biasValue) != 0)
if (!this->compare_bias()) // compare bias setpoint (property) & current bias value
{
// The current bias value differs from the property value
_biasAlarm = true;
......@@ -985,5 +985,42 @@ Tango::DevString LoCuM_4::send_locum4_command(Tango::DevString argin)
}
}
// ********************************************************************************************
// compare_bias()
//
// description:
// 1 - compares the bias setpoint set in device property to current bias value
// 2 - returns true if equal, false if differ
//
// **********************************************************************************************
bool LoCuM_4::compare_bias()
{
bool biasEqual = false;
// bias setpoint: MINUS, DEF, EXT, PLUS
// bias read from locum: S2_Minus, S2_0Volt, S2_EXT, S2_Plus
if ((this->bias.compare("MINUS") == 0) &&
(this->_biasValue.compare("S2_Minus") == 0))
{
biasEqual = true;
}
if ((this->bias.compare("PLUS") == 0) &&
(this->_biasValue.compare("S2_Plus") == 0))
{
biasEqual = true;
}
if ((this->bias.compare("EXT") == 0) &&
(this->_biasValue.compare("S2_Ext") == 0))
{
biasEqual = true;
}
if ((this->bias.compare("DEF") == 0) &&
(this->_biasValue.compare("S2_0Volt") == 0))
{
biasEqual = true;
}
return biasEqual;
}
} // namespace
......@@ -304,6 +304,7 @@ private:
void get_config(void);
void configure(void);
void get_bias(std::string config);
bool compare_bias();
};
} // namespace_ns
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment