rsmp 0.9.10 → 0.11.0
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 +1 -0
- data/lib/rsmp/collect/alarm_collector.rb +8 -1
- data/lib/rsmp/component.rb +22 -0
- data/lib/rsmp/site.rb +6 -0
- data/lib/rsmp/supervisor_proxy.rb +6 -0
- data/lib/rsmp/tlc/traffic_controller.rb +2 -0
- data/lib/rsmp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1710b4aeba40d7f888921f76e2b09ffe5b7372f34d6e4360ccab5b7786b39ab
|
4
|
+
data.tar.gz: 275ab0407885ed7b0b6aa1e3b12d257914ee09b6c1de65591189a88f07e40e93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 171a4a1da3fe6a4b88a8efc48f51dbb78456261b41df943d77d1fbfb5df71568dd22978a0966d099e6e62bd870ad2ce252138df56790352d8647ab98039535f7
|
7
|
+
data.tar.gz: 8829abe372e8dedeb8e81a79380ae62398e31814e96cd3e5e3f086db2d25d5dcd6127e628034bb04117e460d33600f7a5139380aebefb55289fadcb76555d73c
|
data/Gemfile.lock
CHANGED
data/config/tlc.yaml
CHANGED
@@ -14,7 +14,14 @@ module RSMP
|
|
14
14
|
|
15
15
|
# match fixed attributes
|
16
16
|
%w{aCId aSp ack aS sS cat pri}.each do |key|
|
17
|
-
|
17
|
+
want = @query[key]
|
18
|
+
got = message.attribute(key)
|
19
|
+
case want
|
20
|
+
when Regexp
|
21
|
+
return false if got !~ want
|
22
|
+
when String
|
23
|
+
return false if got != want
|
24
|
+
end
|
18
25
|
end
|
19
26
|
|
20
27
|
# match rvs items
|
data/lib/rsmp/component.rb
CHANGED
@@ -77,6 +77,7 @@ module RSMP
|
|
77
77
|
raise UnknownStatus.new "Status #{status_code}/#{status_name} not implemented by #{self.class}"
|
78
78
|
end
|
79
79
|
|
80
|
+
# handle incoming alarm
|
80
81
|
def handle_alarm message
|
81
82
|
code = message.attribute('aCId')
|
82
83
|
previous = @alarms[code]
|
@@ -92,6 +93,27 @@ module RSMP
|
|
92
93
|
@alarms[code] = message
|
93
94
|
end
|
94
95
|
|
96
|
+
# set alarm
|
97
|
+
def send_alarm code:, status:
|
98
|
+
# TODO
|
99
|
+
# we need to manage the state of alarms internally (an ALarm class probably),
|
100
|
+
# and handle request from the supervisor to suspend and resume alarms etc.
|
101
|
+
# when this state changes, we then send an alarm message
|
102
|
+
alarm = Alarm.new(
|
103
|
+
'cId' => c_id,
|
104
|
+
'aTs' => @node.clock.to_s,
|
105
|
+
'aCId' => code,
|
106
|
+
'aSp' => 'Issue',
|
107
|
+
'ack' => 'Acknowledged',
|
108
|
+
'sS' => 'notSuspended',
|
109
|
+
'aS' => status,
|
110
|
+
'cat' => 'D',
|
111
|
+
'pri' => '2',
|
112
|
+
'rvs' => []
|
113
|
+
)
|
114
|
+
@node.alarm_changed self, alarm
|
115
|
+
end
|
116
|
+
|
95
117
|
# Handle an incoming status respone, by storing the values
|
96
118
|
def handle_status_response message
|
97
119
|
store_status message, check_repeated: false
|
data/lib/rsmp/site.rb
CHANGED
@@ -93,6 +93,12 @@ module RSMP
|
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
96
|
+
def alarm_changed component, alarm
|
97
|
+
@proxies.each do |proxy|
|
98
|
+
proxy.send_alarm component, alarm if proxy.ready?
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
96
102
|
def connect_to_supervisor task, supervisor_settings
|
97
103
|
proxy = build_proxy({
|
98
104
|
site: self,
|
@@ -172,6 +172,12 @@ module RSMP
|
|
172
172
|
end
|
173
173
|
end
|
174
174
|
|
175
|
+
def send_alarm component, alarm, options={}
|
176
|
+
send_and_optionally_collect alarm, options do |collect_options|
|
177
|
+
Collector.new self, collect_options.merge(task:@task, type: 'MessageAck')
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
175
181
|
def process_aggregated_status message
|
176
182
|
se = message.attribute("se")
|
177
183
|
validate_aggregated_status(message,se) == false
|
@@ -264,8 +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
|
+
send_alarm code:alarm_code, status:'Active'
|
267
268
|
else
|
268
269
|
log "Deactivating alarm #{alarm_code}, because input #{input} was deactivated", level: :info
|
270
|
+
send_alarm code:alarm_code, status:'inActive'
|
269
271
|
end
|
270
272
|
end
|
271
273
|
end
|
data/lib/rsmp/version.rb
CHANGED
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.
|
4
|
+
version: 0.11.0
|
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-03-
|
11
|
+
date: 2022-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|