lib/messcada/services/robot_handle_scan_pallet_movement.rb
# Take some expected messages and modify them to fit in the robot's limited display.
Take some expected messages and modify them to fit in the robot's limited display.
Take some expected messages and modify them to fit in the robot ' s limited display .
def translate_robot_message(msg) 
      match = msg.match(/PALLET: .+ moved successfully/i)
      return 'Moved successfully' if match
      match = msg.match(/Scan (.+) is not a recognised pallet number length/i)
      return "#{match[1]} not a pallet" if match
      match = msg.match(/is already in this location/i)
      return 'Already in this location' if match
      match = msg.match(/Validation error - (.+)/i)
      return match[1].capitalize if match
      match = msg.match(/is on a tripsheet/i)
      return 'Pallet is on a tripsheet' if match
      match = msg.match(/Maximun units in location have been reached/i)
      return 'Location is full' if match
      msg
    end
def translate_robot_message ( msg ) match = msg . match ( / PALLET: .+ moved successfully /i ) return 'Moved successfully' if match match = msg . match ( / Scan (.+) is not a recognised pallet number length /i ) return "#{match[1]} not a pallet" if match match = msg . match ( / is already in this location /i ) return 'Already in this location' if match match = msg . match ( / Validation error - (.+) /i ) return match [ 1 ] . capitalize if match match = msg . match ( / is on a tripsheet /i ) return 'Pallet is on a tripsheet' if match match = msg . match ( / Maximun units in location have been reached /i ) return 'Location is full' if match msg end
Take some expected messages and modify them to fit in the robot's limited display.
Take some expected messages and modify them to fit in the robot ' s limited display .
# rubocop:disable Metrics/CyclomaticComplexity
msg
<not_specific>