cosmos 3.2.1 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (364) hide show
  1. checksums.yaml +4 -4
  2. data/Manifest.txt +195 -0
  3. data/README.md +3 -3
  4. data/data/crc.txt +52 -52
  5. data/lib/cosmos.rb +1 -1
  6. data/lib/cosmos/core_ext/time.rb +11 -9
  7. data/lib/cosmos/gui/choosers/telemetry_chooser.rb +0 -2
  8. data/lib/cosmos/gui/dialogs/about_dialog.rb +2 -2
  9. data/lib/cosmos/gui/dialogs/exception_dialog.rb +2 -2
  10. data/lib/cosmos/gui/dialogs/progress_dialog.rb +11 -5
  11. data/lib/cosmos/gui/dialogs/splash.rb +32 -10
  12. data/lib/cosmos/gui/dialogs/tlm_details_dialog.rb +1 -1
  13. data/lib/cosmos/gui/line_graph/line_graph_drawing.rb +2 -2
  14. data/lib/cosmos/gui/qt.rb +22 -22
  15. data/lib/cosmos/io/json_drb.rb +4 -4
  16. data/lib/cosmos/io/json_rpc.rb +21 -21
  17. data/lib/cosmos/packet_logs/packet_log_writer.rb +18 -20
  18. data/lib/cosmos/packets/commands.rb +8 -6
  19. data/lib/cosmos/packets/limits.rb +3 -2
  20. data/lib/cosmos/packets/packet.rb +14 -11
  21. data/lib/cosmos/packets/parsers/limits_parser.rb +1 -1
  22. data/lib/cosmos/packets/parsers/macro_parser.rb +4 -4
  23. data/lib/cosmos/packets/parsers/state_parser.rb +1 -1
  24. data/lib/cosmos/packets/structure.rb +2 -2
  25. data/lib/cosmos/packets/telemetry.rb +5 -4
  26. data/lib/cosmos/script/script.rb +6 -6
  27. data/lib/cosmos/streams/tcpip_socket_stream.rb +2 -1
  28. data/lib/cosmos/streams/template_stream_protocol.rb +1 -1
  29. data/lib/cosmos/tools/cmd_sender/cmd_sender.rb +1 -1
  30. data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_gui.rb +5 -8
  31. data/lib/cosmos/tools/cmd_tlm_server/gui/interfaces_tab.rb +4 -3
  32. data/lib/cosmos/tools/cmd_tlm_server/gui/packets_tab.rb +9 -3
  33. data/lib/cosmos/tools/cmd_tlm_server/gui/status_tab.rb +15 -11
  34. data/lib/cosmos/tools/data_viewer/data_viewer.rb +1 -1
  35. data/lib/cosmos/tools/data_viewer/data_viewer_component.rb +2 -2
  36. data/lib/cosmos/tools/handbook_creator/handbook_creator.rb +2 -2
  37. data/lib/cosmos/tools/handbook_creator/handbook_creator_config.rb +0 -2
  38. data/lib/cosmos/tools/limits_monitor/limits_monitor.rb +1 -1
  39. data/lib/cosmos/tools/replay/replay.rb +2 -2
  40. data/lib/cosmos/tools/script_runner/script_audit.rb +1 -1
  41. data/lib/cosmos/tools/script_runner/script_runner.rb +1 -1
  42. data/lib/cosmos/tools/script_runner/script_runner_frame.rb +3 -7
  43. data/lib/cosmos/tools/table_manager/table_config.rb +1 -1
  44. data/lib/cosmos/tools/test_runner/results_writer.rb +1 -1
  45. data/lib/cosmos/tools/test_runner/test_runner.rb +2 -2
  46. data/lib/cosmos/tools/tlm_extractor/tlm_extractor.rb +2 -1
  47. data/lib/cosmos/tools/tlm_extractor/tlm_extractor_processor.rb +1 -1
  48. data/lib/cosmos/tools/tlm_grapher/data_object_adders/xy_data_object_adder.rb +1 -0
  49. data/lib/cosmos/tools/tlm_grapher/data_object_editors/housekeeping_data_object_editor.rb +1 -0
  50. data/lib/cosmos/tools/tlm_grapher/data_object_editors/xy_data_object_editor.rb +1 -0
  51. data/lib/cosmos/tools/tlm_grapher/tabbed_plots/overview_tabbed_plots.rb +3 -3
  52. data/lib/cosmos/tools/tlm_viewer/tlm_viewer.rb +1 -3
  53. data/lib/cosmos/top_level.rb +2 -6
  54. data/lib/cosmos/utilities/ruby_lex_utils.rb +1 -1
  55. data/lib/cosmos/version.rb +5 -5
  56. data/lib/cosmos/win32/win32_main.rb +11 -7
  57. data/spec/ccsds/ccsds_packet_spec.rb +28 -28
  58. data/spec/ccsds/ccsds_parser_spec.rb +27 -27
  59. data/spec/config/config_parser_spec.rb +88 -88
  60. data/spec/conversions/conversion_spec.rb +3 -3
  61. data/spec/conversions/generic_conversion_spec.rb +9 -9
  62. data/spec/conversions/new_packet_log_conversion_spec.rb +4 -4
  63. data/spec/conversions/polynomial_conversion_spec.rb +7 -7
  64. data/spec/conversions/processor_conversion_spec.rb +9 -9
  65. data/spec/conversions/received_count_conversion_spec.rb +7 -7
  66. data/spec/conversions/received_time_formatted_conversion_spec.rb +9 -9
  67. data/spec/conversions/received_time_seconds_conversion_spec.rb +9 -9
  68. data/spec/conversions/segmented_polynomial_conversion_spec.rb +11 -11
  69. data/spec/conversions/unix_time_formatted_conversion_spec.rb +13 -13
  70. data/spec/conversions/unix_time_seconds_conversion_spec.rb +13 -13
  71. data/spec/core_ext/array_spec.rb +76 -76
  72. data/spec/core_ext/class_spec.rb +3 -3
  73. data/spec/core_ext/cosmos_io_spec.rb +16 -16
  74. data/spec/core_ext/exception_spec.rb +19 -19
  75. data/spec/core_ext/file_spec.rb +16 -16
  76. data/spec/core_ext/hash_spec.rb +3 -3
  77. data/spec/core_ext/io_spec.rb +2 -2
  78. data/spec/core_ext/kernel_spec.rb +2 -2
  79. data/spec/core_ext/math_spec.rb +43 -43
  80. data/spec/core_ext/matrix_spec.rb +22 -22
  81. data/spec/core_ext/objectspace_spec.rb +6 -6
  82. data/spec/core_ext/range_spec.rb +2 -2
  83. data/spec/core_ext/socket_spec.rb +4 -4
  84. data/spec/core_ext/string_spec.rb +67 -67
  85. data/spec/core_ext/stringio_spec.rb +2 -2
  86. data/spec/core_ext/time_spec.rb +82 -82
  87. data/spec/gui/line_graph/line_clip_spec.rb +34 -34
  88. data/spec/interfaces/interface_spec.rb +46 -46
  89. data/spec/interfaces/linc_interface_spec.rb +26 -26
  90. data/spec/interfaces/serial_interface_spec.rb +16 -16
  91. data/spec/interfaces/simulated_target_interface_spec.rb +21 -21
  92. data/spec/interfaces/stream_interface_spec.rb +22 -22
  93. data/spec/interfaces/tcpip_client_interface_spec.rb +14 -14
  94. data/spec/interfaces/tcpip_server_interface_spec.rb +41 -41
  95. data/spec/interfaces/udp_interface_spec.rb +46 -46
  96. data/spec/io/buffered_file_spec.rb +50 -50
  97. data/spec/io/io_multiplexer_spec.rb +9 -9
  98. data/spec/io/json_drb_object_spec.rb +7 -7
  99. data/spec/io/json_drb_spec.rb +55 -55
  100. data/spec/io/json_rpc_spec.rb +68 -68
  101. data/spec/io/raw_logger_pair_spec.rb +28 -28
  102. data/spec/io/raw_logger_spec.rb +22 -22
  103. data/spec/io/serial_driver_spec.rb +3 -3
  104. data/spec/io/stderr_spec.rb +2 -2
  105. data/spec/io/stdout_spec.rb +2 -2
  106. data/spec/io/tcpip_server_spec.rb +62 -62
  107. data/spec/io/udp_sockets_spec.rb +19 -19
  108. data/spec/io/win32_serial_driver_spec.rb +10 -10
  109. data/spec/packet_logs/meta_packet_log_writer_spec.rb +32 -32
  110. data/spec/packet_logs/packet_log_reader_spec.rb +138 -138
  111. data/spec/packet_logs/packet_log_writer_pair_spec.rb +3 -3
  112. data/spec/packet_logs/packet_log_writer_spec.rb +26 -26
  113. data/spec/packets/binary_accessor_spec.rb +672 -672
  114. data/spec/packets/commands_spec.rb +123 -123
  115. data/spec/packets/limits_response_spec.rb +1 -1
  116. data/spec/packets/limits_spec.rb +69 -69
  117. data/spec/packets/packet_config_spec.rb +93 -93
  118. data/spec/packets/packet_item_limits_spec.rb +46 -46
  119. data/spec/packets/packet_item_spec.rb +108 -108
  120. data/spec/packets/packet_spec.rb +364 -348
  121. data/spec/packets/parsers/format_string_parser_spec.rb +13 -13
  122. data/spec/packets/parsers/limits_parser_spec.rb +8 -8
  123. data/spec/packets/parsers/limits_response_parser_spec.rb +9 -9
  124. data/spec/packets/parsers/macro_parser_spec.rb +34 -6
  125. data/spec/packets/parsers/packet_parser_spec.rb +6 -6
  126. data/spec/packets/parsers/processor_parser_spec.rb +7 -7
  127. data/spec/packets/parsers/state_parser_spec.rb +23 -23
  128. data/spec/packets/structure_item_spec.rb +62 -62
  129. data/spec/packets/structure_spec.rb +183 -183
  130. data/spec/packets/telemetry_spec.rb +174 -174
  131. data/spec/processors/new_packet_log_processor_spec.rb +4 -4
  132. data/spec/processors/processor_spec.rb +9 -9
  133. data/spec/processors/statistics_processor_spec.rb +21 -21
  134. data/spec/processors/watermark_processor_spec.rb +12 -12
  135. data/spec/script/script_spec.rb +158 -158
  136. data/spec/spec_helper.rb +44 -13
  137. data/spec/streams/burst_stream_protocol_spec.rb +8 -8
  138. data/spec/streams/fixed_stream_protocol_spec.rb +26 -26
  139. data/spec/streams/length_stream_protocol_spec.rb +27 -27
  140. data/spec/streams/preidentified_stream_protocol_spec.rb +25 -25
  141. data/spec/streams/serial_stream_spec.rb +19 -19
  142. data/spec/streams/stream_protocol_spec.rb +52 -52
  143. data/spec/streams/stream_spec.rb +1 -1
  144. data/spec/streams/tcpip_client_stream_spec.rb +7 -7
  145. data/spec/streams/tcpip_socket_stream_spec.rb +84 -49
  146. data/spec/streams/template_stream_protocol_spec.rb +17 -17
  147. data/spec/streams/terminated_stream_protocol_spec.rb +19 -19
  148. data/spec/system/system_spec.rb +95 -95
  149. data/spec/system/target_spec.rb +32 -32
  150. data/spec/tools/cmd_tlm_server/api_spec.rb +386 -386
  151. data/spec/tools/cmd_tlm_server/background_task_spec.rb +3 -3
  152. data/spec/tools/cmd_tlm_server/background_tasks_spec.rb +8 -8
  153. data/spec/tools/cmd_tlm_server/cmd_tlm_server_config_spec.rb +57 -57
  154. data/spec/tools/cmd_tlm_server/cmd_tlm_server_spec.rb +85 -85
  155. data/spec/tools/cmd_tlm_server/commanding_spec.rb +11 -11
  156. data/spec/tools/cmd_tlm_server/connections_spec.rb +23 -23
  157. data/spec/tools/cmd_tlm_server/interface_thread_spec.rb +57 -57
  158. data/spec/tools/cmd_tlm_server/interfaces_spec.rb +32 -32
  159. data/spec/tools/cmd_tlm_server/packet_logging_spec.rb +17 -17
  160. data/spec/tools/cmd_tlm_server/router_thread_spec.rb +15 -15
  161. data/spec/tools/cmd_tlm_server/routers_spec.rb +36 -36
  162. data/spec/top_level/top_level_spec.rb +60 -60
  163. data/spec/utilities/crc_spec.rb +6 -6
  164. data/spec/utilities/csv_spec.rb +13 -13
  165. data/spec/utilities/logger_spec.rb +20 -20
  166. data/spec/utilities/message_log_spec.rb +13 -13
  167. data/spec/utilities/quaternion_spec.rb +30 -30
  168. data/spec/utilities/ruby_lex_utils_spec.rb +14 -14
  169. data/test/benchmarks/binary_accessor_benchmark.rb +14 -0
  170. data/test/benchmarks/gsub_benchmark.rb +114 -0
  171. data/test/performance/PACKETS.bat +1 -0
  172. data/test/performance/Rakefile +77 -0
  173. data/test/performance/THREADS.bat +1 -0
  174. data/test/performance/config/data/attitude.bin +0 -0
  175. data/test/performance/config/data/crc.txt +206 -0
  176. data/test/performance/config/data/diamond.STL +58 -0
  177. data/test/performance/config/data/groundoff.gif +0 -0
  178. data/test/performance/config/data/groundon.gif +0 -0
  179. data/test/performance/config/data/hselectoff.gif +0 -0
  180. data/test/performance/config/data/hselecton.gif +0 -0
  181. data/test/performance/config/data/hswitchoff.gif +0 -0
  182. data/test/performance/config/data/hswitchon.gif +0 -0
  183. data/test/performance/config/data/meta_init.txt +4 -0
  184. data/test/performance/config/data/position.bin +0 -0
  185. data/test/performance/config/data/poweroff.gif +0 -0
  186. data/test/performance/config/data/poweron.gif +0 -0
  187. data/test/performance/config/data/satellite.gif +0 -0
  188. data/test/performance/config/data/tada.wav +0 -0
  189. data/test/performance/config/data/vswitchoff.gif +0 -0
  190. data/test/performance/config/data/vswitchon.gif +0 -0
  191. data/test/performance/config/system/system_packets.txt +39 -0
  192. data/test/performance/config/system/system_threads.txt +59 -0
  193. data/test/performance/config/targets/COSMOS/cmd_tlm/cosmos_server_cmds.txt +41 -0
  194. data/test/performance/config/targets/COSMOS/cmd_tlm/cosmos_server_tlm.txt +15 -0
  195. data/test/performance/config/targets/COSMOS/cmd_tlm_server.txt +6 -0
  196. data/test/performance/config/targets/COSMOS/screens/limits_change.txt +20 -0
  197. data/test/performance/config/targets/COSMOS/screens/version.txt +19 -0
  198. data/test/performance/config/targets/COSMOS/target.txt +11 -0
  199. data/test/performance/config/targets/EXAMPLE/cmd_tlm/example_cmds.txt +17 -0
  200. data/test/performance/config/targets/EXAMPLE/cmd_tlm/example_tlm.txt +18 -0
  201. data/test/performance/config/targets/EXAMPLE/cmd_tlm_server.txt +6 -0
  202. data/test/performance/config/targets/EXAMPLE/lib/example_interface.rb +22 -0
  203. data/test/performance/config/targets/EXAMPLE/target.txt +7 -0
  204. data/test/performance/config/targets/SYSTEM/screens/status.txt +12 -0
  205. data/test/performance/config/tools/cmd_tlm_server/cmd_tlm_server_packets.txt +34 -0
  206. data/test/performance/config/tools/cmd_tlm_server/cmd_tlm_server_threads.txt +68 -0
  207. data/test/performance/config/tools/data_viewer/data_viewer.txt +11 -0
  208. data/test/performance/config/tools/handbook_creator/default_toc.xsl +59 -0
  209. data/test/performance/config/tools/handbook_creator/handbook_creator.txt +66 -0
  210. data/test/performance/config/tools/handbook_creator/templates/command_packets.html.erb +86 -0
  211. data/test/performance/config/tools/handbook_creator/templates/command_toc.html.erb +38 -0
  212. data/test/performance/config/tools/handbook_creator/templates/footer.html.erb +9 -0
  213. data/test/performance/config/tools/handbook_creator/templates/header.html.erb +25 -0
  214. data/test/performance/config/tools/handbook_creator/templates/limits_groups.html.erb +13 -0
  215. data/test/performance/config/tools/handbook_creator/templates/nav.html.erb +27 -0
  216. data/test/performance/config/tools/handbook_creator/templates/overview.html.erb +1 -0
  217. data/test/performance/config/tools/handbook_creator/templates/pdf_cover.html.erb +23 -0
  218. data/test/performance/config/tools/handbook_creator/templates/pdf_footer.html.erb +33 -0
  219. data/test/performance/config/tools/handbook_creator/templates/pdf_header.html.erb +41 -0
  220. data/test/performance/config/tools/handbook_creator/templates/telemetry_packets.html.erb +80 -0
  221. data/test/performance/config/tools/handbook_creator/templates/telemetry_toc.html.erb +38 -0
  222. data/test/performance/config/tools/handbook_creator/templates/title.html.erb +1 -0
  223. data/test/performance/config/tools/launcher/launcher_packets.txt +29 -0
  224. data/test/performance/config/tools/launcher/launcher_threads.txt +70 -0
  225. data/test/performance/config/tools/limits_monitor/README.txt +1 -0
  226. data/test/performance/config/tools/opengl_builder/README.txt +1 -0
  227. data/test/performance/config/tools/script_runner/script_runner.txt +3 -0
  228. data/test/performance/config/tools/table_manager/ConfigTables_def.txt +8 -0
  229. data/test/performance/config/tools/table_manager/ExampleTableDefinition.txt +24 -0
  230. data/test/performance/config/tools/table_manager/MCConfigurationTable_fsw1_def.txt +25 -0
  231. data/test/performance/config/tools/table_manager/MCConfigurationTable_fsw2_def.txt +25 -0
  232. data/test/performance/config/tools/table_manager/PPSSelectionTable_def.txt +8 -0
  233. data/test/performance/config/tools/table_manager/TLMMonitoringTable_def.txt +248 -0
  234. data/test/performance/config/tools/test_runner/test_runner.txt +17 -0
  235. data/test/performance/config/tools/tlm_extractor/tlm_extractor.txt +13 -0
  236. data/test/performance/config/tools/tlm_extractor/tlm_extractor2.txt +2 -0
  237. data/test/performance/config/tools/tlm_extractor/tlm_extractor3.txt +2 -0
  238. data/test/performance/config/tools/tlm_extractor/tlm_extractor4.txt +2 -0
  239. data/test/performance/config/tools/tlm_grapher/README.txt +1 -0
  240. data/test/performance/config/tools/tlm_viewer/tlm_viewer.txt +41 -0
  241. data/test/performance/lib/example_background_task.rb +57 -0
  242. data/test/performance/lib/example_target.rb +120 -0
  243. data/test/performance/lib/scpi_target.rb +74 -0
  244. data/test/performance/lib/user_version.rb +3 -0
  245. data/test/performance/outputs/handbooks/README.txt +1 -0
  246. data/test/performance/outputs/logs/README.txt +1 -0
  247. data/test/performance/outputs/saved_config/README.txt +1 -0
  248. data/test/performance/outputs/tables/README.txt +1 -0
  249. data/test/performance/outputs/tmp/README.txt +1 -0
  250. data/test/performance/procedures/checks.rb +11 -0
  251. data/test/performance/procedures/clear_util.rb +7 -0
  252. data/test/performance/procedures/collect.rb +18 -0
  253. data/test/performance/procedures/collect_util.rb +14 -0
  254. data/test/performance/procedures/cosmos_api_test.rb +293 -0
  255. data/test/performance/procedures/disconnect.rb +29 -0
  256. data/test/performance/procedures/example_test.rb +182 -0
  257. data/test/performance/procedures/plot_test.rb +8 -0
  258. data/test/performance/procedures/procedure.rb +3 -0
  259. data/test/performance/procedures/run_example_test.rb +3 -0
  260. data/test/performance/procedures/test.rb +51 -0
  261. data/test/performance/tools/CmdExtractor +14 -0
  262. data/test/performance/tools/CmdExtractor.bat +59 -0
  263. data/test/performance/tools/CmdSender +14 -0
  264. data/test/performance/tools/CmdSender.bat +59 -0
  265. data/test/performance/tools/CmdTlmServer +16 -0
  266. data/test/performance/tools/CmdTlmServer.bat +59 -0
  267. data/test/performance/tools/CmdTlmServerMemProf +20 -0
  268. data/test/performance/tools/CmdTlmServerMemProf.bat +59 -0
  269. data/test/performance/tools/DataViewer +14 -0
  270. data/test/performance/tools/DataViewer.bat +59 -0
  271. data/test/performance/tools/ExampleTarget +14 -0
  272. data/test/performance/tools/ExampleTarget.bat +59 -0
  273. data/test/performance/tools/HandbookCreator +14 -0
  274. data/test/performance/tools/HandbookCreator.bat +61 -0
  275. data/test/performance/tools/Launcher +14 -0
  276. data/test/performance/tools/Launcher.bat +59 -0
  277. data/test/performance/tools/LimitsMonitor +14 -0
  278. data/test/performance/tools/LimitsMonitor.bat +59 -0
  279. data/test/performance/tools/OpenGLBuilder +14 -0
  280. data/test/performance/tools/OpenGLBuilder.bat +59 -0
  281. data/test/performance/tools/PacketViewer +14 -0
  282. data/test/performance/tools/PacketViewer.bat +59 -0
  283. data/test/performance/tools/Replay +14 -0
  284. data/test/performance/tools/Replay.bat +59 -0
  285. data/test/performance/tools/ScpiTarget +14 -0
  286. data/test/performance/tools/ScpiTarget.bat +59 -0
  287. data/test/performance/tools/ScriptRunner +14 -0
  288. data/test/performance/tools/ScriptRunner.bat +59 -0
  289. data/test/performance/tools/TableManager +14 -0
  290. data/test/performance/tools/TableManager.bat +59 -0
  291. data/test/performance/tools/TestRunner +14 -0
  292. data/test/performance/tools/TestRunner.bat +59 -0
  293. data/test/performance/tools/TlmExtractor +14 -0
  294. data/test/performance/tools/TlmExtractor.bat +59 -0
  295. data/test/performance/tools/TlmGrapher +14 -0
  296. data/test/performance/tools/TlmGrapher.bat +59 -0
  297. data/test/performance/tools/TlmViewer +14 -0
  298. data/test/performance/tools/TlmViewer.bat +59 -0
  299. data/test/performance/tools/mac/CmdExtractor.app/Contents/Info.plist +38 -0
  300. data/test/performance/tools/mac/CmdExtractor.app/Contents/MacOS/CmdExtractor.rb +15 -0
  301. data/test/performance/tools/mac/CmdExtractor.app/Contents/MacOS/main.sh +6 -0
  302. data/test/performance/tools/mac/CmdExtractor.app/Contents/Resources/appIcon.icns +0 -0
  303. data/test/performance/tools/mac/CmdSender.app/Contents/Info.plist +38 -0
  304. data/test/performance/tools/mac/CmdSender.app/Contents/MacOS/CmdSender.rb +15 -0
  305. data/test/performance/tools/mac/CmdSender.app/Contents/MacOS/main.sh +6 -0
  306. data/test/performance/tools/mac/CmdSender.app/Contents/Resources/appIcon.icns +0 -0
  307. data/test/performance/tools/mac/CmdTlmServer.app/Contents/Info.plist +38 -0
  308. data/test/performance/tools/mac/CmdTlmServer.app/Contents/MacOS/CmdTlmServer.rb +15 -0
  309. data/test/performance/tools/mac/CmdTlmServer.app/Contents/MacOS/main.sh +6 -0
  310. data/test/performance/tools/mac/CmdTlmServer.app/Contents/Resources/appIcon.icns +0 -0
  311. data/test/performance/tools/mac/DataViewer.app/Contents/Info.plist +38 -0
  312. data/test/performance/tools/mac/DataViewer.app/Contents/MacOS/DataViewer.rb +15 -0
  313. data/test/performance/tools/mac/DataViewer.app/Contents/MacOS/main.sh +6 -0
  314. data/test/performance/tools/mac/DataViewer.app/Contents/Resources/appIcon.icns +0 -0
  315. data/test/performance/tools/mac/HandbookCreator.app/Contents/Info.plist +38 -0
  316. data/test/performance/tools/mac/HandbookCreator.app/Contents/MacOS/HandbookCreator.rb +15 -0
  317. data/test/performance/tools/mac/HandbookCreator.app/Contents/MacOS/main.sh +6 -0
  318. data/test/performance/tools/mac/HandbookCreator.app/Contents/Resources/appIcon.icns +0 -0
  319. data/test/performance/tools/mac/Launcher.app/Contents/Info.plist +38 -0
  320. data/test/performance/tools/mac/Launcher.app/Contents/MacOS/Launcher.rb +15 -0
  321. data/test/performance/tools/mac/Launcher.app/Contents/MacOS/main.sh +6 -0
  322. data/test/performance/tools/mac/Launcher.app/Contents/Resources/appIcon.icns +0 -0
  323. data/test/performance/tools/mac/LimitsMonitor.app/Contents/Info.plist +38 -0
  324. data/test/performance/tools/mac/LimitsMonitor.app/Contents/MacOS/LimitsMonitor.rb +15 -0
  325. data/test/performance/tools/mac/LimitsMonitor.app/Contents/MacOS/main.sh +6 -0
  326. data/test/performance/tools/mac/LimitsMonitor.app/Contents/Resources/appIcon.icns +0 -0
  327. data/test/performance/tools/mac/OpenGLBuilder.app/Contents/Info.plist +38 -0
  328. data/test/performance/tools/mac/OpenGLBuilder.app/Contents/MacOS/OpenGLBuilder.rb +15 -0
  329. data/test/performance/tools/mac/OpenGLBuilder.app/Contents/MacOS/main.sh +6 -0
  330. data/test/performance/tools/mac/OpenGLBuilder.app/Contents/Resources/appIcon.icns +0 -0
  331. data/test/performance/tools/mac/PacketViewer.app/Contents/Info.plist +38 -0
  332. data/test/performance/tools/mac/PacketViewer.app/Contents/MacOS/PacketViewer.rb +15 -0
  333. data/test/performance/tools/mac/PacketViewer.app/Contents/MacOS/main.sh +6 -0
  334. data/test/performance/tools/mac/PacketViewer.app/Contents/Resources/appIcon.icns +0 -0
  335. data/test/performance/tools/mac/Replay.app/Contents/Info.plist +38 -0
  336. data/test/performance/tools/mac/Replay.app/Contents/MacOS/Replay.rb +15 -0
  337. data/test/performance/tools/mac/Replay.app/Contents/MacOS/main.sh +6 -0
  338. data/test/performance/tools/mac/Replay.app/Contents/Resources/appIcon.icns +0 -0
  339. data/test/performance/tools/mac/ScriptRunner.app/Contents/Info.plist +38 -0
  340. data/test/performance/tools/mac/ScriptRunner.app/Contents/MacOS/ScriptRunner.rb +15 -0
  341. data/test/performance/tools/mac/ScriptRunner.app/Contents/MacOS/main.sh +6 -0
  342. data/test/performance/tools/mac/ScriptRunner.app/Contents/Resources/appIcon.icns +0 -0
  343. data/test/performance/tools/mac/TableManager.app/Contents/Info.plist +38 -0
  344. data/test/performance/tools/mac/TableManager.app/Contents/MacOS/TableManager.rb +15 -0
  345. data/test/performance/tools/mac/TableManager.app/Contents/MacOS/main.sh +6 -0
  346. data/test/performance/tools/mac/TableManager.app/Contents/Resources/appIcon.icns +0 -0
  347. data/test/performance/tools/mac/TestRunner.app/Contents/Info.plist +38 -0
  348. data/test/performance/tools/mac/TestRunner.app/Contents/MacOS/TestRunner.rb +15 -0
  349. data/test/performance/tools/mac/TestRunner.app/Contents/MacOS/main.sh +6 -0
  350. data/test/performance/tools/mac/TestRunner.app/Contents/Resources/appIcon.icns +0 -0
  351. data/test/performance/tools/mac/TlmExtractor.app/Contents/Info.plist +38 -0
  352. data/test/performance/tools/mac/TlmExtractor.app/Contents/MacOS/TlmExtractor.rb +15 -0
  353. data/test/performance/tools/mac/TlmExtractor.app/Contents/MacOS/main.sh +6 -0
  354. data/test/performance/tools/mac/TlmExtractor.app/Contents/Resources/appIcon.icns +0 -0
  355. data/test/performance/tools/mac/TlmGrapher.app/Contents/Info.plist +38 -0
  356. data/test/performance/tools/mac/TlmGrapher.app/Contents/MacOS/TlmGrapher.rb +15 -0
  357. data/test/performance/tools/mac/TlmGrapher.app/Contents/MacOS/main.sh +6 -0
  358. data/test/performance/tools/mac/TlmGrapher.app/Contents/Resources/appIcon.icns +0 -0
  359. data/test/performance/tools/mac/TlmViewer.app/Contents/Info.plist +38 -0
  360. data/test/performance/tools/mac/TlmViewer.app/Contents/MacOS/TlmViewer.rb +15 -0
  361. data/test/performance/tools/mac/TlmViewer.app/Contents/MacOS/main.sh +6 -0
  362. data/test/performance/tools/mac/TlmViewer.app/Contents/Resources/appIcon.icns +0 -0
  363. data/test/performance/userpath.txt +1 -0
  364. metadata +197 -2
