openc3 7.5.0 → 7.6.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 (175) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +0 -0
  3. data/bin/openc3cli +82 -5
  4. data/data/config/_params.yaml +3 -0
  5. data/data/config/command_modifiers.yaml +5 -3
  6. data/data/config/default_plugins.yaml +1 -0
  7. data/data/config/interface_modifiers.yaml +17 -1
  8. data/data/config/item_modifiers.yaml +24 -1
  9. data/data/config/microservice.yaml +15 -1
  10. data/data/config/parameter_modifiers.yaml +4 -4
  11. data/data/config/plugins.yaml +511 -3
  12. data/data/config/settings.yaml +17 -0
  13. data/data/config/target.yaml +53 -0
  14. data/data/config/telemetry.yaml +58 -2
  15. data/data/config/widgets.yaml +30 -0
  16. data/lib/openc3/accessors/accessor.rb +14 -2
  17. data/lib/openc3/accessors/binary_accessor.rb +25 -5
  18. data/lib/openc3/api/CLAUDE.md +1 -0
  19. data/lib/openc3/api/api.rb +1 -0
  20. data/lib/openc3/api/cmd_api.rb +9 -1
  21. data/lib/openc3/api/interface_api.rb +7 -2
  22. data/lib/openc3/api/limits_api.rb +236 -195
  23. data/lib/openc3/api/router_api.rb +7 -2
  24. data/lib/openc3/api/settings_api.rb +4 -1
  25. data/lib/openc3/api/shared_resource_api.rb +107 -0
  26. data/lib/openc3/api/tlm_api.rb +229 -61
  27. data/lib/openc3/interfaces/http_client_interface.rb +84 -27
  28. data/lib/openc3/interfaces/protocols/preidentified_protocol.rb +6 -2
  29. data/lib/openc3/interfaces/tcpip_server_interface.rb +205 -125
  30. data/lib/openc3/io/json_api.rb +2 -10
  31. data/lib/openc3/io/json_api_object.rb +2 -10
  32. data/lib/openc3/logs/log_writer.rb +9 -8
  33. data/lib/openc3/logs/packet_log_writer.rb +8 -3
  34. data/lib/openc3/microservices/decom_common.rb +4 -1
  35. data/lib/openc3/microservices/decom_microservice.rb +73 -5
  36. data/lib/openc3/microservices/interface_decom_common.rb +16 -1
  37. data/lib/openc3/microservices/interface_microservice.rb +50 -11
  38. data/lib/openc3/microservices/limits_group_microservice.rb +513 -0
  39. data/lib/openc3/microservices/log_microservice.rb +22 -8
  40. data/lib/openc3/microservices/microservice.rb +8 -2
  41. data/lib/openc3/microservices/multi_microservice.rb +76 -22
  42. data/lib/openc3/microservices/queue_microservice.rb +29 -24
  43. data/lib/openc3/migrations/20260704000000_default_bridge.rb +1 -2
  44. data/lib/openc3/migrations/20261103000001_limits_group_backfill.rb +193 -0
  45. data/lib/openc3/models/bridge_model.rb +3 -3
  46. data/lib/openc3/models/cvt_model.rb +10 -3
  47. data/lib/openc3/models/host_interface_microservice_model.rb +4 -4
  48. data/lib/openc3/models/interface_model.rb +27 -7
  49. data/lib/openc3/models/microservice_group.rb +167 -0
  50. data/lib/openc3/models/microservice_model.rb +88 -2
  51. data/lib/openc3/models/panel_model.rb +109 -0
  52. data/lib/openc3/models/plugin_model.rb +1006 -26
  53. data/lib/openc3/models/plugin_store_model.rb +6 -1
  54. data/lib/openc3/models/protected_storage_model.rb +64 -0
  55. data/lib/openc3/models/queue_model.rb +19 -10
  56. data/lib/openc3/models/scope_model.rb +80 -3
  57. data/lib/openc3/models/setting_model.rb +2 -2
  58. data/lib/openc3/models/shared_resource_model.rb +381 -0
  59. data/lib/openc3/models/target_model.rb +333 -74
  60. data/lib/openc3/operators/microservice_operator.rb +76 -9
  61. data/lib/openc3/operators/operator.rb +29 -0
  62. data/lib/openc3/packets/commands.rb +16 -16
  63. data/lib/openc3/packets/limits.rb +2 -0
  64. data/lib/openc3/packets/packet.rb +75 -4
  65. data/lib/openc3/packets/packet_config.rb +152 -13
  66. data/lib/openc3/packets/packet_item.rb +48 -22
  67. data/lib/openc3/packets/packet_item_limits.rb +67 -6
  68. data/lib/openc3/packets/parsers/limits_parser.rb +69 -2
  69. data/lib/openc3/packets/parsers/packet_item_parser.rb +6 -0
  70. data/lib/openc3/packets/parsers/packet_parser.rb +45 -0
  71. data/lib/openc3/packets/parsers/state_parser.rb +1 -1
  72. data/lib/openc3/script/CLAUDE.md +1 -0
  73. data/lib/openc3/script/api_shared.rb +27 -17
  74. data/lib/openc3/script/calendar.rb +18 -6
  75. data/lib/openc3/script/commands.rb +11 -9
  76. data/lib/openc3/script/critical_cmd.rb +22 -2
  77. data/lib/openc3/script/extract.rb +52 -5
  78. data/lib/openc3/script/metadata.rb +30 -4
  79. data/lib/openc3/script/plugins.rb +8 -0
  80. data/lib/openc3/script/script.rb +9 -25
  81. data/lib/openc3/script/web_socket_api.rb +23 -17
  82. data/lib/openc3/system/system.rb +9 -3
  83. data/lib/openc3/top_level.rb +17 -0
  84. data/lib/openc3/topics/command_topic.rb +7 -1
  85. data/lib/openc3/topics/decom_interface_topic.rb +9 -3
  86. data/lib/openc3/topics/discovery_topic.rb +84 -0
  87. data/lib/openc3/topics/limits_event_topic.rb +317 -11
  88. data/lib/openc3/topics/router_topic.rb +6 -2
  89. data/lib/openc3/topics/system_events_topic.rb +9 -6
  90. data/lib/openc3/topics/telemetry_decom_topic.rb +12 -3
  91. data/lib/openc3/topics/topic.rb +9 -1
  92. data/lib/openc3/utilities/authentication.rb +67 -16
  93. data/lib/openc3/utilities/bucket.rb +5 -0
  94. data/lib/openc3/utilities/cli_generator.rb +117 -25
  95. data/lib/openc3/utilities/client_ip_header_filter.rb +38 -0
  96. data/lib/openc3/utilities/config_overlay.rb +24 -1
  97. data/lib/openc3/utilities/cosmos_rails_formatter.rb +18 -10
  98. data/lib/openc3/utilities/hardware_discovery.rb +279 -0
  99. data/lib/openc3/utilities/limits_rollup.rb +81 -0
  100. data/lib/openc3/utilities/local_mode.rb +48 -5
  101. data/lib/openc3/utilities/questdb_client.rb +256 -54
  102. data/lib/openc3/utilities/reingest_job.rb +12 -3
  103. data/lib/openc3/utilities/running_script.rb +206 -49
  104. data/lib/openc3/utilities/script.rb +24 -12
  105. data/lib/openc3/utilities/script_env.rb +164 -0
  106. data/lib/openc3/utilities/script_message_signing.rb +133 -0
  107. data/lib/openc3/utilities/secrets.rb +5 -0
  108. data/lib/openc3/utilities/store_autoload.rb +35 -2
  109. data/lib/openc3/utilities/store_queued.rb +5 -1
  110. data/lib/openc3/version.rb +5 -5
  111. data/templates/command_validator/command_validator.py +9 -9
  112. data/templates/{tool_react/pnpm-workspace.yaml → panel/.prettierrc.cjs} +7 -5
  113. data/templates/panel/Rakefile +24 -0
  114. data/templates/panel/package.json +17 -0
  115. data/templates/{tool_angular → panel}/pnpm-workspace.yaml +5 -0
  116. data/templates/panel/src/Panel.js +52 -0
  117. data/templates/panel/src/Panel.vue +60 -0
  118. data/templates/panel/src/panelSdk.js +24 -0
  119. data/templates/panel/vite-Panel.config.js +43 -0
  120. data/templates/tool_vue/package.json +3 -3
  121. data/templates/widget/package.json +2 -2
  122. metadata +24 -56
  123. data/templates/tool_angular/.editorconfig +0 -16
  124. data/templates/tool_angular/.gitignore +0 -44
  125. data/templates/tool_angular/.vscode/extensions.json +0 -4
  126. data/templates/tool_angular/.vscode/launch.json +0 -20
  127. data/templates/tool_angular/.vscode/tasks.json +0 -42
  128. data/templates/tool_angular/angular.json +0 -111
  129. data/templates/tool_angular/extra-webpack.config.js +0 -8
  130. data/templates/tool_angular/package.json +0 -48
  131. data/templates/tool_angular/src/app/app-routing.module.ts +0 -15
  132. data/templates/tool_angular/src/app/app.component.html +0 -22
  133. data/templates/tool_angular/src/app/app.component.scss +0 -18
  134. data/templates/tool_angular/src/app/app.component.spec.ts +0 -29
  135. data/templates/tool_angular/src/app/app.component.ts +0 -52
  136. data/templates/tool_angular/src/app/app.module.ts +0 -30
  137. data/templates/tool_angular/src/app/custom-overlay-container.ts +0 -17
  138. data/templates/tool_angular/src/app/empty-route/empty-route.component.ts +0 -7
  139. data/templates/tool_angular/src/app/openc3-api.d.ts +0 -1
  140. data/templates/tool_angular/src/assets/.gitkeep +0 -0
  141. data/templates/tool_angular/src/environments/environment.prod.ts +0 -3
  142. data/templates/tool_angular/src/environments/environment.ts +0 -16
  143. data/templates/tool_angular/src/favicon.ico +0 -0
  144. data/templates/tool_angular/src/index.html +0 -13
  145. data/templates/tool_angular/src/main.single-spa.ts +0 -40
  146. data/templates/tool_angular/src/single-spa/asset-url.ts +0 -12
  147. data/templates/tool_angular/src/single-spa/single-spa-props.ts +0 -8
  148. data/templates/tool_angular/src/styles.scss +0 -1
  149. data/templates/tool_angular/tsconfig.app.json +0 -13
  150. data/templates/tool_angular/tsconfig.json +0 -33
  151. data/templates/tool_angular/tsconfig.spec.json +0 -14
  152. data/templates/tool_react/.eslintrc +0 -7
  153. data/templates/tool_react/.gitignore +0 -71
  154. data/templates/tool_react/.prettierignore +0 -8
  155. data/templates/tool_react/babel.config.json +0 -29
  156. data/templates/tool_react/jest.config.js +0 -12
  157. data/templates/tool_react/package.json +0 -51
  158. data/templates/tool_react/src/openc3-tool_name.js +0 -24
  159. data/templates/tool_react/src/root.component.js +0 -88
  160. data/templates/tool_react/src/root.component.test.js +0 -9
  161. data/templates/tool_react/webpack.config.js +0 -27
  162. data/templates/tool_svelte/.gitignore +0 -71
  163. data/templates/tool_svelte/.prettierignore +0 -8
  164. data/templates/tool_svelte/.prettierrc.js +0 -5
  165. data/templates/tool_svelte/babel.config.js +0 -12
  166. data/templates/tool_svelte/build/smui.css +0 -1
  167. data/templates/tool_svelte/jest.config.js +0 -9
  168. data/templates/tool_svelte/package.json +0 -49
  169. data/templates/tool_svelte/pnpm-workspace.yaml +0 -20
  170. data/templates/tool_svelte/rollup.config.js +0 -74
  171. data/templates/tool_svelte/src/App.svelte +0 -42
  172. data/templates/tool_svelte/src/App.test.js +0 -9
  173. data/templates/tool_svelte/src/theme/_smui-theme.scss +0 -25
  174. data/templates/tool_svelte/src/tool_name.js +0 -17
  175. data/templates/widget/LICENSE.md +0 -20
