cosmos 3.2.1 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -23,7 +23,7 @@ module Cosmos
|
|
23
23
|
@pc = PacketConfig.new
|
24
24
|
end
|
25
25
|
|
26
|
-
it "
|
26
|
+
it "complains if a current item is not defined" do
|
27
27
|
# Check for missing ITEM definitions
|
28
28
|
tf = Tempfile.new('unittest')
|
29
29
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
@@ -33,7 +33,7 @@ module Cosmos
|
|
33
33
|
tf.unlink
|
34
34
|
end
|
35
35
|
|
36
|
-
it "
|
36
|
+
it "complains if there are not enough parameters" do
|
37
37
|
tf = Tempfile.new('unittest')
|
38
38
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
39
39
|
tf.puts 'ITEM myitem 0 8 UINT "Test Item"'
|
@@ -43,7 +43,7 @@ module Cosmos
|
|
43
43
|
tf.unlink
|
44
44
|
end
|
45
45
|
|
46
|
-
it "
|
46
|
+
it "complains if there are too many parameters" do
|
47
47
|
tf = Tempfile.new('unittest')
|
48
48
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
49
49
|
tf.puts 'ITEM myitem 0 8 UINT "Test Item"'
|
@@ -53,7 +53,7 @@ module Cosmos
|
|
53
53
|
tf.unlink
|
54
54
|
end
|
55
55
|
|
56
|
-
it "
|
56
|
+
it "complains about invalid format strings" do
|
57
57
|
tf = Tempfile.new('unittest')
|
58
58
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
59
59
|
tf.puts ' ITEM item1 0 8 INT'
|
@@ -71,7 +71,7 @@ module Cosmos
|
|
71
71
|
tf.unlink
|
72
72
|
end
|
73
73
|
|
74
|
-
it "
|
74
|
+
it "formats integers" do
|
75
75
|
tf = Tempfile.new('unittest')
|
76
76
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
77
77
|
tf.puts ' ITEM item1 0 8 INT'
|
@@ -83,13 +83,13 @@ module Cosmos
|
|
83
83
|
tf.close
|
84
84
|
@pc.process_file(tf.path, "TGT1")
|
85
85
|
@pc.telemetry["TGT1"]["PKT1"].buffer = "\x0a\x0b\x0c"
|
86
|
-
@pc.telemetry["TGT1"]["PKT1"].read("ITEM1",:FORMATTED).
|
87
|
-
@pc.telemetry["TGT1"]["PKT1"].read("ITEM2",:FORMATTED).
|
88
|
-
@pc.telemetry["TGT1"]["PKT1"].read("ITEM3",:FORMATTED).
|
86
|
+
expect(@pc.telemetry["TGT1"]["PKT1"].read("ITEM1",:FORMATTED)).to eql "d10"
|
87
|
+
expect(@pc.telemetry["TGT1"]["PKT1"].read("ITEM2",:FORMATTED)).to eql "u10"
|
88
|
+
expect(@pc.telemetry["TGT1"]["PKT1"].read("ITEM3",:FORMATTED)).to eql "0xa"
|
89
89
|
tf.unlink
|
90
90
|
end
|
91
91
|
|
92
|
-
it "
|
92
|
+
it "formats floats" do
|
93
93
|
tf = Tempfile.new('unittest')
|
94
94
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
95
95
|
tf.puts ' ITEM item1 0 32 FLOAT'
|
@@ -97,11 +97,11 @@ module Cosmos
|
|
97
97
|
tf.close
|
98
98
|
@pc.process_file(tf.path, "TGT1")
|
99
99
|
@pc.telemetry["TGT1"]["PKT1"].write("ITEM1",12345.12345)
|
100
|
-
@pc.telemetry["TGT1"]["PKT1"].read("ITEM1",:FORMATTED).
|
100
|
+
expect(@pc.telemetry["TGT1"]["PKT1"].read("ITEM1",:FORMATTED)).to eql "12345.123"
|
101
101
|
tf.unlink
|
102
102
|
end
|
103
103
|
|
104
|
-
it "
|
104
|
+
it "formats strings and blocks" do
|
105
105
|
tf = Tempfile.new('unittest')
|
106
106
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
107
107
|
tf.puts ' ITEM item1 0 32 STRING'
|
@@ -111,9 +111,9 @@ module Cosmos
|
|
111
111
|
tf.close
|
112
112
|
@pc.process_file(tf.path, "TGT1")
|
113
113
|
@pc.telemetry["TGT1"]["PKT1"].write("ITEM1","HI")
|
114
|
-
@pc.telemetry["TGT1"]["PKT1"].read("ITEM1",:FORMATTED).
|
114
|
+
expect(@pc.telemetry["TGT1"]["PKT1"].read("ITEM1",:FORMATTED)).to eql "String: HI"
|
115
115
|
@pc.telemetry["TGT1"]["PKT1"].write("ITEM2","\x00\x01\x02\x03")
|
116
|
-
@pc.telemetry["TGT1"]["PKT1"].read("ITEM2",:FORMATTED).
|
116
|
+
expect(@pc.telemetry["TGT1"]["PKT1"].read("ITEM2",:FORMATTED)).to eql "Block: \x00\x01\x02\x03"
|
117
117
|
tf.unlink
|
118
118
|
end
|
119
119
|
end
|
@@ -227,7 +227,7 @@ module Cosmos
|
|
227
227
|
tf.unlink
|
228
228
|
end
|
229
229
|
|
230
|
-
it "
|
230
|
+
it "takes 4 limits values" do
|
231
231
|
tf = Tempfile.new('unittest')
|
232
232
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
233
233
|
tf.puts ' APPEND_ITEM item1 16 UINT "Item"'
|
@@ -235,16 +235,16 @@ module Cosmos
|
|
235
235
|
tf.close
|
236
236
|
@pc.process_file(tf.path, "TGT1")
|
237
237
|
item = @pc.telemetry["TGT1"]["PKT1"].items["ITEM1"]
|
238
|
-
item.limits.values[:DEFAULT].
|
238
|
+
expect(item.limits.values[:DEFAULT]).not_to be_nil
|
239
239
|
@pc.telemetry["TGT1"]["PKT1"].buffer = "\x04"
|
240
240
|
@pc.telemetry["TGT1"]["PKT1"].enable_limits("ITEM1")
|
241
241
|
@pc.telemetry["TGT1"]["PKT1"].check_limits
|
242
|
-
item.limits.state.
|
243
|
-
@pc.telemetry["TGT1"]["PKT1"].limits_items.
|
242
|
+
expect(item.limits.state).to eql :GREEN
|
243
|
+
expect(@pc.telemetry["TGT1"]["PKT1"].limits_items).to eql [item]
|
244
244
|
tf.unlink
|
245
245
|
end
|
246
246
|
|
247
|
-
it "
|
247
|
+
it "takes 6 limits values" do
|
248
248
|
tf = Tempfile.new('unittest')
|
249
249
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
250
250
|
tf.puts ' APPEND_ITEM item1 16 UINT "Item"'
|
@@ -252,12 +252,12 @@ module Cosmos
|
|
252
252
|
tf.close
|
253
253
|
@pc.process_file(tf.path, "TGT1")
|
254
254
|
item = @pc.telemetry["TGT1"]["PKT1"].items["ITEM1"]
|
255
|
-
item.limits.values[:DEFAULT].
|
255
|
+
expect(item.limits.values[:DEFAULT]).not_to be_nil
|
256
256
|
@pc.telemetry["TGT1"]["PKT1"].buffer = "\x04"
|
257
257
|
@pc.telemetry["TGT1"]["PKT1"].enable_limits("ITEM1")
|
258
258
|
@pc.telemetry["TGT1"]["PKT1"].check_limits
|
259
|
-
item.limits.state.
|
260
|
-
@pc.telemetry["TGT1"]["PKT1"].limits_items.
|
259
|
+
expect(item.limits.state).to eql :BLUE
|
260
|
+
expect(@pc.telemetry["TGT1"]["PKT1"].limits_items).to eql [item]
|
261
261
|
tf.unlink
|
262
262
|
end
|
263
263
|
|
@@ -23,7 +23,7 @@ module Cosmos
|
|
23
23
|
@pc = PacketConfig.new
|
24
24
|
end
|
25
25
|
|
26
|
-
it "
|
26
|
+
it "complains if a current item is not defined" do
|
27
27
|
tf = Tempfile.new('unittest')
|
28
28
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
29
29
|
tf.puts ' LIMITS_RESPONSE'
|
@@ -32,7 +32,7 @@ module Cosmos
|
|
32
32
|
tf.unlink
|
33
33
|
end
|
34
34
|
|
35
|
-
it "
|
35
|
+
it "complains if there are not enough parameters" do
|
36
36
|
tf = Tempfile.new('unittest')
|
37
37
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
38
38
|
tf.puts 'ITEM myitem 0 8 UINT "Test Item"'
|
@@ -42,7 +42,7 @@ module Cosmos
|
|
42
42
|
tf.unlink
|
43
43
|
end
|
44
44
|
|
45
|
-
it "
|
45
|
+
it "complains if applied to a command PARAMETER" do
|
46
46
|
tf = Tempfile.new('unittest')
|
47
47
|
tf.puts 'COMMAND tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
48
48
|
tf.puts ' APPEND_PARAMETER item1 16 UINT 0 0 0 "Item"'
|
@@ -52,7 +52,7 @@ module Cosmos
|
|
52
52
|
tf.unlink
|
53
53
|
end
|
54
54
|
|
55
|
-
it "
|
55
|
+
it "complains about missing response file" do
|
56
56
|
filename = File.join(File.dirname(__FILE__), "../../test_only.rb")
|
57
57
|
File.delete(filename) if File.exist?(filename)
|
58
58
|
@pc = PacketConfig.new
|
@@ -67,7 +67,7 @@ module Cosmos
|
|
67
67
|
tf.unlink
|
68
68
|
end
|
69
69
|
|
70
|
-
it "
|
70
|
+
it "complains about a non Cosmos::LimitsResponse class" do
|
71
71
|
filename = File.join(File.dirname(__FILE__), "../../limits_response1.rb")
|
72
72
|
File.open(filename, 'w') do |file|
|
73
73
|
file.puts "class LimitsResponse1"
|
@@ -88,7 +88,7 @@ module Cosmos
|
|
88
88
|
tf.unlink
|
89
89
|
end
|
90
90
|
|
91
|
-
it "
|
91
|
+
it "sets the response" do
|
92
92
|
filename = File.join(File.dirname(__FILE__), "../../limits_response2.rb")
|
93
93
|
File.open(filename, 'w') do |file|
|
94
94
|
file.puts "require 'cosmos/packets/limits_response'"
|
@@ -108,13 +108,13 @@ module Cosmos
|
|
108
108
|
tf.close
|
109
109
|
@pc.process_file(tf.path, "TGT1")
|
110
110
|
pkt = @pc.telemetry["TGT1"]["PKT1"]
|
111
|
-
pkt.get_item("ITEM1").limits.response.class.
|
111
|
+
expect(pkt.get_item("ITEM1").limits.response.class).to eql LimitsResponse2
|
112
112
|
|
113
113
|
File.delete(filename) if File.exist?(filename)
|
114
114
|
tf.unlink
|
115
115
|
end
|
116
116
|
|
117
|
-
it "
|
117
|
+
it "calls the response with parameters" do
|
118
118
|
filename = File.join(File.dirname(__FILE__), "../../limits_response2.rb")
|
119
119
|
File.open(filename, 'w') do |file|
|
120
120
|
file.puts "require 'cosmos/packets/limits_response'"
|
@@ -137,7 +137,7 @@ module Cosmos
|
|
137
137
|
tf.close
|
138
138
|
capture_io do |stdout|
|
139
139
|
@pc.process_file(tf.path, "TGT1")
|
140
|
-
stdout.string.
|
140
|
+
expect(stdout.string).to eql "initialize: 2\n"
|
141
141
|
end
|
142
142
|
|
143
143
|
File.delete(filename) if File.exist?(filename)
|
@@ -107,6 +107,29 @@ module Cosmos
|
|
107
107
|
end
|
108
108
|
|
109
109
|
describe "add_item" do
|
110
|
+
it "adds multiple items to the packet" do
|
111
|
+
tf = Tempfile.new('unittest')
|
112
|
+
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Description"'
|
113
|
+
tf.puts 'MACRO_APPEND_START 1 2'
|
114
|
+
tf.puts 'APPEND_ITEM WORD 16 UINT'
|
115
|
+
tf.puts 'APPEND_ITEM DOUBLE_WORD 32 UINT'
|
116
|
+
tf.puts 'MACRO_APPEND_END'
|
117
|
+
tf.close
|
118
|
+
@pc.process_file(tf.path, "TGT1")
|
119
|
+
pkt = @pc.telemetry["TGT1"]["PKT1"]
|
120
|
+
expect(pkt.items.length).to eql 7 # 4 plus the RECEIVED_XXX items
|
121
|
+
expect(pkt.items.keys).to include('WORD1','WORD2','DOUBLE_WORD1','DOUBLE_WORD2')
|
122
|
+
expect(pkt.sorted_items[3].name).to eql 'WORD1'
|
123
|
+
expect(pkt.sorted_items[3].bit_offset).to eql 0
|
124
|
+
expect(pkt.sorted_items[4].name).to eql 'DOUBLE_WORD1'
|
125
|
+
expect(pkt.sorted_items[4].bit_offset).to eql 16
|
126
|
+
expect(pkt.sorted_items[5].name).to eql 'WORD2'
|
127
|
+
expect(pkt.sorted_items[5].bit_offset).to eql 48
|
128
|
+
expect(pkt.sorted_items[6].name).to eql 'DOUBLE_WORD2'
|
129
|
+
expect(pkt.sorted_items[6].bit_offset).to eql 64
|
130
|
+
tf.unlink
|
131
|
+
end
|
132
|
+
|
110
133
|
it "adds items with states to the packet" do
|
111
134
|
tf = Tempfile.new('unittest')
|
112
135
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Description"'
|
@@ -119,17 +142,22 @@ module Cosmos
|
|
119
142
|
@pc.process_file(tf.path, "TGT1")
|
120
143
|
pkt = @pc.telemetry["TGT1"]["PKT1"]
|
121
144
|
expect(pkt.items.length).to eql 8 # 5 plus the RECEIVED_XXX items
|
122
|
-
pkt.items.keys.
|
145
|
+
expect(pkt.items.keys).to include('BIT1','BIT2','BIT3','BIT4','BIT5')
|
123
146
|
expect(pkt.sorted_items[3].name).to eql 'BIT1'
|
147
|
+
expect(pkt.sorted_items[3].bit_offset).to eql 0
|
124
148
|
expect(pkt.sorted_items[4].name).to eql 'BIT2'
|
149
|
+
expect(pkt.sorted_items[4].bit_offset).to eql 16
|
125
150
|
expect(pkt.sorted_items[5].name).to eql 'BIT3'
|
151
|
+
expect(pkt.sorted_items[5].bit_offset).to eql 32
|
126
152
|
expect(pkt.sorted_items[6].name).to eql 'BIT4'
|
153
|
+
expect(pkt.sorted_items[6].bit_offset).to eql 48
|
127
154
|
expect(pkt.sorted_items[7].name).to eql 'BIT5'
|
155
|
+
expect(pkt.sorted_items[7].bit_offset).to eql 64
|
128
156
|
limits_items = []
|
129
157
|
pkt.items.each do |name, item|
|
130
158
|
limits_items << item if name.include?('BIT')
|
131
159
|
end
|
132
|
-
pkt.limits_items.
|
160
|
+
expect(pkt.limits_items).to eql limits_items
|
133
161
|
tf.unlink
|
134
162
|
end
|
135
163
|
|
@@ -159,8 +187,8 @@ module Cosmos
|
|
159
187
|
@pc.process_file(tf.path, "TGT1")
|
160
188
|
pkt = @pc.telemetry["TGT1"]["PKT1"]
|
161
189
|
expect(pkt.items.length).to eql 8 # 5 plus the RECEIVED_XXX items
|
162
|
-
pkt.items.keys.
|
163
|
-
pkt.limits_items.
|
190
|
+
expect(pkt.items.keys).to include('BIT1','BIT2','BIT3','BIT4','BIT5')
|
191
|
+
expect(pkt.limits_items).to be_empty
|
164
192
|
tf.unlink
|
165
193
|
end
|
166
194
|
|
@@ -174,8 +202,8 @@ module Cosmos
|
|
174
202
|
@pc.process_file(tf.path, "TGT1")
|
175
203
|
pkt = @pc.telemetry["TGT1"]["PKT1"]
|
176
204
|
expect(pkt.items.length).to eql 8 # 5 plus the RECEIVED_XXX items
|
177
|
-
pkt.items.keys.
|
178
|
-
pkt.limits_items.
|
205
|
+
expect(pkt.items.keys).to include('08_BIT','09_BIT','10_BIT','11_BIT','12_BIT')
|
206
|
+
expect(pkt.limits_items).to be_empty
|
179
207
|
tf.unlink
|
180
208
|
end
|
181
209
|
|
@@ -61,10 +61,10 @@ module Cosmos
|
|
61
61
|
@pc.process_file(tf.path, "TGT1")
|
62
62
|
pkt = @pc.commands["TGT1"]["PKT1"] if keyword == 'COMMAND'
|
63
63
|
pkt = @pc.telemetry["TGT1"]["PKT1"] if keyword == 'TELEMETRY'
|
64
|
-
pkt.target_name.
|
65
|
-
pkt.packet_name.
|
66
|
-
pkt.default_endianness.
|
67
|
-
pkt.description.
|
64
|
+
expect(pkt.target_name).to eql "TGT1"
|
65
|
+
expect(pkt.packet_name).to eql "PKT1"
|
66
|
+
expect(pkt.default_endianness).to eql :LITTLE_ENDIAN
|
67
|
+
expect(pkt.description).to eql "Packet"
|
68
68
|
tf.unlink
|
69
69
|
end
|
70
70
|
end
|
@@ -77,7 +77,7 @@ module Cosmos
|
|
77
77
|
@pc.process_file(tf.path, "NEW")
|
78
78
|
pkt = @pc.commands["NEW"]["PKT1"] if keyword == 'COMMAND'
|
79
79
|
pkt = @pc.telemetry["NEW"]["PKT1"] if keyword == 'TELEMETRY'
|
80
|
-
pkt.target_name.
|
80
|
+
expect(pkt.target_name).to eql "NEW"
|
81
81
|
tf.unlink
|
82
82
|
end
|
83
83
|
end
|
@@ -89,7 +89,7 @@ module Cosmos
|
|
89
89
|
tf.puts keyword + ' tgt1 pkt1 LITTLE_ENDIAN "Packet 2"'
|
90
90
|
tf.close
|
91
91
|
@pc.process_file(tf.path, "SYSTEM")
|
92
|
-
@pc.warnings.
|
92
|
+
expect(@pc.warnings).to include("#{keyword.capitalize} Packet TGT1 PKT1 redefined.")
|
93
93
|
tf.unlink
|
94
94
|
end
|
95
95
|
end
|
@@ -23,7 +23,7 @@ module Cosmos
|
|
23
23
|
@pc = PacketConfig.new
|
24
24
|
end
|
25
25
|
|
26
|
-
it "
|
26
|
+
it "complains if a current packet is not defined" do
|
27
27
|
# Check for missing TELEMETRY line
|
28
28
|
tf = Tempfile.new('unittest')
|
29
29
|
tf.puts('PROCESSOR')
|
@@ -32,7 +32,7 @@ module Cosmos
|
|
32
32
|
tf.unlink
|
33
33
|
end
|
34
34
|
|
35
|
-
it "
|
35
|
+
it "complains if there are not enough parameters" do
|
36
36
|
tf = Tempfile.new('unittest')
|
37
37
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
38
38
|
tf.puts ' PROCESSOR'
|
@@ -41,7 +41,7 @@ module Cosmos
|
|
41
41
|
tf.unlink
|
42
42
|
end
|
43
43
|
|
44
|
-
it "
|
44
|
+
it "complains about missing processor file" do
|
45
45
|
filename = File.join(File.dirname(__FILE__), "../../test_only.rb")
|
46
46
|
File.delete(filename) if File.exist?(filename)
|
47
47
|
@pc = PacketConfig.new
|
@@ -54,7 +54,7 @@ module Cosmos
|
|
54
54
|
tf.unlink
|
55
55
|
end
|
56
56
|
|
57
|
-
it "
|
57
|
+
it "complains about a non Cosmos::Processor class" do
|
58
58
|
filename = File.join(File.dirname(__FILE__), "../../processor1.rb")
|
59
59
|
File.open(filename, 'w') do |file|
|
60
60
|
file.puts "class Processor1"
|
@@ -73,7 +73,7 @@ module Cosmos
|
|
73
73
|
tf.unlink
|
74
74
|
end
|
75
75
|
|
76
|
-
it "
|
76
|
+
it "parses the processor" do
|
77
77
|
filename = File.join(File.dirname(__FILE__), "../../processor2.rb")
|
78
78
|
File.open(filename, 'w') do |file|
|
79
79
|
file.puts "require 'cosmos/processors/processor'"
|
@@ -94,13 +94,13 @@ module Cosmos
|
|
94
94
|
tf.close
|
95
95
|
@pc.process_file(tf.path, "TGT1")
|
96
96
|
@pc.telemetry["TGT1"]["PKT1"].buffer = "\x01\x01"
|
97
|
-
@pc.telemetry["TGT1"]["PKT1"].read("ITEM1").
|
97
|
+
expect(@pc.telemetry["TGT1"]["PKT1"].read("ITEM1")).to eql 5
|
98
98
|
tf.unlink
|
99
99
|
|
100
100
|
File.delete(filename) if File.exist?(filename)
|
101
101
|
end
|
102
102
|
|
103
|
-
it "
|
103
|
+
it "complains if applied to a command packet" do
|
104
104
|
tf = Tempfile.new('unittest')
|
105
105
|
tf.puts 'COMMAND tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
106
106
|
tf.puts ' PROCESSOR P1 processor1.rb'
|
@@ -23,7 +23,7 @@ module Cosmos
|
|
23
23
|
@pc = PacketConfig.new
|
24
24
|
end
|
25
25
|
|
26
|
-
it "
|
26
|
+
it "complains if a current item is not defined" do
|
27
27
|
# Check for missing ITEM definitions
|
28
28
|
tf = Tempfile.new('unittest')
|
29
29
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
@@ -33,7 +33,7 @@ module Cosmos
|
|
33
33
|
tf.unlink
|
34
34
|
end
|
35
35
|
|
36
|
-
it "
|
36
|
+
it "complains if there are not enough parameters" do
|
37
37
|
tf = Tempfile.new('unittest')
|
38
38
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
39
39
|
tf.puts 'ITEM myitem 0 8 UINT "Test Item"'
|
@@ -43,7 +43,7 @@ module Cosmos
|
|
43
43
|
tf.unlink
|
44
44
|
end
|
45
45
|
|
46
|
-
it "
|
46
|
+
it "complains if there are too many parameters" do
|
47
47
|
tf = Tempfile.new('unittest')
|
48
48
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Packet"'
|
49
49
|
tf.puts 'ITEM myitem 0 8 UINT "Test Item"'
|
@@ -53,7 +53,7 @@ module Cosmos
|
|
53
53
|
tf.unlink
|
54
54
|
end
|
55
55
|
|
56
|
-
it "
|
56
|
+
it "supports STRING items" do
|
57
57
|
tf = Tempfile.new('unittest')
|
58
58
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Description"'
|
59
59
|
tf.puts ' APPEND_ITEM item1 128 STRING "state item"'
|
@@ -62,13 +62,13 @@ module Cosmos
|
|
62
62
|
tf.close
|
63
63
|
@pc.process_file(tf.path, "TGT1")
|
64
64
|
@pc.telemetry["TGT1"]["PKT1"].write("ITEM1", "TRUE STRING")
|
65
|
-
@pc.telemetry["TGT1"]["PKT1"].read("ITEM1").
|
65
|
+
expect(@pc.telemetry["TGT1"]["PKT1"].read("ITEM1")).to eql "TRUE"
|
66
66
|
@pc.telemetry["TGT1"]["PKT1"].write("ITEM1", "FALSE STRING")
|
67
|
-
@pc.telemetry["TGT1"]["PKT1"].read("ITEM1").
|
67
|
+
expect(@pc.telemetry["TGT1"]["PKT1"].read("ITEM1")).to eql "FALSE"
|
68
68
|
tf.unlink
|
69
69
|
end
|
70
70
|
|
71
|
-
it "
|
71
|
+
it "warns about duplicate states and replace the duplicate" do
|
72
72
|
tf = Tempfile.new('unittest')
|
73
73
|
tf.puts 'COMMAND tgt1 pkt1 LITTLE_ENDIAN "Description"'
|
74
74
|
tf.puts ' APPEND_PARAMETER item1 8 UINT 0 2 0 "state item"'
|
@@ -77,16 +77,16 @@ module Cosmos
|
|
77
77
|
tf.puts ' STATE FALSE 2'
|
78
78
|
tf.close
|
79
79
|
@pc.process_file(tf.path, "TGT1")
|
80
|
-
@pc.warnings.
|
80
|
+
expect(@pc.warnings).to include("Duplicate state defined on line 5: STATE FALSE 2")
|
81
81
|
@pc.commands["TGT1"]["PKT1"].buffer = "\x00"
|
82
|
-
@pc.commands["TGT1"]["PKT1"].read("ITEM1").
|
82
|
+
expect(@pc.commands["TGT1"]["PKT1"].read("ITEM1")).to eql 0
|
83
83
|
@pc.commands["TGT1"]["PKT1"].buffer = "\x02"
|
84
|
-
@pc.commands["TGT1"]["PKT1"].read("ITEM1").
|
84
|
+
expect(@pc.commands["TGT1"]["PKT1"].read("ITEM1")).to eql "FALSE"
|
85
85
|
tf.unlink
|
86
86
|
end
|
87
87
|
|
88
88
|
context "with telemetry" do
|
89
|
-
it "
|
89
|
+
it "only allows GREEN YELLOW or RED" do
|
90
90
|
tf = Tempfile.new('unittest')
|
91
91
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Description"'
|
92
92
|
tf.puts ' APPEND_ITEM item1 8 UINT "state item"'
|
@@ -96,7 +96,7 @@ module Cosmos
|
|
96
96
|
tf.unlink
|
97
97
|
end
|
98
98
|
|
99
|
-
it "
|
99
|
+
it "records the state values and colors" do
|
100
100
|
tf = Tempfile.new('unittest')
|
101
101
|
tf.puts 'TELEMETRY tgt1 pkt1 LITTLE_ENDIAN "Description"'
|
102
102
|
tf.puts ' APPEND_ITEM item1 8 UINT "state item"'
|
@@ -109,19 +109,19 @@ module Cosmos
|
|
109
109
|
index = 1
|
110
110
|
colors = [:RED, :YELLOW, :GREEN]
|
111
111
|
@pc.telemetry["TGT1"]["PKT1"].items["ITEM1"].states.each do |name,val|
|
112
|
-
name.
|
113
|
-
val.
|
114
|
-
@pc.telemetry["TGT1"]["PKT1"].items["ITEM1"].state_colors[name].
|
112
|
+
expect(name).to eql "STATE#{index}"
|
113
|
+
expect(val).to eql index
|
114
|
+
expect(@pc.telemetry["TGT1"]["PKT1"].items["ITEM1"].state_colors[name]).to eql colors[index - 1]
|
115
115
|
|
116
116
|
index += 1
|
117
117
|
end
|
118
|
-
@pc.telemetry["TGT1"]["PKT1"].limits_items.
|
118
|
+
expect(@pc.telemetry["TGT1"]["PKT1"].limits_items).to eql [@pc.telemetry["TGT1"]["PKT1"].items["ITEM1"]]
|
119
119
|
tf.unlink
|
120
120
|
end
|
121
121
|
end
|
122
122
|
|
123
123
|
context "with command" do
|
124
|
-
it "
|
124
|
+
it "only allows HAZARDOUS as the third param" do
|
125
125
|
tf = Tempfile.new('unittest')
|
126
126
|
tf.puts 'COMMAND tgt1 pkt1 LITTLE_ENDIAN "Description"'
|
127
127
|
tf.puts ' APPEND_PARAMETER item1 8 UINT 0 0 0'
|
@@ -131,7 +131,7 @@ module Cosmos
|
|
131
131
|
tf.unlink
|
132
132
|
end
|
133
133
|
|
134
|
-
it "
|
134
|
+
it "takes HAZARDOUS and an optional description" do
|
135
135
|
tf = Tempfile.new('unittest')
|
136
136
|
tf.puts 'COMMAND tgt1 pkt1 LITTLE_ENDIAN "Description"'
|
137
137
|
tf.puts ' APPEND_PARAMETER item1 8 UINT 1 3 1'
|
@@ -142,11 +142,11 @@ module Cosmos
|
|
142
142
|
@pc.process_file(tf.path, "TGT1")
|
143
143
|
@pc.commands["TGT1"]["PKT1"].buffer = "\x01"
|
144
144
|
@pc.commands["TGT1"]["PKT1"].check_limits
|
145
|
-
@pc.commands["TGT1"]["PKT1"].items["ITEM1"].hazardous["GOOD"].
|
146
|
-
@pc.commands["TGT1"]["PKT1"].items["ITEM1"].hazardous["BAD"].
|
147
|
-
@pc.commands["TGT1"]["PKT1"].items["ITEM1"].hazardous["WORST"].
|
148
|
-
@pc.commands["TGT1"]["PKT1"].items["ITEM1"].hazardous["WORST"].
|
149
|
-
@pc.commands["TGT1"]["PKT1"].limits_items.
|
145
|
+
expect(@pc.commands["TGT1"]["PKT1"].items["ITEM1"].hazardous["GOOD"]).to be_nil
|
146
|
+
expect(@pc.commands["TGT1"]["PKT1"].items["ITEM1"].hazardous["BAD"]).not_to be_nil
|
147
|
+
expect(@pc.commands["TGT1"]["PKT1"].items["ITEM1"].hazardous["WORST"]).not_to be_nil
|
148
|
+
expect(@pc.commands["TGT1"]["PKT1"].items["ITEM1"].hazardous["WORST"]).to eql "Hazardous description"
|
149
|
+
expect(@pc.commands["TGT1"]["PKT1"].limits_items).to be_empty
|
150
150
|
tf.unlink
|
151
151
|
end
|
152
152
|
end
|