清理扣电不必要代码

This commit is contained in:
calvincao
2025-10-27 11:43:03 +08:00
parent 2901d72b4b
commit 190b2d2518
20 changed files with 0 additions and 41203 deletions

View File

@@ -1,114 +0,0 @@
#!/usr/bin/env python
#coding=utf-8
ENV = 'pro'#'test'
class MQConfig:
"""MQTT 配置类"""
lab_id: str = '9F05593C'
instance_id: str = 'mqtt-cn-dsr48m6jy02'
group_id: str = 'GID_prod'
broker_url: str = 'mqtt-cn-dsr48m6jy02.mqtt.aliyuncs.com'
port: int = 8883
ca_content: str = '''-----BEGIN CERTIFICATE-----
MIID3jCCAsagAwIBAgIUDyIgmg4qZtMPa8r2Vvn1b1fgJ+YwDQYJKoZIhvcNAQEL
BQAwSzELMAkGA1UEBhMCQ04xCzAJBgNVBAgMAkJKMQswCQYDVQQHDAJCSjEQMA4G
A1UECgwHZHAudGVjaDEQMA4GA1UECwwHdW5pLWxhYjAeFw0yNTA1MDYxNTE0Mjda
Fw0zNTA1MDQxNTE0MjdaMEsxCzAJBgNVBAYTAkNOMQswCQYDVQQIDAJCSjELMAkG
A1UEBwwCQkoxEDAOBgNVBAoMB2RwLnRlY2gxEDAOBgNVBAsMB3VuaS1sYWIwggEi
MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDnTBywX+6DJ2n+prNKvylBBJF6
NHQrCt2cztZfswHsW4QhAbDddp4PRzNVzKtIfHX5ZrXGbxNT1/TqQYXKiFjKbfPC
VHTrS6+95LP3MxNTlBWHP6d2uI45KwrGgQ7D1uPDG1wZsfuJxvOkfAIxZRCDUMJr
erYYK/p2/GVMAO5YKE7wENUMN+iLfVQRqQJRgte9z0B35DxUeOUblJDun0Dpl/6L
0km/YRrjUKA/5+u/h+Ko9+36L1DAi+9rm3eyp+BQHBy5aiVhAG6uAJeMjbZMxwxz
ixg9cWNxP1BW+aQQzixbEQ+YlO9+w/soJkLstiK7jF8uIg2QvmNUKNlqab0pAgMB
AAGjgbkwgbYwHQYDVR0OBBYEFAqg0r7f6ngWOD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AdoR01mdBtdytcYAH+FHplW
wlkCfpT1RPf3fEd0Asy727pJnL9v/QfY/BB+vfgWKUQg9CWNIevwItCaTNOSekis
lKl5dxNGOyouU7rPbTj9BC26OHA50Z3vLMKmi+MCgYEAy0Sb6N6TJ26pNK1qcNs+
1e1oKMem+6lWAYHvTJ35q9jz8q9taJTCXHHnwRZDP8vDwuoZ8iTmm+rQ+HprebQP
Zv9WBYtrc1GgUmtErFGn8wVWZI0rYVGPGx2HK5M7SwJYvajixW0DHD28b7ncLm2/
gv5xKo1QUWEpFlT0OIGDYQECgYEA8WRlH6+s1Iel++ZM8B7T1ibXh5mG6a1ue3eb
0bqmNwPFtASIugqYvWwO3ajlSsWvuTyjgLWaRDye9C42i7HU3UZX/KUAjJvKAjjp
Nt0pfUadCJrdNNZp7sa8RLbrtx9qaWdgl9WAgCckWbZqCvFjTK/iwX7f0cHY4J/w
ojftqYUCgYARM6YaEJuBJEBmZV1I0rweiguqWssZz2j1awSlsfYxckwnci4VtSMI
D/sp0Wp0yn2N4cgqp49BFD0rCQCTsASVICEf9HWdMQXsUhzWsz4SjVEhjWWC1VAk
sEL+BOcbsHy3qMbV2uKBHrhuZShDdy5KtCm9TB+7zTWyDVHwE24nig==
-----END RSA PRIVATE KEY-----
'''
# HTTP配置
class HTTPConfig:
remote_addr = "https://uni-lab.test.bohrium.com/api/v1"

File diff suppressed because it is too large Load Diff

View File

