updated slow control prototype - #82
brichards64 wants to merge 1 commit into
Conversation
| SC_vars["State"]->SetValue(0); | ||
| Add("ClearState",SlowControlElementType(BUTTON), | ||
| [this](const char*) -> std::string { ClearState(); return "OK";}, | ||
| [this](const char*, const char*, std::string&) -> bool { ClearState(); return true;}, |
There was a problem hiding this comment.
doesn't set response. Might want to.
| ret = false; | ||
| } | ||
| if(!ret){ | ||
| std::cerr<<"failed to call read fucntion"<<m_name<<" : "<<response<<std::endl; |
| ret = false; | ||
| } | ||
| if(!ret){ | ||
| std::cerr<<"failed to call change fucntion "<<m_name<<" : "<<response<<std::endl; |
There was a problem hiding this comment.
fucntion 🙃
probably better to unlock before cout really
| return GetValue(value, tmp); | ||
| } | ||
|
|
||
| bool SlowControlElement::GetValue(std::string &value, std::string& response){ |
There was a problem hiding this comment.
Why does GetValue accept a value and a response....? What goes in what?
| mtx.unlock(); | ||
| return false; | ||
| } | ||
| options.Get("value", value); |
There was a problem hiding this comment.
so if there's an m_read_function response gets the value as well, but if not it doesn't? :/ Hmmmm, not really intuitive...
| @@ -90,6 +93,11 @@ namespace ToolFramework{ | |||
|
|
|||
|
|
|||
| template<typename T> bool SetValue(T value){ | |||
There was a problem hiding this comment.
why are we maintaining all these SetValue signatures that don't return a response?
| ret = false; | ||
| } | ||
| if(!ret){ | ||
| std::cerr<<"failed to call change fucntion "<<m_name<<" : "<<response<<std::endl; |
There was a problem hiding this comment.
fucntion ಠ⌣ಠ
unlock before cout
| ret = false; | ||
| } | ||
| if(!ret){ | ||
| std::cerr<<"failed to call read fucntion "<<m_name<<" : "<<response<<std::endl; |
There was a problem hiding this comment.
fucntion ◔ ◡ ◔
unlock before cout
| ret= false; | ||
| } | ||
| if(!ret){ | ||
| std::cerr<<"failed to call read fucntion "<<m_name<<" : "<<response<<std::endl; |
There was a problem hiding this comment.
fucntion! ٩( ❛ᴗ❛ )۶
unlock before cout
|
SlowControlElement has six different overrides of SetValue. Two templated, four not. This just seems silly. |
No description provided.