diff options
Diffstat (limited to 'gr-qtgui/lib')
-rw-r--r-- | gr-qtgui/lib/FrequencyDisplayPlot.cc | 1 | ||||
-rw-r--r-- | gr-qtgui/lib/TimeDomainDisplayPlot.cc | 8 | ||||
-rw-r--r-- | gr-qtgui/lib/VectorDisplayPlot.cc | 22 | ||||
-rw-r--r-- | gr-qtgui/lib/const_sink_c_impl.cc | 6 | ||||
-rw-r--r-- | gr-qtgui/lib/edit_box_msg_impl.cc | 6 | ||||
-rw-r--r-- | gr-qtgui/lib/freq_sink_c_impl.cc | 6 | ||||
-rw-r--r-- | gr-qtgui/lib/freq_sink_f_impl.cc | 6 | ||||
-rw-r--r-- | gr-qtgui/lib/freqcontrolpanel.cc | 19 | ||||
-rw-r--r-- | gr-qtgui/lib/freqdisplayform.cc | 6 | ||||
-rw-r--r-- | gr-qtgui/lib/histogram_sink_f_impl.cc | 6 | ||||
-rw-r--r-- | gr-qtgui/lib/qtgui_util.cc | 12 | ||||
-rw-r--r-- | gr-qtgui/lib/sink_c_impl.cc | 6 | ||||
-rw-r--r-- | gr-qtgui/lib/sink_f_impl.cc | 6 | ||||
-rw-r--r-- | gr-qtgui/lib/time_raster_sink_b_impl.cc | 6 | ||||
-rw-r--r-- | gr-qtgui/lib/time_raster_sink_f_impl.cc | 6 | ||||
-rw-r--r-- | gr-qtgui/lib/time_sink_c_impl.cc | 6 | ||||
-rw-r--r-- | gr-qtgui/lib/time_sink_f_impl.cc | 6 | ||||
-rw-r--r-- | gr-qtgui/lib/vector_sink_f_impl.cc | 6 | ||||
-rw-r--r-- | gr-qtgui/lib/waterfall_sink_c_impl.cc | 6 | ||||
-rw-r--r-- | gr-qtgui/lib/waterfall_sink_f_impl.cc | 6 |
20 files changed, 65 insertions, 87 deletions
diff --git a/gr-qtgui/lib/FrequencyDisplayPlot.cc b/gr-qtgui/lib/FrequencyDisplayPlot.cc index 233c786d0a..2820bae2f5 100644 --- a/gr-qtgui/lib/FrequencyDisplayPlot.cc +++ b/gr-qtgui/lib/FrequencyDisplayPlot.cc @@ -607,7 +607,6 @@ FrequencyDisplayPlot::setYLabel(const std::string &label, if(unit.length() > 0) l += " (" + unit + ")"; setAxisTitle(QwtPlot::yLeft, QString(l.c_str())); - ((FreqDisplayZoomer*)d_zoomer)->setUnitType(unit); } void diff --git a/gr-qtgui/lib/TimeDomainDisplayPlot.cc b/gr-qtgui/lib/TimeDomainDisplayPlot.cc index bc9f630235..51a1989a9a 100644 --- a/gr-qtgui/lib/TimeDomainDisplayPlot.cc +++ b/gr-qtgui/lib/TimeDomainDisplayPlot.cc @@ -343,9 +343,7 @@ TimeDomainDisplayPlot::plotNewData(const std::vector<double*> dataPoints, m->setXValue(sample_offset); m->setYValue(yval); - QBrush brush; - brush.setColor(QColor(0xC8, 0x2F, 0x1F)); - brush.setStyle(Qt::SolidPattern); + QBrush brush(getTagBackgroundColor(), getTagBackgroundStyle()); QPen pen; pen.setColor(Qt::black); @@ -367,8 +365,10 @@ TimeDomainDisplayPlot::plotNewData(const std::vector<double*> dataPoints, #else m->setSymbol(sym); #endif + QwtText tag_label(s.str().c_str()); + tag_label.setColor(getTagTextColor()); + m->setLabel(tag_label); - m->setLabel(QwtText(s.str().c_str())); m->attach(this); if(!(show && d_tag_markers_en[which])) { diff --git a/gr-qtgui/lib/VectorDisplayPlot.cc b/gr-qtgui/lib/VectorDisplayPlot.cc index 2babfea1cc..54d5c49acc 100644 --- a/gr-qtgui/lib/VectorDisplayPlot.cc +++ b/gr-qtgui/lib/VectorDisplayPlot.cc @@ -284,12 +284,12 @@ void VectorDisplayPlot::setYAxisLabel(const QString &label) void VectorDisplayPlot::setXAxisUnit(const QString &unit) { - ((VectorDisplayZoomer*)d_zoomer)->setXUnits(unit); + ((VectorDisplayZoomer*)d_zoomer)->setXUnits(unit); } void VectorDisplayPlot::setYAxisUnit(const QString &unit) { - ((VectorDisplayZoomer*)d_zoomer)->setYUnits(unit); + ((VectorDisplayZoomer*)d_zoomer)->setYUnits(unit); } void @@ -301,17 +301,17 @@ VectorDisplayPlot::setXAxisValues( if((start != d_x_axis_start) || (step != d_x_axis_step)) reset = true; - d_x_axis_start = start; - d_x_axis_step = step; + d_x_axis_start = start; + d_x_axis_step = step; - if((axisScaleDraw(QwtPlot::xBottom) != NULL) && (d_zoomer != NULL)) { - setAxisTitle(QwtPlot::xBottom, d_x_axis_label); - if(reset) { - _resetXAxisPoints(); - clearMaxData(); - clearMinData(); - } + if((axisScaleDraw(QwtPlot::xBottom) != NULL) && (d_zoomer != NULL)) { + setAxisTitle(QwtPlot::xBottom, d_x_axis_label); + if(reset) { + _resetXAxisPoints(); + clearMaxData(); + clearMinData(); } + } } void diff --git a/gr-qtgui/lib/const_sink_c_impl.cc b/gr-qtgui/lib/const_sink_c_impl.cc index 7aa99a1c68..26ddf793dc 100644 --- a/gr-qtgui/lib/const_sink_c_impl.cc +++ b/gr-qtgui/lib/const_sink_c_impl.cc @@ -136,11 +136,7 @@ namespace gr { } // If a style sheet is set in the prefs file, enable it here. - std::string qssfile = prefs::singleton()->get_string("qtgui","qss",""); - if(qssfile.size() > 0) { - QString sstext = get_qt_style_sheet(QString(qssfile.c_str())); - d_qApplication->setStyleSheet(sstext); - } + check_set_qss(d_qApplication); int numplots = (d_nconnections > 0) ? d_nconnections : 1; d_main_gui = new ConstellationDisplayForm(numplots, d_parent); diff --git a/gr-qtgui/lib/edit_box_msg_impl.cc b/gr-qtgui/lib/edit_box_msg_impl.cc index e0b5f256b6..0dee1fa18b 100644 --- a/gr-qtgui/lib/edit_box_msg_impl.cc +++ b/gr-qtgui/lib/edit_box_msg_impl.cc @@ -69,11 +69,7 @@ namespace gr { } // If a style sheet is set in the prefs file, enable it here. - std::string qssfile = prefs::singleton()->get_string("qtgui","qss",""); - if(qssfile.size() > 0) { - QString sstext = get_qt_style_sheet(QString(qssfile.c_str())); - d_qApplication->setStyleSheet(sstext); - } + check_set_qss(d_qApplication); d_is_pair = is_pair; d_is_static = is_static; diff --git a/gr-qtgui/lib/freq_sink_c_impl.cc b/gr-qtgui/lib/freq_sink_c_impl.cc index 544c8b3c47..c697e8c269 100644 --- a/gr-qtgui/lib/freq_sink_c_impl.cc +++ b/gr-qtgui/lib/freq_sink_c_impl.cc @@ -162,11 +162,7 @@ namespace gr { } // If a style sheet is set in the prefs file, enable it here. - std::string qssfile = prefs::singleton()->get_string("qtgui","qss",""); - if(qssfile.size() > 0) { - QString sstext = get_qt_style_sheet(QString(qssfile.c_str())); - d_qApplication->setStyleSheet(sstext); - } + check_set_qss(d_qApplication); int numplots = (d_nconnections > 0) ? d_nconnections : 1; d_main_gui = new FreqDisplayForm(numplots, d_parent); diff --git a/gr-qtgui/lib/freq_sink_f_impl.cc b/gr-qtgui/lib/freq_sink_f_impl.cc index 816b37415e..046414ffaf 100644 --- a/gr-qtgui/lib/freq_sink_f_impl.cc +++ b/gr-qtgui/lib/freq_sink_f_impl.cc @@ -161,11 +161,7 @@ namespace gr { } // If a style sheet is set in the prefs file, enable it here. - std::string qssfile = prefs::singleton()->get_string("qtgui","qss",""); - if(qssfile.size() > 0) { - QString sstext = get_qt_style_sheet(QString(qssfile.c_str())); - d_qApplication->setStyleSheet(sstext); - } + check_set_qss(d_qApplication); int numplots = (d_nconnections > 0) ? d_nconnections : 1; d_main_gui = new FreqDisplayForm(numplots, d_parent); diff --git a/gr-qtgui/lib/freqcontrolpanel.cc b/gr-qtgui/lib/freqcontrolpanel.cc index 9729005f50..c0a8ed4158 100644 --- a/gr-qtgui/lib/freqcontrolpanel.cc +++ b/gr-qtgui/lib/freqcontrolpanel.cc @@ -229,6 +229,12 @@ FreqControlPanel::toggleGrid(bool en) } void +FreqControlPanel::toggleAxisLabels(bool en) +{ + d_axislabels_check->setChecked(en); +} + +void FreqControlPanel::toggleMaxHold(bool en) { d_maxhold_check->setChecked(en); @@ -243,12 +249,23 @@ FreqControlPanel::toggleMinHold(bool en) void FreqControlPanel::notifyAvgSlider(int val) { - float fval = static_cast<float>(val) / (d_slider_max - d_slider_min); + float fval = static_cast<float>(val) / (d_slider_max - d_slider_min + 1); emit signalAvgSlider(fval); emit signalAvg(true); } void +FreqControlPanel::setFFTAverage(float val) +{ + int slider_val = static_cast<int>(roundf(val * (d_slider_max - d_slider_min + 1))); + if (slider_val > d_slider_max) + slider_val = d_slider_max; + else if (slider_val < d_slider_min) + slider_val = d_slider_min; + d_avg_slider->setValue(slider_val); +} + +void FreqControlPanel::toggleFFTSize(int val) { int index = static_cast<int>(round(logf(static_cast<float>(val))/logf(2.0f))) - 5; diff --git a/gr-qtgui/lib/freqdisplayform.cc b/gr-qtgui/lib/freqdisplayform.cc index 141df5475c..6aa4894a96 100644 --- a/gr-qtgui/lib/freqdisplayform.cc +++ b/gr-qtgui/lib/freqdisplayform.cc @@ -177,6 +177,8 @@ FreqDisplayForm::setupControlPanel() // Connect action items in menu to controlpanel widgets connect(d_grid_act, SIGNAL(triggered(bool)), d_controlpanel, SLOT(toggleGrid(bool))); + connect(d_axislabelsmenu, SIGNAL(triggered(bool)), + d_controlpanel, SLOT(toggleAxisLabels(bool))); connect(d_sizemenu, SIGNAL(whichTrigger(int)), d_controlpanel, SLOT(toggleFFTSize(int))); connect(d_winmenu, SIGNAL(whichTrigger(gr::filter::firdes::win_type)), @@ -189,6 +191,8 @@ FreqDisplayForm::setupControlPanel() d_controlpanel, SLOT(toggleMaxHold(bool))); connect(d_minhold_act, SIGNAL(triggered(bool)), d_controlpanel, SLOT(toggleMinHold(bool))); + connect(d_avgmenu, SIGNAL(whichTrigger(float)), + d_controlpanel, SLOT(setFFTAverage(float))); connect(d_tr_mode_menu, SIGNAL(whichTrigger(gr::qtgui::trigger_mode)), d_controlpanel, SLOT(toggleTriggerMode(gr::qtgui::trigger_mode))); connect(this, SIGNAL(signalTriggerMode(gr::qtgui::trigger_mode)), @@ -199,10 +203,12 @@ FreqDisplayForm::setupControlPanel() d_layout->addLayout(d_controlpanel, 0, 1); d_controlpanel->toggleGrid(d_grid_act->isChecked()); + d_controlpanel->toggleAxisLabels(d_axislabelsmenu->isChecked()); d_controlpanelmenu->setChecked(true); d_controlpanel->toggleTriggerMode(getTriggerMode()); d_controlpanel->toggleMaxHold(d_maxhold_act->isChecked()); d_controlpanel->toggleMinHold(d_minhold_act->isChecked()); + d_controlpanel->setFFTAverage(getFFTAverage()); emit signalFFTSize(getFFTSize()); emit signalFFTWindow(getFFTWindowType()); diff --git a/gr-qtgui/lib/histogram_sink_f_impl.cc b/gr-qtgui/lib/histogram_sink_f_impl.cc index 376f50a4a4..13e50b217c 100644 --- a/gr-qtgui/lib/histogram_sink_f_impl.cc +++ b/gr-qtgui/lib/histogram_sink_f_impl.cc @@ -123,11 +123,7 @@ namespace gr { } // If a style sheet is set in the prefs file, enable it here. - std::string qssfile = prefs::singleton()->get_string("qtgui","qss",""); - if(qssfile.size() > 0) { - QString sstext = get_qt_style_sheet(QString(qssfile.c_str())); - d_qApplication->setStyleSheet(sstext); - } + check_set_qss(d_qApplication); int numplots = (d_nconnections > 0) ? d_nconnections : 1; d_main_gui = new HistogramDisplayForm(numplots, d_parent); diff --git a/gr-qtgui/lib/qtgui_util.cc b/gr-qtgui/lib/qtgui_util.cc index 07cf3cc9a3..0a0c826bbe 100644 --- a/gr-qtgui/lib/qtgui_util.cc +++ b/gr-qtgui/lib/qtgui_util.cc @@ -21,8 +21,11 @@ */ #include <gnuradio/qtgui/utils.h> +#include <gnuradio/prefs.h> #include <QDebug> #include <QFile> +#include <QCoreApplication> +#include <qapplication.h> QString get_qt_style_sheet(QString filename) @@ -101,3 +104,12 @@ QwtDblClickPlotPicker::stateMachine(int n) const { return new QwtPickerDblClickPointMachine; } + +void check_set_qss(QApplication *app){ + std::string qssfile = gr::prefs::singleton()->get_string("qtgui","qss",""); + if(qssfile.size() > 0) { + QString sstext = get_qt_style_sheet(QString(qssfile.c_str())); + app->setStyleSheet(sstext); + } +} + diff --git a/gr-qtgui/lib/sink_c_impl.cc b/gr-qtgui/lib/sink_c_impl.cc index 14ddde8e20..ba1be4b7c3 100644 --- a/gr-qtgui/lib/sink_c_impl.cc +++ b/gr-qtgui/lib/sink_c_impl.cc @@ -138,11 +138,7 @@ namespace gr { } // If a style sheet is set in the prefs file, enable it here. - std::string qssfile = prefs::singleton()->get_string("qtgui","qss",""); - if(qssfile.size() > 0) { - QString sstext = get_qt_style_sheet(QString(qssfile.c_str())); - d_qApplication->setStyleSheet(sstext); - } + check_set_qss(d_qApplication); if(d_center_freq < 0) { throw std::runtime_error("sink_c_impl: Received bad center frequency.\n"); diff --git a/gr-qtgui/lib/sink_f_impl.cc b/gr-qtgui/lib/sink_f_impl.cc index e60e98a59b..73b6fcad83 100644 --- a/gr-qtgui/lib/sink_f_impl.cc +++ b/gr-qtgui/lib/sink_f_impl.cc @@ -138,11 +138,7 @@ namespace gr { } // If a style sheet is set in the prefs file, enable it here. - std::string qssfile = prefs::singleton()->get_string("qtgui","qss",""); - if(qssfile.size() > 0) { - QString sstext = get_qt_style_sheet(QString(qssfile.c_str())); - d_qApplication->setStyleSheet(sstext); - } + check_set_qss(d_qApplication); uint64_t maxBufferSize = 32768; d_main_gui = new SpectrumGUIClass(maxBufferSize, d_fftsize, diff --git a/gr-qtgui/lib/time_raster_sink_b_impl.cc b/gr-qtgui/lib/time_raster_sink_b_impl.cc index 7b252a4d1c..1e2fe360b1 100644 --- a/gr-qtgui/lib/time_raster_sink_b_impl.cc +++ b/gr-qtgui/lib/time_raster_sink_b_impl.cc @@ -138,11 +138,7 @@ namespace gr { } // If a style sheet is set in the prefs file, enable it here. - std::string qssfile = prefs::singleton()->get_string("qtgui","qss",""); - if(qssfile.size() > 0) { - QString sstext = get_qt_style_sheet(QString(qssfile.c_str())); - d_qApplication->setStyleSheet(sstext); - } + check_set_qss(d_qApplication); // Create time raster plot; as a bit input, we expect to see 1's // and 0's from each stream, so we set the maximum intensity diff --git a/gr-qtgui/lib/time_raster_sink_f_impl.cc b/gr-qtgui/lib/time_raster_sink_f_impl.cc index 0e4cb1d345..e4cbb0d38f 100644 --- a/gr-qtgui/lib/time_raster_sink_f_impl.cc +++ b/gr-qtgui/lib/time_raster_sink_f_impl.cc @@ -136,11 +136,7 @@ namespace gr { } // If a style sheet is set in the prefs file, enable it here. - std::string qssfile = prefs::singleton()->get_string("qtgui","qss",""); - if(qssfile.size() > 0) { - QString sstext = get_qt_style_sheet(QString(qssfile.c_str())); - d_qApplication->setStyleSheet(sstext); - } + check_set_qss(d_qApplication); // Create time raster plot; as a bit input, we expect to see 1's // and 0's from each stream, so we set the maximum intensity diff --git a/gr-qtgui/lib/time_sink_c_impl.cc b/gr-qtgui/lib/time_sink_c_impl.cc index b59e4c9461..25d5a687d1 100644 --- a/gr-qtgui/lib/time_sink_c_impl.cc +++ b/gr-qtgui/lib/time_sink_c_impl.cc @@ -137,11 +137,7 @@ namespace gr { } // If a style sheet is set in the prefs file, enable it here. - std::string qssfile = prefs::singleton()->get_string("qtgui","qss",""); - if(qssfile.size() > 0) { - QString sstext = get_qt_style_sheet(QString(qssfile.c_str())); - d_qApplication->setStyleSheet(sstext); - } + check_set_qss(d_qApplication); int numplots = (d_nconnections > 0) ? d_nconnections : 2; d_main_gui = new TimeDisplayForm(numplots, d_parent); diff --git a/gr-qtgui/lib/time_sink_f_impl.cc b/gr-qtgui/lib/time_sink_f_impl.cc index 28bbb44ee9..419a9243c4 100644 --- a/gr-qtgui/lib/time_sink_f_impl.cc +++ b/gr-qtgui/lib/time_sink_f_impl.cc @@ -134,11 +134,7 @@ namespace gr { } // If a style sheet is set in the prefs file, enable it here. - std::string qssfile = prefs::singleton()->get_string("qtgui","qss",""); - if(qssfile.size() > 0) { - QString sstext = get_qt_style_sheet(QString(qssfile.c_str())); - d_qApplication->setStyleSheet(sstext); - } + check_set_qss(d_qApplication); int numplots = (d_nconnections > 0) ? d_nconnections : 1; d_main_gui = new TimeDisplayForm(numplots, d_parent); diff --git a/gr-qtgui/lib/vector_sink_f_impl.cc b/gr-qtgui/lib/vector_sink_f_impl.cc index bafd1b73aa..fedef9654d 100644 --- a/gr-qtgui/lib/vector_sink_f_impl.cc +++ b/gr-qtgui/lib/vector_sink_f_impl.cc @@ -147,11 +147,7 @@ namespace gr { } // If a style sheet is set in the prefs file, enable it here. - std::string qssfile = prefs::singleton()->get_string("qtgui","qss",""); - if(qssfile.size() > 0) { - QString sstext = get_qt_style_sheet(QString(qssfile.c_str())); - d_qApplication->setStyleSheet(sstext); - } + check_set_qss(d_qApplication); d_main_gui = new VectorDisplayForm(d_nconnections, d_parent); d_main_gui->setVecSize(d_vlen); diff --git a/gr-qtgui/lib/waterfall_sink_c_impl.cc b/gr-qtgui/lib/waterfall_sink_c_impl.cc index d3ca347c36..4306b97d71 100644 --- a/gr-qtgui/lib/waterfall_sink_c_impl.cc +++ b/gr-qtgui/lib/waterfall_sink_c_impl.cc @@ -162,11 +162,7 @@ namespace gr { } // If a style sheet is set in the prefs file, enable it here. - std::string qssfile = prefs::singleton()->get_string("qtgui","qss",""); - if(qssfile.size() > 0) { - QString sstext = get_qt_style_sheet(QString(qssfile.c_str())); - d_qApplication->setStyleSheet(sstext); - } + check_set_qss(d_qApplication); int numplots = (d_nconnections > 0) ? d_nconnections : 1; d_main_gui = new WaterfallDisplayForm(numplots, d_parent); diff --git a/gr-qtgui/lib/waterfall_sink_f_impl.cc b/gr-qtgui/lib/waterfall_sink_f_impl.cc index 4b062de14d..9789c2cf6d 100644 --- a/gr-qtgui/lib/waterfall_sink_f_impl.cc +++ b/gr-qtgui/lib/waterfall_sink_f_impl.cc @@ -162,11 +162,7 @@ namespace gr { } // If a style sheet is set in the prefs file, enable it here. - std::string qssfile = prefs::singleton()->get_string("qtgui","qss",""); - if(qssfile.size() > 0) { - QString sstext = get_qt_style_sheet(QString(qssfile.c_str())); - d_qApplication->setStyleSheet(sstext); - } + check_set_qss(d_qApplication); int numplots = (d_nconnections > 0) ? d_nconnections : 1; d_main_gui = new WaterfallDisplayForm(numplots, d_parent); |