-
-
Notifications
You must be signed in to change notification settings - Fork 815
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
GPS location managed by Windows #2620
Conversation
Great PR! Please pay attention to the following items before merging: Files matching
This is an automatically generated QA checklist based on modified files |
8df3c25
to
8c639df
Compare
…um.git into uwes-ufo-gps
I can try use GPS-dongle to test this PR tomorrow |
I am busy this week. Maybe I can find a slot to test the smartphone/BT bridge which worked with the existing solution. |
The PR works with GPS-dongle u-blox 7, but this is through NMEA |
No. |
src/core/StelLocationMgr.cpp
Outdated
loc.name = QString("GPS %1%2 %3%4") | ||
.arg(loc.latitude<0?"S":"N").arg(floor(.5+abs(loc.latitude))) | ||
.arg(loc.longitude<0?"W":"E").arg(floor(.5+abs(loc.longitude))); | ||
core->moveObserverTo(loc, 0.0, 0.0); |
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.
These two lines could also be replaced by
emit queryFinished(loc);
to avoid some code duplication.
src/core/StelLocationMgr.cpp
Outdated
loc.isUserLocation = true; | ||
loc.planetName = "Earth"; | ||
loc.name = QString("GPS %1%2 %3%4") | ||
.arg(loc.latitude<0?"S":"N").arg(floor(.5+abs(loc.latitude))) |
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.
I understand the 0.5 is for rounding purposes. In this case we should also change the GPS-based name of the NMEALookupHelper::nmeaUpdated() on which this method is based.
…um.git into uwes-ufo-gps
Good to remove the code duplicates, thanks. Can you please add some lines of user documentation into guide/ch_advanced_use.tex, at line 448? Built-in GPS sensors in WIndows devices are new to me. |
…um.git into uwes-ufo-gps
"... When this location setting is enabled, the Microsoft location service will use a combination of global positioning service (GPS), nearby wireless access points, cell towers, and your IP address (or default location) to determine your device’s location ..." So you may get an approximate position without a GPS sensor? I deactivated my gps sensor in the device manager as a test - it still works, but I don't get any altitude information. |
The NmeaPositionInfoSource is a subclass. Uwe apparently has a Win11 device with built-in GPS receiver, which communicates directly. |
Ah good! If that is what is used here, fine. Maybe the button should then be renamed on Windows: Get location from GPS or system service |
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.
OK, seems to work. I can use my Bluetooth NMEA or the system's fallback service.
Thank you!
Yes, it seems this result is similar to the "get location from Network" option. |
Hello @uwes-ufo! Please check the fresh version (development snapshot) of Stellarium: |
What I stumbled across while browsing... diff --git a/src/core/StelLocationMgr.cpp b/src/core/StelLocationMgr.cpp
index 5c3327c..a49d98d 100644
--- a/src/core/StelLocationMgr.cpp
+++ b/src/core/StelLocationMgr.cpp
@@ -1053,7 +1053,7 @@
.arg(loc.latitude<0?"S":"N").arg(qRound(abs(loc.latitude)))
.arg(loc.longitude<0?"W":"E").arg(qRound(abs(loc.longitude)));
- StelApp::getInstance().getCore()->moveObserverTo(loc, 0.0, 0.0);
+ core->moveObserverTo(loc, 0.0, 0.0);
if (nmeaHelper)
{
if (verbose) |
Hello @uwes-ufo! Please check the latest stable version of Stellarium: |
Description
GPS location managed by Windows
On Windows systems, built-in GPS sensors are managed by the operating system. There is no serial port or NMEA protocol. But Qt can handle it.
Type of change
How Has This Been Tested?
Test Configuration:
Checklist: