- What:
1. `docs/architecture/studio-architecture.md`:分层视图(Mermaid + 纯文本版)、运行时/线程视图、
二维/三维显示子系统视图、边界规则与证据表、指标表(模块行数 × 扇出、稳定核心 fan-in、验证面规模)、
可维护性评估(5 条优点 / 7 条风险,逐条带证据)、6 条建议(按性价比排序)。
2. `docs/architecture/studio-architecture.svg`(浏览器直接打开)与同名 `.png`(由 SVG 经 QtSvg 栅格化,
给没有 SVG 渲染器的场景):分层海报,层间流动用箭头表示,跨模块关系写在框内。
3. 数据来源(在 `.repro/`,可重跑):`studio_arch_scan.py` 扫 89 个模块的 import 图并给出 fan-in/fan-out
与**模块级环**;`studio_arch_imports.py` 分别统计"import 时就拉 Qt/GL/SDK"与"函数内惰性 import",
并在**新解释器**里逐个验证"导入 X 是否会拉进 PyQt5/OpenGL/SDK";`make_studio_svg.py`/`svg_to_png.py`
生成图。原始数据 `studio_arch.json`、`studio_arch_imports.json`。
- Why: 用户要看架构图来判断"软件组织是否合理、是否容易维护"。因此所有框与数字都从源码实际 import 关系
生成,而不是画一个理想分层:报告里同时给出**成立**的边界规则(无环、共享层 import 时不依赖 Qt/GL、
三维调度与相机无 Qt 可脱离 GUI 测试)与**不成立**的一条(`force/calibration_io` 在 import 时 import
orisys,于是力相关单测必须装 SDK),以及最贵的单点 `app_window.py`(3044 行 / 158 方法 / fan-out 36)。
- Verification:
· 扫描结果:89 个模块(studio 32 + shared 57)模块级**环 0 个**;import 时拉 PyQt5 的 21 个模块**全部**
在 `orisys_studio.*`;OpenGL 只在 `gl_backend`/`widget` 函数内惰性加载;新解释器验证
`scene3d.contracts/composer`、`acquisition.arrows/sinks`、`record.playback`、`theme`、
`studio.scene3d.coordinator/camera` 均为"干净"(不含 PyQt5/OpenGL/SDK),而 `force.history` 会拉进 SDK。
· 规模:studio src 13 376 行(三维 4 326)、shared 14 820 行(三维 4 576 / 记录 2 673 / 力 2 645 /
采集 2 343)、测试 11 633 行、工具 5 272 行;`scene3d.contracts` fan-in 22 为全仓最高。
· 图的自检:SVG 由 `ET.parse` 验证为良构 XML,并栅格化成 PNG 后逐版目视检查过(第一版箭头穿框,已改为
层间箭头 + 框内关系文字)。
- Not in this change: 不改任何产品代码;建议 1(拆 `app_window`)等 6 条尚未实施,它们属于下一轮工作,
每条都写了收益、成本与回归门。
orisys-app
Desktop applications that consume the Orisys SDK.
| App | Status |
|---|---|
apps/studio |
Scaffold shell (theme / locale / prefs / logging) |
apps/internal |
Stub for future calibration & automated testing |
Layout
shared/— common paths, prefs, theme, i18n, loggingapps/studio/config/— locales, default prefs, editablesensors/copiesapps/studio/outputs/— generated logs and calibration exports (gitignored)build/— Windows PyInstaller packaging (build/studio/build.ps1)
Run (studio shell)
cd D:\repo\orisys-app
python -m pip install -e .\shared -e .\apps\studio
python .\apps\studio\run.py
Or without install:
$env:PYTHONPATH = "D:\repo\orisys-app\shared\src;D:\repo\orisys-app\apps\studio\src"
python D:\repo\orisys-app\apps\studio\run.py
Local orisys SDK
orisys_app_shared.force imports orisys.calibration at module scope, so the
studio app cannot start against an SDK build that predates that module
(the published 0.5.2 wheel does not include it). When working from a repo
checkout, install the SDK from source instead of from an index:
python -m pip install .\..\orisys-sdk # same checkout that built this app
If a pip build is blocked by the environment, the equivalent manual install is
to copy orisys-sdk/src/orisys/**/*.py over site-packages/orisys/ and delete
the stale __init__.cp310-win_amd64.pyd (an extension module shadows the
package __init__.py, which hides sibling modules such as calibration.py).
Verifying UI changes
Both tools render the real main window with the offscreen Qt platform — no display, camera or sensor hardware required:
python .\apps\studio\tools\ui_check.py # layout/theme assertions
python .\apps\studio\tools\ui_snapshot.py --theme light --demo `
--sensor finger --panels cal,3d --size 1600x900 --out shot.png
ui_check.py needs only the runtime dependencies. The pytest suite in
shared/tests and apps/studio/tests covers the same ground plus locale and
preference-schema parity:
pip install pytest
python -m pytest
On Windows the offscreen platform finds no fonts unless QT_QPA_FONTDIR points
at C:\Windows\Fonts; both tools set it automatically.
ui_check.py also runs the palette rules (WCAG contrast, colour separation,
ramp monotonicity) that guard the brand tokens; see
apps/studio/docs/ui-palette.md for the
colour system, its relationship to the UI design spec, and every deliberate
deviation from it.
ui_check.py includes a record channel section as well; see
apps/studio/docs/record-channel.md for
why recording and calibration sampling no longer hang off the UI refresh timer,
and for the data-reliability fixes that came with it.
Branding
Window / EXE icon: shared/resources/branding/logo.png
Top bar / About: shared/resources/branding/logo_topbar.png
Dark mode is the default. Logos currently sit on a black tile; a transparent (or light) variant may be needed for polished light mode later.
Versioning
- Studio app version (
orisys_studio.__version__) — shown in Help → About and used for releases. - Shared package version (
orisys_app_shared.__version__) — internal library version. - Shared API (
orisys_app_shared.API_VERSION) — compatibility tag. Studio declaresREQUIRES_SHARED_API; startup logs a warning on mismatch.
Deferred
Run/Stop pipeline, arrow/force plots, units, calibration capture, Open3D finger mesh, sync-from-wheel for config/sensors, PyInstaller packaging, and the internal app.