cosmos 3.9.2 → 4.0.0
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/.rubocop.yml +23 -0
- data/.travis.yml +1 -0
- data/.yardopts +3 -0
- data/Gemfile +1 -1
- data/Manifest.txt +137 -52
- data/Rakefile +50 -44
- data/autohotkey/config/system/system.txt +0 -5
- data/autohotkey/config/targets/INST/cmd_tlm/inst_cmds.txt +6 -1
- data/autohotkey/config/targets/INST/screens/extra.txt +19 -0
- data/autohotkey/config/targets/INST/sequences/run_sequence.txt +1 -0
- data/autohotkey/config/targets/META/screens/data.txt +12 -0
- data/autohotkey/config/targets/SYSTEM/cmd_tlm/meta_cmd_tlm.txt +16 -0
- data/autohotkey/config/targets/{COSMOS/cmd_tlm/cosmos_server_cmds.txt → SYSTEM/cmd_tlm/system_cmds.txt} +8 -8
- data/autohotkey/config/targets/SYSTEM/cmd_tlm/system_tlm.txt +7 -0
- data/autohotkey/config/targets/SYSTEM/screens/limits_change.txt +14 -0
- data/autohotkey/config/targets/SYSTEM/screens/meta.txt +14 -0
- data/autohotkey/config/targets/SYSTEM/target.txt +12 -0
- data/autohotkey/config/tools/cmd_tlm_server/cmd_tlm_server.txt +2 -2
- data/autohotkey/config/tools/test_runner/test_runner2.txt +1 -1
- data/autohotkey/tools/CmdSequence +14 -0
- data/autohotkey/tools/CmdSequenceAHK +23 -0
- data/autohotkey/tools/CmdSequenceAHK2 +16 -0
- data/autohotkey/tools/cmd_extractor.ahk +2 -2
- data/autohotkey/tools/cmd_sender.ahk +4 -6
- data/autohotkey/tools/cmd_sequence.ahk +215 -0
- data/autohotkey/tools/cmd_sequence2.ahk +23 -0
- data/autohotkey/tools/data_viewer.ahk +2 -3
- data/autohotkey/tools/limits_monitor.ahk +9 -11
- data/autohotkey/tools/open_gl_builder.ahk +1 -2
- data/autohotkey/tools/packet_viewer.ahk +51 -35
- data/autohotkey/tools/replay.ahk +1 -2
- data/autohotkey/tools/script_runner.ahk +1 -2
- data/autohotkey/tools/script_runner2.ahk +1 -2
- data/autohotkey/tools/test_runner2.ahk +1 -5
- data/autohotkey/tools/test_runner3.ahk +1 -3
- data/autohotkey/tools/tlm_grapher.ahk +1 -3
- data/autohotkey/tools/tlm_grapher3.ahk +1 -2
- data/autohotkey/tools/tlm_viewer.ahk +8 -3
- data/autohotkey/tools/tlm_viewer2.ahk +2 -3
- data/autohotkey/tools/tlm_viewer5.ahk +1 -2
- data/cosmos.gemspec +26 -20
- data/data/cmd_sequence.png +0 -0
- data/data/config/_array_params.yaml +23 -0
- data/data/config/_id_items.yaml +24 -0
- data/data/config/_id_params.yaml +58 -0
- data/data/config/_interfaces.yaml +206 -0
- data/data/config/_items.yaml +20 -0
- data/data/config/_params.yaml +58 -0
- data/data/config/cmd_tlm_server.yaml +110 -0
- data/data/config/command.yaml +38 -0
- data/data/config/command_modifiers.yaml +127 -0
- data/data/config/command_telemetry.yaml +3 -0
- data/data/config/data_viewer.yaml +43 -0
- data/data/config/handbook_creator.yaml +23 -0
- data/data/config/housekeeping_params.yaml +71 -0
- data/data/config/interface_modifiers.yaml +44 -0
- data/data/config/item_modifiers.yaml +172 -0
- data/data/config/launcher.yaml +117 -0
- data/data/config/limits_monitor.yaml +53 -0
- data/data/config/linegraph_params.yaml +30 -0
- data/data/config/linegraph_plot.yaml +106 -0
- data/data/config/page_modifiers.yaml +128 -0
- data/data/config/param_item_modifiers.yaml +41 -0
- data/data/config/parameter_modifiers.yaml +144 -0
- data/data/config/protocols.yaml +257 -0
- data/data/config/screen.yaml +151 -0
- data/data/config/script_runner.yaml +15 -0
- data/data/config/system.yaml +153 -0
- data/data/config/table_manager.yaml +76 -0
- data/data/config/table_parameter_modifiers.yaml +9 -0
- data/data/config/target.yaml +71 -0
- data/data/config/telemetry.yaml +73 -0
- data/data/config/telemetry_modifiers.yaml +129 -0
- data/data/config/test_runner.yaml +118 -0
- data/data/config/tlm_extractor.yaml +109 -0
- data/data/config/tlm_grapher.yaml +78 -0
- data/data/config/tlm_viewer.yaml +107 -0
- data/data/config/unknown.yaml +3 -0
- data/data/config/widgets.yaml +1339 -0
- data/data/config/xy_params.yaml +50 -0
- data/data/config/xy_plot.yaml +12 -0
- data/data/config_editor.png +0 -0
- data/data/crc.txt +172 -161
- data/data/delete.png +0 -0
- data/demo/config/data/crc.txt +56 -36
- data/demo/config/data/meta_init.txt +1 -4
- data/demo/config/system/system.txt +15 -3
- data/demo/config/system/system2.txt +13 -3
- data/demo/config/targets/EXAMPLE/lib/example_interface.rb +2 -6
- data/demo/config/targets/EXAMPLE/target.txt +3 -1
- data/demo/config/targets/INST/cmd_tlm/inst_cmds.txt +1 -0
- data/demo/config/targets/INST/lib/inst_dump_component.rb +34 -0
- data/demo/config/targets/INST/screens/adcs.txt +39 -15
- data/demo/config/targets/INST/screens/commanding.txt +26 -19
- data/demo/config/targets/INST/screens/spacing_box.txt +44 -0
- data/demo/config/targets/INST/screens/spacing_grid.txt +78 -0
- data/demo/config/targets/INST/screens/tabs.txt +0 -2
- data/demo/config/targets/INST/sequences/sequence.tsv +3 -0
- data/demo/config/targets/INST/tables/EventAction.csv +9 -0
- data/demo/config/targets/INST/tables/EventAction.dat +0 -0
- data/demo/config/targets/INST/tables/McConfigTable.csv +20 -0
- data/demo/config/targets/INST/tables/McConfigTable.dat +0 -0
- data/demo/config/targets/INST/target.txt +4 -0
- data/demo/config/targets/INST/tools/data_viewer/data_viewer.txt +2 -0
- data/demo/config/targets/INST/tools/data_viewer/data_viewer2.txt +2 -0
- data/demo/config/targets/INST/tools/table_manager/EventAction_def.txt +6 -0
- data/demo/config/targets/INST/tools/table_manager/McConfigTable_def.txt +38 -0
- data/demo/config/targets/SYSTEM/cmd_tlm/limits_groups.txt +7 -3
- data/demo/config/targets/SYSTEM/cmd_tlm/meta_cmd_tlm.txt +16 -0
- data/demo/config/targets/{COSMOS/cmd_tlm/cosmos_server_cmds.txt → SYSTEM/cmd_tlm/system_cmds.txt} +8 -8
- data/demo/config/targets/SYSTEM/cmd_tlm/system_tlm.txt +7 -0
- data/demo/config/targets/{COSMOS → SYSTEM}/cmd_tlm_server.txt +2 -2
- data/demo/config/targets/SYSTEM/lib/limits_groups.rb +39 -0
- data/demo/config/targets/SYSTEM/screens/status.txt +1 -1
- data/demo/config/targets/SYSTEM/target.txt +12 -0
- data/demo/config/targets/TEMPLATED/cmd_tlm_server.txt +1 -1
- data/demo/config/targets/TEMPLATED/lib/templated_interface.rb +8 -5
- data/demo/config/targets/TEMPLATED/target.txt +2 -0
- data/demo/config/tools/cmd_tlm_server/cmd_tlm_server.txt +15 -6
- data/demo/config/tools/cmd_tlm_server/cmd_tlm_server2.txt +13 -5
- data/demo/config/tools/data_viewer/data_viewer.txt +9 -0
- data/demo/config/tools/launcher/launcher.txt +9 -6
- data/demo/config/tools/launcher/launcher2.txt +16 -13
- data/demo/config/tools/launcher/launcher_mini.txt +45 -0
- data/demo/config/tools/table_manager/MCConfigurationTable_fsw1_def.txt +12 -11
- data/demo/config/tools/table_manager/MCConfigurationTable_fsw2_def.txt +12 -11
- data/demo/config/tools/test_runner/test_runner.txt +1 -1
- data/demo/config/tools/tlm_viewer/tlm_viewer.txt +5 -5
- data/demo/lib/example_background_task.rb +9 -5
- data/demo/lib/example_target.rb +5 -15
- data/demo/lib/scpi_target.rb +4 -10
- data/demo/procedures/cosmos_api_test.rb +17 -0
- data/demo/tools/CmdSequence +16 -0
- data/demo/tools/CmdSequence.bat +9 -0
- data/demo/tools/ConfigEditor +16 -0
- data/demo/tools/ConfigEditor.bat +9 -0
- data/demo/tools/mac/CmdSequence.app/Contents/Info.plist +38 -0
- data/demo/tools/mac/CmdSequence.app/Contents/MacOS/CmdSequence.rb +16 -0
- data/demo/tools/mac/CmdSequence.app/Contents/MacOS/main.sh +10 -0
- data/demo/tools/mac/CmdSequence.app/Contents/MacOS/tool_launch.rb +38 -0
- data/demo/tools/mac/CmdSequence.app/Contents/Resources/appIcon.icns +0 -0
- data/ext/cosmos/ext/packet/packet.c +5 -5
- data/install/config/data/crc.txt +12 -8
- data/install/config/system/system.txt +13 -3
- data/install/config/targets/SYSTEM/cmd_tlm/meta_cmd_tlm.txt +14 -0
- data/install/config/targets/SYSTEM/target.txt +12 -0
- data/install/tools/CmdSequence +16 -0
- data/install/tools/CmdSequence.bat +9 -0
- data/install/tools/ConfigEditor +16 -0
- data/install/tools/ConfigEditor.bat +9 -0
- data/install/tools/mac/CmdSequence.app/Contents/Info.plist +38 -0
- data/install/tools/mac/CmdSequence.app/Contents/MacOS/CmdSequence.rb +16 -0
- data/install/tools/mac/CmdSequence.app/Contents/MacOS/main.sh +10 -0
- data/install/tools/mac/CmdSequence.app/Contents/MacOS/tool_launch.rb +38 -0
- data/install/tools/mac/CmdSequence.app/Contents/Resources/appIcon.icns +0 -0
- data/lib/cosmos.rb +1 -1
- data/lib/cosmos/config/config_parser.rb +147 -59
- data/lib/cosmos/config/meta_config_parser.rb +57 -0
- data/lib/cosmos/conversions/polynomial_conversion.rb +20 -4
- data/lib/cosmos/conversions/unix_time_conversion.rb +4 -4
- data/lib/cosmos/core_ext/array.rb +45 -5
- data/lib/cosmos/core_ext/cosmos_io.rb +31 -15
- data/lib/cosmos/core_ext/file.rb +2 -2
- data/lib/cosmos/core_ext/kernel.rb +1 -6
- data/lib/cosmos/core_ext/objectspace.rb +0 -2
- data/lib/cosmos/core_ext/string.rb +27 -4
- data/lib/cosmos/core_ext/time.rb +39 -10
- data/lib/cosmos/gui/choosers/combobox_chooser.rb +37 -26
- data/lib/cosmos/gui/choosers/file_chooser.rb +23 -6
- data/lib/cosmos/gui/choosers/float_chooser.rb +13 -11
- data/lib/cosmos/gui/choosers/integer_chooser.rb +13 -11
- data/lib/cosmos/gui/choosers/string_chooser.rb +18 -36
- data/lib/cosmos/gui/choosers/telemetry_chooser.rb +64 -64
- data/lib/cosmos/gui/choosers/value_chooser.rb +15 -15
- data/lib/cosmos/gui/dialogs/about_dialog.rb +18 -13
- data/lib/cosmos/gui/dialogs/calendar_dialog.rb +11 -3
- data/lib/cosmos/gui/dialogs/cmd_tlm_raw_dialog.rb +1 -1
- data/lib/cosmos/gui/dialogs/details_dialog.rb +1 -1
- data/lib/cosmos/gui/dialogs/exception_dialog.rb +7 -7
- data/lib/cosmos/gui/dialogs/find_replace_dialog.rb +20 -15
- data/lib/cosmos/gui/dialogs/interface_raw_dialog.rb +143 -0
- data/lib/cosmos/gui/dialogs/legal_dialog.rb +6 -5
- data/lib/cosmos/gui/dialogs/packet_log_dialog.rb +5 -2
- data/lib/cosmos/gui/dialogs/progress_dialog.rb +1 -1
- data/lib/cosmos/gui/dialogs/pry_dialog.rb +4 -4
- data/lib/cosmos/gui/dialogs/scroll_text_dialog.rb +3 -0
- data/lib/cosmos/gui/dialogs/set_tlm_dialog.rb +7 -6
- data/lib/cosmos/gui/dialogs/splash.rb +1 -1
- data/lib/cosmos/gui/dialogs/tlm_details_dialog.rb +1 -1
- data/lib/cosmos/gui/dialogs/tlm_graph_dialog.rb +114 -0
- data/lib/cosmos/gui/line_graph/line_graph.rb +9 -10
- data/lib/cosmos/gui/line_graph/line_graph_dialog.rb +7 -5
- data/lib/cosmos/gui/line_graph/line_graph_drawing.rb +3 -7
- data/lib/cosmos/gui/line_graph/line_graph_popups.rb +3 -8
- data/lib/cosmos/gui/line_graph/line_graph_scaling.rb +2 -7
- data/lib/cosmos/gui/line_graph/overview_graph.rb +6 -1
- data/lib/cosmos/gui/opengl/earth_model.rb +6 -3
- data/lib/cosmos/gui/opengl/gl_bounds.rb +11 -23
- data/lib/cosmos/gui/opengl/gl_light.rb +3 -4
- data/lib/cosmos/gui/opengl/gl_material.rb +3 -4
- data/lib/cosmos/gui/opengl/gl_scene.rb +10 -4
- data/lib/cosmos/gui/opengl/gl_shape.rb +6 -2
- data/lib/cosmos/gui/opengl/gl_viewer.rb +5 -5
- data/lib/cosmos/gui/opengl/gl_viewport.rb +11 -12
- data/lib/cosmos/gui/opengl/moon_model.rb +6 -3
- data/lib/cosmos/gui/opengl/stl_reader.rb +8 -9
- data/lib/cosmos/gui/opengl/stl_shape.rb +4 -5
- data/lib/cosmos/gui/opengl/texture_mapped_sphere.rb +7 -7
- data/lib/cosmos/gui/qt.rb +1 -1
- data/lib/cosmos/gui/qt_tool.rb +21 -10
- data/lib/cosmos/gui/text/completion.rb +23 -2
- data/lib/cosmos/gui/text/completion_text_edit.rb +38 -23
- data/lib/cosmos/gui/utilities/analyze_log.rb +1 -1
- data/lib/cosmos/gui/utilities/screenshot.rb +2 -2
- data/lib/cosmos/gui/widgets/full_text_search_line_edit.rb +11 -1
- data/lib/cosmos/gui/widgets/packet_log_frame.rb +19 -6
- data/lib/cosmos/interfaces.rb +10 -0
- data/lib/cosmos/interfaces/cmd_tlm_server_interface.rb +28 -47
- data/lib/cosmos/interfaces/interface.rb +240 -22
- data/lib/cosmos/interfaces/linc_interface.rb +3 -5
- data/lib/cosmos/interfaces/protocols/burst_protocol.rb +173 -0
- data/lib/cosmos/interfaces/protocols/crc_protocol.rb +141 -0
- data/lib/cosmos/{streams/fixed_stream_protocol.rb → interfaces/protocols/fixed_protocol.rb} +40 -37
- data/lib/cosmos/{streams/length_stream_protocol.rb → interfaces/protocols/length_protocol.rb} +55 -48
- data/lib/cosmos/interfaces/protocols/override_protocol.rb +52 -0
- data/lib/cosmos/interfaces/protocols/preidentified_protocol.rb +141 -0
- data/lib/cosmos/interfaces/protocols/protocol.rb +60 -0
- data/lib/cosmos/interfaces/protocols/template_protocol.rb +209 -0
- data/lib/cosmos/interfaces/protocols/terminated_protocol.rb +81 -0
- data/lib/cosmos/interfaces/serial_interface.rb +28 -23
- data/lib/cosmos/interfaces/simulated_target_interface.rb +27 -16
- data/lib/cosmos/interfaces/stream_interface.rb +36 -108
- data/lib/cosmos/interfaces/tcpip_client_interface.rb +21 -21
- data/lib/cosmos/interfaces/tcpip_server_interface.rb +555 -94
- data/lib/cosmos/interfaces/udp_interface.rb +51 -83
- data/lib/cosmos/io/buffered_file.rb +92 -2
- data/lib/cosmos/io/json_drb.rb +2 -2
- data/lib/cosmos/io/posix_serial_driver.rb +3 -1
- data/lib/cosmos/io/raw_logger.rb +3 -3
- data/lib/cosmos/io/serial_driver.rb +14 -5
- data/lib/cosmos/io/win32_serial_driver.rb +16 -4
- data/lib/cosmos/packet_logs.rb +0 -1
- data/lib/cosmos/packet_logs/packet_log_reader.rb +11 -1
- data/lib/cosmos/packet_logs/packet_log_writer.rb +31 -13
- data/lib/cosmos/packets/binary_accessor.rb +599 -32
- data/lib/cosmos/packets/commands.rb +48 -24
- data/lib/cosmos/packets/packet.rb +140 -54
- data/lib/cosmos/packets/packet_config.rb +0 -2
- data/lib/cosmos/packets/parsers/packet_item_parser.rb +10 -2
- data/lib/cosmos/packets/structure.rb +81 -33
- data/lib/cosmos/packets/structure_item.rb +45 -5
- data/lib/cosmos/packets/telemetry.rb +149 -55
- data/lib/cosmos/script/api_shared.rb +1000 -0
- data/lib/cosmos/script/commands.rb +2 -2
- data/lib/cosmos/script/extract.rb +19 -4
- data/lib/cosmos/script/limits.rb +2 -0
- data/lib/cosmos/script/script.rb +1 -1
- data/lib/cosmos/script/scripting.rb +4 -784
- data/lib/cosmos/script/telemetry.rb +44 -23
- data/lib/cosmos/script/tools.rb +15 -69
- data/lib/cosmos/streams/serial_stream.rb +12 -19
- data/lib/cosmos/streams/stream.rb +2 -11
- data/lib/cosmos/streams/tcpip_socket_stream.rb +3 -13
- data/lib/cosmos/system/system.rb +187 -31
- data/lib/cosmos/system/target.rb +11 -2
- data/lib/cosmos/tools/cmd_extractor/cmd_extractor.rb +12 -11
- data/lib/cosmos/tools/cmd_sender/{cmd_sender_item_delegate.rb → cmd_param_table_item_delegate.rb} +11 -10
- data/lib/cosmos/tools/cmd_sender/cmd_sender.rb +209 -164
- data/lib/cosmos/tools/cmd_sequence/cmd_sequence.rb +652 -0
- data/lib/cosmos/tools/cmd_sequence/sequence_item.rb +510 -0
- data/lib/cosmos/tools/cmd_sequence/sequence_list.rb +194 -0
- data/lib/cosmos/tools/cmd_tlm_server/api.rb +179 -5
- data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb +31 -14
- data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_config.rb +23 -16
- data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_gui.rb +92 -20
- data/lib/cosmos/tools/cmd_tlm_server/commanding.rb +1 -1
- data/lib/cosmos/tools/cmd_tlm_server/gui/interfaces_tab.rb +17 -4
- data/lib/cosmos/tools/cmd_tlm_server/gui/targets_tab.rb +0 -5
- data/lib/cosmos/tools/cmd_tlm_server/interface_thread.rb +1 -2
- data/lib/cosmos/tools/cmd_tlm_server/interfaces.rb +4 -4
- data/lib/cosmos/tools/cmd_tlm_server/limits_groups_background_task.rb +121 -0
- data/lib/cosmos/tools/cmd_tlm_server/routers.rb +8 -4
- data/lib/cosmos/tools/config_editor/config_editor.rb +720 -0
- data/lib/cosmos/tools/config_editor/config_editor_frame.rb +675 -0
- data/lib/cosmos/tools/data_viewer/data_viewer.rb +44 -27
- data/lib/cosmos/tools/data_viewer/data_viewer_component.rb +8 -22
- data/lib/cosmos/tools/launcher/launcher.rb +29 -12
- data/lib/cosmos/tools/launcher/launcher_config.rb +1 -1
- data/lib/cosmos/tools/limits_monitor/limits_monitor.rb +153 -42
- data/lib/cosmos/tools/packet_viewer/packet_viewer.rb +44 -6
- data/lib/cosmos/tools/replay/replay.rb +36 -20
- data/lib/cosmos/tools/replay/replay_server.rb +1 -1
- data/lib/cosmos/tools/script_runner/script_runner_config.rb +1 -1
- data/lib/cosmos/tools/script_runner/script_runner_frame.rb +31 -21
- data/lib/cosmos/tools/table_manager/table_config.rb +9 -3
- data/lib/cosmos/tools/table_manager/table_manager.rb +27 -7
- data/lib/cosmos/tools/test_runner/results_writer.rb +6 -6
- data/lib/cosmos/tools/test_runner/test_runner.rb +4 -6
- data/lib/cosmos/tools/tlm_extractor/tlm_extractor.rb +4 -5
- data/lib/cosmos/tools/tlm_extractor/tlm_extractor_config.rb +1 -1
- data/lib/cosmos/tools/tlm_extractor/tlm_extractor_processor.rb +1 -1
- data/lib/cosmos/tools/tlm_grapher/data_object_adders/housekeeping_data_object_adder.rb +23 -6
- data/lib/cosmos/tools/tlm_grapher/data_object_editors/housekeeping_data_object_editor.rb +44 -3
- data/lib/cosmos/tools/tlm_grapher/data_objects/housekeeping_data_object.rb +20 -7
- data/lib/cosmos/tools/tlm_grapher/tabbed_plots/overview_tabbed_plots.rb +1 -1
- data/lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_config.rb +11 -4
- data/lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_plot_editor.rb +2 -2
- data/lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_realtime_thread.rb +1 -1
- data/lib/cosmos/tools/tlm_grapher/tlm_grapher.rb +16 -0
- data/lib/cosmos/tools/tlm_viewer/screen.rb +36 -32
- data/lib/cosmos/tools/tlm_viewer/tlm_viewer.rb +59 -50
- data/lib/cosmos/tools/tlm_viewer/tlm_viewer_config.rb +2 -2
- data/lib/cosmos/tools/tlm_viewer/widgets.rb +1 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/canvasvalue_widget.rb +1 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/labelvalue_widget.rb +22 -4
- data/lib/cosmos/tools/tlm_viewer/widgets/matrixbycolumns_widget.rb +9 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/spacer_widget.rb +55 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/vertical_widget.rb +3 -2
- data/lib/cosmos/tools/tlm_viewer/widgets/verticalbox_widget.rb +3 -2
- data/lib/cosmos/tools/tlm_viewer/widgets/widget.rb +12 -12
- data/lib/cosmos/top_level.rb +34 -24
- data/lib/cosmos/utilities/crc.rb +108 -6
- data/lib/cosmos/utilities/csv.rb +68 -14
- data/lib/cosmos/utilities/logger.rb +2 -2
- data/lib/cosmos/utilities/low_fragmentation_array.rb +9 -1
- data/lib/cosmos/version.rb +6 -6
- data/lib/cosmos/win32/win32_main.rb +50 -46
- data/run_gui_tests.bat +3 -1
- data/spec/conversions/unix_time_formatted_conversion_spec.rb +2 -2
- data/spec/conversions/unix_time_seconds_conversion_spec.rb +2 -2
- data/spec/core_ext/file_spec.rb +1 -1
- data/spec/core_ext/objectspace_spec.rb +12 -9
- data/spec/core_ext/string_spec.rb +6 -0
- data/spec/core_ext/time_spec.rb +10 -0
- data/spec/gui/line_graph/line_clip_spec.rb +226 -224
- data/spec/gui/qt_spec.rb +81 -79
- data/spec/install/config/system/system.txt +0 -6
- data/spec/install/config/targets/INST/cmd_tlm/inst_cmd_linc.txt +5 -5
- data/spec/install/config/targets/INST/cmd_tlm/inst_tlm_linc.txt +8 -8
- data/spec/install/config/targets/SYSTEM/cmd_tlm/meta_cmd_tlm.txt +16 -0
- data/{install/config/targets/COSMOS/cmd_tlm/cosmos_server_cmds.txt → spec/install/config/targets/SYSTEM/cmd_tlm/system_cmds.txt} +8 -8
- data/spec/install/config/targets/SYSTEM/cmd_tlm/system_tlm.txt +7 -0
- data/spec/install/config/targets/{COSMOS → SYSTEM}/cmd_tlm_server.txt +2 -2
- data/spec/install/config/targets/SYSTEM/screens/status.txt +12 -0
- data/spec/install/config/targets/SYSTEM/target.txt +12 -0
- data/spec/interfaces/cmd_tlm_server_interface_spec.rb +9 -13
- data/spec/interfaces/interface_spec.rb +402 -18
- data/spec/interfaces/linc_interface_spec.rb +37 -39
- data/spec/interfaces/protocols/burst_protocol_spec.rb +300 -0
- data/spec/interfaces/protocols/crc_protocol_spec.rb +709 -0
- data/spec/interfaces/protocols/fixed_protocol_spec.rb +119 -0
- data/spec/interfaces/protocols/length_protocol_spec.rb +499 -0
- data/spec/interfaces/protocols/override_protocol_spec.rb +158 -0
- data/spec/interfaces/protocols/preidentified_protocol_spec.rb +149 -0
- data/spec/interfaces/protocols/template_protocol_spec.rb +218 -0
- data/spec/interfaces/protocols/terminated_protocol_spec.rb +174 -0
- data/spec/interfaces/serial_interface_spec.rb +35 -34
- data/spec/interfaces/simulated_target_interface_spec.rb +13 -13
- data/spec/interfaces/tcpip_client_interface_spec.rb +21 -16
- data/spec/interfaces/tcpip_server_interface_spec.rb +66 -69
- data/spec/interfaces/udp_interface_spec.rb +120 -55
- data/spec/io/serial_driver_spec.rb +41 -39
- data/spec/io/udp_sockets_spec.rb +13 -8
- data/spec/io/win32_serial_driver_spec.rb +62 -59
- data/spec/packet_logs/packet_log_reader_spec.rb +68 -47
- data/spec/packet_logs/packet_log_writer_spec.rb +7 -5
- data/spec/packets/commands_spec.rb +5 -5
- data/spec/packets/packet_spec.rb +2 -14
- data/spec/script/extract_spec.rb +21 -7
- data/spec/script/scripting_spec.rb +261 -6
- data/spec/script/telemetry_spec.rb +17 -9
- data/spec/spec_helper.rb +26 -10
- data/spec/streams/serial_stream_spec.rb +87 -82
- data/spec/streams/tcpip_client_stream_spec.rb +12 -4
- data/spec/streams/tcpip_socket_stream_spec.rb +5 -0
- data/spec/system/system_spec.rb +66 -50
- data/spec/system/target_spec.rb +33 -11
- data/spec/tools/cmd_tlm_server/api_spec.rb +5 -5
- data/spec/tools/cmd_tlm_server/background_tasks_spec.rb +75 -15
- data/spec/tools/cmd_tlm_server/cmd_tlm_server_config_spec.rb +125 -5
- data/spec/tools/cmd_tlm_server/cmd_tlm_server_spec.rb +244 -232
- data/spec/tools/cmd_tlm_server/commanding_spec.rb +18 -18
- data/spec/tools/cmd_tlm_server/interface_thread_spec.rb +124 -29
- data/spec/tools/cmd_tlm_server/interfaces_spec.rb +2 -2
- data/spec/tools/cmd_tlm_server/limits_groups_background_task_spec.rb +145 -0
- data/spec/tools/cmd_tlm_server/router_thread_spec.rb +50 -10
- data/spec/tools/table_manager/tablemanager_core_spec.rb +0 -1
- data/spec/top_level/top_level_spec.rb +39 -11
- data/spec/utilities/csv_spec.rb +62 -20
- data/tasks/gemfile_stats.rake +6 -3
- data/test/performance/config/system/system_packets.txt +0 -1
- data/test/performance/config/system/system_threads.txt +0 -1
- metadata +177 -92
- data/autohotkey/config/targets/COSMOS/cmd_tlm/cosmos_server_tlm.txt +0 -15
- data/autohotkey/config/targets/COSMOS/cmd_tlm_server.txt +0 -6
- data/autohotkey/config/targets/COSMOS/target.txt +0 -5
- data/autohotkey/userpath.txt +0 -1
- data/demo/config/targets/COSMOS/cmd_tlm/cosmos_server_tlm.txt +0 -15
- data/demo/config/targets/COSMOS/screens/limits_change.txt +0 -20
- data/demo/config/targets/COSMOS/screens/version.txt +0 -19
- data/demo/config/targets/COSMOS/target.txt +0 -11
- data/demo/config/targets/META/cmd_tlm/meta_cmd.txt +0 -10
- data/demo/config/targets/META/cmd_tlm/meta_tlm.txt +0 -13
- data/demo/userpath.txt +0 -1
- data/install/config/targets/COSMOS/cmd_tlm/cosmos_server_tlm.txt +0 -15
- data/install/config/targets/COSMOS/cmd_tlm_server.txt +0 -6
- data/install/config/targets/COSMOS/screens/limits_change.txt +0 -20
- data/install/config/targets/COSMOS/screens/version.txt +0 -19
- data/install/config/targets/COSMOS/target.txt +0 -9
- data/install/config/targets/SYSTEM/README.txt +0 -1
- data/install/userpath.txt +0 -1
- data/lib/cosmos/io/tcpip_server.rb +0 -571
- data/lib/cosmos/packet_logs/meta_packet_log_writer.rb +0 -107
- data/lib/cosmos/streams/burst_stream_protocol.rb +0 -25
- data/lib/cosmos/streams/preidentified_stream_protocol.rb +0 -118
- data/lib/cosmos/streams/stream_protocol.rb +0 -373
- data/lib/cosmos/streams/template_stream_protocol.rb +0 -140
- data/lib/cosmos/streams/terminated_stream_protocol.rb +0 -85
- data/spec/install/config/targets/COSMOS/cmd_tlm/cosmos_server_cmds.txt +0 -41
- data/spec/install/config/targets/COSMOS/cmd_tlm/cosmos_server_tlm.txt +0 -15
- data/spec/install/config/targets/COSMOS/screens/limits_change.txt +0 -20
- data/spec/install/config/targets/COSMOS/screens/version.txt +0 -19
- data/spec/install/config/targets/COSMOS/target.txt +0 -5
- data/spec/install/config/targets/META/cmd_tlm/meta_cmd.txt +0 -4
- data/spec/install/config/targets/META/cmd_tlm/meta_tlm.txt +0 -4
- data/spec/install/userpath.txt +0 -1
- data/spec/interfaces/stream_interface_spec.rb +0 -157
- data/spec/io/tcpip_server_spec.rb +0 -338
- data/spec/packet_logs/meta_packet_log_writer_spec.rb +0 -170
- data/spec/streams/burst_stream_protocol_spec.rb +0 -32
- data/spec/streams/fixed_stream_protocol_spec.rb +0 -113
- data/spec/streams/length_stream_protocol_spec.rb +0 -300
- data/spec/streams/preidentified_stream_protocol_spec.rb +0 -121
- data/spec/streams/stream_protocol_spec.rb +0 -346
- data/spec/streams/template_stream_protocol_spec.rb +0 -156
- data/spec/streams/terminated_stream_protocol_spec.rb +0 -127
- data/test/performance/userpath.txt +0 -1
|
@@ -14,6 +14,7 @@ Cosmos.catch_fatal_exception do
|
|
|
14
14
|
require 'cosmos/gui/qt_tool'
|
|
15
15
|
require 'cosmos/gui/dialogs/tlm_details_dialog'
|
|
16
16
|
require 'cosmos/gui/dialogs/tlm_edit_dialog'
|
|
17
|
+
require 'cosmos/gui/dialogs/tlm_graph_dialog'
|
|
17
18
|
require 'cosmos/gui/dialogs/exception_dialog'
|
|
18
19
|
require 'cosmos/gui/dialogs/splash'
|
|
19
20
|
require 'cosmos/gui/widgets/full_text_search_line_edit'
|
|
@@ -83,6 +84,14 @@ module Cosmos
|
|
|
83
84
|
def initialize_actions
|
|
84
85
|
super()
|
|
85
86
|
|
|
87
|
+
@edit_action = Qt::Action.new(Cosmos.get_icon('edit.png'),
|
|
88
|
+
tr('&Edit Definition'),
|
|
89
|
+
self)
|
|
90
|
+
@edit_keyseq = Qt::KeySequence.new(tr('Ctrl+E'))
|
|
91
|
+
@edit_action.shortcut = @edit_keyseq
|
|
92
|
+
@edit_action.statusTip = tr('Open packet definition in a editor')
|
|
93
|
+
@edit_action.connect(SIGNAL('triggered()')) { edit_definition }
|
|
94
|
+
|
|
86
95
|
@reset_action = Qt::Action.new(tr('&Reset'), self)
|
|
87
96
|
@reset_keyseq = Qt::KeySequence.new(tr('Ctrl+R'))
|
|
88
97
|
@reset_action.shortcut = @reset_keyseq
|
|
@@ -168,6 +177,7 @@ module Cosmos
|
|
|
168
177
|
def initialize_menus
|
|
169
178
|
# File Menu
|
|
170
179
|
file_menu = menuBar.addMenu(tr('&File'))
|
|
180
|
+
file_menu.addAction(@edit_action)
|
|
171
181
|
file_menu.addAction(@reset_action)
|
|
172
182
|
file_menu.addAction(@option_action)
|
|
173
183
|
file_menu.addSeparator()
|
|
@@ -217,11 +227,8 @@ module Cosmos
|
|
|
217
227
|
cmd_label.setBuddy(@packet_select)
|
|
218
228
|
|
|
219
229
|
# Mnemonic Search Box
|
|
220
|
-
@search_layout = Qt::HBoxLayout.new
|
|
221
230
|
@search_box = FullTextSearchLineEdit.new(self)
|
|
222
|
-
@search_box
|
|
223
|
-
@search_layout.addWidget(@search_box)
|
|
224
|
-
top_layout.addLayout(@search_layout)
|
|
231
|
+
top_layout.addWidget(@search_box)
|
|
225
232
|
|
|
226
233
|
# Layout the top level selection
|
|
227
234
|
select_layout = Qt::HBoxLayout.new
|
|
@@ -258,6 +265,33 @@ module Cosmos
|
|
|
258
265
|
@polling_rate, 0, 1000, 1, nil)
|
|
259
266
|
end
|
|
260
267
|
|
|
268
|
+
def edit_definition
|
|
269
|
+
# Grab all the cmd_tlm_files and processes them in reverse sort order
|
|
270
|
+
# because typically we'll have cmd.txt and tlm.txt and we want to process
|
|
271
|
+
# tlm.txt first
|
|
272
|
+
found = false
|
|
273
|
+
System.targets[@target_select.text].cmd_tlm_files.sort.reverse.each do |filename|
|
|
274
|
+
# Skip partials which begin with an underscore
|
|
275
|
+
next if File.basename(filename)[0] == '_'
|
|
276
|
+
file = File.read(filename)
|
|
277
|
+
# Wild card the target name because it is not used and is often aliased
|
|
278
|
+
if file =~ /TELEMETRY\s+.*\s+#{@packet_select.text}/
|
|
279
|
+
Cosmos.open_in_text_editor(filename)
|
|
280
|
+
found = true
|
|
281
|
+
break
|
|
282
|
+
end
|
|
283
|
+
end
|
|
284
|
+
# A packet definition might not be found due to ERB templates or other
|
|
285
|
+
# strange things they're doing. Pop up a warning and make them go look.
|
|
286
|
+
if !found
|
|
287
|
+
target_name = System.targets[@target_select.text].original_name
|
|
288
|
+
Qt::MessageBox.warning(self, "Definition Not Found",
|
|
289
|
+
"Could not find definition for #{@target_select.text} #{@packet_select.text}.\n"\
|
|
290
|
+
"Perhaps some ERB code is preventing automatic detection.\n"\
|
|
291
|
+
"You should manually explore the files in config/targets/#{target_name}/cmd_tlm.")
|
|
292
|
+
end
|
|
293
|
+
end
|
|
294
|
+
|
|
261
295
|
def update_all
|
|
262
296
|
update_targets()
|
|
263
297
|
update_packets()
|
|
@@ -396,7 +430,7 @@ module Cosmos
|
|
|
396
430
|
@tlm_thread = Thread.new do
|
|
397
431
|
begin
|
|
398
432
|
while true
|
|
399
|
-
time = Time.now
|
|
433
|
+
time = Time.now.sys
|
|
400
434
|
break if @shutdown_tlm_thread
|
|
401
435
|
|
|
402
436
|
begin
|
|
@@ -475,7 +509,7 @@ module Cosmos
|
|
|
475
509
|
# Delay for 1/10 of polling rate
|
|
476
510
|
10.times do
|
|
477
511
|
break if @shutdown_tlm_thread
|
|
478
|
-
sleep(@polling_rate.to_f / 10.0) if (Time.now - time < @polling_rate)
|
|
512
|
+
sleep(@polling_rate.to_f / 10.0) if (Time.now.sys - time < @polling_rate)
|
|
479
513
|
end
|
|
480
514
|
end
|
|
481
515
|
rescue Exception => error
|
|
@@ -506,6 +540,7 @@ module Cosmos
|
|
|
506
540
|
details_action.statusTip = tr("Popup details about #{target_name} #{packet_name} #{item_name}")
|
|
507
541
|
details_action.connect(SIGNAL('triggered()')) do
|
|
508
542
|
TlmDetailsDialog.new(nil, target_name, packet_name, item_name)
|
|
543
|
+
@table.clearSelection
|
|
509
544
|
end
|
|
510
545
|
menu.addAction(details_action)
|
|
511
546
|
|
|
@@ -513,12 +548,14 @@ module Cosmos
|
|
|
513
548
|
edit_action.statusTip = tr("Edit Settings for #{target_name} #{packet_name} #{item_name}")
|
|
514
549
|
edit_action.connect(SIGNAL('triggered()')) do
|
|
515
550
|
TlmEditDialog.new(self, target_name, packet_name, item_name)
|
|
551
|
+
@table.clearSelection
|
|
516
552
|
end
|
|
517
553
|
menu.addAction(edit_action)
|
|
518
554
|
|
|
519
555
|
graph_action = Qt::Action.new(tr("Graph #{target_name} #{packet_name} #{item_name}"), self)
|
|
520
556
|
graph_action.statusTip = tr("Create a new COSMOS graph of #{target_name} #{packet_name} #{item_name}")
|
|
521
557
|
graph_action.connect(SIGNAL('triggered()')) do
|
|
558
|
+
@table.clearSelection
|
|
522
559
|
if Kernel.is_windows?
|
|
523
560
|
Cosmos.run_process("rubyw tools/TlmGrapher -i \"#{target_name} #{packet_name} #{item_name}\" --system #{File.basename(System.initial_filename)}")
|
|
524
561
|
elsif Kernel.is_mac? and File.exist?("tools/mac/TlmGrapher.app")
|
|
@@ -526,6 +563,7 @@ module Cosmos
|
|
|
526
563
|
else
|
|
527
564
|
Cosmos.run_process("ruby tools/TlmGrapher -i \"#{target_name} #{packet_name} #{item_name}\" --system #{File.basename(System.initial_filename)}")
|
|
528
565
|
end
|
|
566
|
+
TlmGraphDialog.new(self, target_name, packet_name, item_name)
|
|
529
567
|
end
|
|
530
568
|
menu.addAction(graph_action)
|
|
531
569
|
|
|
@@ -13,6 +13,7 @@ Cosmos.catch_fatal_exception do
|
|
|
13
13
|
require 'cosmos/gui/qt_tool'
|
|
14
14
|
require 'cosmos/gui/dialogs/splash'
|
|
15
15
|
require 'cosmos/gui/dialogs/progress_dialog'
|
|
16
|
+
require 'cosmos/gui/dialogs/packet_log_dialog'
|
|
16
17
|
require 'cosmos/tools/replay/replay_server'
|
|
17
18
|
require 'cosmos/gui/choosers/string_chooser'
|
|
18
19
|
end
|
|
@@ -48,7 +49,7 @@ module Cosmos
|
|
|
48
49
|
end
|
|
49
50
|
|
|
50
51
|
# Initialize variables
|
|
51
|
-
@packet_log_reader = System.default_packet_log_reader.new
|
|
52
|
+
@packet_log_reader = System.default_packet_log_reader.new(*System.default_packet_log_reader_params)
|
|
52
53
|
@log_directory = System.paths['LOGS']
|
|
53
54
|
@log_directory << '/' unless @log_directory[-1..-1] == '\\' or @log_directory[-1..-1] == '/'
|
|
54
55
|
@log_filename = nil
|
|
@@ -209,27 +210,32 @@ module Cosmos
|
|
|
209
210
|
|
|
210
211
|
def select_log_file
|
|
211
212
|
unless @playback_thread
|
|
212
|
-
|
|
213
|
-
self,
|
|
214
|
-
|
|
213
|
+
packet_log_dialog = PacketLogDialog.new(
|
|
214
|
+
self, 'Select Log File', @log_directory, @packet_log_reader,
|
|
215
|
+
[], nil, false, false, true, Cosmos::TLM_FILE_PATTERN,
|
|
216
|
+
Cosmos::BIN_FILE_PATTERN, false
|
|
217
|
+
)
|
|
218
|
+
case packet_log_dialog.exec
|
|
219
|
+
when Qt::Dialog::Accepted
|
|
215
220
|
stop()
|
|
216
|
-
@
|
|
217
|
-
@
|
|
218
|
-
@
|
|
221
|
+
@packet_log_reader = packet_log_dialog.packet_log_reader
|
|
222
|
+
@log_filename = packet_log_dialog.filenames[0]
|
|
223
|
+
@log_directory = File.dirname(@log_filename)
|
|
224
|
+
@log_directory << '/' unless @log_directory[-1..-1] == '\\'
|
|
225
|
+
@log_name.text = @log_filename
|
|
219
226
|
|
|
220
227
|
System.telemetry.reset
|
|
221
|
-
|
|
222
228
|
@cancel = false
|
|
223
229
|
ProgressDialog.execute(self, 'Analyzing Log File', 500, 10, true, false, true, false, true) do |progress_dialog|
|
|
224
|
-
progress_dialog.append_text("Processing File: #{
|
|
230
|
+
progress_dialog.append_text("Processing File: #{@log_filename}\n")
|
|
225
231
|
progress_dialog.set_overall_progress(0.0)
|
|
226
232
|
progress_dialog.cancel_callback = method(:cancel_callback)
|
|
227
233
|
progress_dialog.enable_cancel_button
|
|
228
|
-
Cosmos.check_log_configuration(@packet_log_reader,
|
|
229
|
-
@packet_offsets = @packet_log_reader.packet_offsets(
|
|
234
|
+
Cosmos.check_log_configuration(@packet_log_reader, @log_filename)
|
|
235
|
+
@packet_offsets = @packet_log_reader.packet_offsets(@log_filename, lambda {|percentage| progress_dialog.set_overall_progress(percentage); @cancel})
|
|
230
236
|
@playback_index = 0
|
|
231
237
|
update_slider_and_current_time(nil)
|
|
232
|
-
@packet_log_reader.open(
|
|
238
|
+
@packet_log_reader.open(@log_filename)
|
|
233
239
|
progress_dialog.close_done
|
|
234
240
|
end
|
|
235
241
|
|
|
@@ -258,7 +264,7 @@ module Cosmos
|
|
|
258
264
|
def move_start
|
|
259
265
|
if @log_filename and !@playback_thread
|
|
260
266
|
packet = read_at_index(0, :FORWARD)
|
|
261
|
-
@start_time.value = packet.received_time.formatted if packet and packet.received_time
|
|
267
|
+
@start_time.value = packet.received_time.formatted(true, 3, true) if packet and packet.received_time
|
|
262
268
|
else
|
|
263
269
|
stop()
|
|
264
270
|
end
|
|
@@ -307,7 +313,7 @@ module Cosmos
|
|
|
307
313
|
def move_end
|
|
308
314
|
if @log_filename and !@playback_thread
|
|
309
315
|
packet = read_at_index(@packet_offsets.length - 1, :FORWARD)
|
|
310
|
-
@end_time.value = packet.received_time.formatted if packet and packet.received_time
|
|
316
|
+
@end_time.value = packet.received_time.formatted(true, 3, true) if packet and packet.received_time
|
|
311
317
|
else
|
|
312
318
|
stop()
|
|
313
319
|
end
|
|
@@ -330,17 +336,17 @@ module Cosmos
|
|
|
330
336
|
previous_packet = nil
|
|
331
337
|
while (@playing)
|
|
332
338
|
if @playback_delay
|
|
333
|
-
packet_start = Time.now
|
|
339
|
+
packet_start = Time.now.sys
|
|
334
340
|
packet = read_at_index(@playback_index, direction)
|
|
335
341
|
break unless packet
|
|
336
342
|
delay_time = 0.0
|
|
337
343
|
if @playback_delay > 0.0
|
|
338
|
-
delay_time = @playback_delay - (Time.now - packet_start)
|
|
344
|
+
delay_time = @playback_delay - (Time.now.sys - packet_start)
|
|
339
345
|
elsif previous_packet and packet.received_time and previous_packet.received_time
|
|
340
346
|
if direction == :FORWARD
|
|
341
|
-
delay_time = packet.received_time - previous_packet.received_time - (Time.now - packet_start)
|
|
347
|
+
delay_time = packet.received_time - previous_packet.received_time - (Time.now.sys - packet_start)
|
|
342
348
|
else
|
|
343
|
-
delay_time = previous_packet.received_time - packet.received_time - (Time.now - packet_start)
|
|
349
|
+
delay_time = previous_packet.received_time - packet.received_time - (Time.now.sys - packet_start)
|
|
344
350
|
end
|
|
345
351
|
end
|
|
346
352
|
sleep(delay_time) if delay_time > 0.0
|
|
@@ -389,7 +395,7 @@ module Cosmos
|
|
|
389
395
|
value = (((@playback_index - 1) / @packet_offsets.length.to_f) * 10000).to_i
|
|
390
396
|
@slider.setSliderPosition(value)
|
|
391
397
|
@slider.setValue(value)
|
|
392
|
-
@current_time.value = packet.received_time.formatted if packet and packet.received_time
|
|
398
|
+
@current_time.value = packet.received_time.formatted(true, 3, true) if packet and packet.received_time
|
|
393
399
|
end
|
|
394
400
|
end
|
|
395
401
|
|
|
@@ -477,6 +483,16 @@ module Cosmos
|
|
|
477
483
|
end
|
|
478
484
|
end
|
|
479
485
|
|
|
486
|
+
def closeEvent(event)
|
|
487
|
+
Cosmos.kill_thread(self, @playback_thread)
|
|
488
|
+
super(event)
|
|
489
|
+
end
|
|
490
|
+
|
|
491
|
+
# Gracefully kill threads
|
|
492
|
+
def graceful_kill
|
|
493
|
+
stop()
|
|
494
|
+
end
|
|
495
|
+
|
|
480
496
|
def self.run(option_parser = nil, options = nil)
|
|
481
497
|
Cosmos.catch_fatal_exception do
|
|
482
498
|
unless option_parser and options
|
|
@@ -496,6 +512,6 @@ module Cosmos
|
|
|
496
512
|
end
|
|
497
513
|
end
|
|
498
514
|
|
|
499
|
-
end # class
|
|
515
|
+
end # class Replay
|
|
500
516
|
|
|
501
517
|
end # module Cosmos
|
|
@@ -34,7 +34,7 @@ module Cosmos
|
|
|
34
34
|
|
|
35
35
|
@json_drb.method_whitelist = @api_whitelist
|
|
36
36
|
begin
|
|
37
|
-
@json_drb.start_service(
|
|
37
|
+
@json_drb.start_service(System.listen_hosts['CTS_API'], System.ports['CTS_API'], self)
|
|
38
38
|
rescue Exception
|
|
39
39
|
raise FatalError.new("Error starting JsonDRb on port #{System.ports['CTS_API']}.\nPerhaps a Command and Telemetry Server is already running?")
|
|
40
40
|
end
|
|
@@ -16,7 +16,7 @@ module Cosmos
|
|
|
16
16
|
class ScriptRunnerConfig
|
|
17
17
|
# Processes the config file
|
|
18
18
|
def initialize(filename)
|
|
19
|
-
parser = ConfigParser.new
|
|
19
|
+
parser = ConfigParser.new("http://cosmosrb.com/docs/tools/#script-runner-configuration")
|
|
20
20
|
parser.parse_file(filename) do |keyword, params|
|
|
21
21
|
case keyword
|
|
22
22
|
when 'LINE_DELAY'
|
|
@@ -81,7 +81,7 @@ module Cosmos
|
|
|
81
81
|
enable_limits disable_limits wait_tolerance wait_tolerance_raw \
|
|
82
82
|
check_tolerance check_tolerance_raw wait_check_tolerance \
|
|
83
83
|
wait_check_tolerance_raw)
|
|
84
|
-
SET_TLM_KEYWORDS = %w(set_tlm set_tlm_raw)
|
|
84
|
+
SET_TLM_KEYWORDS = %w(set_tlm set_tlm_raw override_tlm_raw normalize_tlm_raw)
|
|
85
85
|
CHECK_KEYWORDS = %w(check check_raw wait wait_raw wait_check wait_check_raw)
|
|
86
86
|
|
|
87
87
|
attr_accessor :use_instrumentation
|
|
@@ -203,7 +203,7 @@ module Cosmos
|
|
|
203
203
|
@debug_history = []
|
|
204
204
|
@debug_code_completion = nil
|
|
205
205
|
@top_level_instrumented_cache = nil
|
|
206
|
-
@output_time = Time.now
|
|
206
|
+
@output_time = Time.now.sys
|
|
207
207
|
initialize_variables()
|
|
208
208
|
|
|
209
209
|
# Redirect $stdout and $stderr
|
|
@@ -360,6 +360,14 @@ module Cosmos
|
|
|
360
360
|
@@instrumented_cache = value
|
|
361
361
|
end
|
|
362
362
|
|
|
363
|
+
def self.file_cache
|
|
364
|
+
@@file_cache
|
|
365
|
+
end
|
|
366
|
+
|
|
367
|
+
def self.file_cache=(value)
|
|
368
|
+
@@file_cache = value
|
|
369
|
+
end
|
|
370
|
+
|
|
363
371
|
def self.pause_on_error
|
|
364
372
|
@@pause_on_error
|
|
365
373
|
end
|
|
@@ -391,7 +399,7 @@ module Cosmos
|
|
|
391
399
|
def self.show_backtrace=(value)
|
|
392
400
|
@@show_backtrace = value
|
|
393
401
|
if @@show_backtrace and @@error
|
|
394
|
-
puts Time.now.formatted + " (SCRIPTRUNNER): " + "Most recent exception:\n" + @@error.formatted
|
|
402
|
+
puts Time.now.sys.formatted + " (SCRIPTRUNNER): " + "Most recent exception:\n" + @@error.formatted
|
|
395
403
|
end
|
|
396
404
|
end
|
|
397
405
|
|
|
@@ -505,7 +513,7 @@ module Cosmos
|
|
|
505
513
|
false, # don't show text
|
|
506
514
|
false, # don't show done
|
|
507
515
|
true) do |progress_dialog| # show cancel
|
|
508
|
-
progress_dialog.cancel_callback = lambda {|dialog| @cancel_instrumentation = true; [true, false]}
|
|
516
|
+
progress_dialog.cancel_callback = lambda { |dialog| @cancel_instrumentation = true; [true, false] }
|
|
509
517
|
progress_dialog.enable_cancel_button
|
|
510
518
|
comments_removed_text = ruby_lex_utils.remove_comments(text)
|
|
511
519
|
num_lines = comments_removed_text.num_lines.to_f
|
|
@@ -609,7 +617,10 @@ module Cosmos
|
|
|
609
617
|
Logger.detail_string = detail_string
|
|
610
618
|
|
|
611
619
|
# Highlight the line that is about to run
|
|
612
|
-
Qt.execute_in_main_thread(true)
|
|
620
|
+
Qt.execute_in_main_thread(true) do
|
|
621
|
+
@active_script.center_line(line_number)
|
|
622
|
+
@active_script.highlight_line
|
|
623
|
+
end
|
|
613
624
|
|
|
614
625
|
# Handle pausing the script
|
|
615
626
|
handle_pause(filename, line_number)
|
|
@@ -1034,9 +1045,9 @@ module Cosmos
|
|
|
1034
1045
|
dialog_layout = Qt::VBoxLayout.new
|
|
1035
1046
|
|
|
1036
1047
|
chooser = FileChooser.new(self, "Config File", config_file, 'Select',
|
|
1037
|
-
File.
|
|
1048
|
+
File.dirname(config_file))
|
|
1038
1049
|
chooser.callback = lambda do |filename|
|
|
1039
|
-
chooser.filename =
|
|
1050
|
+
chooser.filename = filename
|
|
1040
1051
|
end
|
|
1041
1052
|
dialog_layout.addWidget(chooser)
|
|
1042
1053
|
|
|
@@ -1086,14 +1097,14 @@ module Cosmos
|
|
|
1086
1097
|
end
|
|
1087
1098
|
|
|
1088
1099
|
def scriptrunner_puts(string)
|
|
1089
|
-
puts Time.now.formatted + " (SCRIPTRUNNER): " + string
|
|
1100
|
+
puts Time.now.sys.formatted + " (SCRIPTRUNNER): " + string
|
|
1090
1101
|
end
|
|
1091
1102
|
|
|
1092
1103
|
def handle_output_io(filename = @current_filename, line_number = @current_line_number)
|
|
1093
|
-
@output_time = Time.now
|
|
1104
|
+
@output_time = Time.now.sys
|
|
1094
1105
|
Qt.execute_in_main_thread(true) do
|
|
1095
1106
|
if @output_io.string[-1..-1] == "\n"
|
|
1096
|
-
time_formatted = Time.now.formatted
|
|
1107
|
+
time_formatted = Time.now.sys.formatted
|
|
1097
1108
|
lines_to_write = ''
|
|
1098
1109
|
out_line_number = line_number.to_s
|
|
1099
1110
|
out_filename = File.basename(filename) if filename
|
|
@@ -1152,7 +1163,6 @@ module Cosmos
|
|
|
1152
1163
|
protected
|
|
1153
1164
|
|
|
1154
1165
|
def initialize_variables
|
|
1155
|
-
@@file_cache = {}
|
|
1156
1166
|
@@error = nil
|
|
1157
1167
|
@go = false
|
|
1158
1168
|
if @@step_mode
|
|
@@ -1165,7 +1175,7 @@ module Cosmos
|
|
|
1165
1175
|
@use_instrumentation = true
|
|
1166
1176
|
@active_script = @script
|
|
1167
1177
|
@call_stack = []
|
|
1168
|
-
@pre_line_time = Time.now
|
|
1178
|
+
@pre_line_time = Time.now.sys
|
|
1169
1179
|
@current_file = @filename
|
|
1170
1180
|
@exceptions = nil
|
|
1171
1181
|
@script_binding = nil
|
|
@@ -1199,7 +1209,7 @@ module Cosmos
|
|
|
1199
1209
|
def mark_running
|
|
1200
1210
|
Qt.execute_in_main_thread(true) do
|
|
1201
1211
|
@run_callback.call(self) if @run_callback
|
|
1202
|
-
@active_script.
|
|
1212
|
+
@active_script.highlight_line
|
|
1203
1213
|
@realtime_button_bar.state = 'Running'
|
|
1204
1214
|
@realtime_button_bar.start_button.setText('Go')
|
|
1205
1215
|
@realtime_button_bar.pause_button.setText('Pause')
|
|
@@ -1209,7 +1219,7 @@ module Cosmos
|
|
|
1209
1219
|
def mark_paused
|
|
1210
1220
|
Qt.execute_in_main_thread(true) do
|
|
1211
1221
|
@pause_callback.call(self) if @pause_callback
|
|
1212
|
-
@active_script.
|
|
1222
|
+
@active_script.highlight_line('lightblue')
|
|
1213
1223
|
@realtime_button_bar.state = 'Paused'
|
|
1214
1224
|
end
|
|
1215
1225
|
end
|
|
@@ -1217,7 +1227,7 @@ module Cosmos
|
|
|
1217
1227
|
def mark_error
|
|
1218
1228
|
Qt.execute_in_main_thread(true) do
|
|
1219
1229
|
@error_callback.call(self) if @error_callback
|
|
1220
|
-
@active_script.
|
|
1230
|
+
@active_script.highlight_line('pink')
|
|
1221
1231
|
@realtime_button_bar.state = 'Error'
|
|
1222
1232
|
@realtime_button_bar.pause_button.setText('Retry')
|
|
1223
1233
|
end
|
|
@@ -1235,7 +1245,7 @@ module Cosmos
|
|
|
1235
1245
|
|
|
1236
1246
|
def mark_breakpoint
|
|
1237
1247
|
Qt.execute_in_main_thread(true) do
|
|
1238
|
-
@active_script.
|
|
1248
|
+
@active_script.highlight_line('tan')
|
|
1239
1249
|
@realtime_button_bar.state = 'Breakpoint'
|
|
1240
1250
|
end
|
|
1241
1251
|
end
|
|
@@ -1291,7 +1301,7 @@ module Cosmos
|
|
|
1291
1301
|
|
|
1292
1302
|
# Execute the script with warnings disabled
|
|
1293
1303
|
Cosmos.disable_warnings do
|
|
1294
|
-
@pre_line_time = Time.now
|
|
1304
|
+
@pre_line_time = Time.now.sys
|
|
1295
1305
|
Cosmos.set_working_dir do
|
|
1296
1306
|
if text_binding
|
|
1297
1307
|
eval(instrumented_script, text_binding, @filename, 1)
|
|
@@ -1314,7 +1324,7 @@ module Cosmos
|
|
|
1314
1324
|
handle_exception(error, true, filename, line_number)
|
|
1315
1325
|
scriptrunner_puts "Exception in Control Statement - Script stopped: #{File.basename(@filename)}"
|
|
1316
1326
|
handle_output_io()
|
|
1317
|
-
Qt.execute_in_main_thread(true) {@script.
|
|
1327
|
+
Qt.execute_in_main_thread(true) { @script.highlight_line('red') }
|
|
1318
1328
|
end
|
|
1319
1329
|
ensure
|
|
1320
1330
|
# Change Go Button to Start Button and remove highlight
|
|
@@ -1417,10 +1427,10 @@ module Cosmos
|
|
|
1417
1427
|
|
|
1418
1428
|
def handle_line_delay
|
|
1419
1429
|
if @@line_delay > 0.0
|
|
1420
|
-
sleep_time = @@line_delay - (Time.now - @pre_line_time)
|
|
1430
|
+
sleep_time = @@line_delay - (Time.now.sys - @pre_line_time)
|
|
1421
1431
|
sleep(sleep_time) if sleep_time > 0.0
|
|
1422
1432
|
end
|
|
1423
|
-
@pre_line_time = Time.now
|
|
1433
|
+
@pre_line_time = Time.now.sys
|
|
1424
1434
|
end
|
|
1425
1435
|
|
|
1426
1436
|
def continue_without_pausing_on_errors?
|
|
@@ -1717,7 +1727,7 @@ module Cosmos
|
|
|
1717
1727
|
begin
|
|
1718
1728
|
loop do
|
|
1719
1729
|
break if @@cancel_output
|
|
1720
|
-
handle_output_io() if (Time.now - @output_time) > 5.0
|
|
1730
|
+
handle_output_io() if (Time.now.sys - @output_time) > 5.0
|
|
1721
1731
|
break if @@cancel_output
|
|
1722
1732
|
break if @@output_sleeper.sleep(1.0)
|
|
1723
1733
|
end # loop
|