refactor(studio): 回放引擎改名 ReplayEngine —— 把「引擎」与「窗口级控制器」的名字分开
- What: `apps/studio/src/orisys_studio/replay.py` 的 `ReplayController` 改名为 `ReplayEngine` (引用只有 4 处:`app_window.py` 的 import 与构造、`ui_check.py` 的一处 import、模块内定义); 模块 docstring 写明它为什么叫 engine(只回答"t 时刻是什么",不知道传输策略、不知道控件), 并指路即将落地的窗口级 `ReplayController`;`app_window.replay` 这个属性名**不动**(36 处使用)。 同步更新两份既有文档里的类名(`apps/studio/docs/shell-lifecycle.md`、`record-channel.md`、 `docs/architecture/studio-architecture.md` 的框图标签)。 - Why: 用户已同意分拆 `app_window.py`,并选定"引擎改名 ReplayEngine + 新类叫 ReplayController" 这一方案(另一方案是让两个名字 `ReplayController`/`ReplayCoordinator` 并存,容易进错门)。 这一步是后续把窗口里那 30 个回放方法搬进 `ReplayController` 的前提:先把名字腾出来, 否则搬迁时无法区分"引擎"与"控制器"。 - Verification: shared+apps 同一次运行 **588 项 0 失败 15 跳过**;`ui_check` 587 项 0 失败; 全仓 `grep ReplayController` 只剩两处有意保留的提及(`replay.py` docstring 里指路、 `app_window.py` 注释里指路),没有悬空引用。 - Not in this change: 不搬运任何方法、不改行为——`app_window.py` 仍是 3043 行;`SessionController`、 `ReplayController`、`ViewLayoutController`、`DisplayPrefsController` 四个模块的搬迁尚未开始 (顺序与契约见 docs/architecture/studio-architecture.md 建议 1)。
This commit is contained in:
@@ -48,7 +48,7 @@ from orisys_app_shared.paths import recordings_dir
|
||||
from orisys_app_shared.record import RecordConfig
|
||||
from orisys_app_shared.record.sample import to_record_sample
|
||||
from orisys_studio.recording import RecordingCoordinator, record_config_from_prefs
|
||||
from orisys_studio.replay import ReplayController
|
||||
from orisys_studio.replay import ReplayEngine
|
||||
from orisys_studio.scene3d.prefs import settings_to_prefs
|
||||
from orisys_app_shared.i18n import set_locale, t
|
||||
from orisys_app_shared.logging import report_error
|
||||
@@ -190,8 +190,10 @@ class StudioMainWindow(QMainWindow):
|
||||
self._run_source_label = ""
|
||||
# ---- replay ---------------------------------------------------------
|
||||
# One engine for the history view: the recording reader, the cursor and
|
||||
# the asynchronous depth recomputation. It renders nothing itself.
|
||||
self.replay = ReplayController(self)
|
||||
# the asynchronous depth recomputation. It renders nothing itself; the
|
||||
# transport policy around it will move into a ReplayController (see
|
||||
# docs/architecture/studio-architecture.md, suggestion 1).
|
||||
self.replay = ReplayEngine(self)
|
||||
# ---- record channel -------------------------------------------------
|
||||
# Fed from the acquisition thread via the worker's sink list, so it does
|
||||
# not depend on the UI refresh rate or on which panels are visible.
|
||||
|
||||
@@ -6,6 +6,12 @@ panel, the curves read the recording through
|
||||
:class:`~orisys_app_shared.force.source.RecordingCurveSource`, and the transport
|
||||
on the chart header drives :meth:`set_position`.
|
||||
|
||||
It is an *engine*, not a controller: it answers "what is at t?" and knows nothing about
|
||||
the transport's policy (when to start, what the end of the timeline means, whether a
|
||||
recompute pass is running) or about the widgets. That policy lives in
|
||||
``ReplayController`` (the window-level controller for this view), which is why the two
|
||||
names are deliberately different — see ``apps/studio/docs/shell-lifecycle.md``.
|
||||
|
||||
There is no depth recomputation here: depth is not stored with a recording, the
|
||||
replay view shows the recorded frames, and re-running the pipeline over a video
|
||||
is the acquisition path's job (see the studio's "recompute" mode).
|
||||
@@ -37,7 +43,7 @@ def _sdk_version() -> str:
|
||||
return ""
|
||||
|
||||
|
||||
class ReplayController(QObject):
|
||||
class ReplayEngine(QObject):
|
||||
"""Open one recording and answer "what is at t?" for every view."""
|
||||
|
||||
#: The cursor moved; the chart cursor and the 2D panel follow.
|
||||
|
||||
Reference in New Issue
Block a user