MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / syncDisplaySettings

Method syncDisplaySettings

src/gui/SpectrumOverlayMenu.cpp:1965–2047  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1963}
1964
1965void SpectrumOverlayMenu::syncDisplaySettings(int avg, int fps, int fillPct,
1966 bool weightedAvg, const QColor& fillColor,
1967 int gain, int black, bool autoBlack,
1968 int autoBlackOffset, int rate,
1969 int floorPos, bool floorEnable,
1970 bool heatMap, int colorScheme,
1971 bool showGrid,
1972 float lineWidth,
1973 bool autoBlackRadioSide,
1974 int renderMode,
1975 int dssFloorDepth,
1976 int dssGain)
1977{
1978 if (!m_avgSlider) return; // panel not built yet
1979
1980 QSignalBlocker b1(m_avgSlider), b2(m_fpsSlider), b3(m_fillSlider),
1981 b4(m_weightedAvgBtn), b5(m_gainSlider), b6(m_blackSlider),
1982 b7(m_autoBlackBtn), b8(m_rateSlider);
1983
1984 setKiwiWaterfallControlMode(false);
1985
1986 m_avgSlider->setValue(avg);
1987 m_avgLabel->setText(QString::number(avg));
1988 m_fpsSlider->setValue(fps);
1989 m_fpsLabel->setText(QString::number(fps));
1990 m_fillSlider->setValue(fillPct);
1991 m_fillLabel->setText(QString::number(fillPct));
1992 m_weightedAvgBtn->setChecked(weightedAvg);
1993 m_fillColor = fillColor;
1994 m_fillColorBtn->setStyleSheet(
1995 QString("QPushButton { background: %1; border: 1px solid #506070;"
1996 " border-radius: 2px; }").arg(fillColor.name()));
1997 m_gainSlider->setValue(gain);
1998 m_gainLabel->setText(QString::number(gain));
1999 m_blackManualValue = black;
2000 m_blackAutoOffsetValue = autoBlackOffset;
2001 // Reflect the persisted 3-way auto-black mode on the cycle button + slider.
2002 // (m_blackManualValue / m_blackAutoOffsetValue were just set above; the
2003 // helper picks the right one for the mode and updates the label/tooltip.)
2004 const int abMode = !autoBlack ? 0 : (autoBlackRadioSide ? 2 : 1);
2005 applyAutoBlackMode(abMode, /*emitSignals=*/false);
2006 syncWfLineDuration(rate);
2007
2008 if (m_floorSlider) {
2009 QSignalBlocker bf(m_floorSlider), be(m_floorEnableBtn);
2010 m_floorSlider->setValue(floorPos);
2011 m_floorLabel->setText(QString::number(floorPos));
2012 m_floorEnableBtn->setChecked(floorEnable);
2013 m_floorSlider->setEnabled(floorEnable);
2014 }
2015 if (m_heatMapBtn) {
2016 QSignalBlocker bh(m_heatMapBtn);
2017 m_heatMapBtn->setChecked(heatMap);
2018 }
2019 if (m_showGridBtn) {
2020 QSignalBlocker bg(m_showGridBtn);
2021 m_showGridBtn->setChecked(showGrid);
2022 }

Callers 3

wirePanadapterMethod · 0.80
loadSettingsMethod · 0.80

Calls 3

setValueMethod · 0.45
nameMethod · 0.45
setEnabledMethod · 0.45

Tested by

no test coverage detected