重构目录结构:调整项目布局

This commit is contained in:
cdeyw
2025-09-26 13:32:34 +08:00
parent 486645a3aa
commit 3ebc4c3765
64 changed files with 2847 additions and 0 deletions

0
config/__init__.py Normal file
View File

Binary file not shown.

Binary file not shown.

51
config/settings.py Normal file
View File

@ -0,0 +1,51 @@
# config/settings.py
import os
class Settings:
def __init__(self):
# 项目根目录
self.project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# 网络继电器配置
self.relay_host = '192.168.0.18'
self.relay_port = 50000
# 摄像头配置
self.camera_type = "ip"
self.camera_ip = "192.168.1.51"
self.camera_port = 554
self.camera_username = "admin"
self.camera_password = "XJ123456"
self.camera_channel = 1
# 下料控制参数
self.min_required_weight = 500 # 模具车最小需要重量(kg)
self.target_vehicle_weight = 5000 # 目标模具车重量(kg)
self.upper_buffer_weight = 500 # 上料斗缓冲重量(kg)
self.single_batch_weight = 2500 # 单次下料重量(kg)
# 角度控制参数
self.target_angle = 20.0 # 目标角度
self.min_angle = 10.0 # 最小角度
self.max_angle = 80.0 # 最大角度
self.angle_threshold = 60.0 # 角度阈值
self.angle_tolerance = 5.0 # 角度容差
# 变频器配置
self.inverter_max_frequency = 400.0 # 频率最大值
self.frequencies = [220.0, 230.0, 240.0] # 下料阶段频率Hz
# 模型路径配置
self.models_dir = os.path.join(self.project_root, 'vision', 'models')
self.angle_model_path = os.path.join(self.models_dir, 'angle.pt')
self.overflow_model_path = os.path.join(self.models_dir, 'overflow.pt')
self.alignment_model_path = os.path.join(self.models_dir, 'alig.pt')
# ROI路径配置
self.roi_file_path = os.path.join(self.project_root, 'vision', 'roi_coordinates', '1_rois.txt')
# 系统控制参数
self.visual_check_interval = 1.0 # 视觉检查间隔(秒)
self.alignment_check_interval = 0.5 # 对齐检查间隔(秒)
self.max_error_count = 3 # 最大错误计数