rsmp 0.13.9 → 0.14.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: '08492adc58ab046ad5b4ff844ce630aa3dba8962b768ec1787b4867c9d221a38'
4
- data.tar.gz: a3f3d1182268d14369bbca723b3bc72cc1969327a4e0c3a6c268f7e920b0b1bb
3
+ metadata.gz: ff38488f573505ba26ab81c6f586c341a40bc6d00999b33fb97226c48d989dc1
4
+ data.tar.gz: 5c9d199fcbd87090a65d2148efe02a2521d726a272c0b20a0756570961439c6f
5
5
  SHA512:
6
- metadata.gz: 3a1379ea993e6bb1bce084a27fd347db40859113b1d55cbfac6c175e9f66ba47b95aa1f2a41cdd933c4dcc2c0174a217861c13c88f3491b2e5c40bcb393cdcdb
7
- data.tar.gz: ed45664a849d801cb9ab385365653055349c4ce4138c701ff5bf3413f71289524fdac532bd14d1b2b6a6d06db964529cef5ac845343428eea061143a440e9f04
6
+ metadata.gz: 9f5dd8a06e3d7684eed3653b0b6b810e2d75f9447078dc93504a2aebd30bdb5b2ede91a7d8b5c3e30e4e2687e0e3c3faf1b5fc625c1b5c197f9a58b77a49f009
7
+ data.tar.gz: 503e4e15aec9293d4c1b0d057e57f79ed67680db3321ea7c6d513b4290c231da38c3d531f8ac32cf1bc4da649631c54c5374c6a388e90f1646ce3251e40dfd4d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rsmp (0.13.9)
4
+ rsmp (0.14.0)
5
5
  async (~> 1.30.3)
6
6
  async-io (~> 1.33.0)
7
7
  colorize (~> 0.8.1)
@@ -80,7 +80,7 @@ GEM
80
80
  nio4r (2.5.8)
81
81
  rake (13.0.6)
82
82
  regexp_parser (2.5.0)
83
- rsmp_schemer (0.4.2)
83
+ rsmp_schemer (0.5.0)
84
84
  json_schemer (~> 0.2.21)
85
85
  rspec (3.10.0)
86
86
  rspec-core (~> 3.10.0)
@@ -25,6 +25,8 @@ module RSMP
25
25
  sCI, n, s, q = item['sCI'], item['n'], item['s'], item['q']
26
26
  uRt = subscription_list.dig(c_id,sCI,n,'uRt')
27
27
  next if uRt.to_i > 0
28
+ sOc = subscription_list.dig(c_id,sCI,n,'sOc')
29
+ next if sOc == 'False'
28
30
  next if @allow_repeat_updates[sCI] && @allow_repeat_updates[sCI].include?(n)
29
31
  new_values = {'s'=>s,'q'=>q}
30
32
  old_values = @statuses.dig(sCI,n)
@@ -31,9 +31,9 @@ module RSMP
31
31
  if item['list']
32
32
  case item['type']
33
33
  when "boolean"
34
- out["$ref"] = "../../core/definitions.json#/boolean_list"
34
+ out["$ref"] = "../../../core/3.1.1/definitions.json#/boolean_list"
35
35
  when "integer", "ordinal", "unit", "scale", "long"
36
- out["$ref"] = "../../core/definitions.json#/integer_list"
36
+ out["$ref"] = "../../../core/3.1.1/definitions.json#/integer_list"
37
37
  else
38
38
  raise "Error: List of #{item['type']} is not supported: #{item.inspect}"
39
39
  end
@@ -51,11 +51,11 @@ module RSMP
51
51
  when "string", "base64"
52
52
  out["type"] = "string"
53
53
  when "boolean"
54
- out["$ref"] = "../../core/definitions.json#/boolean"
54
+ out["$ref"] = "../../../core/3.1.1/definitions.json#/boolean"
55
55
  when "timestamp"
56
- out["$ref"] = "../../core/definitions.json#/timestamp"
56
+ out["$ref"] = "../../../core/3.1.1/definitions.json#/timestamp"
57
57
  when "integer", "ordinal", "unit", "scale", "long"
58
- out["$ref"] = "../../core/definitions.json#/integer"
58
+ out["$ref"] = "../../../core/3.1.1/definitions.json#/integer"
59
59
  else
60
60
  out["type"] = "string"
61
61
  end
@@ -153,9 +153,11 @@ module RSMP
153
153
  out["commands/#{key}.json"] = output_json json
154
154
  end
155
155
 
156
- def self.output_root out
156
+ def self.output_root out, meta
157
157
  json = {
158
- "description"=> "A schema validatating message against the RSMP SXL for Traffic Light Controllers",
158
+ "name"=> meta['name'],
159
+ "description"=> meta['description'],
160
+ "version"=> meta['version'],
159
161
  "allOf" => [
160
162
  {
161
163
  "if" => { "required" => ["type"], "properties" => { "type" => { "const" => "CommandRequest" }}},
@@ -180,7 +182,7 @@ module RSMP
180
182
 
181
183
  def self.generate sxl
182
184
  out = {}
183
- output_root out
185
+ output_root out, sxl[:meta]
184
186
  output_alarms out, sxl[:alarms]
185
187
  output_statuses out, sxl[:statuses]
186
188
  output_commands out, sxl[:commands]
@@ -19,15 +19,18 @@ module RSMP
19
19
 
20
20
  def self.convert yaml
21
21
  sxl = {
22
+ meta: {},
22
23
  alarms: {},
23
24
  statuses: {},
24
25
  commands: {}
25
26
  }
26
27
 
28
+ sxl[:meta] = yaml['meta']
29
+
27
30
  yaml['objects'].each_pair do |type,object|
28
- object["alarms"].each { |id,item| sxl[:alarms][id] = item }
29
- object["statuses"].each { |id,item| sxl[:statuses][id] = item }
30
- object["commands"].each { |id,item| sxl[:commands][id] = item }
31
+ object["alarms"].each { |id,item| sxl[:alarms][id] = item } if object["alarms"]
32
+ object["statuses"].each { |id,item| sxl[:statuses][id] = item } if object["statuses"]
33
+ object["commands"].each { |id,item| sxl[:commands][id] = item } if object["commands"]
31
34
  end
32
35
  sxl
33
36
  end
@@ -212,7 +212,7 @@ module RSMP
212
212
 
213
213
  # additional items can be used when verifying the response,
214
214
  # but must be removed from the subscribe message
215
- subscribe_list = status_list.map { |item| item.slice('sCI','n','uRt') }
215
+ subscribe_list = status_list.map { |item| item.slice('sCI','n','uRt','sOc') }
216
216
 
217
217
  # update our subcription list
218
218
  @status_subscriptions[component_id] ||= {}
@@ -220,9 +220,11 @@ module RSMP
220
220
  sCI = item["sCI"]
221
221
  n = item["n"]
222
222
  uRt = item["uRt"]
223
+ sOc = item["sOc"]
223
224
  @status_subscriptions[component_id][sCI] ||= {}
224
225
  @status_subscriptions[component_id][sCI][n] ||= {}
225
226
  @status_subscriptions[component_id][sCI][n]['uRt'] = uRt
227
+ @status_subscriptions[component_id][sCI][n]['sOc'] = sOc
226
228
  end
227
229
 
228
230
  component = find_component component_id
data/lib/rsmp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RSMP
2
- VERSION = "0.13.9"
2
+ VERSION = "0.14.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.13.9
4
+ version: 0.14.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-08-08 00:00:00.000000000 Z
11
+ date: 2022-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async