Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions src/ServiceDiscovery/SlowControlElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,14 @@ bool SlowControlElement::SetValue(const char value[]){
bool SlowControlElement::SetValue(std::string value){
mtx.lock();

if(m_type == SlowControlElementType(VARIABLE)){
std::stringstream tmp(value);
double val=0;
tmp>>val;
mtx.unlock();
return SetValue(val);
}

if(m_change_function!=0){
try{
m_change_function(value.c_str());
Expand All @@ -227,14 +235,9 @@ bool SlowControlElement::SetValue(std::string value){
}
}

if(m_type == SlowControlElementType(VARIABLE)){
std::stringstream tmp(value);
double val=0;
tmp>>val;
mtx.unlock();
return SetValue(val);
}
else if(m_type == SlowControlElementType(INFO)){ //sanitising for web printout


if(m_type == SlowControlElementType(INFO)){ //sanitising for web printout
for(unsigned int i=0; i<value.length(); i++){
if(value.at(i)==',') value.at(i)='.';
else if (value.at(i)=='{') value.at(i)='[';
Expand Down
Loading