This commit is contained in:
gac-S_Changer
2018-09-20 18:07:54 +02:00
parent e82c487e33
commit 7deba9eee4
16 changed files with 3895 additions and 95 deletions

View File

@@ -11,4 +11,12 @@ def get_puck_info():
def get_puck_obj(address):
return BasePlate.getChild(address)
return BasePlate.getChild(address)
def get_puck_obj_by_id(puck_id):
for puck in BasePlate.pucks:
if puck.id == puck_id:
return puck
return None

View File

@@ -2,7 +2,7 @@ import json
import org.python.core.PyDictionary as PyDictionary
SAMPLE_INFO_KEYS = ["userName", "dewarName", "puckName", "puckBarcode", "puckType", "puckAddress",
"sampleName", "samplePosition", "sampleStatus", "sampleMountCount"]
"sampleName", "samplePosition", "sampleBarcode", "sampleStatus", "sampleMountCount"]
samples_info = []
@@ -103,7 +103,10 @@ def reset_puck_datamatrix(puck = None):
for si in samples_info:
if (si["puckAddress"] == puck) or (puck is None):
si["puckAddress"] = ""
save_samples_info()
save_samples_info()
for p in BasePlate.getChildren():
if (p.name == puck) or (puck is None):
p.id = None
def get_puck_datamatrix():
ret = {}
@@ -130,7 +133,8 @@ def update_puck_table():
#Sample mount/unmount
def update_samples_info_sample_mount(puck_address, sample_position, sample_detected):
def update_samples_info_sample_mount(puck_address, sample_position, sample_detected, sample_id):
print ""
try:
if (samples_info is not None) and (puck_address is not None):
for si in samples_info:
@@ -145,6 +149,10 @@ def update_samples_info_sample_mount(puck_address, sample_position, sample_detec
si["sampleMountCount"] = mount_count + 1
else:
si["sampleStatus"] = "Unknown"
if sample_id is not None:
si["sampleBarcode"] = sample_id
save_samples_info()
return
except:
@@ -172,6 +180,7 @@ test_sample_data = [ \
"puckAddress": "A1",\
"sampleName": "MySample 1", \
"samplePosition": 1,\
"sampleBarcode": "", \
"sampleStatus": "Present", \
"sampleMountCount": 0,
} , \
@@ -183,6 +192,7 @@ test_sample_data = [ \
"puckAddress": "A1",\
"sampleName": "MySample 2", \
"samplePosition": 2,\
"sampleBarcode": "", \
"sampleStatus": "Present", \
"sampleMountCount": 0,
} , \
@@ -194,6 +204,7 @@ test_sample_data = [ \
"puckAddress": "A1",\
"sampleName": "MySample 3", \
"samplePosition": 3,\
"sampleBarcode": "", \
"sampleStatus": "Present", \
"sampleMountCount": 0,
} , \
@@ -205,6 +216,7 @@ test_sample_data = [ \
"puckAddress": "A1",\
"sampleName": "MySample 4", \
"samplePosition": 4,\
"sampleBarcode": "", \
"sampleStatus": "Present", \
"sampleMountCount": 0,
} , \
@@ -215,6 +227,7 @@ test_sample_data = [ \
"puckType": "unipuck", \
"puckAddress": "A1",\
"sampleName": "MySample 5", \
"sampleBarcode": "", \
"samplePosition": 5,\
"sampleStatus": "Present", \
"sampleMountCount": 0,
@@ -228,6 +241,7 @@ test_sample_data = [ \
"puckAddress": "C2",\
"sampleName": "MySample 1", \
"samplePosition": 1,\
"sampleBarcode": "", \
"sampleStatus": "Present", \
"sampleMountCount": 0,
} , \
@@ -239,6 +253,7 @@ test_sample_data = [ \
"puckAddress": "C2",\
"sampleName": "MySample 2", \
"samplePosition": 2,\
"sampleBarcode": "", \
"sampleStatus": "Present", \
"sampleMountCount": 0,
} , \
@@ -250,6 +265,7 @@ test_sample_data = [ \
"puckAddress": "C2",\
"sampleName": "MySample 3", \
"samplePosition": 3,\
"sampleBarcode": "", \
"sampleStatus": "Present", \
"sampleMountCount": 0,
} , \
@@ -261,6 +277,7 @@ test_sample_data = [ \
"puckAddress": "C2",\
"sampleName": "MySample 4", \
"samplePosition": 4,\
"sampleBarcode": "", \
"sampleStatus": "Present", \
"sampleMountCount": 0,
} , \
@@ -272,6 +289,7 @@ test_sample_data = [ \
"puckAddress": "C2",\
"sampleName": "MySample 5", \
"samplePosition": 5,\
"sampleBarcode": "", \
"sampleStatus": "Present", \
"sampleMountCount": 0,
} , \