Sha256: 8c0b87e4bfb17df8f10b65c12a3a48af0c9db9c4c10d13dca864f1b08ee8eed3

Contents?: true

Size: 363 Bytes

Versions: 10

Compression:

Stored size: 363 Bytes

Contents

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

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

    def self.from_a2l(str)
      str.gsub!(%r{/\*.*?\*/}, "")
      signals = str.scan(A2LREGEXP).map do |name, description|
        Ecu::Signal.new(name: name, description: description)
      end
      new(signals)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

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