@@ -1,44 +0,0 @@
Name,DataType,InitValue,Comment,Attribute,DeviceType,Address
COIL_SYS_START_CMD,BOOL,,<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,,coil,8010
COIL_SYS_STOP_CMD,BOOL,,<EFBFBD>豸ֹͣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,,coil,8020
COIL_SYS_RESET_CMD,BOOL,,<EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,,coil,8030
COIL_SYS_HAND_CMD,BOOL,,<EFBFBD><EFBFBD>ֶ<EFBFBD>ģʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,,coil,8040
COIL_SYS_AUTO_CMD,BOOL,,<EFBFBD><EFBFBD>Զ<EFBFBD>ģʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,,coil,8050
COIL_SYS_INIT_CMD,BOOL,,<EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>ģʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,,coil,8060
COIL_UNILAB_SEND_MSG_SUCC_CMD,BOOL,,UNILAB<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,,coil,8700
COIL_UNILAB_REC_MSG_SUCC_CMD,BOOL,,UNILAB<EFBFBD><EFBFBD><EFBFBD>ܲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,,coil,8710
COIL_SYS_START_STATUS,BOOL,,<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,,coil,8210
COIL_SYS_STOP_STATUS,BOOL,,<EFBFBD>豸ֹͣ<EFBFBD><EFBFBD>,,coil,8220
COIL_SYS_RESET_STATUS,BOOL,,<EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD>,,coil,8230
COIL_SYS_HAND_STATUS,BOOL,,<EFBFBD><EFBFBD>ֶ<EFBFBD>ģʽ,,coil,8240
COIL_SYS_AUTO_STATUS,BOOL,,<EFBFBD><EFBFBD>Զ<EFBFBD>ģʽ,,coil,8250
COIL_SYS_INIT_STATUS,BOOL,,<EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,,coil,8260
COIL_REQUEST_REC_MSG_STATUS,BOOL,,<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,,coil,8510
COIL_REQUEST_SEND_MSG_STATUS,BOOL,,<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,,coil,8500
REG_MSG_ELECTROLYTE_USE_NUM,INT16,,<EFBFBD><EFBFBD>ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Һʹ<EFBFBD>ô<EFBFBD><EFBFBD><EFBFBD>,,hold_register,11000
REG_MSG_ELECTROLYTE_NUM,INT16,,<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Һʹ<EFBFBD><EFBFBD>ƿ<EFBFBD><EFBFBD>,,hold_register,11002
REG_MSG_ELECTROLYTE_VOLUME,INT16,,<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Һ<EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD>,,hold_register,11004
REG_MSG_ASSEMBLY_TYPE,INT16,,<EFBFBD><EFBFBD>װ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƭ<EFBFBD>ѵ<EFBFBD><EFBFBD><EFBFBD>ʽ,,hold_register,11006
REG_MSG_ASSEMBLY_PRESSURE,INT16,,<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,,hold_register,11008
REG_DATA_ASSEMBLY_COIN_CELL_NUM,INT16,,<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,,hold_register,10000
REG_DATA_OPEN_CIRCUIT_VOLTAGE,FLOAT32,,<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,,hold_register,10002
REG_DATA_AXIS_X_POS,FLOAT32,,<EFBFBD><EFBFBD>ҺX<EFBFBD>ᵱǰλ<EFBFBD><EFBFBD>,,hold_register,10004
REG_DATA_AXIS_Y_POS,FLOAT32,,<EFBFBD><EFBFBD>ҺZ<EFBFBD>ᵱǰλ<EFBFBD><EFBFBD>,,hold_register,10006
REG_DATA_AXIS_Z_POS,FLOAT32,,<EFBFBD><EFBFBD>ҺY<EFBFBD>ᵱǰλ<EFBFBD><EFBFBD>,,hold_register,10008
REG_DATA_POLE_WEIGHT,FLOAT32,,<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,,hold_register,10010
REG_DATA_ASSEMBLY_PER_TIME,FLOAT32,,<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װʱ<EFBFBD><EFBFBD>,,hold_register,10012
REG_DATA_ASSEMBLY_PRESSURE,INT16,,<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,,hold_register,10014
REG_DATA_ELECTROLYTE_VOLUME,INT16,,<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Һ<EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD>,,hold_register,10016
REG_DATA_COIN_NUM,INT16,,<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,,hold_register,10018
REG_DATA_ELECTROLYTE_CODE,STRING,,<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Һ<EFBFBD><EFBFBD>ά<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>,,hold_register,10020
REG_DATA_COIN_CELL_CODE,STRING,,<EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD>ά<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>,,hold_register,10030
REG_DATA_STACK_VISON_CODE,STRING,,<EFBFBD><EFBFBD><EFBFBD>϶ѵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼƬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,,hold_register,12004
REG_DATA_GLOVE_BOX_PRESSURE,FLOAT32,,<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD>,,hold_register,10050
REG_DATA_GLOVE_BOX_WATER_CONTENT,FLOAT32,,<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,,hold_register,10052
REG_DATA_GLOVE_BOX_O2_CONTENT,FLOAT32,,<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,,hold_register,10054
UNILAB_SEND_ELECTROLYTE_BOTTLE_NUM,BOOL,,Unilabȷ<EFBFBD><EFBFBD><EFBFBD>ѷ<EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD>Һƿ<EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD>,,coil,8720
UNILAB_RECE_ELECTROLYTE_BOTTLE_NUM,BOOL,,Unilab<EFBFBD>ɽ<EFBFBD><EFBFBD>ܵ<EFBFBD><EFBFBD><EFBFBD>Һƿ<EFBFBD><EFBFBD>,,coil,8520
REG_MSG_ELECTROLYTE_NUM_USED,INT16,,<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Һ<EFBFBD><EFBFBD>װ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,,hold_register,496
REG_DATA_ELECTROLYTE_USE_NUM,INT16,,<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>װƽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,,hold_register,10000
UNILAB_SEND_FINISHED_CMD,BOOL,,Unilab<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD>,,coil,8730
UNILAB_RECE_FINISHED_CMD,BOOL,,<EFBFBD><EFBFBD>֪unilab<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD>,,coil,8530
1 Name DataType InitValue Comment Attribute DeviceType Address
2 COIL_SYS_START_CMD BOOL 设备启动命令 coil 8010
3 COIL_SYS_STOP_CMD BOOL 设备停止命令 coil 8020
4 COIL_SYS_RESET_CMD BOOL 设备复位命令 coil 8030
5 COIL_SYS_HAND_CMD BOOL 设备手动模式命令 coil 8040
6 COIL_SYS_AUTO_CMD BOOL 设备自动模式命令 coil 8050
7 COIL_SYS_INIT_CMD BOOL 设备初始化模式命令 coil 8060
8 COIL_UNILAB_SEND_MSG_SUCC_CMD BOOL UNILAB发送配方完毕 coil 8700
9 COIL_UNILAB_REC_MSG_SUCC_CMD BOOL UNILAB接受测试数据完毕 coil 8710
10 COIL_SYS_START_STATUS BOOL 设备启动中 coil 8210
11 COIL_SYS_STOP_STATUS BOOL 设备停止中 coil 8220
12 COIL_SYS_RESET_STATUS BOOL 设备复位中 coil 8230
13 COIL_SYS_HAND_STATUS BOOL 设备手动模式 coil 8240
14 COIL_SYS_AUTO_STATUS BOOL 设备自动模式 coil 8250
15 COIL_SYS_INIT_STATUS BOOL 设备初始化完成 coil 8260
16 COIL_REQUEST_REC_MSG_STATUS BOOL 设备请求接受配方 coil 8510
17 COIL_REQUEST_SEND_MSG_STATUS BOOL 设备请求发送测试数据 coil 8500
18 REG_MSG_ELECTROLYTE_USE_NUM INT16 单瓶电解液使用次数 hold_register 11000
19 REG_MSG_ELECTROLYTE_NUM INT16 电解液使用瓶数 hold_register 11002
20 REG_MSG_ELECTROLYTE_VOLUME INT16 电解液吸取量 hold_register 11004
21 REG_MSG_ASSEMBLY_TYPE INT16 组装参数:极片堆叠方式 hold_register 11006
22 REG_MSG_ASSEMBLY_PRESSURE INT16 电池组装压制力 hold_register 11008
23 REG_DATA_ASSEMBLY_COIN_CELL_NUM INT16 当前完成组装电池数量 hold_register 10000
24 REG_DATA_OPEN_CIRCUIT_VOLTAGE FLOAT32 当前电池电压数据 hold_register 10002
25 REG_DATA_AXIS_X_POS FLOAT32 分液X轴当前位置 hold_register 10004
26 REG_DATA_AXIS_Y_POS FLOAT32 分液Z轴当前位置 hold_register 10006
27 REG_DATA_AXIS_Z_POS FLOAT32 分液Y轴当前位置 hold_register 10008
28 REG_DATA_POLE_WEIGHT FLOAT32 当前电池正极片称重数据 hold_register 10010
29 REG_DATA_ASSEMBLY_PER_TIME FLOAT32 当前单颗电池组装时间 hold_register 10012
30 REG_DATA_ASSEMBLY_PRESSURE INT16 当前电池组装压制力 hold_register 10014
31 REG_DATA_ELECTROLYTE_VOLUME INT16 当前电解液加注量 hold_register 10016
32 REG_DATA_COIN_NUM INT16 当前电池物料数 hold_register 10018
33 REG_DATA_ELECTROLYTE_CODE STRING 电解液二维码序列号 hold_register 10020
34 REG_DATA_COIN_CELL_CODE STRING 电池二维码序列号 hold_register 10030
35 REG_DATA_STACK_VISON_CODE STRING 物料堆叠复检图片编码 hold_register 12004
36 REG_DATA_GLOVE_BOX_PRESSURE FLOAT32 手套箱压力 hold_register 10050
37 REG_DATA_GLOVE_BOX_WATER_CONTENT FLOAT32 手套箱水含量 hold_register 10052
38 REG_DATA_GLOVE_BOX_O2_CONTENT FLOAT32 手套箱氧含量 hold_register 10054
39 UNILAB_SEND_ELECTROLYTE_BOTTLE_NUM BOOL Unilab确认已发送电解液瓶数信号 coil 8720
40 UNILAB_RECE_ELECTROLYTE_BOTTLE_NUM BOOL Unilab可接受电解液瓶数 coil 8520
41 REG_MSG_ELECTROLYTE_NUM_USED INT16 电解液组装电池平行样数 hold_register 496
42 REG_DATA_ELECTROLYTE_USE_NUM INT16 当前已组装平行样数 hold_register 10000
43 UNILAB_SEND_FINISHED_CMD BOOL Unilab发送收到完成信号 coil 8730
44 UNILAB_RECE_FINISHED_CMD BOOL 告知unilab结束信号 coil 8530

View File

