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

Dependency injection #65

Merged
merged 15 commits into from
Nov 4, 2024
Merged

Dependency injection #65

merged 15 commits into from
Nov 4, 2024

Conversation

Yaremadzulynsky
Copy link
Contributor

@Yaremadzulynsky Yaremadzulynsky commented Oct 27, 2024

Description

What was completed, changed, or updated?

All dependency objects used by TelemetryManager (e.g. GroundStationCommunication) are now created in SystemManager before the TM object. Dependencies are passed directly to the TM constructor.

All state data pointers used by TM have been organized to a struct.


Why was this done (if applicable)?

TM can now be created from mock instances for testing.
The order of object construction can be changed, so we can wait until we have all dependencies ready before initializing a TM object.
TM objects can potentially be made outside of SystemManager


Testing

What unit tests were used to validate the code?

  • tools.ps1 compile test

Documentation

Milestone number and name:
M3

Link to Asana task: https://app.asana.com/0/1203458353737758/1208312402823490/f

Reminders

  • Add reviewers to the PR

  • Mention the PR in the appropriate discord channel

Copy link
Contributor Author

@Yaremadzulynsky Yaremadzulynsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

TelemetryManager/Inc/TelemetryManager.hpp Show resolved Hide resolved
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. One note I have is that the SM constructor is starting to look a little cluttered with TM stuff. What we could do is make a function in the SM cpp file called something like setupTM() which will do the TM setup stuff, then call tm->init() after everything is set up.

TelemetryManager/Src/TelemetryManager.cpp Show resolved Hide resolved
Copy link
Contributor Author

@Yaremadzulynsky Yaremadzulynsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 😃

Copy link
Contributor

@larry-pan larry-pan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

Copy link
Contributor

@HardyYu HardyYu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@larry-pan larry-pan merged commit 501aaa7 into main Nov 4, 2024
2 checks passed
@larry-pan larry-pan deleted the Dependency-Injection branch November 4, 2024 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants