openc3 5.19.0 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +0 -7
  3. data/bin/openc3cli +12 -120
  4. data/bin/pipinstall +5 -3
  5. data/data/config/command_modifiers.yaml +17 -1
  6. data/data/config/interface_modifiers.yaml +21 -4
  7. data/data/config/item_modifiers.yaml +1 -1
  8. data/data/config/microservice.yaml +15 -2
  9. data/data/config/param_item_modifiers.yaml +1 -1
  10. data/data/config/parameter_modifiers.yaml +1 -1
  11. data/data/config/table_manager.yaml +2 -2
  12. data/data/config/target.yaml +11 -0
  13. data/data/config/telemetry_modifiers.yaml +17 -1
  14. data/data/config/tool.yaml +12 -0
  15. data/data/config/widgets.yaml +41 -17
  16. data/ext/openc3/ext/packet/packet.c +3 -0
  17. data/lib/openc3/accessors/form_accessor.rb +4 -3
  18. data/lib/openc3/accessors/html_accessor.rb +3 -3
  19. data/lib/openc3/accessors/http_accessor.rb +13 -13
  20. data/lib/openc3/accessors/xml_accessor.rb +16 -4
  21. data/lib/openc3/api/cmd_api.rb +4 -5
  22. data/lib/openc3/api/limits_api.rb +3 -3
  23. data/lib/openc3/api/target_api.rb +0 -30
  24. data/lib/openc3/api/tlm_api.rb +2 -1
  25. data/lib/openc3/bridge/bridge_config.rb +1 -2
  26. data/lib/openc3/ccsds/ccsds_parser.rb +12 -8
  27. data/lib/openc3/config/config_parser.rb +10 -3
  28. data/lib/openc3/conversions/bit_reverse_conversion.rb +1 -0
  29. data/lib/openc3/conversions/conversion.rb +5 -1
  30. data/lib/openc3/conversions/generic_conversion.rb +3 -8
  31. data/lib/openc3/conversions/object_read_conversion.rb +1 -8
  32. data/lib/openc3/conversions/polynomial_conversion.rb +3 -8
  33. data/lib/openc3/conversions/processor_conversion.rb +13 -11
  34. data/lib/openc3/conversions/segmented_polynomial_conversion.rb +3 -11
  35. data/lib/openc3/conversions/unix_time_conversion.rb +4 -7
  36. data/lib/openc3/conversions/unix_time_formatted_conversion.rb +4 -3
  37. data/lib/openc3/conversions/unix_time_seconds_conversion.rb +4 -3
  38. data/lib/openc3/core_ext/array.rb +0 -16
  39. data/lib/openc3/core_ext.rb +0 -1
  40. data/lib/openc3/interfaces/file_interface.rb +198 -0
  41. data/lib/openc3/interfaces/http_client_interface.rb +71 -39
  42. data/lib/openc3/interfaces/http_server_interface.rb +1 -9
  43. data/lib/openc3/interfaces/interface.rb +3 -2
  44. data/lib/openc3/interfaces/mqtt_interface.rb +32 -15
  45. data/lib/openc3/interfaces/mqtt_stream_interface.rb +19 -4
  46. data/lib/openc3/interfaces/protocols/crc_protocol.rb +7 -0
  47. data/lib/openc3/interfaces/serial_interface.rb +1 -0
  48. data/lib/openc3/interfaces/tcpip_server_interface.rb +1 -2
  49. data/lib/openc3/interfaces/udp_interface.rb +5 -3
  50. data/lib/openc3/interfaces.rb +2 -4
  51. data/lib/openc3/io/json_drb.rb +5 -0
  52. data/lib/openc3/io/json_rpc.rb +10 -9
  53. data/lib/openc3/io/udp_sockets.rb +7 -5
  54. data/lib/openc3/microservices/decom_microservice.rb +24 -7
  55. data/lib/openc3/microservices/interface_microservice.rb +65 -7
  56. data/lib/openc3/microservices/microservice.rb +1 -2
  57. data/lib/openc3/microservices/multi_microservice.rb +3 -3
  58. data/lib/openc3/migrations/20241208080000_no_critical_cmd.rb +31 -0
  59. data/lib/openc3/migrations/20241208080001_no_trigger_group.rb +46 -0
  60. data/lib/openc3/models/activity_model.rb +7 -3
  61. data/lib/openc3/models/cvt_model.rb +7 -1
  62. data/lib/openc3/models/interface_model.rb +9 -3
  63. data/lib/openc3/models/microservice_model.rb +8 -1
  64. data/lib/openc3/models/model.rb +1 -0
  65. data/lib/openc3/models/plugin_model.rb +11 -6
  66. data/lib/openc3/models/python_package_model.rb +10 -3
  67. data/lib/openc3/models/reaction_model.rb +14 -10
  68. data/lib/openc3/models/scope_model.rb +87 -25
  69. data/lib/openc3/models/target_model.rb +17 -1
  70. data/lib/openc3/models/timeline_model.rb +17 -5
  71. data/lib/openc3/models/tool_model.rb +15 -3
  72. data/lib/openc3/models/trigger_group_model.rb +6 -3
  73. data/lib/openc3/operators/microservice_operator.rb +10 -3
  74. data/lib/openc3/packets/commands.rb +17 -6
  75. data/lib/openc3/packets/limits.rb +0 -12
  76. data/lib/openc3/packets/packet.rb +10 -1
  77. data/lib/openc3/packets/packet_config.rb +34 -1
  78. data/lib/openc3/packets/packet_item.rb +30 -32
  79. data/lib/openc3/packets/structure_item.rb +2 -2
  80. data/lib/openc3/script/calendar.rb +1 -6
  81. data/lib/openc3/script/commands.rb +19 -13
  82. data/lib/openc3/script/critical_cmd.rb +91 -0
  83. data/lib/openc3/script/screen.rb +2 -2
  84. data/lib/openc3/script/script.rb +17 -10
  85. data/lib/openc3/script/web_socket_api.rb +5 -5
  86. data/lib/openc3/streams/mqtt_stream.rb +41 -33
  87. data/lib/openc3/streams/serial_stream.rb +27 -27
  88. data/lib/openc3/streams/stream.rb +17 -17
  89. data/lib/openc3/streams/tcpip_client_stream.rb +1 -1
  90. data/lib/openc3/streams/tcpip_socket_stream.rb +19 -19
  91. data/lib/openc3/system/system.rb +1 -1
  92. data/lib/openc3/system.rb +2 -3
  93. data/lib/openc3/tools/table_manager/table.rb +2 -2
  94. data/lib/openc3/tools/table_manager/table_parser.rb +1 -1
  95. data/lib/openc3/top_level.rb +9 -5
  96. data/lib/openc3/topics/command_decom_topic.rb +0 -7
  97. data/lib/openc3/topics/command_topic.rb +16 -0
  98. data/lib/openc3/topics/interface_topic.rb +2 -0
  99. data/lib/openc3/utilities/authentication.rb +7 -3
  100. data/lib/openc3/utilities/bucket_utilities.rb +1 -1
  101. data/lib/openc3/utilities/cli_generator.rb +0 -1
  102. data/lib/openc3/utilities/logger.rb +1 -0
  103. data/lib/openc3/utilities/store_queued.rb +1 -0
  104. data/lib/openc3/version.rb +6 -6
  105. data/templates/conversion/conversion.rb +2 -0
  106. data/templates/plugin/README.md +1 -1
  107. data/templates/target/targets/TARGET/lib/target.rb +1 -1
  108. data/templates/tool_angular/package.json +9 -9
  109. data/templates/tool_angular/src/app/app.component.html +4 -13
  110. data/templates/tool_angular/src/app/app.component.scss +5 -13
  111. data/templates/tool_angular/src/app/app.component.ts +5 -4
  112. data/templates/tool_angular/src/app/custom-overlay-container.ts +2 -2
  113. data/templates/tool_angular/src/app/openc3-api.d.ts +1 -1
  114. data/templates/tool_angular/src/main.single-spa.ts +1 -1
  115. data/templates/tool_react/package.json +1 -0
  116. data/templates/tool_react/src/root.component.js +1 -1
  117. data/templates/tool_svelte/build/smui.css +1 -1
  118. data/templates/tool_svelte/package.json +11 -9
  119. data/templates/tool_svelte/rollup.config.js +2 -0
  120. data/templates/tool_svelte/src/App.svelte +2 -2
  121. data/templates/tool_vue/eslint.config.mjs +68 -0
  122. data/templates/tool_vue/jsconfig.json +1 -1
  123. data/templates/tool_vue/package.json +26 -43
  124. data/templates/tool_vue/src/App.vue +3 -5
  125. data/templates/tool_vue/src/main.js +12 -23
  126. data/templates/tool_vue/src/router.js +19 -18
  127. data/templates/tool_vue/src/tools/tool_name/tool_name.vue +2 -2
  128. data/templates/tool_vue/vite.config.js +52 -0
  129. data/templates/widget/package.json +19 -26
  130. data/templates/widget/src/Widget.vue +13 -15
  131. data/templates/widget/vite.config.js +26 -0
  132. metadata +25 -39
  133. data/lib/openc3/core_ext/hash.rb +0 -40
  134. data/lib/openc3/core_ext/httpclient.rb +0 -11
  135. data/lib/openc3/interfaces/linc_interface.rb +0 -480
  136. data/lib/openc3/interfaces/protocols/override_protocol.rb +0 -4
  137. data/lib/openc3/microservices/reaction_microservice.rb +0 -607
  138. data/lib/openc3/microservices/timeline_microservice.rb +0 -400
  139. data/lib/openc3/microservices/trigger_group_microservice.rb +0 -698
  140. data/lib/openc3/migrations/20230615000000_autonomic.rb +0 -86
  141. data/lib/openc3/migrations/20240915000000_activity_uuid.rb +0 -28
  142. data/lib/openc3/system/system_config.rb +0 -413
  143. data/templates/tool_svelte/src/services/api.js +0 -92
  144. data/templates/tool_svelte/src/services/axios.js +0 -85
  145. data/templates/tool_svelte/src/services/cable.js +0 -65
  146. data/templates/tool_svelte/src/services/config-parser.js +0 -198
  147. data/templates/tool_svelte/src/services/openc3-api.js +0 -606
  148. data/templates/tool_vue/.eslintrc.js +0 -43
  149. data/templates/tool_vue/babel.config.json +0 -11
  150. data/templates/tool_vue/vue.config.js +0 -38
  151. data/templates/widget/.eslintrc.js +0 -43
  152. data/templates/widget/babel.config.json +0 -11
  153. data/templates/widget/vue.config.js +0 -28
  154. /data/templates/tool_vue/{.prettierrc.js → .prettierrc.cjs} +0 -0
  155. /data/templates/widget/{.prettierrc.js → .prettierrc.cjs} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 65a5c8a4ee0645f9d129c7c6140b9e8863e61e035f5e0269a977e8cd7d722c15
