| 1033 | } |
| 1034 | |
| 1035 | void |
| 1036 | PanoramicDialog::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 | |
| 1071 | void |
| 1072 | PanoramicDialog::onPaletteChanged(int) |
nothing calls this directly
no test coverage detected