Class: CherrypickTask

Inherits:
Task show all
Defined in:
app/models/cherrypick_task.rb

Overview

A Task used in cherrypick pipelines Performs the main bulk of cherrypick action. Although a lot of the options on this page are presented as part of the previous step, and get persisted on this page as hidden fields. This page shows a drag-drop plate layout which lets users set-up the way the plate will be picked. The target asset of each request will have its plate and map set accordingly. Well attributes are set to track picking volumes

Defined Under Namespace

Classes: PickTarget

Constant Summary collapse

EMPTY_WELL =
[0, 'Empty', '']
TEMPLATE_EMPTY_WELL =
[0, '---', '']

Instance Method Summary collapse

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


15
16
# File 'app/models/cherrypick_task.rb', line 15

def create_render_element(request)
end

#do_task(workflow, params) ⇒ Object


188
189
190
191
192
193
# File 'app/models/cherrypick_task.rb', line 188

def do_task(workflow, params)
  workflow.do_cherrypick_task(self, params)
rescue Cherrypick::Error => e
  workflow.send(:flash)[:error] = e.message
  return false
end

#partialObject


179
180
181
# File 'app/models/cherrypick_task.rb', line 179

def partial
  'cherrypick_batches'
end

#pick_new_plate(requests, template, robot, plate_purpose) ⇒ Object


126
127
128
129
130
131
# File 'app/models/cherrypick_task.rb', line 126

def pick_new_plate(requests, template, robot, plate_purpose)
  target_type = PickTarget.for(plate_purpose)
  perform_pick(requests, robot) do
    target_type.new(template, plate_purpose.try(:asset_shape))
  end
end

#pick_onto_partial_plate(requests, template, robot, partial_plate) ⇒ Object


133
134
135
136
137
138
139
140
141
142
# File 'app/models/cherrypick_task.rb', line 133

def pick_onto_partial_plate(requests, template, robot, partial_plate)
  purpose = partial_plate.plate_purpose
  target_type = PickTarget.for(purpose)

  perform_pick(requests, robot) do
    target_type.new(template, purpose.try(:asset_shape), partial_plate).tap do
      partial_plate = nil # Ensure that subsequent calls have no partial plate
    end
  end
end

#render_task(workflow, params) ⇒ Object


183
184
185
186
# File 'app/models/cherrypick_task.rb', line 183

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