[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r8286 - in grc/trunk: notes src/grc src/grc_gnuradio
From: |
jblum |
Subject: |
[Commit-gnuradio] r8286 - in grc/trunk: notes src/grc src/grc_gnuradio |
Date: |
Mon, 28 Apr 2008 19:22:06 -0600 (MDT) |
Author: jblum
Date: 2008-04-28 19:22:06 -0600 (Mon, 28 Apr 2008)
New Revision: 8286
Modified:
grc/trunk/notes/todo.txt
grc/trunk/src/grc/ActionHandler.py
grc/trunk/src/grc/Constants.py
grc/trunk/src/grc_gnuradio/Generator.py
Log:
gtk thread enter/leave, stdout + stderr
Modified: grc/trunk/notes/todo.txt
===================================================================
--- grc/trunk/notes/todo.txt 2008-04-28 00:45:31 UTC (rev 8285)
+++ grc/trunk/notes/todo.txt 2008-04-29 01:22:06 UTC (rev 8286)
@@ -15,7 +15,6 @@
-copy and paste blocks
-disable blocks (grey out, keep in design file, but generate ignores)
-conversion script from previous format
--print stdout with stderr from exec
############ Suggestions: ####################
-scope sink constructor needs average option and triggering option
Modified: grc/trunk/src/grc/ActionHandler.py
===================================================================
--- grc/trunk/src/grc/ActionHandler.py 2008-04-28 00:45:31 UTC (rev 8285)
+++ grc/trunk/src/grc/ActionHandler.py 2008-04-29 01:22:06 UTC (rev 8286)
@@ -67,9 +67,7 @@
self.handle_states(APPLICATION_INITIALIZE)
#enter the mainloop
gtk.gdk.threads_init()
- gtk.gdk.threads_enter()
- gtk.main()
- gtk.gdk.threads_leave()
+ gtk.main()
def _handle_key_press(self, widget, event):
"""
@@ -340,12 +338,10 @@
Update the exec and stop buttons.
Lock and unlock the mutex for race conditions with exec flow
graph threads.
"""
- MUTEX.lock()
sensitive = self.get_flow_graph().is_valid() and not
self.get_page().get_pid_file()
get_action_from_name(FLOW_GRAPH_GEN).set_sensitive(sensitive)
get_action_from_name(FLOW_GRAPH_EXEC).set_sensitive(sensitive)
get_action_from_name(FLOW_GRAPH_KILL).set_sensitive(self.get_page().get_pid_file()
!= '')
- MUTEX.unlock()
class ExecFlowGraphThread(Thread):
"""Execute the flow graph as a new process and wait on it to finish."""
@@ -376,9 +372,13 @@
#handle completion
r = "\n"
while(r):
+ gtk.gdk.threads_enter()
Messages.send_verbose_exec(r)
- r = self.p.stderr.read(1)
+ gtk.gdk.threads_leave()
+ r = os.read(self.p.stdout.fileno(), 1024)
+ gtk.gdk.threads_enter()
Messages.send_end_exec()
self.page.set_pid_file('')
self.update_exec_stop()
+ gtk.gdk.threads_leave()
Modified: grc/trunk/src/grc/Constants.py
===================================================================
--- grc/trunk/src/grc/Constants.py 2008-04-28 00:45:31 UTC (rev 8285)
+++ grc/trunk/src/grc/Constants.py 2008-04-29 01:22:06 UTC (rev 8286)
@@ -21,15 +21,7 @@
address@hidden Josh Blum
import os
-import mutex
-import time
-##mutex used when running a flow graph.
-MUTEX = mutex.mutex()
-def lock(mutex):
- while not mutex.testandset(): time.sleep(1e-4) #try to lock repeatedly
until lock is aquired
-MUTEX.lock = lambda: lock(MUTEX)
-
######################################################################################################
## Global Titles @{
######################################################################################################
@@ -126,7 +118,7 @@
SCROLL_DISTANCE = 15
##The redrawing sensitivity, how many motion detection events must occur
before a redraw?
-MOTION_DETECT_REDRAWING_SENSITIVITY = 5
+MOTION_DETECT_REDRAWING_SENSITIVITY = 3
##How close the mouse click can be to a connection and register a connection
select.
CONNECTION_SELECT_SENSITIVITY = 5
Modified: grc/trunk/src/grc_gnuradio/Generator.py
===================================================================
--- grc/trunk/src/grc_gnuradio/Generator.py 2008-04-28 00:45:31 UTC (rev
8285)
+++ grc/trunk/src/grc_gnuradio/Generator.py 2008-04-29 01:22:06 UTC (rev
8286)
@@ -59,7 +59,7 @@
cmds = [PYEXEC, self.get_file_path()]
if self._flow_graph.get_option('generate_options') == 'no_gui':
cmds = ['xterm', '-e'] + cmds
- p = subprocess.Popen(args=cmds, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, shell=False, universal_newlines=True)
+ p = subprocess.Popen(args=cmds, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT, shell=False, universal_newlines=True)
return p
def __str__(self):
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r8286 - in grc/trunk: notes src/grc src/grc_gnuradio,
jblum <=