Method: OpenC3::ProcessorConversion#initialize

Defined in:
lib/openc3/conversions/processor_conversion.rb

#initialize(processor_name, result_name, converted_type = nil, converted_bit_size = nil, converted_array_size = nil) ⇒ ProcessorConversion

Returns a new instance of ProcessorConversion.

Parameters:

  • processor_name (String)

    The name of the associated processor

  • result_name (String)

    The name of the associated result in the processor

  • converted_type (String or nil) (defaults to: nil)

    The datatype of the result of the processor

  • converted_bit_size (Integer or nil) (defaults to: nil)

    The bit size of the result of the processor

  • converted_array_size (Integer or nil) (defaults to: nil)

    The total array bit size of the result of the processor



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/openc3/conversions/processor_conversion.rb', line 33

def initialize(processor_name, result_name, converted_type = nil, converted_bit_size = nil, converted_array_size = nil)
  super()
  @processor_name = processor_name.to_s.upcase
  @result_name = result_name.to_s.upcase.intern
  if ConfigParser.handle_nil(converted_type)
    @converted_type = converted_type.to_s.upcase.intern
    raise ArgumentError, "Unknown converted type: #{converted_type}" if !BinaryAccessor::DATA_TYPES.include?(@converted_type)
  end
  @converted_bit_size = Integer(converted_bit_size) if ConfigParser.handle_nil(converted_bit_size)
  @converted_array_size = Integer(converted_array_size) if ConfigParser.handle_nil(converted_array_size)
end