rsmp 0.35.0 → 0.35.2
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/Gemfile.lock +21 -17
- data/lib/rsmp/error.rb +1 -0
- data/lib/rsmp/message.rb +3 -1
- data/lib/rsmp/proxy.rb +4 -2
- data/lib/rsmp/supervisor_proxy.rb +12 -7
- data/lib/rsmp/tlc/traffic_controller.rb +3 -1
- data/lib/rsmp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5c0f93062b73555dd67edda6564054299c1df0240c4ce55f0b854abc7e94931
|
4
|
+
data.tar.gz: 2659660e29f1ba7b50533b3e89bb80c81ae69f81768cbc4012db6da6776ccebc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c48367c147156f5adb8cdabfd5fc81cde4cbb3e842f05c982307b6400f6fb33deb583cc57737faa2e7a1fe2a87f7e629dde7b335f063e126a403e45f49774c2f
|
7
|
+
data.tar.gz: 77c5e1343d7106bd9a60ff55e666d69cb4589655e7ad9bcbcf84cb95101e3b7c004bf373943f018d24b38d5cb6f6cccc97f7a0202fe2c8f5dc6ad7e687134c1b
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rsmp (0.35.
|
4
|
+
rsmp (0.35.2)
|
5
5
|
async (~> 2.21)
|
6
6
|
async-io (~> 1.43)
|
7
7
|
colorize (~> 1.1)
|
@@ -18,21 +18,23 @@ GEM
|
|
18
18
|
cucumber (>= 8.0, < 10.0)
|
19
19
|
rspec-expectations (~> 3.4)
|
20
20
|
thor (~> 1.0)
|
21
|
-
async (2.
|
21
|
+
async (2.23.0)
|
22
22
|
console (~> 1.29)
|
23
23
|
fiber-annotation
|
24
|
-
io-event (~> 1.
|
24
|
+
io-event (~> 1.9)
|
25
|
+
metrics (~> 0.12)
|
26
|
+
traces (~> 0.15)
|
25
27
|
async-io (1.43.2)
|
26
28
|
async
|
27
|
-
bigdecimal (3.1.
|
29
|
+
bigdecimal (3.1.9)
|
28
30
|
builder (3.3.0)
|
29
31
|
colorize (1.1.0)
|
30
|
-
console (1.29.
|
32
|
+
console (1.29.3)
|
31
33
|
fiber-annotation
|
32
34
|
fiber-local (~> 1.1)
|
33
35
|
json
|
34
36
|
contracts (0.17.2)
|
35
|
-
cucumber (9.2.
|
37
|
+
cucumber (9.2.1)
|
36
38
|
builder (~> 3.2)
|
37
39
|
cucumber-ci-environment (> 9, < 11)
|
38
40
|
cucumber-core (> 13, < 14)
|
@@ -53,38 +55,39 @@ GEM
|
|
53
55
|
bigdecimal
|
54
56
|
cucumber-gherkin (27.0.0)
|
55
57
|
cucumber-messages (>= 19.1.4, < 23)
|
56
|
-
cucumber-html-formatter (21.
|
57
|
-
cucumber-messages (> 19, <
|
58
|
+
cucumber-html-formatter (21.9.0)
|
59
|
+
cucumber-messages (> 19, < 28)
|
58
60
|
cucumber-messages (22.0.0)
|
59
|
-
cucumber-tag-expressions (6.1.
|
60
|
-
diff-lcs (1.
|
61
|
-
ffi (1.17.
|
61
|
+
cucumber-tag-expressions (6.1.2)
|
62
|
+
diff-lcs (1.6.0)
|
63
|
+
ffi (1.17.1)
|
62
64
|
fiber-annotation (0.2.0)
|
63
65
|
fiber-local (1.1.0)
|
64
66
|
fiber-storage
|
65
67
|
fiber-storage (1.0.0)
|
66
68
|
hana (1.3.7)
|
67
|
-
io-event (1.
|
68
|
-
json (2.
|
69
|
+
io-event (1.9.0)
|
70
|
+
json (2.10.1)
|
69
71
|
json_schemer (2.3.0)
|
70
72
|
bigdecimal
|
71
73
|
hana (~> 1.3)
|
72
74
|
regexp_parser (~> 2.0)
|
73
75
|
simpleidn (~> 0.2)
|
74
|
-
logger (1.6.
|
76
|
+
logger (1.6.6)
|
77
|
+
metrics (0.12.1)
|
75
78
|
mini_mime (1.1.5)
|
76
79
|
multi_test (1.1.0)
|
77
80
|
ostruct (0.6.1)
|
78
81
|
rake (13.2.1)
|
79
|
-
regexp_parser (2.
|
80
|
-
rsmp_schema (0.8.
|
82
|
+
regexp_parser (2.10.0)
|
83
|
+
rsmp_schema (0.8.7)
|
81
84
|
json_schemer (~> 2.3.0)
|
82
85
|
thor (~> 1.3.1)
|
83
86
|
rspec (3.13.0)
|
84
87
|
rspec-core (~> 3.13.0)
|
85
88
|
rspec-expectations (~> 3.13.0)
|
86
89
|
rspec-mocks (~> 3.13.0)
|
87
|
-
rspec-core (3.13.
|
90
|
+
rspec-core (3.13.3)
|
88
91
|
rspec-support (~> 3.13.0)
|
89
92
|
rspec-expectations (3.13.3)
|
90
93
|
diff-lcs (>= 1.2.0, < 2.0)
|
@@ -98,6 +101,7 @@ GEM
|
|
98
101
|
ffi (~> 1.1)
|
99
102
|
thor (1.3.2)
|
100
103
|
timecop (0.9.10)
|
104
|
+
traces (0.15.2)
|
101
105
|
|
102
106
|
PLATFORMS
|
103
107
|
arm64-darwin-22
|
data/lib/rsmp/error.rb
CHANGED
data/lib/rsmp/message.rb
CHANGED
@@ -153,7 +153,9 @@ module RSMP
|
|
153
153
|
errors = RSMP::Schema.validate attributes, schemas
|
154
154
|
if errors
|
155
155
|
error_string = errors.map {|item| item.reject {|e| e=='' } }.compact.join(', ').strip
|
156
|
-
|
156
|
+
err = SchemaError.new "#{error_string}"
|
157
|
+
err.schemas = schemas
|
158
|
+
raise err
|
157
159
|
end
|
158
160
|
end
|
159
161
|
|
data/lib/rsmp/proxy.rb
CHANGED
@@ -353,7 +353,8 @@ module RSMP
|
|
353
353
|
rescue EOFError, IOError
|
354
354
|
buffer_message message
|
355
355
|
rescue SchemaError, RSMP::Schema::Error => e
|
356
|
-
|
356
|
+
schemas_string = e.schemas.map {|schema| "#{schema.first}: #{schema.last}"}.join(", ")
|
357
|
+
str = "Could not send #{message.type} because schema validation failed (#{schemas_string}): #{e.message}"
|
357
358
|
log str, message: message, level: :error
|
358
359
|
distribute_error e.exception("#{str} #{message.json}")
|
359
360
|
end
|
@@ -416,7 +417,8 @@ module RSMP
|
|
416
417
|
# cannot send NotAcknowledged for a malformed message since we can't read it, just ignore it
|
417
418
|
nil
|
418
419
|
rescue SchemaError, RSMP::Schema::Error => e
|
419
|
-
|
420
|
+
schemas_string = e.schemas.map {|schema| "#{schema.first}: #{schema.last}"}.join(", ")
|
421
|
+
reason = "schema errors (#{schemas_string}): #{e.message}"
|
420
422
|
str = "Received invalid #{message.type}"
|
421
423
|
distribute_error e.exception(str), message: message
|
422
424
|
dont_acknowledge message, str, reason
|
@@ -312,9 +312,14 @@ module RSMP
|
|
312
312
|
send_message response
|
313
313
|
end
|
314
314
|
|
315
|
-
def rsmpify_value v
|
316
|
-
|
317
|
-
|
315
|
+
def rsmpify_value v, q
|
316
|
+
if v.is_a?(Array) || v.is_a?(Set)
|
317
|
+
v
|
318
|
+
elsif ['undefined','unknown'].include?(q.to_s)
|
319
|
+
nil
|
320
|
+
else
|
321
|
+
v.to_s
|
322
|
+
end
|
318
323
|
end
|
319
324
|
|
320
325
|
def process_status_request message, options={}
|
@@ -324,7 +329,7 @@ module RSMP
|
|
324
329
|
component = @site.find_component component_id
|
325
330
|
sS = message.attributes["sS"].map do |arg|
|
326
331
|
value, quality = component.get_status arg['sCI'], arg['n'], {sxl_version: sxl_version}
|
327
|
-
{ "s" => rsmpify_value(value), "q" => quality.to_s }.merge arg
|
332
|
+
{ "s" => rsmpify_value(value, quality), "q" => quality.to_s }.merge arg
|
328
333
|
end
|
329
334
|
log "Received #{message.type}", message: message, level: :log
|
330
335
|
|
@@ -434,8 +439,8 @@ module RSMP
|
|
434
439
|
if subscription[:interval] == 0
|
435
440
|
# send as soon as the data changes
|
436
441
|
if component_object
|
437
|
-
current,
|
438
|
-
current = rsmpify_value(current)
|
442
|
+
current, quality = *(component_object.get_status code, name)
|
443
|
+
current = rsmpify_value(current,quality)
|
439
444
|
end
|
440
445
|
last_sent = fetch_last_sent_status component, code, name
|
441
446
|
if current != last_sent
|
@@ -473,7 +478,7 @@ module RSMP
|
|
473
478
|
end
|
474
479
|
sS << { "sCI" => code,
|
475
480
|
"n" => status_name,
|
476
|
-
"s" => rsmpify_value(value),
|
481
|
+
"s" => rsmpify_value(value, quality),
|
477
482
|
"q" => quality }
|
478
483
|
end
|
479
484
|
end
|
@@ -1045,7 +1045,9 @@ module RSMP
|
|
1045
1045
|
when 'start'
|
1046
1046
|
TrafficControllerSite.make_status clock.to_s
|
1047
1047
|
when 'occupancy'
|
1048
|
-
|
1048
|
+
values = [-1,0,50,100]
|
1049
|
+
output = @detector_logics.each_with_index.map {|dl,i| values[i%values.size] }.join(",")
|
1050
|
+
TrafficControllerSite.make_status output
|
1049
1051
|
end
|
1050
1052
|
end
|
1051
1053
|
|
data/lib/rsmp/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rsmp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.35.
|
4
|
+
version: 0.35.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emil Tin
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-03-04 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: logger
|