cosmos 4.2.4 → 4.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (458) hide show
  1. checksums.yaml +5 -5
  2. data/.dockerignore +2 -0
  3. data/.github/ISSUE_TEMPLATE/bug_report.md +30 -0
  4. data/.github/ISSUE_TEMPLATE/feature_request.md +19 -0
  5. data/.github/ISSUE_TEMPLATE/help---usage---general-question.md +12 -0
  6. data/.gitignore +2 -0
  7. data/.travis.yml +6 -6
  8. data/Dockerfile +69 -0
  9. data/Gemfile +1 -1
  10. data/Manifest.txt +130 -46
  11. data/README.md +9 -0
  12. data/Rakefile +57 -0
  13. data/appveyor.yml +18 -7
  14. data/autohotkey/config/targets/INST/cmd_tlm/inst_cmds.txt +1 -1
  15. data/autohotkey/config/targets/INST/cmd_tlm/inst_tlm.txt +5 -5
  16. data/autohotkey/config/targets/INST/lib/sim_inst.rb +3 -1
  17. data/autohotkey/config/tools/cmd_sequence/cmd_sequence.txt +2 -0
  18. data/autohotkey/config/tools/handbook_creator/assets/css/bootstrap-theme.css +397 -0
  19. data/autohotkey/config/tools/handbook_creator/assets/css/bootstrap-theme.min.css +7 -0
  20. data/autohotkey/config/tools/handbook_creator/assets/css/bootstrap.css +7118 -0
  21. data/autohotkey/config/tools/handbook_creator/assets/css/bootstrap.min.css +7 -0
  22. data/autohotkey/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.eot +0 -0
  23. data/autohotkey/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.svg +229 -0
  24. data/autohotkey/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
  25. data/autohotkey/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.woff +0 -0
  26. data/autohotkey/config/tools/handbook_creator/assets/js/bootstrap.js +2006 -0
  27. data/autohotkey/config/tools/handbook_creator/assets/js/bootstrap.min.js +7 -0
  28. data/autohotkey/config/tools/table_manager/ConfigTables_def.txt +2 -4
  29. data/autohotkey/config/tools/table_manager/SubTables/OneDimensionalSubTable_def.txt +31 -0
  30. data/autohotkey/config/tools/table_manager/SubTables/TwoDimensionalSubTable_def.txt +28 -0
  31. data/autohotkey/config/tools/test_runner/test_runner.txt +1 -1
  32. data/autohotkey/config/tools/test_runner/test_runner2.txt +1 -1
  33. data/autohotkey/config/tools/test_runner/test_runner3.txt +1 -1
  34. data/autohotkey/config/tools/test_runner/test_runner4.txt +1 -1
  35. data/autohotkey/lib/cmd_sequence_exporter.rb +52 -0
  36. data/autohotkey/procedures/collect.rb +2 -2
  37. data/autohotkey/procedures/collect_util.rb +1 -1
  38. data/autohotkey/procedures/script_test.rb +1 -1
  39. data/autohotkey/tools/CmdSenderAHK2 +18 -0
  40. data/autohotkey/tools/cmd_sender.ahk +34 -6
  41. data/autohotkey/tools/cmd_sender2.ahk +4 -0
  42. data/autohotkey/tools/cmd_sequence.ahk +36 -22
  43. data/autohotkey/tools/cmd_sequence2.ahk +1 -1
  44. data/autohotkey/tools/config_editor.ahk +5 -5
  45. data/autohotkey/tools/launcher.ahk +1 -0
  46. data/autohotkey/tools/limits_monitor.ahk +1 -1
  47. data/autohotkey/tools/packet_viewer.ahk +7 -6
  48. data/autohotkey/tools/script_runner.ahk +16 -4
  49. data/autohotkey/tools/test_runner.ahk +8 -8
  50. data/bin/cosmos +38 -1
  51. data/bin/cstol_converter +1 -1
  52. data/bin/dart_util +0 -0
  53. data/bin/rubysloc +73 -28
  54. data/bin/xtce_converter +1 -1
  55. data/cosmos.gemspec +7 -9
  56. data/data/config/_interfaces.yaml +4 -0
  57. data/data/config/cmd_sequence.yaml +14 -0
  58. data/data/config/command_modifiers.yaml +16 -1
  59. data/data/config/housekeeping_params.yaml +14 -0
  60. data/data/config/interface_modifiers.yaml +14 -2
  61. data/data/config/item_modifiers.yaml +11 -1
  62. data/data/config/launcher.yaml +12 -2
  63. data/data/config/param_item_modifiers.yaml +7 -2
  64. data/data/config/parameter_modifiers.yaml +20 -0
  65. data/data/config/screen.yaml +2 -0
  66. data/data/config/script_runner.yaml +9 -0
  67. data/data/config/system.yaml +152 -28
  68. data/data/config/table_manager.yaml +7 -0
  69. data/data/config/target.yaml +12 -0
  70. data/data/config/telemetry_modifiers.yaml +19 -2
  71. data/data/config/test_runner.yaml +10 -9
  72. data/data/config/widgets.yaml +174 -11
  73. data/data/crc.txt +428 -415
  74. data/demo/Gemfile +1 -1
  75. data/demo/Launcher.bat +1 -9
  76. data/demo/Launcher2.bat +1 -0
  77. data/demo/LauncherMini.bat +1 -0
  78. data/demo/Rakefile +2 -0
  79. data/demo/config/dart/Gemfile +2 -7
  80. data/demo/config/data/crc.txt +243 -219
  81. data/demo/config/system/system.txt +42 -3
  82. data/demo/config/system/system2.txt +34 -5
  83. data/demo/config/system/system_alt_ports.txt +80 -0
  84. data/demo/config/targets/EXAMPLE/cmd_tlm_server.txt +1 -0
  85. data/demo/config/targets/INST/cmd_tlm/inst_cmds.txt +5 -4
  86. data/demo/config/targets/INST/cmd_tlm/inst_tlm.txt +12 -7
  87. data/demo/config/targets/INST/cmd_tlm/inst_tlm_override.txt +12 -0
  88. data/demo/config/targets/INST/cmd_tlm_server.txt +2 -0
  89. data/demo/config/targets/INST/lib/sim_inst.rb +15 -3
  90. data/demo/config/targets/INST/screens/adcs.txt +2 -2
  91. data/demo/config/targets/INST/screens/block.txt +1 -1
  92. data/demo/config/targets/INST/screens/commanding.txt +1 -1
  93. data/demo/config/targets/INST/screens/ground.txt +27 -5
  94. data/demo/config/targets/INST/screens/ground_error.gif +0 -0
  95. data/demo/config/{data/groundoff.gif → targets/INST/screens/ground_off.gif} +0 -0
  96. data/demo/config/{data/groundon.gif → targets/INST/screens/ground_on.gif} +0 -0
  97. data/demo/config/targets/INST/screens/limits.txt +69 -31
  98. data/demo/config/targets/INST/screens/other.txt +13 -3
  99. data/demo/config/targets/INST/screens/params.txt +54 -0
  100. data/demo/config/targets/INST/screens/satellite.gif +0 -0
  101. data/demo/config/targets/INST/target.txt +1 -0
  102. data/demo/config/tools/cmd_tlm_server/cmd_tlm_server_chain.txt +18 -0
  103. data/demo/config/tools/data_viewer/data_viewer.txt +3 -0
  104. data/demo/config/tools/handbook_creator/assets/css/bootstrap-theme.css +397 -0
  105. data/demo/config/tools/handbook_creator/assets/css/bootstrap-theme.min.css +7 -0
  106. data/demo/config/tools/handbook_creator/assets/css/bootstrap.css +7118 -0
  107. data/demo/config/tools/handbook_creator/assets/css/bootstrap.min.css +7 -0
  108. data/demo/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.eot +0 -0
  109. data/demo/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.svg +229 -0
  110. data/demo/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
  111. data/demo/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.woff +0 -0
  112. data/demo/config/tools/handbook_creator/assets/img/ball_logo.bmp +0 -0
  113. data/demo/config/tools/handbook_creator/assets/img/ball_logo.gif +0 -0
  114. data/demo/config/tools/handbook_creator/assets/img/ball_logo.jpg +0 -0
  115. data/demo/config/tools/handbook_creator/assets/js/bootstrap.js +2006 -0
  116. data/demo/config/tools/handbook_creator/assets/js/bootstrap.min.js +7 -0
  117. data/demo/config/tools/handbook_creator/assets/js/html5shiv.js +8 -0
  118. data/demo/config/tools/handbook_creator/assets/js/jquery-1.10.2.min.js +6 -0
  119. data/demo/config/tools/handbook_creator/assets/js/respond.min.js +6 -0
  120. data/demo/config/tools/handbook_creator/default_toc.xsl +59 -59
  121. data/demo/config/tools/script_runner/script_runner.txt +1 -2
  122. data/demo/config/tools/test_runner/test_runner.txt +3 -1
  123. data/demo/lib/example_background_task.rb +1 -0
  124. data/demo/procedures/cosmos_api_test.rb +26 -22
  125. data/demo/procedures/interactive.rb +22 -0
  126. data/demo/procedures/local_screen_example.rb +51 -0
  127. data/ext/cosmos/ext/cosmos_io/cosmos_io.c +32 -4
  128. data/ext/cosmos/ext/packet/packet.c +6 -77
  129. data/ext/mkrf_conf.rb +2 -2
  130. data/extensions/vscode/.gitignore +4 -0
  131. data/extensions/vscode/.vscode/launch.json +32 -0
  132. data/extensions/vscode/.vscode/settings.json +13 -0
  133. data/extensions/vscode/.vscode/tasks.json +79 -0
  134. data/extensions/vscode/License.txt +879 -0
  135. data/extensions/vscode/README.md +9 -0
  136. data/extensions/vscode/client/License.txt +879 -0
  137. data/extensions/vscode/client/README.md +39 -0
  138. data/extensions/vscode/client/cosmos.configuration.json +23 -0
  139. data/extensions/vscode/client/images/icon.png +0 -0
  140. data/extensions/vscode/client/package-lock.json +414 -0
  141. data/extensions/vscode/client/package.json +105 -0
  142. data/extensions/vscode/client/src/extension.ts +132 -0
  143. data/extensions/vscode/client/src/screen_preview.rb +25 -0
  144. data/extensions/vscode/client/syntaxes/cosmos.tmLanguage.json +219 -0
  145. data/extensions/vscode/client/tsconfig.json +17 -0
  146. data/extensions/vscode/package-lock.json +26 -0
  147. data/extensions/vscode/package.json +35 -0
  148. data/extensions/vscode/server/License.txt +879 -0
  149. data/extensions/vscode/server/package-lock.json +236 -0
  150. data/extensions/vscode/server/package.json +29 -0
  151. data/extensions/vscode/server/src/server.ts +59 -0
  152. data/extensions/vscode/server/tsconfig.json +16 -0
  153. data/install/Gemfile +1 -1
  154. data/install/Launcher.bat +1 -9
  155. data/install/config/dart/Gemfile +3 -8
  156. data/install/config/data/crc.txt +148 -132
  157. data/install/config/system/system.txt +36 -3
  158. data/install/config/tools/handbook_creator/assets/css/bootstrap-theme.css +397 -0
  159. data/install/config/tools/handbook_creator/assets/css/bootstrap-theme.min.css +7 -0
  160. data/install/config/tools/handbook_creator/assets/css/bootstrap.css +7118 -0
  161. data/install/config/tools/handbook_creator/assets/css/bootstrap.min.css +7 -0
  162. data/install/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.eot +0 -0
  163. data/install/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.svg +229 -0
  164. data/install/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
  165. data/install/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.woff +0 -0
  166. data/install/config/tools/handbook_creator/assets/img/ball_logo.bmp +0 -0
  167. data/install/config/tools/handbook_creator/assets/img/ball_logo.gif +0 -0
  168. data/install/config/tools/handbook_creator/assets/img/ball_logo.jpg +0 -0
  169. data/install/config/tools/handbook_creator/assets/js/bootstrap.js +2006 -0
  170. data/install/config/tools/handbook_creator/assets/js/bootstrap.min.js +7 -0
  171. data/install/config/tools/handbook_creator/assets/js/html5shiv.js +8 -0
  172. data/install/config/tools/handbook_creator/assets/js/jquery-1.10.2.min.js +6 -0
  173. data/install/config/tools/handbook_creator/assets/js/respond.min.js +6 -0
  174. data/install/config/tools/handbook_creator/default_toc.xsl +59 -59
  175. data/lib/cosmos/config/config_parser.rb +4 -5
  176. data/lib/cosmos/conversions.rb +2 -0
  177. data/lib/cosmos/conversions/packet_time_formatted_conversion.rb +38 -0
  178. data/lib/cosmos/conversions/packet_time_seconds_conversion.rb +38 -0
  179. data/lib/cosmos/core_ext/cosmos_io.rb +2 -1
  180. data/lib/cosmos/core_ext/time.rb +3 -1
  181. data/lib/cosmos/dart/config/boot.rb +1 -1
  182. data/lib/cosmos/dart/config/database.yml +2 -0
  183. data/lib/cosmos/dart/examples/dart_decom_client.rb +1 -1
  184. data/lib/cosmos/dart/examples/dart_stream_client.rb +6 -2
  185. data/lib/cosmos/dart/lib/dart_common.rb +13 -6
  186. data/lib/cosmos/dart/lib/dart_constants.rb +15 -0
  187. data/lib/cosmos/dart/lib/dart_database_cleaner.rb +2 -2
  188. data/lib/cosmos/dart/lib/dart_decom_query.rb +5 -6
  189. data/lib/cosmos/dart/lib/dart_decommutator.rb +64 -54
  190. data/lib/cosmos/dart/lib/dart_importer.rb +3 -3
  191. data/lib/cosmos/dart/lib/dart_master_query.rb +71 -0
  192. data/lib/cosmos/dart/lib/dart_packet_log_writer.rb +2 -2
  193. data/lib/cosmos/dart/lib/dart_reducer_worker_thread.rb +165 -134
  194. data/lib/cosmos/dart/processes/dart.rb +4 -2
  195. data/lib/cosmos/dart/processes/dart_decom_server.rb +3 -3
  196. data/lib/cosmos/dart/processes/dart_ingester.rb +40 -1
  197. data/lib/cosmos/dart/processes/dart_master.rb +44 -0
  198. data/lib/cosmos/dart/processes/dart_util.rb +119 -4
  199. data/lib/cosmos/dart/spec/dart/dart_reducer_manager_spec.rb +3 -3
  200. data/lib/cosmos/gui/dialogs/cmd_tlm_raw_dialog.rb +9 -5
  201. data/lib/cosmos/gui/dialogs/details_dialog.rb +44 -29
  202. data/lib/cosmos/gui/dialogs/exception_list_dialog.rb +1 -1
  203. data/lib/cosmos/gui/dialogs/find_replace_dialog.rb +3 -3
  204. data/lib/cosmos/gui/dialogs/interface_raw_dialog.rb +2 -2
  205. data/lib/cosmos/gui/dialogs/set_tlm_dialog.rb +1 -1
  206. data/lib/cosmos/gui/dialogs/tlm_details_dialog.rb +11 -10
  207. data/lib/cosmos/gui/dialogs/tlm_graph_dialog.rb +4 -2
  208. data/lib/cosmos/gui/opengl/earth_model.rb +1 -1
  209. data/lib/cosmos/gui/qt.rb +13 -2
  210. data/lib/cosmos/gui/qt_tool.rb +71 -43
  211. data/lib/cosmos/gui/text/ruby_editor.rb +91 -49
  212. data/lib/cosmos/gui/utilities/classification_banner.rb +60 -0
  213. data/lib/cosmos/gui/utilities/screenshot.rb +1 -1
  214. data/lib/cosmos/gui/utilities/script_module_gui.rb +117 -91
  215. data/lib/cosmos/gui/widgets/dart_meta_frame.rb +22 -3
  216. data/lib/cosmos/interfaces.rb +2 -0
  217. data/lib/cosmos/interfaces/dart_status_interface.rb +1 -1
  218. data/lib/cosmos/interfaces/interface.rb +9 -1
  219. data/lib/cosmos/interfaces/linc_interface.rb +3 -3
  220. data/lib/cosmos/interfaces/protocols/burst_protocol.rb +1 -1
  221. data/lib/cosmos/interfaces/protocols/crc_protocol.rb +1 -1
  222. data/lib/cosmos/interfaces/protocols/fixed_protocol.rb +40 -18
  223. data/lib/cosmos/interfaces/protocols/ignore_packet_protocol.rb +46 -0
  224. data/lib/cosmos/interfaces/protocols/length_protocol.rb +5 -0
  225. data/lib/cosmos/interfaces/protocols/preidentified_protocol.rb +68 -23
  226. data/lib/cosmos/interfaces/protocols/template_protocol.rb +9 -4
  227. data/lib/cosmos/interfaces/serial_interface.rb +7 -1
  228. data/lib/cosmos/interfaces/simulated_target_interface.rb +14 -5
  229. data/lib/cosmos/interfaces/stream_interface.rb +1 -1
  230. data/lib/cosmos/interfaces/tcpip_server_interface.rb +13 -13
  231. data/lib/cosmos/io/json_drb.rb +16 -12
  232. data/lib/cosmos/io/json_drb_object.rb +7 -2
  233. data/lib/cosmos/io/json_drb_rack.rb +25 -5
  234. data/lib/cosmos/io/json_rpc.rb +1 -1
  235. data/lib/cosmos/io/posix_serial_driver.rb +60 -22
  236. data/lib/cosmos/io/serial_driver.rb +11 -8
  237. data/lib/cosmos/io/win32_serial_driver.rb +31 -3
  238. data/lib/cosmos/packet_logs/packet_log_reader.rb +71 -28
  239. data/lib/cosmos/packet_logs/packet_log_writer.rb +13 -1
  240. data/lib/cosmos/packets/commands.rb +30 -9
  241. data/lib/cosmos/packets/packet.rb +105 -34
  242. data/lib/cosmos/packets/packet_config.rb +60 -10
  243. data/lib/cosmos/packets/parsers/format_string_parser.rb +0 -1
  244. data/lib/cosmos/packets/parsers/state_parser.rb +0 -1
  245. data/lib/cosmos/packets/parsers/xtce_converter.rb +2 -0
  246. data/lib/cosmos/packets/parsers/xtce_parser.rb +5 -4
  247. data/lib/cosmos/packets/structure.rb +32 -4
  248. data/lib/cosmos/packets/structure_item.rb +5 -1
  249. data/lib/cosmos/packets/telemetry.rb +30 -4
  250. data/lib/cosmos/script/api_shared.rb +22 -10
  251. data/lib/cosmos/script/extract.rb +1 -1
  252. data/lib/cosmos/script/limits.rb +4 -0
  253. data/lib/cosmos/script/script.rb +29 -20
  254. data/lib/cosmos/script/scripting.rb +16 -14
  255. data/lib/cosmos/script/telemetry.rb +3 -1
  256. data/lib/cosmos/script/tools.rb +18 -8
  257. data/lib/cosmos/streams/serial_stream.rb +11 -6
  258. data/lib/cosmos/system/system.rb +214 -76
  259. data/lib/cosmos/system/target.rb +39 -9
  260. data/lib/cosmos/tools/cmd_extractor/cmd_extractor.rb +116 -55
  261. data/lib/cosmos/tools/cmd_sender/cmd_param_table_item_delegate.rb +15 -0
  262. data/lib/cosmos/tools/cmd_sender/cmd_params.rb +382 -0
  263. data/lib/cosmos/tools/cmd_sender/cmd_sender.rb +54 -340
  264. data/lib/cosmos/tools/cmd_sequence/cmd_sequence.rb +74 -52
  265. data/lib/cosmos/tools/cmd_sequence/sequence_item.rb +40 -333
  266. data/lib/cosmos/tools/cmd_sequence/sequence_list.rb +16 -11
  267. data/lib/cosmos/tools/cmd_tlm_server/api.rb +13 -0
  268. data/lib/cosmos/tools/cmd_tlm_server/background_tasks.rb +2 -0
  269. data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb +44 -15
  270. data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_config.rb +8 -1
  271. data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_gui.rb +18 -20
  272. data/lib/cosmos/tools/cmd_tlm_server/commanding.rb +13 -2
  273. data/lib/cosmos/tools/cmd_tlm_server/gui/interfaces_tab.rb +2 -2
  274. data/lib/cosmos/tools/cmd_tlm_server/gui/logging_tab.rb +13 -13
  275. data/lib/cosmos/tools/cmd_tlm_server/gui/packets_tab.rb +9 -6
  276. data/lib/cosmos/tools/cmd_tlm_server/gui/status_tab.rb +8 -8
  277. data/lib/cosmos/tools/cmd_tlm_server/gui/targets_tab.rb +5 -5
  278. data/lib/cosmos/tools/cmd_tlm_server/interface_thread.rb +35 -20
  279. data/lib/cosmos/tools/cmd_tlm_server/replay_backend.rb +15 -11
  280. data/lib/cosmos/tools/cmd_tlm_server/router_thread.rb +5 -0
  281. data/lib/cosmos/tools/cmd_tlm_server/routers.rb +2 -0
  282. data/lib/cosmos/tools/config_editor/config_editor.rb +181 -94
  283. data/lib/cosmos/tools/config_editor/config_editor_frame.rb +10 -9
  284. data/lib/cosmos/tools/config_editor/system_config_dialog.rb +158 -0
  285. data/lib/cosmos/tools/data_viewer/data_viewer.rb +57 -47
  286. data/lib/cosmos/tools/data_viewer/data_viewer_component.rb +1 -0
  287. data/lib/cosmos/tools/data_viewer/dump_component.rb +3 -9
  288. data/lib/cosmos/tools/data_viewer/text_component.rb +77 -0
  289. data/lib/cosmos/tools/handbook_creator/handbook_creator.rb +68 -42
  290. data/lib/cosmos/tools/handbook_creator/handbook_creator_config.rb +1 -1
  291. data/lib/cosmos/tools/launcher/launcher.rb +2 -1
  292. data/lib/cosmos/tools/limits_monitor/limits_monitor.rb +59 -41
  293. data/lib/cosmos/tools/opengl_builder/opengl_builder.rb +42 -42
  294. data/lib/cosmos/tools/packet_viewer/packet_viewer.rb +64 -59
  295. data/lib/cosmos/tools/script_runner/script_runner.rb +198 -123
  296. data/lib/cosmos/tools/script_runner/script_runner_config.rb +14 -0
  297. data/lib/cosmos/tools/script_runner/script_runner_frame.rb +87 -35
  298. data/lib/cosmos/tools/table_manager/table_config.rb +5 -3
  299. data/lib/cosmos/tools/table_manager/table_manager.rb +48 -45
  300. data/lib/cosmos/tools/test_runner/test.rb +5 -2
  301. data/lib/cosmos/tools/test_runner/test_runner.rb +61 -38
  302. data/lib/cosmos/tools/test_runner/test_runner_chooser.rb +24 -12
  303. data/lib/cosmos/tools/tlm_extractor/tlm_extractor.rb +48 -48
  304. data/lib/cosmos/tools/tlm_extractor/tlm_extractor_config.rb +5 -8
  305. data/lib/cosmos/tools/tlm_extractor/tlm_extractor_processor.rb +20 -16
  306. data/lib/cosmos/tools/tlm_grapher/data_object_adders/xy_data_object_adder.rb +3 -3
  307. data/lib/cosmos/tools/tlm_grapher/data_object_editors/housekeeping_data_object_editor.rb +7 -7
  308. data/lib/cosmos/tools/tlm_grapher/data_object_editors/xy_data_object_editor.rb +10 -10
  309. data/lib/cosmos/tools/tlm_grapher/data_objects/housekeeping_data_object.rb +10 -3
  310. data/lib/cosmos/tools/tlm_grapher/data_objects/xy_data_object.rb +6 -6
  311. data/lib/cosmos/tools/tlm_grapher/tabbed_plots/overview_tabbed_plots.rb +14 -14
  312. data/lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_dart_thread.rb +21 -17
  313. data/lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_realtime_thread.rb +5 -8
  314. data/lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_tool.rb +94 -91
  315. data/lib/cosmos/tools/tlm_grapher/tlm_grapher.rb +27 -26
  316. data/lib/cosmos/tools/tlm_viewer/screen.rb +76 -14
  317. data/lib/cosmos/tools/tlm_viewer/tlm_viewer.rb +51 -34
  318. data/lib/cosmos/tools/tlm_viewer/widgets.rb +3 -0
  319. data/lib/cosmos/tools/tlm_viewer/widgets/aging_widget.rb +4 -5
  320. data/lib/cosmos/tools/tlm_viewer/widgets/array_widget.rb +3 -4
  321. data/lib/cosmos/tools/tlm_viewer/widgets/block_widget.rb +4 -5
  322. data/lib/cosmos/tools/tlm_viewer/widgets/canvas_clickable.rb +16 -2
  323. data/lib/cosmos/tools/tlm_viewer/widgets/canvas_widget.rb +17 -3
  324. data/lib/cosmos/tools/tlm_viewer/widgets/canvasdot_widget.rb +1 -2
  325. data/lib/cosmos/tools/tlm_viewer/widgets/canvasellipse_widget.rb +40 -0
  326. data/lib/cosmos/tools/tlm_viewer/widgets/canvasimage_widget.rb +12 -7
  327. data/lib/cosmos/tools/tlm_viewer/widgets/canvasimagevalue_widget.rb +79 -29
  328. data/lib/cosmos/tools/tlm_viewer/widgets/canvaslabel_widget.rb +1 -0
  329. data/lib/cosmos/tools/tlm_viewer/widgets/canvaslabelvalue_widget.rb +2 -1
  330. data/lib/cosmos/tools/tlm_viewer/widgets/canvasline_widget.rb +2 -0
  331. data/lib/cosmos/tools/tlm_viewer/widgets/canvaslinevalue_widget.rb +4 -0
  332. data/lib/cosmos/tools/tlm_viewer/widgets/canvasvalue_widget.rb +33 -25
  333. data/lib/cosmos/tools/tlm_viewer/widgets/checkbutton_widget.rb +5 -3
  334. data/lib/cosmos/tools/tlm_viewer/widgets/combobox_widget.rb +5 -3
  335. data/lib/cosmos/tools/tlm_viewer/widgets/formatfontvalue_widget.rb +1 -1
  336. data/lib/cosmos/tools/tlm_viewer/widgets/formatvalue_widget.rb +4 -7
  337. data/lib/cosmos/tools/tlm_viewer/widgets/horizontal_widget.rb +5 -5
  338. data/lib/cosmos/tools/tlm_viewer/widgets/horizontalbox_widget.rb +6 -7
  339. data/lib/cosmos/tools/tlm_viewer/widgets/horizontalline_widget.rb +2 -4
  340. data/lib/cosmos/tools/tlm_viewer/widgets/label_widget.rb +10 -8
  341. data/lib/cosmos/tools/tlm_viewer/widgets/labelformatvalue_widget.rb +2 -3
  342. data/lib/cosmos/tools/tlm_viewer/widgets/labelled_widget.rb +58 -0
  343. data/lib/cosmos/tools/tlm_viewer/widgets/labelprogressbar_widget.rb +3 -4
  344. data/lib/cosmos/tools/tlm_viewer/widgets/labeltrendlimitsbar_widget.rb +2 -4
  345. data/lib/cosmos/tools/tlm_viewer/widgets/labelvalue_widget.rb +2 -1
  346. data/lib/cosmos/tools/tlm_viewer/widgets/labelvaluedesc_widget.rb +3 -5
  347. data/lib/cosmos/tools/tlm_viewer/widgets/labelvaluelimitsbar_widget.rb +2 -3
  348. data/lib/cosmos/tools/tlm_viewer/widgets/labelvaluelimitscolumn_widget.rb +2 -3
  349. data/lib/cosmos/tools/tlm_viewer/widgets/labelvaluerangebar_widget.rb +2 -3
  350. data/lib/cosmos/tools/tlm_viewer/widgets/labelvaluerangecolumn_widget.rb +2 -3
  351. data/lib/cosmos/tools/tlm_viewer/widgets/layout_widget.rb +3 -5
  352. data/lib/cosmos/tools/tlm_viewer/widgets/led_widget.rb +108 -0
  353. data/lib/cosmos/tools/tlm_viewer/widgets/limits_widget.rb +60 -10
  354. data/lib/cosmos/tools/tlm_viewer/widgets/limitsbar_widget.rb +22 -8
  355. data/lib/cosmos/tools/tlm_viewer/widgets/limitscolor_widget.rb +19 -13
  356. data/lib/cosmos/tools/tlm_viewer/widgets/limitscolumn_widget.rb +22 -8
  357. data/lib/cosmos/tools/tlm_viewer/widgets/linegraph_widget.rb +2 -3
  358. data/lib/cosmos/tools/tlm_viewer/widgets/matrixbycolumns_widget.rb +4 -3
  359. data/lib/cosmos/tools/tlm_viewer/widgets/multi_widget.rb +1 -3
  360. data/lib/cosmos/tools/tlm_viewer/widgets/progressbar_widget.rb +10 -5
  361. data/lib/cosmos/tools/tlm_viewer/widgets/radiobutton_widget.rb +7 -4
  362. data/lib/cosmos/tools/tlm_viewer/widgets/rangebar_widget.rb +4 -6
  363. data/lib/cosmos/tools/tlm_viewer/widgets/rangecolumn_widget.rb +3 -5
  364. data/lib/cosmos/tools/tlm_viewer/widgets/screenshotbutton_widget.rb +4 -3
  365. data/lib/cosmos/tools/tlm_viewer/widgets/scrollwindow_widget.rb +2 -3
  366. data/lib/cosmos/tools/tlm_viewer/widgets/sectionheader_widget.rb +2 -3
  367. data/lib/cosmos/tools/tlm_viewer/widgets/spacer_widget.rb +4 -6
  368. data/lib/cosmos/tools/tlm_viewer/widgets/tabbook_widget.rb +2 -3
  369. data/lib/cosmos/tools/tlm_viewer/widgets/tabitem_widget.rb +2 -3
  370. data/lib/cosmos/tools/tlm_viewer/widgets/textbox_widget.rb +13 -4
  371. data/lib/cosmos/tools/tlm_viewer/widgets/textfield_widget.rb +3 -4
  372. data/lib/cosmos/tools/tlm_viewer/widgets/timegraph_widget.rb +3 -8
  373. data/lib/cosmos/tools/tlm_viewer/widgets/title_widget.rb +6 -12
  374. data/lib/cosmos/tools/tlm_viewer/widgets/trendbar_widget.rb +5 -10
  375. data/lib/cosmos/tools/tlm_viewer/widgets/trendlimitsbar_widget.rb +5 -3
  376. data/lib/cosmos/tools/tlm_viewer/widgets/value_widget.rb +4 -4
  377. data/lib/cosmos/tools/tlm_viewer/widgets/valuelimitsbar_widget.rb +2 -3
  378. data/lib/cosmos/tools/tlm_viewer/widgets/valuelimitscolumn_widget.rb +2 -3
  379. data/lib/cosmos/tools/tlm_viewer/widgets/valuerangebar_widget.rb +3 -4
  380. data/lib/cosmos/tools/tlm_viewer/widgets/valuerangecolumn_widget.rb +2 -3
  381. data/lib/cosmos/tools/tlm_viewer/widgets/vertical_widget.rb +8 -7
  382. data/lib/cosmos/tools/tlm_viewer/widgets/verticalbox_widget.rb +9 -7
  383. data/lib/cosmos/tools/tlm_viewer/widgets/widget.rb +60 -47
  384. data/lib/cosmos/top_level.rb +37 -13
  385. data/lib/cosmos/utilities/ruby_lex_utils.rb +34 -30
  386. data/lib/cosmos/version.rb +5 -5
  387. data/lib/cosmos/win32/excel.rb +81 -24
  388. data/make_gems.sh +10 -0
  389. data/run_gui_tests.bat +1 -0
  390. data/spec/conversions/packet_time_formatted_conversion_spec.rb +58 -0
  391. data/spec/conversions/packet_time_seconds_conversion_spec.rb +60 -0
  392. data/spec/core_ext/socket_spec.rb +1 -1
  393. data/spec/core_ext/time_spec.rb +4 -0
  394. data/spec/gui/utilities/script_module_gui_spec.rb +44 -63
  395. data/spec/install/config/targets/INST/cmd_tlm/inst_cmds.txt +1 -1
  396. data/spec/install/config/targets/INST/cmd_tlm/inst_tlm.txt +5 -5
  397. data/spec/install/yaml_docs_spec.rb +132 -0
  398. data/spec/interfaces/linc_interface_spec.rb +1 -1
  399. data/spec/interfaces/protocols/fixed_protocol_spec.rb +20 -9
  400. data/spec/interfaces/protocols/ignore_packet_protocol_spec.rb +243 -0
  401. data/spec/interfaces/protocols/length_protocol_spec.rb +39 -0
  402. data/spec/interfaces/protocols/preidentified_protocol_spec.rb +227 -4
  403. data/spec/interfaces/protocols/template_protocol_spec.rb +78 -25
  404. data/spec/io/json_drb_rack_spec.rb +166 -0
  405. data/spec/io/json_drb_spec.rb +14 -0
  406. data/spec/io/json_rpc_spec.rb +4 -5
  407. data/spec/io/posix_serial_driver_spec.rb +81 -0
  408. data/spec/io/serial_driver_spec.rb +15 -13
  409. data/spec/io/win32_serial_driver_spec.rb +33 -3
  410. data/spec/packet_logs/packet_log_reader_spec.rb +106 -52
  411. data/spec/packets/commands_spec.rb +22 -0
  412. data/spec/packets/packet_config_spec.rb +29 -16
  413. data/spec/packets/packet_item_spec.rb +2 -2
  414. data/spec/packets/packet_spec.rb +39 -6
  415. data/spec/packets/parsers/format_string_parser_spec.rb +0 -11
  416. data/spec/packets/parsers/macro_parser_spec.rb +36 -36
  417. data/spec/packets/parsers/state_parser_spec.rb +69 -11
  418. data/spec/packets/structure_spec.rb +93 -2
  419. data/spec/packets/telemetry_spec.rb +63 -10
  420. data/spec/script/extract_spec.rb +4 -1
  421. data/spec/script/script_spec.rb +2 -3
  422. data/spec/script/scripting_spec.rb +2 -1
  423. data/spec/script/tools_spec.rb +0 -1
  424. data/spec/streams/tcpip_socket_stream_spec.rb +32 -27
  425. data/spec/system/system_spec.rb +187 -4
  426. data/spec/system/target_spec.rb +62 -1
  427. data/spec/tools/cmd_tlm_server/api_spec.rb +29 -21
  428. data/spec/tools/cmd_tlm_server/background_tasks_spec.rb +15 -7
  429. data/spec/tools/cmd_tlm_server/cmd_tlm_server_config_spec.rb +33 -0
  430. data/spec/tools/cmd_tlm_server/commanding_spec.rb +25 -1
  431. data/spec/tools/cmd_tlm_server/interface_thread_spec.rb +15 -0
  432. data/spec/tools/cmd_tlm_server/router_thread_spec.rb +2 -3
  433. data/spec/top_level/top_level_spec.rb +29 -5
  434. data/spec/utilities/message_log_spec.rb +6 -3
  435. data/tasks/gemfile_stats.rake +38 -14
  436. data/test/performance/config/system/system.txt +0 -0
  437. data/test/performance/config/targets/PACKET/cmd_tlm/packet_tlm.txt +5 -5
  438. data/test/performance/config/tools/handbook_creator/assets/css/bootstrap-theme.css +397 -0
  439. data/test/performance/config/tools/handbook_creator/assets/css/bootstrap-theme.min.css +7 -0
  440. data/test/performance/config/tools/handbook_creator/assets/css/bootstrap.css +7118 -0
  441. data/test/performance/config/tools/handbook_creator/assets/css/bootstrap.min.css +7 -0
  442. data/test/performance/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.eot +0 -0
  443. data/test/performance/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.svg +229 -0
  444. data/test/performance/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
  445. data/test/performance/config/tools/handbook_creator/assets/fonts/glyphicons-halflings-regular.woff +0 -0
  446. data/test/performance/config/tools/handbook_creator/assets/img/ball_logo.bmp +0 -0
  447. data/test/performance/config/tools/handbook_creator/assets/img/ball_logo.gif +0 -0
  448. data/test/performance/config/tools/handbook_creator/assets/img/ball_logo.jpg +0 -0
  449. data/test/performance/config/tools/handbook_creator/assets/js/bootstrap.js +2006 -0
  450. data/test/performance/config/tools/handbook_creator/assets/js/bootstrap.min.js +7 -0
  451. data/test/performance/config/tools/handbook_creator/assets/js/html5shiv.js +8 -0
  452. data/test/performance/config/tools/handbook_creator/assets/js/jquery-1.10.2.min.js +6 -0
  453. data/test/performance/config/tools/handbook_creator/assets/js/respond.min.js +6 -0
  454. data/test/performance/config/tools/test_runner/test_runner.txt +1 -1
  455. data/test/performance/procedures/cosmos_api_test.rb +1 -1
  456. data/test/performance/tools/identify_performance.rb +82 -0
  457. metadata +154 -64
  458. data/lib/cosmos/dart/Gemfile +0 -69
