automotive-ecu 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ecu/interfaces/lab/combined_list.rb +4 -2
- data/lib/ecu/signals/signal_list_comparison.rb +7 -7
- data/lib/ecu/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cbc3b625690b9f5d8d6bf67e86b3ce6134cd35ae10240f1b02a2708c2a63fd8f
|
|
4
|
+
data.tar.gz: 337197db174176a05b20c762edc9ed31f7f9cdaa5ec9ccc7d4a4e28c2a70e491
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 790eaa6e0abc424b844153076789a6847a35806af182ee502fc7105d63de02b0778128f70ea6b774a235eff166b9480624aead5919122706389f0f0f5f620003
|
|
7
|
+
data.tar.gz: 2712b9924613bddac8486f4dfeb69b0a7ff52172067e8ab0c198cd6f6bdad4f65a025f4734f543e45020e8fe74871fb52355ee6ac8820df2395025f3eba20bd4
|
|
@@ -5,7 +5,9 @@ class Ecu
|
|
|
5
5
|
class CombinedList
|
|
6
6
|
def self.from_lab(str)
|
|
7
7
|
signals, labels, headers, subheaders = LabParser.new(str).call
|
|
8
|
-
new(signals,
|
|
8
|
+
new(SignalList.new(signals, headers, subheaders),
|
|
9
|
+
LabelList.new(labels, headers, subheaders),
|
|
10
|
+
headers, subheaders)
|
|
9
11
|
end
|
|
10
12
|
|
|
11
13
|
def to_lab
|
|
@@ -26,7 +28,7 @@ class Ecu
|
|
|
26
28
|
out.append("[Label]")
|
|
27
29
|
out.append(*labels.map(&:to_lab))
|
|
28
30
|
|
|
29
|
-
out.join("\n")
|
|
31
|
+
out.join("\n") + "\n"
|
|
30
32
|
end
|
|
31
33
|
end
|
|
32
34
|
end
|
|
@@ -6,8 +6,8 @@ class Ecu
|
|
|
6
6
|
fail "Can only merge SignalLists (left: #{left.class}, right: #{right.class})!"
|
|
7
7
|
end
|
|
8
8
|
|
|
9
|
-
@left = left.map(&:name)
|
|
10
|
-
@right = right.map(&:name)
|
|
9
|
+
@left = left.map(&:name).zip(left).to_h
|
|
10
|
+
@right = right.map(&:name).zip(right).to_h
|
|
11
11
|
@unified_headers = left.headers + right.headers
|
|
12
12
|
@unified_subheaders = left.subheaders + right.subheaders
|
|
13
13
|
@names = Hash.new
|
|
@@ -16,10 +16,10 @@ class Ecu
|
|
|
16
16
|
def names(criterion)
|
|
17
17
|
@names[criterion] ||= \
|
|
18
18
|
case criterion
|
|
19
|
-
when :left_exclusive then left - right
|
|
20
|
-
when :right_exclusive then right - left
|
|
21
|
-
when :common then left & right
|
|
22
|
-
when :equal then left & right
|
|
19
|
+
when :left_exclusive then left.keys - right.keys
|
|
20
|
+
when :right_exclusive then right.keys - left.keys
|
|
21
|
+
when :common then left.keys & right.keys
|
|
22
|
+
when :equal then left.keys & right.keys
|
|
23
23
|
when :nonequal then []
|
|
24
24
|
else fail "Unknown criterion #{criterion}"
|
|
25
25
|
end
|
|
@@ -38,7 +38,7 @@ class Ecu
|
|
|
38
38
|
(
|
|
39
39
|
names(:left_exclusive).map { |n| left.fetch(n) } +
|
|
40
40
|
names(:right_exclusive).map { |n| right.fetch(n) } +
|
|
41
|
-
names(:common).map { |n| left.fetch(n) }
|
|
41
|
+
names(:common).map { |n| (priority == :right ? right : left).fetch(n) }
|
|
42
42
|
),
|
|
43
43
|
@unified_headers,
|
|
44
44
|
@unified_subheaders
|
data/lib/ecu/version.rb
CHANGED