BallAerospace / COSMOS

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

COSMOS5 Table Manager Use Cases #1638

Closed jwestra-carrastro closed 2 years ago

jwestra-carrastro commented 2 years ago

As there is not yet documentation on the Table Manager in COSMOS v5, I am unsure how I can utilize it in my projects. I want to create key-value pairs of register names and addresses, so that an address can be retrieved by its name. Can a table be used as a lookup table in script files? And if so, what is the syntax?

ghost commented 2 years ago

I realized we have not yet brought over the Table Manager documentation from COSMOS 4. For now that is a good reference and I will update the COSMOS 5 website. The Table Manager use case is to provide a GUI to edit binary files. You provide the binary file structure and Table Manager interprets this and adds text fields, drop downs, checkboxes, etc to allow for editing. Ultimately it still results in a binary file which can then be uploaded to a target or whatever.

It sounds like you want to create aliases to your Telemetry definitions. Since we allow overlapping telemetry items you can just declare it twice:

ITEM ADDR_1000 32 32 UINT "Register at address 1000"
ITEM SET_REG 32 32 UINT "Register alias SET_REG which mirrors ADDR_1000"
ghost commented 2 years ago

If you just want some sort of config file for your script, you can do that by placing the file in a subfolder of your target, and then get the file in the script using get_target_file().

https://cosmosc2.com/docs/v5/scripting#get_target_file

The format can be whatever you want.