4
- data.tar.gz: a023d452a32050ab5d81a3edcdc8fccaf10eed1a81b481ef11d89c633d3f6cba
3
+ metadata.gz: 9a54edc01e060c3a3d1163a1535491aca88770aa2cc0caba9d1300a2b450483d
4
+ data.tar.gz: a5bb46d276b36a51a742cfa383118cf6eb8cd866a3bb408f3daccfc69276a19e
5
5
  SHA512:
6
- metadata.gz: 3ecd41dc83eb1d9af0e847fcb61d8784bfce374c33681008030423f2d1b04c09b62200ec5ca7f878273e6aed704982aeb55fddad1b1ae5490367e5fe48ea844f
7
- data.tar.gz: f121f92ac5c6101eb9e3d9ebe52b525235090dc964a7bf409ebf7a47b1bc1c52c7f5a97a7194f5238ade4cee31078cb5822b486954d87983c8fdf9294f557257
6
+ metadata.gz: 3a7be413270a65c56781df9c8ffd4fe9a488c55d1e6e481ba6b043b94a6e762258fd7d7d6c02d7976bf05e6e84909fb032d9e4a569382888df1acb87e062bec9
7
+ data.tar.gz: e14b519af7d3f25a7668e37bfe7264d2ca766a4b2d0d654fe968a85be5809c5553a7dd0d8eeb60f674118c10a6f4be7851ec68df9ee07d7c3cd639cdc7b03d6a
data/Gemfile CHANGED
@@ -11,10 +11,3 @@ gem 'bootsnap', '>= 1.9.3', require: false
11
11
  gem 'rack-cors', '~> 2.0'
