mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2026-02-06 15:05:13 +00:00
feat: migrate to pymodbus 3.11.4 and update bioyond configs
PyModbus 3.x Migration: - Copied modbus.py and client.py from dev branch for compatibility - Rewrote FLOAT32 decoding using struct module in coin_cell_assembly.py - Fixed STRING decoding for QR codes (battery and electrolyte barcodes) - Tested successfully on hardware with correct data decoding Bioyond Studio Updates: - Updated bioyond_studio config.py - Modified bioyond_cell_workstation.py - Enhanced warehouse.py and decks.py - Added README_WAREHOUSE.md documentation Parameter Enhancements: - Enhanced coin_cell_workstation.yaml parameter descriptions - Added matrix position ranges and indexing rules Breaking changes: - Requires pymodbus >= 3.9.0 - Removed deprecated BinaryPayloadDecoder/BinaryPayloadBuilder - Updated to use client.convert_from/to_registers() methods
This commit is contained in:
@@ -27,6 +27,7 @@ def warehouse_factory(
|
||||
category: str = "warehouse",
|
||||
model: Optional[str] = None,
|
||||
col_offset: int = 0, # 列起始偏移量,用于生成A05-D08等命名
|
||||
row_offset: int = 0, # 行起始偏移量,用于生成F01-J03等命名
|
||||
layout: str = "col-major", # 新增:排序方式,"col-major"=列优先,"row-major"=行优先
|
||||
):
|
||||
# 创建位置坐标
|
||||
@@ -65,10 +66,10 @@ def warehouse_factory(
|
||||
if layout == "row-major":
|
||||
# 行优先顺序: A01,A02,A03,A04, B01,B02,B03,B04
|
||||
# locations[0] 对应 row=0, y最大(前端顶部)→ 应该是 A01
|
||||
keys = [f"{LETTERS[j]}{i + 1 + col_offset:02d}" for j in range(len_y) for i in range(len_x)]
|
||||
keys = [f"{LETTERS[j + row_offset]}{i + 1 + col_offset:02d}" for j in range(len_y) for i in range(len_x)]
|
||||
else:
|
||||
# 列优先顺序: A01,B01,C01,D01, A02,B02,C02,D02
|
||||
keys = [f"{LETTERS[j]}{i + 1 + col_offset:02d}" for i in range(len_x) for j in range(len_y)]
|
||||
keys = [f"{LETTERS[j + row_offset]}{i + 1 + col_offset:02d}" for i in range(len_x) for j in range(len_y)]
|
||||
|
||||
sites = {i: site for i, site in zip(keys, _sites.values())}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user