diff options
25 files changed, 103 insertions, 62 deletions
diff --git a/cmake/Modules/FindQwt.cmake b/cmake/Modules/FindQwt.cmake index 1e82cb97f8..68f55bf14a 100644 --- a/cmake/Modules/FindQwt.cmake +++ b/cmake/Modules/FindQwt.cmake @@ -15,6 +15,7 @@ find_path(QWT_INCLUDE_DIRS /usr/include/qwt6 /usr/include/qwt-qt4 /usr/include/qwt + /usr/include/qwt5 /opt/local/include/qwt /sw/include/qwt /usr/local/lib/qwt.framework/Headers diff --git a/docs/doxygen/other/stream_tags.dox b/docs/doxygen/other/stream_tags.dox index 851740984e..d48ec1ddee 100644 --- a/docs/doxygen/other/stream_tags.dox +++ b/docs/doxygen/other/stream_tags.dox @@ -61,7 +61,10 @@ at <em>nitems_written(0)+i</em> for the 0th output port. \section stream_tags_api Stream Tags API The stream tags API consists of four functions, two to add and two to -get the stream tags. These functions are: +get the stream tags. These functions are only meant to be accessed +within a call to general_work/work. While they can be called elsewhere +in time by a block, the behavior outside of work is undefined without +exact knowledge of the item counts in the buffers. \li gr::block::add_item_tag: Adds an item tag to a particular output port using a gr::tag_t data type. diff --git a/gnuradio-runtime/CMakeLists.txt b/gnuradio-runtime/CMakeLists.txt index 1f942429a0..7660642509 100644 --- a/gnuradio-runtime/CMakeLists.txt +++ b/gnuradio-runtime/CMakeLists.txt @@ -136,7 +136,7 @@ install( if(ENABLE_GR_LOG AND HAVE_LOG4CPP) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/gr_log_default.conf - DESTINATION ${GR_CONF_DIR}/gnuradio + DESTINATION ${GR_PREFSDIR} COMPONENT "runtime_runtime" ) endif(ENABLE_GR_LOG AND HAVE_LOG4CPP) diff --git a/gr-audio/lib/alsa/alsa_sink.cc b/gr-audio/lib/alsa/alsa_sink.cc index cfb247520f..4238f11f85 100644 --- a/gr-audio/lib/alsa/alsa_sink.cc +++ b/gr-audio/lib/alsa/alsa_sink.cc @@ -274,7 +274,7 @@ namespace gr { d_buffer = new char[d_buffer_size_bytes]; if(CHATTY_DEBUG) { - GR_LOG_DEBUG(d_logger, boost::format("[%1%]: sample resolution = %d bits") \ + GR_LOG_DEBUG(d_logger,boost::format("[%1%]: sample resolution = %2% bits") \ % snd_pcm_name(d_pcm_handle) \ % snd_pcm_hw_params_get_sbits(d_hw_params)); } diff --git a/gr-audio/lib/alsa/alsa_source.cc b/gr-audio/lib/alsa/alsa_source.cc index 92a7bc549f..6297c335c8 100644 --- a/gr-audio/lib/alsa/alsa_source.cc +++ b/gr-audio/lib/alsa/alsa_source.cc @@ -252,7 +252,7 @@ namespace gr { d_buffer = new char[d_buffer_size_bytes]; if(CHATTY_DEBUG) { - GR_LOG_DEBUG(d_logger, boost::format("[%1%]: sample resolution = %d bits") \ + GR_LOG_DEBUG(d_logger, boost::format("[%1%]: sample resolution = %2% bits") \ % snd_pcm_name(d_pcm_handle) \ % snd_pcm_hw_params_get_sbits(d_hw_params)); } diff --git a/gr-blocks/lib/keep_m_in_n_impl.cc b/gr-blocks/lib/keep_m_in_n_impl.cc index b33eb7c1a8..11b3b27af7 100644 --- a/gr-blocks/lib/keep_m_in_n_impl.cc +++ b/gr-blocks/lib/keep_m_in_n_impl.cc @@ -66,7 +66,7 @@ namespace gr { } set_output_multiple(m); - set_relative_rate(static_cast<double>(d_n)/static_cast<double>(d_m)); + set_relative_rate(static_cast<double>(d_m)/static_cast<double>(d_n)); } void @@ -80,14 +80,14 @@ namespace gr { { d_m = m; set_output_multiple(m); - set_relative_rate(static_cast<double>(d_n)/static_cast<double>(d_m)); + set_relative_rate(static_cast<double>(d_m)/static_cast<double>(d_n)); } void keep_m_in_n_impl::set_n(int n) { d_n = n; - set_relative_rate(static_cast<double>(d_n)/static_cast<double>(d_m)); + set_relative_rate(static_cast<double>(d_m)/static_cast<double>(d_n)); } void diff --git a/gr-blocks/lib/message_strobe_impl.cc b/gr-blocks/lib/message_strobe_impl.cc index bd0ad80142..b3f1782229 100644 --- a/gr-blocks/lib/message_strobe_impl.cc +++ b/gr-blocks/lib/message_strobe_impl.cc @@ -47,15 +47,15 @@ namespace gr { message_strobe_impl::message_strobe_impl(pmt::pmt_t msg, float period_ms) : block("message_strobe", - io_signature::make(0, 0, 0), - io_signature::make(0, 0, 0)), + io_signature::make(0, 0, 0), + io_signature::make(0, 0, 0)), d_finished(false), d_period_ms(period_ms), d_msg(msg) { message_port_register_out(pmt::mp("strobe")); - d_thread = boost::shared_ptr<boost::thread> - (new boost::thread(boost::bind(&message_strobe_impl::run, this))); + d_thread = boost::shared_ptr<gr::thread::thread> + (new gr::thread::thread(boost::bind(&message_strobe_impl::run, this))); message_port_register_in(pmt::mp("set_msg")); set_msg_handler(pmt::mp("set_msg"), diff --git a/gr-blocks/lib/message_strobe_impl.h b/gr-blocks/lib/message_strobe_impl.h index 7a54680286..0f37cd2e0e 100644 --- a/gr-blocks/lib/message_strobe_impl.h +++ b/gr-blocks/lib/message_strobe_impl.h @@ -31,7 +31,7 @@ namespace gr { class BLOCKS_API message_strobe_impl : public message_strobe { private: - boost::shared_ptr<boost::thread> d_thread; + boost::shared_ptr<gr::thread::thread> d_thread; bool d_finished; float d_period_ms; pmt::pmt_t d_msg; diff --git a/gr-blocks/lib/message_strobe_random_impl.cc b/gr-blocks/lib/message_strobe_random_impl.cc index 80819fc2fc..c62aad1c7a 100644 --- a/gr-blocks/lib/message_strobe_random_impl.cc +++ b/gr-blocks/lib/message_strobe_random_impl.cc @@ -61,8 +61,8 @@ namespace gr { // set up ports message_port_register_out(pmt::mp("strobe")); - d_thread = boost::shared_ptr<boost::thread> - (new boost::thread(boost::bind(&message_strobe_random_impl::run, this))); + d_thread = boost::shared_ptr<gr::thread::thread> + (new gr::thread::thread(boost::bind(&message_strobe_random_impl::run, this))); message_port_register_in(pmt::mp("set_msg")); set_msg_handler(pmt::mp("set_msg"), diff --git a/gr-blocks/lib/message_strobe_random_impl.h b/gr-blocks/lib/message_strobe_random_impl.h index 32eddb592c..2dcaa7effa 100644 --- a/gr-blocks/lib/message_strobe_random_impl.h +++ b/gr-blocks/lib/message_strobe_random_impl.h @@ -36,7 +36,7 @@ namespace gr { class BLOCKS_API message_strobe_random_impl : public message_strobe_random { private: - boost::shared_ptr<boost::thread> d_thread; + boost::shared_ptr<gr::thread::thread> d_thread; bool d_finished; float d_mean_ms; float d_std_ms; diff --git a/gr-blocks/lib/throttle_impl.cc b/gr-blocks/lib/throttle_impl.cc index f46decee11..7c24f80ae1 100644 --- a/gr-blocks/lib/throttle_impl.cc +++ b/gr-blocks/lib/throttle_impl.cc @@ -57,6 +57,14 @@ namespace gr { { } + bool + throttle_impl::start() + { + d_start = boost::get_system_time(); + d_total_samples = 0; + return block::start(); + } + void throttle_impl::set_sample_rate(double rate) { diff --git a/gr-blocks/lib/throttle_impl.h b/gr-blocks/lib/throttle_impl.h index c5e43d7564..6afacbba5d 100644 --- a/gr-blocks/lib/throttle_impl.h +++ b/gr-blocks/lib/throttle_impl.h @@ -41,6 +41,9 @@ namespace gr { throttle_impl(size_t itemsize, double samples_per_sec, bool ignore_tags=true); ~throttle_impl(); + // Overloading gr::block::start to reset timer + bool start(); + void setup_rpc(); void set_sample_rate(double rate); diff --git a/gr-filter/grc/filter_pfb_channelizer.xml b/gr-filter/grc/filter_pfb_channelizer.xml index f8a51d2204..446acf0591 100644 --- a/gr-filter/grc/filter_pfb_channelizer.xml +++ b/gr-filter/grc/filter_pfb_channelizer.xml @@ -15,6 +15,7 @@ $osr, $atten) self.$(id).set_channel_map($ch_map) +self.$(id).declare_sample_delay($samp_delay) </make> <callback>set_taps($taps)</callback> <callback>set_channel_map($ch_map)</callback> @@ -44,6 +45,13 @@ self.$(id).set_channel_map($ch_map) <type>real</type> </param> <param> + <name>Sample Delay</name> + <key>samp_delay</key> + <value>0</value> + <type>int</type> + <hide>part</hide> + </param> + <param> <name>Channel Map</name> <key>ch_map</key> <value>[]</value> diff --git a/gr-filter/grc/filter_pfb_synthesizer.xml b/gr-filter/grc/filter_pfb_synthesizer.xml index e7e1ae3951..8cbe19528d 100644 --- a/gr-filter/grc/filter_pfb_synthesizer.xml +++ b/gr-filter/grc/filter_pfb_synthesizer.xml @@ -12,6 +12,7 @@ <make>filter.pfb_synthesizer_ccf( $numchans, $taps, $twox) self.$(id).set_channel_map($ch_map) +self.$(id).declare_sample_delay($samp_delay) </make> <callback>set_taps($taps)</callback> <callback>set_channel_map($ch_map)</callback> @@ -40,6 +41,13 @@ self.$(id).set_channel_map($ch_map) <type>bool</type> </param> <param> + <name>Sample Delay</name> + <key>samp_delay</key> + <value>0</value> + <type>int</type> + <hide>part</hide> + </param> + <param> <name>Channel Map</name> <key>ch_map</key> <value>[]</value> diff --git a/gr-filter/python/filter/pfb.py b/gr-filter/python/filter/pfb.py index c08f9d1364..22270589e8 100644 --- a/gr-filter/python/filter/pfb.py +++ b/gr-filter/python/filter/pfb.py @@ -84,6 +84,10 @@ class channelizer_ccf(gr.hier_block2): def taps(self): return self.pfb.taps() + def declare_sample_delay(self, delay): + self.pfb.declare_sample_delay(delay) + + class interpolator_ccf(gr.hier_block2): ''' Make a Polyphase Filter interpolator (complex in, complex out, floating-point taps) diff --git a/gr-uhd/lib/usrp_source_impl.cc b/gr-uhd/lib/usrp_source_impl.cc index 53038bf202..a71f53c5b3 100644 --- a/gr-uhd/lib/usrp_source_impl.cc +++ b/gr-uhd/lib/usrp_source_impl.cc @@ -87,7 +87,7 @@ namespace gr { { bool clocks_locked = true; - // 1) Check ref lock for all mboards + // Check ref lock for all mboards for (size_t mboard_index = 0; mboard_index < _dev->get_num_mboards(); mboard_index++) { std::string sensor_name = "ref_locked"; if (_dev->get_clock_source(mboard_index) == "internal") { @@ -106,19 +106,6 @@ namespace gr { } } - // 2) Check LO for all channels - for (size_t i = 0; i < _nchan; i++) { - size_t chan_index = _stream_args.channels[i]; - if (not _wait_for_locked_sensor( - get_sensor_names(chan_index), - "lo_locked", - boost::bind(&usrp_source_impl::get_sensor, this, _1, chan_index) - )) { - GR_LOG_WARN(d_logger, boost::format("Sensor 'lo_locked' failed to lock within timeout on channel %d.") % chan_index); - clocks_locked = false; - } - } - return clocks_locked; } diff --git a/grc/base/ParseXML.py b/grc/base/ParseXML.py index 888272a2e1..a2cede1c86 100644 --- a/grc/base/ParseXML.py +++ b/grc/base/ParseXML.py @@ -121,7 +121,7 @@ def to_file(nested_data, xml_file): instructions = nested_data.pop('_instructions', None) if instructions: xml_data += etree.tostring(etree.ProcessingInstruction( - 'grc', ' '.join("{}='{}'".format(*item) for item in instructions.iteritems()) + 'grc', ' '.join("{0}='{1}'".format(*item) for item in instructions.iteritems()) ), xml_declaration=True, pretty_print=True) xml_data += etree.tostring(_to_file(nested_data)[0], pretty_print=True) open(xml_file, 'w').write(xml_data) diff --git a/grc/base/Port.py b/grc/base/Port.py index 34766bb4f8..761369d4f8 100644 --- a/grc/base/Port.py +++ b/grc/base/Port.py @@ -38,6 +38,8 @@ class Port(Element): self._type = n['type'] self._hide = n.find('hide') or '' self._dir = dir + self._type_evaluated = '' # updated on rewrite() + self._hide_evaluated = False # updated on rewrite() def validate(self): """ @@ -48,6 +50,13 @@ class Port(Element): if self.get_type() not in self.get_types(): self.add_error_message('Type "%s" is not a possible type.'%self.get_type()) + def rewrite(self): + """resolve dependencies in for type and hide""" + Element.rewrite(self) + self._type_evaluated = self.get_parent().resolve_dependencies(self._type) + hide = self.get_parent().resolve_dependencies(self._hide).strip().lower() + self._hide_evaluated = False if hide in ('false', 'off', '0') else bool(hide) + def __str__(self): if self.is_source(): return 'Source - %s(%s)'%(self.get_name(), self.get_key()) @@ -73,10 +82,8 @@ class Port(Element): def get_key(self): return self._key def is_sink(self): return self._dir == 'sink' def is_source(self): return self._dir == 'source' - def get_type(self): return self.get_parent().resolve_dependencies(self._type) - def get_hide(self): - value = self.get_parent().resolve_dependencies(self._hide).strip().lower() - return False if value in ('false', 'off', '0') else bool(value) + def get_type(self): return self._type_evaluated + def get_hide(self): return self._hide_evaluated def get_connections(self): """ diff --git a/grc/gui/ActionHandler.py b/grc/gui/ActionHandler.py index 2e968faf5b..6c56a94e9c 100644 --- a/grc/gui/ActionHandler.py +++ b/grc/gui/ActionHandler.py @@ -86,7 +86,10 @@ class ActionHandler: false to let gtk handle the key action """ # prevent key event stealing while the search box is active - if self.main_window.btwin.search_entry.has_focus(): return False + # .has_focus() only in newer versions 2.17+? + # .is_focus() seems to work, but exactly the same + if self.main_window.btwin.search_entry.flags() & gtk.HAS_FOCUS: + return False if not self.get_focus_flag(): return False return Actions.handle_key_press(event) @@ -394,7 +397,8 @@ class ActionHandler: Actions.NOTHING_SELECT() elif action == Actions.TOGGLE_AUTO_HIDE_PORT_LABELS: action.save_to_preferences() - self.main_window.get_flow_graph().create_shapes() + for page in self.main_window.get_pages(): + page.get_flow_graph().create_shapes() elif action == Actions.TOGGLE_SNAP_TO_GRID: action.save_to_preferences() ################################################## diff --git a/grc/gui/Block.py b/grc/gui/Block.py index 70496ac143..9b8d3b1b56 100644 --- a/grc/gui/Block.py +++ b/grc/gui/Block.py @@ -226,8 +226,7 @@ class Block(Element): window.draw_drawable(gc, self.vertical_label, 0, 0, x+(self.H-self.label_height)/2, y+BLOCK_LABEL_PADDING, -1, -1) #draw ports for port in self.get_ports_gui(): - if not port.get_hide(): - port.draw(gc, window) + port.draw(gc, window) def what_is_selected(self, coor, coor_m=None): """ diff --git a/grc/gui/BlockTreeWindow.py b/grc/gui/BlockTreeWindow.py index b04a4dda7c..76eebdb959 100644 --- a/grc/gui/BlockTreeWindow.py +++ b/grc/gui/BlockTreeWindow.py @@ -58,10 +58,13 @@ class BlockTreeWindow(gtk.VBox): # search entry self.search_entry = gtk.Entry() - self.search_entry.set_icon_from_stock(gtk.ENTRY_ICON_PRIMARY, gtk.STOCK_FIND) - self.search_entry.set_icon_activatable(gtk.ENTRY_ICON_PRIMARY, False) - self.search_entry.set_icon_from_stock(gtk.ENTRY_ICON_SECONDARY, gtk.STOCK_CLOSE) - self.search_entry.connect('icon-release', self._handle_icon_event) + try: + self.search_entry.set_icon_from_stock(gtk.ENTRY_ICON_PRIMARY, gtk.STOCK_FIND) + self.search_entry.set_icon_activatable(gtk.ENTRY_ICON_PRIMARY, False) + self.search_entry.set_icon_from_stock(gtk.ENTRY_ICON_SECONDARY, gtk.STOCK_CLOSE) + self.search_entry.connect('icon-release', self._handle_icon_event) + except AttributeError: + pass # no icon for old pygtk self.search_entry.connect('changed', self._update_search_tree) self.search_entry.connect('key-press-event', self._handle_search_key_press) self.pack_start(self.search_entry, False) diff --git a/grc/gui/MainWindow.py b/grc/gui/MainWindow.py index 75d9dce433..d1cf866ce7 100644 --- a/grc/gui/MainWindow.py +++ b/grc/gui/MainWindow.py @@ -209,7 +209,7 @@ class MainWindow(gtk.Window): open_files = filter(lambda file: file, self._get_files()) #filter blank files open_file = self.get_page().get_file_path() #close each page - for page in self._get_pages(): + for page in self.get_pages(): self.page_to_be_closed = page self.close_page(False) if self.notebook.get_n_pages(): return False @@ -271,7 +271,7 @@ class MainWindow(gtk.Window): ) ) #set tab titles - for page in self._get_pages(): page.set_markup( + for page in self.get_pages(): page.set_markup( Utils.parse_template(PAGE_TITLE_MARKUP_TMPL, #get filename and strip out file extension title=os.path.splitext(os.path.basename(page.get_file_path()))[0], @@ -280,13 +280,13 @@ class MainWindow(gtk.Window): ) ) #show/hide notebook tabs - self.notebook.set_show_tabs(len(self._get_pages()) > 1) + self.notebook.set_show_tabs(len(self.get_pages()) > 1) def update_pages(self): """ Forces a reload of all the pages in this notebook. """ - for page in self._get_pages(): + for page in self.get_pages(): success = page.get_flow_graph().reload() if success: # Only set saved if errors occurred during import page.set_saved(False) @@ -351,9 +351,9 @@ class MainWindow(gtk.Window): Returns: list of file paths """ - return map(lambda page: page.get_file_path(), self._get_pages()) + return map(lambda page: page.get_file_path(), self.get_pages()) - def _get_pages(self): + def get_pages(self): """ Get a list of all pages in the notebook. diff --git a/grc/gui/Port.py b/grc/gui/Port.py index fdd2934527..2a87573911 100644 --- a/grc/gui/Port.py +++ b/grc/gui/Port.py @@ -43,7 +43,7 @@ class Port(Element): """ Element.__init__(self) self.W = self.H = self.w = self.h = 0 - self._connector_coordinate = (0,0) + self._connector_coordinate = (0, 0) self._connector_length = 0 self._hovering = True self._force_label_unhidden = False @@ -51,11 +51,15 @@ class Port(Element): def create_shapes(self): """Create new areas and labels for the port.""" Element.create_shapes(self) + if self.get_hide(): + return # this port is hidden, no need to create shapes #get current rotation rotation = self.get_rotation() #get all sibling ports - if self.is_source(): ports = self.get_parent().get_sources_gui() - elif self.is_sink(): ports = self.get_parent().get_sinks_gui() + if self.is_source(): + ports = self.get_parent().get_sources_gui() + elif self.is_sink(): + ports = self.get_parent().get_sinks_gui() #get the max width self.W = max([port.W for port in ports] + [PORT_MIN_WIDTH]) W = self.W if not self._label_hidden() else PORT_LABEL_HIDDEN_WIDTH @@ -68,7 +72,8 @@ class Port(Element): return length = len(filter(lambda p: not p.get_hide(), ports)) #reverse the order of ports for these rotations - if rotation in (180, 270): index = length-index-1 + if rotation in (180, 270): + index = length-index-1 offset = (self.get_parent().H - (length-1)*PORT_SEPARATION - self.H)/2 #create areas and connector coordinates if (self.is_sink() and rotation == 0) or (self.is_source() and rotation == 180): @@ -135,12 +140,13 @@ class Port(Element): Element.draw( self, gc, window, bg_color=self._bg_color, border_color=self.is_highlighted() and Colors.HIGHLIGHT_COLOR or - self.get_parent().is_dummy_block() and Colors.MISSING_BLOCK_BORDER_COLOR or Colors.BORDER_COLOR, + self.get_parent().is_dummy_block() and Colors.MISSING_BLOCK_BORDER_COLOR or + Colors.BORDER_COLOR, ) - if self._label_hidden(): - return - X,Y = self.get_coordinate() - (x,y),(w,h) = self._areas_list[0] #use the first area's sizes to place the labels + if not self._areas_list or self._label_hidden(): + return # this port is either hidden (no areas) or folded (no label) + X, Y = self.get_coordinate() + (x, y), (w, h) = self._areas_list[0] # use the first area's sizes to place the labels if self.is_horizontal(): window.draw_drawable(gc, self.horizontal_label, 0, 0, x+X+(self.W-self.w)/2, y+Y+(self.H-self.h)/2, -1, -1) elif self.is_vertical(): diff --git a/grc/python/Generator.py b/grc/python/Generator.py index 92f36cf30b..caf45fa3b1 100644 --- a/grc/python/Generator.py +++ b/grc/python/Generator.py @@ -93,10 +93,10 @@ This is usually undesired. Consider removing the throttle block.''') # python_exe = 'pythonw' #setup the command args to run - cmds = [python_exe, '-u', self.get_file_path()] #-u is unbuffered stdio + cmds = [python_exe, '-u', self.get_file_path()] # -u is unbuffered stdio - #when in no gui mode on linux, use an xterm (looks nice) - if self._generate_options == 'no_gui' and 'linux' in sys.platform.lower(): + # when in no gui mode on linux, use a graphical terminal (looks nice) + if self._generate_options == 'no_gui' and os.path.exists(XTERM_EXECUTABLE): cmds = [XTERM_EXECUTABLE, '-e'] + cmds p = subprocess.Popen(args=cmds, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=False, universal_newlines=True) diff --git a/volk/lib/CMakeLists.txt b/volk/lib/CMakeLists.txt index 386237bf65..37915e5552 100644 --- a/volk/lib/CMakeLists.txt +++ b/volk/lib/CMakeLists.txt @@ -406,7 +406,6 @@ if(${CMAKE_VERSION} VERSION_GREATER "2.8.9") # if we find one that matches our current system architecture # set up the assembler flags and include the source files foreach(ARCH ${ASM_ARCHS_AVAILABLE}) - message(STATUS "--==>> -CFLAGS1: ${FULL_C_FLAGS}") string(REGEX MATCH "${ARCH}" ASM_ARCH "${FULL_C_FLAGS}") if( ASM_ARCH STREQUAL "armv7" ) message(STATUS "---- Adding ASM files") # we always use ATT syntax @@ -421,8 +420,9 @@ if(${CMAKE_VERSION} VERSION_GREATER "2.8.9") message(STATUS "Adding source file: ${asm_file}") endforeach(asm_file) endif() + enable_language(ASM) set(CMAKE_ASM_FLAGS ${ARCH_ASM_FLAGS}) - enable_language(ASM) # this must be after flags_init + message(STATUS "c flags: ${FULL_C_FLAGS}") message(STATUS "asm flags: ${CMAKE_ASM_FLAGS}") endforeach(ARCH) |