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
data/spec/system/target_spec.rb
CHANGED
@@ -21,26 +21,26 @@ module Cosmos
|
|
21
21
|
end
|
22
22
|
|
23
23
|
describe "initialize" do
|
24
|
-
it "
|
25
|
-
Target.new("TGT").name.
|
24
|
+
it "creates a target with the given name" do
|
25
|
+
expect(Target.new("TGT").name).to eql "TGT"
|
26
26
|
end
|
27
27
|
|
28
|
-
it "
|
28
|
+
it "creates a target with the given substitute name" do
|
29
29
|
tgt = Target.new("TGT","TGT2")
|
30
|
-
tgt.name.
|
31
|
-
tgt.original_name.
|
30
|
+
expect(tgt.name).to eql "TGT2"
|
31
|
+
expect(tgt.original_name).to eql "TGT"
|
32
32
|
end
|
33
33
|
|
34
|
-
it "
|
35
|
-
Target.new("TGT").dir.
|
34
|
+
it "creates a target with the default dir" do
|
35
|
+
expect(Target.new("TGT").dir).to eql File.join(USERPATH,'config','targets','TGT')
|
36
36
|
end
|
37
37
|
|
38
|
-
it "
|
38
|
+
it "creates a target with an override path" do
|
39
39
|
saved = File.join(USERPATH,'saved')
|
40
|
-
Target.new("TGT",nil,saved).dir.
|
40
|
+
expect(Target.new("TGT",nil,saved).dir).to eql File.join(saved,'TGT')
|
41
41
|
end
|
42
42
|
|
43
|
-
it "
|
43
|
+
it "records all the command and telemetry files in the target directory" do
|
44
44
|
tgt_path = File.join(Cosmos::USERPATH,'target_spec_temp')
|
45
45
|
tgt_name = "TEST"
|
46
46
|
cmd_tlm = File.join(tgt_path,tgt_name,'cmd_tlm')
|
@@ -51,16 +51,16 @@ module Cosmos
|
|
51
51
|
File.open(File.join(cmd_tlm,'tlm2.txt'),'w') {}
|
52
52
|
|
53
53
|
tgt = Target.new(tgt_name,nil,tgt_path)
|
54
|
-
tgt.dir.
|
54
|
+
expect(tgt.dir).to eql File.join(tgt_path,tgt_name)
|
55
55
|
files = Dir[File.join(cmd_tlm,'*.txt')]
|
56
|
-
files.
|
57
|
-
tgt.cmd_tlm_files.length.
|
58
|
-
tgt.cmd_tlm_files.sort.
|
56
|
+
expect(files).not_to be_empty
|
57
|
+
expect(tgt.cmd_tlm_files.length).to eql 4
|
58
|
+
expect(tgt.cmd_tlm_files.sort).to eql files.sort
|
59
59
|
|
60
60
|
FileUtils.rm_r(tgt_path)
|
61
61
|
end
|
62
62
|
|
63
|
-
it "
|
63
|
+
it "processes a target.txt in the target directory" do
|
64
64
|
tgt_path = File.join(Cosmos::USERPATH,'target_spec_temp')
|
65
65
|
tgt_name = "TEST"
|
66
66
|
tgt_dir = File.join(tgt_path,tgt_name)
|
@@ -70,13 +70,13 @@ module Cosmos
|
|
70
70
|
end
|
71
71
|
|
72
72
|
tgt = Target.new(tgt_name,nil,tgt_path)
|
73
|
-
tgt.dir.
|
74
|
-
tgt.ignored_parameters.
|
73
|
+
expect(tgt.dir).to eql tgt_dir
|
74
|
+
expect(tgt.ignored_parameters).to eql ["TEST"]
|
75
75
|
|
76
76
|
FileUtils.rm_r(tgt_path)
|
77
77
|
end
|
78
78
|
|
79
|
-
it "
|
79
|
+
it "processes an alternative target.txt in the target directory" do
|
80
80
|
tgt_path = File.join(Cosmos::USERPATH,'target_spec_temp')
|
81
81
|
tgt_name = "TEST"
|
82
82
|
tgt_dir = File.join(tgt_path,tgt_name)
|
@@ -86,15 +86,15 @@ module Cosmos
|
|
86
86
|
end
|
87
87
|
|
88
88
|
tgt = Target.new(tgt_name,nil,tgt_path, 'target_other.txt')
|
89
|
-
tgt.dir.
|
90
|
-
tgt.ignored_parameters.
|
89
|
+
expect(tgt.dir).to eql tgt_dir
|
90
|
+
expect(tgt.ignored_parameters).to eql ["BOB"]
|
91
91
|
|
92
92
|
FileUtils.rm_r(tgt_path)
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
96
96
|
describe "process_file" do
|
97
|
-
it "
|
97
|
+
it "complains about unknown keywords" do
|
98
98
|
tf = Tempfile.new('unittest')
|
99
99
|
tf.puts("BLAH")
|
100
100
|
tf.close
|
@@ -103,7 +103,7 @@ module Cosmos
|
|
103
103
|
end
|
104
104
|
|
105
105
|
context "with REQUIRE" do
|
106
|
-
it "
|
106
|
+
it "takes 1 parameters" do
|
107
107
|
tf = Tempfile.new('unittest')
|
108
108
|
tf.puts("REQUIRE")
|
109
109
|
tf.close
|
@@ -117,7 +117,7 @@ module Cosmos
|
|
117
117
|
tf.unlink
|
118
118
|
end
|
119
119
|
|
120
|
-
it "
|
120
|
+
it "complains if the file doesn't exist" do
|
121
121
|
tf = Tempfile.new('unittest')
|
122
122
|
tf.puts("REQUIRE my_file.rb")
|
123
123
|
tf.close
|
@@ -125,7 +125,7 @@ module Cosmos
|
|
125
125
|
tf.unlink
|
126
126
|
end
|
127
127
|
|
128
|
-
it "
|
128
|
+
it "requires the file" do
|
129
129
|
filename = File.join(File.dirname(__FILE__),'..','..','lib','my_file.rb')
|
130
130
|
File.open(filename, 'w') do |file|
|
131
131
|
file.puts "class MyFile"
|
@@ -142,7 +142,7 @@ module Cosmos
|
|
142
142
|
end
|
143
143
|
|
144
144
|
context "with IGNORE_PARAMETER" do
|
145
|
-
it "
|
145
|
+
it "takes 1 parameters" do
|
146
146
|
tf = Tempfile.new('unittest')
|
147
147
|
tf.puts("IGNORE_PARAMETER")
|
148
148
|
tf.close
|
@@ -156,19 +156,19 @@ module Cosmos
|
|
156
156
|
tf.unlink
|
157
157
|
end
|
158
158
|
|
159
|
-
it "
|
159
|
+
it "stores the parameter" do
|
160
160
|
tf = Tempfile.new('unittest')
|
161
161
|
tf.puts("IGNORE_PARAMETER TEST")
|
162
162
|
tf.close
|
163
163
|
tgt = Target.new("TGT")
|
164
164
|
tgt.process_file(tf.path)
|
165
|
-
tgt.ignored_parameters.
|
165
|
+
expect(tgt.ignored_parameters).to eql ["TEST"]
|
166
166
|
tf.unlink
|
167
167
|
end
|
168
168
|
end
|
169
169
|
|
170
170
|
context "with COMMANDS and TELEMETRY" do
|
171
|
-
it "
|
171
|
+
it "takes 1 parameters" do
|
172
172
|
tf = Tempfile.new('unittest')
|
173
173
|
tf.puts("COMMANDS")
|
174
174
|
tf.close
|
@@ -194,7 +194,7 @@ module Cosmos
|
|
194
194
|
tf.unlink
|
195
195
|
end
|
196
196
|
|
197
|
-
it "
|
197
|
+
it "stores the filename" do
|
198
198
|
tgt_path = File.join(Cosmos::USERPATH,'target_spec_temp')
|
199
199
|
tgt_name = "TEST"
|
200
200
|
tgt_dir = File.join(tgt_path,tgt_name)
|
@@ -212,9 +212,9 @@ module Cosmos
|
|
212
212
|
end
|
213
213
|
|
214
214
|
tgt = Target.new(tgt_name,nil,tgt_path)
|
215
|
-
tgt.dir.
|
216
|
-
tgt.cmd_tlm_files.length.
|
217
|
-
tgt.cmd_tlm_files.
|
215
|
+
expect(tgt.dir).to eql tgt_dir
|
216
|
+
expect(tgt.cmd_tlm_files.length).to eql 2
|
217
|
+
expect(tgt.cmd_tlm_files).to eql [tgt_dir + '/cmd_tlm/tgt_cmds2.txt', tgt_dir + '/cmd_tlm/tgt_tlm3.txt']
|
218
218
|
|
219
219
|
FileUtils.rm_r(tgt_dir)
|
220
220
|
end
|
@@ -55,402 +55,402 @@ module Cosmos
|
|
55
55
|
end
|
56
56
|
|
57
57
|
describe "cmd" do
|
58
|
-
it "
|
58
|
+
it "complains about unknown targets, commands, and parameters" do
|
59
59
|
test_cmd_unknown(:cmd)
|
60
60
|
sleep(0.5)
|
61
61
|
end
|
62
62
|
|
63
|
-
it "
|
63
|
+
it "processes a string" do
|
64
64
|
target_name, cmd_name, params = @api.cmd("INST COLLECT with TYPE NORMAL, DURATION 5")
|
65
|
-
target_name.
|
66
|
-
cmd_name.
|
67
|
-
params.
|
65
|
+
expect(target_name).to eql 'INST'
|
66
|
+
expect(cmd_name).to eql 'COLLECT'
|
67
|
+
expect(params).to include('TYPE'=>'NORMAL', 'DURATION'=>5)
|
68
68
|
end
|
69
69
|
|
70
|
-
it "
|
70
|
+
it "complains if parameters are not separated by commas" do
|
71
71
|
expect { @api.cmd("INST COLLECT with TYPE NORMAL DURATION 5") }.to raise_error(/Missing comma/)
|
72
72
|
end
|
73
73
|
|
74
|
-
it "
|
74
|
+
it "complains if parameters don't have values" do
|
75
75
|
expect { @api.cmd("INST COLLECT with TYPE") }.to raise_error(/Missing value/)
|
76
76
|
end
|
77
77
|
|
78
|
-
it "
|
78
|
+
it "processes parameters" do
|
79
79
|
target_name, cmd_name, params = @api.cmd("INST","COLLECT","TYPE"=>"NORMAL","DURATION"=>5)
|
80
|
-
target_name.
|
81
|
-
cmd_name.
|
82
|
-
params.
|
80
|
+
expect(target_name).to eql 'INST'
|
81
|
+
expect(cmd_name).to eql 'COLLECT'
|
82
|
+
expect(params).to include('TYPE'=>'NORMAL', 'DURATION'=>5)
|
83
83
|
end
|
84
84
|
|
85
|
-
it "
|
85
|
+
it "processes commands without parameters" do
|
86
86
|
target_name, cmd_name, params = @api.cmd("INST","ABORT")
|
87
|
-
target_name.
|
88
|
-
cmd_name.
|
89
|
-
params.
|
87
|
+
expect(target_name).to eql 'INST'
|
88
|
+
expect(cmd_name).to eql 'ABORT'
|
89
|
+
expect(params).to be {}
|
90
90
|
end
|
91
91
|
|
92
|
-
it "
|
92
|
+
it "complains about too many parameters" do
|
93
93
|
expect { @api.cmd("INST","COLLECT","TYPE","DURATION") }.to raise_error(/Invalid number of arguments/)
|
94
94
|
end
|
95
95
|
|
96
|
-
it "
|
96
|
+
it "warns about required parameters" do
|
97
97
|
expect { @api.cmd("INST COLLECT with DURATION 5") }.to raise_error(/Required/)
|
98
98
|
end
|
99
99
|
|
100
|
-
it "
|
100
|
+
it "warns about out of range parameters" do
|
101
101
|
expect { @api.cmd("INST COLLECT with TYPE NORMAL, DURATION 1000") }.to raise_error(/not in valid range/)
|
102
102
|
end
|
103
103
|
|
104
|
-
it "
|
104
|
+
it "warns about hazardous parameters" do
|
105
105
|
expect { @api.cmd("INST COLLECT with TYPE SPECIAL") }.to raise_error(/Hazardous/)
|
106
106
|
end
|
107
107
|
|
108
|
-
it "
|
108
|
+
it "warns about hazardous commands" do
|
109
109
|
expect { @api.cmd("INST CLEAR") }.to raise_error(/Hazardous/)
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
113
113
|
describe "cmd_no_range_check" do
|
114
|
-
it "
|
114
|
+
it "complains about unknown targets, commands, and parameters" do
|
115
115
|
test_cmd_unknown(:cmd_no_range_check)
|
116
116
|
end
|
117
117
|
|
118
|
-
it "
|
118
|
+
it "processes a string" do
|
119
119
|
target_name, cmd_no_range_check_name, params = @api.cmd_no_range_check("INST COLLECT with TYPE NORMAL, DURATION 5")
|
120
|
-
target_name.
|
121
|
-
cmd_no_range_check_name.
|
122
|
-
params.
|
120
|
+
expect(target_name).to eql 'INST'
|
121
|
+
expect(cmd_no_range_check_name).to eql 'COLLECT'
|
122
|
+
expect(params).to include('TYPE'=>'NORMAL', 'DURATION'=>5)
|
123
123
|
end
|
124
124
|
|
125
|
-
it "
|
125
|
+
it "processes parameters" do
|
126
126
|
target_name, cmd_no_range_check_name, params = @api.cmd_no_range_check("INST","COLLECT","TYPE"=>"NORMAL","DURATION"=>5)
|
127
|
-
target_name.
|
128
|
-
cmd_no_range_check_name.
|
129
|
-
params.
|
127
|
+
expect(target_name).to eql 'INST'
|
128
|
+
expect(cmd_no_range_check_name).to eql 'COLLECT'
|
129
|
+
expect(params).to include('TYPE'=>'NORMAL', 'DURATION'=>5)
|
130
130
|
end
|
131
131
|
|
132
|
-
it "
|
132
|
+
it "warns about required parameters" do
|
133
133
|
expect { @api.cmd_no_range_check("INST COLLECT with DURATION 5") }.to raise_error(/Required/)
|
134
134
|
end
|
135
135
|
|
136
|
-
it "
|
136
|
+
it "does not warn about out of range parameters" do
|
137
137
|
expect { @api.cmd_no_range_check("INST COLLECT with TYPE NORMAL, DURATION 1000") }.to_not raise_error
|
138
138
|
end
|
139
139
|
|
140
|
-
it "
|
140
|
+
it "warns about hazardous parameters" do
|
141
141
|
expect { @api.cmd_no_range_check("INST COLLECT with TYPE SPECIAL") }.to raise_error(/Hazardous/)
|
142
142
|
end
|
143
143
|
|
144
|
-
it "
|
144
|
+
it "warns about hazardous commands" do
|
145
145
|
expect { @api.cmd_no_range_check("INST CLEAR") }.to raise_error(/Hazardous/)
|
146
146
|
end
|
147
147
|
end
|
148
148
|
|
149
149
|
describe "cmd_no_hazardous_check" do
|
150
|
-
it "
|
150
|
+
it "complains about unknown targets, commands, and parameters" do
|
151
151
|
test_cmd_unknown(:cmd_no_hazardous_check)
|
152
152
|
end
|
153
153
|
|
154
|
-
it "
|
154
|
+
it "processes a string" do
|
155
155
|
target_name, cmd_no_hazardous_check_name, params = @api.cmd_no_hazardous_check("INST COLLECT with TYPE NORMAL, DURATION 5")
|
156
|
-
target_name.
|
157
|
-
cmd_no_hazardous_check_name.
|
158
|
-
params.
|
156
|
+
expect(target_name).to eql 'INST'
|
157
|
+
expect(cmd_no_hazardous_check_name).to eql 'COLLECT'
|
158
|
+
expect(params).to include('TYPE'=>'NORMAL', 'DURATION'=>5)
|
159
159
|
end
|
160
160
|
|
161
|
-
it "
|
161
|
+
it "processes parameters" do
|
162
162
|
target_name, cmd_no_hazardous_check_name, params = @api.cmd_no_hazardous_check("INST","COLLECT","TYPE"=>"NORMAL","DURATION"=>5)
|
163
|
-
target_name.
|
164
|
-
cmd_no_hazardous_check_name.
|
165
|
-
params.
|
163
|
+
expect(target_name).to eql 'INST'
|
164
|
+
expect(cmd_no_hazardous_check_name).to eql 'COLLECT'
|
165
|
+
expect(params).to include('TYPE'=>'NORMAL', 'DURATION'=>5)
|
166
166
|
end
|
167
167
|
|
168
|
-
it "
|
168
|
+
it "processes parameters that are strings" do
|
169
169
|
target_name, cmd_name, params = @api.cmd_no_hazardous_check("INST ASCIICMD with STRING 'ARM LASER'")
|
170
|
-
target_name.
|
171
|
-
cmd_name.
|
172
|
-
params.
|
170
|
+
expect(target_name).to eql 'INST'
|
171
|
+
expect(cmd_name).to eql 'ASCIICMD'
|
172
|
+
expect(params).to include('STRING'=>'ARM LASER')
|
173
173
|
end
|
174
174
|
|
175
|
-
it "
|
175
|
+
it "warns about required parameters" do
|
176
176
|
expect { @api.cmd_no_hazardous_check("INST COLLECT with DURATION 5") }.to raise_error(/Required/)
|
177
177
|
end
|
178
178
|
|
179
|
-
it "
|
179
|
+
it "warns about out of range parameters" do
|
180
180
|
expect { @api.cmd_no_hazardous_check("INST COLLECT with TYPE NORMAL, DURATION 1000") }.to raise_error(/not in valid range/)
|
181
181
|
end
|
182
182
|
|
183
|
-
it "
|
183
|
+
it "does not warn about hazardous parameters" do
|
184
184
|
expect { @api.cmd_no_hazardous_check("INST COLLECT with TYPE SPECIAL") }.to_not raise_error
|
185
185
|
end
|
186
186
|
|
187
|
-
it "
|
187
|
+
it "does not warn about hazardous commands" do
|
188
188
|
expect { @api.cmd_no_hazardous_check("INST CLEAR") }.to_not raise_error
|
189
189
|
end
|
190
190
|
end
|
191
191
|
|
192
192
|
describe "cmd_no_checks" do
|
193
|
-
it "
|
193
|
+
it "complains about unknown targets, commands, and parameters" do
|
194
194
|
test_cmd_unknown(:cmd_no_checks)
|
195
195
|
end
|
196
196
|
|
197
|
-
it "
|
197
|
+
it "processes a string" do
|
198
198
|
target_name, cmd_no_checks_name, params = @api.cmd_no_checks("INST COLLECT with TYPE NORMAL, DURATION 5")
|
199
|
-
target_name.
|
200
|
-
cmd_no_checks_name.
|
201
|
-
params.
|
199
|
+
expect(target_name).to eql 'INST'
|
200
|
+
expect(cmd_no_checks_name).to eql 'COLLECT'
|
201
|
+
expect(params).to include('TYPE'=>'NORMAL', 'DURATION'=>5)
|
202
202
|
end
|
203
203
|
|
204
|
-
it "
|
204
|
+
it "processes parameters" do
|
205
205
|
target_name, cmd_no_checks_name, params = @api.cmd_no_checks("INST","COLLECT","TYPE"=>"NORMAL","DURATION"=>5)
|
206
|
-
target_name.
|
207
|
-
cmd_no_checks_name.
|
208
|
-
params.
|
206
|
+
expect(target_name).to eql 'INST'
|
207
|
+
expect(cmd_no_checks_name).to eql 'COLLECT'
|
208
|
+
expect(params).to include('TYPE'=>'NORMAL', 'DURATION'=>5)
|
209
209
|
end
|
210
210
|
|
211
|
-
it "
|
211
|
+
it "warns about required parameters" do
|
212
212
|
expect { @api.cmd_no_checks("INST COLLECT with DURATION 5") }.to raise_error(/Required/)
|
213
213
|
end
|
214
214
|
|
215
|
-
it "
|
215
|
+
it "does not warn about out of range parameters" do
|
216
216
|
expect { @api.cmd_no_checks("INST COLLECT with TYPE NORMAL, DURATION 1000") }.to_not raise_error
|
217
217
|
end
|
218
218
|
|
219
|
-
it "
|
219
|
+
it "does not warn about hazardous parameters" do
|
220
220
|
expect { @api.cmd_no_checks("INST COLLECT with TYPE SPECIAL") }.to_not raise_error
|
221
221
|
end
|
222
222
|
|
223
|
-
it "
|
223
|
+
it "does not warn about hazardous commands" do
|
224
224
|
expect { @api.cmd_no_checks("INST CLEAR") }.to_not raise_error
|
225
225
|
end
|
226
226
|
end
|
227
227
|
|
228
228
|
describe "cmd_raw" do
|
229
|
-
it "
|
229
|
+
it "complains about unknown targets, commands, and parameters" do
|
230
230
|
test_cmd_unknown(:cmd_raw)
|
231
231
|
end
|
232
232
|
|
233
|
-
it "
|
233
|
+
it "processes a string" do
|
234
234
|
target_name, cmd_name, params = @api.cmd_raw("INST COLLECT with TYPE 0, DURATION 5")
|
235
|
-
target_name.
|
236
|
-
cmd_name.
|
237
|
-
params.
|
235
|
+
expect(target_name).to eql 'INST'
|
236
|
+
expect(cmd_name).to eql 'COLLECT'
|
237
|
+
expect(params).to include('TYPE'=>0, 'DURATION'=>5)
|
238
238
|
end
|
239
239
|
|
240
|
-
it "
|
240
|
+
it "complains if parameters are not separated by commas" do
|
241
241
|
expect { @api.cmd_raw("INST COLLECT with TYPE 0 DURATION 5") }.to raise_error(/Missing comma/)
|
242
242
|
end
|
243
243
|
|
244
|
-
it "
|
244
|
+
it "complains if parameters don't have values" do
|
245
245
|
expect { @api.cmd_raw("INST COLLECT with TYPE") }.to raise_error(/Missing value/)
|
246
246
|
end
|
247
247
|
|
248
|
-
it "
|
248
|
+
it "processes parameters" do
|
249
249
|
target_name, cmd_name, params = @api.cmd_raw("INST","COLLECT","TYPE"=>0,"DURATION"=>5)
|
250
|
-
target_name.
|
251
|
-
cmd_name.
|
252
|
-
params.
|
250
|
+
expect(target_name).to eql 'INST'
|
251
|
+
expect(cmd_name).to eql 'COLLECT'
|
252
|
+
expect(params).to include('TYPE'=>0, 'DURATION'=>5)
|
253
253
|
end
|
254
254
|
|
255
|
-
it "
|
255
|
+
it "processes commands without parameters" do
|
256
256
|
target_name, cmd_name, params = @api.cmd_raw("INST","ABORT")
|
257
|
-
target_name.
|
258
|
-
cmd_name.
|
259
|
-
params.
|
257
|
+
expect(target_name).to eql 'INST'
|
258
|
+
expect(cmd_name).to eql 'ABORT'
|
259
|
+
expect(params).to be {}
|
260
260
|
end
|
261
261
|
|
262
|
-
it "
|
262
|
+
it "complains about too many parameters" do
|
263
263
|
expect { @api.cmd_raw("INST","COLLECT","TYPE","DURATION") }.to raise_error(/Invalid number of arguments/)
|
264
264
|
end
|
265
265
|
|
266
|
-
it "
|
266
|
+
it "warns about required parameters" do
|
267
267
|
expect { @api.cmd_raw("INST COLLECT with DURATION 5") }.to raise_error(/Required/)
|
268
268
|
end
|
269
269
|
|
270
|
-
it "
|
270
|
+
it "warns about out of range parameters" do
|
271
271
|
expect { @api.cmd_raw("INST COLLECT with TYPE 0, DURATION 1000") }.to raise_error(/not in valid range/)
|
272
272
|
end
|
273
273
|
|
274
|
-
it "
|
274
|
+
it "warns about hazardous parameters" do
|
275
275
|
expect { @api.cmd_raw("INST COLLECT with TYPE 1") }.to raise_error(/Hazardous/)
|
276
276
|
end
|
277
277
|
|
278
|
-
it "
|
278
|
+
it "warns about hazardous commands" do
|
279
279
|
expect { @api.cmd_raw("INST CLEAR") }.to raise_error(/Hazardous/)
|
280
280
|
end
|
281
281
|
end
|
282
282
|
|
283
283
|
describe "cmd_no_range_check" do
|
284
|
-
it "
|
284
|
+
it "complains about unknown targets, commands, and parameters" do
|
285
285
|
test_cmd_unknown(:cmd_raw_no_range_check)
|
286
286
|
end
|
287
287
|
|
288
|
-
it "
|
288
|
+
it "processes a string" do
|
289
289
|
target_name, cmd_no_range_check_name, params = @api.cmd_raw_no_range_check("INST COLLECT with TYPE 0, DURATION 5")
|
290
|
-
target_name.
|
291
|
-
cmd_no_range_check_name.
|
292
|
-
params.
|
290
|
+
expect(target_name).to eql 'INST'
|
291
|
+
expect(cmd_no_range_check_name).to eql 'COLLECT'
|
292
|
+
expect(params).to include('TYPE'=>0, 'DURATION'=>5)
|
293
293
|
end
|
294
294
|
|
295
|
-
it "
|
295
|
+
it "processes parameters" do
|
296
296
|
target_name, cmd_no_range_check_name, params = @api.cmd_raw_no_range_check("INST","COLLECT","TYPE"=>0,"DURATION"=>5)
|
297
|
-
target_name.
|
298
|
-
cmd_no_range_check_name.
|
299
|
-
params.
|
297
|
+
expect(target_name).to eql 'INST'
|
298
|
+
expect(cmd_no_range_check_name).to eql 'COLLECT'
|
299
|
+
expect(params).to include('TYPE'=>0, 'DURATION'=>5)
|
300
300
|
end
|
301
301
|
|
302
|
-
it "
|
302
|
+
it "warns about required parameters" do
|
303
303
|
expect { @api.cmd_raw_no_range_check("INST COLLECT with DURATION 5") }.to raise_error(/Required/)
|
304
304
|
end
|
305
305
|
|
306
|
-
it "
|
306
|
+
it "does not warn about out of range parameters" do
|
307
307
|
expect { @api.cmd_raw_no_range_check("INST COLLECT with TYPE 0, DURATION 1000") }.to_not raise_error
|
308
308
|
end
|
309
309
|
|
310
|
-
it "
|
310
|
+
it "warns about hazardous parameters" do
|
311
311
|
expect { @api.cmd_raw_no_range_check("INST COLLECT with TYPE 1") }.to raise_error(/Hazardous/)
|
312
312
|
end
|
313
313
|
|
314
|
-
it "
|
314
|
+
it "warns about hazardous commands" do
|
315
315
|
expect { @api.cmd_raw_no_range_check("INST CLEAR") }.to raise_error(/Hazardous/)
|
316
316
|
end
|
317
317
|
end
|
318
318
|
|
319
319
|
describe "cmd_raw_no_hazardous_check" do
|
320
|
-
it "
|
320
|
+
it "complains about unknown targets, commands, and parameters" do
|
321
321
|
test_cmd_unknown(:cmd_raw_no_hazardous_check)
|
322
322
|
end
|
323
323
|
|
324
|
-
it "
|
324
|
+
it "processes a string" do
|
325
325
|
target_name, cmd_no_hazardous_check_name, params = @api.cmd_raw_no_hazardous_check("INST COLLECT with TYPE 0, DURATION 5")
|
326
|
-
target_name.
|
327
|
-
cmd_no_hazardous_check_name.
|
328
|
-
params.
|
326
|
+
expect(target_name).to eql 'INST'
|
327
|
+
expect(cmd_no_hazardous_check_name).to eql 'COLLECT'
|
328
|
+
expect(params).to include('TYPE'=>0, 'DURATION'=>5)
|
329
329
|
end
|
330
330
|
|
331
|
-
it "
|
331
|
+
it "processes parameters" do
|
332
332
|
target_name, cmd_no_hazardous_check_name, params = @api.cmd_raw_no_hazardous_check("INST","COLLECT","TYPE"=>0,"DURATION"=>5)
|
333
|
-
target_name.
|
334
|
-
cmd_no_hazardous_check_name.
|
335
|
-
params.
|
333
|
+
expect(target_name).to eql 'INST'
|
334
|
+
expect(cmd_no_hazardous_check_name).to eql 'COLLECT'
|
335
|
+
expect(params).to include('TYPE'=>0, 'DURATION'=>5)
|
336
336
|
end
|
337
337
|
|
338
|
-
it "
|
338
|
+
it "processes parameters that are strings" do
|
339
339
|
target_name, cmd_name, params = @api.cmd_raw_no_hazardous_check("INST ASCIICMD with STRING 'ARM LASER'")
|
340
|
-
target_name.
|
341
|
-
cmd_name.
|
342
|
-
params.
|
340
|
+
expect(target_name).to eql 'INST'
|
341
|
+
expect(cmd_name).to eql 'ASCIICMD'
|
342
|
+
expect(params).to include('STRING'=>'ARM LASER')
|
343
343
|
end
|
344
344
|
|
345
|
-
it "
|
345
|
+
it "warns about required parameters" do
|
346
346
|
expect { @api.cmd_raw_no_hazardous_check("INST COLLECT with DURATION 5") }.to raise_error(/Required/)
|
347
347
|
end
|
348
348
|
|
349
|
-
it "
|
349
|
+
it "warns about out of range parameters" do
|
350
350
|
expect { @api.cmd_raw_no_hazardous_check("INST COLLECT with TYPE 0, DURATION 1000") }.to raise_error(/not in valid range/)
|
351
351
|
end
|
352
352
|
|
353
|
-
it "
|
353
|
+
it "does not warn about hazardous parameters" do
|
354
354
|
expect { @api.cmd_raw_no_hazardous_check("INST COLLECT with TYPE 1") }.to_not raise_error
|
355
355
|
end
|
356
356
|
|
357
|
-
it "
|
357
|
+
it "does not warn about hazardous commands" do
|
358
358
|
expect { @api.cmd_raw_no_hazardous_check("INST CLEAR") }.to_not raise_error
|
359
359
|
end
|
360
360
|
end
|
361
361
|
|
362
362
|
describe "cmd_raw_no_checks" do
|
363
|
-
it "
|
363
|
+
it "complains about unknown targets, commands, and parameters" do
|
364
364
|
test_cmd_unknown(:cmd_raw_no_checks)
|
365
365
|
end
|
366
366
|
|
367
|
-
it "
|
367
|
+
it "processes a string" do
|
368
368
|
target_name, cmd_no_checks_name, params = @api.cmd_raw_no_checks("INST COLLECT with TYPE 0, DURATION 5")
|
369
|
-
target_name.
|
370
|
-
cmd_no_checks_name.
|
371
|
-
params.
|
369
|
+
expect(target_name).to eql 'INST'
|
370
|
+
expect(cmd_no_checks_name).to eql 'COLLECT'
|
371
|
+
expect(params).to include('TYPE'=>0, 'DURATION'=>5)
|
372
372
|
end
|
373
373
|
|
374
|
-
it "
|
374
|
+
it "processes parameters" do
|
375
375
|
target_name, cmd_no_checks_name, params = @api.cmd_raw_no_checks("INST","COLLECT","TYPE"=>0,"DURATION"=>5)
|
376
|
-
target_name.
|
377
|
-
cmd_no_checks_name.
|
378
|
-
params.
|
376
|
+
expect(target_name).to eql 'INST'
|
377
|
+
expect(cmd_no_checks_name).to eql 'COLLECT'
|
378
|
+
expect(params).to include('TYPE'=>0, 'DURATION'=>5)
|
379
379
|
end
|
380
380
|
|
381
|
-
it "
|
381
|
+
it "warns about required parameters" do
|
382
382
|
expect { @api.cmd_raw_no_checks("INST COLLECT with DURATION 5") }.to raise_error(/Required/)
|
383
383
|
end
|
384
384
|
|
385
|
-
it "
|
385
|
+
it "does not warn about out of range parameters" do
|
386
386
|
expect { @api.cmd_raw_no_checks("INST COLLECT with TYPE 0, DURATION 1000") }.to_not raise_error
|
387
387
|
end
|
388
388
|
|
389
|
-
it "
|
389
|
+
it "does not warn about hazardous parameters" do
|
390
390
|
expect { @api.cmd_raw_no_checks("INST COLLECT with TYPE 1") }.to_not raise_error
|
391
391
|
end
|
392
392
|
|
393
|
-
it "
|
393
|
+
it "does not warn about hazardous commands" do
|
394
394
|
expect { @api.cmd_raw_no_checks("INST CLEAR") }.to_not raise_error
|
395
395
|
end
|
396
396
|
end
|
397
397
|
|
398
398
|
describe "get_cmd_list" do
|
399
|
-
it "
|
399
|
+
it "returns command names sorted" do
|
400
400
|
result = @api.get_cmd_list("INST")
|
401
|
-
result.sort.
|
401
|
+
expect(result.sort).to eql result
|
402
402
|
end
|
403
403
|
|
404
|
-
it "
|
404
|
+
it "complains with a unknown target" do
|
405
405
|
expect { @api.get_cmd_list("BLAH") }.to raise_error(/does not exist/)
|
406
406
|
end
|
407
407
|
|
408
|
-
it "
|
408
|
+
it "returns command names and descriptions for a given target" do
|
409
409
|
result = @api.get_cmd_list("INST")
|
410
|
-
result[0][0].
|
410
|
+
expect(result[0][0]).to eql "ABORT"
|
411
411
|
# The second parameter is the description ... only test one
|
412
|
-
result[0][1].
|
413
|
-
result[1][0].
|
414
|
-
result[2][0].
|
415
|
-
result[3][0].
|
416
|
-
result[4][0].
|
417
|
-
result[5][0].
|
418
|
-
result[6][0].
|
419
|
-
result[7][0].
|
420
|
-
result[8][0].
|
421
|
-
result[9][0].
|
422
|
-
result[10][0].
|
423
|
-
result[11][0].
|
424
|
-
result[12][0].
|
425
|
-
result[13][0].
|
412
|
+
expect(result[0][1]).to eql "Aborts a collect on the instrument"
|
413
|
+
expect(result[1][0]).to eql "ARYCMD"
|
414
|
+
expect(result[2][0]).to eql "ASCIICMD"
|
415
|
+
expect(result[3][0]).to eql "CLEAR"
|
416
|
+
expect(result[4][0]).to eql "COLLECT"
|
417
|
+
expect(result[5][0]).to eql "COSMOS_ERROR_HANDLE"
|
418
|
+
expect(result[6][0]).to eql "COSMOS_ERROR_IGNORE"
|
419
|
+
expect(result[7][0]).to eql "COSMOS_HANDSHAKE_DS"
|
420
|
+
expect(result[8][0]).to eql "COSMOS_HANDSHAKE_EN"
|
421
|
+
expect(result[9][0]).to eql "FLTCMD"
|
422
|
+
expect(result[10][0]).to eql "LINC_COMMAND"
|
423
|
+
expect(result[11][0]).to eql "SETPARAMS"
|
424
|
+
expect(result[12][0]).to eql "SLRPNLDEPLOY"
|
425
|
+
expect(result[13][0]).to eql "SLRPNLRESET"
|
426
426
|
end
|
427
427
|
end
|
428
428
|
|
429
429
|
describe "get_cmd_param_list" do
|
430
|
-
it "
|
430
|
+
it "returns parameters for the command" do
|
431
431
|
result = @api.get_cmd_param_list("INST","COLLECT")
|
432
432
|
# Each element in the results array contains:
|
433
433
|
# name, default, states, description, full units, units, required
|
434
|
-
result.
|
435
|
-
result.
|
434
|
+
expect(result).to include ['TYPE',0,{"NORMAL"=>0,"SPECIAL"=>1},'Collect type',nil,nil,true]
|
435
|
+
expect(result).to include ['TEMP',0.0,nil,'Collect temperature','Celcius','C',false]
|
436
436
|
end
|
437
437
|
|
438
|
-
it "
|
438
|
+
it "returns array parameters for the command" do
|
439
439
|
result = @api.get_cmd_param_list("INST","ARYCMD")
|
440
440
|
# Each element in the results array contains:
|
441
441
|
# name, default, states, description, full units, units, required
|
442
|
-
result.
|
442
|
+
expect(result).to include ['ARRAY',[],nil,'Array parameter',nil,nil,false]
|
443
443
|
end
|
444
444
|
end
|
445
445
|
|
446
446
|
describe "get_cmd_hazardous" do
|
447
|
-
it "
|
448
|
-
@api.get_cmd_hazardous("INST","COLLECT",{"TYPE"=>"NORMAL"}).
|
449
|
-
@api.get_cmd_hazardous("INST","COLLECT",{"TYPE"=>"SPECIAL"}).
|
447
|
+
it "returns whether the command with parameters is hazardous" do
|
448
|
+
expect(@api.get_cmd_hazardous("INST","COLLECT",{"TYPE"=>"NORMAL"})).to be_falsey
|
449
|
+
expect(@api.get_cmd_hazardous("INST","COLLECT",{"TYPE"=>"SPECIAL"})).to be_truthy
|
450
450
|
end
|
451
451
|
|
452
|
-
it "
|
453
|
-
@api.get_cmd_hazardous("INST","CLEAR").
|
452
|
+
it "returns whether the command is hazardous" do
|
453
|
+
expect(@api.get_cmd_hazardous("INST","CLEAR")).to be_truthy
|
454
454
|
end
|
455
455
|
end
|
456
456
|
|
@@ -464,80 +464,80 @@ module Cosmos
|
|
464
464
|
end
|
465
465
|
|
466
466
|
describe "tlm" do
|
467
|
-
it "
|
467
|
+
it "complains about unknown targets, commands, and parameters" do
|
468
468
|
test_tlm_unknown(:tlm)
|
469
469
|
end
|
470
470
|
|
471
|
-
it "
|
471
|
+
it "processes a string" do
|
472
472
|
value = @api.tlm("INST HEALTH_STATUS TEMP1")
|
473
|
-
value.
|
473
|
+
expect(value).to eql -100.0
|
474
474
|
end
|
475
475
|
|
476
|
-
it "
|
476
|
+
it "processes parameters" do
|
477
477
|
value = @api.tlm("INST","HEALTH_STATUS","TEMP1")
|
478
478
|
end
|
479
479
|
|
480
|
-
it "
|
480
|
+
it "complains if too many parameters" do
|
481
481
|
expect { @api.tlm("INST","HEALTH_STATUS","TEMP1","TEMP2") }.to raise_error(/Invalid number of arguments/)
|
482
482
|
end
|
483
483
|
end
|
484
484
|
|
485
485
|
describe "tlm_raw" do
|
486
|
-
it "
|
486
|
+
it "complains about unknown targets, commands, and parameters" do
|
487
487
|
test_tlm_unknown(:tlm_raw)
|
488
488
|
end
|
489
489
|
|
490
|
-
it "
|
491
|
-
@api.tlm_raw("INST HEALTH_STATUS TEMP1").
|
490
|
+
it "processes a string" do
|
491
|
+
expect(@api.tlm_raw("INST HEALTH_STATUS TEMP1")).to eql 0
|
492
492
|
end
|
493
493
|
|
494
|
-
it "
|
495
|
-
@api.tlm_raw("INST LATEST TEMP1").
|
494
|
+
it "returns the value using LATEST" do
|
495
|
+
expect(@api.tlm_raw("INST LATEST TEMP1")).to eql 0
|
496
496
|
end
|
497
497
|
|
498
|
-
it "
|
499
|
-
@api.tlm_raw("INST","HEALTH_STATUS","TEMP1").
|
498
|
+
it "processes parameters" do
|
499
|
+
expect(@api.tlm_raw("INST","HEALTH_STATUS","TEMP1")).to eql 0
|
500
500
|
end
|
501
501
|
end
|
502
502
|
|
503
503
|
describe "tlm_formatted" do
|
504
|
-
it "
|
504
|
+
it "complains about unknown targets, commands, and parameters" do
|
505
505
|
test_tlm_unknown(:tlm_formatted)
|
506
506
|
end
|
507
507
|
|
508
|
-
it "
|
509
|
-
@api.tlm_formatted("INST HEALTH_STATUS TEMP1").
|
508
|
+
it "processes a string" do
|
509
|
+
expect(@api.tlm_formatted("INST HEALTH_STATUS TEMP1")).to eql "-100.000"
|
510
510
|
end
|
511
511
|
|
512
|
-
it "
|
513
|
-
@api.tlm_formatted("INST LATEST TEMP1").
|
512
|
+
it "returns the value using LATEST" do
|
513
|
+
expect(@api.tlm_formatted("INST LATEST TEMP1")).to eql "-100.000"
|
514
514
|
end
|
515
515
|
|
516
|
-
it "
|
517
|
-
@api.tlm_formatted("INST","HEALTH_STATUS","TEMP1").
|
516
|
+
it "processes parameters" do
|
517
|
+
expect(@api.tlm_formatted("INST","HEALTH_STATUS","TEMP1")).to eql "-100.000"
|
518
518
|
end
|
519
519
|
end
|
520
520
|
|
521
521
|
describe "tlm_with_units" do
|
522
|
-
it "
|
522
|
+
it "complains about unknown targets, commands, and parameters" do
|
523
523
|
test_tlm_unknown(:tlm_with_units)
|
524
524
|
end
|
525
525
|
|
526
|
-
it "
|
527
|
-
@api.tlm_with_units("INST HEALTH_STATUS TEMP1").
|
526
|
+
it "processes a string" do
|
527
|
+
expect(@api.tlm_with_units("INST HEALTH_STATUS TEMP1")).to eql "-100.000 C"
|
528
528
|
end
|
529
529
|
|
530
|
-
it "
|
531
|
-
@api.tlm_with_units("INST LATEST TEMP1").
|
530
|
+
it "returns the value using LATEST" do
|
531
|
+
expect(@api.tlm_with_units("INST LATEST TEMP1")).to eql "-100.000 C"
|
532
532
|
end
|
533
533
|
|
534
|
-
it "
|
535
|
-
@api.tlm_with_units("INST","HEALTH_STATUS","TEMP1").
|
534
|
+
it "processes parameters" do
|
535
|
+
expect(@api.tlm_with_units("INST","HEALTH_STATUS","TEMP1")).to eql "-100.000 C"
|
536
536
|
end
|
537
537
|
end
|
538
538
|
|
539
539
|
describe "tlm_variable" do
|
540
|
-
it "
|
540
|
+
it "complains about unknown targets, commands, and parameters" do
|
541
541
|
expect { @api.tlm_variable("BLAH HEALTH_STATUS COLLECTS",:RAW) }.to raise_error(/does not exist/)
|
542
542
|
expect { @api.tlm_variable("INST UNKNOWN COLLECTS",:RAW) }.to raise_error(/does not exist/)
|
543
543
|
expect { @api.tlm_variable("INST HEALTH_STATUS BLAH",:RAW) }.to raise_error(/does not exist/)
|
@@ -546,34 +546,34 @@ module Cosmos
|
|
546
546
|
expect { @api.tlm_variable("INST","HEALTH_STATUS","BLAH",:RAW) }.to raise_error(/does not exist/)
|
547
547
|
end
|
548
548
|
|
549
|
-
it "
|
550
|
-
@api.tlm_variable("INST HEALTH_STATUS TEMP1",:CONVERTED).
|
551
|
-
@api.tlm_variable("INST HEALTH_STATUS TEMP1",:RAW).
|
552
|
-
@api.tlm_variable("INST HEALTH_STATUS TEMP1",:FORMATTED).
|
553
|
-
@api.tlm_variable("INST HEALTH_STATUS TEMP1",:WITH_UNITS).
|
549
|
+
it "processes a string" do
|
550
|
+
expect(@api.tlm_variable("INST HEALTH_STATUS TEMP1",:CONVERTED)).to eql -100.0
|
551
|
+
expect(@api.tlm_variable("INST HEALTH_STATUS TEMP1",:RAW)).to eql 0
|
552
|
+
expect(@api.tlm_variable("INST HEALTH_STATUS TEMP1",:FORMATTED)).to eql "-100.000"
|
553
|
+
expect(@api.tlm_variable("INST HEALTH_STATUS TEMP1",:WITH_UNITS)).to eql "-100.000 C"
|
554
554
|
end
|
555
555
|
|
556
|
-
it "
|
557
|
-
@api.tlm_variable("INST LATEST TEMP1",:CONVERTED).
|
558
|
-
@api.tlm_variable("INST LATEST TEMP1",:RAW).
|
559
|
-
@api.tlm_variable("INST LATEST TEMP1",:FORMATTED).
|
560
|
-
@api.tlm_variable("INST LATEST TEMP1",:WITH_UNITS).
|
556
|
+
it "returns the value using LATEST" do
|
557
|
+
expect(@api.tlm_variable("INST LATEST TEMP1",:CONVERTED)).to eql -100.0
|
558
|
+
expect(@api.tlm_variable("INST LATEST TEMP1",:RAW)).to eql 0
|
559
|
+
expect(@api.tlm_variable("INST LATEST TEMP1",:FORMATTED)).to eql "-100.000"
|
560
|
+
expect(@api.tlm_variable("INST LATEST TEMP1",:WITH_UNITS)).to eql "-100.000 C"
|
561
561
|
end
|
562
562
|
|
563
|
-
it "
|
564
|
-
@api.tlm_variable("INST","HEALTH_STATUS","TEMP1",:CONVERTED).
|
565
|
-
@api.tlm_variable("INST","HEALTH_STATUS","TEMP1",:RAW).
|
566
|
-
@api.tlm_variable("INST","HEALTH_STATUS","TEMP1",:FORMATTED).
|
567
|
-
@api.tlm_variable("INST","HEALTH_STATUS","TEMP1",:WITH_UNITS).
|
563
|
+
it "processes parameters" do
|
564
|
+
expect(@api.tlm_variable("INST","HEALTH_STATUS","TEMP1",:CONVERTED)).to eql -100.0
|
565
|
+
expect(@api.tlm_variable("INST","HEALTH_STATUS","TEMP1",:RAW)).to eql 0
|
566
|
+
expect(@api.tlm_variable("INST","HEALTH_STATUS","TEMP1",:FORMATTED)).to eql "-100.000"
|
567
|
+
expect(@api.tlm_variable("INST","HEALTH_STATUS","TEMP1",:WITH_UNITS)).to eql "-100.000 C"
|
568
568
|
end
|
569
569
|
|
570
|
-
it "
|
570
|
+
it "complains with too many parameters" do
|
571
571
|
expect { @api.tlm_variable("INST","HEALTH_STATUS","TEMP1","TEMP2",:CONVERTED) }.to raise_error(/Invalid number of arguments/)
|
572
572
|
end
|
573
573
|
end
|
574
574
|
|
575
575
|
describe "set_tlm" do
|
576
|
-
it "
|
576
|
+
it "complains about unknown targets, commands, and parameters" do
|
577
577
|
expect { @api.set_tlm("BLAH HEALTH_STATUS COLLECTS = 1") }.to raise_error(/does not exist/)
|
578
578
|
expect { @api.set_tlm("INST UNKNOWN COLLECTS = 1") }.to raise_error(/does not exist/)
|
579
579
|
expect { @api.set_tlm("INST HEALTH_STATUS BLAH = 1") }.to raise_error(/does not exist/)
|
@@ -582,23 +582,23 @@ module Cosmos
|
|
582
582
|
expect { @api.set_tlm("INST","HEALTH_STATUS","BLAH",1) }.to raise_error(/does not exist/)
|
583
583
|
end
|
584
584
|
|
585
|
-
it "
|
585
|
+
it "processes a string" do
|
586
586
|
@api.set_tlm("INST HEALTH_STATUS TEMP1 = 0.0")
|
587
|
-
@api.tlm("INST HEALTH_STATUS TEMP1").
|
587
|
+
expect(@api.tlm("INST HEALTH_STATUS TEMP1")).to be_within(0.00001).of(-0.05759)
|
588
588
|
end
|
589
589
|
|
590
|
-
it "
|
590
|
+
it "processes parameters" do
|
591
591
|
@api.set_tlm("INST","HEALTH_STATUS","TEMP1", 0.0)
|
592
|
-
@api.tlm("INST HEALTH_STATUS TEMP1").
|
592
|
+
expect(@api.tlm("INST HEALTH_STATUS TEMP1")).to be_within(0.00001).of(-0.05759)
|
593
593
|
end
|
594
594
|
|
595
|
-
it "
|
595
|
+
it "complains with too many parameters" do
|
596
596
|
expect { @api.set_tlm("INST","HEALTH_STATUS","TEMP1","TEMP2",0.0) }.to raise_error(/Invalid number of arguments/)
|
597
597
|
end
|
598
598
|
end
|
599
599
|
|
600
600
|
describe "set_tlm_raw" do
|
601
|
-
it "
|
601
|
+
it "complains about unknown targets, commands, and parameters" do
|
602
602
|
expect { @api.set_tlm_raw("BLAH HEALTH_STATUS COLLECTS = 1") }.to raise_error(/does not exist/)
|
603
603
|
expect { @api.set_tlm_raw("INST UNKNOWN COLLECTS = 1") }.to raise_error(/does not exist/)
|
604
604
|
expect { @api.set_tlm_raw("INST HEALTH_STATUS BLAH = 1") }.to raise_error(/does not exist/)
|
@@ -607,156 +607,156 @@ module Cosmos
|
|
607
607
|
expect { @api.set_tlm_raw("INST","HEALTH_STATUS","BLAH",1) }.to raise_error(/does not exist/)
|
608
608
|
end
|
609
609
|
|
610
|
-
it "
|
610
|
+
it "processes a string" do
|
611
611
|
@api.set_tlm_raw("INST HEALTH_STATUS TEMP1 = 0.0")
|
612
|
-
@api.tlm("INST HEALTH_STATUS TEMP1").
|
612
|
+
expect(@api.tlm("INST HEALTH_STATUS TEMP1")).to eql -100.0
|
613
613
|
end
|
614
614
|
|
615
|
-
it "
|
615
|
+
it "processes parameters" do
|
616
616
|
@api.set_tlm_raw("INST","HEALTH_STATUS","TEMP1", 0.0)
|
617
|
-
@api.tlm("INST HEALTH_STATUS TEMP1").
|
617
|
+
expect(@api.tlm("INST HEALTH_STATUS TEMP1")).to eql -100.0
|
618
618
|
end
|
619
619
|
end
|
620
620
|
|
621
621
|
describe "get_tlm_packet" do
|
622
|
-
it "
|
622
|
+
it "complains about non-existant targets" do
|
623
623
|
expect { @api.get_tlm_packet("BLAH","HEALTH_STATUS") }.to raise_error(RuntimeError, "Telemetry target 'BLAH' does not exist")
|
624
624
|
end
|
625
625
|
|
626
|
-
it "
|
626
|
+
it "complains about non-existant packets" do
|
627
627
|
expect { @api.get_tlm_packet("INST","BLAH") }.to raise_error(RuntimeError, "Telemetry packet 'INST BLAH' does not exist")
|
628
628
|
end
|
629
629
|
|
630
|
-
it "
|
630
|
+
it "complains using LATEST" do
|
631
631
|
expect { @api.get_tlm_packet("INST","LATEST") }.to raise_error(RuntimeError, "Telemetry packet 'INST LATEST' does not exist")
|
632
632
|
end
|
633
633
|
|
634
|
-
it "
|
634
|
+
it "complains about non-existant value_types" do
|
635
635
|
expect { @api.get_tlm_packet("INST","HEALTH_STATUS",:MINE) }.to raise_error(ArgumentError, "Unknown value type on read: MINE")
|
636
636
|
end
|
637
637
|
|
638
|
-
it "
|
638
|
+
it "reads all telemetry items with their limits states" do
|
639
639
|
vals = @api.get_tlm_packet("INST","HEALTH_STATUS")
|
640
|
-
vals[0][0].
|
641
|
-
vals[0][1].
|
642
|
-
vals[0][2].
|
643
|
-
vals[1][0].
|
644
|
-
vals[1][1].
|
645
|
-
vals[1][2].
|
646
|
-
vals[2][0].
|
647
|
-
vals[2][1].
|
648
|
-
vals[2][2].
|
640
|
+
expect(vals[0][0]).to eql "RECEIVED_TIMESECONDS"
|
641
|
+
expect(vals[0][1]).to eql 0.0
|
642
|
+
expect(vals[0][2]).to be_nil
|
643
|
+
expect(vals[1][0]).to eql "RECEIVED_TIMEFORMATTED"
|
644
|
+
expect(vals[1][1]).to eql "No Packet Received Time"
|
645
|
+
expect(vals[1][2]).to be_nil
|
646
|
+
expect(vals[2][0]).to eql "RECEIVED_COUNT"
|
647
|
+
expect(vals[2][1]).to eql 0
|
648
|
+
expect(vals[2][2]).to be_nil
|
649
649
|
# Spot check a few more
|
650
|
-
vals[22][0].
|
651
|
-
vals[22][1].
|
652
|
-
vals[22][2].
|
653
|
-
vals[23][0].
|
654
|
-
vals[23][1].
|
655
|
-
vals[23][2].
|
656
|
-
vals[24][0].
|
657
|
-
vals[24][1].
|
658
|
-
vals[24][2].
|
659
|
-
vals[25][0].
|
660
|
-
vals[25][1].
|
661
|
-
vals[25][2].
|
650
|
+
expect(vals[22][0]).to eql "TEMP1"
|
651
|
+
expect(vals[22][1]).to eql -100.0
|
652
|
+
expect(vals[22][2]).to eql :RED_LOW
|
653
|
+
expect(vals[23][0]).to eql "TEMP2"
|
654
|
+
expect(vals[23][1]).to eql -100.0
|
655
|
+
expect(vals[23][2]).to eql :RED_LOW
|
656
|
+
expect(vals[24][0]).to eql "TEMP3"
|
657
|
+
expect(vals[24][1]).to eql -100.0
|
658
|
+
expect(vals[24][2]).to eql :RED_LOW
|
659
|
+
expect(vals[25][0]).to eql "TEMP4"
|
660
|
+
expect(vals[25][1]).to eql -100.0
|
661
|
+
expect(vals[25][2]).to eql :RED_LOW
|
662
662
|
end
|
663
663
|
end
|
664
664
|
|
665
665
|
describe "get_tlm_values" do
|
666
|
-
it "
|
667
|
-
@api.get_tlm_values([]).
|
666
|
+
it "handles an empty request" do
|
667
|
+
expect(@api.get_tlm_values([])).to eql [[], [], [], :DEFAULT]
|
668
668
|
end
|
669
669
|
|
670
|
-
it "
|
670
|
+
it "complains about non-existant targets" do
|
671
671
|
expect { @api.get_tlm_values([["BLAH","HEALTH_STATUS","TEMP1"]]) }.to raise_error(RuntimeError, "Telemetry target 'BLAH' does not exist")
|
672
672
|
end
|
673
673
|
|
674
|
-
it "
|
674
|
+
it "complains about non-existant packets" do
|
675
675
|
expect { @api.get_tlm_values([["INST","BLAH","TEMP1"]]) }.to raise_error(RuntimeError, "Telemetry packet 'INST BLAH' does not exist")
|
676
676
|
end
|
677
677
|
|
678
|
-
it "
|
678
|
+
it "complains about non-existant items" do
|
679
679
|
expect { @api.get_tlm_values([["INST","LATEST","BLAH"]]) }.to raise_error(RuntimeError, "Telemetry item 'INST LATEST BLAH' does not exist")
|
680
680
|
end
|
681
681
|
|
682
|
-
it "
|
682
|
+
it "complains about non-existant value_types" do
|
683
683
|
expect { @api.get_tlm_values([["INST","HEALTH_STATUS","TEMP1"]],:MINE) }.to raise_error(ArgumentError, "Unknown value type on read: MINE")
|
684
684
|
end
|
685
685
|
|
686
|
-
it "
|
686
|
+
it "complains about bad arguments" do
|
687
687
|
expect { @api.get_tlm_values("INST",:MINE) }.to raise_error(ArgumentError, /item_array must be nested array/)
|
688
688
|
expect { @api.get_tlm_values(["INST","HEALTH_STATUS","TEMP1"],:MINE) }.to raise_error(ArgumentError, /item_array must be nested array/)
|
689
689
|
expect { @api.get_tlm_values([["INST","HEALTH_STATUS","TEMP1"]],10) }.to raise_error(ArgumentError, /value_types must be a single symbol or array of symbols/)
|
690
690
|
expect { @api.get_tlm_values([["INST","HEALTH_STATUS","TEMP1"]],[10]) }.to raise_error(ArgumentError, /value_types must be a single symbol or array of symbols/)
|
691
691
|
end
|
692
692
|
|
693
|
-
it "
|
693
|
+
it "reads all the specified items" do
|
694
694
|
items = []
|
695
695
|
items << %w(INST HEALTH_STATUS TEMP1)
|
696
696
|
items << %w(INST HEALTH_STATUS TEMP2)
|
697
697
|
items << %w(INST HEALTH_STATUS TEMP3)
|
698
698
|
items << %w(INST HEALTH_STATUS TEMP4)
|
699
699
|
vals = @api.get_tlm_values(items)
|
700
|
-
vals[0][0].
|
701
|
-
vals[0][1].
|
702
|
-
vals[0][2].
|
703
|
-
vals[0][3].
|
704
|
-
vals[1][0].
|
705
|
-
vals[1][1].
|
706
|
-
vals[1][2].
|
707
|
-
vals[1][3].
|
708
|
-
vals[2][0].
|
709
|
-
vals[2][1].
|
710
|
-
vals[2][2].
|
711
|
-
vals[2][3].
|
712
|
-
vals[3].
|
713
|
-
end
|
714
|
-
|
715
|
-
it "
|
700
|
+
expect(vals[0][0]).to eql -100.0
|
701
|
+
expect(vals[0][1]).to eql -100.0
|
702
|
+
expect(vals[0][2]).to eql -100.0
|
703
|
+
expect(vals[0][3]).to eql -100.0
|
704
|
+
expect(vals[1][0]).to eql :RED_LOW
|
705
|
+
expect(vals[1][1]).to eql :RED_LOW
|
706
|
+
expect(vals[1][2]).to eql :RED_LOW
|
707
|
+
expect(vals[1][3]).to eql :RED_LOW
|
708
|
+
expect(vals[2][0]).to eql [-80.0, -70.0, 60.0, 80.0, -20.0, 20.0]
|
709
|
+
expect(vals[2][1]).to eql [-60.0, -55.0, 30.0, 35.0]
|
710
|
+
expect(vals[2][2]).to eql [-25.0, -10.0, 50.0, 55.0]
|
711
|
+
expect(vals[2][3]).to eql [-80.0, -70.0, 60.0, 80.0]
|
712
|
+
expect(vals[3]).to eql :DEFAULT
|
713
|
+
end
|
714
|
+
|
715
|
+
it "reads all the specified items with one conversion" do
|
716
716
|
items = []
|
717
717
|
items << %w(INST HEALTH_STATUS TEMP1)
|
718
718
|
items << %w(INST HEALTH_STATUS TEMP2)
|
719
719
|
items << %w(INST HEALTH_STATUS TEMP3)
|
720
720
|
items << %w(INST HEALTH_STATUS TEMP4)
|
721
721
|
vals = @api.get_tlm_values(items, :RAW)
|
722
|
-
vals[0][0].
|
723
|
-
vals[0][1].
|
724
|
-
vals[0][2].
|
725
|
-
vals[0][3].
|
726
|
-
vals[1][0].
|
727
|
-
vals[1][1].
|
728
|
-
vals[1][2].
|
729
|
-
vals[1][3].
|
730
|
-
vals[2][0].
|
731
|
-
vals[2][1].
|
732
|
-
vals[2][2].
|
733
|
-
vals[2][3].
|
734
|
-
vals[3].
|
735
|
-
end
|
736
|
-
|
737
|
-
it "
|
722
|
+
expect(vals[0][0]).to eql 0
|
723
|
+
expect(vals[0][1]).to eql 0
|
724
|
+
expect(vals[0][2]).to eql 0
|
725
|
+
expect(vals[0][3]).to eql 0
|
726
|
+
expect(vals[1][0]).to eql :RED_LOW
|
727
|
+
expect(vals[1][1]).to eql :RED_LOW
|
728
|
+
expect(vals[1][2]).to eql :RED_LOW
|
729
|
+
expect(vals[1][3]).to eql :RED_LOW
|
730
|
+
expect(vals[2][0]).to eql [-80.0, -70.0, 60.0, 80.0, -20.0, 20.0]
|
731
|
+
expect(vals[2][1]).to eql [-60.0, -55.0, 30.0, 35.0]
|
732
|
+
expect(vals[2][2]).to eql [-25.0, -10.0, 50.0, 55.0]
|
733
|
+
expect(vals[2][3]).to eql [-80.0, -70.0, 60.0, 80.0]
|
734
|
+
expect(vals[3]).to eql :DEFAULT
|
735
|
+
end
|
736
|
+
|
737
|
+
it "reads all the specified items with different conversions" do
|
738
738
|
items = []
|
739
739
|
items << %w(INST HEALTH_STATUS TEMP1)
|
740
740
|
items << %w(INST HEALTH_STATUS TEMP2)
|
741
741
|
items << %w(INST HEALTH_STATUS TEMP3)
|
742
742
|
items << %w(INST HEALTH_STATUS TEMP4)
|
743
743
|
vals = @api.get_tlm_values(items, [:RAW, :CONVERTED, :FORMATTED, :WITH_UNITS])
|
744
|
-
vals[0][0].
|
745
|
-
vals[0][1].
|
746
|
-
vals[0][2].
|
747
|
-
vals[0][3].
|
748
|
-
vals[1][0].
|
749
|
-
vals[1][1].
|
750
|
-
vals[1][2].
|
751
|
-
vals[1][3].
|
752
|
-
vals[2][0].
|
753
|
-
vals[2][1].
|
754
|
-
vals[2][2].
|
755
|
-
vals[2][3].
|
756
|
-
vals[3].
|
757
|
-
end
|
758
|
-
|
759
|
-
it "
|
744
|
+
expect(vals[0][0]).to eql 0
|
745
|
+
expect(vals[0][1]).to eql -100.0
|
746
|
+
expect(vals[0][2]).to eql "-100.000"
|
747
|
+
expect(vals[0][3]).to eql "-100.000 C"
|
748
|
+
expect(vals[1][0]).to eql :RED_LOW
|
749
|
+
expect(vals[1][1]).to eql :RED_LOW
|
750
|
+
expect(vals[1][2]).to eql :RED_LOW
|
751
|
+
expect(vals[1][3]).to eql :RED_LOW
|
752
|
+
expect(vals[2][0]).to eql [-80.0, -70.0, 60.0, 80.0, -20.0, 20.0]
|
753
|
+
expect(vals[2][1]).to eql [-60.0, -55.0, 30.0, 35.0]
|
754
|
+
expect(vals[2][2]).to eql [-25.0, -10.0, 50.0, 55.0]
|
755
|
+
expect(vals[2][3]).to eql [-80.0, -70.0, 60.0, 80.0]
|
756
|
+
expect(vals[3]).to eql :DEFAULT
|
757
|
+
end
|
758
|
+
|
759
|
+
it "complains if items length != conversions length" do
|
760
760
|
items = []
|
761
761
|
items << %w(INST HEALTH_STATUS TEMP1)
|
762
762
|
items << %w(INST HEALTH_STATUS TEMP2)
|
@@ -767,251 +767,251 @@ module Cosmos
|
|
767
767
|
end
|
768
768
|
|
769
769
|
describe "get_tlm_list" do
|
770
|
-
it "
|
770
|
+
it "complains about non-existant targets" do
|
771
771
|
expect { @api.get_tlm_list("BLAH") }.to raise_error(RuntimeError, "Telemetry target 'BLAH' does not exist")
|
772
772
|
end
|
773
773
|
|
774
|
-
it "
|
774
|
+
it "returns the sorted packet names for a target" do
|
775
775
|
pkts = @api.get_tlm_list("INST")
|
776
|
-
pkts[0][0].
|
777
|
-
pkts[1][0].
|
778
|
-
pkts[2][0].
|
779
|
-
pkts[3][0].
|
780
|
-
pkts[4][0].
|
781
|
-
pkts[5][0].
|
782
|
-
pkts[6][0].
|
776
|
+
expect(pkts[0][0]).to eql "ADCS"
|
777
|
+
expect(pkts[1][0]).to eql "ERROR"
|
778
|
+
expect(pkts[2][0]).to eql "HANDSHAKE"
|
779
|
+
expect(pkts[3][0]).to eql "HEALTH_STATUS"
|
780
|
+
expect(pkts[4][0]).to eql "IMAGE"
|
781
|
+
expect(pkts[5][0]).to eql "MECH"
|
782
|
+
expect(pkts[6][0]).to eql "PARAMS"
|
783
783
|
end
|
784
784
|
end
|
785
785
|
|
786
786
|
describe "get_tlm_item_list" do
|
787
|
-
it "
|
787
|
+
it "complains about non-existant targets" do
|
788
788
|
expect { @api.get_tlm_item_list("BLAH","HEALTH_STATUS") }.to raise_error(RuntimeError, "Telemetry target 'BLAH' does not exist")
|
789
789
|
end
|
790
790
|
|
791
|
-
it "
|
791
|
+
it "complains about non-existant packets" do
|
792
792
|
expect { @api.get_tlm_item_list("INST","BLAH") }.to raise_error(RuntimeError, "Telemetry packet 'INST BLAH' does not exist")
|
793
793
|
end
|
794
794
|
|
795
|
-
it "
|
795
|
+
it "returns all the items for a target/packet" do
|
796
796
|
items = @api.get_tlm_item_list("INST","HEALTH_STATUS")
|
797
|
-
items[0][0].
|
798
|
-
items[1][0].
|
799
|
-
items[2][0].
|
797
|
+
expect(items[0][0]).to eql "RECEIVED_TIMESECONDS"
|
798
|
+
expect(items[1][0]).to eql "RECEIVED_TIMEFORMATTED"
|
799
|
+
expect(items[2][0]).to eql "RECEIVED_COUNT"
|
800
800
|
# Spot check a few more
|
801
|
-
items[22][0].
|
802
|
-
items[22][1].
|
803
|
-
items[22][2].
|
804
|
-
items[28][0].
|
805
|
-
items[28][1].
|
806
|
-
items[28][2].
|
801
|
+
expect(items[22][0]).to eql "TEMP1"
|
802
|
+
expect(items[22][1]).to be_nil
|
803
|
+
expect(items[22][2]).to eql "Temperature #1"
|
804
|
+
expect(items[28][0]).to eql "COLLECT_TYPE"
|
805
|
+
expect(items[28][1]).to include("NORMAL"=>0, "SPECIAL"=>1)
|
806
|
+
expect(items[28][2]).to eql "Most recent collect type"
|
807
807
|
end
|
808
808
|
end
|
809
809
|
|
810
810
|
describe "get_tlm_details" do
|
811
|
-
it "
|
811
|
+
it "complains about non-existant targets" do
|
812
812
|
expect { @api.get_tlm_details([["BLAH","HEALTH_STATUS","TEMP1"]]) }.to raise_error(RuntimeError, "Telemetry target 'BLAH' does not exist")
|
813
813
|
end
|
814
814
|
|
815
|
-
it "
|
815
|
+
it "complains about non-existant packets" do
|
816
816
|
expect { @api.get_tlm_details([["INST","BLAH","TEMP1"]]) }.to raise_error(RuntimeError, "Telemetry packet 'INST BLAH' does not exist")
|
817
817
|
end
|
818
818
|
|
819
|
-
it "
|
819
|
+
it "complains about non-existant items" do
|
820
820
|
expect { @api.get_tlm_details([["INST","LATEST","BLAH"]]) }.to raise_error(RuntimeError, "Telemetry item 'INST LATEST BLAH' does not exist")
|
821
821
|
end
|
822
822
|
|
823
|
-
it "
|
823
|
+
it "complains about bad parameters" do
|
824
824
|
expect { @api.get_tlm_details("INST") }.to raise_error(ArgumentError, /item_array must be nested array/)
|
825
825
|
expect { @api.get_tlm_details(["INST","LATEST","BLAH"]) }.to raise_error(ArgumentError, /item_array must be nested array/)
|
826
826
|
end
|
827
827
|
|
828
|
-
it "
|
828
|
+
it "reads all the specified items" do
|
829
829
|
items = []
|
830
830
|
items << %w(INST HEALTH_STATUS TEMP1)
|
831
831
|
items << %w(INST HEALTH_STATUS TEMP2)
|
832
832
|
items << %w(INST HEALTH_STATUS TEMP3)
|
833
833
|
items << %w(INST HEALTH_STATUS TEMP4)
|
834
834
|
details = @api.get_tlm_details(items)
|
835
|
-
details.length.
|
836
|
-
details[0]["name"].
|
837
|
-
details[1]["name"].
|
838
|
-
details[2]["name"].
|
839
|
-
details[3]["name"].
|
835
|
+
expect(details.length).to eql 4
|
836
|
+
expect(details[0]["name"]).to eql "TEMP1"
|
837
|
+
expect(details[1]["name"]).to eql "TEMP2"
|
838
|
+
expect(details[2]["name"]).to eql "TEMP3"
|
839
|
+
expect(details[3]["name"]).to eql "TEMP4"
|
840
840
|
end
|
841
841
|
end
|
842
842
|
|
843
843
|
describe "get_out_of_limits" do
|
844
|
-
it "
|
844
|
+
it "returns all out of limits items" do
|
845
845
|
items = @api.get_out_of_limits
|
846
846
|
(0..3).each do |i|
|
847
|
-
items[i][0].
|
848
|
-
items[i][1].
|
849
|
-
items[i][2].
|
850
|
-
items[i][3].
|
847
|
+
expect(items[i][0]).to eql "INST"
|
848
|
+
expect(items[i][1]).to eql "HEALTH_STATUS"
|
849
|
+
expect(items[i][2]).to eql "TEMP#{i+1}"
|
850
|
+
expect(items[i][3]).to eql :RED_LOW
|
851
851
|
end
|
852
852
|
end
|
853
853
|
end
|
854
854
|
|
855
855
|
describe "limits_enabled?" do
|
856
|
-
it "
|
856
|
+
it "complains about non-existant targets" do
|
857
857
|
expect { @api.limits_enabled?("BLAH","HEALTH_STATUS","TEMP1") }.to raise_error(RuntimeError, "Telemetry target 'BLAH' does not exist")
|
858
858
|
end
|
859
859
|
|
860
|
-
it "
|
860
|
+
it "complains about non-existant packets" do
|
861
861
|
expect { @api.limits_enabled?("INST","BLAH","TEMP1") }.to raise_error(RuntimeError, "Telemetry packet 'INST BLAH' does not exist")
|
862
862
|
end
|
863
863
|
|
864
|
-
it "
|
864
|
+
it "complains about non-existant items" do
|
865
865
|
expect { @api.limits_enabled?("INST","HEALTH_STATUS","BLAH") }.to raise_error(RuntimeError, "Packet item 'INST HEALTH_STATUS BLAH' does not exist")
|
866
866
|
end
|
867
867
|
|
868
|
-
it "
|
869
|
-
@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1").
|
868
|
+
it "returns whether limits are enable for an item" do
|
869
|
+
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to be_truthy
|
870
870
|
end
|
871
871
|
end
|
872
872
|
|
873
873
|
describe "enable_limits" do
|
874
|
-
it "
|
874
|
+
it "complains about non-existant targets" do
|
875
875
|
expect { @api.enable_limits("BLAH","HEALTH_STATUS","TEMP1") }.to raise_error(RuntimeError, "Telemetry target 'BLAH' does not exist")
|
876
876
|
end
|
877
877
|
|
878
|
-
it "
|
878
|
+
it "complains about non-existant packets" do
|
879
879
|
expect { @api.enable_limits("INST","BLAH","TEMP1") }.to raise_error(RuntimeError, "Telemetry packet 'INST BLAH' does not exist")
|
880
880
|
end
|
881
881
|
|
882
|
-
it "
|
882
|
+
it "complains about non-existant items" do
|
883
883
|
expect { @api.enable_limits("INST","HEALTH_STATUS","BLAH") }.to raise_error(RuntimeError, "Packet item 'INST HEALTH_STATUS BLAH' does not exist")
|
884
884
|
end
|
885
885
|
|
886
|
-
it "
|
887
|
-
@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1").
|
886
|
+
it "enables limits for an item" do
|
887
|
+
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to be_truthy
|
888
888
|
@api.disable_limits("INST","HEALTH_STATUS","TEMP1")
|
889
|
-
@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1").
|
889
|
+
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to be_falsey
|
890
890
|
@api.enable_limits("INST","HEALTH_STATUS","TEMP1")
|
891
|
-
@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1").
|
891
|
+
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to be_truthy
|
892
892
|
end
|
893
893
|
end
|
894
894
|
|
895
895
|
describe "disable_limits" do
|
896
|
-
it "
|
896
|
+
it "complains about non-existant targets" do
|
897
897
|
expect { @api.disable_limits("BLAH","HEALTH_STATUS","TEMP1") }.to raise_error(RuntimeError, "Telemetry target 'BLAH' does not exist")
|
898
898
|
end
|
899
899
|
|
900
|
-
it "
|
900
|
+
it "complains about non-existant packets" do
|
901
901
|
expect { @api.disable_limits("INST","BLAH","TEMP1") }.to raise_error(RuntimeError, "Telemetry packet 'INST BLAH' does not exist")
|
902
902
|
end
|
903
903
|
|
904
|
-
it "
|
904
|
+
it "complains about non-existant items" do
|
905
905
|
expect { @api.disable_limits("INST","HEALTH_STATUS","BLAH") }.to raise_error(RuntimeError, "Packet item 'INST HEALTH_STATUS BLAH' does not exist")
|
906
906
|
end
|
907
907
|
|
908
|
-
it "
|
909
|
-
@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1").
|
908
|
+
it "disables limits for an item" do
|
909
|
+
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to be_truthy
|
910
910
|
@api.disable_limits("INST","HEALTH_STATUS","TEMP1")
|
911
|
-
@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1").
|
911
|
+
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to be_falsey
|
912
912
|
@api.enable_limits("INST","HEALTH_STATUS","TEMP1")
|
913
913
|
end
|
914
914
|
end
|
915
915
|
|
916
916
|
describe "get_limits" do
|
917
|
-
it "
|
917
|
+
it "complains about non-existant targets" do
|
918
918
|
expect { @api.get_limits("BLAH","HEALTH_STATUS","TEMP1") }.to raise_error(RuntimeError, "Telemetry target 'BLAH' does not exist")
|
919
919
|
end
|
920
920
|
|
921
|
-
it "
|
921
|
+
it "complains about non-existant packets" do
|
922
922
|
expect { @api.get_limits("INST","BLAH","TEMP1") }.to raise_error(RuntimeError, "Telemetry packet 'INST BLAH' does not exist")
|
923
923
|
end
|
924
924
|
|
925
|
-
it "
|
925
|
+
it "complains about non-existant items" do
|
926
926
|
expect { @api.get_limits("INST","HEALTH_STATUS","BLAH") }.to raise_error(RuntimeError, "Packet item 'INST HEALTH_STATUS BLAH' does not exist")
|
927
927
|
end
|
928
928
|
|
929
|
-
it "
|
930
|
-
@api.get_limits("INST","HEALTH_STATUS","TEMP1").
|
931
|
-
@api.get_limits("INST","HEALTH_STATUS","TEMP1",:TVAC).
|
929
|
+
it "gets limits for an item" do
|
930
|
+
expect(@api.get_limits("INST","HEALTH_STATUS","TEMP1")).to eql([:DEFAULT, 1, true, -80.0, -70.0, 60.0, 80.0, -20.0, 20.0])
|
931
|
+
expect(@api.get_limits("INST","HEALTH_STATUS","TEMP1",:TVAC)).to eql([:TVAC, 1, true, -80.0, -30.0, 30.0, 80.0, nil, nil])
|
932
932
|
end
|
933
933
|
end
|
934
934
|
|
935
935
|
describe "set_limits" do
|
936
|
-
it "
|
936
|
+
it "complains about non-existant targets" do
|
937
937
|
expect { @api.set_limits("BLAH","HEALTH_STATUS","TEMP1",0.0,10.0,20.0,30.0) }.to raise_error(RuntimeError, "Telemetry target 'BLAH' does not exist")
|
938
938
|
end
|
939
939
|
|
940
|
-
it "
|
940
|
+
it "complains about non-existant packets" do
|
941
941
|
expect { @api.set_limits("INST","BLAH","TEMP1",0.0,10.0,20.0,30.0) }.to raise_error(RuntimeError, "Telemetry packet 'INST BLAH' does not exist")
|
942
942
|
end
|
943
943
|
|
944
|
-
it "
|
944
|
+
it "complains about non-existant items" do
|
945
945
|
expect { @api.set_limits("INST","HEALTH_STATUS","BLAH",0.0,10.0,20.0,30.0) }.to raise_error(RuntimeError, "Packet item 'INST HEALTH_STATUS BLAH' does not exist")
|
946
946
|
end
|
947
947
|
|
948
|
-
it "
|
949
|
-
@api.set_limits("INST","HEALTH_STATUS","TEMP1",0.0,10.0,20.0,30.0).
|
950
|
-
@api.set_limits("INST","HEALTH_STATUS","TEMP1",0.0,10.0,20.0,30.0,12.0,15.0,:CUSTOM2,2,false).
|
951
|
-
@api.set_limits("INST","HEALTH_STATUS","TEMP1",0.0,10.0,20.0,30.0,12.0,15.0,:CUSTOM,1,true).
|
948
|
+
it "gets limits for an item" do
|
949
|
+
expect(@api.set_limits("INST","HEALTH_STATUS","TEMP1",0.0,10.0,20.0,30.0)).to eql([:CUSTOM, 1, true, 0.0, 10.0, 20.0, 30.0, nil, nil])
|
950
|
+
expect(@api.set_limits("INST","HEALTH_STATUS","TEMP1",0.0,10.0,20.0,30.0,12.0,15.0,:CUSTOM2,2,false)).to eql([:CUSTOM2, 2, false, 0.0, 10.0, 20.0, 30.0, 12.0, 15.0])
|
951
|
+
expect(@api.set_limits("INST","HEALTH_STATUS","TEMP1",0.0,10.0,20.0,30.0,12.0,15.0,:CUSTOM,1,true)).to eql([:CUSTOM, 1, true, 0.0, 10.0, 20.0, 30.0, 12.0, 15.0])
|
952
952
|
end
|
953
953
|
end
|
954
954
|
|
955
955
|
describe "get_limits_groups" do
|
956
|
-
it "
|
957
|
-
@api.get_limits_groups.
|
956
|
+
it "returns all the limits groups" do
|
957
|
+
expect(@api.get_limits_groups).to eql %w(FIRST SECOND)
|
958
958
|
end
|
959
959
|
end
|
960
960
|
|
961
961
|
describe "enable_limits_group" do
|
962
|
-
it "
|
962
|
+
it "complains about undefined limits groups" do
|
963
963
|
expect { @api.enable_limits_group("MINE") }.to raise_error(RuntimeError, "LIMITS_GROUP MINE undefined. Ensure your telemetry definition contains the line: LIMITS_GROUP MINE")
|
964
964
|
end
|
965
965
|
|
966
|
-
it "
|
966
|
+
it "enables limits for all items in the group" do
|
967
967
|
@api.disable_limits("INST","HEALTH_STATUS","TEMP1")
|
968
968
|
@api.disable_limits("INST","HEALTH_STATUS","TEMP3")
|
969
|
-
@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1").
|
970
|
-
@api.limits_enabled?("INST","HEALTH_STATUS","TEMP3").
|
969
|
+
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to be_falsey
|
970
|
+
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP3")).to be_falsey
|
971
971
|
@api.enable_limits_group("FIRST")
|
972
|
-
@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1").
|
973
|
-
@api.limits_enabled?("INST","HEALTH_STATUS","TEMP3").
|
972
|
+
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to be_truthy
|
973
|
+
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP3")).to be_truthy
|
974
974
|
end
|
975
975
|
end
|
976
976
|
|
977
977
|
describe "disable_limits_group" do
|
978
|
-
it "
|
978
|
+
it "complains about undefined limits groups" do
|
979
979
|
expect { @api.disable_limits_group("MINE") }.to raise_error(RuntimeError, "LIMITS_GROUP MINE undefined. Ensure your telemetry definition contains the line: LIMITS_GROUP MINE")
|
980
980
|
end
|
981
981
|
|
982
|
-
it "
|
982
|
+
it "disables limits for all items in the group" do
|
983
983
|
@api.enable_limits("INST","HEALTH_STATUS","TEMP1")
|
984
984
|
@api.enable_limits("INST","HEALTH_STATUS","TEMP3")
|
985
|
-
@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1").
|
986
|
-
@api.limits_enabled?("INST","HEALTH_STATUS","TEMP3").
|
985
|
+
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to be_truthy
|
986
|
+
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP3")).to be_truthy
|
987
987
|
@api.disable_limits_group("FIRST")
|
988
|
-
@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1").
|
989
|
-
@api.limits_enabled?("INST","HEALTH_STATUS","TEMP3").
|
988
|
+
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to be_falsey
|
989
|
+
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP3")).to be_falsey
|
990
990
|
end
|
991
991
|
end
|
992
992
|
|
993
993
|
describe "get_limits_sets, get_limits_set, set_limits_set" do
|
994
|
-
it "
|
994
|
+
it "gets and set the active limits set" do
|
995
995
|
if @api.get_limits_sets.include?(:CUSTOM)
|
996
|
-
@api.get_limits_sets.
|
996
|
+
expect(@api.get_limits_sets).to eql [:DEFAULT,:TVAC, :CUSTOM, :CUSTOM2]
|
997
997
|
else
|
998
|
-
@api.get_limits_sets.
|
998
|
+
expect(@api.get_limits_sets).to eql [:DEFAULT,:TVAC]
|
999
999
|
end
|
1000
1000
|
@api.set_limits_set("TVAC")
|
1001
|
-
@api.get_limits_set.
|
1001
|
+
expect(@api.get_limits_set).to eql "TVAC"
|
1002
1002
|
@api.set_limits_set("DEFAULT")
|
1003
|
-
@api.get_limits_set.
|
1003
|
+
expect(@api.get_limits_set).to eql "DEFAULT"
|
1004
1004
|
end
|
1005
1005
|
end
|
1006
1006
|
|
1007
1007
|
describe "get_target_list" do
|
1008
|
-
it "
|
1009
|
-
@api.get_target_list.
|
1008
|
+
it "returns all target names" do
|
1009
|
+
expect(@api.get_target_list).to eql %w(COSMOS INST META SYSTEM)
|
1010
1010
|
end
|
1011
1011
|
end
|
1012
1012
|
|
1013
1013
|
describe "subscribe_limits_events" do
|
1014
|
-
it "
|
1014
|
+
it "calls CmdTlmServer" do
|
1015
1015
|
stub_const("Cosmos::CmdTlmServer::DEFAULT_LIMITS_EVENT_QUEUE_SIZE", 100)
|
1016
1016
|
expect(CmdTlmServer).to receive(:subscribe_limits_events)
|
1017
1017
|
@api.subscribe_limits_events
|
@@ -1019,21 +1019,21 @@ module Cosmos
|
|
1019
1019
|
end
|
1020
1020
|
|
1021
1021
|
describe "unsubscribe_limits_events" do
|
1022
|
-
it "
|
1022
|
+
it "calls CmdTlmServer" do
|
1023
1023
|
expect(CmdTlmServer).to receive(:unsubscribe_limits_events)
|
1024
1024
|
@api.unsubscribe_limits_events(0)
|
1025
1025
|
end
|
1026
1026
|
end
|
1027
1027
|
|
1028
1028
|
describe "get_limits_event" do
|
1029
|
-
it "
|
1029
|
+
it "gets a limits event" do
|
1030
1030
|
expect(CmdTlmServer).to receive(:get_limits_event)
|
1031
1031
|
@api.get_limits_event(0)
|
1032
1032
|
end
|
1033
1033
|
end
|
1034
1034
|
|
1035
1035
|
describe "subscribe_packet_data" do
|
1036
|
-
it "
|
1036
|
+
it "calls CmdTlmServer" do
|
1037
1037
|
stub_const("Cosmos::CmdTlmServer::DEFAULT_PACKET_DATA_QUEUE_SIZE", 100)
|
1038
1038
|
expect(CmdTlmServer).to receive(:subscribe_packet_data)
|
1039
1039
|
@api.subscribe_packet_data([["TGT","PKT1"],["TGT","PKT2"]])
|
@@ -1041,14 +1041,14 @@ module Cosmos
|
|
1041
1041
|
end
|
1042
1042
|
|
1043
1043
|
describe "unsubscribe_packet_datas" do
|
1044
|
-
it "
|
1044
|
+
it "calls CmdTlmServer" do
|
1045
1045
|
expect(CmdTlmServer).to receive(:unsubscribe_packet_data)
|
1046
1046
|
@api.unsubscribe_packet_data(10)
|
1047
1047
|
end
|
1048
1048
|
end
|
1049
1049
|
|
1050
1050
|
describe "get_packet_data" do
|
1051
|
-
it "
|
1051
|
+
it "calls CmdTlmServer" do
|
1052
1052
|
expect(CmdTlmServer).to receive(:get_packet_data)
|
1053
1053
|
@api.get_packet_data(10)
|
1054
1054
|
end
|
@@ -1058,7 +1058,7 @@ module Cosmos
|
|
1058
1058
|
# adding any functionality. Thus we just test that they are are received
|
1059
1059
|
# by the CmdTlmServer.
|
1060
1060
|
describe "CmdTlmServer pass-throughs" do
|
1061
|
-
it "
|
1061
|
+
it "calls through to the CmdTlmServer" do
|
1062
1062
|
@api.get_interface_names
|
1063
1063
|
@api.connect_interface("INT")
|
1064
1064
|
@api.disconnect_interface("INT")
|