From f7251fe9839b95b4adea7ec598a06f288acf59c9 Mon Sep 17 00:00:00 2001 From: Hannes Matuschek Date: Wed, 17 Dec 2014 11:55:38 +0100 Subject: [PATCH] Fixed minors. --- dist/linux/debian/control | 2 +- src/CMakeLists.txt | 4 ++-- src/gui/waterfallview.cc | 16 +++++++++++++++- src/gui/waterfallview.hh | 2 ++ 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/dist/linux/debian/control b/dist/linux/debian/control index 596d2dd..429dd63 100644 --- a/dist/linux/debian/control +++ b/dist/linux/debian/control @@ -16,6 +16,6 @@ Description: libsdr Package: libsdr-dev Section: hamradio Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} +Depends: ${shlibs:Depends}, ${misc:Depends}, libsdr Description: libsdr A C++ library for software defined radio. Development files. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ac530b8..0e0b0c1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -32,7 +32,7 @@ set_target_properties(libsdr PROPERTIES DEPENDS libsdr_hdrs) set_target_properties(libsdr PROPERTIES VERSION "${libsdr_VERSION_MAJOR}.${libsdr_VERSION_MINOR}.${libsdr_VERSION_PATCH}") set_target_properties(libsdr PROPERTIES SOVERION "${libsdr_VERSION_MAJOR}") -set_target_properties(libsdr PROPERTIES MACOSX_RPATH ${CMAKE_INSTALL_RPATH}) +set_target_properties(libsdr PROPERTIES MACOSX_RPATH "${CMAKE_INSTALL_RPATH}") set_target_properties(libsdr PROPERTIES INSTALL_NAME_DIR ${CMAKE_INSTALL_FULL_LIBDIR}) target_link_libraries(libsdr ${LIBS}) @@ -53,7 +53,7 @@ if(SDR_WITH_FFTW AND SDR_WITH_QT5) "${libsdr_VERSION_MAJOR}.${libsdr_VERSION_MINOR}.${libsdr_VERSION_PATCH}") set_target_properties(libsdr-gui PROPERTIES SOVERION "${libsdr_VERSION_MAJOR}") set_target_properties(libsdr-gui PROPERTIES INSTALL_NAME_DIR ${CMAKE_INSTALL_FULL_LIBDIR}) - set_target_properties(libsdr-gui PROPERTIES MACOSX_RPATH ${CMAKE_INSTALL_RPATH}) + set_target_properties(libsdr-gui PROPERTIES MACOSX_RPATH "${CMAKE_INSTALL_RPATH}") target_link_libraries(libsdr-gui libsdr ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES}) install(TARGETS libsdr-gui DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/src/gui/waterfallview.cc b/src/gui/waterfallview.cc index c5f36af..9b11b59 100644 --- a/src/gui/waterfallview.cc +++ b/src/gui/waterfallview.cc @@ -99,7 +99,7 @@ WaterFallView::WaterFallView(SpectrumProvider *spectrum, size_t hist, Direction // Get notified once a new spectrum is available: QObject::connect(_spectrum, SIGNAL(spectrumUpdated()), this, SLOT(_onSpectrumUpdated())); - QObject::connect(_spectrum, SIGNAL(spectrumConfigured()), this, SLOT(update())); + QObject::connect(_spectrum, SIGNAL(spectrumConfigured()), this, SLOT(_onSpectrumConfigure())); } void @@ -130,6 +130,20 @@ WaterFallView::_onSpectrumUpdated() { this->update(); } +void +WaterFallView::_onSpectrumConfigure() { + std::cerr << "Reset waterfall pixmap..." << std::endl; + // Update spectrum width + _N = _spectrum->fftSize(); + // Replace WaterFall pixmap + _waterfall = QPixmap(_N, _M); + // Fill waterfall pixmap + _waterfall.fill(Qt::black); + + // Trigger update + this->update(); +} + void WaterFallView::mouseReleaseEvent(QMouseEvent *evt) { // If event is accepted -> determine frequency diff --git a/src/gui/waterfallview.hh b/src/gui/waterfallview.hh index d9c9111..c33072f 100644 --- a/src/gui/waterfallview.hh +++ b/src/gui/waterfallview.hh @@ -95,6 +95,8 @@ protected: protected slots: /** Gets called once a new PSD is available. */ void _onSpectrumUpdated(); + /** Gets called once the spectrum provider gets reconfigured. */ + void _onSpectrumConfigure(); protected: /** The spectrum sink. */