mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-10-02 18:16:50 -04:00
Merge pull request #106 from cjcliffe/freq_entry_tweak
Assume Mhz if direct input value <= 3000 with no suffix
This commit is contained in:
commit
dbc85d4f29
@ -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…
Reference in New Issue
Block a user