@@ -15,6 +15,7 @@ TELEMETRY:
15
15
  description:
16
16
  Name of this telemetry packet. Also referred to as its mnemonic.
17
17
  Must be unique to telemetry packets in this target. Ideally will be as short and clear as possible.
18
+ LIMITS_GROUP is reserved for the packet COSMOS generates from the target's limits groups.
18
19
  values: \D\S*
19
20
  - name: Endianness
20
21
  required: true
@@ -59,6 +60,30 @@ LIMITS_GROUP:
59
60
  but the last enabled or disabled group "wins". For example, if an item belongs to
60
61
  GROUP1 and GROUP2 and you first enable GROUP1 and then disable GROUP2 the item will
61
62
  be disabled. If you then enable GROUP1 again it will be enabled.
63
+
64
+
65
+ Each limits group is also published as telemetry in the LIMITS_GROUP packet of the
66
+ target which defines the group. For a group named THERMAL defined by the INST target,
67
+ INST LIMITS_GROUP THERMAL is the most severe limits state (GREEN, YELLOW or RED) of the
68
+ group's members which have limits enabled, so it can be displayed on screens, graphed,
69
+ used in scripts with tlm and wait_check, and extracted from history. It's BLUE only
70
+ when every member which counts is BLUE, and DISABLED when limits are disabled on every
71
+ member. INST LIMITS_GROUP THERMAL_ENABLED is TRUE when limits are enabled on every
72
+ member, FALSE when they're disabled on every member, and PARTIAL otherwise, for example
73
+ when a nested group is disabled. A group whose enabled members have no limits state yet
74
+ is GREEN with no limits color. The LIMITS_GROUP packet
75
+ name is reserved, so a target can't define a telemetry packet named LIMITS_GROUP.
76
+
77
+
78
+ Group names become item names so they follow the same rules as ITEM names
79
+ (no spaces, quotes, double underscores or trailing underscore). They also become
80
+ time-series database columns so they can't contain characters the database
81
+ replaces with an underscore, like the period in TEMP.A. They can't end in _ENABLED,
82
+ use a reserved item name like RECEIVED_COUNT or PACKET_TIME, or be longer than 119
83
+ characters. A group whose name breaks these rules is skipped with a warning, along
84
+ with its LIMITS_GROUP_ITEM and NESTED_LIMITS_GROUP lines, and a NESTED_LIMITS_GROUP
85
+ with such a name is skipped the same way. Group names only need to be unique within
86
+ a target, so two targets can each define a THERMAL group.
62
87
  parameters:
63
88
  - name: Group Name
64
89
  required: true
@@ -68,7 +93,10 @@ LIMITS_GROUP_ITEM:
68
93
  summary: Adds the specified telemetry item to the last defined LIMITS_GROUP
69
94
  description:
70
95
  Limits group information is typically kept in a separate configuration
71
- file in the config/TARGET/cmd_tlm folder named limits_groups.txt.
96
+ file in the config/TARGET/cmd_tlm folder named limits_groups.txt. Use
97
+ NESTED_LIMITS_GROUP to add another limits group. A LIMITS_GROUP_ITEM in a
98
+ packet named LIMITS_GROUP is skipped with a warning since that packet holds
99
+ the rolled up state of limits groups.
72
100
  parameters:
73
101
  - name: Target Name
74
102
  required: true
@@ -83,7 +111,35 @@ LIMITS_GROUP_ITEM:
83
111
  description: Name of the telemetry item to add to the group
84
112
  values: .+
85
113
  example: |
86
- LIMITS_GROUP SUBSYSTEM
114
+ LIMITS_GROUP THERMAL
87
115
  LIMITS_GROUP_ITEM INST HEALTH_STATUS TEMP1
88
116
  LIMITS_GROUP_ITEM INST HEALTH_STATUS TEMP2
89
117
  LIMITS_GROUP_ITEM INST HEALTH_STATUS TEMP3
