BallAerospace / COSMOS

Ball Aerospace COSMOS
https://ballaerospace.github.io/cosmos-website/
Other
360 stars 129 forks source link

Unmatched Number of Parentheses in Telemetry Screens api.cmd Example. #1738

Closed dlackner closed 2 years ago

dlackner commented 2 years ago

Describe the bug In the COSMOS documentation, telemetry_screens/example_file there is an unmatched parentheses (missing a single end quote). I have tried closing the unmatched parentheses and get the error attached in the screenshot. It appears that an unmatched parentheses is the intention? This may not necessarily be a bug, but looking for some clarification.

eg: BUTTON 'Start Collect' "api.cmd('INST COLLECT with TYPE '+screen.get_named_widget('COLLECT_TYPE').text()+', DURATION '+screen.get_named_widget('DURATION').text())"

To Reproduce Steps to reproduce the behavior:

  1. Go to COSMOS Telemetry Screens Documentation
  2. Copy the example file into an IDE and Run
  3. Count the number of parentheses and try running the same file with a matched number of parentheses
  4. See error

Expected behavior Unmatched number of parentheses works Matched number of parentheses does not work

Screenshots file_download_error

Environment (please complete the following information):

jmthomas commented 2 years ago

I think you mean this: https://ballaerospace.github.io/cosmos-website/docs/v5/screens#example-file

    BUTTON 'Start Collect' "api.cmd('INST COLLECT with TYPE '+screen.get_named_widget('COLLECT_TYPE').text()+', DURATION '+screen.get_named_widget('DURATION').text())"

If we break it apart to just the command we get:

"api.cmd('INST COLLECT with TYPE '+screen.get_named_widget('COLLECT_TYPE').text()+', DURATION '+screen.get_named_widget('DURATION').text())"

If we remove the variables we get:

"api.cmd('INST COLLECT with TYPE '+type+', DURATION '+duration)"

The reason the quotes don't seem to match up is we're making a method call in Javascript. So ultimately we're just building up a string which we pass to api.cmd(). It effectively looks like this:

"api.cmd('INST COLLECT with TYPE NORMAL, DURATION 10')"

This is rather messy and confusing but we're at the mercy of Javascript here.