openc3 6.4.2 → 6.5.1

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.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/bin/openc3cli +172 -97
  3. data/data/config/_graph_params.yaml +4 -4
  4. data/data/config/conversions.yaml +2 -1
  5. data/data/config/item_modifiers.yaml +1 -0
  6. data/data/config/plugins.yaml +14 -1
  7. data/data/config/processors.yaml +51 -0
  8. data/data/config/telemetry_modifiers.yaml +1 -0
  9. data/lib/openc3/api/tlm_api.rb +10 -5
  10. data/lib/openc3/microservices/interface_microservice.rb +15 -9
  11. data/lib/openc3/models/gem_model.rb +2 -2
  12. data/lib/openc3/models/plugin_model.rb +5 -4
  13. data/lib/openc3/models/scope_model.rb +87 -57
  14. data/lib/openc3/models/script_engine_model.rb +93 -0
  15. data/lib/openc3/models/script_status_model.rb +4 -0
  16. data/lib/openc3/models/target_model.rb +7 -1
  17. data/lib/openc3/script/script.rb +5 -1
  18. data/lib/openc3/script_engines/script_engine.rb +118 -0
  19. data/lib/openc3/topics/interface_topic.rb +23 -3
  20. data/lib/openc3/utilities/aws_bucket.rb +3 -3
  21. data/lib/openc3/utilities/bucket.rb +1 -1
  22. data/lib/openc3/utilities/cli_generator.rb +42 -15
  23. data/lib/openc3/utilities/local_mode.rb +1 -0
  24. data/lib/openc3/utilities/running_script.rb +1460 -0
  25. data/lib/openc3/version.rb +6 -6
  26. data/templates/conversion/conversion.py +1 -1
  27. data/templates/conversion/conversion.rb +1 -1
  28. data/templates/processor/processor.py +32 -0
  29. data/templates/processor/processor.rb +36 -0
  30. data/templates/tool_angular/package.json +2 -2
  31. data/templates/tool_react/package.json +1 -1
  32. data/templates/tool_svelte/package.json +1 -1
  33. data/templates/tool_vue/package.json +3 -3
  34. data/templates/widget/package.json +2 -2
  35. metadata +21 -1
@@ -1,14 +1,14 @@
1
1
  # encoding: ascii-8bit
2
2
 
3
- OPENC3_VERSION = '6.4.2'
3
+ OPENC3_VERSION = '6.5.1'
4
4
  module OpenC3
5
5
  module Version
6
6
  MAJOR = '6'
7
- MINOR = '4'
8
- PATCH = '2'
7
+ MINOR = '5'
8
+ PATCH = '1'
9
9
  OTHER = ''
10
- BUILD = '8b7b7389663bce219219fe1b42679119a63331f1'
10
+ BUILD = 'bccc9a29582eed0d565be2c5135676ce87c066f8'
11
11
  end
12
- VERSION = '6.4.2'
13
- GEM_VERSION = '6.4.2'
12
+ VERSION = '6.5.1'
13
+ GEM_VERSION = '6.5.1'
14
14
  end
@@ -3,7 +3,7 @@ from openc3.conversions.conversion import Conversion
3
3
  # from openc3.api.tlm_api import tlm
4
4
 
5
5
  # Custom conversion class
6
- # See https://docs.openc3.com/docs/configuration/telemetry#read_conversion
6
+ # See https://docs.openc3.com/docs/configuration/conversions
7
7
  class <%= conversion_class %>(Conversion):
8
8
  def __init__(self):
9
9
  super().__init__()
@@ -3,7 +3,7 @@ require 'openc3/conversions/conversion'
3
3
 
4
4
  module OpenC3
5
5
  # Custom conversion class
6
- # See https://docs.openc3.com/docs/configuration/telemetry#read_conversion
6
+ # See https://docs.openc3.com/docs/configuration/conversions
7
7
  class <%= conversion_class %> < Conversion
8
8
  def initialize
9
9
  super()
@@ -0,0 +1,32 @@
1
+ import math
2
+ from openc3.processors.processor import Processor
3
+
4
+ # Custom processor class
5
+ # See https://docs.openc3.com/docs/configuration/processors
6
+ class <%= processor_class %>(Processor):
7
+ def __init__(self, item_name, num_samples, value_type='CONVERTED'):
8
+ super().__init__(value_type)
9
+ self.item_name = item_name.upper()
10
+ self.num_samples = int(num_samples)
11
+ self.reset()
12
+
13
+ def call(self, value, packet, buffer):
14
+ value = packet.read(self.item_name, self.value_type, buffer)
15
+ # Don't process NaN or Infinite values
16
+ if math.isnan(value) or math.isinf(value):
17
+ return
18
+
19
+ self.samples.append(value)
20
+ if len(self.samples) > self.num_samples:
21
+ self.samples = self.samples[-self.num_samples :]
22
+
23
+ # Calculate something based on the collected samples
24
+ # For example, calculate the rate of change:
25
+ if len(self.samples) > 1:
26
+ self.results['RATE_OF_CHANGE'] = (self.samples[-1] - self.samples[0]) / (len(self.samples) - 1)
27
+ else:
28
+ self.results['RATE_OF_CHANGE'] = None
29
+
30
+ def reset(self):
31
+ self.samples = []
32
+ self.results['RATE_OF_CHANGE'] = None
@@ -0,0 +1,36 @@
1
+ # encoding: ascii-8bit
2
+ require 'openc3/processors/processor'
3
+
4
+ module OpenC3
5
+ # Custom processor class
6
+ # See https://docs.openc3.com/docs/configuration/processors
7
+ class <%= processor_class %> < Processor
8
+ def initialize(item_name, num_samples, value_type = :CONVERTED)
9
+ super(value_type)
10
+ @item_name = item_name.to_s.upcase
11
+ @num_samples = Integer(num_samples)
12
+ reset()
13
+ end
14
+
15
+ # This is where the processor does its work.
16
+ # All processor results should be stored in the @results hash.
17
+ # Results are accessed via a ProcessorConversion
18
+ def call(packet, buffer)
19
+ value = packet.read(@item_name, @value_type, buffer)
20
+ # Don't process NaN or Infinite values
21
+ return if value.to_f.nan? || value.to_f.infinite?
22
+
23
+ @samples << value
24
+ @samples = @samples[-@num_samples..-1] if @samples.length > @num_samples
25
+ # Calculate something based on the collected samples
26
+ # For example, calculate the rate of change:
27
+ @results[:RATE_OF_CHANGE] = (@samples.last - @samples.first) / (@samples.length - 1) if @samples.length > 1
28
+ end
29
+
30
+ # Reset any state
31
+ def reset
32
+ @samples = []
33
+ @results[:RATE_OF_CHANGE] = nil
34
+ end
35
+ end
36
+ end
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "<%= tool_name %>",
3
- "version": "6.4.2",
3
+ "version": "6.5.1",
4
4
  "scripts": {
5
5
  "ng": "ng",
6
6
  "start": "ng serve",
@@ -23,7 +23,7 @@
23
23
  "@angular/platform-browser-dynamic": "^18.2.6",
24
24
  "@angular/router": "^18.2.6",
25
25
  "@astrouxds/astro-web-components": "^7.24.0",
26
- "@openc3/js-common": "6.4.2",
26
+ "@openc3/js-common": "6.5.1",
27
27
  "rxjs": "~7.8.0",
28
28
  "single-spa": "^5.9.5",
29
29
  "single-spa-angular": "^9.2.0",
@@ -16,7 +16,7 @@
16
16
  "@emotion/react": "^11.13.3",
17
17
  "@emotion/styled": "^11.11.0",
18
18
  "@mui/material": "^6.1.1",
19
- "@openc3/js-common": "6.4.2",
19
+ "@openc3/js-common": "6.5.1",
20
20
  "react": "^18.2.0",
21
21
  "react-dom": "^18.2.0",
22
22
  "single-spa-react": "^5.1.4"
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "@astrouxds/astro-web-components": "^7.24.0",
15
- "@openc3/js-common": "6.4.2",
15
+ "@openc3/js-common": "6.5.1",
16
16
  "@smui/button": "^7.0.0",
17
17
  "@smui/common": "^7.0.0",
18
18
  "@smui/card": "^7.0.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "<%= tool_name %>",
3
- "version": "6.4.2",
3
+ "version": "6.5.1",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -11,8 +11,8 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@astrouxds/astro-web-components": "^7.24.0",
14
- "@openc3/js-common": "6.4.2",
15
- "@openc3/vue-common": "6.4.2",
14
+ "@openc3/js-common": "6.5.1",
15
+ "@openc3/vue-common": "6.5.1",
16
16
  "axios": "^1.7.7",
17
17
  "date-fns": "^4.1.0",
18
18
  "lodash": "^4.17.21",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "<%= widget_name %>",
3
- "version": "6.4.2",
3
+ "version": "6.5.1",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "@astrouxds/astro-web-components": "^7.24.0",
11
- "@openc3/vue-common": "6.4.2",
11
+ "@openc3/vue-common": "6.5.1",
12
12
  "vuetify": "^3.7.1"
13
13
  },
