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
|
@@ -51,7 +51,7 @@ module Cosmos
|
|
|
51
51
|
|
|
52
52
|
@pry_history = []
|
|
53
53
|
@pry_frame = Qt::HBoxLayout.new
|
|
54
|
-
@pry_frame.setContentsMargins(0,0,0,0)
|
|
54
|
+
@pry_frame.setContentsMargins(0, 0, 0, 0)
|
|
55
55
|
@pry_frame_label = Qt::Label.new("Pry:")
|
|
56
56
|
@pry_frame.addWidget(@pry_frame_label)
|
|
57
57
|
@pry_text = PryLineEdit.new(self)
|
|
@@ -63,7 +63,7 @@ module Cosmos
|
|
|
63
63
|
pry_text = @pry_text.text
|
|
64
64
|
@pry_history.unshift(pry_text)
|
|
65
65
|
@pry_history_index = 0
|
|
66
|
-
if pry_text.strip == 'exit'
|
|
66
|
+
if (pry_text.strip == 'exit') || (pry_text.strip == 'quit')
|
|
67
67
|
return_value = false
|
|
68
68
|
self.close
|
|
69
69
|
else
|
|
@@ -75,7 +75,7 @@ module Cosmos
|
|
|
75
75
|
@pry_text.setText(@pry_history[@pry_history_index])
|
|
76
76
|
@pry_history_index += 1
|
|
77
77
|
if @pry_history_index == @pry_history.length
|
|
78
|
-
@pry_history_index = @pry_history.length-1
|
|
78
|
+
@pry_history_index = @pry_history.length - 1
|
|
79
79
|
end
|
|
80
80
|
end
|
|
81
81
|
when Qt::Key_Down
|
|
@@ -101,7 +101,7 @@ module Cosmos
|
|
|
101
101
|
Pry.config.pager = false
|
|
102
102
|
Pry.config.color = false
|
|
103
103
|
Pry.config.correct_indent = false
|
|
104
|
-
Pry.start pry_binding, :
|
|
104
|
+
Pry.start pry_binding, input: self, output: self
|
|
105
105
|
@pry_thread = nil
|
|
106
106
|
end
|
|
107
107
|
end
|
|
@@ -17,6 +17,9 @@ module Cosmos
|
|
|
17
17
|
SCREEN_WIDTH_MARGIN = 40
|
|
18
18
|
SCREEN_HEIGHT_MARGIN = 100
|
|
19
19
|
|
|
20
|
+
# @param parent [Qt::Widget] Parent of this dialog
|
|
21
|
+
# @param title [String] Dialog title
|
|
22
|
+
# @param text [String] Text to display
|
|
20
23
|
# @param parent [Qt::Widget] Parent of this dialog
|
|
21
24
|
# @param title [String] Dialog title
|
|
22
25
|
# @param text [String] Text to display
|
|
@@ -20,7 +20,7 @@ module Cosmos
|
|
|
20
20
|
# are written back into the packet.
|
|
21
21
|
class SetTlmDialog < Qt::Dialog
|
|
22
22
|
# @return [Array<String>] Items which should not be displayed in the dialog
|
|
23
|
-
IGNORED_ITEMS = ['RECEIVED_TIMESECONDS', 'RECEIVED_TIMEFORMATTED', 'RECEIVED_COUNT']
|
|
23
|
+
IGNORED_ITEMS = ['RECEIVED_TIMESECONDS', 'RECEIVED_TIMEFORMATTED', 'RECEIVED_COUNT', 'PKTID', 'CONFIG']
|
|
24
24
|
|
|
25
25
|
# @return [String] Errors encountered when trying to set the values back
|
|
26
26
|
# into the packet
|
|
@@ -49,7 +49,6 @@ module Cosmos
|
|
|
49
49
|
super(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
|
|
50
50
|
@target_name = target_name
|
|
51
51
|
@packet_name = packet_name
|
|
52
|
-
@current_item_name = nil
|
|
53
52
|
|
|
54
53
|
extend Api if CmdTlmServer.instance
|
|
55
54
|
|
|
@@ -58,7 +57,7 @@ module Cosmos
|
|
|
58
57
|
else
|
|
59
58
|
@items = packet.read_all_with_limits_states
|
|
60
59
|
end
|
|
61
|
-
@items.delete_if {|item_name, _, _|
|
|
60
|
+
@items.delete_if {|item_name, _, _| IGNORED_ITEMS.include?(item_name)}
|
|
62
61
|
|
|
63
62
|
setWindowTitle(title)
|
|
64
63
|
Cosmos.load_cosmos_icon
|
|
@@ -94,7 +93,7 @@ module Cosmos
|
|
|
94
93
|
@editors[-1].text = item_value.to_s
|
|
95
94
|
end
|
|
96
95
|
values_layout.addRow(item_name, @editors[-1])
|
|
97
|
-
if (
|
|
96
|
+
if (@editors.length % 10 == 0) && (@items.length > @editors.length)
|
|
98
97
|
values_layout = Qt::FormLayout.new
|
|
99
98
|
widget = Qt::Widget.new
|
|
100
99
|
widget.layout = values_layout
|
|
@@ -125,11 +124,13 @@ module Cosmos
|
|
|
125
124
|
# Set all user edited items from the dialog back into the packet
|
|
126
125
|
def set_items
|
|
127
126
|
index = 0
|
|
127
|
+
item_hash = {}
|
|
128
128
|
@items.each do |item_name, _, _|
|
|
129
|
-
|
|
130
|
-
set_tlm(@target_name, @packet_name, item_name, @editors[index].text)
|
|
129
|
+
item_hash[item_name] = @editors[index].text
|
|
131
130
|
index += 1
|
|
132
131
|
end
|
|
132
|
+
# Send to routers, and start new logs (which should inject the META packet)
|
|
133
|
+
inject_tlm(@target_name, @packet_name, item_hash, :CONVERTED, true, false, true)
|
|
133
134
|
end
|
|
134
135
|
|
|
135
136
|
# (see #initialize)
|
|
@@ -58,7 +58,7 @@ module Cosmos
|
|
|
58
58
|
# @param progress [Float] Set the progress bar to a percentage from 0 to 1
|
|
59
59
|
def progress=(progress)
|
|
60
60
|
progress_int = (progress * 100).to_i
|
|
61
|
-
if !@complete
|
|
61
|
+
if !@complete && (@progress != progress_int)
|
|
62
62
|
@progress = progress_int
|
|
63
63
|
Qt.execute_in_main_thread(false) do
|
|
64
64
|
@progress_bar.setValue(progress_int)
|
|
@@ -151,7 +151,7 @@ module Cosmos
|
|
|
151
151
|
def update_limits_details(limits_settings, limits_set)
|
|
152
152
|
return unless limits_settings[0]
|
|
153
153
|
label_text = "RL/#{limits_settings[0][0]} YL/#{limits_settings[0][1]} YH/#{limits_settings[0][2]} RH/#{limits_settings[0][3]}"
|
|
154
|
-
if limits_settings[0][4]
|
|
154
|
+
if limits_settings[0][4] && limits_settings[0][5]
|
|
155
155
|
label_text << " GL/#{limits_settings[0][4]} GH/#{limits_settings[0][5]}"
|
|
156
156
|
end
|
|
157
157
|
if @limits_labels[limits_set]
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# encoding: ascii-8bit
|
|
2
|
+
|
|
3
|
+
# Copyright 2014 Ball Aerospace & Technologies Corp.
|
|
4
|
+
# All Rights Reserved.
|
|
5
|
+
#
|
|
6
|
+
# This program is free software; you can modify and/or redistribute it
|
|
7
|
+
# under the terms of the GNU General Public License
|
|
8
|
+
# as published by the Free Software Foundation; version 3 with
|
|
9
|
+
# attribution addendums as found in the LICENSE.txt
|
|
10
|
+
|
|
11
|
+
# This file contains the implementation and TlmGraphDialog class. This class
|
|
12
|
+
# is used to open a telemetry grapher to graph a telemetry item, typically on
|
|
13
|
+
# a right click.
|
|
14
|
+
|
|
15
|
+
require 'cosmos'
|
|
16
|
+
require 'cosmos/gui/qt'
|
|
17
|
+
require 'cosmos/gui/choosers/integer_chooser'
|
|
18
|
+
require 'cosmos/script'
|
|
19
|
+
|
|
20
|
+
module Cosmos
|
|
21
|
+
# Dialog which allows the user to start graphing the given item. If the
|
|
22
|
+
# item is a fixed-size array, this allows the user to determine whether to
|
|
23
|
+
# graph a single index within the array or all indices within the array.
|
|
24
|
+
# If the item is a variable-sized array, this allows the user to select a
|
|
25
|
+
# single index to graph.
|
|
26
|
+
class TlmGraphDialog
|
|
27
|
+
# @param parent [Qt::Widget] Dialog parent
|
|
28
|
+
# @param target_name [String] Name of the target
|
|
29
|
+
# @param packet_name [String] Name of the packet
|
|
30
|
+
# @param item_name [String] Name of the item
|
|
31
|
+
def initialize(parent, target_name, packet_name, item_name)
|
|
32
|
+
packet, item = System.telemetry.packet_and_item(target_name, packet_name, item_name)
|
|
33
|
+
|
|
34
|
+
num_array_elements = 0
|
|
35
|
+
if item.array_size
|
|
36
|
+
if item.array_size > 0
|
|
37
|
+
# Fixed size array
|
|
38
|
+
num_array_elements = item.array_size / item.bit_size
|
|
39
|
+
else
|
|
40
|
+
# Variable size array
|
|
41
|
+
num_array_elements = -1
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
item_string = ""
|
|
46
|
+
|
|
47
|
+
if num_array_elements != 0
|
|
48
|
+
dialog = Qt::Dialog.new(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
|
|
49
|
+
dialog.setWindowTitle("Select array index")
|
|
50
|
+
dialog_layout = Qt::VBoxLayout.new
|
|
51
|
+
dialog_layout.addWidget(Qt::Label.new("#{target_name} #{packet_name} #{item_name} is an array."))
|
|
52
|
+
|
|
53
|
+
if num_array_elements > 0
|
|
54
|
+
dialog_layout.addWidget(Qt::Label.new("Select array index to graph or graph all:"))
|
|
55
|
+
index_chooser = IntegerChooser.new(parent, 'Array Index:', 0, 0, num_array_elements-1)
|
|
56
|
+
else
|
|
57
|
+
dialog_layout.addWidget(Qt::Label.new("Select array index to graph:"))
|
|
58
|
+
index_chooser = IntegerChooser.new(parent, 'Array Index:', 0, 0)
|
|
59
|
+
end
|
|
60
|
+
dialog_layout.addWidget(index_chooser)
|
|
61
|
+
|
|
62
|
+
checkbox = nil
|
|
63
|
+
if num_array_elements > 0
|
|
64
|
+
check_layout = Qt::HBoxLayout.new
|
|
65
|
+
check_label = Qt::Label.new("Graph all:")
|
|
66
|
+
checkbox = Qt::CheckBox.new
|
|
67
|
+
checkbox.setChecked(false)
|
|
68
|
+
check_label.setBuddy(checkbox)
|
|
69
|
+
check_layout.addWidget(check_label)
|
|
70
|
+
check_layout.addWidget(checkbox)
|
|
71
|
+
dialog_layout.addLayout(check_layout)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
button_layout = Qt::HBoxLayout.new
|
|
75
|
+
ok = Qt::PushButton.new("Ok")
|
|
76
|
+
ok.connect(SIGNAL('clicked()')) { dialog.accept }
|
|
77
|
+
button_layout.addWidget(ok)
|
|
78
|
+
cancel = Qt::PushButton.new("Cancel")
|
|
79
|
+
cancel.connect(SIGNAL('clicked()')) { dialog.reject }
|
|
80
|
+
button_layout.addWidget(cancel)
|
|
81
|
+
dialog_layout.addLayout(button_layout)
|
|
82
|
+
|
|
83
|
+
dialog.setLayout(dialog_layout)
|
|
84
|
+
dialog.show
|
|
85
|
+
dialog.raise
|
|
86
|
+
if dialog.exec == Qt::Dialog::Accepted
|
|
87
|
+
indices_to_graph = [index_chooser.value.to_i]
|
|
88
|
+
if num_array_elements > 0 and checkbox.isChecked()
|
|
89
|
+
indices_to_graph = (0..num_array_elements-1).to_a
|
|
90
|
+
end
|
|
91
|
+
indices_to_graph.each {|i| item_string << "-i \"#{target_name} #{packet_name} #{item_name}[#{i}]\" "}
|
|
92
|
+
else
|
|
93
|
+
# Cancel - graph nothing.
|
|
94
|
+
item_string = ""
|
|
95
|
+
end
|
|
96
|
+
dialog.dispose
|
|
97
|
+
else
|
|
98
|
+
# This is not an array item, we don't need to create a dialog box...
|
|
99
|
+
item_string << "-i \"#{target_name} #{packet_name} #{item_name}\" "
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Start grapher if necessary.
|
|
103
|
+
if !item_string.empty?
|
|
104
|
+
if Kernel.is_windows?
|
|
105
|
+
Cosmos.run_process("rubyw tools/TlmGrapher #{item_string} --system #{File.basename(System.initial_filename)}")
|
|
106
|
+
elsif Kernel.is_mac? and File.exist?("tools/mac/TlmGrapher.app")
|
|
107
|
+
Cosmos.run_process("open tools/mac/TlmGrapher.app --args #{item_string} --system #{File.basename(System.initial_filename)}")
|
|
108
|
+
else
|
|
109
|
+
Cosmos.run_process("ruby tools/TlmGrapher #{item_string} --system #{File.basename(System.initial_filename)}")
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
end
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
# attribution addendums as found in the LICENSE.txt
|
|
10
10
|
|
|
11
11
|
require 'cosmos'
|
|
12
|
-
require 'cosmos/ext/line_graph'
|
|
12
|
+
require 'cosmos/ext/line_graph' # Only supported with MRI
|
|
13
13
|
require 'cosmos/gui/qt'
|
|
14
14
|
require 'cosmos/gui/dialogs/exception_dialog'
|
|
15
15
|
require 'cosmos/gui/line_graph/lines'
|
|
@@ -18,10 +18,11 @@ require 'cosmos/gui/line_graph/line_graph_scaling'
|
|
|
18
18
|
require 'cosmos/gui/line_graph/line_graph_popups'
|
|
19
19
|
|
|
20
20
|
module Cosmos
|
|
21
|
-
|
|
22
|
-
#
|
|
21
|
+
# Widget which displays a line graph. Graph provides decorations such as
|
|
22
|
+
# titles, labels, grid lines, and a legend. Mouse tracking is provided to allow
|
|
23
|
+
# popups on graph values. Automatic scaling is provided to scale the X and Y
|
|
24
|
+
# axis according to the data values.
|
|
23
25
|
class LineGraph < Qt::Widget
|
|
24
|
-
|
|
25
26
|
# Create attr_accessors that automatically set the redraw_needed flag when
|
|
26
27
|
# they are set
|
|
27
28
|
def self.attr_accessor_with_redraw(*symbols)
|
|
@@ -250,7 +251,7 @@ module Cosmos
|
|
|
250
251
|
@in_update_graph_size = false
|
|
251
252
|
|
|
252
253
|
# Time of previous left button release
|
|
253
|
-
@previous_left_button_release_time = Time.now
|
|
254
|
+
@previous_left_button_release_time = Time.now.sys
|
|
254
255
|
|
|
255
256
|
# List of line colors to use
|
|
256
257
|
@color_list = ['blue','red','green','darkorange', 'gold', 'purple', 'hotpink', 'lime', 'cornflowerblue', 'brown', 'coral', 'crimson', 'indigo', 'tan', 'lightblue', 'cyan', 'peru', 'maroon','orange','navy','teal','black']
|
|
@@ -321,7 +322,7 @@ module Cosmos
|
|
|
321
322
|
end # def mousePressEvent
|
|
322
323
|
|
|
323
324
|
def mouseReleaseEvent(event)
|
|
324
|
-
left_button_release_time = Time.now
|
|
325
|
+
left_button_release_time = Time.now.sys
|
|
325
326
|
|
|
326
327
|
if @error and ((left_button_release_time - @previous_left_button_release_time) < DOUBLE_CLICK_SECONDS)
|
|
327
328
|
@pre_error_callback.call(self) if @pre_error_callback
|
|
@@ -477,7 +478,5 @@ module Cosmos
|
|
|
477
478
|
@horizontal_lines << [y_value, color, axis]
|
|
478
479
|
@redraw_needed = true
|
|
479
480
|
end
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
end # module Cosmos
|
|
483
|
-
|
|
481
|
+
end
|
|
482
|
+
end
|
|
@@ -13,12 +13,15 @@ require 'cosmos/gui/qt'
|
|
|
13
13
|
require 'cosmos/gui/line_graph/line_graph'
|
|
14
14
|
|
|
15
15
|
module Cosmos
|
|
16
|
-
|
|
16
|
+
# Creates a dialog with a {LineGraph} in it
|
|
17
17
|
class LineGraphDialog < Qt::Dialog
|
|
18
|
-
|
|
18
|
+
# @return [LineGraph] The dialog line graph
|
|
19
19
|
attr_accessor :line_graph
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
# @param title [String] Dialog title
|
|
22
|
+
# @param width [Integer] Dialog width
|
|
23
|
+
# @param height [Integer] Dialog height
|
|
24
|
+
def initialize(title, width = 400, height = 300)
|
|
22
25
|
super(Qt::CoreApplication.instance.activeWindow)
|
|
23
26
|
self.window_title = title
|
|
24
27
|
@layout = Qt::VBoxLayout.new
|
|
@@ -30,5 +33,4 @@ module Cosmos
|
|
|
30
33
|
resize(width, height)
|
|
31
34
|
end
|
|
32
35
|
end
|
|
33
|
-
|
|
34
|
-
end # end module Cosmos
|
|
36
|
+
end
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
# attribution addendums as found in the LICENSE.txt
|
|
10
10
|
|
|
11
11
|
module Cosmos
|
|
12
|
-
|
|
13
|
-
# LineGraph class continued
|
|
14
12
|
class LineGraph < Qt::Widget
|
|
15
13
|
# Pixels for a label tick
|
|
16
14
|
LABEL_TICK_SIZE = 3
|
|
@@ -248,7 +246,7 @@ module Cosmos
|
|
|
248
246
|
if !@show_popup_x_y && @unix_epoch_x_values
|
|
249
247
|
# Determine if the value is a time stamp and should be converted
|
|
250
248
|
if value > 1 && value < 2147483647
|
|
251
|
-
time = Time.at(value)
|
|
249
|
+
time = Time.at(value).sys
|
|
252
250
|
time = time.utc if @utc_time
|
|
253
251
|
if full_date
|
|
254
252
|
time.formatted # full date with day, month, year
|
|
@@ -519,7 +517,5 @@ module Cosmos
|
|
|
519
517
|
end
|
|
520
518
|
text
|
|
521
519
|
end
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
end # module Cosmos
|
|
520
|
+
end
|
|
521
|
+
end
|
|
@@ -9,10 +9,7 @@
|
|
|
9
9
|
# attribution addendums as found in the LICENSE.txt
|
|
10
10
|
|
|
11
11
|
module Cosmos
|
|
12
|
-
|
|
13
|
-
# LineGraph class continued
|
|
14
12
|
class LineGraph < Qt::Widget
|
|
15
|
-
|
|
16
13
|
# Builds popups associated with an x value
|
|
17
14
|
def build_popups_from_x_value(x_value)
|
|
18
15
|
# Clear any existing popups
|
|
@@ -110,8 +107,6 @@ module Cosmos
|
|
|
110
107
|
next_graph_y += @popups[popup_index][4] + 2
|
|
111
108
|
end
|
|
112
109
|
end
|
|
113
|
-
end
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
end # module Cosmos
|
|
117
|
-
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
end
|
|
@@ -9,10 +9,7 @@
|
|
|
9
9
|
# attribution addendums as found in the LICENSE.txt
|
|
10
10
|
|
|
11
11
|
module Cosmos
|
|
12
|
-
|
|
13
|
-
# LineGraph class continued
|
|
14
12
|
class LineGraph < Qt::Widget
|
|
15
|
-
|
|
16
13
|
# Spacer between items
|
|
17
14
|
GRAPH_SPACER = 5
|
|
18
15
|
|
|
@@ -451,7 +448,5 @@ module Cosmos
|
|
|
451
448
|
end
|
|
452
449
|
return scale
|
|
453
450
|
end
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
end # module Cosmos
|
|
451
|
+
end
|
|
452
|
+
end
|
|
@@ -12,9 +12,14 @@ require 'cosmos'
|
|
|
12
12
|
require 'cosmos/gui/line_graph/line_graph'
|
|
13
13
|
|
|
14
14
|
module Cosmos
|
|
15
|
-
|
|
15
|
+
# The overview graph provides a graph which contains the entire graph
|
|
16
|
+
# history. It provides a window with draggable bars that expands the viewport
|
|
17
|
+
# on graph. Expanding this viewport results in a callback that can be used to
|
|
18
|
+
# adjust the view on a different graph.
|
|
16
19
|
class OverviewGraph < LineGraph
|
|
20
|
+
# Default zoom when pressing the up or down arrow keys
|
|
17
21
|
DEFAULT_ZOOM_FACTOR = 0.1 # 10 percent
|
|
22
|
+
# Default pan when pressing the left or right arrow keys
|
|
18
23
|
DEFAULT_PAN_FACTOR = 0.1 # 10 percent
|
|
19
24
|
|
|
20
25
|
# Minimum allowed size of the window in seconds plotted
|
|
@@ -12,11 +12,14 @@ require 'cosmos'
|
|
|
12
12
|
require 'cosmos/gui/opengl/texture_mapped_sphere'
|
|
13
13
|
|
|
14
14
|
module Cosmos
|
|
15
|
-
|
|
15
|
+
# Three dimensional model of the earth by mapping a picture of the earth onto
|
|
16
|
+
# a sphere.
|
|
16
17
|
class EarthModel < TextureMappedSphere
|
|
18
|
+
# @param x (see TextureMappedSphere#initialize)
|
|
19
|
+
# @param y (see TextureMappedSphere#initialize)
|
|
20
|
+
# @param z (see TextureMappedSphere#initialize)
|
|
17
21
|
def initialize(x, y, z)
|
|
18
22
|
super(x, y, z, File.join(::Cosmos::PATH, 'data', 'EarthMap1024x512.gif'))
|
|
19
23
|
end
|
|
20
24
|
end
|
|
21
|
-
|
|
22
|
-
end # module Cosmos
|
|
25
|
+
end
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
# attribution addendums as found in the LICENSE.txt
|
|
10
10
|
|
|
11
11
|
module Cosmos
|
|
12
|
-
|
|
12
|
+
# Defines the boundary for a {GlScene}.
|
|
13
13
|
class GlBounds
|
|
14
|
-
def initialize
|
|
14
|
+
def initialize(x0, x1, y0, y1, z0, z1)
|
|
15
15
|
@x0 = x0
|
|
16
16
|
@x1 = x1
|
|
17
17
|
@y0 = y0
|
|
@@ -20,7 +20,10 @@ module Cosmos
|
|
|
20
20
|
@z1 = z1
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
# @param index [Integer] 0 based index into the bounds variables. Bounds
|
|
24
|
+
# are returned in the following order: x0, x1, y0, y1, z0, z1.
|
|
25
|
+
# @return [Integer] Boundary value
|
|
26
|
+
def [](index)
|
|
24
27
|
case index
|
|
25
28
|
when 0
|
|
26
29
|
@x0
|
|
@@ -39,29 +42,14 @@ module Cosmos
|
|
|
39
42
|
end
|
|
40
43
|
end
|
|
41
44
|
|
|
45
|
+
# @return [Array<Integer, Integer, Integer>] The center of the bounds
|
|
42
46
|
def center
|
|
43
47
|
[(@x0 + @x1) / 2.0, (@y0 + @y1) / 2.0, (@z0 + @z1) / 2.0]
|
|
44
48
|
end
|
|
45
49
|
|
|
50
|
+
# @return [Integer] The longest dimension of the bounds
|
|
46
51
|
def longest
|
|
47
|
-
|
|
48
|
-
y = @y1 - @y0
|
|
49
|
-
z = @z1 - @z0
|
|
50
|
-
if x > y
|
|
51
|
-
if x > z
|
|
52
|
-
x
|
|
53
|
-
else
|
|
54
|
-
z
|
|
55
|
-
end
|
|
56
|
-
else
|
|
57
|
-
if y > z
|
|
58
|
-
y
|
|
59
|
-
else
|
|
60
|
-
z
|
|
61
|
-
end
|
|
62
|
-
end
|
|
52
|
+
[@x1 - @x0, @y1 - @y0, @z1 - @z0].max
|
|
63
53
|
end
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
end # module Cosmos
|
|
54
|
+
end
|
|
55
|
+
end
|