@@ -0,0 +1,17 @@
1
+ REQUIRE_UTILITY 'example_test'
2
+ LINE_DELAY 0
3
+ # RESULTS_WRITER 'results_writer.rb'
4
+ ALLOW_DEBUG
5
+ PAUSE_ON_ERROR TRUE
6
+ CONTINUE_TEST_CASE_AFTER_ERROR TRUE
7
+ ABORT_TESTING_AFTER_ERROR FALSE
8
+ MANUAL TRUE
9
+ LOOP_TESTING FALSE
10
+ BREAK_LOOP_AFTER_ERROR FALSE
11
+ CREATE_DATA_PACKAGE
12
+ AUTO_CYCLE_LOGS
13
+ COLLECT_METADATA META DATA
14
+ # IGNORE_TEST_SUITE EmptyTestSuite
15
+ # IGNORE_TEST EmptyTest
16
+ # MONITOR_LIMITS
17
+ # PAUSE_ON_RED
@@ -0,0 +1,13 @@
1
+ ITEM INST ADCS TIMEFORMATTED
2
+ ITEM INST ADCS Q1 RAW
3
+ ITEM INST ADCS Q1
4
+ ITEM INST ADCS Q1 FORMATTED
5
+ ITEM INST ADCS Q1 WITH_UNITS
6
+ ITEM INST ADCS VELX RAW
7
+ ITEM INST ADCS VELX
8
+ ITEM INST ADCS VELX FORMATTED
9
+ ITEM INST ADCS VELX WITH_UNITS
10
+ ITEM INST ADCS CCSDSSEQFLAGS RAW
11
+ ITEM INST ADCS CCSDSSEQFLAGS
12
+ ITEM INST ADCS CCSDSSEQFLAGS FORMATTED
13
+ ITEM INST ADCS CCSDSSEQFLAGS WITH_UNITS
@@ -0,0 +1,2 @@
1
+ ITEM INST ADCS TIMEFORMATTED
2
+ ITEM INST ADCS Q2 RAW
@@ -0,0 +1,2 @@
1
+ ITEM INST ADCS TIMEFORMATTED
2
+ ITEM INST ADCS Q3 RAW
@@ -0,0 +1,2 @@
1
+ ITEM INST ADCS TIMEFORMATTED
2
+ ITEM INST ADCS Q4 RAW
@@ -0,0 +1 @@
1
+ This file is here to make sure this folder is included in the release.
@@ -0,0 +1,41 @@
1
+ # Automatically pull in screens from all targets
2
+ AUTO_TARGETS
3
+
4
+ # Create a new dropdown with a few specific sceens
5
+ GROUP "My group"
6
+ GROUP_SCREEN "COSMOS" "version.txt"
7
+ GROUP_SCREEN "INST" "hs.txt"
8
+ GROUP_SCREEN "INST2" "hs.txt"
9
+
10
+ # NEW_COLUMN
11
+
12
+ # AUTO_TARGET INST
13
+
14
+ # TARGET "INST"
15
+ # SCREEN "adcs.txt"
16
+ # SCREEN "array.txt"
17
+ # SCREEN "block.txt"
18
+ # SCREEN "commanding.txt"
19
+ # SCREEN "graphs.txt"
20
+ # SCREEN "ground.txt"
21
+ # SCREEN "hs.txt"
22
+ # SCREEN "latest.txt" 480 324
23
+ # SHOW_ON_STARTUP
24
+ # SCREEN "other.txt"
25
+ # SCREEN "tabs.txt"
26
+
27
+ #TARGET "INST2"
28
+ # SCREEN "adcs.txt"
29
+ # SCREEN "array.txt"
30
+ # SCREEN "block.txt"
31
+ # SCREEN "commanding.txt" 898 317
32
+ # SHOW_ON_STARTUP
33
+ # SCREEN "graphs.txt"
34
+ # SCREEN "ground.txt"
35
+ # SCREEN "hs.txt"
36
+ # SCREEN "latest.txt"
37
+ # SCREEN "other.txt"
38
+ # SCREEN "tabs.txt"
39
+
40
+ # ADD_SHOW_ON_STARTUP INST ADCS 10 10
41
+ # ADD_SHOW_ON_STARTUP INST HS 500 500
@@ -0,0 +1,57 @@
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
+ # This file implements an example background task
12
+
13
+ require 'cosmos/tools/cmd_tlm_server/background_task'
14
+
15
+ module Cosmos
16
+
17
+ # ExampleBackgroundTask class
18
+ #
19
+ # This class is an example background task
20
+ #
21
+ class ExampleBackgroundTask < BackgroundTask
22
+
23
+ def initialize
24
+ super()
25
+ @name = 'Example Background Task'
26
+ @sleeper = Sleeper.new
27
+ end
28
+
29
+ def call
30
+ sent_count = 0
31
+ @status = "Sleeping for 5 seconds"
32
+ return if @sleeper.sleep(5) # allow interfaces time to start
33
+ loop do
34
+ #Make sure we start up with 3 collects
35
+ if (tlm('INST', 'HEALTH_STATUS', 'COLLECTS') < 3)
36
+ begin
37
+ cmd('INST', 'COLLECT', 'TYPE' => 'NORMAL', 'DURATION' => 1)
38
+ sent_count += 1
39
+ @status = "Sent COLLECT ##{sent_count} at #{Time.now.formatted}"
40
+ rescue
41
+ # Oh well - probably disconnected
42
+ end
43
+ else
44
+ break
45
+ end
46
+ return if @sleeper.sleep(1)
47
+ end
48
+ @status = "Finished at #{Time.now.formatted}"
49
+ end
50
+
51
+ def stop
52
+ @sleeper.cancel
53
+ end
54
+
55
+ end # class ExampleBackgroundTask
56
+
57
+ end # module Cosmos
@@ -0,0 +1,120 @@
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/interfaces'
13
+ require 'cosmos/tools/cmd_tlm_server/interface_thread'
14
+
15
+ module Cosmos
16
+
17
+ class ExampleTarget
18
+
19
+ class ExampleServerInterface < TcpipServerInterface
20
+ def initialize(port)
21
+ @port = port
22
+ super(port, port, 5.0, nil, 'LENGTH', 0, 32, 4, 1, 'BIG_ENDIAN', 4)
23
+ end
24
+
25
+ def pre_write_packet(packet)
26
+ [packet.length].pack('N') << packet.buffer(false)
27
+ end
28
+ end
29
+
30
+ class ExampleInterfaceThread < InterfaceThread
31
+
32
+ protected
33
+
34
+ def handle_packet(packet)
35
+ identified_packet = System.commands.identify(packet.buffer, [@port.to_s])
36
+ if identified_packet
37
+ Logger.info "Received command: #{identified_packet.target_name} #{identified_packet.packet_name}"
38
+ else
39
+ Logger.info "Received UNKNOWN command"
40
+ end
41
+ end
42
+ end
43
+
44
+ class ExampleTelemetryThread
45
+ attr_reader :thread
46
+
47
+ def initialize(interface, port, packet, rate)
48
+ @interface = interface
49
+ @port = port.to_s
50
+ @packet = packet.to_s
51
+ @rate = rate.to_i
52
+ @sleeper = Sleeper.new
53
+ end
54
+
55
+ def start
56
+ packet = System.telemetry.packet(@port, @packet)
57
+ packet.write("PACKET_ID", packet.get_item("PACKET_ID").id_value)
58
+ @thread = Thread.new do
59
+ @stop_thread = false
60
+ begin
61
+ while true
62
+ @rate.times do
63
+ packet.write('STRING', "The time is now: #{Time.now.formatted}")
64
+ @interface.write(packet)
65
+ break if @sleeper.sleep(1.0 / @rate)
66
+ end
67
+ end
68
+ rescue Exception => err
69
+ Logger.error "ExampleTelemetryThread unexpectedly died\n#{err.formatted}"
70
+ end
71
+ end
72
+ end
73
+
74
+ def stop
75
+ Cosmos.kill_thread(self, @thread)
76
+ end
77
+
78
+ def graceful_kill
79
+ @sleeper.cancel
80
+ end
81
+ end
82
+
83
+ def initialize(arguments)
84
+ @port = arguments[0]
85
+ @packet = arguments[1]
86
+ @rate = arguments[2]
87
+ # Create interface to receive commands and send telemetry
88
+ @interface = ExampleServerInterface.new(@port)
89
+ @interface_thread = nil
90
+ @telemetry_thread = nil
91
+ end
92
+
93
+ def start
94
+ @interface_thread = ExampleInterfaceThread.new(@interface)
95
+ @interface_thread.start
96
+ @telemetry_thread = ExampleTelemetryThread.new(@interface, @port, @packet, @rate)
97
+ @telemetry_thread.start
98
+ end
99
+
100
+ def stop
101
+ @telemetry_thread.stop if @telemetry_thread
102
+ @interface_thread.stop if @interface_thread
103
+ end
104
+
105
+ def self.run
106
+ Logger.level = Logger::INFO
107
+ target = self.new(ARGV)
108
+ begin
109
+ target.start
110
+ while true
111
+ sleep 1
112
+ end
113
+ rescue SystemExit, Interrupt
114
+ target.stop
115
+ end
116
+ end
117
+
118
+ end # class ExampleTarget
119
+
120
+ end # module Cosmos
@@ -0,0 +1,74 @@
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/interfaces'
13
+ require 'cosmos/tools/cmd_tlm_server/interface_thread'
14
+
15
+ module Cosmos
16
+
17
+ class ScpiTarget
18
+
19
+ class ScpiServerInterface < TcpipServerInterface
20
+ PORT = 5025
21
+
22
+ def initialize
23
+ super(PORT, PORT, 5.0, nil, 'TERMINATED', '0xA', '0xA')
24
+ end
25
+ end
26
+
27
+ class ScpiInterfaceThread < InterfaceThread
28
+ def initialize(interface)
29
+ super(interface)
30
+ @index = 0
31
+ end
32
+
33
+ protected
34
+
35
+ def handle_packet(packet)
36
+ Logger.info "Received command: #{packet.buffer}"
37
+ if packet.buffer.include?('?')
38
+ @interface.write_raw(@index.to_s)
39
+ end
40
+ @index += 1
41
+ end
42
+ end
43
+
44
+ def initialize
45
+ # Create interface to receive commands and send telemetry
46
+ @target_interface = ScpiServerInterface.new
47
+ @interface_thread = nil
48
+ end
49
+
50
+ def start
51
+ @interface_thread = ScpiInterfaceThread.new(@target_interface)
52
+ @interface_thread.start
53
+ end
54
+
55
+ def stop
56
+ @interface_thread.stop if @interface_thread
57
+ end
58
+
59
+ def self.run
60
+ Logger.level = Logger::INFO
61
+ target = self.new
62
+ begin
63
+ target.start
64
+ while true
65
+ sleep 1
66
+ end
67
+ rescue SystemExit, Interrupt
68
+ target.stop
69
+ end
70
+ end
71
+
72
+ end # class ScpiTarget
73
+
74
+ end # module Cosmos
@@ -0,0 +1,3 @@
1
+ # encoding: ascii-8bit
2
+
3
+ USER_VERSION = "Unofficial"
@@ -0,0 +1 @@
1
+ This file is here to make sure this folder is included in the release.
@@ -0,0 +1 @@
1
+ This file is here to make sure this folder is included in the release.
@@ -0,0 +1 @@
1
+ This file is here to make sure this folder is included in the release.
@@ -0,0 +1 @@
1
+ This file is here to make sure this folder is included in the release.
@@ -0,0 +1 @@
1
+ This file is here to make sure this folder is included in the release.
@@ -0,0 +1,11 @@
1
+ collect_cnt = tlm("INST HEALTH_STATUS COLLECTS")
2
+ cmd("INST COLLECT with DURATION 11, TYPE NORMAL")
3
+ cmd_no_range_check("INST COLLECT with DURATION 11, TYPE NORMAL")
4
+ cmd_no_hazardous_check("INST COLLECT with DURATION 11, TYPE NORMAL")
5
+ cmd_no_checks("INST COLLECT with DURATION 11, TYPE NORMAL")
6
+ wait_check("INST HEALTH_STATUS COLLECTS == #{collect_cnt + 2}", 10)
7
+ cmd("INST CLEAR")
8
+ cmd_no_range_check("INST CLEAR")
9
+ cmd_no_hazardous_check("INST CLEAR")
10
+ cmd_no_checks("INST CLEAR")
11
+ puts tlm("INST HEALTH_STATUS COLLECTS")
@@ -0,0 +1,7 @@
1
+ def clear
2
+ #Command the collect
3
+ cmd("INST CLEAR")
4
+
5
+ #Wait for telemetry to update
6
+ wait_check("INST HEALTH_STATUS COLLECTS == 0", 10)
7
+ end
@@ -0,0 +1,18 @@
1
+ load_utility 'collect_util.rb'
2
+ load_utility 'clear_util.rb'
3
+
4
+ number = ask("Enter a number.")
5
+ raise "Bad return" unless number.is_a? Numeric
6
+ number = ask_string("Enter a number.")
7
+ raise "Bad return" unless number.is_a? String
8
+
9
+ result = message_box("Click something.", "BLAH", "WHAT")
10
+ raise "Bad return" unless result == 'BLAH' or result == 'WHAT'
11
+
12
+ prompt("Press Ok to start NORMAL Collect")
13
+ collect('NORMAL', 1)
14
+ prompt("Press Ok to start SPECIAL Collect")
15
+ collect('SPECIAL', 2, true)
16
+ clear()
17
+
18
+ wait_check("INST HEALTH_STATUS COLLECTS == 0", 10)
@@ -0,0 +1,14 @@
1
+ load_utility 'clear_util.rb'
2
+
3
+ def collect (type, duration, call_clear = false)
4
+ # Get the current collects telemetry point
5
+ collects = tlm('INST HEALTH_STATUS COLLECTS')
6
+
7
+ #Command the collect
8
+ cmd("INST COLLECT with TYPE #{type}, DURATION #{duration}")
9
+
10
+ #Wait for telemetry to update
11
+ wait_check("INST HEALTH_STATUS COLLECTS == #{collects + 1}", 10)
12
+
13
+ clear() if call_clear
14
+ end
@@ -0,0 +1,293 @@
1
+ # cmd
2
+ cmd("INST ABORT")
3
+ cmd("INST ARYCMD with ARRAY []")
4
+ cmd("INST CLEAR")
5
+ cmd("INST COLLECT with DURATION 1.0, TEMP 0.0, TYPE 'NORMAL'")
6
+ cmd("INST FLTCMD with FLOAT32 0.0, FLOAT64 0.0")
7
+ cmd("INST SETPARAMS with VALUE1 0, VALUE2 0, VALUE3 0, VALUE4 0, VALUE5 0")
8
+ cmd("INST SLRPNLDEPLOY")
9
+ cmd("INST SLRPNLRESET")
10
+ cmd("INST ASCIICMD with STRING 'ARM LASER'")
11
+
12
+ cmd("INST", "ABORT")
13
+ cmd("INST", "ARYCMD", "ARRAY" => [])
14
+ cmd("INST", "CLEAR")
15
+ cmd("INST", "COLLECT", "DURATION" => 1.0, "TEMP" => 0.0, "TYPE" => 'NORMAL')
16
+ cmd("INST", "FLTCMD", "FLOAT32" => 0.0, "FLOAT64" => 0.0)
17
+ cmd("INST", "SETPARAMS", "VALUE1" => 0, "VALUE2" => 0, "VALUE3" => 0, "VALUE4" => 0, "VALUE5" => 0)
18
+ cmd("INST", "SLRPNLDEPLOY")
19
+ cmd("INST", "SLRPNLRESET")
20
+ cmd("INST", "ASCIICMD", "STRING" => 'ARM LASER')
21
+
22
+ # cmd should fail
23
+ begin
24
+ cmd("INST COLLECT with DURATION 11, TYPE 'NORMAL'")
25
+ rescue RuntimeError => e
26
+ raise "Fail" if e.message != "Command parameter 'INST COLLECT DURATION' = 11 not in valid range of 0.0 to 10.0"
27
+ rescue
28
+ raise "Fail"
29
+ end
30
+
31
+ cmd()
32
+ cmd("BOB")
33
+ cmd("BOB", "ABORT")
34
+ cmd("INST", "BOB")
35
+ cmd("INST", "ABORT", "BOB" => "BOB")
36
+ cmd("INST", "ABORT", "TED", "BOB" => "BOB")
37
+ cmd("BOB")
38
+ cmd("BOB ABORT")
39
+ cmd("INST BOB")
40
+
41
+ # cmd_no_range_check
42
+ cmd_no_range_check("INST ABORT")
43
+ cmd_no_range_check("INST ARYCMD with ARRAY []")
44
+ cmd_no_range_check("INST CLEAR")
45
+ cmd_no_range_check("INST COLLECT with DURATION 1.0, TEMP 0.0, TYPE 'NORMAL'")
46
+ cmd_no_range_check("INST FLTCMD with FLOAT32 0.0, FLOAT64 0.0")
47
+ cmd_no_range_check("INST SETPARAMS with VALUE1 0, VALUE2 0, VALUE3 0, VALUE4 0, VALUE5 0")
48
+ cmd_no_range_check("INST SLRPNLDEPLOY")
49
+ cmd_no_range_check("INST SLRPNLRESET")
50
+ cmd_no_range_check("INST ASCIICMD with STRING 'ARM LASER'")
51
+ cmd_no_range_check("INST COLLECT with DURATION 11, TYPE 'NORMAL'")
52
+
53
+ cmd_no_range_check("INST", "ABORT")
54
+ cmd_no_range_check("INST", "ARYCMD", "ARRAY" => [])
55
+ cmd_no_range_check("INST", "CLEAR")
56
+ cmd_no_range_check("INST", "COLLECT", "DURATION" => 1.0, "TEMP" => 0.0, "TYPE" => 'NORMAL')
57
+ cmd_no_range_check("INST", "FLTCMD", "FLOAT32" => 0.0, "FLOAT64" => 0.0)
58
+ cmd_no_range_check("INST", "SETPARAMS", "VALUE1" => 0, "VALUE2" => 0, "VALUE3" => 0, "VALUE4" => 0, "VALUE5" => 0)
59
+ cmd_no_range_check("INST", "SLRPNLDEPLOY")
60
+ cmd_no_range_check("INST", "SLRPNLRESET")
61
+ cmd_no_range_check("INST", "ASCIICMD", "STRING" => 'ARM LASER')
62
+ cmd_no_range_check("INST", "COLLECT", "DURATION" => 11, "TYPE" => 'NORMAL')
63
+
64
+ # cmd_no_range_check should fail
65
+ cmd_no_range_check()
66
+ cmd_no_range_check("BOB")
67
+ cmd_no_range_check("BOB", "ABORT")
68
+ cmd_no_range_check("INST", "BOB")
69
+ cmd_no_range_check("INST", "ABORT", "BOB" => "BOB")
70
+ cmd_no_range_check("INST", "ABORT", "TED", "BOB" => "BOB")
71
+ cmd_no_range_check("BOB")
72
+ cmd_no_range_check("BOB ABORT")
73
+ cmd_no_range_check("INST BOB")
74
+
75
+ # cmd_no_hazardous_check
76
+ cmd_no_hazardous_check("INST ABORT")
77
+ cmd_no_hazardous_check("INST ARYCMD with ARRAY []")
78
+ cmd_no_hazardous_check("INST CLEAR")
79
+ cmd_no_hazardous_check("INST COLLECT with DURATION 1.0, TEMP 0.0, TYPE 'NORMAL'")
80
+ cmd_no_hazardous_check("INST FLTCMD with FLOAT32 0.0, FLOAT64 0.0")
81
+ cmd_no_hazardous_check("INST SETPARAMS with VALUE1 0, VALUE2 0, VALUE3 0, VALUE4 0, VALUE5 0")
82
+ cmd_no_hazardous_check("INST SLRPNLDEPLOY")
83
+ cmd_no_hazardous_check("INST SLRPNLRESET")
84
+ cmd_no_hazardous_check("INST ASCIICMD with STRING 'ARM LASER'")
85
+
86
+ cmd_no_hazardous_check("INST", "ABORT")
87
+ cmd_no_hazardous_check("INST", "ARYCMD", "ARRAY" => [])
88
+ cmd_no_hazardous_check("INST", "CLEAR")
89
+ cmd_no_hazardous_check("INST", "COLLECT", "DURATION" => 1.0, "TEMP" => 0.0, "TYPE" => 'NORMAL')
90
+ cmd_no_hazardous_check("INST", "FLTCMD", "FLOAT32" => 0.0, "FLOAT64" => 0.0)
91
+ cmd_no_hazardous_check("INST", "SETPARAMS", "VALUE1" => 0, "VALUE2" => 0, "VALUE3" => 0, "VALUE4" => 0, "VALUE5" => 0)
92
+ cmd_no_hazardous_check("INST", "SLRPNLDEPLOY")
93
+ cmd_no_hazardous_check("INST", "SLRPNLRESET")
94
+ cmd_no_hazardous_check("INST", "ASCIICMD", "STRING" => 'ARM LASER')
95
+
96
+ # cmd_no_hazardous_check should fail
97
+ cmd_no_hazardous_check("INST COLLECT with DURATION 11, TYPE 'NORMAL'")
98
+ cmd_no_hazardous_check()
99
+ cmd_no_hazardous_check("BOB")
100
+ cmd_no_hazardous_check("BOB", "ABORT")
101
+ cmd_no_hazardous_check("INST", "BOB")
102
+ cmd_no_hazardous_check("INST", "ABORT", "BOB" => "BOB")
103
+ cmd_no_hazardous_check("INST", "ABORT", "TED", "BOB" => "BOB")
104
+ cmd_no_hazardous_check("BOB")
105
+ cmd_no_hazardous_check("BOB ABORT")
106
+ cmd_no_hazardous_check("INST BOB")
107
+
108
+ # cmd_no_checks
109
+ cmd_no_checks("INST ABORT")
110
+ cmd_no_checks("INST ARYCMD with ARRAY []")
111
+ cmd_no_checks("INST CLEAR")
112
+ cmd_no_checks("INST COLLECT with DURATION 1.0, TEMP 0.0, TYPE 'NORMAL'")
113
+ cmd_no_checks("INST FLTCMD with FLOAT32 0.0, FLOAT64 0.0")
114
+ cmd_no_checks("INST SETPARAMS with VALUE1 0, VALUE2 0, VALUE3 0, VALUE4 0, VALUE5 0")
115
+ cmd_no_checks("INST SLRPNLDEPLOY")
116
+ cmd_no_checks("INST SLRPNLRESET")
117
+ cmd_no_checks("INST ASCIICMD with STRING 'ARM LASER'")
118
+ cmd_no_checks("INST COLLECT with DURATION 11, TYPE 'NORMAL'")
119
+
120
+ cmd_no_checks("INST", "ABORT")
121
+ cmd_no_checks("INST", "ARYCMD", "ARRAY" => [])
122
+ cmd_no_checks("INST", "CLEAR")
123
+ cmd_no_checks("INST", "COLLECT", "DURATION" => 1.0, "TEMP" => 0.0, "TYPE" => 'NORMAL')
124
+ cmd_no_checks("INST", "FLTCMD", "FLOAT32" => 0.0, "FLOAT64" => 0.0)
125
+ cmd_no_checks("INST", "SETPARAMS", "VALUE1" => 0, "VALUE2" => 0, "VALUE3" => 0, "VALUE4" => 0, "VALUE5" => 0)
126
+ cmd_no_checks("INST", "SLRPNLDEPLOY")
127
+ cmd_no_checks("INST", "SLRPNLRESET")
128
+ cmd_no_checks("INST", "ASCIICMD", "STRING" => 'ARM LASER')
129
+ cmd_no_checks("INST", "COLLECT", "DURATION" => 11, "TYPE" => 'NORMAL')
130
+
131
+ # cmd_no_checks should fail
132
+ cmd_no_checks()
133
+ cmd_no_checks("BOB")
134
+ cmd_no_checks("BOB", "ABORT")
135
+ cmd_no_checks("INST", "BOB")
136
+ cmd_no_checks("INST", "ABORT", "BOB" => "BOB")
137
+ cmd_no_checks("INST", "ABORT", "TED", "BOB" => "BOB")
138
+ cmd_no_checks("BOB")
139
+ cmd_no_checks("BOB ABORT")
140
+ cmd_no_checks("INST BOB")
141
+
142
+ # send_raw should fail (on demo cmd/tlm server)
143
+ send_raw()
144
+ send_raw("INT1")
145
+ send_raw("INT1", "\x00\x00")
146
+ send_raw("INT1", "\x00\x00", "\x00\x00")
147
+
148
+ # get_cmd_list
149
+ expected_list = [["ABORT", "Aborts a collect on the instrument"], ["ARYCMD", "Command with array parameter"], ["ASCIICMD", "Enumerated ASCII command"], ["CLEAR", "Clears counters on the instrument"], ["COLLECT", "Starts a collect on the instrument"], ["FLTCMD", "Command with float parameters"], ["SETPARAMS", "Sets numbered parameters"], ["SLRPNLDEPLOY", "Deploy solar array panels"], ["SLRPNLRESET", "Reset solar array panels"]]
150
+ list = get_cmd_list("INST")
151
+ raise "Fail" if list != expected_list
152
+
153
+ # get_cmd_list should fail
154
+ get_cmd_list()
155
+ get_cmd_list("BOB")
156
+ get_cmd_list("BOB", "TED")
157
+
158
+ # get_cmd_param_list
159
+ expected_list = [["CCSDSVER", 0, nil, "CCSDS primary header version number", nil, nil, false],
160
+ ["CCSDSTYPE", 1, nil, "CCSDS primary header packet type", nil, nil, false],
161
+ ["CCSDSSHF", 0, nil, "CCSDS primary header secondary header flag", nil, nil, false],
162
+ ["CCSDSAPID", 999, nil, "CCSDS primary header application id", nil, nil, false],
163
+ ["CCSDSSEQFLAGS", 3, nil, "CCSDS primary header sequence flags", nil, nil, false],
164
+ ["CCSDSSEQCNT", 0, nil, "CCSDS primary header sequence count", nil, nil, false],
165
+ ["CCSDSLENGTH", 0, nil, "CCSDS primary header packet length", nil, nil, false],
166
+ ["PKTID", 1, nil, "Packet id", nil, nil, false],
167
+ ["TYPE", 0, {"NORMAL"=>0, "SPECIAL"=>1}, "Collect type", nil, nil, true],
168
+ ["DURATION", 1.0, nil, "Collect duration", nil, nil, false],
169
+ ["OPCODE", "0xAB", nil, "Collect opcode", nil, nil, false],
170
+ ["TEMP", 0.0, nil, "Collect temperature", "Celcius", "C", false]]
171
+ list = get_cmd_param_list("INST", "COLLECT")
172
+ if list != expected_list
173
+ raise "Fail"
174
+ end
175
+
176
+ # get_cmd_param_list should fail
177
+ get_cmd_param_list()
178
+ get_cmd_param_list("INST")
179
+ get_cmd_param_list("INST", "BOB")
180
+ get_cmd_param_list("INST", "COLLECT", "DURATION")
181
+
182
+ # get_cmd_hazardous
183
+ hazardous, hazardous_description = get_cmd_hazardous("INST", "COLLECT", "TYPE" => "SPECIAL")
184
+ puts "#{hazardous}:#{hazardous_description}"
185
+ hazardous, hazardous_description = get_cmd_hazardous("INST", "COLLECT", "TYPE" => "NORMAL")
186
+ puts "#{hazardous}:#{hazardous_description}"
187
+ hazardous, hazardous_description = get_cmd_hazardous("INST", "ABORT")
188
+ puts "#{hazardous}:#{hazardous_description}"
189
+ hazardous, hazardous_description = get_cmd_hazardous("INST", "CLEAR")
190
+ puts "#{hazardous}:#{hazardous_description}"
191
+
192
+ # get_cmd_hazardous should fail
193
+ get_cmd_hazardous()
194
+ get_cmd_hazardous("INST")
195
+ get_cmd_hazardous("INST", "COLLECT", "BOB" => 5)
196
+ get_cmd_hazardous("INST", "COLLECT", 5)
197
+
198
+ # tlm
199
+ tlm("INST HEALTH_STATUS ARY")
200
+ tlm("INST HEALTH_STATUS ASCIICMD")
201
+ tlm("INST HEALTH_STATUS CCSDSAPID")
202
+ tlm("INST HEALTH_STATUS TEMP1")
203
+
204
+ tlm("INST", "HEALTH_STATUS", "ARY")
205
+ tlm("INST", "HEALTH_STATUS", "ASCIICMD")
206
+ tlm("INST", "HEALTH_STATUS", "CCSDSAPID")
207
+ tlm("INST", "HEALTH_STATUS", "TEMP1")
208
+
209
+ # tlm should fail
210
+ tlm()
211
+ tlm("BOB")
212
+ tlm("INST")
213
+ tlm("INST BOB")
214
+ tlm("INST HEALTH_STATUS")
215
+ tlm("INST HEALTH_STATUS BOB")
216
+ tlm("INST HEALTH_STATUS ARY BOB")
217
+ tlm("INST", "BOB")
218
+ tlm("INST", "HEALTH_STATUS")
219
+ tlm("INST", "HEALTH_STATUS", "BOB")
220
+ tlm("INST", "HEALTH_STATUS", "ARY", "BOB")
221
+
222
+ # tlm_raw
223
+ tlm_raw("INST HEALTH_STATUS ARY")
224
+ tlm_raw("INST HEALTH_STATUS ASCIICMD")
225
+ tlm_raw("INST HEALTH_STATUS CCSDSAPID")
226
+ tlm_raw("INST HEALTH_STATUS TEMP1")
227
+
228
+ tlm_raw("INST", "HEALTH_STATUS", "ARY")
229
+ tlm_raw("INST", "HEALTH_STATUS", "ASCIICMD")
230
+ tlm_raw("INST", "HEALTH_STATUS", "CCSDSAPID")
231
+ tlm_raw("INST", "HEALTH_STATUS", "TEMP1")
232
+
233
+ # tlm_raw should fail
234
+ tlm_raw()
235
+ tlm_raw("BOB")
236
+ tlm_raw("INST")
237
+ tlm_raw("INST BOB")
238
+ tlm_raw("INST HEALTH_STATUS")
239
+ tlm_raw("INST HEALTH_STATUS BOB")
240
+ tlm_raw("INST HEALTH_STATUS ARY BOB")
241
+ tlm_raw("INST", "BOB")
242
+ tlm_raw("INST", "HEALTH_STATUS")
243
+ tlm_raw("INST", "HEALTH_STATUS", "BOB")
244
+ tlm_raw("INST", "HEALTH_STATUS", "ARY", "BOB")
245
+
246
+ # tlm_formatted
247
+ tlm_formatted("INST HEALTH_STATUS ARY")
248
+ tlm_formatted("INST HEALTH_STATUS ASCIICMD")
249
+ tlm_formatted("INST HEALTH_STATUS CCSDSAPID")
250
+ tlm_formatted("INST HEALTH_STATUS TEMP1")
251
+
252
+ tlm_formatted("INST", "HEALTH_STATUS", "ARY")
253
+ tlm_formatted("INST", "HEALTH_STATUS", "ASCIICMD")
254
+ tlm_formatted("INST", "HEALTH_STATUS", "CCSDSAPID")
255
+ tlm_formatted("INST", "HEALTH_STATUS", "TEMP1")
256
+
257
+ # tlm_formatted should fail
258
+ tlm_formatted()
259
+ tlm_formatted("BOB")
260
+ tlm_formatted("INST")
261
+ tlm_formatted("INST BOB")
262
+ tlm_formatted("INST HEALTH_STATUS")
263
+ tlm_formatted("INST HEALTH_STATUS BOB")
264
+ tlm_formatted("INST HEALTH_STATUS ARY BOB")
265
+ tlm_formatted("INST", "BOB")
266
+ tlm_formatted("INST", "HEALTH_STATUS")
267
+ tlm_formatted("INST", "HEALTH_STATUS", "BOB")
268
+ tlm_formatted("INST", "HEALTH_STATUS", "ARY", "BOB")
269
+
270
+ # tlm_with_units
271
+ tlm_with_units("INST HEALTH_STATUS ARY")
272
+ tlm_with_units("INST HEALTH_STATUS ASCIICMD")
273
+ tlm_with_units("INST HEALTH_STATUS CCSDSAPID")
274
+ tlm_with_units("INST HEALTH_STATUS TEMP1")
275
+
276
+ tlm_with_units("INST", "HEALTH_STATUS", "ARY")
277
+ tlm_with_units("INST", "HEALTH_STATUS", "ASCIICMD")
278
+ tlm_with_units("INST", "HEALTH_STATUS", "CCSDSAPID")
279
+ tlm_with_units("INST", "HEALTH_STATUS", "TEMP1")
280
+
281
+ # tlm_with_units should fail
282
+ tlm_with_units()
283
+ tlm_with_units("BOB")
284
+ tlm_with_units("INST")
285
+ tlm_with_units("INST BOB")
286
+ tlm_with_units("INST HEALTH_STATUS")
287
+ tlm_with_units("INST HEALTH_STATUS BOB")
288
+ tlm_with_units("INST HEALTH_STATUS ARY BOB")
289
+ tlm_with_units("INST", "BOB")
290
+ tlm_with_units("INST", "HEALTH_STATUS")
291
+ tlm_with_units("INST", "HEALTH_STATUS", "BOB")
292
+ tlm_with_units("INST", "HEALTH_STATUS", "ARY", "BOB")
293
+