rsmp 0.12.1 → 0.12.2
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/lib/rsmp/alarm_state.rb +8 -0
- data/lib/rsmp/component.rb +23 -19
- data/lib/rsmp/site.rb +1 -1
- data/lib/rsmp/tlc/traffic_controller.rb +2 -2
- 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: 34c922ce1e22f31aabc3b476f1aa3d9a6eeaa4b89e4550255f237c5f5810b4e8
|
4
|
+
data.tar.gz: 95590c49d1ba70af34dfd913808239cea39b5dae0324003deb921c21a0bf0aa2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d1c8bfd469ae45764292bf3e2615bf95b1904229d34c2df0eb18ad496a7d1b6ecfd0aeff594f07a0bbf59c34d7b6247fc566e1a94d65412f78719e3f4f42b1b
|
7
|
+
data.tar.gz: 66edc8044373bca92cc52641f49c78f3336d4e5c6caa8615a8da05aad6176d8e2c6161a5d835716fe7feac38948a059b4de6ec1f772de3c1f992d8c7f76bc8e0
|
data/Gemfile.lock
CHANGED
data/lib/rsmp/alarm_state.rb
CHANGED
data/lib/rsmp/component.rb
CHANGED
@@ -20,31 +20,35 @@ module RSMP
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def suspend_alarm alarm_code
|
23
|
-
|
24
|
-
if alarm.suspended
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
else
|
29
|
-
log "Alarm #{alarm_code} already suspended", level: :info
|
30
|
-
end
|
23
|
+
alarm = get_alarm_state alarm_code
|
24
|
+
return if alarm.suspended
|
25
|
+
log "Suspending alarm #{alarm_code}", level: :info
|
26
|
+
alarm.suspend
|
27
|
+
@node.alarm_changed alarm
|
31
28
|
end
|
32
29
|
|
33
30
|
def resume_alarm alarm_code
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
else
|
40
|
-
log "Alarm #{alarm_code} not suspended", level: :info
|
41
|
-
end
|
31
|
+
alarm = get_alarm_state alarm_code
|
32
|
+
return unless alarm.suspended
|
33
|
+
log "Resuming alarm #{alarm_code}", level: :info
|
34
|
+
alarm.resume
|
35
|
+
@node.alarm_changed alarm
|
42
36
|
end
|
43
37
|
|
44
|
-
|
45
|
-
|
46
|
-
|
38
|
+
def activate_alarm alarm_code
|
39
|
+
alarm = get_alarm_state alarm_code
|
40
|
+
return if alarm.active
|
41
|
+
log "Activating alarm #{alarm_code}", level: :info
|
42
|
+
alarm.activate
|
43
|
+
@node.alarm_changed alarm
|
47
44
|
end
|
48
45
|
|
46
|
+
def deactivate_alarm alarm_code
|
47
|
+
alarm = get_alarm_state alarm_code
|
48
|
+
return unless alarm.active
|
49
|
+
log "Deactivating alarm #{alarm_code}", level: :info
|
50
|
+
alarm.deactivate
|
51
|
+
@node.alarm_changed alarm
|
52
|
+
end
|
49
53
|
end
|
50
54
|
end
|
data/lib/rsmp/site.rb
CHANGED
@@ -264,10 +264,10 @@ module RSMP
|
|
264
264
|
alarm_code = actions['raise']
|
265
265
|
if change
|
266
266
|
log "Activating alarm #{alarm_code}, because input #{input} was activated", level: :info
|
267
|
-
|
267
|
+
activate_alarm alarm_code
|
268
268
|
else
|
269
269
|
log "Deactivating alarm #{alarm_code}, because input #{input} was deactivated", level: :info
|
270
|
-
|
270
|
+
deactivate_alarm alarm_code
|
271
271
|
end
|
272
272
|
end
|
273
273
|
end
|
data/lib/rsmp/version.rb
CHANGED