@@ -1,46 +0,0 @@
Name,DataType,InitValue,Comment,Attribute,DeviceType,Address,
COIL_SYS_START_CMD,BOOL,,,,coil,8010,
COIL_SYS_STOP_CMD,BOOL,,,,coil,8020,
COIL_SYS_RESET_CMD,BOOL,,,,coil,8030,
COIL_SYS_HAND_CMD,BOOL,,,,coil,8040,
COIL_SYS_AUTO_CMD,BOOL,,,,coil,8050,
COIL_SYS_INIT_CMD,BOOL,,,,coil,8060,
COIL_UNILAB_SEND_MSG_SUCC_CMD,BOOL,,,,coil,8700,
COIL_UNILAB_REC_MSG_SUCC_CMD,BOOL,,,,coil,8710,unilab_rec_msg_succ_cmd
COIL_SYS_START_STATUS,BOOL,,,,coil,8210,
COIL_SYS_STOP_STATUS,BOOL,,,,coil,8220,
COIL_SYS_RESET_STATUS,BOOL,,,,coil,8230,
COIL_SYS_HAND_STATUS,BOOL,,,,coil,8240,
COIL_SYS_AUTO_STATUS,BOOL,,,,coil,8250,
COIL_SYS_INIT_STATUS,BOOL,,,,coil,8260,
COIL_REQUEST_REC_MSG_STATUS,BOOL,,,,coil,8500,
COIL_REQUEST_SEND_MSG_STATUS,BOOL,,,,coil,8510,request_send_msg_status
REG_MSG_ELECTROLYTE_USE_NUM,INT16,,,,hold_register,11000,
REG_MSG_ELECTROLYTE_NUM,INT16,,,,hold_register,11002,unilab_send_msg_electrolyte_num
REG_MSG_ELECTROLYTE_VOLUME,INT16,,,,hold_register,11004,unilab_send_msg_electrolyte_vol
REG_MSG_ASSEMBLY_TYPE,INT16,,,,hold_register,11006,unilab_send_msg_assembly_type
REG_MSG_ASSEMBLY_PRESSURE,INT16,,,,hold_register,11008,unilab_send_msg_assembly_pressure
REG_DATA_ASSEMBLY_COIN_CELL_NUM,INT16,,,,hold_register,10000,data_assembly_coin_cell_num
REG_DATA_OPEN_CIRCUIT_VOLTAGE,FLOAT32,,,,hold_register,10002,data_open_circuit_voltage
REG_DATA_AXIS_X_POS,FLOAT32,,,,hold_register,10004,
REG_DATA_AXIS_Y_POS,FLOAT32,,,,hold_register,10006,
REG_DATA_AXIS_Z_POS,FLOAT32,,,,hold_register,10008,
REG_DATA_POLE_WEIGHT,FLOAT32,,,,hold_register,10010,data_pole_weight
REG_DATA_ASSEMBLY_PER_TIME,FLOAT32,,,,hold_register,10012,data_assembly_time
REG_DATA_ASSEMBLY_PRESSURE,INT16,,,,hold_register,10014,data_assembly_pressure
REG_DATA_ELECTROLYTE_VOLUME,INT16,,,,hold_register,10016,data_electrolyte_volume
REG_DATA_COIN_NUM,INT16,,,,hold_register,10018,data_coin_num
REG_DATA_ELECTROLYTE_CODE,STRING,,,,hold_register,10020,data_electrolyte_code()
REG_DATA_COIN_CELL_CODE,STRING,,,,hold_register,10030,data_coin_cell_code()
REG_DATA_STACK_VISON_CODE,STRING,,,,hold_register,12004,data_stack_vision_code()
REG_DATA_GLOVE_BOX_PRESSURE,FLOAT32,,,,hold_register,10050,data_glove_box_pressure
REG_DATA_GLOVE_BOX_WATER_CONTENT,FLOAT32,,,,hold_register,10052,data_glove_box_water_content
REG_DATA_GLOVE_BOX_O2_CONTENT,FLOAT32,,,,hold_register,10054,data_glove_box_o2_content
UNILAB_SEND_ELECTROLYTE_BOTTLE_NUM,BOOL,,,,coil,8720,
UNILAB_RECE_ELECTROLYTE_BOTTLE_NUM,BOOL,,,,coil,8520,
REG_MSG_ELECTROLYTE_NUM_USED,INT16,,,,hold_register,496,
REG_DATA_ELECTROLYTE_USE_NUM,INT16,,,,hold_register,10000,
UNILAB_SEND_FINISHED_CMD,BOOL,,,,coil,8730,
UNILAB_RECE_FINISHED_CMD,BOOL,,,,coil,8530,
REG_DATA_ASSEMBLY_TYPE,INT16,,,,hold_register,10018,ASSEMBLY_TYPE7or8
COIL_ALUMINUM_FOIL,BOOL,,,,coil,8340,
1 Name DataType InitValue Comment Attribute DeviceType Address
2 COIL_SYS_START_CMD BOOL coil 8010
3 COIL_SYS_STOP_CMD BOOL coil 8020
4 COIL_SYS_RESET_CMD BOOL coil 8030
5 COIL_SYS_HAND_CMD BOOL coil 8040
6 COIL_SYS_AUTO_CMD BOOL coil 8050
7 COIL_SYS_INIT_CMD BOOL coil 8060
8 COIL_UNILAB_SEND_MSG_SUCC_CMD BOOL coil 8700
9 COIL_UNILAB_REC_MSG_SUCC_CMD BOOL coil 8710 unilab_rec_msg_succ_cmd
10 COIL_SYS_START_STATUS BOOL coil 8210
11 COIL_SYS_STOP_STATUS BOOL coil 8220
12 COIL_SYS_RESET_STATUS BOOL coil 8230
13 COIL_SYS_HAND_STATUS BOOL coil 8240
14 COIL_SYS_AUTO_STATUS BOOL coil 8250
15 COIL_SYS_INIT_STATUS BOOL coil 8260
16 COIL_REQUEST_REC_MSG_STATUS BOOL coil 8500
17 COIL_REQUEST_SEND_MSG_STATUS BOOL coil 8510 request_send_msg_status
18 REG_MSG_ELECTROLYTE_USE_NUM INT16 hold_register 11000
19 REG_MSG_ELECTROLYTE_NUM INT16 hold_register 11002 unilab_send_msg_electrolyte_num
20 REG_MSG_ELECTROLYTE_VOLUME INT16 hold_register 11004 unilab_send_msg_electrolyte_vol
21 REG_MSG_ASSEMBLY_TYPE INT16 hold_register 11006 unilab_send_msg_assembly_type
22 REG_MSG_ASSEMBLY_PRESSURE INT16 hold_register 11008 unilab_send_msg_assembly_pressure
23 REG_DATA_ASSEMBLY_COIN_CELL_NUM INT16 hold_register 10000 data_assembly_coin_cell_num
24 REG_DATA_OPEN_CIRCUIT_VOLTAGE FLOAT32 hold_register 10002 data_open_circuit_voltage
25 REG_DATA_AXIS_X_POS FLOAT32 hold_register 10004
26 REG_DATA_AXIS_Y_POS FLOAT32 hold_register 10006
27 REG_DATA_AXIS_Z_POS FLOAT32 hold_register 10008
28 REG_DATA_POLE_WEIGHT FLOAT32 hold_register 10010 data_pole_weight
29 REG_DATA_ASSEMBLY_PER_TIME FLOAT32 hold_register 10012 data_assembly_time
30 REG_DATA_ASSEMBLY_PRESSURE INT16 hold_register 10014 data_assembly_pressure
31 REG_DATA_ELECTROLYTE_VOLUME INT16 hold_register 10016 data_electrolyte_volume
32 REG_DATA_COIN_NUM INT16 hold_register 10018 data_coin_num
33 REG_DATA_ELECTROLYTE_CODE STRING hold_register 10020 data_electrolyte_code()
34 REG_DATA_COIN_CELL_CODE STRING hold_register 10030 data_coin_cell_code()
35 REG_DATA_STACK_VISON_CODE STRING hold_register 12004 data_stack_vision_code()
36 REG_DATA_GLOVE_BOX_PRESSURE FLOAT32 hold_register 10050 data_glove_box_pressure
37 REG_DATA_GLOVE_BOX_WATER_CONTENT FLOAT32 hold_register 10052 data_glove_box_water_content
38 REG_DATA_GLOVE_BOX_O2_CONTENT FLOAT32 hold_register 10054 data_glove_box_o2_content
39 UNILAB_SEND_ELECTROLYTE_BOTTLE_NUM BOOL coil 8720
40 UNILAB_RECE_ELECTROLYTE_BOTTLE_NUM BOOL coil 8520
41 REG_MSG_ELECTROLYTE_NUM_USED INT16 hold_register 496
42 REG_DATA_ELECTROLYTE_USE_NUM INT16 hold_register 10000
43 UNILAB_SEND_FINISHED_CMD BOOL coil 8730
44 UNILAB_RECE_FINISHED_CMD BOOL coil 8530
45 REG_DATA_ASSEMBLY_TYPE INT16 hold_register 10018 ASSEMBLY_TYPE7or8
46 COIL_ALUMINUM_FOIL BOOL coil 8340

View File

