cosmos 3.2.1 → 3.3.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/Manifest.txt +195 -0
- data/README.md +3 -3
- data/data/crc.txt +52 -52
- data/lib/cosmos.rb +1 -1
- data/lib/cosmos/core_ext/time.rb +11 -9
- data/lib/cosmos/gui/choosers/telemetry_chooser.rb +0 -2
- data/lib/cosmos/gui/dialogs/about_dialog.rb +2 -2
- data/lib/cosmos/gui/dialogs/exception_dialog.rb +2 -2
- data/lib/cosmos/gui/dialogs/progress_dialog.rb +11 -5
- data/lib/cosmos/gui/dialogs/splash.rb +32 -10
- data/lib/cosmos/gui/dialogs/tlm_details_dialog.rb +1 -1
- data/lib/cosmos/gui/line_graph/line_graph_drawing.rb +2 -2
- data/lib/cosmos/gui/qt.rb +22 -22
- data/lib/cosmos/io/json_drb.rb +4 -4
- data/lib/cosmos/io/json_rpc.rb +21 -21
- data/lib/cosmos/packet_logs/packet_log_writer.rb +18 -20
- data/lib/cosmos/packets/commands.rb +8 -6
- data/lib/cosmos/packets/limits.rb +3 -2
- data/lib/cosmos/packets/packet.rb +14 -11
- data/lib/cosmos/packets/parsers/limits_parser.rb +1 -1
- data/lib/cosmos/packets/parsers/macro_parser.rb +4 -4
- data/lib/cosmos/packets/parsers/state_parser.rb +1 -1
- data/lib/cosmos/packets/structure.rb +2 -2
- data/lib/cosmos/packets/telemetry.rb +5 -4
- data/lib/cosmos/script/script.rb +6 -6
- data/lib/cosmos/streams/tcpip_socket_stream.rb +2 -1
- data/lib/cosmos/streams/template_stream_protocol.rb +1 -1
- data/lib/cosmos/tools/cmd_sender/cmd_sender.rb +1 -1
- data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_gui.rb +5 -8
- data/lib/cosmos/tools/cmd_tlm_server/gui/interfaces_tab.rb +4 -3
- data/lib/cosmos/tools/cmd_tlm_server/gui/packets_tab.rb +9 -3
- data/lib/cosmos/tools/cmd_tlm_server/gui/status_tab.rb +15 -11
- data/lib/cosmos/tools/data_viewer/data_viewer.rb +1 -1
- data/lib/cosmos/tools/data_viewer/data_viewer_component.rb +2 -2
- data/lib/cosmos/tools/handbook_creator/handbook_creator.rb +2 -2
- data/lib/cosmos/tools/handbook_creator/handbook_creator_config.rb +0 -2
- data/lib/cosmos/tools/limits_monitor/limits_monitor.rb +1 -1
- data/lib/cosmos/tools/replay/replay.rb +2 -2
- data/lib/cosmos/tools/script_runner/script_audit.rb +1 -1
- data/lib/cosmos/tools/script_runner/script_runner.rb +1 -1
- data/lib/cosmos/tools/script_runner/script_runner_frame.rb +3 -7
- data/lib/cosmos/tools/table_manager/table_config.rb +1 -1
- data/lib/cosmos/tools/test_runner/results_writer.rb +1 -1
- data/lib/cosmos/tools/test_runner/test_runner.rb +2 -2
- data/lib/cosmos/tools/tlm_extractor/tlm_extractor.rb +2 -1
- data/lib/cosmos/tools/tlm_extractor/tlm_extractor_processor.rb +1 -1
- data/lib/cosmos/tools/tlm_grapher/data_object_adders/xy_data_object_adder.rb +1 -0
- data/lib/cosmos/tools/tlm_grapher/data_object_editors/housekeeping_data_object_editor.rb +1 -0
- data/lib/cosmos/tools/tlm_grapher/data_object_editors/xy_data_object_editor.rb +1 -0
- data/lib/cosmos/tools/tlm_grapher/tabbed_plots/overview_tabbed_plots.rb +3 -3
- data/lib/cosmos/tools/tlm_viewer/tlm_viewer.rb +1 -3
- data/lib/cosmos/top_level.rb +2 -6
- data/lib/cosmos/utilities/ruby_lex_utils.rb +1 -1
- data/lib/cosmos/version.rb +5 -5
- data/lib/cosmos/win32/win32_main.rb +11 -7
- data/spec/ccsds/ccsds_packet_spec.rb +28 -28
- data/spec/ccsds/ccsds_parser_spec.rb +27 -27
- data/spec/config/config_parser_spec.rb +88 -88
- data/spec/conversions/conversion_spec.rb +3 -3
- data/spec/conversions/generic_conversion_spec.rb +9 -9
- data/spec/conversions/new_packet_log_conversion_spec.rb +4 -4
- data/spec/conversions/polynomial_conversion_spec.rb +7 -7
- data/spec/conversions/processor_conversion_spec.rb +9 -9
- data/spec/conversions/received_count_conversion_spec.rb +7 -7
- data/spec/conversions/received_time_formatted_conversion_spec.rb +9 -9
- data/spec/conversions/received_time_seconds_conversion_spec.rb +9 -9
- data/spec/conversions/segmented_polynomial_conversion_spec.rb +11 -11
- data/spec/conversions/unix_time_formatted_conversion_spec.rb +13 -13
- data/spec/conversions/unix_time_seconds_conversion_spec.rb +13 -13
- data/spec/core_ext/array_spec.rb +76 -76
- data/spec/core_ext/class_spec.rb +3 -3
- data/spec/core_ext/cosmos_io_spec.rb +16 -16
- data/spec/core_ext/exception_spec.rb +19 -19
- data/spec/core_ext/file_spec.rb +16 -16
- data/spec/core_ext/hash_spec.rb +3 -3
- data/spec/core_ext/io_spec.rb +2 -2
- data/spec/core_ext/kernel_spec.rb +2 -2
- data/spec/core_ext/math_spec.rb +43 -43
- data/spec/core_ext/matrix_spec.rb +22 -22
- data/spec/core_ext/objectspace_spec.rb +6 -6
- data/spec/core_ext/range_spec.rb +2 -2
- data/spec/core_ext/socket_spec.rb +4 -4
- data/spec/core_ext/string_spec.rb +67 -67
- data/spec/core_ext/stringio_spec.rb +2 -2
- data/spec/core_ext/time_spec.rb +82 -82
- data/spec/gui/line_graph/line_clip_spec.rb +34 -34
- data/spec/interfaces/interface_spec.rb +46 -46
- data/spec/interfaces/linc_interface_spec.rb +26 -26
- data/spec/interfaces/serial_interface_spec.rb +16 -16
- data/spec/interfaces/simulated_target_interface_spec.rb +21 -21
- data/spec/interfaces/stream_interface_spec.rb +22 -22
- data/spec/interfaces/tcpip_client_interface_spec.rb +14 -14
- data/spec/interfaces/tcpip_server_interface_spec.rb +41 -41
- data/spec/interfaces/udp_interface_spec.rb +46 -46
- data/spec/io/buffered_file_spec.rb +50 -50
- data/spec/io/io_multiplexer_spec.rb +9 -9
- data/spec/io/json_drb_object_spec.rb +7 -7
- data/spec/io/json_drb_spec.rb +55 -55
- data/spec/io/json_rpc_spec.rb +68 -68
- data/spec/io/raw_logger_pair_spec.rb +28 -28
- data/spec/io/raw_logger_spec.rb +22 -22
- data/spec/io/serial_driver_spec.rb +3 -3
- data/spec/io/stderr_spec.rb +2 -2
- data/spec/io/stdout_spec.rb +2 -2
- data/spec/io/tcpip_server_spec.rb +62 -62
- data/spec/io/udp_sockets_spec.rb +19 -19
- data/spec/io/win32_serial_driver_spec.rb +10 -10
- data/spec/packet_logs/meta_packet_log_writer_spec.rb +32 -32
- data/spec/packet_logs/packet_log_reader_spec.rb +138 -138
- data/spec/packet_logs/packet_log_writer_pair_spec.rb +3 -3
- data/spec/packet_logs/packet_log_writer_spec.rb +26 -26
- data/spec/packets/binary_accessor_spec.rb +672 -672
- data/spec/packets/commands_spec.rb +123 -123
- data/spec/packets/limits_response_spec.rb +1 -1
- data/spec/packets/limits_spec.rb +69 -69
- data/spec/packets/packet_config_spec.rb +93 -93
- data/spec/packets/packet_item_limits_spec.rb +46 -46
- data/spec/packets/packet_item_spec.rb +108 -108
- data/spec/packets/packet_spec.rb +364 -348
- data/spec/packets/parsers/format_string_parser_spec.rb +13 -13
- data/spec/packets/parsers/limits_parser_spec.rb +8 -8
- data/spec/packets/parsers/limits_response_parser_spec.rb +9 -9
- data/spec/packets/parsers/macro_parser_spec.rb +34 -6
- data/spec/packets/parsers/packet_parser_spec.rb +6 -6
- data/spec/packets/parsers/processor_parser_spec.rb +7 -7
- data/spec/packets/parsers/state_parser_spec.rb +23 -23
- data/spec/packets/structure_item_spec.rb +62 -62
- data/spec/packets/structure_spec.rb +183 -183
- data/spec/packets/telemetry_spec.rb +174 -174
- data/spec/processors/new_packet_log_processor_spec.rb +4 -4
- data/spec/processors/processor_spec.rb +9 -9
- data/spec/processors/statistics_processor_spec.rb +21 -21
- data/spec/processors/watermark_processor_spec.rb +12 -12
- data/spec/script/script_spec.rb +158 -158
- data/spec/spec_helper.rb +44 -13
- data/spec/streams/burst_stream_protocol_spec.rb +8 -8
- data/spec/streams/fixed_stream_protocol_spec.rb +26 -26
- data/spec/streams/length_stream_protocol_spec.rb +27 -27
- data/spec/streams/preidentified_stream_protocol_spec.rb +25 -25
- data/spec/streams/serial_stream_spec.rb +19 -19
- data/spec/streams/stream_protocol_spec.rb +52 -52
- data/spec/streams/stream_spec.rb +1 -1
- data/spec/streams/tcpip_client_stream_spec.rb +7 -7
- data/spec/streams/tcpip_socket_stream_spec.rb +84 -49
- data/spec/streams/template_stream_protocol_spec.rb +17 -17
- data/spec/streams/terminated_stream_protocol_spec.rb +19 -19
- data/spec/system/system_spec.rb +95 -95
- data/spec/system/target_spec.rb +32 -32
- data/spec/tools/cmd_tlm_server/api_spec.rb +386 -386
- data/spec/tools/cmd_tlm_server/background_task_spec.rb +3 -3
- data/spec/tools/cmd_tlm_server/background_tasks_spec.rb +8 -8
- data/spec/tools/cmd_tlm_server/cmd_tlm_server_config_spec.rb +57 -57
- data/spec/tools/cmd_tlm_server/cmd_tlm_server_spec.rb +85 -85
- data/spec/tools/cmd_tlm_server/commanding_spec.rb +11 -11
- data/spec/tools/cmd_tlm_server/connections_spec.rb +23 -23
- data/spec/tools/cmd_tlm_server/interface_thread_spec.rb +57 -57
- data/spec/tools/cmd_tlm_server/interfaces_spec.rb +32 -32
- data/spec/tools/cmd_tlm_server/packet_logging_spec.rb +17 -17
- data/spec/tools/cmd_tlm_server/router_thread_spec.rb +15 -15
- data/spec/tools/cmd_tlm_server/routers_spec.rb +36 -36
- data/spec/top_level/top_level_spec.rb +60 -60
- data/spec/utilities/crc_spec.rb +6 -6
- data/spec/utilities/csv_spec.rb +13 -13
- data/spec/utilities/logger_spec.rb +20 -20
- data/spec/utilities/message_log_spec.rb +13 -13
- data/spec/utilities/quaternion_spec.rb +30 -30
- data/spec/utilities/ruby_lex_utils_spec.rb +14 -14
- data/test/benchmarks/binary_accessor_benchmark.rb +14 -0
- data/test/benchmarks/gsub_benchmark.rb +114 -0
- data/test/performance/PACKETS.bat +1 -0
- data/test/performance/Rakefile +77 -0
- data/test/performance/THREADS.bat +1 -0
- data/test/performance/config/data/attitude.bin +0 -0
- data/test/performance/config/data/crc.txt +206 -0
- data/test/performance/config/data/diamond.STL +58 -0
- data/test/performance/config/data/groundoff.gif +0 -0
- data/test/performance/config/data/groundon.gif +0 -0
- data/test/performance/config/data/hselectoff.gif +0 -0
- data/test/performance/config/data/hselecton.gif +0 -0
- data/test/performance/config/data/hswitchoff.gif +0 -0
- data/test/performance/config/data/hswitchon.gif +0 -0
- data/test/performance/config/data/meta_init.txt +4 -0
- data/test/performance/config/data/position.bin +0 -0
- data/test/performance/config/data/poweroff.gif +0 -0
- data/test/performance/config/data/poweron.gif +0 -0
- data/test/performance/config/data/satellite.gif +0 -0
- data/test/performance/config/data/tada.wav +0 -0
- data/test/performance/config/data/vswitchoff.gif +0 -0
- data/test/performance/config/data/vswitchon.gif +0 -0
- data/test/performance/config/system/system_packets.txt +39 -0
- data/test/performance/config/system/system_threads.txt +59 -0
- data/test/performance/config/targets/COSMOS/cmd_tlm/cosmos_server_cmds.txt +41 -0
- data/test/performance/config/targets/COSMOS/cmd_tlm/cosmos_server_tlm.txt +15 -0
- data/test/performance/config/targets/COSMOS/cmd_tlm_server.txt +6 -0
- data/test/performance/config/targets/COSMOS/screens/limits_change.txt +20 -0
- data/test/performance/config/targets/COSMOS/screens/version.txt +19 -0
- data/test/performance/config/targets/COSMOS/target.txt +11 -0
- data/test/performance/config/targets/EXAMPLE/cmd_tlm/example_cmds.txt +17 -0
- data/test/performance/config/targets/EXAMPLE/cmd_tlm/example_tlm.txt +18 -0
- data/test/performance/config/targets/EXAMPLE/cmd_tlm_server.txt +6 -0
- data/test/performance/config/targets/EXAMPLE/lib/example_interface.rb +22 -0
- data/test/performance/config/targets/EXAMPLE/target.txt +7 -0
- data/test/performance/config/targets/SYSTEM/screens/status.txt +12 -0
- data/test/performance/config/tools/cmd_tlm_server/cmd_tlm_server_packets.txt +34 -0
- data/test/performance/config/tools/cmd_tlm_server/cmd_tlm_server_threads.txt +68 -0
- data/test/performance/config/tools/data_viewer/data_viewer.txt +11 -0
- data/test/performance/config/tools/handbook_creator/default_toc.xsl +59 -0
- data/test/performance/config/tools/handbook_creator/handbook_creator.txt +66 -0
- data/test/performance/config/tools/handbook_creator/templates/command_packets.html.erb +86 -0
- data/test/performance/config/tools/handbook_creator/templates/command_toc.html.erb +38 -0
- data/test/performance/config/tools/handbook_creator/templates/footer.html.erb +9 -0
- data/test/performance/config/tools/handbook_creator/templates/header.html.erb +25 -0
- data/test/performance/config/tools/handbook_creator/templates/limits_groups.html.erb +13 -0
- data/test/performance/config/tools/handbook_creator/templates/nav.html.erb +27 -0
- data/test/performance/config/tools/handbook_creator/templates/overview.html.erb +1 -0
- data/test/performance/config/tools/handbook_creator/templates/pdf_cover.html.erb +23 -0
- data/test/performance/config/tools/handbook_creator/templates/pdf_footer.html.erb +33 -0
- data/test/performance/config/tools/handbook_creator/templates/pdf_header.html.erb +41 -0
- data/test/performance/config/tools/handbook_creator/templates/telemetry_packets.html.erb +80 -0
- data/test/performance/config/tools/handbook_creator/templates/telemetry_toc.html.erb +38 -0
- data/test/performance/config/tools/handbook_creator/templates/title.html.erb +1 -0
- data/test/performance/config/tools/launcher/launcher_packets.txt +29 -0
- data/test/performance/config/tools/launcher/launcher_threads.txt +70 -0
- data/test/performance/config/tools/limits_monitor/README.txt +1 -0
- data/test/performance/config/tools/opengl_builder/README.txt +1 -0
- data/test/performance/config/tools/script_runner/script_runner.txt +3 -0
- data/test/performance/config/tools/table_manager/ConfigTables_def.txt +8 -0
- data/test/performance/config/tools/table_manager/ExampleTableDefinition.txt +24 -0
- data/test/performance/config/tools/table_manager/MCConfigurationTable_fsw1_def.txt +25 -0
- data/test/performance/config/tools/table_manager/MCConfigurationTable_fsw2_def.txt +25 -0
- data/test/performance/config/tools/table_manager/PPSSelectionTable_def.txt +8 -0
- data/test/performance/config/tools/table_manager/TLMMonitoringTable_def.txt +248 -0
- data/test/performance/config/tools/test_runner/test_runner.txt +17 -0
- data/test/performance/config/tools/tlm_extractor/tlm_extractor.txt +13 -0
- data/test/performance/config/tools/tlm_extractor/tlm_extractor2.txt +2 -0
- data/test/performance/config/tools/tlm_extractor/tlm_extractor3.txt +2 -0
- data/test/performance/config/tools/tlm_extractor/tlm_extractor4.txt +2 -0
- data/test/performance/config/tools/tlm_grapher/README.txt +1 -0
- data/test/performance/config/tools/tlm_viewer/tlm_viewer.txt +41 -0
- data/test/performance/lib/example_background_task.rb +57 -0
- data/test/performance/lib/example_target.rb +120 -0
- data/test/performance/lib/scpi_target.rb +74 -0
- data/test/performance/lib/user_version.rb +3 -0
- data/test/performance/outputs/handbooks/README.txt +1 -0
- data/test/performance/outputs/logs/README.txt +1 -0
- data/test/performance/outputs/saved_config/README.txt +1 -0
- data/test/performance/outputs/tables/README.txt +1 -0
- data/test/performance/outputs/tmp/README.txt +1 -0
- data/test/performance/procedures/checks.rb +11 -0
- data/test/performance/procedures/clear_util.rb +7 -0
- data/test/performance/procedures/collect.rb +18 -0
- data/test/performance/procedures/collect_util.rb +14 -0
- data/test/performance/procedures/cosmos_api_test.rb +293 -0
- data/test/performance/procedures/disconnect.rb +29 -0
- data/test/performance/procedures/example_test.rb +182 -0
- data/test/performance/procedures/plot_test.rb +8 -0
- data/test/performance/procedures/procedure.rb +3 -0
- data/test/performance/procedures/run_example_test.rb +3 -0
- data/test/performance/procedures/test.rb +51 -0
- data/test/performance/tools/CmdExtractor +14 -0
- data/test/performance/tools/CmdExtractor.bat +59 -0
- data/test/performance/tools/CmdSender +14 -0
- data/test/performance/tools/CmdSender.bat +59 -0
- data/test/performance/tools/CmdTlmServer +16 -0
- data/test/performance/tools/CmdTlmServer.bat +59 -0
- data/test/performance/tools/CmdTlmServerMemProf +20 -0
- data/test/performance/tools/CmdTlmServerMemProf.bat +59 -0
- data/test/performance/tools/DataViewer +14 -0
- data/test/performance/tools/DataViewer.bat +59 -0
- data/test/performance/tools/ExampleTarget +14 -0
- data/test/performance/tools/ExampleTarget.bat +59 -0
- data/test/performance/tools/HandbookCreator +14 -0
- data/test/performance/tools/HandbookCreator.bat +61 -0
- data/test/performance/tools/Launcher +14 -0
- data/test/performance/tools/Launcher.bat +59 -0
- data/test/performance/tools/LimitsMonitor +14 -0
- data/test/performance/tools/LimitsMonitor.bat +59 -0
- data/test/performance/tools/OpenGLBuilder +14 -0
- data/test/performance/tools/OpenGLBuilder.bat +59 -0
- data/test/performance/tools/PacketViewer +14 -0
- data/test/performance/tools/PacketViewer.bat +59 -0
- data/test/performance/tools/Replay +14 -0
- data/test/performance/tools/Replay.bat +59 -0
- data/test/performance/tools/ScpiTarget +14 -0
- data/test/performance/tools/ScpiTarget.bat +59 -0
- data/test/performance/tools/ScriptRunner +14 -0
- data/test/performance/tools/ScriptRunner.bat +59 -0
- data/test/performance/tools/TableManager +14 -0
- data/test/performance/tools/TableManager.bat +59 -0
- data/test/performance/tools/TestRunner +14 -0
- data/test/performance/tools/TestRunner.bat +59 -0
- data/test/performance/tools/TlmExtractor +14 -0
- data/test/performance/tools/TlmExtractor.bat +59 -0
- data/test/performance/tools/TlmGrapher +14 -0
- data/test/performance/tools/TlmGrapher.bat +59 -0
- data/test/performance/tools/TlmViewer +14 -0
- data/test/performance/tools/TlmViewer.bat +59 -0
- data/test/performance/tools/mac/CmdExtractor.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/CmdExtractor.app/Contents/MacOS/CmdExtractor.rb +15 -0
- data/test/performance/tools/mac/CmdExtractor.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/CmdExtractor.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/CmdSender.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/CmdSender.app/Contents/MacOS/CmdSender.rb +15 -0
- data/test/performance/tools/mac/CmdSender.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/CmdSender.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/CmdTlmServer.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/CmdTlmServer.app/Contents/MacOS/CmdTlmServer.rb +15 -0
- data/test/performance/tools/mac/CmdTlmServer.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/CmdTlmServer.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/DataViewer.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/DataViewer.app/Contents/MacOS/DataViewer.rb +15 -0
- data/test/performance/tools/mac/DataViewer.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/DataViewer.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/HandbookCreator.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/HandbookCreator.app/Contents/MacOS/HandbookCreator.rb +15 -0
- data/test/performance/tools/mac/HandbookCreator.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/HandbookCreator.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/Launcher.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/Launcher.app/Contents/MacOS/Launcher.rb +15 -0
- data/test/performance/tools/mac/Launcher.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/Launcher.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/LimitsMonitor.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/LimitsMonitor.app/Contents/MacOS/LimitsMonitor.rb +15 -0
- data/test/performance/tools/mac/LimitsMonitor.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/LimitsMonitor.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/OpenGLBuilder.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/OpenGLBuilder.app/Contents/MacOS/OpenGLBuilder.rb +15 -0
- data/test/performance/tools/mac/OpenGLBuilder.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/OpenGLBuilder.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/PacketViewer.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/PacketViewer.app/Contents/MacOS/PacketViewer.rb +15 -0
- data/test/performance/tools/mac/PacketViewer.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/PacketViewer.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/Replay.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/Replay.app/Contents/MacOS/Replay.rb +15 -0
- data/test/performance/tools/mac/Replay.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/Replay.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/ScriptRunner.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/ScriptRunner.app/Contents/MacOS/ScriptRunner.rb +15 -0
- data/test/performance/tools/mac/ScriptRunner.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/ScriptRunner.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/TableManager.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/TableManager.app/Contents/MacOS/TableManager.rb +15 -0
- data/test/performance/tools/mac/TableManager.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/TableManager.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/TestRunner.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/TestRunner.app/Contents/MacOS/TestRunner.rb +15 -0
- data/test/performance/tools/mac/TestRunner.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/TestRunner.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/TlmExtractor.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/TlmExtractor.app/Contents/MacOS/TlmExtractor.rb +15 -0
- data/test/performance/tools/mac/TlmExtractor.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/TlmExtractor.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/TlmGrapher.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/TlmGrapher.app/Contents/MacOS/TlmGrapher.rb +15 -0
- data/test/performance/tools/mac/TlmGrapher.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/TlmGrapher.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/TlmViewer.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/TlmViewer.app/Contents/MacOS/TlmViewer.rb +15 -0
- data/test/performance/tools/mac/TlmViewer.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/TlmViewer.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/userpath.txt +1 -0
- metadata +197 -2
@@ -18,8 +18,8 @@ module Cosmos
|
|
18
18
|
describe Telemetry do
|
19
19
|
|
20
20
|
describe "initialize" do
|
21
|
-
it "
|
22
|
-
Telemetry.new(PacketConfig.new).warnings.
|
21
|
+
it "has no warnings" do
|
22
|
+
expect(Telemetry.new(PacketConfig.new).warnings).to be_empty
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
@@ -51,82 +51,82 @@ module Cosmos
|
|
51
51
|
end
|
52
52
|
|
53
53
|
describe "target_names" do
|
54
|
-
it "
|
55
|
-
Telemetry.new(PacketConfig.new).target_names.
|
54
|
+
it "returns an empty array if no targets" do
|
55
|
+
expect(Telemetry.new(PacketConfig.new).target_names).to eql []
|
56
56
|
end
|
57
57
|
|
58
|
-
it "
|
59
|
-
@tlm.target_names.
|
58
|
+
it "returns all target names" do
|
59
|
+
expect(@tlm.target_names).to eql ["TGT1","TGT2"]
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
63
|
describe "packets" do
|
64
|
-
it "
|
64
|
+
it "complains about non-existant targets" do
|
65
65
|
expect { @tlm.packets("tgtX") }.to raise_error(RuntimeError, "Telemetry target 'TGTX' does not exist")
|
66
66
|
end
|
67
67
|
|
68
|
-
it "
|
68
|
+
it "returns all packets target TGT1" do
|
69
69
|
pkts = @tlm.packets("TGT1")
|
70
|
-
pkts.length.
|
71
|
-
pkts.keys.
|
72
|
-
pkts.keys.
|
70
|
+
expect(pkts.length).to eql 2
|
71
|
+
expect(pkts.keys).to include("PKT1")
|
72
|
+
expect(pkts.keys).to include("PKT2")
|
73
73
|
end
|
74
74
|
|
75
|
-
it "
|
75
|
+
it "returns all packets target TGT2" do
|
76
76
|
pkts = @tlm.packets("TGT2")
|
77
|
-
pkts.length.
|
78
|
-
pkts.keys.
|
77
|
+
expect(pkts.length).to eql 1
|
78
|
+
expect(pkts.keys).to include("PKT1")
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
82
82
|
describe "packet" do
|
83
|
-
it "
|
83
|
+
it "complains about non-existant targets" do
|
84
84
|
expect { @tlm.packet("tgtX","pkt1") }.to raise_error(RuntimeError, "Telemetry target 'TGTX' does not exist")
|
85
85
|
end
|
86
86
|
|
87
|
-
it "
|
87
|
+
it "complains about non-existant packets" do
|
88
88
|
expect { @tlm.packet("TGT1","PKTX") }.to raise_error(RuntimeError, "Telemetry packet 'TGT1 PKTX' does not exist")
|
89
89
|
end
|
90
90
|
|
91
|
-
it "
|
91
|
+
it "complains about the 'LATEST' packet" do
|
92
92
|
expect { @tlm.packet("TGT1","LATEST") }.to raise_error(RuntimeError, "Telemetry packet 'TGT1 LATEST' does not exist")
|
93
93
|
end
|
94
94
|
|
95
|
-
it "
|
95
|
+
it "returns the specified packet" do
|
96
96
|
pkt = @tlm.packet("TGT1","PKT1")
|
97
|
-
pkt.target_name.
|
98
|
-
pkt.packet_name.
|
97
|
+
expect(pkt.target_name).to eql "TGT1"
|
98
|
+
expect(pkt.packet_name).to eql "PKT1"
|
99
99
|
end
|
100
100
|
end
|
101
101
|
|
102
102
|
describe "items" do
|
103
|
-
it "
|
103
|
+
it "complains about non-existant targets" do
|
104
104
|
expect { @tlm.items("tgtX","pkt1") }.to raise_error(RuntimeError, "Telemetry target 'TGTX' does not exist")
|
105
105
|
end
|
106
106
|
|
107
|
-
it "
|
107
|
+
it "complains about non-existant packets" do
|
108
108
|
expect { @tlm.items("TGT1","PKTX") }.to raise_error(RuntimeError, "Telemetry packet 'TGT1 PKTX' does not exist")
|
109
109
|
end
|
110
110
|
|
111
|
-
it "
|
111
|
+
it "complains about the 'LATEST' packet" do
|
112
112
|
expect { @tlm.items("TGT1","LATEST") }.to raise_error(RuntimeError, "Telemetry packet 'TGT1 LATEST' does not exist")
|
113
113
|
end
|
114
114
|
|
115
|
-
it "
|
115
|
+
it "returns all items from packet TGT1/PKT1" do
|
116
116
|
items = @tlm.items("TGT1","PKT1")
|
117
|
-
items.length.
|
118
|
-
items[0].name.
|
119
|
-
items[1].name.
|
120
|
-
items[2].name.
|
121
|
-
items[3].name.
|
122
|
-
items[4].name.
|
123
|
-
items[5].name.
|
124
|
-
items[6].name.
|
117
|
+
expect(items.length).to eql 7
|
118
|
+
expect(items[0].name).to eql "RECEIVED_TIMESECONDS"
|
119
|
+
expect(items[1].name).to eql "RECEIVED_TIMEFORMATTED"
|
120
|
+
expect(items[2].name).to eql "RECEIVED_COUNT"
|
121
|
+
expect(items[3].name).to eql "ITEM1"
|
122
|
+
expect(items[4].name).to eql "ITEM2"
|
123
|
+
expect(items[5].name).to eql "ITEM3"
|
124
|
+
expect(items[6].name).to eql "ITEM4"
|
125
125
|
end
|
126
126
|
end
|
127
127
|
|
128
128
|
describe "item_names" do
|
129
|
-
it "
|
129
|
+
it "returns all the items for a given target and packet" do
|
130
130
|
items = @tlm.item_names("TGT1","PKT1")
|
131
131
|
expect(items).to contain_exactly('RECEIVED_TIMEFORMATTED','RECEIVED_TIMESECONDS','RECEIVED_COUNT','ITEM1','ITEM2','ITEM3','ITEM4')
|
132
132
|
|
@@ -136,221 +136,221 @@ module Cosmos
|
|
136
136
|
end
|
137
137
|
|
138
138
|
describe "packet_and_item" do
|
139
|
-
it "
|
139
|
+
it "complains about non-existant targets" do
|
140
140
|
expect { @tlm.packet_and_item("tgtX","pkt1","item1") }.to raise_error(RuntimeError, "Telemetry target 'TGTX' does not exist")
|
141
141
|
end
|
142
142
|
|
143
|
-
it "
|
143
|
+
it "complains about non-existant packets" do
|
144
144
|
expect { @tlm.packet_and_item("TGT1","PKTX","ITEM1") }.to raise_error(RuntimeError, "Telemetry packet 'TGT1 PKTX' does not exist")
|
145
145
|
end
|
146
146
|
|
147
|
-
it "
|
147
|
+
it "complains about non-existant items" do
|
148
148
|
expect { @tlm.packet_and_item("TGT1","PKT1","ITEMX") }.to raise_error(RuntimeError, "Packet item 'TGT1 PKT1 ITEMX' does not exist")
|
149
149
|
end
|
150
150
|
|
151
|
-
it "
|
151
|
+
it "returns the packet and item" do
|
152
152
|
pkt,item = @tlm.packet_and_item("TGT1","PKT1","ITEM1")
|
153
|
-
item.name.
|
153
|
+
expect(item.name).to eql "ITEM1"
|
154
154
|
end
|
155
155
|
|
156
|
-
it "
|
156
|
+
it "returns the LATEST packet and item if it exists" do
|
157
157
|
pkt,item = @tlm.packet_and_item("TGT1","LATEST","ITEM1")
|
158
|
-
pkt.packet_name.
|
159
|
-
item.name.
|
158
|
+
expect(pkt.packet_name).to eql "PKT2"
|
159
|
+
expect(item.name).to eql "ITEM1"
|
160
160
|
end
|
161
161
|
end
|
162
162
|
|
163
163
|
describe "latest_packets" do
|
164
|
-
it "
|
164
|
+
it "complains about non-existant targets" do
|
165
165
|
expect { @tlm.latest_packets("tgtX","item1") }.to raise_error(RuntimeError, "Telemetry target 'TGTX' does not exist")
|
166
166
|
end
|
167
167
|
|
168
|
-
it "
|
168
|
+
it "complains about non-existant items" do
|
169
169
|
expect { @tlm.latest_packets("TGT1","ITEMX") }.to raise_error(RuntimeError, "Telemetry item 'TGT1 LATEST ITEMX' does not exist")
|
170
170
|
end
|
171
171
|
|
172
|
-
it "
|
172
|
+
it "returns the packets that contain the item" do
|
173
173
|
pkts = @tlm.latest_packets("TGT1","ITEM1")
|
174
|
-
pkts.length.
|
175
|
-
pkts[0].packet_name.
|
176
|
-
pkts[1].packet_name.
|
174
|
+
expect(pkts.length).to eql 2
|
175
|
+
expect(pkts[0].packet_name).to eql "PKT1"
|
176
|
+
expect(pkts[1].packet_name).to eql "PKT2"
|
177
177
|
end
|
178
178
|
end
|
179
179
|
|
180
180
|
describe "newest_packet" do
|
181
|
-
it "
|
181
|
+
it "complains about non-existant targets" do
|
182
182
|
expect { @tlm.newest_packet("tgtX","item1") }.to raise_error(RuntimeError, "Telemetry target 'TGTX' does not exist")
|
183
183
|
end
|
184
184
|
|
185
|
-
it "
|
185
|
+
it "complains about non-existant items" do
|
186
186
|
expect { @tlm.newest_packet("TGT1","ITEMX") }.to raise_error(RuntimeError, "Telemetry item 'TGT1 LATEST ITEMX' does not exist")
|
187
187
|
end
|
188
188
|
|
189
189
|
context "with two valid timestamps" do
|
190
|
-
it "
|
190
|
+
it "returns the latest packet (PKT1)" do
|
191
191
|
time = Time.now
|
192
192
|
@tlm.packet("TGT1","PKT1").received_time = time + 1
|
193
193
|
@tlm.packet("TGT1","PKT2").received_time = time
|
194
194
|
pkt = @tlm.newest_packet("TGT1","ITEM1")
|
195
|
-
pkt.packet_name.
|
196
|
-
pkt.received_time.
|
195
|
+
expect(pkt.packet_name).to eql "PKT1"
|
196
|
+
expect(pkt.received_time).to eql(time + 1)
|
197
197
|
end
|
198
198
|
|
199
|
-
it "
|
199
|
+
it "returns the latest packet (PKT2)" do
|
200
200
|
time = Time.now
|
201
201
|
@tlm.packet("TGT1","PKT1").received_time = time
|
202
202
|
@tlm.packet("TGT1","PKT2").received_time = time + 1
|
203
203
|
pkt = @tlm.newest_packet("TGT1","ITEM1")
|
204
|
-
pkt.packet_name.
|
205
|
-
pkt.received_time.
|
204
|
+
expect(pkt.packet_name).to eql "PKT2"
|
205
|
+
expect(pkt.received_time).to eql(time + 1)
|
206
206
|
end
|
207
207
|
|
208
|
-
it "
|
208
|
+
it "returns the last packet if timestamps are equal" do
|
209
209
|
time = Time.now
|
210
210
|
@tlm.packet("TGT1","PKT1").received_time = time
|
211
211
|
@tlm.packet("TGT1","PKT2").received_time = time
|
212
212
|
pkt = @tlm.newest_packet("TGT1","ITEM1")
|
213
|
-
pkt.packet_name.
|
214
|
-
pkt.received_time.
|
213
|
+
expect(pkt.packet_name).to eql "PKT2"
|
214
|
+
expect(pkt.received_time).to eql(time)
|
215
215
|
end
|
216
216
|
end
|
217
217
|
|
218
218
|
context "with one or more nil timestamps" do
|
219
|
-
it "
|
219
|
+
it "returns the last packet if neither has a timestamp" do
|
220
220
|
pkt = @tlm.newest_packet("TGT1","ITEM1")
|
221
|
-
pkt.packet_name.
|
222
|
-
pkt.received_time.
|
221
|
+
expect(pkt.packet_name).to eql "PKT2"
|
222
|
+
expect(pkt.received_time).to be_nil
|
223
223
|
end
|
224
224
|
|
225
|
-
it "
|
225
|
+
it "returns the packet with a timestamp (PKT1)" do
|
226
226
|
time = Time.now
|
227
227
|
@tlm.packet("TGT1","PKT1").received_time = time
|
228
228
|
pkt = @tlm.newest_packet("TGT1","ITEM1")
|
229
|
-
pkt.packet_name.
|
230
|
-
pkt.received_time.
|
229
|
+
expect(pkt.packet_name).to eql "PKT1"
|
230
|
+
expect(pkt.received_time).to eql time
|
231
231
|
end
|
232
232
|
|
233
|
-
it "
|
233
|
+
it "returns the packet with a timestamp (PKT2)" do
|
234
234
|
time = Time.now
|
235
235
|
@tlm.packet("TGT1","PKT2").received_time = time
|
236
236
|
pkt = @tlm.newest_packet("TGT1","ITEM1")
|
237
|
-
pkt.packet_name.
|
238
|
-
pkt.received_time.
|
237
|
+
expect(pkt.packet_name).to eql "PKT2"
|
238
|
+
expect(pkt.received_time).to eql time
|
239
239
|
end
|
240
240
|
end
|
241
241
|
end
|
242
242
|
|
243
243
|
describe "identify!" do
|
244
|
-
it "
|
245
|
-
@tlm.identify!(nil).
|
244
|
+
it "returns nil with a nil buffer" do
|
245
|
+
expect(@tlm.identify!(nil)).to be_nil
|
246
246
|
end
|
247
247
|
|
248
|
-
it "
|
248
|
+
it "only checks the targets given" do
|
249
249
|
buffer = "\x01\x02\x03\x04"
|
250
250
|
@tlm.identify!(buffer,["TGT1"])
|
251
251
|
pkt = @tlm.packet("TGT1","PKT1")
|
252
252
|
pkt.enable_method_missing
|
253
|
-
pkt.item1.
|
254
|
-
pkt.item2.
|
255
|
-
pkt.item3.
|
256
|
-
pkt.item4.
|
253
|
+
expect(pkt.item1).to eql 1
|
254
|
+
expect(pkt.item2).to eql 2
|
255
|
+
expect(pkt.item3).to eql 6.0
|
256
|
+
expect(pkt.item4).to eql 8.0
|
257
257
|
end
|
258
258
|
|
259
|
-
it "
|
259
|
+
it "returns nil with unknown targets given" do
|
260
260
|
buffer = "\x01\x02\x03\x04"
|
261
|
-
@tlm.identify!(buffer,["TGTX"]).
|
261
|
+
expect(@tlm.identify!(buffer,["TGTX"])).to be_nil
|
262
262
|
end
|
263
263
|
|
264
264
|
context "with an unknown buffer" do
|
265
|
-
it "
|
265
|
+
it "logs an invalid sized buffer" do
|
266
266
|
capture_io do |stdout|
|
267
267
|
buffer = "\x01\x02\x03\x04\x05"
|
268
268
|
@tlm.identify!(buffer)
|
269
269
|
pkt = @tlm.packet("TGT1","PKT1")
|
270
270
|
pkt.enable_method_missing
|
271
|
-
pkt.item1.
|
272
|
-
pkt.item2.
|
273
|
-
pkt.item3.
|
274
|
-
pkt.item4.
|
275
|
-
stdout.string.
|
271
|
+
expect(pkt.item1).to eql 1
|
272
|
+
expect(pkt.item2).to eql 2
|
273
|
+
expect(pkt.item3).to eql 6.0
|
274
|
+
expect(pkt.item4).to eql 8.0
|
275
|
+
expect(stdout.string).to match(/ERROR: TGT1 PKT1 received with actual packet length of 5 but defined length of 4/)
|
276
276
|
end
|
277
277
|
end
|
278
278
|
|
279
|
-
it "
|
279
|
+
it "identifies TGT1 PKT1" do
|
280
280
|
buffer = "\x01\x02\x03\x04"
|
281
281
|
@tlm.identify!(buffer)
|
282
282
|
pkt = @tlm.packet("TGT1","PKT1")
|
283
283
|
pkt.enable_method_missing
|
284
|
-
pkt.item1.
|
285
|
-
pkt.item2.
|
286
|
-
pkt.item3.
|
287
|
-
pkt.item4.
|
284
|
+
expect(pkt.item1).to eql 1
|
285
|
+
expect(pkt.item2).to eql 2
|
286
|
+
expect(pkt.item3).to eql 6.0
|
287
|
+
expect(pkt.item4).to eql 8.0
|
288
288
|
end
|
289
289
|
|
290
|
-
it "
|
290
|
+
it "identifies TGT1 PKT2" do
|
291
291
|
buffer = "\x02\x02"
|
292
292
|
@tlm.identify!(buffer)
|
293
293
|
pkt = @tlm.packet("TGT1","PKT2")
|
294
294
|
pkt.enable_method_missing
|
295
|
-
pkt.item1.
|
296
|
-
pkt.item2.
|
295
|
+
expect(pkt.item1).to eql 2
|
296
|
+
expect(pkt.item2).to eql 2
|
297
297
|
end
|
298
298
|
|
299
|
-
it "
|
299
|
+
it "identifies TGT2 PKT1" do
|
300
300
|
buffer = "\x03\x02"
|
301
301
|
@tlm.identify!(buffer)
|
302
302
|
pkt = @tlm.packet("TGT2","PKT1")
|
303
303
|
pkt.enable_method_missing
|
304
|
-
pkt.item1.
|
305
|
-
pkt.item2.
|
304
|
+
expect(pkt.item1).to eql 3
|
305
|
+
expect(pkt.item2).to eql 2
|
306
306
|
end
|
307
307
|
end
|
308
308
|
end
|
309
309
|
|
310
310
|
describe "update!" do
|
311
|
-
it "
|
311
|
+
it "complains about non-existant targets" do
|
312
312
|
expect { @tlm.update!("TGTX","PKT1","\x00") }.to raise_error(RuntimeError, "Telemetry target 'TGTX' does not exist")
|
313
313
|
end
|
314
314
|
|
315
|
-
it "
|
315
|
+
it "complains about non-existant packets" do
|
316
316
|
expect { @tlm.update!("TGT1","PKTX","\x00") }.to raise_error(RuntimeError, "Telemetry packet 'TGT1 PKTX' does not exist")
|
317
317
|
end
|
318
318
|
|
319
|
-
it "
|
319
|
+
it "complains about the 'LATEST' packet" do
|
320
320
|
expect { @tlm.update!("TGT1","LATEST","\x00") }.to raise_error(RuntimeError, "Telemetry packet 'TGT1 LATEST' does not exist")
|
321
321
|
end
|
322
322
|
|
323
|
-
it "
|
323
|
+
it "complains with a nil buffer" do
|
324
324
|
expect { @tlm.update!("TGT1","PKT1",nil) }.to raise_error(ArgumentError, "Buffer class is NilClass but must be String")
|
325
325
|
end
|
326
326
|
|
327
|
-
it "
|
327
|
+
it "logs an invalid sized buffer" do
|
328
328
|
capture_io do |stdout|
|
329
329
|
buffer = "\x01\x02\x03\x04\x05"
|
330
330
|
@tlm.update!("TGT1","PKT1",buffer)
|
331
331
|
pkt = @tlm.packet("TGT1","PKT1")
|
332
332
|
pkt.enable_method_missing
|
333
|
-
pkt.item1.
|
334
|
-
pkt.item2.
|
335
|
-
pkt.item3.
|
336
|
-
pkt.item4.
|
337
|
-
stdout.string.
|
333
|
+
expect(pkt.item1).to eql 1
|
334
|
+
expect(pkt.item2).to eql 2
|
335
|
+
expect(pkt.item3).to eql 6.0
|
336
|
+
expect(pkt.item4).to eql 8.0
|
337
|
+
expect(stdout.string).to match(/ERROR: TGT1 PKT1 received with actual packet length of 5 but defined length of 4/)
|
338
338
|
end
|
339
339
|
end
|
340
340
|
|
341
|
-
it "
|
341
|
+
it "updates a packet with the given data" do
|
342
342
|
@tlm.update!("TGT1","PKT1","\x01\x02\x03\x04")
|
343
343
|
pkt = @tlm.packet("TGT1","PKT1")
|
344
344
|
pkt.enable_method_missing
|
345
|
-
pkt.item1.
|
346
|
-
pkt.item2.
|
347
|
-
pkt.item3.
|
348
|
-
pkt.item4.
|
345
|
+
expect(pkt.item1).to eql 1
|
346
|
+
expect(pkt.item2).to eql 2
|
347
|
+
expect(pkt.item3).to eql 6.0
|
348
|
+
expect(pkt.item4).to eql 8.0
|
349
349
|
end
|
350
350
|
end
|
351
351
|
|
352
352
|
describe "limits_change_callback" do
|
353
|
-
it "
|
353
|
+
it "assigns a callback to each packet" do
|
354
354
|
callback = Object.new
|
355
355
|
expect(callback).to receive(:call).twice
|
356
356
|
@tlm.limits_change_callback = callback
|
@@ -364,107 +364,107 @@ module Cosmos
|
|
364
364
|
end
|
365
365
|
|
366
366
|
describe "check_stale" do
|
367
|
-
it "
|
367
|
+
it "checks each packet for staleness" do
|
368
368
|
@tlm.check_stale
|
369
|
-
@tlm.packet("TGT1","PKT1").stale.
|
370
|
-
@tlm.packet("TGT1","PKT2").stale.
|
371
|
-
@tlm.packet("TGT2","PKT1").stale.
|
369
|
+
expect(@tlm.packet("TGT1","PKT1").stale).to be_truthy
|
370
|
+
expect(@tlm.packet("TGT1","PKT2").stale).to be_truthy
|
371
|
+
expect(@tlm.packet("TGT2","PKT1").stale).to be_truthy
|
372
372
|
|
373
373
|
@tlm.packet("TGT1","PKT1").check_limits
|
374
374
|
@tlm.packet("TGT1","PKT2").check_limits
|
375
375
|
@tlm.packet("TGT2","PKT1").check_limits
|
376
376
|
@tlm.check_stale
|
377
|
-
@tlm.packet("TGT1","PKT1").stale.
|
378
|
-
@tlm.packet("TGT1","PKT2").stale.
|
379
|
-
@tlm.packet("TGT2","PKT1").stale.
|
377
|
+
expect(@tlm.packet("TGT1","PKT1").stale).to be_falsey
|
378
|
+
expect(@tlm.packet("TGT1","PKT2").stale).to be_falsey
|
379
|
+
expect(@tlm.packet("TGT2","PKT1").stale).to be_falsey
|
380
380
|
end
|
381
381
|
end
|
382
382
|
|
383
383
|
describe "clear_counters" do
|
384
|
-
it "
|
384
|
+
it "clears each packet's receive count " do
|
385
385
|
@tlm.packet("TGT1","PKT1").received_count = 1
|
386
386
|
@tlm.packet("TGT1","PKT2").received_count = 2
|
387
387
|
@tlm.packet("TGT2","PKT1").received_count = 3
|
388
388
|
@tlm.clear_counters
|
389
|
-
@tlm.packet("TGT1","PKT1").received_count.
|
390
|
-
@tlm.packet("TGT1","PKT2").received_count.
|
391
|
-
@tlm.packet("TGT2","PKT1").received_count.
|
389
|
+
expect(@tlm.packet("TGT1","PKT1").received_count).to eql 0
|
390
|
+
expect(@tlm.packet("TGT1","PKT2").received_count).to eql 0
|
391
|
+
expect(@tlm.packet("TGT2","PKT1").received_count).to eql 0
|
392
392
|
end
|
393
393
|
end
|
394
394
|
|
395
395
|
describe "value" do
|
396
|
-
it "
|
396
|
+
it "complains about non-existant targets" do
|
397
397
|
expect { @tlm.value("TGTX","PKT1","ITEM1") }.to raise_error(RuntimeError, "Telemetry target 'TGTX' does not exist")
|
398
398
|
end
|
399
399
|
|
400
|
-
it "
|
400
|
+
it "complains about non-existant packets" do
|
401
401
|
expect { @tlm.value("TGT1","PKTX","ITEM1") }.to raise_error(RuntimeError, "Telemetry packet 'TGT1 PKTX' does not exist")
|
402
402
|
end
|
403
403
|
|
404
|
-
it "
|
404
|
+
it "complains about non-existant items" do
|
405
405
|
expect { @tlm.value("TGT1","PKT1","ITEMX") }.to raise_error(RuntimeError, "Packet item 'TGT1 PKT1 ITEMX' does not exist")
|
406
406
|
end
|
407
407
|
|
408
|
-
it "
|
409
|
-
@tlm.value("TGT1","PKT1","ITEM1").
|
408
|
+
it "returns the value" do
|
409
|
+
expect(@tlm.value("TGT1","PKT1","ITEM1")).to eql 0
|
410
410
|
end
|
411
411
|
|
412
|
-
it "
|
413
|
-
@tlm.value("TGT1","LATEST","ITEM1").
|
412
|
+
it "returns the value using LATEST" do
|
413
|
+
expect(@tlm.value("TGT1","LATEST","ITEM1")).to eql 0
|
414
414
|
end
|
415
415
|
end
|
416
416
|
|
417
417
|
describe "set_tlm" do
|
418
|
-
it "
|
418
|
+
it "complains about non-existant targets" do
|
419
419
|
expect { @tlm.set_value("TGTX","PKT1","ITEM1", 1) }.to raise_error(RuntimeError, "Telemetry target 'TGTX' does not exist")
|
420
420
|
end
|
421
421
|
|
422
|
-
it "
|
422
|
+
it "complains about non-existant packets" do
|
423
423
|
expect { @tlm.set_value("TGT1","PKTX","ITEM1", 1) }.to raise_error(RuntimeError, "Telemetry packet 'TGT1 PKTX' does not exist")
|
424
424
|
end
|
425
425
|
|
426
|
-
it "
|
426
|
+
it "complains about non-existant items" do
|
427
427
|
expect { @tlm.set_value("TGT1","PKT1","ITEMX", 1) }.to raise_error(RuntimeError, "Packet item 'TGT1 PKT1 ITEMX' does not exist")
|
428
428
|
end
|
429
429
|
|
430
|
-
it "
|
430
|
+
it "sets the value" do
|
431
431
|
@tlm.set_value("TGT1","PKT1","ITEM1",1)
|
432
|
-
@tlm.value("TGT1","PKT1","ITEM1").
|
432
|
+
expect(@tlm.value("TGT1","PKT1","ITEM1")).to eql 1
|
433
433
|
end
|
434
434
|
|
435
|
-
it "
|
435
|
+
it "sets the value using LATEST" do
|
436
436
|
@tlm.set_value("TGT1","LATEST","ITEM1",1)
|
437
|
-
@tlm.value("TGT1","PKT1","ITEM1").
|
438
|
-
@tlm.value("TGT1","PKT2","ITEM1").
|
437
|
+
expect(@tlm.value("TGT1","PKT1","ITEM1")).to eql 0
|
438
|
+
expect(@tlm.value("TGT1","PKT2","ITEM1")).to eql 1
|
439
439
|
end
|
440
440
|
end
|
441
441
|
|
442
442
|
describe "values_and_limits_states" do
|
443
|
-
it "
|
443
|
+
it "complains about non-existant targets" do
|
444
444
|
expect { @tlm.values_and_limits_states([["TGTX","PKT1","ITEM1"]]) }.to raise_error(RuntimeError, "Telemetry target 'TGTX' does not exist")
|
445
445
|
end
|
446
446
|
|
447
|
-
it "
|
447
|
+
it "complains about non-existant packets" do
|
448
448
|
expect { @tlm.values_and_limits_states([["TGT1","PKTX","ITEM1"]]) }.to raise_error(RuntimeError, "Telemetry packet 'TGT1 PKTX' does not exist")
|
449
449
|
end
|
450
450
|
|
451
|
-
it "
|
451
|
+
it "complains about non-existant items" do
|
452
452
|
expect { @tlm.values_and_limits_states([["TGT1","PKT1","ITEMX"]]) }.to raise_error(RuntimeError, "Packet item 'TGT1 PKT1 ITEMX' does not exist")
|
453
453
|
end
|
454
454
|
|
455
|
-
it "
|
455
|
+
it "complains about non-existant value_types" do
|
456
456
|
expect { @tlm.values_and_limits_states([["TGT1","PKT1","ITEM1"]],:MINE) }.to raise_error(ArgumentError, "Unknown value type on read: MINE")
|
457
457
|
end
|
458
458
|
|
459
|
-
it "
|
459
|
+
it "complains if passed a single array" do
|
460
460
|
expect { @tlm.values_and_limits_states(["TGT1","PKT1","ITEM1"]) }.to raise_error(ArgumentError, /item_array must be a nested array/)
|
461
461
|
end
|
462
462
|
|
463
|
-
it "
|
463
|
+
it "complains about the wrong number of parameters" do
|
464
464
|
expect { @tlm.values_and_limits_states([["TGT1","PKT1","ITEM1"]],:RAW,:RAW) }.to raise_error(ArgumentError, /wrong number of arguments/)
|
465
465
|
end
|
466
466
|
|
467
|
-
it "
|
467
|
+
it "reads all the specified values" do
|
468
468
|
@tlm.update!("TGT1","PKT1","\x01\x02\x03\x04")
|
469
469
|
@tlm.update!("TGT1","PKT2","\x05\x06")
|
470
470
|
@tlm.update!("TGT2","PKT1","\x07\x08")
|
@@ -476,18 +476,18 @@ module Cosmos
|
|
476
476
|
items << %w(TGT1 PKT2 ITEM2)
|
477
477
|
items << %w(TGT2 PKT1 ITEM1)
|
478
478
|
vals = @tlm.values_and_limits_states(items)
|
479
|
-
vals[0][0].
|
480
|
-
vals[0][1].
|
481
|
-
vals[0][2].
|
482
|
-
vals[1][0].
|
483
|
-
vals[1][1].
|
484
|
-
vals[1][2].
|
485
|
-
vals[2][0].
|
486
|
-
vals[2][1].
|
487
|
-
vals[2][2].
|
488
|
-
end
|
489
|
-
|
490
|
-
it "
|
479
|
+
expect(vals[0][0]).to eql 1
|
480
|
+
expect(vals[0][1]).to eql 6
|
481
|
+
expect(vals[0][2]).to eql 7
|
482
|
+
expect(vals[1][0]).to eql :RED_LOW
|
483
|
+
expect(vals[1][1]).to be_nil
|
484
|
+
expect(vals[1][2]).to be_nil
|
485
|
+
expect(vals[2][0]).to eql [1.0, 2.0, 4.0, 5.0]
|
486
|
+
expect(vals[2][1]).to be_nil
|
487
|
+
expect(vals[2][2]).to be_nil
|
488
|
+
end
|
489
|
+
|
490
|
+
it "reads all the specified values with specified value_types" do
|
491
491
|
@tlm.update!("TGT1","PKT1","\x01\x02\x03\x04")
|
492
492
|
@tlm.update!("TGT1","PKT2","\x05\x06")
|
493
493
|
@tlm.update!("TGT2","PKT1","\x07\x08")
|
@@ -503,30 +503,30 @@ module Cosmos
|
|
503
503
|
items << %w(TGT2 PKT1 ITEM1)
|
504
504
|
formats = [:CONVERTED, :RAW, :CONVERTED, :RAW, :CONVERTED, :CONVERTED]
|
505
505
|
vals = @tlm.values_and_limits_states(items,formats)
|
506
|
-
vals[0][0].
|
507
|
-
vals[0][1].
|
508
|
-
vals[0][2].
|
509
|
-
vals[0][3].
|
510
|
-
vals[0][4].
|
511
|
-
vals[0][5].
|
512
|
-
vals[1][0].
|
513
|
-
vals[1][1].
|
514
|
-
vals[1][2].
|
515
|
-
vals[1][3].
|
516
|
-
vals[1][4].
|
517
|
-
vals[1][5].
|
518
|
-
vals[2][0].
|
519
|
-
vals[2][1].
|
520
|
-
vals[2][2].
|
521
|
-
vals[2][3].
|
522
|
-
vals[2][4].
|
523
|
-
vals[2][5].
|
506
|
+
expect(vals[0][0]).to eql 1
|
507
|
+
expect(vals[0][1]).to eql 2
|
508
|
+
expect(vals[0][2]).to eql 6.0
|
509
|
+
expect(vals[0][3]).to eql 4
|
510
|
+
expect(vals[0][4]).to eql 6
|
511
|
+
expect(vals[0][5]).to eql 7
|
512
|
+
expect(vals[1][0]).to eql :RED_LOW
|
513
|
+
expect(vals[1][1]).to eql :YELLOW_LOW
|
514
|
+
expect(vals[1][2]).to be_nil
|
515
|
+
expect(vals[1][3]).to be_nil
|
516
|
+
expect(vals[1][4]).to be_nil
|
517
|
+
expect(vals[1][5]).to be_nil
|
518
|
+
expect(vals[2][0]).to eql [1.0, 2.0, 4.0, 5.0]
|
519
|
+
expect(vals[2][1]).to eql [1.0, 2.0, 4.0, 5.0]
|
520
|
+
expect(vals[2][2]).to be_nil
|
521
|
+
expect(vals[2][3]).to be_nil
|
522
|
+
expect(vals[2][4]).to be_nil
|
523
|
+
expect(vals[2][5]).to be_nil
|
524
524
|
end
|
525
525
|
end
|
526
526
|
|
527
527
|
describe "all" do
|
528
|
-
it "
|
529
|
-
@tlm.all.keys.
|
528
|
+
it "returns all packets" do
|
529
|
+
expect(@tlm.all.keys).to eql %w(UNKNOWN TGT1 TGT2)
|
530
530
|
end
|
531
531
|
end
|
532
532
|
|