rsmp 0.9.6 → 0.9.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/config/tlc.yaml +5 -0
- data/lib/rsmp/error.rb +3 -0
- data/lib/rsmp/site_proxy.rb +1 -1
- data/lib/rsmp/tlc/traffic_controller.rb +29 -9
- data/lib/rsmp/tlc/traffic_controller_site.rb +2 -1
- data/lib/rsmp/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: 71af49e549129bf32f9137a2799c91b43ba19e5e7adb15f777a181919c19dbd0
|
4
|
+
data.tar.gz: 15c8f8c96ed3838f0b0b948b5d0e9be895ec965a9f651a529a44b214426242ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33206373986495e8c8d9871c83d465d2961db86c2713e0056eb1e5a0fb6f153dc506c05f549bc52f6963f7aeb7e1b7f78f387b479893babe8f0d77cd0efbffe3
|
7
|
+
data.tar.gz: 125e125b49bb0a5d99234d8aa4bac4a3107de077fb7adc55a1e70cbf0544c0b163355cfac4a94eeae1e412b8951e4f5fab8d2846187e2d7479c626e0adf81530
|
data/Gemfile.lock
CHANGED
data/config/tlc.yaml
CHANGED
data/lib/rsmp/error.rb
CHANGED
data/lib/rsmp/site_proxy.rb
CHANGED
@@ -72,7 +72,7 @@ module RSMP
|
|
72
72
|
else
|
73
73
|
super message
|
74
74
|
end
|
75
|
-
rescue RSMP::RepeatedAlarmError, RSMP::RepeatedStatusError => e
|
75
|
+
rescue RSMP::RepeatedAlarmError, RSMP::RepeatedStatusError, RSMP::TimestampError => e
|
76
76
|
str = "Rejected #{message.type} message,"
|
77
77
|
dont_acknowledge message, str, "#{e}"
|
78
78
|
notify_error e.exception("#{str}#{e.message} #{message.json}")
|
@@ -10,14 +10,22 @@ module RSMP
|
|
10
10
|
:startup_sequence_active, :startup_sequence, :startup_sequence_pos
|
11
11
|
|
12
12
|
def initialize node:, id:, cycle_time: 10, signal_plans:,
|
13
|
-
startup_sequence:, live_output:nil
|
13
|
+
startup_sequence:, live_output:nil, inputs:{}
|
14
14
|
super node: node, id: id, grouped: true
|
15
15
|
@signal_groups = []
|
16
16
|
@detector_logics = []
|
17
17
|
@plans = signal_plans
|
18
18
|
@cycle_time = cycle_time
|
19
19
|
@num_traffic_situations = 1
|
20
|
-
|
20
|
+
|
21
|
+
if inputs
|
22
|
+
@num_inputs = inputs['total'] || 8
|
23
|
+
@input_programming = inputs['programming']
|
24
|
+
else
|
25
|
+
@num_inputs = 8
|
26
|
+
@input_programming = nil
|
27
|
+
end
|
28
|
+
|
21
29
|
@startup_sequence = startup_sequence
|
22
30
|
@live_output = live_output
|
23
31
|
reset
|
@@ -274,11 +282,24 @@ module RSMP
|
|
274
282
|
idx = input - 1
|
275
283
|
@input_activations[idx] = bool_string_to_digit arg['status']
|
276
284
|
recompute_input idx
|
277
|
-
|
285
|
+
activate = @input_activations[idx] == '1'
|
286
|
+
if activate
|
278
287
|
log "Activating input #{input}", level: :info
|
279
288
|
else
|
280
289
|
log "Deactivating input #{input}", level: :info
|
281
290
|
end
|
291
|
+
|
292
|
+
if @input_programming
|
293
|
+
actions = @input_programming[input]
|
294
|
+
if actions && actions['raise']
|
295
|
+
alarm_code = actions['raise']
|
296
|
+
if activate
|
297
|
+
log "Activating alarm #{alarm_code}, due to input #{input} programming", level: :info
|
298
|
+
else
|
299
|
+
log "Deactivating alarm #{alarm_code}, due to input #{input} programming", level: :info
|
300
|
+
end
|
301
|
+
end
|
302
|
+
end
|
282
303
|
end
|
283
304
|
|
284
305
|
def handle_m0007 arg
|
@@ -359,9 +380,8 @@ module RSMP
|
|
359
380
|
@node.verify_security_code 2, arg['securityCode']
|
360
381
|
input = arg['input'].to_i
|
361
382
|
idx = input - 1
|
362
|
-
unless
|
363
|
-
|
364
|
-
return
|
383
|
+
unless input>0 && input<=@num_inputs
|
384
|
+
raise MessageRejected.new("Can't force input #{input}, only have #{@num_inputs} inputs")
|
365
385
|
end
|
366
386
|
@input_forced[idx] = bool_string_to_digit arg['status']
|
367
387
|
if @input_forced[idx]
|
@@ -369,9 +389,9 @@ module RSMP
|
|
369
389
|
end
|
370
390
|
recompute_input idx
|
371
391
|
if @input_forced[idx]
|
372
|
-
log "Forcing input #{
|
392
|
+
log "Forcing input #{input} to #{@input_forced_values[idx]}", level: :info
|
373
393
|
else
|
374
|
-
log "Releasing input #{
|
394
|
+
log "Releasing input #{input}", level: :info
|
375
395
|
end
|
376
396
|
end
|
377
397
|
|
@@ -430,7 +450,7 @@ module RSMP
|
|
430
450
|
if reverting
|
431
451
|
log "Reverting to functional position #{mode} after timeout", level: :info
|
432
452
|
elsif timeout && timeout > 0
|
433
|
-
log "Switching to functional position #{mode} with timeout #{timeout}min", level: :info
|
453
|
+
log "Switching to functional position #{mode} with timeout #{(timeout/60).round(1)}min", level: :info
|
434
454
|
@previous_functional_position = @function_position
|
435
455
|
now = clock.now
|
436
456
|
@functional_position_timeout = now + timeout
|
@@ -56,7 +56,8 @@ module RSMP
|
|
56
56
|
cycle_time: settings['cycle_time'],
|
57
57
|
startup_sequence: @startup_sequence,
|
58
58
|
signal_plans: @signal_plans,
|
59
|
-
live_output: @site_settings['live_output']
|
59
|
+
live_output: @site_settings['live_output'],
|
60
|
+
inputs: @site_settings['inputs']
|
60
61
|
when 'signal_group'
|
61
62
|
group = SignalGroup.new node: self, id: id
|
62
63
|
@main.add_signal_group group
|
data/lib/rsmp/version.rb
CHANGED