@@ -1,135 +0,0 @@
import json
import re
from pymodbus.client import ModbusTcpClient
from unilabos.device_comms.modbus_plc.modbus import WorderOrder, Coil, DiscreteInputs, HoldRegister, InputRegister, DataType
from pymodbus.constants import Endian
import time
import threading
import csv
import os
from datetime import datetime
from typing import Callable
from unilabos.device_comms.modbus_plc.client import TCPClient, ModbusNode, PLCWorkflow, ModbusWorkflow, WorkflowAction, BaseClient
from unilabos.device_comms.modbus_plc.modbus import DeviceType, Base as ModbusNodeBase, DataType, WorderOrder
class Coin_Cell_Assembly:
if __name__ == '__main__':
coin_cell_assmbly = Coin_Cell_Assembly(address="192.168.1.20", port="502")
#params = {
# "elec_num": 32
#}
#str_data = json.dumps(params, ensure_ascii=False)
#print('param:', coin_cell_assmbly.func_pack_device_write_batch_elec_param(params))
#time.sleep(1)
print(coin_cell_assmbly.func_pack_device_write_per_elec_param(
elec_use_num=4,
elec_num=5,
elec_vol=55,
assembly_type=25,
assembly_pressure=550))
time.sleep(1)
'''
print('start:', coin_cell_assmbly.func_pack_device_start())
time.sleep(1)
print('start:', coin_cell_assmbly.func_pack_device_start())
time.sleep(1)
print('stop:', coin_cell_assmbly.func_pack_device_stop())
time.sleep(1)
while True:
# cmd coil
print('start cmd:', coin_cell_assmbly.sys_start_cmd(True))
time.sleep(1)
print('stop cmd:', coin_cell_assmbly.sys_stop_cmd(False))
time.sleep(1)
print('reset cmd:', coin_cell_assmbly.sys_reset_cmd(True))
time.sleep(1)
print('hand cmd:', coin_cell_assmbly.sys_hand_cmd(False))
time.sleep(1)
print('auto cmd:', coin_cell_assmbly.sys_auto_cmd(True))
time.sleep(1)
print('init cmd:', coin_cell_assmbly.sys_init_cmd(False))
time.sleep(1)
print('send msg succ cmd:', coin_cell_assmbly.unilab_send_msg_succ_cmd(False))
time.sleep(1)
print('rec msg succ cmd:', coin_cell_assmbly.unilab_rec_msg_succ_cmd(True))
time.sleep(1)
# cmd reg
print('elec use num msg:', coin_cell_assmbly.unilab_send_msg_electrolyte_use_num(8))
time.sleep(1)
print('elec num msg:', coin_cell_assmbly.unilab_send_msg_electrolyte_num(4))
time.sleep(1)
print('elec vol msg:', coin_cell_assmbly.unilab_send_msg_electrolyte_vol(3.3))
time.sleep(1)
print('assembly type msg:', coin_cell_assmbly.unilab_send_msg_assembly_type(1))
time.sleep(1)
print('assembly pressure msg:', coin_cell_assmbly.unilab_send_msg_assembly_pressure(1))
time.sleep(1)
# status coil
print('start status:',coin_cell_assmbly.sys_start_status)
time.sleep(1)
print('stop status:',coin_cell_assmbly.sys_stop_status)
time.sleep(1)
print('reset status:',coin_cell_assmbly.sys_reset_status)
time.sleep(1)
print('hand status:',coin_cell_assmbly.sys_hand_status)
time.sleep(1)
print('auto status:', coin_cell_assmbly.sys_auto_status)
time.sleep(1)
print('init ok:', coin_cell_assmbly.sys_init_status)
time.sleep(1)
print('request rec msg:', coin_cell_assmbly.request_rec_msg_status)
time.sleep(1)
print('request send msg:', coin_cell_assmbly.request_send_msg_status)
time.sleep(1)
# status reg
print('assembly coin cell num:', coin_cell_assmbly.data_assembly_coin_cell_num)
time.sleep(1)
print('assembly coin assembly per time:', coin_cell_assmbly.data_assembly_time)
time.sleep(1)
print('open circuit vol:', coin_cell_assmbly.data_open_circuit_voltage)
time.sleep(1)
print('axis x pos:', coin_cell_assmbly.data_axis_x_pos)
time.sleep(1)
print('axis y pos:', coin_cell_assmbly.data_axis_y_pos)
time.sleep(1)
print('axis z pos:', coin_cell_assmbly.data_axis_z_pos)
time.sleep(1)
print('pole weight:', coin_cell_assmbly.data_pole_weight)
time.sleep(1)
print('assembly pressure:', coin_cell_assmbly.data_assembly_coin_cell_num)
time.sleep(1)
print('assembly electrolyte vol:', coin_cell_assmbly.data_electrolyte_volume)
time.sleep(1)
print('assembly coin num:', coin_cell_assmbly.data_coin_num)
time.sleep(1)
print('coin cell code:', coin_cell_assmbly.data_coin_cell_code)
time.sleep(1)
print('elec code:', coin_cell_assmbly.data_electrolyte_code)
time.sleep(1)
print('glove box pressure:', coin_cell_assmbly.data_glove_box_pressure)
time.sleep(1)
print('glove box o2:', coin_cell_assmbly.data_glove_box_o2_content)
time.sleep(1)
print('glove box water:', coin_cell_assmbly.data_glove_box_water_content)
time.sleep(1)
'''

View File

