mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2025-08-03 06:02:26 -04:00
Assume Mhz if input <= 3000 with no suffix, require suffix of 'hz' below 3001hz
This commit is contained in:
parent
6fe145425c
commit
c728ddc45b
@ -65,7 +65,7 @@ std::string FrequencyDialog::frequencyToStr(long long freq) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
long long FrequencyDialog::strToFrequency(std::string freqStr) {
|
long long FrequencyDialog::strToFrequency(std::string freqStr) {
|
||||||
std::string filterStr = filterChars(freqStr, std::string("0123456789.MKGmkg"));
|
std::string filterStr = filterChars(freqStr, std::string("0123456789.MKGHmkgh"));
|
||||||
|
|
||||||
int numLen = filterStr.find_first_not_of("0123456789.");
|
int numLen = filterStr.find_first_not_of("0123456789.");
|
||||||
|
|
||||||
@ -90,8 +90,10 @@ long long FrequencyDialog::strToFrequency(std::string freqStr) {
|
|||||||
freqTemp *= 1.0e6;
|
freqTemp *= 1.0e6;
|
||||||
} else if (suffixStr.find_first_of("Kk") != std::string::npos) {
|
} else if (suffixStr.find_first_of("Kk") != std::string::npos) {
|
||||||
freqTemp *= 1.0e3;
|
freqTemp *= 1.0e3;
|
||||||
|
} else if (suffixStr.find_first_of("Hh") != std::string::npos) {
|
||||||
|
// ...
|
||||||
}
|
}
|
||||||
} else if (numPartStr.find_first_of(".") != std::string::npos) {
|
} else if (numPartStr.find_first_of(".") != std::string::npos || freqTemp <= 3000) {
|
||||||
freqTemp *= 1.0e6;
|
freqTemp *= 1.0e6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user