rsmp 0.9.10 → 0.10.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f9afdedb545513c5574db59a28f07515866dbd34d8908767813275518ee590cd
4
- data.tar.gz: e6fa96a531f450ce114601a57f91045ade415bb9317c5155a57a05054acf6481
3
+ metadata.gz: 966835905e623249647c1c09a2571ffe81e42a4d28b7f61630f11dbd886f5e60
4
+ data.tar.gz: 134c264fdbeddd2a2dd72613ccb96d9476f732ecff086ae274bb0bc25a381e5c
5
5
  SHA512:
6
- metadata.gz: c3a2fbb33b4789e0cc0200156f759014eab17b51a23f78e486fd8fa67e54da1ac241bdd1c1b6c77ce0b0534d8447607b8806105433920ef7d00733183c2e67de
7
- data.tar.gz: c6cf57cc0b98b54c541293283b7810de1ce218a3c22454d925db5727706b1d29793493d2cc0bff6f96e932c8dc6e9f5dffab005ebba79785617f9292c056575c
6
+ metadata.gz: '04027059289848f757e10b46b5cc9ba15ade51460cdaaa80d442945dd79a3300f676a593a6cc3ec29c945f9340664855cca3304188cbef99f89531820731004f'
7
+ data.tar.gz: a04881e95b77482897ccd746047847e3036953515d02539fb2988b1a743135ebf0d6c66d1f15c39c46d7d3bfd8c5df67568bddf58ac26df3fee5fca5f00d3dd4
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.10.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:
@@ -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.10.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
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.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emil Tin