fix(neware): 修复 submit_auto_export_excel 因 resource=[] 导致 0 下发 + filetype kwarg

问题:
- 日志中 submit_auto_export_excel 收到 resource=[](工作流本身不传成品电池资源,
  电池由人工搬运),原代码 n = len(resource) = 0 → 整个循环跳过 →
  "共 0 颗电池,成功下发 0 颗"。
- neware_driver.start_test 原来不接收 filetype kwarg,导致 TypeError 阻塞下发。

修复:
1. submit_auto_export_excel 改为由 mount_resource 驱动循环长度:
   - 新签名以 mount_resource 为主,resource/pole_weight/coin_cell_code 均可选
   - 新增 coin_cell_code 入参,coin_id 优先级 coin_cell_code > resource.name > fallback
   - n==0 时提前返回并给出明确错误信息
2. manual_confirm 的返回值与 YAML handles/output 新增 coin_cell_code
   (从已解包的 assembly_data 直接取)
3. submit_auto_export_excel YAML goal/schema/goal_default/handles.input
   新增 coin_cell_code;required 中移除 resource(不再强制)
4. neware_driver.build_start_command / start_test 增加 filetype:int=1 参数,
   动态嵌入 XML backup 配置,消除 TypeError

Made-with: Cursor
This commit is contained in:
Xie Qiming
2026-04-22 16:24:35 +08:00
parent f431d61d85
commit 79c0815b70
3 changed files with 147 additions and 14 deletions

View File

@@ -354,6 +354,42 @@ neware_battery_test_system:
title: upload_backup_to_oss参数
type: object
type: UniLabJsonCommand
mock_assembly_data:
type: UniLabJsonCommand
goal: {}
feedback: {}
result:
assembly_data: assembly_data
success: success
return_info: return_info
schema:
title: mock_assembly_data参数
description: 模拟扣电组装站 auto-func_sendbottle_allpack_multi 输出固定的 assembly_data用于测试 neware 完整链路)
type: object
properties:
goal:
type: object
properties:
unilabos_device_id:
type: string
default: ''
description: UniLabOS设备ID用于指定执行动作的具体设备实例
required: []
feedback: {}
result:
type: object
required:
- goal
goal_default: {}
handles:
input: []
output:
- handler_key: assembly_data_output
data_type: array
label: 扣电组装数据列表(模拟)
data_key: assembly_data
data_source: executor
placeholder_keys: {}
manual_confirm:
type: UniLabJsonCommand
goal:
@@ -372,6 +408,7 @@ neware_battery_test_system:
feedback: {}
result:
resource: resource
coin_cell_code: coin_cell_code
target_device: target_device
mount_resource: mount_resource
collector_mass: collector_mass
@@ -711,6 +748,11 @@ neware_battery_test_system:
label: 极片质量
data_key: pole_weight
data_source: executor
- handler_key: coin_cell_code
data_type: array
label: 电池条码列表
data_key: coin_cell_code
data_source: executor
placeholder_keys:
resource: unilabos_resources
target_device: unilabos_devices
@@ -729,6 +771,7 @@ neware_battery_test_system:
capacity: capacity
battery_system: battery_system
pole_weight: pole_weight
coin_cell_code: coin_cell_code
feedback: {}
result:
return_info: return_info
@@ -932,8 +975,11 @@ neware_battery_test_system:
type: array
items:
type: number
coin_cell_code:
type: array
items:
type: string
required:
- resource
- mount_resource
- collector_mass
- active_material
@@ -954,6 +1000,7 @@ neware_battery_test_system:
capacity: []
battery_system: []
pole_weight: []
coin_cell_code: []
handles:
input:
- handler_key: resource
@@ -998,6 +1045,12 @@ neware_battery_test_system:
data_key: pole_weight
data_source: handle
io_type: source
- handler_key: coin_cell_code
data_type: array
label: 电池条码列表
data_key: coin_cell_code
data_source: handle
io_type: source
output: []
placeholder_keys:
resource: unilabos_resources