rsmp 0.8.1 → 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/Gemfile.lock +45 -67
- data/config/tlc.yaml +8 -6
- data/documentation/collecting_message.md +1 -1
- data/lib/rsmp/collect/collector.rb +37 -24
- data/lib/rsmp/collect/command_response_collector.rb +1 -1
- data/lib/rsmp/collect/filter.rb +31 -0
- data/lib/rsmp/collect/listener.rb +0 -8
- data/lib/rsmp/collect/query.rb +16 -6
- data/lib/rsmp/collect/state_collector.rb +18 -7
- data/lib/rsmp/collect/status_collector.rb +20 -0
- data/lib/rsmp/node.rb +0 -1
- data/lib/rsmp/proxy.rb +22 -19
- data/lib/rsmp/site.rb +3 -2
- data/lib/rsmp/site_proxy.rb +26 -46
- data/lib/rsmp/supervisor_proxy.rb +3 -11
- data/lib/rsmp/tlc/signal_group.rb +15 -7
- data/lib/rsmp/tlc/traffic_controller.rb +92 -28
- data/lib/rsmp/tlc/traffic_controller_site.rb +10 -1
- data/lib/rsmp/version.rb +1 -1
- data/lib/rsmp.rb +2 -3
- data/rsmp.gemspec +7 -7
- metadata +19 -20
- data/lib/rsmp/collect/status_response_collector.rb +0 -11
- data/lib/rsmp/collect/status_update_collector.rb +0 -11
- data/lib/rsmp/collect/status_update_or_response_collector.rb +0 -17
data/lib/rsmp/site_proxy.rb
CHANGED
@@ -101,8 +101,11 @@ module RSMP
|
|
101
101
|
"cId" => component,
|
102
102
|
"mId" => m_id
|
103
103
|
})
|
104
|
-
|
105
|
-
|
104
|
+
send_and_optionally_collect message, options do |collect_options|
|
105
|
+
AggregatedStatusCollector.new(
|
106
|
+
self,
|
107
|
+
collect_options.merge(task:@task,m_id: m_id, num:1)
|
108
|
+
)
|
106
109
|
end
|
107
110
|
end
|
108
111
|
|
@@ -174,8 +177,12 @@ module RSMP
|
|
174
177
|
"sS" => request_list,
|
175
178
|
"mId" => m_id
|
176
179
|
})
|
177
|
-
|
178
|
-
|
180
|
+
send_and_optionally_collect message, options do |collect_options|
|
181
|
+
StatusCollector.new(
|
182
|
+
self,
|
183
|
+
status_list,
|
184
|
+
collect_options.merge(task:@task,m_id: m_id)
|
185
|
+
)
|
179
186
|
end
|
180
187
|
end
|
181
188
|
|
@@ -186,17 +193,6 @@ module RSMP
|
|
186
193
|
acknowledge message
|
187
194
|
end
|
188
195
|
|
189
|
-
def send_and_collect_if_needed message, options, &block
|
190
|
-
if options[:collect]
|
191
|
-
task = @task.async { |task| yield task }
|
192
|
-
send_message message, validate: options[:validate]
|
193
|
-
{ sent: message, collector: task.wait }
|
194
|
-
else
|
195
|
-
send_message message, validate: options[:validate]
|
196
|
-
return { sent: message }
|
197
|
-
end
|
198
|
-
end
|
199
|
-
|
200
196
|
def subscribe_to_status component_id, status_list, options={}
|
201
197
|
validate_ready 'subscribe to status'
|
202
198
|
m_id = options[:m_id] || RSMP::Message.make_m_id
|
@@ -215,8 +211,12 @@ module RSMP
|
|
215
211
|
"sS" => subscribe_list,
|
216
212
|
'mId' => m_id
|
217
213
|
})
|
218
|
-
|
219
|
-
|
214
|
+
send_and_optionally_collect message, options do |collect_options|
|
215
|
+
StatusCollector.new(
|
216
|
+
self,
|
217
|
+
status_list,
|
218
|
+
collect_options.merge(task:@task,m_id: m_id)
|
219
|
+
)
|
220
220
|
end
|
221
221
|
end
|
222
222
|
|
@@ -261,8 +261,12 @@ module RSMP
|
|
261
261
|
"arg" => command_list,
|
262
262
|
"mId" => m_id
|
263
263
|
})
|
264
|
-
|
265
|
-
|
264
|
+
send_and_optionally_collect message, options do |collect_options|
|
265
|
+
CommandResponseCollector.new(
|
266
|
+
self,
|
267
|
+
command_list,
|
268
|
+
collect_options.merge(task:@task,m_id: m_id)
|
269
|
+
)
|
266
270
|
end
|
267
271
|
end
|
268
272
|
|
@@ -339,37 +343,13 @@ module RSMP
|
|
339
343
|
distribute_error e, options
|
340
344
|
end
|
341
345
|
|
342
|
-
def collect_alarms
|
343
|
-
collect(
|
346
|
+
def collect_alarms options={}
|
347
|
+
collect(@task,options.merge(type: "Alarm")) do |alarm|
|
344
348
|
next if options[:aCId] && options[:aCId] != alarm.attribute("aCId")
|
345
349
|
next if options[:aSp] && options[:aSp] != alarm.attribute("aSp")
|
346
350
|
next if options[:aS] && options[:aS] != alarm.attribute("aS")
|
347
|
-
|
351
|
+
:keep
|
348
352
|
end
|
349
353
|
end
|
350
|
-
|
351
|
-
def collect_status_updates task, status_list, options
|
352
|
-
collector = StatusUpdateCollector.new(self, status_list, options.merge(task:task))
|
353
|
-
collector.collect
|
354
|
-
collector
|
355
|
-
end
|
356
|
-
|
357
|
-
def collect_status_responses task, status_list, options
|
358
|
-
collector = StatusResponseCollector.new(self, status_list, options.merge(task:task))
|
359
|
-
collector.collect
|
360
|
-
collector
|
361
|
-
end
|
362
|
-
|
363
|
-
def collect_command_responses task, command_list, options
|
364
|
-
collector = CommandResponseCollector.new(self, command_list, options.merge(task:task))
|
365
|
-
collector.collect
|
366
|
-
collector
|
367
|
-
end
|
368
|
-
|
369
|
-
def collect_aggregated_status task, options
|
370
|
-
collector = AggregatedStatusCollector.new(self, options.merge(task:task))
|
371
|
-
collector.collect
|
372
|
-
collector
|
373
|
-
end
|
374
354
|
end
|
375
355
|
end
|
@@ -138,16 +138,8 @@ module RSMP
|
|
138
138
|
"mId" => m_id,
|
139
139
|
})
|
140
140
|
|
141
|
-
|
142
|
-
|
143
|
-
task = @task.async do |task|
|
144
|
-
wait_for_acknowledgement task, options[:collect], m_id
|
145
|
-
end
|
146
|
-
send_message message, validate: options[:validate]
|
147
|
-
return message, task.wait
|
148
|
-
else
|
149
|
-
send_message message, validate: options[:validate]
|
150
|
-
message
|
141
|
+
send_and_optionally_collect message, options do |task|
|
142
|
+
wait_for_acknowledgement task, options[:collect], m_id
|
151
143
|
end
|
152
144
|
end
|
153
145
|
|
@@ -282,7 +274,7 @@ module RSMP
|
|
282
274
|
end
|
283
275
|
|
284
276
|
def fetch_last_sent_status component, code, name
|
285
|
-
@last_status_sent.dig component, code, name
|
277
|
+
@last_status_sent.dig component, code, name if @last_status_sent
|
286
278
|
end
|
287
279
|
|
288
280
|
def store_last_sent_status message
|
@@ -6,25 +6,33 @@ module RSMP
|
|
6
6
|
# plan is a string, with each character representing a signal phase at a particular second in the cycle
|
7
7
|
def initialize node:, id:
|
8
8
|
super node: node, id: id, grouped: false
|
9
|
-
move 0
|
10
9
|
end
|
11
10
|
|
12
|
-
def
|
11
|
+
def timer
|
12
|
+
@state = get_state
|
13
|
+
end
|
14
|
+
|
15
|
+
def get_state
|
16
|
+
return 'a' if node.main.dark_mode
|
17
|
+
return 'c' if node.main.yellow_flash
|
18
|
+
|
19
|
+
cycle_counter = node.main.cycle_counter
|
20
|
+
|
21
|
+
if node.main.startup_sequence_active
|
22
|
+
@state = node.main.startup_state || 'a'
|
23
|
+
end
|
24
|
+
|
13
25
|
default = 'a' # phase a means disabled/dark
|
14
26
|
plan = node.main.current_plan
|
15
27
|
return default unless plan
|
16
28
|
return default unless plan.states
|
17
29
|
states = plan.states[c_id]
|
18
30
|
return default unless states
|
19
|
-
state = states[
|
31
|
+
state = states[cycle_counter]
|
20
32
|
return default unless state =~ /[a-hA-G0-9N-P]/ # valid signal group states
|
21
33
|
state
|
22
34
|
end
|
23
35
|
|
24
|
-
def move pos
|
25
|
-
@state = get_state pos
|
26
|
-
end
|
27
|
-
|
28
36
|
def handle_command command_code, arg
|
29
37
|
case command_code
|
30
38
|
when 'M0010', 'M0011'
|
@@ -5,9 +5,12 @@ module RSMP
|
|
5
5
|
# and keeps track of signal plans, detector logics, inputs, etc. which do
|
6
6
|
# not have dedicated components.
|
7
7
|
class TrafficController < Component
|
8
|
-
attr_reader :pos, :cycle_time, :plan
|
8
|
+
attr_reader :pos, :cycle_time, :plan, :cycle_counter,
|
9
|
+
:yellow_flash, :dark_mode,
|
10
|
+
:startup_sequence_active, :startup_sequence, :startup_sequence_pos
|
9
11
|
|
10
|
-
def initialize node:, id:, cycle_time: 10, signal_plans
|
12
|
+
def initialize node:, id:, cycle_time: 10, signal_plans:,
|
13
|
+
startup_sequence:, live_output:nil
|
11
14
|
super node: node, id: id, grouped: true
|
12
15
|
@signal_groups = []
|
13
16
|
@detector_logics = []
|
@@ -15,13 +18,15 @@ module RSMP
|
|
15
18
|
@cycle_time = cycle_time
|
16
19
|
@num_traffic_situations = 1
|
17
20
|
@num_inputs = 8
|
21
|
+
@startup_sequence = startup_sequence
|
22
|
+
@live_output = live_output
|
18
23
|
reset
|
19
24
|
end
|
20
25
|
|
21
26
|
def reset
|
22
|
-
@
|
23
|
-
@plan =
|
24
|
-
@dark_mode =
|
27
|
+
@cycle_counter = 0
|
28
|
+
@plan = 1
|
29
|
+
@dark_mode = true
|
25
30
|
@yellow_flash = false
|
26
31
|
@booting = false
|
27
32
|
@control_mode = 'control'
|
@@ -40,6 +45,12 @@ module RSMP
|
|
40
45
|
@inputs = '0'*@num_inputs
|
41
46
|
@input_activations = '0'*@num_inputs
|
42
47
|
@input_results = '0'*@num_inputs
|
48
|
+
|
49
|
+
@day_time_table = {}
|
50
|
+
@startup_sequence_active = false
|
51
|
+
@startup_sequence_initiated_at = nil
|
52
|
+
@startup_sequence_pos = 0
|
53
|
+
@time_int = nil
|
43
54
|
end
|
44
55
|
|
45
56
|
def clock
|
@@ -64,46 +75,83 @@ module RSMP
|
|
64
75
|
end
|
65
76
|
|
66
77
|
def timer now
|
67
|
-
# TODO
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
78
|
+
# TODO use monotone timer, to avoid jumps in case the user sets the system time
|
79
|
+
@signal_groups.each { |group| group.timer }
|
80
|
+
time = Time.now.to_i
|
81
|
+
return if time == @time_int
|
82
|
+
@time_int = time
|
83
|
+
move_cycle_counter
|
84
|
+
move_startup_sequence if @startup_sequence_active
|
85
|
+
output_states
|
86
|
+
end
|
87
|
+
|
88
|
+
def move_cycle_counter
|
89
|
+
counter = Time.now.to_i % @cycle_time
|
90
|
+
@cycle_counter = counter
|
91
|
+
end
|
92
|
+
|
93
|
+
def startup_state
|
94
|
+
return unless @startup_sequence_active
|
95
|
+
return unless @startup_sequence_pos
|
96
|
+
@startup_sequence[ @startup_sequence_pos ]
|
75
97
|
end
|
76
98
|
|
77
|
-
def
|
78
|
-
|
79
|
-
|
99
|
+
def initiate_startup_sequence
|
100
|
+
log "Initiating startup sequence", level: :info
|
101
|
+
@startup_sequence_active = true
|
102
|
+
@startup_sequence_initiated_at = nil
|
103
|
+
@startup_sequence_pos = nil
|
104
|
+
end
|
105
|
+
|
106
|
+
def end_startup_sequence
|
107
|
+
@startup_sequence_active = false
|
108
|
+
@startup_sequence_initiated_at = nil
|
109
|
+
@startup_sequence_pos = nil
|
110
|
+
|
111
|
+
@yellow_flash = false
|
112
|
+
@dark_mode = false
|
113
|
+
end
|
114
|
+
|
115
|
+
def move_startup_sequence
|
116
|
+
was = @startup_sequence_pos
|
117
|
+
if @startup_sequence_initiated_at == nil
|
118
|
+
@startup_sequence_initiated_at = Time.now.to_i + 1
|
119
|
+
@startup_sequence_pos = 0
|
120
|
+
else
|
121
|
+
@startup_sequence_pos = Time.now.to_i - @startup_sequence_initiated_at
|
122
|
+
end
|
123
|
+
if @startup_sequence_pos >= @startup_sequence.size
|
124
|
+
end_startup_sequence
|
80
125
|
end
|
81
|
-
#output_states
|
82
126
|
end
|
83
127
|
|
84
128
|
def output_states
|
129
|
+
return unless @live_output
|
85
130
|
str = @signal_groups.map do |group|
|
86
131
|
s = "#{group.c_id}:#{group.state}"
|
87
132
|
if group.state =~ /^[1-9]$/
|
88
133
|
s.colorize(:green)
|
89
134
|
elsif group.state =~ /^[NOP]$/
|
90
135
|
s.colorize(:yellow)
|
91
|
-
elsif group.state =~ /^[
|
92
|
-
s.colorize(
|
136
|
+
elsif group.state =~ /^[ae]$/
|
137
|
+
s.colorize(:black)
|
138
|
+
elsif group.state =~ /^[f]$/
|
139
|
+
s.colorize(:yellow)
|
140
|
+
elsif group.state =~ /^[g]$/
|
141
|
+
s.colorize(:red)
|
93
142
|
else
|
94
143
|
s.colorize(:red)
|
95
144
|
end
|
96
145
|
end.join ' '
|
97
146
|
plan = "P#{@plan}"
|
98
|
-
|
147
|
+
|
148
|
+
File.open @live_output, 'w' do |file|
|
149
|
+
file.puts "#{plan.rjust(4)} #{pos.to_s.rjust(4)} #{str}\r"
|
150
|
+
end
|
99
151
|
end
|
100
152
|
|
101
153
|
def format_signal_group_status
|
102
|
-
|
103
|
-
'c' * @signal_groups.size
|
104
|
-
else
|
105
|
-
@signal_groups.map { |group| group.state }.join
|
106
|
-
end
|
154
|
+
@signal_groups.map { |group| group.state }.join
|
107
155
|
end
|
108
156
|
|
109
157
|
def handle_command command_code, arg
|
@@ -214,6 +262,18 @@ module RSMP
|
|
214
262
|
|
215
263
|
def handle_m0017 arg
|
216
264
|
@node.verify_security_code 2, arg['securityCode']
|
265
|
+
arg['status'].split(',').each do |item|
|
266
|
+
elems = item.split('-')
|
267
|
+
nr = elems[0].to_i
|
268
|
+
plan = elems[1].to_i
|
269
|
+
hour = elems[2].to_i
|
270
|
+
min = elems[3].to_i
|
271
|
+
if nr<0 || nr>12
|
272
|
+
raise InvalidMessage.new "time table id must be between 0 and 12, got #{nr}"
|
273
|
+
end
|
274
|
+
#p "nr: #{nr}, plan #{plan} at #{hour}:#{min}"
|
275
|
+
@day_time_table[nr] = {plan: plan, hour: hour, min:min}
|
276
|
+
end
|
217
277
|
end
|
218
278
|
|
219
279
|
def handle_m0018 arg
|
@@ -276,6 +336,7 @@ module RSMP
|
|
276
336
|
log "Switching to mode #{mode}", level: :info
|
277
337
|
case mode
|
278
338
|
when 'NormalControl'
|
339
|
+
initiate_startup_sequence if @yellow_flash || @dark_mode
|
279
340
|
@yellow_flash = false
|
280
341
|
@dark_mode = false
|
281
342
|
when 'YellowFlash'
|
@@ -308,9 +369,9 @@ module RSMP
|
|
308
369
|
when 'signalgroupstatus'
|
309
370
|
TrafficControllerSite.make_status format_signal_group_status
|
310
371
|
when 'cyclecounter'
|
311
|
-
TrafficControllerSite.make_status @
|
372
|
+
TrafficControllerSite.make_status @cycle_counter.to_s
|
312
373
|
when 'basecyclecounter'
|
313
|
-
TrafficControllerSite.make_status @
|
374
|
+
TrafficControllerSite.make_status @cycle_counter.to_s
|
314
375
|
when 'stage'
|
315
376
|
TrafficControllerSite.make_status 0.to_s
|
316
377
|
end
|
@@ -511,7 +572,10 @@ module RSMP
|
|
511
572
|
def handle_s0027 status_code, status_name=nil
|
512
573
|
case status_name
|
513
574
|
when 'status'
|
514
|
-
|
575
|
+
status = @day_time_table.map do |i,item|
|
576
|
+
"#{i}-#{item[:plan]}-#{item[:hour]}-#{item[:min]}"
|
577
|
+
end.join(',')
|
578
|
+
TrafficControllerSite.make_status status
|
515
579
|
end
|
516
580
|
end
|
517
581
|
|
@@ -5,11 +5,16 @@ module RSMP
|
|
5
5
|
attr_accessor :main, :signal_plans
|
6
6
|
|
7
7
|
def initialize options={}
|
8
|
+
# setup options before calling super initializer,
|
9
|
+
# since build of components depend on options
|
8
10
|
@sxl = 'traffic_light_controller'
|
9
11
|
@security_codes = options[:site_settings]['security_codes']
|
10
12
|
@interval = options[:site_settings].dig('intervals','timer') || 1
|
13
|
+
@startup_sequence = options[:site_settings]['startup_sequence'] || 'efg'
|
11
14
|
build_plans options[:site_settings].dig('signal_plans')
|
15
|
+
|
12
16
|
super options
|
17
|
+
|
13
18
|
unless @main
|
14
19
|
raise ConfigurationError.new "TLC must have a main component"
|
15
20
|
end
|
@@ -37,7 +42,9 @@ module RSMP
|
|
37
42
|
when 'main'
|
38
43
|
@main = TrafficController.new node: self, id: id,
|
39
44
|
cycle_time: settings['cycle_time'],
|
40
|
-
|
45
|
+
startup_sequence: @startup_sequence,
|
46
|
+
signal_plans: @signal_plans,
|
47
|
+
live_output: @site_settings['live_output']
|
41
48
|
when 'signal_group'
|
42
49
|
group = SignalGroup.new node: self, id: id
|
43
50
|
@main.add_signal_group group
|
@@ -52,6 +59,7 @@ module RSMP
|
|
52
59
|
def start_action
|
53
60
|
super
|
54
61
|
start_timer
|
62
|
+
@main.initiate_startup_sequence
|
55
63
|
end
|
56
64
|
|
57
65
|
def start_timer
|
@@ -134,6 +142,7 @@ module RSMP
|
|
134
142
|
when :restart
|
135
143
|
log "Restarting TLC", level: :info
|
136
144
|
restart
|
145
|
+
initiate_startup_sequence
|
137
146
|
end
|
138
147
|
end
|
139
148
|
end
|
data/lib/rsmp/version.rb
CHANGED
data/lib/rsmp.rb
CHANGED
@@ -21,12 +21,11 @@ require 'rsmp/collect/notifier'
|
|
21
21
|
require 'rsmp/collect/listener'
|
22
22
|
require 'rsmp/collect/collector'
|
23
23
|
require 'rsmp/collect/state_collector'
|
24
|
+
require 'rsmp/collect/filter'
|
24
25
|
require 'rsmp/collect/query'
|
25
26
|
require 'rsmp/collect/status_query'
|
26
27
|
require 'rsmp/collect/command_query'
|
27
|
-
require 'rsmp/collect/
|
28
|
-
require 'rsmp/collect/status_response_collector'
|
29
|
-
require 'rsmp/collect/status_update_collector'
|
28
|
+
require 'rsmp/collect/status_collector'
|
30
29
|
require 'rsmp/collect/command_response_collector'
|
31
30
|
require 'rsmp/collect/aggregated_status_collector'
|
32
31
|
require 'rsmp/component'
|
data/rsmp.gemspec
CHANGED
@@ -31,16 +31,16 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.require_paths = ["lib"]
|
32
32
|
|
33
33
|
spec.add_dependency "async", "~> 1.29.1"
|
34
|
-
spec.add_dependency "async-io", "~> 1.32.
|
34
|
+
spec.add_dependency "async-io", "~> 1.32.2"
|
35
35
|
spec.add_dependency "colorize", "~> 0.8.1"
|
36
|
-
spec.add_dependency "thor", "~> 1.
|
36
|
+
spec.add_dependency "thor", "~> 1.2.1"
|
37
37
|
spec.add_dependency "rsmp_schemer"
|
38
38
|
|
39
|
-
spec.add_development_dependency "bundler", "~> 2.
|
40
|
-
spec.add_development_dependency "rake", "~> 13.0.
|
39
|
+
spec.add_development_dependency "bundler", "~> 2.3.6"
|
40
|
+
spec.add_development_dependency "rake", "~> 13.0.6"
|
41
41
|
spec.add_development_dependency "rspec", "~> 3.10.0"
|
42
|
-
spec.add_development_dependency "rspec-expectations", "~> 3.10.
|
42
|
+
spec.add_development_dependency "rspec-expectations", "~> 3.10.2"
|
43
43
|
spec.add_development_dependency "timecop", "~> 0.9.4"
|
44
|
-
spec.add_development_dependency "cucumber", "~>
|
45
|
-
spec.add_development_dependency "aruba" , "~>
|
44
|
+
spec.add_development_dependency "cucumber", "~> 7.1.0"
|
45
|
+
spec.add_development_dependency "aruba" , "~> 2.0.0"
|
46
46
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rsmp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emil Tin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.32.
|
33
|
+
version: 1.32.2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.32.
|
40
|
+
version: 1.32.2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: colorize
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.
|
61
|
+
version: 1.2.1
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.
|
68
|
+
version: 1.2.1
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rsmp_schemer
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,28 +86,28 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 2.
|
89
|
+
version: 2.3.6
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 2.
|
96
|
+
version: 2.3.6
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rake
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 13.0.
|
103
|
+
version: 13.0.6
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 13.0.
|
110
|
+
version: 13.0.6
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rspec
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 3.10.
|
131
|
+
version: 3.10.2
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 3.10.
|
138
|
+
version: 3.10.2
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: timecop
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,28 +156,28 @@ dependencies:
|
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
159
|
+
version: 7.1.0
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version:
|
166
|
+
version: 7.1.0
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: aruba
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
171
|
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version:
|
173
|
+
version: 2.0.0
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version:
|
180
|
+
version: 2.0.0
|
181
181
|
description: Easy RSMP site and supervisor communication.
|
182
182
|
email:
|
183
183
|
- zf0f@kk.dk
|
@@ -211,15 +211,14 @@ files:
|
|
211
211
|
- lib/rsmp/collect/collector.rb
|
212
212
|
- lib/rsmp/collect/command_query.rb
|
213
213
|
- lib/rsmp/collect/command_response_collector.rb
|
214
|
+
- lib/rsmp/collect/filter.rb
|
214
215
|
- lib/rsmp/collect/listener.rb
|
215
216
|
- lib/rsmp/collect/message_matchers.rb
|
216
217
|
- lib/rsmp/collect/notifier.rb
|
217
218
|
- lib/rsmp/collect/query.rb
|
218
219
|
- lib/rsmp/collect/state_collector.rb
|
220
|
+
- lib/rsmp/collect/status_collector.rb
|
219
221
|
- lib/rsmp/collect/status_query.rb
|
220
|
-
- lib/rsmp/collect/status_response_collector.rb
|
221
|
-
- lib/rsmp/collect/status_update_collector.rb
|
222
|
-
- lib/rsmp/collect/status_update_or_response_collector.rb
|
223
222
|
- lib/rsmp/component.rb
|
224
223
|
- lib/rsmp/components.rb
|
225
224
|
- lib/rsmp/convert/export/json_schema.rb
|
@@ -270,7 +269,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
270
269
|
- !ruby/object:Gem::Version
|
271
270
|
version: '0'
|
272
271
|
requirements: []
|
273
|
-
rubygems_version: 3.
|
272
|
+
rubygems_version: 3.3.3
|
274
273
|
signing_key:
|
275
274
|
specification_version: 4
|
276
275
|
summary: RoadSide Message Protocol (RSMP) library.
|
@@ -1,11 +0,0 @@
|
|
1
|
-
module RSMP
|
2
|
-
# Class for waiting for specific status responses
|
3
|
-
class StatusResponseCollector < StatusUpdateOrResponseCollector
|
4
|
-
def initialize proxy, want, options={}
|
5
|
-
super proxy, want, options.merge(
|
6
|
-
type: ['StatusResponse','MessageNotAck'],
|
7
|
-
title: 'status response'
|
8
|
-
)
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
module RSMP
|
2
|
-
# Class for waiting for specific status responses
|
3
|
-
class StatusUpdateCollector < StatusUpdateOrResponseCollector
|
4
|
-
def initialize proxy, want, options={}
|
5
|
-
super proxy, want, options.merge(
|
6
|
-
type: ['StatusUpdate','MessageNotAck'],
|
7
|
-
title:'status update'
|
8
|
-
)
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module RSMP
|
2
|
-
# Base class for waiting for status updates or responses
|
3
|
-
class StatusUpdateOrResponseCollector < StateCollector
|
4
|
-
def initialize proxy, want, options={}
|
5
|
-
super proxy, want, options.merge
|
6
|
-
end
|
7
|
-
|
8
|
-
def build_query want
|
9
|
-
RSMP::StatusQuery.new want
|
10
|
-
end
|
11
|
-
|
12
|
-
# Get items, in our case status values
|
13
|
-
def get_items message
|
14
|
-
message.attributes['sS']
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|