stage_one

This commit is contained in:
2025-12-12 18:00:14 +08:00
parent dc4ef9002e
commit b8b9679bc8
55 changed files with 6541 additions and 459 deletions

View File

@ -32,6 +32,8 @@ class SystemState(QObject):
self._mould_weight=0
self._mould_frequency=220
self._mould_vibrate_status=0 #1振动中0未振动
#记录模具开始振动的时间
self.mould_vibrate_time=0
self.lower_feeding_cycle = 0 # 下料斗下料循环次数
self.upper_feeding_count = 0 # 上料斗已下料次数
@ -48,6 +50,7 @@ class SystemState(QObject):
self.initial_upper_weight=0
self.initial_lower_weight=0
# 错误计数
self.upper_weight_error_count = 0
@ -101,4 +104,6 @@ class FeedStatus(IntEnum):
# 下料3
FFeed3 = 8
#完成(管片生产完成)
FFinished = 11
FFinished = 11
FFeed=12

View File

@ -60,36 +60,19 @@ class FeedingControlSystem:
def initialize(self):
"""初始化系统"""
print("初始化控制系统...")
# 设置摄像头配置
# self.camera_controller.set_config(
# camera_type=app_set_config.camera_type,
# ip=app_set_config.camera_ip,
# port=app_set_config.camera_port,
# username=app_set_config.camera_username,
# password=app_set_config.camera_password,
# channel=app_set_config.camera_channel
# )
# # 初始化摄像头
# if not self.camera_controller.setup_capture():
# raise Exception("摄像头初始化失败")
# 加载视觉模型
# if not self.vision_detector.load_models():
# raise Exception("视觉模型加载失败")
self.check_device_connectivity()
# self.check_device_connectivity()
# self.camera_controller.start_cameras()
# if not app_set_config.debug_feeding:
# 启动系统监控(要料,破拱)线程
self.start_monitoring()
# 启动视觉控制(角度、溢出)线程
# self.start_visual_control()
# 启动对齐检查线程
# self.start_alignment_check()
self.start_alignment_check()
# 启动下料线程
self.start_lower_feeding()
@ -132,7 +115,7 @@ class FeedingControlSystem:
"""视觉控制循环"""
while self.state.running:
try:
print('visual_control')
# print('visual_control')
current_frame = self.camera_controller.get_single_latest_frame()
if current_frame is not None:
# 执行视觉控制逻辑
@ -241,16 +224,15 @@ class FeedingControlSystem:
"""启动LED流程"""
while self.state.running:
led_info = app_web_service.get_pouring_led()
if led_info and self.state.current_artifact:
if led_info:
if self.state.current_artifact.MouldCode==led_info.MouldCode:
led_info.RingTypeCode=self.state.current_artifact.RingTypeCode
led_info.UpperWeight=self.state._upper_weight
led_info.LowerWeight=self.state._lower_weight
led_info.VibrationFrequency=self.state._mould_frequency
#发送到LED屏
time.sleep(app_set_config.led_interval)
def check_device_connectivity(self) -> bool: