openc3 6.10.4 → 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/Gemfile +2 -1
- data/Guardfile +4 -9
- data/LICENSE.md +85 -0
- data/README.md +8 -8
- data/Rakefile +3 -9
- data/bin/cstol_converter +3 -8
- data/bin/openc3cli +64 -35
- data/data/config/command_modifiers.yaml +18 -1
- data/data/config/interface_modifiers.yaml +0 -2
- data/data/config/plugins.yaml +14 -18
- data/data/config/screen.yaml +1 -1
- data/data/config/target.yaml +26 -79
- data/data/config/telemetry_modifiers.yaml +15 -0
- data/data/config/widgets.yaml +32 -32
- data/ext/openc3/ext/array/array.c +4 -9
- data/ext/openc3/ext/buffered_file/buffered_file.c +4 -9
- data/ext/openc3/ext/burst_protocol/burst_protocol.c +3 -8
- data/ext/openc3/ext/config_parser/config_parser.c +2 -7
- data/ext/openc3/ext/crc/crc.c +3 -8
- data/ext/openc3/ext/openc3_io/openc3_io.c +4 -9
- data/ext/openc3/ext/packet/packet.c +7 -9
- data/ext/openc3/ext/platform/platform.c +3 -8
- data/ext/openc3/ext/polynomial_conversion/polynomial_conversion.c +16 -12
- data/ext/openc3/ext/string/string.c +4 -9
- data/ext/openc3/ext/structure/structure.c +5 -9
- data/ext/openc3/ext/tabbed_plots_config/tabbed_plots_config.c +4 -9
- data/ext/openc3/ext/telemetry/telemetry.c +8 -12
- data/lib/cosmos.rb +4 -9
- data/lib/cosmosc2.rb +4 -9
- data/lib/openc3/accessors/accessor.rb +10 -13
- data/lib/openc3/accessors/binary_accessor.rb +18 -17
- data/lib/openc3/accessors/cbor_accessor.rb +3 -8
- data/lib/openc3/accessors/form_accessor.rb +4 -9
- data/lib/openc3/accessors/html_accessor.rb +3 -8
- data/lib/openc3/accessors/http_accessor.rb +4 -9
- data/lib/openc3/accessors/json_accessor.rb +4 -9
- data/lib/openc3/accessors/template_accessor.rb +4 -9
- data/lib/openc3/accessors/xml_accessor.rb +4 -9
- data/lib/openc3/accessors.rb +3 -8
- data/lib/openc3/api/README.md +1 -1
- data/lib/openc3/api/api.rb +3 -8
- data/lib/openc3/api/authorized_api.rb +4 -9
- data/lib/openc3/api/cmd_api.rb +3 -8
- data/lib/openc3/api/config_api.rb +3 -8
- data/lib/openc3/api/interface_api.rb +4 -9
- data/lib/openc3/api/limits_api.rb +3 -8
- data/lib/openc3/api/metrics_api.rb +2 -19
- data/lib/openc3/api/offline_access_api.rb +2 -7
- data/lib/openc3/api/router_api.rb +5 -10
- data/lib/openc3/api/settings_api.rb +3 -8
- data/lib/openc3/api/stash_api.rb +2 -7
- data/lib/openc3/api/target_api.rb +3 -8
- data/lib/openc3/api/tlm_api.rb +15 -38
- data/lib/openc3/bridge/bridge.rb +3 -8
- data/lib/openc3/bridge/bridge_config.rb +5 -10
- data/lib/openc3/bridge/bridge_interface_thread.rb +4 -9
- data/lib/openc3/bridge/bridge_router_thread.rb +4 -9
- data/lib/openc3/ccsds/ccsds_packet.rb +4 -9
- data/lib/openc3/ccsds/ccsds_parser.rb +3 -8
- data/lib/openc3/config/config_parser.rb +3 -8
- data/lib/openc3/config/meta_config_parser.rb +3 -8
- data/lib/openc3/conversions/bit_reverse_conversion.rb +3 -8
- data/lib/openc3/conversions/conversion.rb +3 -8
- data/lib/openc3/conversions/generic_conversion.rb +3 -8
- data/lib/openc3/conversions/ip_read_conversion.rb +3 -8
- data/lib/openc3/conversions/ip_write_conversion.rb +3 -8
- data/lib/openc3/conversions/object_read_conversion.rb +3 -8
- data/lib/openc3/conversions/object_write_conversion.rb +3 -8
- data/lib/openc3/conversions/packet_time_formatted_conversion.rb +4 -9
- data/lib/openc3/conversions/packet_time_seconds_conversion.rb +4 -9
- data/lib/openc3/conversions/polynomial_conversion.rb +6 -8
- data/lib/openc3/conversions/processor_conversion.rb +3 -8
- data/lib/openc3/conversions/received_count_conversion.rb +4 -9
- data/lib/openc3/conversions/received_time_formatted_conversion.rb +4 -9
- data/lib/openc3/conversions/received_time_seconds_conversion.rb +4 -9
- data/lib/openc3/conversions/segmented_polynomial_conversion.rb +6 -8
- data/lib/openc3/conversions/unix_time_conversion.rb +3 -8
- data/lib/openc3/conversions/unix_time_formatted_conversion.rb +3 -8
- data/lib/openc3/conversions/unix_time_seconds_conversion.rb +3 -8
- data/lib/openc3/conversions.rb +3 -8
- data/lib/openc3/core_ext/array.rb +3 -8
- data/lib/openc3/core_ext/binding.rb +4 -9
- data/lib/openc3/core_ext/class.rb +4 -9
- data/lib/openc3/core_ext/exception.rb +3 -8
- data/lib/openc3/core_ext/file.rb +4 -9
- data/lib/openc3/core_ext/io.rb +4 -9
- data/lib/openc3/core_ext/kernel.rb +3 -8
- data/lib/openc3/core_ext/math.rb +4 -9
- data/lib/openc3/core_ext/matrix.rb +4 -9
- data/lib/openc3/core_ext/objectspace.rb +4 -9
- data/lib/openc3/core_ext/openc3_io.rb +4 -9
- data/lib/openc3/core_ext/range.rb +4 -9
- data/lib/openc3/core_ext/socket.rb +4 -9
- data/lib/openc3/core_ext/string.rb +3 -8
- data/lib/openc3/core_ext/stringio.rb +4 -9
- data/lib/openc3/core_ext/tempfile.rb +4 -9
- data/lib/openc3/core_ext/time.rb +3 -8
- data/lib/openc3/core_ext.rb +3 -8
- data/lib/openc3/interfaces/file_interface.rb +3 -8
- data/lib/openc3/interfaces/http_client_interface.rb +3 -8
- data/lib/openc3/interfaces/http_server_interface.rb +3 -8
- data/lib/openc3/interfaces/interface.rb +3 -8
- data/lib/openc3/interfaces/mqtt_interface.rb +3 -8
- data/lib/openc3/interfaces/mqtt_stream_interface.rb +3 -8
- data/lib/openc3/interfaces/protocols/burst_protocol.rb +3 -8
- data/lib/openc3/interfaces/protocols/cmd_response_protocol.rb +3 -8
- data/lib/openc3/interfaces/protocols/cobs_protocol.rb +3 -8
- data/lib/openc3/interfaces/protocols/crc_protocol.rb +3 -8
- data/lib/openc3/interfaces/protocols/fixed_protocol.rb +3 -8
- data/lib/openc3/interfaces/protocols/ignore_packet_protocol.rb +3 -8
- data/lib/openc3/interfaces/protocols/length_protocol.rb +3 -8
- data/lib/openc3/interfaces/protocols/preidentified_protocol.rb +3 -8
- data/lib/openc3/interfaces/protocols/protocol.rb +3 -8
- data/lib/openc3/interfaces/protocols/slip_protocol.rb +3 -8
- data/lib/openc3/interfaces/protocols/template_protocol.rb +3 -8
- data/lib/openc3/interfaces/protocols/terminated_protocol.rb +3 -8
- data/lib/openc3/interfaces/serial_interface.rb +3 -8
- data/lib/openc3/interfaces/simulated_target_interface.rb +3 -8
- data/lib/openc3/interfaces/stream_interface.rb +3 -8
- data/lib/openc3/interfaces/tcpip_client_interface.rb +3 -8
- data/lib/openc3/interfaces/tcpip_server_interface.rb +3 -8
- data/lib/openc3/interfaces/udp_interface.rb +3 -8
- data/lib/openc3/interfaces.rb +3 -8
- data/lib/openc3/io/buffered_file.rb +4 -9
- data/lib/openc3/io/io_multiplexer.rb +4 -9
- data/lib/openc3/io/json_api.rb +3 -8
- data/lib/openc3/io/json_api_object.rb +4 -9
- data/lib/openc3/io/json_drb.rb +3 -8
- data/lib/openc3/io/json_drb_object.rb +4 -9
- data/lib/openc3/io/json_drb_rack.rb +4 -9
- data/lib/openc3/io/json_rpc.rb +3 -8
- data/lib/openc3/io/posix_serial_driver.rb +3 -8
- data/lib/openc3/io/serial_driver.rb +3 -8
- data/lib/openc3/io/stderr.rb +4 -9
- data/lib/openc3/io/stdout.rb +4 -9
- data/lib/openc3/io/udp_sockets.rb +3 -8
- data/lib/openc3/io/win32_serial_driver.rb +4 -9
- data/lib/openc3/logs/buffered_packet_log_reader.rb +3 -8
- data/lib/openc3/logs/buffered_packet_log_writer.rb +3 -8
- data/lib/openc3/logs/log_writer.rb +3 -8
- data/lib/openc3/logs/packet_log_constants.rb +3 -8
- data/lib/openc3/logs/packet_log_reader.rb +3 -8
- data/lib/openc3/logs/packet_log_writer.rb +3 -8
- data/lib/openc3/logs/stream_log.rb +3 -8
- data/lib/openc3/logs/stream_log_pair.rb +3 -8
- data/lib/openc3/logs/text_log_writer.rb +3 -8
- data/lib/openc3/logs.rb +3 -8
- data/lib/openc3/microservices/cleanup_microservice.rb +4 -14
- data/lib/openc3/microservices/decom_microservice.rb +3 -8
- data/lib/openc3/microservices/interface_decom_common.rb +3 -8
- data/lib/openc3/microservices/interface_microservice.rb +5 -9
- data/lib/openc3/microservices/log_microservice.rb +3 -8
- data/lib/openc3/microservices/microservice.rb +24 -12
- data/lib/openc3/microservices/multi_microservice.rb +2 -7
- data/lib/openc3/microservices/periodic_microservice.rb +3 -8
- data/lib/openc3/microservices/plugin_microservice.rb +3 -8
- data/lib/openc3/microservices/queue_microservice.rb +3 -8
- data/lib/openc3/microservices/router_microservice.rb +3 -8
- data/lib/openc3/microservices/scope_cleanup_microservice.rb +3 -8
- data/lib/openc3/microservices/text_log_microservice.rb +3 -8
- data/lib/openc3/migrations/20251213120000_reinstall_plugins.rb +45 -0
- data/lib/openc3/migrations/20260204000000_remove_decom_reducer.rb +60 -0
- data/lib/openc3/models/activity_model.rb +4 -8
- data/lib/openc3/models/auth_model.rb +57 -38
- data/lib/openc3/models/cvt_model.rb +203 -62
- data/lib/openc3/models/environment_model.rb +4 -9
- data/lib/openc3/models/gem_model.rb +3 -8
- data/lib/openc3/models/info_model.rb +4 -9
- data/lib/openc3/models/interface_model.rb +6 -10
- data/lib/openc3/models/interface_status_model.rb +4 -9
- data/lib/openc3/models/metadata_model.rb +3 -8
- data/lib/openc3/models/metric_model.rb +3 -8
- data/lib/openc3/models/microservice_model.rb +24 -10
- data/lib/openc3/models/microservice_status_model.rb +3 -8
- data/lib/openc3/models/migration_model.rb +3 -8
- data/lib/openc3/models/model.rb +3 -8
- data/lib/openc3/models/news_model.rb +3 -8
- data/lib/openc3/models/note_model.rb +3 -8
- data/lib/openc3/models/offline_access_model.rb +3 -8
- data/lib/openc3/models/ping_model.rb +4 -9
- data/lib/openc3/models/plugin_model.rb +14 -9
- data/lib/openc3/models/plugin_store_model.rb +21 -17
- data/lib/openc3/models/process_status_model.rb +4 -9
- data/lib/openc3/models/python_package_model.rb +3 -8
- data/lib/openc3/models/queue_model.rb +3 -8
- data/lib/openc3/models/reaction_model.rb +9 -10
- data/lib/openc3/models/router_model.rb +4 -9
- data/lib/openc3/models/router_status_model.rb +4 -9
- data/lib/openc3/models/scope_model.rb +4 -9
- data/lib/openc3/models/script_engine_model.rb +3 -8
- data/lib/openc3/models/script_status_model.rb +3 -8
- data/lib/openc3/models/secret_model.rb +3 -8
- data/lib/openc3/models/setting_model.rb +3 -8
- data/lib/openc3/models/sorted_model.rb +3 -8
- data/lib/openc3/models/stash_model.rb +3 -8
- data/lib/openc3/models/target_model.rb +99 -229
- data/lib/openc3/models/timeline_model.rb +3 -8
- data/lib/openc3/models/tool_config_model.rb +3 -8
- data/lib/openc3/models/tool_model.rb +10 -10
- data/lib/openc3/models/trigger_group_model.rb +3 -8
- data/lib/openc3/models/trigger_model.rb +3 -8
- data/lib/openc3/models/widget_model.rb +3 -8
- data/lib/openc3/operators/microservice_operator.rb +7 -8
- data/lib/openc3/operators/operator.rb +3 -8
- data/lib/openc3/packets/command_validator.rb +3 -8
- data/lib/openc3/packets/commands.rb +32 -14
- data/lib/openc3/packets/json_packet.rb +7 -19
- data/lib/openc3/packets/limits.rb +3 -8
- data/lib/openc3/packets/limits_response.rb +3 -8
- data/lib/openc3/packets/packet.rb +38 -32
- data/lib/openc3/packets/packet_config.rb +23 -13
- data/lib/openc3/packets/packet_item.rb +3 -8
- data/lib/openc3/packets/packet_item_limits.rb +3 -8
- data/lib/openc3/packets/parsers/format_string_parser.rb +3 -8
- data/lib/openc3/packets/parsers/limits_parser.rb +3 -8
- data/lib/openc3/packets/parsers/limits_response_parser.rb +3 -8
- data/lib/openc3/packets/parsers/packet_item_parser.rb +7 -8
- data/lib/openc3/packets/parsers/packet_parser.rb +3 -8
- data/lib/openc3/packets/parsers/processor_parser.rb +3 -8
- data/lib/openc3/packets/parsers/state_parser.rb +3 -8
- data/lib/openc3/packets/parsers/xtce_converter.rb +12 -9
- data/lib/openc3/packets/parsers/xtce_parser.rb +3 -8
- data/lib/openc3/packets/structure.rb +14 -11
- data/lib/openc3/packets/structure_item.rb +4 -9
- data/lib/openc3/packets/telemetry.rb +7 -11
- data/lib/openc3/processors/processor.rb +5 -10
- data/lib/openc3/processors/statistics_processor.rb +4 -9
- data/lib/openc3/processors/watermark_processor.rb +4 -9
- data/lib/openc3/processors.rb +4 -9
- data/lib/openc3/script/api_shared.rb +8 -37
- data/lib/openc3/script/autonomic.rb +3 -8
- data/lib/openc3/script/calendar.rb +3 -8
- data/lib/openc3/script/commands.rb +3 -8
- data/lib/openc3/script/critical_cmd.rb +3 -8
- data/lib/openc3/script/exceptions.rb +4 -9
- data/lib/openc3/script/extract.rb +3 -8
- data/lib/openc3/script/limits.rb +3 -8
- data/lib/openc3/script/metadata.rb +3 -8
- data/lib/openc3/script/packages.rb +3 -8
- data/lib/openc3/script/plugins.rb +3 -8
- data/lib/openc3/script/queue.rb +3 -8
- data/lib/openc3/script/screen.rb +7 -8
- data/lib/openc3/script/script.rb +3 -8
- data/lib/openc3/script/script_runner.rb +3 -8
- data/lib/openc3/script/storage.rb +6 -10
- data/lib/openc3/script/suite.rb +3 -8
- data/lib/openc3/script/suite_results.rb +3 -8
- data/lib/openc3/script/suite_runner.rb +3 -8
- data/lib/openc3/script/tables.rb +3 -8
- data/lib/openc3/script/telemetry.rb +3 -8
- data/lib/openc3/script/web_socket_api.rb +8 -13
- data/lib/openc3/script.rb +4 -9
- data/lib/openc3/script_engines/script_engine.rb +3 -8
- data/lib/openc3/streams/mqtt_stream.rb +3 -8
- data/lib/openc3/streams/serial_stream.rb +3 -8
- data/lib/openc3/streams/stream.rb +3 -8
- data/lib/openc3/streams/tcpip_client_stream.rb +3 -8
- data/lib/openc3/streams/tcpip_socket_stream.rb +3 -8
- data/lib/openc3/streams/web_socket_client_stream.rb +3 -8
- data/lib/openc3/system/system.rb +3 -8
- data/lib/openc3/system/target.rb +3 -8
- data/lib/openc3/system.rb +3 -8
- data/lib/openc3/tools/cmd_tlm_server/api.rb +4 -9
- data/lib/openc3/tools/cmd_tlm_server/interface_thread.rb +3 -8
- data/lib/openc3/tools/table_manager/table.rb +3 -8
- data/lib/openc3/tools/table_manager/table_config.rb +3 -8
- data/lib/openc3/tools/table_manager/table_item.rb +4 -9
- data/lib/openc3/tools/table_manager/table_item_parser.rb +3 -8
- data/lib/openc3/tools/table_manager/table_manager_core.rb +3 -8
- data/lib/openc3/tools/table_manager/table_parser.rb +3 -8
- data/lib/openc3/tools/test_runner/test.rb +4 -9
- data/lib/openc3/top_level.rb +3 -8
- data/lib/openc3/topics/autonomic_topic.rb +4 -9
- data/lib/openc3/topics/calendar_topic.rb +4 -9
- data/lib/openc3/topics/command_decom_topic.rb +14 -17
- data/lib/openc3/topics/command_topic.rb +14 -10
- data/lib/openc3/topics/config_topic.rb +3 -8
- data/lib/openc3/topics/decom_interface_topic.rb +3 -8
- data/lib/openc3/topics/interface_topic.rb +3 -8
- data/lib/openc3/topics/limits_event_topic.rb +3 -8
- data/lib/openc3/topics/notebook_topic.rb +32 -0
- data/lib/openc3/topics/queue_topic.rb +3 -8
- data/lib/openc3/topics/router_topic.rb +3 -8
- data/lib/openc3/topics/system_events_topic.rb +3 -8
- data/lib/openc3/topics/telemetry_decom_topic.rb +12 -12
- data/lib/openc3/topics/telemetry_topic.rb +3 -8
- data/lib/openc3/topics/timeline_topic.rb +4 -9
- data/lib/openc3/topics/topic.rb +3 -8
- data/lib/openc3/utilities/authentication.rb +29 -10
- data/lib/openc3/utilities/authorization.rb +4 -9
- data/lib/openc3/utilities/aws_bucket.rb +126 -16
- data/lib/openc3/utilities/bucket.rb +9 -9
- data/lib/openc3/utilities/bucket_file_cache.rb +3 -13
- data/lib/openc3/utilities/bucket_require.rb +3 -8
- data/lib/openc3/utilities/bucket_utilities.rb +3 -10
- data/lib/openc3/utilities/cli_generator.rb +11 -16
- data/lib/openc3/utilities/cmd_log.rb +3 -8
- data/lib/openc3/utilities/crc.rb +3 -8
- data/lib/openc3/utilities/csv.rb +4 -9
- data/lib/openc3/utilities/local_bucket.rb +5 -10
- data/lib/openc3/utilities/local_mode.rb +14 -18
- data/lib/openc3/utilities/logger.rb +3 -8
- data/lib/openc3/utilities/message_log.rb +3 -8
- data/lib/openc3/utilities/metric.rb +3 -8
- data/lib/openc3/utilities/migration.rb +3 -8
- data/lib/openc3/utilities/open_telemetry.rb +3 -8
- data/lib/openc3/utilities/process_manager.rb +3 -8
- data/lib/openc3/utilities/python_proxy.rb +3 -8
- data/lib/openc3/utilities/quaternion.rb +3 -8
- data/lib/openc3/utilities/questdb_client.rb +210 -0
- data/lib/openc3/utilities/redis_secrets.rb +3 -8
- data/lib/openc3/utilities/ruby_lex_utils.rb +3 -8
- data/lib/openc3/utilities/running_script.rb +13 -11
- data/lib/openc3/utilities/s3_autoload.rb +9 -2
- data/lib/openc3/utilities/secrets.rb +8 -9
- data/lib/openc3/utilities/simulated_target.rb +4 -9
- data/lib/openc3/utilities/sleeper.rb +3 -8
- data/lib/openc3/utilities/store.rb +4 -9
- data/lib/openc3/utilities/store_autoload.rb +7 -14
- data/lib/openc3/utilities/store_queued.rb +6 -9
- data/lib/openc3/utilities/target_file.rb +3 -8
- data/lib/openc3/utilities/thread_manager.rb +3 -8
- data/lib/openc3/utilities/throttle.rb +3 -8
- data/lib/openc3/utilities/zip.rb +4 -9
- data/lib/openc3/utilities.rb +4 -9
- data/lib/openc3/version.rb +8 -8
- data/lib/openc3/win32/excel.rb +4 -9
- data/lib/openc3/win32/win32.rb +4 -9
- data/lib/openc3/win32/win32_main.rb +3 -8
- data/lib/openc3.rb +3 -12
- data/tasks/gemfile_stats.rake +4 -9
- data/tasks/spec.rake +4 -9
- data/templates/plugin/README.md +2 -2
- data/templates/plugin/plugin.gemspec +1 -1
- data/templates/tool_angular/package.json +1 -1
- data/templates/tool_vue/package.json +3 -3
- data/templates/tool_vue/vite.config.js +2 -1
- data/templates/widget/package.json +3 -3
- data/templates/widget/vite.config.js +1 -1
- metadata +49 -26
- data/LICENSE.txt +0 -729
- data/bin/rubysloc +0 -142
- data/ext/openc3/ext/reducer_microservice/extconf.rb +0 -13
- data/ext/openc3/ext/reducer_microservice/reducer_microservice.c +0 -165
- data/lib/openc3/microservices/reducer_microservice.rb +0 -640
- data/lib/openc3/models/reducer_model.rb +0 -72
- data/lib/openc3/topics/telemetry_reduced_topics.rb +0 -80
- /data/templates/plugin/{LICENSE.txt → LICENSE.md} +0 -0
- /data/templates/widget/{LICENSE.txt → LICENSE.md} +0 -0
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
# encoding: ascii-8bit
|
|
2
2
|
|
|
3
|
-
# Copyright
|
|
3
|
+
# Copyright 2026 OpenC3, Inc.
|
|
4
4
|
# All Rights Reserved.
|
|
5
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
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
|
|
16
11
|
# This file may also be used under the terms of a commercial license
|
|
17
12
|
# if purchased from OpenC3, Inc.
|
|
@@ -200,8 +195,8 @@ module OpenC3
|
|
|
200
195
|
abort("Target #{target_path} already exists!")
|
|
201
196
|
end
|
|
202
197
|
target_lib_filename = "#{target_name.downcase}.#{@@language}"
|
|
203
|
-
target_class = target_lib_filename.filename_to_class_name
|
|
204
|
-
target_object = target_name.downcase
|
|
198
|
+
target_class = target_lib_filename.filename_to_class_name
|
|
199
|
+
target_object = target_name.downcase
|
|
205
200
|
|
|
206
201
|
process_template("#{TEMPLATES_DIR}/target", binding) do |filename|
|
|
207
202
|
# Rename the template TARGET to our actual target named after the plugin
|
|
@@ -228,7 +223,7 @@ module OpenC3
|
|
|
228
223
|
else
|
|
229
224
|
'requirements.txt'
|
|
230
225
|
end
|
|
231
|
-
s.files = Dir.glob("{targets,lib,public,tools,microservices}/**/*") + %w(Rakefile README.md LICENSE.
|
|
226
|
+
s.files = Dir.glob("{targets,lib,public,tools,microservices}/**/*") + %w(Rakefile README.md LICENSE.md plugin.txt) + [python_dep_file]
|
|
232
227
|
RUBY
|
|
233
228
|
end
|
|
234
229
|
File.write(gemspec_filename, gemspec)
|
|
@@ -296,7 +291,7 @@ RUBY
|
|
|
296
291
|
abort("Microservice #{microservice_path} already exists!")
|
|
297
292
|
end
|
|
298
293
|
microservice_filename = "#{microservice_name.downcase}.#{@@language}"
|
|
299
|
-
microservice_class = microservice_filename.filename_to_class_name
|
|
294
|
+
microservice_class = microservice_filename.filename_to_class_name
|
|
300
295
|
|
|
301
296
|
process_template("#{TEMPLATES_DIR}/microservice", binding) do |filename|
|
|
302
297
|
# Rename the template MICROSERVICE to our actual microservice name
|
|
@@ -551,7 +546,7 @@ RUBY
|
|
|
551
546
|
end
|
|
552
547
|
conversion_name = "#{args[2].upcase.gsub(/_+|-+/, '_')}_CONVERSION"
|
|
553
548
|
conversion_basename = "#{conversion_name.downcase}.#{@@language}"
|
|
554
|
-
conversion_class = conversion_basename.filename_to_class_name
|
|
549
|
+
conversion_class = conversion_basename.filename_to_class_name
|
|
555
550
|
conversion_filename = "targets/#{target_name}/lib/#{conversion_basename}"
|
|
556
551
|
if File.exist?(conversion_filename)
|
|
557
552
|
abort("Conversion #{conversion_filename} already exists!")
|
|
@@ -605,7 +600,7 @@ RUBY
|
|
|
605
600
|
end
|
|
606
601
|
processor_name = "#{args[2].upcase.gsub(/_+|-+/, '_')}_PROCESSOR"
|
|
607
602
|
processor_basename = "#{processor_name.downcase}.#{@@language}"
|
|
608
|
-
processor_class = processor_basename.filename_to_class_name
|
|
603
|
+
processor_class = processor_basename.filename_to_class_name
|
|
609
604
|
processor_filename = "targets/#{target_name}/lib/#{processor_basename}"
|
|
610
605
|
if File.exist?(processor_filename)
|
|
611
606
|
abort("Processor #{processor_filename} already exists!")
|
|
@@ -660,7 +655,7 @@ RUBY
|
|
|
660
655
|
response_name = "#{args[2].upcase.gsub(/_+|-+/, '_')}_LIMITS_RESPONSE"
|
|
661
656
|
response_basename = "#{response_name.downcase}.#{@@language}"
|
|
662
657
|
response_filename = "targets/#{target_name}/lib/#{response_basename}"
|
|
663
|
-
response_class = response_basename.filename_to_class_name
|
|
658
|
+
response_class = response_basename.filename_to_class_name
|
|
664
659
|
if File.exist?(response_filename)
|
|
665
660
|
abort("response #{response_filename} already exists!")
|
|
666
661
|
end
|
|
@@ -713,7 +708,7 @@ RUBY
|
|
|
713
708
|
end
|
|
714
709
|
validator_name = "#{args[2].upcase.gsub(/_+|-+/, '_')}_COMMAND_VALIDATOR"
|
|
715
710
|
validator_basename = "#{validator_name.downcase}.#{@@language}"
|
|
716
|
-
validator_class = validator_basename.filename_to_class_name
|
|
711
|
+
validator_class = validator_basename.filename_to_class_name
|
|
717
712
|
validator_filename = "targets/#{target_name}/lib/#{validator_basename}"
|
|
718
713
|
if File.exist?(validator_filename)
|
|
719
714
|
abort("Command validator #{validator_filename} already exists!")
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
# encoding: ascii-8bit
|
|
2
2
|
|
|
3
|
-
# Copyright
|
|
3
|
+
# Copyright 2026 OpenC3, Inc.
|
|
4
4
|
# All Rights Reserved.
|
|
5
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
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
|
|
16
11
|
# This file may also be used under the terms of a commercial license
|
|
17
12
|
# if purchased from OpenC3, Inc.
|
data/lib/openc3/utilities/crc.rb
CHANGED
|
@@ -3,18 +3,13 @@
|
|
|
3
3
|
# Copyright 2022 Ball Aerospace & Technologies Corp.
|
|
4
4
|
# All Rights Reserved.
|
|
5
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
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
|
|
16
11
|
# Modified by OpenC3, Inc.
|
|
17
|
-
# All changes Copyright
|
|
12
|
+
# All changes Copyright 2026, OpenC3, Inc.
|
|
18
13
|
# All Rights Reserved
|
|
19
14
|
#
|
|
20
15
|
# This file may also be used under the terms of a commercial license
|
data/lib/openc3/utilities/csv.rb
CHANGED
|
@@ -3,21 +3,16 @@
|
|
|
3
3
|
# Copyright 2022 Ball Aerospace & Technologies Corp.
|
|
4
4
|
# All Rights Reserved.
|
|
5
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
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
|
|
16
11
|
# Modified by OpenC3, Inc.
|
|
17
|
-
# All changes Copyright
|
|
12
|
+
# All changes Copyright 2026, OpenC3, Inc.
|
|
18
13
|
# All Rights Reserved
|
|
19
14
|
#
|
|
20
|
-
# This file may also be used under the terms of a commercial license
|
|
15
|
+
# This file may also be used under the terms of a commercial license
|
|
21
16
|
# if purchased from OpenC3, Inc.
|
|
22
17
|
|
|
23
18
|
require 'csv'
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
# encoding: ascii-8bit
|
|
2
2
|
|
|
3
|
-
# Copyright
|
|
3
|
+
# Copyright 2026 OpenC3, Inc.
|
|
4
4
|
# All Rights Reserved.
|
|
5
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
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
#
|
|
16
|
-
# This file may also be used under the terms of a commercial license
|
|
11
|
+
# This file may also be used under the terms of a commercial license
|
|
17
12
|
# if purchased from OpenC3, Inc.
|
|
18
13
|
|
|
19
14
|
require 'openc3/utilities/aws_bucket'
|
|
@@ -22,7 +17,7 @@ module OpenC3
|
|
|
22
17
|
# This class exists simply to enable the following code in bucket.rb
|
|
23
18
|
# bucket_class = ENV['OPENC3_CLOUD'].capitalize + 'Bucket'
|
|
24
19
|
# So when the OPENC3_CLOUD var is set to 'local' this file is used
|
|
25
|
-
# The local code uses
|
|
20
|
+
# The local code uses versitygw which is identical to the Aws APIs
|
|
26
21
|
class LocalBucket < AwsBucket
|
|
27
22
|
end
|
|
28
23
|
end
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
# encoding: ascii-8bit
|
|
2
2
|
|
|
3
|
-
# Copyright
|
|
3
|
+
# Copyright 2026 OpenC3, Inc.
|
|
4
4
|
# All Rights Reserved.
|
|
5
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
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
#
|
|
16
11
|
# This file may also be used under the terms of a commercial license
|
|
17
12
|
# if purchased from OpenC3, Inc.
|
|
@@ -26,13 +21,13 @@ require 'openc3/utilities/bucket'
|
|
|
26
21
|
module OpenC3
|
|
27
22
|
module LocalMode
|
|
28
23
|
OPENC3_LOCAL_MODE_PATH = ENV['OPENC3_LOCAL_MODE_PATH'] || "/plugins"
|
|
29
|
-
# When updating update local_mode.py, PluginsTab.vue, plugins.spec.ts
|
|
24
|
+
# When updating update local_mode.py, PluginsTab.vue, plugins.p.spec.ts
|
|
30
25
|
DEFAULT_PLUGINS = [
|
|
31
26
|
'openc3-cosmos-tool-admin',
|
|
32
27
|
'openc3-cosmos-tool-bucketexplorer',
|
|
33
28
|
'openc3-cosmos-tool-cmdsender',
|
|
34
|
-
'openc3-cosmos-tool-cmdqueue',
|
|
35
|
-
'openc3-cosmos-tool-cmdhistory',
|
|
29
|
+
'openc3-cosmos-tool-cmdqueue', # Enterprise only
|
|
30
|
+
'openc3-cosmos-tool-cmdhistory', # Enterprise only
|
|
36
31
|
'openc3-cosmos-tool-cmdtlmserver',
|
|
37
32
|
'openc3-cosmos-tool-dataextractor',
|
|
38
33
|
'openc3-cosmos-tool-dataviewer',
|
|
@@ -45,13 +40,14 @@ module OpenC3
|
|
|
45
40
|
'openc3-cosmos-tool-tablemanager',
|
|
46
41
|
'openc3-cosmos-tool-tlmgrapher',
|
|
47
42
|
'openc3-cosmos-tool-tlmviewer',
|
|
48
|
-
'openc3-cosmos-enterprise-tool-admin',
|
|
49
|
-
'openc3-
|
|
50
|
-
'openc3-cosmos-tool-
|
|
51
|
-
'openc3-cosmos-tool-
|
|
52
|
-
'openc3-cosmos-tool-
|
|
53
|
-
'openc3-cosmos-tool-
|
|
54
|
-
'openc3-cosmos-tool-
|
|
43
|
+
'openc3-cosmos-enterprise-tool-admin', # Enterprise only
|
|
44
|
+
'openc3-cosmos-tool-autonomic', # Enterprise only
|
|
45
|
+
'openc3-cosmos-tool-calendar', # Enterprise only
|
|
46
|
+
'openc3-cosmos-tool-grafana', # Enterprise only
|
|
47
|
+
'openc3-cosmos-tool-logexplorer', # Enterprise only
|
|
48
|
+
'openc3-cosmos-tool-notebooks', # Enterprise only
|
|
49
|
+
'openc3-cosmos-tool-systemhealth', # Enterprise only
|
|
50
|
+
'openc3-enterprise-tool-base', # Enterprise only
|
|
55
51
|
'openc3-tool-base',
|
|
56
52
|
]
|
|
57
53
|
|
|
@@ -3,18 +3,13 @@
|
|
|
3
3
|
# Copyright 2022 Ball Aerospace & Technologies Corp.
|
|
4
4
|
# All Rights Reserved.
|
|
5
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
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
|
|
16
11
|
# Modified by OpenC3, Inc.
|
|
17
|
-
# All changes Copyright
|
|
12
|
+
# All changes Copyright 2026, OpenC3, Inc.
|
|
18
13
|
# All Rights Reserved
|
|
19
14
|
#
|
|
20
15
|
# This file may also be used under the terms of a commercial license
|
|
@@ -3,18 +3,13 @@
|
|
|
3
3
|
# Copyright 2022 Ball Aerospace & Technologies Corp.
|
|
4
4
|
# All Rights Reserved.
|
|
5
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
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
|
|
16
11
|
# Modified by OpenC3, Inc.
|
|
17
|
-
# All changes Copyright
|
|
12
|
+
# All changes Copyright 2026, OpenC3, Inc.
|
|
18
13
|
# All Rights Reserved
|
|
19
14
|
#
|
|
20
15
|
# This file may also be used under the terms of a commercial license
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
# encoding: ascii-8bit
|
|
2
2
|
|
|
3
|
-
# Copyright
|
|
3
|
+
# Copyright 2026 OpenC3, Inc.
|
|
4
4
|
# All Rights Reserved.
|
|
5
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
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
#
|
|
16
11
|
# This file may also be used under the terms of a commercial license
|
|
17
12
|
# if purchased from OpenC3, Inc.
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
# encoding: ascii-8bit
|
|
2
2
|
|
|
3
|
-
# Copyright
|
|
3
|
+
# Copyright 2026 OpenC3, Inc.
|
|
4
4
|
# All Rights Reserved.
|
|
5
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
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
#
|
|
16
11
|
# This file may also be used under the terms of a commercial license
|
|
17
12
|
# if purchased from OpenC3, Inc.
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
# encoding: ascii-8bit
|
|
2
2
|
|
|
3
|
-
# Copyright
|
|
3
|
+
# Copyright 2026 OpenC3, Inc.
|
|
4
4
|
# All Rights Reserved.
|
|
5
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
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
#
|
|
16
11
|
# This file may also be used under the terms of a commercial license
|
|
17
12
|
# if purchased from OpenC3, Inc.
|
|
@@ -3,18 +3,13 @@
|
|
|
3
3
|
# Copyright 2022 Ball Aerospace & Technologies Corp.
|
|
4
4
|
# All Rights Reserved.
|
|
5
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
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
|
|
16
11
|
# Modified by OpenC3, Inc.
|
|
17
|
-
# All changes Copyright
|
|
12
|
+
# All changes Copyright 2026, OpenC3, Inc.
|
|
18
13
|
# All Rights Reserved
|
|
19
14
|
#
|
|
20
15
|
# This file may also be used under the terms of a commercial license
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
# encoding: ascii-8bit
|
|
2
2
|
|
|
3
|
-
# Copyright
|
|
3
|
+
# Copyright 2026 OpenC3, Inc.
|
|
4
4
|
# All Rights Reserved.
|
|
5
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
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
#
|
|
16
11
|
# This file may also be used under the terms of a commercial license
|
|
17
12
|
# if purchased from OpenC3, Inc.
|
|
@@ -3,18 +3,13 @@
|
|
|
3
3
|
# Copyright 2022 Ball Aerospace & Technologies Corp.
|
|
4
4
|
# All Rights Reserved.
|
|
5
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
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
|
|
16
11
|
# Modified by OpenC3, Inc.
|
|
17
|
-
# All changes Copyright
|
|
12
|
+
# All changes Copyright 2026, OpenC3, Inc.
|
|
18
13
|
# All Rights Reserved
|
|
19
14
|
#
|
|
20
15
|
# This file may also be used under the terms of a commercial license
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# encoding: ascii-8bit
|
|
2
|
+
|
|
3
|
+
# Copyright 2026 OpenC3, Inc.
|
|
4
|
+
# All Rights Reserved.
|
|
5
|
+
#
|
|
6
|
+
# This program is distributed in the hope that it will be useful,
|
|
7
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
10
|
+
#
|
|
11
|
+
# This file may also be used under the terms of a commercial license
|
|
12
|
+
# if purchased from OpenC3, Inc.
|
|
13
|
+
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'base64'
|
|
16
|
+
require 'bigdecimal'
|
|
17
|
+
|
|
18
|
+
module OpenC3
|
|
19
|
+
# Utility class for QuestDB data encoding and decoding.
|
|
20
|
+
# This provides a common interface for serializing/deserializing COSMOS data types
|
|
21
|
+
# when writing to and reading from QuestDB.
|
|
22
|
+
class QuestDBClient
|
|
23
|
+
# Special timestamp items that are calculated from PACKET_TIMESECONDS/RECEIVED_TIMESECONDS columns
|
|
24
|
+
# rather than stored as separate columns. PACKET_TIMESECONDS and RECEIVED_TIMESECONDS are stored
|
|
25
|
+
# as timestamp_ns columns and need conversion to float seconds on read. The TIMEFORMATTED items
|
|
26
|
+
# are derived from these timestamp columns.
|
|
27
|
+
TIMESTAMP_ITEMS = {
|
|
28
|
+
'PACKET_TIMEFORMATTED' => { source: 'PACKET_TIMESECONDS', format: :formatted },
|
|
29
|
+
'RECEIVED_TIMEFORMATTED' => { source: 'RECEIVED_TIMESECONDS', format: :formatted }
|
|
30
|
+
}.freeze
|
|
31
|
+
|
|
32
|
+
# Sentinel values for storing float special values (inf, -inf, nan) in QuestDB.
|
|
33
|
+
# QuestDB stores these as NULL, so we use sentinel values near float max instead.
|
|
34
|
+
|
|
35
|
+
# 64-bit double sentinels (for FLOAT 64-bit columns)
|
|
36
|
+
FLOAT64_POS_INF_SENTINEL = 1.7976931348623155e308
|
|
37
|
+
FLOAT64_NEG_INF_SENTINEL = -1.7976931348623155e308
|
|
38
|
+
FLOAT64_NAN_SENTINEL = -1.7976931348623153e308
|
|
39
|
+
|
|
40
|
+
# 32-bit float sentinels (what we read back after 32-bit storage)
|
|
41
|
+
FLOAT32_POS_INF_STORED = 3.4028232635611926e38
|
|
42
|
+
FLOAT32_NEG_INF_STORED = -3.4028232635611926e38
|
|
43
|
+
FLOAT32_NAN_STORED = -3.4028230607370965e38
|
|
44
|
+
|
|
45
|
+
# Decode sentinel values back to float special values (inf, -inf, nan).
|
|
46
|
+
# Checks against both 32-bit and 64-bit sentinel values since we may not
|
|
47
|
+
# know the original column type at read time.
|
|
48
|
+
#
|
|
49
|
+
# @param value [Float] The float value to potentially decode
|
|
50
|
+
# @return [Float] The value with sentinels replaced by special values
|
|
51
|
+
def self.decode_float_special_values(value)
|
|
52
|
+
return value unless value.is_a?(Float)
|
|
53
|
+
|
|
54
|
+
# Check 64-bit sentinels
|
|
55
|
+
return Float::INFINITY if value == FLOAT64_POS_INF_SENTINEL
|
|
56
|
+
return -Float::INFINITY if value == FLOAT64_NEG_INF_SENTINEL
|
|
57
|
+
return Float::NAN if value == FLOAT64_NAN_SENTINEL
|
|
58
|
+
|
|
59
|
+
# Check 32-bit sentinels (stored values after precision loss)
|
|
60
|
+
return Float::INFINITY if value == FLOAT32_POS_INF_STORED
|
|
61
|
+
return -Float::INFINITY if value == FLOAT32_NEG_INF_STORED
|
|
62
|
+
return Float::NAN if value == FLOAT32_NAN_STORED
|
|
63
|
+
|
|
64
|
+
value
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Decode a value retrieved from QuestDB back to its original Ruby type.
|
|
68
|
+
#
|
|
69
|
+
# QuestDB stores certain COSMOS types as encoded strings:
|
|
70
|
+
# - Arrays are JSON-encoded: "[1, 2, 3]" or '["a", "b"]'
|
|
71
|
+
# - Objects/Hashes are JSON-encoded: '{"key": "value"}'
|
|
72
|
+
# - Binary data (BLOCK) is base64-encoded
|
|
73
|
+
# - Large integers (64-bit) are stored as DECIMAL
|
|
74
|
+
#
|
|
75
|
+
# @param value [Object] The value to decode
|
|
76
|
+
# @param data_type [String] COSMOS data type (INT, UINT, FLOAT, STRING, BLOCK, DERIVED, etc.)
|
|
77
|
+
# @param array_size [Integer, nil] If not nil, indicates this is an array item
|
|
78
|
+
# @return [Object] The decoded value
|
|
79
|
+
def self.decode_value(value, data_type: nil, array_size: nil)
|
|
80
|
+
# Handle BigDecimal values from QuestDB DECIMAL columns (used for 64-bit integers)
|
|
81
|
+
if value.is_a?(BigDecimal)
|
|
82
|
+
return value.to_i if data_type == 'INT' || data_type == 'UINT'
|
|
83
|
+
return value
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Decode float sentinel values back to inf/nan
|
|
87
|
+
return decode_float_special_values(value) if value.is_a?(Float)
|
|
88
|
+
|
|
89
|
+
# Non-strings don't need decoding (already handled by PG type mapping)
|
|
90
|
+
return value unless value.is_a?(String)
|
|
91
|
+
|
|
92
|
+
# Empty strings stay as empty strings
|
|
93
|
+
return value if value.empty?
|
|
94
|
+
|
|
95
|
+
# Handle based on data type if provided
|
|
96
|
+
if data_type == 'BLOCK'
|
|
97
|
+
begin
|
|
98
|
+
return Base64.strict_decode64(value)
|
|
99
|
+
rescue ArgumentError
|
|
100
|
+
return value
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Arrays are JSON-encoded
|
|
105
|
+
if array_size
|
|
106
|
+
begin
|
|
107
|
+
return JSON.parse(value, allow_nan: true, create_additions: true)
|
|
108
|
+
rescue JSON::ParserError
|
|
109
|
+
return value
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Integer values stored as strings (fallback path, normally DECIMAL)
|
|
114
|
+
if data_type == 'INT' || data_type == 'UINT'
|
|
115
|
+
begin
|
|
116
|
+
return Integer(value)
|
|
117
|
+
rescue ArgumentError
|
|
118
|
+
return value
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# DERIVED items with declared converted_type are stored as typed columns
|
|
123
|
+
# (float, int, etc.) and will be returned as non-strings, handled above.
|
|
124
|
+
# DERIVED items without declared type or with complex types (ARRAY, OBJECT, ANY)
|
|
125
|
+
# are stored as VARCHAR and JSON-encoded.
|
|
126
|
+
if data_type == 'DERIVED'
|
|
127
|
+
begin
|
|
128
|
+
return JSON.parse(value, allow_nan: true, create_additions: true)
|
|
129
|
+
rescue JSON::ParserError
|
|
130
|
+
# Could be a plain string from DERIVED with converted_type=STRING
|
|
131
|
+
return value
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# No data_type provided - fall back to heuristic decoding
|
|
136
|
+
if data_type.nil?
|
|
137
|
+
first_char = value[0]
|
|
138
|
+
# Try JSON for arrays/objects
|
|
139
|
+
if first_char == '[' || first_char == '{'
|
|
140
|
+
begin
|
|
141
|
+
return JSON.parse(value, allow_nan: true, create_additions: true)
|
|
142
|
+
rescue JSON::ParserError
|
|
143
|
+
# Not valid JSON
|
|
144
|
+
end
|
|
145
|
+
# Try integer conversion for numeric strings
|
|
146
|
+
elsif value =~ /\A-?\d+\z/
|
|
147
|
+
begin
|
|
148
|
+
return Integer(value)
|
|
149
|
+
rescue ArgumentError
|
|
150
|
+
# Not a valid integer
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Return as-is (STRING type or unknown)
|
|
156
|
+
value
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Sanitize a table name for QuestDB.
|
|
160
|
+
# See https://questdb.com/docs/reference/api/ilp/advanced-settings/#name-restrictions
|
|
161
|
+
#
|
|
162
|
+
# @param target_name [String] Target name
|
|
163
|
+
# @param packet_name [String] Packet name
|
|
164
|
+
# @param cmd_or_tlm [String, Symbol] "CMD" or "TLM" prefix (default "TLM")
|
|
165
|
+
# @param scope [String] Scope name (default "DEFAULT")
|
|
166
|
+
# @return [String] Sanitized table name
|
|
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(/[?,'"\\\/:\)\(\+\*\%~]/, '_')
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Sanitize a column name for QuestDB.
|
|
172
|
+
# See https://questdb.com/docs/reference/api/ilp/advanced-settings/#name-restrictions
|
|
173
|
+
#
|
|
174
|
+
# @param item_name [String] Item name
|
|
175
|
+
# @return [String] Sanitized column name
|
|
176
|
+
# ILP protocol special characters that must be sanitized in column names
|
|
177
|
+
def self.sanitize_column_name(item_name)
|
|
178
|
+
item_name.to_s.gsub(/[?\.,'"\\\/:\)\(\+=\-\*\%~;!@#\$\^&]/, '_')
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Convert a PG timestamp to UTC.
|
|
182
|
+
# PG driver returns timestamps as naive Time objects that need UTC treatment.
|
|
183
|
+
# QuestDB stores timestamps in UTC, but the PG driver applies local timezone.
|
|
184
|
+
#
|
|
185
|
+
# @param pg_time [Time] Timestamp from PG query result
|
|
186
|
+
# @return [Time] UTC timestamp
|
|
187
|
+
def self.pg_timestamp_to_utc(pg_time)
|
|
188
|
+
return nil unless pg_time
|
|
189
|
+
Time.utc(pg_time.year, pg_time.month, pg_time.day,
|
|
190
|
+
pg_time.hour, pg_time.min, pg_time.sec, pg_time.usec)
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# Format a UTC timestamp according to the specified format.
|
|
194
|
+
#
|
|
195
|
+
# @param utc_time [Time] UTC timestamp
|
|
196
|
+
# @param format [Symbol] :seconds for Unix seconds (float), :formatted for ISO 8601
|
|
197
|
+
# @return [Float, String, nil] Formatted timestamp or nil if utc_time is nil
|
|
198
|
+
def self.format_timestamp(utc_time, format)
|
|
199
|
+
return nil unless utc_time
|
|
200
|
+
case format
|
|
201
|
+
when :seconds
|
|
202
|
+
utc_time.to_f
|
|
203
|
+
when :formatted
|
|
204
|
+
utc_time.strftime('%Y-%m-%dT%H:%M:%S.%6NZ')
|
|
205
|
+
else
|
|
206
|
+
nil
|
|
207
|
+
end
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
end
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
# encoding: ascii-8bit
|
|
2
2
|
|
|
3
|
-
# Copyright
|
|
3
|
+
# Copyright 2026 OpenC3, Inc.
|
|
4
4
|
# All Rights Reserved.
|
|
5
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
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
#
|
|
16
11
|
# This file may also be used under the terms of a commercial license
|
|
17
12
|
# if purchased from OpenC3, Inc.
|