118
+ NESTED_LIMITS_GROUP:
119
+ summary: Nests the specified limits group in the last defined LIMITS_GROUP
120
+ description:
121
+ The parent group rolls up the nested group's state. Enabling or disabling the
122
+ parent enables or disables every group and item below it unless the API is
123
+ called with cascade false, which only changes the parent itself and the items
124
+ directly in it. A group disabled this way is DISABLED and its parents ignore it
125
+ while its nested groups keep checking limits and rolling up their own state. Pass just
126
+ the group name to nest a group defined by the same target, or the target name
127
+ and group name to nest a group defined by another target. A nested group can be
128
+ installed after its parent and is ignored until it is.
129
+ Nested groups can't form a loop, so a group can't contain itself directly or
130
+ through other groups. Installing a target skips the NESTED_LIMITS_GROUP which
131
+ would close a loop and logs a warning.
132
+ parameters:
133
+ - name: Target Name or Group Name
134
+ required: true
135
+ description: Name of the target which defines the group, or the name of a limits group of this target when it's the only parameter
136
+ values: .+
137
+ - name: Group Name
138
+ required: false
139
+ description: Name of the limits group. Required when the first parameter is a target name.
140
+ values: .+
141
+ example: |
142
+ LIMITS_GROUP SPACECRAFT
143
+ NESTED_LIMITS_GROUP THERMAL
144
+ NESTED_LIMITS_GROUP INST2 POWER
145
+ LIMITS_GROUP_ITEM INST HEALTH_STATUS VOLTS
@@ -119,6 +119,36 @@ Layout Widgets:
119
119
  END
