openc3 7.0.0.pre.rc1 → 7.0.0.pre.rc2
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/data/config/command_modifiers.yaml +9 -0
- data/data/config/telemetry_modifiers.yaml +9 -0
- data/lib/openc3/accessors/accessor.rb +7 -5
- data/lib/openc3/accessors/binary_accessor.rb +9 -7
- data/lib/openc3/models/cvt_model.rb +2 -2
- data/lib/openc3/models/microservice_model.rb +10 -2
- data/lib/openc3/models/plugin_model.rb +3 -1
- data/lib/openc3/packets/packet.rb +3 -4
- data/lib/openc3/packets/packet_config.rb +9 -3
- data/lib/openc3/packets/parsers/xtce_converter.rb +9 -1
- data/lib/openc3/packets/structure_item.rb +1 -1
- data/lib/openc3/utilities/questdb_client.rb +3 -2
- data/lib/openc3/utilities/running_script.rb +2 -1
- data/lib/openc3/version.rb +5 -5
- data/templates/tool_angular/package.json +1 -1
- data/templates/tool_vue/package.json +1 -1
- data/templates/widget/package.json +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a7c545191fe3248b560961c422b5906474a068d06df3d480a35a61dba621e469
|
|
4
|
+
data.tar.gz: 77b9201a38591fad76787947918fd6910a8599e09368cdfdf9d0870520a9f073
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 164c14d7fd49d30bcaf8f8838cd2e3d63c3fbbccb514e7b5a40348868e68317100d8a48beda0a3015959d0f49d3093b40b1184e517093ae7a4df4aafb8710be0
|
|
7
|
+
data.tar.gz: cb6276f37e41717565abbbb24d7df1006cf4dfbfdeff92c76b34638dff29279dcfed536aced5a488d1aacf63541568d3a0c8da4b7edd5ecaed9f792b3a12a7ae
|
|
@@ -266,6 +266,15 @@ TEMPLATE:
|
|
|
266
266
|
description: The template string which should be enclosed in quotes
|
|
267
267
|
values: "['\"].*['\"]"
|
|
268
268
|
since: 5.0.10
|
|
269
|
+
TEMPLATE_BASE64:
|
|
270
|
+
summary: Defines a template binary as base64 used to initialize the command before default values are filled in
|
|
271
|
+
description: Base64 encoded binary data
|
|
272
|
+
parameters:
|
|
273
|
+
- name: Template
|
|
274
|
+
required: true
|
|
275
|
+
description: The template string as base64 data
|
|
276
|
+
values: .+
|
|
277
|
+
since: 7.0.0
|
|
269
278
|
TEMPLATE_FILE:
|
|
270
279
|
summary: Defines a template file used to initialize the command before default values are filled in
|
|
271
280
|
description: Generally the template file is formatted in JSON or HTML and then values are filled in with
|
|
@@ -259,6 +259,15 @@ TEMPLATE:
|
|
|
259
259
|
description: The template string which should be enclosed in quotes
|
|
260
260
|
values: "['\"].*['\"]"
|
|
261
261
|
since: 5.0.10
|
|
262
|
+
TEMPLATE_BASE64:
|
|
263
|
+
summary: Defines a template binary as base64 used to to pull telemetry values from a string buffer
|
|
264
|
+
description: Base64 encoded binary data
|
|
265
|
+
parameters:
|
|
266
|
+
- name: Template
|
|
267
|
+
required: true
|
|
268
|
+
description: The template string as base64 data
|
|
269
|
+
values: .+
|
|
270
|
+
since: 7.0.0
|
|
262
271
|
TEMPLATE_FILE:
|
|
263
272
|
summary: Defines a template file used to pull telemetry values from a string buffer
|
|
264
273
|
parameters:
|
|
@@ -26,8 +26,9 @@ module OpenC3
|
|
|
26
26
|
def read_item(item, buffer)
|
|
27
27
|
if item.parent_item
|
|
28
28
|
# Structure is used to read items with parent, not accessor
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
parent_item = @packet.get_item(item.parent_item)
|
|
30
|
+
structure_buffer = read_item(parent_item, buffer)
|
|
31
|
+
structure = parent_item.structure
|
|
31
32
|
structure.read(item.key, :RAW, structure_buffer)
|
|
32
33
|
else
|
|
33
34
|
self.class.read_item(item, buffer)
|
|
@@ -37,10 +38,11 @@ module OpenC3
|
|
|
37
38
|
def write_item(item, value, buffer)
|
|
38
39
|
if item.parent_item
|
|
39
40
|
# Structure is used to write items with parent, not accessor
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
parent_item = @packet.get_item(item.parent_item)
|
|
42
|
+
structure_buffer = read_item(parent_item, buffer)
|
|
43
|
+
structure = parent_item.structure
|
|
42
44
|
structure.write(item.key, value, :RAW, structure_buffer)
|
|
43
|
-
self.class.write_item(
|
|
45
|
+
self.class.write_item(parent_item, structure_buffer, buffer)
|
|
44
46
|
else
|
|
45
47
|
self.class.write_item(item, value, buffer)
|
|
46
48
|
end
|
|
@@ -133,10 +133,11 @@ module OpenC3
|
|
|
133
133
|
def read_item(item, buffer)
|
|
134
134
|
return nil if item.data_type == :DERIVED
|
|
135
135
|
if item.parent_item
|
|
136
|
-
|
|
136
|
+
parent_item = @packet.get_item(item.parent_item)
|
|
137
|
+
handle_read_variable_bit_size(parent_item, buffer) if parent_item.variable_bit_size
|
|
137
138
|
# Structure is used to read items with parent, not accessor
|
|
138
|
-
structure_buffer = read_item(
|
|
139
|
-
structure =
|
|
139
|
+
structure_buffer = read_item(parent_item, buffer)
|
|
140
|
+
structure = parent_item.structure
|
|
140
141
|
structure.read(item.key, :RAW, structure_buffer)
|
|
141
142
|
else
|
|
142
143
|
handle_read_variable_bit_size(item, buffer) if item.variable_bit_size
|
|
@@ -275,11 +276,12 @@ module OpenC3
|
|
|
275
276
|
return nil if item.data_type == :DERIVED
|
|
276
277
|
if item.parent_item
|
|
277
278
|
# Structure is used to write items with parent, not accessor
|
|
278
|
-
|
|
279
|
-
|
|
279
|
+
parent_item = @packet.get_item(item.parent_item)
|
|
280
|
+
structure_buffer = read_item(parent_item, buffer)
|
|
281
|
+
structure = parent_item.structure
|
|
280
282
|
structure.write(item.key, value, :RAW, structure_buffer)
|
|
281
|
-
handle_write_variable_bit_size(
|
|
282
|
-
self.class.write_item(
|
|
283
|
+
handle_write_variable_bit_size(parent_item, structure_buffer, buffer) if parent_item.variable_bit_size
|
|
284
|
+
self.class.write_item(parent_item, structure_buffer, buffer)
|
|
283
285
|
else
|
|
284
286
|
handle_write_variable_bit_size(item, value, buffer) if item.variable_bit_size
|
|
285
287
|
self.class.write_item(item, value, buffer)
|
|
@@ -159,7 +159,7 @@ module OpenC3
|
|
|
159
159
|
current_position += 1
|
|
160
160
|
next
|
|
161
161
|
end
|
|
162
|
-
table_name = QuestDBClient.sanitize_table_name(target_name, packet_name)
|
|
162
|
+
table_name = QuestDBClient.sanitize_table_name(target_name, packet_name, scope: scope)
|
|
163
163
|
tables[table_name] = 1
|
|
164
164
|
index = tables.find_index {|k,v| k == table_name }
|
|
165
165
|
|
|
@@ -406,7 +406,7 @@ module OpenC3
|
|
|
406
406
|
# If a start_time is passed we're doing a QuestDB lookup and directly return the results
|
|
407
407
|
# TODO: This currently does NOT support the override values
|
|
408
408
|
if start_time
|
|
409
|
-
return tsdb_lookup(items, start_time: start_time, end_time: end_time)
|
|
409
|
+
return tsdb_lookup(items, start_time: start_time, end_time: end_time, scope: scope)
|
|
410
410
|
end
|
|
411
411
|
|
|
412
412
|
# First generate a lookup hash of all the items represented so we can query the CVT
|
|
@@ -200,8 +200,16 @@ module OpenC3
|
|
|
200
200
|
@cmd = parameters.dup
|
|
201
201
|
# Automatically use UV venv Python for user microservices to ensure openc3 module is found
|
|
202
202
|
# Replace 'python', 'python3', or 'python3.X' with the correct Python binary
|
|
203
|
-
|
|
204
|
-
|
|
203
|
+
# Handles both split form: CMD python start.py -> ["python", "start.py"]
|
|
204
|
+
# and quoted single-string form: CMD "python start.py" -> ["python start.py"]
|
|
205
|
+
python_bin = ENV['OPENC3_PYTHON_BIN'] || '/openc3/python/.venv/bin/python'
|
|
206
|
+
# Handle split form: CMD python start.py => @cmd = ["python", "start.py"]
|
|
207
|
+
if @cmd[0] =~ /^python3?(\.\d+)*$/
|
|
208
|
+
@cmd[0] = python_bin
|
|
209
|
+
# Handle quoted single-string form: CMD "python start.py" => @cmd = ["python start.py"]
|
|
210
|
+
elsif @cmd[0] =~ /^python3?(\.\d+)*\s+/
|
|
211
|
+
_exe, rest = @cmd[0].split(/\s+/, 2)
|
|
212
|
+
@cmd = [python_bin, rest]
|
|
205
213
|
end
|
|
206
214
|
when 'OPTION'
|
|
207
215
|
parser.verify_num_parameters(2, nil, "#{keyword} <Option Name> <Option Values>")
|
|
@@ -192,9 +192,11 @@ module OpenC3
|
|
|
192
192
|
tf = nil
|
|
193
193
|
|
|
194
194
|
# Get the gem from local gem server if it hasn't been passed
|
|
195
|
-
|
|
195
|
+
if gem_file_path.nil?
|
|
196
196
|
gem_name = plugin_hash['name'].split("__")[0]
|
|
197
197
|
gem_file_path = OpenC3::GemModel.get(gem_name)
|
|
198
|
+
else
|
|
199
|
+
gem_name = File.basename(gem_file_path)
|
|
198
200
|
end
|
|
199
201
|
|
|
200
202
|
# Attempt to remove all older versions of this same plugin before install to prevent version conflicts
|
|
@@ -602,7 +602,7 @@ module OpenC3
|
|
|
602
602
|
cloned_item = sorted_item.clone
|
|
603
603
|
cloned_item.key = cloned_item.name
|
|
604
604
|
cloned_item.name = "#{item.name}.#{cloned_item.name}"
|
|
605
|
-
cloned_item.parent_item = item
|
|
605
|
+
cloned_item.parent_item = item.name
|
|
606
606
|
cloned_item.bit_offset = item.bit_offset
|
|
607
607
|
if sorted_item.bit_size <= 0
|
|
608
608
|
cloned_item.bit_size = item.bit_size
|
|
@@ -1140,9 +1140,8 @@ module OpenC3
|
|
|
1140
1140
|
if @validator
|
|
1141
1141
|
config << " VALIDATOR #{@validator.class} #{@validator.args.map { |a| a.to_s.quote_if_necessary }.join(" ")}\n"
|
|
1142
1142
|
end
|
|
1143
|
-
# TODO: Add TEMPLATE_ENCODED so this can always be done inline regardless of content
|
|
1144
1143
|
if @template
|
|
1145
|
-
config << "
|
|
1144
|
+
config << " TEMPLATE_BASE64 #{Base64.strict_encode64(@template)}\n"
|
|
1146
1145
|
end
|
|
1147
1146
|
config << " ALLOW_SHORT\n" if @short_buffer_allowed
|
|
1148
1147
|
config << " HAZARDOUS #{@hazardous_description.to_s.quote_if_necessary}\n" if @hazardous
|
|
@@ -1228,7 +1227,7 @@ module OpenC3
|
|
|
1228
1227
|
config['accessor'] = @accessor.class.to_s
|
|
1229
1228
|
config['accessor_args'] = @accessor.args
|
|
1230
1229
|
config['validator'] = @validator.class.to_s if @validator
|
|
1231
|
-
config['template'] = Base64.
|
|
1230
|
+
config['template'] = Base64.strict_encode64(@template) if @template
|
|
1232
1231
|
config['config_name'] = self.config_name
|
|
1233
1232
|
config['obfuscated_items'] = @obfuscated_items&.map(&:name) || []
|
|
1234
1233
|
|
|
@@ -30,6 +30,7 @@ require 'openc3/utilities/python_proxy'
|
|
|
30
30
|
require 'openc3/conversions'
|
|
31
31
|
require 'openc3/processors'
|
|
32
32
|
require 'openc3/accessors'
|
|
33
|
+
require 'base64'
|
|
33
34
|
require 'nokogiri'
|
|
34
35
|
require 'ostruct'
|
|
35
36
|
require 'fileutils'
|
|
@@ -239,7 +240,7 @@ module OpenC3
|
|
|
239
240
|
'PARAMETER', 'ID_ITEM', 'ID_PARAMETER', 'ARRAY_ITEM', 'ARRAY_PARAMETER', 'APPEND_ITEM',\
|
|
240
241
|
'APPEND_PARAMETER', 'APPEND_ID_ITEM', 'APPEND_ID_PARAMETER', 'APPEND_ARRAY_ITEM',\
|
|
241
242
|
'APPEND_ARRAY_PARAMETER', 'ALLOW_SHORT', 'HAZARDOUS', 'PROCESSOR', 'META',\
|
|
242
|
-
'DISABLE_MESSAGES', 'HIDDEN', 'DISABLED', 'VIRTUAL', 'CATCHALL', 'RESTRICTED', 'ACCESSOR', 'TEMPLATE', 'TEMPLATE_FILE',\
|
|
243
|
+
'DISABLE_MESSAGES', 'HIDDEN', 'DISABLED', 'VIRTUAL', 'CATCHALL', 'RESTRICTED', 'ACCESSOR', 'TEMPLATE', 'TEMPLATE_BASE64', 'TEMPLATE_FILE',\
|
|
243
244
|
'RESPONSE', 'ERROR_RESPONSE', 'SCREEN', 'RELATED_ITEM', 'IGNORE_OVERLAP', 'VALIDATOR', 'SUBPACKET', 'SUBPACKETIZER',\
|
|
244
245
|
'STRUCTURE', 'APPEND_STRUCTURE'
|
|
245
246
|
raise parser.error("No current packet for #{keyword}") unless @current_packet
|
|
@@ -598,14 +599,19 @@ module OpenC3
|
|
|
598
599
|
when 'TEMPLATE'
|
|
599
600
|
usage = "#{keyword} <Template string>"
|
|
600
601
|
parser.verify_num_parameters(1, 1, usage)
|
|
601
|
-
@current_packet.template = params[0]
|
|
602
|
+
@current_packet.template = params[0].force_encoding('ascii-8bit')
|
|
603
|
+
|
|
604
|
+
when 'TEMPLATE_BASE64'
|
|
605
|
+
usage = "#{keyword} <Template string>"
|
|
606
|
+
parser.verify_num_parameters(1, 1, usage)
|
|
607
|
+
@current_packet.template = Base64.decode64(params[0])
|
|
602
608
|
|
|
603
609
|
when 'TEMPLATE_FILE'
|
|
604
610
|
usage = "#{keyword} <Template file path>"
|
|
605
611
|
parser.verify_num_parameters(1, 1, usage)
|
|
606
612
|
|
|
607
613
|
begin
|
|
608
|
-
@current_packet.template = parser.read_file(params[0])
|
|
614
|
+
@current_packet.template = parser.read_file(params[0]).force_encoding('ascii-8bit')
|
|
609
615
|
rescue Exception => e
|
|
610
616
|
raise parser.error(e.formatted)
|
|
611
617
|
end
|
|
@@ -173,8 +173,16 @@ module OpenC3
|
|
|
173
173
|
algorithm_xml = Nokogiri::XML::Builder.new do |alg_xml|
|
|
174
174
|
alg_xml.AlgorithmSet do
|
|
175
175
|
derived.each do |packet_name, item|
|
|
176
|
+
rc = item.read_conversion
|
|
177
|
+
# PythonProxy overrides .class to return a String, so handle both cases
|
|
178
|
+
conv_name = if rc
|
|
179
|
+
rc_class = rc.class
|
|
180
|
+
rc_class.is_a?(String) ? rc_class : rc_class.name
|
|
181
|
+
else
|
|
182
|
+
"NoConversion"
|
|
183
|
+
end
|
|
176
184
|
alg_xml.CustomAlgorithm("name" => "#{packet_name.tr(INVALID_CHARS, REPLACEMENT_CHAR)}_" \
|
|
177
|
-
"#{item.name.tr(INVALID_CHARS, REPLACEMENT_CHAR)}_#{
|
|
185
|
+
"#{item.name.tr(INVALID_CHARS, REPLACEMENT_CHAR)}_#{conv_name}") do
|
|
178
186
|
alg_xml.ExternalAlgorithmSet do
|
|
179
187
|
alg_xml.ExternalAlgorithm("implementationName" => "TODO", "algorithmLocation" => "TODO")
|
|
180
188
|
end
|
|
@@ -334,7 +334,7 @@ module OpenC3
|
|
|
334
334
|
hash['variable_bit_size'] = @variable_bit_size
|
|
335
335
|
end
|
|
336
336
|
if self.parent_item
|
|
337
|
-
hash['parent_item'] = self.parent_item
|
|
337
|
+
hash['parent_item'] = self.parent_item
|
|
338
338
|
end
|
|
339
339
|
if self.structure
|
|
340
340
|
hash['structure'] = self.structure.as_json
|
|
@@ -162,9 +162,10 @@ module OpenC3
|
|
|
162
162
|
# @param target_name [String] Target name
|
|
163
163
|
# @param packet_name [String] Packet name
|
|
164
164
|
# @param cmd_or_tlm [String, Symbol] "CMD" or "TLM" prefix (default "TLM")
|
|
165
|
+
# @param scope [String] Scope name (default "DEFAULT")
|
|
165
166
|
# @return [String] Sanitized table name
|
|
166
|
-
def self.sanitize_table_name(target_name, packet_name, cmd_or_tlm = "TLM")
|
|
167
|
-
"#{cmd_or_tlm}__#{target_name}__#{packet_name}".gsub(/[?,'"\\\/:\)\(\+\*\%~]/, '_')
|
|
167
|
+
def self.sanitize_table_name(target_name, packet_name, cmd_or_tlm = "TLM", scope: "DEFAULT")
|
|
168
|
+
"#{scope}__#{cmd_or_tlm}__#{target_name}__#{packet_name}".gsub(/[?,'"\\\/:\)\(\+\*\%~]/, '_')
|
|
168
169
|
end
|
|
169
170
|
|
|
170
171
|
# Sanitize a column name for QuestDB.
|
|
@@ -341,6 +341,7 @@ class RunningScript
|
|
|
341
341
|
attr_accessor :user_input
|
|
342
342
|
attr_accessor :prompt_id
|
|
343
343
|
attr_reader :script_status
|
|
344
|
+
attr_reader :suite_report
|
|
344
345
|
attr_accessor :execute_while_paused_info
|
|
345
346
|
|
|
346
347
|
# This REGEX is also found in scripts_controller.rb
|
|
@@ -1210,7 +1211,7 @@ class RunningScript
|
|
|
1210
1211
|
elsif parts[0] and init_split.length > 1
|
|
1211
1212
|
parts[0] += "_#{init_split[-1]}"
|
|
1212
1213
|
end
|
|
1213
|
-
|
|
1214
|
+
@suite_report = OpenC3::SuiteRunner.suite_results.report
|
|
1214
1215
|
# Write out the report to a local file
|
|
1215
1216
|
log_dir = File.join(RAILS_ROOT, 'log')
|
|
1216
1217
|
filename = File.join(log_dir, File.build_timestamped_filename(['sr', parts.join('__')]))
|
data/lib/openc3/version.rb
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# encoding: ascii-8bit
|
|
2
2
|
|
|
3
|
-
OPENC3_VERSION = '7.0.0-
|
|
3
|
+
OPENC3_VERSION = '7.0.0-rc2'
|
|
4
4
|
module OpenC3
|
|
5
5
|
module Version
|
|
6
6
|
MAJOR = '7'
|
|
7
7
|
MINOR = '0'
|
|
8
8
|
PATCH = '0'
|
|
9
|
-
OTHER = 'pre.
|
|
10
|
-
BUILD = '
|
|
9
|
+
OTHER = 'pre.rc2'
|
|
10
|
+
BUILD = 'f3aa0d40478504753a1f4728bae52e02342c50f9'
|
|
11
11
|
end
|
|
12
|
-
VERSION = '7.0.0-
|
|
13
|
-
GEM_VERSION = '7.0.0.pre.
|
|
12
|
+
VERSION = '7.0.0-rc2'
|
|
13
|
+
GEM_VERSION = '7.0.0.pre.rc2'
|
|
14
14
|
end
|