Module: Cherrypick::VolumeByMicroLitre

Included in:
Well
Defined in:
app/models/cherrypick/volume_by_micro_litre.rb

Instance Method Summary collapse

Instance Method Details

#volume_to_cherrypick_by_micro_litre(volume_required, robot_minimum_picking_volume = 0.0) ⇒ Object

rubocop:todo Metrics/AbcSize



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/models/cherrypick/volume_by_micro_litre.rb', line 4

def volume_to_cherrypick_by_micro_litre(volume_required, robot_minimum_picking_volume = 0.0)
  robot_minimum_picking_volume ||= 0.0
  check_inputs_to_volume_to_cherrypick_by_micro_litre!(volume_required)

  volume_required = [volume_required, robot_minimum_picking_volume].max

  volume_required.to_f.tap do |volume_to_pick|
    well_attribute.current_volume = volume_required.to_f
    well_attribute.requested_volume = volume_required.to_f
    well_attribute.buffer_volume = 0
    well_attribute.picked_volume = volume_to_pick
    well_attribute.robot_minimum_picking_volume = robot_minimum_picking_volume
  end
end