diff options
-rw-r--r-- | gnuradio-core/src/lib/io/gr_file_source.cc | 10 | ||||
-rw-r--r-- | gr-blocks/lib/file_source_impl.cc | 8 | ||||
-rw-r--r-- | gr-qtgui/lib/plot_raster.cc | 10 | ||||
-rw-r--r-- | gr-qtgui/lib/plot_raster.h | 5 | ||||
-rw-r--r-- | gr-qtgui/lib/timeRasterGlobalData.cc | 2 | ||||
-rw-r--r-- | gr-qtgui/lib/timerasterdisplayform.cc | 6 | ||||
-rw-r--r-- | gruel/src/include/gruel/thread.h | 2 |
7 files changed, 30 insertions, 13 deletions
diff --git a/gnuradio-core/src/lib/io/gr_file_source.cc b/gnuradio-core/src/lib/io/gr_file_source.cc index 09f3986cd2..f3def0721b 100644 --- a/gnuradio-core/src/lib/io/gr_file_source.cc +++ b/gnuradio-core/src/lib/io/gr_file_source.cc @@ -89,7 +89,7 @@ gr_file_source::work (int noutput_items, if(d_fp == NULL) throw std::runtime_error("work with file not open"); - boost::mutex::scoped_lock lock(fp_mutex); // hold for the rest of this function + gruel::scoped_lock lock(fp_mutex); // hold for the rest of this function while (size) { i = fread(o, d_itemsize, size, (FILE *) d_fp); @@ -129,7 +129,7 @@ bool gr_file_source::seek (long seek_point, int whence) { // obtain exclusive access for duration of this function - boost::mutex::scoped_lock lock(fp_mutex); + gruel::scoped_lock lock(fp_mutex); return fseek((FILE *) d_fp, seek_point * d_itemsize, whence) == 0; } @@ -137,7 +137,7 @@ void gr_file_source::open(const char *filename, bool repeat) { // obtain exclusive access for duration of this function - boost::mutex::scoped_lock lock(fp_mutex); + gruel::scoped_lock lock(fp_mutex); int fd; @@ -166,7 +166,7 @@ void gr_file_source::close() { // obtain exclusive access for duration of this function - boost::mutex::scoped_lock lock(fp_mutex); + gruel::scoped_lock lock(fp_mutex); if(d_new_fp != NULL) { fclose(d_new_fp); @@ -179,7 +179,7 @@ void gr_file_source::do_update() { if(d_updated) { - boost::mutex::scoped_lock lock(fp_mutex); // hold while in scope + gruel::scoped_lock lock(fp_mutex); // hold while in scope if(d_fp) fclose(d_fp); diff --git a/gr-blocks/lib/file_source_impl.cc b/gr-blocks/lib/file_source_impl.cc index ed1f50c435..a8db31be7a 100644 --- a/gr-blocks/lib/file_source_impl.cc +++ b/gr-blocks/lib/file_source_impl.cc @@ -84,7 +84,7 @@ namespace gr { file_source_impl::open(const char *filename, bool repeat) { // obtain exclusive access for duration of this function - boost::mutex::scoped_lock lock(fp_mutex); + gruel::scoped_lock lock(fp_mutex); int fd; @@ -113,7 +113,7 @@ namespace gr { file_source_impl::close() { // obtain exclusive access for duration of this function - boost::mutex::scoped_lock lock(fp_mutex); + gruel::scoped_lock lock(fp_mutex); if(d_new_fp != NULL) { fclose(d_new_fp); @@ -126,7 +126,7 @@ namespace gr { file_source_impl::do_update() { if(d_updated) { - boost::mutex::scoped_lock lock(fp_mutex); // hold while in scope + gruel::scoped_lock lock(fp_mutex); // hold while in scope if(d_fp) fclose(d_fp); @@ -150,7 +150,7 @@ namespace gr { if(d_fp == NULL) throw std::runtime_error("work with file not open"); - boost::mutex::scoped_lock lock(fp_mutex); // hold for the rest of this function + gruel::scoped_lock lock(fp_mutex); // hold for the rest of this function while(size) { i = fread(o, d_itemsize, size, (FILE*)d_fp); diff --git a/gr-qtgui/lib/plot_raster.cc b/gr-qtgui/lib/plot_raster.cc index bccff88f10..76bff473e9 100644 --- a/gr-qtgui/lib/plot_raster.cc +++ b/gr-qtgui/lib/plot_raster.cc @@ -312,11 +312,21 @@ QImage PlotTimeRaster::renderImage(const QwtScaleMap &xMap, return image; } +#if QWT_VERSION < 0x060000 +QwtDoubleInterval +PlotTimeRaster::interval(Qt::Axis ax) const +{ + return d_data->data->range(); +} + +#else + QwtInterval PlotTimeRaster::interval(Qt::Axis ax) const { return d_data->data->interval(ax); } +#endif /*! \brief Draw the raster diff --git a/gr-qtgui/lib/plot_raster.h b/gr-qtgui/lib/plot_raster.h index e46dea568b..7bea0a4d57 100644 --- a/gr-qtgui/lib/plot_raster.h +++ b/gr-qtgui/lib/plot_raster.h @@ -61,11 +61,12 @@ public: #if QWT_VERSION < 0x060000 virtual QwtDoubleRect boundingRect() const; virtual QSize rasterHint(const QwtDoubleRect &) const; + virtual QwtDoubleInterval interval(Qt::Axis ax) const; +#else + virtual QwtInterval interval(Qt::Axis ax) const; #endif virtual int rtti() const; - - virtual QwtInterval interval(Qt::Axis ax) const; virtual void draw(QPainter *p, const QwtScaleMap &xMap, diff --git a/gr-qtgui/lib/timeRasterGlobalData.cc b/gr-qtgui/lib/timeRasterGlobalData.cc index 27cb41d403..10ba7ececc 100644 --- a/gr-qtgui/lib/timeRasterGlobalData.cc +++ b/gr-qtgui/lib/timeRasterGlobalData.cc @@ -79,7 +79,7 @@ void TimeRasterData::copy(const TimeRasterData* rhs) d_data_size = d_totalitems + static_cast<int>(floor(d_cols)); setBoundingRect(rhs->boundingRect()); delete [] d_data; - _data = new double[d_data_size]; + d_data = new double[d_data_size]; } #else if((d_cols != rhs->getNumCols()) || (d_rows != rhs->getNumRows())) { diff --git a/gr-qtgui/lib/timerasterdisplayform.cc b/gr-qtgui/lib/timerasterdisplayform.cc index b7f1dba2f6..1fbad090ca 100644 --- a/gr-qtgui/lib/timerasterdisplayform.cc +++ b/gr-qtgui/lib/timerasterdisplayform.cc @@ -33,6 +33,12 @@ TimeRasterDisplayForm::TimeRasterDisplayForm(int nplots, QWidget* parent) : DisplayForm(nplots, parent) { +#if QWT_VERSION < 0x060000 + std::cerr << "Warning: QWT5 has been found which has serious performance issues with raster plots." + << std::endl << " Consider updating to QWT version 6 to use the time raster GUIs." + << std::endl << std::endl; +#endif + _layout = new QGridLayout(this); _displayPlot = new TimeRasterDisplayPlot(nplots, samp_rate, rows, cols, this); _layout->addWidget(_displayPlot, 0, 0); diff --git a/gruel/src/include/gruel/thread.h b/gruel/src/include/gruel/thread.h index 63143c8b46..c0b54b0a46 100644 --- a/gruel/src/include/gruel/thread.h +++ b/gruel/src/include/gruel/thread.h @@ -31,7 +31,7 @@ namespace gruel { typedef boost::thread thread; typedef boost::mutex mutex; - typedef boost::mutex::scoped_lock scoped_lock; + typedef boost::unique_lock<boost::mutex> scoped_lock; typedef boost::condition_variable condition_variable; } /* namespace gruel */ |