53
53
DARK_DURATION = 1
54
54
55
55
USER_PRESSURE = {
56
- "Step1 " : {"pressure" : 0.02 , "duration" : 60 },
57
- "Step2 " : {"pressure" : 0.06 , "duration" : 60 },
58
- "Step3 " : {"pressure" : 0.02 , "duration" : 180 },
59
- "Step4 " : {"pressure" : 0.03 , "duration" : 60 },
60
- "Step5 " : {"pressure" : 0.03 , "duration" : 60 },
61
- "Step6_1 " : {"pressure" : 0.04 , "duration" : 20 },
62
- "Step6_2 " : {"pressure" : 0.04 , "duration" : 20 },
63
- "Step6_3 " : {"pressure" : 0.04 , "duration" : 60 },
64
- "Step7 " : {"pressure" : 0.05 , "duration" : 40 },
65
- "Step8_1 " : {"pressure" : 0.04 , "duration" : 16 },
66
- "Step8_2 " : {"pressure" : 0.02 , "duration" : 5 },
67
- "Step9 " : {"pressure" : 0.04 , "duration" : 100 },
68
- "Step10 " : {"pressure" : 0.07 , "duration" : 60 },
69
- "Step11 " : {"pressure" : 0.07 , "duration" : 60 },
70
- "Step12 " : {"pressure" : 0.03 , "duration" : 60 },
56
+ "step1 " : {"pressure" : 0.02 , "duration" : 60 },
57
+ "step2 " : {"pressure" : 0.06 , "duration" : 60 },
58
+ "step3 " : {"pressure" : 0.02 , "duration" : 180 },
59
+ "step4 " : {"pressure" : 0.03 , "duration" : 60 },
60
+ "step5 " : {"pressure" : 0.03 , "duration" : 60 },
61
+ "step6_1 " : {"pressure" : 0.04 , "duration" : 20 },
62
+ "step6_2 " : {"pressure" : 0.04 , "duration" : 20 },
63
+ "step6_3 " : {"pressure" : 0.04 , "duration" : 60 },
64
+ "step7 " : {"pressure" : 0.05 , "duration" : 40 },
65
+ "step8_1 " : {"pressure" : 0.04 , "duration" : 16 },
66
+ "step8_2 " : {"pressure" : 0.02 , "duration" : 5 },
67
+ "step9 " : {"pressure" : 0.04 , "duration" : 100 },
68
+ "step10 " : {"pressure" : 0.07 , "duration" : 60 },
69
+ "step11 " : {"pressure" : 0.07 , "duration" : 60 },
70
+ "step12 " : {"pressure" : 0.03 , "duration" : 60 },
71
71
72
72
}
73
73
@@ -90,7 +90,6 @@ class UserMode(Enum):
90
90
Debugging = 1
91
91
Running = 2
92
92
93
-
94
93
class BayOmicsLib :
95
94
@classmethod
96
95
def get_com_list (cls ):
@@ -102,7 +101,7 @@ def __init__(self, baud, protocol):
102
101
self .port = None
103
102
self .device = None
104
103
self .protocol : protocol_api .ProtocolContext = protocol
105
- self .simulate = False
104
+ self .simulate = True
106
105
self .led_virtual = True
107
106
self .verify = True
108
107
self .explain_flag = True
@@ -119,19 +118,19 @@ def print_f(self, msg):
119
118
120
119
def build_connection (self , simulating , led_virtual , user_pwd ):
121
120
res = BayOmicsLib .get_com_list ()
121
+ self .simulate = simulating
122
122
self .print_f ("=" * 5 + "PORT LIST" + "=" * 5 )
123
123
for index , p in enumerate (res ):
124
124
self .print_f (f"{ index + 1 } >>{ p .device } " )
125
125
# select = input("Select Port Number(输入串口号对应的数字):")
126
126
select = str (SERIAL_DEVICE_INDEX )
127
127
if self .port is None :
128
- if len (res ) == 0 :
128
+ if len (res ) == 0 or self . simulate is True :
129
129
self .port = "None"
130
+ self .device = None
131
+ return
130
132
else :
131
133
self .port = res [int (select .strip ()) - 1 ].device
132
- if self .port == "None" :
133
- self .device = None
134
- return
135
134
self .device = serial .Serial (self .port , self .baud , parity = serial .PARITY_NONE , stopbits = serial .STOPBITS_ONE ,
136
135
bytesize = serial .EIGHTBITS , timeout = 1 )
137
136
if self .device .isOpen ():
@@ -141,7 +140,7 @@ def build_connection(self, simulating, led_virtual, user_pwd):
141
140
self .device .parity = serial .PARITY_NONE # 无校验
142
141
self .device .stopbits = serial .STOPBITS_ONE # 停止位 1
143
142
# init
144
- self . simulate = simulating
143
+
145
144
auth = _auth (user_pwd )
146
145
if auth :
147
146
self .led_virtual = led_virtual
@@ -658,27 +657,8 @@ def release_device(self):
658
657
self .close_device ()
659
658
self .set_lights (False )
660
659
661
- def init_loop (self ):
662
- """
663
- run main
664
- :return:
665
- """
666
- """ 一、串口连接
667
- 1. 连接串口
668
- 2. 初始化led
669
- """
670
- self .build_connection ()
671
- self .init_led ()
672
-
673
- """ 二、初始化
674
- 1. 使能电机,初始化速度和复位
675
- 2. 关闭加压
676
- 3. 关闭温度控制器
677
- """
678
- self .init_device ()
679
-
680
660
681
- def _transfer_user_liquid (pipette : protocol_api .InstrumentContext , liquid_labware : protocol_api .Labware ,
661
+ def transfer_user_liquid (pipette : protocol_api .InstrumentContext , liquid_labware : protocol_api .Labware ,
682
662
customer_labware : protocol_api .labware , customer_labware_pos : str , liquid_name : str ,
683
663
volume : float , move_location : protocol_api .Labware , pick_up = False , drop = False ):
684
664
"""
@@ -723,6 +703,8 @@ def _drop_tip():
723
703
assert aspirate_flag , "Aspirate liquid fail"
724
704
pipette .dispense (SINGLE_VOLUME , customer_labware [customer_labware_pos ])
725
705
pipette .blow_out (customer_labware [customer_labware_pos ])
706
+ if liquid_name == 'Ac' or liquid_name == 'Et' :
707
+ pipette .touch_tip (speed = 30 )
726
708
727
709
if _trans_last_volume > 0 :
728
710
if liquid_name != "Sample" and liquid_name != "Enzyme" :
@@ -738,6 +720,8 @@ def _drop_tip():
738
720
assert aspirate_flag , "Aspirate liquid fail"
739
721
pipette .dispense (_trans_last_volume , customer_labware [customer_labware_pos ])
740
722
pipette .blow_out (customer_labware [customer_labware_pos ])
723
+ if liquid_name == 'Ac' or liquid_name == 'Et' :
724
+ pipette .touch_tip (speed = 30 )
741
725
_drop_tip ()
742
726
743
727
@@ -779,7 +763,7 @@ def transform_round(pipette: protocol_api.InstrumentContext, liquid_labware: pro
779
763
else :
780
764
drop = True
781
765
pick_up = True
782
- _transfer_user_liquid (pipette , liquid_labware , customer_labware , f'A{ i + 1 } ' , liquid_name , volume , move_location ,
766
+ transfer_user_liquid (pipette , liquid_labware , customer_labware , f'A{ i + 1 } ' , liquid_name , volume , move_location ,
783
767
pick_up = pick_up , drop = drop )
784
768
if drop_method == DropMethod .DoNotDrop :
785
769
pipette .move_to (move_location ['A1' ].top (z = 50 ))
0 commit comments