cosmos 4.2.4 → 4.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.dockerignore +2 -0
- data/.github/ISSUE_TEMPLATE/bug_report.md +30 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +19 -0
- data/.github/ISSUE_TEMPLATE/help---usage---general-question.md +12 -0
- data/.gitignore +2 -0
- data/.travis.yml +6 -6
- data/Dockerfile +69 -0
- data/Gemfile +1 -1
- data/Manifest.txt +130 -46
- data/README.md +9 -0
- data/Rakefile +57 -0
- data/appveyor.yml +18 -7
- data/autohotkey/config/targets/INST/cmd_tlm/inst_cmds.txt +1 -1
- data/autohotkey/config/targets/INST/cmd_tlm/inst_tlm.txt +5 -5
- data/autohotkey/config/targets/INST/lib/sim_inst.rb +3 -1
- data/autohotkey/config/tools/cmd_sequence/cmd_sequence.txt +2 -0
- data/autohotkey/config/tools/handbook_creator/assets/css/bootstrap-theme.css +397 -0
- data/autohotkey/config/tools/handbook_creator/assets/css/bootstrap-theme.min.css +7 -0
- data/autohotkey/config/tools/handbook_creator/assets/css/bootstrap.css +7118 -0
- data/autohotkey/config/tools/handbook_creator/assets/css/bootstrap.min.css +7 -0
- data/autohotkey/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.eot +0 -0
- data/autohotkey/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.svg +229 -0
- data/autohotkey/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/autohotkey/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.woff +0 -0
- data/autohotkey/config/tools/handbook_creator/assets/js/bootstrap.js +2006 -0
- data/autohotkey/config/tools/handbook_creator/assets/js/bootstrap.min.js +7 -0
- data/autohotkey/config/tools/table_manager/ConfigTables_def.txt +2 -4
- data/autohotkey/config/tools/table_manager/SubTables/OneDimensionalSubTable_def.txt +31 -0
- data/autohotkey/config/tools/table_manager/SubTables/TwoDimensionalSubTable_def.txt +28 -0
- data/autohotkey/config/tools/test_runner/test_runner.txt +1 -1
- data/autohotkey/config/tools/test_runner/test_runner2.txt +1 -1
- data/autohotkey/config/tools/test_runner/test_runner3.txt +1 -1
- data/autohotkey/config/tools/test_runner/test_runner4.txt +1 -1
- data/autohotkey/lib/cmd_sequence_exporter.rb +52 -0
- data/autohotkey/procedures/collect.rb +2 -2
- data/autohotkey/procedures/collect_util.rb +1 -1
- data/autohotkey/procedures/script_test.rb +1 -1
- data/autohotkey/tools/CmdSenderAHK2 +18 -0
- data/autohotkey/tools/cmd_sender.ahk +34 -6
- data/autohotkey/tools/cmd_sender2.ahk +4 -0
- data/autohotkey/tools/cmd_sequence.ahk +36 -22
- data/autohotkey/tools/cmd_sequence2.ahk +1 -1
- data/autohotkey/tools/config_editor.ahk +5 -5
- data/autohotkey/tools/launcher.ahk +1 -0
- data/autohotkey/tools/limits_monitor.ahk +1 -1
- data/autohotkey/tools/packet_viewer.ahk +7 -6
- data/autohotkey/tools/script_runner.ahk +16 -4
- data/autohotkey/tools/test_runner.ahk +8 -8
- data/bin/cosmos +38 -1
- data/bin/cstol_converter +1 -1
- data/bin/dart_util +0 -0
- data/bin/rubysloc +73 -28
- data/bin/xtce_converter +1 -1
- data/cosmos.gemspec +7 -9
- data/data/config/_interfaces.yaml +4 -0
- data/data/config/cmd_sequence.yaml +14 -0
- data/data/config/command_modifiers.yaml +16 -1
- data/data/config/housekeeping_params.yaml +14 -0
- data/data/config/interface_modifiers.yaml +14 -2
- data/data/config/item_modifiers.yaml +11 -1
- data/data/config/launcher.yaml +12 -2
- data/data/config/param_item_modifiers.yaml +7 -2
- data/data/config/parameter_modifiers.yaml +20 -0
- data/data/config/screen.yaml +2 -0
- data/data/config/script_runner.yaml +9 -0
- data/data/config/system.yaml +152 -28
- data/data/config/table_manager.yaml +7 -0
- data/data/config/target.yaml +12 -0
- data/data/config/telemetry_modifiers.yaml +19 -2
- data/data/config/test_runner.yaml +10 -9
- data/data/config/widgets.yaml +174 -11
- data/data/crc.txt +428 -415
- data/demo/Gemfile +1 -1
- data/demo/Launcher.bat +1 -9
- data/demo/Launcher2.bat +1 -0
- data/demo/LauncherMini.bat +1 -0
- data/demo/Rakefile +2 -0
- data/demo/config/dart/Gemfile +2 -7
- data/demo/config/data/crc.txt +243 -219
- data/demo/config/system/system.txt +42 -3
- data/demo/config/system/system2.txt +34 -5
- data/demo/config/system/system_alt_ports.txt +80 -0
- data/demo/config/targets/EXAMPLE/cmd_tlm_server.txt +1 -0
- data/demo/config/targets/INST/cmd_tlm/inst_cmds.txt +5 -4
- data/demo/config/targets/INST/cmd_tlm/inst_tlm.txt +12 -7
- data/demo/config/targets/INST/cmd_tlm/inst_tlm_override.txt +12 -0
- data/demo/config/targets/INST/cmd_tlm_server.txt +2 -0
- data/demo/config/targets/INST/lib/sim_inst.rb +15 -3
- data/demo/config/targets/INST/screens/adcs.txt +2 -2
- data/demo/config/targets/INST/screens/block.txt +1 -1
- data/demo/config/targets/INST/screens/commanding.txt +1 -1
- data/demo/config/targets/INST/screens/ground.txt +27 -5
- data/demo/config/targets/INST/screens/ground_error.gif +0 -0
- data/demo/config/{data/groundoff.gif → targets/INST/screens/ground_off.gif} +0 -0
- data/demo/config/{data/groundon.gif → targets/INST/screens/ground_on.gif} +0 -0
- data/demo/config/targets/INST/screens/limits.txt +69 -31
- data/demo/config/targets/INST/screens/other.txt +13 -3
- data/demo/config/targets/INST/screens/params.txt +54 -0
- data/demo/config/targets/INST/screens/satellite.gif +0 -0
- data/demo/config/targets/INST/target.txt +1 -0
- data/demo/config/tools/cmd_tlm_server/cmd_tlm_server_chain.txt +18 -0
- data/demo/config/tools/data_viewer/data_viewer.txt +3 -0
- data/demo/config/tools/handbook_creator/assets/css/bootstrap-theme.css +397 -0
- data/demo/config/tools/handbook_creator/assets/css/bootstrap-theme.min.css +7 -0
- data/demo/config/tools/handbook_creator/assets/css/bootstrap.css +7118 -0
- data/demo/config/tools/handbook_creator/assets/css/bootstrap.min.css +7 -0
- data/demo/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.eot +0 -0
- data/demo/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.svg +229 -0
- data/demo/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/demo/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.woff +0 -0
- data/demo/config/tools/handbook_creator/assets/img/ball_logo.bmp +0 -0
- data/demo/config/tools/handbook_creator/assets/img/ball_logo.gif +0 -0
- data/demo/config/tools/handbook_creator/assets/img/ball_logo.jpg +0 -0
- data/demo/config/tools/handbook_creator/assets/js/bootstrap.js +2006 -0
- data/demo/config/tools/handbook_creator/assets/js/bootstrap.min.js +7 -0
- data/demo/config/tools/handbook_creator/assets/js/html5shiv.js +8 -0
- data/demo/config/tools/handbook_creator/assets/js/jquery-1.10.2.min.js +6 -0
- data/demo/config/tools/handbook_creator/assets/js/respond.min.js +6 -0
- data/demo/config/tools/handbook_creator/default_toc.xsl +59 -59
- data/demo/config/tools/script_runner/script_runner.txt +1 -2
- data/demo/config/tools/test_runner/test_runner.txt +3 -1
- data/demo/lib/example_background_task.rb +1 -0
- data/demo/procedures/cosmos_api_test.rb +26 -22
- data/demo/procedures/interactive.rb +22 -0
- data/demo/procedures/local_screen_example.rb +51 -0
- data/ext/cosmos/ext/cosmos_io/cosmos_io.c +32 -4
- data/ext/cosmos/ext/packet/packet.c +6 -77
- data/ext/mkrf_conf.rb +2 -2
- data/extensions/vscode/.gitignore +4 -0
- data/extensions/vscode/.vscode/launch.json +32 -0
- data/extensions/vscode/.vscode/settings.json +13 -0
- data/extensions/vscode/.vscode/tasks.json +79 -0
- data/extensions/vscode/License.txt +879 -0
- data/extensions/vscode/README.md +9 -0
- data/extensions/vscode/client/License.txt +879 -0
- data/extensions/vscode/client/README.md +39 -0
- data/extensions/vscode/client/cosmos.configuration.json +23 -0
- data/extensions/vscode/client/images/icon.png +0 -0
- data/extensions/vscode/client/package-lock.json +414 -0
- data/extensions/vscode/client/package.json +105 -0
- data/extensions/vscode/client/src/extension.ts +132 -0
- data/extensions/vscode/client/src/screen_preview.rb +25 -0
- data/extensions/vscode/client/syntaxes/cosmos.tmLanguage.json +219 -0
- data/extensions/vscode/client/tsconfig.json +17 -0
- data/extensions/vscode/package-lock.json +26 -0
- data/extensions/vscode/package.json +35 -0
- data/extensions/vscode/server/License.txt +879 -0
- data/extensions/vscode/server/package-lock.json +236 -0
- data/extensions/vscode/server/package.json +29 -0
- data/extensions/vscode/server/src/server.ts +59 -0
- data/extensions/vscode/server/tsconfig.json +16 -0
- data/install/Gemfile +1 -1
- data/install/Launcher.bat +1 -9
- data/install/config/dart/Gemfile +3 -8
- data/install/config/data/crc.txt +148 -132
- data/install/config/system/system.txt +36 -3
- data/install/config/tools/handbook_creator/assets/css/bootstrap-theme.css +397 -0
- data/install/config/tools/handbook_creator/assets/css/bootstrap-theme.min.css +7 -0
- data/install/config/tools/handbook_creator/assets/css/bootstrap.css +7118 -0
- data/install/config/tools/handbook_creator/assets/css/bootstrap.min.css +7 -0
- data/install/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.eot +0 -0
- data/install/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.svg +229 -0
- data/install/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/install/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.woff +0 -0
- data/install/config/tools/handbook_creator/assets/img/ball_logo.bmp +0 -0
- data/install/config/tools/handbook_creator/assets/img/ball_logo.gif +0 -0
- data/install/config/tools/handbook_creator/assets/img/ball_logo.jpg +0 -0
- data/install/config/tools/handbook_creator/assets/js/bootstrap.js +2006 -0
- data/install/config/tools/handbook_creator/assets/js/bootstrap.min.js +7 -0
- data/install/config/tools/handbook_creator/assets/js/html5shiv.js +8 -0
- data/install/config/tools/handbook_creator/assets/js/jquery-1.10.2.min.js +6 -0
- data/install/config/tools/handbook_creator/assets/js/respond.min.js +6 -0
- data/install/config/tools/handbook_creator/default_toc.xsl +59 -59
- data/lib/cosmos/config/config_parser.rb +4 -5
- data/lib/cosmos/conversions.rb +2 -0
- data/lib/cosmos/conversions/packet_time_formatted_conversion.rb +38 -0
- data/lib/cosmos/conversions/packet_time_seconds_conversion.rb +38 -0
- data/lib/cosmos/core_ext/cosmos_io.rb +2 -1
- data/lib/cosmos/core_ext/time.rb +3 -1
- data/lib/cosmos/dart/config/boot.rb +1 -1
- data/lib/cosmos/dart/config/database.yml +2 -0
- data/lib/cosmos/dart/examples/dart_decom_client.rb +1 -1
- data/lib/cosmos/dart/examples/dart_stream_client.rb +6 -2
- data/lib/cosmos/dart/lib/dart_common.rb +13 -6
- data/lib/cosmos/dart/lib/dart_constants.rb +15 -0
- data/lib/cosmos/dart/lib/dart_database_cleaner.rb +2 -2
- data/lib/cosmos/dart/lib/dart_decom_query.rb +5 -6
- data/lib/cosmos/dart/lib/dart_decommutator.rb +64 -54
- data/lib/cosmos/dart/lib/dart_importer.rb +3 -3
- data/lib/cosmos/dart/lib/dart_master_query.rb +71 -0
- data/lib/cosmos/dart/lib/dart_packet_log_writer.rb +2 -2
- data/lib/cosmos/dart/lib/dart_reducer_worker_thread.rb +165 -134
- data/lib/cosmos/dart/processes/dart.rb +4 -2
- data/lib/cosmos/dart/processes/dart_decom_server.rb +3 -3
- data/lib/cosmos/dart/processes/dart_ingester.rb +40 -1
- data/lib/cosmos/dart/processes/dart_master.rb +44 -0
- data/lib/cosmos/dart/processes/dart_util.rb +119 -4
- data/lib/cosmos/dart/spec/dart/dart_reducer_manager_spec.rb +3 -3
- data/lib/cosmos/gui/dialogs/cmd_tlm_raw_dialog.rb +9 -5
- data/lib/cosmos/gui/dialogs/details_dialog.rb +44 -29
- data/lib/cosmos/gui/dialogs/exception_list_dialog.rb +1 -1
- data/lib/cosmos/gui/dialogs/find_replace_dialog.rb +3 -3
- data/lib/cosmos/gui/dialogs/interface_raw_dialog.rb +2 -2
- data/lib/cosmos/gui/dialogs/set_tlm_dialog.rb +1 -1
- data/lib/cosmos/gui/dialogs/tlm_details_dialog.rb +11 -10
- data/lib/cosmos/gui/dialogs/tlm_graph_dialog.rb +4 -2
- data/lib/cosmos/gui/opengl/earth_model.rb +1 -1
- data/lib/cosmos/gui/qt.rb +13 -2
- data/lib/cosmos/gui/qt_tool.rb +71 -43
- data/lib/cosmos/gui/text/ruby_editor.rb +91 -49
- data/lib/cosmos/gui/utilities/classification_banner.rb +60 -0
- data/lib/cosmos/gui/utilities/screenshot.rb +1 -1
- data/lib/cosmos/gui/utilities/script_module_gui.rb +117 -91
- data/lib/cosmos/gui/widgets/dart_meta_frame.rb +22 -3
- data/lib/cosmos/interfaces.rb +2 -0
- data/lib/cosmos/interfaces/dart_status_interface.rb +1 -1
- data/lib/cosmos/interfaces/interface.rb +9 -1
- data/lib/cosmos/interfaces/linc_interface.rb +3 -3
- data/lib/cosmos/interfaces/protocols/burst_protocol.rb +1 -1
- data/lib/cosmos/interfaces/protocols/crc_protocol.rb +1 -1
- data/lib/cosmos/interfaces/protocols/fixed_protocol.rb +40 -18
- data/lib/cosmos/interfaces/protocols/ignore_packet_protocol.rb +46 -0
- data/lib/cosmos/interfaces/protocols/length_protocol.rb +5 -0
- data/lib/cosmos/interfaces/protocols/preidentified_protocol.rb +68 -23
- data/lib/cosmos/interfaces/protocols/template_protocol.rb +9 -4
- data/lib/cosmos/interfaces/serial_interface.rb +7 -1
- data/lib/cosmos/interfaces/simulated_target_interface.rb +14 -5
- data/lib/cosmos/interfaces/stream_interface.rb +1 -1
- data/lib/cosmos/interfaces/tcpip_server_interface.rb +13 -13
- data/lib/cosmos/io/json_drb.rb +16 -12
- data/lib/cosmos/io/json_drb_object.rb +7 -2
- data/lib/cosmos/io/json_drb_rack.rb +25 -5
- data/lib/cosmos/io/json_rpc.rb +1 -1
- data/lib/cosmos/io/posix_serial_driver.rb +60 -22
- data/lib/cosmos/io/serial_driver.rb +11 -8
- data/lib/cosmos/io/win32_serial_driver.rb +31 -3
- data/lib/cosmos/packet_logs/packet_log_reader.rb +71 -28
- data/lib/cosmos/packet_logs/packet_log_writer.rb +13 -1
- data/lib/cosmos/packets/commands.rb +30 -9
- data/lib/cosmos/packets/packet.rb +105 -34
- data/lib/cosmos/packets/packet_config.rb +60 -10
- data/lib/cosmos/packets/parsers/format_string_parser.rb +0 -1
- data/lib/cosmos/packets/parsers/state_parser.rb +0 -1
- data/lib/cosmos/packets/parsers/xtce_converter.rb +2 -0
- data/lib/cosmos/packets/parsers/xtce_parser.rb +5 -4
- data/lib/cosmos/packets/structure.rb +32 -4
- data/lib/cosmos/packets/structure_item.rb +5 -1
- data/lib/cosmos/packets/telemetry.rb +30 -4
- data/lib/cosmos/script/api_shared.rb +22 -10
- data/lib/cosmos/script/extract.rb +1 -1
- data/lib/cosmos/script/limits.rb +4 -0
- data/lib/cosmos/script/script.rb +29 -20
- data/lib/cosmos/script/scripting.rb +16 -14
- data/lib/cosmos/script/telemetry.rb +3 -1
- data/lib/cosmos/script/tools.rb +18 -8
- data/lib/cosmos/streams/serial_stream.rb +11 -6
- data/lib/cosmos/system/system.rb +214 -76
- data/lib/cosmos/system/target.rb +39 -9
- data/lib/cosmos/tools/cmd_extractor/cmd_extractor.rb +116 -55
- data/lib/cosmos/tools/cmd_sender/cmd_param_table_item_delegate.rb +15 -0
- data/lib/cosmos/tools/cmd_sender/cmd_params.rb +382 -0
- data/lib/cosmos/tools/cmd_sender/cmd_sender.rb +54 -340
- data/lib/cosmos/tools/cmd_sequence/cmd_sequence.rb +74 -52
- data/lib/cosmos/tools/cmd_sequence/sequence_item.rb +40 -333
- data/lib/cosmos/tools/cmd_sequence/sequence_list.rb +16 -11
- data/lib/cosmos/tools/cmd_tlm_server/api.rb +13 -0
- data/lib/cosmos/tools/cmd_tlm_server/background_tasks.rb +2 -0
- data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb +44 -15
- data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_config.rb +8 -1
- data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_gui.rb +18 -20
- data/lib/cosmos/tools/cmd_tlm_server/commanding.rb +13 -2
- data/lib/cosmos/tools/cmd_tlm_server/gui/interfaces_tab.rb +2 -2
- data/lib/cosmos/tools/cmd_tlm_server/gui/logging_tab.rb +13 -13
- data/lib/cosmos/tools/cmd_tlm_server/gui/packets_tab.rb +9 -6
- data/lib/cosmos/tools/cmd_tlm_server/gui/status_tab.rb +8 -8
- data/lib/cosmos/tools/cmd_tlm_server/gui/targets_tab.rb +5 -5
- data/lib/cosmos/tools/cmd_tlm_server/interface_thread.rb +35 -20
- data/lib/cosmos/tools/cmd_tlm_server/replay_backend.rb +15 -11
- data/lib/cosmos/tools/cmd_tlm_server/router_thread.rb +5 -0
- data/lib/cosmos/tools/cmd_tlm_server/routers.rb +2 -0
- data/lib/cosmos/tools/config_editor/config_editor.rb +181 -94
- data/lib/cosmos/tools/config_editor/config_editor_frame.rb +10 -9
- data/lib/cosmos/tools/config_editor/system_config_dialog.rb +158 -0
- data/lib/cosmos/tools/data_viewer/data_viewer.rb +57 -47
- data/lib/cosmos/tools/data_viewer/data_viewer_component.rb +1 -0
- data/lib/cosmos/tools/data_viewer/dump_component.rb +3 -9
- data/lib/cosmos/tools/data_viewer/text_component.rb +77 -0
- data/lib/cosmos/tools/handbook_creator/handbook_creator.rb +68 -42
- data/lib/cosmos/tools/handbook_creator/handbook_creator_config.rb +1 -1
- data/lib/cosmos/tools/launcher/launcher.rb +2 -1
- data/lib/cosmos/tools/limits_monitor/limits_monitor.rb +59 -41
- data/lib/cosmos/tools/opengl_builder/opengl_builder.rb +42 -42
- data/lib/cosmos/tools/packet_viewer/packet_viewer.rb +64 -59
- data/lib/cosmos/tools/script_runner/script_runner.rb +198 -123
- data/lib/cosmos/tools/script_runner/script_runner_config.rb +14 -0
- data/lib/cosmos/tools/script_runner/script_runner_frame.rb +87 -35
- data/lib/cosmos/tools/table_manager/table_config.rb +5 -3
- data/lib/cosmos/tools/table_manager/table_manager.rb +48 -45
- data/lib/cosmos/tools/test_runner/test.rb +5 -2
- data/lib/cosmos/tools/test_runner/test_runner.rb +61 -38
- data/lib/cosmos/tools/test_runner/test_runner_chooser.rb +24 -12
- data/lib/cosmos/tools/tlm_extractor/tlm_extractor.rb +48 -48
- data/lib/cosmos/tools/tlm_extractor/tlm_extractor_config.rb +5 -8
- data/lib/cosmos/tools/tlm_extractor/tlm_extractor_processor.rb +20 -16
- data/lib/cosmos/tools/tlm_grapher/data_object_adders/xy_data_object_adder.rb +3 -3
- data/lib/cosmos/tools/tlm_grapher/data_object_editors/housekeeping_data_object_editor.rb +7 -7
- data/lib/cosmos/tools/tlm_grapher/data_object_editors/xy_data_object_editor.rb +10 -10
- data/lib/cosmos/tools/tlm_grapher/data_objects/housekeeping_data_object.rb +10 -3
- data/lib/cosmos/tools/tlm_grapher/data_objects/xy_data_object.rb +6 -6
- data/lib/cosmos/tools/tlm_grapher/tabbed_plots/overview_tabbed_plots.rb +14 -14
- data/lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_dart_thread.rb +21 -17
- data/lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_realtime_thread.rb +5 -8
- data/lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_tool.rb +94 -91
- data/lib/cosmos/tools/tlm_grapher/tlm_grapher.rb +27 -26
- data/lib/cosmos/tools/tlm_viewer/screen.rb +76 -14
- data/lib/cosmos/tools/tlm_viewer/tlm_viewer.rb +51 -34
- data/lib/cosmos/tools/tlm_viewer/widgets.rb +3 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/aging_widget.rb +4 -5
- data/lib/cosmos/tools/tlm_viewer/widgets/array_widget.rb +3 -4
- data/lib/cosmos/tools/tlm_viewer/widgets/block_widget.rb +4 -5
- data/lib/cosmos/tools/tlm_viewer/widgets/canvas_clickable.rb +16 -2
- data/lib/cosmos/tools/tlm_viewer/widgets/canvas_widget.rb +17 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/canvasdot_widget.rb +1 -2
- data/lib/cosmos/tools/tlm_viewer/widgets/canvasellipse_widget.rb +40 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/canvasimage_widget.rb +12 -7
- data/lib/cosmos/tools/tlm_viewer/widgets/canvasimagevalue_widget.rb +79 -29
- data/lib/cosmos/tools/tlm_viewer/widgets/canvaslabel_widget.rb +1 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/canvaslabelvalue_widget.rb +2 -1
- data/lib/cosmos/tools/tlm_viewer/widgets/canvasline_widget.rb +2 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/canvaslinevalue_widget.rb +4 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/canvasvalue_widget.rb +33 -25
- data/lib/cosmos/tools/tlm_viewer/widgets/checkbutton_widget.rb +5 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/combobox_widget.rb +5 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb +1 -1
- data/lib/cosmos/tools/tlm_viewer/widgets/formatvalue_widget.rb +4 -7
- data/lib/cosmos/tools/tlm_viewer/widgets/horizontal_widget.rb +5 -5
- data/lib/cosmos/tools/tlm_viewer/widgets/horizontalbox_widget.rb +6 -7
- data/lib/cosmos/tools/tlm_viewer/widgets/horizontalline_widget.rb +2 -4
- data/lib/cosmos/tools/tlm_viewer/widgets/label_widget.rb +10 -8
- data/lib/cosmos/tools/tlm_viewer/widgets/labelformatvalue_widget.rb +2 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/labelled_widget.rb +58 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/labelprogressbar_widget.rb +3 -4
- data/lib/cosmos/tools/tlm_viewer/widgets/labeltrendlimitsbar_widget.rb +2 -4
- data/lib/cosmos/tools/tlm_viewer/widgets/labelvalue_widget.rb +2 -1
- data/lib/cosmos/tools/tlm_viewer/widgets/labelvaluedesc_widget.rb +3 -5
- data/lib/cosmos/tools/tlm_viewer/widgets/labelvaluelimitsbar_widget.rb +2 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/labelvaluelimitscolumn_widget.rb +2 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/labelvaluerangebar_widget.rb +2 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/labelvaluerangecolumn_widget.rb +2 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/layout_widget.rb +3 -5
- data/lib/cosmos/tools/tlm_viewer/widgets/led_widget.rb +108 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/limits_widget.rb +60 -10
- data/lib/cosmos/tools/tlm_viewer/widgets/limitsbar_widget.rb +22 -8
- data/lib/cosmos/tools/tlm_viewer/widgets/limitscolor_widget.rb +19 -13
- data/lib/cosmos/tools/tlm_viewer/widgets/limitscolumn_widget.rb +22 -8
- data/lib/cosmos/tools/tlm_viewer/widgets/linegraph_widget.rb +2 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/matrixbycolumns_widget.rb +4 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/multi_widget.rb +1 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/progressbar_widget.rb +10 -5
- data/lib/cosmos/tools/tlm_viewer/widgets/radiobutton_widget.rb +7 -4
- data/lib/cosmos/tools/tlm_viewer/widgets/rangebar_widget.rb +4 -6
- data/lib/cosmos/tools/tlm_viewer/widgets/rangecolumn_widget.rb +3 -5
- data/lib/cosmos/tools/tlm_viewer/widgets/screenshotbutton_widget.rb +4 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/scrollwindow_widget.rb +2 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/sectionheader_widget.rb +2 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/spacer_widget.rb +4 -6
- data/lib/cosmos/tools/tlm_viewer/widgets/tabbook_widget.rb +2 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/tabitem_widget.rb +2 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/textbox_widget.rb +13 -4
- data/lib/cosmos/tools/tlm_viewer/widgets/textfield_widget.rb +3 -4
- data/lib/cosmos/tools/tlm_viewer/widgets/timegraph_widget.rb +3 -8
- data/lib/cosmos/tools/tlm_viewer/widgets/title_widget.rb +6 -12
- data/lib/cosmos/tools/tlm_viewer/widgets/trendbar_widget.rb +5 -10
- data/lib/cosmos/tools/tlm_viewer/widgets/trendlimitsbar_widget.rb +5 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/value_widget.rb +4 -4
- data/lib/cosmos/tools/tlm_viewer/widgets/valuelimitsbar_widget.rb +2 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/valuelimitscolumn_widget.rb +2 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/valuerangebar_widget.rb +3 -4
- data/lib/cosmos/tools/tlm_viewer/widgets/valuerangecolumn_widget.rb +2 -3
- data/lib/cosmos/tools/tlm_viewer/widgets/vertical_widget.rb +8 -7
- data/lib/cosmos/tools/tlm_viewer/widgets/verticalbox_widget.rb +9 -7
- data/lib/cosmos/tools/tlm_viewer/widgets/widget.rb +60 -47
- data/lib/cosmos/top_level.rb +37 -13
- data/lib/cosmos/utilities/ruby_lex_utils.rb +34 -30
- data/lib/cosmos/version.rb +5 -5
- data/lib/cosmos/win32/excel.rb +81 -24
- data/make_gems.sh +10 -0
- data/run_gui_tests.bat +1 -0
- data/spec/conversions/packet_time_formatted_conversion_spec.rb +58 -0
- data/spec/conversions/packet_time_seconds_conversion_spec.rb +60 -0
- data/spec/core_ext/socket_spec.rb +1 -1
- data/spec/core_ext/time_spec.rb +4 -0
- data/spec/gui/utilities/script_module_gui_spec.rb +44 -63
- data/spec/install/config/targets/INST/cmd_tlm/inst_cmds.txt +1 -1
- data/spec/install/config/targets/INST/cmd_tlm/inst_tlm.txt +5 -5
- data/spec/install/yaml_docs_spec.rb +132 -0
- data/spec/interfaces/linc_interface_spec.rb +1 -1
- data/spec/interfaces/protocols/fixed_protocol_spec.rb +20 -9
- data/spec/interfaces/protocols/ignore_packet_protocol_spec.rb +243 -0
- data/spec/interfaces/protocols/length_protocol_spec.rb +39 -0
- data/spec/interfaces/protocols/preidentified_protocol_spec.rb +227 -4
- data/spec/interfaces/protocols/template_protocol_spec.rb +78 -25
- data/spec/io/json_drb_rack_spec.rb +166 -0
- data/spec/io/json_drb_spec.rb +14 -0
- data/spec/io/json_rpc_spec.rb +4 -5
- data/spec/io/posix_serial_driver_spec.rb +81 -0
- data/spec/io/serial_driver_spec.rb +15 -13
- data/spec/io/win32_serial_driver_spec.rb +33 -3
- data/spec/packet_logs/packet_log_reader_spec.rb +106 -52
- data/spec/packets/commands_spec.rb +22 -0
- data/spec/packets/packet_config_spec.rb +29 -16
- data/spec/packets/packet_item_spec.rb +2 -2
- data/spec/packets/packet_spec.rb +39 -6
- data/spec/packets/parsers/format_string_parser_spec.rb +0 -11
- data/spec/packets/parsers/macro_parser_spec.rb +36 -36
- data/spec/packets/parsers/state_parser_spec.rb +69 -11
- data/spec/packets/structure_spec.rb +93 -2
- data/spec/packets/telemetry_spec.rb +63 -10
- data/spec/script/extract_spec.rb +4 -1
- data/spec/script/script_spec.rb +2 -3
- data/spec/script/scripting_spec.rb +2 -1
- data/spec/script/tools_spec.rb +0 -1
- data/spec/streams/tcpip_socket_stream_spec.rb +32 -27
- data/spec/system/system_spec.rb +187 -4
- data/spec/system/target_spec.rb +62 -1
- data/spec/tools/cmd_tlm_server/api_spec.rb +29 -21
- data/spec/tools/cmd_tlm_server/background_tasks_spec.rb +15 -7
- data/spec/tools/cmd_tlm_server/cmd_tlm_server_config_spec.rb +33 -0
- data/spec/tools/cmd_tlm_server/commanding_spec.rb +25 -1
- data/spec/tools/cmd_tlm_server/interface_thread_spec.rb +15 -0
- data/spec/tools/cmd_tlm_server/router_thread_spec.rb +2 -3
- data/spec/top_level/top_level_spec.rb +29 -5
- data/spec/utilities/message_log_spec.rb +6 -3
- data/tasks/gemfile_stats.rake +38 -14
- data/test/performance/config/system/system.txt +0 -0
- data/test/performance/config/targets/PACKET/cmd_tlm/packet_tlm.txt +5 -5
- data/test/performance/config/tools/handbook_creator/assets/css/bootstrap-theme.css +397 -0
- data/test/performance/config/tools/handbook_creator/assets/css/bootstrap-theme.min.css +7 -0
- data/test/performance/config/tools/handbook_creator/assets/css/bootstrap.css +7118 -0
- data/test/performance/config/tools/handbook_creator/assets/css/bootstrap.min.css +7 -0
- data/test/performance/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.eot +0 -0
- data/test/performance/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.svg +229 -0
- data/test/performance/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/test/performance/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.woff +0 -0
- data/test/performance/config/tools/handbook_creator/assets/img/ball_logo.bmp +0 -0
- data/test/performance/config/tools/handbook_creator/assets/img/ball_logo.gif +0 -0
- data/test/performance/config/tools/handbook_creator/assets/img/ball_logo.jpg +0 -0
- data/test/performance/config/tools/handbook_creator/assets/js/bootstrap.js +2006 -0
- data/test/performance/config/tools/handbook_creator/assets/js/bootstrap.min.js +7 -0
- data/test/performance/config/tools/handbook_creator/assets/js/html5shiv.js +8 -0
- data/test/performance/config/tools/handbook_creator/assets/js/jquery-1.10.2.min.js +6 -0
- data/test/performance/config/tools/handbook_creator/assets/js/respond.min.js +6 -0
- data/test/performance/config/tools/test_runner/test_runner.txt +1 -1
- data/test/performance/procedures/cosmos_api_test.rb +1 -1
- data/test/performance/tools/identify_performance.rb +82 -0
- metadata +154 -64
- data/lib/cosmos/dart/Gemfile +0 -69
@@ -16,12 +16,16 @@ module Cosmos
|
|
16
16
|
# Processes the config file
|
17
17
|
def initialize(filename)
|
18
18
|
return unless filename
|
19
|
+
@filename = filename
|
19
20
|
parser = ConfigParser.new("http://cosmosrb.com/docs/tools/#script-runner-configuration")
|
20
21
|
parser.parse_file(filename) do |keyword, params|
|
21
22
|
case keyword
|
22
23
|
when 'LINE_DELAY'
|
23
24
|
parser.verify_num_parameters(1, 1, "#{keyword} <Delay in Seconds>")
|
24
25
|
ScriptRunnerFrame.line_delay = params[0].to_f
|
26
|
+
when 'PAUSE_ON_ERROR'
|
27
|
+
parser.verify_num_parameters(1, 1, "#{keyword} <TRUE or FALSE>")
|
28
|
+
ScriptRunnerFrame.pause_on_error = ConfigParser.handle_true_false(params[0])
|
25
29
|
when 'MONITOR_LIMITS'
|
26
30
|
parser.verify_num_parameters(0, 0, keyword)
|
27
31
|
ScriptRunnerFrame.monitor_limits = true
|
@@ -35,5 +39,15 @@ module Cosmos
|
|
35
39
|
end
|
36
40
|
end
|
37
41
|
end
|
42
|
+
|
43
|
+
def write_config
|
44
|
+
@filename = File.join(Cosmos::USERPATH, 'config', 'tools', 'script_runner', 'script_runner.txt') unless @filename
|
45
|
+
File.open(@filename, 'w') do |file|
|
46
|
+
file.puts("LINE_DELAY #{ScriptRunnerFrame.line_delay}")
|
47
|
+
file.puts("PAUSE_ON_ERROR #{ScriptRunnerFrame.pause_on_error ? 'TRUE' : 'FALSE'}")
|
48
|
+
file.puts("MONITOR_LIMITS") if ScriptRunnerFrame.monitor_limits
|
49
|
+
file.puts("PAUSE_ON_RED") if ScriptRunnerFrame.pause_on_red
|
50
|
+
end
|
51
|
+
end
|
38
52
|
end
|
39
53
|
end
|
@@ -89,6 +89,9 @@ module Cosmos
|
|
89
89
|
SET_TLM_KEYWORDS = %w(set_tlm set_tlm_raw override_tlm_raw normalize_tlm_raw)
|
90
90
|
CHECK_KEYWORDS = %w(check check_raw wait wait_raw wait_check wait_check_raw)
|
91
91
|
|
92
|
+
INSTANCE_VARS = %w(__return_val close_on_complete error eval_error filename instrumented_script \
|
93
|
+
line_number line_offset saved_instance saved_run_thread text text_binding uncaught_exception)
|
94
|
+
|
92
95
|
attr_accessor :use_instrumentation
|
93
96
|
attr_accessor :change_callback
|
94
97
|
attr_accessor :run_callback
|
@@ -99,8 +102,8 @@ module Cosmos
|
|
99
102
|
attr_accessor :continue_after_error
|
100
103
|
attr_accessor :exceptions
|
101
104
|
attr_accessor :script_binding
|
102
|
-
attr_accessor :inline_return
|
103
|
-
attr_accessor :inline_return_params
|
105
|
+
attr_accessor :inline_return # Deprecated and unused - Here to prevent cache errors for old scripts
|
106
|
+
attr_accessor :inline_return_params # Deprecated and unused - Here to prevent cache errors for old scripts
|
104
107
|
attr_reader :message_log
|
105
108
|
attr_reader :script_class
|
106
109
|
attr_reader :top_level_instrumented_cache
|
@@ -126,6 +129,7 @@ module Cosmos
|
|
126
129
|
@@cancel_output = false
|
127
130
|
@@cancel_limits = false
|
128
131
|
@@file_number = 1
|
132
|
+
@@default_font = Cosmos.get_default_font
|
129
133
|
|
130
134
|
def initialize(parent, default_tab_text = 'Untitled')
|
131
135
|
super(parent)
|
@@ -252,7 +256,7 @@ module Cosmos
|
|
252
256
|
|
253
257
|
def create_ruby_editor
|
254
258
|
# Add Initial Text Window
|
255
|
-
script = RubyEditor.new(self)
|
259
|
+
script = RubyEditor.new(self, @@default_font)
|
256
260
|
script.enable_breakpoints = true if @debug_frame
|
257
261
|
connect(script,
|
258
262
|
SIGNAL('breakpoint_set(int)'),
|
@@ -266,6 +270,10 @@ module Cosmos
|
|
266
270
|
SIGNAL('breakpoints_cleared()'),
|
267
271
|
self,
|
268
272
|
SLOT('breakpoints_cleared()'))
|
273
|
+
script.connect(SIGNAL('font_changed(QFont)')) do |font|
|
274
|
+
# Remember changed fonts for future tabs
|
275
|
+
@@default_font = font
|
276
|
+
end
|
269
277
|
|
270
278
|
# Add right click menu
|
271
279
|
script.setContextMenuPolicy(Qt::CustomContextMenu)
|
@@ -315,6 +323,10 @@ module Cosmos
|
|
315
323
|
@script.setFocus
|
316
324
|
end
|
317
325
|
|
326
|
+
def active_script_highlight(color)
|
327
|
+
Qt.execute_in_main_thread { @active_script.highlight_line(color) }
|
328
|
+
end
|
329
|
+
|
318
330
|
def allow_start=(value)
|
319
331
|
@allow_start = value
|
320
332
|
if @allow_start
|
@@ -560,10 +572,18 @@ module Cosmos
|
|
560
572
|
return nil if @cancel_instrumentation
|
561
573
|
instrumented_line = ''
|
562
574
|
if instrumentable
|
563
|
-
#
|
564
|
-
#
|
575
|
+
# Add a newline if it's empty to ensure the instrumented code has
|
576
|
+
# the same number of lines as the original script. Note that the
|
577
|
+
# segment could have originally had comments but they were stripped in
|
565
578
|
# ruby_lex_utils.remove_comments
|
566
|
-
|
579
|
+
if segment.strip.empty?
|
580
|
+
instrumented_text << "\n"
|
581
|
+
next
|
582
|
+
end
|
583
|
+
|
584
|
+
# Create a variable to hold the segment's return value
|
585
|
+
instrumented_line << "__return_val = nil; "
|
586
|
+
|
567
587
|
# If not inside a begin block then create one to catch exceptions
|
568
588
|
unless inside_begin
|
569
589
|
instrumented_line << 'begin; '
|
@@ -571,24 +591,23 @@ module Cosmos
|
|
571
591
|
|
572
592
|
# Add preline instrumentation
|
573
593
|
instrumented_line << "ScriptRunnerFrame.instance.script_binding = binding(); "\
|
574
|
-
"if ScriptRunnerFrame.instance.inline_return then ScriptRunnerFrame.instance.inline_return = nil; "\
|
575
|
-
"return ScriptRunnerFrame.instance.inline_return_params; end; "\
|
576
594
|
"ScriptRunnerFrame.instance.pre_line_instrumentation('#{filename}', #{line_no}); "
|
577
595
|
|
578
596
|
# Add the actual line
|
597
|
+
instrumented_line << "__return_val = begin; "
|
579
598
|
instrumented_line << segment
|
580
599
|
instrumented_line.chomp!
|
581
600
|
|
582
601
|
# Add postline instrumentation
|
583
|
-
instrumented_line << "; ScriptRunnerFrame.instance.post_line_instrumentation('#{filename}', #{line_no})"
|
602
|
+
instrumented_line << " end; ScriptRunnerFrame.instance.post_line_instrumentation('#{filename}', #{line_no}); "
|
584
603
|
|
585
604
|
# Complete begin block to catch exceptions
|
586
605
|
unless inside_begin
|
587
|
-
instrumented_line << "
|
588
|
-
"retry if ScriptRunnerFrame.instance.exception_instrumentation(eval_error, '#{filename}', #{line_no}); end"
|
606
|
+
instrumented_line << "rescue Exception => eval_error; "\
|
607
|
+
"retry if ScriptRunnerFrame.instance.exception_instrumentation(eval_error, '#{filename}', #{line_no}); end; "
|
589
608
|
end
|
590
609
|
|
591
|
-
instrumented_line << "\n"
|
610
|
+
instrumented_line << " __return_val\n"
|
592
611
|
else
|
593
612
|
unless segment =~ /^\s*end\s*$/ or segment =~ /^\s*when .*$/
|
594
613
|
num_left_brackets = segment.count('{')
|
@@ -659,7 +678,7 @@ module Cosmos
|
|
659
678
|
def exception_instrumentation(error, filename, line_number)
|
660
679
|
if error.class == StopScript || error.class == SkipTestCase || !@use_instrumentation
|
661
680
|
Kernel.raise error
|
662
|
-
|
681
|
+
elsif !error.eql?(@@error)
|
663
682
|
line_number = line_number + @line_offset if @active_script.object_id == @script.object_id
|
664
683
|
handle_exception(error, false, filename, line_number)
|
665
684
|
end
|
@@ -752,6 +771,21 @@ module Cosmos
|
|
752
771
|
@script.comment_or_uncomment_lines unless running?()
|
753
772
|
end
|
754
773
|
|
774
|
+
def zoom_in
|
775
|
+
# @active_script since this can be used while running
|
776
|
+
@active_script.zoom_in
|
777
|
+
end
|
778
|
+
|
779
|
+
def zoom_out
|
780
|
+
# @active_script since this can be used while running
|
781
|
+
@active_script.zoom_out
|
782
|
+
end
|
783
|
+
|
784
|
+
def zoom_default
|
785
|
+
# @active_script since this can be used while running
|
786
|
+
@active_script.zoom_default
|
787
|
+
end
|
788
|
+
|
755
789
|
##################################################################################
|
756
790
|
# Implement Script functionality in the frame (run selection, run from cursor, etc
|
757
791
|
##################################################################################
|
@@ -935,6 +969,10 @@ module Cosmos
|
|
935
969
|
end
|
936
970
|
|
937
971
|
if @script_binding
|
972
|
+
# Check for accessing an instance variable or local
|
973
|
+
if debug_text =~ /^@\S+$/ || @script_binding.local_variables.include?(debug_text.to_sym)
|
974
|
+
debug_text = "puts #{debug_text}" # Automatically add puts to print it
|
975
|
+
end
|
938
976
|
eval(debug_text, @script_binding, 'debug', 1)
|
939
977
|
else
|
940
978
|
Object.class_eval(debug_text, 'debug', 1)
|
@@ -972,17 +1010,20 @@ module Cosmos
|
|
972
1010
|
@debug_text.setPlainText("")
|
973
1011
|
end
|
974
1012
|
end
|
975
|
-
|
976
1013
|
@debug_frame.addWidget(@debug_text)
|
977
1014
|
|
978
|
-
@
|
979
|
-
@
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
1015
|
+
@locals_button = Qt::PushButton.new('Locals')
|
1016
|
+
@locals_button.connect(SIGNAL('clicked(bool)')) do
|
1017
|
+
next unless @script_binding
|
1018
|
+
@locals_button.setEnabled(false)
|
1019
|
+
vars = @script_binding.local_variables.map(&:to_s)
|
1020
|
+
puts "Locals: #{vars.reject {|x| INSTANCE_VARS.include?(x)}.sort.join(', ')}"
|
1021
|
+
while @output_io.string[-1..-1] == "\n"
|
1022
|
+
Qt::CoreApplication.processEvents()
|
1023
|
+
end
|
1024
|
+
@locals_button.setEnabled(true)
|
985
1025
|
end
|
1026
|
+
@debug_frame.addWidget(@locals_button)
|
986
1027
|
|
987
1028
|
@bottom_frame.layout.addLayout(@debug_frame)
|
988
1029
|
end
|
@@ -1060,7 +1101,7 @@ module Cosmos
|
|
1060
1101
|
|
1061
1102
|
def toggle_disconnect(config_file, ask_for_config_file = true)
|
1062
1103
|
dialog = Qt::Dialog.new(self, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
|
1063
|
-
dialog.setWindowTitle(
|
1104
|
+
dialog.setWindowTitle("Disconnect Settings")
|
1064
1105
|
dialog_layout = Qt::VBoxLayout.new
|
1065
1106
|
dialog_layout.addWidget(Qt::Label.new("Targets checked will be disconnected."))
|
1066
1107
|
|
@@ -1156,7 +1197,7 @@ module Cosmos
|
|
1156
1197
|
Splash.execute(self) do |splash|
|
1157
1198
|
ConfigParser.splash = splash
|
1158
1199
|
splash.message = "Initializing Command and Telemetry Server"
|
1159
|
-
set_disconnected_targets(targets, config_file)
|
1200
|
+
set_disconnected_targets(targets, targets.length == all_targets.length, config_file)
|
1160
1201
|
ConfigParser.splash = nil
|
1161
1202
|
end
|
1162
1203
|
end
|
@@ -1357,7 +1398,13 @@ module Cosmos
|
|
1357
1398
|
$stdout.add_stream(@output_io)
|
1358
1399
|
$stderr.add_stream(@output_io)
|
1359
1400
|
|
1360
|
-
|
1401
|
+
unless close_on_complete
|
1402
|
+
scriptrunner_puts("Starting script: #{File.basename(@filename)}")
|
1403
|
+
targets = get_disconnected_targets()
|
1404
|
+
if targets
|
1405
|
+
scriptrunner_puts("DISCONNECTED targets: #{targets.join(',')}")
|
1406
|
+
end
|
1407
|
+
end
|
1361
1408
|
handle_output_io()
|
1362
1409
|
|
1363
1410
|
# Start Limits Monitoring
|
@@ -1627,33 +1674,33 @@ module Cosmos
|
|
1627
1674
|
menu = current_script.context_menu(point)
|
1628
1675
|
menu.addSeparator()
|
1629
1676
|
if not self.class.running?
|
1630
|
-
exec_selected_action = Qt::Action.new(
|
1631
|
-
exec_selected_action.statusTip =
|
1677
|
+
exec_selected_action = Qt::Action.new("Execute Selected Lines", self)
|
1678
|
+
exec_selected_action.statusTip = "Execute the selected lines as a standalone script"
|
1632
1679
|
exec_selected_action.connect(SIGNAL('triggered()')) { run_selection() }
|
1633
1680
|
menu.addAction(exec_selected_action)
|
1634
1681
|
|
1635
|
-
exec_cursor_action = Qt::Action.new(
|
1636
|
-
exec_cursor_action.statusTip =
|
1682
|
+
exec_cursor_action = Qt::Action.new("Execute From Cursor", self)
|
1683
|
+
exec_cursor_action.statusTip = "Execute the script starting at the line containing the cursor"
|
1637
1684
|
exec_cursor_action.connect(SIGNAL('triggered()')) { run_from_cursor() }
|
1638
1685
|
menu.addAction(exec_cursor_action)
|
1639
1686
|
|
1640
1687
|
menu.addSeparator()
|
1641
1688
|
|
1642
1689
|
if RUBY_VERSION.split('.')[0].to_i > 1
|
1643
|
-
syntax_action = Qt::Action.new(
|
1644
|
-
syntax_action.statusTip =
|
1690
|
+
syntax_action = Qt::Action.new("Ruby Syntax Check Selected Lines", self)
|
1691
|
+
syntax_action.statusTip = "Check the selected lines for valid Ruby syntax"
|
1645
1692
|
syntax_action.connect(SIGNAL('triggered()')) { ruby_syntax_check_selection() }
|
1646
1693
|
menu.addAction(syntax_action)
|
1647
1694
|
end
|
1648
1695
|
|
1649
|
-
mnemonic_action = Qt::Action.new(
|
1650
|
-
mnemonic_action.statusTip =
|
1696
|
+
mnemonic_action = Qt::Action.new("Mnemonic Check Selected Lines", self)
|
1697
|
+
mnemonic_action.statusTip = "Check the selected lines for valid targets, packets, mnemonics and parameters"
|
1651
1698
|
mnemonic_action.connect(SIGNAL('triggered()')) { mnemonic_check_selection() }
|
1652
1699
|
menu.addAction(mnemonic_action)
|
1653
1700
|
|
1654
1701
|
elsif running?() and @realtime_button_bar.state != 'Running'
|
1655
|
-
exec_selected_action = Qt::Action.new(
|
1656
|
-
exec_selected_action.statusTip =
|
1702
|
+
exec_selected_action = Qt::Action.new("Execute Selected Lines While Paused", self)
|
1703
|
+
exec_selected_action.statusTip = "Execute the selected lines as a standalone script"
|
1657
1704
|
exec_selected_action.connect(SIGNAL('triggered()')) { run_selection_while_paused() }
|
1658
1705
|
menu.addAction(exec_selected_action)
|
1659
1706
|
end
|
@@ -1667,7 +1714,12 @@ module Cosmos
|
|
1667
1714
|
if cached
|
1668
1715
|
@active_script.setPlainText(cached.gsub("\r", ''))
|
1669
1716
|
else
|
1670
|
-
|
1717
|
+
if File.exist?(filename)
|
1718
|
+
data = File.read(filename).gsub("\r", '')
|
1719
|
+
else
|
1720
|
+
data = ""
|
1721
|
+
end
|
1722
|
+
@active_script.setPlainText(data)
|
1671
1723
|
end
|
1672
1724
|
mark_breakpoints(filename)
|
1673
1725
|
|
@@ -85,9 +85,9 @@ module Cosmos
|
|
85
85
|
when 'TABLEFILE'
|
86
86
|
usage = "#{keyword} <File name>"
|
87
87
|
parser.verify_num_parameters(1, 1, usage)
|
88
|
-
|
89
|
-
raise parser.error("Table file #{
|
90
|
-
process_file(
|
88
|
+
table_filename = File.join(File.dirname(filename), params[0])
|
89
|
+
raise parser.error("Table file #{table_filename} not found", usage) unless File.exist?(table_filename)
|
90
|
+
process_file(table_filename)
|
91
91
|
|
92
92
|
when 'TABLE'
|
93
93
|
finish_packet()
|
@@ -172,6 +172,8 @@ module Cosmos
|
|
172
172
|
# duplicated until the specified number of rows are created.
|
173
173
|
def finish_packet
|
174
174
|
if @current_packet
|
175
|
+
warnings = @current_packet.check_bit_offsets
|
176
|
+
raise "Overlapping items not allowed in tables.\n#{warnings}" if warnings.length > 0
|
175
177
|
if @current_packet.type == :TWO_DIMENSIONAL
|
176
178
|
items = @current_packet.sorted_items.clone
|
177
179
|
(@current_packet.num_rows - 1).times do |row|
|
@@ -12,9 +12,9 @@ require 'cosmos'
|
|
12
12
|
Cosmos.catch_fatal_exception do
|
13
13
|
require 'cosmos/gui/qt_tool'
|
14
14
|
require 'cosmos/gui/dialogs/progress_dialog'
|
15
|
+
require 'cosmos/gui/dialogs/tlm_details_dialog'
|
15
16
|
require 'cosmos/tools/table_manager/table_config'
|
16
17
|
require 'cosmos/tools/table_manager/table_manager_core'
|
17
|
-
require 'cosmos/gui/dialogs/tlm_details_dialog'
|
18
18
|
end
|
19
19
|
|
20
20
|
class Qt::ComboBox
|
@@ -192,7 +192,7 @@ module Cosmos
|
|
192
192
|
option_parser.on("-c", "--create FILE", "Use the specified definition file to create the table") do |arg|
|
193
193
|
options.create = arg
|
194
194
|
end
|
195
|
-
option_parser.on("-o", "--output DIRECTORY", "Create files in the specified directory") do |arg|
|
195
|
+
option_parser.on("-o", "--output DIRECTORY", "Create files in the specified directory (required with --create)") do |arg|
|
196
196
|
options.output_dir = File.expand_path(arg)
|
197
197
|
end
|
198
198
|
option_parser.on("--convert FILE", "Convert the specified configuration file to the new format") do |arg|
|
@@ -211,12 +211,15 @@ module Cosmos
|
|
211
211
|
# command line
|
212
212
|
# @return [Boolean] Whether to contine running the application
|
213
213
|
def self.post_options_parsed_hook(options)
|
214
|
-
if options.create
|
214
|
+
if options.create and options.output_dir
|
215
|
+
normalize_config_options(options)
|
215
216
|
core = TableManagerCore.new
|
216
|
-
|
217
|
+
create_path = self.config_path(options, options.create, ".txt", "table_manager")
|
218
|
+
core.file_new(create_path, options.output_dir)
|
217
219
|
return false
|
218
220
|
end
|
219
221
|
if options.convert
|
222
|
+
normalize_config_options(options)
|
220
223
|
if options.convert.include?("/")
|
221
224
|
parts = options.convert.split("/")
|
222
225
|
else
|
@@ -279,7 +282,7 @@ module Cosmos
|
|
279
282
|
complete_initialize()
|
280
283
|
setMinimumSize(400, 250)
|
281
284
|
|
282
|
-
statusBar.showMessage(
|
285
|
+
statusBar.showMessage("Ready") # Show message to initialize status bar
|
283
286
|
end
|
284
287
|
|
285
288
|
def initialize_actions(no_tables = false)
|
@@ -296,79 +299,79 @@ module Cosmos
|
|
296
299
|
open_action.connect(SIGNAL('triggered()')) { file_open(@bin_path) }
|
297
300
|
self.addAction(open_action) # Add it to the application
|
298
301
|
|
299
|
-
@file_open_both = Qt::Action.new(Cosmos.get_icon('open.png'),
|
300
|
-
@file_open_both.statusTip =
|
302
|
+
@file_open_both = Qt::Action.new(Cosmos.get_icon('open.png'), 'Open &Both', self)
|
303
|
+
@file_open_both.statusTip = 'Specify both the binary file and the definition file to open'
|
301
304
|
@file_open_both.connect(SIGNAL('triggered()')) { file_open_both() }
|
302
305
|
|
303
|
-
@file_save = Qt::Action.new(Cosmos.get_icon('save.png'),
|
306
|
+
@file_save = Qt::Action.new(Cosmos.get_icon('save.png'), '&Save File', self)
|
304
307
|
@file_save_keyseq = Qt::KeySequence.new(Qt::KeySequence::Save)
|
305
308
|
@file_save.shortcut = @file_save_keyseq
|
306
|
-
@file_save.statusTip =
|
309
|
+
@file_save.statusTip = 'Save the displayed data back to the binary file'
|
307
310
|
@file_save.connect(SIGNAL('triggered()')) { file_save() }
|
308
311
|
|
309
|
-
@file_save_as = Qt::Action.new(Cosmos.get_icon('save_as.png'),
|
312
|
+
@file_save_as = Qt::Action.new(Cosmos.get_icon('save_as.png'), 'Save File &As', self)
|
310
313
|
@file_save_as_keyseq = Qt::KeySequence.new(Qt::KeySequence::SaveAs)
|
311
314
|
@file_save_as.shortcut = @file_save_as_keyseq
|
312
|
-
@file_save_as.statusTip =
|
315
|
+
@file_save_as.statusTip = 'Save the displayed data to a new binary file'
|
313
316
|
@file_save_as.connect(SIGNAL('triggered()')) { file_save(true) }
|
314
317
|
|
315
|
-
@file_close = Qt::Action.new(Cosmos.get_icon('close.png'),
|
316
|
-
@file_close_keyseq = Qt::KeySequence.new(
|
318
|
+
@file_close = Qt::Action.new(Cosmos.get_icon('close.png'), '&Close File', self)
|
319
|
+
@file_close_keyseq = Qt::KeySequence.new("Ctrl+W") # Qt::KeySequence::Close is Alt-F4 on Windows
|
317
320
|
@file_close.shortcut = @file_close_keyseq
|
318
|
-
@file_close.statusTip =
|
321
|
+
@file_close.statusTip = 'Close the current file'
|
319
322
|
@file_close.connect(SIGNAL('triggered()')) { file_close() }
|
320
323
|
|
321
|
-
@file_check = Qt::Action.new(Cosmos.get_icon('checkmark.png'),
|
322
|
-
@file_check_keyseq = Qt::KeySequence.new(
|
324
|
+
@file_check = Qt::Action.new(Cosmos.get_icon('checkmark.png'), '&Check All', self)
|
325
|
+
@file_check_keyseq = Qt::KeySequence.new('Ctrl+K')
|
323
326
|
@file_check.shortcut = @file_check_keyseq
|
324
|
-
@file_check.statusTip =
|
327
|
+
@file_check.statusTip = 'Check each data value against verification criteria'
|
325
328
|
@file_check.connect(SIGNAL('triggered()')) { file_check() }
|
326
329
|
|
327
|
-
@file_hex = Qt::Action.new(
|
328
|
-
@file_hex_keyseq = Qt::KeySequence.new(
|
330
|
+
@file_hex = Qt::Action.new('&Hex Dump', self)
|
331
|
+
@file_hex_keyseq = Qt::KeySequence.new('Ctrl+H')
|
329
332
|
@file_hex.shortcut = @file_hex_keyseq
|
330
|
-
@file_hex.statusTip =
|
333
|
+
@file_hex.statusTip = 'Display a hex representation of the binary file'
|
331
334
|
@file_hex.connect(SIGNAL('triggered()')) { display_hex(:file) }
|
332
335
|
|
333
|
-
@file_report = Qt::Action.new(
|
334
|
-
@file_report_keyseq = Qt::KeySequence.new(
|
336
|
+
@file_report = Qt::Action.new('Create &Report', self)
|
337
|
+
@file_report_keyseq = Qt::KeySequence.new('Ctrl+R')
|
335
338
|
@file_report.shortcut = @file_report_keyseq
|
336
|
-
@file_report.statusTip =
|
339
|
+
@file_report.statusTip = 'Create a text file report describing the binary data'
|
337
340
|
@file_report.connect(SIGNAL('triggered()')) { file_report() }
|
338
341
|
|
339
342
|
unless no_tables
|
340
343
|
# Table Menu Actions
|
341
|
-
@table_check = Qt::Action.new(Cosmos.get_icon('checkmark.png'),
|
342
|
-
@table_check.statusTip =
|
344
|
+
@table_check = Qt::Action.new(Cosmos.get_icon('checkmark.png'), '&Check', self)
|
345
|
+
@table_check.statusTip = 'Check each data value against verification criteria'
|
343
346
|
@table_check.connect(SIGNAL('triggered()')) { table_check() }
|
344
347
|
|
345
|
-
@table_default = Qt::Action.new(
|
346
|
-
@table_default_keyseq = Qt::KeySequence.new(
|
348
|
+
@table_default = Qt::Action.new('&Default', self)
|
349
|
+
@table_default_keyseq = Qt::KeySequence.new('Ctrl+D')
|
347
350
|
@table_default.shortcut = @table_default_keyseq
|
348
|
-
@table_default.statusTip =
|
351
|
+
@table_default.statusTip = 'Revert all data values to their defaults'
|
349
352
|
@table_default.connect(SIGNAL('triggered()')) { table_default() }
|
350
353
|
|
351
|
-
@table_hex = Qt::Action.new(
|
352
|
-
@table_hex.statusTip =
|
354
|
+
@table_hex = Qt::Action.new('&Hex Dump', self)
|
355
|
+
@table_hex.statusTip = 'Display a hex representation of the table'
|
353
356
|
@table_hex.connect(SIGNAL('triggered()')) { display_hex(:table) }
|
354
357
|
|
355
|
-
@table_save = Qt::Action.new(
|
356
|
-
@table_save.statusTip =
|
358
|
+
@table_save = Qt::Action.new('&Save Table Binary', self)
|
359
|
+
@table_save.statusTip = 'Save the current table to a stand alone binary file'
|
357
360
|
@table_save.connect(SIGNAL('triggered()')) { table_save() }
|
358
361
|
|
359
|
-
@table_commit = Qt::Action.new(
|
360
|
-
@table_commit.statusTip =
|
362
|
+
@table_commit = Qt::Action.new('Commit to Existing &File', self)
|
363
|
+
@table_commit.statusTip = 'Incorporate the current table data into a binary file which already contains the table'
|
361
364
|
@table_commit.connect(SIGNAL('triggered()')) { table_commit() }
|
362
365
|
end
|
363
366
|
end
|
364
367
|
|
365
368
|
def initialize_menus(no_tables = false)
|
366
|
-
file_menu = menuBar.addMenu(
|
369
|
+
file_menu = menuBar.addMenu('&File')
|
367
370
|
|
368
|
-
file_new = file_menu.addMenu(Cosmos.get_icon('file.png'),
|
371
|
+
file_new = file_menu.addMenu(Cosmos.get_icon('file.png'), "&New File") # \tCtrl-N displays shortcut
|
369
372
|
target_dirs_action(file_new, @system_def_path, 'tools/table_manager', method(:file_new))
|
370
373
|
|
371
|
-
file_open = file_menu.addMenu(Cosmos.get_icon('open.png'),
|
374
|
+
file_open = file_menu.addMenu(Cosmos.get_icon('open.png'), "&Open") # \tCtrl-O displays shortcut
|
372
375
|
target_dirs_action(file_open, @system_bin_path, 'tables', method(:file_open))
|
373
376
|
|
374
377
|
file_menu.addAction(@file_open_both)
|
@@ -383,7 +386,7 @@ module Cosmos
|
|
383
386
|
file_menu.addAction(@exit_action)
|
384
387
|
|
385
388
|
unless no_tables
|
386
|
-
table_menu = menuBar.addMenu(
|
389
|
+
table_menu = menuBar.addMenu('&Table')
|
387
390
|
table_menu.addAction(@table_check)
|
388
391
|
table_menu.addAction(@table_default)
|
389
392
|
table_menu.addAction(@table_hex)
|
@@ -409,9 +412,9 @@ module Cosmos
|
|
409
412
|
# Create the information pane with the filenames
|
410
413
|
filename_layout = Qt::FormLayout.new
|
411
414
|
@table_def_label = Qt::Label.new("")
|
412
|
-
filename_layout.addRow(
|
415
|
+
filename_layout.addRow("Definition File:", @table_def_label)
|
413
416
|
@table_bin_label = Qt::Label.new("")
|
414
|
-
filename_layout.addRow(
|
417
|
+
filename_layout.addRow("Binary File:", @table_bin_label)
|
415
418
|
@top_layout.addLayout(filename_layout)
|
416
419
|
|
417
420
|
# Separator before editor
|
@@ -556,7 +559,7 @@ module Cosmos
|
|
556
559
|
|
557
560
|
display_all_gui_data()
|
558
561
|
@table_bin_label.text = filename
|
559
|
-
statusBar.showMessage(
|
562
|
+
statusBar.showMessage("File Saved Successfully")
|
560
563
|
rescue TableManagerCore::CoreError, SaveError => err
|
561
564
|
Qt::MessageBox.warning(self, "File Save Errors", err.message)
|
562
565
|
rescue => err
|
@@ -1073,8 +1076,8 @@ module Cosmos
|
|
1073
1076
|
else
|
1074
1077
|
item_name = gui_table.verticalHeaderItem(table_item.row).text
|
1075
1078
|
end
|
1076
|
-
details_action = Qt::Action.new(
|
1077
|
-
details_action.statusTip =
|
1079
|
+
details_action = Qt::Action.new("Details", self)
|
1080
|
+
details_action.statusTip = "Popup details about #{current_table_name} #{item_name}"
|
1078
1081
|
details_action.connect(SIGNAL('triggered()')) do
|
1079
1082
|
TlmDetailsDialog.new(nil,
|
1080
1083
|
'TABLE',
|
@@ -1084,8 +1087,8 @@ module Cosmos
|
|
1084
1087
|
end
|
1085
1088
|
menu.addAction(details_action)
|
1086
1089
|
|
1087
|
-
default_action = Qt::Action.new(
|
1088
|
-
default_action.statusTip =
|
1090
|
+
default_action = Qt::Action.new("Default", self)
|
1091
|
+
default_action.statusTip = "Set item to default value"
|
1089
1092
|
default_action.connect(SIGNAL('triggered()')) do
|
1090
1093
|
item = table.get_item(item_name)
|
1091
1094
|
table.write(item.name, item.default)
|