@@ -16,12 +16,16 @@ module Cosmos
16
16
  # Processes the config file
17
17
  def initialize(filename)
18
18
  return unless filename
19
+ @filename = filename
19
20
  parser = ConfigParser.new("http://cosmosrb.com/docs/tools/#script-runner-configuration")
20
21
  parser.parse_file(filename) do |keyword, params|
21
22
  case keyword
22
23
  when 'LINE_DELAY'
23
24
  parser.verify_num_parameters(1, 1, "#{keyword} <Delay in Seconds>")
24
25
  ScriptRunnerFrame.line_delay = params[0].to_f
26
+ when 'PAUSE_ON_ERROR'
27
+ parser.verify_num_parameters(1, 1, "#{keyword} <TRUE or FALSE>")
28
+ ScriptRunnerFrame.pause_on_error = ConfigParser.handle_true_false(params[0])
25
29
  when 'MONITOR_LIMITS'
26
30
  parser.verify_num_parameters(0, 0, keyword)
27
31
  ScriptRunnerFrame.monitor_limits = true
@@ -35,5 +39,15 @@ module Cosmos
35
39
  end
36
40
  end
37
41
  end
42
+
43
+ def write_config
44
+ @filename = File.join(Cosmos::USERPATH, 'config', 'tools', 'script_runner', 'script_runner.txt') unless @filename
45
+ File.open(@filename, 'w') do |file|
46
+ file.puts("LINE_DELAY #{ScriptRunnerFrame.line_delay}")
47
+ file.puts("PAUSE_ON_ERROR #{ScriptRunnerFrame.pause_on_error ? 'TRUE' : 'FALSE'}")
48
+ file.puts("MONITOR_LIMITS") if ScriptRunnerFrame.monitor_limits
49
+ file.puts("PAUSE_ON_RED") if ScriptRunnerFrame.pause_on_red
50
+ end
51
+ end
38
52
  end
