diff --git a/src/ServiceDiscovery/Services.cpp b/src/ServiceDiscovery/Services.cpp index bf90741..28373ab 100644 --- a/src/ServiceDiscovery/Services.cpp +++ b/src/ServiceDiscovery/Services.cpp @@ -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; } @@ -1222,7 +1224,7 @@ std::string Services::LoadConfigSlowControlFunc(const char* control){ if(count==5){ ret <<"Failed to load config "<SetValue(1); @@ -1231,13 +1233,17 @@ std::string Services::LoadConfigSlowControlFunc(const char* control){ ret <<"Loaded config "<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){ diff --git a/src/ServiceDiscovery/Services.h b/src/ServiceDiscovery/Services.h index d41ba0c..0a4f4e7 100644 --- a/src/ServiceDiscovery/Services.h +++ b/src/ServiceDiscovery/Services.h @@ -112,6 +112,7 @@ namespace ToolFramework { bool AddSlowControlVariable(std::string name, SlowControlElementType type, std::function change_function=nullptr, std::function read_function=nullptr); bool RemoveSlowControlVariable(std::string name); void ClearSlowControlVariables(); + void ResetConfigIDs(); bool AlertSubscribe(std::string alert, std::function function); bool AlertSend(std::string alert, std::string payload);