12
12
  gem 'rails', '~> 7.1.0'
13
13
  gem 'tzinfo-data'
14
-
15
- group :test, :development do
16
- gem 'mock_redis', '0.45'
17
- gem 'rspec-rails', '~> 7.0'
18
- gem 'simplecov', '~> 0.20'
19
- gem 'simplecov-cobertura', '~> 2.1'
20
- end
data/bin/openc3cli CHANGED
@@ -47,15 +47,6 @@ require 'irb/completion'
47
47
 
48
48
  $redis_url = "redis://#{ENV['OPENC3_REDIS_HOSTNAME']}:#{ENV['OPENC3_REDIS_PORT']}"
49
49
 
50
- # Build the OpenStruct and OptionParser here as constants so we can use in methods
51
- MIGRATE_OPTIONS = OpenStruct.new
52
- MIGRATE_OPTIONS.all = false
53
- MIGRATE_PARSER = OptionParser.new do |opts|
54
- opts.banner = "cli migrate PLUGIN [TGT1...] # Create a OpenC3 plugin from existing COSMOS 4 targets"
55
- opts.on("-a", "--all", " Move all COSMOS 4 targets into a single OpenC3 plugin") do
56
- MIGRATE_OPTIONS.all = true
57
- end
58
- end
59
50
  ERROR_CODE = 1
60
51
 
61
52
  CLI_SCRIPT_ACTIONS = %w(help list run spawn)
@@ -82,7 +73,6 @@ def print_usage
82
73
  puts " cli list <SCOPE> # Lists installed plugins, SCOPE is DEFAULT if not given"
83
74
  puts " cli generate TYPE OPTIONS # Generate various COSMOS entities"
84
75
  puts " OPTIONS: --ruby or --python is required to specify the language in the generated code unless OPENC3_LANGUAGE is set"
85
- puts " #{MIGRATE_PARSER}"
86
76
  puts " cli bridge CONFIG_FILENAME # Run COSMOS host bridge"
87
77
  puts " cli bridgegem gem_name variable1=value1 variable2=value2 # Runs bridge using gem bridge.txt"
88
78
  puts " cli bridgesetup CONFIG_FILENAME # Create a default config file"
@@ -116,110 +106,6 @@ def check_environment
116
106
  end
117
107
  end
118
108
 
119
- def migrate(args)
120
- MIGRATE_PARSER.parse!(args)
121
- abort(MIGRATE_PARSER.to_s) if args.length == 0
122
- if MIGRATE_OPTIONS.all and args.length > 1
123
- puts "Only specify the plugin name when using --all"
124
- abort(MIGRATE_PARSER.to_s)
125
- end
126
- if !MIGRATE_OPTIONS.all and args.length < 2
127
- puts "Specify the individual target names when not using --all"
128
- abort(MIGRATE_PARSER.to_s)
129
- end
130
- if Dir.glob("config/targets/**/*").empty?
131
- puts "No targets found in config/targets/*"
132
- puts "Migrate must be run within an existing COSMOS configuration"
133
- abort(MIGRATE_PARSER.to_s)
134
- end
135
-
136
- ###############################################################
137
- # Create the framework for the plugin
138
- # NOTE: generate does a chdir to be inside the plugin directory
139
- ###############################################################
140
- plugin = args.shift
141
- OpenC3::CliGenerator.generate(['plugin', plugin])
142
-
143
- if MIGRATE_OPTIONS.all
144
- # Grab all target directories to match the command line input
145
- args = Dir.glob("../config/targets/*").map { |path| File.basename(path) }
146
- else
147
- # Ensure targets passed in on command line actually exist
148
- args.each do |target|
149
- path = File.join('..', 'config', 'targets', target)
150
- unless File.exist?(path)
151
- puts "Target #{path} does not exist!"
152
- abort(MIGRATE_PARSER.to_s)
153
- end
154
- end
155
- end
156
-
157
- # Overwrite plugin.txt with specified targets
158
- plugin = File.open('plugin.txt', 'w')
159
- FileUtils.mkdir 'targets'
160
- args.each do |target|
161
- puts "Migrating target #{target}"
162
- FileUtils.cp_r "../config/targets/#{target}", 'targets'
163
- plugin.puts "TARGET #{target} #{target}"
164
- end
165
- plugin.puts ""
166
-
167
- files = Dir.glob('../lib/*')
168
- files.concat(Dir.glob('../procedures/*'))
169
- unless files.empty?
170
- puts "Migrating /lib & /procedures to PROCEDURES target"
171
- FileUtils.cp_r '../lib', "targets/PROCEDURES"
172
- FileUtils.cp_r '../procedures', "targets/PROCEDURES"
173
- end
174
-
175
- # Migrate cmd_tlm_server.txt info to plugin.txt
176
- Dir.glob('targets/**/cmd_tlm_server*.txt') do |cmd_tlm_server_file|
177
- File.open(cmd_tlm_server_file) do |file|
178
- file.each do |line|
179
- next if line =~ /^\s*#/ # Ignore comments
180
- next if line.strip.empty? # Ignore empty lines
181
-
182
- # Convert TARGET to MAP_TARGET
183
- line.gsub!(/TARGET (\S+)/, 'MAP_TARGET \1')
184
- plugin.puts line
185
- end
186
- end
187
- plugin.puts ''
188
- end
189
-
190
- # Migrate target.txt
191
- Dir.glob('targets/**/target.txt') do |filename|
192
- file = File.read(filename)
193
- file.gsub!('LOG_RAW', 'LOG_STREAM')
194
- file.gsub!('AUTO_SCREEN_SUBSTITUTE', '')
195
- File.write(filename, file)
196
- end
197
-
198
- # Migrate some of the screens api
199
- Dir.glob('targets/**/screens/*') do |file|
200
- screen = File.read(file)
201
- screen.gsub!('cmd(', 'api.cmd(')
202
- screen.gsub!('cmd_no_checks(', 'api.cmd_no_checks(')
203
- screen.gsub!('cmd_no_range_check(', 'api.cmd_no_range_check(')
204
- screen.gsub!('cmd_no_hazardous_check(', 'api.cmd_no_hazardous_check(')
205
- screen.gsub!('get_named_widget(', 'screen.getNamedWidget(')
206
- lines = screen.split("\n")
207
- lines.map! do |line|
208
- if line.include?('Qt.')
209
- "# FIXME (no Qt): #{line.sub("<%", "< %").sub("%>", "% >")}"
210
- elsif line.include?('Cosmos::')
211
- "# FIXME (no Cosmos::): #{line.sub("<%", "< %").sub("%>", "% >")}"
212
- else
213
- line
214
- end
215
- end
216
- File.write(file, lines.join("\n"))
217
- end
218
-
219
- plugin.close
220
- puts "Plugin complete: #{File.expand_path('.')}" # Remember we're inside the plugin dir
221
- end
222
-
223
109
  def xtce_converter(args)
224
110
  options = {}
225
111
  option_parser = OptionParser.new do |opts|
@@ -619,16 +505,25 @@ def run_migrations(folder)
619
505
  end
620
506
 
621
507
  # Run each newly discovered migration unless brand_new
622
- folder = "/openc3/lib/openc3/migrations" unless folder
508
+ if !folder
509
+ folder = "/openc3/lib/openc3/migrations"
510
+ entries = Dir.entries(folder).map { |entry| File.join(folder, entry) }
511
+ folder = "/openc3-enterprise/lib/openc3-enterprise/migrations"
512
+ if File.exist?(folder)
513
+ entries.concat(Dir.entries(folder).map { |entry| File.join(folder, entry) })
514
+ end
515
+ entries = entries.sort() # run in alphabetical order
516
+ else
517
+ entries = Dir.entries(folder).sort
518
+ end
623
519
  migrations = OpenC3::MigrationModel.all
624
- entries = Dir.entries(folder).sort # run in alphabetical order
625
520
  entries.each do |entry|
626
521
  name = File.basename(entry)
627
522
  extension = File.extname(name)
628
523
  if extension == '.rb' and not migrations[name]
629
524
  unless brand_new
630
525
  puts "Running Migration: #{name}"
631
- require File.join(folder, entry)
526
+ require entry
632
527
  end
633
528
  OpenC3::MigrationModel.new(name: name).create
634
529
  end
@@ -869,9 +764,6 @@ if not ARGV[0].nil? # argument(s) given
869
764
  when 'generate'
870
765
  OpenC3::CliGenerator.generate(ARGV[1..-1])
