scripts/rokae/aio/aio.py
gitea e11dc60438 [modify]
v0.0.6(2024/05/23)
1. 为了调整多功能框架,aio.py文件将会作为入口程序存在,不实现具体功能,功能的实现将由具体的功能脚本实现,aio.py只负责条件调用
2. 新增了自动化处理电流数据(电机/过载)的功能
2024-05-23 17:35:34 +08:00

22 lines
697 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.

import openpyxl
import brake
import current
try:
wb_conf = openpyxl.load_workbook('./configs.xlsx', read_only=True)
ws_conf = wb_conf['attention']
except Exception as Err:
msg = "无法在当前路径下找到或打开【configs.xlsx】文件请确认"
brake.warn_pause_exit(msg, 1, 2)
func_name = ws_conf['B2'].value
if func_name not in wb_conf.sheetnames[1:]:
msg = f"主功能选择错误,程序没有{func_name}的功能,请确认后重新输入...."
wb_conf.close()
brake.warn_pause_exit(msg, 1, 1)
else:
func_dict = {'brake': brake.main,
'current': current.main,
}
func_dict[func_name]()