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
archaeolines plugin: increase location accuracy #1447
archaeolines plugin: increase location accuracy #1447
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix CodeFactor warning
It may then be worth using the same coordinate input boxes that are used in the Location panel. They also automatically react to decimal degrees setting. |
Good idea! Plus following “Use decimal degrees” option from main GUI. |
I've looked into the code of both classes and this is far from trivial. To start, both modules were written very differently (especially event handling). Also, additional work would be nice, eg introduce additional UI classes derived from I'd see this in a separate change request that should no longer block the current change. |
Why you added weird StelLocation method? Why you added const int variables with strange names and why you don’t use it completely? Why AngleSpinBox is too hard to you and why you want to get a separate classes? |
I won't take such aggressive remarks, sorry. This is NOT the way to treat contributions. You should be ashamed of your attitude! |
Really?! Where do you see "aggressive remarks"? Maybe here:
But I really do not understand why you add a new method in StelLocation class which is unusable in any part of Stellarium except for one place - ArcheoLines plugin. Why you not use simple struct here? Maybe here:
You are added the LOCATION_DEGREE_PRECISION_DIGITS and LOCATION_RAD_PRECISION_DIGITS variables, but... where you see radians for latitude and longitude? Right now by the fact both variables are added just because you may add them. Why didn't you use LOCATION_RAD_PRECISION_DIGITS within the AngleSpinBox class (Hint: see constructor)? Or maybe here:
I don't understand why AngleSpinBox is not usable for you and you need 2 separate classes for coordinates. Why I should be ashamed if you writing something strange and unobvious? |
Great PR! Please pay attention to the following items before merging: Files matching
This is an automatically generated QA checklist based on modified files |
As a result of not accepting this PR, the current implementation (0.20.4) shows a horrible angular precision issue, just because the input boxes do not accept a higher precision. here is the proposed change: master...axd1967:contrib/plugin/archeo/20201229-precision One will notice that the proposed changes are very simple and basic (and removes DRY and meant to be more readable, with the price of an added dependency...). And I explain why I refuse to perform further refactoring. In exchange, I am being scolded. Profusingly. |
What is KBC, what kind of line have you set, and what is DRY? You can set a line to 1/100 degrees accuracy, exceeding application of naked-eye resolution this plugin's use was originally intended for. In a process of further developing this plugin it may make sense to replace Qt's default DoubleSpinBox by whatever multi-angle-detail GUI input element has been developed for use in the Location panel. A cheap solution would be to increase field width to 7 post-comma places. What for? |
@axd1967 you are added new method in StelLocation class where is not used in this class, you are defined 2 variables in AngleSpinBox class and both variables are not used in this class - I asked why you doing it and what I got in answer? |
In the Location panel and in the AstroCalc tool we use standard Qt's spinboxes, but with DMS style - no need some special for it. To follow DD/DMS styles we need add additional 5 lines in the code - no need any strange work as @axd1967 proposed. |
OK, even better. |
KBC doesn't matter. it is a custom geographic location that I defined in the archeo plugin, and the corresponding azimuth towards that same location was separately computed in the landscape. because of the limited input precision of the archeo plugin, it is currently not capable to compute accurate azimuths for nearby locations: the result in this case is a 7-degree difference. For DRY, see https://en.wikipedia.org/wiki/Don%27t_repeat_yourself . that's the "strange work" and the seemingly "unneeded" constructor (and it's not because a method is not used in a class, that it makes no sense. a class can provide services for its clients without using those services). I believe in readability over efficiency, especially in an open source product: better readable code will attract more developers, who will then be even more productive. |
According to DRY principle you should obtain coordinates for 2 locations from existing database of locations through existing methods in the class - not adding messing through adding "empty" methods with doubling data and unobvious dependencies. Please read about KISS principle. Same problem for introduced by you 2 variables in one class to using exclusively in the other class (really it need one variable!). |
Finally you expressed the problem case clear enough to understand. Nearby locations. |
Good point, @gzotti , but no cigar, as I already mention it in the PR :-) |
I don't smoke... ;-) |
- also add some property connector code to the AngleSpinBox - also make sure cursor position does not change while mouse-wheeling an angle
#1573 should provide what you need. |
- Add Polar Circles (Fix #1555) - Add two custom altitude lines - Replace angle DoubleSpinBoxes by AngleSpinBoxes. (Supersedes #1447) - Allow grabbing declination/azimuth/altitude data from selected object - Allow direct selection of locations from Stellarium's location list - SUG: Updated description of ArchaeoLines - Added QTextEdit StelProperty connections - AngleSpinBox: - add property connector code - make sure cursor position does not change while mouse-wheeling an angle Co-authored-by: Alexander Wolf <aw@altspu.ru>
Hello @axd1967! Please check the latest stable version of Stellarium: |
Description
The custom location lat/long input boxes accepted 2 digits after the comma, which lead to considerable azimuth deviations for custom locations less than a few km distant.
Precision has been increased to 6 digits (as used in current location precision).
Screenshots (if appropriate):
Type of change
How Has This Been Tested?
Test Configuration:
Checklist:
Note
There is a strange behaviour when entering values by keyboard (this used to happen in Ocular plugin if I'm not mistaken): the GUI prevents entering several digits at a time, so one has to enter digits one by one. Maybe due to too early event handling?
edit added: this is an issue that existed before this PR.
Workaround: after entering a digit, select the remaining digits (SHIFT+END) and type the next digit, until all digits have been entered.