Sha256: 28cb8061980152547ee6f829d9840ee0d61f585e56d487f17cfeab4cc6707a21

Contents?: true

Size: 465 Bytes

Versions: 11

Compression:

Stored size: 465 Bytes

Contents

require_relative "../../../core_ext"

class Ecu
  class LabelList
    A2LREGEXP = %r{/begin CHARACTERISTIC\s+([\S]+)\s+"([^"]*)"}

    def self.from_a2l(str)
      str.gsub!(%r{/\*.*?\*/}, "")
      labels = str.scan(A2LREGEXP).map do |name, description|
        # Ugly hack: Create dummy Festwert until better parsing
        # is implemented
        Ecu::Festwert.new(name: name, description: description, value: 0)
      end
      new(labels)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
automotive-ecu-0.1.10 lib/ecu/interfaces/a2l/label_list.rb
automotive-ecu-0.1.9 lib/ecu/interfaces/a2l/label_list.rb
automotive-ecu-0.1.8 lib/ecu/interfaces/a2l/label_list.rb
automotive-ecu-0.1.7 lib/ecu/interfaces/a2l/label_list.rb
automotive-ecu-0.1.6 lib/ecu/interfaces/a2l/label_list.rb
automotive-ecu-0.1.5 lib/ecu/interfaces/a2l/label_list.rb
automotive-ecu-0.1.4 lib/ecu/interfaces/a2l/label_list.rb
automotive-ecu-0.1.3 lib/ecu/interfaces/a2l/label_list.rb
automotive-ecu-0.1.2 lib/ecu/interfaces/a2l/label_list.rb
automotive-ecu-0.1.1 lib/ecu/interfaces/a2l/label_list.rb
automotive-ecu-0.1.0 lib/ecu/interfaces/a2l/label_list.rb