"stacking_above": u"1", "plate_width": u"85.48", "general_name": u"4titude 0203 384 Well ", }, ] ] plateOrder = [plate.id_barcode for plate in plateData] plateOrder.sort() ### ### BARCODE PRINTING ### # Read template from momentum psr = Momentum.readMomentum("PTT Barcode Label.txt") plateTypeData = { plate.id_barcode: { "PlateType": '"' + plate.id_barcode + '"', "Size": '"' + str(plate.plate_type) + '"', "Dropstage": plate.flange_dropstage, "Descriptor": '"' + plate.general_name + '"', "Bottomread": plate.plate_bottom_read, } for plate in plateData } # Add bottomread as a varible of type Boolean / existing variables are not overwritten psr.add_variable("Bottomread", "Boolean")
""" if __name__ == '__main__': pass from klaatu.components.momentum.momentum import Momentum import copy from lxml import etree, objectify # print cv.xml_to_python(cv.momentum_to_xml(source)) # create a psr object fom a Momentum source file, readXML is also possible although this is my own XML specification # and is mainly used as an intermediate step to parse into a python object psr = Momentum.readMomentum("components/momentum/templates/process/plAnalysis.mpr") # example_tecan change a property inside the python object tree. A next level can be specified using a "/" separated string # if the level is a dict than it ust picks the value with the given key, in case of a list of dicts it picks the entry which has # an 'id' key with the given value for lists also a number can be given with specifies the index # this is meant to be similar to an xpath for XML but is less powerful. At some point we might use xpath only and edit the # XML elemtns directly # psr['profile/devices/BarCode/params/Active'] = 'Inactive' # copy (shallow) and insert the first process step at position 2 twice. Note that process steps to NOT have an ID attribute # psr['process/steps'].insert(2, psr['process/steps/0']) # psr['process/steps'].insert(2, psr['process/steps/0']) # psr['process/steps'].insert(2, evo_run_singleplate('script.msc', 'MyPlate', 'left(1)', 'left(2)'))
'flange_type': u'short', 'stacking_above': u'1', 'plate_width': u'85.48', 'general_name': u'4titude 0203 384 Well ' }] ] plateOrder = [plate.id_barcode for plate in plateData] plateOrder.sort() ### ### BARCODE PRINTING ### # Read template from momentum psr = Momentum.readMomentum("PTT Barcode Label.txt") plateTypeData = { plate.id_barcode: { 'PlateType': '"' + plate.id_barcode + '"', 'Size': '"' + str(plate.plate_type) + '"', 'Dropstage': plate.flange_dropstage, 'Descriptor': '"' + plate.general_name + '"', 'Bottomread': plate.plate_bottom_read } for plate in plateData } # Add bottomread as a varible of type Boolean / existing variables are not overwritten psr.add_variable('Bottomread', 'Boolean')