network_backend: use resolved device name in console output
NetworkBackend's connect/send/lost/error prints always used the connect-time registration name, so GUI console output kept showing the placeholder counter ID even after MON-VER resolved the real device name. Add a display_name per socket (defaults to name, kept separate from the routing key used by find_by_name/register_xcvr) and have the GUI update it once MON-VER responds. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XM4FNUjhu9x8df5Dp1hHvd
This commit is contained in:
+4
-1
@@ -253,7 +253,7 @@ class ReceiverManager(QObject):
|
||||
state = self._states.get(rid)
|
||||
if not state or not state.connected:
|
||||
return
|
||||
print(f"Receiver '{rid}': connection lost")
|
||||
print(f"Receiver '{self.display_name(rid)}': connection lost")
|
||||
self.remove_receiver(rid)
|
||||
|
||||
def disconnect_receiver(self, rid: str):
|
||||
@@ -340,6 +340,9 @@ class ReceiverManager(QObject):
|
||||
if state:
|
||||
state.device_id = device_id
|
||||
state.sw_version = sw_version
|
||||
set_name = getattr(state.backend, 'set_display_name', None)
|
||||
if device_id and callable(set_name):
|
||||
set_name(rid, device_id)
|
||||
config = self._configs.get(rid)
|
||||
if config and device_id:
|
||||
config.receiver_id = device_id
|
||||
|
||||
Reference in New Issue
Block a user