feat: 站点 JSON、语音终端 WebSocket 指派与客户端联调
- 用 OR_SITE_CONFIG_JSON_FILE 统一术间配置(video_rtsp_urls + voice_or_room_bindings) - VoiceTerminalHub:assignment、WS 推送与 HTTP 查询;开录/停录后 notify - 一键联调 orchestrate-and-start 与 /client/surgeries/start 共用指派逻辑,修复 demo 路径不发 WS - 语音桌面端:SIGINT 退出、shutdown 清理、仅 WS 指派、固定 pending 轮询间隔、界面仅保留录音时长 - 新增/调整契约与绑定测试,文档与示例配置同步 Made-with: Cursor
This commit is contained in:
@@ -2,10 +2,12 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import signal
|
||||
import sys
|
||||
|
||||
|
||||
def main() -> None:
|
||||
from PySide6.QtCore import QTimer
|
||||
from PySide6.QtWidgets import QApplication
|
||||
|
||||
from voice_confirmation_client.gui.main_window import MainWindow
|
||||
@@ -13,6 +15,19 @@ def main() -> None:
|
||||
app = QApplication(sys.argv)
|
||||
win = MainWindow()
|
||||
win.show()
|
||||
|
||||
app.aboutToQuit.connect(win.shutdown)
|
||||
|
||||
# Qt 事件循环长时间跑在 native 代码里时,Python 无法处理 SIGINT;定时器让解释器周期性醒来。
|
||||
_pulse = QTimer()
|
||||
_pulse.timeout.connect(lambda: None)
|
||||
_pulse.start(200)
|
||||
|
||||
def _on_sigint(_signum: int, _frame: object | None) -> None:
|
||||
app.quit()
|
||||
|
||||
signal.signal(signal.SIGINT, _on_sigint)
|
||||
|
||||
raise SystemExit(app.exec())
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user