rsmp 0.9.2 → 0.9.3
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/collect/alarm_collector.rb +20 -0
- data/lib/rsmp/collect/alarm_query.rb +15 -0
- data/lib/rsmp/site_proxy.rb +0 -9
- data/lib/rsmp/version.rb +1 -1
- data/lib/rsmp.rb +2 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4eb81e9be58fe5645d41ffe88fad923aac8ba5db14382ce0532d17721b18b0c
|
4
|
+
data.tar.gz: 806810e243027d1349631b1b0153c452557e9b7ad01470ff51376c6a181a3810
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfa09b0e9692c42999c97866166631e5e805c16741af046b21670a5cdaad862afa9fd532d266877da1c623b0ebb42f4d23854bac9dcb1884e095dabf6027b97a
|
7
|
+
data.tar.gz: 493156ab24d418536dd57a5d0a68d008320b9c896e99b33e9ed6023c061f597467569865645895b106f3e13423c686f5c3c89c2177cafbd28a1707c387a5a00c
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
module RSMP
|
2
|
+
# Class for waiting for specific command responses
|
3
|
+
class AlarmCollector < Collector
|
4
|
+
def initialize proxy, want, options={}
|
5
|
+
@want = want
|
6
|
+
super proxy, options.merge(
|
7
|
+
type: 'Alarm',
|
8
|
+
title:'alarm'
|
9
|
+
)
|
10
|
+
end
|
11
|
+
|
12
|
+
def type_match? message
|
13
|
+
return false if super(message) == false
|
14
|
+
[:aCId, :aSp, :ack, :aS, :sS, :cat, :pri].each do |key|
|
15
|
+
return false if @want[key] && @want[key] != message.attribute(key.to_s)
|
16
|
+
end
|
17
|
+
true
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module RSMP
|
2
|
+
# Match a specific alarm
|
3
|
+
class AlarmQuery < Query
|
4
|
+
# Match an alarm value against a query
|
5
|
+
def match? item
|
6
|
+
return false if @want['n'] && @want['n'] != item['n']
|
7
|
+
if @want['v'].is_a? Regexp
|
8
|
+
return false if item['v'] !~ @want['v']
|
9
|
+
elsif @want['v']
|
10
|
+
return false if item['v'] != @want['v']
|
11
|
+
end
|
12
|
+
true
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/rsmp/site_proxy.rb
CHANGED
@@ -346,14 +346,5 @@ module RSMP
|
|
346
346
|
@supervisor.notify_error e, options if @supervisor
|
347
347
|
distribute_error e, options
|
348
348
|
end
|
349
|
-
|
350
|
-
def collect_alarms options={}
|
351
|
-
collect(@task,options.merge(type: "Alarm")) do |alarm|
|
352
|
-
next if options[:aCId] && options[:aCId] != alarm.attribute("aCId")
|
353
|
-
next if options[:aSp] && options[:aSp] != alarm.attribute("aSp")
|
354
|
-
next if options[:aS] && options[:aS] != alarm.attribute("aS")
|
355
|
-
:keep
|
356
|
-
end
|
357
|
-
end
|
358
349
|
end
|
359
350
|
end
|
data/lib/rsmp/version.rb
CHANGED
data/lib/rsmp.rb
CHANGED
@@ -25,9 +25,11 @@ require 'rsmp/collect/filter'
|
|
25
25
|
require 'rsmp/collect/query'
|
26
26
|
require 'rsmp/collect/status_query'
|
27
27
|
require 'rsmp/collect/command_query'
|
28
|
+
require 'rsmp/collect/alarm_query'
|
28
29
|
require 'rsmp/collect/status_collector'
|
29
30
|
require 'rsmp/collect/command_response_collector'
|
30
31
|
require 'rsmp/collect/aggregated_status_collector'
|
32
|
+
require 'rsmp/collect/alarm_collector'
|
31
33
|
require 'rsmp/component'
|
32
34
|
require 'rsmp/site'
|
33
35
|
require 'rsmp/proxy'
|
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.9.
|
4
|
+
version: 0.9.3
|
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-
|
11
|
+
date: 2022-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|
@@ -211,6 +211,8 @@ files:
|
|
211
211
|
- lib/rsmp/archive.rb
|
212
212
|
- lib/rsmp/cli.rb
|
213
213
|
- lib/rsmp/collect/aggregated_status_collector.rb
|
214
|
+
- lib/rsmp/collect/alarm_collector.rb
|
215
|
+
- lib/rsmp/collect/alarm_query.rb
|
214
216
|
- lib/rsmp/collect/collector.rb
|
215
217
|
- lib/rsmp/collect/command_query.rb
|
216
218
|
- lib/rsmp/collect/command_response_collector.rb
|