openc3 5.16.1 → 5.16.2

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.

Potentially problematic release.


This version of openc3 might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3ac82073ce5dfe75636cde46ad9bb2c0969653414ed774e02932f6f3c0d93ac5
4
- data.tar.gz: f372bc340015f6a32c9df038f8601f7be44e57782f95bfc9b8290592820b46e4
3
+ metadata.gz: 178d5ecd9984ee77cc79a3f4e6b84f793a863aa01dc1da87cb318ddff90f0397
4
+ data.tar.gz: cab3009043a7f423cd11f882f8639790d890588fae5ada6aa7dae868bf78b3ed
5
5
  SHA512:
6
- metadata.gz: 90152ca7620ed0f1a7c1292d12a89fa1fcc503e4320ca430da04d4fad2c586669baf9c6f5f61de5943d029ce4a7e67d2dab1cb3f59abd42bd158dce80a863cb9
7
- data.tar.gz: a5b1d9a4c815b8d2d3a9c6a35b351be0c3a0f25d9d89bbe53d1c76e510d39f7983c03fc26a3ee6010cee222b1675843782d6587fd8fcc6045abf298b7f461e6c
6
+ metadata.gz: f3197aabb417f5a467b4cbcdbb48c9a7523002ecf9b58930aa37a31d521abf5ce132b66c27a77ca14cb0676badeb42a8d689991e226be50577ddddccfced0a58
7
+ data.tar.gz: aa8749e4a08c4891a7aa4aa72d46474d5b4bfa17da047ef8f537b727fda31e9225dba24121e7680b6458fa5abfcdafdf6221d86b06d0adb9362f8bead3691496
data/bin/openc3cli CHANGED
@@ -316,7 +316,7 @@ def validate_plugin(plugin_file_path, scope:, variables_file: nil)
316
316
  puts "Successfully validated #{File.basename(plugin_file_path)}"
317
317
  result = 0 # bash and Windows consider 0 success
318
318
  rescue => e
319
- puts "Error: #{e.message}"
319
+ puts e.message
320
320
  result = ERROR_CODE
321
321
  ensure
322
322
  exit(result)
@@ -125,10 +125,10 @@ module OpenC3
125
125
  # default this gets constructed to point to the generic configuration
126
126
  # Guide on the OpenC3 Wiki.
127
127
  def initialize(config_parser, message = "Configuration Error", usage = "", url = "")
128
- if Error == message
128
+ if Error === message
129
129
  super(message.message)
130
- elsif Exception == message
131
- super("#{message.class}:#{message.message}")
130
+ elsif Exception === message
131
+ super("#{message.class}: #{message.message}")
132
132
  else
133
133
  super(message)
134
134
  end
@@ -449,18 +449,24 @@ module OpenC3
449
449
  return if errors.empty?
450
450
  message = ''
451
451
  errors.each do |error|
452
+ # Once we have a message we want to ignore errors about bad items, packets, and targets
453
+ # because the real error is probably in a previous definition
454
+ next if message != '' && error.message.include?('No current item')
455
+ next if message != '' && error.message.include?('No current packet')
456
+ next if message != '' && error.message.include?('Unknown keyword and parameters for Target')
457
+
452
458
  if error.is_a? OpenC3::ConfigParser::Error
453
- message += "\n#{File.basename(error.filename)}:#{error.line_number}: #{error.line}"
459
+ message += "\n#{File.basename(error.filename)}:#{error.line_number}: #{error.line}" if error.filename
454
460
  message += "\nError: #{error.message}"
455
461
  message += "\nUsage: #{error.usage}" unless error.usage.empty?
456
- message += "\nBacktrace:"
457
- message += "\n#{error.backtrace.join("\n")}"
458
- else
459
- message += "\n#{error.formatted}"
462
+ message += "\n"
463
+ # Only capture the first non-ConfigParser::Error which is typically
464
+ # a RuntimeError generated from a raise during parsing
465
+ elsif message == ''
466
+ message += "\n#{error.formatted}\n"
460
467
  end
461
- message += "\n"
462
468
  end
463
- raise message
469
+ raise Error.new(self, message)
464
470
  end
465
471
 
466
472
  if RUBY_ENGINE != 'ruby' or ENV['OPENC3_NO_EXT']
@@ -245,13 +245,19 @@ module OpenC3
245
245
  when 'VARIABLE', 'NEEDS_DEPENDENCIES'
246
246
  # Ignore during phase 2
247
247
  when 'TARGET', 'INTERFACE', 'ROUTER', 'MICROSERVICE', 'TOOL', 'WIDGET'