120
120
  TABBOOK:
121
121
  summary: Creates a tabbed area in which to place TABITEM widgets
122
+ example: |
123
+ TABBOOK
124
+ SETTING LIMITS_STATE TRUE
125
+ TABITEM "Temperatures"
126
+ LABELVALUE INST HEALTH_STATUS TEMP1
127
+ LABELVALUE INST HEALTH_STATUS TEMP2
128
+ END
129
+ TABITEM "Ground"
130
+ LABELVALUE INST HEALTH_STATUS GROUND1STATUS
131
+ END
132
+ END
133
+ settings:
134
+ LIMITS_STATE:
135
+ summary: Outline each tab in the worst limits color of the items on it
136
+ description:
137
+ When set to TRUE, each tab is outlined in the worst limits color of the items on
138
+ that tab (RED, then YELLOW, then GREEN, with BLUE counted as GREEN) and shows the
139
+ matching Astro status icon before its name, so you can see a problem on a tab that
140
+ isn't showing. Tabs without items in a limits state have
141
+ no outline. Items in TABBOOKs nested inside a tab count toward that tab.
142
+ To do this every tab, including the tabs of nested TABBOOKs, is built when the
143
+ screen opens instead of when it is first shown, so all of their items are polled
144
+ and their graphs and other widgets run from the start. Put this SETTING directly
145
+ after TABBOOK, before the first TABITEM.
146
+ since: 7.6.0
147
+ parameters:
148
+ - name: Enabled
149
+ required: true
150
+ description: Whether to outline the tabs
151
+ values: ["TRUE", "FALSE"]
122
152
  TABITEM:
123
153
  summary: Creates a VERTICAL layout tab into which to place widgets
124
154
  parameters:
@@ -139,9 +139,9 @@ module OpenC3
139
139
  when :UINT, :INT
140
140
  if item.array_size
141
141
  value = JSON.parse(value) if value.is_a? String
142
- value = value.map { |v| Integer(v) }
142
+ value = value.map { |v| convert_to_int(v) }
143
143
  else
144
- value = Integer(value)
144
+ value = convert_to_int(value)
145
145
  end
146
146
  when :FLOAT
147
147
  if item.array_size
