Skip to content

Commit 1201a73

Browse files
author
andy
committed
release bayomics 1.4.8
1 parent bda8149 commit 1201a73

File tree

7 files changed

+38
-53
lines changed

7 files changed

+38
-53
lines changed

oem_projects/bayOmics/Lib/BayOmicsLib.egg-info/PKG-INFO

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.1
22
Name: BayOmicsLib
3-
Version: 1.4.4
3+
Version: 1.4.8
44
Summary: UNKNOWN
55
Home-page: UNKNOWN
66
License: UNKNOWN

oem_projects/bayOmics/Lib/BayOmicsLib.py

Lines changed: 27 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,21 @@
5353
DARK_DURATION = 1
5454

5555
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},
7171

7272
}
7373

@@ -90,7 +90,6 @@ class UserMode(Enum):
9090
Debugging = 1
9191
Running = 2
9292

93-
9493
class BayOmicsLib:
9594
@classmethod
9695
def get_com_list(cls):
@@ -102,7 +101,7 @@ def __init__(self, baud, protocol):
102101
self.port = None
103102
self.device = None
104103
self.protocol: protocol_api.ProtocolContext = protocol
105-
self.simulate = False
104+
self.simulate = True
106105
self.led_virtual = True
107106
self.verify = True
108107
self.explain_flag = True
@@ -119,19 +118,19 @@ def print_f(self, msg):
119118

120119
def build_connection(self, simulating, led_virtual, user_pwd):
121120
res = BayOmicsLib.get_com_list()
121+
self.simulate = simulating
122122
self.print_f("=" * 5 + "PORT LIST" + "=" * 5)
123123
for index, p in enumerate(res):
124124
self.print_f(f"{index + 1} >>{p.device}")
125125
# select = input("Select Port Number(输入串口号对应的数字):")
126126
select = str(SERIAL_DEVICE_INDEX)
127127
if self.port is None:
128-
if len(res) == 0:
128+
if len(res) == 0 or self.simulate is True:
129129
self.port = "None"
130+
self.device = None
131+
return
130132
else:
131133
self.port = res[int(select.strip()) - 1].device
132-
if self.port == "None":
133-
self.device = None
134-
return
135134
self.device = serial.Serial(self.port, self.baud, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE,
136135
bytesize=serial.EIGHTBITS, timeout=1)
137136
if self.device.isOpen():
@@ -141,7 +140,7 @@ def build_connection(self, simulating, led_virtual, user_pwd):
141140
self.device.parity = serial.PARITY_NONE # 无校验
142141
self.device.stopbits = serial.STOPBITS_ONE # 停止位 1
143142
# init
144-
self.simulate = simulating
143+
145144
auth = _auth(user_pwd)
146145
if auth:
147146
self.led_virtual = led_virtual
@@ -658,27 +657,8 @@ def release_device(self):
658657
self.close_device()
659658
self.set_lights(False)
660659

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-
680660

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,
682662
customer_labware: protocol_api.labware, customer_labware_pos: str, liquid_name: str,
683663
volume: float, move_location: protocol_api.Labware, pick_up=False, drop=False):
684664
"""
@@ -723,6 +703,8 @@ def _drop_tip():
723703
assert aspirate_flag, "Aspirate liquid fail"
724704
pipette.dispense(SINGLE_VOLUME, customer_labware[customer_labware_pos])
725705
pipette.blow_out(customer_labware[customer_labware_pos])
706+
if liquid_name == 'Ac' or liquid_name == 'Et':
707+
pipette.touch_tip(speed=30)
726708

727709
if _trans_last_volume > 0:
728710
if liquid_name != "Sample" and liquid_name != "Enzyme":
@@ -738,6 +720,8 @@ def _drop_tip():
738720
assert aspirate_flag, "Aspirate liquid fail"
739721
pipette.dispense(_trans_last_volume, customer_labware[customer_labware_pos])
740722
pipette.blow_out(customer_labware[customer_labware_pos])
723+
if liquid_name == 'Ac' or liquid_name == 'Et':
724+
pipette.touch_tip(speed=30)
741725
_drop_tip()
742726

743727

@@ -779,7 +763,7 @@ def transform_round(pipette: protocol_api.InstrumentContext, liquid_labware: pro
779763
else:
780764
drop = True
781765
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,
783767
pick_up=pick_up, drop=drop)
784768
if drop_method == DropMethod.DoNotDrop:
785769
pipette.move_to(move_location['A1'].top(z=50))
Binary file not shown.
Binary file not shown.

oem_projects/bayOmics/Lib/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from setuptools import setup
22

33
setup(name='BayOmicsLib',
4-
version='1.4.4',
4+
version='1.4.8',
55
py_modules=['BayOmicsLib'],
66
)

oem_projects/bayOmics/main_protocol.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class UserMode(Enum):
101101
Running = 2
102102

103103

104-
class BasicDriver:
104+
class BayOmicsLib:
105105
@classmethod
106106
def get_com_list(cls):
107107
port_list = serial.tools.list_ports.comports()
@@ -128,7 +128,7 @@ def print_f(self, msg):
128128
self.protocol.comment(msg)
129129

130130
def build_connection(self, simulating, led_virtual, user_pwd):
131-
res = BasicDriver.get_com_list()
131+
res = BayOmicsLib.get_com_list()
132132
self.simulate = simulating
133133
self.print_f("=" * 5 + "PORT LIST" + "=" * 5)
134134
for index, p in enumerate(res):
@@ -715,7 +715,7 @@ def _drop_tip():
715715
pipette.dispense(SINGLE_VOLUME, customer_labware[customer_labware_pos])
716716
pipette.blow_out(customer_labware[customer_labware_pos])
717717
if liquid_name == 'Ac' or liquid_name == 'Et':
718-
pipette.touch_tip()
718+
pipette.touch_tip(speed=30)
719719

720720
if _trans_last_volume > 0:
721721
if liquid_name != "Sample" and liquid_name != "Enzyme":
@@ -732,13 +732,13 @@ def _drop_tip():
732732
pipette.dispense(_trans_last_volume, customer_labware[customer_labware_pos])
733733
pipette.blow_out(customer_labware[customer_labware_pos])
734734
if liquid_name == 'Ac' or liquid_name == 'Et':
735-
pipette.touch_tip()
735+
pipette.touch_tip(speed=30)
736736
_drop_tip()
737737

738738

739739
def transform_round(pipette: protocol_api.InstrumentContext, liquid_labware: protocol_api.Labware,
740740
customer_labware: protocol_api.labware, liquid_name: str, sample_counts: int,
741-
volume: float, move_location: protocol_api.Labware, serial_device: BasicDriver, pressure=None,
741+
volume: float, move_location: protocol_api.Labware, serial_device: BayOmicsLib, pressure=None,
742742
duration=30, drop_method: DropMethod = DropMethod.DropAtLast, protocol=None,
743743
pressure_setting: dict = None):
744744
"""
@@ -923,7 +923,7 @@ def run(protocol: protocol_api.ProtocolContext):
923923
2. 初始化LED屏幕
924924
"""
925925
protocol.comment(">>>>>1.连接串口<<<<<")
926-
serial_module = BasicDriver(19200, protocol)
926+
serial_module = BayOmicsLib(19200, protocol)
927927
serial_module.build_connection(simulating, led_virtual, user_pwd)
928928
serial_module.user_mode = UserMode.Debugging
929929

oem_projects/bayOmics/user_protocol.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
# metadata
1010
metadata = {
11-
"protocolName": "__BayOmicsTemperatureModule__V1.4.5",
11+
"protocolName": "__BayOmicsTemperatureModule__V1.4.8",
1212
"author": "Name <[email protected]>",
1313
"description": "Simple protocol to get started using the OT-2",
1414
}
@@ -124,6 +124,7 @@ def run(protocol: protocol_api.ProtocolContext):
124124
protocol.comment(">>>>>1.连接串口<<<<<")
125125
serial_module = BayOmicsLib(19200, protocol)
126126
serial_module.build_connection(simulating, led_virtual, user_pwd)
127+
serial_module.user_mode = UserMode.Debugging
127128

128129
if serial_module.device is not None:
129130
protocol.comment(">>>>>2.初始化设备<<<<<")
@@ -231,6 +232,6 @@ def run(protocol: protocol_api.ProtocolContext):
231232
transform_round(left_pipette, customer_liquid, user_labware, "Et", sample_counts, 60, move_to_location,
232233
serial_module, pressure_setting=USER_PRESSURE['step12'])
233234
protocol.pause("实验结束...恢复即将复位设备...")
234-
if serial_module.device is not None:
235+
235236
protocol.comment(">>>>>4.实验结束<<<<<")
236237
serial_module.release_device()

0 commit comments

Comments
 (0)