From fe4e49e56d69cb7257ef1b597add40c671a17283 Mon Sep 17 00:00:00 2001 From: calvincao Date: Fri, 31 Oct 2025 13:53:58 +0800 Subject: [PATCH] =?UTF-8?q?feat(workstation):=20=E6=9B=B4=E6=96=B0=20Bioyo?= =?UTF-8?q?nd=20=E5=92=8C=20Coin=20Cell=20=E7=BB=84=E8=A3=85=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E7=AB=99=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改 Bioyond Studio 配置文件中的 API 主机地址 - 更新 bioyond_cell_workstation.py 中的默认模板路径 - 新增物料模板文件 material_template.xlsx - 扩展 func_pack_send_msg_cmd 函数以支持 assembly_pressure 参数 - 更新 coin_cell_workstation.yaml 文件以包含 assembly_pressure 的默认值和类型定义 --- .../bioyond_cell/bioyond_cell_workstation.py | 2 +- ...品导入模板.xlsx => material_template.xlsx} | Bin 22129 -> 22168 bytes .../workstation/bioyond_studio/config.py | 2 +- .../coin_cell_assembly/coin_cell_assembly.py | 15 +++++++++------ .../devices/coin_cell_workstation.yaml | 8 ++++++++ 5 files changed, 19 insertions(+), 8 deletions(-) rename unilabos/devices/workstation/bioyond_studio/bioyond_cell/{样品导入模板.xlsx => material_template.xlsx} (88%) diff --git a/unilabos/devices/workstation/bioyond_studio/bioyond_cell/bioyond_cell_workstation.py b/unilabos/devices/workstation/bioyond_studio/bioyond_cell/bioyond_cell_workstation.py index ff29574d..5ce49e00 100644 --- a/unilabos/devices/workstation/bioyond_studio/bioyond_cell/bioyond_cell_workstation.py +++ b/unilabos/devices/workstation/bioyond_studio/bioyond_cell/bioyond_cell_workstation.py @@ -253,7 +253,7 @@ class BioyondCellWorkstation(BioyondWorkstation): def auto_feeding4to3( self, # ★ 修改点:默认模板路径 - xlsx_path: Optional[str] = "unilabos\\devices\\workstation\\bioyond_studio\\bioyond_cell\\样品导入模板.xlsx", + xlsx_path: Optional[str] = "/Users/calvincao/Desktop/work/uni-lab-all/Uni-Lab-OS/unilabos/devices/workstation/bioyond_studio/bioyond_cell/material_template.xlsx", # ---------------- WH4 - 加样头面 (Z=1, 12个点位) ---------------- WH4_x1_y1_z1_1_materialName: str = "", WH4_x1_y1_z1_1_quantity: float = 0.0, WH4_x2_y1_z1_2_materialName: str = "", WH4_x2_y1_z1_2_quantity: float = 0.0, diff --git a/unilabos/devices/workstation/bioyond_studio/bioyond_cell/样品导入模板.xlsx b/unilabos/devices/workstation/bioyond_studio/bioyond_cell/material_template.xlsx similarity index 88% rename from unilabos/devices/workstation/bioyond_studio/bioyond_cell/样品导入模板.xlsx rename to unilabos/devices/workstation/bioyond_studio/bioyond_cell/material_template.xlsx index 0d8d0e297d6ff5c2d304bc438c499a27da375b01..844fc84d932f618891abbdf6efdefc4bcf16289f 100644 GIT binary patch delta 128 zcmeykhH=JP#tr?de40E$H#?*l7(iHpVe*9#smFu?W$XZCM#I-ZC+quEyD>{GWkhJ vIHSa5n@}6Zvy&@g-0L> diff --git a/unilabos/devices/workstation/bioyond_studio/config.py b/unilabos/devices/workstation/bioyond_studio/config.py index 52feff6f..504cf459 100644 --- a/unilabos/devices/workstation/bioyond_studio/config.py +++ b/unilabos/devices/workstation/bioyond_studio/config.py @@ -8,7 +8,7 @@ import os # BioyondCellWorkstation 默认配置(包含所有必需参数) API_CONFIG = { # API 连接配置 - "api_host": os.getenv("BIOYOND_API_HOST", "http://172.21.32.103:44388"), + "api_host": os.getenv("BIOYOND_API_HOST", "http://172.16.10.169:44388"), "api_key": os.getenv("BIOYOND_API_KEY", "8A819E5C"), "timeout": int(os.getenv("BIOYOND_TIMEOUT", "30")), diff --git a/unilabos/devices/workstation/coin_cell_assembly/coin_cell_assembly.py b/unilabos/devices/workstation/coin_cell_assembly/coin_cell_assembly.py index e520628e..d8bb5975 100644 --- a/unilabos/devices/workstation/coin_cell_assembly/coin_cell_assembly.py +++ b/unilabos/devices/workstation/coin_cell_assembly/coin_cell_assembly.py @@ -766,7 +766,7 @@ class CoinCellAssemblyWorkstation(WorkstationBase): # self.success = True # return self.success - def func_pack_send_msg_cmd(self, elec_use_num, elec_vol, assembly_type) -> bool: + def func_pack_send_msg_cmd(self, elec_use_num, elec_vol, assembly_type, assembly_pressure) -> bool: """UNILAB写参数""" while (self.request_rec_msg_status) == False: print("wait for request_rec_msg_status to True") @@ -782,6 +782,9 @@ class CoinCellAssemblyWorkstation(WorkstationBase): #发送电解液组装类型 self._unilab_send_msg_assembly_type(assembly_type) time.sleep(1) + #发送电池压制力 + self._unilab_send_msg_assembly_pressure(assembly_pressure) + time.sleep(1) self._unilab_send_msg_succ_cmd(True) time.sleep(1) while (self.request_rec_msg_status) == True: @@ -895,16 +898,16 @@ class CoinCellAssemblyWorkstation(WorkstationBase): self.client.use_node('REG_MSG_NE_PLATE_MATRIX').write(fujipian_juzhendianwei) self.client.use_node('REG_MSG_SEPARATOR_PLATE_NUM').write(gemopanshu) self.client.use_node('REG_MSG_SEPARATOR_PLATE_MATRIX').write(gemo_juzhendianwei) - self.client.use_node('COIL_ALUMINUM_FOIL').write(lvbodian) - self.client.use_node('REG_MSG_PRESS_MODE').write(battery_pressure_mode) + self.client.use_node('COIL_ALUMINUM_FOIL').write(not lvbodian) + self.client.use_node('REG_MSG_PRESS_MODE').write(not battery_pressure_mode) # self.client.use_node('REG_MSG_ASSEMBLY_PRESSURE').write(battery_pressure) self.client.use_node('REG_MSG_BATTERY_CLEAN_IGNORE').write(battery_clean_ignore) self.success = True return self.success - def func_allpack_cmd(self, elec_num, elec_use_num, elec_vol:int=50, assembly_type:int=7, file_path: str="D:\\coin_cell_data") -> bool: - elec_num, elec_use_num, elec_vol, assembly_type = int(elec_num), int(elec_use_num), int(elec_vol), int(assembly_type) + def func_allpack_cmd(self, elec_num, elec_use_num, elec_vol:int=50, assembly_type:int=7, assembly_pressure:int=4200, file_path: str="D:\\coin_cell_data") -> bool: + elec_num, elec_use_num, elec_vol, assembly_type, assembly_pressure = int(elec_num), int(elec_use_num), int(elec_vol), int(assembly_type), int(assembly_pressure) summary_csv_file = os.path.join(file_path, "duandian.csv") # 如果断点文件存在,先读取之前的进度 if os.path.exists(summary_csv_file): @@ -954,7 +957,7 @@ class CoinCellAssemblyWorkstation(WorkstationBase): print(f"开始第{last_i+i+1}瓶电解液的组装") #第一个循环从上次断点继续,后续循环从0开始 j_start = last_j if i == last_i else 0 - self.func_pack_send_msg_cmd(elec_use_num-j_start, elec_vol, assembly_type) + self.func_pack_send_msg_cmd(elec_use_num-j_start, elec_vol, assembly_type, assembly_pressure) for j in range(j_start, elec_use_num): print(f"开始第{last_i+i+1}瓶电解液的第{j+j_start+1}个电池组装") diff --git a/unilabos/registry/devices/coin_cell_workstation.yaml b/unilabos/registry/devices/coin_cell_workstation.yaml index 7e541eb8..4738946b 100644 --- a/unilabos/registry/devices/coin_cell_workstation.yaml +++ b/unilabos/registry/devices/coin_cell_workstation.yaml @@ -74,6 +74,7 @@ coincellassemblyworkstation_device: feedback: {} goal: {} goal_default: + assembly_pressure: 4200 assembly_type: 7 elec_num: null elec_use_num: null @@ -88,6 +89,9 @@ coincellassemblyworkstation_device: feedback: {} goal: properties: + assembly_pressure: + default: 4200 + type: integer assembly_type: default: 7 type: integer @@ -291,6 +295,7 @@ coincellassemblyworkstation_device: feedback: {} goal: {} goal_default: + assembly_pressure: null assembly_type: null elec_use_num: null elec_vol: null @@ -303,6 +308,8 @@ coincellassemblyworkstation_device: feedback: {} goal: properties: + assembly_pressure: + type: string assembly_type: type: string elec_use_num: @@ -313,6 +320,7 @@ coincellassemblyworkstation_device: - elec_use_num - elec_vol - assembly_type + - assembly_pressure type: object result: {} required: