improve event handling

This commit is contained in:
Jakob Ketterl 2021-03-27 23:40:10 +01:00
parent 29c0f7148a
commit 65443eb0ba

View File

@ -194,14 +194,19 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient):
def sendBookmarks(*args):
cf = configProps["center_freq"]
srh = configProps["samp_rate"] / 2
dial_frequencies = []
bookmarks = []
if "center_freq" in configProps and "samp_rate" in configProps:
frequencyRange = (cf - srh, cf + srh)
self.write_dial_frequencies(Bandplan.getSharedInstance().collectDialFrequencies(frequencyRange))
dial_frequencies = Bandplan.getSharedInstance().collectDialFrequencies(frequencyRange)
bookmarks = [b.__dict__() for b in Bookmarks.getSharedInstance().getBookmarks(frequencyRange)]
self.write_dial_frequencies(dial_frequencies)
self.write_bookmarks(bookmarks)
def updateBookmarkSubscription(*args):
if self.bookmarkSub is not None:
self.bookmarkSub.cancel()
if "center_freq" in configProps and "samp_rate" in configProps:
cf = configProps["center_freq"]
srh = configProps["samp_rate"] / 2
frequencyRange = (cf - srh, cf + srh)
@ -344,6 +349,7 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient):
self.configSubs.pop().cancel()
if self.bookmarkSub is not None:
self.bookmarkSub.cancel()
self.bookmarkSub = None
super().close()
def stopDsp(self):