39
53
  end
@@ -89,6 +89,9 @@ module Cosmos
89
89
  SET_TLM_KEYWORDS = %w(set_tlm set_tlm_raw override_tlm_raw normalize_tlm_raw)
90
90
  CHECK_KEYWORDS = %w(check check_raw wait wait_raw wait_check wait_check_raw)
91
91
 
92
+ INSTANCE_VARS = %w(__return_val close_on_complete error eval_error filename instrumented_script \
93
+ line_number line_offset saved_instance saved_run_thread text text_binding uncaught_exception)
94
+
92
95
  attr_accessor :use_instrumentation
93
96
  attr_accessor :change_callback
94
97
  attr_accessor :run_callback
@@ -99,8 +102,8 @@ module Cosmos
99
102
  attr_accessor :continue_after_error
100
103
  attr_accessor :exceptions
101
104
  attr_accessor :script_binding
102
- attr_accessor :inline_return
103
- attr_accessor :inline_return_params
105
+ attr_accessor :inline_return # Deprecated and unused - Here to prevent cache errors for old scripts
106
+ attr_accessor :inline_return_params # Deprecated and unused - Here to prevent cache errors for old scripts
104
107
  attr_reader :message_log
105
108
  attr_reader :script_class
106
109
  attr_reader :top_level_instrumented_cache
