implement first stages of active mode communication

This commit is contained in:
Jakob Ketterl
2020-04-26 15:17:03 +02:00
parent e61d3a22a3
commit 907787cfdc
7 changed files with 96 additions and 30 deletions

View File

@ -11,6 +11,7 @@ from owrx.bookmarks import Bookmarks
from owrx.map import Map
from owrx.locator import Locator
from owrx.property import PropertyStack
from owrx.modes import Modes
from multiprocessing import Queue
from queue import Full
from js8py import Js8Frame
@ -122,6 +123,9 @@ class OpenWebRxReceiverClient(Client):
features = FeatureDetector().feature_availability()
self.write_features(features)
modes = Modes.getModes()
self.write_modes(modes)
CpuUsageThread.getSharedInstance().add_client(self)
def __sendProfiles(self):
@ -345,6 +349,13 @@ class OpenWebRxReceiverClient(Client):
"mode": frame.mode
}})
def write_modes(self, modes):
self.send({"type": "modes", "value": [{
"modulation": m.modulation,
"name": m.name,
"requirements": m.requirements
} for m in modes]})
class MapConnection(Client):
def __init__(self, conn):