some refactoring and socket server added
This commit is contained in:
@@ -48,6 +48,10 @@ def run_config_from_dict(payload: dict[str, Any]) -> RunConfigModel:
|
||||
pre_ring_payload = _as_dict(rings_payload.get("preprocessed"), "rings.preprocessed")
|
||||
pre_tap_ring_payload = _as_dict(rings_payload.get("preprocessed_tap"), "rings.preprocessed_tap")
|
||||
result_ring_payload = _as_dict(rings_payload.get("results"), "rings.results")
|
||||
locator_server_payload = _as_dict(
|
||||
run_payload.get("locator_server", run_payload.get("locator")),
|
||||
"run.locator_server",
|
||||
)
|
||||
|
||||
model.radar.model = str(radar_payload.get("model", model.radar.model))
|
||||
model.radar.serial = str(radar_payload.get("serial", model.radar.serial))
|
||||
@@ -71,6 +75,39 @@ def run_config_from_dict(payload: dict[str, Any]) -> RunConfigModel:
|
||||
model.runtime.processing_live_config_path = str(
|
||||
run_payload.get("processing_live_config_path", model.runtime.processing_live_config_path)
|
||||
)
|
||||
model.runtime.locator_server.device_id = int(
|
||||
locator_server_payload.get("device_id", model.runtime.locator_server.device_id)
|
||||
)
|
||||
model.runtime.locator_server.protocol_version = int(
|
||||
locator_server_payload.get(
|
||||
"protocol_version",
|
||||
model.runtime.locator_server.protocol_version,
|
||||
)
|
||||
)
|
||||
model.runtime.locator_server.host = str(
|
||||
locator_server_payload.get("host", model.runtime.locator_server.host)
|
||||
)
|
||||
model.runtime.locator_server.port = int(
|
||||
locator_server_payload.get("port", model.runtime.locator_server.port)
|
||||
)
|
||||
model.runtime.locator_server.max_payload_bytes = int(
|
||||
locator_server_payload.get(
|
||||
"max_payload_bytes",
|
||||
model.runtime.locator_server.max_payload_bytes,
|
||||
)
|
||||
)
|
||||
model.runtime.locator_server.client_queue_size = int(
|
||||
locator_server_payload.get(
|
||||
"client_queue_size",
|
||||
model.runtime.locator_server.client_queue_size,
|
||||
)
|
||||
)
|
||||
model.runtime.locator_server.logger_name = str(
|
||||
locator_server_payload.get(
|
||||
"logger_name",
|
||||
model.runtime.locator_server.logger_name,
|
||||
)
|
||||
)
|
||||
|
||||
s21_preprocess_payload = _as_dict(preprocess_payload.get("s21"), "preprocess.s21")
|
||||
_load_preprocess_asset(
|
||||
@@ -203,6 +240,15 @@ def run_config_to_dict(model: RunConfigModel) -> dict[str, Any]:
|
||||
"idle_sleep_ms": model.runtime.idle_sleep_ms,
|
||||
"continuous": model.runtime.continuous,
|
||||
"processing_live_config_path": model.runtime.processing_live_config_path,
|
||||
"locator_server": {
|
||||
"device_id": model.runtime.locator_server.device_id,
|
||||
"protocol_version": model.runtime.locator_server.protocol_version,
|
||||
"host": model.runtime.locator_server.host,
|
||||
"port": model.runtime.locator_server.port,
|
||||
"max_payload_bytes": model.runtime.locator_server.max_payload_bytes,
|
||||
"client_queue_size": model.runtime.locator_server.client_queue_size,
|
||||
"logger_name": model.runtime.locator_server.logger_name,
|
||||
},
|
||||
"combos": [{"input": combo.input, "output": combo.output} for combo in model.combos],
|
||||
},
|
||||
"preprocess": {
|
||||
|
||||
Reference in New Issue
Block a user