@@ -1,691 +0,0 @@
{
"nodes": [
{
"id": "BatteryStation",
"name": "扣电工作站",
"children": [
"coin_cell_deck"
],
"parent": null,
"type": "device",
"class": "bettery_station_registry",
"position": {
"x": 600,
"y": 400,
"z": 0
},
"config": {
"debug_mode": false,
"_comment": "protocol_type接外部工站固定写法字段一般为空station_resource写法也固定",
"protocol_type": [],
"station_resource": {
"data": {
"_resource_child_name": "coin_cell_deck",
"_resource_type": "unilabos.devices.workstation.coin_cell_assembly.button_battery_station:CoincellDeck"
}
},
"address": "192.168.1.20",
"port": 502
},
"data": {}
},
{
"id": "coin_cell_deck",
"name": "coin_cell_deck",
"sample_id": null,
"children": [
"\u7535\u6c60\u6599\u76d8"
],
"parent": null,
"type": "container",
"class": "",
"position": {
"x": 0,
"y": 0,
"z": 0
},
"config": {
"type": "CoincellDeck",
"size_x": 1000,
"size_y": 1000,
"size_z": 900,
"rotation": {
"x": 0,
"y": 0,
"z": 0,
"type": "Rotation"
},
"category": "coin_cell_deck",
"barcode": null
},
"data": {}
},
{
"id": "\u7535\u6c60\u6599\u76d8",
"name": "\u7535\u6c60\u6599\u76d8",
"sample_id": null,
"children": [
"\u7535\u6c60\u6599\u76d8_materialhole_0_0",
"\u7535\u6c60\u6599\u76d8_materialhole_0_1",
"\u7535\u6c60\u6599\u76d8_materialhole_0_2",
"\u7535\u6c60\u6599\u76d8_materialhole_0_3",
"\u7535\u6c60\u6599\u76d8_materialhole_1_0",
"\u7535\u6c60\u6599\u76d8_materialhole_1_1",
"\u7535\u6c60\u6599\u76d8_materialhole_1_2",
"\u7535\u6c60\u6599\u76d8_materialhole_1_3",
"\u7535\u6c60\u6599\u76d8_materialhole_2_0",
"\u7535\u6c60\u6599\u76d8_materialhole_2_1",
"\u7535\u6c60\u6599\u76d8_materialhole_2_2",
"\u7535\u6c60\u6599\u76d8_materialhole_2_3",
"\u7535\u6c60\u6599\u76d8_materialhole_3_0",
"\u7535\u6c60\u6599\u76d8_materialhole_3_1",
"\u7535\u6c60\u6599\u76d8_materialhole_3_2",
"\u7535\u6c60\u6599\u76d8_materialhole_3_3"
],
"parent": "coin_cell_deck",
"type": "container",
"class": "",
"position": {
"x": 100,
"y": 100,
"z": 0
},
"config": {
"type": "MaterialPlate",
"size_x": 120.8,
"size_y": 160.5,
"size_z": 10.0,
"rotation": {
"x": 0,
"y": 0,
"z": 0,
"type": "Rotation"
},
"category": "material_plate",
"model": null,
"barcode": null,
"ordering": {
"A1": "\u7535\u6c60\u6599\u76d8_materialhole_0_0",
"B1": "\u7535\u6c60\u6599\u76d8_materialhole_0_1",
"C1": "\u7535\u6c60\u6599\u76d8_materialhole_0_2",
"D1": "\u7535\u6c60\u6599\u76d8_materialhole_0_3",
"A2": "\u7535\u6c60\u6599\u76d8_materialhole_1_0",
"B2": "\u7535\u6c60\u6599\u76d8_materialhole_1_1",
"C2": "\u7535\u6c60\u6599\u76d8_materialhole_1_2",
"D2": "\u7535\u6c60\u6599\u76d8_materialhole_1_3",
"A3": "\u7535\u6c60\u6599\u76d8_materialhole_2_0",
"B3": "\u7535\u6c60\u6599\u76d8_materialhole_2_1",
"C3": "\u7535\u6c60\u6599\u76d8_materialhole_2_2",
"D3": "\u7535\u6c60\u6599\u76d8_materialhole_2_3",
"A4": "\u7535\u6c60\u6599\u76d8_materialhole_3_0",
"B4": "\u7535\u6c60\u6599\u76d8_materialhole_3_1",
"C4": "\u7535\u6c60\u6599\u76d8_materialhole_3_2",
"D4": "\u7535\u6c60\u6599\u76d8_materialhole_3_3"
}
},
"data": {}
},
{
"id": "\u7535\u6c60\u6599\u76d8_materialhole_0_0",
"name": "\u7535\u6c60\u6599\u76d8_materialhole_0_0",
"sample_id": null,
"children": [],
"parent": "\u7535\u6c60\u6599\u76d8",
"type": "container",
"class": "",
"position": {
"x": 12.4,
"y": 104.25,
"z": 10.0
},
"config": {
"type": "MaterialHole",
"size_x": 16,
"size_y": 16,
"size_z": 16,
"rotation": {
"x": 0,
"y": 0,
"z": 0,
"type": "Rotation"
},
"category": "material_hole",
"model": null,
"barcode": null
},
"data": {
"diameter": 20,
"depth": 10,
"max_sheets": 1,
"info": null
}
},
{
"id": "\u7535\u6c60\u6599\u76d8_materialhole_0_1",
"name": "\u7535\u6c60\u6599\u76d8_materialhole_0_1",
"sample_id": null,
"children": [],
"parent": "\u7535\u6c60\u6599\u76d8",
"type": "container",
"class": "",
"position": {
"x": 12.4,
"y": 80.25,
"z": 10.0
},
"config": {
"type": "MaterialHole",
"size_x": 16,
"size_y": 16,
"size_z": 16,
"rotation": {
"x": 0,
"y": 0,
"z": 0,
"type": "Rotation"
},
"category": "material_hole",
"model": null,
"barcode": null
},
"data": {
"diameter": 20,
"depth": 10,
"max_sheets": 1,
"info": null
}
},
{
"id": "\u7535\u6c60\u6599\u76d8_materialhole_0_2",
"name": "\u7535\u6c60\u6599\u76d8_materialhole_0_2",
"sample_id": null,
"children": [],
"parent": "\u7535\u6c60\u6599\u76d8",
"type": "container",
"class": "",
"position": {
"x": 12.4,
"y": 56.25,
"z": 10.0
},
"config": {
"type": "MaterialHole",
"size_x": 16,
"size_y": 16,
"size_z": 16,
"rotation": {
"x": 0,
"y": 0,
"z": 0,
"type": "Rotation"
},
"category": "material_hole",
"model": null,
"barcode": null
},
"data": {
"diameter": 20,
"depth": 10,
"max_sheets": 1,
"info": null
}
},
{
"id": "\u7535\u6c60\u6599\u76d8_materialhole_0_3",
"name": "\u7535\u6c60\u6599\u76d8_materialhole_0_3",
"sample_id": null,
"children": [],
"parent": "\u7535\u6c60\u6599\u76d8",
"type": "container",
"class": "",
"position": {
"x": 12.4,
"y": 32.25,
"z": 10.0
},
"config": {
"type": "MaterialHole",
"size_x": 16,
"size_y": 16,
"size_z": 16,
"rotation": {
"x": 0,
"y": 0,
"z": 0,
"type": "Rotation"
},
"category": "material_hole",
"model": null,
"barcode": null
},
"data": {
"diameter": 20,
"depth": 10,
"max_sheets": 1,
"info": null
}
},
{
"id": "\u7535\u6c60\u6599\u76d8_materialhole_1_0",
"name": "\u7535\u6c60\u6599\u76d8_materialhole_1_0",
"sample_id": null,
"children": [],
"parent": "\u7535\u6c60\u6599\u76d8",
"type": "container",
"class": "",
"position": {
"x": 36.4,
"y": 104.25,
"z": 10.0
},
"config": {
"type": "MaterialHole",
"size_x": 16,
"size_y": 16,
"size_z": 16,
"rotation": {
"x": 0,
"y": 0,
"z": 0,
"type": "Rotation"
},
"category": "material_hole",
"model": null,
"barcode": null
},
"data": {
"diameter": 20,
"depth": 10,
"max_sheets": 1,
"info": null
}
},
{
"id": "\u7535\u6c60\u6599\u76d8_materialhole_1_1",
"name": "\u7535\u6c60\u6599\u76d8_materialhole_1_1",
"sample_id": null,
"children": [],
"parent": "\u7535\u6c60\u6599\u76d8",
"type": "container",
"class": "",
"position": {
"x": 36.4,
"y": 80.25,
"z": 10.0
},
"config": {
"type": "MaterialHole",
"size_x": 16,
"size_y": 16,
"size_z": 16,
"rotation": {
"x": 0,
"y": 0,
"z": 0,
"type": "Rotation"
},
"category": "material_hole",
"model": null,
"barcode": null
},
"data": {
"diameter": 20,
"depth": 10,
"max_sheets": 1,
"info": null
}
},
{
"id": "\u7535\u6c60\u6599\u76d8_materialhole_1_2",
"name": "\u7535\u6c60\u6599\u76d8_materialhole_1_2",
"sample_id": null,
"children": [],
"parent": "\u7535\u6c60\u6599\u76d8",
"type": "container",
"class": "",
"position": {
"x": 36.4,
"y": 56.25,
"z": 10.0
},
"config": {
"type": "MaterialHole",
"size_x": 16,
"size_y": 16,
"size_z": 16,
"rotation": {
"x": 0,
"y": 0,
"z": 0,
"type": "Rotation"
},
"category": "material_hole",
"model": null,
"barcode": null
},
"data": {
"diameter": 20,
"depth": 10,
"max_sheets": 1,
"info": null
}
},
{
"id": "\u7535\u6c60\u6599\u76d8_materialhole_1_3",
"name": "\u7535\u6c60\u6599\u76d8_materialhole_1_3",
"sample_id": null,
"children": [],
"parent": "\u7535\u6c60\u6599\u76d8",
"type": "container",
"class": "",
"position": {
"x": 36.4,
"y": 32.25,
"z": 10.0
},
"config": {
"type": "MaterialHole",
"size_x": 16,
"size_y": 16,
"size_z": 16,
"rotation": {
"x": 0,
"y": 0,
"z": 0,
"type": "Rotation"
},
"category": "material_hole",
"model": null,
"barcode": null
},
"data": {
"diameter": 20,
"depth": 10,
"max_sheets": 1,
"info": null
}
},
{
"id": "\u7535\u6c60\u6599\u76d8_materialhole_2_0",
"name": "\u7535\u6c60\u6599\u76d8_materialhole_2_0",
"sample_id": null,
"children": [],
"parent": "\u7535\u6c60\u6599\u76d8",
"type": "container",
"class": "",
"position": {
"x": 60.4,
"y": 104.25,
"z": 10.0
},
"config": {
"type": "MaterialHole",
"size_x": 16,
"size_y": 16,
"size_z": 16,
"rotation": {
"x": 0,
"y": 0,
"z": 0,
"type": "Rotation"
},
"category": "material_hole",
"model": null,
"barcode": null
},
"data": {
"diameter": 20,
"depth": 10,
"max_sheets": 1,
"info": null
}
},
{
"id": "\u7535\u6c60\u6599\u76d8_materialhole_2_1",
"name": "\u7535\u6c60\u6599\u76d8_materialhole_2_1",
"sample_id": null,
"children": [],
"parent": "\u7535\u6c60\u6599\u76d8",
"type": "container",
"class": "",
"position": {
"x": 60.4,
"y": 80.25,
"z": 10.0
},
"config": {
"type": "MaterialHole",
"size_x": 16,
"size_y": 16,
"size_z": 16,
"rotation": {
"x": 0,
"y": 0,
"z": 0,
"type": "Rotation"
},
"category": "material_hole",
"model": null,
"barcode": null
},
"data": {
"diameter": 20,
"depth": 10,
"max_sheets": 1,
"info": null
}
},
{
"id": "\u7535\u6c60\u6599\u76d8_materialhole_2_2",
"name": "\u7535\u6c60\u6599\u76d8_materialhole_2_2",
"sample_id": null,
"children": [],
"parent": "\u7535\u6c60\u6599\u76d8",
"type": "container",
"class": "",
"position": {
"x": 60.4,
"y": 56.25,
"z": 10.0
},
"config": {
"type": "MaterialHole",
"size_x": 16,
"size_y": 16,
"size_z": 16,
"rotation": {
"x": 0,
"y": 0,
"z": 0,
"type": "Rotation"
},
"category": "material_hole",
"model": null,
"barcode": null
},
"data": {
"diameter": 20,
"depth": 10,
"max_sheets": 1,
"info": null
}
},
{
"id": "\u7535\u6c60\u6599\u76d8_materialhole_2_3",
"name": "\u7535\u6c60\u6599\u76d8_materialhole_2_3",
"sample_id": null,
"children": [],
"parent": "\u7535\u6c60\u6599\u76d8",
"type": "container",
"class": "",
"position": {
"x": 60.4,
"y": 32.25,
"z": 10.0
},
"config": {
"type": "MaterialHole",
"size_x": 16,
"size_y": 16,
"size_z": 16,
"rotation": {
"x": 0,
"y": 0,
"z": 0,
"type": "Rotation"
},
"category": "material_hole",
"model": null,
"barcode": null
},
"data": {
"diameter": 20,
"depth": 10,
"max_sheets": 1,
"info": null
}
},
{
"id": "\u7535\u6c60\u6599\u76d8_materialhole_3_0",
"name": "\u7535\u6c60\u6599\u76d8_materialhole_3_0",
"sample_id": null,
"children": [],
"parent": "\u7535\u6c60\u6599\u76d8",
"type": "container",
"class": "",
"position": {
"x": 84.4,
"y": 104.25,
"z": 10.0
},
"config": {
"type": "MaterialHole",
"size_x": 16,
"size_y": 16,
"size_z": 16,
"rotation": {
"x": 0,
"y": 0,
"z": 0,
"type": "Rotation"
},
"category": "material_hole",
"model": null,
"barcode": null
},
"data": {
"diameter": 20,
"depth": 10,
"max_sheets": 1,
"info": null
}
},
{
"id": "\u7535\u6c60\u6599\u76d8_materialhole_3_1",
"name": "\u7535\u6c60\u6599\u76d8_materialhole_3_1",
"sample_id": null,
"children": [],
"parent": "\u7535\u6c60\u6599\u76d8",
"type": "container",
"class": "",
"position": {
"x": 84.4,
"y": 80.25,
"z": 10.0
},
"config": {
"type": "MaterialHole",
"size_x": 16,
"size_y": 16,
"size_z": 16,
"rotation": {
"x": 0,
"y": 0,
"z": 0,
"type": "Rotation"
},
"category": "material_hole",
"model": null,
"barcode": null
},
"data": {
"diameter": 20,
"depth": 10,
"max_sheets": 1,
"info": null
}
},
{
"id": "\u7535\u6c60\u6599\u76d8_materialhole_3_2",
"name": "\u7535\u6c60\u6599\u76d8_materialhole_3_2",
"sample_id": null,
"children": [],
"parent": "\u7535\u6c60\u6599\u76d8",
"type": "container",
"class": "",
"position": {
"x": 84.4,
"y": 56.25,
"z": 10.0
},
"config": {
"type": "MaterialHole",
"size_x": 16,
"size_y": 16,
"size_z": 16,
"rotation": {
"x": 0,
"y": 0,
"z": 0,
"type": "Rotation"
},
"category": "material_hole",
"model": null,
"barcode": null
},
"data": {
"diameter": 20,
"depth": 10,
"max_sheets": 1,
"info": null
}
},
{
"id": "\u7535\u6c60\u6599\u76d8_materialhole_3_3",
"name": "\u7535\u6c60\u6599\u76d8_materialhole_3_3",
"sample_id": null,
"children": [],
"parent": "\u7535\u6c60\u6599\u76d8",
"type": "container",
"class": "",
"position": {
"x": 84.4,
"y": 32.25,
"z": 10.0
},
"config": {
"type": "MaterialHole",
"size_x": 16,
"size_y": 16,
"size_z": 16,
"rotation": {
"x": 0,
"y": 0,
"z": 0,
"type": "Rotation"
},
"category": "material_hole",
"model": null,
"barcode": null
},
"data": {
"diameter": 20,
"depth": 10,
"max_sheets": 1,
"info": null
}
}
],
"links": []
}

