Class: PlateTemplateTask

Inherits:
Task show all
Includes:
Tasks::PlatePurposeBehavior
Defined in:
app/models/plate_template_task.rb

Overview

Handles display of plate template options (first page of cherrypicking) and the processing of any uploaded spreadsheets to set a layout

Direct Known Subclasses

FluidigmTemplateTask

Defined Under Namespace

Classes: PlateTemplateData, SpreadsheetReader

Instance Method Summary collapse

Methods included from Tasks::PlatePurposeBehavior

#plate_purpose_options

Methods inherited from Task

#find_batch, #find_batch_requests, #get_descriptor_value, get_subclass_attribute_options, #get_subclass_attribute_options, #get_subclass_attribute_value, get_subclass_attributes, #get_subclass_attributes, #included_for_do_task, #included_for_render_task, init_class, #set_descriptor_value, set_subclass_attribute, #set_subclass_attribute_value, #sub_events_for

Methods inherited from ApplicationRecord

convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!

Methods included from Warren::BroadcastMessages

#broadcast, included, #queue_associated_for_broadcast, #queue_for_broadcast, #warren

Instance Method Details

#create_render_element(request) ⇒ Object


66
67
68
# File 'app/models/plate_template_task.rb', line 66

def create_render_element(request)
  request.asset && PlateTemplateData.new(request)
end

#do_task(workflows_controller, params) ⇒ Object


79
80
81
82
83
84
85
86
87
88
89
# File 'app/models/plate_template_task.rb', line 79

def do_task(workflows_controller, params)
  return true if params[:file].blank?

  plate_size = if params[:plate_template].blank?
                 PlatePurpose.find(params[:plate_purpose_id]).size
               else
                 PlateTemplate.find(params[:plate_template]['0'].to_i).size
               end
  workflows_controller.spreadsheet_layout = SpreadsheetReader.new(params[:file].read, workflows_controller.batch, plate_size).layout
  true
end

#partialObject


70
71
72
# File 'app/models/plate_template_task.rb', line 70

def partial
  'plate_template_batches'
end

#render_task(workflow, params) ⇒ Object


74
75
76
77
# File 'app/models/plate_template_task.rb', line 74

def render_task(workflow, params)
  super
  workflow.render_plate_template_task(self, params)
end