stellarium icon indicating copy to clipboard operation
stellarium copied to clipboard

Simplify gridline intersect callbacks

Open gzotti opened this issue 1 year ago • 8 comments

Description

Issue #3688 describes a tiny problem in the gridline manager's labeling of equatorial coordinates. I tried to fix and saw quite a bit of elaborate code was not even required. Or was it?

During development of this branch I will try to remove that possible bloat code also for the other grids.

Fixes #3688 (issue)

Screenshots (if appropriate):

see #3688

Type of change

  • [x] 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
  • [x] Housekeeping

How Has This Been Tested?

Test Configuration:

  • Operating system: Win10, Win11
  • Graphics Card: Geforce cards (irrelevant)

Checklist:

  • [x] My code follows the code style of this project.
  • [x] I have performed a self-review of my own code
  • [x] 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

gzotti avatar Jul 02 '24 14:07 gzotti

Great PR! Please pay attention to the following items before merging:

Files matching src/**/*.cpp:

  • [ ] Are possibly unused includes removed?

This is an automatically generated QA checklist based on modified files.

github-actions[bot] avatar Jul 02 '24 14:07 github-actions[bot]

What is lon supposed to mean? The longitude of the observer on the planet? Why should it affect the label?

10110111 avatar Jul 02 '24 14:07 10110111

lon/lat (longitude/latitude) seem to be the interface points of screen intersection (?) in general spherical names. I have not gone further today, but at least in the equatorial grid they seem not to be required. Or I am missing something important.

gzotti avatar Jul 02 '24 15:07 gzotti

OK, all tests from my side are passed

alex-w avatar Jul 02 '24 16:07 alex-w

Brr, and I just discovered errors. Switch to decimal degrees! Not sure what's happening.

gzotti avatar Jul 02 '24 16:07 gzotti

Brr, and I just discovered errors. Switch to decimal degrees! Not sure what's happening.

Oops... hour angle should be always in hours - this bug exists in the current release too

alex-w avatar Jul 02 '24 16:07 alex-w

Not necessarily. It's really user's choice. See SHA for navigators.

gzotti avatar Jul 02 '24 17:07 gzotti

Coordinates in infobox and in grids should be consistent

alex-w avatar Jul 02 '24 17:07 alex-w

please test with all grids and settings (decimal numbers etc.)

gzotti avatar Sep 08 '24 11:09 gzotti

Hour angles should be measured in hours by definition, not in degrees

P.S. Of course in the current master I see same problem and this is bug IMHO

alex-w avatar Sep 08 '24 13:09 alex-w

Do you mean decimal hours? I am not aware of any use for that. Navigators and maybe others (surveyors?) may prefer decimal degrees for hour angles. This branch/fix should however only change the previous behaviour of a spurious 0 for 12h/180°. Given the simplifications, I hope I did not break other grids now. (I guess a lot of bloat was to mitigate the original problem)

gzotti avatar Sep 08 '24 14:09 gzotti

Hello @gzotti!

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

github-actions[bot] avatar Sep 08 '24 15:09 github-actions[bot]

Hello @gzotti!

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

github-actions[bot] avatar Sep 22 '24 14:09 github-actions[bot]