openc3 6.5.1 → 6.7.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.
- checksums.yaml +4 -4
- data/bin/openc3cli +66 -10
- data/data/config/command_modifiers.yaml +3 -3
- data/data/config/interface_modifiers.yaml +1 -1
- data/data/config/param_item_modifiers.yaml +3 -0
- data/data/config/table_manager.yaml +1 -1
- data/data/config/telemetry_modifiers.yaml +3 -3
- data/data/config/widgets.yaml +2 -2
- data/lib/openc3/accessors.rb +1 -1
- data/lib/openc3/api/cmd_api.rb +5 -45
- data/lib/openc3/api/settings_api.rb +8 -0
- data/lib/openc3/api/stash_api.rb +1 -1
- data/lib/openc3/api/tlm_api.rb +93 -14
- data/lib/openc3/core_ext/kernel.rb +3 -3
- data/lib/openc3/logs/log_writer.rb +16 -12
- data/lib/openc3/microservices/interface_microservice.rb +2 -0
- data/lib/openc3/microservices/plugin_microservice.rb +2 -2
- data/lib/openc3/models/cvt_model.rb +140 -3
- data/lib/openc3/models/plugin_model.rb +7 -2
- data/lib/openc3/models/plugin_store_model.rb +70 -0
- data/lib/openc3/models/target_model.rb +26 -0
- data/lib/openc3/models/tool_model.rb +1 -1
- data/lib/openc3/packets/commands.rb +7 -49
- data/lib/openc3/packets/packet.rb +67 -2
- data/lib/openc3/packets/packet_config.rb +10 -2
- data/lib/openc3/packets/packet_item.rb +10 -1
- data/lib/openc3/packets/parsers/state_parser.rb +7 -1
- data/lib/openc3/packets/structure.rb +9 -2
- data/lib/openc3/script/calendar.rb +10 -10
- data/lib/openc3/script/commands.rb +37 -24
- data/lib/openc3/script/script_runner.rb +7 -2
- data/lib/openc3/script/tables.rb +3 -3
- data/lib/openc3/tools/table_manager/table_config.rb +3 -3
- data/lib/openc3/top_level.rb +2 -6
- data/lib/openc3/topics/command_topic.rb +12 -15
- data/lib/openc3/utilities/authorization.rb +1 -1
- data/lib/openc3/utilities/cmd_log.rb +70 -0
- data/lib/openc3/utilities/cosmos_rails_formatter.rb +1 -1
- data/lib/openc3/utilities/logger.rb +1 -1
- data/lib/openc3/utilities/running_script.rb +5 -1
- data/lib/openc3/version.rb +6 -6
- data/templates/tool_angular/package.json +2 -2
- data/templates/tool_react/package.json +1 -1
- data/templates/tool_svelte/package.json +1 -1
- data/templates/tool_vue/package.json +3 -3
- data/templates/widget/package.json +2 -2
- metadata +60 -16
@@ -603,7 +603,7 @@ module OpenC3
|
|
603
603
|
if item.variable_bit_size
|
604
604
|
# Bit size is determined by length field
|
605
605
|
length_value = self.read(item.variable_bit_size['length_item_name'], :CONVERTED)
|
606
|
-
if item.data_type == :INT or item.data_type == :UINT and not item.original_array_size
|
606
|
+
if (item.data_type == :INT or item.data_type == :UINT) and not item.original_array_size
|
607
607
|
case length_value
|
608
608
|
when 0
|
609
609
|
return 6
|
@@ -641,7 +641,14 @@ module OpenC3
|
|
641
641
|
# Calculate the actual current size of this variable length item
|
642
642
|
new_bit_size = calculate_total_bit_size(item)
|
643
643
|
|
644
|
-
if item.
|
644
|
+
if item.original_array_size
|
645
|
+
# Array size has changed from original - so we need to adjust everything after this item
|
646
|
+
# This includes items that may have the same bit_offset as the variable length item because it
|
647
|
+
# started out at zero bit_size
|
648
|
+
if item.original_array_size != new_bit_size
|
649
|
+
adjustment += (new_bit_size - item.original_array_size)
|
650
|
+
end
|
651
|
+
elsif item.original_bit_size != new_bit_size
|
645
652
|
# Bit size has changed from original - so we need to adjust everything after this item
|
646
653
|
# This includes items that may have the same bit_offset as the variable length item because it
|
647
654
|
# started out at zero bit_size
|
@@ -25,7 +25,7 @@ module OpenC3
|
|
25
25
|
|
26
26
|
def list_timelines(scope: $openc3_scope)
|
27
27
|
response = $api_server.request('get', "/openc3-api/timeline", scope: scope)
|
28
|
-
return
|
28
|
+
return _cal_handle_response(response, 'Failed to list timelines')
|
29
29
|
end
|
30
30
|
|
31
31
|
def create_timeline(name, color: nil, scope: $openc3_scope)
|
@@ -33,19 +33,19 @@ module OpenC3
|
|
33
33
|
data['name'] = name
|
34
34
|
data['color'] = color if color
|
35
35
|
response = $api_server.request('post', "/openc3-api/timeline", data: data, json: true, scope: scope)
|
36
|
-
return
|
36
|
+
return _cal_handle_response(response, 'Failed to create timeline')
|
37
37
|
end
|
38
38
|
|
39
39
|
def get_timeline(name, scope: $openc3_scope)
|
40
40
|
response = $api_server.request('get', "/openc3-api/timeline/#{name}", scope: scope)
|
41
|
-
return
|
41
|
+
return _cal_handle_response(response, 'Failed to get timeline')
|
42
42
|
end
|
43
43
|
|
44
44
|
def set_timeline_color(name, color, scope: $openc3_scope)
|
45
45
|
post_data = {}
|
46
46
|
post_data['color'] = color
|
47
47
|
response = $api_server.request('post', "/openc3-api/timeline/#{name}/color", data: post_data, json: true, scope: scope)
|
48
|
-
return
|
48
|
+
return _cal_handle_response(response, 'Failed to set timeline color')
|
49
49
|
end
|
50
50
|
|
51
51
|
def delete_timeline(name, force: false, scope: $openc3_scope)
|
@@ -54,7 +54,7 @@ module OpenC3
|
|
54
54
|
url += "?force=true"
|
55
55
|
end
|
56
56
|
response = $api_server.request('delete', url, scope: scope)
|
57
|
-
return
|
57
|
+
return _cal_handle_response(response, 'Failed to delete timeline')
|
58
58
|
end
|
59
59
|
|
60
60
|
def create_timeline_activity(name, kind:, start:, stop:, data: {}, scope: $openc3_scope)
|
@@ -69,12 +69,12 @@ module OpenC3
|
|
69
69
|
post_data['kind'] = kind
|
70
70
|
post_data['data'] = data
|
71
71
|
response = $api_server.request('post', "/openc3-api/timeline/#{name}/activities", data: post_data, json: true, scope: scope)
|
72
|
-
return
|
72
|
+
return _cal_handle_response(response, 'Failed to create timeline activity')
|
73
73
|
end
|
74
74
|
|
75
75
|
def get_timeline_activity(name, start, uuid, scope: $openc3_scope)
|
76
76
|
response = $api_server.request('get', "/openc3-api/timeline/#{name}/activity/#{start}/#{uuid}", scope: scope)
|
77
|
-
return
|
77
|
+
return _cal_handle_response(response, 'Failed to get timeline activity')
|
78
78
|
end
|
79
79
|
|
80
80
|
def get_timeline_activities(name, start: nil, stop: nil, limit: nil, scope: $openc3_scope)
|
@@ -86,16 +86,16 @@ module OpenC3
|
|
86
86
|
url += "?limit=#{limit}"
|
87
87
|
end
|
88
88
|
response = $api_server.request('get', url, scope: scope)
|
89
|
-
return
|
89
|
+
return _cal_handle_response(response, 'Failed to get timeline activities')
|
90
90
|
end
|
91
91
|
|
92
92
|
def delete_timeline_activity(name, start, uuid, scope: $openc3_scope)
|
93
93
|
response = $api_server.request('delete', "/openc3-api/timeline/#{name}/activity/#{start}/#{uuid}", scope: scope)
|
94
|
-
return
|
94
|
+
return _cal_handle_response(response, 'Failed to delete timeline activity')
|
95
95
|
end
|
96
96
|
|
97
97
|
# Helper method to handle the response
|
98
|
-
def
|
98
|
+
def _cal_handle_response(response, error_message)
|
99
99
|
return nil if response.nil?
|
100
100
|
if response.status >= 400
|
101
101
|
result = JSON.parse(response.body, :allow_nan => true, :create_additions => true)
|
@@ -14,12 +14,13 @@
|
|
14
14
|
# GNU Affero General Public License for more details.
|
15
15
|
|
16
16
|
# Modified by OpenC3, Inc.
|
17
|
-
# All changes Copyright
|
17
|
+
# All changes Copyright 2025, OpenC3, Inc.
|
18
18
|
# All Rights Reserved
|
19
19
|
#
|
20
20
|
# This file may also be used under the terms of a commercial license
|
21
21
|
# if purchased from OpenC3, Inc.
|
22
22
|
|
23
|
+
require 'json'
|
23
24
|
require 'openc3/packets/packet'
|
24
25
|
require 'openc3/script/extract'
|
25
26
|
|
@@ -30,7 +31,14 @@ module OpenC3
|
|
30
31
|
private
|
31
32
|
|
32
33
|
# Format the command like it appears in a script
|
33
|
-
def _cmd_string(target_name, cmd_name, cmd_params, raw)
|
34
|
+
def _cmd_string(target_name, cmd_name, cmd_params, raw, obfuscated_items)
|
35
|
+
# Normally obfuscated_items is returned as an Array formatted as a JSON string
|
36
|
+
# because we're hitting the API server, but in the case of a disconnect command, it is an Array
|
37
|
+
if obfuscated_items and obfuscated_items.is_a?(String)
|
38
|
+
obfuscated_items = JSON.parse(obfuscated_items)
|
39
|
+
elsif !obfuscated_items
|
40
|
+
obfuscated_items = []
|
41
|
+
end
|
34
42
|
output_string = $disconnect ? 'DISCONNECT: ' : ''
|
35
43
|
if raw
|
36
44
|
output_string += 'cmd_raw("'
|
@@ -44,18 +52,21 @@ module OpenC3
|
|
44
52
|
params = []
|
45
53
|
cmd_params.each do |key, value|
|
46
54
|
next if Packet::RESERVED_ITEM_NAMES.include?(key)
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
55
|
+
if obfuscated_items and obfuscated_items.is_a?(Array) and obfuscated_items.include?(key)
|
56
|
+
params << "#{key} *****"
|
57
|
+
else
|
58
|
+
if value.is_a?(String)
|
59
|
+
if !value.is_printable?
|
60
|
+
value = "BINARY"
|
61
|
+
elsif value.length > 256
|
62
|
+
value = value[0..255] + "...'"
|
63
|
+
end
|
64
|
+
value.tr!('"', "'")
|
65
|
+
elsif value.is_a?(Array)
|
66
|
+
value = "[#{value.join(", ")}]"
|
53
67
|
end
|
54
|
-
|
55
|
-
elsif value.is_a?(Array)
|
56
|
-
value = "[#{value.join(", ")}]"
|
68
|
+
params << "#{key} #{value}"
|
57
69
|
end
|
58
|
-
params << "#{key} #{value}"
|
59
70
|
end
|
60
71
|
params = params.join(", ")
|
61
72
|
output_string += ' with ' + params + '")'
|
@@ -65,14 +76,14 @@ module OpenC3
|
|
65
76
|
|
66
77
|
# Log any warnings about disabling checks and log the command itself
|
67
78
|
# NOTE: This is a helper method and should not be called directly
|
68
|
-
def _log_cmd(
|
79
|
+
def _log_cmd(cmd, raw, no_range, no_hazardous)
|
69
80
|
if no_range
|
70
|
-
puts "WARN: Command #{target_name} #{cmd_name} being sent ignoring range checks"
|
81
|
+
puts "WARN: Command #{cmd['target_name']} #{cmd['cmd_name']} being sent ignoring range checks"
|
71
82
|
end
|
72
83
|
if no_hazardous
|
73
|
-
puts "WARN: Command #{target_name} #{cmd_name} being sent ignoring hazardous warnings"
|
84
|
+
puts "WARN: Command #{cmd['target_name']} #{cmd['cmd_name']} being sent ignoring hazardous warnings"
|
74
85
|
end
|
75
|
-
puts _cmd_string(target_name, cmd_name, cmd_params, raw)
|
86
|
+
puts _cmd_string(cmd['target_name'], cmd['cmd_name'], cmd['cmd_params'], raw, cmd['obfuscated_items'])
|
76
87
|
end
|
77
88
|
|
78
89
|
def _cmd_disconnect(cmd, raw, no_range, no_hazardous, *args, scope: $openc3_scope)
|
@@ -94,13 +105,16 @@ module OpenC3
|
|
94
105
|
|
95
106
|
# Get the command and validate the parameters
|
96
107
|
command = $api_server.get_cmd(target_name, cmd_name, scope: scope)
|
108
|
+
# This returns a packet hash instead of the command hash so add missing fields
|
109
|
+
command['cmd_name'] = cmd_name
|
110
|
+
command['cmd_params'] = cmd_params
|
97
111
|
cmd_params.each do |param_name, _param_value|
|
98
112
|
param = command['items'].find { |item| item['name'] == param_name }
|
99
113
|
unless param
|
100
114
|
raise "Packet item '#{target_name} #{cmd_name} #{param_name}' does not exist"
|
101
115
|
end
|
102
116
|
end
|
103
|
-
_log_cmd(
|
117
|
+
_log_cmd(command, raw, no_range, no_hazardous)
|
104
118
|
end
|
105
119
|
|
106
120
|
# Send the command and log the results
|
@@ -113,30 +127,29 @@ module OpenC3
|
|
113
127
|
raw = cmd.include?('raw')
|
114
128
|
no_range = cmd.include?('no_range') || cmd.include?('no_checks')
|
115
129
|
no_hazardous = cmd.include?('no_hazardous') || cmd.include?('no_checks')
|
116
|
-
|
117
130
|
if $disconnect
|
118
131
|
_cmd_disconnect(cmd, raw, no_range, no_hazardous, *args, scope: scope)
|
119
132
|
else
|
120
133
|
begin
|
121
134
|
begin
|
122
|
-
|
135
|
+
command = $api_server.method_missing(cmd, *args, timeout: timeout, log_message: log_message, validate: validate, scope: scope, token: token)
|
123
136
|
if log_message.nil? or log_message
|
124
|
-
_log_cmd(
|
137
|
+
_log_cmd(command, raw, no_range, no_hazardous)
|
125
138
|
end
|
126
139
|
rescue HazardousError => e
|
127
140
|
# This opens a prompt at which point they can cancel and stop the script
|
128
141
|
# or say Yes and send the command. Thus we don't care about the return value.
|
129
142
|
prompt_for_hazardous(e.target_name, e.cmd_name, e.hazardous_description)
|
130
|
-
|
143
|
+
command = $api_server.method_missing(cmd_no_hazardous, *args, timeout: timeout, log_message: log_message, validate: validate, scope: scope, token: token)
|
131
144
|
if log_message.nil? or log_message
|
132
|
-
_log_cmd(
|
145
|
+
_log_cmd(command, raw, no_range, no_hazardous)
|
133
146
|
end
|
134
147
|
end
|
135
148
|
rescue CriticalCmdError => e
|
136
149
|
# This should not return until the critical command has been approved
|
137
|
-
prompt_for_critical_cmd(e.uuid, e.username, e.target_name, e.cmd_name, e.cmd_params, e.cmd_string)
|
150
|
+
prompt_for_critical_cmd(e.uuid, e.command['username'], e.command['target_name'], e.command['cmd_name'], e.command['cmd_params'], e.command['cmd_string'])
|
138
151
|
if log_message.nil? or log_message
|
139
|
-
_log_cmd(e.
|
152
|
+
_log_cmd(e.command, raw, no_range, no_hazardous)
|
140
153
|
end
|
141
154
|
end
|
142
155
|
end
|
@@ -71,7 +71,7 @@ module OpenC3
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
-
def script_run(filename, disconnect: false, environment: nil, scope: $openc3_scope)
|
74
|
+
def script_run(filename, disconnect: false, environment: nil, suite_runner: nil, scope: $openc3_scope)
|
75
75
|
if disconnect
|
76
76
|
endpoint = "/script-api/scripts/#{filename}/run/disconnect"
|
77
77
|
else
|
@@ -87,8 +87,13 @@ module OpenC3
|
|
87
87
|
else
|
88
88
|
env_data = []
|
89
89
|
end
|
90
|
+
data = { environment: env_data }
|
91
|
+
if suite_runner
|
92
|
+
# TODO 7.0: Should suiteRunner be snake case?
|
93
|
+
data['suiteRunner'] = suite_runner
|
94
|
+
end
|
90
95
|
# NOTE: json: true causes json_api_object to JSON generate and set the Content-Type to json
|
91
|
-
response = $script_runner_api_server.request('post', endpoint, json: true, data:
|
96
|
+
response = $script_runner_api_server.request('post', endpoint, json: true, data: data, scope: scope)
|
92
97
|
if response.nil? || response.status != 200
|
93
98
|
_script_response_error(response, "Failed to run #{filename}", scope: scope)
|
94
99
|
else
|
data/lib/openc3/script/tables.rb
CHANGED
@@ -24,7 +24,7 @@ module OpenC3
|
|
24
24
|
post_data = {}
|
25
25
|
post_data['definition'] = definition
|
26
26
|
response = $api_server.request('post', '/openc3-api/tables/generate', json: true, data: post_data, scope: scope)
|
27
|
-
return
|
27
|
+
return _tables_handle_response(response, 'Failed to create binary')
|
28
28
|
end
|
29
29
|
|
30
30
|
def table_create_report(filename, definition, table_name: nil, scope: $openc3_scope)
|
@@ -33,11 +33,11 @@ module OpenC3
|
|
33
33
|
post_data['definition'] = definition
|
34
34
|
post_data['table_name'] = table_name if table_name
|
35
35
|
response = $api_server.request('post', '/openc3-api/tables/report', json: true, data: post_data, scope: scope)
|
36
|
-
return
|
36
|
+
return _tables_handle_response(response, 'Failed to create report')
|
37
37
|
end
|
38
38
|
|
39
39
|
# Helper method to handle the response
|
40
|
-
def
|
40
|
+
def _tables_handle_response(response, error_message)
|
41
41
|
return nil if response.nil?
|
42
42
|
if response.status >= 400
|
43
43
|
result = JSON.parse(response.body, :allow_nan => true, :create_additions => true)
|
@@ -14,10 +14,10 @@
|
|
14
14
|
# GNU Affero General Public License for more details.
|
15
15
|
|
16
16
|
# Modified by OpenC3, Inc.
|
17
|
-
# All changes Copyright
|
17
|
+
# All changes Copyright 2025, 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/config/config_parser'
|
@@ -169,7 +169,7 @@ module OpenC3
|
|
169
169
|
'GENERIC_WRITE_CONVERSION_START', 'REQUIRED', 'LIMITS',
|
170
170
|
'LIMITS_RESPONSE', 'UNITS', 'FORMAT_STRING', 'DESCRIPTION',
|
171
171
|
'HIDDEN', 'MINIMUM_VALUE', 'MAXIMUM_VALUE', 'DEFAULT_VALUE',
|
172
|
-
'OVERFLOW', 'UNEDITABLE'
|
172
|
+
'OVERFLOW', 'UNEDITABLE', 'OBFUSCATE'
|
173
173
|
unless @current_item
|
174
174
|
raise parser.error("No current item for #{keyword}")
|
175
175
|
end
|
data/lib/openc3/top_level.rb
CHANGED
@@ -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
|
17
|
+
# All changes Copyright 2025, OpenC3, Inc.
|
18
18
|
# All Rights Reserved
|
19
19
|
#
|
20
20
|
# This file may also be used under the terms of a commercial license
|
@@ -51,11 +51,7 @@ end
|
|
51
51
|
|
52
52
|
class CriticalCmdError < StandardError
|
53
53
|
attr_accessor :uuid
|
54
|
-
attr_accessor :
|
55
|
-
attr_accessor :target_name
|
56
|
-
attr_accessor :cmd_name
|
57
|
-
attr_accessor :cmd_params
|
58
|
-
attr_accessor :cmd_string
|
54
|
+
attr_accessor :command
|
59
55
|
end
|
60
56
|
|
61
57
|
# If a disabled command is sent through the {OpenC3::Api} this error is raised.
|
@@ -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
|
17
|
+
# All changes Copyright 2025, OpenC3, Inc.
|
18
18
|
# All Rights Reserved
|
19
19
|
#
|
20
20
|
# This file may also be used under the terms of a commercial license
|
@@ -41,7 +41,7 @@ module OpenC3
|
|
41
41
|
end
|
42
42
|
|
43
43
|
# @param command [Hash] Command hash structure read to be written to a topic
|
44
|
-
def self.send_command(command, timeout: COMMAND_ACK_TIMEOUT_S, scope:)
|
44
|
+
def self.send_command(command, timeout: COMMAND_ACK_TIMEOUT_S, scope:, obfuscated_items: [])
|
45
45
|
timeout = COMMAND_ACK_TIMEOUT_S unless timeout
|
46
46
|
ack_topic = "{#{scope}__ACKCMD}TARGET__#{command['target_name']}"
|
47
47
|
Topic.update_topic_offsets([ack_topic])
|
@@ -50,17 +50,18 @@ module OpenC3
|
|
50
50
|
command['cmd_params'] = JSON.generate(command['cmd_params'].as_json(:allow_nan => true))
|
51
51
|
OpenC3.inject_context(command)
|
52
52
|
cmd_id = Topic.write_topic("{#{scope}__CMD}TARGET__#{command['target_name']}", command, '*', 100)
|
53
|
+
command["cmd_params"] = cmd_params # Restore the original cmd_params Hash
|
53
54
|
time = Time.now
|
54
55
|
while (Time.now - time) < timeout
|
55
56
|
Topic.read_topics([ack_topic]) do |_topic, _msg_id, msg_hash, _redis|
|
56
57
|
if msg_hash["id"] == cmd_id
|
57
58
|
if msg_hash["result"] == "SUCCESS"
|
58
|
-
return
|
59
|
+
return command
|
59
60
|
# Check for HazardousError which is a special case
|
60
61
|
elsif msg_hash["result"].include?("HazardousError")
|
61
|
-
raise_hazardous_error(msg_hash, command
|
62
|
+
raise_hazardous_error(msg_hash, command)
|
62
63
|
elsif msg_hash["result"].include?("CriticalCmdError")
|
63
|
-
raise_critical_cmd_error(msg_hash, command
|
64
|
+
raise_critical_cmd_error(msg_hash, command)
|
64
65
|
else
|
65
66
|
raise msg_hash["result"]
|
66
67
|
end
|
@@ -74,14 +75,14 @@ module OpenC3
|
|
74
75
|
# PRIVATE implementation details
|
75
76
|
###########################################################################
|
76
77
|
|
77
|
-
def self.raise_hazardous_error(msg_hash,
|
78
|
+
def self.raise_hazardous_error(msg_hash, command)
|
78
79
|
_, description, formatted = msg_hash["result"].split("\n")
|
79
80
|
# Create and populate a new HazardousError and raise it up
|
80
81
|
# The _cmd method in script/commands.rb rescues this and calls prompt_for_hazardous
|
81
82
|
error = HazardousError.new
|
82
|
-
error.target_name = target_name
|
83
|
-
error.cmd_name = cmd_name
|
84
|
-
error.cmd_params = cmd_params
|
83
|
+
error.target_name = command["target_name"]
|
84
|
+
error.cmd_name = command["cmd_name"]
|
85
|
+
error.cmd_params = command["cmd_params"]
|
85
86
|
error.hazardous_description = description
|
86
87
|
error.formatted = formatted
|
87
88
|
|
@@ -89,17 +90,13 @@ module OpenC3
|
|
89
90
|
raise error
|
90
91
|
end
|
91
92
|
|
92
|
-
def self.raise_critical_cmd_error(msg_hash,
|
93
|
+
def self.raise_critical_cmd_error(msg_hash, command)
|
93
94
|
_, uuid = msg_hash["result"].split("\n")
|
94
95
|
# Create and populate a new CriticalCmdError and raise it up
|
95
96
|
# The _cmd method in script/commands.rb rescues this and calls prompt_for_critical_cmd
|
96
97
|
error = CriticalCmdError.new
|
97
98
|
error.uuid = uuid
|
98
|
-
error.
|
99
|
-
error.target_name = target_name
|
100
|
-
error.cmd_name = cmd_name
|
101
|
-
error.cmd_params = cmd_params
|
102
|
-
error.cmd_string = cmd_string
|
99
|
+
error.command = command
|
103
100
|
raise error
|
104
101
|
end
|
105
102
|
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# encoding: ascii-8bit
|
2
|
+
|
3
|
+
# Copyright 2025 OpenC3, Inc.
|
4
|
+
# All Rights Reserved.
|
5
|
+
#
|
6
|
+
# This program is free software; you can modify and/or redistribute it
|
7
|
+
# under the terms of the GNU Affero General Public License
|
8
|
+
# as published by the Free Software Foundation; version 3 with
|
9
|
+
# attribution addendums as found in the LICENSE.txt
|
10
|
+
#
|
11
|
+
# This program is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU Affero General Public License for more details.
|
15
|
+
|
16
|
+
# This file may also be used under the terms of a commercial license
|
17
|
+
# if purchased from OpenC3, Inc.
|
18
|
+
|
19
|
+
require 'openc3/packets/packet'
|
20
|
+
|
21
|
+
module OpenC3
|
22
|
+
module CmdLog
|
23
|
+
def _build_cmd_output_string(method_name, target_name, cmd_name, cmd_params, packet)
|
24
|
+
output_string = "#{method_name}(\""
|
25
|
+
output_string << (target_name + ' ' + cmd_name)
|
26
|
+
if cmd_params.nil? or cmd_params.empty?
|
27
|
+
output_string << '")'
|
28
|
+
else
|
29
|
+
params = []
|
30
|
+
cmd_params.each do |key, value|
|
31
|
+
next if Packet::RESERVED_ITEM_NAMES.include?(key)
|
32
|
+
|
33
|
+
item = packet['items'].find { |find_item| find_item['name'] == key.to_s }
|
34
|
+
begin
|
35
|
+
item_type = item['data_type'].intern
|
36
|
+
rescue
|
37
|
+
item_type = nil
|
38
|
+
end
|
39
|
+
|
40
|
+
if (item and item['obfuscate'])
|
41
|
+
params << "#{key} *****"
|
42
|
+
else
|
43
|
+
if value.is_a?(String)
|
44
|
+
value = value.dup
|
45
|
+
if item_type == :BLOCK or item_type == :STRING
|
46
|
+
if !value.is_printable?
|
47
|
+
value = "0x" + value.simple_formatted
|
48
|
+
else
|
49
|
+
value = value.inspect
|
50
|
+
end
|
51
|
+
else
|
52
|
+
value = value.convert_to_value.to_s
|
53
|
+
end
|
54
|
+
if value.length > 256
|
55
|
+
value = value[0..255] + "...'"
|
56
|
+
end
|
57
|
+
value.tr!('"', "'")
|
58
|
+
elsif value.is_a?(Array)
|
59
|
+
value = "[#{value.join(", ")}]"
|
60
|
+
end
|
61
|
+
params << "#{key} #{value}"
|
62
|
+
end
|
63
|
+
end
|
64
|
+
params = params.join(", ")
|
65
|
+
output_string << (' with ' + params + '")')
|
66
|
+
end
|
67
|
+
return output_string
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -179,7 +179,7 @@ module OpenC3
|
|
179
179
|
data = { time: time.to_nsec_from_epoch, '@timestamp' => time.iso8601(6), level: log_level }
|
180
180
|
data[:microservice_name] = @microservice_name if @microservice_name
|
181
181
|
data[:detail] = @detail_string if @detail_string
|
182
|
-
data[:user] = user if user #
|
182
|
+
data[:user] = user if user # Enterprise: If a user is passed, put its name. Don't include user data if no user was passed.
|
183
183
|
if block_given?
|
184
184
|
message = yield
|
185
185
|
end
|
@@ -771,7 +771,11 @@ class RunningScript
|
|
771
771
|
def run
|
772
772
|
if @script_status.suite_runner
|
773
773
|
@script_status.suite_runner = JSON.parse(@script_status.suite_runner, :allow_nan => true, :create_additions => true) # Convert to hash
|
774
|
-
|
774
|
+
if @script_status.suite_runner['options']
|
775
|
+
parse_options(@script_status.suite_runner['options'])
|
776
|
+
else
|
777
|
+
parse_options({}) # Set default options
|
778
|
+
end
|
775
779
|
if @script_status.suite_runner['script']
|
776
780
|
run_text("OpenC3::SuiteRunner.start(#{@script_status.suite_runner['suite']}, #{@script_status.suite_runner['group']}, '#{@script_status.suite_runner['script']}')", initial_filename: "SCRIPTRUNNER")
|
777
781
|
elsif script_status.suite_runner['group']
|
data/lib/openc3/version.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# encoding: ascii-8bit
|
2
2
|
|
3
|
-
OPENC3_VERSION = '6.
|
3
|
+
OPENC3_VERSION = '6.7.0'
|
4
4
|
module OpenC3
|
5
5
|
module Version
|
6
6
|
MAJOR = '6'
|
7
|
-
MINOR = '
|
8
|
-
PATCH = '
|
7
|
+
MINOR = '7'
|
8
|
+
PATCH = '0'
|
9
9
|
OTHER = ''
|
10
|
-
BUILD = '
|
10
|
+
BUILD = '6c4726a21dd004109cf840f83a99f5a8614cfbe3'
|
11
11
|
end
|
12
|
-
VERSION = '6.
|
13
|
-
GEM_VERSION = '6.
|
12
|
+
VERSION = '6.7.0'
|
13
|
+
GEM_VERSION = '6.7.0'
|
14
14
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "<%= tool_name %>",
|
3
|
-
"version": "6.
|
3
|
+
"version": "6.7.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.
|
26
|
+
"@openc3/js-common": "6.7.0",
|
27
27
|
"rxjs": "~7.8.0",
|
28
28
|
"single-spa": "^5.9.5",
|
29
29
|
"single-spa-angular": "^9.2.0",
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "<%= tool_name %>",
|
3
|
-
"version": "6.
|
3
|
+
"version": "6.7.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.
|
15
|
-
"@openc3/vue-common": "6.
|
14
|
+
"@openc3/js-common": "6.7.0",
|
15
|
+
"@openc3/vue-common": "6.7.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.
|
3
|
+
"version": "6.7.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.
|
11
|
+
"@openc3/vue-common": "6.7.0",
|
12
12
|
"vuetify": "^3.7.1"
|
13
13
|
},
|
14
14
|
"devDependencies": {
|