@@ -155,5 +155,17 @@ module OpenC3
155
155
  end
156
156
  return value
157
157
  end
158
+
159
+ # Leading zeros on a decimal string, which Integer() would read as octal
160
+ LEADING_ZEROS = /\A(\s*[+-]?)(?:0_?)+(?=\d[\d_]*\s*\z)/
161
+
162
+ # Integer() with leading zeros treated as decimal, so "010" is 10 rather
163
+ # than octal 8. Prefixed strings like "0x10" are left to Integer().
164
+ # Python's accessor.py _convert_to_int matches this, keep the two in sync.
165
+ def self.convert_to_int(value)
166
+ value = value.sub(LEADING_ZEROS, '\1') if value.is_a?(String)
167
+ return Integer(value)
168
+ end
169
+ private_class_method :convert_to_int
158
170
  end
159
171
  end
@@ -179,7 +179,15 @@ module OpenC3
179
179
  structure = parent_item.structure
180
180
  structure.read(item.key, :RAW, structure_buffer)
181
181
  else
182
- handle_read_variable_bit_size(item, buffer) if item.variable_bit_size
182
+ if item.variable_bit_size
183
+ handle_read_variable_bit_size(item, buffer)
184
+ # A size of 0 normally means fill the rest of the buffer but here it means empty
185
+ if item.array_size
186
+ return [] if item.array_size == 0
187
+ elsif item.bit_size == 0
188
+ return ''.b
189
+ end
190
+ end
183
191
  if @packet.short_buffer_allowed && (native_value_out_of_range?(item) || derived_size_negative?(item, buffer))
184
192
  return nil
185
193
  end
@@ -274,26 +282,38 @@ module OpenC3
274
282
  end
275
283
  # Probably not possible to get this condition because we don't allow 0 sized floats
276
284
  # but check for it just to cover all the possible data_types
277
- elsif item.data_type == :FLOAT
285
+ # (variable sized FLOAT arrays are handled below)
286
+ elsif item.data_type == :FLOAT and not item.original_array_size
278
287
  raise "Variable bit size not currently supported for FLOAT data type"
279
288
  else
280
289
  # STRING, BLOCK, or array types
290
+ length_bits_per_count = item.variable_bit_size['length_bits_per_count']
291
+ length_value_bit_offset = item.variable_bit_size['length_value_bit_offset']
281
292
 
282
293
  # Calculate current bit size so we can preserve bytes after the item
283
294
  length_item_value = @packet.read(item.variable_bit_size['length_item_name'], :CONVERTED)
284
- current_bit_size = (length_item_value * item.variable_bit_size['length_bits_per_count']) + item.variable_bit_size['length_value_bit_offset']
295
+ current_bit_size = (length_item_value * length_bits_per_count) + length_value_bit_offset
285
296
 
286
297
  # Calculate bits after this item
287
298
  bits_with_item = item.bit_offset + current_bit_size
288
299
  bits_after_item = (buffer.length * 8) - bits_with_item
300
+
301
+ # Arrays are sized in elements, STRING and BLOCK in bytes
302
+ value_unit_bit_size = item.original_array_size ? item.bit_size : 8
303
+ new_bit_size = value.length * value_unit_bit_size
304
+ # Reject sizes the length item can't represent exactly or the reader would decode the wrong size
305
+ length_bits = new_bit_size - length_value_bit_offset
306
+ if length_bits % length_bits_per_count != 0
307
+ raise ArgumentError, "Variable bit size #{new_bit_size} for item #{item.name} is not representable with length_bits_per_count #{length_bits_per_count} and length_value_bit_offset #{length_value_bit_offset}"
308
+ end
309
+
289
310
  if item.original_array_size
290
311
  item.array_size = -bits_after_item
291
312
  else
292
313
  item.bit_size = -bits_after_item
293
314
  end
294
315
 
295
- new_bit_size = value.length * 8
296
- length_value = (new_bit_size - item.variable_bit_size['length_value_bit_offset']) / item.variable_bit_size['length_bits_per_count']
316
+ length_value = length_bits / length_bits_per_count
297
317
  @packet.write(item.variable_bit_size['length_item_name'], length_value)
