rsmp 0.9.6 → 0.9.7
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 +1 -1
- data/config/tlc.yaml +5 -0
- data/lib/rsmp/error.rb +3 -0
- data/lib/rsmp/tlc/traffic_controller.rb +18 -4
- 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: 9634c9a0b4e843d2f9d53f85023a51584a4686bea45aeb4cc74dbca7d63a117b
|
4
|
+
data.tar.gz: 598c15d07dc9dd22bda5e4901e2537b902b675af9a88281c2dae9b494d41a52f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 990b18990bc24622bdceb84c9f19a247fb3c6e6cca82fb0a4019e1aa1da7f33503f182ebd4d7789ab890c4d9d51c83062f7f6ff8ab96681bc8cd98cc626418e8
|
7
|
+
data.tar.gz: 20d4a23d38c6cce0ce46fe7def72d90a822627f51800a82d90c06f433e7104d3336a1c300ba6462038c641d08378980ceb794dc0ec54a91d36a17b21d1bf589a
|
data/Gemfile.lock
CHANGED
data/config/tlc.yaml
CHANGED
data/lib/rsmp/error.rb
CHANGED
@@ -10,14 +10,15 @@ 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
|
-
@num_inputs =
|
20
|
+
@num_inputs = inputs['total']
|
21
|
+
@input_programming = inputs['programming']
|
21
22
|
@startup_sequence = startup_sequence
|
22
23
|
@live_output = live_output
|
23
24
|
reset
|
@@ -274,11 +275,24 @@ module RSMP
|
|
274
275
|
idx = input - 1
|
275
276
|
@input_activations[idx] = bool_string_to_digit arg['status']
|
276
277
|
recompute_input idx
|
277
|
-
|
278
|
+
activate = @input_activations[idx] == '1'
|
279
|
+
if activate
|
278
280
|
log "Activating input #{input}", level: :info
|
279
281
|
else
|
280
282
|
log "Deactivating input #{input}", level: :info
|
281
283
|
end
|
284
|
+
|
285
|
+
if @input_programming
|
286
|
+
actions = @input_programming[input]
|
287
|
+
if actions && actions['raise']
|
288
|
+
alarm_code = actions['raise']
|
289
|
+
if activate
|
290
|
+
log "Activating alarm #{alarm_code}, due to input #{input} programming", level: :info
|
291
|
+
else
|
292
|
+
log "Deactivating alarm #{alarm_code}, due to input #{input} programming", level: :info
|
293
|
+
end
|
294
|
+
end
|
295
|
+
end
|
282
296
|
end
|
283
297
|
|
284
298
|
def handle_m0007 arg
|
@@ -430,7 +444,7 @@ module RSMP
|
|
430
444
|
if reverting
|
431
445
|
log "Reverting to functional position #{mode} after timeout", level: :info
|
432
446
|
elsif timeout && timeout > 0
|
433
|
-
log "Switching to functional position #{mode} with timeout #{timeout}min", level: :info
|
447
|
+
log "Switching to functional position #{mode} with timeout #{(timeout/60).round(1)}min", level: :info
|
434
448
|
@previous_functional_position = @function_position
|
435
449
|
now = clock.now
|
436
450
|
@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