diff --git a/apps/studio/config/locales/en_US.json b/apps/studio/config/locales/en_US.json index 3cb4f10..f949403 100644 --- a/apps/studio/config/locales/en_US.json +++ b/apps/studio/config/locales/en_US.json @@ -20,6 +20,7 @@ "reveal_config": "Reveal sensor config…", "playback": "Open recording replay…", "playback_latest": "Replay most recent recording", + "session": "Session", "view": "View", "theme": "Theme", "theme_dark": "Dark", diff --git a/apps/studio/config/locales/zh_CN.json b/apps/studio/config/locales/zh_CN.json index a04b1ce..43cac61 100644 --- a/apps/studio/config/locales/zh_CN.json +++ b/apps/studio/config/locales/zh_CN.json @@ -20,6 +20,7 @@ "reveal_config": "显示传感器配置…", "playback": "打开录制回放…", "playback_latest": "回放最近一次录制", + "session": "采集", "view": "视图", "theme": "主题", "theme_dark": "深色", diff --git a/apps/studio/docs/ui-elements.json b/apps/studio/docs/ui-elements.json index 6e9b624..5234762 100644 --- a/apps/studio/docs/ui-elements.json +++ b/apps/studio/docs/ui-elements.json @@ -154,8 +154,10 @@ "elements": [ { "id": "file_menu", "path": "file_menu", "objectName": null, "class": "QMenu", "purpose": "open a video, reveal the sensor config, open a recording for playback" }, + { "id": "session_menu", "path": "session_menu", "objectName": null, "class": "QMenu", + "purpose": "acquisition session controls: run, cancel, preview, tracker reset, pause" }, { "id": "view_menu", "path": "view_menu", "objectName": null, "class": "QMenu", - "purpose": "what is on screen: panels, 3D, display aids, transport shortcuts, theme and language" }, + "purpose": "what is on screen: panels, 3D, display aids, reset views, theme and language" }, { "id": "theme_menu", "path": "theme_menu", "objectName": null, "class": "QMenu", "purpose": "the dark / light submenu of the view menu" }, { "id": "lang_menu", "path": "lang_menu", "objectName": null, "class": "QMenu", @@ -172,6 +174,16 @@ "purpose": "file menu: open the most recent recording" }, { "id": "act_play", "path": "act_play", "objectName": null, "class": "QAction", "purpose": "Space: the transport shortcut, a window action with no menu entry" }, + { "id": "act_run", "path": "act_run", "objectName": null, "class": "QAction", + "purpose": "session menu / F5: start a run (the rail's transport is the primary control)" }, + { "id": "act_stop", "path": "act_stop", "objectName": null, "class": "QAction", + "purpose": "session menu / Esc: stop the session or the replay" }, + { "id": "act_preview", "path": "act_preview", "objectName": null, "class": "QAction", + "purpose": "session menu / F6: camera preview on/off" }, + { "id": "act_reset", "path": "act_reset", "objectName": null, "class": "QAction", + "purpose": "session menu / Ctrl+R: the rail's reset on a second surface, named from the view it is in (reset sensor tracker while measuring, reset display while replaying)" }, + { "id": "act_pause", "path": "act_pause", "objectName": null, "class": "QAction", + "purpose": "session menu / F7: pause/resume the live session, the same state as the transport" }, { "id": "act_cal_panel", "path": "act_cal_panel", "objectName": null, "class": "QAction", "purpose": "view menu: show the calibration panel (checking it enters the calibration view, unchecking returns to live)" }, { "id": "act_finger_3d", "path": "act_finger_3d", "objectName": null, "class": "QAction", @@ -192,18 +204,8 @@ "purpose": "view menu: analyze video — serve a stored result or run the pass; same state as the rail's button" }, { "id": "act_analysis_setup", "path": "act_analysis_setup", "objectName": null, "class": "QAction", "purpose": "view menu: reopen the analysis setup dialog (profile, calibration, reference frame)" }, - { "id": "act_run", "path": "act_run", "objectName": null, "class": "QAction", - "purpose": "F5: start a run (the rail's transport is the primary control)" }, - { "id": "act_stop", "path": "act_stop", "objectName": null, "class": "QAction", - "purpose": "Esc: stop the session or the replay" }, - { "id": "act_preview", "path": "act_preview", "objectName": null, "class": "QAction", - "purpose": "F6: camera preview on/off" }, - { "id": "act_reset", "path": "act_reset", "objectName": null, "class": "QAction", - "purpose": "Ctrl+R: the rail's reset on a second surface, named from the view it is in (reset sensor tracker while measuring, reset display while replaying)" }, { "id": "act_reset_view", "path": "act_reset_view", "objectName": null, "class": "QAction", - "purpose": "F8: reset the views (curves, window, cursor, 3D camera) without touching the device" }, - { "id": "act_pause", "path": "act_pause", "objectName": null, "class": "QAction", - "purpose": "F7: pause/resume the live session, the same state as the transport" }, + "purpose": "view menu / F8: reset the views (curves, window, cursor, 3D camera) without touching the device" }, { "id": "act_theme_dark", "path": "act_theme_dark", "objectName": null, "class": "QAction", "purpose": "theme submenu: dark theme" }, { "id": "act_theme_light", "path": "act_theme_light", "objectName": null, "class": "QAction", diff --git a/apps/studio/src/orisys_studio/app_window.py b/apps/studio/src/orisys_studio/app_window.py index b7b12c4..94cefa4 100644 --- a/apps/studio/src/orisys_studio/app_window.py +++ b/apps/studio/src/orisys_studio/app_window.py @@ -1063,6 +1063,38 @@ class StudioMainWindow(QMainWindow): self.act_play.setShortcutContext(Qt.ShortcutContext.ApplicationShortcut) self.addAction(self.act_play) + # Acquisition session controls (run / preview / pause). Order on the bar: + # File | Session | View | Help. + self.session_menu = menu_bar.addMenu("") + + self.act_run = QAction(self) + self.act_run.setShortcut("F5") + self.act_run.triggered.connect(self._on_run_shortcut) + self.session_menu.addAction(self.act_run) + + self.act_stop = QAction(self) + self.act_stop.setShortcut("Esc") + self.act_stop.triggered.connect(self._on_stop_shortcut) + self.session_menu.addAction(self.act_stop) + + self.act_preview = QAction(self) + self.act_preview.setShortcut("F6") + self.act_preview.triggered.connect(self._on_preview_shortcut) + self.session_menu.addAction(self.act_preview) + + self.act_reset = QAction(self) + self.act_reset.setShortcut("Ctrl+R") + self.act_reset.triggered.connect(self._on_reset) + self.session_menu.addAction(self.act_reset) + + # Pause has a shortcut as well as a rail button: an operator who is holding a + # sample still wants to stop the numbers moving without reaching for the mouse. + self.act_pause = QAction(self) + self.act_pause.setShortcut("F7") + self.act_pause.setCheckable(True) + self.act_pause.toggled.connect(self._on_pause_action_toggled) + self.session_menu.addAction(self.act_pause) + self.view_menu = menu_bar.addMenu("") self.act_cal_panel = QAction(self) self.act_cal_panel.setCheckable(True) @@ -1123,41 +1155,13 @@ class StudioMainWindow(QMainWindow): self.view_menu.addAction(self.act_analysis_setup) self.view_menu.addSeparator() - self.act_run = QAction(self) - self.act_run.setShortcut("F5") - self.act_run.triggered.connect(self._on_run_shortcut) - self.view_menu.addAction(self.act_run) - - self.act_stop = QAction(self) - self.act_stop.setShortcut("Esc") - self.act_stop.triggered.connect(self._on_stop_shortcut) - self.view_menu.addAction(self.act_stop) - - self.act_preview = QAction(self) - self.act_preview.setShortcut("F6") - self.act_preview.triggered.connect(self._on_preview_shortcut) - self.view_menu.addAction(self.act_preview) - - self.act_reset = QAction(self) - self.act_reset.setShortcut("Ctrl+R") - self.act_reset.triggered.connect(self._on_reset) - self.view_menu.addAction(self.act_reset) - # The graphics half of the old 重置: curves, window, cursor and the 3D camera. # Separate because resetting the device tracker is not the same intention as - # wanting the views back, and only the first one belongs to the device. + # wanting the views back, and only the first one belongs to the device (session menu). self.act_reset_view = QAction(self) self.act_reset_view.setShortcut("F8") self.act_reset_view.triggered.connect(self._on_reset_view) self.view_menu.addAction(self.act_reset_view) - - # Pause has a shortcut as well as a rail button: an operator who is holding a - # sample still wants to stop the numbers moving without reaching for the mouse. - self.act_pause = QAction(self) - self.act_pause.setShortcut("F7") - self.act_pause.setCheckable(True) - self.act_pause.toggled.connect(self._on_pause_action_toggled) - self.view_menu.addAction(self.act_pause) self.view_menu.addSeparator() self.theme_menu = self.view_menu.addMenu("") @@ -1379,6 +1383,15 @@ class StudioMainWindow(QMainWindow): self.act_reveal_config.setText(t("menu.reveal_config")) self.act_playback.setText(t("menu.playback")) self.act_playback_latest.setText(t("menu.playback_latest")) + self.session_menu.setTitle(t("menu.session")) + self.act_run.setText(t("menu.run")) + self.act_stop.setText(t("menu.stop")) + self.act_preview.setText(t("menu.preview")) + # Ctrl+R is the rail's reset on a second surface, so its wording follows the + # view the same way the button's does (see ``_sync_reset_action``). + self._sync_reset_action() + self.act_pause.setText(t("menu.pause")) + self._sync_pause_action() self.view_menu.setTitle(t("menu.view")) self.act_cal_panel.setText(t("menu.calibration_panel")) self.act_finger_3d.setText(t("menu.finger_3d")) @@ -1392,16 +1405,8 @@ class StudioMainWindow(QMainWindow): self.act_recompute.setToolTip(t("menu.recompute_tip")) self.act_analysis_setup.setText(t("menu.analysis_setup")) self.act_analysis_setup.setToolTip(t("menu.analysis_setup_tip")) - self.act_run.setText(t("menu.run")) - self.act_stop.setText(t("menu.stop")) - self.act_preview.setText(t("menu.preview")) - # Ctrl+R is the rail's reset on a second surface, so its wording follows the - # view the same way the button's does (see ``_sync_reset_action``). - self._sync_reset_action() self.act_reset_view.setText(t("menu.reset_view")) self.act_reset_view.setToolTip(t("menu.reset_view_tip")) - self.act_pause.setText(t("menu.pause")) - self._sync_pause_action() self.theme_menu.setTitle(t("menu.theme")) self.act_theme_dark.setText(t("menu.theme_dark")) self.act_theme_light.setText(t("menu.theme_light"))