14
14
  "devDependencies": {
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: 6.4.2
4
+ version: 6.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Melton
@@ -766,6 +766,20 @@ dependencies:
766
766
  - - "~>"
767
767
  - !ruby/object:Gem::Version
768
768
  version: '2.1'
769
+ - !ruby/object:Gem::Dependency
770
+ name: simplecov_json_formatter
771
+ requirement: !ruby/object:Gem::Requirement
772
+ requirements:
773
+ - - "~>"
774
+ - !ruby/object:Gem::Version
775
+ version: '0.1'
776
+ type: :development
777
+ prerelease: false
778
+ version_requirements: !ruby/object:Gem::Requirement
779
+ requirements:
780
+ - - "~>"
781
+ - !ruby/object:Gem::Version
782
+ version: '0.1'
769
783
  description: |2
770
784
  OpenC3 provides all the functionality needed to send
771
785
  commands to and receive data from one or more embedded systems
@@ -824,6 +838,7 @@ files:
824
838
  - data/config/param_item_modifiers.yaml
825
839
  - data/config/parameter_modifiers.yaml
826
840
  - data/config/plugins.yaml
841
+ - data/config/processors.yaml
827
842
  - data/config/protocols.yaml
828
843
  - data/config/screen.yaml
829
844
  - data/config/settings.yaml
@@ -1034,6 +1049,7 @@ files:
1034
1049
  - lib/openc3/models/router_model.rb
1035
1050
  - lib/openc3/models/router_status_model.rb
1036
1051
  - lib/openc3/models/scope_model.rb
1052
+ - lib/openc3/models/script_engine_model.rb
1037
1053
  - lib/openc3/models/script_status_model.rb
1038
1054
  - lib/openc3/models/secret_model.rb
1039
1055
  - lib/openc3/models/setting_model.rb
@@ -1096,6 +1112,7 @@ files:
1096
1112
  - lib/openc3/script/tables.rb
1097
1113
  - lib/openc3/script/telemetry.rb
1098
1114
  - lib/openc3/script/web_socket_api.rb
1115
+ - lib/openc3/script_engines/script_engine.rb
1099
1116
  - lib/openc3/streams/mqtt_stream.rb
1100
1117
  - lib/openc3/streams/serial_stream.rb
1101
1118
  - lib/openc3/streams/stream.rb
@@ -1154,6 +1171,7 @@ files:
1154
1171
  - lib/openc3/utilities/quaternion.rb
1155
1172
  - lib/openc3/utilities/redis_secrets.rb
1156
1173
  - lib/openc3/utilities/ruby_lex_utils.rb
1174
+ - lib/openc3/utilities/running_script.rb
1157
1175
  - lib/openc3/utilities/s3_autoload.rb
1158
1176
  - lib/openc3/utilities/secrets.rb
1159
1177
  - lib/openc3/utilities/simulated_target.rb
@@ -1183,6 +1201,8 @@ files:
1183
1201
  - templates/plugin/Rakefile
1184
1202
  - templates/plugin/plugin.gemspec
1185
1203
  - templates/plugin/plugin.txt
1204
+ - templates/processor/processor.py
1205
+ - templates/processor/processor.rb
1186
1206
  - templates/target/targets/TARGET/cmd_tlm/cmd.txt
1187
1207
  - templates/target/targets/TARGET/cmd_tlm/tlm.txt
1188
1208
  - templates/target/targets/TARGET/lib/target.py