248
- if current_model
249
- current_model.create unless validate_only
250
- current_model.deploy(gem_path, variables, validate_only: validate_only)
248
+ begin
249
+ if current_model
250
+ current_model.create unless validate_only
251
+ current_model.deploy(gem_path, variables, validate_only: validate_only)
252
+ end
253
+ # If something goes wrong in create, or more likely in deploy,
254
+ # we want to clear the current_model and try to instantiate the next
255
+ # Otherwise we're stuck constantly iterating on the last model
256
+ ensure
251
257
  current_model = nil
258
+ current_model = OpenC3.const_get((keyword.capitalize + 'Model').intern).handle_config(parser,
259
+ keyword, params, plugin: plugin_model.name, needs_dependencies: needs_dependencies, scope: scope)
252
260
  end
253
- current_model = OpenC3.const_get((keyword.capitalize + 'Model').intern).handle_config(parser,
254
- keyword, params, plugin: plugin_model.name, needs_dependencies: needs_dependencies, scope: scope)
255
261
  else
256
262
  if current_model
257
263
  current_model.handle_config(parser, keyword, params)
@@ -271,10 +277,10 @@ module OpenC3
271
277
  $LOAD_PATH.delete(load_dir)
272
278
  end
273
279
  end
274
- rescue => err
280
+ rescue => e
275
281
  # Install failed - need to cleanup
276
282
  plugin_model.destroy unless validate_only
277
- raise err
283
+ raise e
278
284
  ensure
279
285
  FileUtils.remove_entry(temp_dir) if temp_dir and File.exist?(temp_dir)
280
286
  tf.unlink if tf
@@ -301,7 +307,7 @@ module OpenC3
301
307
  super(update: update, force: force, queued: queued)
302
308
  end
303
309
 
