EMV延迟参数集成,旧EMV在同名文件夹下EMV_old_save

This commit is contained in:
琉璃月光
2025-08-15 14:03:07 +08:00
parent 817291a425
commit 6b280e75fe
9 changed files with 489 additions and 124 deletions

28
EMV/only_sensor1_test.py Normal file
View File

@ -0,0 +1,28 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
from EMV import RelayController # 请根据你的实际模块名修改
def run_real_sensor_monitor():
# 创建控制器实例
controller = RelayController()
try:
print("启动传感器1监听线程...")
controller.start_sensor1_only() # 只启动传感器1的监听线程
print("开始监听真实传感器1信号按 Ctrl+C 停止...")
# 主线程可以继续做其他事情,或者只是等待
while True:
time.sleep(1) # 保持主线程运行
except KeyboardInterrupt:
print("\n检测到中断信号,正在停止传感器监听...")
finally:
controller.stop()
print("程序已安全退出。")
if __name__ == '__main__':
run_real_sensor_monitor()