298
318
 
299
319
  # Later items need their bit_offset adjusted by the change in this item
@@ -0,0 +1 @@
1
+ When any files in this directory are modified, update the appropriate documentation in docs.openc3.com/docs/guides/scripting-api.md and the docs.openc3.com/docs/guides/script-writing.md
@@ -26,6 +26,7 @@ require 'openc3/api/metrics_api'
26
26
  require 'openc3/api/offline_access_api'
27
27
  require 'openc3/api/router_api'
28
28
  require 'openc3/api/settings_api'
29
+ require 'openc3/api/shared_resource_api'
29
30
  require 'openc3/api/stash_api'
30
31
  require 'openc3/api/target_api'
31
32
  require 'openc3/api/tlm_api'
@@ -20,6 +20,7 @@
20
20
 
21
21
  require 'openc3/api/interface_api'
22
22
  require 'openc3/models/queue_model'
23
+ require 'openc3/models/shared_resource_model'
23
24
  require 'openc3/models/target_model'
24
25
  require 'openc3/topics/command_topic'
25
26
  require 'openc3/topics/command_decom_topic'
@@ -170,6 +171,7 @@ module OpenC3
170
171
  interface['cmd_target_names'].each do |target_name|
171
172
  authorize(permission: 'cmd_raw', interface_name: interface_name, target_name: target_name, manual: manual, scope: scope, token: token)
172
173
  end
174
+ SharedResourceModel.check_interface_active('INTERFACE', interface_name, scope: scope)
173
175
  InterfaceTopic.write_raw(interface_name, data, scope: scope)
174
176
  end
175
177
 
@@ -447,7 +449,7 @@ module OpenC3
447
449
 
448
450
  # NOTE: When adding new keywords to this method, make sure to update script/commands.rb
449
451
  def _cmd_implementation(method_name, *args, range_check:, hazardous_check:, raw:, timeout: nil, log_message: nil, manual: false, validate: true, queue: nil,
450
- queue_username: nil, scope: $openc3_scope, token: $openc3_token, **kwargs)
452
+ queue_username: nil, extra: nil, scope: $openc3_scope, token: $openc3_token, **kwargs)
451
453
  extract_string_kwargs_to_args(args, kwargs)
452
454
  unless [nil, true, false].include?(log_message)
453
455
  raise "Invalid log_message parameter: #{log_message}. Must be true or false."
@@ -459,6 +461,9 @@ module OpenC3
459
461
  raise "Invalid timeout parameter: #{timeout}. Must be numeric."
460
462
  end
461
463
  end
464
+ unless extra.nil? || extra.is_a?(Hash)
465
+ raise "Invalid extra parameter: #{extra}. Must be a Hash."
466
+ end
462
467
 
463
468
  case args.length
464
469
  when 1
@@ -479,6 +484,7 @@ module OpenC3
479
484
  cmd_name = cmd_name.upcase
480
485
  cmd_params = cmd_params.transform_keys(&:upcase)
481
486
  user = authorize(permission: 'cmd', target_name: target_name, packet_name: cmd_name, manual: manual, scope: scope, token: token)
487
+ SharedResourceModel.check_target_active(target_name, scope: scope)
482
488
  if user.nil?
483
489
  user = {}
484
490
  user['username'] = ENV.fetch('OPENC3_MICROSERVICE_NAME', nil)
@@ -532,6 +538,7 @@ module OpenC3
532
538
  'log_message' => log_message.to_s,
533
539
  'obfuscated_items' => packet['obfuscated_items'].to_s
534
540
  }
541
+ command['extra'] = extra unless extra.nil?
535
542
  # Record the original queuing user (author) separately from 'username' (the
536
543
  # user or process that actually executed the command). Command History shows
537
544
  # 'username' as "Executed By" and queue_username as "Queued By".
@@ -547,6 +554,7 @@ module OpenC3
547
554
  target_name: target_name,