304
- def as_json(*a)
310
+ def as_json(*_a)
305
311
  {
306
312
  'name' => @name,
307
313
  'variables' => @variables,
@@ -316,11 +322,11 @@ module OpenC3
316
322
  errors = []
317
323
  microservice_count = 0
318
324
  microservices = MicroserviceModel.find_all_by_plugin(plugin: @name, scope: @scope)
319
- microservices.each do |name, model_instance|
325
+ microservices.each do |_name, model_instance|
320
326
  begin
321
327
  model_instance.destroy
322
- rescue Exception => error
323
- errors << error
328
+ rescue Exception => e
329
+ errors << e
324
330
  end
325
331
  microservice_count += 1
326
332
  end
@@ -329,20 +335,20 @@ module OpenC3
329
335
  # Remove all the other models now that the processes have stopped
330
336
  # Save TargetModel for last as it has the most to cleanup
331
337
  [InterfaceModel, RouterModel, ToolModel, WidgetModel, TargetModel].each do |model|
332
- model.find_all_by_plugin(plugin: @name, scope: @scope).each do |name, model_instance|
338
+ model.find_all_by_plugin(plugin: @name, scope: @scope).each do |_name, model_instance|
333
339
  begin
334
340
  model_instance.destroy
335
- rescue Exception => error
336
- errors << error
341
+ rescue Exception => e
342
+ errors << e
337
343
  end
338
344
  end
339
345
  end
340
346
  # Cleanup Redis stuff that might have been left by microservices
341
- microservices.each do |name, model_instance|
347
+ microservices.each do |_name, model_instance|
342
348
  begin
343
349
  model_instance.cleanup
344
- rescue Exception => error
345
- errors << error
350
+ rescue Exception => e
351
+ errors << e
346
352
  end
347
353
  end
348
354
  # Raise all the errors at once
@@ -353,13 +359,13 @@ module OpenC3
353
359
  end
354
360
  raise message
355
361
  end
356
- rescue Exception => error
357
- Logger.error("Error undeploying plugin model #{@name} in scope #{@scope} due to: #{error.formatted}")
362
+ rescue Exception => e
363
+ Logger.error("Error undeploying plugin model #{@name} in scope #{@scope} due to: #{e.formatted}")
358
364
  ensure
359
365
  # Double check everything is gone
360
366
  found = []
361
367
  [MicroserviceModel, InterfaceModel, RouterModel, ToolModel, WidgetModel, TargetModel].each do |model|
362
- model.find_all_by_plugin(plugin: @name, scope: @scope).each do |name, model_instance|
368
+ model.find_all_by_plugin(plugin: @name, scope: @scope).each do |_name, model_instance|
363
369
  found << model_instance
364
370
  end
365
371
  end
@@ -14,7 +14,7 @@
14
14
  # GNU Affero General Public License for more details.
15
15
 
16
16
  # Modified by OpenC3, Inc.
17
- # All changes Copyright 2023, OpenC3, Inc.
17
+ # All changes Copyright 2024, OpenC3, Inc.
18
18
  # All Rights Reserved
19
19
  #
20
20
  # This file may also be used under the terms of a commercial license
@@ -753,7 +753,7 @@ module OpenC3
753
753
  packet_hash.each do |target_name, packets|
754
754
  Store.del("#{@scope}__openc3tlm__#{target_name}") if clear_old
755
755
  packets.each do |packet_name, packet|
756
- Logger.info "Configuring tlm packet: #{target_name} #{packet_name}"
756
+ Logger.debug "Configuring tlm packet: #{target_name} #{packet_name}"
757
757
  begin
758
758
  Store.hset("#{@scope}__openc3tlm__#{target_name}", packet_name, JSON.generate(packet.as_json(:allow_nan => true)))
759
759
  rescue JSON::GeneratorError => e
@@ -773,7 +773,7 @@ module OpenC3
773
773
  packet_hash.each do |target_name, packets|
774
774
  Store.del("#{@scope}__openc3cmd__#{target_name}") if clear_old
775
775
  packets.each do |packet_name, packet|
776
- Logger.info "Configuring cmd packet: #{target_name} #{packet_name}"
776
+ Logger.debug "Configuring cmd packet: #{target_name} #{packet_name}"
777
777
  begin
778
778
  Store.hset("#{@scope}__openc3cmd__#{target_name}", packet_name, JSON.generate(packet.as_json(:allow_nan => true)))
779
779
  rescue JSON::GeneratorError => e
@@ -14,7 +14,7 @@
14
14
  # GNU Affero General Public License for more details.
15
15
 
16
16
  # Modified by OpenC3, Inc.
17
- # All changes Copyright 2023, OpenC3, Inc.
17
+ # All changes Copyright 2024, OpenC3, Inc.
18
18
  # All Rights Reserved
19
19
  #
20
20
  # This file may also be used under the terms of a commercial license
@@ -396,7 +396,7 @@ module OpenC3
396
396
  # @return [Array<String>] Warning messages for big definition overlaps
397
397
  def check_bit_offsets
398
398
  if @ignore_overlap
399
- Logger.instance.info("#{@target_name} #{@packet_name} has IGNORE_OVERLAP so bit overlaps ignored")
399
+ Logger.instance.debug("#{@target_name} #{@packet_name} has IGNORE_OVERLAP so bit overlaps ignored")
400
400
  return []
401
401
  end
402
402
  expected_next_offset = nil
@@ -488,7 +488,7 @@ module OpenC3
488
488
  end
489
489
  end
490
490
  rescue Exception => e
491
- raise parser.error(e)
491
+ raise parser.error(e.formatted)
492
492
  end
493
493
 
494
494
  when 'TEMPLATE'
@@ -503,7 +503,7 @@ module OpenC3
503
503
  begin
504
504
  @current_packet.template = parser.read_file(params[0])
505
505
  rescue Exception => e
506
- raise parser.error(e)
506
+ raise parser.error(e.formatted)
507
507
  end
508
508
 
509
509
  when 'RESPONSE'
@@ -66,8 +66,6 @@ module OpenC3
66
66
  item.limits.response = PythonProxy.new('LimitsResponse', @parser.parameters[0], [])
67
67
  end
68
68
  end
69
- rescue Exception => e
70
- raise @parser.error(e, @usage)
71
69
  end
72
70
  end
73
71
  end
@@ -88,8 +88,6 @@ module OpenC3
88
88
  item = packet.define(item)
89
89
  end
90
90
  item
91
- rescue => err
92
- raise @parser.error(err, @usage)
93
91
  end
94
92
 
95
93
  private
@@ -105,17 +103,16 @@ module OpenC3
105
103
 
106
104
  def get_bit_offset
107
105
  return 0 if append?
108
-
109
106
  Integer(@parser.parameters[1])
110
- rescue => err # In case Integer fails
111
- raise @parser.error(err, @usage)
107
+ rescue => e
108
+ raise @parser.error(e, @usage)
112
109
  end
113
110
 
114
111
  def get_bit_size
115
112
  index = append? ? 1 : 2
116
113
  Integer(@parser.parameters[index])
117
- rescue => err
118
- raise @parser.error(err, @usage)
114
+ rescue => e
115
+ raise @parser.error(e, @usage)
119
116
  end
120
117
 
121
118
  def get_array_size
@@ -133,8 +130,8 @@ module OpenC3
133
130
  @warnings << warning
134
131
  end
135
132
  array_bit_size
136
- rescue => err
137
- raise @parser.error(err, @usage)
133
+ rescue => e
134
+ raise @parser.error(e, @usage)
138
135
  end
139
136
 
140
137
  def get_endianness(packet)
@@ -71,8 +71,6 @@ module OpenC3
71
71
  end
72
72
  processor.name = get_processor_name()
73
73
  packet.processors[processor.name] = processor
74
- rescue Exception => err
75
- raise @parser.error(err, @usage)
76
74
  end
77
75
 
78
76
  private
@@ -183,7 +183,7 @@ module OpenC3
183
183
  errors << "Error processing #{cmd_tlm_file}:\n#{e.message}"
184
184
  end
185
185
  unless errors.empty?
186
- raise errors.join("\n")
186
+ raise parser.error(errors.join("\n"))
187
187
  end
188
188
  end
189
189
  end
@@ -140,11 +140,11 @@ module OpenC3
140
140
  filename = parameters[0]
141
141
  OpenC3.require_file(parameters[0])
142
142
  end
143
- rescue Exception => err
144
- raise parser.error(err.message)
143
+ rescue Exception => e
144
+ raise parser.error(e.formatted)
145
145
  end
146
146
  rescue Exception => e
147
- raise parser.error(e.message)
147
+ raise parser.error(e.formatted)
148
148
  end
149
149
 
150
150
  # This code resolves any relative paths to absolute before putting into the @requires array
@@ -17,7 +17,7 @@
17
17
  # All changes Copyright 2022, OpenC3, Inc.
18
18
  # All Rights Reserved
19
19
  #
20
- # This file may also be used under the terms of a commercial license
20
+ # This file may also be used under the terms of a commercial license
21
21
  # if purchased from OpenC3, Inc.
22
22
 
23
23
  require 'openc3/packets/packet_config'
@@ -62,8 +62,6 @@ module OpenC3
62
62
  item = table.define(item)
63
63
  end
64
64
  item
65
- rescue => err
66
- raise @parser.error(err, @usage)
67
65
  end
68
66
  end
69
67
  end
@@ -47,6 +47,7 @@ module OpenC3
47
47
  'openc3-enterprise-tool-base',
48
48
  'openc3-cosmos-tool-autonomic',
49
49
  'openc3-cosmos-tool-calendar',
50
+ 'openc3-cosmos-tool-grafana',
50
51
  'openc3-tool-base',
51
52
  ]
