rsmp 0.9.5 → 0.9.8
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 +30 -7
- 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: 34b503622433b88389b62af2deca5e8c296fb305701ed1a8ed92b9b32dfe8893
|
4
|
+
data.tar.gz: b76db428241ac087692925b5b259f55e40145a13f0436e56be4eb698688b6edb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb0a905c3129dfa6960178fe427490950d10f4d04dd58ece46cea4ccfb318abffd18835b6a7b4cbefeb80103542be68c1a258687b97f632bbaa574cff409f73c
|
7
|
+
data.tar.gz: 87e9b41facacfd9170874c1a19f5a3738261d55b8cd4eeecc53c51c5a540c0c6503e3756f8bdaa59dbf5eb7393c66ae5d61e93f77a58ad0bbe634a1886076061
|
data/Gemfile.lock
CHANGED
data/config/tlc.yaml
CHANGED
data/lib/rsmp/error.rb
CHANGED
@@ -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
|
@@ -268,14 +276,29 @@ module RSMP
|
|
268
276
|
def handle_m0006 arg
|
269
277
|
@node.verify_security_code 2, arg['securityCode']
|
270
278
|
input = arg['input'].to_i
|
279
|
+
unless input>0 && input<=@num_inputs
|
280
|
+
raise MessageRejected.new("Input #{idx} is invalid, must be in the range 1-#{@num_inputs}")
|
281
|
+
end
|
271
282
|
idx = input - 1
|
272
|
-
return unless idx>=0 && input<@num_inputs # TODO should NotAck
|
273
283
|
@input_activations[idx] = bool_string_to_digit arg['status']
|
274
284
|
recompute_input idx
|
275
|
-
|
276
|
-
|
285
|
+
activate = @input_activations[idx] == '1'
|
286
|
+
if activate
|
287
|
+
log "Activating input #{input}", level: :info
|
277
288
|
else
|
278
|
-
log "Deactivating input #{
|
289
|
+
log "Deactivating input #{input}", level: :info
|
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
|
279
302
|
end
|
280
303
|
end
|
281
304
|
|
@@ -428,7 +451,7 @@ module RSMP
|
|
428
451
|
if reverting
|
429
452
|
log "Reverting to functional position #{mode} after timeout", level: :info
|
430
453
|
elsif timeout && timeout > 0
|
431
|
-
log "Switching to functional position #{mode} with timeout #{timeout}min", level: :info
|
454
|
+
log "Switching to functional position #{mode} with timeout #{(timeout/60).round(1)}min", level: :info
|
432
455
|
@previous_functional_position = @function_position
|
433
456
|
now = clock.now
|
434
457
|
@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