Method: OpenC3::GenericConversion#to_config

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

#to_config(read_or_write) ⇒ String

Returns Config fragment for this conversion.

Parameters:

  • read_or_write (String)

    Either 'READ' or 'WRITE'

Returns:

  • (String)

    Config fragment for this conversion



69
70
71
72
73
74
75
76
77
78
# File 'lib/openc3/conversions/generic_conversion.rb', line 69

def to_config(read_or_write)
  config = "    GENERIC_#{read_or_write}_CONVERSION_START"
  config << " #{@converted_type}" if @converted_type
  config << " #{@converted_bit_size}" if @converted_bit_size
  config << " #{@converted_array_size}" if @converted_array_size
  config << "\n"
  config << @code_to_eval
  config << "    GENERIC_#{read_or_write}_CONVERSION_END\n"
  config
end