openc3 6.4.1 → 6.5.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.
Files changed (48) 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 +274 -0
  5. data/data/config/item_modifiers.yaml +8 -70
  6. data/data/config/parameter_modifiers.yaml +9 -69
  7. data/data/config/plugins.yaml +14 -1
  8. data/data/config/processors.yaml +51 -0
  9. data/data/config/telemetry_modifiers.yaml +1 -0
  10. data/lib/openc3/api/api.rb +1 -1
  11. data/lib/openc3/api/tlm_api.rb +10 -5
  12. data/lib/openc3/conversions/unix_time_conversion.rb +2 -2
  13. data/lib/openc3/conversions/unix_time_formatted_conversion.rb +3 -3
  14. data/lib/openc3/conversions/unix_time_seconds_conversion.rb +3 -3
  15. data/lib/openc3/core_ext/time.rb +2 -9
  16. data/lib/openc3/microservices/cleanup_microservice.rb +2 -2
  17. data/lib/openc3/microservices/decom_microservice.rb +2 -2
  18. data/lib/openc3/microservices/interface_microservice.rb +18 -12
  19. data/lib/openc3/microservices/log_microservice.rb +4 -2
  20. data/lib/openc3/microservices/multi_microservice.rb +2 -2
  21. data/lib/openc3/microservices/periodic_microservice.rb +2 -2
  22. data/lib/openc3/microservices/reducer_microservice.rb +2 -2
  23. data/lib/openc3/microservices/router_microservice.rb +2 -2
  24. data/lib/openc3/microservices/scope_cleanup_microservice.rb +2 -2
  25. data/lib/openc3/microservices/text_log_microservice.rb +19 -6
  26. data/lib/openc3/models/plugin_model.rb +5 -4
  27. data/lib/openc3/models/scope_model.rb +87 -57
  28. data/lib/openc3/models/script_engine_model.rb +93 -0
  29. data/lib/openc3/models/script_status_model.rb +26 -4
  30. data/lib/openc3/models/target_model.rb +33 -5
  31. data/lib/openc3/packets/packet_config.rb +1 -1
  32. data/lib/openc3/script/autonomic.rb +359 -0
  33. data/lib/openc3/script/script.rb +6 -1
  34. data/lib/openc3/script_engines/script_engine.rb +118 -0
  35. data/lib/openc3/topics/interface_topic.rb +23 -3
  36. data/lib/openc3/utilities/cli_generator.rb +42 -15
  37. data/lib/openc3/utilities/running_script.rb +1460 -0
  38. data/lib/openc3/version.rb +6 -6
  39. data/templates/conversion/conversion.py +1 -1
  40. data/templates/conversion/conversion.rb +1 -1
  41. data/templates/processor/processor.py +32 -0
  42. data/templates/processor/processor.rb +36 -0
  43. data/templates/tool_angular/package.json +2 -2
  44. data/templates/tool_react/package.json +1 -1
  45. data/templates/tool_svelte/package.json +1 -1
  46. data/templates/tool_vue/package.json +3 -3
  47. data/templates/widget/package.json +2 -2
  48. metadata +9 -1
@@ -1,14 +1,14 @@
1
1
  # encoding: ascii-8bit
2
2
 
3
- OPENC3_VERSION = '6.4.1'
3
+ OPENC3_VERSION = '6.5.0'
4
4
  module OpenC3
5
5
  module Version
6
6
  MAJOR = '6'
7
- MINOR = '4'
8
- PATCH = '1'
7
+ MINOR = '5'
8
+ PATCH = '0'
9
9
  OTHER = ''
10
- BUILD = '09f13531376ee0c7651a2eea12c702318b57a7aa'
10
+ BUILD = '492046952832ad5a3a4d16f2e52e9f712374fbe1'
11
11
  end
