From cf015f49e79e9f5add28121516418eb39c46cad4 Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 5 Oct 2009 14:55:28 -0400 Subject: Adding ability to easily reload/reset file --- gr-utils/src/python/gr_plot_qt.py | 8 ++ gr-utils/src/python/pyqt_plot.py | 11 +- gr-utils/src/python/pyqt_plot.ui | 262 ++++++++++++++++++++------------------ 3 files changed, 152 insertions(+), 129 deletions(-) (limited to 'gr-utils') diff --git a/gr-utils/src/python/gr_plot_qt.py b/gr-utils/src/python/gr_plot_qt.py index a5e3463c8..5e2b3065c 100755 --- a/gr-utils/src/python/gr_plot_qt.py +++ b/gr-utils/src/python/gr_plot_qt.py @@ -154,6 +154,10 @@ class gr_plot_qt(QtGui.QMainWindow): Qt.SIGNAL("activated()"), self.open_file) + self.connect(self.gui.action_reload, + Qt.SIGNAL("activated()"), + self.reload_file) + # Set up file position boxes to update current figure self.connect(self.gui.filePosStartLineEdit, Qt.SIGNAL("editingFinished()"), @@ -225,7 +229,11 @@ class gr_plot_qt(QtGui.QMainWindow): print filename self.initialize(filename) + def reload_file(self): + initialize(self.filename) + def initialize(self, filename): + self.filename = filename self.hfile = open(filename, "r") self.setWindowTitle(("GNU Radio File Plot Utility: %s" % filename)) diff --git a/gr-utils/src/python/pyqt_plot.py b/gr-utils/src/python/pyqt_plot.py index 74c43c3eb..3b8b4c9e8 100644 --- a/gr-utils/src/python/pyqt_plot.py +++ b/gr-utils/src/python/pyqt_plot.py @@ -2,8 +2,8 @@ # Form implementation generated from reading ui file 'pyqt_plot.ui' # -# Created: Tue Aug 25 18:18:14 2009 -# by: PyQt4 UI code generator 4.4.3 +# Created: Mon Aug 31 22:12:05 2009 +# by: PyQt4 UI code generator 4.4.4 # # WARNING! All changes made in this file will be lost! @@ -158,7 +158,7 @@ class Ui_MainWindow(object): self.gridLayout.addWidget(self.filePosBox, 3, 0, 1, 1) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtGui.QMenuBar(MainWindow) - self.menubar.setGeometry(QtCore.QRect(0, 0, 927, 24)) + self.menubar.setGeometry(QtCore.QRect(0, 0, 927, 25)) self.menubar.setObjectName("menubar") self.menu_File = QtGui.QMenu(self.menubar) self.menu_File.setObjectName("menu_File") @@ -170,7 +170,10 @@ class Ui_MainWindow(object): self.action_open.setObjectName("action_open") self.action_exit = QtGui.QAction(MainWindow) self.action_exit.setObjectName("action_exit") + self.action_reload = QtGui.QAction(MainWindow) + self.action_reload.setObjectName("action_reload") self.menu_File.addAction(self.action_open) + self.menu_File.addAction(self.action_reload) self.menu_File.addAction(self.action_exit) self.menubar.addAction(self.menu_File.menuAction()) @@ -202,5 +205,7 @@ class Ui_MainWindow(object): self.action_open.setText(QtGui.QApplication.translate("MainWindow", "&Open", None, QtGui.QApplication.UnicodeUTF8)) self.action_open.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+O", None, QtGui.QApplication.UnicodeUTF8)) self.action_exit.setText(QtGui.QApplication.translate("MainWindow", "E&xit", None, QtGui.QApplication.UnicodeUTF8)) + self.action_reload.setText(QtGui.QApplication.translate("MainWindow", "&Reload", None, QtGui.QApplication.UnicodeUTF8)) + self.action_reload.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+R", None, QtGui.QApplication.UnicodeUTF8)) from PyQt4 import Qwt5 diff --git a/gr-utils/src/python/pyqt_plot.ui b/gr-utils/src/python/pyqt_plot.ui index 19a62adf5..55c72fda2 100644 --- a/gr-utils/src/python/pyqt_plot.ui +++ b/gr-utils/src/python/pyqt_plot.ui @@ -1,7 +1,8 @@ - + + MainWindow - - + + 0 0 @@ -9,62 +10,62 @@ 696 - + MainWindow - - - - - + + + + + Qt::Horizontal - - - + + + 0 - - + + Time Domain - + - + - - + + Frequency Domain - + - - + + 160 0 - + FFT Properties - - + + QFormLayout::AllNonFixedFieldsGrow - - - + + + 96 0 - + 96 16777215 @@ -72,9 +73,9 @@ - - - + + + FFT Size @@ -83,37 +84,37 @@ - + - - + + Spectrogram - + - - + + Spectrogram Properties - - - - + + + + FFT Size - - - + + + 96 0 - + 96 16777215 @@ -125,7 +126,7 @@ - + specPlot @@ -133,19 +134,19 @@ - - - + + + 0 120 - + File Position - - + + 0 20 @@ -153,41 +154,41 @@ 92 - - - - + + + + Start - - + + - - - + + + Stop - - + + - - - + + + Length - - + + - - + + 180 20 @@ -195,41 +196,41 @@ 92 - - - - + + + + time start (sec) - - + + - - - + + + time stop (sec) - - + + - - - + + + time length (sec) - - + + - - + + 530 0 @@ -237,17 +238,17 @@ 120 - + 200 0 - + System Properties - - + + 0 20 @@ -255,17 +256,17 @@ 91 - - - - + + + + Sample Rate - - - + + + 0 0 @@ -276,8 +277,8 @@ - - + + 730 0 @@ -285,17 +286,17 @@ 120 - + 170 0 - + Display Properties - - + + 0 20 @@ -303,16 +304,16 @@ 91 - + - + - - + + Qt::Vertical - + 20 40 @@ -327,38 +328,47 @@ - - + + 0 0 927 - 24 + 25 - - + + &File - - + + + - + - - - + + + &Open - + Ctrl+O - - + + E&xit + + + &Reload + + + Ctrl+R + + @@ -375,11 +385,11 @@ MainWindow close() - + -1 -1 - + 399 347 -- cgit