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
|
@@ -1041,7 +1041,7 @@ module Cosmos
|
|
|
1041
1041
|
|
|
1042
1042
|
type_list.each do |data_object_type|
|
|
1043
1043
|
begin
|
|
1044
|
-
filename = data_object_type.to_s.downcase + '_data_object_adder'
|
|
1044
|
+
filename = data_object_type.to_s.downcase + '_data_object_adder.rb'
|
|
1045
1045
|
@data_object_adders << Cosmos.require_class(filename).new(self, @adder_orientation)
|
|
1046
1046
|
layout.addWidget(@data_object_adders[-1])
|
|
1047
1047
|
@data_object_adders[-1].add_data_object_callback = method(:adder_add_data_object)
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
# attribution addendums as found in the LICENSE.txt
|
|
10
10
|
|
|
11
11
|
require 'cosmos'
|
|
12
|
-
require 'cosmos/ext/tabbed_plots_config'
|
|
12
|
+
require 'cosmos/ext/tabbed_plots_config' if RUBY_ENGINE == 'ruby' and !ENV['COSMOS_NO_EXT']
|
|
13
13
|
require 'cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_tab'
|
|
14
14
|
require 'cosmos/tools/tlm_grapher/plots/plot'
|
|
15
15
|
require 'cosmos/tools/tlm_grapher/plots/linegraph_plot'
|
|
@@ -85,7 +85,7 @@ module Cosmos
|
|
|
85
85
|
|
|
86
86
|
if File.exist?(filename.to_s)
|
|
87
87
|
# Loop over each line of the configuration file
|
|
88
|
-
parser = ConfigParser.new
|
|
88
|
+
parser = ConfigParser.new("http://cosmosrb.com/docs/grapher/")
|
|
89
89
|
parser.parse_file(filename) do |keyword, parameters|
|
|
90
90
|
begin
|
|
91
91
|
# Handle each keyword
|
|
@@ -405,8 +405,15 @@ module Cosmos
|
|
|
405
405
|
|
|
406
406
|
protected
|
|
407
407
|
|
|
408
|
-
|
|
409
|
-
|
|
408
|
+
if RUBY_ENGINE != 'ruby' or ENV['COSMOS_NO_EXT']
|
|
409
|
+
# Optimization method to move each call to C code
|
|
410
|
+
def process_packet_in_each_data_object(data_objects, packet, packet_count)
|
|
411
|
+
data_objects.each do |data_object|
|
|
412
|
+
data_object.process_packet(packet, packet_count)
|
|
413
|
+
end
|
|
414
|
+
return nil
|
|
415
|
+
end
|
|
416
|
+
end
|
|
410
417
|
|
|
411
418
|
# Build (or rebuild) the mapping between packets and data objects that process them
|
|
412
419
|
# Note: This is an optimization to prevent looping through all the data objects
|
|
@@ -52,7 +52,7 @@ module Cosmos
|
|
|
52
52
|
end
|
|
53
53
|
@editor_layout = Qt::VBoxLayout.new
|
|
54
54
|
@layout.addLayout(@editor_layout)
|
|
55
|
-
@editor = Cosmos.require_class(plot_type + '_plot_editor').new(self, plot)
|
|
55
|
+
@editor = Cosmos.require_class(plot_type + '_plot_editor.rb').new(self, plot)
|
|
56
56
|
@editor_layout.addWidget(@editor)
|
|
57
57
|
|
|
58
58
|
# Separator before buttons
|
|
@@ -92,7 +92,7 @@ module Cosmos
|
|
|
92
92
|
def handle_plot_type_change
|
|
93
93
|
plot_type = @combobox.currentText.downcase
|
|
94
94
|
@editor.dispose
|
|
95
|
-
@editor = Cosmos.require_class(plot_type.capitalize + '_plot_editor').new(self)
|
|
95
|
+
@editor = Cosmos.require_class(plot_type.capitalize + '_plot_editor.rb').new(self)
|
|
96
96
|
@editor_layout.addWidget(@editor)
|
|
97
97
|
end
|
|
98
98
|
|
|
@@ -19,7 +19,7 @@ module Cosmos
|
|
|
19
19
|
|
|
20
20
|
# Create a new TabbedPlotsRealtimeThread
|
|
21
21
|
def initialize(tabbed_plots_config, connection_success_callback = nil, connection_failed_callback = nil, connection_lost_callback = nil, fatal_exception_callback = nil)
|
|
22
|
-
interface = TcpipClientInterface.new('
|
|
22
|
+
interface = TcpipClientInterface.new(System.connect_hosts['CTS_PREIDENTIFIED'], nil, System.ports['CTS_PREIDENTIFIED'], nil, tabbed_plots_config.cts_timeout, 'PREIDENTIFIED')
|
|
23
23
|
super(interface)
|
|
24
24
|
|
|
25
25
|
@queue = Queue.new
|
|
@@ -74,9 +74,25 @@ module Cosmos
|
|
|
74
74
|
def handle_items
|
|
75
75
|
plot_index = 0
|
|
76
76
|
@items.each do |target_name, packet_name, item_name|
|
|
77
|
+
target_name.upcase!
|
|
78
|
+
packet_name.upcase!
|
|
79
|
+
item_name.upcase!
|
|
80
|
+
# Check to see if the item name is followed by an array index,
|
|
81
|
+
# notated by square brackets around an integer; i.e. ARRAY_ITEM[1]
|
|
82
|
+
if (item_name =~ /\[\d+\]$/)
|
|
83
|
+
# We found an array index.
|
|
84
|
+
# The $` special variable is the string before the regex match, i.e. ARRAY_ITEM
|
|
85
|
+
item_name = $`
|
|
86
|
+
# The $& special variable is the string matched by the regex, i.e. [1].
|
|
87
|
+
# Strip off the brackets and then convert the array index to an integer.
|
|
88
|
+
item_array_index = $&.gsub(/[\[\]]/, "").to_i
|
|
89
|
+
else
|
|
90
|
+
item_array_index = nil
|
|
91
|
+
end
|
|
77
92
|
# Default configuration has one plot so don't add plot for first item
|
|
78
93
|
data_object = HousekeepingDataObject.new
|
|
79
94
|
data_object.set_item(target_name, packet_name, item_name)
|
|
95
|
+
data_object.item_array_index = item_array_index
|
|
80
96
|
@tabbed_plots_config.add_data_object(0, 0, data_object)
|
|
81
97
|
plot_index += 1
|
|
82
98
|
end
|
|
@@ -114,35 +114,37 @@ module Cosmos
|
|
|
114
114
|
begin
|
|
115
115
|
while(true)
|
|
116
116
|
break if @@closing_all
|
|
117
|
-
time = Time.now
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
117
|
+
time = Time.now.sys
|
|
118
|
+
|
|
119
|
+
if !@item.empty?
|
|
120
|
+
begin
|
|
121
|
+
# Gather item values for value widgets
|
|
122
|
+
if @mode == :REALTIME
|
|
123
|
+
values, limits_states, limits_settings, limits_set = get_tlm_values(@items, @value_types)
|
|
124
|
+
index = 0
|
|
125
|
+
@items.each do |target_name, packet_name, item_name|
|
|
126
|
+
begin
|
|
127
|
+
System.limits.set(target_name, packet_name, item_name, limits_settings[index][0], limits_settings[index][1], limits_settings[index][2], limits_settings[index][3], limits_settings[index][4], limits_settings[index][5], limits_set) if limits_settings[index]
|
|
128
|
+
rescue
|
|
129
|
+
# This can fail if we missed setting the DEFAULT limits set earlier - Oh well
|
|
130
|
+
end
|
|
131
|
+
index += 1
|
|
129
132
|
end
|
|
130
|
-
index += 1
|
|
131
133
|
end
|
|
134
|
+
@mutex.synchronize do
|
|
135
|
+
@values = values
|
|
136
|
+
@limits_states = limits_states
|
|
137
|
+
@limits_set = limits_set
|
|
138
|
+
end
|
|
139
|
+
rescue DRb::DRbConnError
|
|
140
|
+
break if @@closing_all
|
|
141
|
+
break if @value_sleeper.sleep(1)
|
|
142
|
+
next
|
|
132
143
|
end
|
|
133
|
-
@mutex.synchronize do
|
|
134
|
-
@values = values
|
|
135
|
-
@limits_states = limits_states
|
|
136
|
-
@limits_set = limits_set
|
|
137
|
-
end
|
|
138
|
-
rescue DRb::DRbConnError
|
|
139
|
-
break if @@closing_all
|
|
140
|
-
break if @value_sleeper.sleep(1)
|
|
141
|
-
next
|
|
142
144
|
end
|
|
143
145
|
|
|
144
146
|
Qt.execute_in_main_thread {update_gui()} if @alive and (@mode == :REALTIME)
|
|
145
|
-
delta = Time.now - time
|
|
147
|
+
delta = Time.now.sys - time
|
|
146
148
|
break if @@closing_all
|
|
147
149
|
if @polling_period - delta > 0
|
|
148
150
|
break if @value_sleeper.sleep(@polling_period - delta)
|
|
@@ -161,14 +163,16 @@ module Cosmos
|
|
|
161
163
|
def update_gui
|
|
162
164
|
begin
|
|
163
165
|
if @alive
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
@
|
|
171
|
-
|
|
166
|
+
if !@item.empty?
|
|
167
|
+
# Handle change in limits set
|
|
168
|
+
update_limits_set()
|
|
169
|
+
|
|
170
|
+
# Update widgets with values and limits_states
|
|
171
|
+
@mutex.synchronize do
|
|
172
|
+
(0..(@values.length - 1)).each do |index|
|
|
173
|
+
@item[index].limits_state = @limits_states[index]
|
|
174
|
+
@item[index].value = @values[index]
|
|
175
|
+
end
|
|
172
176
|
end
|
|
173
177
|
end
|
|
174
178
|
|
|
@@ -252,7 +256,7 @@ module Cosmos
|
|
|
252
256
|
global_subsettings = {}
|
|
253
257
|
|
|
254
258
|
begin
|
|
255
|
-
parser = ConfigParser.new
|
|
259
|
+
parser = ConfigParser.new("http://cosmosrb.com/docs/screens/")
|
|
256
260
|
parser.parse_file(filename) do |keyword, parameters|
|
|
257
261
|
|
|
258
262
|
if keyword
|
|
@@ -125,15 +125,14 @@ module Cosmos
|
|
|
125
125
|
# Start DRb with access control
|
|
126
126
|
@json_drb = JsonDRb.new
|
|
127
127
|
port = System.ports['TLMVIEWER_API']
|
|
128
|
-
acl =
|
|
129
|
-
@json_drb.acl = acl
|
|
128
|
+
@json_drb.acl = System.acl
|
|
130
129
|
whitelist = [
|
|
131
130
|
'display',
|
|
132
131
|
'clear',
|
|
133
132
|
'clear_all']
|
|
134
133
|
@json_drb.method_whitelist = whitelist
|
|
135
134
|
begin
|
|
136
|
-
@json_drb.start_service
|
|
135
|
+
@json_drb.start_service System.listen_hosts['TLMVIEWER_API'], port, self
|
|
137
136
|
rescue Exception
|
|
138
137
|
raise FatalError.new("Error starting JsonDRb on port #{port}.\nPerhaps a Telemetry Viewer is already running?")
|
|
139
138
|
end
|
|
@@ -199,70 +198,76 @@ module Cosmos
|
|
|
199
198
|
end
|
|
200
199
|
|
|
201
200
|
def initialize_central_widget(options)
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
@top_layout = Qt::VBoxLayout.new
|
|
201
|
+
central_widget = Qt::Widget.new
|
|
202
|
+
setCentralWidget(central_widget)
|
|
203
|
+
top_layout = Qt::VBoxLayout.new
|
|
206
204
|
|
|
207
|
-
# Create Search box
|
|
208
|
-
@search_layout = Qt::HBoxLayout.new
|
|
209
205
|
@search_box = FullTextSearchLineEdit.new(self)
|
|
210
|
-
@search_box
|
|
211
|
-
@search_layout.addWidget(@search_box)
|
|
212
|
-
@top_layout.addLayout(@search_layout)
|
|
206
|
+
top_layout.addWidget(@search_box)
|
|
213
207
|
|
|
214
208
|
# Create Screen Drop Down Lists
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
if
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
@selection_pane.addWidget(@column_widgets[column_index][:sep1])
|
|
209
|
+
selection_pane = Qt::HBoxLayout.new
|
|
210
|
+
top_layout.addLayout(selection_pane)
|
|
211
|
+
|
|
212
|
+
column_widgets = []
|
|
213
|
+
@tlm_viewer_config.columns.each_with_index do |target_screen_infos, col|
|
|
214
|
+
if col != 0 # Don't add separator for the first column
|
|
215
|
+
separator = Qt::Frame.new(central_widget)
|
|
216
|
+
separator.setFrameStyle(Qt::Frame::VLine | Qt::Frame::Sunken)
|
|
217
|
+
selection_pane.addWidget(separator)
|
|
225
218
|
end
|
|
226
|
-
|
|
227
|
-
|
|
219
|
+
grid = Qt::GridLayout.new
|
|
220
|
+
selection_pane.addLayout(grid)
|
|
228
221
|
row = 0
|
|
229
|
-
@column_widgets[column_index][:rows] = []
|
|
230
222
|
target_screen_infos.each do |target_name, screen_infos|
|
|
231
|
-
|
|
223
|
+
grid.addWidget(Qt::Label.new("#{target_name}:"), row, 0)
|
|
232
224
|
|
|
233
|
-
# Create
|
|
234
|
-
|
|
235
|
-
@column_widgets[column_index][:grid].addWidget(@column_widgets[column_index][:rows][row][:label], row, 0)
|
|
236
|
-
|
|
237
|
-
# Create Drop Down Menu for Category
|
|
238
|
-
@column_widgets[column_index][:rows][row][:screen_select] = Qt::ComboBox.new
|
|
239
|
-
@variants = []
|
|
225
|
+
# Create drop down of screens for this target
|
|
226
|
+
combo = Qt::ComboBox.new
|
|
240
227
|
screen_infos.each do |screen_name, screen_info|
|
|
241
|
-
|
|
242
|
-
|
|
228
|
+
# Store both the screen name (for display) and the screen filename
|
|
229
|
+
# (for the edit button) in a variant we can access in button handlers
|
|
230
|
+
combo.addItem(screen_info.name,
|
|
231
|
+
Qt::Variant.new("#{screen_info.full_name};#{screen_info.filename}"))
|
|
243
232
|
end
|
|
244
233
|
if screen_infos.length >= 20
|
|
245
|
-
|
|
234
|
+
combo.setMaxVisibleItems(20)
|
|
246
235
|
else
|
|
247
|
-
|
|
248
|
-
end
|
|
249
|
-
my_row = row
|
|
250
|
-
handler = lambda do
|
|
251
|
-
screen_full_name = @column_widgets[column_index][:rows][my_row][:screen_select].itemData(@column_widgets[column_index][:rows][my_row][:screen_select].currentIndex)
|
|
252
|
-
display(screen_full_name.value)
|
|
236
|
+
combo.setMaxVisibleItems(screen_infos.length)
|
|
253
237
|
end
|
|
254
|
-
@column_widgets[column_index][:rows][row][:screen_select].connect(SIGNAL('activated(int)')) { handler.call }
|
|
255
|
-
@column_widgets[column_index][:grid].addWidget(@column_widgets[column_index][:rows][row][:screen_select], row, 1)
|
|
256
238
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
239
|
+
# Create an anonymous method to display the screen which we can
|
|
240
|
+
# attach to both the combobox activated signal and the button press
|
|
241
|
+
display_handler = lambda do
|
|
242
|
+
# Access the variant we created for this screen name
|
|
243
|
+
string = combo.itemData(combo.currentIndex)
|
|
244
|
+
# The first part of the variant before the semicolon is the screen name
|
|
245
|
+
display(string.value.split(';')[0])
|
|
246
|
+
end
|
|
247
|
+
combo.connect(SIGNAL('activated(int)')) { display_handler.call }
|
|
248
|
+
grid.addWidget(combo, row, 1)
|
|
249
|
+
|
|
250
|
+
show_button = Qt::PushButton.new("Show Screen")
|
|
251
|
+
show_button.connect(SIGNAL('clicked(bool)')) { display_handler.call }
|
|
252
|
+
grid.addWidget(show_button, row, 2)
|
|
253
|
+
|
|
254
|
+
unless options.production
|
|
255
|
+
edit_button = Qt::PushButton.new(Cosmos.get_icon('edit.png'), '')
|
|
256
|
+
edit_button.setFixedSize(24, 24)
|
|
257
|
+
edit_button.connect(SIGNAL('clicked(bool)')) do
|
|
258
|
+
# Access the variant we created for this screen name
|
|
259
|
+
string = combo.itemData(combo.currentIndex)
|
|
260
|
+
# The second part of the variant after the semicolon is the screen filename
|
|
261
|
+
Cosmos.open_in_text_editor(string.value.split(';')[1])
|
|
262
|
+
end
|
|
263
|
+
grid.addWidget(edit_button, row, 3)
|
|
264
|
+
end
|
|
260
265
|
|
|
261
266
|
row += 1
|
|
262
267
|
end
|
|
263
268
|
end
|
|
264
269
|
|
|
265
|
-
|
|
270
|
+
central_widget.setLayout(top_layout)
|
|
266
271
|
end
|
|
267
272
|
|
|
268
273
|
# Handles saving the current configuration to a file
|
|
@@ -288,7 +293,7 @@ module Cosmos
|
|
|
288
293
|
filename << '.txt' if File.extname(filename).empty?
|
|
289
294
|
@tlm_viewer_config.save(filename)
|
|
290
295
|
end
|
|
291
|
-
end
|
|
296
|
+
end
|
|
292
297
|
|
|
293
298
|
def generate_target(target_name)
|
|
294
299
|
target = System.targets[target_name]
|
|
@@ -377,7 +382,7 @@ module Cosmos
|
|
|
377
382
|
output_filename = File.join(System.paths['LOGS'],
|
|
378
383
|
File.build_timestamped_filename(['screen','audit'], '.txt'))
|
|
379
384
|
File.open(output_filename, 'w') do |file|
|
|
380
|
-
file.puts "Telemetry Viewer audit created on #{Time.now.formatted}.\n"
|
|
385
|
+
file.puts "Telemetry Viewer audit created on #{Time.now.sys.formatted}.\n"
|
|
381
386
|
if all_telemetry.empty?
|
|
382
387
|
msg = "\nAll telemetry points accounted for in screens."
|
|
383
388
|
progress.append_text(msg)
|
|
@@ -516,6 +521,7 @@ module Cosmos
|
|
|
516
521
|
options.listen = true
|
|
517
522
|
options.config_file = nil
|
|
518
523
|
options.restore_size = false
|
|
524
|
+
options.production = false
|
|
519
525
|
|
|
520
526
|
option_parser.separator "Telemetry Viewer Specific Options:"
|
|
521
527
|
option_parser.on("-c", "--config FILE", "Use the specified config file") { |arg| options.config_file = arg }
|
|
@@ -524,6 +530,9 @@ module Cosmos
|
|
|
524
530
|
options.listen = false
|
|
525
531
|
options.title << ' : Not Listening'
|
|
526
532
|
end
|
|
533
|
+
option_parser.on("-p", "--production", "Run TlmServer in production mode which disables the edit buttons.") do |arg|
|
|
534
|
+
options.production = true
|
|
535
|
+
end
|
|
527
536
|
option_parser.parse!(ARGV)
|
|
528
537
|
end
|
|
529
538
|
|
|
@@ -54,7 +54,7 @@ module Cosmos
|
|
|
54
54
|
@items = []
|
|
55
55
|
@invalid_items = []
|
|
56
56
|
begin
|
|
57
|
-
parser = ConfigParser.new
|
|
57
|
+
parser = ConfigParser.new("http://cosmosrb.com/docs/screens/")
|
|
58
58
|
parser.parse_file(@filename) do |keyword, parameters|
|
|
59
59
|
if keyword
|
|
60
60
|
case keyword
|
|
@@ -115,7 +115,7 @@ module Cosmos
|
|
|
115
115
|
@current_screens = nil
|
|
116
116
|
@current_screen_info = nil
|
|
117
117
|
@current_group = nil
|
|
118
|
-
parser = ConfigParser.new
|
|
118
|
+
parser = ConfigParser.new("http://cosmosrb.com/docs/screens/")
|
|
119
119
|
parser.parse_file(filename) do |keyword, parameters|
|
|
120
120
|
case keyword
|
|
121
121
|
|
|
@@ -42,6 +42,7 @@ require 'cosmos/tools/tlm_viewer/widgets/rangecolumn_widget.rb'
|
|
|
42
42
|
require 'cosmos/tools/tlm_viewer/widgets/screenshotbutton_widget.rb'
|
|
43
43
|
require 'cosmos/tools/tlm_viewer/widgets/scrollwindow_widget.rb'
|
|
44
44
|
require 'cosmos/tools/tlm_viewer/widgets/sectionheader_widget.rb'
|
|
45
|
+
require 'cosmos/tools/tlm_viewer/widgets/spacer_widget.rb'
|
|
45
46
|
require 'cosmos/tools/tlm_viewer/widgets/tabbook_widget.rb'
|
|
46
47
|
require 'cosmos/tools/tlm_viewer/widgets/tabitem_widget.rb'
|
|
47
48
|
require 'cosmos/tools/tlm_viewer/widgets/textbox_widget.rb'
|
|
@@ -54,6 +54,7 @@ module Cosmos
|
|
|
54
54
|
# if the item should be drawn on the canvas as "on" or "off".
|
|
55
55
|
begin
|
|
56
56
|
@item_settings.each_with_index do |item,index|
|
|
57
|
+
next if @values[index].to_f.nan? || @values[index].to_f.infinite?
|
|
57
58
|
eval_string << " " << item[0].to_s << " (" << @values[index].to_s << " " << item[1].to_s << " " << item[2].to_s << ")"
|
|
58
59
|
end
|
|
59
60
|
on = eval(eval_string)
|
|
@@ -20,20 +20,38 @@ module Cosmos
|
|
|
20
20
|
include Widget
|
|
21
21
|
include MultiWidget
|
|
22
22
|
|
|
23
|
-
def initialize(parent_layout, target_name, packet_name, item_name, value_type = :WITH_UNITS, characters = 12)
|
|
23
|
+
def initialize(parent_layout, target_name, packet_name, item_name, value_type = :WITH_UNITS, characters = 12, align = 'split')
|
|
24
24
|
super(target_name, packet_name, item_name, value_type)
|
|
25
25
|
setLayout(Qt::HBoxLayout.new)
|
|
26
26
|
layout.setSpacing(0)
|
|
27
27
|
layout.setContentsMargins(0,0,0,0)
|
|
28
|
+
layout.addStretch(1) if align.downcase == 'right' || align.downcase == 'center'
|
|
28
29
|
@widgets << LabelWidget.new(layout, item_name.to_s + ':')
|
|
29
|
-
layout.addStretch(1)
|
|
30
|
+
layout.addStretch(1) if align.downcase == 'split'
|
|
30
31
|
@widgets << ValueWidget.new(layout, target_name, packet_name, item_name, value_type, characters.to_i)
|
|
32
|
+
layout.addStretch(1) if align.downcase == 'left' || align.downcase == 'center'
|
|
31
33
|
parent_layout.addWidget(self) if parent_layout
|
|
32
34
|
end
|
|
33
35
|
|
|
34
36
|
def self.takes_value?
|
|
35
37
|
return true
|
|
36
38
|
end
|
|
37
|
-
end
|
|
38
39
|
|
|
39
|
-
|
|
40
|
+
# Normally the user would have to use SUBSETTING to set the label and
|
|
41
|
+
# value parts of this widget. Since this widget is so common we overrides
|
|
42
|
+
# set_setting so it's easier to set some of the more common things.
|
|
43
|
+
def set_setting(setting_name, setting_values)
|
|
44
|
+
case setting_name.upcase
|
|
45
|
+
# Only apply TEXTALIGN to the value widget by default. It makes the label
|
|
46
|
+
# look weird when doing LEFT align which is the most common.
|
|
47
|
+
when 'TEXTALIGN'
|
|
48
|
+
@widgets[1].set_setting(setting_name, setting_values)
|
|
49
|
+
when 'TEXTCOLOR' # Apply this to both widgets automatically
|
|
50
|
+
@widgets[0].set_setting(setting_name, setting_values)
|
|
51
|
+
@widgets[1].set_setting(setting_name, setting_values)
|
|
52
|
+
else
|
|
53
|
+
super(setting_name, setting_values)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|