app
KiCad - the KiCad Bridge
Public Made by Adomby adom
Reference implementation of the KiCad bridge: multi-instance Python server, forward path via kicad-cli, reverse path via in-process plugin. Most complex of the three bundled bridges.
← Commit history
0.9.312: kicad_demo layoutProbe diagnostic; layout uses the monitor work area
3 files changed
+19−4
BRIDGE_VERSION+1−1@@ -1 +1 @@-0.9.311+0.9.312
bridge.json+1−1@@ -2,7 +2,7 @@ "manifest_version": 1, "name": "kicad", "displayName": "KiCad EDA",- "version": "0.9.311",+ "version": "0.9.312", "description": "Reverse bridge for KiCad \u2014 board/schematic introspection, lint via kicad-cli, plugin install, multi-instance probe, in-process DRC.", "homepage": "https://wiki.adom.inc/adom/adom-bridge", "author": "Adom Inc.",
handlers/demo.py+17−2@@ -655,11 +655,24 @@ def _primary_monitor() -> dict | None: d = ((out or {}).get("data") if isinstance(out, dict) else None) or out or {} mons = d.get("monitors") or [] prim = next((m for m in mons if m.get("primary")), mons[0] if mons else None)- return (prim or {}).get("bounds")- except Exception: # pylint: disable=broad-except+ # workArea keeps the windows off the taskbar; bounds is the fallback.+ return (prim or {}).get("workArea") or (prim or {}).get("bounds")+ except Exception as e: # pylint: disable=broad-except+ _PRIMARY_MONITOR_ERR["v"] = f"{type(e).__name__}: {e}" return None +_PRIMARY_MONITOR_ERR: dict = {"v": None}+++def _layout_probe() -> dict:+ """kicad_demo {"layoutProbe": true}: what the tour's layout code sees."""+ from handlers import ad_client+ raw = ad_client.call("desktop_list_monitors", {"reason": "KiCad tour layout probe"}, timeout=6)+ return {"success": True, "raw": raw, "primary": _primary_monitor(), "error": _PRIMARY_MONITOR_ERR["v"],+ "rawType": type(raw).__name__, "rawKeys": list(raw.keys())[:12] if isinstance(raw, dict) else None}++ def _leftovers_path() -> Path: return _demo_dir() / "window-bounds-to-restore.json" @@ -1659,6 +1672,8 @@ def handle_demo(kicad_info: dict, args: dict) -> dict: "clears the caption.")} # ---- progress poll (cheap, no side effects) ----+ if args.get("layoutProbe"):+ return _layout_probe() if args.get("progress"): snap = _job_snapshot() if not snap or (not snap.get("active") and "done" not in snap):