improve event handling
This commit is contained in:
parent
29c0f7148a
commit
65443eb0ba
@ -194,18 +194,23 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient):
|
|||||||
def sendBookmarks(*args):
|
def sendBookmarks(*args):
|
||||||
cf = configProps["center_freq"]
|
cf = configProps["center_freq"]
|
||||||
srh = configProps["samp_rate"] / 2
|
srh = configProps["samp_rate"] / 2
|
||||||
frequencyRange = (cf - srh, cf + srh)
|
dial_frequencies = []
|
||||||
self.write_dial_frequencies(Bandplan.getSharedInstance().collectDialFrequencies(frequencyRange))
|
bookmarks = []
|
||||||
bookmarks = [b.__dict__() for b in Bookmarks.getSharedInstance().getBookmarks(frequencyRange)]
|
if "center_freq" in configProps and "samp_rate" in configProps:
|
||||||
|
frequencyRange = (cf - srh, cf + srh)
|
||||||
|
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)
|
self.write_bookmarks(bookmarks)
|
||||||
|
|
||||||
def updateBookmarkSubscription(*args):
|
def updateBookmarkSubscription(*args):
|
||||||
if self.bookmarkSub is not None:
|
if self.bookmarkSub is not None:
|
||||||
self.bookmarkSub.cancel()
|
self.bookmarkSub.cancel()
|
||||||
cf = configProps["center_freq"]
|
if "center_freq" in configProps and "samp_rate" in configProps:
|
||||||
srh = configProps["samp_rate"] / 2
|
cf = configProps["center_freq"]
|
||||||
frequencyRange = (cf - srh, cf + srh)
|
srh = configProps["samp_rate"] / 2
|
||||||
self.bookmarkSub = Bookmarks.getSharedInstance().subscribe(frequencyRange, sendBookmarks)
|
frequencyRange = (cf - srh, cf + srh)
|
||||||
|
self.bookmarkSub = Bookmarks.getSharedInstance().subscribe(frequencyRange, sendBookmarks)
|
||||||
sendBookmarks()
|
sendBookmarks()
|
||||||
|
|
||||||
self.configSubs.append(configProps.wire(sendConfig))
|
self.configSubs.append(configProps.wire(sendConfig))
|
||||||
@ -344,6 +349,7 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient):
|
|||||||
self.configSubs.pop().cancel()
|
self.configSubs.pop().cancel()
|
||||||
if self.bookmarkSub is not None:
|
if self.bookmarkSub is not None:
|
||||||
self.bookmarkSub.cancel()
|
self.bookmarkSub.cancel()
|
||||||
|
self.bookmarkSub = None
|
||||||
super().close()
|
super().close()
|
||||||
|
|
||||||
def stopDsp(self):
|
def stopDsp(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user