Skip to content
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

Restrict command parameters to configured states #1471

Open
321github123 opened this issue Aug 13, 2024 · 5 comments · Fixed by #1661 · May be fixed by #1670
Open

Restrict command parameters to configured states #1471

321github123 opened this issue Aug 13, 2024 · 5 comments · Fixed by #1661 · May be fixed by #1670
Assignees
Labels
COSMOS 6 Done for COSMOS 6 release enhancement New feature or request

Comments

@321github123
Copy link

First check out our main documentation site at https://openc3.com.

Is your feature request related to a problem? Please describe.
For a command parameter that has a set of states (i.e. an enumeration), would it be possible to restrict the user to only sending a parameter that is one of the states?

Describe the solution you'd like
The user cannot set a value via MANUALLY_ENTERED that is not a valid state.

Additional context
image

Cosmos allows the manually entering of a non-valid state, e.g., 777, and the sending the command with this parameter.

@jmthomas
Copy link
Member

If we're talking just about Command Sender then I think that's reasonable. We'll always allow the user to override the command parameter in a script because that's really useful for edge case testing in the UUT software.

If we disable the MANUALLY_ENTERED field in Command Sender they would still be able to go into the script output and edit it manually to send whatever.

@jmthomas jmthomas added the enhancement New feature or request label Aug 13, 2024
@321github123
Copy link
Author

Disabling the MANUALLY_ENTERED in Command Sender sounds like a good near term solution. Could we add a flag that enforces the state enumeration?

@ryanmelt
Copy link
Member

We can add a RANGE_CHECK_STATES flag

@jmthomas
Copy link
Member

jmthomas commented Aug 14, 2024

We already have variations on cmd: cmd, cmd_no_range_check, cmd_no_hazardous_check, cmd_no_checks. It seems like this should be part of the cmd_no_range_check category. If you send a command with a bad state enumeration using cmd it should fail unless you use cmd_no_range_check. This is a pretty big breaking change though so we couldn't implement it until COSMOS 6.

@ryanmelt
Copy link
Member

The default behavior can't change until COSMOS 6, but we could add the new feature flag before then.

@jmthomas jmthomas self-assigned this Oct 22, 2024
@jmthomas jmthomas reopened this Nov 4, 2024
@jmthomas jmthomas added the COSMOS 6 Done for COSMOS 6 release label Nov 4, 2024
@jmthomas jmthomas linked a pull request Nov 4, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
COSMOS 6 Done for COSMOS 6 release enhancement New feature or request
Projects
None yet
3 participants