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
@@ -22,7 +22,7 @@ module Cosmos
|
|
22
22
|
@pc = PacketConfig.new
|
23
23
|
end
|
24
24
|
|
25
|
-
it "
|
25
|
+
it "complains about unknown keywords" do
|
26
26
|
tf = Tempfile.new('unittest')
|
27
27
|
tf.puts("BLAH")
|
28
28
|
tf.close
|
@@ -40,7 +40,7 @@ module Cosmos
|
|
40
40
|
@item_keywords = %w(STATE READ_CONVERSION WRITE_CONVERSION POLY_READ_CONVERSION POLY_WRITE_CONVERSION SEG_POLY_READ_CONVERSION SEG_POLY_WRITE_CONVERSION GENERIC_READ_CONVERSION_START GENERIC_WRITE_CONVERSION_START LIMITS LIMITS_RESPONSE UNITS FORMAT_STRING DESCRIPTION META)
|
41
41
|
end
|
42
42
|
|
43
|
-
it "
|
43
|
+
it "complains if a current packet is not defined" do
|
44
44
|
# Check for missing TELEMETRY line
|
45
45
|
@tlm_keywords.each do |keyword|
|
46
46
|
tf = Tempfile.new('unittest')
|
@@ -51,7 +51,7 @@ module Cosmos
|
|
51
51
|
end # end for each tlm_keywords
|
52
52
|
end
|
53
53
|
|
54
|
-
it "
|
54
|
+
it "complains if a current item is not defined" do
|
55
55
|
# Check for missing ITEM definitions
|
56
56
|
@item_keywords.each do |keyword|
|
57
57
|
next if %w(META).include? keyword
|
@@ -64,7 +64,7 @@ module Cosmos
|
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
-
it "
|
67
|
+
it "complains if there are not enough parameters" do
|
68
68
|
@top_keywords.each do |keyword|
|
69
69
|
tf = Tempfile.new('unittest')
|
70
70
|
tf.puts(keyword)
|
@@ -94,7 +94,7 @@ module Cosmos
|
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
97
|
-
it "
|
97
|
+
it "complains if there are too many parameters" do
|
98
98
|
@top_keywords.each do |keyword|
|
99
99
|
tf = Tempfile.new('unittest')
|
100
100
|
case keyword
|
@@ -164,7 +164,7 @@ module Cosmos
|
|
164
164
|
end
|
165
165
|
|
166
166
|
context "with SELECT_COMMAND or SELECT_TELEMETRY" do
|
167
|
-
it "
|
167
|
+
it "complains if the packet is not found" do
|
168
168
|
%w(SELECT_COMMAND SELECT_TELEMETRY).each do |keyword|
|
169
169
|
tf = Tempfile.new('unittest')
|
170
170
|
tf.puts keyword + ' tgt1 pkt1'
|
@@ -176,7 +176,7 @@ module Cosmos
|
|
176
176
|
end
|
177
177
|
end
|
178
178
|
|
179
|
-
it "
|
179
|
+
it "selects a packet for modification" do
|
180
180
|
%w(SELECT_COMMAND SELECT_TELEMETRY).each do |keyword|
|
181
181
|
tf = Tempfile.new('unittest')
|
182
182
|
tf.puts 'COMMAND tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
@@ -187,7 +187,7 @@ module Cosmos
|
|
187
187
|
@pc.process_file(tf.path, "TGT1")
|
188
188
|
pkt = @pc.commands["TGT1"]["PKT1"] if keyword =~ /COMMAND/
|
189
189
|
pkt = @pc.telemetry["TGT1"]["PKT1"] if keyword =~ /TELEMETRY/
|
190
|
-
pkt.get_item("ITEM1").description.
|
190
|
+
expect(pkt.get_item("ITEM1").description).to eql "Item"
|
191
191
|
tf.unlink
|
192
192
|
|
193
193
|
tf = Tempfile.new('unittest')
|
@@ -199,12 +199,12 @@ module Cosmos
|
|
199
199
|
@pc.process_file(tf.path, "TGT1")
|
200
200
|
pkt = @pc.commands["TGT1"]["PKT1"] if keyword =~ /COMMAND/
|
201
201
|
pkt = @pc.telemetry["TGT1"]["PKT1"] if keyword =~ /TELEMETRY/
|
202
|
-
pkt.get_item("ITEM1").description.
|
202
|
+
expect(pkt.get_item("ITEM1").description).to eql "New description"
|
203
203
|
tf.unlink
|
204
204
|
end
|
205
205
|
end
|
206
206
|
|
207
|
-
it "
|
207
|
+
it "substitutes the target name" do
|
208
208
|
%w(SELECT_COMMAND SELECT_TELEMETRY).each do |keyword|
|
209
209
|
tf = Tempfile.new('unittest')
|
210
210
|
tf.puts 'COMMAND tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
@@ -215,7 +215,7 @@ module Cosmos
|
|
215
215
|
@pc.process_file(tf.path, "NEW")
|
216
216
|
pkt = @pc.commands["NEW"]["PKT1"] if keyword =~ /COMMAND/
|
217
217
|
pkt = @pc.telemetry["NEW"]["PKT1"] if keyword =~ /TELEMETRY/
|
218
|
-
pkt.get_item("ITEM1").description.
|
218
|
+
expect(pkt.get_item("ITEM1").description).to eql "Item"
|
219
219
|
tf.unlink
|
220
220
|
|
221
221
|
tf = Tempfile.new('unittest')
|
@@ -227,14 +227,14 @@ module Cosmos
|
|
227
227
|
@pc.process_file(tf.path, "NEW")
|
228
228
|
pkt = @pc.commands["NEW"]["PKT1"] if keyword =~ /COMMAND/
|
229
229
|
pkt = @pc.telemetry["NEW"]["PKT1"] if keyword =~ /TELEMETRY/
|
230
|
-
pkt.get_item("ITEM1").description.
|
230
|
+
expect(pkt.get_item("ITEM1").description).to eql "New description"
|
231
231
|
tf.unlink
|
232
232
|
end
|
233
233
|
end
|
234
234
|
end
|
235
235
|
|
236
236
|
context "with SELECT_PARAMETER" do
|
237
|
-
it "
|
237
|
+
it "complains if used with SELECT_TELEMETRY" do
|
238
238
|
tf = Tempfile.new('unittest')
|
239
239
|
tf.puts 'TELEMETRY TGT PKT LITTLE_ENDIAN "Packet"'
|
240
240
|
tf.puts ' APPEND_ITEM ITEM 16 UINT "Item"'
|
@@ -244,14 +244,14 @@ module Cosmos
|
|
244
244
|
expect { @pc.process_file(tf.path, "TGT") }.to raise_error(ConfigParser::Error, "SELECT_PARAMETER only applies to command packets")
|
245
245
|
end
|
246
246
|
|
247
|
-
it "
|
247
|
+
it "complains if the parameter is not found" do
|
248
248
|
tf = Tempfile.new('unittest')
|
249
249
|
tf.puts 'COMMAND TGT PKT LITTLE_ENDIAN "Packet"'
|
250
250
|
tf.puts ' APPEND_PARAMETER PARAM 16 UINT 0 0 0 "Param"'
|
251
251
|
tf.close
|
252
252
|
@pc.process_file(tf.path, "TGT")
|
253
253
|
pkt = @pc.commands["TGT"]["PKT"]
|
254
|
-
pkt.get_item("PARAM").description.
|
254
|
+
expect(pkt.get_item("PARAM").description).to eql "Param"
|
255
255
|
tf.unlink
|
256
256
|
|
257
257
|
tf = Tempfile.new('unittest')
|
@@ -264,7 +264,7 @@ module Cosmos
|
|
264
264
|
end
|
265
265
|
|
266
266
|
context "with SELECT_ITEM" do
|
267
|
-
it "
|
267
|
+
it "complains if used with SELECT_COMMAND" do
|
268
268
|
tf = Tempfile.new('unittest')
|
269
269
|
tf.puts 'COMMAND TGT PKT LITTLE_ENDIAN "Packet"'
|
270
270
|
tf.puts ' APPEND_PARAMETER PARAM 16 UINT 0 0 0 "Param"'
|
@@ -274,14 +274,14 @@ module Cosmos
|
|
274
274
|
expect { @pc.process_file(tf.path, "TGT") }.to raise_error(ConfigParser::Error, "SELECT_ITEM only applies to telemetry packets")
|
275
275
|
end
|
276
276
|
|
277
|
-
it "
|
277
|
+
it "complains if the item is not found" do
|
278
278
|
tf = Tempfile.new('unittest')
|
279
279
|
tf.puts 'TELEMETRY TGT PKT LITTLE_ENDIAN "Packet"'
|
280
280
|
tf.puts ' APPEND_ITEM ITEM 16 UINT "Item"'
|
281
281
|
tf.close
|
282
282
|
@pc.process_file(tf.path, "TGT")
|
283
283
|
pkt = @pc.telemetry["TGT"]["PKT"]
|
284
|
-
pkt.get_item("ITEM").description.
|
284
|
+
expect(pkt.get_item("ITEM").description).to eql "Item"
|
285
285
|
tf.unlink
|
286
286
|
|
287
287
|
tf = Tempfile.new('unittest')
|
@@ -313,27 +313,27 @@ module Cosmos
|
|
313
313
|
end
|
314
314
|
|
315
315
|
context "with LIMITS_GROUP" do
|
316
|
-
it "
|
316
|
+
it "creates a new limits group" do
|
317
317
|
tf = Tempfile.new('unittest')
|
318
318
|
tf.puts 'LIMITS_GROUP TVAC'
|
319
319
|
tf.puts 'LIMITS_GROUP VIBE'
|
320
320
|
tf.close
|
321
|
-
@pc.limits_groups.
|
321
|
+
expect(@pc.limits_groups).to be_empty
|
322
322
|
@pc.process_file(tf.path, "TGT1")
|
323
|
-
@pc.limits_groups.
|
323
|
+
expect(@pc.limits_groups).to include('TVAC','VIBE')
|
324
324
|
tf.unlink
|
325
325
|
end
|
326
326
|
end
|
327
327
|
|
328
328
|
context "with LIMITS_ITEM" do
|
329
|
-
it "
|
329
|
+
it "adds a new limits item to the group" do
|
330
330
|
tf = Tempfile.new('unittest')
|
331
331
|
tf.puts 'LIMITS_GROUP TVAC'
|
332
332
|
tf.puts 'LIMITS_GROUP_ITEM TGT1 PKT1 ITEM1'
|
333
333
|
tf.close
|
334
|
-
@pc.limits_groups.
|
334
|
+
expect(@pc.limits_groups).to be_empty
|
335
335
|
@pc.process_file(tf.path, "TGT1")
|
336
|
-
@pc.limits_groups["TVAC"].
|
336
|
+
expect(@pc.limits_groups["TVAC"]).to eql [%w(TGT1 PKT1 ITEM1)]
|
337
337
|
tf.unlink
|
338
338
|
|
339
339
|
# Show we can 're-open' the group and add items
|
@@ -342,27 +342,27 @@ module Cosmos
|
|
342
342
|
tf.puts 'LIMITS_GROUP_ITEM TGT1 PKT1 ITEM2'
|
343
343
|
tf.close
|
344
344
|
@pc.process_file(tf.path, "TGT1")
|
345
|
-
@pc.limits_groups["TVAC"].
|
345
|
+
expect(@pc.limits_groups["TVAC"]).to eql [%w(TGT1 PKT1 ITEM1), %w(TGT1 PKT1 ITEM2)]
|
346
346
|
tf.unlink
|
347
347
|
end
|
348
348
|
end
|
349
349
|
|
350
350
|
context "with ALLOW_SHORT" do
|
351
|
-
it "
|
351
|
+
it "marks the packet as allowing short buffers" do
|
352
352
|
tf = Tempfile.new('unittest')
|
353
353
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Description"'
|
354
354
|
tf.puts 'ALLOW_SHORT'
|
355
355
|
tf.puts 'TELEMETRY tgt1 pkt2 LITTLE_ENDIAN "Description"'
|
356
356
|
tf.close
|
357
357
|
@pc.process_file(tf.path, "TGT1")
|
358
|
-
@pc.telemetry["TGT1"]["PKT1"].short_buffer_allowed.
|
359
|
-
@pc.telemetry["TGT1"]["PKT2"].short_buffer_allowed.
|
358
|
+
expect(@pc.telemetry["TGT1"]["PKT1"].short_buffer_allowed).to be_truthy
|
359
|
+
expect(@pc.telemetry["TGT1"]["PKT2"].short_buffer_allowed).to be_falsey
|
360
360
|
tf.unlink
|
361
361
|
end
|
362
362
|
end
|
363
363
|
|
364
364
|
context "with META" do
|
365
|
-
it "
|
365
|
+
it "saves metadata" do
|
366
366
|
tf = Tempfile.new('unittest')
|
367
367
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Description"'
|
368
368
|
tf.puts 'META TYPE "struct packet"'
|
@@ -370,60 +370,60 @@ module Cosmos
|
|
370
370
|
tf.puts 'META TYPE "struct packet2"'
|
371
371
|
tf.close
|
372
372
|
@pc.process_file(tf.path, "TGT1")
|
373
|
-
@pc.telemetry["TGT1"]["PKT1"].meta['TYPE'].
|
374
|
-
@pc.telemetry["TGT1"]["PKT2"].meta['TYPE'].
|
373
|
+
expect(@pc.telemetry["TGT1"]["PKT1"].meta['TYPE']).to eql ["struct packet"]
|
374
|
+
expect(@pc.telemetry["TGT1"]["PKT2"].meta['TYPE']).to eql ["struct packet2"]
|
375
375
|
tf.unlink
|
376
376
|
end
|
377
377
|
end
|
378
378
|
|
379
379
|
context "with DISABLE_MESSAGES" do
|
380
|
-
it "
|
380
|
+
it "marks the packet as messages disabled" do
|
381
381
|
tf = Tempfile.new('unittest')
|
382
382
|
tf.puts 'COMMAND tgt1 pkt1 LITTLE_ENDIAN "Description"'
|
383
383
|
tf.puts 'DISABLE_MESSAGES'
|
384
384
|
tf.puts 'COMMAND tgt1 pkt2 LITTLE_ENDIAN "Description"'
|
385
385
|
tf.close
|
386
386
|
@pc.process_file(tf.path, "TGT1")
|
387
|
-
@pc.commands["TGT1"]["PKT1"].messages_disabled.
|
388
|
-
@pc.commands["TGT1"]["PKT2"].messages_disabled.
|
387
|
+
expect(@pc.commands["TGT1"]["PKT1"].messages_disabled).to be_truthy
|
388
|
+
expect(@pc.commands["TGT1"]["PKT2"].messages_disabled).to be_falsey
|
389
389
|
tf.unlink
|
390
390
|
end
|
391
391
|
end
|
392
392
|
|
393
393
|
context "with HIDDEN" do
|
394
|
-
it "
|
394
|
+
it "marks the packet as hidden" do
|
395
395
|
tf = Tempfile.new('unittest')
|
396
396
|
tf.puts 'COMMAND tgt1 pkt1 LITTLE_ENDIAN "Description"'
|
397
397
|
tf.puts 'HIDDEN'
|
398
398
|
tf.puts 'COMMAND tgt1 pkt2 LITTLE_ENDIAN "Description"'
|
399
399
|
tf.close
|
400
400
|
@pc.process_file(tf.path, "TGT1")
|
401
|
-
@pc.commands["TGT1"]["PKT1"].hidden.
|
402
|
-
@pc.commands["TGT1"]["PKT1"].disabled.
|
403
|
-
@pc.commands["TGT1"]["PKT2"].hidden.
|
404
|
-
@pc.commands["TGT1"]["PKT2"].disabled.
|
401
|
+
expect(@pc.commands["TGT1"]["PKT1"].hidden).to be_truthy
|
402
|
+
expect(@pc.commands["TGT1"]["PKT1"].disabled).to be_falsey
|
403
|
+
expect(@pc.commands["TGT1"]["PKT2"].hidden).to be_falsey
|
404
|
+
expect(@pc.commands["TGT1"]["PKT2"].disabled).to be_falsey
|
405
405
|
tf.unlink
|
406
406
|
end
|
407
407
|
end
|
408
408
|
|
409
409
|
context "with DISABLED" do
|
410
|
-
it "
|
410
|
+
it "marks the packet as disabled" do
|
411
411
|
tf = Tempfile.new('unittest')
|
412
412
|
tf.puts 'COMMAND tgt1 pkt1 LITTLE_ENDIAN "Description"'
|
413
413
|
tf.puts 'DISABLED'
|
414
414
|
tf.puts 'COMMAND tgt1 pkt2 LITTLE_ENDIAN "Description"'
|
415
415
|
tf.close
|
416
416
|
@pc.process_file(tf.path, "TGT1")
|
417
|
-
@pc.commands["TGT1"]["PKT1"].hidden.
|
418
|
-
@pc.commands["TGT1"]["PKT1"].disabled.
|
419
|
-
@pc.commands["TGT1"]["PKT2"].hidden.
|
420
|
-
@pc.commands["TGT1"]["PKT2"].disabled.
|
417
|
+
expect(@pc.commands["TGT1"]["PKT1"].hidden).to be_truthy
|
418
|
+
expect(@pc.commands["TGT1"]["PKT1"].disabled).to be_truthy
|
419
|
+
expect(@pc.commands["TGT1"]["PKT2"].hidden).to be_falsey
|
420
|
+
expect(@pc.commands["TGT1"]["PKT2"].disabled).to be_falsey
|
421
421
|
tf.unlink
|
422
422
|
end
|
423
423
|
end
|
424
424
|
|
425
425
|
context "with HAZARDOUS" do
|
426
|
-
it "
|
426
|
+
it "marks the packet as hazardous" do
|
427
427
|
tf = Tempfile.new('unittest')
|
428
428
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Description"'
|
429
429
|
tf.puts 'HAZARDOUS'
|
@@ -433,27 +433,27 @@ module Cosmos
|
|
433
433
|
tf.puts 'COMMAND tgt2 pkt2 LITTLE_ENDIAN "Description"'
|
434
434
|
tf.close
|
435
435
|
@pc.process_file(tf.path, "SYSTEM")
|
436
|
-
@pc.telemetry["TGT1"]["PKT1"].hazardous.
|
437
|
-
@pc.telemetry["TGT1"]["PKT2"].hazardous.
|
438
|
-
@pc.commands["TGT2"]["PKT1"].hazardous.
|
439
|
-
@pc.commands["TGT2"]["PKT2"].hazardous.
|
436
|
+
expect(@pc.telemetry["TGT1"]["PKT1"].hazardous).to be_truthy
|
437
|
+
expect(@pc.telemetry["TGT1"]["PKT2"].hazardous).to be_falsey
|
438
|
+
expect(@pc.commands["TGT2"]["PKT1"].hazardous).to be_truthy
|
439
|
+
expect(@pc.commands["TGT2"]["PKT2"].hazardous).to be_falsey
|
440
440
|
tf.unlink
|
441
441
|
end
|
442
442
|
|
443
|
-
it "
|
443
|
+
it "takes a description" do
|
444
444
|
tf = Tempfile.new('unittest')
|
445
445
|
tf.puts 'COMMAND tgt1 pkt1 LITTLE_ENDIAN "Description"'
|
446
446
|
tf.puts 'HAZARDOUS "Hazardous description"'
|
447
447
|
tf.close
|
448
448
|
@pc.process_file(tf.path, "TGT1")
|
449
|
-
@pc.commands["TGT1"]["PKT1"].hazardous.
|
450
|
-
@pc.commands["TGT1"]["PKT1"].hazardous_description.
|
449
|
+
expect(@pc.commands["TGT1"]["PKT1"].hazardous).to be_truthy
|
450
|
+
expect(@pc.commands["TGT1"]["PKT1"].hazardous_description).to eql "Hazardous description"
|
451
451
|
tf.unlink
|
452
452
|
end
|
453
453
|
end
|
454
454
|
|
455
455
|
context "with READ_CONVERSION and WRITE_CONVERSION" do
|
456
|
-
it "
|
456
|
+
it "complains about missing conversion file" do
|
457
457
|
filename = File.join(File.dirname(__FILE__), "../test_only.rb")
|
458
458
|
File.delete(filename) if File.exist?(filename)
|
459
459
|
@pc = PacketConfig.new
|
@@ -475,7 +475,7 @@ module Cosmos
|
|
475
475
|
tf.unlink
|
476
476
|
end
|
477
477
|
|
478
|
-
it "
|
478
|
+
it "complains about a non Cosmos::Conversion class" do
|
479
479
|
filename = File.join(File.dirname(__FILE__), "../conversion1.rb")
|
480
480
|
File.open(filename, 'w') do |file|
|
481
481
|
file.puts "class Conversion1"
|
@@ -503,7 +503,7 @@ module Cosmos
|
|
503
503
|
tf.unlink
|
504
504
|
end
|
505
505
|
|
506
|
-
it "
|
506
|
+
it "parses the conversion" do
|
507
507
|
filename = File.join(File.dirname(__FILE__), "../conversion2.rb")
|
508
508
|
File.open(filename, 'w') do |file|
|
509
509
|
file.puts "require 'cosmos/conversions/conversion'"
|
@@ -522,7 +522,7 @@ module Cosmos
|
|
522
522
|
tf.close
|
523
523
|
@pc.process_file(tf.path, "TGT1")
|
524
524
|
@pc.telemetry["TGT1"]["PKT1"].buffer = "\x01"
|
525
|
-
@pc.telemetry["TGT1"]["PKT1"].read("ITEM1").
|
525
|
+
expect(@pc.telemetry["TGT1"]["PKT1"].read("ITEM1")).to eql 2
|
526
526
|
tf.unlink
|
527
527
|
|
528
528
|
tf = Tempfile.new('unittest')
|
@@ -532,7 +532,7 @@ module Cosmos
|
|
532
532
|
tf.close
|
533
533
|
@pc.process_file(tf.path, "TGT1")
|
534
534
|
@pc.commands["TGT1"]["PKT1"].write("ITEM1", 3)
|
535
|
-
@pc.commands["TGT1"]["PKT1"].read("ITEM1").
|
535
|
+
expect(@pc.commands["TGT1"]["PKT1"].read("ITEM1")).to eql 6
|
536
536
|
tf.unlink
|
537
537
|
|
538
538
|
File.delete(filename) if File.exist?(filename)
|
@@ -540,7 +540,7 @@ module Cosmos
|
|
540
540
|
end
|
541
541
|
|
542
542
|
context "with POLY_READ_CONVERSION and POLY_WRITE_CONVERSION" do
|
543
|
-
it "
|
543
|
+
it "performs a polynomial conversion" do
|
544
544
|
tf = Tempfile.new('unittest')
|
545
545
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
546
546
|
tf.puts ' ITEM item1 0 16 INT "Integer Item"'
|
@@ -548,7 +548,7 @@ module Cosmos
|
|
548
548
|
tf.close
|
549
549
|
@pc.process_file(tf.path, "TGT1")
|
550
550
|
@pc.telemetry["TGT1"]["PKT1"].buffer = "\x01"
|
551
|
-
@pc.telemetry["TGT1"]["PKT1"].read("ITEM1").
|
551
|
+
expect(@pc.telemetry["TGT1"]["PKT1"].read("ITEM1")).to eql 7.0
|
552
552
|
tf.unlink
|
553
553
|
|
554
554
|
tf = Tempfile.new('unittest')
|
@@ -558,13 +558,13 @@ module Cosmos
|
|
558
558
|
tf.close
|
559
559
|
@pc.process_file(tf.path, "TGT1")
|
560
560
|
@pc.commands["TGT1"]["PKT1"].write("ITEM1", 3)
|
561
|
-
@pc.commands["TGT1"]["PKT1"].read("ITEM1").
|
561
|
+
expect(@pc.commands["TGT1"]["PKT1"].read("ITEM1")).to eql 11
|
562
562
|
tf.unlink
|
563
563
|
end
|
564
564
|
end
|
565
565
|
|
566
566
|
context "with SEG_POLY_READ_CONVERSION and SEG_POLY_WRITE_CONVERSION" do
|
567
|
-
it "
|
567
|
+
it "performs a segmented polynomial conversion" do
|
568
568
|
tf = Tempfile.new('unittest')
|
569
569
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
570
570
|
tf.puts ' ITEM item1 0 16 INT "Integer Item"'
|
@@ -573,9 +573,9 @@ module Cosmos
|
|
573
573
|
tf.close
|
574
574
|
@pc.process_file(tf.path, "TGT1")
|
575
575
|
@pc.telemetry["TGT1"]["PKT1"].buffer = "\x01"
|
576
|
-
@pc.telemetry["TGT1"]["PKT1"].read("ITEM1").
|
576
|
+
expect(@pc.telemetry["TGT1"]["PKT1"].read("ITEM1")).to eql 3.0
|
577
577
|
@pc.telemetry["TGT1"]["PKT1"].buffer = "\x05"
|
578
|
-
@pc.telemetry["TGT1"]["PKT1"].read("ITEM1").
|
578
|
+
expect(@pc.telemetry["TGT1"]["PKT1"].read("ITEM1")).to eql 17.0
|
579
579
|
tf.unlink
|
580
580
|
|
581
581
|
tf = Tempfile.new('unittest')
|
@@ -586,15 +586,15 @@ module Cosmos
|
|
586
586
|
tf.close
|
587
587
|
@pc.process_file(tf.path, "TGT1")
|
588
588
|
@pc.commands["TGT1"]["PKT1"].write("ITEM1", 1)
|
589
|
-
@pc.commands["TGT1"]["PKT1"].read("ITEM1").
|
589
|
+
expect(@pc.commands["TGT1"]["PKT1"].read("ITEM1")).to eql 3
|
590
590
|
@pc.commands["TGT1"]["PKT1"].write("ITEM1", 5)
|
591
|
-
@pc.commands["TGT1"]["PKT1"].read("ITEM1").
|
591
|
+
expect(@pc.commands["TGT1"]["PKT1"].read("ITEM1")).to eql 17
|
592
592
|
tf.unlink
|
593
593
|
end
|
594
594
|
end
|
595
595
|
|
596
596
|
context "with GENERIC_READ_CONVERSION and GENERIC_WRITE_CONVERSION" do
|
597
|
-
it "
|
597
|
+
it "processes a generic conversion" do
|
598
598
|
tf = Tempfile.new('unittest')
|
599
599
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
600
600
|
tf.puts ' APPEND_ITEM item1 16 UINT "Item"'
|
@@ -610,12 +610,12 @@ module Cosmos
|
|
610
610
|
pkt = @pc.telemetry["TGT1"]["PKT1"]
|
611
611
|
pkt.enable_method_missing
|
612
612
|
pkt.item1 = 2
|
613
|
-
pkt.item1.
|
614
|
-
pkt.item2.
|
613
|
+
expect(pkt.item1).to eql 4
|
614
|
+
expect(pkt.item2).to eql "Number 0"
|
615
615
|
tf.unlink
|
616
616
|
end
|
617
617
|
|
618
|
-
it "
|
618
|
+
it "processes a generic conversion with a defined type" do
|
619
619
|
tf = Tempfile.new('unittest')
|
620
620
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
621
621
|
tf.puts ' APPEND_ITEM item1 16 UINT "Item"'
|
@@ -631,9 +631,9 @@ module Cosmos
|
|
631
631
|
pkt = @pc.telemetry["TGT1"]["PKT1"]
|
632
632
|
pkt.enable_method_missing
|
633
633
|
pkt.item1 = 400
|
634
|
-
pkt.item1.
|
634
|
+
expect(pkt.item1).to eql 800
|
635
635
|
pkt.item2 = 400
|
636
|
-
pkt.item2.
|
636
|
+
expect(pkt.item2).to eql 800.0
|
637
637
|
tf.unlink
|
638
638
|
end
|
639
639
|
end
|
@@ -654,7 +654,7 @@ module Cosmos
|
|
654
654
|
@pc.telemetry["TGT1"]["PKT1"].buffer = "\x04"
|
655
655
|
@pc.telemetry["TGT1"]["PKT1"].enable_limits("ITEM1")
|
656
656
|
@pc.telemetry["TGT1"]["PKT1"].check_limits
|
657
|
-
item.limits.state.
|
657
|
+
expect(item.limits.state).to eql :RED_LOW
|
658
658
|
tf.unlink
|
659
659
|
end
|
660
660
|
end
|
@@ -667,13 +667,13 @@ module Cosmos
|
|
667
667
|
tf.puts ' UNITS Volts V'
|
668
668
|
tf.close
|
669
669
|
@pc.process_file(tf.path, "TGT1")
|
670
|
-
@pc.telemetry["TGT1"]["PKT1"].read("ITEM1",:WITH_UNITS).
|
670
|
+
expect(@pc.telemetry["TGT1"]["PKT1"].read("ITEM1",:WITH_UNITS)).to eql "0 V"
|
671
671
|
tf.unlink
|
672
672
|
end
|
673
673
|
end
|
674
674
|
|
675
675
|
context "with META" do
|
676
|
-
it "
|
676
|
+
it "saves metadata for items" do
|
677
677
|
tf = Tempfile.new('unittest')
|
678
678
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
679
679
|
tf.puts ' ITEM item1 0 8 UINT'
|
@@ -681,14 +681,14 @@ module Cosmos
|
|
681
681
|
tf.puts ' META OTHER'
|
682
682
|
tf.close
|
683
683
|
@pc.process_file(tf.path, "TGT1")
|
684
|
-
@pc.telemetry["TGT1"]["PKT1"].get_item('item1').meta['TYPE'].
|
685
|
-
@pc.telemetry["TGT1"]["PKT1"].get_item('item1').meta['OTHER'].
|
684
|
+
expect(@pc.telemetry["TGT1"]["PKT1"].get_item('item1').meta['TYPE']).to eql ['unsigned int']
|
685
|
+
expect(@pc.telemetry["TGT1"]["PKT1"].get_item('item1').meta['OTHER']).to eql []
|
686
686
|
tf.unlink
|
687
687
|
end
|
688
688
|
end
|
689
689
|
|
690
690
|
context "with OVERFLOW" do
|
691
|
-
it "
|
691
|
+
it "sets the overflow type for items" do
|
692
692
|
tf = Tempfile.new('unittest')
|
693
693
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
694
694
|
tf.puts ' ITEM item1 0 8 UINT'
|
@@ -701,16 +701,16 @@ module Cosmos
|
|
701
701
|
tf.puts ' OVERFLOW ERROR_ALLOW_HEX'
|
702
702
|
tf.close
|
703
703
|
@pc.process_file(tf.path, "TGT1")
|
704
|
-
@pc.telemetry["TGT1"]["PKT1"].get_item('item1').overflow.
|
705
|
-
@pc.telemetry["TGT1"]["PKT1"].get_item('item2').overflow.
|
706
|
-
@pc.telemetry["TGT1"]["PKT1"].get_item('item3').overflow.
|
707
|
-
@pc.telemetry["TGT1"]["PKT1"].get_item('item4').overflow.
|
704
|
+
expect(@pc.telemetry["TGT1"]["PKT1"].get_item('item1').overflow).to eql :TRUNCATE
|
705
|
+
expect(@pc.telemetry["TGT1"]["PKT1"].get_item('item2').overflow).to eql :SATURATE
|
706
|
+
expect(@pc.telemetry["TGT1"]["PKT1"].get_item('item3').overflow).to eql :ERROR
|
707
|
+
expect(@pc.telemetry["TGT1"]["PKT1"].get_item('item4').overflow).to eql :ERROR_ALLOW_HEX
|
708
708
|
tf.unlink
|
709
709
|
end
|
710
710
|
end
|
711
711
|
|
712
712
|
context "with REQUIRED" do
|
713
|
-
it "
|
713
|
+
it "only applies to a command parameter" do
|
714
714
|
tf = Tempfile.new('unittest')
|
715
715
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
716
716
|
tf.puts ' ITEM item1 0 8 UINT'
|
@@ -727,7 +727,7 @@ module Cosmos
|
|
727
727
|
tf.unlink
|
728
728
|
end
|
729
729
|
|
730
|
-
it "
|
730
|
+
it "marks a command parameter as required" do
|
731
731
|
tf = Tempfile.new('unittest')
|
732
732
|
tf.puts 'COMMAND tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
733
733
|
tf.puts ' PARAMETER item1 0 8 UINT 0 1 1'
|
@@ -735,14 +735,14 @@ module Cosmos
|
|
735
735
|
tf.puts ' PARAMETER item2 0 8 UINT 0 1 1'
|
736
736
|
tf.close
|
737
737
|
@pc.process_file(tf.path, "TGT1")
|
738
|
-
@pc.commands["TGT1"]["PKT1"].items["ITEM1"].required.
|
739
|
-
@pc.commands["TGT1"]["PKT1"].items["ITEM2"].required.
|
738
|
+
expect(@pc.commands["TGT1"]["PKT1"].items["ITEM1"].required).to be_truthy
|
739
|
+
expect(@pc.commands["TGT1"]["PKT1"].items["ITEM2"].required).to be_falsey
|
740
740
|
tf.unlink
|
741
741
|
end
|
742
742
|
end
|
743
743
|
|
744
744
|
context "with MINIMUM_VALUE, MAXIMUM_VALUE, DEFAULT_VALUE" do
|
745
|
-
it "
|
745
|
+
it "complains if used on telemetry items" do
|
746
746
|
tf = Tempfile.new('unittest')
|
747
747
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
748
748
|
tf.puts ' APPEND_ITEM item1 16 UINT'
|
@@ -768,7 +768,7 @@ module Cosmos
|
|
768
768
|
tf.unlink
|
769
769
|
end
|
770
770
|
|
771
|
-
it "
|
771
|
+
it "allows overriding the defined value" do
|
772
772
|
tf = Tempfile.new('unittest')
|
773
773
|
tf.puts 'COMMAND tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
774
774
|
tf.puts ' APPEND_PARAMETER item1 16 UINT 0 1 1'
|
@@ -776,9 +776,9 @@ module Cosmos
|
|
776
776
|
tf.close
|
777
777
|
@pc.process_file(tf.path, "TGT1")
|
778
778
|
@pc.commands["TGT1"]["PKT1"].restore_defaults
|
779
|
-
@pc.commands["TGT1"]["PKT1"].read("ITEM1").
|
780
|
-
@pc.commands["TGT1"]["PKT1"].items["ITEM1"].range.
|
781
|
-
@pc.commands["TGT1"]["PKT1"].read("ITEM2").
|
779
|
+
expect(@pc.commands["TGT1"]["PKT1"].read("ITEM1")).to eql 1
|
780
|
+
expect(@pc.commands["TGT1"]["PKT1"].items["ITEM1"].range).to eql (0..1)
|
781
|
+
expect(@pc.commands["TGT1"]["PKT1"].read("ITEM2")).to eql "HI"
|
782
782
|
tf.unlink
|
783
783
|
|
784
784
|
# Now override the values from above
|
@@ -793,9 +793,9 @@ module Cosmos
|
|
793
793
|
tf.close
|
794
794
|
@pc.process_file(tf.path, "TGT1")
|
795
795
|
@pc.commands["TGT1"]["PKT1"].restore_defaults
|
796
|
-
@pc.commands["TGT1"]["PKT1"].read("ITEM1").
|
797
|
-
@pc.commands["TGT1"]["PKT1"].items["ITEM1"].range.
|
798
|
-
@pc.commands["TGT1"]["PKT1"].read("ITEM2").
|
796
|
+
expect(@pc.commands["TGT1"]["PKT1"].read("ITEM1")).to eql 2
|
797
|
+
expect(@pc.commands["TGT1"]["PKT1"].items["ITEM1"].range).to eql (1..3)
|
798
|
+
expect(@pc.commands["TGT1"]["PKT1"].read("ITEM2")).to eql "NO"
|
799
799
|
tf.unlink
|
800
800
|
end
|
801
801
|
end
|