cosmos 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +48 -0
- data/.travis.yml +5 -0
- data/Gemfile +5 -0
- data/Guardfile +27 -0
- data/LICENSE.txt +879 -0
- data/Manifest.txt +1112 -0
- data/README.md +42 -0
- data/Rakefile +214 -0
- data/autohotkey/config/data/attitude.bin +0 -0
- data/autohotkey/config/data/diamond.STL +58 -0
- data/autohotkey/config/data/groundoff.gif +0 -0
- data/autohotkey/config/data/groundon.gif +0 -0
- data/autohotkey/config/data/position.bin +0 -0
- data/autohotkey/config/data/satellite.gif +0 -0
- data/autohotkey/config/data/tada.wav +0 -0
- data/autohotkey/config/system/system.txt +34 -0
- data/autohotkey/config/targets/COSMOS/cmd_tlm/cosmos_server_cmds.txt +41 -0
- data/autohotkey/config/targets/COSMOS/cmd_tlm/cosmos_server_tlm.txt +15 -0
- data/autohotkey/config/targets/COSMOS/cmd_tlm_server.txt +6 -0
- data/autohotkey/config/targets/COSMOS/target.txt +5 -0
- data/autohotkey/config/targets/INST/cmd_tlm/inst_cmds.txt +121 -0
- data/autohotkey/config/targets/INST/cmd_tlm/inst_tlm.txt +247 -0
- data/autohotkey/config/targets/INST/cmd_tlm_server.txt +5 -0
- data/autohotkey/config/targets/INST/doc/README.txt +1 -0
- data/autohotkey/config/targets/INST/lib/example_limits_response.rb +30 -0
- data/autohotkey/config/targets/INST/lib/sim_inst.rb +294 -0
- data/autohotkey/config/targets/INST/screens/adcs.txt +46 -0
- data/autohotkey/config/targets/INST/screens/array.txt +7 -0
- data/autohotkey/config/targets/INST/screens/block.txt +8 -0
- data/autohotkey/config/targets/INST/screens/commanding.txt +30 -0
- data/autohotkey/config/targets/INST/screens/graphs.txt +14 -0
- data/autohotkey/config/targets/INST/screens/ground.txt +25 -0
- data/autohotkey/config/targets/INST/screens/health_status.txt +33 -0
- data/autohotkey/config/targets/INST/screens/hs.txt +49 -0
- data/autohotkey/config/targets/INST/screens/image.txt +21 -0
- data/autohotkey/config/targets/INST/screens/latest.txt +23 -0
- data/autohotkey/config/targets/INST/screens/mech.txt +25 -0
- data/autohotkey/config/targets/INST/screens/other.txt +25 -0
- data/autohotkey/config/targets/INST/screens/params.txt +25 -0
- data/autohotkey/config/targets/INST/screens/tabs.txt +68 -0
- data/autohotkey/config/targets/INST/target.txt +27 -0
- data/autohotkey/config/targets/META/cmd_tlm/meta_cmd.txt +10 -0
- data/autohotkey/config/targets/META/cmd_tlm/meta_tlm.txt +9 -0
- data/autohotkey/config/targets/SYSTEM/cmd_tlm/limits_groups.txt +7 -0
- data/autohotkey/config/targets/SYSTEM/screens/error.txt +11 -0
- data/autohotkey/config/tools/cmd_sender/cmd_sender.txt +1 -0
- data/autohotkey/config/tools/cmd_tlm_server/cmd_tlm_server.txt +22 -0
- data/autohotkey/config/tools/data_viewer/data_viewer.txt +11 -0
- data/autohotkey/config/tools/handbook_creator/default_toc.xsl +59 -0
- data/autohotkey/config/tools/handbook_creator/handbook_creator.txt +49 -0
- data/autohotkey/config/tools/handbook_creator/templates/command_packets.html.erb +86 -0
- data/autohotkey/config/tools/handbook_creator/templates/command_toc.html.erb +38 -0
- data/autohotkey/config/tools/handbook_creator/templates/footer.html.erb +9 -0
- data/autohotkey/config/tools/handbook_creator/templates/header.html.erb +25 -0
- data/autohotkey/config/tools/handbook_creator/templates/limits_groups.html.erb +13 -0
- data/autohotkey/config/tools/handbook_creator/templates/nav.html.erb +27 -0
- data/autohotkey/config/tools/handbook_creator/templates/overview.html.erb +1 -0
- data/autohotkey/config/tools/handbook_creator/templates/pdf_cover.html.erb +23 -0
- data/autohotkey/config/tools/handbook_creator/templates/pdf_footer.html.erb +33 -0
- data/autohotkey/config/tools/handbook_creator/templates/pdf_header.html.erb +41 -0
- data/autohotkey/config/tools/handbook_creator/templates/telemetry_packets.html.erb +80 -0
- data/autohotkey/config/tools/handbook_creator/templates/telemetry_toc.html.erb +38 -0
- data/autohotkey/config/tools/handbook_creator/templates/title.html.erb +1 -0
- data/autohotkey/config/tools/launcher/launcher.txt +38 -0
- data/autohotkey/config/tools/limits_monitor/README.txt +1 -0
- data/autohotkey/config/tools/opengl_builder/error.txt +1 -0
- data/autohotkey/config/tools/script_runner/script_runner.txt +3 -0
- data/autohotkey/config/tools/table_manager/ConfigTables_def.txt +8 -0
- data/autohotkey/config/tools/table_manager/OneDimensionalTable_def.txt +19 -0
- data/autohotkey/config/tools/table_manager/TwoDimensionalTable_def.txt +248 -0
- data/autohotkey/config/tools/test_runner/test_runner.txt +8 -0
- data/autohotkey/config/tools/test_runner/test_runner2.txt +11 -0
- data/autohotkey/config/tools/test_runner/test_runner3.txt +7 -0
- data/autohotkey/config/tools/test_runner/test_runner4.txt +1 -0
- data/autohotkey/config/tools/tlm_extractor/tlm_extractor.txt +14 -0
- data/autohotkey/config/tools/tlm_extractor/tlm_extractor2.txt +9 -0
- data/autohotkey/config/tools/tlm_grapher/README.txt +1 -0
- data/autohotkey/config/tools/tlm_grapher/bad.txt +50 -0
- data/autohotkey/config/tools/tlm_grapher/temp1-4.txt +51 -0
- data/autohotkey/config/tools/tlm_grapher/test2.txt +111 -0
- data/autohotkey/config/tools/tlm_viewer/tlm_viewer.txt +24 -0
- data/autohotkey/config/tools/tlm_viewer/tlm_viewer2.txt +4 -0
- data/autohotkey/config/tools/tlm_viewer/tlm_viewer3.txt +3 -0
- data/autohotkey/lib/example_background_task.rb +42 -0
- data/autohotkey/lib/user_version.rb +3 -0
- data/autohotkey/outputs/handbooks/assets/css/bootstrap-theme.css +397 -0
- data/autohotkey/outputs/handbooks/assets/css/bootstrap-theme.min.css +7 -0
- data/autohotkey/outputs/handbooks/assets/css/bootstrap.css +7118 -0
- data/autohotkey/outputs/handbooks/assets/css/bootstrap.min.css +7 -0
- data/autohotkey/outputs/handbooks/assets/fonts/glyphicons-halflings-regular.eot +0 -0
- data/autohotkey/outputs/handbooks/assets/fonts/glyphicons-halflings-regular.svg +229 -0
- data/autohotkey/outputs/handbooks/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/autohotkey/outputs/handbooks/assets/fonts/glyphicons-halflings-regular.woff +0 -0
- data/autohotkey/outputs/handbooks/assets/js/bootstrap.js +2006 -0
- data/autohotkey/outputs/handbooks/assets/js/bootstrap.min.js +7 -0
- data/autohotkey/outputs/logs/bigtlm.bin +0 -0
- data/autohotkey/outputs/logs/cmd.bin +0 -0
- data/autohotkey/outputs/logs/tlm.bin +0 -0
- data/autohotkey/outputs/saved_config/README.txt +1 -0
- data/autohotkey/outputs/tables/README.txt +1 -0
- data/autohotkey/outputs/tmp/README.txt +1 -0
- data/autohotkey/procedures/clear_util.rb +7 -0
- data/autohotkey/procedures/collect.rb +18 -0
- data/autohotkey/procedures/collect_util.rb +14 -0
- data/autohotkey/procedures/example_test.rb +67 -0
- data/autohotkey/procedures/example_test2.rb +74 -0
- data/autohotkey/procedures/script_test.rb +17 -0
- data/autohotkey/procedures/syntax_error.rb +18 -0
- data/autohotkey/tools/CmdExtractorAHK +16 -0
- data/autohotkey/tools/CmdSender +14 -0
- data/autohotkey/tools/CmdSenderAHK +18 -0
- data/autohotkey/tools/CmdTlmServer +14 -0
- data/autohotkey/tools/CmdTlmServerAHK +28 -0
- data/autohotkey/tools/CmdTlmServerAHK2 +17 -0
- data/autohotkey/tools/DataViewer +14 -0
- data/autohotkey/tools/DataViewerAHK +17 -0
- data/autohotkey/tools/HandbookCreatorAHK +20 -0
- data/autohotkey/tools/LauncherAHK +17 -0
- data/autohotkey/tools/LimitsMonitorAHK +20 -0
- data/autohotkey/tools/OpenGLBuilderAHK +20 -0
- data/autohotkey/tools/PacketViewer +14 -0
- data/autohotkey/tools/PacketViewerAHK +18 -0
- data/autohotkey/tools/PacketViewerAHK2 +17 -0
- data/autohotkey/tools/Replay +14 -0
- data/autohotkey/tools/Replay.bat +59 -0
- data/autohotkey/tools/ReplayAHK +17 -0
- data/autohotkey/tools/ScriptRunner +14 -0
- data/autohotkey/tools/ScriptRunnerAHK +20 -0
- data/autohotkey/tools/ScriptRunnerAHK2 +17 -0
- data/autohotkey/tools/TableManager +14 -0
- data/autohotkey/tools/TableManagerAHK +30 -0
- data/autohotkey/tools/TestRunner +15 -0
- data/autohotkey/tools/TestRunnerAHK +17 -0
- data/autohotkey/tools/TestRunnerAHK2 +17 -0
- data/autohotkey/tools/TestRunnerAHK3 +17 -0
- data/autohotkey/tools/TestRunnerAHK4 +17 -0
- data/autohotkey/tools/TlmExtractor +15 -0
- data/autohotkey/tools/TlmExtractorAHK +19 -0
- data/autohotkey/tools/TlmExtractorAHK2 +16 -0
- data/autohotkey/tools/TlmExtractorAHK3 +16 -0
- data/autohotkey/tools/TlmGrapher +14 -0
- data/autohotkey/tools/TlmGrapherAHK +19 -0
- data/autohotkey/tools/TlmGrapherAHK2 +23 -0
- data/autohotkey/tools/TlmGrapherAHK3 +17 -0
- data/autohotkey/tools/TlmGrapherAHK4 +17 -0
- data/autohotkey/tools/TlmViewer +14 -0
- data/autohotkey/tools/TlmViewerAHK +28 -0
- data/autohotkey/tools/TlmViewerAHK2 +18 -0
- data/autohotkey/tools/TlmViewerAHK3 +18 -0
- data/autohotkey/tools/TlmViewerAHK4 +18 -0
- data/autohotkey/tools/TlmViewerAHK5 +18 -0
- data/autohotkey/tools/autohotkey.rb +37 -0
- data/autohotkey/tools/cmd_extractor.ahk +27 -0
- data/autohotkey/tools/cmd_sender.ahk +162 -0
- data/autohotkey/tools/cmd_tlm_server.ahk +89 -0
- data/autohotkey/tools/cmd_tlm_server2.ahk +45 -0
- data/autohotkey/tools/data_viewer.ahk +135 -0
- data/autohotkey/tools/handbook_creator.ahk +23 -0
- data/autohotkey/tools/launcher.ahk +41 -0
- data/autohotkey/tools/limits_monitor.ahk +70 -0
- data/autohotkey/tools/open_gl_builder.ahk +134 -0
- data/autohotkey/tools/packet_viewer.ahk +143 -0
- data/autohotkey/tools/packet_viewer2.ahk +9 -0
- data/autohotkey/tools/replay.ahk +98 -0
- data/autohotkey/tools/script_runner.ahk +589 -0
- data/autohotkey/tools/script_runner2.ahk +31 -0
- data/autohotkey/tools/table_manager.ahk +220 -0
- data/autohotkey/tools/test_runner.ahk +259 -0
- data/autohotkey/tools/test_runner2.ahk +52 -0
- data/autohotkey/tools/test_runner3.ahk +13 -0
- data/autohotkey/tools/tlm_extractor.ahk +272 -0
- data/autohotkey/tools/tlm_grapher.ahk +642 -0
- data/autohotkey/tools/tlm_grapher2.ahk +115 -0
- data/autohotkey/tools/tlm_grapher3.ahk +24 -0
- data/autohotkey/tools/tlm_viewer.ahk +133 -0
- data/autohotkey/tools/tlm_viewer2.ahk +49 -0
- data/autohotkey/tools/tlm_viewer4.ahk +4 -0
- data/autohotkey/tools/tlm_viewer5.ahk +20 -0
- data/autohotkey/userpath.txt +1 -0
- data/bin/cosmos +96 -0
- data/bin/cstol_converter +1166 -0
- data/bin/exchndl20.dll +0 -0
- data/bin/exchndl21.dll +0 -0
- data/bin/mgwhelp.dll +0 -0
- data/bin/rubysloc +85 -0
- data/cosmos.gemspec +98 -0
- data/data/COSMOS_64x64.bmp +0 -0
- data/data/COSMOS_64x64.ico +0 -0
- data/data/COSMOS_64x64.png +0 -0
- data/data/CheckBoxCheck.gif +0 -0
- data/data/CheckBoxEmpty.gif +0 -0
- data/data/Earthmap1024x512.gif +0 -0
- data/data/about.txt +4 -0
- data/data/add_database.png +0 -0
- data/data/add_plot.png +0 -0
- data/data/add_tab.png +0 -0
- data/data/blank.png +0 -0
- data/data/bug.png +0 -0
- data/data/checkmark.png +0 -0
- data/data/close.png +0 -0
- data/data/cmd_extractor.png +0 -0
- data/data/cmd_sender.png +0 -0
- data/data/copy.png +0 -0
- data/data/cosmos.xcf +0 -0
- data/data/cosmos_word.gif +0 -0
- data/data/crc.txt +305 -0
- data/data/cts.png +0 -0
- data/data/cut.png +0 -0
- data/data/data_viewer.png +0 -0
- data/data/delete_database.png +0 -0
- data/data/delete_plot.png +0 -0
- data/data/delete_tab.png +0 -0
- data/data/diamond.STL +58 -0
- data/data/disconnected.png +0 -0
- data/data/edit.png +0 -0
- data/data/edit_database.png +0 -0
- data/data/edit_plot.png +0 -0
- data/data/edit_tab.png +0 -0
- data/data/end-26.png +0 -0
- data/data/fast_forward-26.png +0 -0
- data/data/file.png +0 -0
- data/data/handbook_creator.png +0 -0
- data/data/help.png +0 -0
- data/data/html-32.png +0 -0
- data/data/launcher.png +0 -0
- data/data/legal.gif +0 -0
- data/data/legal.txt +9 -0
- data/data/limits_monitor.png +0 -0
- data/data/moonmap1k.gif +0 -0
- data/data/multi.png +0 -0
- data/data/open.png +0 -0
- data/data/open_in_browser-32.png +0 -0
- data/data/opengl_builder.png +0 -0
- data/data/packet_viewer.png +0 -0
- data/data/pdf-32.png +0 -0
- data/data/play-26.png +0 -0
- data/data/redo.png +0 -0
- data/data/replay.png +0 -0
- data/data/reverse-play-26.png +0 -0
- data/data/rewind-26.png +0 -0
- data/data/running.png +0 -0
- data/data/save.png +0 -0
- data/data/save_as.png +0 -0
- data/data/screenshot.png +0 -0
- data/data/script_runner.png +0 -0
- data/data/search-14.png +0 -0
- data/data/search.png +0 -0
- data/data/send_file.png +0 -0
- data/data/skip_to_start-26.png +0 -0
- data/data/spinner.gif +0 -0
- data/data/splash.gif +0 -0
- data/data/stop-26.png +0 -0
- data/data/table_manager.png +0 -0
- data/data/test_runner.png +0 -0
- data/data/tlm_extractor.png +0 -0
- data/data/tlm_grapher.png +0 -0
- data/data/tlm_viewer.png +0 -0
- data/data/undo.png +0 -0
- data/demo/Gemfile +5 -0
- data/demo/Launcher +15 -0
- data/demo/Launcher.bat +59 -0
- data/demo/Rakefile +61 -0
- data/demo/config/data/attitude.bin +0 -0
- data/demo/config/data/crc.txt +206 -0
- data/demo/config/data/diamond.STL +58 -0
- data/demo/config/data/groundoff.gif +0 -0
- data/demo/config/data/groundon.gif +0 -0
- data/demo/config/data/hselectoff.gif +0 -0
- data/demo/config/data/hselecton.gif +0 -0
- data/demo/config/data/hswitchoff.gif +0 -0
- data/demo/config/data/hswitchon.gif +0 -0
- data/demo/config/data/meta_init.txt +4 -0
- data/demo/config/data/position.bin +0 -0
- data/demo/config/data/poweroff.gif +0 -0
- data/demo/config/data/poweron.gif +0 -0
- data/demo/config/data/satellite.gif +0 -0
- data/demo/config/data/tada.wav +0 -0
- data/demo/config/data/vswitchoff.gif +0 -0
- data/demo/config/data/vswitchon.gif +0 -0
- data/demo/config/system/system.txt +34 -0
- data/demo/config/system/system2.txt +33 -0
- data/demo/config/targets/COSMOS/cmd_tlm/cosmos_server_cmds.txt +41 -0
- data/demo/config/targets/COSMOS/cmd_tlm/cosmos_server_tlm.txt +15 -0
- data/demo/config/targets/COSMOS/cmd_tlm_server.txt +6 -0
- data/demo/config/targets/COSMOS/screens/limits_change.txt +20 -0
- data/demo/config/targets/COSMOS/screens/version.txt +19 -0
- data/demo/config/targets/COSMOS/target.txt +11 -0
- data/demo/config/targets/EXAMPLE/cmd_tlm/example_cmds.txt +2 -0
- data/demo/config/targets/EXAMPLE/cmd_tlm/example_tlm.txt +3 -0
- data/demo/config/targets/EXAMPLE/cmd_tlm_server.txt +6 -0
- data/demo/config/targets/EXAMPLE/lib/example_interface.rb +22 -0
- data/demo/config/targets/EXAMPLE/target.txt +7 -0
- data/demo/config/targets/INST/cmd_tlm/inst_cmds.txt +121 -0
- data/demo/config/targets/INST/cmd_tlm/inst_tlm.txt +247 -0
- data/demo/config/targets/INST/cmd_tlm_server.txt +5 -0
- data/demo/config/targets/INST/doc/README.txt +1 -0
- data/demo/config/targets/INST/lib/example_limits_response.rb +30 -0
- data/demo/config/targets/INST/lib/sim_inst.rb +294 -0
- data/demo/config/targets/INST/screens/adcs.txt +46 -0
- data/demo/config/targets/INST/screens/array.txt +15 -0
- data/demo/config/targets/INST/screens/block.txt +8 -0
- data/demo/config/targets/INST/screens/commanding.txt +30 -0
- data/demo/config/targets/INST/screens/graphs.txt +14 -0
- data/demo/config/targets/INST/screens/ground.txt +25 -0
- data/demo/config/targets/INST/screens/hs.txt +44 -0
- data/demo/config/targets/INST/screens/latest.txt +23 -0
- data/demo/config/targets/INST/screens/other.txt +29 -0
- data/demo/config/targets/INST/screens/tabs.txt +70 -0
- data/demo/config/targets/INST/target.txt +33 -0
- data/demo/config/targets/META/cmd_tlm/meta_cmd.txt +10 -0
- data/demo/config/targets/META/cmd_tlm/meta_tlm.txt +13 -0
- data/demo/config/targets/SYSTEM/cmd_tlm/limits_groups.txt +7 -0
- data/demo/config/targets/SYSTEM/cmd_tlm/override.txt +29 -0
- data/demo/config/targets/SYSTEM/screens/status.txt +12 -0
- data/demo/config/targets/TEMPLATED/cmd_tlm/templated_cmds.txt +12 -0
- data/demo/config/targets/TEMPLATED/cmd_tlm/templated_tlm.txt +3 -0
- data/demo/config/targets/TEMPLATED/cmd_tlm_server.txt +6 -0
- data/demo/config/targets/TEMPLATED/lib/templated_interface.rb +48 -0
- data/demo/config/targets/TEMPLATED/target.txt +6 -0
- data/demo/config/tools/cmd_tlm_server/cmd_tlm_server.txt +33 -0
- data/demo/config/tools/cmd_tlm_server/cmd_tlm_server2.txt +29 -0
- data/demo/config/tools/data_viewer/data_viewer.txt +11 -0
- data/demo/config/tools/handbook_creator/default_toc.xsl +59 -0
- data/demo/config/tools/handbook_creator/handbook_creator.txt +66 -0
- data/demo/config/tools/handbook_creator/templates/command_packets.html.erb +86 -0
- data/demo/config/tools/handbook_creator/templates/command_toc.html.erb +38 -0
- data/demo/config/tools/handbook_creator/templates/footer.html.erb +9 -0
- data/demo/config/tools/handbook_creator/templates/header.html.erb +25 -0
- data/demo/config/tools/handbook_creator/templates/limits_groups.html.erb +13 -0
- data/demo/config/tools/handbook_creator/templates/nav.html.erb +27 -0
- data/demo/config/tools/handbook_creator/templates/overview.html.erb +1 -0
- data/demo/config/tools/handbook_creator/templates/pdf_cover.html.erb +23 -0
- data/demo/config/tools/handbook_creator/templates/pdf_footer.html.erb +33 -0
- data/demo/config/tools/handbook_creator/templates/pdf_header.html.erb +41 -0
- data/demo/config/tools/handbook_creator/templates/telemetry_packets.html.erb +80 -0
- data/demo/config/tools/handbook_creator/templates/telemetry_toc.html.erb +38 -0
- data/demo/config/tools/handbook_creator/templates/title.html.erb +1 -0
- data/demo/config/tools/launcher/launcher.txt +45 -0
- data/demo/config/tools/launcher/launcher2.txt +45 -0
- data/demo/config/tools/limits_monitor/README.txt +1 -0
- data/demo/config/tools/opengl_builder/README.txt +1 -0
- data/demo/config/tools/script_runner/script_runner.txt +3 -0
- data/demo/config/tools/table_manager/ConfigTables_def.txt +8 -0
- data/demo/config/tools/table_manager/ExampleTableDefinition.txt +24 -0
- data/demo/config/tools/table_manager/MCConfigurationTable_fsw1_def.txt +25 -0
- data/demo/config/tools/table_manager/MCConfigurationTable_fsw2_def.txt +25 -0
- data/demo/config/tools/table_manager/PPSSelectionTable_def.txt +8 -0
- data/demo/config/tools/table_manager/TLMMonitoringTable_def.txt +248 -0
- data/demo/config/tools/test_runner/test_runner.txt +17 -0
- data/demo/config/tools/tlm_extractor/tlm_extractor.txt +13 -0
- data/demo/config/tools/tlm_extractor/tlm_extractor2.txt +2 -0
- data/demo/config/tools/tlm_extractor/tlm_extractor3.txt +2 -0
- data/demo/config/tools/tlm_extractor/tlm_extractor4.txt +2 -0
- data/demo/config/tools/tlm_grapher/README.txt +1 -0
- data/demo/config/tools/tlm_viewer/tlm_viewer.txt +41 -0
- data/demo/lib/example_background_task.rb +52 -0
- data/demo/lib/example_target.rb +108 -0
- data/demo/lib/scpi_target.rb +74 -0
- data/demo/lib/user_version.rb +3 -0
- data/demo/outputs/handbooks/assets/css/bootstrap-theme.css +397 -0
- data/demo/outputs/handbooks/assets/css/bootstrap-theme.min.css +7 -0
- data/demo/outputs/handbooks/assets/css/bootstrap.css +7118 -0
- data/demo/outputs/handbooks/assets/css/bootstrap.min.css +7 -0
- data/demo/outputs/handbooks/assets/fonts/glyphicons-halflings-regular.eot +0 -0
- data/demo/outputs/handbooks/assets/fonts/glyphicons-halflings-regular.svg +229 -0
- data/demo/outputs/handbooks/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/demo/outputs/handbooks/assets/fonts/glyphicons-halflings-regular.woff +0 -0
- data/demo/outputs/handbooks/assets/img/ball_logo.bmp +0 -0
- data/demo/outputs/handbooks/assets/img/ball_logo.gif +0 -0
- data/demo/outputs/handbooks/assets/img/ball_logo.jpg +0 -0
- data/demo/outputs/handbooks/assets/js/bootstrap.js +2006 -0
- data/demo/outputs/handbooks/assets/js/bootstrap.min.js +7 -0
- data/demo/outputs/handbooks/assets/js/html5shiv.js +8 -0
- data/demo/outputs/handbooks/assets/js/jquery-1.10.2.min.js +6 -0
- data/demo/outputs/handbooks/assets/js/respond.min.js +6 -0
- data/demo/outputs/logs/README.txt +1 -0
- data/demo/outputs/saved_config/README.txt +1 -0
- data/demo/outputs/tables/README.txt +1 -0
- data/demo/outputs/tmp/README.txt +1 -0
- data/demo/procedures/checks.rb +11 -0
- data/demo/procedures/clear_util.rb +7 -0
- data/demo/procedures/collect.rb +18 -0
- data/demo/procedures/collect_util.rb +14 -0
- data/demo/procedures/cosmos_api_test.rb +293 -0
- data/demo/procedures/disconnect.rb +29 -0
- data/demo/procedures/example_test.rb +182 -0
- data/demo/procedures/plot_test.rb +8 -0
- data/demo/procedures/run_example_test.rb +3 -0
- data/demo/procedures/test.rb +51 -0
- data/demo/tools/CmdExtractor +15 -0
- data/demo/tools/CmdExtractor.bat +59 -0
- data/demo/tools/CmdSender +15 -0
- data/demo/tools/CmdSender.bat +59 -0
- data/demo/tools/CmdTlmServer +15 -0
- data/demo/tools/CmdTlmServer.bat +59 -0
- data/demo/tools/DataViewer +15 -0
- data/demo/tools/DataViewer.bat +59 -0
- data/demo/tools/ExampleTarget +15 -0
- data/demo/tools/ExampleTarget.bat +59 -0
- data/demo/tools/HandbookCreator +15 -0
- data/demo/tools/HandbookCreator.bat +61 -0
- data/demo/tools/Launcher +15 -0
- data/demo/tools/Launcher.bat +59 -0
- data/demo/tools/LimitsMonitor +15 -0
- data/demo/tools/LimitsMonitor.bat +59 -0
- data/demo/tools/OpenGLBuilder +15 -0
- data/demo/tools/OpenGLBuilder.bat +59 -0
- data/demo/tools/PacketViewer +15 -0
- data/demo/tools/PacketViewer.bat +59 -0
- data/demo/tools/Replay +15 -0
- data/demo/tools/Replay.bat +59 -0
- data/demo/tools/ScpiTarget +15 -0
- data/demo/tools/ScpiTarget.bat +59 -0
- data/demo/tools/ScriptRunner +15 -0
- data/demo/tools/ScriptRunner.bat +59 -0
- data/demo/tools/TableManager +15 -0
- data/demo/tools/TableManager.bat +59 -0
- data/demo/tools/TestRunner +15 -0
- data/demo/tools/TestRunner.bat +59 -0
- data/demo/tools/TlmExtractor +15 -0
- data/demo/tools/TlmExtractor.bat +59 -0
- data/demo/tools/TlmGrapher +15 -0
- data/demo/tools/TlmGrapher.bat +59 -0
- data/demo/tools/TlmViewer +15 -0
- data/demo/tools/TlmViewer.bat +59 -0
- data/demo/tools/mac/CmdExtractor.app/Contents/Info.plist +38 -0
- data/demo/tools/mac/CmdExtractor.app/Contents/MacOS/CmdExtractor.rb +15 -0
- data/demo/tools/mac/CmdExtractor.app/Contents/MacOS/main.sh +6 -0
- data/demo/tools/mac/CmdExtractor.app/Contents/Resources/appIcon.icns +0 -0
- data/demo/tools/mac/CmdSender.app/Contents/Info.plist +38 -0
- data/demo/tools/mac/CmdSender.app/Contents/MacOS/CmdSender.rb +15 -0
- data/demo/tools/mac/CmdSender.app/Contents/MacOS/main.sh +6 -0
- data/demo/tools/mac/CmdSender.app/Contents/Resources/appIcon.icns +0 -0
- data/demo/tools/mac/CmdTlmServer.app/Contents/Info.plist +38 -0
- data/demo/tools/mac/CmdTlmServer.app/Contents/MacOS/CmdTlmServer.rb +15 -0
- data/demo/tools/mac/CmdTlmServer.app/Contents/MacOS/main.sh +6 -0
- data/demo/tools/mac/CmdTlmServer.app/Contents/Resources/appIcon.icns +0 -0
- data/demo/tools/mac/DataViewer.app/Contents/Info.plist +38 -0
- data/demo/tools/mac/DataViewer.app/Contents/MacOS/DataViewer.rb +15 -0
- data/demo/tools/mac/DataViewer.app/Contents/MacOS/main.sh +6 -0
- data/demo/tools/mac/DataViewer.app/Contents/Resources/appIcon.icns +0 -0
- data/demo/tools/mac/HandbookCreator.app/Contents/Info.plist +38 -0
- data/demo/tools/mac/HandbookCreator.app/Contents/MacOS/HandbookCreator.rb +15 -0
- data/demo/tools/mac/HandbookCreator.app/Contents/MacOS/main.sh +6 -0
- data/demo/tools/mac/HandbookCreator.app/Contents/Resources/appIcon.icns +0 -0
- data/demo/tools/mac/Launcher.app/Contents/Info.plist +38 -0
- data/demo/tools/mac/Launcher.app/Contents/MacOS/Launcher.rb +15 -0
- data/demo/tools/mac/Launcher.app/Contents/MacOS/main.sh +6 -0
- data/demo/tools/mac/Launcher.app/Contents/Resources/appIcon.icns +0 -0
- data/demo/tools/mac/LimitsMonitor.app/Contents/Info.plist +38 -0
- data/demo/tools/mac/LimitsMonitor.app/Contents/MacOS/LimitsMonitor.rb +15 -0
- data/demo/tools/mac/LimitsMonitor.app/Contents/MacOS/main.sh +6 -0
- data/demo/tools/mac/LimitsMonitor.app/Contents/Resources/appIcon.icns +0 -0
- data/demo/tools/mac/OpenGLBuilder.app/Contents/Info.plist +38 -0
- data/demo/tools/mac/OpenGLBuilder.app/Contents/MacOS/OpenGLBuilder.rb +15 -0
- data/demo/tools/mac/OpenGLBuilder.app/Contents/MacOS/main.sh +6 -0
- data/demo/tools/mac/OpenGLBuilder.app/Contents/Resources/appIcon.icns +0 -0
- data/demo/tools/mac/PacketViewer.app/Contents/Info.plist +38 -0
- data/demo/tools/mac/PacketViewer.app/Contents/MacOS/PacketViewer.rb +15 -0
- data/demo/tools/mac/PacketViewer.app/Contents/MacOS/main.sh +6 -0
- data/demo/tools/mac/PacketViewer.app/Contents/Resources/appIcon.icns +0 -0
- data/demo/tools/mac/Replay.app/Contents/Info.plist +38 -0
- data/demo/tools/mac/Replay.app/Contents/MacOS/Replay.rb +15 -0
- data/demo/tools/mac/Replay.app/Contents/MacOS/main.sh +6 -0
- data/demo/tools/mac/Replay.app/Contents/Resources/appIcon.icns +0 -0
- data/demo/tools/mac/ScriptRunner.app/Contents/Info.plist +38 -0
- data/demo/tools/mac/ScriptRunner.app/Contents/MacOS/ScriptRunner.rb +15 -0
- data/demo/tools/mac/ScriptRunner.app/Contents/MacOS/main.sh +6 -0
- data/demo/tools/mac/ScriptRunner.app/Contents/Resources/appIcon.icns +0 -0
- data/demo/tools/mac/TableManager.app/Contents/Info.plist +38 -0
- data/demo/tools/mac/TableManager.app/Contents/MacOS/TableManager.rb +15 -0
- data/demo/tools/mac/TableManager.app/Contents/MacOS/main.sh +6 -0
- data/demo/tools/mac/TableManager.app/Contents/Resources/appIcon.icns +0 -0
- data/demo/tools/mac/TestRunner.app/Contents/Info.plist +38 -0
- data/demo/tools/mac/TestRunner.app/Contents/MacOS/TestRunner.rb +15 -0
- data/demo/tools/mac/TestRunner.app/Contents/MacOS/main.sh +6 -0
- data/demo/tools/mac/TestRunner.app/Contents/Resources/appIcon.icns +0 -0
- data/demo/tools/mac/TlmExtractor.app/Contents/Info.plist +38 -0
- data/demo/tools/mac/TlmExtractor.app/Contents/MacOS/TlmExtractor.rb +15 -0
- data/demo/tools/mac/TlmExtractor.app/Contents/MacOS/main.sh +6 -0
- data/demo/tools/mac/TlmExtractor.app/Contents/Resources/appIcon.icns +0 -0
- data/demo/tools/mac/TlmGrapher.app/Contents/Info.plist +38 -0
- data/demo/tools/mac/TlmGrapher.app/Contents/MacOS/TlmGrapher.rb +15 -0
- data/demo/tools/mac/TlmGrapher.app/Contents/MacOS/main.sh +6 -0
- data/demo/tools/mac/TlmGrapher.app/Contents/Resources/appIcon.icns +0 -0
- data/demo/tools/mac/TlmViewer.app/Contents/Info.plist +38 -0
- data/demo/tools/mac/TlmViewer.app/Contents/MacOS/TlmViewer.rb +15 -0
- data/demo/tools/mac/TlmViewer.app/Contents/MacOS/main.sh +6 -0
- data/demo/tools/mac/TlmViewer.app/Contents/Resources/appIcon.icns +0 -0
- data/demo/userpath.txt +1 -0
- data/ext/cosmos/ext/array/array.c +111 -0
- data/ext/cosmos/ext/array/extconf.rb +13 -0
- data/ext/cosmos/ext/buffered_file/buffered_file.c +167 -0
- data/ext/cosmos/ext/buffered_file/extconf.rb +13 -0
- data/ext/cosmos/ext/config_parser/config_parser.c +237 -0
- data/ext/cosmos/ext/config_parser/extconf.rb +13 -0
- data/ext/cosmos/ext/cosmos_io/cosmos_io.c +117 -0
- data/ext/cosmos/ext/cosmos_io/extconf.rb +13 -0
- data/ext/cosmos/ext/crc/crc.c +341 -0
- data/ext/cosmos/ext/crc/extconf.rb +13 -0
- data/ext/cosmos/ext/line_graph/extconf.rb +13 -0
- data/ext/cosmos/ext/line_graph/line_graph.c +501 -0
- data/ext/cosmos/ext/low_fragmentation_array/extconf.rb +13 -0
- data/ext/cosmos/ext/low_fragmentation_array/low_fragmentation_array.c +261 -0
- data/ext/cosmos/ext/packet/extconf.rb +13 -0
- data/ext/cosmos/ext/packet/packet.c +339 -0
- data/ext/cosmos/ext/platform/extconf.rb +13 -0
- data/ext/cosmos/ext/platform/platform.c +82 -0
- data/ext/cosmos/ext/polynomial_conversion/extconf.rb +13 -0
- data/ext/cosmos/ext/polynomial_conversion/polynomial_conversion.c +73 -0
- data/ext/cosmos/ext/string/extconf.rb +13 -0
- data/ext/cosmos/ext/string/string.c +49 -0
- data/ext/cosmos/ext/structure/structure.c +894 -0
- data/ext/cosmos/ext/tabbed_plots_config/extconf.rb +13 -0
- data/ext/cosmos/ext/tabbed_plots_config/tabbed_plots_config.c +51 -0
- data/ext/cosmos/ext/telemetry/extconf.rb +13 -0
- data/ext/cosmos/ext/telemetry/telemetry.c +306 -0
- data/install/Gemfile +5 -0
- data/install/Launcher +14 -0
- data/install/Launcher.bat +59 -0
- data/install/Rakefile +61 -0
- data/install/config/data/README.txt +1 -0
- data/install/config/data/crc.txt +133 -0
- data/install/config/system/system.txt +29 -0
- data/install/config/targets/COSMOS/cmd_tlm/cosmos_server_cmds.txt +41 -0
- data/install/config/targets/COSMOS/cmd_tlm/cosmos_server_tlm.txt +15 -0
- data/install/config/targets/COSMOS/cmd_tlm_server.txt +6 -0
- data/install/config/targets/COSMOS/screens/limits_change.txt +20 -0
- data/install/config/targets/COSMOS/screens/version.txt +19 -0
- data/install/config/targets/COSMOS/target.txt +9 -0
- data/install/config/targets/SYSTEM/README.txt +1 -0
- data/install/config/tools/cmd_tlm_server/cmd_tlm_server.txt +2 -0
- data/install/config/tools/data_viewer/data_viewer.txt +4 -0
- data/install/config/tools/handbook_creator/default_toc.xsl +59 -0
- data/install/config/tools/handbook_creator/handbook_creator.txt +49 -0
- data/install/config/tools/handbook_creator/templates/command_packets.html.erb +86 -0
- data/install/config/tools/handbook_creator/templates/command_toc.html.erb +38 -0
- data/install/config/tools/handbook_creator/templates/footer.html.erb +9 -0
- data/install/config/tools/handbook_creator/templates/header.html.erb +25 -0
- data/install/config/tools/handbook_creator/templates/limits_groups.html.erb +13 -0
- data/install/config/tools/handbook_creator/templates/nav.html.erb +27 -0
- data/install/config/tools/handbook_creator/templates/overview.html.erb +1 -0
- data/install/config/tools/handbook_creator/templates/pdf_cover.html.erb +23 -0
- data/install/config/tools/handbook_creator/templates/pdf_footer.html.erb +33 -0
- data/install/config/tools/handbook_creator/templates/pdf_header.html.erb +41 -0
- data/install/config/tools/handbook_creator/templates/telemetry_packets.html.erb +80 -0
- data/install/config/tools/handbook_creator/templates/telemetry_toc.html.erb +38 -0
- data/install/config/tools/handbook_creator/templates/title.html.erb +1 -0
- data/install/config/tools/launcher/launcher.txt +39 -0
- data/install/config/tools/limits_monitor/README.txt +1 -0
- data/install/config/tools/opengl_builder/README.txt +1 -0
- data/install/config/tools/script_runner/script_runner.txt +3 -0
- data/install/config/tools/table_manager/README.txt +1 -0
- data/install/config/tools/test_runner/test_runner.txt +8 -0
- data/install/config/tools/tlm_extractor/README.txt +1 -0
- data/install/config/tools/tlm_grapher/README.txt +1 -0
- data/install/config/tools/tlm_viewer/tlm_viewer.txt +5 -0
- data/install/lib/user_version.rb +3 -0
- data/install/outputs/handbooks/assets/css/bootstrap-theme.css +397 -0
- data/install/outputs/handbooks/assets/css/bootstrap-theme.min.css +7 -0
- data/install/outputs/handbooks/assets/css/bootstrap.css +7118 -0
- data/install/outputs/handbooks/assets/css/bootstrap.min.css +7 -0
- data/install/outputs/handbooks/assets/fonts/glyphicons-halflings-regular.eot +0 -0
- data/install/outputs/handbooks/assets/fonts/glyphicons-halflings-regular.svg +229 -0
- data/install/outputs/handbooks/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/install/outputs/handbooks/assets/fonts/glyphicons-halflings-regular.woff +0 -0
- data/install/outputs/handbooks/assets/img/ball_logo.bmp +0 -0
- data/install/outputs/handbooks/assets/img/ball_logo.gif +0 -0
- data/install/outputs/handbooks/assets/img/ball_logo.jpg +0 -0
- data/install/outputs/handbooks/assets/js/bootstrap.js +2006 -0
- data/install/outputs/handbooks/assets/js/bootstrap.min.js +7 -0
- data/install/outputs/handbooks/assets/js/html5shiv.js +8 -0
- data/install/outputs/handbooks/assets/js/jquery-1.10.2.min.js +6 -0
- data/install/outputs/handbooks/assets/js/respond.min.js +6 -0
- data/install/outputs/logs/README.txt +1 -0
- data/install/outputs/saved_config/README.txt +1 -0
- data/install/outputs/tables/README.txt +1 -0
- data/install/outputs/tmp/README.txt +1 -0
- data/install/procedures/README.txt +1 -0
- data/install/tools/CmdExtractor +15 -0
- data/install/tools/CmdExtractor.bat +59 -0
- data/install/tools/CmdSender +15 -0
- data/install/tools/CmdSender.bat +59 -0
- data/install/tools/CmdTlmServer +15 -0
- data/install/tools/CmdTlmServer.bat +59 -0
- data/install/tools/DataViewer +15 -0
- data/install/tools/DataViewer.bat +59 -0
- data/install/tools/HandbookCreator +15 -0
- data/install/tools/HandbookCreator.bat +61 -0
- data/install/tools/Launcher +15 -0
- data/install/tools/Launcher.bat +59 -0
- data/install/tools/LimitsMonitor +15 -0
- data/install/tools/LimitsMonitor.bat +59 -0
- data/install/tools/OpenGLBuilder +15 -0
- data/install/tools/OpenGLBuilder.bat +59 -0
- data/install/tools/PacketViewer +15 -0
- data/install/tools/PacketViewer.bat +59 -0
- data/install/tools/Replay +15 -0
- data/install/tools/Replay.bat +59 -0
- data/install/tools/ScriptRunner +15 -0
- data/install/tools/ScriptRunner.bat +59 -0
- data/install/tools/TableManager +15 -0
- data/install/tools/TableManager.bat +59 -0
- data/install/tools/TestRunner +15 -0
- data/install/tools/TestRunner.bat +59 -0
- data/install/tools/TlmExtractor +15 -0
- data/install/tools/TlmExtractor.bat +59 -0
- data/install/tools/TlmGrapher +15 -0
- data/install/tools/TlmGrapher.bat +59 -0
- data/install/tools/TlmViewer +15 -0
- data/install/tools/TlmViewer.bat +59 -0
- data/install/tools/mac/CmdExtractor.app/Contents/Info.plist +38 -0
- data/install/tools/mac/CmdExtractor.app/Contents/MacOS/CmdExtractor.rb +15 -0
- data/install/tools/mac/CmdExtractor.app/Contents/MacOS/main.sh +6 -0
- data/install/tools/mac/CmdExtractor.app/Contents/Resources/appIcon.icns +0 -0
- data/install/tools/mac/CmdSender.app/Contents/Info.plist +38 -0
- data/install/tools/mac/CmdSender.app/Contents/MacOS/CmdSender.rb +15 -0
- data/install/tools/mac/CmdSender.app/Contents/MacOS/main.sh +6 -0
- data/install/tools/mac/CmdSender.app/Contents/Resources/appIcon.icns +0 -0
- data/install/tools/mac/CmdTlmServer.app/Contents/Info.plist +38 -0
- data/install/tools/mac/CmdTlmServer.app/Contents/MacOS/CmdTlmServer.rb +15 -0
- data/install/tools/mac/CmdTlmServer.app/Contents/MacOS/main.sh +6 -0
- data/install/tools/mac/CmdTlmServer.app/Contents/Resources/appIcon.icns +0 -0
- data/install/tools/mac/DataViewer.app/Contents/Info.plist +38 -0
- data/install/tools/mac/DataViewer.app/Contents/MacOS/DataViewer.rb +15 -0
- data/install/tools/mac/DataViewer.app/Contents/MacOS/main.sh +6 -0
- data/install/tools/mac/DataViewer.app/Contents/Resources/appIcon.icns +0 -0
- data/install/tools/mac/HandbookCreator.app/Contents/Info.plist +38 -0
- data/install/tools/mac/HandbookCreator.app/Contents/MacOS/HandbookCreator.rb +15 -0
- data/install/tools/mac/HandbookCreator.app/Contents/MacOS/main.sh +6 -0
- data/install/tools/mac/HandbookCreator.app/Contents/Resources/appIcon.icns +0 -0
- data/install/tools/mac/Launcher.app/Contents/Info.plist +38 -0
- data/install/tools/mac/Launcher.app/Contents/MacOS/Launcher.rb +15 -0
- data/install/tools/mac/Launcher.app/Contents/MacOS/main.sh +6 -0
- data/install/tools/mac/Launcher.app/Contents/Resources/appIcon.icns +0 -0
- data/install/tools/mac/LimitsMonitor.app/Contents/Info.plist +38 -0
- data/install/tools/mac/LimitsMonitor.app/Contents/MacOS/LimitsMonitor.rb +15 -0
- data/install/tools/mac/LimitsMonitor.app/Contents/MacOS/main.sh +6 -0
- data/install/tools/mac/LimitsMonitor.app/Contents/Resources/appIcon.icns +0 -0
- data/install/tools/mac/OpenGLBuilder.app/Contents/Info.plist +38 -0
- data/install/tools/mac/OpenGLBuilder.app/Contents/MacOS/OpenGLBuilder.rb +15 -0
- data/install/tools/mac/OpenGLBuilder.app/Contents/MacOS/main.sh +6 -0
- data/install/tools/mac/OpenGLBuilder.app/Contents/Resources/appIcon.icns +0 -0
- data/install/tools/mac/PacketViewer.app/Contents/Info.plist +38 -0
- data/install/tools/mac/PacketViewer.app/Contents/MacOS/PacketViewer.rb +15 -0
- data/install/tools/mac/PacketViewer.app/Contents/MacOS/main.sh +6 -0
- data/install/tools/mac/PacketViewer.app/Contents/Resources/appIcon.icns +0 -0
- data/install/tools/mac/Replay.app/Contents/Info.plist +38 -0
- data/install/tools/mac/Replay.app/Contents/MacOS/Replay.rb +15 -0
- data/install/tools/mac/Replay.app/Contents/MacOS/main.sh +6 -0
- data/install/tools/mac/Replay.app/Contents/Resources/appIcon.icns +0 -0
- data/install/tools/mac/ScriptRunner.app/Contents/Info.plist +38 -0
- data/install/tools/mac/ScriptRunner.app/Contents/MacOS/ScriptRunner.rb +15 -0
- data/install/tools/mac/ScriptRunner.app/Contents/MacOS/main.sh +6 -0
- data/install/tools/mac/ScriptRunner.app/Contents/Resources/appIcon.icns +0 -0
- data/install/tools/mac/TableManager.app/Contents/Info.plist +38 -0
- data/install/tools/mac/TableManager.app/Contents/MacOS/TableManager.rb +15 -0
- data/install/tools/mac/TableManager.app/Contents/MacOS/main.sh +6 -0
- data/install/tools/mac/TableManager.app/Contents/Resources/appIcon.icns +0 -0
- data/install/tools/mac/TestRunner.app/Contents/Info.plist +38 -0
- data/install/tools/mac/TestRunner.app/Contents/MacOS/TestRunner.rb +15 -0
- data/install/tools/mac/TestRunner.app/Contents/MacOS/main.sh +6 -0
- data/install/tools/mac/TestRunner.app/Contents/Resources/appIcon.icns +0 -0
- data/install/tools/mac/TlmExtractor.app/Contents/Info.plist +38 -0
- data/install/tools/mac/TlmExtractor.app/Contents/MacOS/TlmExtractor.rb +15 -0
- data/install/tools/mac/TlmExtractor.app/Contents/MacOS/main.sh +6 -0
- data/install/tools/mac/TlmExtractor.app/Contents/Resources/appIcon.icns +0 -0
- data/install/tools/mac/TlmGrapher.app/Contents/Info.plist +38 -0
- data/install/tools/mac/TlmGrapher.app/Contents/MacOS/TlmGrapher.rb +15 -0
- data/install/tools/mac/TlmGrapher.app/Contents/MacOS/main.sh +6 -0
- data/install/tools/mac/TlmGrapher.app/Contents/Resources/appIcon.icns +0 -0
- data/install/tools/mac/TlmViewer.app/Contents/Info.plist +38 -0
- data/install/tools/mac/TlmViewer.app/Contents/MacOS/TlmViewer.rb +15 -0
- data/install/tools/mac/TlmViewer.app/Contents/MacOS/main.sh +6 -0
- data/install/tools/mac/TlmViewer.app/Contents/Resources/appIcon.icns +0 -0
- data/install/userpath.txt +1 -0
- data/lib/cosmos/ccsds/ccsds_packet.rb +63 -0
- data/lib/cosmos/ccsds/ccsds_parser.rb +143 -0
- data/lib/cosmos/config/config_parser.rb +324 -0
- data/lib/cosmos/conversions/conversion.rb +47 -0
- data/lib/cosmos/conversions/generic_conversion.rb +55 -0
- data/lib/cosmos/conversions/new_packet_log_conversion.rb +45 -0
- data/lib/cosmos/conversions/polynomial_conversion.rb +57 -0
- data/lib/cosmos/conversions/processor_conversion.rb +46 -0
- data/lib/cosmos/conversions/received_count_conversion.rb +33 -0
- data/lib/cosmos/conversions/received_time_formatted_conversion.rb +37 -0
- data/lib/cosmos/conversions/received_time_seconds_conversion.rb +37 -0
- data/lib/cosmos/conversions/segmented_polynomial_conversion.rb +128 -0
- data/lib/cosmos/conversions/unix_time_conversion.rb +50 -0
- data/lib/cosmos/conversions/unix_time_formatted_conversion.rb +44 -0
- data/lib/cosmos/conversions/unix_time_seconds_conversion.rb +44 -0
- data/lib/cosmos/conversions.rb +13 -0
- data/lib/cosmos/core_ext/array.rb +354 -0
- data/lib/cosmos/core_ext/class.rb +51 -0
- data/lib/cosmos/core_ext/cosmos_io.rb +29 -0
- data/lib/cosmos/core_ext/exception.rb +52 -0
- data/lib/cosmos/core_ext/file.rb +75 -0
- data/lib/cosmos/core_ext/hash.rb +28 -0
- data/lib/cosmos/core_ext/io.rb +75 -0
- data/lib/cosmos/core_ext/kernel.rb +38 -0
- data/lib/cosmos/core_ext/math.rb +119 -0
- data/lib/cosmos/core_ext/matrix.rb +146 -0
- data/lib/cosmos/core_ext/objectspace.rb +29 -0
- data/lib/cosmos/core_ext/range.rb +22 -0
- data/lib/cosmos/core_ext/socket.rb +32 -0
- data/lib/cosmos/core_ext/string.rb +310 -0
- data/lib/cosmos/core_ext/stringio.rb +24 -0
- data/lib/cosmos/core_ext/time.rb +446 -0
- data/lib/cosmos/core_ext.rb +18 -0
- data/lib/cosmos/ext/.keep +0 -0
- data/lib/cosmos/gui/choosers/combobox_chooser.rb +130 -0
- data/lib/cosmos/gui/choosers/file_chooser.rb +68 -0
- data/lib/cosmos/gui/choosers/float_chooser.rb +82 -0
- data/lib/cosmos/gui/choosers/integer_chooser.rb +80 -0
- data/lib/cosmos/gui/choosers/string_chooser.rb +53 -0
- data/lib/cosmos/gui/choosers/telemetry_chooser.rb +317 -0
- data/lib/cosmos/gui/dialogs/about_dialog.rb +128 -0
- data/lib/cosmos/gui/dialogs/calendar_dialog.rb +136 -0
- data/lib/cosmos/gui/dialogs/cmd_details_dialog.rb +52 -0
- data/lib/cosmos/gui/dialogs/cmd_tlm_raw_dialog.rb +149 -0
- data/lib/cosmos/gui/dialogs/details_dialog.rb +174 -0
- data/lib/cosmos/gui/dialogs/exception_dialog.rb +97 -0
- data/lib/cosmos/gui/dialogs/exception_list_dialog.rb +59 -0
- data/lib/cosmos/gui/dialogs/find_replace_dialog.rb +196 -0
- data/lib/cosmos/gui/dialogs/legal_dialog.rb +168 -0
- data/lib/cosmos/gui/dialogs/packet_log_dialog.rb +118 -0
- data/lib/cosmos/gui/dialogs/progress_dialog.rb +262 -0
- data/lib/cosmos/gui/dialogs/pry_dialog.rb +161 -0
- data/lib/cosmos/gui/dialogs/scroll_text_dialog.rb +37 -0
- data/lib/cosmos/gui/dialogs/select_dialog.rb +54 -0
- data/lib/cosmos/gui/dialogs/set_tlm_dialog.rb +131 -0
- data/lib/cosmos/gui/dialogs/splash.rb +113 -0
- data/lib/cosmos/gui/dialogs/tlm_details_dialog.rb +206 -0
- data/lib/cosmos/gui/dialogs/tlm_edit_dialog.rb +81 -0
- data/lib/cosmos/gui/line_graph/line_graph.rb +456 -0
- data/lib/cosmos/gui/line_graph/line_graph_dialog.rb +34 -0
- data/lib/cosmos/gui/line_graph/line_graph_drawing.rb +494 -0
- data/lib/cosmos/gui/line_graph/line_graph_popups.rb +116 -0
- data/lib/cosmos/gui/line_graph/line_graph_scaling.rb +460 -0
- data/lib/cosmos/gui/line_graph/line_graph_script.rb +26 -0
- data/lib/cosmos/gui/line_graph/lines.rb +290 -0
- data/lib/cosmos/gui/line_graph/overview_graph.rb +459 -0
- data/lib/cosmos/gui/opengl/earth_model.rb +22 -0
- data/lib/cosmos/gui/opengl/gl_bounds.rb +67 -0
- data/lib/cosmos/gui/opengl/gl_light.rb +39 -0
- data/lib/cosmos/gui/opengl/gl_material.rb +29 -0
- data/lib/cosmos/gui/opengl/gl_scene.rb +72 -0
- data/lib/cosmos/gui/opengl/gl_shape.rb +146 -0
- data/lib/cosmos/gui/opengl/gl_viewer.rb +712 -0
- data/lib/cosmos/gui/opengl/gl_viewport.rb +35 -0
- data/lib/cosmos/gui/opengl/moon_model.rb +22 -0
- data/lib/cosmos/gui/opengl/opengl.rb +8 -0
- data/lib/cosmos/gui/opengl/stl_reader.rb +211 -0
- data/lib/cosmos/gui/opengl/stl_shape.rb +124 -0
- data/lib/cosmos/gui/opengl/texture_mapped_sphere.rb +202 -0
- data/lib/cosmos/gui/qt.rb +786 -0
- data/lib/cosmos/gui/qt_tool.rb +373 -0
- data/lib/cosmos/gui/text/completion.rb +381 -0
- data/lib/cosmos/gui/text/completion_line_edit.rb +30 -0
- data/lib/cosmos/gui/text/completion_text_edit.rb +179 -0
- data/lib/cosmos/gui/text/ruby_editor.rb +395 -0
- data/lib/cosmos/gui/utilities/screenshot.rb +25 -0
- data/lib/cosmos/gui/utilities/script_module_gui.rb +203 -0
- data/lib/cosmos/gui/widgets/full_text_search_line_edit.rb +161 -0
- data/lib/cosmos/gui/widgets/packet_log_frame.rb +305 -0
- data/lib/cosmos/gui/widgets/realtime_button_bar.rb +98 -0
- data/lib/cosmos/interfaces/cmd_tlm_server_interface.rb +149 -0
- data/lib/cosmos/interfaces/interface.rb +213 -0
- data/lib/cosmos/interfaces/linc_interface.rb +360 -0
- data/lib/cosmos/interfaces/serial_interface.rb +76 -0
- data/lib/cosmos/interfaces/simulated_target_interface.rb +128 -0
- data/lib/cosmos/interfaces/stream_interface.rb +156 -0
- data/lib/cosmos/interfaces/tcpip_client_interface.rb +60 -0
- data/lib/cosmos/interfaces/tcpip_server_interface.rb +154 -0
- data/lib/cosmos/interfaces/udp_interface.rb +173 -0
- data/lib/cosmos/interfaces.rb +11 -0
- data/lib/cosmos/io/buffered_file.rb +11 -0
- data/lib/cosmos/io/cosmos_snmp.rb +50 -0
- data/lib/cosmos/io/io_multiplexer.rb +89 -0
- data/lib/cosmos/io/json_drb.rb +320 -0
- data/lib/cosmos/io/json_drb_object.rb +137 -0
- data/lib/cosmos/io/json_rpc.rb +365 -0
- data/lib/cosmos/io/posix_serial_driver.rb +145 -0
- data/lib/cosmos/io/raw_logger.rb +174 -0
- data/lib/cosmos/io/raw_logger_pair.rb +71 -0
- data/lib/cosmos/io/serial_driver.rb +85 -0
- data/lib/cosmos/io/stderr.rb +36 -0
- data/lib/cosmos/io/stdout.rb +36 -0
- data/lib/cosmos/io/tcpip_server.rb +532 -0
- data/lib/cosmos/io/udp_sockets.rb +152 -0
- data/lib/cosmos/io/win32_serial_driver.rb +147 -0
- data/lib/cosmos/packet_logs/meta_packet_log_writer.rb +107 -0
- data/lib/cosmos/packet_logs/packet_log_reader.rb +439 -0
- data/lib/cosmos/packet_logs/packet_log_writer.rb +309 -0
- data/lib/cosmos/packet_logs/packet_log_writer_pair.rb +30 -0
- data/lib/cosmos/packet_logs.rb +6 -0
- data/lib/cosmos/packets/binary_accessor.rb +921 -0
- data/lib/cosmos/packets/commands.rb +291 -0
- data/lib/cosmos/packets/limits.rb +263 -0
- data/lib/cosmos/packets/limits_response.rb +38 -0
- data/lib/cosmos/packets/packet.rb +699 -0
- data/lib/cosmos/packets/packet_config.rb +1034 -0
- data/lib/cosmos/packets/packet_item.rb +317 -0
- data/lib/cosmos/packets/packet_item_limits.rb +128 -0
- data/lib/cosmos/packets/structure.rb +386 -0
- data/lib/cosmos/packets/structure_item.rb +233 -0
- data/lib/cosmos/packets/telemetry.rb +317 -0
- data/lib/cosmos/processors/new_packet_log_processor.rb +34 -0
- data/lib/cosmos/processors/processor.rb +71 -0
- data/lib/cosmos/processors/statistics_processor.rb +65 -0
- data/lib/cosmos/processors/watermark_processor.rb +44 -0
- data/lib/cosmos/processors.rb +6 -0
- data/lib/cosmos/script/extract.rb +115 -0
- data/lib/cosmos/script/script.rb +1493 -0
- data/lib/cosmos/script.rb +9 -0
- data/lib/cosmos/streams/burst_stream_protocol.rb +25 -0
- data/lib/cosmos/streams/fixed_stream_protocol.rb +111 -0
- data/lib/cosmos/streams/length_stream_protocol.rb +140 -0
- data/lib/cosmos/streams/preidentified_stream_protocol.rb +118 -0
- data/lib/cosmos/streams/serial_stream.rb +143 -0
- data/lib/cosmos/streams/stream.rb +57 -0
- data/lib/cosmos/streams/stream_protocol.rb +369 -0
- data/lib/cosmos/streams/tcpip_client_stream.rb +77 -0
- data/lib/cosmos/streams/tcpip_socket_stream.rb +139 -0
- data/lib/cosmos/streams/template_stream_protocol.rb +140 -0
- data/lib/cosmos/streams/terminated_stream_protocol.rb +81 -0
- data/lib/cosmos/system/system.rb +558 -0
- data/lib/cosmos/system/target.rb +178 -0
- data/lib/cosmos/system.rb +4 -0
- data/lib/cosmos/tools/cmd_extractor/cmd_extractor.rb +253 -0
- data/lib/cosmos/tools/cmd_sender/cmd_sender.rb +716 -0
- data/lib/cosmos/tools/cmd_sender/cmd_sender_item_delegate.rb +77 -0
- data/lib/cosmos/tools/cmd_sender/cmd_sender_text_edit.rb +70 -0
- data/lib/cosmos/tools/cmd_tlm_server/api.rb +940 -0
- data/lib/cosmos/tools/cmd_tlm_server/background_task.rb +46 -0
- data/lib/cosmos/tools/cmd_tlm_server/background_tasks.rb +63 -0
- data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb +496 -0
- data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_config.rb +241 -0
- data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_gui.rb +1008 -0
- data/lib/cosmos/tools/cmd_tlm_server/commanding.rb +112 -0
- data/lib/cosmos/tools/cmd_tlm_server/connections.rb +176 -0
- data/lib/cosmos/tools/cmd_tlm_server/interface_thread.rb +221 -0
- data/lib/cosmos/tools/cmd_tlm_server/interfaces.rb +127 -0
- data/lib/cosmos/tools/cmd_tlm_server/packet_logging.rb +132 -0
- data/lib/cosmos/tools/cmd_tlm_server/router_thread.rb +66 -0
- data/lib/cosmos/tools/cmd_tlm_server/routers.rb +97 -0
- data/lib/cosmos/tools/data_viewer/data_viewer.rb +600 -0
- data/lib/cosmos/tools/data_viewer/data_viewer_component.rb +167 -0
- data/lib/cosmos/tools/data_viewer/dump_component.rb +40 -0
- data/lib/cosmos/tools/handbook_creator/handbook_creator.rb +149 -0
- data/lib/cosmos/tools/handbook_creator/handbook_creator_config.rb +360 -0
- data/lib/cosmos/tools/launcher/launcher.rb +184 -0
- data/lib/cosmos/tools/launcher/launcher_config.rb +167 -0
- data/lib/cosmos/tools/launcher/launcher_multitool.rb +41 -0
- data/lib/cosmos/tools/launcher/launcher_tool.rb +104 -0
- data/lib/cosmos/tools/limits_monitor/limits_monitor.rb +768 -0
- data/lib/cosmos/tools/opengl_builder/opengl_builder.rb +416 -0
- data/lib/cosmos/tools/opengl_builder/scene_config.rb +118 -0
- data/lib/cosmos/tools/packet_viewer/packet_viewer.rb +525 -0
- data/lib/cosmos/tools/replay/replay.rb +488 -0
- data/lib/cosmos/tools/replay/replay_server.rb +91 -0
- data/lib/cosmos/tools/script_runner/script_audit.rb +139 -0
- data/lib/cosmos/tools/script_runner/script_runner.rb +914 -0
- data/lib/cosmos/tools/script_runner/script_runner_config.rb +40 -0
- data/lib/cosmos/tools/script_runner/script_runner_frame.rb +1859 -0
- data/lib/cosmos/tools/table_manager/table.rb +70 -0
- data/lib/cosmos/tools/table_manager/table_config.rb +764 -0
- data/lib/cosmos/tools/table_manager/table_item.rb +74 -0
- data/lib/cosmos/tools/table_manager/table_manager.rb +1065 -0
- data/lib/cosmos/tools/table_manager/table_manager_core.rb +539 -0
- data/lib/cosmos/tools/test_runner/results_writer.rb +283 -0
- data/lib/cosmos/tools/test_runner/test.rb +480 -0
- data/lib/cosmos/tools/test_runner/test_runner.rb +1157 -0
- data/lib/cosmos/tools/test_runner/test_runner_chooser.rb +338 -0
- data/lib/cosmos/tools/tlm_extractor/text_item_chooser.rb +60 -0
- data/lib/cosmos/tools/tlm_extractor/tlm_extractor.rb +1008 -0
- data/lib/cosmos/tools/tlm_extractor/tlm_extractor_config.rb +371 -0
- data/lib/cosmos/tools/tlm_extractor/tlm_extractor_processor.rb +60 -0
- data/lib/cosmos/tools/tlm_grapher/data_object_adders/housekeeping_data_object_adder.rb +75 -0
- data/lib/cosmos/tools/tlm_grapher/data_object_adders/singlexy_data_object_adder.rb +44 -0
- data/lib/cosmos/tools/tlm_grapher/data_object_adders/xy_data_object_adder.rb +94 -0
- data/lib/cosmos/tools/tlm_grapher/data_object_editors/data_object_editor.rb +61 -0
- data/lib/cosmos/tools/tlm_grapher/data_object_editors/housekeeping_data_object_editor.rb +180 -0
- data/lib/cosmos/tools/tlm_grapher/data_object_editors/linegraph_data_object_editor.rb +141 -0
- data/lib/cosmos/tools/tlm_grapher/data_object_editors/singlexy_data_object_editor.rb +30 -0
- data/lib/cosmos/tools/tlm_grapher/data_object_editors/xy_data_object_editor.rb +173 -0
- data/lib/cosmos/tools/tlm_grapher/data_objects/data_object.rb +177 -0
- data/lib/cosmos/tools/tlm_grapher/data_objects/housekeeping_data_object.rb +409 -0
- data/lib/cosmos/tools/tlm_grapher/data_objects/linegraph_data_object.rb +176 -0
- data/lib/cosmos/tools/tlm_grapher/data_objects/singlexy_data_object.rb +25 -0
- data/lib/cosmos/tools/tlm_grapher/data_objects/xy_data_object.rb +320 -0
- data/lib/cosmos/tools/tlm_grapher/plot_editors/linegraph_plot_editor.rb +181 -0
- data/lib/cosmos/tools/tlm_grapher/plot_editors/plot_editor.rb +28 -0
- data/lib/cosmos/tools/tlm_grapher/plot_editors/singlexy_plot_editor.rb +30 -0
- data/lib/cosmos/tools/tlm_grapher/plot_editors/xy_plot_editor.rb +59 -0
- data/lib/cosmos/tools/tlm_grapher/plot_gui_objects/linegraph_plot_gui_object.rb +172 -0
- data/lib/cosmos/tools/tlm_grapher/plot_gui_objects/singlexy_plot_gui_object.rb +27 -0
- data/lib/cosmos/tools/tlm_grapher/plot_gui_objects/xy_plot_gui_object.rb +74 -0
- data/lib/cosmos/tools/tlm_grapher/plots/linegraph_plot.rb +201 -0
- data/lib/cosmos/tools/tlm_grapher/plots/plot.rb +69 -0
- data/lib/cosmos/tools/tlm_grapher/plots/singlexy_plot.rb +20 -0
- data/lib/cosmos/tools/tlm_grapher/plots/xy_plot.rb +61 -0
- data/lib/cosmos/tools/tlm_grapher/tabbed_plots/overview_tabbed_plots.rb +1278 -0
- data/lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_config.rb +430 -0
- data/lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_data_object_editor.rb +107 -0
- data/lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_logfile_thread.rb +95 -0
- data/lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_plot_editor.rb +101 -0
- data/lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_realtime_thread.rb +66 -0
- data/lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_tab.rb +57 -0
- data/lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_tool.rb +1004 -0
- data/lib/cosmos/tools/tlm_grapher/tlm_grapher.rb +87 -0
- data/lib/cosmos/tools/tlm_viewer/screen.rb +458 -0
- data/lib/cosmos/tools/tlm_viewer/tlm_viewer.rb +544 -0
- data/lib/cosmos/tools/tlm_viewer/tlm_viewer_config.rb +287 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/aging_widget.rb +110 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/array_widget.rb +70 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/block_widget.rb +61 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/button_widget.rb +39 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/canvas_widget.rb +62 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/canvasimage_widget.rb +41 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/canvasimagevalue_widget.rb +57 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/canvaslabel_widget.rb +37 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/canvaslabelvalue_widget.rb +56 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/canvasline_widget.rb +55 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/canvaslinevalue_widget.rb +66 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/canvasvalue_widget.rb +124 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/checkbutton_widget.rb +31 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/combobox_widget.rb +30 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb +36 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/formatvalue_widget.rb +35 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/horizontal_widget.rb +27 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/horizontalbox_widget.rb +31 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/horizontalline_widget.rb +26 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/label_widget.rb +29 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/labelformatvalue_widget.rb +39 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/labelprogressbar_widget.rb +38 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/labeltrendlimitsbar_widget.rb +38 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/labelvalue_widget.rb +39 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/labelvaluedesc_widget.rb +42 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/labelvaluelimitsbar_widget.rb +37 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/labelvaluerangebar_widget.rb +37 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/layout_widget.rb +34 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/limitsbar_widget.rb +178 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/linegraph_widget.rb +54 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/matrixbycolumns_widget.rb +47 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/multi_widget.rb +116 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/progressbar_widget.rb +34 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/radiobutton_widget.rb +30 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/rangebar_widget.rb +57 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/screenshotbutton_widget.rb +34 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/scrollwindow_widget.rb +35 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/sectionheader_widget.rb +33 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/tabbook_widget.rb +26 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/tabitem_widget.rb +28 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/textbox_widget.rb +47 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/textfield_widget.rb +26 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/timegraph_widget.rb +88 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/title_widget.rb +27 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/trendbar_widget.rb +130 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/trendlimitsbar_widget.rb +46 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/value_widget.rb +43 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/valuelimitsbar_widget.rb +37 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/valuerangebar_widget.rb +37 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/vertical_widget.rb +35 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/verticalbox_widget.rb +37 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/widget.rb +257 -0
- data/lib/cosmos/tools/tlm_viewer/widgets.rb +53 -0
- data/lib/cosmos/top_level.rb +596 -0
- data/lib/cosmos/utilities/crc.rb +166 -0
- data/lib/cosmos/utilities/csv.rb +83 -0
- data/lib/cosmos/utilities/logger.rb +137 -0
- data/lib/cosmos/utilities/low_fragmentation_array.rb +11 -0
- data/lib/cosmos/utilities/message_log.rb +74 -0
- data/lib/cosmos/utilities/quaternion.rb +258 -0
- data/lib/cosmos/utilities/ruby_lex_utils.rb +313 -0
- data/lib/cosmos/utilities/simulated_target.rb +99 -0
- data/lib/cosmos/utilities.rb +10 -0
- data/lib/cosmos/version.rb +12 -0
- data/lib/cosmos/win32/excel.rb +66 -0
- data/lib/cosmos/win32/win32.rb +387 -0
- data/lib/cosmos/win32/win32_main.rb +311 -0
- data/lib/cosmos.rb +63 -0
- data/roodi.yml +24 -0
- data/run_gui_tests.bat +32 -0
- data/spec/ccsds/ccsds_packet_spec.rb +67 -0
- data/spec/ccsds/ccsds_parser_spec.rb +148 -0
- data/spec/config/config_parser_spec.rb +322 -0
- data/spec/conversions/conversion_spec.rb +31 -0
- data/spec/conversions/generic_conversion_spec.rb +45 -0
- data/spec/conversions/new_packet_log_conversion_spec.rb +39 -0
- data/spec/conversions/polynomial_conversion_spec.rb +40 -0
- data/spec/conversions/processor_conversion_spec.rb +45 -0
- data/spec/conversions/received_count_conversion_spec.rb +43 -0
- data/spec/conversions/received_time_formatted_conversion_spec.rb +49 -0
- data/spec/conversions/received_time_seconds_conversion_spec.rb +50 -0
- data/spec/conversions/segmented_polynomial_conversion_spec.rb +51 -0
- data/spec/conversions/unix_time_formatted_conversion_spec.rb +74 -0
- data/spec/conversions/unix_time_seconds_conversion_spec.rb +76 -0
- data/spec/core_ext/array_spec.rb +186 -0
- data/spec/core_ext/class_spec.rb +36 -0
- data/spec/core_ext/cosmos_io_spec.rb +77 -0
- data/spec/core_ext/exception_spec.rb +91 -0
- data/spec/core_ext/file_spec.rb +72 -0
- data/spec/core_ext/hash_spec.rb +24 -0
- data/spec/core_ext/io_spec.rb +46 -0
- data/spec/core_ext/kernel_spec.rb +54 -0
- data/spec/core_ext/math_spec.rb +116 -0
- data/spec/core_ext/matrix_spec.rb +66 -0
- data/spec/core_ext/objectspace_spec.rb +29 -0
- data/spec/core_ext/range_spec.rb +21 -0
- data/spec/core_ext/socket_spec.rb +32 -0
- data/spec/core_ext/string_spec.rb +223 -0
- data/spec/core_ext/stringio_spec.rb +21 -0
- data/spec/core_ext/time_spec.rb +151 -0
- data/spec/gui/line_graph/line_clip_spec.rb +322 -0
- data/spec/install/config/system/system.txt +33 -0
- data/spec/install/config/targets/COSMOS/cmd_tlm/cosmos_server_cmds.txt +41 -0
- data/spec/install/config/targets/COSMOS/cmd_tlm/cosmos_server_tlm.txt +15 -0
- data/spec/install/config/targets/COSMOS/cmd_tlm_server.txt +6 -0
- data/spec/install/config/targets/COSMOS/screens/limits_change.txt +20 -0
- data/spec/install/config/targets/COSMOS/screens/version.txt +19 -0
- data/spec/install/config/targets/COSMOS/target.txt +5 -0
- data/spec/install/config/targets/INST/cmd_tlm/inst_cmd_linc.txt +30 -0
- data/spec/install/config/targets/INST/cmd_tlm/inst_cmds.txt +111 -0
- data/spec/install/config/targets/INST/cmd_tlm/inst_tlm.txt +236 -0
- data/spec/install/config/targets/INST/cmd_tlm/inst_tlm_linc.txt +25 -0
- data/spec/install/config/targets/INST/cmd_tlm_server.txt +5 -0
- data/spec/install/config/targets/INST/lib/sim_inst.rb +294 -0
- data/spec/install/config/targets/INST/target.txt +10 -0
- data/spec/install/config/targets/META/cmd_tlm/meta_cmd.txt +4 -0
- data/spec/install/config/targets/META/cmd_tlm/meta_tlm.txt +4 -0
- data/spec/install/config/targets/SYSTEM/cmd_tlm/limits_groups.txt +7 -0
- data/spec/install/config/tools/cmd_tlm_server/cmd_tlm_server.txt +1 -0
- data/spec/install/lib/README.txt +1 -0
- data/spec/install/userpath.txt +1 -0
- data/spec/interfaces/cmd_tlm_server_interface_spec.rb +150 -0
- data/spec/interfaces/interface_spec.rb +128 -0
- data/spec/interfaces/linc_interface_spec.rb +199 -0
- data/spec/interfaces/serial_interface_spec.rb +56 -0
- data/spec/interfaces/simulated_target_interface_spec.rb +128 -0
- data/spec/interfaces/stream_interface_spec.rb +157 -0
- data/spec/interfaces/tcpip_client_interface_spec.rb +54 -0
- data/spec/interfaces/tcpip_server_interface_spec.rb +151 -0
- data/spec/interfaces/udp_interface_spec.rb +175 -0
- data/spec/io/buffered_file_spec.rb +113 -0
- data/spec/io/io_multiplexer_spec.rb +94 -0
- data/spec/io/json_drb_object_spec.rb +93 -0
- data/spec/io/json_drb_spec.rb +293 -0
- data/spec/io/json_rpc_spec.rb +264 -0
- data/spec/io/raw_logger_pair_spec.rb +76 -0
- data/spec/io/raw_logger_spec.rb +133 -0
- data/spec/io/serial_driver_spec.rb +61 -0
- data/spec/io/stderr_spec.rb +32 -0
- data/spec/io/stdout_spec.rb +32 -0
- data/spec/io/tcpip_server_spec.rb +322 -0
- data/spec/io/udp_sockets_spec.rb +94 -0
- data/spec/io/win32_serial_driver_spec.rb +88 -0
- data/spec/packet_logs/meta_packet_log_writer_spec.rb +170 -0
- data/spec/packet_logs/packet_log_reader_spec.rb +408 -0
- data/spec/packet_logs/packet_log_writer_pair_spec.rb +30 -0
- data/spec/packet_logs/packet_log_writer_spec.rb +209 -0
- data/spec/packets/binary_accessor_spec.rb +2073 -0
- data/spec/packets/commands_spec.rb +369 -0
- data/spec/packets/limits_response_spec.rb +25 -0
- data/spec/packets/limits_spec.rb +326 -0
- data/spec/packets/packet_config_spec.rb +1620 -0
- data/spec/packets/packet_item_limits_spec.rb +161 -0
- data/spec/packets/packet_item_spec.rb +386 -0
- data/spec/packets/packet_spec.rb +949 -0
- data/spec/packets/structure_item_spec.rb +195 -0
- data/spec/packets/structure_spec.rb +419 -0
- data/spec/packets/telemetry_spec.rb +535 -0
- data/spec/processors/new_packet_log_processor_spec.rb +39 -0
- data/spec/processors/processor_spec.rb +55 -0
- data/spec/processors/statistics_processor_spec.rb +60 -0
- data/spec/processors/watermark_processor_spec.rb +51 -0
- data/spec/script/script_spec.rb +650 -0
- data/spec/spec_helper.rb +138 -0
- data/spec/streams/burst_stream_protocol_spec.rb +32 -0
- data/spec/streams/fixed_stream_protocol_spec.rb +110 -0
- data/spec/streams/length_stream_protocol_spec.rb +297 -0
- data/spec/streams/preidentified_stream_protocol_spec.rb +118 -0
- data/spec/streams/serial_stream_spec.rb +105 -0
- data/spec/streams/stream_protocol_spec.rb +332 -0
- data/spec/streams/stream_spec.rb +29 -0
- data/spec/streams/tcpip_client_stream_spec.rb +54 -0
- data/spec/streams/tcpip_socket_stream_spec.rb +146 -0
- data/spec/streams/template_stream_protocol_spec.rb +151 -0
- data/spec/streams/terminated_stream_protocol_spec.rb +123 -0
- data/spec/system/system_spec.rb +645 -0
- data/spec/system/target_spec.rb +248 -0
- data/spec/tools/cmd_tlm_server/api_spec.rb +1090 -0
- data/spec/tools/cmd_tlm_server/background_task_spec.rb +32 -0
- data/spec/tools/cmd_tlm_server/background_tasks_spec.rb +82 -0
- data/spec/tools/cmd_tlm_server/cmd_tlm_server_config_spec.rb +406 -0
- data/spec/tools/cmd_tlm_server/cmd_tlm_server_spec.rb +418 -0
- data/spec/tools/cmd_tlm_server/commanding_spec.rb +123 -0
- data/spec/tools/cmd_tlm_server/connections_spec.rb +147 -0
- data/spec/tools/cmd_tlm_server/interface_thread_spec.rb +317 -0
- data/spec/tools/cmd_tlm_server/interfaces_spec.rb +228 -0
- data/spec/tools/cmd_tlm_server/packet_logging_spec.rb +143 -0
- data/spec/tools/cmd_tlm_server/router_thread_spec.rb +104 -0
- data/spec/tools/cmd_tlm_server/routers_spec.rb +196 -0
- data/spec/top_level/top_level_spec.rb +320 -0
- data/spec/utilities/crc_spec.rb +45 -0
- data/spec/utilities/csv_spec.rb +97 -0
- data/spec/utilities/logger_spec.rb +102 -0
- data/spec/utilities/message_log_spec.rb +89 -0
- data/spec/utilities/quaternion_spec.rb +107 -0
- data/spec/utilities/ruby_lex_utils_spec.rb +86 -0
- data/tasks/manifest.rake +22 -0
- data/tasks/spec.rake +23 -0
- metadata +1566 -0
@@ -0,0 +1,1493 @@
|
|
1
|
+
# encoding: ascii-8bit
|
2
|
+
|
3
|
+
# Copyright 2014 Ball Aerospace & Technologies Corp.
|
4
|
+
# All Rights Reserved.
|
5
|
+
#
|
6
|
+
# This program is free software; you can modify and/or redistribute it
|
7
|
+
# under the terms of the GNU General Public License
|
8
|
+
# as published by the Free Software Foundation; version 3 with
|
9
|
+
# attribution addendums as found in the LICENSE.txt
|
10
|
+
|
11
|
+
require 'cosmos'
|
12
|
+
require 'cosmos/io/json_drb_object'
|
13
|
+
require 'cosmos/tools/cmd_tlm_server/cmd_tlm_server'
|
14
|
+
require 'cosmos/script/extract'
|
15
|
+
|
16
|
+
$cmd_tlm_server = nil
|
17
|
+
$cmd_tlm_disconnect = false
|
18
|
+
|
19
|
+
module Cosmos
|
20
|
+
class CheckError < RuntimeError; end
|
21
|
+
class StopScript < StandardError; end
|
22
|
+
class SkipTestCase < StandardError; end
|
23
|
+
|
24
|
+
module Script
|
25
|
+
DEFAULT_TLM_POLLING_RATE = 0.25
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
include Extract
|
30
|
+
|
31
|
+
#######################################
|
32
|
+
# Methods accessing cmd_tlm_server
|
33
|
+
#######################################
|
34
|
+
|
35
|
+
#
|
36
|
+
# Methods involving commands
|
37
|
+
#
|
38
|
+
|
39
|
+
# Send a command to the specified target
|
40
|
+
# Supports two signatures:
|
41
|
+
# cmd(target_name, cmd_name, cmd_params = {})
|
42
|
+
# or
|
43
|
+
# cmd('target_name cmd_name with cmd_param1 value1, cmd_param2 value2')
|
44
|
+
def cmd(*args)
|
45
|
+
begin
|
46
|
+
target_name, cmd_name, cmd_params = $cmd_tlm_server.cmd(*args)
|
47
|
+
Logger.info build_cmd_output_string(target_name, cmd_name, cmd_params)
|
48
|
+
rescue HazardousError => e
|
49
|
+
ok_to_proceed = prompt_for_hazardous(e.target_name,
|
50
|
+
e.cmd_name,
|
51
|
+
e.hazardous_description)
|
52
|
+
if ok_to_proceed
|
53
|
+
target_name, cmd_name, cmd_params =
|
54
|
+
$cmd_tlm_server.cmd_no_hazardous_check(*args)
|
55
|
+
Logger.info build_cmd_output_string(target_name, cmd_name, cmd_params)
|
56
|
+
else
|
57
|
+
Logger.warn "Hazardous command not sent"
|
58
|
+
prompt_for_script_abort
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# Send a command to the specified target without range checking parameters
|
64
|
+
# Supports two signatures:
|
65
|
+
# cmd_no_range_check(target_name, cmd_name, cmd_params = {})
|
66
|
+
# or
|
67
|
+
# cmd_no_range_check('target_name cmd_name with cmd_param1 value1, cmd_param2 value2')
|
68
|
+
def cmd_no_range_check(*args)
|
69
|
+
begin
|
70
|
+
target_name, cmd_name, cmd_params = $cmd_tlm_server.cmd_no_range_check(*args)
|
71
|
+
Logger.warn "Command #{target_name} #{cmd_name} being sent ignoring range checks"
|
72
|
+
Logger.info build_cmd_output_string(target_name, cmd_name, cmd_params)
|
73
|
+
rescue HazardousError => e
|
74
|
+
ok_to_proceed = prompt_for_hazardous(e.target_name,
|
75
|
+
e.cmd_name,
|
76
|
+
e.hazardous_description)
|
77
|
+
if ok_to_proceed
|
78
|
+
target_name, cmd_name, cmd_params = $cmd_tlm_server.cmd_no_checks(*args)
|
79
|
+
Logger.warn "Command #{target_name} #{cmd_name} being sent ignoring range checks"
|
80
|
+
Logger.info build_cmd_output_string(target_name, cmd_name, cmd_params)
|
81
|
+
else
|
82
|
+
Logger.warn "Hazardous command not sent"
|
83
|
+
prompt_for_script_abort
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
# Send a command to the specified target without hazardous checks
|
89
|
+
# Supports two signatures:
|
90
|
+
# cmd_no_hazardous_check(target_name, cmd_name, cmd_params = {})
|
91
|
+
# or
|
92
|
+
# cmd_no_hazardous_check('target_name cmd_name with cmd_param1 value1, cmd_param2 value2')
|
93
|
+
def cmd_no_hazardous_check(*args)
|
94
|
+
target_name, cmd_name, cmd_params = $cmd_tlm_server.cmd_no_hazardous_check(*args)
|
95
|
+
Logger.warn "Command #{target_name} #{cmd_name} being sent ignoring hazardous warnings"
|
96
|
+
Logger.info build_cmd_output_string(target_name, cmd_name, cmd_params)
|
97
|
+
end
|
98
|
+
|
99
|
+
# Send a command to the specified target without range checking or hazardous checks
|
100
|
+
# Supports two signatures:
|
101
|
+
# cmd_no_checks(target_name, cmd_name, cmd_params = {})
|
102
|
+
# or
|
103
|
+
# cmd_no_checks('target_name cmd_name with cmd_param1 value1, cmd_param2 value2')
|
104
|
+
def cmd_no_checks(*args)
|
105
|
+
target_name, cmd_name, cmd_params = $cmd_tlm_server.cmd_no_checks(*args)
|
106
|
+
Logger.warn "Command #{target_name} #{cmd_name} being sent ignoring range checks"
|
107
|
+
Logger.warn "Command #{target_name} #{cmd_name} being sent ignoring hazardous warnings"
|
108
|
+
Logger.info build_cmd_output_string(target_name, cmd_name, cmd_params)
|
109
|
+
end
|
110
|
+
|
111
|
+
# Send a command to the specified target without running conversions
|
112
|
+
# Supports two signatures:
|
113
|
+
# cmd_raw(target_name, cmd_name, cmd_params = {})
|
114
|
+
# or
|
115
|
+
# cmd_raw('target_name cmd_name with cmd_param1 value1, cmd_param2 value2')
|
116
|
+
def cmd_raw(*args)
|
117
|
+
begin
|
118
|
+
target_name, cmd_name, cmd_params = $cmd_tlm_server.cmd_raw(*args)
|
119
|
+
Logger.info build_cmd_output_string(target_name, cmd_name, cmd_params, true)
|
120
|
+
rescue HazardousError => e
|
121
|
+
ok_to_proceed = prompt_for_hazardous(e.target_name,
|
122
|
+
e.cmd_name,
|
123
|
+
e.hazardous_description)
|
124
|
+
if ok_to_proceed
|
125
|
+
target_name, cmd_name, cmd_params =
|
126
|
+
$cmd_tlm_server.cmd_raw_no_hazardous_check(*args)
|
127
|
+
Logger.info build_cmd_output_string(target_name, cmd_name, cmd_params, true)
|
128
|
+
else
|
129
|
+
Logger.warn "Hazardous command not sent"
|
130
|
+
prompt_for_script_abort
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
# Send a command to the specified target without range checking parameters or running conversions
|
136
|
+
# Supports two signatures:
|
137
|
+
# cmd_raw_no_range_check(target_name, cmd_name, cmd_params = {})
|
138
|
+
# or
|
139
|
+
# cmd_raw_no_range_check('target_name cmd_name with cmd_param1 value1, cmd_param2 value2')
|
140
|
+
def cmd_raw_no_range_check(*args)
|
141
|
+
begin
|
142
|
+
target_name, cmd_name, cmd_params = $cmd_tlm_server.cmd_raw_no_range_check(*args)
|
143
|
+
Logger.warn "Command #{target_name} #{cmd_name} being sent ignoring range checks"
|
144
|
+
Logger.info build_cmd_output_string(target_name, cmd_name, cmd_params, true)
|
145
|
+
rescue HazardousError => e
|
146
|
+
ok_to_proceed = prompt_for_hazardous(e.target_name,
|
147
|
+
e.cmd_name,
|
148
|
+
e.hazardous_description)
|
149
|
+
if ok_to_proceed
|
150
|
+
target_name, cmd_name, cmd_params = $cmd_tlm_server.cmd_raw_no_checks(*args)
|
151
|
+
Logger.warn "Command #{target_name} #{cmd_name} being sent ignoring range checks"
|
152
|
+
Logger.info build_cmd_output_string(target_name, cmd_name, cmd_params, true)
|
153
|
+
else
|
154
|
+
Logger.warn "Hazardous command not sent"
|
155
|
+
prompt_for_script_abort
|
156
|
+
end
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
# Send a command to the specified target without hazardous checks or running conversions
|
161
|
+
# Supports two signatures:
|
162
|
+
# cmd_raw_no_hazardous_check(target_name, cmd_name, cmd_params = {})
|
163
|
+
# or
|
164
|
+
# cmd_raw_no_hazardous_check('target_name cmd_name with cmd_param1 value1, cmd_param2 value2')
|
165
|
+
def cmd_raw_no_hazardous_check(*args)
|
166
|
+
target_name, cmd_name, cmd_params = $cmd_tlm_server.cmd_raw_no_hazardous_check(*args)
|
167
|
+
Logger.warn "Command #{target_name} #{cmd_name} being sent ignoring hazardous warnings"
|
168
|
+
Logger.info build_cmd_output_string(target_name, cmd_name, cmd_params, true)
|
169
|
+
end
|
170
|
+
|
171
|
+
# Send a command to the specified target without range checking or hazardous checks or running conversions
|
172
|
+
# Supports two signatures:
|
173
|
+
# cmd_raw_no_checks(target_name, cmd_name, cmd_params = {})
|
174
|
+
# or
|
175
|
+
# cmd_raw_no_checks('target_name cmd_name with cmd_param1 value1, cmd_param2 value2')
|
176
|
+
def cmd_raw_no_checks(*args)
|
177
|
+
target_name, cmd_name, cmd_params = $cmd_tlm_server.cmd_raw_no_checks(*args)
|
178
|
+
Logger.warn "Command #{target_name} #{cmd_name} being sent ignoring range checks"
|
179
|
+
Logger.warn "Command #{target_name} #{cmd_name} being sent ignoring hazardous warnings"
|
180
|
+
Logger.info build_cmd_output_string(target_name, cmd_name, cmd_params, true)
|
181
|
+
end
|
182
|
+
|
183
|
+
# Sends raw data through an interface
|
184
|
+
def send_raw(interface_name, data)
|
185
|
+
return $cmd_tlm_server.send_raw(interface_name, data)
|
186
|
+
end
|
187
|
+
|
188
|
+
# Sends raw data through an interface from a file
|
189
|
+
def send_raw_file(interface_name, filename)
|
190
|
+
data = nil
|
191
|
+
File.open(filename, 'rb') {|file| data = file.read}
|
192
|
+
return $cmd_tlm_server.send_raw(interface_name, data)
|
193
|
+
end
|
194
|
+
|
195
|
+
def get_cmd_list(target_name)
|
196
|
+
return $cmd_tlm_server.get_cmd_list(target_name)
|
197
|
+
end
|
198
|
+
|
199
|
+
def get_cmd_param_list(target_name, cmd_name)
|
200
|
+
return $cmd_tlm_server.get_cmd_param_list(target_name, cmd_name)
|
201
|
+
end
|
202
|
+
|
203
|
+
def get_cmd_hazardous(target_name, cmd_name, cmd_params = {})
|
204
|
+
return $cmd_tlm_server.get_cmd_hazardous(target_name, cmd_name, cmd_params)
|
205
|
+
end
|
206
|
+
|
207
|
+
#
|
208
|
+
# Methods involving telemetry
|
209
|
+
#
|
210
|
+
|
211
|
+
# Poll for the converted value of a telemetry item
|
212
|
+
# Supports two signatures:
|
213
|
+
# tlm(target_name, packet_name, item_name)
|
214
|
+
# or
|
215
|
+
# tlm('target_name packet_name item_name')
|
216
|
+
def tlm(*args)
|
217
|
+
return $cmd_tlm_server.tlm(*args)
|
218
|
+
end
|
219
|
+
|
220
|
+
# Poll for the raw value of a telemetry item
|
221
|
+
# Supports two signatures:
|
222
|
+
# tlm_raw(target_name, packet_name, item_name)
|
223
|
+
# or
|
224
|
+
# tlm_raw('target_name packet_name item_name')
|
225
|
+
def tlm_raw(*args)
|
226
|
+
return $cmd_tlm_server.tlm_raw(*args)
|
227
|
+
end
|
228
|
+
|
229
|
+
# Poll for the formatted value of a telemetry item
|
230
|
+
# Supports two signatures:
|
231
|
+
# tlm_formatted(target_name, packet_name, item_name)
|
232
|
+
# or
|
233
|
+
# tlm_formatted('target_name packet_name item_name')
|
234
|
+
def tlm_formatted(*args)
|
235
|
+
return $cmd_tlm_server.tlm_formatted(*args)
|
236
|
+
end
|
237
|
+
|
238
|
+
# Poll for the formatted with units value of a telemetry item
|
239
|
+
# Supports two signatures:
|
240
|
+
# tlm_with_units(target_name, packet_name, item_name)
|
241
|
+
# or
|
242
|
+
# tlm_with_units('target_name packet_name item_name')
|
243
|
+
def tlm_with_units(*args)
|
244
|
+
return $cmd_tlm_server.tlm_with_units(*args)
|
245
|
+
end
|
246
|
+
|
247
|
+
def tlm_variable(*args)
|
248
|
+
return $cmd_tlm_server.tlm_variable(*args)
|
249
|
+
end
|
250
|
+
|
251
|
+
# Set a telemetry point
|
252
|
+
def set_tlm(*args)
|
253
|
+
return $cmd_tlm_server.set_tlm(*args)
|
254
|
+
end
|
255
|
+
|
256
|
+
# Set the raw value of a telemetry point
|
257
|
+
def set_tlm_raw(*args)
|
258
|
+
return $cmd_tlm_server.set_tlm_raw(*args)
|
259
|
+
end
|
260
|
+
|
261
|
+
def get_tlm_packet(target_name, packet_name, value_types = :CONVERTED)
|
262
|
+
result = $cmd_tlm_server.get_tlm_packet(target_name, packet_name, value_types)
|
263
|
+
result.each do |entry|
|
264
|
+
entry[2] = entry[2].to_s.intern if entry[2]
|
265
|
+
end
|
266
|
+
result
|
267
|
+
end
|
268
|
+
|
269
|
+
def get_tlm_values(items, value_types = :CONVERTED)
|
270
|
+
result = $cmd_tlm_server.get_tlm_values(items, value_types)
|
271
|
+
result[1].length.times do |index|
|
272
|
+
result[1][index] = result[1][index].to_s.intern if result[1][index]
|
273
|
+
end
|
274
|
+
result[3] = result[3].to_s.intern
|
275
|
+
result
|
276
|
+
end
|
277
|
+
|
278
|
+
def get_tlm_list(target_name)
|
279
|
+
return $cmd_tlm_server.get_tlm_list(target_name)
|
280
|
+
end
|
281
|
+
|
282
|
+
def get_tlm_item_list(target_name, packet_name)
|
283
|
+
return $cmd_tlm_server.get_tlm_item_list(target_name, packet_name)
|
284
|
+
end
|
285
|
+
|
286
|
+
def get_tlm_details(items)
|
287
|
+
$cmd_tlm_server.get_tlm_details(items)
|
288
|
+
end
|
289
|
+
|
290
|
+
def get_out_of_limits
|
291
|
+
result = $cmd_tlm_server.get_out_of_limits
|
292
|
+
result.each do |entry|
|
293
|
+
entry[3] = entry[3].to_s.intern if entry[3]
|
294
|
+
end
|
295
|
+
result
|
296
|
+
end
|
297
|
+
|
298
|
+
def get_overall_limits_state (ignored_items = nil)
|
299
|
+
return $cmd_tlm_server.get_overall_limits_state(ignored_items).to_s.intern
|
300
|
+
end
|
301
|
+
|
302
|
+
def limits_enabled?(*args)
|
303
|
+
return $cmd_tlm_server.limits_enabled?(*args)
|
304
|
+
end
|
305
|
+
|
306
|
+
def enable_limits(*args)
|
307
|
+
return $cmd_tlm_server.enable_limits(*args)
|
308
|
+
end
|
309
|
+
|
310
|
+
def disable_limits(*args)
|
311
|
+
return $cmd_tlm_server.disable_limits(*args)
|
312
|
+
end
|
313
|
+
|
314
|
+
def get_limits(target_name, packet_name, item_name, limits_set = nil)
|
315
|
+
results = $cmd_tlm_server.get_limits(target_name, packet_name, item_name, limits_set)
|
316
|
+
results[0] = results[0].to_s.intern if results[0]
|
317
|
+
return results
|
318
|
+
end
|
319
|
+
|
320
|
+
def set_limits(target_name, packet_name, item_name, red_low, yellow_low, yellow_high, red_high, green_low = nil, green_high = nil, limits_set = :CUSTOM, persistence = nil, enabled = true)
|
321
|
+
results = $cmd_tlm_server.set_limits(target_name, packet_name, item_name, red_low, yellow_low, yellow_high, red_high, green_low, green_high, limits_set, persistence, enabled)
|
322
|
+
results[0] = results[0].to_s.intern if results[0]
|
323
|
+
return results
|
324
|
+
end
|
325
|
+
|
326
|
+
def get_limits_groups
|
327
|
+
return $cmd_tlm_server.get_limits_groups
|
328
|
+
end
|
329
|
+
|
330
|
+
def enable_limits_group(group_name)
|
331
|
+
return $cmd_tlm_server.enable_limits_group(group_name)
|
332
|
+
end
|
333
|
+
|
334
|
+
def disable_limits_group(group_name)
|
335
|
+
return $cmd_tlm_server.disable_limits_group(group_name)
|
336
|
+
end
|
337
|
+
|
338
|
+
def get_limits_sets
|
339
|
+
result = $cmd_tlm_server.get_limits_sets
|
340
|
+
result.each_with_index do |limits_set, index|
|
341
|
+
result[index] = limits_set.to_s.intern
|
342
|
+
end
|
343
|
+
return result
|
344
|
+
end
|
345
|
+
|
346
|
+
def set_limits_set(limits_set)
|
347
|
+
return $cmd_tlm_server.set_limits_set(limits_set)
|
348
|
+
end
|
349
|
+
|
350
|
+
def get_limits_set
|
351
|
+
result = $cmd_tlm_server.get_limits_set
|
352
|
+
# Limits sets are always represented as symbols
|
353
|
+
result.to_s.intern
|
354
|
+
end
|
355
|
+
|
356
|
+
#
|
357
|
+
# General Purpose Methods
|
358
|
+
#
|
359
|
+
|
360
|
+
def get_target_list
|
361
|
+
return $cmd_tlm_server.get_target_list
|
362
|
+
end
|
363
|
+
|
364
|
+
def subscribe_limits_events(queue_size = CmdTlmServer::DEFAULT_LIMITS_EVENT_QUEUE_SIZE)
|
365
|
+
return $cmd_tlm_server.subscribe_limits_events(queue_size)
|
366
|
+
end
|
367
|
+
|
368
|
+
def unsubscribe_limits_events(id)
|
369
|
+
return $cmd_tlm_server.unsubscribe_limits_events(id)
|
370
|
+
end
|
371
|
+
|
372
|
+
def get_limits_event(id, non_block = false)
|
373
|
+
result = $cmd_tlm_server.get_limits_event(id, non_block)
|
374
|
+
if result
|
375
|
+
result[0] = result[0].to_s.intern
|
376
|
+
if result[0] == :LIMITS_CHANGE
|
377
|
+
result[1][3] = result[1][3].to_s.intern if result[1][3]
|
378
|
+
result[1][4] = result[1][4].to_s.intern if result[1][4]
|
379
|
+
elsif result[0] == :LIMITS_SETTINGS
|
380
|
+
result[1][3] = result[1][3].to_s.intern if result[1][3]
|
381
|
+
else
|
382
|
+
result[1] = result[1].to_s.intern
|
383
|
+
end
|
384
|
+
end
|
385
|
+
result
|
386
|
+
end
|
387
|
+
|
388
|
+
def subscribe_packet_data(packets, queue_size = CmdTlmServer::DEFAULT_PACKET_DATA_QUEUE_SIZE)
|
389
|
+
result = $cmd_tlm_server.subscribe_packet_data(packets, queue_size)
|
390
|
+
result
|
391
|
+
end
|
392
|
+
|
393
|
+
def unsubscribe_packet_data(id)
|
394
|
+
result = $cmd_tlm_server.unsubscribe_packet_data(id)
|
395
|
+
result
|
396
|
+
end
|
397
|
+
|
398
|
+
def get_packet_data(id, non_block = false)
|
399
|
+
results = $cmd_tlm_server.get_packet_data(id, non_block)
|
400
|
+
if Array === results and results[3] and results[4]
|
401
|
+
results[3] = Time.at(results[3], results[4])
|
402
|
+
results.delete_at(4)
|
403
|
+
end
|
404
|
+
results
|
405
|
+
end
|
406
|
+
|
407
|
+
def get_packet(id, non_block = false)
|
408
|
+
packet = nil
|
409
|
+
buffer, target_name, packet_name, received_time, received_count = get_packet_data(id, non_block)
|
410
|
+
if buffer
|
411
|
+
packet = System.telemetry.packet(target_name, packet_name).clone
|
412
|
+
packet.buffer = buffer
|
413
|
+
packet.received_time = received_time
|
414
|
+
packet.received_count = received_count
|
415
|
+
end
|
416
|
+
packet
|
417
|
+
end
|
418
|
+
|
419
|
+
#
|
420
|
+
# Methods for scripting
|
421
|
+
#
|
422
|
+
|
423
|
+
def play_wav_file(wav_filename)
|
424
|
+
if defined? Qt
|
425
|
+
Qt.execute_in_main_thread(true) do
|
426
|
+
if Qt::CoreApplication.instance and Qt::Sound.isAvailable
|
427
|
+
Cosmos.set_working_dir do
|
428
|
+
Qt::Sound.play(wav_filename.to_s)
|
429
|
+
end
|
430
|
+
end
|
431
|
+
end
|
432
|
+
end
|
433
|
+
end
|
434
|
+
|
435
|
+
def status_bar(message)
|
436
|
+
script_runner = nil
|
437
|
+
ObjectSpace.each_object {|object| if ScriptRunner === object then script_runner = object; break; end}
|
438
|
+
script_runner.script_set_status(message) if script_runner
|
439
|
+
end
|
440
|
+
|
441
|
+
def ask_string(question, allow_blank = false)
|
442
|
+
answer = ''
|
443
|
+
while answer.empty?
|
444
|
+
print question + " "
|
445
|
+
answer = gets
|
446
|
+
answer.chomp!
|
447
|
+
break if allow_blank
|
448
|
+
end
|
449
|
+
return answer
|
450
|
+
end
|
451
|
+
|
452
|
+
def ask(question, allow_blank = false)
|
453
|
+
string = ask_string(question, allow_blank)
|
454
|
+
value = string.convert_to_value
|
455
|
+
return value
|
456
|
+
end
|
457
|
+
|
458
|
+
def prompt(string)
|
459
|
+
prompt_to_continue(string)
|
460
|
+
end
|
461
|
+
|
462
|
+
def message_box(string, *buttons)
|
463
|
+
prompt_message_box(string, buttons)
|
464
|
+
end
|
465
|
+
|
466
|
+
def _check(*args)
|
467
|
+
target_name, packet_name, item_name, comparison_to_eval =
|
468
|
+
check_process_args(args, 'check')
|
469
|
+
value = yield(target_name, packet_name, item_name)
|
470
|
+
if comparison_to_eval
|
471
|
+
check_eval(target_name, packet_name, item_name, comparison_to_eval, value)
|
472
|
+
else
|
473
|
+
Logger.info "CHECK: #{target_name.upcase} #{packet_name.upcase} #{item_name.upcase} == #{value}"
|
474
|
+
end
|
475
|
+
end
|
476
|
+
|
477
|
+
# Check the converted value of a telmetry item against a condition
|
478
|
+
# Always print the value of the telemetry item to STDOUT
|
479
|
+
# If the condition check fails, raise an error
|
480
|
+
# Supports two signatures:
|
481
|
+
# check(target_name, packet_name, item_name, comparison_to_eval)
|
482
|
+
# or
|
483
|
+
# check('target_name packet_name item_name > 1')
|
484
|
+
def check(*args)
|
485
|
+
_check(*args) {|tgt,pkt,item| tlm(tgt,pkt,item) }
|
486
|
+
end
|
487
|
+
|
488
|
+
# Check the formatted value of a telmetry item against a condition
|
489
|
+
# Always print the value of the telemetry item to STDOUT
|
490
|
+
# If the condition check fails, raise an error
|
491
|
+
# Supports two signatures:
|
492
|
+
# check(target_name, packet_name, item_name, comparison_to_eval)
|
493
|
+
# or
|
494
|
+
# check('target_name packet_name item_name > 1')
|
495
|
+
def check_formatted(*args)
|
496
|
+
_check(*args) {|tgt,pkt,item| tlm_formatted(tgt,pkt,item) }
|
497
|
+
end
|
498
|
+
|
499
|
+
# Check the formatted with units value of a telmetry item against a condition
|
500
|
+
# Always print the value of the telemetry item to STDOUT
|
501
|
+
# If the condition check fails, raise an error
|
502
|
+
# Supports two signatures:
|
503
|
+
# check(target_name, packet_name, item_name, comparison_to_eval)
|
504
|
+
# or
|
505
|
+
# check('target_name packet_name item_name > 1')
|
506
|
+
def check_with_units(*args)
|
507
|
+
_check(*args) {|tgt,pkt,item| tlm_with_units(tgt,pkt,item) }
|
508
|
+
end
|
509
|
+
|
510
|
+
# Check the raw value of a telmetry item against a condition
|
511
|
+
# Always print the value of the telemetry item to STDOUT
|
512
|
+
# If the condition check fails, raise an error
|
513
|
+
# Supports two signatures:
|
514
|
+
# check(target_name, packet_name, item_name, comparison_to_eval)
|
515
|
+
# or
|
516
|
+
# check('target_name packet_name item_name > 1')
|
517
|
+
def check_raw(*args)
|
518
|
+
_check(*args) {|tgt,pkt,item| tlm_raw(tgt,pkt,item) }
|
519
|
+
end
|
520
|
+
|
521
|
+
def _check_tolerance(*args)
|
522
|
+
target_name, packet_name, item_name, expected_value, tolerance =
|
523
|
+
check_tolerance_process_args(args, 'check_tolerance')
|
524
|
+
value = yield(target_name, packet_name, item_name)
|
525
|
+
range = (expected_value - tolerance)..(expected_value + tolerance)
|
526
|
+
if range.include?(value)
|
527
|
+
Logger.info "CHECK: #{target_name.upcase} #{packet_name.upcase} #{item_name.upcase} was within range #{range.first} to #{range.last} with value == #{value}"
|
528
|
+
else
|
529
|
+
message = "CHECK: #{target_name.upcase} #{packet_name.upcase} #{item_name.upcase} failed to be within range #{range.first} to #{range.last} with value == #{value}"
|
530
|
+
if $cmd_tlm_disconnect
|
531
|
+
Logger.error message
|
532
|
+
else
|
533
|
+
raise CheckError, message
|
534
|
+
end
|
535
|
+
end
|
536
|
+
end
|
537
|
+
|
538
|
+
# Check the converted value of a telmetry item against an expected value with a tolerance
|
539
|
+
# Always print the value of the telemetry item to STDOUT
|
540
|
+
# If the condition check fails, raise an error
|
541
|
+
# Supports two signatures:
|
542
|
+
# check_tolerance(target_name, packet_name, item_name, expected_value, tolerance)
|
543
|
+
# or
|
544
|
+
# check_tolerance('target_name packet_name item_name', expected_value, tolerance)
|
545
|
+
def check_tolerance(*args)
|
546
|
+
_check_tolerance(*args) {|tgt,pkt,item| tlm(tgt,pkt,item) }
|
547
|
+
end
|
548
|
+
|
549
|
+
# Check the raw value of a telmetry item against an expected value with a tolerance
|
550
|
+
# Always print the value of the telemetry item to STDOUT
|
551
|
+
# If the condition check fails, raise an error
|
552
|
+
# Supports two signatures:
|
553
|
+
# check_tolerance_raw(target_name, packet_name, item_name, expected_value, tolerance)
|
554
|
+
# or
|
555
|
+
# check_tolerance_raw('target_name packet_name item_name', expected_value, tolerance)
|
556
|
+
def check_tolerance_raw(*args)
|
557
|
+
_check_tolerance(*args) {|tgt,pkt,item| tlm_raw(tgt,pkt,item) }
|
558
|
+
end
|
559
|
+
|
560
|
+
# Check to see if an expression is true without waiting. If the expression
|
561
|
+
# is not true, the script will pause.
|
562
|
+
def check_expression(exp_to_eval, context = nil)
|
563
|
+
success = cosmos_script_wait_implementation_expression(exp_to_eval, 0, DEFAULT_TLM_POLLING_RATE, context)
|
564
|
+
if success
|
565
|
+
Logger.info "CHECK: #{exp_to_eval} is TRUE"
|
566
|
+
else
|
567
|
+
message = "CHECK: #{exp_to_eval} is FALSE"
|
568
|
+
if $cmd_tlm_disconnect
|
569
|
+
Logger.error message
|
570
|
+
else
|
571
|
+
raise CheckError, message
|
572
|
+
end
|
573
|
+
end
|
574
|
+
end
|
575
|
+
|
576
|
+
# Wait on an expression to be true. On a timeout, the script will continue.
|
577
|
+
# Supports multiple signatures:
|
578
|
+
# wait(time)
|
579
|
+
# wait('target_name packet_name item_name > 1', timeout, polling_rate)
|
580
|
+
# wait('target_name', 'packet_name', 'item_name', comparison_to_eval, timeout, polling_rate)
|
581
|
+
def wait(*args)
|
582
|
+
wait_process_args(args, 'wait', :CONVERTED)
|
583
|
+
end
|
584
|
+
|
585
|
+
# Wait on an expression to be true. On a timeout, the script will continue.
|
586
|
+
# Supports multiple signatures:
|
587
|
+
# wait(time)
|
588
|
+
# wait_raw('target_name packet_name item_name > 1', timeout, polling_rate)
|
589
|
+
# wait_raw('target_name', 'packet_name', 'item_name', comparison_to_eval, timeout, polling_rate)
|
590
|
+
def wait_raw(*args)
|
591
|
+
wait_process_args(args, 'wait_raw', :RAW)
|
592
|
+
end
|
593
|
+
|
594
|
+
def _wait_tolerance(raw, *args)
|
595
|
+
type = (raw ? :RAW : :CONVERTED)
|
596
|
+
type_string = 'wait_tolerance'
|
597
|
+
type_string += '_raw' if raw
|
598
|
+
target_name, packet_name, item_name, expected_value, tolerance, timeout, polling_rate = wait_tolerance_process_args(args, type_string)
|
599
|
+
start_time = Time.now
|
600
|
+
success, value = cosmos_script_wait_implementation_tolerance(target_name, packet_name, item_name, type, expected_value, tolerance, timeout, polling_rate)
|
601
|
+
time = Time.now - start_time
|
602
|
+
range = (expected_value - tolerance)..(expected_value + tolerance)
|
603
|
+
if success
|
604
|
+
Logger.info "WAIT: #{target_name.upcase} #{packet_name.upcase} #{item_name.upcase} was within range #{range.first} to #{range.last} with value == #{value} after waiting #{time} seconds"
|
605
|
+
else
|
606
|
+
Logger.warn "WAIT: #{target_name.upcase} #{packet_name.upcase} #{item_name.upcase} failed to be within range #{range.first} to #{range.last} with value == #{value} after waiting #{time} seconds"
|
607
|
+
end
|
608
|
+
time
|
609
|
+
end
|
610
|
+
|
611
|
+
# Wait on an expression to be true. On a timeout, the script will continue.
|
612
|
+
# Supports multiple signatures:
|
613
|
+
# wait_tolerance('target_name packet_name item_name', expected_value, tolerance, timeout, polling_rate)
|
614
|
+
# wait_tolerance('target_name', 'packet_name', 'item_name', expected_value, tolerance, timeout, polling_rate)
|
615
|
+
def wait_tolerance(*args)
|
616
|
+
_wait_tolerance(false, *args)
|
617
|
+
end
|
618
|
+
|
619
|
+
# Wait on an expression to be true. On a timeout, the script will continue.
|
620
|
+
# Supports multiple signatures:
|
621
|
+
# wait_tolerance_raw('target_name packet_name item_name', expected_value, tolerance, timeout, polling_rate)
|
622
|
+
# wait_tolerance_raw('target_name', 'packet_name', 'item_name', expected_value, tolerance, timeout, polling_rate)
|
623
|
+
def wait_tolerance_raw(*args)
|
624
|
+
_wait_tolerance(true, *args)
|
625
|
+
end
|
626
|
+
|
627
|
+
# Wait on a custom expression to be true
|
628
|
+
def wait_expression(exp_to_eval, timeout, polling_rate = DEFAULT_TLM_POLLING_RATE, context = nil)
|
629
|
+
start_time = Time.now
|
630
|
+
success = cosmos_script_wait_implementation_expression(exp_to_eval, timeout, polling_rate, context)
|
631
|
+
time = Time.now - start_time
|
632
|
+
if success
|
633
|
+
Logger.info "WAIT: #{exp_to_eval} is TRUE after waiting #{time} seconds"
|
634
|
+
else
|
635
|
+
Logger.warn "WAIT: #{exp_to_eval} is FALSE after waiting #{time} seconds"
|
636
|
+
end
|
637
|
+
time
|
638
|
+
end
|
639
|
+
|
640
|
+
def _wait_check(raw, *args)
|
641
|
+
type = (raw ? :RAW : :CONVERTED)
|
642
|
+
target_name, packet_name, item_name, comparison_to_eval, timeout, polling_rate = wait_check_process_args(args, 'wait_check')
|
643
|
+
start_time = Time.now
|
644
|
+
success, value = cosmos_script_wait_implementation(target_name, packet_name, item_name, type, comparison_to_eval, timeout, polling_rate)
|
645
|
+
time = Time.now - start_time
|
646
|
+
if success
|
647
|
+
Logger.info "CHECK: #{target_name.upcase} #{packet_name.upcase} #{item_name.upcase} #{comparison_to_eval} success with value == #{value} after waiting #{time} seconds"
|
648
|
+
else
|
649
|
+
message = "CHECK: #{target_name.upcase} #{packet_name.upcase} #{item_name.upcase} #{comparison_to_eval} failed with value == #{value} after waiting #{time} seconds"
|
650
|
+
if $cmd_tlm_disconnect
|
651
|
+
Logger.error message
|
652
|
+
else
|
653
|
+
raise CheckError, message
|
654
|
+
end
|
655
|
+
end
|
656
|
+
time
|
657
|
+
end
|
658
|
+
|
659
|
+
# Wait for the converted value of a telmetry item against a condition or for a timeout
|
660
|
+
# and then check against the condition
|
661
|
+
# Supports two signatures:
|
662
|
+
# wait_check(target_name, packet_name, item_name, comparison_to_eval, timeout, polling_rate)
|
663
|
+
# or
|
664
|
+
# wait_check('target_name packet_name item_name > 1', timeout, polling_rate)
|
665
|
+
def wait_check(*args)
|
666
|
+
_wait_check(false, *args)
|
667
|
+
end
|
668
|
+
|
669
|
+
# Wait for the raw value of a telmetry item against a condition or for a timeout
|
670
|
+
# and then check against the condition
|
671
|
+
# Supports two signatures:
|
672
|
+
# wait_check_raw(target_name, packet_name, item_name, comparison_to_eval, timeout, polling_rate)
|
673
|
+
# or
|
674
|
+
# wait_check_raw('target_name packet_name item_name > 1', timeout, polling_rate)
|
675
|
+
def wait_check_raw(*args)
|
676
|
+
_wait_check(true, *args)
|
677
|
+
end
|
678
|
+
|
679
|
+
def _wait_check_tolerance(raw, *args)
|
680
|
+
type_string = 'wait_check_tolerance'
|
681
|
+
type_string += '_raw' if raw
|
682
|
+
type = (raw ? :RAW : :CONVERTED)
|
683
|
+
target_name, packet_name, item_name, expected_value, tolerance, timeout, polling_rate = wait_tolerance_process_args(args, type_string)
|
684
|
+
start_time = Time.now
|
685
|
+
success, value = cosmos_script_wait_implementation_tolerance(target_name, packet_name, item_name, type, expected_value, tolerance, timeout, polling_rate)
|
686
|
+
time = Time.now - start_time
|
687
|
+
range = (expected_value - tolerance)..(expected_value + tolerance)
|
688
|
+
if success
|
689
|
+
Logger.info "CHECK: #{target_name.upcase} #{packet_name.upcase} #{item_name.upcase} was within range #{range.first} to #{range.last} with value == #{value} after waiting #{time} seconds"
|
690
|
+
else
|
691
|
+
message = "CHECK: #{target_name.upcase} #{packet_name.upcase} #{item_name.upcase} failed to be within range #{range.first} to #{range.last} with value == #{value} after waiting #{time} seconds"
|
692
|
+
if $cmd_tlm_disconnect
|
693
|
+
Logger.error message
|
694
|
+
else
|
695
|
+
raise CheckError, message
|
696
|
+
end
|
697
|
+
end
|
698
|
+
time
|
699
|
+
end
|
700
|
+
|
701
|
+
def wait_check_tolerance(*args)
|
702
|
+
_wait_check_tolerance(false, *args)
|
703
|
+
end
|
704
|
+
|
705
|
+
def wait_check_tolerance_raw(*args)
|
706
|
+
_wait_check_tolerance(true, *args)
|
707
|
+
end
|
708
|
+
|
709
|
+
# Wait on an expression to be true. On a timeout, the script will pause.
|
710
|
+
def wait_check_expression(exp_to_eval,
|
711
|
+
timeout,
|
712
|
+
polling_rate = DEFAULT_TLM_POLLING_RATE,
|
713
|
+
context = nil)
|
714
|
+
start_time = Time.now
|
715
|
+
success = cosmos_script_wait_implementation_expression(exp_to_eval,
|
716
|
+
timeout,
|
717
|
+
polling_rate,
|
718
|
+
context)
|
719
|
+
time = Time.now - start_time
|
720
|
+
if success
|
721
|
+
Logger.info "CHECK: #{exp_to_eval} is TRUE after waiting #{time} seconds"
|
722
|
+
else
|
723
|
+
message = "CHECK: #{exp_to_eval} is FALSE after waiting #{time} seconds"
|
724
|
+
if $cmd_tlm_disconnect
|
725
|
+
Logger.error message
|
726
|
+
else
|
727
|
+
raise CheckError, message
|
728
|
+
end
|
729
|
+
end
|
730
|
+
time
|
731
|
+
end
|
732
|
+
alias wait_expression_stop_on_timeout wait_check_expression
|
733
|
+
|
734
|
+
# Wait for a telemetry packet to be received a certain number of times or timeout
|
735
|
+
def _wait_packet(check,
|
736
|
+
target_name,
|
737
|
+
packet_name,
|
738
|
+
num_packets,
|
739
|
+
timeout,
|
740
|
+
polling_rate = DEFAULT_TLM_POLLING_RATE)
|
741
|
+
type = (check ? 'CHECK' : 'WAIT')
|
742
|
+
initial_count = tlm(target_name, packet_name, 'RECEIVED_COUNT')
|
743
|
+
start_time = Time.now
|
744
|
+
success, value = cosmos_script_wait_implementation(target_name,
|
745
|
+
packet_name,
|
746
|
+
'RECEIVED_COUNT',
|
747
|
+
:CONVERTED,
|
748
|
+
">= #{initial_count + num_packets}",
|
749
|
+
timeout,
|
750
|
+
polling_rate)
|
751
|
+
time = Time.now - start_time
|
752
|
+
if success
|
753
|
+
Logger.info "#{type}: #{target_name.upcase} #{packet_name.upcase} received #{value - initial_count} times after waiting #{time} seconds"
|
754
|
+
else
|
755
|
+
message = "#{type}: #{target_name.upcase} #{packet_name.upcase} expected to be received #{num_packets} times but only received #{value - initial_count} times after waiting #{time} seconds"
|
756
|
+
if check
|
757
|
+
if $cmd_tlm_disconnect
|
758
|
+
Logger.error message
|
759
|
+
else
|
760
|
+
raise CheckError, message
|
761
|
+
end
|
762
|
+
else
|
763
|
+
Logger.warn message
|
764
|
+
end
|
765
|
+
end
|
766
|
+
time
|
767
|
+
end
|
768
|
+
|
769
|
+
def wait_packet(target_name,
|
770
|
+
packet_name,
|
771
|
+
num_packets,
|
772
|
+
timeout,
|
773
|
+
polling_rate = DEFAULT_TLM_POLLING_RATE)
|
774
|
+
_wait_packet(false, target_name, packet_name, num_packets, timeout, polling_rate)
|
775
|
+
end
|
776
|
+
|
777
|
+
# Wait for a telemetry packet to be received a certain number of times or timeout and raise an error
|
778
|
+
def wait_check_packet(target_name,
|
779
|
+
packet_name,
|
780
|
+
num_packets,
|
781
|
+
timeout,
|
782
|
+
polling_rate = DEFAULT_TLM_POLLING_RATE)
|
783
|
+
_wait_packet(true, target_name, packet_name, num_packets, timeout, polling_rate)
|
784
|
+
end
|
785
|
+
|
786
|
+
def get_interface_names
|
787
|
+
return $cmd_tlm_server.get_interface_names
|
788
|
+
end
|
789
|
+
|
790
|
+
def connect_interface(interface_name, *params)
|
791
|
+
return $cmd_tlm_server.connect_interface(interface_name, *params)
|
792
|
+
end
|
793
|
+
|
794
|
+
def disconnect_interface(interface_name)
|
795
|
+
return $cmd_tlm_server.disconnect_interface(interface_name)
|
796
|
+
end
|
797
|
+
|
798
|
+
def interface_state(interface_name)
|
799
|
+
return $cmd_tlm_server.interface_state(interface_name)
|
800
|
+
end
|
801
|
+
|
802
|
+
def map_target_to_interface(target_name, interface_name)
|
803
|
+
return $cmd_tlm_server.map_target_to_interface(target_name, interface_name)
|
804
|
+
end
|
805
|
+
|
806
|
+
def get_router_names
|
807
|
+
return $cmd_tlm_server.get_router_names
|
808
|
+
end
|
809
|
+
|
810
|
+
def connect_router(router_name, *params)
|
811
|
+
return $cmd_tlm_server.connect_router(router_name, *params)
|
812
|
+
end
|
813
|
+
|
814
|
+
def disconnect_router(router_name)
|
815
|
+
return $cmd_tlm_server.disconnect_router(router_name)
|
816
|
+
end
|
817
|
+
|
818
|
+
def router_state(router_name)
|
819
|
+
return $cmd_tlm_server.router_state(router_name)
|
820
|
+
end
|
821
|
+
|
822
|
+
def get_cmd_log_filename(packet_log_writer_name = 'DEFAULT')
|
823
|
+
return $cmd_tlm_server.get_cmd_log_filename(packet_log_writer_name)
|
824
|
+
end
|
825
|
+
|
826
|
+
def get_tlm_log_filename(packet_log_writer_name = 'DEFAULT')
|
827
|
+
return $cmd_tlm_server.get_tlm_log_filename(packet_log_writer_name)
|
828
|
+
end
|
829
|
+
|
830
|
+
def start_logging(packet_log_writer_name = 'ALL', label = nil)
|
831
|
+
return $cmd_tlm_server.start_logging(packet_log_writer_name, label)
|
832
|
+
end
|
833
|
+
|
834
|
+
def stop_logging(packet_log_writer_name = 'ALL')
|
835
|
+
return $cmd_tlm_server.stop_logging(packet_log_writer_name)
|
836
|
+
end
|
837
|
+
|
838
|
+
def start_cmd_log(packet_log_writer_name = 'ALL', label = nil)
|
839
|
+
return $cmd_tlm_server.start_cmd_log(packet_log_writer_name, label)
|
840
|
+
end
|
841
|
+
|
842
|
+
def start_tlm_log(packet_log_writer_name = 'ALL', label = nil)
|
843
|
+
return $cmd_tlm_server.start_tlm_log(packet_log_writer_name, label)
|
844
|
+
end
|
845
|
+
|
846
|
+
def stop_cmd_log(packet_log_writer_name = 'ALL')
|
847
|
+
return $cmd_tlm_server.stop_cmd_log(packet_log_writer_name)
|
848
|
+
end
|
849
|
+
|
850
|
+
def stop_tlm_log(packet_log_writer_name = 'ALL')
|
851
|
+
return $cmd_tlm_server.stop_tlm_log(packet_log_writer_name)
|
852
|
+
end
|
853
|
+
|
854
|
+
def start_raw_logging_interface(interface_name = 'ALL')
|
855
|
+
return $cmd_tlm_server.start_raw_logging_interface(interface_name)
|
856
|
+
end
|
857
|
+
|
858
|
+
def stop_raw_logging_interface(interface_name = 'ALL')
|
859
|
+
return $cmd_tlm_server.stop_raw_logging_interface(interface_name)
|
860
|
+
end
|
861
|
+
|
862
|
+
def start_raw_logging_router(router_name = 'ALL')
|
863
|
+
return $cmd_tlm_server.start_raw_logging_router(router_name)
|
864
|
+
end
|
865
|
+
|
866
|
+
def stop_raw_logging_router(router_name = 'ALL')
|
867
|
+
return $cmd_tlm_server.stop_raw_logging_router(router_name)
|
868
|
+
end
|
869
|
+
|
870
|
+
def get_server_message_log_filename
|
871
|
+
return $cmd_tlm_server.get_server_message_log_filename
|
872
|
+
end
|
873
|
+
|
874
|
+
def start_new_server_message_log
|
875
|
+
return $cmd_tlm_server.start_new_server_message_log
|
876
|
+
end
|
877
|
+
|
878
|
+
#######################################
|
879
|
+
# Methods accessing tlm_viewer
|
880
|
+
#######################################
|
881
|
+
|
882
|
+
def display(display_name, x_pos = nil, y_pos = nil)
|
883
|
+
tlm_viewer = JsonDRbObject.new "localhost", System.ports['TLMVIEWER_API']
|
884
|
+
begin
|
885
|
+
tlm_viewer.display(display_name, x_pos, y_pos)
|
886
|
+
tlm_viewer.disconnect
|
887
|
+
rescue DRb::DRbConnError
|
888
|
+
# No Listening Tlm Viewer - So Start One
|
889
|
+
if Kernel.is_windows?
|
890
|
+
Cosmos.run_process('rubyw "' + File.join(Cosmos::USERPATH, 'tools', 'TlmViewer') + '"' + " --system #{File.basename(System.initial_filename)}")
|
891
|
+
elsif Kernel.is_mac? and File.exist?(File.join(Cosmos::USERPATH, 'tools', 'mac', 'TlmViewer.app'))
|
892
|
+
Cosmos.run_process('open "' + File.join(Cosmos::USERPATH, 'tools', 'mac', 'TlmViewer.app') + '"' + " --args --system #{File.basename(System.initial_filename)}")
|
893
|
+
else
|
894
|
+
Cosmos.run_process('ruby "' + File.join(Cosmos::USERPATH, 'tools', 'TlmViewer') + '"' + " --system #{File.basename(System.initial_filename)}")
|
895
|
+
end
|
896
|
+
sleep(5)
|
897
|
+
begin
|
898
|
+
tlm_viewer.display(display_name, x_pos, y_pos)
|
899
|
+
tlm_viewer.disconnect
|
900
|
+
rescue DRb::DRbConnError
|
901
|
+
raise "Unable to Successfully Start Listening Telemetry Viewer: #{display_name} could not be displayed"
|
902
|
+
rescue Errno::ENOENT
|
903
|
+
raise "Display Screen File: #{display_name}.txt does not exist"
|
904
|
+
end
|
905
|
+
rescue Errno::ENOENT
|
906
|
+
raise "Display Screen File: #{display_name}.txt does not exist"
|
907
|
+
end
|
908
|
+
end
|
909
|
+
|
910
|
+
def clear(display_name)
|
911
|
+
tlm_viewer = JsonDRbObject.new "localhost", System.ports['TLMVIEWER_API']
|
912
|
+
begin
|
913
|
+
tlm_viewer.clear(display_name)
|
914
|
+
tlm_viewer.disconnect
|
915
|
+
rescue DRb::DRbConnError
|
916
|
+
raise "No Listening Telemetry Viewer: #{display_name} could not be cleared"
|
917
|
+
rescue Errno::ENOENT
|
918
|
+
raise "Display Screen File: #{display_name}.txt does not exist"
|
919
|
+
end
|
920
|
+
end
|
921
|
+
|
922
|
+
#######################################
|
923
|
+
# Methods accessing script runner
|
924
|
+
#######################################
|
925
|
+
|
926
|
+
def set_line_delay(delay)
|
927
|
+
if defined? ScriptRunnerFrame
|
928
|
+
ScriptRunnerFrame.line_delay = delay if delay >= 0.0
|
929
|
+
end
|
930
|
+
end
|
931
|
+
|
932
|
+
def get_line_delay
|
933
|
+
if defined? ScriptRunnerFrame
|
934
|
+
ScriptRunnerFrame.line_delay
|
935
|
+
end
|
936
|
+
end
|
937
|
+
|
938
|
+
def get_scriptrunner_message_log_filename
|
939
|
+
filename = nil
|
940
|
+
if defined? ScriptRunnerFrame
|
941
|
+
filename = ScriptRunnerFrame.instance.message_log.filename if ScriptRunnerFrame.instance and ScriptRunnerFrame.instance.message_log
|
942
|
+
end
|
943
|
+
return filename
|
944
|
+
end
|
945
|
+
|
946
|
+
def start_new_scriptrunner_message_log
|
947
|
+
if defined? ScriptRunnerFrame
|
948
|
+
# A new log will be created at the next message
|
949
|
+
ScriptRunnerFrame.instance.stop_message_log if ScriptRunnerFrame.instance
|
950
|
+
end
|
951
|
+
end
|
952
|
+
|
953
|
+
#######################################
|
954
|
+
# Methods for debugging
|
955
|
+
#######################################
|
956
|
+
|
957
|
+
def insert_return(*params)
|
958
|
+
if defined? ScriptRunnerFrame
|
959
|
+
if ScriptRunnerFrame.instance
|
960
|
+
ScriptRunnerFrame.instance.inline_return = true
|
961
|
+
ScriptRunnerFrame.instance.inline_return_params = params
|
962
|
+
end
|
963
|
+
end
|
964
|
+
end
|
965
|
+
|
966
|
+
def step_mode
|
967
|
+
if defined? ScriptRunnerFrame
|
968
|
+
ScriptRunnerFrame.step_mode = true
|
969
|
+
end
|
970
|
+
end
|
971
|
+
|
972
|
+
def run_mode
|
973
|
+
if defined? ScriptRunnerFrame
|
974
|
+
ScriptRunnerFrame.step_mode = false
|
975
|
+
end
|
976
|
+
end
|
977
|
+
|
978
|
+
def show_backtrace(value = true)
|
979
|
+
if defined? ScriptRunnerFrame
|
980
|
+
ScriptRunnerFrame.show_backtrace = value
|
981
|
+
end
|
982
|
+
end
|
983
|
+
|
984
|
+
##########################################
|
985
|
+
# End Methods accessing other systems
|
986
|
+
##########################################
|
987
|
+
|
988
|
+
def start(procedure_name)
|
989
|
+
# Handle not-giving an extension
|
990
|
+
procedure_name_with_extension = nil
|
991
|
+
procedure_name_with_extension = procedure_name + '.rb' if File.extname(procedure_name).empty?
|
992
|
+
|
993
|
+
file_text = ''
|
994
|
+
path = nil
|
995
|
+
|
996
|
+
# Find filename in search path
|
997
|
+
($:).each do |directory|
|
998
|
+
if File.exist?(directory + '/' + procedure_name) and not File.directory?(directory + '/' + procedure_name)
|
999
|
+
path = directory + '/' + procedure_name
|
1000
|
+
break
|
1001
|
+
end
|
1002
|
+
|
1003
|
+
if procedure_name_with_extension and File.exist?(directory + '/' + procedure_name_with_extension)
|
1004
|
+
procedure_name = procedure_name_with_extension
|
1005
|
+
path = directory + '/' + procedure_name
|
1006
|
+
break
|
1007
|
+
end
|
1008
|
+
end
|
1009
|
+
|
1010
|
+
# Handle absolute path
|
1011
|
+
path = procedure_name if !path and File.exist?(procedure_name)
|
1012
|
+
path = procedure_name_with_extension if !path and procedure_name_with_extension and File.exist?(procedure_name_with_extension)
|
1013
|
+
|
1014
|
+
raise "Procedure not found : #{procedure_name}" unless path
|
1015
|
+
|
1016
|
+
if defined? ScriptRunnerFrame and ScriptRunnerFrame.instance
|
1017
|
+
result = false
|
1018
|
+
md5 = nil
|
1019
|
+
begin
|
1020
|
+
md5 = Cosmos.md5_files([path]).hexdigest
|
1021
|
+
rescue Exception => error
|
1022
|
+
raise "Error calculating md5 on procedure file : #{path}"
|
1023
|
+
end
|
1024
|
+
|
1025
|
+
# Check RAM based instrumented cache
|
1026
|
+
instrumented_cache = ScriptRunnerFrame.instrumented_cache[path]
|
1027
|
+
instrumented_script = nil
|
1028
|
+
if instrumented_cache and md5 == instrumented_cache[1]
|
1029
|
+
# Use cached instrumentation
|
1030
|
+
instrumented_script = instrumented_cache[0]
|
1031
|
+
else
|
1032
|
+
use_file_cache = true
|
1033
|
+
cache_filename = nil
|
1034
|
+
flat_path = nil
|
1035
|
+
|
1036
|
+
# Check for cache directory existence
|
1037
|
+
Cosmos.set_working_dir do
|
1038
|
+
cache_path = File.join(System.paths['TMP'], 'script_runner')
|
1039
|
+
unless File.directory?(cache_path)
|
1040
|
+
# Try to create .cache directory
|
1041
|
+
begin
|
1042
|
+
Dir.mkdir(cache_path)
|
1043
|
+
rescue
|
1044
|
+
use_file_cache = false
|
1045
|
+
end
|
1046
|
+
end
|
1047
|
+
|
1048
|
+
if use_file_cache
|
1049
|
+
# Check file based instrumented cache
|
1050
|
+
flat_path = path.gsub("/", "_").gsub("\\", "_").gsub(":", "_").gsub(" ", "_")
|
1051
|
+
flat_path_with_md5 = flat_path + '_' + md5
|
1052
|
+
cache_filename = File.join(cache_path, flat_path_with_md5)
|
1053
|
+
end
|
1054
|
+
|
1055
|
+
if use_file_cache and File.exist?(cache_filename)
|
1056
|
+
# Use file cached instrumentation
|
1057
|
+
File.open(cache_filename, 'r') {|file| instrumented_script = file.read}
|
1058
|
+
else
|
1059
|
+
# Have to instrument
|
1060
|
+
result = true
|
1061
|
+
|
1062
|
+
# Build instrumentation
|
1063
|
+
begin
|
1064
|
+
file_text = File.read(path)
|
1065
|
+
rescue Exception => error
|
1066
|
+
raise "Error reading procedure file : #{path}"
|
1067
|
+
end
|
1068
|
+
|
1069
|
+
instrumented_script = ScriptRunnerFrame.instrument_script(file_text, path, true)
|
1070
|
+
|
1071
|
+
# Cache instrumentation into file
|
1072
|
+
if use_file_cache
|
1073
|
+
begin
|
1074
|
+
File.open(cache_filename, 'w') {|file| file.write(instrumented_script)}
|
1075
|
+
rescue
|
1076
|
+
# Oh well, failed to write cache file
|
1077
|
+
end
|
1078
|
+
end
|
1079
|
+
end
|
1080
|
+
end
|
1081
|
+
|
1082
|
+
# Cache instrumentation into RAM
|
1083
|
+
ScriptRunnerFrame.instrumented_cache[path] = [instrumented_script, md5]
|
1084
|
+
end
|
1085
|
+
|
1086
|
+
Object.class_eval(instrumented_script, path, 1)
|
1087
|
+
else # No ScriptRunnerFrame so just start it locally
|
1088
|
+
result = true
|
1089
|
+
|
1090
|
+
begin
|
1091
|
+
Kernel::load(path)
|
1092
|
+
rescue LoadError => error
|
1093
|
+
raise RuntimeError.new("Error loading : #{procedure_name} : #{error.message}")
|
1094
|
+
end
|
1095
|
+
end
|
1096
|
+
result
|
1097
|
+
end
|
1098
|
+
|
1099
|
+
# Require an additional ruby file
|
1100
|
+
def load_utility(procedure_name)
|
1101
|
+
result = false
|
1102
|
+
if defined? ScriptRunnerFrame and ScriptRunnerFrame.instance
|
1103
|
+
saved = ScriptRunnerFrame.instance.use_instrumentation
|
1104
|
+
begin
|
1105
|
+
ScriptRunnerFrame.instance.use_instrumentation = false
|
1106
|
+
result = start(procedure_name)
|
1107
|
+
ensure
|
1108
|
+
ScriptRunnerFrame.instance.use_instrumentation = saved
|
1109
|
+
end
|
1110
|
+
else # Just call start
|
1111
|
+
result = start(procedure_name)
|
1112
|
+
end
|
1113
|
+
result
|
1114
|
+
end
|
1115
|
+
alias require_utility load_utility
|
1116
|
+
|
1117
|
+
##########################################
|
1118
|
+
# Protected Methods
|
1119
|
+
##########################################
|
1120
|
+
|
1121
|
+
def check_process_args(args, function_name)
|
1122
|
+
case args.length
|
1123
|
+
when 1
|
1124
|
+
target_name, packet_name, item_name, comparison_to_eval = extract_fields_from_check_text(args[0])
|
1125
|
+
when 4
|
1126
|
+
target_name = args[0]
|
1127
|
+
packet_name = args[1]
|
1128
|
+
item_name = args[2]
|
1129
|
+
comparison_to_eval = args[3]
|
1130
|
+
else
|
1131
|
+
# Invalid number of arguments
|
1132
|
+
raise "ERROR: Invalid number of arguments (#{args.length}) passed to #{function_name}()"
|
1133
|
+
end
|
1134
|
+
return [target_name, packet_name, item_name, comparison_to_eval]
|
1135
|
+
end
|
1136
|
+
|
1137
|
+
def check_tolerance_process_args(args, function_name)
|
1138
|
+
case args.length
|
1139
|
+
when 3
|
1140
|
+
target_name, packet_name, item_name = extract_fields_from_tlm_text(args[0])
|
1141
|
+
expected_value = args[1]
|
1142
|
+
tolerance = args[2]
|
1143
|
+
when 5
|
1144
|
+
target_name = args[0]
|
1145
|
+
packet_name = args[1]
|
1146
|
+
item_name = args[2]
|
1147
|
+
expected_value = args[3]
|
1148
|
+
tolerance = args[4]
|
1149
|
+
else
|
1150
|
+
# Invalid number of arguments
|
1151
|
+
raise "ERROR: Invalid number of arguments (#{args.length}) passed to #{function_name}()"
|
1152
|
+
end
|
1153
|
+
return [target_name, packet_name, item_name, expected_value, tolerance]
|
1154
|
+
end
|
1155
|
+
|
1156
|
+
def wait_process_args(args, function_name, value_type)
|
1157
|
+
time = nil
|
1158
|
+
|
1159
|
+
case args.length
|
1160
|
+
when 0
|
1161
|
+
start_time = Time.now
|
1162
|
+
cosmos_script_sleep()
|
1163
|
+
time = Time.now - start_time
|
1164
|
+
Logger.info("WAIT: Indefinite for actual time of #{time} seconds")
|
1165
|
+
when 1
|
1166
|
+
if args[0].kind_of? Numeric
|
1167
|
+
start_time = Time.now
|
1168
|
+
cosmos_script_sleep(args[0])
|
1169
|
+
time = Time.now - start_time
|
1170
|
+
Logger.info("WAIT: #{args[0]} seconds with actual time of #{time} seconds")
|
1171
|
+
else
|
1172
|
+
raise "Non-numeric wait time specified"
|
1173
|
+
end
|
1174
|
+
when 2, 3
|
1175
|
+
target_name, packet_name, item_name, comparison_to_eval = extract_fields_from_check_text(args[0])
|
1176
|
+
timeout = args[1]
|
1177
|
+
if args.length == 3
|
1178
|
+
polling_rate = args[2]
|
1179
|
+
else
|
1180
|
+
polling_rate = DEFAULT_TLM_POLLING_RATE
|
1181
|
+
end
|
1182
|
+
start_time = Time.now
|
1183
|
+
success, value = cosmos_script_wait_implementation(target_name, packet_name, item_name, value_type, comparison_to_eval, timeout, polling_rate)
|
1184
|
+
time = Time.now - start_time
|
1185
|
+
if success
|
1186
|
+
Logger.info "WAIT: #{target_name.upcase} #{packet_name.upcase} #{item_name.upcase} #{comparison_to_eval} success with value == #{value} after waiting #{time} seconds"
|
1187
|
+
else
|
1188
|
+
Logger.warn "WAIT: #{target_name.upcase} #{packet_name.upcase} #{item_name.upcase} #{comparison_to_eval} failed with value == #{value} after waiting #{time} seconds"
|
1189
|
+
end
|
1190
|
+
when 5, 6
|
1191
|
+
target_name = args[0]
|
1192
|
+
packet_name = args[1]
|
1193
|
+
item_name = args[2]
|
1194
|
+
comparison_to_eval = args[3]
|
1195
|
+
timeout = args[4]
|
1196
|
+
if args.length == 6
|
1197
|
+
polling_rate = args[5]
|
1198
|
+
else
|
1199
|
+
polling_rate = DEFAULT_TLM_POLLING_RATE
|
1200
|
+
end
|
1201
|
+
start_time = Time.now
|
1202
|
+
success, value = cosmos_script_wait_implementation(target_name, packet_name, item_name, value_type, comparison_to_eval, timeout, polling_rate)
|
1203
|
+
time = Time.now - start_time
|
1204
|
+
if success
|
1205
|
+
Logger.info "WAIT: #{target_name.upcase} #{packet_name.upcase} #{item_name.upcase} #{comparison_to_eval} success with value == #{value} after waiting #{time} seconds"
|
1206
|
+
else
|
1207
|
+
Logger.warn "WAIT: #{target_name.upcase} #{packet_name.upcase} #{item_name.upcase} #{comparison_to_eval} failed with value == #{value} after waiting #{time} seconds"
|
1208
|
+
end
|
1209
|
+
else
|
1210
|
+
# Invalid number of arguments
|
1211
|
+
raise "ERROR: Invalid number of arguments (#{args.length}) passed to #{function_name}()"
|
1212
|
+
end
|
1213
|
+
time
|
1214
|
+
end
|
1215
|
+
|
1216
|
+
def wait_tolerance_process_args(args, function_name)
|
1217
|
+
case args.length
|
1218
|
+
when 4, 5
|
1219
|
+
target_name, packet_name, item_name = extract_fields_from_tlm_text(args[0])
|
1220
|
+
expected_value = args[1]
|
1221
|
+
tolerance = args[2]
|
1222
|
+
timeout = args[3]
|
1223
|
+
if args.length == 5
|
1224
|
+
polling_rate = args[4]
|
1225
|
+
else
|
1226
|
+
polling_rate = DEFAULT_TLM_POLLING_RATE
|
1227
|
+
end
|
1228
|
+
when 6, 7
|
1229
|
+
target_name = args[0]
|
1230
|
+
packet_name = args[1]
|
1231
|
+
item_name = args[2]
|
1232
|
+
expected_value = args[3]
|
1233
|
+
tolerance = args[4]
|
1234
|
+
timeout = args[5]
|
1235
|
+
if args.length == 7
|
1236
|
+
polling_rate = args[6]
|
1237
|
+
else
|
1238
|
+
polling_rate = DEFAULT_TLM_POLLING_RATE
|
1239
|
+
end
|
1240
|
+
else
|
1241
|
+
# Invalid number of arguments
|
1242
|
+
raise "ERROR: Invalid number of arguments (#{args.length}) passed to #{function_name}()"
|
1243
|
+
end
|
1244
|
+
return [target_name, packet_name, item_name, expected_value, tolerance, timeout, polling_rate]
|
1245
|
+
end
|
1246
|
+
|
1247
|
+
def wait_check_process_args(args, function_name)
|
1248
|
+
case args.length
|
1249
|
+
when 2,3
|
1250
|
+
target_name, packet_name, item_name, comparison_to_eval = extract_fields_from_check_text(args[0])
|
1251
|
+
timeout = args[1]
|
1252
|
+
if args.length == 3
|
1253
|
+
polling_rate = args[2]
|
1254
|
+
else
|
1255
|
+
polling_rate = DEFAULT_TLM_POLLING_RATE
|
1256
|
+
end
|
1257
|
+
when 5,6
|
1258
|
+
target_name = args[0]
|
1259
|
+
packet_name = args[1]
|
1260
|
+
item_name = args[2]
|
1261
|
+
comparison_to_eval = args[3]
|
1262
|
+
timeout = args[4]
|
1263
|
+
if args.length == 6
|
1264
|
+
polling_rate = args[5]
|
1265
|
+
else
|
1266
|
+
polling_rate = DEFAULT_TLM_POLLING_RATE
|
1267
|
+
end
|
1268
|
+
else
|
1269
|
+
# Invalid number of arguments
|
1270
|
+
raise "ERROR: Invalid number of arguments (#{args.length}) passed to #{function_name}()"
|
1271
|
+
end
|
1272
|
+
return [target_name, packet_name, item_name, comparison_to_eval, timeout, polling_rate]
|
1273
|
+
end
|
1274
|
+
|
1275
|
+
# sleep in a script - returns true if canceled mid sleep
|
1276
|
+
def cosmos_script_sleep(sleep_time = nil)
|
1277
|
+
return false if $cmd_tlm_disconnect
|
1278
|
+
if defined? ScriptRunnerFrame and ScriptRunnerFrame.instance
|
1279
|
+
sleep_time = 30000000 unless sleep_time # Handle infinite wait
|
1280
|
+
if sleep_time > 0.0
|
1281
|
+
end_time = Time.now + sleep_time
|
1282
|
+
until (Time.now >= end_time)
|
1283
|
+
sleep(0.01)
|
1284
|
+
if ScriptRunnerFrame.instance.pause?
|
1285
|
+
ScriptRunnerFrame.instance.perform_pause
|
1286
|
+
return true
|
1287
|
+
end
|
1288
|
+
return true if ScriptRunnerFrame.instance.go?
|
1289
|
+
raise StopScript if ScriptRunnerFrame.instance.stop?
|
1290
|
+
end
|
1291
|
+
end
|
1292
|
+
else
|
1293
|
+
if sleep_time
|
1294
|
+
sleep(sleep_time)
|
1295
|
+
else
|
1296
|
+
print 'Infinite Wait - Press Enter to Continue: '
|
1297
|
+
gets()
|
1298
|
+
end
|
1299
|
+
end
|
1300
|
+
return false
|
1301
|
+
end
|
1302
|
+
|
1303
|
+
def _cosmos_script_wait_implementation(target_name, packet_name, item_name, value_type, timeout, polling_rate)
|
1304
|
+
end_time = Time.now + timeout
|
1305
|
+
exp_to_eval = yield
|
1306
|
+
|
1307
|
+
while true
|
1308
|
+
work_start = Time.now
|
1309
|
+
value = tlm_variable(target_name, packet_name, item_name, value_type)
|
1310
|
+
if eval(exp_to_eval)
|
1311
|
+
return true, value
|
1312
|
+
end
|
1313
|
+
break if Time.now >= end_time || $cmd_tlm_disconnect
|
1314
|
+
|
1315
|
+
delta = Time.now - work_start
|
1316
|
+
sleep_time = polling_rate - delta
|
1317
|
+
end_delta = end_time - Time.now
|
1318
|
+
sleep_time = end_delta if end_delta < sleep_time
|
1319
|
+
sleep_time = 0 if sleep_time < 0
|
1320
|
+
canceled = cosmos_script_sleep(sleep_time)
|
1321
|
+
|
1322
|
+
if canceled
|
1323
|
+
value = tlm_variable(target_name, packet_name, item_name, value_type)
|
1324
|
+
if eval(exp_to_eval)
|
1325
|
+
return true, value
|
1326
|
+
else
|
1327
|
+
return false, value
|
1328
|
+
end
|
1329
|
+
end
|
1330
|
+
end
|
1331
|
+
|
1332
|
+
return false, value
|
1333
|
+
end
|
1334
|
+
|
1335
|
+
# Wait for a converted telemetry item to pass a comparison
|
1336
|
+
def cosmos_script_wait_implementation(target_name, packet_name, item_name, value_type, comparison_to_eval, timeout, polling_rate = DEFAULT_TLM_POLLING_RATE)
|
1337
|
+
_cosmos_script_wait_implementation(target_name, packet_name, item_name, value_type, timeout, polling_rate) do
|
1338
|
+
"value " + comparison_to_eval
|
1339
|
+
end
|
1340
|
+
end
|
1341
|
+
|
1342
|
+
def cosmos_script_wait_implementation_tolerance(target_name, packet_name, item_name, value_type, expected_value, tolerance, timeout, polling_rate = DEFAULT_TLM_POLLING_RATE)
|
1343
|
+
_cosmos_script_wait_implementation(target_name, packet_name, item_name, value_type, timeout, polling_rate) do
|
1344
|
+
"((#{expected_value} - #{tolerance})..(#{expected_value} + #{tolerance})).include? value"
|
1345
|
+
end
|
1346
|
+
end
|
1347
|
+
|
1348
|
+
# Wait on an expression to be true.
|
1349
|
+
def cosmos_script_wait_implementation_expression(exp_to_eval, timeout, polling_rate, context)
|
1350
|
+
end_time = Time.now + timeout
|
1351
|
+
context = ScriptRunnerFrame.instance.script_binding if !context and defined? ScriptRunnerFrame and ScriptRunnerFrame.instance
|
1352
|
+
|
1353
|
+
while true
|
1354
|
+
work_start = Time.now
|
1355
|
+
if eval(exp_to_eval, context)
|
1356
|
+
return true
|
1357
|
+
end
|
1358
|
+
break if Time.now >= end_time
|
1359
|
+
|
1360
|
+
delta = Time.now - work_start
|
1361
|
+
sleep_time = polling_rate - delta
|
1362
|
+
end_delta = end_time - Time.now
|
1363
|
+
sleep_time = end_delta if end_delta < sleep_time
|
1364
|
+
sleep_time = 0 if sleep_time < 0
|
1365
|
+
canceled = cosmos_script_sleep(sleep_time)
|
1366
|
+
|
1367
|
+
if canceled
|
1368
|
+
if eval(exp_to_eval, context)
|
1369
|
+
return true
|
1370
|
+
else
|
1371
|
+
return nil
|
1372
|
+
end
|
1373
|
+
end
|
1374
|
+
end
|
1375
|
+
|
1376
|
+
return nil
|
1377
|
+
end
|
1378
|
+
|
1379
|
+
def check_eval(target_name, packet_name, item_name, comparison_to_eval, value)
|
1380
|
+
string = "value " + comparison_to_eval
|
1381
|
+
if eval(string)
|
1382
|
+
Logger.info "CHECK: #{target_name.upcase} #{packet_name.upcase} #{item_name.upcase} #{comparison_to_eval} success with value == #{value}"
|
1383
|
+
else
|
1384
|
+
message = "CHECK: #{target_name.upcase} #{packet_name.upcase} #{item_name.upcase} #{comparison_to_eval} failed with value == #{value}"
|
1385
|
+
if $cmd_tlm_disconnect
|
1386
|
+
Logger.error message
|
1387
|
+
else
|
1388
|
+
raise CheckError, message
|
1389
|
+
end
|
1390
|
+
end
|
1391
|
+
end
|
1392
|
+
|
1393
|
+
def build_cmd_output_string(target_name, cmd_name, cmd_params, raw = false)
|
1394
|
+
if raw
|
1395
|
+
output_string = 'cmd_raw("'
|
1396
|
+
else
|
1397
|
+
output_string = 'cmd("'
|
1398
|
+
end
|
1399
|
+
output_string << target_name + ' ' + cmd_name
|
1400
|
+
if cmd_params.nil? or cmd_params.empty?
|
1401
|
+
output_string += '")'
|
1402
|
+
else
|
1403
|
+
params = []
|
1404
|
+
cmd_params.each do |key, value|
|
1405
|
+
if value.class == String
|
1406
|
+
if value.convert_to_value.class == String
|
1407
|
+
value = value.inspect
|
1408
|
+
if value.length > 256
|
1409
|
+
value = value[0..255] + "...'"
|
1410
|
+
end
|
1411
|
+
value.gsub!('"',"'")
|
1412
|
+
end
|
1413
|
+
end
|
1414
|
+
params << "#{key} #{value}"
|
1415
|
+
end
|
1416
|
+
params = params.join(", ")
|
1417
|
+
output_string += ' with ' + params + '")'
|
1418
|
+
end
|
1419
|
+
return output_string
|
1420
|
+
end
|
1421
|
+
|
1422
|
+
def prompt_for_hazardous(target_name, cmd_name, hazardous_description)
|
1423
|
+
message = "Warning: Command #{target_name} #{cmd_name} is Hazardous. "
|
1424
|
+
message << "\n#{hazardous_description}\n" if hazardous_description
|
1425
|
+
message << "Send? (y,n): "
|
1426
|
+
print message
|
1427
|
+
answer = gets.chomp
|
1428
|
+
if answer.downcase == 'y'
|
1429
|
+
return true
|
1430
|
+
else
|
1431
|
+
return false
|
1432
|
+
end
|
1433
|
+
end
|
1434
|
+
|
1435
|
+
def prompt_for_script_abort
|
1436
|
+
print "Stop running script? (y,n): "
|
1437
|
+
answer = gets.chomp
|
1438
|
+
if answer.downcase == 'y'
|
1439
|
+
exit
|
1440
|
+
else
|
1441
|
+
return false
|
1442
|
+
end
|
1443
|
+
end
|
1444
|
+
|
1445
|
+
def prompt_to_continue(string)
|
1446
|
+
print "#{string}: "
|
1447
|
+
gets.chomp
|
1448
|
+
end
|
1449
|
+
|
1450
|
+
def prompt_message_box(string, buttons)
|
1451
|
+
print "#{string} (#{buttons.join(", ")}): "
|
1452
|
+
gets.chomp
|
1453
|
+
end
|
1454
|
+
|
1455
|
+
################################
|
1456
|
+
# Module setup and config
|
1457
|
+
################################
|
1458
|
+
|
1459
|
+
def set_cmd_tlm_disconnect(disconnect = false, config_file = CmdTlmServer::DEFAULT_CONFIG_FILE)
|
1460
|
+
if disconnect != $cmd_tlm_disconnect
|
1461
|
+
$cmd_tlm_disconnect = disconnect
|
1462
|
+
initialize_script_module(config_file)
|
1463
|
+
end
|
1464
|
+
end
|
1465
|
+
|
1466
|
+
def get_cmd_tlm_disconnect
|
1467
|
+
return $cmd_tlm_disconnect
|
1468
|
+
end
|
1469
|
+
|
1470
|
+
def initialize_script_module(config_file = CmdTlmServer::DEFAULT_CONFIG_FILE)
|
1471
|
+
if $cmd_tlm_disconnect
|
1472
|
+
# Start up a standalone CTS in disconnected mode
|
1473
|
+
$cmd_tlm_server = CmdTlmServer.new(config_file, false, true)
|
1474
|
+
else
|
1475
|
+
# Start a Json connect to the real CTS server
|
1476
|
+
$cmd_tlm_server = JsonDRbObject.new('127.0.0.1', System.ports['CTS_API'])
|
1477
|
+
end
|
1478
|
+
end
|
1479
|
+
|
1480
|
+
def self.included(base)
|
1481
|
+
$cmd_tlm_disconnect = false
|
1482
|
+
$cmd_tlm_server = nil
|
1483
|
+
initialize_script_module()
|
1484
|
+
end
|
1485
|
+
|
1486
|
+
def shutdown_cmd_tlm
|
1487
|
+
$cmd_tlm_server.disconnect if $cmd_tlm_server && !$cmd_tlm_disconnect
|
1488
|
+
$cmd_tlm_server = nil
|
1489
|
+
end
|
1490
|
+
|
1491
|
+
end # module Script
|
1492
|
+
|
1493
|
+
end # module Cosmos
|