创建项目及AI生成基本代码

This commit is contained in:
2025-09-08 22:12:42 +08:00
parent db6b887237
commit b96db8f5e3
26 changed files with 1866 additions and 0 deletions

69
config/config.yaml Normal file
View File

@@ -0,0 +1,69 @@
# 通信中继器配置文件
# 中继器配置
relay:
# 中继设备唯一标识符用于WebSocket连接时的身份标识
device_id: "1"
# 中继器名称
name: "猪场1"
# WebSocket配置
websocket:
# WebSocket服务器地址
host: "localhost"
# WebSocket端口
port: 8086
# WebSocket请求超时时间(秒)
timeout: 5
# 模拟模式配置
simulation:
# 是否开启模拟模式
enabled: true
# 模拟区域主控设备列表(没有冒号的地址)
controllers:
- id: "2"
name: "猪舍1"
type: "pig_pen_controller"
lora_address: "121"
status: "running"
- id: "5"
name: "做料1"
type: "feed_mill_controller"
lora_address: "123"
status: "stopped"
- id: "8"
name: "猪舍2"
type: "pig_pen_controller"
lora_address: "122"
status: "running"
# 模拟普通设备列表(带冒号的地址,格式为总线号:总线地址)
devices:
- id: "3"
name: "风机1"
type: "fan"
rs485_bus: "1"
rs485_address: "12"
controller_id: "2"
status: "stopped"
- id: "9"
name: "风机2"
type: "fan"
rs485_bus: "1"
rs485_address: "11"
controller_id: "2"
status: "running"
- id: "10"
name: "水帘1"
type: "water_curtain"
rs485_bus: "1"
rs485_address: "11"
controller_id: "8"
status: "stopped"
- id: "11"
name: "风机3"
type: "fan"
rs485_bus: "2"
rs485_address: "21"
controller_id: "2"
status: "stopped"