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
@@ -20,39 +20,39 @@ module Cosmos
|
|
20
20
|
end
|
21
21
|
|
22
22
|
describe "values=" do
|
23
|
-
it "
|
23
|
+
it "sets the values Hash" do
|
24
24
|
@l.values = {:DEFAULT => [0,1,2,3,4,5]}
|
25
|
-
@l.values[:DEFAULT].
|
25
|
+
expect(@l.values[:DEFAULT]).to eql [0,1,2,3,4,5]
|
26
26
|
end
|
27
27
|
|
28
|
-
it "
|
28
|
+
it "allows nil values" do
|
29
29
|
@l.values = nil
|
30
|
-
@l.values.
|
30
|
+
expect(@l.values).to be_nil
|
31
31
|
end
|
32
32
|
|
33
|
-
it "
|
33
|
+
it "complains about non Hash values" do
|
34
34
|
expect { @l.values = [] }.to raise_error(ArgumentError, "values must be a Hash but is a Array")
|
35
35
|
end
|
36
36
|
|
37
|
-
it "
|
37
|
+
it "complains about Hash values without a :DEFAULT key" do
|
38
38
|
expect { @l.values = {} }.to raise_error(ArgumentError, "values must be a Hash with a :DEFAULT key")
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
42
|
describe "state=" do
|
43
|
-
it "
|
43
|
+
it "sets the state to a Symbol" do
|
44
44
|
PacketItemLimits::LIMITS_STATES.each do |state|
|
45
45
|
@l.state = state
|
46
|
-
@l.state.
|
46
|
+
expect(@l.state).to eql state
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
-
it "
|
50
|
+
it "sets the state to nil" do
|
51
51
|
@l.state = nil
|
52
|
-
@l.state.
|
52
|
+
expect(@l.state).to be_nil
|
53
53
|
end
|
54
54
|
|
55
|
-
it "
|
55
|
+
it "complains about bad Symbol states" do
|
56
56
|
expect { @l.state = :ORANGE }.to raise_error(ArgumentError, "state must be one of #{PacketItemLimits::LIMITS_STATES} but is ORANGE")
|
57
57
|
expect { @l.state = "RED" }.to raise_error(ArgumentError, "state must be one of #{PacketItemLimits::LIMITS_STATES} but is RED")
|
58
58
|
expect { @l.state = 5 }.to raise_error(ArgumentError, "state must be one of #{PacketItemLimits::LIMITS_STATES} but is 5")
|
@@ -60,67 +60,67 @@ module Cosmos
|
|
60
60
|
end
|
61
61
|
|
62
62
|
describe "response=" do
|
63
|
-
it "
|
63
|
+
it "accepts LimitsResponse instances" do
|
64
64
|
r = LimitsResponse.new()
|
65
65
|
@l.response = r
|
66
|
-
(LimitsResponse === @l.response).
|
66
|
+
expect(LimitsResponse === @l.response).to be_truthy
|
67
67
|
end
|
68
68
|
|
69
|
-
it "
|
69
|
+
it "sets the response to nil" do
|
70
70
|
@l.response = nil
|
71
|
-
@l.response.
|
71
|
+
expect(@l.response).to be_nil
|
72
72
|
end
|
73
73
|
|
74
|
-
it "
|
74
|
+
it "complains about non LimitsResponse responses" do
|
75
75
|
expect { @l.response = "HI" }.to raise_error(ArgumentError, "response must be a Cosmos::LimitsResponse but is a String")
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
79
79
|
describe "persistence_setting=" do
|
80
|
-
it "
|
80
|
+
it "accepts persistence_setting as a Fixnum" do
|
81
81
|
persistence_setting = 1
|
82
82
|
@l.persistence_setting = persistence_setting
|
83
|
-
@l.persistence_setting.
|
83
|
+
expect(@l.persistence_setting).to eql persistence_setting
|
84
84
|
end
|
85
85
|
|
86
|
-
it "
|
86
|
+
it "complains about persistence_setting = nil" do
|
87
87
|
expect { @l.persistence_setting = nil}.to raise_error(ArgumentError, "persistence_setting must be a Fixnum but is a NilClass")
|
88
88
|
end
|
89
89
|
|
90
|
-
it "
|
90
|
+
it "complains about persistence_setting that aren't Fixnum" do
|
91
91
|
expect { @l.persistence_setting = 5.5}.to raise_error(ArgumentError, "persistence_setting must be a Fixnum but is a Float")
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
95
95
|
describe "persistence_count=" do
|
96
|
-
it "
|
96
|
+
it "accepts persistence_count as a String" do
|
97
97
|
persistence_count = 1
|
98
98
|
@l.persistence_count = persistence_count
|
99
|
-
@l.persistence_count.
|
99
|
+
expect(@l.persistence_count).to eql persistence_count
|
100
100
|
end
|
101
101
|
|
102
|
-
it "
|
102
|
+
it "complains about persistence_count = nil" do
|
103
103
|
expect { @l.persistence_count = nil}.to raise_error(ArgumentError, "persistence_count must be a Fixnum but is a NilClass")
|
104
104
|
end
|
105
105
|
|
106
|
-
it "
|
106
|
+
it "complains about persistence_count that aren't Fixnum" do
|
107
107
|
expect { @l.persistence_count = 5.5}.to raise_error(ArgumentError, "persistence_count must be a Fixnum but is a Float")
|
108
108
|
end
|
109
109
|
end
|
110
110
|
|
111
111
|
describe "clone" do
|
112
|
-
it "
|
112
|
+
it "duplicates the entire Limits" do
|
113
113
|
l2 = @l.clone
|
114
|
-
@l.values.
|
115
|
-
@l.response.
|
116
|
-
@l.state.
|
117
|
-
@l.persistence_count.
|
118
|
-
@l.persistence_setting.
|
114
|
+
expect(@l.values).to eql l2.values
|
115
|
+
expect(@l.response).to eql l2.response
|
116
|
+
expect(@l.state).to eql l2.state
|
117
|
+
expect(@l.persistence_count).to eql l2.persistence_count
|
118
|
+
expect(@l.persistence_setting).to eql l2.persistence_setting
|
119
119
|
end
|
120
120
|
end
|
121
121
|
|
122
122
|
describe "to_hash" do
|
123
|
-
it "
|
123
|
+
it "creates a Hash" do
|
124
124
|
@l.enabled = true
|
125
125
|
@l.values = {:DEFAULT => [0,1,2,3,4,5]}
|
126
126
|
@l.state = :RED_LOW
|
@@ -130,17 +130,17 @@ module Cosmos
|
|
130
130
|
@l.persistence_count = 2
|
131
131
|
|
132
132
|
hash = @l.to_hash
|
133
|
-
hash.keys.length.
|
134
|
-
hash.keys.
|
135
|
-
hash["enabled"].
|
136
|
-
hash["values"].
|
137
|
-
hash["state"].
|
138
|
-
hash["response"].
|
139
|
-
hash["persistence_setting"].
|
140
|
-
hash["persistence_count"].
|
133
|
+
expect(hash.keys.length).to eql 6
|
134
|
+
expect(hash.keys).to include('values','enabled','state','response','persistence_setting','persistence_count')
|
135
|
+
expect(hash["enabled"]).to be_truthy
|
136
|
+
expect(hash["values"]).to include(:DEFAULT => [0,1,2,3,4,5])
|
137
|
+
expect(hash["state"]).to eql :RED_LOW
|
138
|
+
expect(hash["response"]).to match "LimitsResponse"
|
139
|
+
expect(hash["persistence_setting"]).to eql 1
|
140
|
+
expect(hash["persistence_count"]).to eql 2
|
141
141
|
end
|
142
142
|
|
143
|
-
it "
|
143
|
+
it "creates a Hash without a response" do
|
144
144
|
@l.enabled = true
|
145
145
|
@l.values = {:DEFAULT => [0,1,2,3,4,5]}
|
146
146
|
@l.state = :RED_LOW
|
@@ -148,12 +148,12 @@ module Cosmos
|
|
148
148
|
@l.persistence_count = 2
|
149
149
|
|
150
150
|
hash = @l.to_hash
|
151
|
-
hash["enabled"].
|
152
|
-
hash["values"].
|
153
|
-
hash["state"].
|
154
|
-
hash["response"].
|
155
|
-
hash["persistence_setting"].
|
156
|
-
hash["persistence_count"].
|
151
|
+
expect(hash["enabled"]).to be_truthy
|
152
|
+
expect(hash["values"]).to include(:DEFAULT => [0,1,2,3,4,5])
|
153
|
+
expect(hash["state"]).to eql :RED_LOW
|
154
|
+
expect(hash["response"]).to be_nil
|
155
|
+
expect(hash["persistence_setting"]).to eql 1
|
156
|
+
expect(hash["persistence_count"]).to eql 2
|
157
157
|
end
|
158
158
|
end
|
159
159
|
|
@@ -21,21 +21,21 @@ module Cosmos
|
|
21
21
|
end
|
22
22
|
|
23
23
|
describe "format_string=" do
|
24
|
-
it "
|
24
|
+
it "sets the format_string" do
|
25
25
|
@pi.format_string = "%5.1f"
|
26
|
-
@pi.format_string.
|
26
|
+
expect(@pi.format_string).to eql "%5.1f"
|
27
27
|
end
|
28
28
|
|
29
|
-
it "
|
29
|
+
it "sets the format_string to nil" do
|
30
30
|
@pi.format_string = nil
|
31
|
-
@pi.format_string.
|
31
|
+
expect(@pi.format_string).to be_nil
|
32
32
|
end
|
33
33
|
|
34
|
-
it "
|
34
|
+
it "complains about non String format_strings" do
|
35
35
|
expect { @pi.format_string = 5 }.to raise_error(ArgumentError, "#{@pi.name}: format_string must be a String but is a Fixnum")
|
36
36
|
end
|
37
37
|
|
38
|
-
it "
|
38
|
+
it "complains about badly formatted format_strings" do
|
39
39
|
expect { @pi.format_string = "%" }.to raise_error(ArgumentError, "#{@pi.name}: format_string invalid '%'")
|
40
40
|
expect { @pi.format_string = "5" }.to raise_error(ArgumentError, "#{@pi.name}: format_string invalid '5'")
|
41
41
|
expect { @pi.format_string = "%Q" }.to raise_error(ArgumentError, "#{@pi.name}: format_string invalid '%Q'")
|
@@ -43,57 +43,57 @@ module Cosmos
|
|
43
43
|
end
|
44
44
|
|
45
45
|
describe "read_conversion=" do
|
46
|
-
it "
|
46
|
+
it "accepts Conversion instances" do
|
47
47
|
c = GenericConversion.new("value / 2")
|
48
48
|
@pi.read_conversion = c
|
49
|
-
(@pi.read_conversion.to_s == c.to_s).
|
49
|
+
expect(@pi.read_conversion.to_s == c.to_s).to be_truthy
|
50
50
|
end
|
51
51
|
|
52
|
-
it "
|
52
|
+
it "sets the read_conversion to nil" do
|
53
53
|
@pi.read_conversion = nil
|
54
|
-
@pi.read_conversion.
|
54
|
+
expect(@pi.read_conversion).to be_nil
|
55
55
|
end
|
56
56
|
|
57
|
-
it "
|
57
|
+
it "complains about non Conversion read_conversions" do
|
58
58
|
expect { @pi.read_conversion = "HI" }.to raise_error(ArgumentError, "#{@pi.name}: read_conversion must be a Cosmos::Conversion but is a String")
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
62
|
describe "write_conversion=" do
|
63
|
-
it "
|
63
|
+
it "accepts Conversion instances" do
|
64
64
|
c = GenericConversion.new("value / 2")
|
65
65
|
@pi.write_conversion = c
|
66
|
-
(@pi.write_conversion.to_s == c.to_s).
|
66
|
+
expect(@pi.write_conversion.to_s == c.to_s).to be_truthy
|
67
67
|
end
|
68
68
|
|
69
|
-
it "
|
69
|
+
it "sets the write_conversion to nil" do
|
70
70
|
@pi.write_conversion = nil
|
71
|
-
@pi.write_conversion.
|
71
|
+
expect(@pi.write_conversion).to be_nil
|
72
72
|
end
|
73
73
|
|
74
|
-
it "
|
74
|
+
it "complains about non Conversion write_conversions" do
|
75
75
|
expect { @pi.write_conversion = "HI" }.to raise_error(ArgumentError, "#{@pi.name}: write_conversion must be a Cosmos::Conversion but is a String")
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
79
79
|
describe "id_value=" do
|
80
|
-
it "
|
80
|
+
it "accepts id values according to data_type" do
|
81
81
|
@pi.id_value = 10
|
82
|
-
@pi.id_value.
|
82
|
+
expect(@pi.id_value).to eql 10
|
83
83
|
@pi.data_type = :FLOAT
|
84
84
|
@pi.id_value = 10.0
|
85
|
-
@pi.id_value.
|
85
|
+
expect(@pi.id_value).to eql 10.0
|
86
86
|
@pi.data_type = :STRING
|
87
87
|
@pi.id_value = "HI"
|
88
|
-
@pi.id_value.
|
88
|
+
expect(@pi.id_value).to eql "HI"
|
89
89
|
end
|
90
90
|
|
91
|
-
it "
|
91
|
+
it "sets the id_value to nil" do
|
92
92
|
@pi.id_value = nil
|
93
|
-
@pi.id_value.
|
93
|
+
expect(@pi.id_value).to be_nil
|
94
94
|
end
|
95
95
|
|
96
|
-
it "
|
96
|
+
it "complains about id_values that don't match the data_type" do
|
97
97
|
expect { @pi.id_value = "HI" }.to raise_error(ArgumentError, "#{@pi.name}: Invalid value: HI for data type: UINT")
|
98
98
|
@pi.data_type = :FLOAT
|
99
99
|
expect { @pi.id_value = "HI" }.to raise_error(ArgumentError, "#{@pi.name}: Invalid value: HI for data type: FLOAT")
|
@@ -101,97 +101,97 @@ module Cosmos
|
|
101
101
|
end
|
102
102
|
|
103
103
|
describe "states=" do
|
104
|
-
it "
|
104
|
+
it "accepts states as a Hash" do
|
105
105
|
states = {"TRUE"=>1, "FALSE"=>0}
|
106
106
|
@pi.states = states
|
107
|
-
@pi.states.
|
107
|
+
expect(@pi.states).to eql states
|
108
108
|
end
|
109
109
|
|
110
|
-
it "
|
110
|
+
it "sets the states to nil" do
|
111
111
|
@pi.states = nil
|
112
|
-
@pi.states.
|
112
|
+
expect(@pi.states).to be_nil
|
113
113
|
end
|
114
114
|
|
115
|
-
it "
|
115
|
+
it "complains about states that aren't Hashes" do
|
116
116
|
expect { @pi.states = "state" }.to raise_error(ArgumentError, "#{@pi.name}: states must be a Hash but is a String")
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
120
120
|
describe "description=" do
|
121
|
-
it "
|
121
|
+
it "accepts description as a String" do
|
122
122
|
description = "this is it"
|
123
123
|
@pi.description = description
|
124
|
-
@pi.description.
|
124
|
+
expect(@pi.description).to eql description
|
125
125
|
end
|
126
126
|
|
127
|
-
it "
|
127
|
+
it "sets the description to nil" do
|
128
128
|
@pi.description = nil
|
129
|
-
@pi.description.
|
129
|
+
expect(@pi.description).to be_nil
|
130
130
|
end
|
131
131
|
|
132
|
-
it "
|
132
|
+
it "complains about description that aren't Strings" do
|
133
133
|
expect { @pi.description = 5}.to raise_error(ArgumentError, "#{@pi.name}: description must be a String but is a Fixnum")
|
134
134
|
end
|
135
135
|
end
|
136
136
|
|
137
137
|
describe "units_full=" do
|
138
|
-
it "
|
138
|
+
it "accepts units_full as a String" do
|
139
139
|
units_full = "Volts"
|
140
140
|
@pi.units_full = units_full
|
141
|
-
@pi.units_full.
|
141
|
+
expect(@pi.units_full).to eql units_full
|
142
142
|
end
|
143
143
|
|
144
|
-
it "
|
144
|
+
it "sets the units_full to nil" do
|
145
145
|
@pi.units_full = nil
|
146
|
-
@pi.units_full.
|
146
|
+
expect(@pi.units_full).to be_nil
|
147
147
|
end
|
148
148
|
|
149
|
-
it "
|
149
|
+
it "complains about units_full that aren't Strings" do
|
150
150
|
expect { @pi.units_full = 5}.to raise_error(ArgumentError, "#{@pi.name}: units_full must be a String but is a Fixnum")
|
151
151
|
end
|
152
152
|
end
|
153
153
|
|
154
154
|
describe "units=" do
|
155
|
-
it "
|
155
|
+
it "accepts units as a String" do
|
156
156
|
units = "V"
|
157
157
|
@pi.units = units
|
158
|
-
@pi.units.
|
158
|
+
expect(@pi.units).to eql units
|
159
159
|
end
|
160
160
|
|
161
|
-
it "
|
161
|
+
it "sets the units to nil" do
|
162
162
|
@pi.units = nil
|
163
|
-
@pi.units.
|
163
|
+
expect(@pi.units).to be_nil
|
164
164
|
end
|
165
165
|
|
166
|
-
it "
|
166
|
+
it "complains about units that aren't Strings" do
|
167
167
|
expect { @pi.units = 5}.to raise_error(ArgumentError, "#{@pi.name}: units must be a String but is a Fixnum")
|
168
168
|
end
|
169
169
|
end
|
170
170
|
|
171
171
|
describe "default=" do
|
172
|
-
it "
|
172
|
+
it "accepts default according to the data_type" do
|
173
173
|
pi = PacketItem.new("test", 0, 8, :INT, :BIG_ENDIAN, 16)
|
174
174
|
pi.default = [1, -1]
|
175
|
-
pi.default.
|
175
|
+
expect(pi.default).to eql [1, -1]
|
176
176
|
pi = PacketItem.new("test", 0, 32, :UINT, :BIG_ENDIAN, nil)
|
177
177
|
pi.default = 0x01020304
|
178
|
-
pi.default.
|
178
|
+
expect(pi.default).to eql 0x01020304
|
179
179
|
pi = PacketItem.new("test", 0, 32, :FLOAT, :BIG_ENDIAN, nil)
|
180
180
|
pi.default = 5.5
|
181
|
-
pi.default.
|
181
|
+
expect(pi.default).to eql 5.5
|
182
182
|
pi = PacketItem.new("test", 0, 32, :STRING, :BIG_ENDIAN, nil)
|
183
183
|
pi.default = "HI"
|
184
|
-
pi.default.
|
184
|
+
expect(pi.default).to eql "HI"
|
185
185
|
end
|
186
186
|
|
187
|
-
it "
|
187
|
+
it "sets the default to nil" do
|
188
188
|
@pi.default = nil
|
189
|
-
@pi.default.
|
189
|
+
expect(@pi.default).to be_nil
|
190
190
|
end
|
191
191
|
end
|
192
192
|
|
193
193
|
describe "check_default_and_range_data_types" do
|
194
|
-
it "
|
194
|
+
it "complains about default not matching data_type" do
|
195
195
|
pi = PacketItem.new("test", 0, 8, :UINT, :BIG_ENDIAN, 16)
|
196
196
|
pi.default = 1
|
197
197
|
expect { pi.check_default_and_range_data_types }.to raise_error(ArgumentError, "TEST: default must be an Array but is a Fixnum")
|
@@ -227,7 +227,7 @@ module Cosmos
|
|
227
227
|
expect { pi.check_default_and_range_data_types }.to_not raise_error
|
228
228
|
end
|
229
229
|
|
230
|
-
it "
|
230
|
+
it "complains about range not matching data_type" do
|
231
231
|
pi = PacketItem.new("test", 0, 32, :UINT, :BIG_ENDIAN, nil)
|
232
232
|
pi.default = 5
|
233
233
|
pi.range = (5.5..10)
|
@@ -246,90 +246,90 @@ module Cosmos
|
|
246
246
|
end
|
247
247
|
|
248
248
|
describe "range=" do
|
249
|
-
it "
|
249
|
+
it "accepts range as a String" do
|
250
250
|
range = (0..1)
|
251
251
|
@pi.range = range
|
252
|
-
@pi.range.
|
252
|
+
expect(@pi.range).to eql range
|
253
253
|
end
|
254
254
|
|
255
|
-
it "
|
255
|
+
it "sets the range to nil" do
|
256
256
|
@pi.range = nil
|
257
|
-
@pi.range.
|
257
|
+
expect(@pi.range).to be_nil
|
258
258
|
end
|
259
259
|
|
260
|
-
it "
|
260
|
+
it "complains about ranges that aren't Ranges" do
|
261
261
|
expect { @pi.range = 5}.to raise_error(ArgumentError, "#{@pi.name}: range must be a Range but is a Fixnum")
|
262
262
|
end
|
263
263
|
end
|
264
264
|
|
265
265
|
describe "hazardous=" do
|
266
|
-
it "
|
266
|
+
it "accepts hazardous as a Hash" do
|
267
267
|
hazardous = {"TRUE"=>nil,"FALSE"=>"NO FALSE ALLOWED"}
|
268
268
|
@pi.hazardous = hazardous
|
269
|
-
@pi.hazardous.
|
270
|
-
@pi.hazardous["TRUE"].
|
271
|
-
@pi.hazardous["FALSE"].
|
269
|
+
expect(@pi.hazardous).to eql hazardous
|
270
|
+
expect(@pi.hazardous["TRUE"]).to eql hazardous["TRUE"]
|
271
|
+
expect(@pi.hazardous["FALSE"]).to eql hazardous["FALSE"]
|
272
272
|
end
|
273
273
|
|
274
|
-
it "
|
274
|
+
it "sets hazardous to nil" do
|
275
275
|
@pi.hazardous = nil
|
276
|
-
@pi.hazardous.
|
276
|
+
expect(@pi.hazardous).to be_nil
|
277
277
|
end
|
278
278
|
|
279
|
-
it "
|
279
|
+
it "complains about hazardous that aren't Hashes" do
|
280
280
|
expect { @pi.hazardous = ""}.to raise_error(ArgumentError, "#{@pi.name}: hazardous must be a Hash but is a String")
|
281
281
|
end
|
282
282
|
end
|
283
283
|
|
284
284
|
describe "state_colors=" do
|
285
|
-
it "
|
285
|
+
it "accepts state_colors as a Hash" do
|
286
286
|
state_colors = {"TRUE"=>:GREEN, "FALSE"=>:RED}
|
287
287
|
@pi.state_colors = state_colors
|
288
|
-
@pi.state_colors.
|
288
|
+
expect(@pi.state_colors).to eql state_colors
|
289
289
|
end
|
290
290
|
|
291
|
-
it "
|
291
|
+
it "sets the state_colors to nil" do
|
292
292
|
@pi.state_colors = nil
|
293
|
-
@pi.state_colors.
|
293
|
+
expect(@pi.state_colors).to be_nil
|
294
294
|
end
|
295
295
|
|
296
|
-
it "
|
296
|
+
it "complains about state_colors that aren't Hashes" do
|
297
297
|
expect { @pi.state_colors = ""}.to raise_error(ArgumentError, "#{@pi.name}: state_colors must be a Hash but is a String")
|
298
298
|
end
|
299
299
|
end
|
300
300
|
|
301
301
|
describe "limits=" do
|
302
|
-
it "
|
302
|
+
it "accepts limits as a PacketItemLimits" do
|
303
303
|
limits = PacketItemLimits.new
|
304
304
|
@pi.limits = limits
|
305
305
|
end
|
306
306
|
|
307
|
-
it "
|
307
|
+
it "sets the limits to nil" do
|
308
308
|
@pi.limits = nil
|
309
|
-
@pi.limits.
|
309
|
+
expect(@pi.limits).to be_nil
|
310
310
|
end
|
311
311
|
|
312
|
-
it "
|
312
|
+
it "complains about limits that aren't PacketItemLimits" do
|
313
313
|
expect { @pi.limits = ""}.to raise_error(ArgumentError, "#{@pi.name}: limits must be a PacketItemLimits but is a String")
|
314
314
|
end
|
315
315
|
end
|
316
316
|
|
317
317
|
describe "meta" do
|
318
|
-
it "
|
318
|
+
it "allows adding items to the meta hash" do
|
319
319
|
@pi.meta['TYPE'] = 'float32'
|
320
|
-
@pi.meta['TYPE'].
|
320
|
+
expect(@pi.meta['TYPE']).to eql 'float32'
|
321
321
|
end
|
322
322
|
end
|
323
323
|
|
324
324
|
describe "clone" do
|
325
|
-
it "
|
325
|
+
it "duplicates the entire PacketItem" do
|
326
326
|
pi2 = @pi.clone
|
327
|
-
(@pi == pi2).
|
327
|
+
expect(@pi == pi2).to be_truthy
|
328
328
|
end
|
329
329
|
end
|
330
330
|
|
331
331
|
describe "to_hash" do
|
332
|
-
it "
|
332
|
+
it "converts to a Hash" do
|
333
333
|
@pi.format_string = "%5.1f"
|
334
334
|
@pi.id_value = 10
|
335
335
|
@pi.states = {"TRUE"=>1, "FALSE"=>0}
|
@@ -346,39 +346,39 @@ module Cosmos
|
|
346
346
|
@pi.limits = PacketItemLimits.new
|
347
347
|
|
348
348
|
hash = @pi.to_hash
|
349
|
-
hash.keys.length.
|
349
|
+
expect(hash.keys.length).to eql 22
|
350
350
|
# Check the values from StructureItem
|
351
|
-
hash.keys.
|
352
|
-
hash["name"].
|
353
|
-
hash["bit_offset"].
|
354
|
-
hash["bit_size"].
|
355
|
-
hash["data_type"].
|
356
|
-
hash["endianness"].
|
357
|
-
hash["array_size"].
|
358
|
-
hash["overflow"].
|
351
|
+
expect(hash.keys).to include('name','bit_offset','bit_size','data_type','endianness','array_size','overflow')
|
352
|
+
expect(hash["name"]).to eql "TEST"
|
353
|
+
expect(hash["bit_offset"]).to eql 0
|
354
|
+
expect(hash["bit_size"]).to eql 32
|
355
|
+
expect(hash["data_type"]).to eql :UINT
|
356
|
+
expect(hash["endianness"]).to eql :BIG_ENDIAN
|
357
|
+
expect(hash["array_size"]).to be_nil
|
358
|
+
expect(hash["overflow"]).to eql :ERROR
|
359
359
|
# Check the unique PacketItem values
|
360
|
-
hash.keys.
|
361
|
-
hash["format_string"].
|
362
|
-
hash["read_conversion"].
|
363
|
-
hash["write_conversion"].
|
364
|
-
hash["id_value"].
|
365
|
-
hash["states"].
|
366
|
-
hash["description"].
|
367
|
-
hash["units_full"].
|
368
|
-
hash["units"].
|
369
|
-
hash["default"].
|
370
|
-
hash["range"].
|
371
|
-
hash["required"].
|
372
|
-
hash["hazardous"].
|
373
|
-
hash["state_colors"].
|
374
|
-
hash["limits"].
|
375
|
-
hash["meta"].
|
376
|
-
end
|
377
|
-
|
378
|
-
it "
|
360
|
+
expect(hash.keys).to include('format_string','read_conversion','write_conversion','id_value','states','description','units_full','units','default','range','required','hazardous','state_colors','limits')
|
361
|
+
expect(hash["format_string"]).to eql "%5.1f"
|
362
|
+
expect(hash["read_conversion"]).to match "value / 2"
|
363
|
+
expect(hash["write_conversion"]).to match /value \* 2/
|
364
|
+
expect(hash["id_value"]).to eql 10
|
365
|
+
expect(hash["states"]).to include("TRUE"=>1,"FALSE"=>0)
|
366
|
+
expect(hash["description"]).to eql "description"
|
367
|
+
expect(hash["units_full"]).to eql "Celcius"
|
368
|
+
expect(hash["units"]).to eql "C"
|
369
|
+
expect(hash["default"]).to eql 0
|
370
|
+
expect(hash["range"]).to eql (0..100)
|
371
|
+
expect(hash["required"]).to be_truthy
|
372
|
+
expect(hash["hazardous"]).to include("TRUE"=>nil,"FALSE"=>"NO!")
|
373
|
+
expect(hash["state_colors"]).to include("TRUE"=>:GREEN,"FALSE"=>:RED)
|
374
|
+
expect(hash["limits"]).to eql PacketItemLimits.new.to_hash
|
375
|
+
expect(hash["meta"]).to be_nil
|
376
|
+
end
|
377
|
+
|
378
|
+
it "converts to a Hash with no conversions" do
|
379
379
|
hash = @pi.to_hash
|
380
|
-
hash["read_conversion"].
|
381
|
-
hash["write_conversion"].
|
380
|
+
expect(hash["read_conversion"]).to be_nil
|
381
|
+
expect(hash["write_conversion"]).to be_nil
|
382
382
|
end
|
383
383
|
end
|
384
384
|
|