コード例 #1
0
ファイル: platesetup.py プロジェクト: v-makarenko/vtoolsmq
def make_default_setup(date, plan, project=None):
	if not project:
		project = get_validation_project()
	plan_name = plan.get('name', None) or plate_layouts[plan['plate_layout']][1]
	plate_setup = PlateSetup(project_id=project.id, name=plan_name)
	plate_setup.locked = False
	plate_setup.completed = False

	if type(plan['execution_order']) == type([]):
		execution_order = plan['execution_order']
	else:
		execution_order = execution_orders[plan['execution_order']]
	# TODO add status steps
	setup = dict(consumable=consumable_layouts[plan['consumable']],
	           	 execution_order=execution_order,
	           	 plate_layout=plate_layouts[plan['plate_layout']],
	           	 progress=progress(num_readers=len(execution_order)))
	
	plate_setup.time_updated = datetime.now()
	plate_setup.author_id = plan['operator'].id
	plate_setup.setup = json.dumps(setup)
	plate_setup.dr_oil = 22
	plate_setup.dg_oil = 14
	plate_setup.master_mix = 12
	plate_setup.droplet_generation_method = 201
	plate_setup.thermal_cycler_id = plan.get('thermal_cycler', None)
	plate_setup.prefix = make_setup_name(plate_setup)
	return plate_setup