Merge pull request #249 from darksidelemm/testing

Trial fix of issues with blacklist/blocklist frequencies not being re…
pull/259/head
Mark Jessop 2019-11-02 20:30:51 +10:30 zatwierdzone przez GitHub
commit 14a1a72967
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 7 dodań i 3 usunięć

Wyświetl plik

@ -17,7 +17,7 @@ except ImportError:
# MINOR - New sonde type support, other fairly big changes that may result in telemetry or config file incompatability issus.
# PATCH - Small changes, or minor feature additions.
__version__ = "1.2.2"
__version__ = "1.2.3-beta1"
# Global Variables

Wyświetl plik

@ -685,9 +685,13 @@ class SondeScanner(object):
peak_frequencies = peak_frequencies[np.sort(peak_idx)]
# Blacklist & Temporary block list behaviour change as of v1.2.3
# Was: peak_frequencies==_frequency (This only matched an exact frequency in the blacklist)
# Now (1.2.3): Block if the peak frequency is within +/-quantization/2.0 of a blacklist or blocklist frequency.
# Remove any frequencies in the blacklist.
for _frequency in np.array(self.blacklist)*1e6:
_index = np.argwhere(peak_frequencies==_frequency)
_index = np.argwhere(np.abs(peak_frequencies-_frequency) < (self.quantization/2.0))
peak_frequencies = np.delete(peak_frequencies, _index)
# Limit to the user-defined number of peaks to search over.
@ -704,7 +708,7 @@ class SondeScanner(object):
# Check the time the block was added.
if self.temporary_block_list[_frequency] > (time.time()-self.temporary_block_time*60):
# We should still be blocking this frequency, so remove any peaks with this frequency.
_index = np.argwhere(peak_frequencies==_frequency)
_index = np.argwhere(np.abs(peak_frequencies-_frequency) < (self.quantization/2.0))
peak_frequencies = np.delete(peak_frequencies, _index)
if len(_index) > 0:
self.log_debug("Peak on %.3f MHz was removed due to temporary block." % (_frequency/1e6))