diff options
Diffstat (limited to 'gr-qtgui/lib')
-rw-r--r-- | gr-qtgui/lib/TimeDomainDisplayPlot.cc | 13 | ||||
-rw-r--r-- | gr-qtgui/lib/timecontrolpanel.cc | 27 | ||||
-rw-r--r-- | gr-qtgui/lib/timedisplayform.cc | 7 |
3 files changed, 43 insertions, 4 deletions
diff --git a/gr-qtgui/lib/TimeDomainDisplayPlot.cc b/gr-qtgui/lib/TimeDomainDisplayPlot.cc index 2602c0a609..16ba4a39c6 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 ab96a41a9d..f02e536572 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 9a30b30bfe..cc8592715e 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; |