@@ -126,6 +129,7 @@ module Cosmos
126
129
  @@cancel_output = false
127
130
  @@cancel_limits = false
128
131
  @@file_number = 1
132
+ @@default_font = Cosmos.get_default_font
129
133
 
130
134
  def initialize(parent, default_tab_text = 'Untitled')
131
135
  super(parent)
@@ -252,7 +256,7 @@ module Cosmos
252
256
 
253
257
  def create_ruby_editor
254
258
  # Add Initial Text Window
255
- script = RubyEditor.new(self)
259
+ script = RubyEditor.new(self, @@default_font)
256
260
  script.enable_breakpoints = true if @debug_frame
257
261
  connect(script,
258
262
  SIGNAL('breakpoint_set(int)'),
@@ -266,6 +270,10 @@ module Cosmos
266
270
  SIGNAL('breakpoints_cleared()'),
267
271
  self,
268
272
  SLOT('breakpoints_cleared()'))
273
+ script.connect(SIGNAL('font_changed(QFont)')) do |font|
274
+ # Remember changed fonts for future tabs
275
+ @@default_font = font
276
+ end
269
277
 
270
278
  # Add right click menu
271
279
  script.setContextMenuPolicy(Qt::CustomContextMenu)
@@ -315,6 +323,10 @@ module Cosmos
315
323
  @script.setFocus
