rsmp 0.18.1 → 0.19.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: c13ff840a61dbc75246df268480d7951f4ca33df2428029a57447e6fb22ea8f9
4
- data.tar.gz: a1aa8675badf8c95bc50dba84a214a06a15192fb8fb6ff8b4b6bc0e023cc1277
3
+ metadata.gz: 701cfd78320191f3eac511d2354805e3c6ae09fde33f8d4655f84a8c16bb1572
4
+ data.tar.gz: 42d496b37c21f574fe773000c8108895211995e2b1a116d9ef207cf15ae3fef8
5
5
  SHA512:
6
- metadata.gz: de8156a19d3d090deb7c44bdd915141a615dd405ad82e0c0ac5612097bffaf89f0986d379a83787b0ed2bb9c3bae67ff98108c4b42879ed7d5edac0e067294af
7
- data.tar.gz: 9c41f6118a666513e778fe549cd44b7ac22b94dc98dfe4ae9ae64a5b2583aa505b7addf65cd18afa5290449005c3ef9558f54a09bd7565b7faf51364d43812ef
6
+ metadata.gz: 70dfea6c8e226230e15e9d0465287e79131787a62ad7f5f43441e65fd9df1b440f3c9a9ac86a8162df43a141530533eb8f166ac73e49966841d881467d68c2ef
7
+ data.tar.gz: 8247714df9cf91560df02b13a8d0e108d2769f94eed345f87e7244eb9ac46120761c4603068c3a1478a7800d7bfd22a86cbc665f2aba2bba94378891daba4b8b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rsmp (0.18.1)
4
+ rsmp (0.19.0)
5
5
  async (~> 1.30.3)
6
6
  async-io (~> 1.33.0)
7
7
  colorize (~> 0.8.1)
@@ -14,7 +14,7 @@ module RSMP
14
14
  return false if super(message) == false
15
15
 
16
16
  # match fixed attributes
17
- %w{aCId aSp ack aS sS cat pri}.each do |key|
17
+ %w{cId aCId aSp ack aS sS cat pri}.each do |key|
18
18
  want = @query[key]
19
19
  got = message.attribute(key)
20
20
  case want
data/lib/rsmp/proxy.rb CHANGED
@@ -299,13 +299,9 @@ module RSMP
299
299
  latest = @latest_watchdog_received + timeout
300
300
  left = latest - now
301
301
  if left < 0
302
- str = "No Watchdog within #{timeout} seconds"
303
- log str, level: :error
304
- begin
305
- close # this will stop the current task (ourself)
306
- ensure
307
- notify_error MissingWatchdog.new(str) # but ensure block will still be reached
308
- end
302
+ str = "No Watchdog received within #{timeout} seconds"
303
+ log str, level: :warning
304
+ notify MissingWatchdog.new(str)
309
305
  end
310
306
  end
311
307
 
@@ -298,16 +298,21 @@ module RSMP
298
298
 
299
299
  def input_logic input, change
300
300
  return unless @input_programming && change != nil
301
- actions = @input_programming[input]
302
- return unless actions
303
- if actions['raise']
304
- alarm_code = actions['raise']
301
+ action = @input_programming[input]
302
+ return unless action
303
+ if action['raise_alarm']
304
+ if action['component']
305
+ component = node.find_component action['component']
306
+ else
307
+ component = node.main
308
+ end
309
+ alarm_code = action['raise_alarm']
305
310
  if change
306
- log "Activating input #{input} is programmed to activate alarm #{alarm_code}", level: :info
307
- activate_alarm alarm_code
311
+ log "Activating input #{input} is programmed to raise alarm #{alarm_code} on #{component.c_id}", level: :info
312
+ component.activate_alarm alarm_code
308
313
  else
309
- log "Deactivating input #{input} is programmed to deactivate alarm #{alarm_code}", level: :info
310
- deactivate_alarm alarm_code
314
+ log "Deactivating input #{input} is programmed to clear alarm #{alarm_code} on #{component.c_id}", level: :info
315
+ component.deactivate_alarm alarm_code
311
316
  end
312
317
  end
313
318
  end
data/lib/rsmp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RSMP
2
- VERSION = "0.18.1"
2
+ VERSION = "0.19.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.18.1
4
+ version: 0.19.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: 2023-04-27 00:00:00.000000000 Z
11
+ date: 2023-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async