[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r8028 - in grc/branches/grc_reloaded: . src/grc/gui sr
From: |
jblum |
Subject: |
[Commit-gnuradio] r8028 - in grc/branches/grc_reloaded: . src/grc/gui src/grc/platforms/gnuradio_python/blocks src/grc/platforms/gnuradio_python/blocks/conversions src/grc/platforms/gnuradio_python/data |
Date: |
Sat, 15 Mar 2008 13:11:31 -0600 (MDT) |
Author: jblum
Date: 2008-03-15 13:11:31 -0600 (Sat, 15 Mar 2008)
New Revision: 8028
Added:
grc/branches/grc_reloaded/src/grc/gui/NotebookPage.py
grc/branches/grc_reloaded/src/grc/platforms/gnuradio_python/blocks/conversions/
grc/branches/grc_reloaded/src/grc/platforms/gnuradio_python/blocks/conversions/gr_complex_components.xml
Modified:
grc/branches/grc_reloaded/setup.py
grc/branches/grc_reloaded/src/grc/gui/Bars.py
grc/branches/grc_reloaded/src/grc/gui/Dialogs.py
grc/branches/grc_reloaded/src/grc/gui/FileDialogs.py
grc/branches/grc_reloaded/src/grc/gui/MainWindow.py
grc/branches/grc_reloaded/src/grc/gui/SignalBlockParamsDialog.py
grc/branches/grc_reloaded/src/grc/gui/SignalBlockSelectionWindow.py
grc/branches/grc_reloaded/src/grc/gui/__init__.py
grc/branches/grc_reloaded/src/grc/platforms/gnuradio_python/data/block_tree.xml
Log:
complex components, updated some gui code
Modified: grc/branches/grc_reloaded/setup.py
===================================================================
--- grc/branches/grc_reloaded/setup.py 2008-03-14 20:43:07 UTC (rev 8027)
+++ grc/branches/grc_reloaded/setup.py 2008-03-15 19:11:31 UTC (rev 8028)
@@ -47,6 +47,7 @@
'platforms/gnuradio_python/blocks/sinks/*.xml',
'platforms/gnuradio_python/blocks/graphical_sinks/*.xml',
'platforms/gnuradio_python/blocks/operators/*.xml',
+ 'platforms/gnuradio_python/blocks/conversions/*.xml',
'platforms/gnuradio_python/blocks/variables/*.xml',
'platforms/gnuradio_python/blocks/misc/*.xml',
'platforms/gnuradio_python/blocks/usrp/*.xml',
Modified: grc/branches/grc_reloaded/src/grc/gui/Bars.py
===================================================================
--- grc/branches/grc_reloaded/src/grc/gui/Bars.py 2008-03-14 20:43:07 UTC
(rev 8027)
+++ grc/branches/grc_reloaded/src/grc/gui/Bars.py 2008-03-15 19:11:31 UTC
(rev 8028)
@@ -16,7 +16,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
address@hidden Graphics.Bars
address@hidden grc.gui.Bars
#Create the GUI's toolbar and menubar
address@hidden Josh Blum
Modified: grc/branches/grc_reloaded/src/grc/gui/Dialogs.py
===================================================================
--- grc/branches/grc_reloaded/src/grc/gui/Dialogs.py 2008-03-14 20:43:07 UTC
(rev 8027)
+++ grc/branches/grc_reloaded/src/grc/gui/Dialogs.py 2008-03-15 19:11:31 UTC
(rev 8028)
@@ -16,7 +16,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
address@hidden Graphics.Dialogs
address@hidden grc.gui.Dialogs
#Misc dialogs.
address@hidden Josh Blum
Modified: grc/branches/grc_reloaded/src/grc/gui/FileDialogs.py
===================================================================
--- grc/branches/grc_reloaded/src/grc/gui/FileDialogs.py 2008-03-14
20:43:07 UTC (rev 8027)
+++ grc/branches/grc_reloaded/src/grc/gui/FileDialogs.py 2008-03-15
19:11:31 UTC (rev 8028)
@@ -16,7 +16,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
address@hidden Graphics.FileDialogs
address@hidden grc.gui.FileDialogs
#The open/save dialog for flow graph fFileDialogiles and screen shots.
address@hidden Josh Blum
Modified: grc/branches/grc_reloaded/src/grc/gui/MainWindow.py
===================================================================
--- grc/branches/grc_reloaded/src/grc/gui/MainWindow.py 2008-03-14 20:43:07 UTC
(rev 8027)
+++ grc/branches/grc_reloaded/src/grc/gui/MainWindow.py 2008-03-15 19:11:31 UTC
(rev 8028)
@@ -1,5 +1,5 @@
"""
-Copyright 2007 Free Software Foundation, Inc.
+Copyright 2008 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion is free software; you can redistribute it and/or
@@ -16,7 +16,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
address@hidden Graphics.MainWindow
address@hidden grc.gui.MainWindow
#The main window, containing all windows, tool bars, and menu bars.
address@hidden Josh Blum
@@ -29,140 +29,12 @@
from SignalBlockSelectionWindow import SignalBlockSelectionWindow
from Dialogs import TextDisplay,MessageDialogHelper
from DrawingArea import DrawingArea
-from grc.StateCache import StateCache
from grc import Preferences
from grc import Messages
-from grc import ParseXML
+from NotebookPage import Page
import os
############################################################
-## Notebook Page
-############################################################
-
-class Page(gtk.HBox):
- """A page in the notebook."""
-
- def __init__(self, main_window, flow_graph, file_path=''):
- """
- Page constructor.
- @param main_window main window
- @param file_path path to a flow graph file
- """
- self._flow_graph = flow_graph
- self.set_pid_file('')
- #import the file
- self.main_window = main_window
- self.set_file_path(file_path)
- file_path = file_path or
flow_graph.get_parent().get_default_flow_graph()
- initial_state = ParseXML.from_xml(ParseXML.from_file(file_path))
- self.state_cache = StateCache(initial_state)
- self.set_saved(True)
- #parse xml success, initialize page
- gtk.HBox.__init__(self, False, 0)
- self.show()
- #tab box to hold label and close button
- self.tab = gtk.HBox(False, 0)
- #setup tab label
- self.label = gtk.Label()
- self.tab.pack_start(self.label, False)
- #setup button image
- image = gtk.Image()
- image.set_from_stock('gtk-close', gtk.ICON_SIZE_MENU)
- #setup image box
- image_box = gtk.HBox(False, 0)
- image_box.pack_start(image, True, False, 0)
- #setup the button
- button = gtk.Button()
- button.connect("clicked", self._handle_button)
- button.set_relief(gtk.RELIEF_NONE)
- button.add(image_box)
- #button size
- w, h = gtk.icon_size_lookup_for_settings(button.get_settings(),
gtk.ICON_SIZE_MENU)
- button.set_size_request(w+6, h+6)
- self.tab.pack_start(button, False)
- self.tab.show_all()
-
- def _handle_button(self, button):
- """
- The button was clicked.
- Make the current page selected, then close.
- @param the button
- """
- self.main_window.page_to_be_closed = self
- self.main_window.handle_states(FLOW_GRAPH_CLOSE)
-
- def set_text(self, text):
- """
- Set the text in this label.
- @param text the new text
- """
- self.label.set_text(text)
-
- def get_tab(self):
- """
- Get the gtk widget for this page's tab.
- @return gtk widget
- """
- return self.tab
-
- def get_pid_file(self):
- """!
- Get the pid file for the flow graph.
- @return the pid file or ''
- """
- return self.pid_file
-
- def set_pid_file(self, pid_file=''):
- """!
- Set the pid file, '' for no pid file.
- @param pid_file file path string
- """
- self.pid_file = pid_file
-
- def get_flow_graph(self):
- """!
- Get the flow graph.
- @return the flow graph
- """
- return self._flow_graph
-
- def get_file_path(self):
- """!
- Get the file path for the flow graph.
- @return the file path or ''
- """
- return self.file_path
-
- def set_file_path(self, file_path=''):
- """!
- Set the file path, '' for no file path.
- @param file_path file path string
- """
- if file_path: self.file_path = os.path.abspath(file_path)
- else: self.file_path = ''
-
- def get_saved(self):
- """!
- Get the saved status for the flow graph.
- @return true if saved
- """
- return self.saved
-
- def set_saved(self, saved=True):
- """!
- Set the saved status.
- @param saved boolean status
- """
- self.saved = saved
-
- def get_state_cache(self):
- """!
- Get the state cache for the flow graph.
- @return the state cache
- """
- return self.state_cache
-
-############################################################
## Main window
############################################################
@@ -318,8 +190,8 @@
@return true if all closed
"""
files = filter(lambda file: file, self._get_files()) #filter
blank files
-
self._set_page(self.notebook.get_nth_page(self.notebook.get_n_pages()-1)) #show
last page
for page in self._get_pages():
+
self._set_page(self.notebook.get_nth_page(self.notebook.get_n_pages()-1)) #show
last page
self.page_to_be_closed = page
self.close_page(False)
if self.notebook.get_n_pages(): return False
Added: grc/branches/grc_reloaded/src/grc/gui/NotebookPage.py
===================================================================
--- grc/branches/grc_reloaded/src/grc/gui/NotebookPage.py
(rev 0)
+++ grc/branches/grc_reloaded/src/grc/gui/NotebookPage.py 2008-03-15
19:11:31 UTC (rev 8028)
@@ -0,0 +1,157 @@
+"""
+Copyright 2008 Free Software Foundation, Inc.
+This file is part of GNU Radio
+
+GNU Radio Companion is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+GNU Radio Companion is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+"""
address@hidden grc.gui.NotebookPage
+#A page in the notebook, represents an individual flow graph.
address@hidden Josh Blum
+
+from grc.Actions import *
+import pygtk
+pygtk.require('2.0')
+import gtk
+from grc import ParseXML
+from grc.StateCache import StateCache
+import os
+
+############################################################
+## Notebook Page
+############################################################
+
+class Page(gtk.HBox):
+ """A page in the notebook."""
+
+ def __init__(self, main_window, flow_graph, file_path=''):
+ """
+ Page constructor.
+ @param main_window main window
+ @param file_path path to a flow graph file
+ """
+ self._flow_graph = flow_graph
+ self.set_pid_file('')
+ #import the file
+ self.main_window = main_window
+ self.set_file_path(file_path)
+ file_path = file_path or
flow_graph.get_parent().get_default_flow_graph()
+ initial_state = ParseXML.from_xml(ParseXML.from_file(file_path))
+ self.state_cache = StateCache(initial_state)
+ self.set_saved(True)
+ #parse xml success, initialize page
+ gtk.HBox.__init__(self, False, 0)
+ self.show()
+ #tab box to hold label and close button
+ self.tab = gtk.HBox(False, 0)
+ #setup tab label
+ self.label = gtk.Label()
+ self.tab.pack_start(self.label, False)
+ #setup button image
+ image = gtk.Image()
+ image.set_from_stock('gtk-close', gtk.ICON_SIZE_MENU)
+ #setup image box
+ image_box = gtk.HBox(False, 0)
+ image_box.pack_start(image, True, False, 0)
+ #setup the button
+ button = gtk.Button()
+ button.connect("clicked", self._handle_button)
+ button.set_relief(gtk.RELIEF_NONE)
+ button.add(image_box)
+ #button size
+ w, h = gtk.icon_size_lookup_for_settings(button.get_settings(),
gtk.ICON_SIZE_MENU)
+ button.set_size_request(w+6, h+6)
+ self.tab.pack_start(button, False)
+ self.tab.show_all()
+
+ def _handle_button(self, button):
+ """
+ The button was clicked.
+ Make the current page selected, then close.
+ @param the button
+ """
+ self.main_window.page_to_be_closed = self
+ self.main_window.handle_states(FLOW_GRAPH_CLOSE)
+
+ def set_text(self, text):
+ """
+ Set the text in this label.
+ @param text the new text
+ """
+ self.label.set_text(text)
+
+ def get_tab(self):
+ """
+ Get the gtk widget for this page's tab.
+ @return gtk widget
+ """
+ return self.tab
+
+ def get_pid_file(self):
+ """!
+ Get the pid file for the flow graph.
+ @return the pid file or ''
+ """
+ return self.pid_file
+
+ def set_pid_file(self, pid_file=''):
+ """!
+ Set the pid file, '' for no pid file.
+ @param pid_file file path string
+ """
+ self.pid_file = pid_file
+
+ def get_flow_graph(self):
+ """!
+ Get the flow graph.
+ @return the flow graph
+ """
+ return self._flow_graph
+
+ def get_file_path(self):
+ """!
+ Get the file path for the flow graph.
+ @return the file path or ''
+ """
+ return self.file_path
+
+ def set_file_path(self, file_path=''):
+ """!
+ Set the file path, '' for no file path.
+ @param file_path file path string
+ """
+ if file_path: self.file_path = os.path.abspath(file_path)
+ else: self.file_path = ''
+
+ def get_saved(self):
+ """!
+ Get the saved status for the flow graph.
+ @return true if saved
+ """
+ return self.saved
+
+ def set_saved(self, saved=True):
+ """!
+ Set the saved status.
+ @param saved boolean status
+ """
+ self.saved = saved
+
+ def get_state_cache(self):
+ """!
+ Get the state cache for the flow graph.
+ @return the state cache
+ """
+ return self.state_cache
+
Modified: grc/branches/grc_reloaded/src/grc/gui/SignalBlockParamsDialog.py
===================================================================
--- grc/branches/grc_reloaded/src/grc/gui/SignalBlockParamsDialog.py
2008-03-14 20:43:07 UTC (rev 8027)
+++ grc/branches/grc_reloaded/src/grc/gui/SignalBlockParamsDialog.py
2008-03-15 19:11:31 UTC (rev 8028)
@@ -16,7 +16,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
address@hidden Graphics.SignalBlockParamsDialog
address@hidden grc.gui.SignalBlockParamsDialog
#A dialog for editing a signal block's parameters.
address@hidden Josh Blum
Modified: grc/branches/grc_reloaded/src/grc/gui/SignalBlockSelectionWindow.py
===================================================================
--- grc/branches/grc_reloaded/src/grc/gui/SignalBlockSelectionWindow.py
2008-03-14 20:43:07 UTC (rev 8027)
+++ grc/branches/grc_reloaded/src/grc/gui/SignalBlockSelectionWindow.py
2008-03-15 19:11:31 UTC (rev 8028)
@@ -16,7 +16,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
address@hidden Graphics.SignalBlockSelectionWindow
address@hidden grc.gui.SignalBlockSelectionWindow
#The signal block selection window gives the user a tree selection to choose a
signal block.
address@hidden Josh Blum
Modified: grc/branches/grc_reloaded/src/grc/gui/__init__.py
===================================================================
--- grc/branches/grc_reloaded/src/grc/gui/__init__.py 2008-03-14 20:43:07 UTC
(rev 8027)
+++ grc/branches/grc_reloaded/src/grc/gui/__init__.py 2008-03-15 19:11:31 UTC
(rev 8028)
@@ -16,7 +16,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
address@hidden Graphics.__init__
address@hidden grc.gui
#GTK based classes go into this package.
address@hidden Josh Blum
@@ -24,3 +24,4 @@
from MainWindow import MainWindow
from FileDialogs import
OpenFlowGraphFileDialog,SaveFlowGraphFileDialog,SaveImageFileDialog
from Dialogs import
PreferencesDialog,MessageDialogHelper,AboutDialog,HotKeysDialog
+
Added:
grc/branches/grc_reloaded/src/grc/platforms/gnuradio_python/blocks/conversions/gr_complex_components.xml
===================================================================
---
grc/branches/grc_reloaded/src/grc/platforms/gnuradio_python/blocks/conversions/gr_complex_components.xml
(rev 0)
+++
grc/branches/grc_reloaded/src/grc/platforms/gnuradio_python/blocks/conversions/gr_complex_components.xml
2008-03-15 19:11:31 UTC (rev 8028)
@@ -0,0 +1,57 @@
+<?xml version="1.0"?>
+<!DOCTYPE block SYSTEM "../block.dtd">
+<!--
+###################################################
+##Complex Components:
+## angle, magnitude, conjugate...
+###################################################
+ -->
+<block>
+ <name>Complex Components</name>
+ <key>gr_complex_components</key>
+ <import>from gnuradio import gr</import>
+ <make>gr.$(type)()</make>
+ <param>
+ <name>Type</name>
+ <key>type</key>
+ <type>enum</type>
+ <option>
+ <name>Magnitude</name>
+ <key>complex_to_mag</key>
+ <opt>type:float</opt>
+ </option>
+ <option>
+ <name>Magnitude Squared</name>
+ <key>complex_to_mag_squared</key>
+ <opt>type:float</opt>
+ </option>
+ <option>
+ <name>Argument</name>
+ <key>complex_to_arg</key>
+ <opt>type:float</opt>
+ </option>
+ <option>
+ <name>Real</name>
+ <key>complex_to_real</key>
+ <opt>type:float</opt>
+ </option>
+ <option>
+ <name>Imaginary</name>
+ <key>complex_to_imag</key>
+ <opt>type:float</opt>
+ </option>
+ <option>
+ <name>Conjugate</name>
+ <key>conjugate_cc</key>
+ <opt>type:complex</opt>
+ </option>
+ </param>
+ <sink>
+ <name>in</name>
+ <type>complex</type>
+ </sink>
+ <source>
+ <name>out</name>
+ <type>$type.type</type>
+ </source>
+</block>
Modified:
grc/branches/grc_reloaded/src/grc/platforms/gnuradio_python/data/block_tree.xml
===================================================================
---
grc/branches/grc_reloaded/src/grc/platforms/gnuradio_python/data/block_tree.xml
2008-03-14 20:43:07 UTC (rev 8027)
+++
grc/branches/grc_reloaded/src/grc/platforms/gnuradio_python/data/block_tree.xml
2008-03-15 19:11:31 UTC (rev 8028)
@@ -56,8 +56,7 @@
</cat>
<cat>
<name>Type Conversions</name>
- <block>complex_components</block>
- <block>complex_conjugate</block>
+ <block>gr_complex_components</block>
<block>complex_to_float</block>
<block>float_to_complex</block>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r8028 - in grc/branches/grc_reloaded: . src/grc/gui src/grc/platforms/gnuradio_python/blocks src/grc/platforms/gnuradio_python/blocks/conversions src/grc/platforms/gnuradio_python/data,
jblum <=