12
- VERSION = '6.4.1'
13
- GEM_VERSION = '6.4.1'
12
+ VERSION = '6.5.0'
13
+ GEM_VERSION = '6.5.0'
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.1",
3
+ "version": "6.5.0",
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.1",
26
+ "@openc3/js-common": "6.5.0",
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.1",
19
+ "@openc3/js-common": "6.5.0",
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.1",
15
+ "@openc3/js-common": "6.5.0",
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.1",
3
+ "version": "6.5.0",
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.1",
15
- "@openc3/vue-common": "6.4.1",
14
+ "@openc3/js-common": "6.5.0",
15
+ "@openc3/vue-common": "6.5.0",
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.1",
3
+ "version": "6.5.0",
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.1",
11
+ "@openc3/vue-common": "6.5.0",
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.1
4
+ version: 6.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Melton
@@ -816,6 +816,7 @@ files:
816
816
  - data/config/command.yaml
817
817
  - data/config/command_modifiers.yaml
818
818
  - data/config/command_telemetry.yaml
819
+ - data/config/conversions.yaml
819
820
  - data/config/graph_settings.yaml
820
821
  - data/config/interface_modifiers.yaml
821
822
  - data/config/item_modifiers.yaml
@@ -823,6 +824,7 @@ files:
823
824
  - data/config/param_item_modifiers.yaml
824
825
  - data/config/parameter_modifiers.yaml
825
826
  - data/config/plugins.yaml
827
+ - data/config/processors.yaml
826
828
  - data/config/protocols.yaml
827
829
  - data/config/screen.yaml
828
830
  - data/config/settings.yaml
@@ -1033,6 +1035,7 @@ files:
1033
1035
  - lib/openc3/models/router_model.rb
1034
1036
  - lib/openc3/models/router_status_model.rb
1035
1037
  - lib/openc3/models/scope_model.rb
1038
+ - lib/openc3/models/script_engine_model.rb
1036
1039
  - lib/openc3/models/script_status_model.rb
1037
1040
  - lib/openc3/models/secret_model.rb
1038
1041
  - lib/openc3/models/setting_model.rb
@@ -1075,6 +1078,7 @@ files:
1075
1078
  - lib/openc3/processors/watermark_processor.rb
1076
1079
  - lib/openc3/script.rb
1077
1080
  - lib/openc3/script/api_shared.rb
1081
+ - lib/openc3/script/autonomic.rb
1078
1082
  - lib/openc3/script/calendar.rb
1079
1083
  - lib/openc3/script/commands.rb
1080
1084
  - lib/openc3/script/critical_cmd.rb
@@ -1094,6 +1098,7 @@ files:
1094
1098
  - lib/openc3/script/tables.rb
1095
1099
  - lib/openc3/script/telemetry.rb
1096
1100
  - lib/openc3/script/web_socket_api.rb
1101
+ - lib/openc3/script_engines/script_engine.rb
1097
1102
  - lib/openc3/streams/mqtt_stream.rb
1098
1103
  - lib/openc3/streams/serial_stream.rb
1099
1104
  - lib/openc3/streams/stream.rb
@@ -1152,6 +1157,7 @@ files:
1152
1157
  - lib/openc3/utilities/quaternion.rb
1153
1158
  - lib/openc3/utilities/redis_secrets.rb
1154
1159
  - lib/openc3/utilities/ruby_lex_utils.rb
1160
+ - lib/openc3/utilities/running_script.rb
1155
1161
  - lib/openc3/utilities/s3_autoload.rb
1156
1162
  - lib/openc3/utilities/secrets.rb
1157
1163
  - lib/openc3/utilities/simulated_target.rb
@@ -1181,6 +1187,8 @@ files:
1181
1187
  - templates/plugin/Rakefile
1182
1188
  - templates/plugin/plugin.gemspec
1183
1189
  - templates/plugin/plugin.txt
1190
+ - templates/processor/processor.py
1191
+ - templates/processor/processor.rb
1184
1192
  - templates/target/targets/TARGET/cmd_tlm/cmd.txt
1185
1193
  - templates/target/targets/TARGET/cmd_tlm/tlm.txt
1186
1194
  - templates/target/targets/TARGET/lib/target.py