| 27 | using namespace scopy; |
| 28 | using namespace scopy::grutil; |
| 29 | GRTimePlotAddon::GRTimePlotAddon(QString name, GRTopBlock *top, QObject *parent) |
| 30 | : QObject(parent) |
| 31 | , m_top(top) |
| 32 | , time_sink(nullptr) |
| 33 | , m_rollingMode(false) |
| 34 | , m_started(false) |
| 35 | , m_singleShot(false) |
| 36 | , m_showPlotTags(false) |
| 37 | , m_refreshTimerRunning(false) |
| 38 | , fftComplexMode(false) |
| 39 | , m_xmode(GRTimePlotAddonSettings::XMODE_SAMPLES) |
| 40 | , m_fftwindow(gr::fft::window::WIN_HAMMING) |
| 41 | { |
| 42 | Preferences *p = Preferences::GetInstance(); |
| 43 | |
| 44 | this->name = name; |
| 45 | widget = new QTabWidget(); |
| 46 | m_lay = new QVBoxLayout(widget); |
| 47 | m_lay->setMargin(0); |
| 48 | m_lay->setSpacing(0); |
| 49 | |
| 50 | m_plotWidget = new PlotWidget(widget); |
| 51 | dynamic_cast<QTabWidget *>(widget)->addTab(m_plotWidget, "Time"); |
| 52 | |
| 53 | ///// |
| 54 | m_fftPlotWidget = new PlotWidget(widget); |
| 55 | m_fftPlotWidget->xAxis()->setVisible(false); |
| 56 | m_fftPlotWidget->yAxis()->setVisible(false); |
| 57 | dynamic_cast<QTabWidget *>(widget)->addTab(m_fftPlotWidget, "FFT"); |
| 58 | QPen fftchannel_pen = QPen(Style::getAttribute(json::theme::interactive_primary_idle)); |
| 59 | |
| 60 | fft_xPlotAxis = new PlotAxis(QwtAxis::XBottom, m_fftPlotWidget, fftchannel_pen); |
| 61 | fft_yPlotAxis = new PlotAxis(QwtAxis::YLeft, m_fftPlotWidget, fftchannel_pen); |
| 62 | fft_yPlotAxis->setInterval(-145, 5); |
| 63 | |
| 64 | m_fft_channel = new PlotChannel("FFT", fftchannel_pen, fft_xPlotAxis, fft_yPlotAxis); |
| 65 | m_fftPlotWidget->addPlotChannel(m_fft_channel); |
| 66 | // m_fft_channel->setThickness(5); |
| 67 | // m_fft_channel->setStyle(1); |
| 68 | |
| 69 | m_fft_channel->setEnabled(true); |
| 70 | m_fftPlotWidget->selectChannel(m_fft_channel); |
| 71 | m_fftPlotWidget->replot(); |
| 72 | |
| 73 | m_fftPlotWidget->setShowXAxisLabels(true); |
| 74 | m_fftPlotWidget->setShowYAxisLabels(true); |
| 75 | m_fftPlotWidget->showAxisLabels(); |
| 76 | |
| 77 | //// |
| 78 | m_xyPlotWidget = new PlotWidget(widget); |
| 79 | dynamic_cast<QTabWidget *>(widget)->addTab(m_xyPlotWidget, "X-Y"); |
| 80 | QPen xychannel_pen = QPen(Style::getAttribute(json::theme::interactive_primary_idle)); |
| 81 | Style::setBackgroundColor(widget, json::theme::background_subtle); |
| 82 | |
| 83 | xy_xPlotAxis = new PlotAxis(QwtAxis::XBottom, m_xyPlotWidget, xychannel_pen); |
| 84 | xy_yPlotAxis = new PlotAxis(QwtAxis::YLeft, m_xyPlotWidget, xychannel_pen); |
| 85 | |
| 86 | m_xy_channel = new PlotChannel("X-Y", xychannel_pen, xy_xPlotAxis, xy_yPlotAxis, this); |
nothing calls this directly
no test coverage detected