cosmos 4.1.1 → 4.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -2
- data/.travis.yml +2 -0
- data/.yardopts +1 -0
- data/Gemfile +1 -0
- data/Manifest.txt +130 -0
- data/autohotkey/tools/ConfigEditorAHK +19 -0
- data/autohotkey/tools/cmd_extractor.ahk +4 -4
- data/autohotkey/tools/cmd_sequence.ahk +9 -5
- data/autohotkey/tools/config_editor.ahk +197 -0
- data/autohotkey/tools/packet_viewer.ahk +12 -6
- data/autohotkey/tools/replay.ahk +29 -29
- data/autohotkey/tools/script_runner.ahk +10 -2
- data/autohotkey/tools/tlm_extractor.ahk +7 -8
- data/autohotkey/tools/tlm_grapher.ahk +21 -9
- data/bin/dart_import +2 -0
- data/cosmos.gemspec +18 -16
- data/data/config/cmd_tlm_server.yaml +9 -0
- data/data/config/interface_modifiers.yaml +17 -0
- data/data/config/item_modifiers.yaml +3 -3
- data/data/crc.txt +184 -90
- data/data/dart.png +0 -0
- data/demo/Gemfile +1 -0
- data/demo/Rakefile +4 -0
- data/demo/config/dart/Gemfile +54 -0
- data/demo/config/data/crc.txt +28 -21
- data/demo/config/system/system.txt +3 -0
- data/demo/config/system/system2.txt +3 -0
- data/demo/config/targets/INST/cmd_tlm/inst_cmds.txt +3 -3
- data/demo/config/targets/INST/cmd_tlm/inst_tlm.txt +1 -1
- data/demo/config/targets/INST/lib/sim_inst.rb +1 -1
- data/demo/config/targets/INST/screens/adcs.txt +2 -1
- data/demo/config/targets/INST/screens/array.txt +1 -1
- data/demo/config/targets/INST/screens/block.txt +1 -1
- data/demo/config/targets/INST/screens/commanding.txt +7 -2
- data/demo/config/targets/INST/screens/graphs.txt +1 -1
- data/demo/config/targets/INST/screens/ground.txt +1 -1
- data/demo/config/targets/INST/screens/hs.txt +2 -1
- data/demo/config/targets/INST/screens/latest.txt +1 -1
- data/demo/config/targets/INST/screens/limits.txt +1 -1
- data/demo/config/targets/INST/screens/other.txt +1 -1
- data/demo/config/targets/INST/screens/tabs.txt +1 -1
- data/demo/config/tools/cmd_tlm_server/cmd_tlm_server.txt +2 -2
- data/demo/config/tools/cmd_tlm_server/cmd_tlm_server2.txt +3 -1
- data/demo/config/tools/launcher/launcher.txt +3 -2
- data/demo/tools/Dart +16 -0
- data/demo/tools/Dart.bat +9 -0
- data/demo/tools/mac/CmdSequence.app/Contents/MacOS/main.sh +0 -0
- data/demo/tools/mac/ConfigEditor.app/Contents/MacOS/main.sh +0 -0
- data/install/Gemfile +1 -0
- data/install/Rakefile +4 -0
- data/install/config/dart/Gemfile +54 -0
- data/install/config/data/crc.txt +6 -3
- data/install/config/system/system.txt +3 -0
- data/install/config/tools/launcher/launcher.txt +3 -2
- data/install/tools/Dart +16 -0
- data/install/tools/Dart.bat +9 -0
- data/install/tools/mac/CmdSequence.app/Contents/MacOS/main.sh +0 -0
- data/install/tools/mac/ConfigEditor.app/Contents/MacOS/main.sh +0 -0
- data/lib/cosmos/core_ext/time.rb +8 -8
- data/lib/cosmos/dart/.rspec +1 -0
- data/lib/cosmos/dart/Gemfile +69 -0
- data/lib/cosmos/dart/Rakefile +7 -0
- data/lib/cosmos/dart/app/assets/config/manifest.js +4 -0
- data/lib/cosmos/dart/app/assets/images/.keep +0 -0
- data/lib/cosmos/dart/app/assets/javascripts/application.js +13 -0
- data/lib/cosmos/dart/app/assets/javascripts/cable.js +13 -0
- data/lib/cosmos/dart/app/assets/stylesheets/application.css.scss +15 -0
- data/lib/cosmos/dart/app/channels/application_cable/channel.rb +4 -0
- data/lib/cosmos/dart/app/channels/application_cable/connection.rb +4 -0
- data/lib/cosmos/dart/app/controllers/application_controller.rb +3 -0
- data/lib/cosmos/dart/app/helpers/application_helper.rb +2 -0
- data/lib/cosmos/dart/app/jobs/application_job.rb +2 -0
- data/lib/cosmos/dart/app/mailers/application_mailer.rb +4 -0
- data/lib/cosmos/dart/app/models/application_record.rb +3 -0
- data/lib/cosmos/dart/app/models/item.rb +6 -0
- data/lib/cosmos/dart/app/models/item_to_decom_table_mapping.rb +9 -0
- data/lib/cosmos/dart/app/models/packet.rb +4 -0
- data/lib/cosmos/dart/app/models/packet_config.rb +7 -0
- data/lib/cosmos/dart/app/models/packet_log.rb +3 -0
- data/lib/cosmos/dart/app/models/packet_log_entry.rb +41 -0
- data/lib/cosmos/dart/app/models/system_config.rb +2 -0
- data/lib/cosmos/dart/app/models/target.rb +4 -0
- data/lib/cosmos/dart/app/views/layouts/application.html.erb +14 -0
- data/lib/cosmos/dart/app/views/layouts/mailer.html.erb +13 -0
- data/lib/cosmos/dart/app/views/layouts/mailer.text.erb +1 -0
- data/lib/cosmos/dart/bin/bundle +3 -0
- data/lib/cosmos/dart/bin/rails +4 -0
- data/lib/cosmos/dart/bin/rake +4 -0
- data/lib/cosmos/dart/bin/setup +34 -0
- data/lib/cosmos/dart/bin/update +29 -0
- data/lib/cosmos/dart/config.ru +5 -0
- data/lib/cosmos/dart/config/application.rb +29 -0
- data/lib/cosmos/dart/config/boot.rb +3 -0
- data/lib/cosmos/dart/config/cable.yml +9 -0
- data/lib/cosmos/dart/config/database.yml +23 -0
- data/lib/cosmos/dart/config/environment.rb +5 -0
- data/lib/cosmos/dart/config/environments/development.rb +62 -0
- data/lib/cosmos/dart/config/environments/production.rb +84 -0
- data/lib/cosmos/dart/config/environments/test.rb +42 -0
- data/lib/cosmos/dart/config/initializers/application_controller_renderer.rb +6 -0
- data/lib/cosmos/dart/config/initializers/assets.rb +12 -0
- data/lib/cosmos/dart/config/initializers/backtrace_silencers.rb +7 -0
- data/lib/cosmos/dart/config/initializers/cookies_serializer.rb +5 -0
- data/lib/cosmos/dart/config/initializers/filter_parameter_logging.rb +4 -0
- data/lib/cosmos/dart/config/initializers/inflections.rb +16 -0
- data/lib/cosmos/dart/config/initializers/mime_types.rb +4 -0
- data/lib/cosmos/dart/config/initializers/new_framework_defaults.rb +25 -0
- data/lib/cosmos/dart/config/initializers/session_store.rb +3 -0
- data/lib/cosmos/dart/config/initializers/wrap_parameters.rb +14 -0
- data/lib/cosmos/dart/config/locales/en.yml +23 -0
- data/lib/cosmos/dart/config/puma.rb +47 -0
- data/lib/cosmos/dart/config/routes.rb +3 -0
- data/lib/cosmos/dart/config/secrets.yml +22 -0
- data/lib/cosmos/dart/db/migrate/20170406172907_create_targets.rb +8 -0
- data/lib/cosmos/dart/db/migrate/20170406172927_create_packets.rb +10 -0
- data/lib/cosmos/dart/db/migrate/20170406172937_create_packet_logs.rb +9 -0
- data/lib/cosmos/dart/db/migrate/20170406172943_create_packet_log_entries.rb +16 -0
- data/lib/cosmos/dart/db/migrate/20170406183500_change_packet_log_entries_primary_key.rb +5 -0
- data/lib/cosmos/dart/db/migrate/20170407153618_add_unique_requirements.rb +7 -0
- data/lib/cosmos/dart/db/migrate/20170511155447_add_meta_id_to_packet_log_entries.rb +6 -0
- data/lib/cosmos/dart/db/migrate/20170523185056_rename_received_time_and_add_is_tlm_to_packet_log_entries.rb +7 -0
- data/lib/cosmos/dart/db/migrate/20170525201157_create_items.rb +10 -0
- data/lib/cosmos/dart/db/migrate/20170525201315_create_system_configs.rb +9 -0
- data/lib/cosmos/dart/db/migrate/20170525201624_create_packet_configs.rb +11 -0
- data/lib/cosmos/dart/db/migrate/20170525201745_create_item_to_decom_table_mappings.rb +12 -0
- data/lib/cosmos/dart/db/migrate/20170525201939_create_decom_tables.rb +12 -0
- data/lib/cosmos/dart/db/migrate/20170525202051_add_decom_state_to_packet_log_entry.rb +5 -0
- data/lib/cosmos/dart/db/migrate/20170913160409_update_items.rb +6 -0
- data/lib/cosmos/dart/db/migrate/20170913160558_update_item_to_decom_table_mapping.rb +11 -0
- data/lib/cosmos/dart/db/migrate/20170913160916_udpate_decom_table.rb +6 -0
- data/lib/cosmos/dart/db/migrate/20170913212026_add_ready_to_packet_configs.rb +5 -0
- data/lib/cosmos/dart/db/migrate/20170913223556_modify_tables.rb +9 -0
- data/lib/cosmos/dart/db/migrate/20170914215744_modify_mapping_table.rb +6 -0
- data/lib/cosmos/dart/db/migrate/20170919201433_add_system_config_id_to_packet_config.rb +11 -0
- data/lib/cosmos/dart/db/migrate/20170919210307_add_max_table_index_to_packet_configs.rb +5 -0
- data/lib/cosmos/dart/db/migrate/20171215225546_add_ready_to_packet_log_entries.rb +5 -0
- data/lib/cosmos/dart/db/migrate/20180116214338_add_index_for_ple_ready_to_packet_log_entries.rb +5 -0
- data/lib/cosmos/dart/db/schema.rb +103 -0
- data/lib/cosmos/dart/db/seeds.rb +7 -0
- data/lib/cosmos/dart/examples/dart_decom_client.rb +45 -0
- data/lib/cosmos/dart/examples/dart_stream_client.rb +93 -0
- data/lib/cosmos/dart/lib/dart_common.rb +749 -0
- data/lib/cosmos/dart/lib/dart_database_cleaner.rb +172 -0
- data/lib/cosmos/dart/lib/dart_decom_query.rb +184 -0
- data/lib/cosmos/dart/lib/dart_decommutator.rb +235 -0
- data/lib/cosmos/dart/lib/dart_importer.rb +154 -0
- data/lib/cosmos/dart/lib/dart_logging.rb +50 -0
- data/lib/cosmos/dart/lib/dart_packet_log_writer.rb +139 -0
- data/lib/cosmos/dart/lib/dart_reducer_manager.rb +85 -0
- data/lib/cosmos/dart/lib/dart_reducer_worker_thread.rb +263 -0
- data/lib/cosmos/dart/lib/dart_tcpip_server_interface.rb +142 -0
- data/lib/cosmos/dart/processes/dart.rb +145 -0
- data/lib/cosmos/dart/processes/dart_decom_server.rb +39 -0
- data/lib/cosmos/dart/processes/dart_import.rb +63 -0
- data/lib/cosmos/dart/processes/dart_ingester.rb +92 -0
- data/lib/cosmos/dart/processes/dart_reducer.rb +27 -0
- data/lib/cosmos/dart/processes/dart_stream_server.rb +31 -0
- data/lib/cosmos/dart/processes/dart_worker.rb +37 -0
- data/lib/cosmos/dart/spec/dart/dart_common_spec.rb +333 -0
- data/lib/cosmos/dart/spec/dart/dart_database_cleaner_spec.rb +455 -0
- data/lib/cosmos/dart/spec/dart/dart_decom_query_spec.rb +153 -0
- data/lib/cosmos/dart/spec/dart/dart_decommutator_spec.rb +336 -0
- data/lib/cosmos/dart/spec/dart/dart_importer_spec.rb +83 -0
- data/lib/cosmos/dart/spec/dart/dart_logging_spec.rb +30 -0
- data/lib/cosmos/dart/spec/dart/dart_packet_log_writer_spec.rb +149 -0
- data/lib/cosmos/dart/spec/dart/dart_reducer_manager_spec.rb +289 -0
- data/lib/cosmos/dart/spec/dart/dart_tcpip_server_interface_spec.rb +241 -0
- data/lib/cosmos/dart/spec/rails_helper.rb +60 -0
- data/lib/cosmos/dart/spec/spec_helper.rb +139 -0
- data/lib/cosmos/gui/dialogs/about_dialog.rb +1 -1
- data/lib/cosmos/gui/dialogs/dart_dialog.rb +60 -0
- data/lib/cosmos/gui/dialogs/legal_dialog.rb +1 -0
- data/lib/cosmos/gui/dialogs/scroll_text_dialog.rb +0 -3
- data/lib/cosmos/gui/qt.rb +10 -1
- data/lib/cosmos/gui/text/completion.rb +10 -9
- data/lib/cosmos/gui/text/completion_text_edit.rb +16 -14
- data/lib/cosmos/gui/text/ruby_editor.rb +2 -2
- data/lib/cosmos/gui/widgets/dart_frame.rb +142 -0
- data/lib/cosmos/gui/widgets/dart_meta_frame.rb +119 -0
- data/lib/cosmos/gui/widgets/packet_log_frame.rb +42 -12
- data/lib/cosmos/interfaces/interface.rb +1 -2
- data/lib/cosmos/interfaces/protocols/crc_protocol.rb +26 -8
- data/lib/cosmos/interfaces/protocols/fixed_protocol.rb +8 -2
- data/lib/cosmos/interfaces/protocols/protocol.rb +2 -1
- data/lib/cosmos/interfaces/protocols/template_protocol.rb +1 -1
- data/lib/cosmos/interfaces/stream_interface.rb +1 -0
- data/lib/cosmos/interfaces/tcpip_server_interface.rb +2 -3
- data/lib/cosmos/io/json_drb_object.rb +1 -1
- data/lib/cosmos/io/json_rpc.rb +2 -1
- data/lib/cosmos/io/win32_serial_driver.rb +2 -9
- data/lib/cosmos/packet_logs/packet_log_writer.rb +1 -1
- data/lib/cosmos/packets/packet.rb +22 -12
- data/lib/cosmos/packets/packet_config.rb +2 -1
- data/lib/cosmos/packets/packet_item.rb +26 -24
- data/lib/cosmos/packets/parsers/macro_parser.rb +5 -2
- data/lib/cosmos/packets/parsers/packet_item_parser.rb +35 -17
- data/lib/cosmos/packets/parsers/packet_parser.rb +3 -10
- data/lib/cosmos/packets/parsers/xtce_converter.rb +21 -35
- data/lib/cosmos/packets/parsers/xtce_parser.rb +54 -46
- data/lib/cosmos/packets/structure.rb +10 -2
- data/lib/cosmos/packets/structure_item.rb +22 -8
- data/lib/cosmos/processors/statistics_processor.rb +2 -0
- data/lib/cosmos/script/api_shared.rb +13 -12
- data/lib/cosmos/script/cmd_tlm_server.rb +4 -0
- data/lib/cosmos/script/commands.rb +3 -15
- data/lib/cosmos/script/script.rb +69 -23
- data/lib/cosmos/streams/tcpip_client_stream.rb +2 -2
- data/lib/cosmos/system/system.rb +42 -25
- data/lib/cosmos/system/target.rb +6 -2
- data/lib/cosmos/tools/cmd_extractor/cmd_extractor.rb +177 -36
- data/lib/cosmos/tools/cmd_sender/cmd_param_table_item_delegate.rb +3 -2
- data/lib/cosmos/tools/cmd_sender/cmd_sender.rb +34 -8
- data/lib/cosmos/tools/cmd_sequence/cmd_sequence.rb +80 -25
- data/lib/cosmos/tools/cmd_tlm_server/api.rb +19 -4
- data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb +15 -14
- data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_gui.rb +15 -9
- data/lib/cosmos/tools/cmd_tlm_server/gui/interfaces_tab.rb +1 -9
- data/lib/cosmos/tools/cmd_tlm_server/gui/logging_tab.rb +1 -6
- data/lib/cosmos/tools/cmd_tlm_server/gui/packets_tab.rb +1 -3
- data/lib/cosmos/tools/cmd_tlm_server/gui/replay_tab.rb +84 -7
- data/lib/cosmos/tools/cmd_tlm_server/gui/status_tab.rb +0 -1
- data/lib/cosmos/tools/cmd_tlm_server/gui/targets_tab.rb +1 -5
- data/lib/cosmos/tools/cmd_tlm_server/limits_groups_background_task.rb +3 -2
- data/lib/cosmos/tools/cmd_tlm_server/replay_backend.rb +159 -27
- data/lib/cosmos/tools/cmd_tlm_server/routers.rb +1 -1
- data/lib/cosmos/tools/config_editor/config_editor.rb +17 -52
- data/lib/cosmos/tools/config_editor/config_editor_frame.rb +0 -5
- data/lib/cosmos/tools/data_viewer/data_viewer.rb +111 -0
- data/lib/cosmos/tools/limits_monitor/limits_monitor.rb +31 -18
- data/lib/cosmos/tools/packet_viewer/packet_viewer.rb +12 -3
- data/lib/cosmos/tools/script_runner/script_runner.rb +27 -14
- data/lib/cosmos/tools/script_runner/script_runner_frame.rb +104 -37
- data/lib/cosmos/tools/table_manager/table_config.rb +1 -1
- data/lib/cosmos/tools/table_manager/table_item_parser.rb +4 -2
- data/lib/cosmos/tools/table_manager/table_manager.rb +0 -5
- data/lib/cosmos/tools/table_manager/table_manager_core.rb +0 -1
- data/lib/cosmos/tools/test_runner/test.rb +1 -3
- data/lib/cosmos/tools/test_runner/test_runner.rb +26 -15
- data/lib/cosmos/tools/tlm_extractor/tlm_extractor.rb +290 -137
- data/lib/cosmos/tools/tlm_extractor/tlm_extractor_config.rb +122 -25
- data/lib/cosmos/tools/tlm_extractor/tlm_extractor_processor.rb +67 -0
- data/lib/cosmos/tools/tlm_grapher/data_object_editors/housekeeping_data_object_editor.rb +28 -0
- data/lib/cosmos/tools/tlm_grapher/data_object_editors/xy_data_object_editor.rb +36 -0
- data/lib/cosmos/tools/tlm_grapher/data_objects/data_object.rb +42 -3
- data/lib/cosmos/tools/tlm_grapher/data_objects/housekeeping_data_object.rb +88 -14
- data/lib/cosmos/tools/tlm_grapher/data_objects/linegraph_data_object.rb +2 -5
- data/lib/cosmos/tools/tlm_grapher/data_objects/singlexy_data_object.rb +2 -6
- data/lib/cosmos/tools/tlm_grapher/data_objects/xy_data_object.rb +74 -18
- data/lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_config.rb +3 -7
- data/lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_dart_thread.rb +159 -0
- data/lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_tool.rb +49 -2
- data/lib/cosmos/tools/tlm_viewer/screen.rb +3 -0
- data/lib/cosmos/tools/tlm_viewer/tlm_viewer_config.rb +0 -2
- data/lib/cosmos/tools/tlm_viewer/widgets.rb +1 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/backgroundbutton_widget.rb +54 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/button_widget.rb +5 -5
- data/lib/cosmos/top_level.rb +1 -0
- data/lib/cosmos/utilities/crc.rb +3 -0
- data/lib/cosmos/utilities/csv.rb +1 -0
- data/lib/cosmos/utilities/message_log.rb +2 -1
- data/lib/cosmos/utilities/simulated_target.rb +8 -8
- data/lib/cosmos/version.rb +5 -5
- data/lib/cosmos/win32/win32.rb +4 -10
- data/run_gui_tests.bat +2 -1
- data/spec/config/config_parser_spec.rb +4 -4
- data/spec/core_ext/array_spec.rb +1 -1
- data/spec/core_ext/exception_spec.rb +12 -12
- data/spec/core_ext/file_spec.rb +6 -6
- data/spec/core_ext/hash_spec.rb +1 -1
- data/spec/core_ext/socket_spec.rb +2 -2
- data/spec/core_ext/string_spec.rb +13 -13
- data/spec/core_ext/time_spec.rb +0 -2
- data/spec/gui/utilities/script_module_gui_spec.rb +3 -3
- data/spec/install/config/targets/INST/cmd_tlm/inst_tlm.txt +6 -6
- data/spec/install/config/tools/cmd_tlm_server/cmd_tlm_server.txt +4 -0
- data/spec/interfaces/cmd_tlm_server_interface_spec.rb +6 -2
- data/spec/interfaces/interface_spec.rb +0 -1
- data/spec/interfaces/linc_interface_spec.rb +0 -5
- data/spec/interfaces/protocols/crc_protocol_spec.rb +201 -85
- data/spec/interfaces/protocols/fixed_protocol_spec.rb +33 -9
- data/spec/interfaces/protocols/length_protocol_spec.rb +1 -1
- data/spec/interfaces/protocols/override_protocol_spec.rb +6 -2
- data/spec/interfaces/protocols/preidentified_protocol_spec.rb +1 -5
- data/spec/interfaces/protocols/template_protocol_spec.rb +0 -1
- data/spec/interfaces/simulated_target_interface_spec.rb +5 -5
- data/spec/interfaces/udp_interface_spec.rb +2 -4
- data/spec/io/buffered_file_spec.rb +8 -12
- data/spec/io/json_drb_spec.rb +9 -9
- data/spec/io/json_rpc_spec.rb +4 -4
- data/spec/io/raw_logger_spec.rb +4 -3
- data/spec/packet_logs/packet_log_reader_spec.rb +3 -6
- data/spec/packet_logs/packet_log_writer_spec.rb +4 -4
- data/spec/packets/binary_accessor_spec.rb +5 -8
- data/spec/packets/commands_spec.rb +2 -2
- data/spec/packets/limits_spec.rb +2 -2
- data/spec/packets/packet_config_spec.rb +12 -0
- data/spec/packets/packet_item_limits_spec.rb +1 -1
- data/spec/packets/packet_item_spec.rb +9 -9
- data/spec/packets/packet_spec.rb +15 -5
- data/spec/packets/parsers/packet_item_parser_spec.rb +27 -0
- data/spec/packets/parsers/xtce_parser_spec.rb +27 -30
- data/spec/packets/structure_spec.rb +2 -1
- data/spec/packets/telemetry_spec.rb +3 -5
- data/spec/processors/statistics_processor_spec.rb +35 -0
- data/spec/script/cmd_tlm_server_spec.rb +4 -21
- data/spec/script/commands_disconnect_spec.rb +46 -58
- data/spec/script/commands_spec.rb +40 -61
- data/spec/script/limits_spec.rb +1 -21
- data/spec/script/script_spec.rb +32 -41
- data/spec/script/scripting_spec.rb +166 -185
- data/spec/script/telemetry_spec.rb +10 -5
- data/spec/script/tools_spec.rb +2 -24
- data/spec/spec_helper.rb +11 -5
- data/spec/system/system_spec.rb +17 -12
- data/spec/tools/cmd_tlm_server/api_spec.rb +21 -10
- data/spec/tools/cmd_tlm_server/background_tasks_spec.rb +15 -16
- data/spec/tools/cmd_tlm_server/cmd_tlm_server_config_spec.rb +0 -1
- data/spec/tools/cmd_tlm_server/cmd_tlm_server_spec.rb +16 -27
- data/spec/tools/cmd_tlm_server/commanding_spec.rb +2 -6
- data/spec/tools/cmd_tlm_server/connections_spec.rb +0 -4
- data/spec/tools/cmd_tlm_server/interface_thread_spec.rb +13 -13
- data/spec/tools/cmd_tlm_server/interfaces_spec.rb +5 -9
- data/spec/tools/cmd_tlm_server/limits_groups_background_task_spec.rb +11 -3
- data/spec/tools/cmd_tlm_server/packet_logging_spec.rb +0 -4
- data/spec/tools/cmd_tlm_server/router_thread_spec.rb +5 -5
- data/spec/tools/cmd_tlm_server/routers_spec.rb +5 -9
- data/spec/tools/table_manager/table_config_spec.rb +0 -1
- data/spec/tools/table_manager/tablemanager_core_spec.rb +23 -23
- data/spec/tools/tlm_viewer/tlm_viewer_config_spec.rb +6 -4
- data/spec/top_level/top_level_spec.rb +9 -9
- data/spec/utilities/csv_spec.rb +2 -12
- data/spec/utilities/logger_spec.rb +6 -6
- data/spec/utilities/message_log_spec.rb +3 -11
- data/tasks/gemfile_stats.rake +2 -2
- metadata +198 -63
@@ -165,7 +165,7 @@ module Cosmos
|
|
165
165
|
# (see PacketConfig#start_item)
|
166
166
|
def start_item(parser)
|
167
167
|
finish_item()
|
168
|
-
@current_item = TableItemParser.parse(parser, @current_packet)
|
168
|
+
@current_item = TableItemParser.parse(parser, @current_packet, @warnings)
|
169
169
|
end
|
170
170
|
|
171
171
|
# If the table is TWO_DIMENSIONAL all currently defined items are
|
@@ -12,11 +12,13 @@ require 'cosmos/packets/packet_config'
|
|
12
12
|
require 'cosmos/packets/packet_item'
|
13
13
|
|
14
14
|
module Cosmos
|
15
|
+
# Extends the PacketItemParser to create TableItems for TableManager
|
15
16
|
class TableItemParser < PacketItemParser
|
16
17
|
# @param parser [ConfigParser] Configuration parser
|
17
18
|
# @param table [Table] Table all parsed items should be added to
|
18
|
-
|
19
|
-
|
19
|
+
# # @param warnings [Array<String>] Array of warning strings from PacketConfig
|
20
|
+
def self.parse(parser, table, warnings)
|
21
|
+
parser = TableItemParser.new(parser, warnings)
|
20
22
|
parser.verify_parameters(PacketConfig::COMMAND)
|
21
23
|
parser.create_table_item(table)
|
22
24
|
end
|
@@ -357,10 +357,6 @@ module Cosmos
|
|
357
357
|
@table_commit = Qt::Action.new(tr('Commit to Existing &File'), self)
|
358
358
|
@table_commit.statusTip = tr('Incorporate the current table data into a binary file which already contains the table')
|
359
359
|
@table_commit.connect(SIGNAL('triggered()')) { table_commit() }
|
360
|
-
|
361
|
-
#@table_update = Qt::Action.new(tr('&Update Definition'), self)
|
362
|
-
#@table_update.statusTip = tr('Change the defaults in the definition file to the displayed table data')
|
363
|
-
#@table_update.connect(SIGNAL('triggered()')) { table_update() }
|
364
360
|
end
|
365
361
|
end
|
366
362
|
|
@@ -392,7 +388,6 @@ module Cosmos
|
|
392
388
|
table_menu.addSeparator()
|
393
389
|
table_menu.addAction(@table_save)
|
394
390
|
table_menu.addAction(@table_commit)
|
395
|
-
#table_menu.addAction(@table_update)
|
396
391
|
end
|
397
392
|
|
398
393
|
# Help Menu
|
@@ -1122,23 +1122,37 @@ module Cosmos
|
|
1122
1122
|
|
1123
1123
|
# Build list of TestSuites and Tests
|
1124
1124
|
@@test_suites = @@test_suites.select {|my_suite| my_suite.name == 'CustomTestSuite'}
|
1125
|
-
tests
|
1125
|
+
tests = []
|
1126
1126
|
ObjectSpace.each_object(Class) do |object|
|
1127
|
+
|
1127
1128
|
begin
|
1128
1129
|
next if object.name == 'CustomTestSuite'
|
1129
|
-
|
1130
|
-
object != TestSuite &&
|
1131
|
-
!ignored_test_suite_classes.include?(object))
|
1132
|
-
@@test_suites << object.new
|
1133
|
-
end
|
1134
|
-
if (object.ancestors.include?(Test) &&
|
1135
|
-
object != Test &&
|
1136
|
-
!ignored_test_classes.include?(object))
|
1137
|
-
tests << object
|
1138
|
-
end
|
1130
|
+
ancestors = object.ancestors
|
1139
1131
|
rescue
|
1140
|
-
# Ignore Classes where name
|
1132
|
+
# Ignore Classes where name or ancestors may raise exception
|
1141
1133
|
# Bundler::Molinillo::DependencyGraph::Action is one example
|
1134
|
+
next
|
1135
|
+
end
|
1136
|
+
if (ancestors.include?(TestSuite) &&
|
1137
|
+
object != TestSuite &&
|
1138
|
+
!ignored_test_suite_classes.include?(object))
|
1139
|
+
# Ensure they didn't override name for some reason
|
1140
|
+
if object.instance_methods(false).include?(:name)
|
1141
|
+
raise FatalError.new("#{object} redefined the 'name' method. Delete the 'name' method and try again.")
|
1142
|
+
end
|
1143
|
+
# ObjectSpace.each_object appears to yield objects in the reverse
|
1144
|
+
# order that they were parsed by the interpreter so push each
|
1145
|
+
# TestSuite object to the front of the array to order as encountered
|
1146
|
+
@@test_suites.unshift(object.new)
|
1147
|
+
end
|
1148
|
+
if (ancestors.include?(Test) &&
|
1149
|
+
object != Test &&
|
1150
|
+
!ignored_test_classes.include?(object))
|
1151
|
+
# Ensure they didn't override self.name for some reason
|
1152
|
+
if object.methods(false).include?(:name)
|
1153
|
+
raise FatalError.new("#{object} redefined the 'self.name' method. Delete the 'self.name' method and try again.")
|
1154
|
+
end
|
1155
|
+
tests << object
|
1142
1156
|
end
|
1143
1157
|
end
|
1144
1158
|
# Raise error if no test suites or tests
|
@@ -1157,7 +1171,6 @@ module Cosmos
|
|
1157
1171
|
end
|
1158
1172
|
|
1159
1173
|
# Create TestSuite for unassigned Tests
|
1160
|
-
@@test_suites.sort!
|
1161
1174
|
@@test_suites.each do |test_suite|
|
1162
1175
|
tests_to_delete = []
|
1163
1176
|
tests.each { |test| tests_to_delete << test if test_suite.tests[test] }
|
@@ -1183,7 +1196,6 @@ module Cosmos
|
|
1183
1196
|
OpenStruct.new(:setup=>false, :teardown=>false, :cases=>[])
|
1184
1197
|
cur_suite.tests[test_class.name].cases.concat(test_class.test_cases)
|
1185
1198
|
cur_suite.tests[test_class.name].cases.uniq!
|
1186
|
-
cur_suite.tests[test_class.name].cases.sort!
|
1187
1199
|
cur_suite.tests[test_class.name].setup = true if test_class.method_defined?(:setup)
|
1188
1200
|
cur_suite.tests[test_class.name].teardown = true if test_class.method_defined?(:teardown)
|
1189
1201
|
when :TEST_CASE
|
@@ -1193,7 +1205,6 @@ module Cosmos
|
|
1193
1205
|
if test_class.method_defined?(test_case.intern)
|
1194
1206
|
cur_suite.tests[test_class.name].cases << test_case
|
1195
1207
|
cur_suite.tests[test_class.name].cases.uniq!
|
1196
|
-
cur_suite.tests[test_class.name].cases.sort!
|
1197
1208
|
else
|
1198
1209
|
raise "#{test_class} does not have a #{test_case} method defined."
|
1199
1210
|
end
|
@@ -17,6 +17,7 @@ Cosmos.catch_fatal_exception do
|
|
17
17
|
require 'cosmos/gui/choosers/float_chooser'
|
18
18
|
require 'cosmos/gui/dialogs/splash'
|
19
19
|
require 'cosmos/gui/widgets/packet_log_frame'
|
20
|
+
require 'cosmos/gui/widgets/dart_meta_frame'
|
20
21
|
require 'cosmos/gui/dialogs/progress_dialog'
|
21
22
|
require 'cosmos/gui/widgets/full_text_search_line_edit'
|
22
23
|
require 'cosmos/gui/utilities/analyze_log'
|
@@ -33,6 +34,8 @@ module Cosmos
|
|
33
34
|
slots 'context_menu(const QPoint&)'
|
34
35
|
|
35
36
|
FORMATTING_OPTIONS = %w(CONVERTED RAW FORMATTED WITH_UNITS)
|
37
|
+
DART_REDUCED_TYPE_OPTIONS = %w(AVG MIN MAX STDDEV)
|
38
|
+
DART_REDUCTION_OPTIONS = %w(NONE MINUTE HOUR DAY)
|
36
39
|
|
37
40
|
class MyListWidget < Qt::ListWidget
|
38
41
|
signals 'enterKeyPressed(int)'
|
@@ -232,6 +235,9 @@ module Cosmos
|
|
232
235
|
end
|
233
236
|
|
234
237
|
def initialize_central_widget
|
238
|
+
@resize_timer = Qt::Timer.new
|
239
|
+
@resize_timer.connect(SIGNAL('timeout()')) { self.resize(self.width, self.minimumHeight) }
|
240
|
+
|
235
241
|
# Create the central widget
|
236
242
|
@central_widget = Qt::Widget.new
|
237
243
|
setCentralWidget(@central_widget)
|
@@ -390,20 +396,43 @@ module Cosmos
|
|
390
396
|
|
391
397
|
@batch_config_box.hide
|
392
398
|
|
393
|
-
|
394
|
-
@
|
395
|
-
|
396
|
-
@
|
399
|
+
# Data Source Selection
|
400
|
+
@data_source_layout = Qt::HBoxLayout.new()
|
401
|
+
label = Qt::Label.new("Data Source: ")
|
402
|
+
@data_source_layout.addWidget(label)
|
403
|
+
@log_file_radio = Qt::RadioButton.new("Log File", self)
|
404
|
+
@log_file_radio.setChecked(true)
|
405
|
+
@log_file_radio.connect(SIGNAL('clicked()')) do
|
406
|
+
@packet_log_frame.show_log_fields(true)
|
407
|
+
@packet_log_frame.output_filename = ""
|
408
|
+
@dart_meta_frame.hide
|
409
|
+
@resize_timer.start(100)
|
410
|
+
end
|
411
|
+
@data_source_layout.addWidget(@log_file_radio)
|
412
|
+
@dart_radio = Qt::RadioButton.new("DART Database", self)
|
413
|
+
@dart_radio.connect(SIGNAL('clicked()')) do
|
414
|
+
@packet_log_frame.show_log_fields(false)
|
415
|
+
@packet_log_frame.output_filename = ""
|
416
|
+
@dart_meta_frame.show
|
417
|
+
@resize_timer.start(100)
|
418
|
+
end
|
419
|
+
@data_source_layout.addWidget(@dart_radio)
|
420
|
+
@data_source_layout.addStretch()
|
421
|
+
@top_layout.addLayout(@data_source_layout)
|
397
422
|
|
398
423
|
# Packet Log Frame
|
399
424
|
@packet_log_frame = PacketLogFrame.new(self, @log_dir, System.default_packet_log_reader.new(*System.default_packet_log_reader_params), @input_filenames, nil, true, true, true, Cosmos::TLM_FILE_PATTERN, Cosmos::TXT_FILE_PATTERN)
|
400
425
|
@packet_log_frame.change_callback = method(:change_callback)
|
401
|
-
@
|
426
|
+
@top_layout.addWidget(@packet_log_frame)
|
427
|
+
|
428
|
+
@dart_meta_frame = DartMetaFrame.new(self)
|
429
|
+
@dart_meta_frame.hide
|
430
|
+
@top_layout.addWidget(@dart_meta_frame)
|
402
431
|
|
403
432
|
# Process and Open Buttons
|
404
433
|
@button_layout = Qt::HBoxLayout.new
|
405
|
-
@process_button = Qt::PushButton.new('&Process
|
406
|
-
@process_button.connect(SIGNAL('clicked()')) {
|
434
|
+
@process_button = Qt::PushButton.new('&Process')
|
435
|
+
@process_button.connect(SIGNAL('clicked()')) { process() }
|
407
436
|
@button_layout.addWidget(@process_button)
|
408
437
|
|
409
438
|
@open_button = Qt::PushButton.new('&Open in Text Editor')
|
@@ -423,7 +452,7 @@ module Cosmos
|
|
423
452
|
end # def initialize
|
424
453
|
|
425
454
|
def self.post_options_parsed_hook(options)
|
426
|
-
if options.input_files
|
455
|
+
if options.input_files or options.dart
|
427
456
|
# Process config file
|
428
457
|
raise "Configuration File must be specified for command line processing" unless options.config_file
|
429
458
|
|
@@ -431,19 +460,27 @@ module Cosmos
|
|
431
460
|
tlm_extractor_config = TlmExtractorConfig.new(options.config_file)
|
432
461
|
tlm_extractor_processor = TlmExtractorProcessor.new
|
433
462
|
unless options.output_file
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
463
|
+
if options.input_files
|
464
|
+
filename = options.input_files[0]
|
465
|
+
extension = File.extname(filename)
|
466
|
+
filename_no_extension = filename[0..-(extension.length + 1)]
|
467
|
+
if tlm_extractor_config.delimiter.to_s.strip == ','
|
468
|
+
filename = filename_no_extension << '.csv'
|
469
|
+
else
|
470
|
+
filename = filename_no_extension << '.txt'
|
471
|
+
end
|
472
|
+
options.output_file = File.join(System.paths['LOGS'], File.basename(filename))
|
439
473
|
else
|
440
|
-
|
474
|
+
options.output_file = File.join(System.paths['LOGS'], File.build_timestamped_filename(['tlmextractor']))
|
441
475
|
end
|
442
|
-
options.output_file = File.join(System.paths['LOGS'], File.basename(filename))
|
443
476
|
end
|
444
477
|
|
445
478
|
tlm_extractor_config.output_filename = options.output_file
|
446
|
-
|
479
|
+
if options.dart
|
480
|
+
tlm_extractor_processor.process_dart([tlm_extractor_config])
|
481
|
+
else
|
482
|
+
tlm_extractor_processor.process(options.input_files, [tlm_extractor_config])
|
483
|
+
end
|
447
484
|
puts "Created #{options.output_file}"
|
448
485
|
return false
|
449
486
|
else
|
@@ -461,6 +498,7 @@ module Cosmos
|
|
461
498
|
options.auto_size = false
|
462
499
|
options.restore_size = false # always render this the correct size
|
463
500
|
options.title = "Telemetry Extractor"
|
501
|
+
options.dart = false
|
464
502
|
option_parser.separator "Telemetry Extractor Specific Options:"
|
465
503
|
option_parser.on("-c", "--config FILE", "Use the specified configuration file") do |arg|
|
466
504
|
options.config_file = File.join(Cosmos::USERPATH, 'config', 'tools', 'tlm_extractor', arg)
|
@@ -476,6 +514,9 @@ module Cosmos
|
|
476
514
|
option_parser.on("-o", "--output FILE", "Output results to the specified file") do |arg|
|
477
515
|
options.output_file = arg
|
478
516
|
end
|
517
|
+
option_parser.on("--dart", "Query Dart instead of files") do |arg|
|
518
|
+
options.dart = true
|
519
|
+
end
|
479
520
|
end
|
480
521
|
|
481
522
|
super(option_parser, options)
|
@@ -519,13 +560,25 @@ module Cosmos
|
|
519
560
|
packet_name_or_text = split_item[2]
|
520
561
|
item_name = split_item[3]
|
521
562
|
value_type = split_item[4]
|
563
|
+
dart_reduction = split_item[5]
|
564
|
+
dart_reduced_type = split_item[6]
|
522
565
|
if value_type
|
523
566
|
value_type = value_type.upcase.intern
|
524
567
|
else
|
525
568
|
value_type = :CONVERTED
|
526
569
|
end
|
570
|
+
if dart_reduction
|
571
|
+
dart_reduction = dart_reduction.upcase.intern
|
572
|
+
else
|
573
|
+
dart_reduction = :NONE
|
574
|
+
end
|
575
|
+
if dart_reduced_type
|
576
|
+
dart_reduced_type = dart_reduced_type.upcase.intern
|
577
|
+
else
|
578
|
+
dart_reduced_type = :AVG
|
579
|
+
end
|
527
580
|
if item_type == 'ITEM'
|
528
|
-
@tlm_extractor_config.add_item(target_name_or_column_name, packet_name_or_text, item_name, value_type)
|
581
|
+
@tlm_extractor_config.add_item(target_name_or_column_name, packet_name_or_text, item_name, value_type, dart_reduction, dart_reduced_type)
|
529
582
|
else
|
530
583
|
@tlm_extractor_config.add_text(target_name_or_column_name.remove_quotes, packet_name_or_text.remove_quotes)
|
531
584
|
end
|
@@ -554,12 +607,16 @@ module Cosmos
|
|
554
607
|
@downsample_entry.value = @tlm_extractor_config.downsample_seconds
|
555
608
|
|
556
609
|
clear_config_item_list()
|
557
|
-
@tlm_extractor_config.items.each do |item_type, target_name_or_column_name, packet_name_or_text, item_name, value_type|
|
610
|
+
@tlm_extractor_config.items.each do |item_type, target_name_or_column_name, packet_name_or_text, item_name, value_type, dart_reduction, dart_reduced_type|
|
558
611
|
if item_type == 'ITEM'
|
559
|
-
if
|
560
|
-
|
612
|
+
if dart_reduction == :NONE
|
613
|
+
if value_type == :CONVERTED
|
614
|
+
@config_item_list.addItem("#{item_type} #{target_name_or_column_name} #{packet_name_or_text} #{item_name}")
|
615
|
+
else
|
616
|
+
@config_item_list.addItem("#{item_type} #{target_name_or_column_name} #{packet_name_or_text} #{item_name} #{value_type}")
|
617
|
+
end
|
561
618
|
else
|
562
|
-
@config_item_list.addItem("#{item_type} #{target_name_or_column_name} #{packet_name_or_text} #{item_name} #{value_type}")
|
619
|
+
@config_item_list.addItem("#{item_type} #{target_name_or_column_name} #{packet_name_or_text} #{item_name} #{value_type} #{dart_reduction} #{dart_reduced_type}")
|
563
620
|
end
|
564
621
|
else
|
565
622
|
@config_item_list.addItem("#{item_type} \"#{target_name_or_column_name}\" \"#{packet_name_or_text}\"")
|
@@ -576,100 +633,160 @@ module Cosmos
|
|
576
633
|
end
|
577
634
|
|
578
635
|
# Handles processing log files
|
579
|
-
def
|
636
|
+
def process
|
580
637
|
@cancel = false
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
638
|
+
if @log_file_radio.isChecked
|
639
|
+
begin
|
640
|
+
@tlm_extractor_processor.packet_log_reader = @packet_log_frame.packet_log_reader
|
641
|
+
@input_filenames = @packet_log_frame.filenames.sort
|
642
|
+
@batch_filenames = []
|
643
|
+
output_extension = '.txt'
|
644
|
+
batch_name = nil
|
645
|
+
if @batch_mode_check.checked?
|
646
|
+
batch_name = @batch_name_entry.text
|
647
|
+
@batch_filenames_entry.each {|list_item| @batch_filenames << list_item.text}
|
648
|
+
if @packet_log_frame.output_filename_filter == Cosmos::CSV_FILE_PATTERN
|
649
|
+
output_extension = '.csv'
|
650
|
+
else
|
651
|
+
output_extension = '.txt'
|
652
|
+
end
|
594
653
|
end
|
595
|
-
|
596
|
-
return unless pre_process_tests()
|
597
|
-
|
598
|
-
# Configure Tlm Extractor Config
|
599
|
-
sync_gui_to_config()
|
654
|
+
return unless pre_process_tests()
|
600
655
|
|
601
|
-
|
602
|
-
|
603
|
-
progress_dialog.cancel_callback = method(:cancel_callback)
|
604
|
-
progress_dialog.enable_cancel_button
|
656
|
+
# Configure Tlm Extractor Config
|
657
|
+
sync_gui_to_config()
|
605
658
|
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
659
|
+
start_time = Time.now.sys
|
660
|
+
ProgressDialog.execute(self, 'Log File Progress', 600, 300) do |progress_dialog|
|
661
|
+
progress_dialog.cancel_callback = method(:cancel_callback)
|
662
|
+
progress_dialog.enable_cancel_button
|
663
|
+
|
664
|
+
begin
|
665
|
+
current_input_file_index = -1
|
666
|
+
current_config_file_index = -1
|
667
|
+
start_packet_count = -1
|
668
|
+
last_packet_count = -1
|
669
|
+
|
670
|
+
if @batch_filenames.empty?
|
671
|
+
process_method = :process
|
672
|
+
process_args = [@input_filenames, [@tlm_extractor_config], @packet_log_frame.time_start, @packet_log_frame.time_end]
|
673
|
+
else
|
674
|
+
process_method = :process_batch
|
675
|
+
process_args = [batch_name, @input_filenames, @log_dir, output_extension, @batch_filenames, @packet_log_frame.time_start, @packet_log_frame.time_end]
|
676
|
+
end
|
619
677
|
|
620
|
-
|
621
|
-
|
622
|
-
|
678
|
+
@tlm_extractor_processor.send(process_method, *process_args) do |input_file_index, packet_count, file_progress|
|
679
|
+
# Handle Cancel
|
680
|
+
break if @cancel
|
623
681
|
|
624
|
-
|
625
|
-
|
626
|
-
|
682
|
+
# Handle Input File Change
|
683
|
+
if input_file_index != current_input_file_index
|
684
|
+
current_input_file_index = input_file_index
|
627
685
|
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
686
|
+
if start_packet_count >= 0
|
687
|
+
# Make sure some packets were found in the previous file
|
688
|
+
if packet_count == start_packet_count
|
689
|
+
# No packets found in previous file
|
690
|
+
progress_dialog.append_text(" WARNING: No packets processed in #{File.basename(@input_filenames[input_file_index - 1])}")
|
691
|
+
end
|
633
692
|
end
|
693
|
+
start_packet_count = packet_count
|
694
|
+
|
695
|
+
progress_dialog.append_text("Processing File #{input_file_index + 1}/#{@input_filenames.length}: #{File.basename(@input_filenames[input_file_index])}")
|
696
|
+
progress_dialog.set_step_progress(0.0)
|
697
|
+
progress_dialog.set_overall_progress((input_file_index).to_f / @input_filenames.length.to_f)
|
634
698
|
end
|
635
|
-
start_packet_count = packet_count
|
636
699
|
|
637
|
-
|
638
|
-
|
639
|
-
progress_dialog.set_overall_progress((input_file_index).to_f / @input_filenames.length.to_f)
|
640
|
-
end
|
700
|
+
# Save packet_count
|
701
|
+
last_packet_count = packet_count
|
641
702
|
|
642
|
-
|
643
|
-
|
703
|
+
# Handle Progress Reporting
|
704
|
+
progress_dialog.set_step_progress(file_progress)
|
705
|
+
end
|
706
|
+
# Make sure some packets were found in the previous file
|
707
|
+
if start_packet_count == last_packet_count
|
708
|
+
# No packets found in previous file
|
709
|
+
progress_dialog.append_text(" WARNING: No packets processed in #{File.basename(@input_filenames[-1])}")
|
710
|
+
end
|
644
711
|
|
645
|
-
|
646
|
-
progress_dialog.
|
712
|
+
rescue => error
|
713
|
+
progress_dialog.append_text("Error processing:\n#{error.formatted}\n")
|
714
|
+
ensure
|
715
|
+
progress_dialog.set_step_progress(1.0) if !@cancel
|
716
|
+
progress_dialog.set_overall_progress(1.0) if !@cancel
|
717
|
+
progress_dialog.append_text("Runtime: #{Time.now.sys - start_time} s")
|
718
|
+
progress_dialog.complete
|
719
|
+
if @batch_filenames.empty?
|
720
|
+
Qt.execute_in_main_thread(true) do
|
721
|
+
@open_button.setEnabled(true)
|
722
|
+
@open_excel_button.setEnabled(true) if Kernel.is_windows?
|
723
|
+
end
|
724
|
+
end
|
647
725
|
end
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
726
|
+
end # ProgressDialog.execute
|
727
|
+
rescue => error
|
728
|
+
Qt::MessageBox.critical(self, 'Error!', "Error Processing Log File(s)\n#{error.formatted}")
|
729
|
+
end
|
730
|
+
else
|
731
|
+
begin
|
732
|
+
@batch_filenames = []
|
733
|
+
output_extension = '.txt'
|
734
|
+
batch_name = nil
|
735
|
+
if @batch_mode_check.checked?
|
736
|
+
batch_name = @batch_name_entry.text
|
737
|
+
@batch_filenames_entry.each {|list_item| @batch_filenames << list_item.text}
|
738
|
+
if @packet_log_frame.output_filename_filter == Cosmos::CSV_FILE_PATTERN
|
739
|
+
output_extension = '.csv'
|
740
|
+
else
|
741
|
+
output_extension = '.txt'
|
652
742
|
end
|
743
|
+
end
|
744
|
+
return unless pre_process_tests()
|
653
745
|
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
progress_dialog.
|
660
|
-
progress_dialog.
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
746
|
+
# Configure Tlm Extractor Config
|
747
|
+
sync_gui_to_config()
|
748
|
+
|
749
|
+
start_time = Time.now.sys
|
750
|
+
ProgressDialog.execute(self, 'DART Query Progress', 600, 300) do |progress_dialog|
|
751
|
+
progress_dialog.cancel_callback = method(:cancel_callback)
|
752
|
+
progress_dialog.enable_cancel_button
|
753
|
+
|
754
|
+
begin
|
755
|
+
if @batch_filenames.empty?
|
756
|
+
process_method = :process_dart
|
757
|
+
process_args = [[@tlm_extractor_config], @packet_log_frame.time_start, @packet_log_frame.time_end, @dart_meta_frame.meta_filters]
|
758
|
+
else
|
759
|
+
process_method = :process_dart_batch
|
760
|
+
process_args = [batch_name, @log_dir, output_extension, @batch_filenames, @packet_log_frame.time_start, @packet_log_frame.time_end, @dart_meta_frame.meta_filters]
|
761
|
+
end
|
762
|
+
|
763
|
+
@tlm_extractor_processor.send(process_method, *process_args) do |percentage, message|
|
764
|
+
# Handle Cancel
|
765
|
+
break if @cancel
|
766
|
+
progress_dialog.append_text(message)
|
767
|
+
progress_dialog.set_overall_progress(percentage)
|
768
|
+
end
|
769
|
+
|
770
|
+
rescue => error
|
771
|
+
progress_dialog.append_text("Error processing:\n#{error.formatted}\n")
|
772
|
+
ensure
|
773
|
+
progress_dialog.set_step_progress(1.0) if !@cancel
|
774
|
+
progress_dialog.set_overall_progress(1.0) if !@cancel
|
775
|
+
progress_dialog.append_text("Runtime: #{Time.now.sys - start_time} s")
|
776
|
+
progress_dialog.complete
|
777
|
+
if @batch_filenames.empty?
|
778
|
+
Qt.execute_in_main_thread(true) do
|
779
|
+
@open_button.setEnabled(true)
|
780
|
+
@open_excel_button.setEnabled(true) if Kernel.is_windows?
|
781
|
+
end
|
665
782
|
end
|
666
783
|
end
|
667
|
-
end
|
668
|
-
|
669
|
-
|
670
|
-
|
784
|
+
end # ProgressDialog.execute
|
785
|
+
rescue => error
|
786
|
+
Qt::MessageBox.critical(self, 'Error!', "Error Querying DART\n#{error.formatted}")
|
787
|
+
end
|
671
788
|
end
|
672
|
-
end # def
|
789
|
+
end # def process
|
673
790
|
|
674
791
|
# Handles options dialog
|
675
792
|
def handle_options
|
@@ -850,6 +967,32 @@ module Cosmos
|
|
850
967
|
end
|
851
968
|
layout.addWidget(box)
|
852
969
|
|
970
|
+
label = Qt::Label.new('DART Reduction:')
|
971
|
+
layout.addWidget(label)
|
972
|
+
|
973
|
+
dart_reduction_box = Qt::ComboBox.new
|
974
|
+
dart_reduction_box.maxCount = DART_REDUCTION_OPTIONS.length
|
975
|
+
DART_REDUCTION_OPTIONS.each {|item| dart_reduction_box.addItem(item) }
|
976
|
+
current_reduction = split_item[5]
|
977
|
+
current_reduction = 'NONE' unless current_reduction
|
978
|
+
if DART_REDUCTION_OPTIONS.index(current_reduction)
|
979
|
+
dart_reduction_box.currentIndex = DART_REDUCTION_OPTIONS.index(current_reduction)
|
980
|
+
end
|
981
|
+
layout.addWidget(dart_reduction_box)
|
982
|
+
|
983
|
+
label = Qt::Label.new('DART Reduced Type:')
|
984
|
+
layout.addWidget(label)
|
985
|
+
|
986
|
+
dart_reduction_type_box = Qt::ComboBox.new
|
987
|
+
dart_reduction_type_box.maxCount = DART_REDUCED_TYPE_OPTIONS.length
|
988
|
+
DART_REDUCED_TYPE_OPTIONS.each {|item| dart_reduction_type_box.addItem(item) }
|
989
|
+
current_dart_type = split_item[6]
|
990
|
+
current_dart_type = 'AVG' unless current_dart_type
|
991
|
+
if DART_REDUCED_TYPE_OPTIONS.index(current_dart_type)
|
992
|
+
dart_reduction_type_box.currentIndex = DART_REDUCED_TYPE_OPTIONS.index(current_dart_type)
|
993
|
+
end
|
994
|
+
layout.addWidget(dart_reduction_type_box)
|
995
|
+
|
853
996
|
check_box = nil
|
854
997
|
if selected_items.length > 1 and item_index == selected_items[0]
|
855
998
|
check_box = Qt::CheckBox.new('Apply to All?')
|
@@ -876,11 +1019,15 @@ module Cosmos
|
|
876
1019
|
set_indexes.each do |set_item_index|
|
877
1020
|
split_item = @config_item_list.item(set_item_index).text.scan ConfigParser::PARSING_REGEX
|
878
1021
|
if split_item[0] == 'ITEM'
|
879
|
-
# Remove any formatting from the item by only keeping the first four strings
|
1022
|
+
# Remove any formatting/dart info from the item by only keeping the first four strings
|
880
1023
|
@config_item_list.item(set_item_index).text = split_item[0..3].join(' ')
|
881
1024
|
|
882
|
-
if
|
883
|
-
|
1025
|
+
if dart_reduction_box.currentIndex == 0
|
1026
|
+
if box.currentIndex != 0
|
1027
|
+
@config_item_list.item(set_item_index).text = "#{@config_item_list.item(set_item_index).text} #{FORMATTING_OPTIONS[box.currentIndex]}"
|
1028
|
+
end
|
1029
|
+
else
|
1030
|
+
@config_item_list.item(set_item_index).text = "#{@config_item_list.item(set_item_index).text} #{FORMATTING_OPTIONS[box.currentIndex]} #{DART_REDUCTION_OPTIONS[dart_reduction_box.currentIndex]} #{DART_REDUCED_TYPE_OPTIONS[dart_reduction_type_box.currentIndex]}"
|
884
1031
|
end
|
885
1032
|
end
|
886
1033
|
end
|
@@ -1047,9 +1194,13 @@ module Cosmos
|
|
1047
1194
|
return false
|
1048
1195
|
end
|
1049
1196
|
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1197
|
+
if @packet_log_frame.output_filename.to_s.empty?
|
1198
|
+
if @log_file_radio.isChecked
|
1199
|
+
Qt::MessageBox.critical(self, 'Error', 'No Output File Selected')
|
1200
|
+
return false
|
1201
|
+
else
|
1202
|
+
@packet_log_frame.output_filename = File.join(System.paths['LOGS'], File.build_timestamped_filename(['tlm_extractor', 'dart']))
|
1203
|
+
end
|
1053
1204
|
end
|
1054
1205
|
|
1055
1206
|
if File.exist?(@packet_log_frame.output_filename)
|
@@ -1070,43 +1221,45 @@ module Cosmos
|
|
1070
1221
|
end
|
1071
1222
|
end
|
1072
1223
|
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
# Validate configurations exist for input filenames
|
1079
|
-
@input_filenames.each do |input_filename|
|
1080
|
-
Cosmos.check_log_configuration(@tlm_extractor_processor.packet_log_reader, input_filename)
|
1081
|
-
end
|
1082
|
-
|
1083
|
-
#Validate config information
|
1084
|
-
@tlm_extractor_processor.packet_log_reader.open(@input_filenames[0])
|
1085
|
-
@tlm_extractor_processor.packet_log_reader.close
|
1224
|
+
if @log_file_radio.isChecked
|
1225
|
+
unless @input_filenames and @input_filenames[0]
|
1226
|
+
Qt::MessageBox.critical(self, 'Error', 'Please select at least 1 input file')
|
1227
|
+
return false
|
1228
|
+
end
|
1086
1229
|
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
packet_name = split_item[2]
|
1092
|
-
item_name = split_item[3]
|
1230
|
+
# Validate configurations exist for input filenames
|
1231
|
+
@input_filenames.each do |input_filename|
|
1232
|
+
Cosmos.check_log_configuration(@tlm_extractor_processor.packet_log_reader, input_filename)
|
1233
|
+
end
|
1093
1234
|
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1235
|
+
#Validate config information
|
1236
|
+
@tlm_extractor_processor.packet_log_reader.open(@input_filenames[0])
|
1237
|
+
@tlm_extractor_processor.packet_log_reader.close
|
1238
|
+
|
1239
|
+
@config_item_list.each do |item|
|
1240
|
+
split_item = item.text.split
|
1241
|
+
item_type = split_item[0]
|
1242
|
+
target_name = split_item[1]
|
1243
|
+
packet_name = split_item[2]
|
1244
|
+
item_name = split_item[3]
|
1245
|
+
|
1246
|
+
if item_type == 'ITEM'
|
1247
|
+
# Verify Packet
|
1248
|
+
packet = nil
|
1249
|
+
begin
|
1250
|
+
packet = System.telemetry.packet(target_name, packet_name)
|
1251
|
+
rescue
|
1252
|
+
Qt::MessageBox.critical(self, 'Error!', "Unknown Packet #{target_name} #{packet_name} specified")
|
1253
|
+
return false
|
1254
|
+
end
|
1103
1255
|
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1256
|
+
# Verify Item
|
1257
|
+
begin
|
1258
|
+
packet.get_item(item_name)
|
1259
|
+
rescue
|
1260
|
+
Qt::MessageBox.critical(self, 'Error!', "Item #{item_name} not present in packet")
|
1261
|
+
return false
|
1262
|
+
end
|
1110
1263
|
end
|
1111
1264
|
end
|
1112
1265
|
end
|