New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AP_Scripting: Add user accessable script parameters #14787
Conversation
I'm not really a fan of this approach. It's going to lead to accidental script collision on the indexing. There was discussion about how to have a script actually declare a parameter dynamically without requiring an array like this. I think the question may be to @tridge if this is actually reasonable. The alternate way that may be worth considering is if you don't need to change it on the fly then writing to the SD card may be reasonable. |
being ignorant, I'm not sure how this is different than having the scripts be able to read other parameters, which they already can...are there collisions there also?if there is concern about two scripts trying to read or use the same param for different purposes, that would the responsibility of the user who is loading the scripts, wouldn't it? |
@@ -77,6 +77,30 @@ const AP_Param::GroupInfo AP_Scripting::var_info[] = { | |||
// @User: Advanced | |||
AP_GROUPINFO("DEBUG_LVL", 4, AP_Scripting, _debug_level, 0), | |||
|
|||
// @Param: PARAM1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// @Param: PARAM1 | |
// @Param: USER1 |
// @User: Standard | ||
AP_GROUPINFO("USER1", 5, AP_Scripting, _user[0], 0.0), | ||
|
||
// @Param: PARAM2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// @Param: PARAM2 | |
// @Param: USER2 |
// @User: Standard | ||
AP_GROUPINFO("USER2", 6, AP_Scripting, _user[1], 0.0), | ||
|
||
// @Param: PARAM3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// @Param: PARAM3 | |
// @Param: USER3 |
// @User: Standard | ||
AP_GROUPINFO("USER3", 7, AP_Scripting, _user[2], 0.0), | ||
|
||
// @Param: PARAM4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// @Param: PARAM4 | |
// @Param: USER4 |
Merged, thanks! |
complementing #14777 which I had suggested and @IamPete1 quickly,, and generously, coded to get user re-configurations into a script without the user having to actually edit a script (simple, but which may be daunting to some), I think this is also needed.
flagging both with DEVCALL for discussion