[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 07/11: qtgui: adds single-shot autoscale bu
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 07/11: qtgui: adds single-shot autoscale button and stop button to time sink control panel. |
Date: |
Sun, 5 Apr 2015 23:58:07 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch master
in repository gnuradio.
commit 18e9f92dbc7f5717042964f0a9e29978c0a4bff6
Author: Tom Rondeau <address@hidden>
Date: Sun Apr 5 18:17:29 2015 -0400
qtgui: adds single-shot autoscale button and stop button to time sink
control panel.
---
.../include/gnuradio/qtgui/TimeDomainDisplayPlot.h | 2 ++
gr-qtgui/include/gnuradio/qtgui/timecontrolpanel.h | 6 ++++-
gr-qtgui/include/gnuradio/qtgui/timedisplayform.h | 1 +
gr-qtgui/lib/TimeDomainDisplayPlot.cc | 13 +++++++++++
gr-qtgui/lib/timecontrolpanel.cc | 27 ++++++++++++++++++----
gr-qtgui/lib/timedisplayform.cc | 7 ++++++
6 files changed, 51 insertions(+), 5 deletions(-)
diff --git a/gr-qtgui/include/gnuradio/qtgui/TimeDomainDisplayPlot.h
b/gr-qtgui/include/gnuradio/qtgui/TimeDomainDisplayPlot.h
index 3a51888..4b743e0 100644
--- a/gr-qtgui/include/gnuradio/qtgui/TimeDomainDisplayPlot.h
+++ b/gr-qtgui/include/gnuradio/qtgui/TimeDomainDisplayPlot.h
@@ -57,6 +57,7 @@ public slots:
const std::string &strunits);
void setAutoScale(bool state);
+ void setAutoScaleShot();
void setSemilogx(bool en);
void setSemilogy(bool en);
@@ -82,6 +83,7 @@ private:
bool d_semilogx;
bool d_semilogy;
+ bool d_autoscale_shot;
std::vector< std::vector<QwtPlotMarker*> > d_tag_markers;
std::vector<bool> d_tag_markers_en;
diff --git a/gr-qtgui/include/gnuradio/qtgui/timecontrolpanel.h
b/gr-qtgui/include/gnuradio/qtgui/timecontrolpanel.h
index 6f8800c..c8e4143 100644
--- a/gr-qtgui/include/gnuradio/qtgui/timecontrolpanel.h
+++ b/gr-qtgui/include/gnuradio/qtgui/timecontrolpanel.h
@@ -52,6 +52,7 @@ private:
TimeDisplayForm *d_parent;
QGroupBox *d_axes_box;
QGroupBox *d_trigger_box;
+ QGroupBox *d_extras_box;
QVBoxLayout *d_axes_layout;
QHBoxLayout *d_yoff_layout;
@@ -60,6 +61,7 @@ private:
QVBoxLayout *d_trigger_layout;
QHBoxLayout *d_trigger_level_layout;
QHBoxLayout *d_trigger_delay_layout;
+ QVBoxLayout *d_extras_layout;
QLabel *d_yoff_label;
QLabel *d_yrange_label;
@@ -67,7 +69,7 @@ private:
QLabel *d_trigger_level_label;
QLabel *d_trigger_delay_label;
- QCheckBox *d_autorange_check;
+ QCheckBox *d_autoscale_check;
QCheckBox *d_grid_check;
QPushButton *d_yoff_plus, *d_yoff_minus;
QPushButton *d_yrange_plus, *d_yrange_minus;
@@ -76,6 +78,8 @@ private:
QComboBox *d_trigger_slope_combo;
QPushButton *d_trigger_level_plus, *d_trigger_level_minus;
QPushButton *d_trigger_delay_plus, *d_trigger_delay_minus;
+ QPushButton *d_autoscale_button;
+ QPushButton *d_stop_button;
};
#endif /* TIME_CONTROL_PANEL_H */
diff --git a/gr-qtgui/include/gnuradio/qtgui/timedisplayform.h
b/gr-qtgui/include/gnuradio/qtgui/timedisplayform.h
index ab88a5a..0dfab2a 100644
--- a/gr-qtgui/include/gnuradio/qtgui/timedisplayform.h
+++ b/gr-qtgui/include/gnuradio/qtgui/timedisplayform.h
@@ -64,6 +64,7 @@ public slots:
void setNPoints(const int);
void setStem(bool en);
void autoScale(bool en);
+ void autoScaleShot();
void setSemilogx(bool en);
void setSemilogy(bool en);
void tagMenuSlot(bool en);
diff --git a/gr-qtgui/lib/TimeDomainDisplayPlot.cc
b/gr-qtgui/lib/TimeDomainDisplayPlot.cc
index 2602c0a..16ba4a3 100644
--- a/gr-qtgui/lib/TimeDomainDisplayPlot.cc
+++ b/gr-qtgui/lib/TimeDomainDisplayPlot.cc
@@ -152,6 +152,7 @@ TimeDomainDisplayPlot::TimeDomainDisplayPlot(int nplots,
QWidget* parent)
d_semilogx = false;
d_semilogy = false;
+ d_autoscale_shot = false;
setAxisScaleEngine(QwtPlot::xBottom, new QwtLinearScaleEngine);
setXaxis(0, d_numPoints);
@@ -401,6 +402,10 @@ TimeDomainDisplayPlot::plotNewData(const
std::vector<double*> dataPoints,
}
}
_autoScale(bottom, top);
+ if(d_autoscale_shot) {
+ d_autoscale_state = false;
+ d_autoscale_shot = false;
+ }
}
replot();
@@ -490,6 +495,14 @@ TimeDomainDisplayPlot::setAutoScale(bool state)
}
void
+TimeDomainDisplayPlot::setAutoScaleShot()
+{
+ d_autoscale_state = true;
+ d_autoscale_shot = true;
+}
+
+
+void
TimeDomainDisplayPlot::setSampleRate(double sr, double units,
const std::string &strunits)
{
diff --git a/gr-qtgui/lib/timecontrolpanel.cc b/gr-qtgui/lib/timecontrolpanel.cc
index ab96a41..f02e536 100644
--- a/gr-qtgui/lib/timecontrolpanel.cc
+++ b/gr-qtgui/lib/timecontrolpanel.cc
@@ -29,7 +29,7 @@ TimeControlPanel::TimeControlPanel(TimeDisplayForm *form)
// Set up the box for axes items
d_axes_box = new QGroupBox("Axes");
d_axes_layout = new QVBoxLayout;
- d_autorange_check = new QCheckBox("Autorange");
+ d_autoscale_check = new QCheckBox("Autoscale");
d_grid_check = new QCheckBox("Grid");
d_yoff_layout = new QHBoxLayout;
@@ -96,9 +96,15 @@ TimeControlPanel::TimeControlPanel(TimeDisplayForm *form)
d_trigger_delay_layout->addWidget(d_trigger_delay_plus);
d_trigger_delay_layout->addWidget(d_trigger_delay_minus);
+ // Set up the box for other items
+ d_extras_box = new QGroupBox("Extras");
+ d_extras_layout = new QVBoxLayout;
+ d_autoscale_button = new QPushButton("Autoscale");
+ d_stop_button = new QPushButton("Stop");
+ d_stop_button->setCheckable(true);
// Set up the boxes into the layout
- d_axes_layout->addWidget(d_autorange_check);
+ d_axes_layout->addWidget(d_autoscale_check);
d_axes_layout->addWidget(d_grid_check);
d_axes_layout->addLayout(d_yoff_layout);
d_axes_layout->addLayout(d_yrange_layout);
@@ -111,12 +117,18 @@ TimeControlPanel::TimeControlPanel(TimeDisplayForm *form)
d_trigger_layout->addLayout(d_trigger_delay_layout);
d_trigger_box->setLayout(d_trigger_layout);
+ d_extras_layout->addWidget(d_autoscale_button);
+ d_extras_layout->addWidget(d_stop_button);
+ d_extras_box->setLayout(d_extras_layout);
+
addWidget(d_axes_box);
addWidget(d_trigger_box);
+ addWidget(d_extras_box);
addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum,
QSizePolicy::Expanding));
- connect(d_autorange_check, SIGNAL(clicked(bool)),
+ // Connect up the control signals/slots
+ connect(d_autoscale_check, SIGNAL(clicked(bool)),
d_parent, SLOT(autoScale(bool)));
connect(d_grid_check, SIGNAL(clicked(bool)),
d_parent, SLOT(setGrid(bool)));
@@ -146,14 +158,21 @@ TimeControlPanel::TimeControlPanel(TimeDisplayForm *form)
d_parent, SLOT(notifyTriggerDelayPlus()));
connect(d_trigger_delay_minus, SIGNAL(pressed(void)),
d_parent, SLOT(notifyTriggerDelayMinus()));
+
+ connect(d_autoscale_button, SIGNAL(pressed(void)),
+ d_parent, SLOT(autoScaleShot(void)));
+ connect(d_stop_button, SIGNAL(pressed(void)),
+ d_parent, SLOT(setStop(void)));
}
TimeControlPanel::~TimeControlPanel()
{
removeWidget(d_axes_box);
removeWidget(d_trigger_box);
+ removeWidget(d_extras_box);
delete d_axes_box;
delete d_trigger_box;
+ delete d_extras_box;
// All other children of the boxes are automatically deleted.
}
@@ -161,7 +180,7 @@ TimeControlPanel::~TimeControlPanel()
void
TimeControlPanel::toggleAutoScale(bool en)
{
- d_autorange_check->setChecked(en);
+ d_autoscale_check->setChecked(en);
}
void
diff --git a/gr-qtgui/lib/timedisplayform.cc b/gr-qtgui/lib/timedisplayform.cc
index 9a30b30..cc85927 100644
--- a/gr-qtgui/lib/timedisplayform.cc
+++ b/gr-qtgui/lib/timedisplayform.cc
@@ -308,6 +308,13 @@ TimeDisplayForm::autoScale(bool en)
}
void
+TimeDisplayForm::autoScaleShot()
+{
+ getPlot()->setAutoScaleShot();
+ emit signalReplot();
+}
+
+void
TimeDisplayForm::setSemilogx(bool en)
{
d_semilogx = en;
- [Commit-gnuradio] [gnuradio] branch master updated (fa2abde -> cce2347), git, 2015/04/05
- [Commit-gnuradio] [gnuradio] 10/11: Merge remote-tracking branch 'tom/qtgui/time_auto_and_stop', git, 2015/04/05
- [Commit-gnuradio] [gnuradio] 08/11: Merge remote-tracking branch 'mmueller/runtime_hier_block2_signage', git, 2015/04/05
- [Commit-gnuradio] [gnuradio] 09/11: Merge remote-tracking branch 'mmueller/remove_aadvarkness', git, 2015/04/05
- [Commit-gnuradio] [gnuradio] 11/11: Merge remote-tracking branch 'osh/tpc_add', git, 2015/04/05
- [Commit-gnuradio] [gnuradio] 03/11: blocks: adding a variable tag_object to help build tags., git, 2015/04/05
- [Commit-gnuradio] [gnuradio] 02/11: fec: TPC now runs happily, encoder produces uint8_t instead of float, decoder GRC def now fixed, git, 2015/04/05
- [Commit-gnuradio] [gnuradio] 04/11: fec: TPC adding standard headers, git, 2015/04/05
- [Commit-gnuradio] [gnuradio] 05/11: Fixed up the int/size_t handling in hb2's new max/min_output... methods, git, 2015/04/05
- [Commit-gnuradio] [gnuradio] 07/11: qtgui: adds single-shot autoscale button and stop button to time sink control panel.,
git <=
- [Commit-gnuradio] [gnuradio] 01/11: fec: adding TPC encoder and decoder, git, 2015/04/05
- [Commit-gnuradio] [gnuradio] 06/11: removed doxyxml example, git, 2015/04/05