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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f9afdedb545513c5574db59a28f07515866dbd34d8908767813275518ee590cd
4
- data.tar.gz: e6fa96a531f450ce114601a57f91045ade415bb9317c5155a57a05054acf6481
3
+ metadata.gz: e1710b4aeba40d7f888921f76e2b09ffe5b7372f34d6e4360ccab5b7786b39ab
4
+ data.tar.gz: 275ab0407885ed7b0b6aa1e3b12d257914ee09b6c1de65591189a88f07e40e93
5
5
  SHA512:
6
- metadata.gz: c3a2fbb33b4789e0cc0200156f759014eab17b51a23f78e486fd8fa67e54da1ac241bdd1c1b6c77ce0b0534d8447607b8806105433920ef7d00733183c2e67de
7
- data.tar.gz: c6cf57cc0b98b54c541293283b7810de1ce218a3c22454d925db5727706b1d29793493d2cc0bff6f96e932c8dc6e9f5dffab005ebba79785617f9292c056575c
6
+ metadata.gz: 171a4a1da3fe6a4b88a8efc48f51dbb78456261b41df943d77d1fbfb5df71568dd22978a0966d099e6e62bd870ad2ce252138df56790352d8647ab98039535f7
7
+ data.tar.gz: 8829abe372e8dedeb8e81a79380ae62398e31814e96cd3e5e3f086db2d25d5dcd6127e628034bb04117e460d33600f7a5139380aebefb55289fadcb76555d73c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rsmp (0.9.10)
4
+ rsmp (0.11.0)
5
5
  async (~> 1.29.1)
6
6
  async-io (~> 1.32.2)
7
7
  colorize (~> 0.8.1)
data/config/tlc.yaml CHANGED
@@ -15,6 +15,7 @@ components:
15
15
  B2:
16
16
  detector_logic:
17
17
  DL1:
18
+ DL2:
18
19
  signal_plans:
19
20
  1:
20
21
  dynamic_bands:
@@ -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
- return false if @query[key] && @query[key] != message.attribute(key)
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module RSMP
2
- VERSION = "0.9.10"
2
+ VERSION = "0.11.0"
3
3
  end
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.10
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 00:00:00.000000000 Z
11
+ date: 2022-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async