openc3 5.0.10 → 5.1.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of openc3 might be problematic. Click here for more details.

Files changed (280) hide show
  1. checksums.yaml +4 -4
  2. data/Guardfile +3 -0
  3. data/LICENSE.txt +7 -5
  4. data/README.md +11 -9
  5. data/Rakefile +3 -0
  6. data/bin/cstol_converter +3 -0
  7. data/bin/openc3cli +29 -18
  8. data/bin/rubysloc +3 -0
  9. data/data/config/screen.yaml +10 -2
  10. data/data/config/target.yaml +1 -1
  11. data/data/config/widgets.yaml +6 -6
  12. data/ext/mkrf_conf.rb +3 -0
  13. data/ext/openc3/ext/array/array.c +3 -0
  14. data/ext/openc3/ext/buffered_file/buffered_file.c +3 -0
  15. data/ext/openc3/ext/config_parser/config_parser.c +3 -0
  16. data/ext/openc3/ext/crc/crc.c +3 -0
  17. data/ext/openc3/ext/openc3_io/openc3_io.c +3 -0
  18. data/ext/openc3/ext/packet/packet.c +3 -0
  19. data/ext/openc3/ext/platform/platform.c +3 -0
  20. data/ext/openc3/ext/polynomial_conversion/polynomial_conversion.c +3 -0
  21. data/ext/openc3/ext/string/string.c +3 -0
  22. data/ext/openc3/ext/structure/structure.c +3 -0
  23. data/ext/openc3/ext/tabbed_plots_config/tabbed_plots_config.c +3 -0
  24. data/ext/openc3/ext/telemetry/telemetry.c +3 -0
  25. data/lib/cosmos.rb +3 -0
  26. data/lib/cosmosc2.rb +3 -0
  27. data/lib/openc3/accessors/accessor.rb +3 -0
  28. data/lib/openc3/accessors/binary_accessor.rb +3 -0
  29. data/lib/openc3/accessors/cbor_accessor.rb +3 -0
  30. data/lib/openc3/accessors/html_accessor.rb +3 -0
  31. data/lib/openc3/accessors/json_accessor.rb +4 -1
  32. data/lib/openc3/accessors/xml_accessor.rb +3 -0
  33. data/lib/openc3/accessors.rb +3 -0
  34. data/lib/openc3/api/api.rb +3 -0
  35. data/lib/openc3/api/authorized_api.rb +3 -0
  36. data/lib/openc3/api/cmd_api.rb +6 -3
  37. data/lib/openc3/api/config_api.rb +3 -0
  38. data/lib/openc3/api/interface_api.rb +16 -5
  39. data/lib/openc3/api/limits_api.rb +54 -61
  40. data/lib/openc3/api/router_api.rb +6 -3
  41. data/lib/openc3/api/settings_api.rb +3 -0
  42. data/lib/openc3/api/target_api.rb +3 -0
  43. data/lib/openc3/api/tlm_api.rb +27 -32
  44. data/lib/openc3/bridge/bridge.rb +3 -0
  45. data/lib/openc3/bridge/bridge_config.rb +3 -0
  46. data/lib/openc3/bridge/bridge_interface_thread.rb +3 -0
  47. data/lib/openc3/bridge/bridge_router_thread.rb +3 -0
  48. data/lib/openc3/ccsds/ccsds_packet.rb +3 -0
  49. data/lib/openc3/ccsds/ccsds_parser.rb +3 -0
  50. data/lib/openc3/config/config_parser.rb +3 -0
  51. data/lib/openc3/config/meta_config_parser.rb +3 -0
  52. data/lib/openc3/conversions/conversion.rb +3 -0
  53. data/lib/openc3/conversions/generic_conversion.rb +3 -0
  54. data/lib/openc3/conversions/packet_time_formatted_conversion.rb +3 -0
  55. data/lib/openc3/conversions/packet_time_seconds_conversion.rb +3 -0
  56. data/lib/openc3/conversions/polynomial_conversion.rb +3 -0
  57. data/lib/openc3/conversions/processor_conversion.rb +3 -0
  58. data/lib/openc3/conversions/received_count_conversion.rb +3 -0
  59. data/lib/openc3/conversions/received_time_formatted_conversion.rb +3 -0
  60. data/lib/openc3/conversions/received_time_seconds_conversion.rb +3 -0
  61. data/lib/openc3/conversions/segmented_polynomial_conversion.rb +3 -0
  62. data/lib/openc3/conversions/unix_time_conversion.rb +3 -0
  63. data/lib/openc3/conversions/unix_time_formatted_conversion.rb +3 -0
  64. data/lib/openc3/conversions/unix_time_seconds_conversion.rb +3 -0
  65. data/lib/openc3/conversions.rb +3 -0
  66. data/lib/openc3/core_ext/array.rb +3 -0
  67. data/lib/openc3/core_ext/binding.rb +3 -0
  68. data/lib/openc3/core_ext/class.rb +3 -0
  69. data/lib/openc3/core_ext/exception.rb +3 -0
  70. data/lib/openc3/core_ext/file.rb +3 -0
  71. data/lib/openc3/core_ext/hash.rb +3 -0
  72. data/lib/openc3/core_ext/io.rb +3 -0
  73. data/lib/openc3/core_ext/kernel.rb +3 -0
  74. data/lib/openc3/core_ext/math.rb +3 -0
  75. data/lib/openc3/core_ext/matrix.rb +3 -0
  76. data/lib/openc3/core_ext/objectspace.rb +3 -0
  77. data/lib/openc3/core_ext/openc3_io.rb +3 -0
  78. data/lib/openc3/core_ext/range.rb +3 -0
  79. data/lib/openc3/core_ext/socket.rb +3 -0
  80. data/lib/openc3/core_ext/string.rb +3 -0
  81. data/lib/openc3/core_ext/stringio.rb +3 -0
  82. data/lib/openc3/core_ext/tempfile.rb +3 -0
  83. data/lib/openc3/core_ext/time.rb +3 -0
  84. data/lib/openc3/core_ext.rb +4 -0
  85. data/lib/openc3/interfaces/interface.rb +4 -1
  86. data/lib/openc3/interfaces/linc_interface.rb +3 -0
  87. data/lib/openc3/interfaces/protocols/burst_protocol.rb +3 -0
  88. data/lib/openc3/interfaces/protocols/crc_protocol.rb +3 -0
  89. data/lib/openc3/interfaces/protocols/fixed_protocol.rb +3 -0
  90. data/lib/openc3/interfaces/protocols/ignore_packet_protocol.rb +3 -0
  91. data/lib/openc3/interfaces/protocols/length_protocol.rb +3 -0
  92. data/lib/openc3/interfaces/protocols/override_protocol.rb +3 -0
  93. data/lib/openc3/interfaces/protocols/preidentified_protocol.rb +3 -0
  94. data/lib/openc3/interfaces/protocols/protocol.rb +3 -0
  95. data/lib/openc3/interfaces/protocols/template_protocol.rb +3 -0
  96. data/lib/openc3/interfaces/protocols/terminated_protocol.rb +3 -0
  97. data/lib/openc3/interfaces/serial_interface.rb +3 -0
  98. data/lib/openc3/interfaces/simulated_target_interface.rb +3 -0
  99. data/lib/openc3/interfaces/stream_interface.rb +3 -0
  100. data/lib/openc3/interfaces/tcpip_client_interface.rb +3 -0
  101. data/lib/openc3/interfaces/tcpip_server_interface.rb +3 -0
  102. data/lib/openc3/interfaces/udp_interface.rb +3 -0
  103. data/lib/openc3/interfaces.rb +3 -0
  104. data/lib/openc3/io/buffered_file.rb +3 -0
  105. data/lib/openc3/io/io_multiplexer.rb +8 -0
  106. data/lib/openc3/io/json_api_object.rb +5 -2
  107. data/lib/openc3/io/json_drb.rb +3 -0
  108. data/lib/openc3/io/json_drb_object.rb +5 -2
  109. data/lib/openc3/io/json_drb_rack.rb +3 -0
  110. data/lib/openc3/io/json_rpc.rb +3 -0
  111. data/lib/openc3/io/openc3_snmp.rb +3 -0
  112. data/lib/openc3/io/posix_serial_driver.rb +3 -0
  113. data/lib/openc3/io/raw_logger.rb +3 -0
  114. data/lib/openc3/io/raw_logger_pair.rb +3 -0
  115. data/lib/openc3/io/serial_driver.rb +3 -0
  116. data/lib/openc3/io/stderr.rb +3 -0
  117. data/lib/openc3/io/stdout.rb +3 -0
  118. data/lib/openc3/io/udp_sockets.rb +3 -0
  119. data/lib/openc3/io/win32_serial_driver.rb +3 -0
  120. data/lib/openc3/logs/buffered_packet_log_reader.rb +65 -0
  121. data/lib/openc3/logs/buffered_packet_log_writer.rb +118 -0
  122. data/lib/openc3/logs/log_writer.rb +94 -41
  123. data/lib/openc3/logs/packet_log_constants.rb +9 -0
  124. data/lib/openc3/logs/packet_log_reader.rb +34 -3
  125. data/lib/openc3/logs/packet_log_writer.rb +85 -20
  126. data/lib/openc3/logs/text_log_writer.rb +9 -5
  127. data/lib/openc3/logs.rb +8 -2
  128. data/lib/openc3/microservices/cleanup_microservice.rb +18 -18
  129. data/lib/openc3/microservices/decom_microservice.rb +30 -24
  130. data/lib/openc3/microservices/interface_microservice.rb +136 -91
  131. data/lib/openc3/microservices/log_microservice.rb +35 -13
  132. data/lib/openc3/microservices/microservice.rb +16 -14
  133. data/lib/openc3/microservices/plugin_microservice.rb +3 -1
  134. data/lib/openc3/microservices/reaction_microservice.rb +4 -1
  135. data/lib/openc3/microservices/reducer_microservice.rb +332 -149
  136. data/lib/openc3/microservices/router_microservice.rb +3 -0
  137. data/lib/openc3/microservices/text_log_microservice.rb +5 -2
  138. data/lib/openc3/microservices/timeline_microservice.rb +4 -1
  139. data/lib/openc3/microservices/trigger_group_microservice.rb +3 -0
  140. data/lib/openc3/models/activity_model.rb +3 -0
  141. data/lib/openc3/models/auth_model.rb +3 -1
  142. data/lib/openc3/models/cvt_model.rb +14 -5
  143. data/lib/openc3/models/environment_model.rb +3 -0
  144. data/lib/openc3/models/gem_model.rb +30 -51
  145. data/lib/openc3/models/info_model.rb +3 -0
  146. data/lib/openc3/models/interface_model.rb +3 -0
  147. data/lib/openc3/models/interface_status_model.rb +4 -1
  148. data/lib/openc3/models/metadata_model.rb +3 -0
  149. data/lib/openc3/models/metric_model.rb +3 -0
  150. data/lib/openc3/models/microservice_model.rb +9 -6
  151. data/lib/openc3/models/microservice_status_model.rb +4 -1
  152. data/lib/openc3/models/model.rb +3 -0
  153. data/lib/openc3/models/note_model.rb +8 -5
  154. data/lib/openc3/models/notification_model.rb +3 -0
  155. data/lib/openc3/models/ping_model.rb +3 -0
  156. data/lib/openc3/models/plugin_model.rb +20 -14
  157. data/lib/openc3/models/process_status_model.rb +4 -1
  158. data/lib/openc3/models/reaction_model.rb +3 -0
  159. data/lib/openc3/models/reducer_model.rb +31 -24
  160. data/lib/openc3/models/router_model.rb +3 -0
  161. data/lib/openc3/models/router_status_model.rb +3 -0
  162. data/lib/openc3/models/scope_model.rb +3 -4
  163. data/lib/openc3/models/settings_model.rb +3 -0
  164. data/lib/openc3/models/sorted_model.rb +3 -0
  165. data/lib/openc3/models/target_model.rb +61 -94
  166. data/lib/openc3/models/timeline_model.rb +4 -1
  167. data/lib/openc3/models/tool_config_model.rb +3 -0
  168. data/lib/openc3/models/tool_model.rb +11 -9
  169. data/lib/openc3/models/trigger_group_model.rb +3 -0
  170. data/lib/openc3/models/trigger_model.rb +3 -0
  171. data/lib/openc3/models/widget_model.rb +18 -11
  172. data/lib/openc3/operators/microservice_operator.rb +3 -0
  173. data/lib/openc3/operators/operator.rb +105 -34
  174. data/lib/openc3/packets/commands.rb +3 -0
  175. data/lib/openc3/packets/json_packet.rb +87 -14
  176. data/lib/openc3/packets/limits.rb +4 -1
  177. data/lib/openc3/packets/limits_response.rb +3 -0
  178. data/lib/openc3/packets/packet.rb +5 -1
  179. data/lib/openc3/packets/packet_config.rb +3 -0
  180. data/lib/openc3/packets/packet_item.rb +9 -3
  181. data/lib/openc3/packets/packet_item_limits.rb +3 -0
  182. data/lib/openc3/packets/parsers/format_string_parser.rb +3 -0
  183. data/lib/openc3/packets/parsers/limits_parser.rb +3 -0
  184. data/lib/openc3/packets/parsers/limits_response_parser.rb +3 -0
  185. data/lib/openc3/packets/parsers/packet_item_parser.rb +3 -0
  186. data/lib/openc3/packets/parsers/packet_parser.rb +3 -0
  187. data/lib/openc3/packets/parsers/processor_parser.rb +3 -0
  188. data/lib/openc3/packets/parsers/state_parser.rb +3 -0
  189. data/lib/openc3/packets/parsers/xtce_converter.rb +3 -0
  190. data/lib/openc3/packets/parsers/xtce_parser.rb +3 -0
  191. data/lib/openc3/packets/structure.rb +3 -0
  192. data/lib/openc3/packets/structure_item.rb +3 -0
  193. data/lib/openc3/packets/telemetry.rb +3 -0
  194. data/lib/openc3/processors/processor.rb +3 -0
  195. data/lib/openc3/processors/statistics_processor.rb +3 -0
  196. data/lib/openc3/processors/watermark_processor.rb +3 -0
  197. data/lib/openc3/processors.rb +3 -0
  198. data/lib/openc3/script/api_shared.rb +35 -6
  199. data/lib/openc3/script/calendar.rb +3 -0
  200. data/lib/openc3/script/commands.rb +3 -0
  201. data/lib/openc3/script/exceptions.rb +3 -0
  202. data/lib/openc3/script/extract.rb +3 -0
  203. data/lib/openc3/script/limits.rb +3 -24
  204. data/lib/openc3/script/script.rb +11 -7
  205. data/lib/openc3/script/script_runner.rb +3 -0
  206. data/lib/openc3/script/storage.rb +34 -16
  207. data/lib/openc3/script/suite.rb +3 -0
  208. data/lib/openc3/script/suite_results.rb +3 -0
  209. data/lib/openc3/script/suite_runner.rb +3 -0
  210. data/lib/openc3/script/telemetry.rb +43 -0
  211. data/lib/openc3/script.rb +3 -0
  212. data/lib/openc3/streams/serial_stream.rb +3 -0
  213. data/lib/openc3/streams/stream.rb +3 -0
  214. data/lib/openc3/streams/tcpip_client_stream.rb +3 -0
  215. data/lib/openc3/streams/tcpip_socket_stream.rb +3 -0
  216. data/lib/openc3/system/system.rb +23 -10
  217. data/lib/openc3/system/system_config.rb +3 -0
  218. data/lib/openc3/system/target.rb +3 -0
  219. data/lib/openc3/system.rb +3 -0
  220. data/lib/openc3/tools/cmd_tlm_server/api.rb +3 -0
  221. data/lib/openc3/tools/cmd_tlm_server/cmd_tlm_server_config.rb +3 -0
  222. data/lib/openc3/tools/cmd_tlm_server/interface_thread.rb +3 -0
  223. data/lib/openc3/tools/table_manager/table.rb +3 -0
  224. data/lib/openc3/tools/table_manager/table_config.rb +3 -0
  225. data/lib/openc3/tools/table_manager/table_item.rb +3 -0
  226. data/lib/openc3/tools/table_manager/table_item_parser.rb +3 -0
  227. data/lib/openc3/tools/table_manager/table_manager_core.rb +3 -0
  228. data/lib/openc3/tools/table_manager/table_parser.rb +3 -0
  229. data/lib/openc3/tools/test_runner/test.rb +3 -0
  230. data/lib/openc3/top_level.rb +3 -0
  231. data/lib/openc3/topics/autonomic_topic.rb +3 -0
  232. data/lib/openc3/topics/calendar_topic.rb +3 -0
  233. data/lib/openc3/topics/command_decom_topic.rb +4 -1
  234. data/lib/openc3/topics/command_topic.rb +6 -1
  235. data/lib/openc3/topics/config_topic.rb +3 -0
  236. data/lib/openc3/topics/interface_topic.rb +9 -2
  237. data/lib/openc3/topics/limits_event_topic.rb +144 -10
  238. data/lib/openc3/topics/notifications_topic.rb +3 -0
  239. data/lib/openc3/topics/router_topic.rb +10 -3
  240. data/lib/openc3/topics/telemetry_decom_topic.rb +26 -20
  241. data/lib/openc3/topics/telemetry_reduced_topics.rb +92 -0
  242. data/lib/openc3/topics/telemetry_topic.rb +5 -2
  243. data/lib/openc3/topics/timeline_topic.rb +3 -0
  244. data/lib/openc3/topics/topic.rb +3 -0
  245. data/lib/openc3/utilities/authentication.rb +9 -4
  246. data/lib/openc3/utilities/authorization.rb +3 -0
  247. data/lib/openc3/utilities/aws_bucket.rb +199 -0
  248. data/lib/openc3/utilities/bucket.rb +82 -0
  249. data/lib/openc3/utilities/bucket_file_cache.rb +264 -0
  250. data/lib/openc3/utilities/bucket_utilities.rb +109 -0
  251. data/lib/openc3/utilities/crc.rb +3 -0
  252. data/lib/openc3/utilities/csv.rb +3 -0
  253. data/lib/openc3/utilities/local_bucket.rb +28 -0
  254. data/lib/openc3/utilities/local_mode.rb +54 -62
  255. data/lib/openc3/utilities/logger.rb +7 -1
  256. data/lib/openc3/utilities/message_log.rb +7 -4
  257. data/lib/openc3/utilities/metric.rb +4 -1
  258. data/lib/openc3/utilities/open_telemetry.rb +96 -0
  259. data/lib/openc3/utilities/process_manager.rb +3 -0
  260. data/lib/openc3/utilities/quaternion.rb +3 -0
  261. data/lib/openc3/utilities/ruby_lex_utils.rb +3 -0
  262. data/lib/openc3/utilities/s3_autoload.rb +8 -6
  263. data/lib/openc3/utilities/simulated_target.rb +3 -0
  264. data/lib/openc3/utilities/sleeper.rb +3 -0
  265. data/lib/openc3/utilities/store.rb +3 -0
  266. data/lib/openc3/utilities/store_autoload.rb +30 -23
  267. data/lib/openc3/utilities/target_file.rb +89 -63
  268. data/lib/openc3/utilities/zip.rb +3 -0
  269. data/lib/openc3/utilities.rb +3 -0
  270. data/lib/openc3/version.rb +6 -6
  271. data/lib/openc3/win32/excel.rb +3 -0
  272. data/lib/openc3/win32/win32.rb +3 -0
  273. data/lib/openc3/win32/win32_main.rb +3 -0
  274. data/lib/openc3.rb +3 -0
  275. data/tasks/gemfile_stats.rake +3 -0
  276. data/tasks/spec.rake +3 -0
  277. data/templates/plugin-template/plugin.gemspec +1 -1
  278. metadata +112 -6
  279. data/lib/openc3/utilities/s3.rb +0 -218
  280. data/lib/openc3/utilities/s3_file_cache.rb +0 -274
@@ -12,58 +12,64 @@
12
12
  # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
13
  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
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.
15
18
 
16
19
  require 'fileutils'
17
20
  require 'json'
18
21
  require 'openc3/utilities/local_mode'
19
- require 'openc3/utilities/s3'
22
+ require 'openc3/utilities/bucket'
20
23
 
21
24
  module OpenC3
22
25
  class TargetFile
26
+ # Matches ScriptRunner.vue const TEMP_FOLDER
27
+ TEMP_FOLDER = '__TEMP__'
23
28
 
24
- DEFAULT_BUCKET_NAME = 'config'
25
-
26
- def self.all(scope, path_matchers)
29
+ def self.all(scope, path_matchers, include_temp: false)
27
30
  result = []
28
31
  modified = []
32
+ temp = []
29
33
 
30
- rubys3_client = Aws::S3::Client.new
31
- token = nil
32
- while true
33
- resp = rubys3_client.list_objects_v2({
34
- bucket: DEFAULT_BUCKET_NAME,
35
- prefix: "#{scope}/targets",
36
- max_keys: 1000,
37
- continuation_token: token
38
- })
34
+ bucket = Bucket.getClient()
35
+ resp = bucket.list_objects(
36
+ bucket: ENV['OPENC3_CONFIG_BUCKET'],
37
+ prefix: "#{scope}/targets",
38
+ )
39
+ resp.each do |object|
40
+ split_key = object.key.split('/')
41
+ # DEFAULT/targets_modified/__TEMP__/YYYY_MM_DD_HH_MM_SS_mmm_temp.rb
42
+ if split_key[2] == TEMP_FOLDER
43
+ temp << split_key[2..-1].join('/') if include_temp
44
+ next
45
+ end
39
46
 
40
- resp.contents.each do |object|
41
- split_key = object.key.split('/')
42
- found = false
43
- path_matchers.each do |path|
44
- if split_key.include?(path)
45
- found = true
46
- break
47
- end
48
- end
49
- next unless found
50
- result_no_scope_or_target_folder = split_key[2..-1].join('/')
51
- if object.key.include?("#{scope}/targets_modified")
52
- modified << result_no_scope_or_target_folder
53
- else
54
- result << result_no_scope_or_target_folder
47
+ found = false
48
+ path_matchers.each do |path|
49
+ if split_key.include?(path)
50
+ found = true
51
+ break
55
52
  end
56
53
  end
57
- break unless resp.is_truncated
58
- token = resp.next_continuation_token
54
+ next unless found
55
+ result_no_scope_or_target_folder = split_key[2..-1].join('/')
56
+ if object.key.include?("#{scope}/targets_modified")
57
+ modified << result_no_scope_or_target_folder
58
+ else
59
+ result << result_no_scope_or_target_folder
60
+ end
59
61
  end
60
62
 
61
63
  # Add in local targets_modified if present
62
64
  if ENV['OPENC3_LOCAL_MODE']
63
- local_modified = OpenC3::LocalMode.local_target_files(scope: scope, path_matchers: path_matchers)
65
+ local_modified = OpenC3::LocalMode.local_target_files(scope: scope, path_matchers: path_matchers, include_temp: include_temp)
64
66
  local_modified.each do |filename|
65
- modified << filename unless modified.include?(filename)
66
- result << filename unless result.include?(filename)
67
+ if include_temp and filename.include?(TEMP_FOLDER)
68
+ temp << filename
69
+ else
70
+ modified << filename unless modified.include?(filename)
71
+ result << filename unless result.include?(filename)
72
+ end
67
73
  end
68
74
  end
69
75
 
@@ -79,36 +85,50 @@ module OpenC3
79
85
 
80
86
  # Concat any remaining modified files (new files not in original target)
81
87
  result.concat(modified)
88
+ result.concat(temp.uniq)
82
89
  result.sort
83
90
  end
84
91
 
85
- def self.body(scope, name)
86
- name = name.split('*')[0] # Split '*' that indicates modified
87
- rubys3_client = Aws::S3::Client.new
88
- begin
89
- # First try opening a potentially modified version by looking for the modified target
92
+ def self.delete_temp(scope)
93
+ bucket = Bucket.getClient()
94
+ resp = bucket.list_objects(
95
+ bucket: ENV['OPENC3_CONFIG_BUCKET'],
96
+ prefix: "#{scope}/targets_modified/#{TEMP_FOLDER}",
97
+ )
98
+ resp.each do |object|
99
+ bucket.delete_object(
100
+ bucket: ENV['OPENC3_CONFIG_BUCKET'],
101
+ key: object.key,
102
+ )
90
103
  if ENV['OPENC3_LOCAL_MODE']
91
- local_file = OpenC3::LocalMode.open_local_file(name, scope: scope)
92
- return local_file.read if local_file
104
+ OpenC3::LocalMode.delete_local(object.key)
93
105
  end
106
+ end
107
+ true
108
+ end
109
+
110
+ def self.body(scope, name)
111
+ name = name.split('*')[0] # Split '*' that indicates modified
112
+ # First try opening a potentially modified version by looking for the modified target
113
+ if ENV['OPENC3_LOCAL_MODE']
114
+ local_file = OpenC3::LocalMode.open_local_file(name, scope: scope)
115
+ return local_file.read if local_file
116
+ end
94
117
 
95
- resp =
96
- rubys3_client.get_object(
97
- bucket: DEFAULT_BUCKET_NAME,
98
- key: "#{scope}/targets_modified/#{name}",
99
- )
100
- rescue Aws::S3::Errors::NoSuchKey
118
+ bucket = Bucket.getClient()
119
+ resp = bucket.get_object(bucket: ENV['OPENC3_CONFIG_BUCKET'], key: "#{scope}/targets_modified/#{name}")
120
+ unless resp
101
121
  # Now try the original
102
- resp =
103
- rubys3_client.get_object(
104
- bucket: DEFAULT_BUCKET_NAME,
105
- key: "#{scope}/targets/#{name}",
106
- )
122
+ resp = bucket.get_object(bucket: ENV['OPENC3_CONFIG_BUCKET'], key: "#{scope}/targets/#{name}")
107
123
  end
