Files
operating-room-monitor-server/voice_confirmation_client/__main__.py
Kevin 6b3adb4ad8 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
2026-04-27 11:21:16 +08:00

36 lines
856 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""Entry: `python -m voice_confirmation_client` or `voice-confirmation-client`."""
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
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())
if __name__ == "__main__":
main()