Skip to content
Snippets Groups Projects
Commit d1d60d57 authored by Jade PHAM's avatar Jade PHAM
Browse files

use strcpy only one time in read_attribut

parent c4a5ccda
Branches
Tags
No related merge requests found
......@@ -503,6 +503,7 @@ void MCCE2Electrometers::write_electrometerChannel(Tango::WAttribute &attr)
*attr_range1_read = get_range();
}
else
{
......@@ -527,6 +528,7 @@ void MCCE2Electrometers::write_electrometerChannel(Tango::WAttribute &attr)
WARN_STREAM << "Cannot control electrometer on this channel : seems that nothing is connected on!" << std::endl;
//- warn nothing is connected on this channel
strcpy(*attr_range2_read,_notConnectedStr.c_str());
}
}
attr_electrometerChannel_write = w_val;
......@@ -546,9 +548,13 @@ void MCCE2Electrometers::read_range1(Tango::Attribute &attr)
DEBUG_STREAM << "MCCE2Electrometers::read_range1(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(MCCE2Electrometers::read_range1) ENABLED START -----*/
if ( !this->_electrometerCH1 )
{
std::string tmp = *attr_range1_read;
if (strcmp(tmp.c_str(),_notConnectedStr.c_str()))
{
strcpy(*attr_range1_read,_notConnectedStr.c_str());
}
}
else
{
if ( this->_updateRange1FromHW && *attr_electrometerChannel_read == ELETRO_CHANNEL_ONE )
......@@ -576,9 +582,14 @@ void MCCE2Electrometers::read_range2(Tango::Attribute &attr)
DEBUG_STREAM << "MCCE2Electrometers::read_range2(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(MCCE2Electrometers::read_range2) ENABLED START -----*/
if ( !this->_electrometerCH2 )
{
std::string tmp = *attr_range2_read;
if (strcmp(tmp.c_str(),_notConnectedStr.c_str()))
{
strcpy(*attr_range2_read,_notConnectedStr.c_str());
}
}
else
{
if ( this->_updateRange2FromHW && *attr_electrometerChannel_read == ELETRO_CHANNEL_TWO )
......@@ -2495,7 +2506,6 @@ void MCCE2Electrometers::create_electrometers_obj()
case 1 :
case 2 :
case 3 :
// this->_electrometerCH1 = new N_PhotoVoltaique (proxyName, channelNumber, electrometerTypeCh1);
this->_electrometerCH1 = new N_PhotoVoltaique (proxyName, electrometer1Address,comProtocol);
break;
case 4 :
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment