openc3 5.5.2 → 5.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/openc3cli +167 -69
- data/data/config/_interfaces.yaml +1 -6
- data/data/config/interface_modifiers.yaml +55 -4
- data/data/config/microservice.yaml +30 -3
- data/ext/openc3/ext/crc/crc.c +82 -1
- data/lib/openc3/api/cmd_api.rb +19 -7
- data/lib/openc3/api/tlm_api.rb +13 -12
- data/lib/openc3/bridge/bridge_config.rb +4 -4
- data/lib/openc3/config/config_parser.rb +1 -0
- data/lib/openc3/conversions/unix_time_conversion.rb +3 -1
- data/lib/openc3/ext/.keep +0 -0
- data/lib/openc3/interfaces/interface.rb +54 -26
- data/lib/openc3/interfaces/serial_interface.rb +4 -5
- data/lib/openc3/interfaces/simulated_target_interface.rb +4 -4
- data/lib/openc3/interfaces/stream_interface.rb +2 -2
- data/lib/openc3/interfaces/tcpip_client_interface.rb +4 -3
- data/lib/openc3/interfaces/tcpip_server_interface.rb +18 -19
- data/lib/openc3/interfaces/udp_interface.rb +10 -4
- data/lib/openc3/io/json_api.rb +72 -0
- data/lib/openc3/io/serial_driver.rb +4 -5
- data/lib/openc3/logs/buffered_packet_log_writer.rb +2 -4
- data/lib/openc3/logs/log_writer.rb +9 -8
- data/lib/openc3/logs/packet_log_reader.rb +8 -1
- data/lib/openc3/logs/packet_log_writer.rb +3 -4
- data/lib/openc3/logs/stream_log.rb +116 -0
- data/lib/openc3/logs/stream_log_pair.rb +70 -0
- data/lib/openc3/microservices/cleanup_microservice.rb +1 -1
- data/lib/openc3/microservices/decom_microservice.rb +17 -2
- data/lib/openc3/microservices/interface_decom_common.rb +42 -0
- data/lib/openc3/microservices/interface_microservice.rb +24 -17
- data/lib/openc3/microservices/router_microservice.rb +46 -4
- data/lib/openc3/migrations/20221202214600_add_target_names.rb +1 -1
- data/lib/openc3/migrations/20230319154100_log_stream.rb +40 -0
- data/lib/openc3/migrations/20230413101100_remove_log.rb +30 -0
- data/lib/openc3/models/gem_model.rb +2 -2
- data/lib/openc3/models/interface_model.rb +13 -14
- data/lib/openc3/models/metadata_model.rb +1 -1
- data/lib/openc3/models/note_model.rb +1 -1
- data/lib/openc3/models/plugin_model.rb +3 -2
- data/lib/openc3/operators/operator.rb +2 -0
- data/lib/openc3/packets/commands.rb +2 -0
- data/lib/openc3/packets/packet_config.rb +3 -2
- data/lib/openc3/packets/parsers/xtce_converter.rb +2 -1
- data/lib/openc3/script/gems.rb +125 -0
- data/lib/openc3/script/plugins.rb +186 -0
- data/lib/openc3/script/screen.rb +119 -0
- data/lib/openc3/script/script.rb +3 -0
- data/lib/openc3/script/script_runner.rb +19 -8
- data/lib/openc3/script/suite_results.rb +2 -2
- data/lib/openc3/script/web_socket_api.rb +5 -1
- data/lib/openc3/streams/serial_stream.rb +14 -11
- data/lib/openc3/streams/tcpip_client_stream.rb +5 -2
- data/lib/openc3/streams/tcpip_socket_stream.rb +37 -71
- data/lib/openc3/streams/web_socket_client_stream.rb +5 -3
- data/lib/openc3/system/system.rb +2 -0
- data/lib/openc3/topics/interface_topic.rb +13 -4
- data/lib/openc3/topics/router_topic.rb +6 -6
- data/lib/openc3/topics/telemetry_decom_topic.rb +10 -1
- data/lib/openc3/utilities/bucket_utilities.rb +12 -5
- data/lib/openc3/utilities/cli_generator.rb +56 -4
- data/lib/openc3/utilities/crc.rb +42 -7
- data/lib/openc3/utilities/process_manager.rb +3 -1
- data/lib/openc3/utilities/ruby_lex_utils.rb +265 -504
- data/lib/openc3/version.rb +6 -6
- data/templates/conversion/conversion.rb +10 -2
- data/templates/microservice/microservices/TEMPLATE/microservice.rb +1 -1
- data/templates/plugin/Rakefile +8 -1
- data/templates/widget/.browserslistrc +16 -0
- data/templates/widget/.eslintrc.js +43 -0
- data/templates/widget/.nycrc +3 -0
- data/templates/widget/.prettierrc.js +5 -0
- data/templates/widget/LICENSE.txt +20 -0
- data/templates/widget/Rakefile +24 -0
- data/templates/widget/babel.config.json +11 -0
- data/templates/widget/package.json +35 -0
- data/templates/widget/src/Widget.vue +46 -0
- data/templates/widget/vue.config.js +25 -0
- data/templates/widget/yarn.lock +8938 -0
- metadata +23 -4
- data/lib/openc3/io/raw_logger.rb +0 -170
- data/lib/openc3/io/raw_logger_pair.rb +0 -80
data/lib/openc3/utilities/crc.rb
CHANGED
@@ -17,7 +17,7 @@
|
|
17
17
|
# All changes Copyright 2022, 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/ext/crc' if RUBY_ENGINE == 'ruby' and !ENV['OPENC3_NO_EXT']
|
@@ -74,16 +74,22 @@ module OpenC3
|
|
74
74
|
@table = []
|
75
75
|
end
|
76
76
|
|
77
|
-
# Determine which class we're using: Crc16, Crc32, Crc64
|
78
|
-
|
79
|
-
|
80
|
-
|
77
|
+
# Determine which class we're using: Crc8, Crc16, Crc32, Crc64
|
78
|
+
case self.class.name
|
79
|
+
when 'OpenC3::Crc8'
|
80
|
+
@bit_size = 8
|
81
|
+
pack = 'C'
|
82
|
+
filter_mask = 0xFF
|
83
|
+
when 'OpenC3::Crc16'
|
84
|
+
@bit_size = 16
|
81
85
|
pack = 'S'
|
82
86
|
filter_mask = 0xFFFF
|
83
|
-
when
|
87
|
+
when 'OpenC3::Crc32'
|
88
|
+
@bit_size = 32
|
84
89
|
pack = 'I'
|
85
90
|
filter_mask = 0xFFFFFFFF
|
86
|
-
when
|
91
|
+
when 'OpenC3::Crc64'
|
92
|
+
@bit_size = 64
|
87
93
|
pack = 'Q'
|
88
94
|
filter_mask = 0xFFFFFFFFFFFFFFFF
|
89
95
|
end
|
@@ -142,6 +148,10 @@ module OpenC3
|
|
142
148
|
crc = seed
|
143
149
|
|
144
150
|
case @bit_size
|
151
|
+
when 8
|
152
|
+
right_shift = 0
|
153
|
+
filter_mask = 0xFF
|
154
|
+
final_bit_reverse = method(:bit_reverse_8)
|
145
155
|
when 16
|
146
156
|
right_shift = 8
|
147
157
|
filter_mask = 0xFFFF
|
@@ -204,6 +214,31 @@ module OpenC3
|
|
204
214
|
end
|
205
215
|
end
|
206
216
|
|
217
|
+
# Calculates 8-bit CRCs over a buffer of data.
|
218
|
+
class Crc8 < Crc
|
219
|
+
# CRC-8-DVB-S2 default polynomial
|
220
|
+
DEFAULT_POLY = 0xD5
|
221
|
+
# Seed for 8-bit CRC
|
222
|
+
DEFAULT_SEED = 0x00
|
223
|
+
|
224
|
+
# Creates a 8 bit CRC algorithm instance. By default it is initialzed to
|
225
|
+
# use the CRC-8-DVB-S2 algorithm.
|
226
|
+
#
|
227
|
+
# @param poly [Integer] Polynomial to use when calculating the CRC
|
228
|
+
# @param seed [Integer] Seed value to start the calculation
|
229
|
+
# @param xor [Boolean] Whether to XOR the CRC result with 0xFF
|
230
|
+
# @param reflect [Boolean] Whether to bit reverse each byte of data before
|
231
|
+
# calculating the CRC
|
232
|
+
def initialize(poly = DEFAULT_POLY,
|
233
|
+
seed = DEFAULT_SEED,
|
234
|
+
xor = false,
|
235
|
+
reflect = false)
|
236
|
+
super(poly, seed, xor, reflect)
|
237
|
+
end
|
238
|
+
|
239
|
+
alias calculate_crc8 calc
|
240
|
+
end # class Crc8
|
241
|
+
|
207
242
|
# Calculates 16-bit CRCs over a buffer of data.
|
208
243
|
class Crc16 < Crc
|
209
244
|
# CRC-16-CCITT default polynomial
|
@@ -32,6 +32,7 @@ module OpenC3
|
|
32
32
|
attr_accessor :detail
|
33
33
|
attr_accessor :expires_at
|
34
34
|
attr_accessor :status
|
35
|
+
attr_accessor :name
|
35
36
|
|
36
37
|
def initialize(cmd_array, process_type, detail, expires_at, **kw_args)
|
37
38
|
super(cmd_array, **kw_args)
|
@@ -44,7 +45,7 @@ module OpenC3
|
|
44
45
|
def start
|
45
46
|
super()
|
46
47
|
if @process
|
47
|
-
@status = ProcessStatusModel.new(name:
|
48
|
+
@status = ProcessStatusModel.new(name: @name, process_type: @process_type, detail: @detail, state: "Running", scope: @scope)
|
48
49
|
@status.create
|
49
50
|
end
|
50
51
|
end
|
@@ -78,6 +79,7 @@ module OpenC3
|
|
78
79
|
process = ProcessManagerProcess.new(cmd_array, process_type, detail, expires_at, **kw_args)
|
79
80
|
process.start
|
80
81
|
@processes << process
|
82
|
+
return process
|
81
83
|
end
|
82
84
|
|
83
85
|
def monitor
|