paramSet_* Handlers #4915
maxfirefly
started this conversation in
Ideas
Replies: 2 comments 15 replies
-
|
@maxfirefly In your example, is the value invalid due to the mode/phase of the mission, or something else? |
Beta Was this translation helpful? Give feedback.
5 replies
-
|
I suggest maybe |
Beta Was this translation helpful? Give feedback.
10 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Having developed in F' for a number of years now I've run into a number of designs that either aren't feasible or would be more robust if the component had access to either:
Example: I have an enum parameter and the PRM_SET cmdHandler allows it to be set to any value in the enum. However, for whatever reason only a subset of the enum entries are valid for this component's purposes. When ground sends a parameter set command with an invalid value:
MY_PARAM_PRM_SET("INVALID_VALUE")paramSet_MY_PARAM()runs (it's private, I can't override it)m_MY_PARAM = "INVALID_VALUE"parameterUpdated()hook gets calledWe've avoided this issue by using regular member variables and defining our own set_cmdHandlers that check validity, but these obviously can't persist through reboots or leverage the other benefits of parameters.
Being able to validate before the set happens (allow overrides of
paramSet_*maybe) would either let the user:Just spitballing here.
Beta Was this translation helpful? Give feedback.
All reactions