108
- if File.extname(name) == ".bin"
109
- resp.body.binmode
124
+ if resp && resp.body
125
+ if File.extname(name) == ".bin"
126
+ resp.body.binmode
127
+ end
128
+ resp.body.read
129
+ else
130
+ nil
110
131
  end
111
- resp.body.read
112
132
  end
113
133
 
114
134
  def self.create(scope, name, text, content_type: 'text/plain')
@@ -116,31 +136,37 @@ module OpenC3
116
136
  if ENV['OPENC3_LOCAL_MODE']
117
137
  OpenC3::LocalMode.put_target_file("#{scope}/targets_modified/#{name}", text, scope: scope)
118
138
  end
119
- OpenC3::S3Utilities.put_object_and_check(
139
+ client = Bucket.getClient()
140
+ client.put_object(
120
141
  # Use targets_modified to save modifications
121
142
  # This keeps the original target clean (read-only)
143
+ bucket: ENV['OPENC3_CONFIG_BUCKET'],
122
144
  key: "#{scope}/targets_modified/#{name}",
123
145
  body: text,
124
- bucket: DEFAULT_BUCKET_NAME,
125
146
  content_type: content_type,
126
147
  )
127
- true
148
+ # Wait for the object to exist
149
+ if client.check_object(
150
+ bucket: ENV['OPENC3_CONFIG_BUCKET'],
151
+ key: "#{scope}/targets_modified/#{name}",
152
+ )
153
+ true
154
+ else
155
+ false
156
+ end
128
157
  end
129
158
 
130
159
  def self.destroy(scope, name)
131
- rubys3_client = Aws::S3::Client.new
132
-
133
160
  if ENV['OPENC3_LOCAL_MODE']
134
161
  OpenC3::LocalMode.delete_local("#{scope}/targets_modified/#{name}")
135
162
  end
136
163
 
137
164
  # Only delete file from the modified target directory
138
- rubys3_client.delete_object(
165
+ Bucket.getClient.delete_object(
166
+ bucket: ENV['OPENC3_CONFIG_BUCKET'],
139
167
  key: "#{scope}/targets_modified/#{name}",
140
- bucket: DEFAULT_BUCKET_NAME,
141
168
  )
142
169
  true
143
170
  end
144
-
145
171
  end
146
- end
172
+ end
@@ -16,6 +16,9 @@
16
16
  # Modified by OpenC3, Inc.
17
17
  # All changes Copyright 2022, OpenC3, Inc.
18
18
  # All Rights Reserved
19
+ #
20
+ # This file may also be used under the terms of a commercial license
21
+ # if purchased from OpenC3, Inc.
19
22
 
20
23
  require 'zip'
21
24
  require 'zip/filesystem'
@@ -16,6 +16,9 @@
16
16
  # Modified by OpenC3, Inc.
17
17
  # All changes Copyright 2022, OpenC3, Inc.
18
18
  # All Rights Reserved
19
+ #
20
+ # This file may also be used under the terms of a commercial license
21
+ # if purchased from OpenC3, Inc.
19
22
 
20
23
  module OpenC3
21
24
  autoload(:Logger, 'openc3/utilities/logger.rb')
@@ -1,14 +1,14 @@
1
1
  # encoding: ascii-8bit
2
2
 
3
- OPENC3_VERSION = '5.0.10'
3
+ OPENC3_VERSION = '5.1.0'
4
4
  module OpenC3
5
5
  module Version
6
6
  MAJOR = '5'
7
- MINOR = '0'
8
- PATCH = '10'
7
+ MINOR = '1'
8
+ PATCH = '0'
9
9
  OTHER = ''
10
- BUILD = 'a9ab663d6355e0f8d8e62ca67ea300b949f34420'
10
+ BUILD = '7bd7fb9fdfa75abefb1b6ef01a55931c7b1d98dd'
11
11
  end
12
- VERSION = '5.0.10'
13
- GEM_VERSION = '5.0.10'
12
+ VERSION = '5.1.0'
13
+ GEM_VERSION = '5.1.0'
14
14
  end
@@ -16,6 +16,9 @@
16
16
  # Modified by OpenC3, Inc.
17
17
  # All changes Copyright 2022, OpenC3, Inc.
18
18
  # All Rights Reserved
19
+ #
20
+ # This file may also be used under the terms of a commercial license
21
+ # if purchased from OpenC3, Inc.
19
22
 
20
23
  require 'win32ole'
21
24
  require 'fileutils'
@@ -16,6 +16,9 @@
16
16
  # Modified by OpenC3, Inc.
17
17
  # All changes Copyright 2022, OpenC3, Inc.
18
18
  # All Rights Reserved
19
+ #
20
+ # This file may also be used under the terms of a commercial license
21
+ # if purchased from OpenC3, Inc.
19
22
 
20
23
  require 'openc3/win32/win32_main'
21
24
  require 'openc3/packets/structure'
@@ -16,6 +16,9 @@
16
16
  # Modified by OpenC3, Inc.
17
17
  # All changes Copyright 2022, OpenC3, Inc.
18
18
  # All Rights Reserved
19
+ #
20
+ # This file may also be used under the terms of a commercial license
21
+ # if purchased from OpenC3, Inc.
19
22
 
20
23
  module OpenC3
21
24
  if RUBY_ENGINE == 'ruby'
data/lib/openc3.rb CHANGED
@@ -16,6 +16,9 @@
16
16
  # Modified by OpenC3, Inc.
17
17
  # All changes Copyright 2022, OpenC3, Inc.
18
18
  # All Rights Reserved
19
+ #
20
+ # This file may also be used under the terms of a commercial license
21
+ # if purchased from OpenC3, Inc.
19
22
 
20
23
  # This file sets up using the OpenC3 framework
21
24
 
@@ -16,6 +16,9 @@
16
16
  # Modified by OpenC3, Inc.
17
17
  # All changes Copyright 2022, OpenC3, Inc.
18
18
  # All Rights Reserved
19
+ #
20
+ # This file may also be used under the terms of a commercial license
21
+ # if purchased from OpenC3, Inc.
19
22
 
20
23
  desc 'Create a picture of gemfile downloads'
21
24
  task :gemfile_stats do
data/tasks/spec.rake CHANGED
@@ -16,6 +16,9 @@
16
16
  # Modified by OpenC3, Inc.
17
17
  # All changes Copyright 2022, OpenC3, Inc.
18
18
  # All Rights Reserved
19
+ #
20
+ # This file may also be used under the terms of a commercial license
21
+ # if purchased from OpenC3, Inc.
19
22
 
20
23
  begin
21
24
  require 'rspec/core/rake_task'
@@ -19,5 +19,5 @@ spec = Gem::Specification.new do |s|
19
19
  else
20
20
  s.version = '0.0.0' + ".#{time}"
21
21
  end
22
- s.files = Dir.glob("{targets,lib,procedures,tools,microservices}/**/*") + %w(Rakefile README.md plugin.txt)
22
+ s.files = Dir.glob("{targets,lib,tools,microservices}/**/*") + %w(Rakefile README.md plugin.txt)
23
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openc3
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.10
4
+ version: 5.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Melton
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-09-17 00:00:00.000000000 Z
12
+ date: 2022-11-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -171,14 +171,14 @@ dependencies:
171
171
  requirements:
172
172
  - - "~>"
173
173
  - !ruby/object:Gem::Version
174
- version: '4.5'
174
+ version: '5.0'
175
175
  type: :runtime
176
176
  prerelease: false
177
177
  version_requirements: !ruby/object:Gem::Requirement
178
178
  requirements:
179
179
  - - "~>"
180
180
  - !ruby/object:Gem::Version
181
- version: '4.5'
181
+ version: '5.0'
182
182
  - !ruby/object:Gem::Dependency
183
183
  name: psych
184
184
  requirement: !ruby/object:Gem::Requirement
@@ -333,6 +333,104 @@ dependencies:
333
333
  - - "~>"
334
334
  - !ruby/object:Gem::Version
335
335
  version: '1.1'
336
+ - !ruby/object:Gem::Dependency
337
+ name: opentelemetry-sdk
338
+ requirement: !ruby/object:Gem::Requirement
339
+ requirements:
340
+ - - "~>"
341
+ - !ruby/object:Gem::Version
342
+ version: '1.2'
343
+ type: :runtime
344
+ prerelease: false
345
+ version_requirements: !ruby/object:Gem::Requirement
346
+ requirements:
347
+ - - "~>"
348
+ - !ruby/object:Gem::Version
349
+ version: '1.2'
350
+ - !ruby/object:Gem::Dependency
351
+ name: opentelemetry-exporter-otlp
352
+ requirement: !ruby/object:Gem::Requirement
353
+ requirements:
354
+ - - "~>"
355
+ - !ruby/object:Gem::Version
356
+ version: '0.24'
357
+ type: :runtime
358
+ prerelease: false
359
+ version_requirements: !ruby/object:Gem::Requirement
360
+ requirements:
361
+ - - "~>"
362
+ - !ruby/object:Gem::Version
363
+ version: '0.24'
364
+ - !ruby/object:Gem::Dependency
365
+ name: opentelemetry-instrumentation-rack
366
+ requirement: !ruby/object:Gem::Requirement
367
+ requirements:
368
+ - - "~>"
369
+ - !ruby/object:Gem::Version
370
+ version: '0.21'
371
+ type: :runtime
372
+ prerelease: false
373
+ version_requirements: !ruby/object:Gem::Requirement
374
+ requirements:
375
+ - - "~>"
376
+ - !ruby/object:Gem::Version
377
+ version: '0.21'
378
+ - !ruby/object:Gem::Dependency
379
+ name: opentelemetry-instrumentation-redis
380
+ requirement: !ruby/object:Gem::Requirement
381
+ requirements:
382
+ - - "~>"
383
+ - !ruby/object:Gem::Version
384
+ version: '0.24'
385
+ type: :runtime
386
+ prerelease: false
387
+ version_requirements: !ruby/object:Gem::Requirement
388
+ requirements:
389
+ - - "~>"
390
+ - !ruby/object:Gem::Version
391
+ version: '0.24'
392
+ - !ruby/object:Gem::Dependency
393
+ name: opentelemetry-instrumentation-action_pack
394
+ requirement: !ruby/object:Gem::Requirement
395
+ requirements:
396
+ - - "~>"
397
+ - !ruby/object:Gem::Version
398
+ version: '0.2'
399
+ type: :runtime
400
+ prerelease: false
401
+ version_requirements: !ruby/object:Gem::Requirement
402
+ requirements:
403
+ - - "~>"
404
+ - !ruby/object:Gem::Version
405
+ version: '0.2'
406
+ - !ruby/object:Gem::Dependency
407
+ name: opentelemetry-instrumentation-http_client
408
+ requirement: !ruby/object:Gem::Requirement
409
+ requirements:
410
+ - - "~>"
411
+ - !ruby/object:Gem::Version
412
+ version: '0.20'
413
+ type: :runtime
414
+ prerelease: false
415
+ version_requirements: !ruby/object:Gem::Requirement
416
+ requirements:
417
+ - - "~>"
418
+ - !ruby/object:Gem::Version
419
+ version: '0.20'
420
+ - !ruby/object:Gem::Dependency
421
+ name: opentelemetry-instrumentation-aws_sdk
422
+ requirement: !ruby/object:Gem::Requirement
423
+ requirements:
424
+ - - "~>"
425
+ - !ruby/object:Gem::Version
426
+ version: '0.3'
427
+ type: :runtime
428
+ prerelease: false
429
+ version_requirements: !ruby/object:Gem::Requirement
430
+ requirements:
431
+ - - "~>"
432
+ - !ruby/object:Gem::Version
433
+ version: '0.3'
336
434
  - !ruby/object:Gem::Dependency
337
435
  name: dead_end
338
436
  requirement: !ruby/object:Gem::Requirement
@@ -700,6 +798,8 @@ files:
700
798
  - lib/openc3/io/udp_sockets.rb
701
799
  - lib/openc3/io/win32_serial_driver.rb
702
800
  - lib/openc3/logs.rb
801
+ - lib/openc3/logs/buffered_packet_log_reader.rb
802
+ - lib/openc3/logs/buffered_packet_log_writer.rb
703
803
  - lib/openc3/logs/log_writer.rb
704
804
  - lib/openc3/logs/packet_log_constants.rb
705
805
  - lib/openc3/logs/packet_log_reader.rb
@@ -789,6 +889,7 @@ files:
789
889
  - lib/openc3/script/suite.rb
790
890
  - lib/openc3/script/suite_results.rb
791
891
  - lib/openc3/script/suite_runner.rb
892
+ - lib/openc3/script/telemetry.rb
792
893
  - lib/openc3/streams/serial_stream.rb
793
894
  - lib/openc3/streams/stream.rb
794
895
  - lib/openc3/streams/tcpip_client_stream.rb
@@ -818,24 +919,29 @@ files:
818
919
  - lib/openc3/topics/notifications_topic.rb
819
920
  - lib/openc3/topics/router_topic.rb
820
921
  - lib/openc3/topics/telemetry_decom_topic.rb
922
+ - lib/openc3/topics/telemetry_reduced_topics.rb
821
923
  - lib/openc3/topics/telemetry_topic.rb
822
924
  - lib/openc3/topics/timeline_topic.rb
823
925
  - lib/openc3/topics/topic.rb
824
926
  - lib/openc3/utilities.rb
825
927
  - lib/openc3/utilities/authentication.rb
826
928
  - lib/openc3/utilities/authorization.rb
929
+ - lib/openc3/utilities/aws_bucket.rb
930
+ - lib/openc3/utilities/bucket.rb
931
+ - lib/openc3/utilities/bucket_file_cache.rb
932
+ - lib/openc3/utilities/bucket_utilities.rb
827
933
  - lib/openc3/utilities/crc.rb
828
934
  - lib/openc3/utilities/csv.rb
935
+ - lib/openc3/utilities/local_bucket.rb
829
936
  - lib/openc3/utilities/local_mode.rb
830
937
  - lib/openc3/utilities/logger.rb
831
938
  - lib/openc3/utilities/message_log.rb
832
939
  - lib/openc3/utilities/metric.rb
940
+ - lib/openc3/utilities/open_telemetry.rb
833
941
  - lib/openc3/utilities/process_manager.rb
834
942
  - lib/openc3/utilities/quaternion.rb
835
943
  - lib/openc3/utilities/ruby_lex_utils.rb
836
- - lib/openc3/utilities/s3.rb
837
944
  - lib/openc3/utilities/s3_autoload.rb
838
- - lib/openc3/utilities/s3_file_cache.rb
839
945
  - lib/openc3/utilities/simulated_target.rb
840
946
  - lib/openc3/utilities/sleeper.rb
841
947
  - lib/openc3/utilities/store.rb