[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r10526 - gnuradio/branches/developers/jblum/gui_guts/g
From: |
jblum |
Subject: |
[Commit-gnuradio] r10526 - gnuradio/branches/developers/jblum/gui_guts/gr-wxgui/src/python |
Date: |
Thu, 26 Feb 2009 01:22:48 -0700 (MST) |
Author: jblum
Date: 2009-02-26 01:22:47 -0700 (Thu, 26 Feb 2009)
New Revision: 10526
Modified:
gnuradio/branches/developers/jblum/gui_guts/gr-wxgui/src/python/fft_window.py
gnuradio/branches/developers/jblum/gui_guts/gr-wxgui/src/python/scope_window.py
Log:
move trigger channel stuff to handle samples
Modified:
gnuradio/branches/developers/jblum/gui_guts/gr-wxgui/src/python/fft_window.py
===================================================================
---
gnuradio/branches/developers/jblum/gui_guts/gr-wxgui/src/python/fft_window.py
2009-02-26 06:25:55 UTC (rev 10525)
+++
gnuradio/branches/developers/jblum/gui_guts/gr-wxgui/src/python/fft_window.py
2009-02-26 08:22:47 UTC (rev 10526)
@@ -39,8 +39,8 @@
DEFAULT_WIN_SIZE = (600, 300)
DEFAULT_FRAME_RATE = gr.prefs().get_long('wxgui', 'fft_rate', 30)
DIV_LEVELS = (1, 2, 5, 10, 20)
-FFT_PLOT_COLOR_SPEC = (0, 0, 1)
-PEAK_VALS_COLOR_SPEC = (0, 1, 0)
+FFT_PLOT_COLOR_SPEC = (0.3, 0.3, 1.0)
+PEAK_VALS_COLOR_SPEC = (0.0, 0.8, 0.0)
NO_PEAK_VALS = list()
##################################################
Modified:
gnuradio/branches/developers/jblum/gui_guts/gr-wxgui/src/python/scope_window.py
===================================================================
---
gnuradio/branches/developers/jblum/gui_guts/gr-wxgui/src/python/scope_window.py
2009-02-26 06:25:55 UTC (rev 10525)
+++
gnuradio/branches/developers/jblum/gui_guts/gr-wxgui/src/python/scope_window.py
2009-02-26 08:22:47 UTC (rev 10526)
@@ -51,7 +51,7 @@
('Negative -', gr.gr_TRIG_SLOPE_NEG),
)
CHANNEL_COLOR_SPECS = (
- (0.0, 0.0, 1.0),
+ (0.3, 0.3, 1.0),
(0.0, 0.8, 0.0),
(1.0, 0.0, 0.0),
(0.8, 0.0, 0.8),
@@ -93,6 +93,7 @@
choices = [('Scope', None)]
for i in range(parent.num_inputs):
for j in range(parent.num_inputs):
+ if i == j: continue
choices.append(('Ch%d : Ch%d'%(i+1, j+1), (i,
j)))
scope_mode_chooser = common.DropDownController(self, 'Mode',
choices, parent, SCOPE_MODE_KEY, SIZE)
control_box.Add(scope_mode_chooser, 0, wx.EXPAND)
@@ -357,24 +358,18 @@
self[SCOPE_TRIGGER_MODE_KEY] = gr.gr_TRIG_MODE_AUTO
self[SCOPE_TRIGGER_SLOPE_KEY] = gr.gr_TRIG_SLOPE_POS
self[T_FRAC_OFF_KEY] = 0.5
- #register events for trigger
- for key in (
- SCOPE_TRIGGER_LEVEL_KEY, SCOPE_TRIGGER_MODE_KEY,
- T_PER_DIV_KEY, T_OFF_KEY, T_DIVS_KEY,
- Y_PER_DIV_KEY, Y_OFF_KEY, Y_DIVS_KEY,
- SCOPE_MODE_KEY, SCOPE_TRIGGER_SHOW_KEY,
- ): self.subscribe(key, self.update_trigger)
#register events for message
self.subscribe(MSG_KEY, self.handle_msg)
#register events for grid
for key in [common.index_key(MARKER_KEY, i) for i in
range(self.num_inputs)] + [
+ SCOPE_TRIGGER_LEVEL_KEY, SCOPE_TRIGGER_MODE_KEY,
T_PER_DIV_KEY, X_PER_DIV_KEY, Y_PER_DIV_KEY,
T_OFF_KEY, X_OFF_KEY, Y_OFF_KEY,
T_DIVS_KEY, X_DIVS_KEY, Y_DIVS_KEY,
SCOPE_MODE_KEY, AUTORANGE_KEY, T_FRAC_OFF_KEY,
+ SCOPE_TRIGGER_SHOW_KEY,
]: self.subscribe(key, self.update_grid)
#initial update
- self.update_trigger()
self.update_grid()
def handle_msg(self, msg):
@@ -406,34 +401,6 @@
samples = self.sampleses[self[SCOPE_TRIGGER_CHANNEL_KEY]]
self[SCOPE_TRIGGER_LEVEL_KEY] =
(numpy.max(samples)+numpy.min(samples))/2
- def update_trigger(self, *args):
- """
- Redraw the trigger line with current settings.
- """
- if not self.sampleses: return
- #keep trigger level within range
- if self[SCOPE_TRIGGER_LEVEL_KEY] > self.get_y_max():
- self[SCOPE_TRIGGER_LEVEL_KEY] = self.get_y_max()
- return
- if self[SCOPE_TRIGGER_LEVEL_KEY] < self.get_y_min():
- self[SCOPE_TRIGGER_LEVEL_KEY] = self.get_y_min()
- return
- #disable the trigger channel
- if not self[SCOPE_TRIGGER_SHOW_KEY] or self[SCOPE_MODE_KEY] or
self[SCOPE_TRIGGER_MODE_KEY] == gr.gr_TRIG_MODE_FREE:
- self.plotter.clear_waveform(channel='Trig')
- else: #show trigger channel
- trigger_level = self[SCOPE_TRIGGER_LEVEL_KEY]
- trigger_point =
(len(self.sampleses[0])-1)/self.get_actual_rate()/2.0
- self.plotter.set_waveform(
- channel='Trig',
- samples=(
- [self.get_t_min(), trigger_point,
trigger_point, trigger_point, trigger_point, self.get_t_max()],
- [trigger_level, trigger_level,
self.get_y_max(), self.get_y_min(), trigger_level, trigger_level]
- ),
- color_spec=TRIGGER_COLOR_SPEC,
- )
- self.plotter.update()
-
def handle_samples(self):
"""
Handle the cached samples from the scope input.
@@ -442,6 +409,7 @@
if not self.sampleses: return
sampleses = self.sampleses
if self[SCOPE_MODE_KEY]:
+ self[DECIMATION_KEY] = 1
x_samples = sampleses[self[SCOPE_MODE_KEY][1]]
y_samples = sampleses[self[SCOPE_MODE_KEY][0]]
#autorange
@@ -512,6 +480,25 @@
)
#turn XY channel off
self.plotter.clear_waveform(channel='XY')
+ #keep trigger level within range
+ if self[SCOPE_TRIGGER_LEVEL_KEY] > self.get_y_max():
+ self[SCOPE_TRIGGER_LEVEL_KEY] = self.get_y_max(); return
+ if self[SCOPE_TRIGGER_LEVEL_KEY] < self.get_y_min():
+ self[SCOPE_TRIGGER_LEVEL_KEY] = self.get_y_min(); return
+ #disable the trigger channel
+ if not self[SCOPE_TRIGGER_SHOW_KEY] or self[SCOPE_MODE_KEY] or
self[SCOPE_TRIGGER_MODE_KEY] == gr.gr_TRIG_MODE_FREE:
+ self.plotter.clear_waveform(channel='Trig')
+ else: #show trigger channel
+ trigger_level = self[SCOPE_TRIGGER_LEVEL_KEY]
+ trigger_point =
(len(self.sampleses[0])-1)/self.get_actual_rate()/2.0
+ self.plotter.set_waveform(
+ channel='Trig',
+ samples=(
+ [self.get_t_min(), trigger_point,
trigger_point, trigger_point, trigger_point, self.get_t_max()],
+ [trigger_level, trigger_level,
self.get_y_max(), self.get_y_min(), trigger_level, trigger_level]
+ ),
+ color_spec=TRIGGER_COLOR_SPEC,
+ )
#update the plotter
self.plotter.update()
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r10526 - gnuradio/branches/developers/jblum/gui_guts/gr-wxgui/src/python,
jblum <=