MCPcopy Create free account
hub / github.com/analogdevicesinc/scopy / createYAxisMenu

Method createYAxisMenu

tmp/grutil/src/grtimeplotaddonsettings.cpp:65–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65QWidget *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
103QWidget *GRTimePlotAddonSettings::createXAxisMenu(QWidget *parent)
104{

Callers

nothing calls this directly

Calls 10

autoscaleMethod · 0.80
onOffswitchMethod · 0.80
setSingleYModeMethod · 0.80
connectFunction · 0.50
yAxisMethod · 0.45
plotMethod · 0.45
addWidgetMethod · 0.45
contentLayoutMethod · 0.45
setEnabledMethod · 0.45
replotMethod · 0.45

Tested by

no test coverage detected