stage_one
This commit is contained in:
@ -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:
|
||||
|
||||
Reference in New Issue
Block a user