Add tracking-related interfaces for ASCOM mounts - #1457
Merged
Conversation
agalasso
reviewed
Aug 10, 2026
agalasso
reviewed
Aug 16, 2026
agalasso
reviewed
Aug 17, 2026
agalasso
reviewed
Aug 18, 2026
agalasso
left a comment
Contributor
There was a problem hiding this comment.
looks pretty good, a few minor suggestions
agalasso
reviewed
Aug 19, 2026
|
|
||
| bool Scope::GetTrackingRate(TrackingRateInfo *rateInfo) | ||
| { | ||
| rateInfo = &m_supportedTrackingRates.front(); // sidereal |
Contributor
There was a problem hiding this comment.
this won't actually do anything -- it just reassigns the local variable with no visible effect for the caller
Here's what we need:
Suggested change
| rateInfo = &m_supportedTrackingRates.front(); // sidereal | |
| *rateInfo = m_supportedTrackingRates[0]; // sidereal |
Comment on lines
+960
to
+975
| rateInfo->numericalID = (TrackingRate) vRes.iVal; | ||
| switch (rateInfo->numericalID) | ||
| { | ||
| case rateSidereal: | ||
| rateInfo->name = _("Sidereal"); | ||
| break; | ||
| case rateLunar: | ||
| rateInfo->name = _("Lunar"); | ||
| break; | ||
| case rateSolar: | ||
| rateInfo->name = _("Solar"); | ||
| break; | ||
| case rateKing: | ||
| rateInfo->name = _("King"); | ||
| break; | ||
| } |
Contributor
There was a problem hiding this comment.
Let's explicitly check for an unknown rate rather than just quietly fall through. Also, I think it will be better to only update the result when the method succeeds -- no side-effects if the method fails.
Suggested change
| rateInfo->numericalID = (TrackingRate) vRes.iVal; | |
| switch (rateInfo->numericalID) | |
| { | |
| case rateSidereal: | |
| rateInfo->name = _("Sidereal"); | |
| break; | |
| case rateLunar: | |
| rateInfo->name = _("Lunar"); | |
| break; | |
| case rateSolar: | |
| rateInfo->name = _("Solar"); | |
| break; | |
| case rateKing: | |
| rateInfo->name = _("King"); | |
| break; | |
| } | |
| wxString name; | |
| switch (vRes.iVal) | |
| { | |
| case rateSidereal: | |
| name = _("Sidereal"); | |
| break; | |
| case rateLunar: | |
| name = _("Lunar"); | |
| break; | |
| case rateSolar: | |
| name = _("Solar"); | |
| break; | |
| case rateKing: | |
| name = _("King"); | |
| break; | |
| default: | |
| throw ERROR_INFO(wxString::Format("Unknown tracking rate (%d)", vRes.iVal)); | |
| } | |
| rateInfo->numericalID = (TrackingRate) vRes.iVal; | |
| rateInfo->name = name; |
Contributor
Author
|
Yes, getting close - about like Christmas... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.