rsmp 0.13.2 → 0.13.3

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: dfc37b07159cf717f60f293434f6fda0ff6935ad209967b7d5ddb025a9794600
4
- data.tar.gz: 5c5e6b1e7728bdffd50776e95a7beb0fd6261dbb58b4ec3f530f7b33ee15cdf4
3
+ metadata.gz: a7fbae6ef01f7b0d6149360423fb4de524584cf74c7fbf1f5300ebd4115a43e3
4
+ data.tar.gz: 879d0da2780de89a5ef563b62ca36c4728313389671da5e33d0011c94bba9dac
5
5
  SHA512:
6
- metadata.gz: 201cad0d07ee914d79af82d8ad2ee10740fbe49002e1f3cbb2740b3d573df61c26532688651e6f6f70ea538e0475f51cbe0a46055b2b6331cd5fff48aa4b8d3e
7
- data.tar.gz: 74a44c4ac848c9dbe5f0fbd772f2839c5565a8322d7292218d64f7e31f5fdf8e4849e59845fee361d0ca1ed0ecaa2ce067fdc71a86eaf0e50959e0d826742b2f
6
+ metadata.gz: 2e905d13e37c7af948dc978cbb84257aeb7d292e605f9f98238a81311eb2344e37a1b3699998c75bef81ce844bb28564cecc581c6a3410a2cce76c558e7d6c6c
7
+ data.tar.gz: c2d737778d4e08f0c80a94af80953d47af23e93ca576ee9f468113c985b89221c8cf6a42bade00e99b5ded549bbe48fdb10541c8e721a061f4b5f8dac672036d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rsmp (0.13.2)
4
+ rsmp (0.13.3)
5
5
  async (~> 1.29.1)
6
6
  async-io (~> 1.32.2)
7
7
  colorize (~> 0.8.1)
@@ -1,7 +1,7 @@
1
1
  module RSMP
2
2
  # A proxy to a remote RSMP component.
3
3
  class ComponentProxy < ComponentBase
4
- def initialize node:, id:, grouped: false
4
+ def initialize node:, id:, ntsOId: nil, xNId: nil, grouped: false
5
5
  super
6
6
  @alarms = {}
7
7
  @statuses = {}
@@ -2,10 +2,11 @@
2
2
 
3
3
  module RSMP
4
4
  module Components
5
- attr_reader :components
5
+ attr_reader :components, :main
6
6
 
7
7
  def initialize_components
8
8
  @components = {}
9
+ @main = nil
9
10
  end
10
11
 
11
12
  def aggregated_status_changed component, options={}
@@ -18,6 +19,7 @@ module RSMP
18
19
  if components_by_type
19
20
  components_by_type.each_pair do |id,settings|
20
21
  @components[id] = build_component(id:id, type:type, settings:settings)
22
+ @main = @components[id] if type=='main'
21
23
  end
22
24
  end
23
25
  end
@@ -36,10 +38,6 @@ module RSMP
36
38
  @components[component.c_id] = component
37
39
  end
38
40
 
39
- #def build_component id:, type:, settings:{}
40
- # Component.new id:id, node: self, grouped: type=='main'
41
- #end
42
-
43
41
  def infer_component_type component_id
44
42
  Component
45
43
  end
data/lib/rsmp/proxy.rb CHANGED
@@ -438,7 +438,6 @@ module RSMP
438
438
  end
439
439
 
440
440
  def will_not_handle message
441
- "WILL NOT HANDLE"
442
441
  reason = "since we're a #{self.class.name.downcase}" unless reason
443
442
  log "Ignoring #{message.type}, #{reason}", message: message, level: :warning
444
443
  dont_acknowledge message, nil, reason
@@ -645,9 +644,9 @@ module RSMP
645
644
  end
646
645
 
647
646
  def set_nts_message_attributes message
648
- return unless @site && @site.main
649
- ntsOId = @site.main.ntsOId
650
- xNId = @site.main.xNId
647
+ return unless main
648
+ ntsOId = main.ntsOId
649
+ xNId = main.xNId
651
650
  message.attributes['ntsOId'] = ntsOId if ntsOId
