automotive-ecu 0.1.7 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ecu/interfaces/dcm/label_list.rb +19 -19
- data/lib/ecu/labels/label_list.rb +11 -21
- data/lib/ecu/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afdcb21c88b030d3a51419219dbc4ebf34c11cdfa22bcb4878b10980bd1758f8
|
4
|
+
data.tar.gz: 7ba90b0782418f2ae411ced1846292dc3cf69c281efcdbdd55a2bb10d2faca1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 634a92da870fde03b29b91fd52572c13e68cb4265e3570a90e53e83f0653c970ec9f4b2b690a13e3e4454e3ee622c5ab647a1809dcf5f5a388b4db90ec023320
|
7
|
+
data.tar.gz: df6ac03c377110ef7f663339eccf5a2f3a1989dfb95ce52d5845631ddc9f132def6aed90c9788ecf2ab185ec909b8c2c7c2d10a3f57a451db3f87bc0bedc51c2
|
@@ -28,31 +28,31 @@ class Ecu
|
|
28
28
|
str.each_line.lazy.with_index(1).each do |line, n|
|
29
29
|
line = normalize_whitespace(line)
|
30
30
|
case line
|
31
|
-
|
32
|
-
|
31
|
+
when BLANKLINE_REGEX then next
|
32
|
+
when COMMENT_REGEX
|
33
33
|
case buffer.header
|
34
|
-
|
35
|
-
|
36
|
-
|
34
|
+
when :pre then headers << line[1..].strip
|
35
|
+
when :after then subheaders << line[1..].strip
|
36
|
+
when :done then # Header time over, do nothing
|
37
37
|
end
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
38
|
+
when DCM_HEADER then buffer.header_seen!
|
39
|
+
when Functions.dcm_header then buffer.start!(Functions, [line])
|
40
|
+
when Festwert.dcm_header then buffer.start!(Festwert, [line])
|
41
|
+
when Festwerteblock.dcm_header then buffer.start!(Festwerteblock, [line])
|
42
|
+
when Kennlinie.dcm_header then buffer.start!(Kennlinie, [line])
|
43
|
+
when Gruppenkennlinie.dcm_header then buffer.start!(Gruppenkennlinie, [line])
|
44
|
+
when Festkennlinie.dcm_header then buffer.start!(Festkennlinie, [line])
|
45
|
+
when Kennfeld.dcm_header then buffer.start!(Kennfeld, [line])
|
46
|
+
when Gruppenkennfeld.dcm_header then buffer.start!(Gruppenkennfeld, [line])
|
47
|
+
when Festkennfeld.dcm_header then buffer.start!(Festkennfeld, [line])
|
48
|
+
when Stuetzstellenverteilung.dcm_header then buffer.start!(Stuetzstellenverteilung, [line])
|
49
|
+
when "END" then
|
50
50
|
case obj = buffer.finish!(line)
|
51
|
-
|
51
|
+
when Label
|
52
52
|
fail "Duplicate label #{obj.name}" unless labels[obj.name].nil?
|
53
53
|
|
54
54
|
labels[obj.name] = obj
|
55
|
-
|
55
|
+
when Functions
|
56
56
|
fail "Duplicate functions definition" unless functions.empty?
|
57
57
|
|
58
58
|
functions = obj
|
@@ -89,6 +89,10 @@ class Ecu
|
|
89
89
|
self.class.new(@labels.reject(&blk), @headers, @subheaders)
|
90
90
|
end
|
91
91
|
|
92
|
+
def with(headers: [], subheaders: [])
|
93
|
+
self.class.new(@labels, headers, subheaders)
|
94
|
+
end
|
95
|
+
|
92
96
|
def delete_if(&blk)
|
93
97
|
@labels.delete_if(&blk)
|
94
98
|
end
|
@@ -112,27 +116,13 @@ class Ecu
|
|
112
116
|
@subheaders = merged.subheaders
|
113
117
|
end
|
114
118
|
|
115
|
-
def +(other)
|
116
|
-
|
117
|
-
def
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
def
|
122
|
-
@labels.empty?
|
123
|
-
end
|
124
|
-
|
125
|
-
def contains?(name)
|
126
|
-
map(&:name).include?(name)
|
127
|
-
end
|
128
|
-
|
129
|
-
def to_s
|
130
|
-
"[#{@labels.map(&:to_s).join(", ")}]"
|
131
|
-
end
|
132
|
-
|
133
|
-
def size; count end
|
134
|
-
|
135
|
-
def inspect; to_s end
|
119
|
+
def +(other) = merge(other)
|
120
|
+
def to_s = "[#{@labels.map(&:to_s).join(", ")}]"
|
121
|
+
def inspect = to_s
|
122
|
+
def size = count
|
123
|
+
def empty? = @labels.empty?
|
124
|
+
def contains?(name) = map(&:name).include?(name)
|
125
|
+
def to_a = @labels
|
136
126
|
|
137
127
|
end
|
138
128
|
end
|
data/lib/ecu/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: automotive-ecu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Mueller
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: terminal-table
|
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
- !ruby/object:Gem::Version
|
155
155
|
version: '0'
|
156
156
|
requirements: []
|
157
|
-
rubygems_version: 3.5.
|
157
|
+
rubygems_version: 3.5.22
|
158
158
|
signing_key:
|
159
159
|
specification_version: 4
|
160
160
|
summary: A simple API for managing automotive ecu signals and labels
|