Added wide-view option to FSK gui.
authordarksidelemm <darksidelemm@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 21 Mar 2016 04:41:22 +0000 (04:41 +0000)
committerdarksidelemm <darksidelemm@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 21 Mar 2016 04:41:22 +0000 (04:41 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@2752 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/octave/fskdemodgui.py

index 6012c2dc150896dab7c408fd3a875c0426114535..68562b172140f4b3124b19e473b8f3d5dc07f530 100644 (file)
@@ -9,15 +9,19 @@
 #      updates at about 10Hz. Anything faster will fill up the input queue and be discarded.
 #
 #      Call using: 
-#      <producer>| ./fsk_demod 2X 8 923096 115387 - - S 2> >(python ~/Dev/codec2-dev/python/fskdemodgui.py) | <consumer>
+#      <producer>| ./fsk_demod 2X 8 923096 115387 - - S 2> >(python ~/Dev/codec2-dev/octave/fskdemodgui.py) | <consumer>
 #
 #
-import sys, time, json, Queue
+import sys, time, json, Queue, argparse
 from threading import Thread
 from pyqtgraph.Qt import QtGui, QtCore
 import numpy as np
 import pyqtgraph as pg
 
+parser = argparse.ArgumentParser()
+parser.add_argument("--wide", action="store_true", default=False, help="Alternate wide arrangement of widgets, for placement at bottom of 4:3 screen.")
+args = parser.parse_args()
+
 # Some settings...
 update_rate = 10 # Hz
 history_size = 10*10 # 10 seconds at 10Hz...
@@ -29,19 +33,26 @@ in_queue = Queue.Queue(history_size) # 1-element FIFO...
 win = pg.GraphicsWindow()
 win.setWindowTitle('FSK Demodulator Modem Statistics')
 
+
 # Plot objects
 ebno_plot = win.addPlot(title="Eb/No")
+ppm_plot = win.addPlot(title="Symbol Rate Offset")
+if args.wide == False:
+       win.nextRow()
+else:
+       win.resize(1024,200)
+fest_plot = win.addPlot(title="Tone Frequency Estimation")
+eye_plot = win.addPlot(title="Eye Diagram")
+# Disable auto-ranging on eye plot and fix axes for a big speedup...
+
+
+# Configure plot labels and scales.
 ebno_plot.setLabel('left','Eb/No (dB)')
 ebno_plot.setLabel('bottom','Time (seconds)')
-ppm_plot = win.addPlot(title="Symbol Rate Offset")
 ppm_plot.setLabel('left','Offset (ppm)')
 ppm_plot.setLabel('bottom','Time (seconds)')
-win.nextRow()
-fest_plot = win.addPlot(title="Tone Frequency Estimation")
 fest_plot.setLabel('left','Frequency (Hz)')
 fest_plot.setLabel('bottom','Time (seconds)')
-eye_plot = win.addPlot(title="Eye Diagram")
-# Disable auto-ranging on eye plot and fix axes for a big speedup...
 eye_plot.disableAutoRange()
 eye_plot.setYRange(0,1)
 eye_plot.setXRange(0,15)