Attempt to reconnect to gpsd.
(self)
| 506 | |
| 507 | # Talker code -> human constellation name, for the sky view. Shared by the |
| 508 | # gpsd (SKY) and serial (GSV) paths, both of which key by these codes. |
| 509 | _TALKER_NAMES = { |
| 510 | 'GP': 'GPS', 'GL': 'GLONASS', 'GA': 'Galileo', 'GB': 'BeiDou', |
| 511 | 'BD': 'BeiDou', 'GQ': 'QZSS', 'GI': 'NavIC', 'GN': 'combined', |
| 512 | } |
| 513 | |
| 514 | def get_sky_view(self): |
| 515 | """Per-satellite sky list (constellation / prn / az / elev / snr) for the |
| 516 | sky-view plot, from the live GSV/SKY bookkeeping. Only satellites with |
| 517 | both azimuth and elevation (the plottable ones); stale talkers (>30 s) |
| 518 | are skipped. Cheap enough to poll at ~1 Hz for a live view.""" |
| 519 | now = time.time() |
| 520 | with self._lock: |
| 521 | items = [(t, s, ts) for t, (s, ts) in self._sats_by_talker.items()] |
| 522 | out = [] |
| 523 | for talker, sats, ts in items: |
| 524 | if ts and now - ts > 30: |
| 525 | continue |
| 526 | cons = self._TALKER_NAMES.get(talker, talker) |
no test coverage detected