652
651
  message.attributes['xNId'] = xNId if xNId
653
652
  end
data/lib/rsmp/site.rb CHANGED
@@ -161,7 +161,12 @@ module RSMP
161
161
  end
162
162
 
163
163
  def build_component id:, type:, settings:{}
164
- Component.new id:id, node: self, grouped: type=='main'
164
+ if type == 'main'
165
+ Component.new id:id, node: self, grouped: true,
166
+ ntsOId: settings['ntsOId'], xNId: settings['xNId']
167
+ else
168
+ Component.new id:id, node: self, grouped: false
169
+ end
165
170
  end
166
171
  end
167
172
  end
@@ -375,7 +375,12 @@ module RSMP
375
375
  end
376
376
 
377
377
  def build_component id:, type:, settings:{}
378
- ComponentProxy.new id:id, node: self, grouped: type=='main'
378
+ if type == 'main'
379
+ ComponentProxy.new id:id, node: self, grouped: true,
380
+ ntsOId: settings['ntsOId'], xNId: settings['xNId']
381
+ else
382
+ ComponentProxy.new id:id, node: self, grouped: false
383
+ end
379
384
  end
380
385
 
381
386
  end
@@ -254,6 +254,7 @@ module RSMP
254
254
  "cTS"=>clock.to_s,
255
255
  "rvs"=>rvs
256
256
  })
257
+ set_nts_message_attributes response
257
258
  acknowledge message
258
259
  send_message response
259
260
  end
@@ -272,6 +273,7 @@ module RSMP
272
273
  "sS"=>sS,
273
274
  "mId" => options[:m_id]
274
275
  })
276
+ set_nts_message_attributes response
275
277
  acknowledge message
276
278
  send_message response
277
279
  end
@@ -409,6 +411,7 @@ module RSMP
409
411
  "sTs"=>now,
410
412
  "sS"=>sS
411
413
  })
414
+ set_nts_message_attributes update
412
415
  send_message update
413
416
  store_last_sent_status update
414
417
  end
@@ -429,5 +432,8 @@ module RSMP
429
432
  def check_sxl_version message
430
433
  end
431
434
 
435
+ def main
436
+ @site.main
437
+ end
432
438
  end
433
439
  end
@@ -15,7 +15,7 @@ module RSMP
15
15
 
16
16
  super options
17
17
 
18
- unless @main
18
+ unless main
19
19
  raise ConfigurationError.new "TLC must have a main component"
20
20
  end
21
21
 
@@ -24,7 +24,7 @@ module RSMP
24
24
  def start
25
25
  super
26
26
  start_tlc_timer
27
- @main.initiate_startup_sequence
27
+ main.initiate_startup_sequence
28
28
  end
29
29
 
30
30
  def stop_subtasks
@@ -52,7 +52,7 @@ module RSMP
52
52
  def build_component id:, type:, settings:{}
53
53
  component = case type
54
54
  when 'main'
55
- @main = TrafficController.new node: self,
55
+ TrafficController.new node: self,
56
56
  id: id,
57
57
  ntsOId: settings['ntsOId'],
58
58
  xNId: settings['xNId'],
@@ -63,11 +63,11 @@ module RSMP
63
63
  inputs: @site_settings['inputs']
64
64
  when 'signal_group'
65
65
  group = SignalGroup.new node: self, id: id
66
- @main.add_signal_group group
66
+ main.add_signal_group group
67
67
  group
68
68
  when 'detector_logic'
69
69
  logic = DetectorLogic.new node: self, id: id
70
- @main.add_detector_logic logic
70
+ main.add_detector_logic logic
71
71
  logic
72
72
  end
73
73
  end
@@ -112,8 +112,8 @@ module RSMP
112
112
  end
113
113
 
114
114
  def timer now
115
- return unless @main
116
- @main.timer now
115
+ return unless main
116
+ main.timer now
117
117
  end
118
118
 
119
119
  def verify_security_code level, code
data/lib/rsmp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RSMP
2
- VERSION = "0.13.2"
2
+ VERSION = "0.13.3"
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.13.2
4
+ version: 0.13.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emil Tin