316
324
  end
317
325
 
326
+ def active_script_highlight(color)
327
+ Qt.execute_in_main_thread { @active_script.highlight_line(color) }
328
+ end
329
+
318
330
  def allow_start=(value)
319
331
  @allow_start = value
320
332
  if @allow_start
@@ -560,10 +572,18 @@ module Cosmos
560
572
  return nil if @cancel_instrumentation
561
573
  instrumented_line = ''
562
574
  if instrumentable
563
- # Skip the segment if it's empty. Note that the segment could have
564
- # originally had comments but they were stripped in
575
+ # Add a newline if it's empty to ensure the instrumented code has
576
+ # the same number of lines as the original script. Note that the
577
+ # segment could have originally had comments but they were stripped in
565
578
  # ruby_lex_utils.remove_comments
566
- next if segment.strip.empty?
579
+ if segment.strip.empty?
580
+ instrumented_text << "\n"
581
+ next
582
+ end
583
+
584
+ # Create a variable to hold the segment's return value
585
+ instrumented_line << "__return_val = nil; "
586
+
567
587
  # If not inside a begin block then create one to catch exceptions
568
588
  unless inside_begin
569
589
  instrumented_line << 'begin; '
@@ -571,24 +591,23 @@ module Cosmos
571
591
 
572
592
  # Add preline instrumentation