52
53
 
@@ -168,7 +169,7 @@ module OpenC3
168
169
  json = JSON.parse(data, :allow_nan => true, :create_additions => true)
169
170
 
170
171
  found = false
171
- found_models.each do |name, model_details|
172
+ found_models.each do |name, _model_details|
172
173
  if json["name"] == name
173
174
  # Matched pair
174
175
  found = true
@@ -339,7 +340,7 @@ module OpenC3
339
340
  def self.modified_targets(scope:)
340
341
  targets = {}
341
342
  local_catalog = build_local_catalog(scope: scope)
342
- local_catalog.each do |key, size|
343
+ local_catalog.each do |key, _size|
343
344
  split_key = key.split('/') # scope/targets_modified/target_name/*
344
345
  target_name = split_key[2]
345
346
  if target_name
@@ -352,7 +353,7 @@ module OpenC3
352
353
  def self.modified_files(target_name, scope:)
353
354
  modified = []
354
355
  local_catalog = build_local_catalog(scope: scope)
355
- local_catalog.each do |key, size|
356
+ local_catalog.each do |key, _size|
356
357
  split_key = key.split('/') # scope/targets_modified/target_name/*
357
358
  local_target_name = split_key[2]
358
359
  if target_name == local_target_name
@@ -399,7 +400,7 @@ module OpenC3
399
400
  def self.local_target_files(scope:, path_matchers:, include_temp: false)
400
401
  files = []
401
402
  local_catalog = build_local_catalog(scope: scope)
402
- local_catalog.each do |key, size|
403
+ local_catalog.each do |key, _size|
403
404
  split_key = key.split('/')
404
405
  # DEFAULT/targets_modified/__TEMP__/YYYY_MM_DD_HH_MM_SS_mmm_temp.rb
405
406
  # See target_file.rb TEMP_FOLDER
@@ -434,8 +435,8 @@ module OpenC3
434
435
  JSON.parse(data, :allow_nan => true, :create_additions => true)
435
436
  # Only save if the parse was successful
436
437
  ToolConfigModel.save_config(parts[-2], File.basename(config, '.json'), data, scope: scope, local_mode: false)
437
- rescue JSON::ParserError => error
438
- puts "Unable to initialize tool config due to #{error.message}"
438
+ rescue JSON::ParserError => e
439
+ puts "Unable to initialize tool config due to #{e.message}"
439
440
  end
