From 9f2ff1a31b0f4e8ea47a11f0e9674620b97f1e68 Mon Sep 17 00:00:00 2001
From: Tom Rondeau <trondeau@vt.edu>
Date: Thu, 21 Feb 2013 12:34:41 -0500
Subject: qtgui: fixed a autoscale issue with byte file types.

---
 gr-qtgui/apps/plot_base.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

(limited to 'gr-qtgui/apps/plot_base.py')

diff --git a/gr-qtgui/apps/plot_base.py b/gr-qtgui/apps/plot_base.py
index 0990a309b7..52c888cff3 100644
--- a/gr-qtgui/apps/plot_base.py
+++ b/gr-qtgui/apps/plot_base.py
@@ -87,8 +87,14 @@ def read_samples_s(filename, start, in_size, min_size=0):
                         scipy.int16, gr.sizeof_short)
 
 def read_samples_b(filename, start, in_size, min_size=0):
-    return read_samples(filename, start, in_size, min_size,
-                        scipy.uint8, gr.sizeof_char)
+    d,mn,mx = read_samples(filename, start, in_size, min_size,
+                           scipy.int8, gr.sizeof_char)
+
+    # Bit of a hack since we want to read the data as signed ints, but
+    # the gr.vector_source_b will only accept unsigned. We read in as
+    # signed, do our min/max and things on that, then convert here.
+    d = scipy.array(d, dtype=scipy.uint8).tolist()
+    return d,mn,mx
 
 def read_samples_c(filename, start, in_size, min_size=0):
     # Complex samples are handled differently
-- 
cgit v1.2.3