573
593
  instrumented_line << "ScriptRunnerFrame.instance.script_binding = binding(); "\
574
- "if ScriptRunnerFrame.instance.inline_return then ScriptRunnerFrame.instance.inline_return = nil; "\
575
- "return ScriptRunnerFrame.instance.inline_return_params; end; "\
576
594
  "ScriptRunnerFrame.instance.pre_line_instrumentation('#{filename}', #{line_no}); "
577
595
 
578
596
  # Add the actual line
597
+ instrumented_line << "__return_val = begin; "
579
598
  instrumented_line << segment
580
599
  instrumented_line.chomp!
581
600
 
582
601
  # Add postline instrumentation
583
- instrumented_line << "; ScriptRunnerFrame.instance.post_line_instrumentation('#{filename}', #{line_no})"
602
+ instrumented_line << " end; ScriptRunnerFrame.instance.post_line_instrumentation('#{filename}', #{line_no}); "
584
603
 
585
604
  # Complete begin block to catch exceptions
586
605
  unless inside_begin
587
- instrumented_line << "; rescue Exception => eval_error; "\
588
- "retry if ScriptRunnerFrame.instance.exception_instrumentation(eval_error, '#{filename}', #{line_no}); end"
606
+ instrumented_line << "rescue Exception => eval_error; "\
607
+ "retry if ScriptRunnerFrame.instance.exception_instrumentation(eval_error, '#{filename}', #{line_no}); end; "
589
608
  end
590
609
 
591
- instrumented_line << "\n"
610
+ instrumented_line << " __return_val\n"
592
611
  else
593
612
  unless segment =~ /^\s*end\s*$/ or segment =~ /^\s*when .*$/
594
613
  num_left_brackets = segment.count('{')
@@ -659,7 +678,7 @@ module Cosmos
659
678
  def exception_instrumentation(error, filename, line_number)
660
679
  if error.class == StopScript || error.class == SkipTestCase || !@use_instrumentation
661
680
  Kernel.raise error
662
- else
681
+ elsif !error.eql?(@@error)
663
682
  line_number = line_number + @line_offset if @active_script.object_id == @script.object_id
664
683
  handle_exception(error, false, filename, line_number)
665
684
  end
@@ -752,6 +771,21 @@ module Cosmos
752
771
  @script.comment_or_uncomment_lines unless running?()
753
772
  end
754
773
 
774
+ def zoom_in
775
+ # @active_script since this can be used while running
776
+ @active_script.zoom_in
777
+ end
778
+
779
+ def zoom_out
780
+ # @active_script since this can be used while running
781
+ @active_script.zoom_out
782
+ end
783
+
784
+ def zoom_default
785
+ # @active_script since this can be used while running
786
+ @active_script.zoom_default
787
+ end
788
+
755
789
  ##################################################################################
756
790
  # Implement Script functionality in the frame (run selection, run from cursor, etc
757
791
  ##################################################################################
@@ -935,6 +969,10 @@ module Cosmos
935
969
  end
936
970
 
937
971
  if @script_binding
972
+ # Check for accessing an instance variable or local
973
+ if debug_text =~ /^@\S+$/ || @script_binding.local_variables.include?(debug_text.to_sym)
974
+ debug_text = "puts #{debug_text}" # Automatically add puts to print it
975
+ end
938
976
  eval(debug_text, @script_binding, 'debug', 1)
939
977
  else
940
978
  Object.class_eval(debug_text, 'debug', 1)
@@ -972,17 +1010,20 @@ module Cosmos
972
1010
  @debug_text.setPlainText("")
973
1011
  end
974
1012
  end
975
-
976
1013
  @debug_frame.addWidget(@debug_text)
977
1014
 
978
- @return_button = Qt::PushButton.new('Insert Return')
979
- @debug_frame.addWidget(@return_button)
980
- @return_button.connect(SIGNAL('clicked(bool)')) do
981
- scriptrunner_puts "Debug: insert_return(); ScriptRunnerFrame.instance.go()"
982
- handle_output_io()
983
- insert_return()
984
- go()
1015
+ @locals_button = Qt::PushButton.new('Locals')
1016
+ @locals_button.connect(SIGNAL('clicked(bool)')) do
1017
+ next unless @script_binding
1018
+ @locals_button.setEnabled(false)
1019
+ vars = @script_binding.local_variables.map(&:to_s)
1020
+ puts "Locals: #{vars.reject {|x| INSTANCE_VARS.include?(x)}.sort.join(', ')}"
1021
+ while @output_io.string[-1..-1] == "\n"
1022
+ Qt::CoreApplication.processEvents()
1023
+ end
1024
+ @locals_button.setEnabled(true)
985
1025
  end
1026
+ @debug_frame.addWidget(@locals_button)
986
1027
 
987
1028
  @bottom_frame.layout.addLayout(@debug_frame)
988
1029
  end
@@ -1060,7 +1101,7 @@ module Cosmos
1060
1101
 
1061
1102
  def toggle_disconnect(config_file, ask_for_config_file = true)