871
766
 
872
- when 'migrate'
873
- migrate(ARGV[1..-1])
874
-
875
767
  when 'rubysloc'
876
768
  puts `ruby /openc3/bin/rubysloc #{ARGV[1..-1].join(' ')}`
877
769
 
data/bin/pipinstall CHANGED
@@ -1,11 +1,13 @@
1
1
  #!/bin/sh
2
-
3
- pip install "$@"
2
+ python3 -m venv $PYTHONUSERBASE
3
+ source $PYTHONUSERBASE/bin/activate
4
+ echo "pip3 install $@"
5
+ pip3 install "$@"
4
6
  if [ $? -eq 0 ]; then
5
7
  echo "Command succeeded"
6
8
  else
7
9
  echo "Command failed - retrying with --no-index"
8
- pip install --no-index "$@"
10
+ pip3 install --no-index "$@"
9
11
  if [ $? -eq 0 ]; then
10
12
  echo "ERROR: pip install failed"
11
13
  fi
@@ -165,7 +165,7 @@ HAZARDOUS:
165
165
  ACCESSOR:
166
166
  summary: Defines the class used to read and write raw values from the packet
167
167
  description: Defines the class that is used too read raw values from the packet. Defaults to BinaryAccessor.
168
- Provided accessors also include JsonAccessor, CborAccessor, HtmlAccessor, and XmlAccessor.
168
+ For more information see [Accessors](accessors).
169
169
  parameters:
170
170
  - name: Accessor Class Name
171
171
  required: true
@@ -252,6 +252,10 @@ VIRTUAL:
252
252
  summary: Marks this packet as virtual and not participating in identification
253
253
  description: Used for packet definitions that can be used as structures for items with a given packet.
254
254
  since: 5.18.0
255
+ RESTRICTED:
256
+ summary: Marks this packet as restricted and will require approval if critical commanding is enabled
257
+ description: Used as one of the two types of critical commands (HAZARDOUS and RESTRICTED)
258
+ since: 5.20.0
255
259
  VALIDATOR:
256
260
  summary: Defines a validator class for a command
257
261
  description: Validator class is used to validate the command success or failure with both a pre_check and post_check method.
@@ -274,6 +278,12 @@ VALIDATOR:
274
278
 
275
279
  require 'openc3/packets/command_validator'
276
280
  class CustomValidator < OpenC3::CommandValidator
281
+ # Both the pre_check and post_check are passed the command packet that was sent
282
+ # You can inspect the command in your checks as follows:
283
+ # packet.target_name => target name
284
+ # packet.packet_name => packet name (command name)
285
+ # packet.read("ITEM") => converted value
286
+ # packet.read("ITEM", :RAW) => raw value
277
287
  def pre_check(packet)
278
288
  if tlm("TGT PKT ITEM") == 0
279
289
  return [false, "TGT PKT ITEM is 0"]
@@ -293,6 +303,12 @@ VALIDATOR:
293
303
  Defined in custom_validator.py:
294
304
 
295
305
  class CustomValidator(CommandValidator):
306
+ # Both the pre_check and post_check are passed the command packet that was sent
307
+ # You can inspect the command in your checks as follows:
308
+ # packet.target_name => target name
309
+ # packet.packet_name => packet name (command name)
310
+ # packet.read("ITEM") => converted value
311
+ # packet.read("ITEM", :RAW) => raw value
296
312
  def pre_check(self, command):
297
313
  if tlm("TGT PKT ITEM") == 0:
298
314
  return [False, "TGT PKT ITEM is 0"]
@@ -153,7 +153,9 @@ OPTION:
153
153
  OPTION LISTEN_ADDRESS 127.0.0.1
154
154
  SECRET:
155
155
  summary: Define a secret needed by this interface
