Closed pmelanson closed 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)
Added a bunch of tests and fixed bugs @StefanDeYoung hopefully the tests should make this easier to review.
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.
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!