1062
1103
  dialog = Qt::Dialog.new(self, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
1063
- dialog.setWindowTitle(tr("Disconnect Settings"))
1104
+ dialog.setWindowTitle("Disconnect Settings")
1064
1105
  dialog_layout = Qt::VBoxLayout.new
1065
1106
  dialog_layout.addWidget(Qt::Label.new("Targets checked will be disconnected."))
1066
1107
 
@@ -1156,7 +1197,7 @@ module Cosmos
1156
1197
  Splash.execute(self) do |splash|
1157
1198
  ConfigParser.splash = splash
1158
1199
  splash.message = "Initializing Command and Telemetry Server"
1159
- set_disconnected_targets(targets, config_file)
1200
+ set_disconnected_targets(targets, targets.length == all_targets.length, config_file)
1160
1201
  ConfigParser.splash = nil
1161
1202
  end
1162
1203
  end
@@ -1357,7 +1398,13 @@ module Cosmos
1357
1398
  $stdout.add_stream(@output_io)
1358
1399
  $stderr.add_stream(@output_io)
1359
1400
 
1360
- scriptrunner_puts "Starting script: #{File.basename(@filename)}" unless close_on_complete
1401
+ unless close_on_complete
1402
+ scriptrunner_puts("Starting script: #{File.basename(@filename)}")
1403
+ targets = get_disconnected_targets()
1404
+ if targets
1405
+ scriptrunner_puts("DISCONNECTED targets: #{targets.join(',')}")
1406
+ end
1407
+ end
1361
1408
  handle_output_io()
1362
1409
 
1363
1410
  # Start Limits Monitoring
@@ -1627,33 +1674,33 @@ module Cosmos
1627
1674
  menu = current_script.context_menu(point)
1628
1675
  menu.addSeparator()
1629
1676
  if not self.class.running?
1630
- exec_selected_action = Qt::Action.new(tr("Execute Selected Lines"), self)
1631
- exec_selected_action.statusTip = tr("Execute the selected lines as a standalone script")
1677
+ exec_selected_action = Qt::Action.new("Execute Selected Lines", self)
1678
+ exec_selected_action.statusTip = "Execute the selected lines as a standalone script"
1632
1679
  exec_selected_action.connect(SIGNAL('triggered()')) { run_selection() }
1633
1680
  menu.addAction(exec_selected_action)
1634
1681
 
1635
- exec_cursor_action = Qt::Action.new(tr("Execute From Cursor"), self)
1636
- exec_cursor_action.statusTip = tr("Execute the script starting at the line containing the cursor")
1682
+ exec_cursor_action = Qt::Action.new("Execute From Cursor", self)
1683
+ exec_cursor_action.statusTip = "Execute the script starting at the line containing the cursor"
1637
1684
  exec_cursor_action.connect(SIGNAL('triggered()')) { run_from_cursor() }
1638
1685
  menu.addAction(exec_cursor_action)
1639
1686
 
1640
1687
  menu.addSeparator()
1641
1688
 
1642
1689
  if RUBY_VERSION.split('.')[0].to_i > 1
1643
- syntax_action = Qt::Action.new(tr("Ruby Syntax Check Selected Lines"), self)
1644
- syntax_action.statusTip = tr("Check the selected lines for valid Ruby syntax")
1690
+ syntax_action = Qt::Action.new("Ruby Syntax Check Selected Lines", self)
1691
+ syntax_action.statusTip = "Check the selected lines for valid Ruby syntax"
1645
1692
  syntax_action.connect(SIGNAL('triggered()')) { ruby_syntax_check_selection() }
1646
1693
  menu.addAction(syntax_action)
1647
1694
  end
1648
1695
 
1649
- mnemonic_action = Qt::Action.new(tr("Mnemonic Check Selected Lines"), self)
1650
- mnemonic_action.statusTip = tr("Check the selected lines for valid targets, packets, mnemonics and parameters")
1696
+ mnemonic_action = Qt::Action.new("Mnemonic Check Selected Lines", self)
1697
+ mnemonic_action.statusTip = "Check the selected lines for valid targets, packets, mnemonics and parameters"
1651
1698
  mnemonic_action.connect(SIGNAL('triggered()')) { mnemonic_check_selection() }
1652
1699
  menu.addAction(mnemonic_action)
1653
1700
 
1654
1701
  elsif running?() and @realtime_button_bar.state != 'Running'
1655
- exec_selected_action = Qt::Action.new(tr("Execute Selected Lines While Paused"), self)
1656
- exec_selected_action.statusTip = tr("Execute the selected lines as a standalone script")
1702
+ exec_selected_action = Qt::Action.new("Execute Selected Lines While Paused", self)
1703
+ exec_selected_action.statusTip = "Execute the selected lines as a standalone script"
1657
1704
  exec_selected_action.connect(SIGNAL('triggered()')) { run_selection_while_paused() }
1658
1705
  menu.addAction(exec_selected_action)
1659
1706
  end
@@ -1667,7 +1714,12 @@ module Cosmos
1667
1714
  if cached
1668
1715
  @active_script.setPlainText(cached.gsub("\r", ''))
1669
1716
  else
1670
- @active_script.setPlainText(File.read(filename).gsub("\r", ''))
1717
+ if File.exist?(filename)
1718
+ data = File.read(filename).gsub("\r", '')
1719
+ else
1720
+ data = ""
1721
+ end
1722
+ @active_script.setPlainText(data)
1671
1723
  end
1672
1724
  mark_breakpoints(filename)
1673
1725
 
@@ -85,9 +85,9 @@ module Cosmos
85
85
  when 'TABLEFILE'
86
86
  usage = "#{keyword} <File name>"
87
87
  parser.verify_num_parameters(1, 1, usage)
88
- filename = File.join(File.dirname(filename), params[0])
89
- raise parser.error("Table file #{filename} not found", usage) unless File.exist?(filename)
90
- process_file(filename)
88
+ table_filename = File.join(File.dirname(filename), params[0])
89
+ raise parser.error("Table file #{table_filename} not found", usage) unless File.exist?(table_filename)
90
+ process_file(table_filename)
91
91
 
92
92
  when 'TABLE'
93
93
  finish_packet()
@@ -172,6 +172,8 @@ module Cosmos
172
172
  # duplicated until the specified number of rows are created.
173
173
  def finish_packet
174
174
  if @current_packet
175
+ warnings = @current_packet.check_bit_offsets
176
+ raise "Overlapping items not allowed in tables.\n#{warnings}" if warnings.length > 0
175
177
  if @current_packet.type == :TWO_DIMENSIONAL
176
178
  items = @current_packet.sorted_items.clone
177
179
  (@current_packet.num_rows - 1).times do |row|
@@ -12,9 +12,9 @@ require 'cosmos'
12
12
  Cosmos.catch_fatal_exception do
13
13
  require 'cosmos/gui/qt_tool'
14
14
  require 'cosmos/gui/dialogs/progress_dialog'
15
+ require 'cosmos/gui/dialogs/tlm_details_dialog'
15
16
  require 'cosmos/tools/table_manager/table_config'
16
17
  require 'cosmos/tools/table_manager/table_manager_core'
17
- require 'cosmos/gui/dialogs/tlm_details_dialog'
18
18
  end
19
19
 
20
20
  class Qt::ComboBox
@@ -192,7 +192,7 @@ module Cosmos
192
192
  option_parser.on("-c", "--create FILE", "Use the specified definition file to create the table") do |arg|
193
193
  options.create = arg
194
194
  end
195
- option_parser.on("-o", "--output DIRECTORY", "Create files in the specified directory") do |arg|
195
+ option_parser.on("-o", "--output DIRECTORY", "Create files in the specified directory (required with --create)") do |arg|
196
196
  options.output_dir = File.expand_path(arg)
197
197
  end
198
198
  option_parser.on("--convert FILE", "Convert the specified configuration file to the new format") do |arg|
@@ -211,12 +211,15 @@ module Cosmos
211
211
  # command line
212
212
  # @return [Boolean] Whether to contine running the application
213
213
  def self.post_options_parsed_hook(options)
214
- if options.create
214
+ if options.create and options.output_dir
215
+ normalize_config_options(options)
215
216
  core = TableManagerCore.new
216
- core.file_new(options.create, options.output_dir)
217
+ create_path = self.config_path(options, options.create, ".txt", "table_manager")
218
+ core.file_new(create_path, options.output_dir)
217
219
  return false
218
220
  end
219
221
  if options.convert
222
+ normalize_config_options(options)
220
223
  if options.convert.include?("/")
221
224
  parts = options.convert.split("/")
222
225
  else
@@ -279,7 +282,7 @@ module Cosmos
279
282
  complete_initialize()
280
283
  setMinimumSize(400, 250)
281
284
 
282
- statusBar.showMessage(tr("Ready")) # Show message to initialize status bar
285
+ statusBar.showMessage("Ready") # Show message to initialize status bar
283
286
  end
284
287
 
285
288
  def initialize_actions(no_tables = false)
@@ -296,79 +299,79 @@ module Cosmos
296
299
  open_action.connect(SIGNAL('triggered()')) { file_open(@bin_path) }
297
300
  self.addAction(open_action) # Add it to the application
298
301
 
299
- @file_open_both = Qt::Action.new(Cosmos.get_icon('open.png'), tr('Open &Both'), self)
300
- @file_open_both.statusTip = tr('Specify both the binary file and the definition file to open')
302
+ @file_open_both = Qt::Action.new(Cosmos.get_icon('open.png'), 'Open &Both', self)
303
+ @file_open_both.statusTip = 'Specify both the binary file and the definition file to open'
301
304
  @file_open_both.connect(SIGNAL('triggered()')) { file_open_both() }
302
305
 
303
- @file_save = Qt::Action.new(Cosmos.get_icon('save.png'), tr('&Save File'), self)
306
+ @file_save = Qt::Action.new(Cosmos.get_icon('save.png'), '&Save File', self)
304
307
  @file_save_keyseq = Qt::KeySequence.new(Qt::KeySequence::Save)
305
308
  @file_save.shortcut = @file_save_keyseq
306
- @file_save.statusTip = tr('Save the displayed data back to the binary file')
309
+ @file_save.statusTip = 'Save the displayed data back to the binary file'
307
310
  @file_save.connect(SIGNAL('triggered()')) { file_save() }
308
311
 
309
- @file_save_as = Qt::Action.new(Cosmos.get_icon('save_as.png'), tr('Save File &As'), self)
312
+ @file_save_as = Qt::Action.new(Cosmos.get_icon('save_as.png'), 'Save File &As', self)
310
313
  @file_save_as_keyseq = Qt::KeySequence.new(Qt::KeySequence::SaveAs)
311
314
  @file_save_as.shortcut = @file_save_as_keyseq
312
- @file_save_as.statusTip = tr('Save the displayed data to a new binary file')
315
+ @file_save_as.statusTip = 'Save the displayed data to a new binary file'
313
316
  @file_save_as.connect(SIGNAL('triggered()')) { file_save(true) }
314
317
 
315
- @file_close = Qt::Action.new(Cosmos.get_icon('close.png'), tr('&Close File'), self)
316
- @file_close_keyseq = Qt::KeySequence.new(tr("Ctrl+W")) # Qt::KeySequence::Close is Alt-F4 on Windows
318
+ @file_close = Qt::Action.new(Cosmos.get_icon('close.png'), '&Close File', self)
319
+ @file_close_keyseq = Qt::KeySequence.new("Ctrl+W") # Qt::KeySequence::Close is Alt-F4 on Windows
317
320
  @file_close.shortcut = @file_close_keyseq
318
- @file_close.statusTip = tr('Close the current file')
321
+ @file_close.statusTip = 'Close the current file'
319
322
  @file_close.connect(SIGNAL('triggered()')) { file_close() }
320
323
 
321
- @file_check = Qt::Action.new(Cosmos.get_icon('checkmark.png'), tr('&Check All'), self)
322
- @file_check_keyseq = Qt::KeySequence.new(tr('Ctrl+K'))
324
+ @file_check = Qt::Action.new(Cosmos.get_icon('checkmark.png'), '&Check All', self)
325
+ @file_check_keyseq = Qt::KeySequence.new('Ctrl+K')
323
326
  @file_check.shortcut = @file_check_keyseq
324
- @file_check.statusTip = tr('Check each data value against verification criteria')
327
+ @file_check.statusTip = 'Check each data value against verification criteria'
325
328
  @file_check.connect(SIGNAL('triggered()')) { file_check() }
326
329
 
327
- @file_hex = Qt::Action.new(tr('&Hex Dump'), self)
328
- @file_hex_keyseq = Qt::KeySequence.new(tr('Ctrl+H'))
330
+ @file_hex = Qt::Action.new('&Hex Dump', self)
331
+ @file_hex_keyseq = Qt::KeySequence.new('Ctrl+H')
329
332
  @file_hex.shortcut = @file_hex_keyseq
330
- @file_hex.statusTip = tr('Display a hex representation of the binary file')
333
+ @file_hex.statusTip = 'Display a hex representation of the binary file'
331
334
  @file_hex.connect(SIGNAL('triggered()')) { display_hex(:file) }
332
335
 
333
- @file_report = Qt::Action.new(tr('Create &Report'), self)
334
- @file_report_keyseq = Qt::KeySequence.new(tr('Ctrl+R'))
336
+ @file_report = Qt::Action.new('Create &Report', self)
337
+ @file_report_keyseq = Qt::KeySequence.new('Ctrl+R')
335
338
  @file_report.shortcut = @file_report_keyseq
336
- @file_report.statusTip = tr('Create a text file report describing the binary data')
339
+ @file_report.statusTip = 'Create a text file report describing the binary data'
337
340
  @file_report.connect(SIGNAL('triggered()')) { file_report() }
338
341
 
339
342
  unless no_tables
340
343
  # Table Menu Actions
341
- @table_check = Qt::Action.new(Cosmos.get_icon('checkmark.png'), tr('&Check'), self)
342
- @table_check.statusTip = tr('Check each data value against verification criteria')
344
+ @table_check = Qt::Action.new(Cosmos.get_icon('checkmark.png'), '&Check', self)
345
+ @table_check.statusTip = 'Check each data value against verification criteria'
343
346
  @table_check.connect(SIGNAL('triggered()')) { table_check() }
344
347
 
345
- @table_default = Qt::Action.new(tr('&Default'), self)
346
- @table_default_keyseq = Qt::KeySequence.new(tr('Ctrl+D'))
348
+ @table_default = Qt::Action.new('&Default', self)
349
+ @table_default_keyseq = Qt::KeySequence.new('Ctrl+D')
347
350
  @table_default.shortcut = @table_default_keyseq
348
- @table_default.statusTip = tr('Revert all data values to their defaults')
351
+ @table_default.statusTip = 'Revert all data values to their defaults'
349
352
  @table_default.connect(SIGNAL('triggered()')) { table_default() }
350
353
 
351
- @table_hex = Qt::Action.new(tr('&Hex Dump'), self)
352
- @table_hex.statusTip = tr('Display a hex representation of the table')
354
+ @table_hex = Qt::Action.new('&Hex Dump', self)
355
+ @table_hex.statusTip = 'Display a hex representation of the table'
353
356
  @table_hex.connect(SIGNAL('triggered()')) { display_hex(:table) }
354
357
 
355
- @table_save = Qt::Action.new(tr('&Save Table Binary'), self)
356
- @table_save.statusTip = tr('Save the current table to a stand alone binary file')
358
+ @table_save = Qt::Action.new('&Save Table Binary', self)
359
+ @table_save.statusTip = 'Save the current table to a stand alone binary file'
357
360
  @table_save.connect(SIGNAL('triggered()')) { table_save() }
358
361
 
359
- @table_commit = Qt::Action.new(tr('Commit to Existing &File'), self)
360
- @table_commit.statusTip = tr('Incorporate the current table data into a binary file which already contains the table')
362
+ @table_commit = Qt::Action.new('Commit to Existing &File', self)
363
+ @table_commit.statusTip = 'Incorporate the current table data into a binary file which already contains the table'
361
364
  @table_commit.connect(SIGNAL('triggered()')) { table_commit() }
362
365
  end
363
366
  end
364
367
 
365
368
  def initialize_menus(no_tables = false)
366
- file_menu = menuBar.addMenu(tr('&File'))
369
+ file_menu = menuBar.addMenu('&File')
367
370
 
368
- file_new = file_menu.addMenu(Cosmos.get_icon('file.png'), tr("&New File")) # \tCtrl-N displays shortcut
371
+ file_new = file_menu.addMenu(Cosmos.get_icon('file.png'), "&New File") # \tCtrl-N displays shortcut
369
372
  target_dirs_action(file_new, @system_def_path, 'tools/table_manager', method(:file_new))
370
373
 
371
- file_open = file_menu.addMenu(Cosmos.get_icon('open.png'), tr("&Open")) # \tCtrl-O displays shortcut
374
+ file_open = file_menu.addMenu(Cosmos.get_icon('open.png'), "&Open") # \tCtrl-O displays shortcut
372
375
  target_dirs_action(file_open, @system_bin_path, 'tables', method(:file_open))
373
376
 
374
377
  file_menu.addAction(@file_open_both)
@@ -383,7 +386,7 @@ module Cosmos
383
386
  file_menu.addAction(@exit_action)
384
387
 
385
388
  unless no_tables
386
- table_menu = menuBar.addMenu(tr('&Table'))
389
+ table_menu = menuBar.addMenu('&Table')
387
390
  table_menu.addAction(@table_check)
388
391
  table_menu.addAction(@table_default)
389
392
  table_menu.addAction(@table_hex)
@@ -409,9 +412,9 @@ module Cosmos
409
412
  # Create the information pane with the filenames
410
413
  filename_layout = Qt::FormLayout.new
411
414
  @table_def_label = Qt::Label.new("")
412
- filename_layout.addRow(tr("Definition File:"), @table_def_label)
415
+ filename_layout.addRow("Definition File:", @table_def_label)
413
416
  @table_bin_label = Qt::Label.new("")
414
- filename_layout.addRow(tr("Binary File:"), @table_bin_label)
417
+ filename_layout.addRow("Binary File:", @table_bin_label)
415
418
  @top_layout.addLayout(filename_layout)
416
419
 
417
420
  # Separator before editor
@@ -556,7 +559,7 @@ module Cosmos
556
559
 
557
560
  display_all_gui_data()
558
561
  @table_bin_label.text = filename
559
- statusBar.showMessage(tr("File Saved Successfully"))
562
+ statusBar.showMessage("File Saved Successfully")
560
563
  rescue TableManagerCore::CoreError, SaveError => err
561
564
  Qt::MessageBox.warning(self, "File Save Errors", err.message)
562
565
  rescue => err
@@ -1073,8 +1076,8 @@ module Cosmos
1073
1076
  else
1074
1077
  item_name = gui_table.verticalHeaderItem(table_item.row).text
1075
1078
  end
1076
- details_action = Qt::Action.new(tr("Details"), self)
1077
- details_action.statusTip = tr("Popup details about #{current_table_name} #{item_name}")
1079
+ details_action = Qt::Action.new("Details", self)
1080
+ details_action.statusTip = "Popup details about #{current_table_name} #{item_name}"
1078
1081
  details_action.connect(SIGNAL('triggered()')) do
1079
1082
  TlmDetailsDialog.new(nil,
1080
1083
  'TABLE',
@@ -1084,8 +1087,8 @@ module Cosmos
1084
1087
  end
1085
1088
  menu.addAction(details_action)
1086
1089
 
1087
- default_action = Qt::Action.new(tr("Default"), self)
1088
- default_action.statusTip = tr("Set item to default value")
1090
+ default_action = Qt::Action.new("Default", self)
1091
+ default_action.statusTip = "Set item to default value"
1089
1092
  default_action.connect(SIGNAL('triggered()')) do
1090
1093
  item = table.get_item(item_name)
1091
1094
  table.write(item.name, item.default)