156
- description: Defines a secret for this interface and optionally assigns its value to an option
156
+ description:
157
+ Defines a secret for this interface and optionally assigns its value to an option.
158
+ For more information see [Admin Secrets](/docs/tools/admin#secrets).
157
159
  since: 5.3.0
158
160
  parameters:
159
161
  - name: Type
@@ -164,15 +166,19 @@ SECRET:
164
166
  values: .*
165
167
  - name: Secret Name
166
168
  required: true
167
- description: The name of the secret to retrieve
169
+ description:
170
+ The name of the secret to retrieve from the Admin / Secrets tab.
171
+ For more information see [Admin Secrets](/docs/tools/admin#secrets).
168
172
  values: .*
169
173
  - name: Environment Variable or File Path
170
174
  required: true
171
- description: Environment variable name or file path to store secret
175
+ description: Environment variable name or file path to store secret.
176
+ Note that if you use the Option Name to set an option to the secret value,
177
+ this value doesn't really matter as long as it is unique.
172
178
  values: .*
173
179
  - name: Option Name
174
180
  required: false
175
- description: Interface option to pass the secret value
181
+ description: Interface option to pass the secret value. This is the primary way to pass secrets to interfaces.
176
182
  values: .*
177
183
  - name: Secret Store Name
178
184
  required: false
@@ -252,3 +258,14 @@ ROUTE_PREFIX:
252
258
  values: .*
253
259
  example: |
254
260
  ROUTE_PREFIX /interface
261
+ SHARD:
262
+ summary: Operator shard to run target microservices on
263
+ description: Operator Shard. Only used if running multiple operator containers typically in Kubernetes
264
+ since: 6.0.0
265
+ parameters:
266
+ - name: Shard
267
+ required: false
268
+ description: Shard number starting from 0
269
+ values: \d+
270
+ example: |
271
+ SHARD 0
@@ -66,7 +66,7 @@ READ_CONVERSION:
66
66
  super().__init__()
67
67
  self.multiplier = float(multiplier)
68
68
  def call(self, value, packet, buffer):
69
- return value * multiplier
69
+ return value * self.multiplier
70
70
  parameters:
71
71
  - name: Class Filename
72
72
  required: true
@@ -115,7 +115,7 @@ MICROSERVICE:
115
115
  values: .+
116
116
  SECRET:
117
117
  summary: Define a secret needed by this microservice
118
- description: Defines a secret for this microservice
118
+ description: Defines a secret for this microservice. For more information see [Admin Secrets](/docs/tools/admin#secrets).
119
119
  since: 5.3.0
120
120
  parameters:
121
121
  - name: Type
@@ -126,7 +126,9 @@ MICROSERVICE:
126
126
  values: .*
127
127
  - name: Secret Name
128
128
  required: true
129
- description: The name of the secret to retrieve
129
+ description:
130
+ The name of the secret to retrieve from the Admin / Secrets tab.
131
+ For more information see [Admin Secrets](/docs/tools/admin#secrets).
130
132
  values: .*
131
133
  - name: Environment Variable or File Path
132
134
  required: true
@@ -160,3 +162,14 @@ MICROSERVICE:
160
162
  required: false
161
163
  description: Regex to match against filenames. If match, then no ERB processing
162
164
  values: .+
165
+ SHARD:
166
+ summary: Operator shard to run target microservices on
167
+ description: Operator Shard. Only used if running multiple operator containers typically in Kubernetes
168
+ since: 6.0.0
169
+ parameters:
170
+ - name: Shard
171
+ required: false
172
+ description: Shard number starting from 0
173
+ values: \d+
174
+ example: |
175
+ SHARD 0
@@ -52,7 +52,7 @@ OVERLAP:
52
52
  since: 4.4.1
53
53
  KEY:
54
54
  summary: Defines the key used to access this raw value in the packet.
55
- description: Keys are often JsonPath or XPath strings
55
+ description: Keys are often [JSONPath](https://en.wikipedia.org/wiki/JSONPath) or [XPath](https://en.wikipedia.org/wiki/XPath) strings
56
56
  example: KEY $.book.title
57
57
  parameters:
58
58
  - name: Key string
@@ -107,7 +107,7 @@ WRITE_CONVERSION:
107
107
  super().__init__()
108
108
  self.multiplier = float(multiplier)
109
109
  def call(self, value, packet, buffer):
110
- return value * multiplier
110
+ return value * self.multiplier
111
111
  parameters:
112
112
  - name: Class Filename
113
113
  required: true
@@ -53,7 +53,7 @@ TABLE:
53
53
  or a ROW_COLUMN table with identical rows containing different values.
54
54
  values:
55
55
  KEY_VALUE:
56
- summary: Table rows will be unique items (previously ONE_DIMENSIONAL, now deprecated)
56
+ summary: Table rows will be unique items
57
57
  parameters:
58
58
  - name: Description
59
59
  requires: true
@@ -61,7 +61,7 @@ TABLE:
61
61
  used in mouseover popups and status line information.
62
62
  values: "['\"].*['\"]"
63
63
  ROW_COLUMN:
64
- summary: Table rows will be identical with multiple columns (previously TWO_DIMENSIONAL, now deprecated)
64
+ summary: Table rows will be identical with multiple columns
65
65
  parameters:
66
66
  - name: Rows
67
67
  requires: true
@@ -196,3 +196,14 @@ TARGET:
196
196
  required: false
197
197
  description: Regex to match against filenames. If match, then no ERB processing
198
198
  values: .+
199
+ SHARD:
200
+ summary: Operator shard to run target microservices on
201
+ description: Operator Shard. Only used if running multiple operator containers typically in Kubernetes
202
+ since: 6.0.0
203
+ parameters:
204
+ - name: Shard
205
+ required: false
206
+ description: Shard number starting from 0
207
+ values: \d+
208
+ example: |
209
+ SHARD 0
@@ -165,13 +165,29 @@ HIDDEN:
165
165
  ACCESSOR:
166
166
  summary: Defines the class used to read and write raw values from the packet
167
167
  description: Defines the class that is used too read raw values from the packet. Defaults to BinaryAccessor.
168
- Provided accessors also include JsonAccessor, CborAccessor, HtmlAccessor, and XmlAccessor.
168
+ For more information see [Accessors](accessors).
169
169
  parameters:
170
170
  - name: Accessor Class Name
171
171
  required: true
172
172
  description: The name of the accessor class
173
173
  values: .+
174
174
  since: 5.0.10
175
+ TEMPLATE:
176
+ summary: Defines a template string used to pull telemetry values from a string buffer
177
+ parameters:
178
+ - name: Template
179
+ required: true
180
+ description: The template string which should be enclosed in quotes
181
+ values: "['\"].*['\"]"
182
+ since: 5.0.10
183
+ TEMPLATE_FILE:
184
+ summary: Defines a template file used to pull telemetry values from a string buffer
185
+ parameters:
186
+ - name: Template File Path
187
+ required: true
188
+ description: The relative path to the template file. Filename should generally start with an underscore.
189
+ values: .+
190
+ since: 5.0.10
175
191
  IGNORE_OVERLAP:
176
192
  summary: Ignores any packet items which overlap
177
193
  description: Packet items which overlap normally generate a warning unless each individual item has the OVERLAP keyword.
@@ -82,3 +82,15 @@ TOOL:
82
82
  required: false
83
83
  description: Regex to match against filenames. If match, then no ERB processing
84
84
  values: .+
85
+ IMPORT_MAP_ITEM:
86
+ summary: Add an item to the import map
87
+ since: 6.0.0
88
+ parameters:
89
+ - name: key
90
+ required: true
91
+ description: Import Map Key
92
+ values: .+
93
+ - name: value
94
+ required: true
95
+ description: Import Map Value
96
+ values: .+
@@ -173,14 +173,6 @@ Decoration Widgets:
173
173
  LABEL Over
174
174
  HORIZONTALLINE
175
175
  LABEL Under
176
- SECTIONHEADER:
177
- summary: DEPRECATED - Displays a label that is underlined with a horizontal line
178
- description: Use a VERTICALBOX or HORIZONTALBOX with title parameter instead of SECTIONHEADER
179
- parameters:
180
- - name: Text
181
- required: true
182
- description: Text to display
183
- values: .*
184
176
  TITLE:
185
177
  summary: Displays a large centered title on the screen
186
178
  parameters:
@@ -299,7 +291,7 @@ Telemetry Widgets:
299
291
  description: The type of the value to display. Default is CONVERTED.
300
292
  values: <%= %w(RAW CONVERTED FORMATTED WITH_UNITS) %>
301
293
  example: |
302
- BLOCK INST IMAGE IMAGE 400 130 "%02X" 4 4 "0x%08X:"
294
+ BLOCK INST IMAGE IMAGE 620 200 "%02X" 4 4 "0x%08X:"
303
295
  # FORMATFONTVALUE:
304
296
  # summary: Displays a box with a value printed inside
305
297
  # that is formatted by the specified string rather than by a format string given
@@ -377,6 +369,7 @@ Telemetry Widgets:
377
369
  values: .*
378
370
  example: |
379
371
  FORMATVALUE INST LATEST TIMESEC %012u CONVERTED 20
372
+ FORMATVALUE INST LATEST TEMP1 %.2f CONVERTED 20
380
373
  LABELLED:
381
374
  summary: Displays a LABEL followed by a LED
382
375
  parameters:
@@ -978,12 +971,6 @@ Telemetry Widgets:
978
971
  example: |
979
972
  LINEGRAPH INST HEALTH_STATUS TEMP1
980
973
  SETTING ITEM INST ADCS Q1 # Add additional item to graph
981
- LINEGRAPH INST HEALTH_STATUS TEMP2 RAW
982
- LINEGRAPH INST HEALTH_STATUS TEMP3 CONVERTED REDUCED_MINUTE MIN
983
- SETTING SIZE 600 500 # width height
984
- SETTING HISTORY 1h # load 1 hour of data into graph
985
- LINEGRAPH INST HEALTH_STATUS TEMP4
986
- SETTING HISTORY 30m # load 30 minutes of data into graph
987
974
  settings:
988
975
  # Inject the graph settings
989
976
  <%= MetaConfigParser.load('graph_settings.yaml').to_meta_config_yaml(8) %>
@@ -1232,7 +1219,6 @@ Telemetry Widgets:
1232
1219
  values: .*
1233
1220
  example: |
1234
1221
  TEXTBOX INST HEALTH_STATUS PACKET_TIMEFORMATTED 150 70
1235
- TEXTBOX INST HEALTH_STATUS PACKET_TIMEFORMATTED
1236
1222
  # TRENDBAR:
1237
1223
  # summary: Provides the same functionality as the LIMITSBAR
1238
1224
  # widget except that it also keeps a history of the telemetry item and
@@ -1401,10 +1387,20 @@ Interactive Widgets:
1401
1387
  required: true
1402
1388
  description: Text displayed next to the checkbox
1403
1389
  values: .+
1390
+ - name: Checked
1391
+ required: false
1392
+ description:
1393
+ Whether the initial state of the checkbox is checked (default = false).
1394
+ Do not give a value to make the checkbox unchecked.
1395
+ values: .+
1404
1396
  example: |
1405
- NAMED_WIDGET CHECK CHECKBUTTON 'Ignore Hazardous Checks'
1397
+ NAMED_WIDGET UNCHECKED CHECKBUTTON 'Default Unchecked'
1398
+ NAMED_WIDGET CHECK CHECKBUTTON 'Ignore Hazardous Checks' CHECKED
1406
1399
  BUTTON 'Send' 'screen.getNamedWidget("CHECK").checked() ? ' \
1407
1400
  'api.cmd_no_hazardous_check("INST CLEAR") : api.cmd("INST CLEAR")'
1401
+ # You can programmatically check or uncheck the checkbox
1402
+ BUTTON 'Check' 'screen.getNamedWidget("CHECK").value = true'
1403
+ BUTTON 'Uncheck' 'screen.getNamedWidget("CHECK").value = false'
1408
1404
  COMBOBOX:
1409
1405
  summary: Displays a drop down list of text items
1410
1406
  description:
@@ -1423,6 +1419,20 @@ Interactive Widgets:
1423
1419
  BUTTON 'Start Collect' 'var type = screen.getNamedWidget("COLLECT_TYPE").text();' +
1424
1420
  'api.cmd("INST COLLECT with TYPE "+type+", DURATION 10.0")'
1425
1421
  NAMED_WIDGET COLLECT_TYPE COMBOBOX NORMAL SPECIAL
1422
+ DATE:
1423
+ summary: Displays a date picker
1424
+ description:
1425
+ Note this is of limited use by itself and is primarily used in
1426
+ conjunction with NAMED_WIDGET.
1427
+ parameters:
1428
+ - name: Date label
1429
+ required: false
1430
+ description: Text to label the data selection ('Date' by default)
1431
+ values: .+
1432
+ example: |
1433
+ BUTTON 'Alert Date' 'var date = screen.getNamedWidget("DATE").text();' +
1434
+ 'alert("Date:"+date)'
1435
+ NAMED_WIDGET DATE DATE
1426
1436
  RADIOGROUP:
1427
1437
  summary: Creates a group of RADIOBUTTONs
1428
1438
  description: RADIOBUTTONs must be part of a group to enable selection logic
@@ -1464,6 +1474,20 @@ Interactive Widgets:
1464
1474
  NAMED_WIDGET DURATION TEXTFIELD 12 "10.0"
1465
1475
  BUTTON 'Start Collect' 'var dur = screen.getNamedWidget("DURATION").text();' +
1466
1476
  'api.cmd("INST COLLECT with TYPE NORMAL, DURATION "+dur+"")'
1477
+ TIME:
1478
+ summary: Displays a time picker
1479
+ description:
1480
+ Note this is of limited use by itself and is primarily used in
1481
+ conjunction with NAMED_WIDGET.
1482
+ parameters:
1483
+ - name: Time label
1484
+ required: false
1485
+ description: Text to label the time selection ('Time' by default)
1486
+ values: .+
1487
+ example: |
1488
+ BUTTON 'Alert Time' 'var time = screen.getNamedWidget("TIME").text();' +
1489
+ 'alert("Time:"+time)'
1490
+ NAMED_WIDGET TIME TIME
1467
1491
  Canvas Widgets:
1468
1492
  description:
1469
1493
  Canvas Widgets are used to draw custom displays into telemetry screens.
@@ -63,6 +63,7 @@ static ID id_ivar_template = 0;
63
63
  static ID id_ivar_packet_time = 0;
64
64
  static ID id_ivar_ignore_overlap = 0;
65
65
  static ID id_ivar_virtual = 0;
66
+ static ID id_ivar_restricted = 0;
66
67
 
67
68
  /* Sets the target name this packet is associated with. Unidentified packets
68
69
  * will have target name set to nil.
@@ -289,6 +290,7 @@ static VALUE packet_initialize(int argc, VALUE *argv, VALUE self)
289
290
  rb_ivar_set(self, id_ivar_packet_time, Qnil);
290
291
  rb_ivar_set(self, id_ivar_ignore_overlap, Qfalse);
291
292
  rb_ivar_set(self, id_ivar_virtual, Qfalse);
293
+ rb_ivar_set(self, id_ivar_restricted, Qfalse);
292
294
  return self;
293
295
  }
294
296
 
@@ -332,6 +334,7 @@ void Init_packet(void)
332
334
  id_ivar_packet_time = rb_intern("@packet_time");
333
335
  id_ivar_ignore_overlap = rb_intern("@ignore_overlap");
334
336
  id_ivar_virtual = rb_intern("@virtual");
337
+ id_ivar_restricted = rb_intern("@restricted");
335
338
 
336
339
  cPacket = rb_define_class_under(mOpenC3, "Packet", cStructure);
337
340
  rb_define_method(cPacket, "initialize", packet_initialize, -1);
@@ -26,11 +26,12 @@ module OpenC3
26
26
  value = nil
27
27
  ary.each do |key, ary_value|
28
28
  if key == item.key
29
+ # Handle the case of multiple values for the same key
30
+ # and build up an array of values
29
31
  if value
32
+ # Second time through value is not an Array yet
30
33
  if not Array === value
31
- value_temp = []
32
- value_temp << value
33
- value = value_temp
34
+ value = [value]
34
35
  end
35
36
  value << ary_value
36
37
  else
@@ -1,6 +1,6 @@
1
1
  # encoding: ascii-8bit
2
2
 
3
- # Copyright 2022 OpenC3, Inc.
3
+ # Copyright 2024 OpenC3, Inc.
4
4
  # All Rights Reserved.
5
5
  #
6
6
  # This program is free software; you can modify and/or redistribute it
@@ -13,7 +13,7 @@
13
13
  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
14
  # GNU Affero General Public License for more details.
15
15
  #
16
- # This file may also be used under the terms of a commercial license
16
+ # This file may also be used under the terms of a commercial license
17
17
  # if purchased from OpenC3, Inc.
18
18
 
19
19
  require 'openc3/accessors/xml_accessor'
@@ -28,4 +28,4 @@ module OpenC3
28
28
  doc.to_html
29
29
  end
30
30
  end
31
- end
31
+ end