OCESS / orbitx

Rewrite of OrbitV, maintained by Patrick, Gavin, and contributors
MIT License
10 stars 18 forks source link

Added EngineeringState data to y0, allowing it to be simulated #114

Closed pmelanson closed 4 years ago

pmelanson commented 4 years ago

Next step will be to add a command that actually changes some of this data.

The wrapped EngineeringState is mostly a wrapper with the same interface as the proto (e.g. radiator.functioning can be accessed).

Some added features are:

physics_state.engineering.components can be addressed by name or index: physics_state.engineering.components[RAD1] == physics_state.engineering.components[2]

same for engineering.radiators and engineering.coolant_loops

Special case, physics_state.engineering.radiators.get_coolant_loop() returns the coolant loop that specific radiator is currently connected to. Convenient!

pmelanson commented 4 years ago

@StefanDeYoung sorry for big review, you can ignore any .json changes and feel free to just glance over the data_structures.py code (which is the bulk of this)

pmelanson commented 4 years ago

Added a bunch of tests and fixed bugs @StefanDeYoung hopefully the tests should make this easier to review.

StefanDeYoung commented 4 years ago

This all looks good to me. I will need to play with it to merge it with how I've been building the front end. One missing piece is that the components class will need an attached_to_coolant_loop @property, setter, and getter identical to radiators.