Development notes and extension policy

Verified basis

The parameter paths derive from the 19.py study; the export menu/dialog identifiers from 20_inspect_export_uia.py; and the 2θ/θ graph path from 24_inspect_graph_uia.py. 21–23 were investigations, not a mandate to change the established search method. The current inspected application is SmartLab Studio II x64 v5.3.200.0.

Extending UIA operations

  1. Inspect the target screen and capture the parent chain, identifiers, control type, supported patterns, visibility and rectangle; record the GUI state.

  2. Add confirmed paths/identifiers to SmartLabConfig. Avoid scattering path constants through control methods.

  3. Implement the operation in SmartLabUIA, reusing its _uia, _get_root, _find_child, _resolve_path, _invoke, logger and caches as appropriate. Do not instantiate another IUIA or reimplement common traversal.

  4. Distinguish action requested, GUI state observed, and instrument-level completion. Avoid claiming completion based solely on a clicked button or a vanished dialog.

  5. When implementation, APIs, run instructions, dependencies, or verification coverage changes, review the handoff and update the affected bilingual README, changelog, and Pages sources in the same local task. Record completed checks and unverified conditions.

Export-specific caveats

The 2θ/θ graph may be offscreen; tab selection precedes right-click. A UIA RECT does not expose a Python width attribute. Popup menus are transient and may use a second Popup. The Save dialog contains nested elements that are not all direct children. Export selection currently retains GUI defaults. save=True does not inspect the resulting file.

Ownership and future integration

This project’s SmartLabCtrl owns a SmartLabUIA instance for device operations and a DesktopCapture instance for desktop capture and saving. The gRPC server invokes control operations on the COM thread through ComExecutionRunner and streams the captured PNG. Keep UIA independent of the transport layer. Split classes when doing so clarifies responsibilities, state ownership, and dependency direction.

Documentation build

The build uses sphinx, myst-parser, and sphinx-rtd-theme. Run bash docs/build.sh to generate docs/_build/html/. The workflow at .github/workflows/pages.yml builds and publishes GitHub Pages on pushes to main or manual dispatch. Verify local documentation changes and publication separately.