548
555
  cmd_name: cmd_name,
549
556
  cmd_params: cmd_params,
557
+ extra: extra,
550
558
  validate: validate,
551
559
  timeout: timeout,
552
560
  username: username,
@@ -17,6 +17,7 @@
17
17
 
18
18
  require 'openc3/models/interface_model'
19
19
  require 'openc3/models/interface_status_model'
20
+ require 'openc3/models/shared_resource_model'
20
21
  require 'openc3/topics/interface_topic'
21
22
 
22
23
  module OpenC3
@@ -64,6 +65,7 @@ module OpenC3
64
65
  def connect_interface(interface_name, *interface_params, manual: false, scope: $openc3_scope, token: $openc3_token)
65
66
  # TODO: Check if they have command authority for the targets mapped to this interface
66
67
  authorize(permission: 'system_set', interface_name: interface_name, manual: manual, scope: scope, token: token)
68
+ SharedResourceModel.check_interface_active('INTERFACE', interface_name, scope: scope)
67
69
  InterfaceTopic.connect_interface(interface_name, *interface_params, scope: scope)
68
70
  end
69
71
 
@@ -83,7 +85,7 @@ module OpenC3
83
85
  # TODO: Check if they have command authority for the targets mapped to this interface
84
86
  authorize(permission: 'system_set', interface_name: interface_name, manual: manual, scope: scope, token: token)
85
87
  if interface_name == 'ALL'
86
- get_interface_names().each do |interface_name|
88
+ get_interface_names(manual: manual, scope: scope, token: token).each do |interface_name|
87
89
  InterfaceTopic.start_raw_logging(interface_name, scope: scope)
88
90
  end
89
91
  else
@@ -98,7 +100,7 @@ module OpenC3
98
100
  # TODO: Check if they have command authority for the targets mapped to this interface
99
101
  authorize(permission: 'system_set', interface_name: interface_name, manual: manual, scope: scope, token: token)
100
102
  if interface_name == 'ALL'
101
- get_interface_names().each do |interface_name|
103
+ get_interface_names(manual: manual, scope: scope, token: token).each do |interface_name|
102
104
  InterfaceTopic.stop_raw_logging(interface_name, scope: scope)
103
105
  end
104
106
  else
@@ -176,12 +178,14 @@ module OpenC3
176
178
  def interface_cmd(interface_name, cmd_name, *cmd_params, manual: false, scope: $openc3_scope, token: $openc3_token)
177
179
  # TODO: Check if they have command authority for the targets mapped to this interface
178
180
  authorize(permission: 'system_set', interface_name: interface_name, manual: manual, scope: scope, token: token)
181
+ SharedResourceModel.check_interface_active('INTERFACE', interface_name, scope: scope)
179
182
  InterfaceTopic.interface_cmd(interface_name, cmd_name, *cmd_params, scope: scope)
180
183
  end
181
184
 
182
185
  def interface_protocol_cmd(interface_name, cmd_name, *cmd_params, read_write: :READ_WRITE, index: -1, manual: false, scope: $openc3_scope, token: $openc3_token)
183
186
  # TODO: Check if they have command authority for the targets mapped to this interface
184
187
  authorize(permission: 'system_set', interface_name: interface_name, manual: manual, scope: scope, token: token)
188
+ SharedResourceModel.check_interface_active('INTERFACE', interface_name, scope: scope)
185
189
  InterfaceTopic.protocol_cmd(interface_name, cmd_name, *cmd_params, read_write: read_write, index: index, scope: scope)
186
190
  end
187
191
 
@@ -221,6 +225,7 @@ module OpenC3
221
225
 
222
226
  def interface_details(interface_name, manual: false, scope: $openc3_scope, token: $openc3_token)
223
227
  authorize(permission: 'system', interface_name: interface_name, manual: manual, scope: scope, token: token)
228
+ SharedResourceModel.check_interface_active('INTERFACE', interface_name, scope: scope)
224
229
  InterfaceTopic.interface_details(interface_name, scope: scope)
225
230
  end
226
231
  end