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

Allow setting variables in TlmViewer screens #1647

Closed
ghost opened this issue May 20, 2022 · 1 comment · Fixed by #1652
Closed

Allow setting variables in TlmViewer screens #1647

ghost opened this issue May 20, 2022 · 1 comment · Fixed by #1652

Comments

@ghost
Copy link

ghost commented May 20, 2022

You should be able to set a variable in a TlmViewer screen to enable processing on named widgets. Something like:

BUTTON 'Point BSA' "unitVecX = Math.cos(parseInt(screen.get_named_widget('EL_DEG').text()) * Math.PI); api.cmd(‘PCE BSA_INERTIAL_PTG_MODE with BSA_INERTIAL_PTG_MODE_RAW_LOS_X '+ unitVecX)”

This doesn't appear to work, perhaps due to strict mode in EcmaScript 5? Possible solution is to create a tmp or variable ahead of time such that it can be used for things like this.

@ghost
Copy link

ghost commented May 20, 2022

This seems like it should work. Strict mode should only keep variables from leaking out of the eval, but they should still work within.

@ghost ghost closed this as completed in #1652 May 24, 2022
@ghost ghost added this to the v5.0.4 milestone May 24, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

0 participants