38 lines
720 B
Python
38 lines
720 B
Python
# main.py
|
||
import time
|
||
from config.settings import Settings
|
||
from core.system import FeedingControlSystem
|
||
|
||
|
||
def main():
|
||
# 加载配置
|
||
settings = Settings()
|
||
|
||
# 初始化系统
|
||
system = FeedingControlSystem(settings)
|
||
|
||
try:
|
||
# 系统初始化
|
||
system.initialize()
|
||
|
||
print("系统准备就绪,5秒后开始下料...")
|
||
time.sleep(5)
|
||
|
||
# 启动下料流程
|
||
system.start_lower_feeding()
|
||
|
||
# 保持运行
|
||
while True:
|
||
time.sleep(1)
|
||
|
||
except KeyboardInterrupt:
|
||
print("收到停止信号")
|
||
except Exception as e:
|
||
print(f"系统错误: {e}")
|
||
finally:
|
||
system.stop()
|
||
|
||
|
||
if __name__ == "__main__":
|
||
main()
|