Skip to content

updated slow control prototype - #82

Open
brichards64 wants to merge 1 commit into
mainfrom
updatedslowcontrolfuncs
Open

brichards64 wants to merge 1 commit into
mainfrom
updatedslowcontrolfuncs

Conversation

@brichards64

Copy link
Copy Markdown
Contributor

No description provided.

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;},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't set response. Might want to.

ret = false;
}
if(!ret){
std::cerr<<"failed to call read fucntion"<<m_name<<" : "<<response<<std::endl;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fucntion. :)

ret = false;
}
if(!ret){
std::cerr<<"failed to call change fucntion "<<m_name<<" : "<<response<<std::endl;

@marc1uk marc1uk Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fucntion 🙃
probably better to unlock before cout really

return GetValue(value, tmp);
}

bool SlowControlElement::GetValue(std::string &value, std::string& response){

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does GetValue accept a value and a response....? What goes in what?

mtx.unlock();
return false;
}
options.Get("value", value);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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){

@marc1uk marc1uk Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

@marc1uk marc1uk Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fucntion ಠ⌣ಠ
unlock before cout

ret = false;
}
if(!ret){
std::cerr<<"failed to call read fucntion "<<m_name<<" : "<<response<<std::endl;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fucntion ◔ ◡ ◔
unlock before cout

ret= false;
}
if(!ret){
std::cerr<<"failed to call read fucntion "<<m_name<<" : "<<response<<std::endl;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fucntion! ٩( ❛ᴗ❛ )۶
unlock before cout

@marc1uk

marc1uk commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

SlowControlElement has six different overrides of SetValue. Two templated, four not. This just seems silly.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants