Fix live wiresheet: resolve type names and load schema gracefully
- Add type_name_map on SoxClient so components loaded after connect resolve proper names (e.g. control::And2) instead of kit::typeN. This lets the slot registry and final_components_registry match, so component boxes show their slots and property values. - Load live schema gracefully: skip missing kit manifests instead of aborting, compile the kits we have, and warn about missing ones in the status bar. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1969,13 +1969,29 @@ def _load_live_schema(ds):
|
||||
"""Loads schema kits from the device's schema parts into the editor registry."""
|
||||
app_state.active_schema_kits.clear()
|
||||
app_state.final_components_registry.clear()
|
||||
if ds.sox_client and ds.sox_client.schema_parts:
|
||||
for part in ds.sox_client.schema_parts:
|
||||
app_state.active_schema_kits[part.name] = f"{part.checksum & 0xFFFFFFFF:08x}"
|
||||
try:
|
||||
schema.load_schema_kits_and_manifests()
|
||||
except Exception:
|
||||
pass
|
||||
if not (ds.sox_client and ds.sox_client.schema_parts):
|
||||
return
|
||||
|
||||
for part in ds.sox_client.schema_parts:
|
||||
app_state.active_schema_kits[part.name] = f"{part.checksum & 0xFFFFFFFF:08x}"
|
||||
|
||||
# Collect manifests we have, skip missing kits (device may use kits
|
||||
# not installed on this computer — load what we can)
|
||||
manifest_paths = []
|
||||
missing = []
|
||||
for name, checksum in app_state.active_schema_kits.items():
|
||||
path = schema.find_manifest_path(name, checksum)
|
||||
if path:
|
||||
manifest_paths.append(path)
|
||||
else:
|
||||
missing.append(name)
|
||||
|
||||
if manifest_paths:
|
||||
schema.compile_schema_registry(manifest_paths)
|
||||
|
||||
if missing:
|
||||
app_state.set_status(
|
||||
f"Missing kit manifests: {', '.join(missing)}", warn=True)
|
||||
|
||||
|
||||
def do_device_disconnect():
|
||||
|
||||
Reference in New Issue
Block a user