MCPcopy Create free account
hub / github.com/BatchDrake/SigDigger / onNewCenterFreq

Method onNewCenterFreq

Components/PanoramicDialog.cpp:1035–1069  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1033}
1034
1035void
1036PanoramicDialog::onNewCenterFreq(qint64 freq)
1037{
1038 qint64 span = this->currBw;
1039 qint64 min = freq - span / 2;
1040 qint64 max = freq + span / 2;
1041 bool smallRange;
1042 bool leftBorder = false;
1043 bool rightBorder = false;
1044 if (min <= this->getMinFreq()) {
1045 leftBorder = true;
1046 min = static_cast<qint64>(this->getMinFreq());
1047 }
1048
1049 if (max >= this->getMaxFreq()) {
1050 rightBorder = true;
1051 max = static_cast<qint64>(this->getMaxFreq());
1052 }
1053
1054 smallRange = static_cast<quint64>(max - min) <= this->minBwForZoom;
1055
1056 if (smallRange) {
1057 if (leftBorder && !rightBorder) {
1058 max = min + span;
1059 } else if (rightBorder && !leftBorder) {
1060 min = max - span;
1061 }
1062 }
1063
1064 if (rightBorder || leftBorder)
1065 this->ui->waterfall->setCenterFreq(
1066 static_cast<qint64>(.5 * (max + min)));
1067
1068 emit detailChanged(min, max, this->fixedFreqMode);
1069}
1070
1071void
1072PanoramicDialog::onPaletteChanged(int)

Callers

nothing calls this directly

Calls 3

getMinFreqMethod · 0.95
getMaxFreqMethod · 0.95
setCenterFreqMethod · 0.45

Tested by

no test coverage detected