1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-07-25 19:44:12 -04:00

Spectrum Calibration: implementation of calibration points management

This commit is contained in:
f4exb
2022-01-30 07:43:50 +01:00
parent 257a1f685e
commit 76c84c55d8
25 changed files with 1438 additions and 5 deletions
+32
View File
@@ -29,6 +29,7 @@
#include "gui/crightclickenabler.h"
#include "gui/wsspectrumsettingsdialog.h"
#include "gui/spectrummarkersdialog.h"
#include "gui/spectrumcalibrationpointsdialog.h"
#include "util/simpleserializer.h"
#include "util/db.h"
#include "ui_glspectrumgui.h"
@@ -64,6 +65,9 @@ GLSpectrumGUI::GLSpectrumGUI(QWidget* parent) :
CRightClickEnabler *wsSpectrumRightClickEnabler = new CRightClickEnabler(ui->wsSpectrum);
connect(wsSpectrumRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openWebsocketSpectrumSettingsDialog(const QPoint &)));
CRightClickEnabler *calibrationPointsRightClickEnabler = new CRightClickEnabler(ui->calibration);
connect(calibrationPointsRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openCalibrationPointsDialog(const QPoint &)));
displaySettings();
setAveragingCombo();
applySettings();
@@ -726,6 +730,27 @@ void GLSpectrumGUI::openWebsocketSpectrumSettingsDialog(const QPoint& p)
}
}
void GLSpectrumGUI::openCalibrationPointsDialog(const QPoint& p)
{
SpectrumCalibrationPointsDialog dialog(
m_settings.m_calibrationPoints,
m_glSpectrum->getHistogramMarkers().size() > 0 ? &m_glSpectrum->getHistogramMarkers()[0] : nullptr,
this
);
dialog.setCenterFrequency(m_glSpectrum->getCenterFrequency());
connect(&dialog, SIGNAL(updateCalibrationPoints()), this, SLOT(updateCalibrationPoints()));
dialog.move(p);
dialog.exec();
m_settings.m_histogramMarkers = m_glSpectrum->getHistogramMarkers();
m_settings.m_waterfallMarkers = m_glSpectrum->getWaterfallMarkers();
m_settings.m_annoationMarkers = m_glSpectrum->getAnnotationMarkers();
m_settings.m_markersDisplay = m_glSpectrum->getMarkersDisplay();
applySettings();
}
void GLSpectrumGUI::updateHistogramMarkers()
{
if (m_glSpectrum) {
@@ -753,3 +778,10 @@ void GLSpectrumGUI::updateMarkersDisplay()
m_glSpectrum->updateMarkersDisplay();
}
}
void GLSpectrumGUI::updateCalibrationPoints()
{
if (m_glSpectrum) {
m_glSpectrum->updateCalibrationPoints();
}
}