feat(studio): 三维视图接入产品(阶段 4:界面、生命周期与记录隔离)

- What: `Scene3DView` 装配(widget/相机/渲染器/合成器/协调器/适配器),`asset_source`
  只查找并后台加载已编译的 `.oryscene` 包,`scene3d/prefs` 持久化并**修复**显示设置,
  `ui/mesh3d_panel` 用真实容器替换占位标签(无 GL/无包/包被拒/传感器不匹配各显示一行原因),
  `main.py` 在 `QApplication` 之前选定 GL profile,`app_window` 接线:3D 作为采集线程上的
  第二个 sink、`_on_run_tick` 驱动 `tick()`、视图切换与 `closeEvent` 释放、preferences 落盘。
- Why: 阶段 4 的验收要求"三维开关不影响采集/记录/力曲线",并把阶段 1 留下的
  "开/关三维 CSV 一致"这条补上;同时把"没有 context"从"看起来像在工作"变成可显示的终态。
- Verification: app 侧 test_scene3d_view 28 项、test_scene3d_gl_smoke 14 项(真实 GPU)、
  adapters 17 项、skeleton 4 项、stage1 24 项、coordinator 13 项、ui_smoke 86 项;
  shared 侧 contract 26 / assets 33 / package 19 / live 25;`ui_check.py` 566 项检查 0 失败
  (新增 "3D pane" 段 12 项);`locale_check.py` 302 个字面 key 0 缺失、中英各 377 key 对齐;
  记录隔离:同一 96 帧会话挂/不挂 3D 消费者,`forces.csv` 逐字节相同、有效样本数与记录问题数相同;
  生产者预算:合成器放慢到 50 ms 时 `submit_packet` p99 < 1 ms。
- Not in this change: 示意位移(`displacement_sensor_m`)仍未接入(需 SDK lift 与已确认尺度);
  ARM 板卡适配(按用户要求暂缓);包签名/AES-GCM 与长时性能报告(阶段 5);
  仓库中仍未提供 `.oryscene` 包(发布产物,且其单位与变换必须由人声明)。
This commit is contained in:
ykcheungab
2026-09-14 15:47:32 +08:00
parent ea1027e5a6
commit ac4dcd643f
20 changed files with 2718 additions and 83 deletions
@@ -9,6 +9,18 @@ from typing import Any
from orisys_app_shared.paths import preference_path, preferences_default_path
#: The 3D pane's display settings, as one preference block. Kept as its own literal
#: rather than inline so the defaults dictionary stays flat — a nested literal makes
#: every inner key look like a top-level preference to anything that reads it that
#: way (``apps/studio/tests/test_locales.py`` compares the key sets with the shipped
#: JSON, key by key).
_SCENE3D_DISPLAY: dict[str, Any] = {
"deform_enabled": False,
"display_gain": 0.0,
"housing_visible": True,
"max_fps": 30,
}
_DEFAULTS: dict[str, Any] = {
"language": "zh_CN",
"theme": "dark",
@@ -32,6 +44,15 @@ _DEFAULTS: dict[str, Any] = {
"image_view_mode": "arrows_pure",
"arrow_rotation_deg": 90,
"show_fps": False,
#: The GL profile the 3D view is started with. One per process: the surface
#: format is chosen before ``QApplication`` exists and cannot be switched later.
"gl_profile": "desktop33",
#: A ``.oryscene`` package to load instead of the one shipped beside the sensor
#: configuration. Empty means "look in config/sensors/<sensor>/scene".
"scene3d_package": "",
#: The 3D pane's display settings (exaggeration, colour scale, housing, rate).
#: Display only: restoring these cannot change a measurement.
"scene3d_display": _SCENE3D_DISPLAY,
#: The top rail's settings area (source / camera / config / units) starts
#: collapsed: the rail is for state, not configuration.
"settings_expanded": False,