View File

@@ -1,750 +0,0 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 22,
"id": "80bc9500",
"metadata": {},
"outputs": [],
"source": [
"from __future__ import annotations\n",
"\n",
"from collections import OrderedDict\n",
"from typing import Any, Dict, List, Optional, TypedDict, Union, cast\n",
"\n",
"from pylabrobot.resources.coordinate import Coordinate\n",
"from pylabrobot.resources.container import Container\n",
"from pylabrobot.resources.deck import Deck\n",
"from pylabrobot.resources.itemized_resource import ItemizedResource\n",
"from pylabrobot.resources.resource import Resource\n",
"from pylabrobot.resources.resource_stack import ResourceStack\n",
"from pylabrobot.resources.tip_rack import TipRack, TipSpot\n",
"from pylabrobot.resources.trash import Trash\n",
"from pylabrobot.resources.utils import create_ordered_items_2d"
]
},
{
"cell_type": "markdown",
"id": "498a9159",
"metadata": {},
"source": [
"物料类型构建"
]
},
{
"cell_type": "code",
"execution_count": 23,
"id": "f4a27241",
"metadata": {},
"outputs": [],
"source": [
"\n",
"class ElectrodeSheetState(TypedDict):\n",
" diameter: float # 直径 (mm)\n",
" thickness: float # 厚度 (mm)\n",
" mass: float # 质量 (g)\n",
" material_type: str # 材料类型(正极、负极、隔膜、弹片、垫片、铝箔等)\n",
" info: Optional[str] # 附加信息\n",
"\n",
"class ElectrodeSheet(Resource):\n",
" \"\"\"极片类 - 包含正负极片、隔膜、弹片、垫片、铝箔等所有片状材料\"\"\"\n",
"\n",
" def __init__(\n",
" self,\n",
" name: str = \"极片\",\n",
" size_x=10,\n",
" size_y=10,\n",
" size_z=10,\n",
" category: str = \"electrode_sheet\",\n",
" model: Optional[str] = None,\n",
" ):\n",
" \"\"\"初始化极片\n",
"\n",
" Args:\n",
" name: 极片名称\n",
" category: 类别\n",
" model: 型号\n",
" \"\"\"\n",
" super().__init__(\n",
" name=name,\n",
" size_x=size_x,\n",
" size_y=size_y,\n",
" size_z=size_z,\n",
" category=category,\n",
" model=model,\n",
" )\n",
" self._unilabos_state: ElectrodeSheetState = ElectrodeSheetState(\n",
" diameter=14,\n",
" thickness=0.1,\n",
" mass=0.5,\n",
" material_type=\"copper\",\n",
" info=None\n",
" )\n",
"\n",
" # TODO: 这个还要不要给self._unilabos_state赋值的\n",
" def load_state(self, state: Dict[str, Any]) -> None:\n",
" \"\"\"格式不变\"\"\"\n",
" super().load_state(state)\n",
" self._unilabos_state = state\n",
" #序列化\n",
" def serialize_state(self) -> Dict[str, Dict[str, Any]]:\n",
" \"\"\"格式不变\"\"\"\n",
" data = super().serialize_state()\n",
" data.update(self._unilabos_state) # Container自身的信息云端物料将保存这一data本地也通过这里的data进行读写当前类用来表示这个物料的长宽高大小的属性而datastate用来表示物料的内容细节等\n",
" return data\n"
]
},
{
"cell_type": "code",
"execution_count": 24,
"id": "830f052e",
"metadata": {},
"outputs": [],
"source": [
"# TODO: 这个应该只能放一个极片\n",
"class MaterialHoleState(TypedDict):\n",
" diameter: int\n",
" depth: int\n",
" max_sheets: int\n",
" info: Optional[str] # 附加信息\n",
"\n",
"class MaterialHole(Resource):\n",
" \"\"\"料板洞位类\"\"\"\n",
" children: List[ElectrodeSheet] = []\n",
"\n",
" def __init__(\n",
" self,\n",
" name: str,\n",
" size_x: float,\n",
" size_y: float,\n",
" size_z: float,\n",
" category: str = \"material_hole\",\n",
" **kwargs\n",
" ):\n",
" super().__init__(\n",
" name=name,\n",
" size_x=size_x,\n",
" size_y=size_y,\n",
" size_z=size_z,\n",
" category=category,\n",
" )\n",
" self._unilabos_state: MaterialHoleState = MaterialHoleState(\n",
" diameter=20,\n",
" depth=10,\n",
" max_sheets=1,\n",
" info=None\n",
" )\n",
"\n",
" def get_all_sheet_info(self):\n",
" info_list = []\n",
" for sheet in self.children:\n",
" info_list.append(sheet._unilabos_state[\"info\"])\n",
" return info_list\n",
" \n",
" #这个函数函数好像没用,一般不会集中赋值质量\n",
" def set_all_sheet_mass(self):\n",
" for sheet in self.children:\n",
" sheet._unilabos_state[\"mass\"] = 0.5 # 示例设置质量为0.5g\n",
"\n",
" def load_state(self, state: Dict[str, Any]) -> None:\n",
" \"\"\"格式不变\"\"\"\n",
" super().load_state(state)\n",
" self._unilabos_state = state\n",
"\n",
" def serialize_state(self) -> Dict[str, Dict[str, Any]]:\n",
" \"\"\"格式不变\"\"\"\n",
" data = super().serialize_state()\n",
" data.update(self._unilabos_state) # Container自身的信息云端物料将保存这一data本地也通过这里的data进行读写当前类用来表示这个物料的长宽高大小的属性而datastate用来表示物料的内容细节等\n",
" return data\n",
" #移动极片前先取出对象\n",
" def get_sheet_with_name(self, name: str) -> Optional[ElectrodeSheet]:\n",
" for sheet in self.children:\n",
" if sheet.name == name:\n",
" return sheet\n",
" return None\n",
"\n",
" def has_electrode_sheet(self) -> bool:\n",
" \"\"\"检查洞位是否有极片\"\"\"\n",
" return len(self.children) > 0\n",
"\n",
" def assign_child_resource(\n",
" self,\n",
" resource: ElectrodeSheet,\n",
" location: Optional[Coordinate],\n",
" reassign: bool = True,\n",
" ):\n",
" \"\"\"放置极片\"\"\"\n",
" # TODO: 这里要改diameter找不到加入._unilabos_state后应该没问题\n",
" if resource._unilabos_state[\"diameter\"] > self._unilabos_state[\"diameter\"]:\n",
" raise ValueError(f\"极片直径 {resource._unilabos_state['diameter']} 超过洞位直径 {self._unilabos_state['diameter']}\")\n",
" if len(self.children) >= self._unilabos_state[\"max_sheets\"]:\n",
" raise ValueError(f\"洞位已满,无法放置更多极片\")\n",
" super().assign_child_resource(resource, location, reassign)\n",
"\n",
" # 根据children的编号取物料对象。\n",
" def get_electrode_sheet_info(self, index: int) -> ElectrodeSheet:\n",
" return self.children[index]\n",
"\n",
"\n",
"#料板\n",
"class MaterialPlateState(TypedDict):\n",
" hole_spacing_x: float\n",
" hole_spacing_y: float\n",
" hole_diameter: float\n",
" info: Optional[str] # 附加信息\n",
"\n",
"class MaterialPlate(ItemizedResource[MaterialHole]):\n",
" \"\"\"料板类 - 4x4个洞位每个洞位放1个极片\"\"\"\n",
" \n",
" children: List[MaterialHole]\n",
"\n",
" def __init__(\n",
" self,\n",
" name: str,\n",
" size_x: float,\n",
" size_y: float,\n",
" size_z: float,\n",
" ordered_items: Optional[Dict[str, MaterialHole]] = None,\n",
" ordering: Optional[OrderedDict[str, str]] = None,\n",
" category: str = \"material_plate\",\n",
" model: Optional[str] = None,\n",
" fill: bool = False\n",
" ):\n",
" \"\"\"初始化料板\n",
"\n",
" Args:\n",
" name: 料板名称\n",
" size_x: 长度 (mm)\n",
" size_y: 宽度 (mm)\n",
" size_z: 高度 (mm)\n",
" hole_diameter: 洞直径 (mm)\n",
" hole_depth: 洞深度 (mm)\n",
" hole_spacing_x: X方向洞位间距 (mm)\n",
" hole_spacing_y: Y方向洞位间距 (mm)\n",
" number: 编号\n",
" category: 类别\n",
" model: 型号\n",
" \"\"\"\n",
" self._unilabos_state: MaterialPlateState = MaterialPlateState(\n",
" hole_spacing_x=24.0,\n",
" hole_spacing_y=24.0,\n",
" hole_diameter=20.0,\n",
" info=\"\",\n",
" )\n",
" # 创建4x4的洞位\n",
" # TODO: 这里要改,对应不同形状\n",
" holes = create_ordered_items_2d(\n",
" klass=MaterialHole,\n",
" num_items_x=4,\n",
" num_items_y=4,\n",
" dx=(size_x - 4 * self._unilabos_state[\"hole_spacing_x\"]) / 2, # 居中\n",
" dy=(size_y - 4 * self._unilabos_state[\"hole_spacing_y\"]) / 2, # 居中\n",
" dz=size_z,\n",
" item_dx=self._unilabos_state[\"hole_spacing_x\"],\n",
" item_dy=self._unilabos_state[\"hole_spacing_y\"],\n",
" size_x = 16,\n",
" size_y = 16,\n",
" size_z = 16,\n",
" )\n",
" if fill:\n",
" super().__init__(\n",
" name=name,\n",
" size_x=size_x,\n",
" size_y=size_y,\n",
" size_z=size_z,\n",
" ordered_items=holes,\n",
" category=category,\n",
" model=model,\n",
" )\n",
" else:\n",
" super().__init__(\n",
" name=name,\n",
" size_x=size_x,\n",
" size_y=size_y,\n",
" size_z=size_z,\n",
" ordered_items=ordered_items,\n",
" ordering=ordering,\n",
" category=category,\n",
" model=model,\n",
" )\n",
"\n",
" def update_locations(self):\n",
" # TODO:调多次相加\n",
" holes = create_ordered_items_2d(\n",
" klass=MaterialHole,\n",
" num_items_x=4,\n",
" num_items_y=4,\n",
" dx=(self._size_x - 3 * self._unilabos_state[\"hole_spacing_x\"]) / 2, # 居中\n",
" dy=(self._size_y - 3 * self._unilabos_state[\"hole_spacing_y\"]) / 2, # 居中\n",
" dz=self._size_z,\n",
" item_dx=self._unilabos_state[\"hole_spacing_x\"],\n",
" item_dy=self._unilabos_state[\"hole_spacing_y\"],\n",
" size_x = 1,\n",
" size_y = 1,\n",
" size_z = 1,\n",
" )\n",
" for item, original_item in zip(holes.items(), self.children):\n",
" original_item.location = item[1].location"
]
},
{
"cell_type": "code",
"execution_count": 25,
"id": "8318ccca",
"metadata": {},
"outputs": [],
"source": [
"class CoincellDeck(Deck):\n",
" \"\"\"纽扣电池组装工作站台面类\"\"\"\n",
"\n",
" def __init__(\n",
" self,\n",
" name: str = \"coin_cell_deck\",\n",
" size_x: float = 1620.0, # 3.66m\n",
" size_y: float = 1270.0, # 1.23m\n",
" size_z: float = 500.0,\n",
" origin: Coordinate = Coordinate(0, 0, 0),\n",
" category: str = \"coin_cell_deck\",\n",
" ):\n",
" \"\"\"初始化纽扣电池组装工作站台面\n",
"\n",
" Args:\n",
" name: 台面名称\n",
" size_x: 长度 (mm) - 3.66m\n",
" size_y: 宽度 (mm) - 1.23m\n",
" size_z: 高度 (mm)\n",
" origin: 原点坐标\n",
" category: 类别\n",
" \"\"\"\n",
" super().__init__(\n",
" name=name,\n",
" size_x=size_x,\n",
" size_y=size_y,\n",
" size_z=size_z,\n",
" origin=origin,\n",
" category=category,\n",
" )"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "c73bae21",
"metadata": {},
"outputs": [],
"source": [
"import json"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "3369a1dd",
"metadata": {},
"outputs": [],
"source": [
"def upload_resources_to_unilab(wuliao: List[Resource]):\n",
" from unilabos.resources.graphio import convert_resources_from_type\n",
" from unilabos.config.config import BasicConfig \n",
" BasicConfig.ak = \"beb0c15f-2279-46a1-aba5-00eaf89aef55\"\n",
" BasicConfig.sk = \"15d4f25e-3512-4f9c-9bfb-43ab85e7b561\"\n",
" from unilabos.app.web.client import http_client\n",
" resources = convert_resources_from_type(wuliao, [Resource])\n",
" json.dump({\"nodes\": resources, \"links\": []}, open(\"button_battery_station_resources_unilab.json\", \"w\"), indent=2)\n",
" \n",
" #print(resources)\n",
" http_client.remote_addr = \"https://uni-lab.test.bohrium.com/api/v1\"\n",
" \n",
" http_client.resource_add(resources)"
]
},
{
"cell_type": "code",
"execution_count": 29,
"id": "1543ddab",
"metadata": {},
"outputs": [],
"source": [
"liaopan1 = MaterialPlate(name=\"liaopan1\", size_x=120.8, size_y=120.5, size_z=10.0, fill=True)"
]
},
{
"cell_type": "code",
"execution_count": 30,
"id": "b732754a",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"MaterialPlate(name=liaopan1, size_x=120.8, size_y=120.5, size_z=10.0, location=None)\n"
]
}
],
"source": [
"print(liaopan1)"
]
},
{
"cell_type": "code",
"execution_count": 31,
"id": "7e6e7252",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[MaterialHole(name=liaopan1_materialhole_0_0, location=Coordinate(012.400, 084.250, 010.000), size_x=16, size_y=16, size_z=16, category=material_hole), MaterialHole(name=liaopan1_materialhole_0_1, location=Coordinate(012.400, 060.250, 010.000), size_x=16, size_y=16, size_z=16, category=material_hole), MaterialHole(name=liaopan1_materialhole_0_2, location=Coordinate(012.400, 036.250, 010.000), size_x=16, size_y=16, size_z=16, category=material_hole), MaterialHole(name=liaopan1_materialhole_0_3, location=Coordinate(012.400, 012.250, 010.000), size_x=16, size_y=16, size_z=16, category=material_hole), MaterialHole(name=liaopan1_materialhole_1_0, location=Coordinate(036.400, 084.250, 010.000), size_x=16, size_y=16, size_z=16, category=material_hole), MaterialHole(name=liaopan1_materialhole_1_1, location=Coordinate(036.400, 060.250, 010.000), size_x=16, size_y=16, size_z=16, category=material_hole), MaterialHole(name=liaopan1_materialhole_1_2, location=Coordinate(036.400, 036.250, 010.000), size_x=16, size_y=16, size_z=16, category=material_hole), MaterialHole(name=liaopan1_materialhole_1_3, location=Coordinate(036.400, 012.250, 010.000), size_x=16, size_y=16, size_z=16, category=material_hole), MaterialHole(name=liaopan1_materialhole_2_0, location=Coordinate(060.400, 084.250, 010.000), size_x=16, size_y=16, size_z=16, category=material_hole), MaterialHole(name=liaopan1_materialhole_2_1, location=Coordinate(060.400, 060.250, 010.000), size_x=16, size_y=16, size_z=16, category=material_hole), MaterialHole(name=liaopan1_materialhole_2_2, location=Coordinate(060.400, 036.250, 010.000), size_x=16, size_y=16, size_z=16, category=material_hole), MaterialHole(name=liaopan1_materialhole_2_3, location=Coordinate(060.400, 012.250, 010.000), size_x=16, size_y=16, size_z=16, category=material_hole), MaterialHole(name=liaopan1_materialhole_3_0, location=Coordinate(084.400, 084.250, 010.000), size_x=16, size_y=16, size_z=16, category=material_hole), MaterialHole(name=liaopan1_materialhole_3_1, location=Coordinate(084.400, 060.250, 010.000), size_x=16, size_y=16, size_z=16, category=material_hole), MaterialHole(name=liaopan1_materialhole_3_2, location=Coordinate(084.400, 036.250, 010.000), size_x=16, size_y=16, size_z=16, category=material_hole), MaterialHole(name=liaopan1_materialhole_3_3, location=Coordinate(084.400, 012.250, 010.000), size_x=16, size_y=16, size_z=16, category=material_hole)]\n"
]
}
],
"source": [
"print(liaopan1.children)"
]
},
{
"cell_type": "code",
"execution_count": 26,
"id": "836ff68d",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"\u001b[37m25-09-22 [15:15:08,950]\u001b[0m \u001b[1;36m[DEBUG]\u001b[0m \u001b[37mStarting new HTTPS connection (1): uni-lab.test.bohrium.com:443\u001b[37m [_new_conn:1049] [urllib3.connectionpool.connectionpool]\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"CoincellDeck(name=coin_cell_deck, location=Coordinate(000.000, 000.000, 000.000), size_x=1620.0, size_y=1270.0, size_z=500.0, category=coin_cell_deck)\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_plate\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_plate\n",
"转换pylabrobot的时候出现未知类型 coin_cell_deck\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"\u001b[37m25-09-22 [15:15:09,218]\u001b[0m \u001b[1;36m[DEBUG]\u001b[0m \u001b[37mhttps://uni-lab.test.bohrium.com:443 \"POST /api/v1/lab/material HTTP/1.1\" 200 10\u001b[37m [_make_request:544] [urllib3.connectionpool.connectionpool]\u001b[0m\n"
]
}
],
"source": [
"deck = CoincellDeck()\n",
"#创建一个4*4的物料板\n",
"liaopan1 = MaterialPlate(name=\"liaopan1\", size_x=120.8, size_y=120.5, size_z=10.0, fill=True)\n",
"#把物料板放到桌子上\n",
"deck.assign_child_resource(liaopan1, Coordinate(x=0, y=0, z=0))\n",
"#创建一个极片\n",
"for i in range(16):\n",
" jipian = ElectrodeSheet(name=f\"jipian_{i}\", size_x= 12, size_y=12, size_z=0.1)\n",
" liaopan1.children[i].assign_child_resource(jipian, location=None)\n",
"#创建一个4*4的物料板\n",
"liaopan2 = MaterialPlate(name=\"liaopan2\", size_x=120.8, size_y=120.5, size_z=10.0, fill=True)\n",
"#把物料板放到桌子上\n",
"deck.assign_child_resource(liaopan2, Coordinate(x=500, y=0, z=0))\n",
"#liaopan.children[3].assign_child_resource(jipian, location=None)\n",
"print(deck)\n",
"\n",
"upload_resources_to_unilab([deck])"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "00aab9cf",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"MaterialPlate(name=liaopan1, size_x=120.8, size_y=120.5, size_z=10.0, location=Coordinate(000.000, 000.000, 000.000))\n"
]
}
],
"source": [
"liaopan1 = deck.get_resource(\"liaopan1\")\n",
"print(liaopan1)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "7409969c",
"metadata": {},
"outputs": [],
"source": [
"liaopan1 = deck.get_resource(\"liaopan1\")\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "096dde04",
"metadata": {},
"outputs": [],
"source": [
"print()"
]
},
{
"cell_type": "code",
"execution_count": 27,
"id": "5528df96",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"\u001b[37m25-09-22 [15:17:44,322]\u001b[0m \u001b[1;36m[DEBUG]\u001b[0m \u001b[37mStarting new HTTPS connection (1): uni-lab.test.bohrium.com:443\u001b[37m [_new_conn:1049] [urllib3.connectionpool.connectionpool]\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"ElectrodeSheet(name=jipian_1, location=None, size_x=12, size_y=12, size_z=0.1, category=electrode_sheet)\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_plate\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_plate\n",
"转换pylabrobot的时候出现未知类型 coin_cell_deck\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"\u001b[37m25-09-22 [15:17:44,599]\u001b[0m \u001b[1;36m[DEBUG]\u001b[0m \u001b[37mhttps://uni-lab.test.bohrium.com:443 \"POST /api/v1/lab/material HTTP/1.1\" 200 10\u001b[37m [_make_request:544] [urllib3.connectionpool.connectionpool]\u001b[0m\n"
]
}
],
"source": [
"#在台面上找到料盘和极片\n",
"liaopan1 = deck.get_resource(\"liaopan1\")\n",
"liaopan2 = deck.get_resource(\"liaopan2\")\n",
"jipian1 = liaopan1.children[1].children[0]\n",
"#\n",
"print(jipian1)\n",
"#把物料解绑后放到另一盘上\n",
"jipian1.parent.unassign_child_resource(jipian1)\n",
"liaopan2.children[1].assign_child_resource(jipian1, location=None)\n",
"#print(jipian2.parent)\n",
"upload_resources_to_unilab([deck])"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "43736700",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"\u001b[37m25-09-22 [14:31:50,027]\u001b[0m \u001b[1;36m[DEBUG]\u001b[0m \u001b[37mStarting new HTTPS connection (1): uni-lab.test.bohrium.com:443\u001b[37m [_new_conn:1049] [urllib3.connectionpool.connectionpool]\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_plate\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 electrode_sheet\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_hole\n",
"转换pylabrobot的时候出现未知类型 material_plate\n",
"转换pylabrobot的时候出现未知类型 coin_cell_deck\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"\u001b[37m25-09-22 [14:31:50,358]\u001b[0m \u001b[1;36m[DEBUG]\u001b[0m \u001b[37mhttps://uni-lab.test.bohrium.com:443 \"POST /api/v1/lab/material HTTP/1.1\" 200 10\u001b[37m [_make_request:544] [urllib3.connectionpool.connectionpool]\u001b[0m\n"
]
},
{
"data": {
"text/plain": [
"<Response [200]>"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "unilab",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.11"
}
},
"nbformat": 4,
"nbformat_minor": 5
}