diff options
-rwxr-xr-x | gr-utils/src/python/gr_plot_qt.py | 8 | ||||
-rw-r--r-- | gr-utils/src/python/pyqt_plot.py | 11 | ||||
-rw-r--r-- | gr-utils/src/python/pyqt_plot.ui | 262 |
3 files changed, 152 insertions, 129 deletions
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 @@ -<ui version="4.0" > +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> <class>MainWindow</class> - <widget class="QMainWindow" name="MainWindow" > - <property name="geometry" > + <widget class="QMainWindow" name="MainWindow"> + <property name="geometry"> <rect> <x>0</x> <y>0</y> @@ -9,62 +10,62 @@ <height>696</height> </rect> </property> - <property name="windowTitle" > + <property name="windowTitle"> <string>MainWindow</string> </property> - <widget class="QWidget" name="centralwidget" > - <layout class="QGridLayout" name="gridLayout" > - <item row="2" column="0" colspan="2" > - <widget class="QScrollBar" name="plotHBar" > - <property name="orientation" > + <widget class="QWidget" name="centralwidget"> + <layout class="QGridLayout" name="gridLayout"> + <item row="2" column="0" colspan="2"> + <widget class="QScrollBar" name="plotHBar"> + <property name="orientation"> <enum>Qt::Horizontal</enum> </property> </widget> </item> - <item row="1" column="0" > - <widget class="QTabWidget" name="tabGroup" > - <property name="currentIndex" > + <item row="1" column="0"> + <widget class="QTabWidget" name="tabGroup"> + <property name="currentIndex"> <number>0</number> </property> - <widget class="QWidget" name="timeTab" > - <attribute name="title" > + <widget class="QWidget" name="timeTab"> + <attribute name="title"> <string>Time Domain</string> </attribute> - <layout class="QHBoxLayout" name="horizontalLayout" > + <layout class="QHBoxLayout" name="horizontalLayout"> <item> - <widget class="QwtPlot" name="timePlot" /> + <widget class="QwtPlot" name="timePlot"/> </item> </layout> </widget> - <widget class="QWidget" name="freqTab" > - <attribute name="title" > + <widget class="QWidget" name="freqTab"> + <attribute name="title"> <string>Frequency Domain</string> </attribute> - <layout class="QHBoxLayout" name="horizontalLayout_2" > + <layout class="QHBoxLayout" name="horizontalLayout_2"> <item> - <widget class="QGroupBox" name="fftPropBox" > - <property name="minimumSize" > + <widget class="QGroupBox" name="fftPropBox"> + <property name="minimumSize"> <size> <width>160</width> <height>0</height> </size> </property> - <property name="title" > + <property name="title"> <string>FFT Properties</string> </property> - <layout class="QFormLayout" name="formLayout_4" > - <property name="fieldGrowthPolicy" > + <layout class="QFormLayout" name="formLayout_4"> + <property name="fieldGrowthPolicy"> <enum>QFormLayout::AllNonFixedFieldsGrow</enum> </property> - <item row="0" column="1" > - <widget class="QComboBox" name="psdFFTComboBox" > - <property name="minimumSize" > + <item row="0" column="1"> + <widget class="QComboBox" name="psdFFTComboBox"> + <property name="minimumSize"> <size> <width>96</width> <height>0</height> </size> </property> - <property name="maximumSize" > + <property name="maximumSize"> <size> <width>96</width> <height>16777215</height> @@ -72,9 +73,9 @@ </property> </widget> </item> - <item row="0" column="0" > - <widget class="QLabel" name="psdFFTSizeLabel" > - <property name="text" > + <item row="0" column="0"> + <widget class="QLabel" name="psdFFTSizeLabel"> + <property name="text"> <string>FFT Size</string> </property> </widget> @@ -83,37 +84,37 @@ </widget> </item> <item> - <widget class="QwtPlot" name="freqPlot" /> + <widget class="QwtPlot" name="freqPlot"/> </item> </layout> </widget> - <widget class="QWidget" name="specTab" > - <attribute name="title" > + <widget class="QWidget" name="specTab"> + <attribute name="title"> <string>Spectrogram</string> </attribute> - <layout class="QHBoxLayout" name="horizontalLayout_3" > + <layout class="QHBoxLayout" name="horizontalLayout_3"> <item> - <widget class="QGroupBox" name="groupBox" > - <property name="title" > + <widget class="QGroupBox" name="groupBox"> + <property name="title"> <string>Spectrogram Properties</string> </property> - <layout class="QFormLayout" name="formLayout_3" > - <item row="1" column="0" > - <widget class="QLabel" name="specFFTLabel" > - <property name="text" > + <layout class="QFormLayout" name="formLayout_3"> + <item row="1" column="0"> + <widget class="QLabel" name="specFFTLabel"> + <property name="text"> <string>FFT Size</string> </property> </widget> </item> - <item row="1" column="1" > - <widget class="QComboBox" name="specFFTComboBox" > - <property name="minimumSize" > + <item row="1" column="1"> + <widget class="QComboBox" name="specFFTComboBox"> + <property name="minimumSize"> <size> <width>96</width> <height>0</height> </size> </property> - <property name="maximumSize" > + <property name="maximumSize"> <size> <width>96</width> <height>16777215</height> @@ -125,7 +126,7 @@ </widget> </item> <item> - <widget class="QwtPlot" name="specPlot" /> + <widget class="QwtPlot" name="specPlot"/> </item> </layout> <zorder>specPlot</zorder> @@ -133,19 +134,19 @@ </widget> </widget> </item> - <item row="3" column="0" > - <widget class="QGroupBox" name="filePosBox" > - <property name="minimumSize" > + <item row="3" column="0"> + <widget class="QGroupBox" name="filePosBox"> + <property name="minimumSize"> <size> <width>0</width> <height>120</height> </size> </property> - <property name="title" > + <property name="title"> <string>File Position</string> </property> - <widget class="QWidget" name="formLayoutWidget_2" > - <property name="geometry" > + <widget class="QWidget" name="formLayoutWidget_2"> + <property name="geometry"> <rect> <x>0</x> <y>20</y> @@ -153,41 +154,41 @@ <height>92</height> </rect> </property> - <layout class="QFormLayout" name="filePosLayout" > - <item row="0" column="0" > - <widget class="QLabel" name="filePosStartLabel" > - <property name="text" > + <layout class="QFormLayout" name="filePosLayout"> + <item row="0" column="0"> + <widget class="QLabel" name="filePosStartLabel"> + <property name="text"> <string>Start</string> </property> </widget> </item> - <item row="0" column="1" > - <widget class="QLineEdit" name="filePosStartLineEdit" /> + <item row="0" column="1"> + <widget class="QLineEdit" name="filePosStartLineEdit"/> </item> - <item row="1" column="0" > - <widget class="QLabel" name="filePosStopLabel" > - <property name="text" > + <item row="1" column="0"> + <widget class="QLabel" name="filePosStopLabel"> + <property name="text"> <string>Stop</string> </property> </widget> </item> - <item row="1" column="1" > - <widget class="QLineEdit" name="filePosStopLineEdit" /> + <item row="1" column="1"> + <widget class="QLineEdit" name="filePosStopLineEdit"/> </item> - <item row="2" column="0" > - <widget class="QLabel" name="filePosLengthLabel" > - <property name="text" > + <item row="2" column="0"> + <widget class="QLabel" name="filePosLengthLabel"> + <property name="text"> <string>Length</string> </property> </widget> </item> - <item row="2" column="1" > - <widget class="QLineEdit" name="filePosLengthLineEdit" /> + <item row="2" column="1"> + <widget class="QLineEdit" name="filePosLengthLineEdit"/> </item> </layout> </widget> - <widget class="QWidget" name="formLayoutWidget_4" > - <property name="geometry" > + <widget class="QWidget" name="formLayoutWidget_4"> + <property name="geometry"> <rect> <x>180</x> <y>20</y> @@ -195,41 +196,41 @@ <height>92</height> </rect> </property> - <layout class="QFormLayout" name="fileTimeLayout" > - <item row="0" column="0" > - <widget class="QLabel" name="fileTimeStartLabel" > - <property name="text" > + <layout class="QFormLayout" name="fileTimeLayout"> + <item row="0" column="0"> + <widget class="QLabel" name="fileTimeStartLabel"> + <property name="text"> <string>time start (sec)</string> </property> </widget> </item> - <item row="0" column="1" > - <widget class="QLineEdit" name="fileTimeStartLineEdit" /> + <item row="0" column="1"> + <widget class="QLineEdit" name="fileTimeStartLineEdit"/> </item> - <item row="1" column="0" > - <widget class="QLabel" name="fileTimeStopLabel" > - <property name="text" > + <item row="1" column="0"> + <widget class="QLabel" name="fileTimeStopLabel"> + <property name="text"> <string>time stop (sec)</string> </property> </widget> </item> - <item row="1" column="1" > - <widget class="QLineEdit" name="fileTimeStopLineEdit" /> + <item row="1" column="1"> + <widget class="QLineEdit" name="fileTimeStopLineEdit"/> </item> - <item row="2" column="0" > - <widget class="QLabel" name="fileTimeLengthLabel" > - <property name="text" > + <item row="2" column="0"> + <widget class="QLabel" name="fileTimeLengthLabel"> + <property name="text"> <string>time length (sec)</string> </property> </widget> </item> - <item row="2" column="1" > - <widget class="QLineEdit" name="fileTimeLengthLineEdit" /> + <item row="2" column="1"> + <widget class="QLineEdit" name="fileTimeLengthLineEdit"/> </item> </layout> </widget> - <widget class="QGroupBox" name="sysGroupBox" > - <property name="geometry" > + <widget class="QGroupBox" name="sysGroupBox"> + <property name="geometry"> <rect> <x>530</x> <y>0</y> @@ -237,17 +238,17 @@ <height>120</height> </rect> </property> - <property name="minimumSize" > + <property name="minimumSize"> <size> <width>200</width> <height>0</height> </size> </property> - <property name="title" > + <property name="title"> <string>System Properties</string> </property> - <widget class="QWidget" name="formLayoutWidget_3" > - <property name="geometry" > + <widget class="QWidget" name="formLayoutWidget_3"> + <property name="geometry"> <rect> <x>0</x> <y>20</y> @@ -255,17 +256,17 @@ <height>91</height> </rect> </property> - <layout class="QFormLayout" name="formLayout_2" > - <item row="0" column="0" > - <widget class="QLabel" name="sampleRateLabel" > - <property name="text" > + <layout class="QFormLayout" name="formLayout_2"> + <item row="0" column="0"> + <widget class="QLabel" name="sampleRateLabel"> + <property name="text"> <string>Sample Rate</string> </property> </widget> </item> - <item row="0" column="1" > - <widget class="QLineEdit" name="sampleRateLineEdit" > - <property name="minimumSize" > + <item row="0" column="1"> + <widget class="QLineEdit" name="sampleRateLineEdit"> + <property name="minimumSize"> <size> <width>0</width> <height>0</height> @@ -276,8 +277,8 @@ </layout> </widget> </widget> - <widget class="QGroupBox" name="displayGroupBox" > - <property name="geometry" > + <widget class="QGroupBox" name="displayGroupBox"> + <property name="geometry"> <rect> <x>730</x> <y>0</y> @@ -285,17 +286,17 @@ <height>120</height> </rect> </property> - <property name="minimumSize" > + <property name="minimumSize"> <size> <width>170</width> <height>0</height> </size> </property> - <property name="title" > + <property name="title"> <string>Display Properties</string> </property> - <widget class="QWidget" name="verticalLayoutWidget" > - <property name="geometry" > + <widget class="QWidget" name="verticalLayoutWidget"> + <property name="geometry"> <rect> <x>0</x> <y>20</y> @@ -303,16 +304,16 @@ <height>91</height> </rect> </property> - <layout class="QVBoxLayout" name="verticalLayout" > + <layout class="QVBoxLayout" name="verticalLayout"> <item> - <widget class="QComboBox" name="colorComboBox" /> + <widget class="QComboBox" name="colorComboBox"/> </item> <item> - <spacer name="verticalSpacer" > - <property name="orientation" > + <spacer name="verticalSpacer"> + <property name="orientation"> <enum>Qt::Vertical</enum> </property> - <property name="sizeHint" stdset="0" > + <property name="sizeHint" stdset="0"> <size> <width>20</width> <height>40</height> @@ -327,38 +328,47 @@ </item> </layout> </widget> - <widget class="QMenuBar" name="menubar" > - <property name="geometry" > + <widget class="QMenuBar" name="menubar"> + <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>927</width> - <height>24</height> + <height>25</height> </rect> </property> - <widget class="QMenu" name="menu_File" > - <property name="title" > + <widget class="QMenu" name="menu_File"> + <property name="title"> <string>&File</string> </property> - <addaction name="action_open" /> - <addaction name="action_exit" /> + <addaction name="action_open"/> + <addaction name="action_reload"/> + <addaction name="action_exit"/> </widget> - <addaction name="menu_File" /> + <addaction name="menu_File"/> </widget> - <widget class="QStatusBar" name="statusbar" /> - <action name="action_open" > - <property name="text" > + <widget class="QStatusBar" name="statusbar"/> + <action name="action_open"> + <property name="text"> <string>&Open</string> </property> - <property name="shortcut" > + <property name="shortcut"> <string>Ctrl+O</string> </property> </action> - <action name="action_exit" > - <property name="text" > + <action name="action_exit"> + <property name="text"> <string>E&xit</string> </property> </action> + <action name="action_reload"> + <property name="text"> + <string>&Reload</string> + </property> + <property name="shortcut"> + <string>Ctrl+R</string> + </property> + </action> </widget> <customwidgets> <customwidget> @@ -375,11 +385,11 @@ <receiver>MainWindow</receiver> <slot>close()</slot> <hints> - <hint type="sourcelabel" > + <hint type="sourcelabel"> <x>-1</x> <y>-1</y> </hint> - <hint type="destinationlabel" > + <hint type="destinationlabel"> <x>399</x> <y>347</y> </hint> |