diff options
author | Tom Rondeau <tom@trondeau.com> | 2015-03-25 00:09:20 -0700 |
---|---|---|
committer | Tom Rondeau <tom@trondeau.com> | 2015-03-29 14:07:17 -0700 |
commit | c117e3232b32bb70d268932bcea025feb0a4cf25 (patch) | |
tree | f30fe4b276293992847efdb386286590919d9b68 /gr-qtgui/lib/TimeDomainDisplayPlot.cc | |
parent | 603e1b2931a91b1718e0300cdade5e796ff12374 (diff) |
qtgui: wip: adding control panel to time display.
- Handles setting autoscale, grid, x and y axis, and trigger modes.
- Uses a new TimeControlPanel class to make it easy to insert and
delete the control panel.
- Toggle to turn on and off a new setting in the parameters box in
GRC.
- Pop-up menu and control panel should be sync'd with signals/slots.
- Shows a dotted red cross-hair for the trigger when set to Auto or
Normal.
Diffstat (limited to 'gr-qtgui/lib/TimeDomainDisplayPlot.cc')
-rw-r--r-- | gr-qtgui/lib/TimeDomainDisplayPlot.cc | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/gr-qtgui/lib/TimeDomainDisplayPlot.cc b/gr-qtgui/lib/TimeDomainDisplayPlot.cc index 7b81c86d2e..2602c0a609 100644 --- a/gr-qtgui/lib/TimeDomainDisplayPlot.cc +++ b/gr-qtgui/lib/TimeDomainDisplayPlot.cc @@ -195,8 +195,23 @@ TimeDomainDisplayPlot::TimeDomainDisplayPlot(int nplots, QWidget* parent) d_tag_markers.resize(d_nplots); d_tag_markers_en = std::vector<bool>(d_nplots, true); + + d_trigger_lines[0] = new QwtPlotMarker(); + d_trigger_lines[0]->setLineStyle(QwtPlotMarker::HLine); + d_trigger_lines[0]->setLinePen(QPen(Qt::red, 0.6, Qt::DashLine)); + d_trigger_lines[0]->setRenderHint(QwtPlotItem::RenderAntialiased); + d_trigger_lines[0]->setXValue(0.0); + d_trigger_lines[0]->setYValue(0.0); + + d_trigger_lines[1] = new QwtPlotMarker(); + d_trigger_lines[1]->setLineStyle(QwtPlotMarker::VLine); + d_trigger_lines[1]->setLinePen(QPen(Qt::red, 0.6, Qt::DashLine)); + d_trigger_lines[1]->setRenderHint(QwtPlotItem::RenderAntialiased); + d_trigger_lines[1]->setXValue(0.0); + d_trigger_lines[1]->setYValue(0.0); } + TimeDomainDisplayPlot::~TimeDomainDisplayPlot() { for(int i = 0; i < d_nplots; i++) @@ -494,6 +509,12 @@ TimeDomainDisplayPlot::setSampleRate(double sr, double units, } } +double +TimeDomainDisplayPlot::sampleRate() const +{ + return d_sample_rate; +} + void TimeDomainDisplayPlot::stemPlot(bool en) { @@ -575,4 +596,26 @@ TimeDomainDisplayPlot::setYLabel(const std::string &label, ((TimeDomainDisplayZoomer*)d_zoomer)->setYUnitType(unit); } +void +TimeDomainDisplayPlot::attachTriggerLines(bool en) +{ + if(en) { + d_trigger_lines[0]->attach(this); + d_trigger_lines[1]->attach(this); + } + else { + d_trigger_lines[0]->detach(); + d_trigger_lines[1]->detach(); + } +} + +void +TimeDomainDisplayPlot::setTriggerLines(double x, double y) +{ + d_trigger_lines[0]->setXValue(x); + d_trigger_lines[0]->setYValue(y); + d_trigger_lines[1]->setXValue(x); + d_trigger_lines[1]->setYValue(y); +} + #endif /* TIME_DOMAIN_DISPLAY_PLOT_C */ |