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

Replace object type booleans with methods. This removes the need for … #2536

Conversation

colossatr0n
Copy link
Contributor

@colossatr0n colossatr0n commented Jul 26, 2022

…managing object type state and delegates it to the StelObjectMgr.

Description

The Observability plugin manages object type state within the draw method. This is an error prone manual process that must be tracked by the developer when refactoring. This PR removes the need to manage the state and delegates it back to the StelObjectMgr by using methods that consume the object selection and return whether or not the object is the specified type.

Fixes # (issue)

Screenshots (if appropriate):

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • This change requires a documentation update

How Has This Been Tested?

The changes in this PR are essentially a one-to-one conversion from the previous logic, with the exception of the introduction of isSystemPlanet.

These changes were tested by running a pre-change and post-change stellarium instance, selecting the moon, sun, a planet, and an interstellar star, and comparing the output from each instance.

Test Configuration:

  • Operating system: macOS Catalina v10.15.7
  • Graphics Card: Intel Iris 1536 MB

Checklist:

  • My code follows the code style of this project.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (header file)
  • I have updated the respective chapter in the Stellarium User Guide
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@github-actions github-actions bot requested review from alex-w and gzotti July 26, 2022 03:41
@github-actions github-actions bot added the has conflicts The pull request has conflicts label Jul 27, 2022
@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@gzotti
Copy link
Member

gzotti commented Jul 27, 2022

Thanks for taking up work on this plugin. It actually deserves a thorough redesign!

@alex-w alex-w added this to the 0.22.3 milestone Jul 27, 2022
@github-actions github-actions bot removed the has conflicts The pull request has conflicts label Jul 28, 2022
@github-actions
Copy link

Conflicts have been resolved. A maintainer will review the pull request shortly.

Copy link
Member

@gzotti gzotti left a comment

Choose a reason for hiding this comment

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

Otherwise it seems OK. Please rebase your PRs on master so that we can merge more easily.

Copy link
Member

@alex-w alex-w left a comment

Choose a reason for hiding this comment

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

Thanks!

@colossatr0n colossatr0n force-pushed the observability-replace-object-bools-with-methods branch from 4746d7e to 5ae4149 Compare August 3, 2022 14:27
@colossatr0n
Copy link
Contributor Author

colossatr0n commented Aug 3, 2022

Rebased. I still need to test the rebased changes.

…managing object type state and delegates it to the StelObjectMgr.
@colossatr0n colossatr0n force-pushed the observability-replace-object-bools-with-methods branch from c40bb27 to af2925f Compare August 5, 2022 14:07
Copy link
Member

@gzotti gzotti left a comment

Choose a reason for hiding this comment

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

Yes, now we are there. Thanks!

@gzotti gzotti merged commit ff6fb3a into Stellarium:master Aug 5, 2022
@github-actions
Copy link

github-actions bot commented Sep 4, 2022

Hello @colossatr0n! Please check the fresh version (development snapshot) of Stellarium:
https://github.com/Stellarium/stellarium-data/releases/tag/weekly-snapshot

@alex-w alex-w added state: published The fix has been published for testing in weekly binary package and removed state: fixed labels Sep 10, 2022
@github-actions
Copy link

Hello @colossatr0n!

Please check the fresh version (development snapshot) of Stellarium:
https://github.com/Stellarium/stellarium-data/releases/tag/weekly-snapshot

@alex-w alex-w removed the state: published The fix has been published for testing in weekly binary package label Oct 1, 2022
@github-actions
Copy link

github-actions bot commented Oct 1, 2022

Hello @colossatr0n!

Please check the latest stable version of Stellarium:
https://github.com/Stellarium/stellarium/releases/latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants