Files
sfgrid/core/qmt_real.py
T
2026-06-02 18:07:55 +08:00

25 lines
605 B
Python

"""
QMT 模块统一入口
根据环境自动选择真实 QMT 或模拟器
"""
import sys
def _get_qmt():
"""获取 QMT 模块"""
if sys.platform == 'win32':
try:
# Windows 环境尝试导入真实 QMT
import core.qmt_real as qmt_module
return qmt_module.qmtv
except ImportError:
pass
# 非 Windows 或导入失败,使用模拟器
try:
import core.qmt_dummy as qmt_module
return qmt_module.qmtv
except ImportError:
raise ImportError("无法加载 QMT 模块")
# 导出单例
qmtv = _get_qmt()