440
441
  end
441
442
  end
@@ -555,7 +556,7 @@ module OpenC3
555
556
  end
556
557
  end
557
558
 
558
- remote_catalog.each do |key, size|
559
+ remote_catalog.each do |key, _size|
559
560
  local_size = local_catalog[key]
560
561
  if local_size
561
562
  # Both files exist - Handled earlier
@@ -1,14 +1,14 @@
1
1
  # encoding: ascii-8bit
2
2
 
3
- OPENC3_VERSION = '5.16.1'
3
+ OPENC3_VERSION = '5.16.2'
4
4
  module OpenC3
5
5
  module Version
6
6
  MAJOR = '5'
7
7
  MINOR = '16'
8
- PATCH = '1'
8
+ PATCH = '2'
9
9
  OTHER = ''
10
- BUILD = 'd21b56e140b77e4b5e859c7d51c5544e42a8f833'
10
+ BUILD = '91e39a71be955ef5d20c474b73d8bc9a3f895284'
11
11
  end
12
- VERSION = '5.16.1'
13
- GEM_VERSION = '5.16.1'
12
+ VERSION = '5.16.2'
13
+ GEM_VERSION = '5.16.2'
14
14
  end
@@ -1,4 +1,6 @@
1
1
  from openc3.conversions.conversion import Conversion
2
+ # Using tlm() requires the following:
3
+ # from openc3.api.tlm_api import tlm
2
4
 
3
5
  # Custom conversion class
4
6
  # See https://docs.openc3.com/docs/configuration/telemetry#read_conversion
@@ -26,3 +28,4 @@ class <%= conversion_class %>(Conversion):
26
28
  # Used when conversion is applied to a regular (not DERIVED) item
27
29
  # NOTE: You can also use packet.read("ITEM") to get additional values
28
30
  # return value / 2 * packet.read("OTHER_ITEM")
31
+ return value
@@ -1,5 +1,5 @@
1
1
  from openc3.packets.limits_response import LimitsResponse
2
-
2
+ from openc3.api import *
3
3
 
4
4
  class <%= response_class %>(LimitsResponse):
5
5
  # @param packet [Packet] Packet the limits response is assigned to
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "<%= tool_name %>",
3
- "version": "5.16.1",
3
+ "version": "5.16.2",
4
4
  "scripts": {
5
5
  "ng": "ng",
6
6
  "start": "ng serve",
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "private": true,
14
14
  "dependencies": {
15
- "@openc3/tool-common": "5.16.1",
15
+ "@openc3/tool-common": "5.16.2",
16
16
  "@angular/animations": "^17.0.8",
17
17
  "@angular/cdk": "^17.0.4",
18
18
  "@angular/common": "^17.0.8",
@@ -11,7 +11,7 @@
11
11
  "smui-theme": "smui-theme compile build/smui.css -i src/theme"
12
12
  },
13
13
  "dependencies": {
14
- "@openc3/tool-common": "5.16.1",
14
+ "@openc3/tool-common": "5.16.2",
15
15
  "@astrouxds/astro-web-components": "7.22.0",
16
16
  "@smui/button": "^7.0.0-beta.16",
17
17
  "@smui/card": "^7.0.0-beta.16",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "<%= tool_name %>",
3
- "version": "5.16.1",
3
+ "version": "5.16.2",
4
4
  "private": true,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -11,7 +11,7 @@
11
11
  "test:components": "vue-cli-service test:components"
12
12
  },
13
13
  "dependencies": {
14
- "@openc3/tool-common": "5.16.1",
14
+ "@openc3/tool-common": "5.16.2",
15
15
  "@astrouxds/astro-web-components": "7.22.0",
16
16
  "axios": "1.6.8",
17
17
  "date-fns": "3.6.0",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "widget",
3
- "version": "5.16.1",
3
+ "version": "5.16.2",
4
4
  "private": true,
5
5
  "scripts": {
6
6
  "build": "vue-cli-service build --target lib --dest tools/widgets/<%= widget_name %> --formats umd-min <%= widget_path %> --name <%= widget_name %>"
7
7
  },
8
8
  "dependencies": {
9
- "@openc3/tool-common": "5.16.1",
9
+ "@openc3/tool-common": "5.16.2",
10
10
  "@astrouxds/astro-web-components": "7.22.0",
11
11
  "vue": "2.7.16",
12
12
  "vuetify": "2.7.1"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openc3
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.16.1
4
+ version: 5.16.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Melton
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-05-08 00:00:00.000000000 Z
12
+ date: 2024-05-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler