summaryrefslogtreecommitdiff
path: root/xgps
diff options
context:
space:
mode:
authorFred Wright <fw@fwright.net>2017-01-19 18:50:38 -0800
committerFred Wright <fw@fwright.net>2017-01-19 18:50:38 -0800
commita849277d3bd54aacf22df6c3ea1bf3b1c3054e6d (patch)
tree2d0600384fcf7cc041ed3406d2a9e7270bec98e9 /xgps
parente91f750c1e9ac1e1340181febf89201cb3cce8bd (diff)
downloadgpsd-a849277d3bd54aacf22df6c3ea1bf3b1c3054e6d.tar.gz
Increases MAXCHANNELS in xgps.
The current MAXCHANNELS value in xgps, obtained from gps.py, has been observed to be inadequate. The value in gps.py is an outdated value that was never updated when the C value was changed, but using the new value of 72 in xgps would result in a huge window. This change defines a local MAXCHANNELS in xgps, which does not need to match the value in gps.py. It's currently set to 28, based on having observed a case with 25 visible satellites. It would be better to make it dynamic, but that would require reworking some of the Gtk setup code. TESTED: Ran against a receiver reporting 25 visible satellites, seeing all satellites reported and no console error messages.
Diffstat (limited to 'xgps')
-rwxr-xr-xxgps10
1 files changed, 7 insertions, 3 deletions
diff --git a/xgps b/xgps
index d27b273c..078788a3 100755
--- a/xgps
+++ b/xgps
@@ -34,6 +34,10 @@ import cairo
import gps
import gps.clienthelpers
+# Use our own MAXCHANNELS value, due to the tradeoff between max sats and
+# the window size. Ideally, this should be dynamic.
+MAXCHANNELS = 28
+
# how to sort the Satellite List
# some of ("PRN","el","az","ss","used") with optional '-' to reverse sort
# by default, used at the top, then sort PRN
@@ -574,7 +578,7 @@ class Base(object):
view.append_column(column)
self.row_iters = []
- for i in range(gps.MAXCHANNELS):
+ for i in range(MAXCHANNELS):
self.satlist.append(["", "", "", "", ""])
self.row_iters.append(self.satlist.get_iter(i))
@@ -669,7 +673,7 @@ class Base(object):
try:
self.satlist.set_value(self.row_iters[row], column, str(value))
except IndexError:
- sys.stderr.write("xgps: channel = %d, MAXCHANNELS = %d\n" % (row, gps.MAXCHANNELS))
+ sys.stderr.write("xgps: channel = %d, MAXCHANNELS = %d\n" % (row, MAXCHANNELS))
def delete_event(self, _widget, _event, _data=None):
Gtk.main_quit()
@@ -802,7 +806,7 @@ class Base(object):
if satellite.used:
yesno = 'Y'
self.set_satlist_field(i, 4, yesno)
- for i in range(len(satellites), gps.MAXCHANNELS):
+ for i in range(len(satellites), MAXCHANNELS):
for j in range(0, 5):
self.set_satlist_field(i, j, "")
self.skyview.redraw(satellites)