format code
This commit is contained in:
parent
55e1aa5857
commit
f0dc2f8ebe
@ -177,7 +177,11 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient):
|
|||||||
config = configProps.__dict__()
|
config = configProps.__dict__()
|
||||||
else:
|
else:
|
||||||
config = changes
|
config = changes
|
||||||
if (changes is None or "start_freq" in changes or "center_freq" in changes) and "start_freq" in configProps and "center_freq" in configProps:
|
if (
|
||||||
|
(changes is None or "start_freq" in changes or "center_freq" in changes)
|
||||||
|
and "start_freq" in configProps
|
||||||
|
and "center_freq" in configProps
|
||||||
|
):
|
||||||
config["start_offset_freq"] = configProps["start_freq"] - configProps["center_freq"]
|
config["start_offset_freq"] = configProps["start_freq"] - configProps["center_freq"]
|
||||||
if (changes is None or "profile_id" in changes) and self.sdr is not None:
|
if (changes is None or "profile_id" in changes) and self.sdr is not None:
|
||||||
config["sdr_id"] = self.sdr.getId()
|
config["sdr_id"] = self.sdr.getId()
|
||||||
@ -406,15 +410,20 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient):
|
|||||||
self.send({"type": "backoff", "reason": reason})
|
self.send({"type": "backoff", "reason": reason})
|
||||||
|
|
||||||
def write_js8_message(self, frame: Js8Frame, freq: int):
|
def write_js8_message(self, frame: Js8Frame, freq: int):
|
||||||
self.send({"type": "js8_message", "value": {
|
self.send(
|
||||||
"msg": str(frame),
|
{
|
||||||
"timestamp": frame.timestamp,
|
"type": "js8_message",
|
||||||
"db": frame.db,
|
"value": {
|
||||||
"dt": frame.dt,
|
"msg": str(frame),
|
||||||
"freq": freq + frame.freq,
|
"timestamp": frame.timestamp,
|
||||||
"thread_type": frame.thread_type,
|
"db": frame.db,
|
||||||
"mode": frame.mode
|
"dt": frame.dt,
|
||||||
}})
|
"freq": freq + frame.freq,
|
||||||
|
"thread_type": frame.thread_type,
|
||||||
|
"mode": frame.mode,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
def write_modes(self, modes):
|
def write_modes(self, modes):
|
||||||
def to_json(m):
|
def to_json(m):
|
||||||
@ -426,10 +435,7 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient):
|
|||||||
"squelch": m.squelch,
|
"squelch": m.squelch,
|
||||||
}
|
}
|
||||||
if m.bandpass is not None:
|
if m.bandpass is not None:
|
||||||
res["bandpass"] = {
|
res["bandpass"] = {"low_cut": m.bandpass.low_cut, "high_cut": m.bandpass.high_cut}
|
||||||
"low_cut": m.bandpass.low_cut,
|
|
||||||
"high_cut": m.bandpass.high_cut
|
|
||||||
}
|
|
||||||
if isinstance(m, DigitalMode):
|
if isinstance(m, DigitalMode):
|
||||||
res["underlying"] = m.underlying
|
res["underlying"] = m.underlying
|
||||||
return res
|
return res
|
||||||
@ -442,12 +448,14 @@ class MapConnection(OpenWebRxClient):
|
|||||||
super().__init__(conn)
|
super().__init__(conn)
|
||||||
|
|
||||||
pm = Config.get()
|
pm = Config.get()
|
||||||
self.write_config(pm.filter(
|
self.write_config(
|
||||||
"google_maps_api_key",
|
pm.filter(
|
||||||
"receiver_gps",
|
"google_maps_api_key",
|
||||||
"map_position_retention_time",
|
"receiver_gps",
|
||||||
"receiver_name",
|
"map_position_retention_time",
|
||||||
).__dict__())
|
"receiver_name",
|
||||||
|
).__dict__()
|
||||||
|
)
|
||||||
|
|
||||||
Map.getSharedInstance().addClient(self)
|
Map.getSharedInstance().addClient(self)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user