| 63 | } |
| 64 | |
| 65 | QWidget *GRTimePlotAddonSettings::createYAxisMenu(QWidget *parent) |
| 66 | { |
| 67 | MenuSectionWidget *yaxiscontainer = new MenuSectionWidget(parent); |
| 68 | MenuCollapseSection *yaxis = new MenuCollapseSection("Y-AXIS", MenuCollapseSection::MHCW_NONE, |
| 69 | MenuCollapseSection::MHW_BASEWIDGET, yaxiscontainer); |
| 70 | |
| 71 | m_yctrl = new MenuPlotAxisRangeControl(m_plot->plot()->yAxis(), yaxis); |
| 72 | m_singleYModeSw = new MenuOnOffSwitch("Single Y Mode", yaxis); |
| 73 | m_autoscaleBtn = new QPushButton("Autoscale", yaxis); |
| 74 | |
| 75 | autoscaler = new PlotAutoscaler(this); |
| 76 | connect(autoscaler, &PlotAutoscaler::newMin, m_yctrl, &MenuPlotAxisRangeControl::setMin); |
| 77 | connect(autoscaler, &PlotAutoscaler::newMax, m_yctrl, &MenuPlotAxisRangeControl::setMax); |
| 78 | StyleHelper::BasicButton(m_autoscaleBtn, "autoscale"); |
| 79 | |
| 80 | connect(m_autoscaleBtn, &QPushButton::clicked, this, [=]() { autoscaler->autoscale(); }); |
| 81 | |
| 82 | yaxis->contentLayout()->addWidget(m_singleYModeSw); |
| 83 | yaxis->contentLayout()->addWidget(m_yctrl); |
| 84 | yaxis->contentLayout()->addSpacerItem(new QSpacerItem(0, 5, QSizePolicy::Fixed, QSizePolicy::Fixed)); |
| 85 | yaxis->contentLayout()->addWidget(m_autoscaleBtn); |
| 86 | yaxiscontainer->contentLayout()->addWidget(yaxis); |
| 87 | |
| 88 | connect(m_singleYModeSw->onOffswitch(), &QAbstractButton::toggled, this, [=](bool b) { |
| 89 | m_yctrl->setEnabled(b); |
| 90 | m_autoscaleBtn->setEnabled(b); |
| 91 | for(auto ch : channels) { |
| 92 | SingleYModeAware *singleyaware = dynamic_cast<SingleYModeAware *>(ch); |
| 93 | if(singleyaware) { |
| 94 | singleyaware->setSingleYMode(b); |
| 95 | } |
| 96 | } |
| 97 | m_plot->replot(); |
| 98 | }); |
| 99 | |
| 100 | return yaxiscontainer; |
| 101 | } |
| 102 | |
| 103 | QWidget *GRTimePlotAddonSettings::createXAxisMenu(QWidget *parent) |
| 104 | { |
nothing calls this directly
no test coverage detected