From d79723676ea33daf77495afb3c213b0d43687d18 Mon Sep 17 00:00:00 2001 From: SeptimiuVana Date: Mon, 24 Feb 2025 20:02:21 +0200 Subject: [PATCH 1/3] plugins/adc: remove markers when button is disabled Signed-off-by: SeptimiuVana --- plugins/adc/src/freq/grfftchannelcomponent.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/adc/src/freq/grfftchannelcomponent.cpp b/plugins/adc/src/freq/grfftchannelcomponent.cpp index df2d1cc8b0..0d4732deb1 100644 --- a/plugins/adc/src/freq/grfftchannelcomponent.cpp +++ b/plugins/adc/src/freq/grfftchannelcomponent.cpp @@ -250,8 +250,12 @@ QWidget *GRFFTChannelComponent::createMarkerMenu(QWidget *parent) if(b) { auto markerType = static_cast( markerCb->combo()->currentData().toInt()); + m_fftPlotComponentChannel->markerController()->setFixedHandleVisible( + markerType == PlotMarkerController::MC_FIXED && + fixedMarkerEditBtn->onOffswitch()->isChecked()); m_fftPlotComponentChannel->markerController()->setMarkerType(markerType); } else { + m_fftPlotComponentChannel->markerController()->setFixedHandleVisible(false); m_fftPlotComponentChannel->markerController()->setMarkerType(PlotMarkerController::MC_NONE); } }); @@ -259,6 +263,8 @@ QWidget *GRFFTChannelComponent::createMarkerMenu(QWidget *parent) connect(markerCb->combo(), qOverload(&QComboBox::currentIndexChanged), this, [=](int idx) { auto markerType = static_cast(markerCb->combo()->currentData().toInt()); + m_fftPlotComponentChannel->markerController()->setFixedHandleVisible( + markerType == PlotMarkerController::MC_FIXED && fixedMarkerEditBtn->onOffswitch()->isChecked()); m_fftPlotComponentChannel->markerController()->setMarkerType(markerType); fixedMarkerEditBtn->setVisible(markerCb->combo()->currentData().toInt() == PlotMarkerController::MC_FIXED); From 2f3bbc0b62349aef677ec61933c82f1cfce478ec Mon Sep 17 00:00:00 2001 From: SeptimiuVana Date: Tue, 25 Feb 2025 11:04:09 +0200 Subject: [PATCH 2/3] plugins/adc: update marker values when their number changes for single Signed-off-by: SeptimiuVana --- plugins/adc/src/freq/grfftchannelcomponent.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/adc/src/freq/grfftchannelcomponent.cpp b/plugins/adc/src/freq/grfftchannelcomponent.cpp index 0d4732deb1..5ad2f0336e 100644 --- a/plugins/adc/src/freq/grfftchannelcomponent.cpp +++ b/plugins/adc/src/freq/grfftchannelcomponent.cpp @@ -243,8 +243,10 @@ QWidget *GRFFTChannelComponent::createMarkerMenu(QWidget *parent) markerCnt->setScaleRange(1, 10); markerCnt->setValue(5); - connect(markerCnt, &MenuSpinbox::valueChanged, this, - [=](double cnt) { m_fftPlotComponentChannel->markerController()->setNrOfMarkers(cnt); }); + connect(markerCnt, &MenuSpinbox::valueChanged, this, [=](double cnt) { + m_fftPlotComponentChannel->markerController()->setNrOfMarkers(cnt); + m_fftPlotComponentChannel->markerController()->computeMarkers(); + }); connect(section->collapseSection()->header(), &QAbstractButton::toggled, this, [=](bool b) { if(b) { From 766651119ebc11daa4dc0444d7383077b1b8eaad Mon Sep 17 00:00:00 2001 From: SeptimiuVana Date: Tue, 25 Feb 2025 11:43:38 +0200 Subject: [PATCH 3/3] plugins/adc: set min number of markers for singletone to 2 Signed-off-by: SeptimiuVana --- plugins/adc/src/freq/grfftchannelcomponent.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/adc/src/freq/grfftchannelcomponent.cpp b/plugins/adc/src/freq/grfftchannelcomponent.cpp index 5ad2f0336e..ea8fea9a26 100644 --- a/plugins/adc/src/freq/grfftchannelcomponent.cpp +++ b/plugins/adc/src/freq/grfftchannelcomponent.cpp @@ -265,6 +265,13 @@ QWidget *GRFFTChannelComponent::createMarkerMenu(QWidget *parent) connect(markerCb->combo(), qOverload(&QComboBox::currentIndexChanged), this, [=](int idx) { auto markerType = static_cast(markerCb->combo()->currentData().toInt()); + if(markerType == PlotMarkerController::MC_SINGLETONE) { + markerCnt->setMinValue(2); + if(markerCnt->value() < 2) + markerCnt->setValue(2); + } else { + markerCnt->setMinValue(0); + } m_fftPlotComponentChannel->markerController()->setFixedHandleVisible( markerType == PlotMarkerController::MC_FIXED && fixedMarkerEditBtn->onOffswitch()->isChecked()); m_fftPlotComponentChannel->markerController()->setMarkerType(markerType);