Skip to content
Merged
Show file tree
Hide file tree
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
14 changes: 10 additions & 4 deletions src/ServiceDiscovery/Services.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Services::Services(){
m_context=0;
m_name="";
m_verbose=false;
m_base_config_id=0;
m_run_mode_config_id=0;

}

Expand Down Expand Up @@ -1222,7 +1224,7 @@ std::string Services::LoadConfigSlowControlFunc(const char* control){

if(count==5){
ret <<"Failed to load config "<<base_config_id<<":"<<run_mode_config_id;
return ret.str();;
return ret.str();
}

(*sc_vars)["NewConfig"]->SetValue(1);
Expand All @@ -1231,13 +1233,17 @@ std::string Services::LoadConfigSlowControlFunc(const char* control){
ret <<"Loaded config "<<base_config_id<<":"<<run_mode_config_id;
}

// FIXME currently webpage chokes if a slow control value contains JSON
(*sc_vars)[control]->SetValue("");

return ret.str();

}

void Services::ResetConfigIDs(){
// reset the active configuration numbers so that the next ChangeConfig alert will invoke the callback.
m_base_config_id = 0;
m_run_mode_config_id = 0;
return;
}

// ========================

void Services::BufferThread(Thread_args* args){
Expand Down
1 change: 1 addition & 0 deletions src/ServiceDiscovery/Services.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ namespace ToolFramework {
bool AddSlowControlVariable(std::string name, SlowControlElementType type, std::function<std::string(const char*)> change_function=nullptr, std::function<std::string(const char*)> read_function=nullptr);
bool RemoveSlowControlVariable(std::string name);
void ClearSlowControlVariables();
void ResetConfigIDs();

bool AlertSubscribe(std::string alert, std::function<bool(const char*, const char*)> function);
bool AlertSend(std::string alert, std::string payload);
Expand Down
Loading