Skip to content

Commit 2c07edd

Browse files
andrei47wAlexandraTrifan
authored andcommitted
m2k: fix oscilloscope and sig gen x axis labels
Signed-off-by: Andrei Popa <andrei.popa@analog.com>
1 parent 7b6dad9 commit 2c07edd

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

plugins/m2k/src/old/oscilloscope.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1816,10 +1816,14 @@ void Oscilloscope::enableLabels(bool enable)
18161816
if(!allDisabled) {
18171817
plot.setActiveVertAxis(current_channel);
18181818
plot.enableAxisLabels(enable);
1819+
plot.enableXaxisLabels();
1820+
plot.setAxisVisible(QwtAxis::XBottom, !enable);
18191821
}
18201822
}
18211823
if(!enable)
18221824
plot.enableAxisLabels(enable);
1825+
1826+
plot.bottomHandlesArea()->setVisible(enable);
18231827
}
18241828

18251829
void Oscilloscope::setTrigger_input(bool value) { trigger_input = value; }

plugins/m2k/src/old/patterngenerator/pattern_generator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ PatternGenerator::PatternGenerator(libm2k::context::M2k *m2k, Filter *filt, Tool
141141
m_plot.addZoomer(0);
142142
m_plot.addMagnifier(0);
143143
m_plot.getMagnifier()->setYAxisEn(false);
144-
m_plot.getMagnifier()->setXAxis(true);
144+
m_plot.getMagnifier()->setXAxisEn(true);
145145
m_plot.setZoomerParams(true, 20);
146146
m_plot.zoomBaseUpdate();
147147
m_plot.getMagnifier()->setBaseRect(m_plot.getZoomer()->zoomBase());

plugins/m2k/src/old/signal_generator.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,19 +515,28 @@ SignalGenerator::SignalGenerator(libm2k::context::M2k *m2k, QString uri, Filter
515515
m_plot->setOffsetHandleVisible(0, false);
516516
m_plot->setOffsetHandleVisible(1, false);
517517
m_plot->setAxisVisible(QwtAxis::YLeft, false);
518+
m_plot->setAxisVisible(QwtAxis::XBottom, false);
518519
m_plot->setActiveVertAxis(0);
519520

521+
m_plot->enableXaxisLabels();
520522
m_plot->enableTimeTrigger(false);
521523

524+
QWidget *bottomAxis = new QWidget();
525+
bottomAxis->setLayout(new QHBoxLayout());
526+
bottomAxis->layout()->addItem(new QSpacerItem(50, 0));
527+
bottomAxis->layout()->addWidget(m_plot->bottomHandlesArea());
528+
522529
// plot widget
523530
QWidget *centralWidget = new QWidget();
524531
QGridLayout *gridLayout = new QGridLayout();
532+
525533
gridLayout->setVerticalSpacing(0);
526534
gridLayout->setHorizontalSpacing(0);
527-
gridLayout->setContentsMargins(0, 0, 0, 5);
535+
gridLayout->setContentsMargins(0, 0, 50, 5);
528536

529537
gridLayout->addWidget(m_plot->topArea(), 0, 0);
530538
gridLayout->addWidget(m_plot->topHandlesArea(), 1, 0);
539+
gridLayout->addWidget(bottomAxis, 3, 0);
531540
gridLayout->addWidget(m_plot, 2, 0);
532541

533542
centralWidget->setLayout(gridLayout);

0 commit comments

Comments
 (0)