openc3-cosmos-tool-docs 6.5.1 → 6.7.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 (240) hide show
  1. checksums.yaml +4 -4
  2. data/tools/staticdocs/404.html +1 -1
  3. data/tools/staticdocs/assets/css/{styles.1a361da6.css → styles.3a94737c.css} +1 -1
  4. data/tools/staticdocs/assets/js/019369f3.aee00d57.js +1 -0
  5. data/tools/staticdocs/assets/js/058ffc22.4303e204.js +1 -0
  6. data/tools/staticdocs/assets/js/0686a885.be701f94.js +1 -0
  7. data/tools/staticdocs/assets/js/{078dbab0.babf69ab.js → 078dbab0.e6fc6dd3.js} +1 -1
  8. data/tools/staticdocs/assets/js/0f5d161c.a79a923a.js +1 -0
  9. data/tools/staticdocs/assets/js/{0ff569c9.14ed0a79.js → 0ff569c9.9c143528.js} +1 -1
  10. data/tools/staticdocs/assets/js/103cc3be.37e9dfb2.js +1 -0
  11. data/tools/staticdocs/assets/js/13196248.21d79b91.js +1 -0
  12. data/tools/staticdocs/assets/js/13c1b4e4.91618ec1.js +1 -0
  13. data/tools/staticdocs/assets/js/1836.1d45ff5f.js +1 -0
  14. data/tools/staticdocs/assets/js/1e02e6a3.600ebf22.js +1 -0
  15. data/tools/staticdocs/assets/js/2047b354.50c117b3.js +1 -0
  16. data/tools/staticdocs/assets/js/2124.c8b95b39.js +1 -0
  17. data/tools/staticdocs/assets/js/22b3ac48.cfbc9c82.js +1 -0
  18. data/tools/staticdocs/assets/js/2368.071909f8.js +4 -0
  19. data/tools/staticdocs/assets/js/2bb7bf90.44f29c21.js +1 -0
  20. data/tools/staticdocs/assets/js/2c15ad40.d1ffefde.js +1 -0
  21. data/tools/staticdocs/assets/js/35398c5c.431a9dcc.js +1 -0
  22. data/tools/staticdocs/assets/js/{3687.0a024e4c.js → 3687.0184c4bd.js} +2 -2
  23. data/tools/staticdocs/assets/js/3dd7ef3b.bd26614f.js +1 -0
  24. data/tools/staticdocs/assets/js/40365d27.19107461.js +1 -0
  25. data/tools/staticdocs/assets/js/411898ad.91b73850.js +1 -0
  26. data/tools/staticdocs/assets/js/42170351.082207e5.js +1 -0
  27. data/tools/staticdocs/assets/js/43652efd.f076a420.js +1 -0
  28. data/tools/staticdocs/assets/js/5074.11914a81.js +1 -0
  29. data/tools/staticdocs/assets/js/54d0d530.9ad6d6ad.js +1 -0
  30. data/tools/staticdocs/assets/js/59ed27a4.e9ab6f6b.js +1 -0
  31. data/tools/staticdocs/assets/js/5b233ba7.085f41a9.js +1 -0
  32. data/tools/staticdocs/assets/js/5bc719f6.2b490409.js +1 -0
  33. data/tools/staticdocs/assets/js/5c6ce5ec.1cf87b97.js +1 -0
  34. data/tools/staticdocs/assets/js/5e3ed378.92ac2561.js +1 -0
  35. data/tools/staticdocs/assets/js/5fe211ef.aa0ccb3b.js +1 -0
  36. data/tools/staticdocs/assets/js/{630e5448.699a9dec.js → 630e5448.db32449b.js} +1 -1
  37. data/tools/staticdocs/assets/js/6831b732.bb545e9e.js +1 -0
  38. data/tools/staticdocs/assets/js/696b4199.f976483f.js +1 -0
  39. data/tools/staticdocs/assets/js/6b210247.71cd015b.js +1 -0
  40. data/tools/staticdocs/assets/js/6b65133b.9c1a2ea5.js +1 -0
  41. data/tools/staticdocs/assets/js/6f92e431.acc724a9.js +1 -0
  42. data/tools/staticdocs/assets/js/72c6d8a8.f72c7c50.js +1 -0
  43. data/tools/staticdocs/assets/js/75e64983.f1731ba5.js +1 -0
  44. data/tools/staticdocs/assets/js/80c97f38.b5528d51.js +1 -0
  45. data/tools/staticdocs/assets/js/867640d5.a5ebb584.js +1 -0
  46. data/tools/staticdocs/assets/js/89e76475.6f1bd0e6.js +1 -0
  47. data/tools/staticdocs/assets/js/8b939c74.bb6669b6.js +1 -0
  48. data/tools/staticdocs/assets/js/8f7843ee.56210187.js +1 -0
  49. data/tools/staticdocs/assets/js/9424f0b3.4d21b90c.js +1 -0
  50. data/tools/staticdocs/assets/js/964eb012.7b1d7e91.js +1 -0
  51. data/tools/staticdocs/assets/js/97535711.ba627d0c.js +1 -0
  52. data/tools/staticdocs/assets/js/99581c43.f64fd445.js +1 -0
  53. data/tools/staticdocs/assets/js/9d6e81d0.c58de1b0.js +1 -0
  54. data/tools/staticdocs/assets/js/{9fb6059a.91edfcba.js → 9fb6059a.f48e20dc.js} +1 -1
  55. data/tools/staticdocs/assets/js/a677c089.6178ef83.js +1 -0
  56. data/tools/staticdocs/assets/js/a9987364.0d275743.js +1 -0
  57. data/tools/staticdocs/assets/js/a9b2dc27.b072fff7.js +1 -0
  58. data/tools/staticdocs/assets/js/aa6b6c1b.a3594c17.js +1 -0
  59. data/tools/staticdocs/assets/js/b062d239.96a0a741.js +1 -0
  60. data/tools/staticdocs/assets/js/b38a6d74.9f9ebdb2.js +1 -0
  61. data/tools/staticdocs/assets/js/b4596165.8f48aec1.js +1 -0
  62. data/tools/staticdocs/assets/js/b6d70f94.16ef1b69.js +1 -0
  63. data/tools/staticdocs/assets/js/b9f60ba6.df189198.js +1 -0
  64. data/tools/staticdocs/assets/js/bd0034eb.005cb7d6.js +1 -0
  65. data/tools/staticdocs/assets/js/c24eae19.052a322f.js +1 -0
  66. data/tools/staticdocs/assets/js/cb8c3f08.989b1a52.js +1 -0
  67. data/tools/staticdocs/assets/js/cd879be4.3ca90941.js +1 -0
  68. data/tools/staticdocs/assets/js/cf1c01b8.421b8b4b.js +1 -0
  69. data/tools/staticdocs/assets/js/d1b923aa.5b892530.js +1 -0
  70. data/tools/staticdocs/assets/js/d1bfc316.0670c343.js +1 -0
  71. data/tools/staticdocs/assets/js/{d24bf9b6.ea1e95ab.js → d24bf9b6.2db3594a.js} +1 -1
  72. data/tools/staticdocs/assets/js/d57a4b5d.dd2f0a5d.js +1 -0
  73. data/tools/staticdocs/assets/js/d5d77c37.3fe16a67.js +1 -0
  74. data/tools/staticdocs/assets/js/{d66bf9c0.8018f0a0.js → d66bf9c0.4216f492.js} +1 -1
  75. data/tools/staticdocs/assets/js/d8ca4191.0bdab1a3.js +1 -0
  76. data/tools/staticdocs/assets/js/d9b92eba.3909c726.js +1 -0
  77. data/tools/staticdocs/assets/js/db8fa1d0.416dbe98.js +1 -0
  78. data/tools/staticdocs/assets/js/dbe31111.da0777f1.js +1 -0
  79. data/tools/staticdocs/assets/js/dc5f7beb.bc79c9f5.js +1 -0
  80. data/tools/staticdocs/assets/js/e501b0d1.732c5ad4.js +1 -0
  81. data/tools/staticdocs/assets/js/f15615f1.6a937fc3.js +1 -0
  82. data/tools/staticdocs/assets/js/{f75a5f33.d3a97a44.js → f75a5f33.cdf29c46.js} +1 -1
  83. data/tools/staticdocs/assets/js/fd886806.833fb1cc.js +1 -0
  84. data/tools/staticdocs/assets/js/main.8b65f76b.js +38 -0
  85. data/tools/staticdocs/assets/js/runtime~main.ff5e0de8.js +1 -0
  86. data/tools/staticdocs/docs/configuration/accessors.html +2 -2
  87. data/tools/staticdocs/docs/configuration/command.html +18 -17
  88. data/tools/staticdocs/docs/configuration/conversions.html +22 -65
  89. data/tools/staticdocs/docs/configuration/format.html +1 -1
  90. data/tools/staticdocs/docs/configuration/interfaces.html +22 -47
  91. data/tools/staticdocs/docs/configuration/limits-response.html +1 -1
  92. data/tools/staticdocs/docs/configuration/plugins.html +7 -25
  93. data/tools/staticdocs/docs/configuration/processors.html +3 -9
  94. data/tools/staticdocs/docs/configuration/protocols.html +46 -54
  95. data/tools/staticdocs/docs/configuration/ssl-tls.html +1 -1
  96. data/tools/staticdocs/docs/configuration/table.html +7 -11
  97. data/tools/staticdocs/docs/configuration/target.html +1 -1
  98. data/tools/staticdocs/docs/configuration/telemetry-screens.html +2 -2
  99. data/tools/staticdocs/docs/configuration/telemetry.html +12 -25
  100. data/tools/staticdocs/docs/configuration.html +1 -1
  101. data/tools/staticdocs/docs/development/curl.html +1 -1
  102. data/tools/staticdocs/docs/development/developing.html +3 -3
  103. data/tools/staticdocs/docs/development/json-api.html +1 -1
  104. data/tools/staticdocs/docs/development/log-structure.html +1 -1
  105. data/tools/staticdocs/docs/development/roadmap.html +1 -1
  106. data/tools/staticdocs/docs/development/streaming-api.html +2 -2
  107. data/tools/staticdocs/docs/development/testing.html +1 -1
  108. data/tools/staticdocs/docs/development.html +2 -2
  109. data/tools/staticdocs/docs/getting-started/cli.html +9 -4
  110. data/tools/staticdocs/docs/getting-started/generators.html +2 -2
  111. data/tools/staticdocs/docs/getting-started/gettingstarted.html +4 -4
  112. data/tools/staticdocs/docs/getting-started/installation.html +4 -6
  113. data/tools/staticdocs/docs/getting-started/key-concepts.html +1 -1
  114. data/tools/staticdocs/docs/getting-started/podman.html +7 -2
  115. data/tools/staticdocs/docs/getting-started/requirements.html +1 -1
  116. data/tools/staticdocs/docs/getting-started/upgrading.html +27 -15
  117. data/tools/staticdocs/docs/getting-started.html +1 -1
  118. data/tools/staticdocs/docs/guides/bridges.html +2 -2
  119. data/tools/staticdocs/docs/guides/cfs.html +3 -3
  120. data/tools/staticdocs/docs/guides/custom-widgets.html +2 -2
  121. data/tools/staticdocs/docs/guides/dynamic-packets.html +2 -2
  122. data/tools/staticdocs/docs/guides/exposing-microservices.html +8 -8
  123. data/tools/staticdocs/docs/guides/little-endian-bitfields.html +2 -2
  124. data/tools/staticdocs/docs/guides/local-mode.html +2 -2
  125. data/tools/staticdocs/docs/guides/logging.html +2 -2
  126. data/tools/staticdocs/docs/guides/monitoring.html +2 -2
  127. data/tools/staticdocs/docs/guides/performance.html +2 -2
  128. data/tools/staticdocs/docs/guides/raspberrypi.html +2 -2
  129. data/tools/staticdocs/docs/guides/reference-architectures.html +2 -2
  130. data/tools/staticdocs/docs/guides/script-writing.html +3 -6
  131. data/tools/staticdocs/docs/guides/scripting-api.html +377 -996
  132. data/tools/staticdocs/docs/guides/troubleshooting.html +54 -0
  133. data/tools/staticdocs/docs/guides.html +2 -2
  134. data/tools/staticdocs/docs/meta/contributing.html +1 -1
  135. data/tools/staticdocs/docs/meta/licenses.html +1 -1
  136. data/tools/staticdocs/docs/meta/philosophy.html +1 -1
  137. data/tools/staticdocs/docs/meta/xtce.html +1 -1
  138. data/tools/staticdocs/docs/meta.html +1 -1
  139. data/tools/staticdocs/docs/privacy.html +1 -1
  140. data/tools/staticdocs/docs/tools/admin.html +1 -1
  141. data/tools/staticdocs/docs/tools/autonomic.html +1 -1
  142. data/tools/staticdocs/docs/tools/bucket-explorer.html +1 -1
  143. data/tools/staticdocs/docs/tools/calendar.html +1 -1
  144. data/tools/staticdocs/docs/tools/cmd-sender.html +1 -1
  145. data/tools/staticdocs/docs/tools/cmd-tlm-server.html +3 -6
  146. data/tools/staticdocs/docs/tools/command_history.html +1 -1
  147. data/tools/staticdocs/docs/tools/data-extractor.html +1 -1
  148. data/tools/staticdocs/docs/tools/data-viewer.html +1 -1
  149. data/tools/staticdocs/docs/tools/handbooks.html +1 -1
  150. data/tools/staticdocs/docs/tools/limits-monitor.html +1 -1
  151. data/tools/staticdocs/docs/tools/packet-viewer.html +1 -1
  152. data/tools/staticdocs/docs/tools/script-runner.html +1 -1
  153. data/tools/staticdocs/docs/tools/systemhealth.html +1 -1
  154. data/tools/staticdocs/docs/tools/table-manager.html +1 -1
  155. data/tools/staticdocs/docs/tools/tlm-grapher.html +1 -1
  156. data/tools/staticdocs/docs/tools/tlm-viewer.html +1 -1
  157. data/tools/staticdocs/docs/tools.html +1 -1
  158. data/tools/staticdocs/docs.html +1 -1
  159. data/tools/staticdocs/index.html +1 -1
  160. data/tools/staticdocs/lunr-index-1754357604573.json +1 -0
  161. data/tools/staticdocs/lunr-index.json +1 -1
  162. data/tools/staticdocs/markdown-page.html +1 -1
  163. data/tools/staticdocs/search-doc-1754357604573.json +1 -0
  164. data/tools/staticdocs/search-doc.json +1 -1
  165. data/tools/staticdocs/sitemap.xml +1 -1
  166. metadata +88 -85
  167. data/tools/staticdocs/assets/js/019369f3.52424baa.js +0 -1
  168. data/tools/staticdocs/assets/js/058ffc22.82c2873e.js +0 -1
  169. data/tools/staticdocs/assets/js/0686a885.f620e3dc.js +0 -1
  170. data/tools/staticdocs/assets/js/0f5d161c.e43dd7c9.js +0 -1
  171. data/tools/staticdocs/assets/js/103cc3be.3f08893f.js +0 -1
  172. data/tools/staticdocs/assets/js/13196248.68e92816.js +0 -1
  173. data/tools/staticdocs/assets/js/13c1b4e4.b83f8041.js +0 -1
  174. data/tools/staticdocs/assets/js/1e02e6a3.7cea97a5.js +0 -1
  175. data/tools/staticdocs/assets/js/2047b354.573199a8.js +0 -1
  176. data/tools/staticdocs/assets/js/2124.545702e0.js +0 -1
  177. data/tools/staticdocs/assets/js/22b3ac48.5ab6a17a.js +0 -1
  178. data/tools/staticdocs/assets/js/2368.4443f5c4.js +0 -4
  179. data/tools/staticdocs/assets/js/2bb7bf90.882f03a1.js +0 -1
  180. data/tools/staticdocs/assets/js/2c15ad40.a56e1a40.js +0 -1
  181. data/tools/staticdocs/assets/js/35398c5c.d6cb2a82.js +0 -1
  182. data/tools/staticdocs/assets/js/3dd7ef3b.4782cafe.js +0 -1
  183. data/tools/staticdocs/assets/js/40365d27.4fe19af4.js +0 -1
  184. data/tools/staticdocs/assets/js/411898ad.63be48ce.js +0 -1
  185. data/tools/staticdocs/assets/js/42170351.49ebb70c.js +0 -1
  186. data/tools/staticdocs/assets/js/43652efd.deefbd37.js +0 -1
  187. data/tools/staticdocs/assets/js/54d0d530.97fd90e6.js +0 -1
  188. data/tools/staticdocs/assets/js/59ed27a4.6a4d4905.js +0 -1
  189. data/tools/staticdocs/assets/js/5b233ba7.169a9701.js +0 -1
  190. data/tools/staticdocs/assets/js/5bc719f6.adbdce65.js +0 -1
  191. data/tools/staticdocs/assets/js/5c6ce5ec.1827793d.js +0 -1
  192. data/tools/staticdocs/assets/js/5e3ed378.64ea5a52.js +0 -1
  193. data/tools/staticdocs/assets/js/5fe211ef.866de8e9.js +0 -1
  194. data/tools/staticdocs/assets/js/6831b732.d0e1b5a6.js +0 -1
  195. data/tools/staticdocs/assets/js/696b4199.adf3731a.js +0 -1
  196. data/tools/staticdocs/assets/js/6b210247.bb5dedd5.js +0 -1
  197. data/tools/staticdocs/assets/js/6b65133b.c36fb840.js +0 -1
  198. data/tools/staticdocs/assets/js/6f92e431.13b5aeef.js +0 -1
  199. data/tools/staticdocs/assets/js/72c6d8a8.8f66ae6e.js +0 -1
  200. data/tools/staticdocs/assets/js/75e64983.2bd986ec.js +0 -1
  201. data/tools/staticdocs/assets/js/7719.dfa27269.js +0 -1
  202. data/tools/staticdocs/assets/js/80c97f38.997e4e37.js +0 -1
  203. data/tools/staticdocs/assets/js/867640d5.9dd71bf3.js +0 -1
  204. data/tools/staticdocs/assets/js/89e76475.4d439119.js +0 -1
  205. data/tools/staticdocs/assets/js/8b939c74.5fd8e3e8.js +0 -1
  206. data/tools/staticdocs/assets/js/8f7843ee.b3358f6f.js +0 -1
  207. data/tools/staticdocs/assets/js/9424f0b3.b8d6d2bf.js +0 -1
  208. data/tools/staticdocs/assets/js/964eb012.cb76dd8a.js +0 -1
  209. data/tools/staticdocs/assets/js/97535711.c3a1a5a1.js +0 -1
  210. data/tools/staticdocs/assets/js/99581c43.c9f8e384.js +0 -1
  211. data/tools/staticdocs/assets/js/9d6e81d0.6b6404ff.js +0 -1
  212. data/tools/staticdocs/assets/js/a677c089.d33ab1ca.js +0 -1
  213. data/tools/staticdocs/assets/js/a9987364.530c9592.js +0 -1
  214. data/tools/staticdocs/assets/js/a9b2dc27.50f54e80.js +0 -1
  215. data/tools/staticdocs/assets/js/aa6b6c1b.dc1c4a62.js +0 -1
  216. data/tools/staticdocs/assets/js/b062d239.ff2df9fd.js +0 -1
  217. data/tools/staticdocs/assets/js/b38a6d74.62bc94a3.js +0 -1
  218. data/tools/staticdocs/assets/js/b4596165.7dc1e14d.js +0 -1
  219. data/tools/staticdocs/assets/js/b6d70f94.22ca3e8a.js +0 -1
  220. data/tools/staticdocs/assets/js/b9f60ba6.677e8e46.js +0 -1
  221. data/tools/staticdocs/assets/js/bd0034eb.09d6bbbc.js +0 -1
  222. data/tools/staticdocs/assets/js/c24eae19.3db158fe.js +0 -1
  223. data/tools/staticdocs/assets/js/cb8c3f08.7688d6b1.js +0 -1
  224. data/tools/staticdocs/assets/js/cd879be4.1aff15e7.js +0 -1
  225. data/tools/staticdocs/assets/js/d1b923aa.240ccf18.js +0 -1
  226. data/tools/staticdocs/assets/js/d1bfc316.5c7b9c2f.js +0 -1
  227. data/tools/staticdocs/assets/js/d57a4b5d.82790d9f.js +0 -1
  228. data/tools/staticdocs/assets/js/d5d77c37.51a1f08e.js +0 -1
  229. data/tools/staticdocs/assets/js/d8ca4191.ca5f5dde.js +0 -1
  230. data/tools/staticdocs/assets/js/d9b92eba.41086b81.js +0 -1
  231. data/tools/staticdocs/assets/js/db8fa1d0.5107d903.js +0 -1
  232. data/tools/staticdocs/assets/js/dbe31111.a7be0442.js +0 -1
  233. data/tools/staticdocs/assets/js/dc5f7beb.dfbe012c.js +0 -1
  234. data/tools/staticdocs/assets/js/e501b0d1.512e0a0b.js +0 -1
  235. data/tools/staticdocs/assets/js/f15615f1.d668576a.js +0 -1
  236. data/tools/staticdocs/assets/js/fd886806.656b4fa3.js +0 -1
  237. data/tools/staticdocs/assets/js/main.54699355.js +0 -38
  238. data/tools/staticdocs/assets/js/runtime~main.2a93017a.js +0 -1
  239. data/tools/staticdocs/lunr-index-1751323751078.json +0 -1
  240. data/tools/staticdocs/search-doc-1751323751078.json +0 -1
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["5996"],{7015:function(e){e.exports=JSON.parse('{"version":{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"defaultSidebar":[{"type":"link","label":"Introduction","href":"/tools/staticdocs/docs/","docId":"introduction","unlisted":false},{"type":"category","label":"Getting Started","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Key Concepts","href":"/tools/staticdocs/docs/getting-started/key-concepts","customProps":{"myEmoji":"\uD83D\uDCA1"},"docId":"getting-started/key-concepts","unlisted":false},{"type":"link","label":"Installation","href":"/tools/staticdocs/docs/getting-started/installation","customProps":{"myEmoji":"\uD83D\uDCBE"},"docId":"getting-started/installation","unlisted":false},{"type":"link","label":"Getting Started","href":"/tools/staticdocs/docs/getting-started/gettingstarted","customProps":{"myEmoji":"\uD83E\uDDD1\u200D\uD83D\uDCBB"},"docId":"getting-started/gettingstarted","unlisted":false},{"type":"link","label":"Upgrading","href":"/tools/staticdocs/docs/getting-started/upgrading","customProps":{"myEmoji":"\u2B06\uFE0F"},"docId":"getting-started/upgrading","unlisted":false},{"type":"link","label":"Command Line Interface","href":"/tools/staticdocs/docs/getting-started/cli","customProps":{"myEmoji":"\u2328\uFE0F"},"docId":"getting-started/cli","unlisted":false},{"type":"link","label":"Code Generators","href":"/tools/staticdocs/docs/getting-started/generators","customProps":{"myEmoji":"\uD83C\uDFED"},"docId":"getting-started/generators","unlisted":false},{"type":"link","label":"Podman","href":"/tools/staticdocs/docs/getting-started/podman","customProps":{"myEmoji":"\uD83E\uDEDB"},"docId":"getting-started/podman","unlisted":false},{"type":"link","label":"Requirements and Design","href":"/tools/staticdocs/docs/getting-started/requirements","customProps":{"myEmoji":"\uD83D\uDCD1"},"docId":"getting-started/requirements","unlisted":false}],"href":"/tools/staticdocs/docs/getting-started"},{"type":"category","label":"Configuration","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"File Format","href":"/tools/staticdocs/docs/configuration/format","docId":"configuration/format","unlisted":false},{"type":"link","label":"Plugins","href":"/tools/staticdocs/docs/configuration/plugins","customProps":{"myEmoji":"\uD83D\uDD0C"},"docId":"configuration/plugins","unlisted":false},{"type":"link","label":"Targets","href":"/tools/staticdocs/docs/configuration/target","customProps":{"myEmoji":"\uD83D\uDEF0\uFE0F"},"docId":"configuration/target","unlisted":false},{"type":"link","label":"Commands","href":"/tools/staticdocs/docs/configuration/command","customProps":{"myEmoji":"\uD83D\uDCE1"},"docId":"configuration/command","unlisted":false},{"type":"link","label":"Telemetry","href":"/tools/staticdocs/docs/configuration/telemetry","customProps":{"myEmoji":"\uD83D\uDCE1"},"docId":"configuration/telemetry","unlisted":false},{"type":"link","label":"Interfaces","href":"/tools/staticdocs/docs/configuration/interfaces","customProps":{"myEmoji":"\uD83D\uDCA1"},"docId":"configuration/interfaces","unlisted":false},{"type":"link","label":"Protocols","href":"/tools/staticdocs/docs/configuration/protocols","customProps":{"myEmoji":"\uD83D\uDCA1"},"docId":"configuration/protocols","unlisted":false},{"type":"link","label":"Accessors","href":"/tools/staticdocs/docs/configuration/accessors","customProps":{"myEmoji":"\u270F\uFE0F"},"docId":"configuration/accessors","unlisted":false},{"type":"link","label":"Conversions","href":"/tools/staticdocs/docs/configuration/conversions","customProps":{"myEmoji":"\uD83D\uDD04"},"docId":"configuration/conversions","unlisted":false},{"type":"link","label":"Processors","href":"/tools/staticdocs/docs/configuration/processors","customProps":{"myEmoji":"\uD83E\uDDEE"},"docId":"configuration/processors","unlisted":false},{"type":"link","label":"Limits Response","href":"/tools/staticdocs/docs/configuration/limits-response","customProps":{"myEmoji":"\u26A0\uFE0F"},"docId":"configuration/limits-response","unlisted":false},{"type":"link","label":"Tables","href":"/tools/staticdocs/docs/configuration/table","customProps":{"myEmoji":"\uD83E\uDE91"},"docId":"configuration/table","unlisted":false},{"type":"link","label":"Screens","href":"/tools/staticdocs/docs/configuration/telemetry-screens","customProps":{"myEmoji":"\uD83D\uDDA5\uFE0F"},"docId":"configuration/telemetry-screens","unlisted":false},{"type":"link","label":"SSL-TLS","href":"/tools/staticdocs/docs/configuration/ssl-tls","customProps":{"myEmoji":"\uD83D\uDD10"},"docId":"configuration/ssl-tls","unlisted":false}],"href":"/tools/staticdocs/docs/configuration"},{"type":"category","label":"Tools","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Admin","href":"/tools/staticdocs/docs/tools/admin","customProps":{"myEmoji":"\uD83E\uDDD1\u200D\u2696\uFE0F"},"docId":"tools/admin","unlisted":false},{"type":"link","label":"Autonomic (Enterprise)","href":"/tools/staticdocs/docs/tools/autonomic","customProps":{"myEmoji":"\uD83E\uDD16"},"docId":"tools/autonomic","unlisted":false},{"type":"link","label":"Bucket Explorer","href":"/tools/staticdocs/docs/tools/bucket-explorer","customProps":{"myEmoji":"\uD83E\uDEA3"},"docId":"tools/bucket-explorer","unlisted":false},{"type":"link","label":"Calendar (Enterprise)","href":"/tools/staticdocs/docs/tools/calendar","customProps":{"myEmoji":"\uD83D\uDDD3\uFE0F"},"docId":"tools/calendar","unlisted":false},{"type":"link","label":"Command Sender","href":"/tools/staticdocs/docs/tools/cmd-sender","customProps":{"myEmoji":"\uD83D\uDCE2"},"docId":"tools/cmd-sender","unlisted":false},{"type":"link","label":"Command and Telemetry Server","href":"/tools/staticdocs/docs/tools/cmd-tlm-server","customProps":{"myEmoji":"\uD83D\uDCE1"},"docId":"tools/cmd-tlm-server","unlisted":false},{"type":"link","label":"Command History (Enterprise)","href":"/tools/staticdocs/docs/tools/command_history","customProps":{"myEmoji":"\uD83D\uDCCB"},"docId":"tools/command_history","unlisted":false},{"type":"link","label":"Data Extractor","href":"/tools/staticdocs/docs/tools/data-extractor","customProps":{"myEmoji":"\uD83D\uDEE0\uFE0F"},"docId":"tools/data-extractor","unlisted":false},{"type":"link","label":"Data Viewer","href":"/tools/staticdocs/docs/tools/data-viewer","customProps":{"myEmoji":"\uD83D\uDDA5\uFE0F"},"docId":"tools/data-viewer","unlisted":false},{"type":"link","label":"Handbooks","href":"/tools/staticdocs/docs/tools/handbooks","customProps":{"myEmoji":"\uD83D\uDCD6"},"docId":"tools/handbooks","unlisted":false},{"type":"link","label":"Limits Monitor","href":"/tools/staticdocs/docs/tools/limits-monitor","customProps":{"myEmoji":"\uD83D\uDEA5"},"docId":"tools/limits-monitor","unlisted":false},{"type":"link","label":"Packet Viewer","href":"/tools/staticdocs/docs/tools/packet-viewer","customProps":{"myEmoji":"\uD83D\uDDA5\uFE0F"},"docId":"tools/packet-viewer","unlisted":false},{"type":"link","label":"Script Runner","href":"/tools/staticdocs/docs/tools/script-runner","customProps":{"myEmoji":"\uD83C\uDFC3\u200D\u27A1\uFE0F"},"docId":"tools/script-runner","unlisted":false},{"type":"link","label":"System Health (Enterprise)","href":"/tools/staticdocs/docs/tools/systemhealth","customProps":{"myEmoji":"\uD83D\uDC9A"},"docId":"tools/systemhealth","unlisted":false},{"type":"link","label":"Table Manager","href":"/tools/staticdocs/docs/tools/table-manager","customProps":{"myEmoji":"\uD83E\uDE91"},"docId":"tools/table-manager","unlisted":false},{"type":"link","label":"Telemetry Grapher","href":"/tools/staticdocs/docs/tools/tlm-grapher","customProps":{"myEmoji":"\uD83D\uDCC8"},"docId":"tools/tlm-grapher","unlisted":false},{"type":"link","label":"Telemetry Viewer","href":"/tools/staticdocs/docs/tools/tlm-viewer","customProps":{"myEmoji":"\uD83D\uDDA5\uFE0F"},"docId":"tools/tlm-viewer","unlisted":false}],"href":"/tools/staticdocs/docs/tools"},{"type":"category","label":"Guides","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Bridges","href":"/tools/staticdocs/docs/guides/bridges","customProps":{"myEmoji":"\uD83C\uDF09"},"docId":"guides/bridges","unlisted":false},{"type":"link","label":"COSMOS and NASA cFS","href":"/tools/staticdocs/docs/guides/cfs","customProps":{"myEmoji":"\uD83D\uDE80"},"docId":"guides/cfs","unlisted":false},{"type":"link","label":"Custom Widgets","href":"/tools/staticdocs/docs/guides/custom-widgets","customProps":{"myEmoji":"\uD83D\uDD28"},"docId":"guides/custom-widgets","unlisted":false},{"type":"link","label":"Dynamic Packets","href":"/tools/staticdocs/docs/guides/dynamic-packets","customProps":{"myEmoji":"\uD83E\uDDF1"},"docId":"guides/dynamic-packets","unlisted":false},{"type":"link","label":"Exposing Microservices","href":"/tools/staticdocs/docs/guides/exposing-microservices","customProps":{"myEmoji":"\uD83D\uDEAA"},"docId":"guides/exposing-microservices","unlisted":false},{"type":"link","label":"Little Endian Bitfields","href":"/tools/staticdocs/docs/guides/little-endian-bitfields","customProps":{"myEmoji":"\uD83D\uDCBB"},"docId":"guides/little-endian-bitfields","unlisted":false},{"type":"link","label":"Local Mode","href":"/tools/staticdocs/docs/guides/local-mode","customProps":{"myEmoji":"\uD83E\uDDED"},"docId":"guides/local-mode","unlisted":false},{"type":"link","label":"Logging","href":"/tools/staticdocs/docs/guides/logging","customProps":{"myEmoji":"\uD83E\uDEB5"},"docId":"guides/logging","unlisted":false},{"type":"link","label":"Monitoring","href":"/tools/staticdocs/docs/guides/monitoring","customProps":{"myEmoji":"\uD83D\uDDA5\uFE0F"},"docId":"guides/monitoring","unlisted":false},{"type":"link","label":"Performance","href":"/tools/staticdocs/docs/guides/performance","customProps":{"myEmoji":"\uD83D\uDCCA"},"docId":"guides/performance","unlisted":false},{"type":"link","label":"Raspberry Pi","href":"/tools/staticdocs/docs/guides/raspberrypi","customProps":{"myEmoji":"\uD83C\uDF53"},"docId":"guides/raspberrypi","unlisted":false},{"type":"link","label":"Reference Architectures","href":"/tools/staticdocs/docs/guides/reference-architectures","customProps":{"myEmoji":"\uD83C\uDFD7\uFE0F"},"docId":"guides/reference-architectures","unlisted":false},{"type":"link","label":"Script Writing Guide","href":"/tools/staticdocs/docs/guides/script-writing","customProps":{"myEmoji":"\uD83C\uDFC3\u200D\u27A1\uFE0F"},"docId":"guides/script-writing","unlisted":false},{"type":"link","label":"Scripting API Guide","href":"/tools/staticdocs/docs/guides/scripting-api","customProps":{"myEmoji":"\uD83D\uDCDD"},"docId":"guides/scripting-api","unlisted":false}],"href":"/tools/staticdocs/docs/guides"},{"type":"category","label":"Development","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Testing with Curl","href":"/tools/staticdocs/docs/development/curl","customProps":{"myEmoji":"\uD83C\uDF0A"},"docId":"development/curl","unlisted":false},{"type":"link","label":"Developing COSMOS","href":"/tools/staticdocs/docs/development/developing","customProps":{"myEmoji":"\uD83D\uDCBB"},"docId":"development/developing","unlisted":false},{"type":"link","label":"JSON API","href":"/tools/staticdocs/docs/development/json-api","customProps":{"myEmoji":"\uD83D\uDDA5\uFE0F"},"docId":"development/json-api","unlisted":false},{"type":"link","label":"Log Structure","href":"/tools/staticdocs/docs/development/log-structure","customProps":{"myEmoji":"\uD83E\uDEB5"},"docId":"development/log-structure","unlisted":false},{"type":"link","label":"Roadmap","href":"/tools/staticdocs/docs/development/roadmap","customProps":{"myEmoji":"\uD83D\uDDFA\uFE0F"},"docId":"development/roadmap","unlisted":false},{"type":"link","label":"Streaming API","href":"/tools/staticdocs/docs/development/streaming-api","customProps":{"myEmoji":"\uD83D\uDCDD"},"docId":"development/streaming-api","unlisted":false},{"type":"link","label":"Testing COSMOS","href":"/tools/staticdocs/docs/development/testing","customProps":{"myEmoji":"\uD83D\uDCCB"},"docId":"development/testing","unlisted":false}],"href":"/tools/staticdocs/docs/development"},{"type":"category","label":"Meta","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Contributing","href":"/tools/staticdocs/docs/meta/contributing","customProps":{"myEmoji":"\uD83D\uDE42"},"docId":"meta/contributing","unlisted":false},{"type":"link","label":"Licenses","href":"/tools/staticdocs/docs/meta/licenses","customProps":{"myEmoji":"\uD83D\uDD75\uFE0F"},"docId":"meta/licenses","unlisted":false},{"type":"link","label":"Philosophy","href":"/tools/staticdocs/docs/meta/philosophy","customProps":{"myEmoji":"\uD83E\uDD14"},"docId":"meta/philosophy","unlisted":false},{"type":"link","label":"XTCE Support","href":"/tools/staticdocs/docs/meta/xtce","customProps":{"myEmoji":"\uD83D\uDE35"},"docId":"meta/xtce","unlisted":false}],"href":"/tools/staticdocs/docs/meta"},{"type":"link","label":"OpenC3, Inc. Privacy Policy","href":"/tools/staticdocs/docs/privacy","docId":"privacy","unlisted":false}]},"docs":{"configuration/accessors":{"id":"configuration/accessors","title":"Accessors","description":"Responsible for reading and writing data to a buffer","sidebar":"defaultSidebar"},"configuration/command":{"id":"configuration/command","title":"Commands","description":"Command definition file format and keywords","sidebar":"defaultSidebar"},"configuration/conversions":{"id":"configuration/conversions","title":"Conversions","description":"Conversions to apply to command parameters and telemetry items","sidebar":"defaultSidebar"},"configuration/format":{"id":"configuration/format","title":"File Format","description":"Structure of a COSMOS file, including using ERB","sidebar":"defaultSidebar"},"configuration/interfaces":{"id":"configuration/interfaces","title":"Interfaces","description":"Built-in COSMOS interfaces including how to create one","sidebar":"defaultSidebar"},"configuration/limits-response":{"id":"configuration/limits-response","title":"Limits Response","description":"Custom code invoked when a item with limits changes state","sidebar":"defaultSidebar"},"configuration/plugins":{"id":"configuration/plugins","title":"Plugins","description":"Plugin definition file format and keywords","sidebar":"defaultSidebar"},"configuration/processors":{"id":"configuration/processors","title":"Processors","description":"Processors execute code every time a packet is received to calculate values","sidebar":"defaultSidebar"},"configuration/protocols":{"id":"configuration/protocols","title":"Protocols","description":"Built-in COSMOS protocols including how to create one","sidebar":"defaultSidebar"},"configuration/ssl-tls":{"id":"configuration/ssl-tls","title":"SSL-TLS","description":"How to configure SSL and TLS","sidebar":"defaultSidebar"},"configuration/table":{"id":"configuration/table","title":"Tables","description":"Table definition file format and keywords","sidebar":"defaultSidebar"},"configuration/target":{"id":"configuration/target","title":"Targets","description":"Target definition file format and keywords","sidebar":"defaultSidebar"},"configuration/telemetry":{"id":"configuration/telemetry","title":"Telemetry","description":"Telemetry definition file format and keywords","sidebar":"defaultSidebar"},"configuration/telemetry-screens":{"id":"configuration/telemetry-screens","title":"Screens","description":"Telemetry Viewer screen definition and widget documentation","sidebar":"defaultSidebar"},"development/curl":{"id":"development/curl","title":"Testing with Curl","description":"How to use Curl to hit the COSMOS APIs","sidebar":"defaultSidebar"},"development/developing":{"id":"development/developing","title":"Developing COSMOS","description":"Building COSMOS and developing the frontend and backend","sidebar":"defaultSidebar"},"development/json-api":{"id":"development/json-api","title":"JSON API","description":"Interfacing to the COSMOS APIs using JSON-RPC","sidebar":"defaultSidebar"},"development/log-structure":{"id":"development/log-structure","title":"Log Structure","description":"Structure of the COSMOS log file","sidebar":"defaultSidebar"},"development/roadmap":{"id":"development/roadmap","title":"Roadmap","description":"COSMOS roadmap now and into the future","sidebar":"defaultSidebar"},"development/streaming-api":{"id":"development/streaming-api","title":"Streaming API","description":"Using the websocket streaming API to retrieve data","sidebar":"defaultSidebar"},"development/testing":{"id":"development/testing","title":"Testing COSMOS","description":"Running the Playwright integration tests and unit tests","sidebar":"defaultSidebar"},"getting-started/cli":{"id":"getting-started/cli","title":"Command Line Interface","description":"Using openc3.sh","sidebar":"defaultSidebar"},"getting-started/generators":{"id":"getting-started/generators","title":"Code Generators","description":"Using openc3.sh to generate code","sidebar":"defaultSidebar"},"getting-started/gettingstarted":{"id":"getting-started/gettingstarted","title":"Getting Started","description":"Getting starting with COSMOS","sidebar":"defaultSidebar"},"getting-started/installation":{"id":"getting-started/installation","title":"Installation","description":"Installing OpenC3 COSMOS","sidebar":"defaultSidebar"},"getting-started/key-concepts":{"id":"getting-started/key-concepts","title":"Key Concepts","description":"Projects, Containerization, Frontend, Backend","sidebar":"defaultSidebar"},"getting-started/podman":{"id":"getting-started/podman","title":"Podman","description":"Installing and running COSMOS with Podman","sidebar":"defaultSidebar"},"getting-started/requirements":{"id":"getting-started/requirements","title":"Requirements and Design","description":"COSMOS Requirements and Design","sidebar":"defaultSidebar"},"getting-started/upgrading":{"id":"getting-started/upgrading","title":"Upgrading","description":"How to upgrade and migrate COSMOS","sidebar":"defaultSidebar"},"guides/bridges":{"id":"guides/bridges","title":"Bridges","description":"Bridge data into COSMOS from serial ports, PCI, etc","sidebar":"defaultSidebar"},"guides/cfs":{"id":"guides/cfs","title":"COSMOS and NASA cFS","description":"Tutorial for integrating with NASA cFS","sidebar":"defaultSidebar"},"guides/custom-widgets":{"id":"guides/custom-widgets","title":"Custom Widgets","description":"How to build custom widgets for use in Telemetry Viewer","sidebar":"defaultSidebar"},"guides/dynamic-packets":{"id":"guides/dynamic-packets","title":"Dynamic Packets","description":"How COSMOS dynamically builds packets","sidebar":"defaultSidebar"},"guides/exposing-microservices":{"id":"guides/exposing-microservices","title":"Exposing Microservices","description":"Provide external accessibility to microservices","sidebar":"defaultSidebar"},"guides/little-endian-bitfields":{"id":"guides/little-endian-bitfields","title":"Little Endian Bitfields","description":"Defining little endian bitfields","sidebar":"defaultSidebar"},"guides/local-mode":{"id":"guides/local-mode","title":"Local Mode","description":"Edit scripts and screens directly on the host file system","sidebar":"defaultSidebar"},"guides/logging":{"id":"guides/logging","title":"Logging","description":"The log files in COSMOS","sidebar":"defaultSidebar"},"guides/monitoring":{"id":"guides/monitoring","title":"Monitoring","description":"Various ways to monitor COSMOS internals","sidebar":"defaultSidebar"},"guides/performance":{"id":"guides/performance","title":"Performance","description":"Hardware requirements like memory and CPU","sidebar":"defaultSidebar"},"guides/raspberrypi":{"id":"guides/raspberrypi","title":"Raspberry Pi","description":"Running COSMOS on a Raspberry Pi","sidebar":"defaultSidebar"},"guides/reference-architectures":{"id":"guides/reference-architectures","title":"Reference Architectures","description":"Typical COSMOS use-cases","sidebar":"defaultSidebar"},"guides/script-writing":{"id":"guides/script-writing","title":"Script Writing Guide","description":"Key concepts and best practices for script writing","sidebar":"defaultSidebar"},"guides/scripting-api":{"id":"guides/scripting-api","title":"Scripting API Guide","description":"Scripting API methods, deprecations and migrations","sidebar":"defaultSidebar"},"introduction":{"id":"introduction","title":"Introduction","description":"This site aims to be a comprehensive guide to OpenC3 COSMOS. We\'ll cover topics such as getting your configuration up and running, developing test and operations scripts, building custom telemetry screens, and give you some advice on participating in the future development of COSMOS itself.","sidebar":"defaultSidebar"},"meta/contributing":{"id":"meta/contributing","title":"Contributing","description":"Contributing to COSMOS using the github workflow","sidebar":"defaultSidebar"},"meta/licenses":{"id":"meta/licenses","title":"Licenses","description":"COSMOS licenses including the AGPLv3 vs Commercial","sidebar":"defaultSidebar"},"meta/philosophy":{"id":"meta/philosophy","title":"Philosophy","description":"COSMOS goals and philosophy","sidebar":"defaultSidebar"},"meta/xtce":{"id":"meta/xtce","title":"XTCE Support","description":"XTCE Command and Telemetry Definition Standard","sidebar":"defaultSidebar"},"privacy":{"id":"privacy","title":"OpenC3, Inc. Privacy Policy","description":"OpenC3 Inc. is strongly committed to protecting your privacy and complying with your choices. Both personal and non-personal information collected is safeguarded according to the highest privacy and data protection standards adopted worldwide. We have always had a robust and effective data protection program in place which complies with existing law and abides by the data protection principles. However, we recognise our obligations in updating and expanding this program to meet the demands of the GDPR.","sidebar":"defaultSidebar"},"tools/admin":{"id":"tools/admin","title":"Admin","description":"Administer COSMOS, install plugins, change settings","sidebar":"defaultSidebar"},"tools/autonomic":{"id":"tools/autonomic","title":"Autonomic (Enterprise)","description":"Automated execution of commands and scripts","sidebar":"defaultSidebar"},"tools/bucket-explorer":{"id":"tools/bucket-explorer","title":"Bucket Explorer","description":"File browser to the COSMOS backend bucket storage system","sidebar":"defaultSidebar"},"tools/calendar":{"id":"tools/calendar","title":"Calendar (Enterprise)","description":"Calendar visualization of metadata, notes, and timelines","sidebar":"defaultSidebar"},"tools/cmd-sender":{"id":"tools/cmd-sender","title":"Command Sender","description":"Send individual commands","sidebar":"defaultSidebar"},"tools/cmd-tlm-server":{"id":"tools/cmd-tlm-server","title":"Command and Telemetry Server","description":"Status about interfaces, targets and log messages","sidebar":"defaultSidebar"},"tools/command_history":{"id":"tools/command_history","title":"Command History (Enterprise)","description":"See all the commands sent, by whom, and if successful","sidebar":"defaultSidebar"},"tools/data-extractor":{"id":"tools/data-extractor","title":"Data Extractor","description":"Extract command or telemetry data into files","sidebar":"defaultSidebar"},"tools/data-viewer":{"id":"tools/data-viewer","title":"Data Viewer","description":"View packet or item data","sidebar":"defaultSidebar"},"tools/handbooks":{"id":"tools/handbooks","title":"Handbooks","description":"Format the command and telemetry definition into a webpage","sidebar":"defaultSidebar"},"tools/limits-monitor":{"id":"tools/limits-monitor","title":"Limits Monitor","description":"View out of limit items and log messages","sidebar":"defaultSidebar"},"tools/packet-viewer":{"id":"tools/packet-viewer","title":"Packet Viewer","description":"Displays all packets with their items","sidebar":"defaultSidebar"},"tools/script-runner":{"id":"tools/script-runner","title":"Script Runner","description":"Run Python or Ruby scripts to send commands and check telemetry","sidebar":"defaultSidebar"},"tools/systemhealth":{"id":"tools/systemhealth","title":"System Health (Enterprise)","description":"Visualization of overall System Health metrics","sidebar":"defaultSidebar"},"tools/table-manager":{"id":"tools/table-manager","title":"Table Manager","description":"Binary file editor with upload / download","sidebar":"defaultSidebar"},"tools/tlm-grapher":{"id":"tools/tlm-grapher","title":"Telemetry Grapher","description":"Graph real time or historical data","sidebar":"defaultSidebar"},"tools/tlm-viewer":{"id":"tools/tlm-viewer","title":"Telemetry Viewer","description":"Build custom screens using built-in widgets","sidebar":"defaultSidebar"}}}}')}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["442"],{7594:function(e,t,i){i.r(t),i.d(t,{frontMatter:()=>a,default:()=>h,toc:()=>o,metadata:()=>n,assets:()=>c,contentTitle:()=>r});var n=JSON.parse('{"id":"tools/packet-viewer","title":"Packet Viewer","description":"Displays all packets with their items","source":"@site/docs/tools/packet-viewer.md","sourceDirName":"tools","slug":"/tools/packet-viewer","permalink":"/tools/staticdocs/docs/tools/packet-viewer","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/tools/packet-viewer.md","tags":[],"version":"current","frontMatter":{"title":"Packet Viewer","description":"Displays all packets with their items","sidebar_custom_props":{"myEmoji":"\uD83D\uDDA5\uFE0F"}},"sidebar":"defaultSidebar","previous":{"title":"Limits Monitor","permalink":"/tools/staticdocs/docs/tools/limits-monitor"},"next":{"title":"Script Runner","permalink":"/tools/staticdocs/docs/tools/script-runner"}}'),s=i(2322),l=i(2840);let a={title:"Packet Viewer",description:"Displays all packets with their items",sidebar_custom_props:{myEmoji:"\uD83D\uDDA5\uFE0F"}},r=void 0,c={},o=[{value:"Introduction",id:"introduction",level:2},{value:"Packet Viewer Menus",id:"packet-viewer-menus",level:2},{value:"File Menu Items",id:"file-menu-items",level:3},{value:"View Menu Items",id:"view-menu-items",level:3},{value:"Selecting Packets",id:"selecting-packets",level:2},{value:"Details",id:"details",level:3}];function d(e){let t={a:"a",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",ul:"ul",...(0,l.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h2,{id:"introduction",children:"Introduction"}),"\n",(0,s.jsx)(t.p,{children:"Packet Viewer is a live telemetry viewer which requires no configuration to display the current values for all defined target, packet, items. Items with limits are displayed colored (blue, green, yellow, or red) according to their current state. Items can be right clicked to get detailed information."}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{alt:"Packet Viewer",src:i(6077).Z+"",width:"1274",height:"837"})}),"\n",(0,s.jsx)(t.h2,{id:"packet-viewer-menus",children:"Packet Viewer Menus"}),"\n",(0,s.jsx)(t.h3,{id:"file-menu-items",children:"File Menu Items"}),"\n",(0,s.jsx)("img",{src:i(7212).Z,alt:"File Menu",style:{float:"left","margin-right":"50px",height:"120px"}}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"Change the refresh and stale interval"}),"\n",(0,s.jsx)(t.li,{children:"Opens a saved configuration"}),"\n",(0,s.jsx)(t.li,{children:"Save the current configuration (view settings)"}),"\n",(0,s.jsx)(t.li,{children:"Reset the configuration (default settings)"}),"\n"]}),"\n",(0,s.jsx)(t.h3,{id:"view-menu-items",children:"View Menu Items"}),"\n",(0,s.jsx)("img",{src:i(9754).Z,alt:"View Menu",style:{float:"left","margin-right":"50px",height:"180px"}}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:["Shows ",(0,s.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/target#ignore_item",children:"ignored items"})]}),"\n",(0,s.jsxs)(t.li,{children:["Display ",(0,s.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/telemetry#derived-items",children:"derived"})," items last"]}),"\n",(0,s.jsxs)(t.li,{children:["Display formatted items with ",(0,s.jsx)(t.a,{href:"../configuration/telemetry#units",children:"units"})]}),"\n",(0,s.jsxs)(t.li,{children:["Display ",(0,s.jsx)(t.a,{href:"../configuration/telemetry#format_string",children:"formatted"})," items"]}),"\n",(0,s.jsxs)(t.li,{children:["Display ",(0,s.jsx)(t.a,{href:"../configuration/telemetry#read_conversion",children:"converted"})," items"]}),"\n",(0,s.jsx)(t.li,{children:"Display raw items"}),"\n"]}),"\n",(0,s.jsx)(t.h2,{id:"selecting-packets",children:"Selecting Packets"}),"\n",(0,s.jsx)(t.p,{children:"Initially opening Packet Viewer will open the first alphabetical Target and Packet. Click the drop down menus to update the Items table to a new packet. To filter the list of items you can type in the search box."}),"\n",(0,s.jsx)(t.h3,{id:"details",children:"Details"}),"\n",(0,s.jsx)(t.p,{children:"Right-clicking an item and selecting Details will open the details dialog."}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{alt:"Details",src:i(6812).Z+"",width:"591",height:"697"})}),"\n",(0,s.jsx)(t.p,{children:"This dialog lists everything defined on the telemetry item."})]})}function h(e={}){let{wrapper:t}={...(0,l.a)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},7212:function(e,t,i){i.d(t,{Z:()=>n});let n=i.p+"assets/images/file_menu-d9ac5efbe78e58f024666452b9f28af72c6d09a3460fc7c0737c2bb74e4ea409.png"},9754:function(e,t,i){i.d(t,{Z:()=>n});let n=i.p+"assets/images/view_menu-a02cfbd5e6fafa5d3b4f1ae76bfbd63f49388939b4732bf91709f48e44498d19.png"},6077:function(e,t,i){i.d(t,{Z:()=>n});let n=i.p+"assets/images/packet_viewer-505c517c9a838a41d6fe668ff7ca2efb1b89ced4b75df638cd11a45484bc6533.png"},6812:function(e,t,i){i.d(t,{Z:()=>n});let n=i.p+"assets/images/temp1_details-4c4bbe7c2d60e636f0304ee8ac7237af8db2bdba8666c9ae2dc0a105eca248f2.png"},2840:function(e,t,i){i.d(t,{Z:()=>r,a:()=>a});var n=i(2784);let s={},l=n.createContext(s);function a(e){let t=n.useContext(l);return n.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),n.createElement(l.Provider,{value:t},e.children)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["2124"],{2941:function(e,t,n){n.d(t,{Z:()=>a});var o=n(2322);n(2784);var i=n(7239),r=n(6117),s=n(4126);function a(e){let{className:t}=e;return(0,o.jsx)("main",{className:(0,i.Z)("container margin-vert--xl",t),children:(0,o.jsx)("div",{className:"row",children:(0,o.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,o.jsx)(s.Z,{as:"h1",className:"hero__title",children:(0,o.jsx)(r.Z,{id:"theme.NotFound.title",description:"The title of the 404 page",children:"Page Not Found"})}),(0,o.jsx)("p",{children:(0,o.jsx)(r.Z,{id:"theme.NotFound.p1",description:"The first paragraph of the 404 page",children:"We could not find what you were looking for."})}),(0,o.jsx)("p",{children:(0,o.jsx)(r.Z,{id:"theme.NotFound.p2",description:"The 2nd paragraph of the 404 page",children:"Please contact the owner of the site that linked you to the original URL and let them know their link is broken."})})]})})})}},9274:function(e,t,n){n.r(t),n.d(t,{default:()=>c});var o=n(2322);n(2784);var i=n(6117),r=n(1904),s=n(9316),a=n(2941);function c(){let e=(0,i.I)({id:"theme.NotFound.title",message:"Page Not Found"});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(r.d,{title:e}),(0,o.jsx)(s.Z,{children:(0,o.jsx)(a.Z,{})})]})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["9146"],{7073:function(e,n,r){r.r(n),r.d(n,{frontMatter:()=>t,default:()=>p,toc:()=>a,metadata:()=>s,assets:()=>c,contentTitle:()=>l});var s=JSON.parse('{"id":"guides/raspberrypi","title":"Raspberry Pi","description":"Running COSMOS on a Raspberry Pi","source":"@site/docs/guides/raspberrypi.md","sourceDirName":"guides","slug":"/guides/raspberrypi","permalink":"/tools/staticdocs/docs/guides/raspberrypi","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/guides/raspberrypi.md","tags":[],"version":"current","frontMatter":{"title":"Raspberry Pi","description":"Running COSMOS on a Raspberry Pi","sidebar_custom_props":{"myEmoji":"\uD83C\uDF53"}},"sidebar":"defaultSidebar","previous":{"title":"Performance","permalink":"/tools/staticdocs/docs/guides/performance"},"next":{"title":"Reference Architectures","permalink":"/tools/staticdocs/docs/guides/reference-architectures"}}'),i=r(2322),o=r(2840);let t={title:"Raspberry Pi",description:"Running COSMOS on a Raspberry Pi",sidebar_custom_props:{myEmoji:"\uD83C\uDF53"}},l=void 0,c={},a=[{value:"COSMOS Running on Raspberry Pi 4",id:"cosmos-running-on-raspberry-pi-4",level:3}];function d(e){let n={a:"a",code:"code",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",ul:"ul",...(0,o.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h3,{id:"cosmos-running-on-raspberry-pi-4",children:"COSMOS Running on Raspberry Pi 4"}),"\n",(0,i.jsx)(n.p,{children:"The Raspberry Pi 4 is a low-cost powerful ARM-based minicomputer that runs linux. And because it runs modern linux, it can also run COSMOS! These directions will get you up and running."}),"\n",(0,i.jsx)(n.p,{children:"What you'll need:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Raspberry Pi 4 board (tested with 8GB RAM)"}),"\n",(0,i.jsx)(n.li,{children:"A Pi Case but Optional"}),"\n",(0,i.jsx)(n.li,{children:"Raspbeerry Pi Power Supply"}),"\n",(0,i.jsx)(n.li,{children:"32GB or Larger SD Card - Also faster the better"}),"\n",(0,i.jsx)(n.li,{children:"A Laptop with a way to write SD Cards"}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"Let's get started!"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Setup 64-bit Raspian OS Lite on the SD Card"}),"\n",(0,i.jsxs)(n.p,{children:["Make sure you have the Raspberry Pi Imager app from: ",(0,i.jsx)(n.a,{href:"https://www.raspberrypi.com/software/",children:"https://www.raspberrypi.com/software/"})]}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsx)(n.li,{children:"Insert the SD Card into your computer (Note this process will erase all data on the SD card!)"}),"\n",(0,i.jsx)(n.li,{children:"Open the Raspberry Pi Imager App"}),"\n",(0,i.jsx)(n.li,{children:'Click the "Choose Device" Button'}),"\n",(0,i.jsx)(n.li,{children:"Pick Your Raspberry Pi Model"}),"\n",(0,i.jsx)(n.li,{children:'Click the "Choose OS" Button'}),"\n",(0,i.jsx)(n.li,{children:'Select "Raspberry Pi OS (other)"'}),"\n",(0,i.jsx)(n.li,{children:'Select "Raspberry Pi OS Lite (64-bit)"'}),"\n",(0,i.jsx)(n.li,{children:'Click the "Choose Storage" Button'}),"\n",(0,i.jsx)(n.li,{children:"Select Your SD Card"}),"\n",(0,i.jsx)(n.li,{children:"Click Edit Settings"}),"\n",(0,i.jsx)(n.li,{children:"If prompted if you would like to prefill the Wifi information, select OK"}),"\n",(0,i.jsx)(n.li,{children:"Set the hostname to: cosmos.local"}),"\n",(0,i.jsx)(n.li,{children:"Set the username and password. The default username is your username, you should also set a password to make the system secure"}),"\n",(0,i.jsx)(n.li,{children:"Fill in your Wifi info, and set the country appropriately (ie. US)"}),"\n",(0,i.jsx)(n.li,{children:"Set the correct time zone"}),"\n",(0,i.jsx)(n.li,{children:"Goto the Services Tab and Enable SSH"}),"\n",(0,i.jsx)(n.li,{children:"You can either use Password auth, or public-key only if your computer is already setup for passwordless SSH"}),"\n",(0,i.jsx)(n.li,{children:'Goto the Options tab and make sure "Enable Telemetry" is not checked'}),"\n",(0,i.jsx)(n.li,{children:'Click "Save" when everything is filled out'}),"\n",(0,i.jsx)(n.li,{children:'Click "Yes" to apply OS Customization Settings, Yes to Are You Sure, and Wait for it to complete'}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Make sure the Raspberry Pi is NOT powered on"}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Remove the SD Card from your computer and insert into the Raspberry Pi"}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Apply power to the Raspberry Pi and wait approximately 1 minute for it to boot"}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"SSH to your raspberry Pi"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Open a terminal window and use ssh to connect to your Pi"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["On Mac / Linux: ssh ",(0,i.jsx)(n.a,{href:"mailto:yourusername@cosmos.local",children:"yourusername@cosmos.local"})]}),"\n",(0,i.jsx)(n.li,{children:"On Windows, use Putty to connect. You will probably have to install Bonjour for Windows for .local addresses to work as well."}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"From SSH, Enter the following commands"}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:" sudo sysctl -w vm.max_map_count=262144\n sudo sysctl -w vm.overcommit_memory=1\n sudo apt update\n sudo apt upgrade\n sudo apt install git -y\n curl -fsSL https://get.docker.com -o get-docker.sh\n sudo sh get-docker.sh\n sudo usermod -aG docker $USER\n newgrp docker\n git clone https://github.com/OpenC3/cosmos-project.git cosmos\n cd cosmos\n # Edit compose.yaml and remove 127.0.0.1: from the ports section of the openc3-traefik service\n ./openc3.sh run\n"})}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After about 2 minutes, open a web browser on your computer, and goto: ",(0,i.jsx)(n.a,{href:"http://cosmos.local:2900",children:"http://cosmos.local:2900"})]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Congratulations! You now have COSMOS running on a Raspberry Pi!"}),"\n"]}),"\n"]})]})}function p(e={}){let{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},2840:function(e,n,r){r.d(n,{Z:()=>l,a:()=>t});var s=r(2784);let i={},o=s.createContext(i);function t(e){let n=s.useContext(o);return s.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:t(e.components),s.createElement(o.Provider,{value:n},e.children)}}}]);
@@ -1,4 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["2368"],{4814:function(e,n,s){s.d(n,{Z:()=>g});var t=s(2322);s(2784);var r=s(7239),a=s(6460),i=s(606),l=s(3422),o=s(5819),c=s(6117),d=s(7720);function u(e){return(0,t.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,t.jsx)("path",{d:"M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z",fill:"currentColor"})})}function m(){let e=(0,d.ZP)("/");return(0,t.jsx)("li",{className:"breadcrumbs__item",children:(0,t.jsx)(o.Z,{"aria-label":(0,c.I)({id:"theme.docs.breadcrumbs.home",message:"Home page",description:"The ARIA label for the home page in the breadcrumbs"}),className:"breadcrumbs__link",href:e,children:(0,t.jsx)(u,{className:"breadcrumbHomeIcon_JFrk"})})})}var h=s(7173),b=s(3687);function x(e){let n=function(e){let{breadcrumbs:n}=e,{siteConfig:s}=(0,b.Z)();return{"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:n.filter(e=>e.href).map((e,n)=>({"@type":"ListItem",position:n+1,name:e.label,item:`${s.url}${e.href}`}))}}({breadcrumbs:e.breadcrumbs});return(0,t.jsx)(h.Z,{children:(0,t.jsx)("script",{type:"application/ld+json",children:JSON.stringify(n)})})}let v={breadcrumbsContainer:"breadcrumbsContainer_zCmv"};function p(e){let{children:n,href:s,isLast:r}=e,a="breadcrumbs__link";return r?(0,t.jsx)("span",{className:a,children:n}):s?(0,t.jsx)(o.Z,{className:a,href:s,children:(0,t.jsx)("span",{children:n})}):(0,t.jsx)("span",{className:a,children:n})}function j(e){let{children:n,active:s}=e;return(0,t.jsx)("li",{className:(0,r.Z)("breadcrumbs__item",{"breadcrumbs__item--active":s}),children:n})}function g(){let e=(0,i.s1)(),n=(0,l.Ns)();return e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x,{breadcrumbs:e}),(0,t.jsx)("nav",{className:(0,r.Z)(a.k.docs.docBreadcrumbs,v.breadcrumbsContainer),"aria-label":(0,c.I)({id:"theme.docs.breadcrumbs.navAriaLabel",message:"Breadcrumbs",description:"The ARIA label for the breadcrumbs"}),children:(0,t.jsxs)("ul",{className:"breadcrumbs",children:[n&&(0,t.jsx)(m,{}),e.map((n,s)=>{let r=s===e.length-1,a="category"===n.type&&n.linkUnlisted?void 0:n.href;return(0,t.jsx)(j,{active:r,children:(0,t.jsx)(p,{href:a,isLast:r,children:n.label})},s)})]})})]}):null}},2070:function(e,n,s){s.r(n),s.d(n,{default:()=>f});var t=s(2322);s(2784);var r=s(1904),a=s(606),i=s(7720),l=s(7239),o=s(4310);function c(e){let{className:n}=e,s=(0,a.Ok)();return(0,t.jsx)(u,{items:s,className:n})}function d(e){let{item:n}=e;return(0,t.jsx)("article",{className:(0,l.Z)("docCardListItem_h8oi","col col--6"),children:(0,t.jsx)(o.Z,{item:n})})}function u(e){let{items:n,className:s}=e;if(!n)return(0,t.jsx)(c,{...e});let r=(0,a.MN)(n);return(0,t.jsx)("section",{className:(0,l.Z)("row",s),children:r.map((e,n)=>(0,t.jsx)(d,{item:e},n))})}var m=s(9061),h=s(7997),b=s(8674),x=s(4814),v=s(4126);let p={generatedIndexPage:"generatedIndexPage_ak01",title:"title_AulG"};function j(e){let{categoryGeneratedIndex:n}=e;return(0,t.jsx)(r.d,{title:n.title,description:n.description,keywords:n.keywords,image:(0,i.ZP)(n.image)})}function g(e){let{categoryGeneratedIndex:n}=e,s=(0,a.jA)();return(0,t.jsxs)("div",{className:p.generatedIndexPage,children:[(0,t.jsx)(h.Z,{}),(0,t.jsx)(x.Z,{}),(0,t.jsx)(b.Z,{}),(0,t.jsxs)("header",{children:[(0,t.jsx)(v.Z,{as:"h1",className:p.title,children:n.title}),n.description&&(0,t.jsx)("p",{children:n.description})]}),(0,t.jsx)("article",{className:"margin-top--lg",children:(0,t.jsx)(u,{items:s.items,className:p.list})}),(0,t.jsx)("footer",{className:"margin-top--md",children:(0,t.jsx)(m.Z,{previous:n.navigation.previous,next:n.navigation.next})})]})}function f(e){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j,{...e}),(0,t.jsx)(g,{...e})]})}},9061:function(e,n,s){s.d(n,{Z:()=>o});var t=s(2322);s(2784);var r=s(7239),a=s(6117),i=s(5819);function l(e){let{permalink:n,title:s,subLabel:a,isNext:l}=e;return(0,t.jsxs)(i.Z,{className:(0,r.Z)("pagination-nav__link",l?"pagination-nav__link--next":"pagination-nav__link--prev"),to:n,children:[a&&(0,t.jsx)("div",{className:"pagination-nav__sublabel",children:a}),(0,t.jsx)("div",{className:"pagination-nav__label",children:s})]})}function o(e){let{className:n,previous:s,next:i}=e;return(0,t.jsxs)("nav",{className:(0,r.Z)(n,"pagination-nav"),"aria-label":(0,a.I)({id:"theme.docs.paginator.navAriaLabel",message:"Docs pages",description:"The ARIA label for the docs pagination"}),children:[s&&(0,t.jsx)(l,{...s,subLabel:(0,t.jsx)(a.Z,{id:"theme.docs.paginator.previous",description:"The label used to navigate to the previous doc",children:"Previous"})}),i&&(0,t.jsx)(l,{...i,subLabel:(0,t.jsx)(a.Z,{id:"theme.docs.paginator.next",description:"The label used to navigate to the next doc",children:"Next"}),isNext:!0})]})}},8674:function(e,n,s){s.d(n,{Z:()=>o});var t=s(2322);s(2784);var r=s(7239),a=s(6117),i=s(6460),l=s(8354);function o(e){let{className:n}=e,s=(0,l.E)();return s.badge?(0,t.jsx)("span",{className:(0,r.Z)(n,i.k.docs.docVersionBadge,"badge badge--secondary"),children:(0,t.jsx)(a.Z,{id:"theme.docs.versionBadge.label",values:{versionLabel:s.label},children:"Version: {versionLabel}"})}):null}},7997:function(e,n,s){s.d(n,{Z:()=>v});var t=s(2322);s(2784);var r=s(7239),a=s(3687),i=s(5819),l=s(6117),o=s(7691),c=s(6460),d=s(2972),u=s(8354);let m={unreleased:function(e){let{siteTitle:n,versionMetadata:s}=e;return(0,t.jsx)(l.Z,{id:"theme.docs.versions.unreleasedVersionLabel",description:"The label used to tell the user that he's browsing an unreleased doc version",values:{siteTitle:n,versionLabel:(0,t.jsx)("b",{children:s.label})},children:"This is unreleased documentation for {siteTitle} {versionLabel} version."})},unmaintained:function(e){let{siteTitle:n,versionMetadata:s}=e;return(0,t.jsx)(l.Z,{id:"theme.docs.versions.unmaintainedVersionLabel",description:"The label used to tell the user that he's browsing an unmaintained doc version",values:{siteTitle:n,versionLabel:(0,t.jsx)("b",{children:s.label})},children:"This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained."})}};function h(e){let n=m[e.versionMetadata.banner];return(0,t.jsx)(n,{...e})}function b(e){let{versionLabel:n,to:s,onClick:r}=e;return(0,t.jsx)(l.Z,{id:"theme.docs.versions.latestVersionSuggestionLabel",description:"The label used to tell the user to check the latest version",values:{versionLabel:n,latestVersionLink:(0,t.jsx)("b",{children:(0,t.jsx)(i.Z,{to:s,onClick:r,children:(0,t.jsx)(l.Z,{id:"theme.docs.versions.latestVersionLinkLabel",description:"The label used for the latest version suggestion link label",children:"latest version"})})})},children:"For up-to-date documentation, see the {latestVersionLink} ({versionLabel})."})}function x(e){let{className:n,versionMetadata:s}=e,{siteConfig:{title:i}}=(0,a.Z)(),{pluginId:l}=(0,o.gA)({failfast:!0}),{savePreferredVersionName:u}=(0,d.J)(l),{latestDocSuggestion:m,latestVersionSuggestion:x}=(0,o.Jo)(l),v=m??x.docs.find(e=>e.id===x.mainDocId);return(0,t.jsxs)("div",{className:(0,r.Z)(n,c.k.docs.docVersionBanner,"alert alert--warning margin-bottom--md"),role:"alert",children:[(0,t.jsx)("div",{children:(0,t.jsx)(h,{siteTitle:i,versionMetadata:s})}),(0,t.jsx)("div",{className:"margin-top--md",children:(0,t.jsx)(b,{versionLabel:x.label,to:v.path,onClick:()=>u(x.name)})})]})}function v(e){let{className:n}=e,s=(0,u.E)();return s.banner?(0,t.jsx)(x,{className:n,versionMetadata:s}):null}},7583:function(e,n,s){s.d(n,{c:()=>o});var t=s(2784),r=s(3687);let a=["zero","one","two","few","many","other"];function i(e){return a.filter(n=>e.includes(n))}let l={locale:"en",pluralForms:i(["one","other"]),select:e=>1===e?"one":"other"};function o(){let e=function(){let{i18n:{currentLocale:e}}=(0,r.Z)();return(0,t.useMemo)(()=>{try{let n=new Intl.PluralRules(e);return{locale:e,pluralForms:i(n.resolvedOptions().pluralCategories),select:e=>n.select(e)}}catch(n){return console.error(`Failed to use Intl.PluralRules for locale "${e}".
2
- Docusaurus will fallback to the default (English) implementation.
3
- Error: ${n.message}
4
- `),l}},[e])}();return{selectMessage:(n,s)=>(function(e,n,s){let t=e.split("|");if(1===t.length)return t[0];t.length>s.pluralForms.length&&console.error(`For locale=${s.locale}, a maximum of ${s.pluralForms.length} plural forms are expected (${s.pluralForms.join(",")}), but the message contains ${t.length}: ${e}`);let r=s.select(n);return t[Math.min(s.pluralForms.indexOf(r),t.length-1)]})(s,n,e)}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["7637"],{9121:function(e,n,t){t.r(n),t.d(n,{frontMatter:()=>o,default:()=>h,toc:()=>l,metadata:()=>s,assets:()=>c,contentTitle:()=>a});var s=JSON.parse('{"id":"getting-started/generators","title":"Code Generators","description":"Using openc3.sh to generate code","source":"@site/docs/getting-started/generators.md","sourceDirName":"getting-started","slug":"/getting-started/generators","permalink":"/tools/staticdocs/docs/getting-started/generators","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/getting-started/generators.md","tags":[],"version":"current","sidebarPosition":6,"frontMatter":{"sidebar_position":6,"title":"Code Generators","description":"Using openc3.sh to generate code","sidebar_custom_props":{"myEmoji":"\uD83C\uDFED"}},"sidebar":"defaultSidebar","previous":{"title":"Command Line Interface","permalink":"/tools/staticdocs/docs/getting-started/cli"},"next":{"title":"Podman","permalink":"/tools/staticdocs/docs/getting-started/podman"}}'),r=t(2322),i=t(2840);let o={sidebar_position:6,title:"Code Generators",description:"Using openc3.sh to generate code",sidebar_custom_props:{myEmoji:"\uD83C\uDFED"}},a=void 0,c={},l=[{value:"Plugin Generator",id:"plugin-generator",level:2},{value:"Target Generator",id:"target-generator",level:2},{value:"Microservice Generator",id:"microservice-generator",level:2},{value:"Conversion Generator",id:"conversion-generator",level:2},{value:"Processor Generator",id:"processor-generator",level:2},{value:"Limits Response Generator",id:"limits-response-generator",level:2},{value:"Widget Generator",id:"widget-generator",level:2},{value:"Tool Generator",id:"tool-generator",level:2}];function d(e){let n={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,i.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(n.p,{children:["The COSMOS Code Generators are built into the scripts ",(0,r.jsx)(n.code,{children:"openc3.sh"})," and ",(0,r.jsx)(n.code,{children:"openc3.bat"})," that are included in the COSMOS ",(0,r.jsx)(n.a,{href:"https://github.com/OpenC3/cosmos-project",children:"project"})," (more about ",(0,r.jsx)(n.a,{href:"key-concepts#projects",children:"projects"}),")."]}),"\n",(0,r.jsxs)(n.p,{children:["If you followed the ",(0,r.jsx)(n.a,{href:"/tools/staticdocs/docs/getting-started/installation",children:"Installation Guide"})," you should already be inside a cloned ",(0,r.jsx)(n.a,{href:"https://github.com/OpenC3/cosmos-project",children:"openc3-project"})," which is in your PATH (necessary for openc3.bat / openc3.sh to be resolved). To see all the available code generators type the following:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"% openc3.sh cli generate\nUnknown generator ''. Valid generators: plugin, target, microservice, widget, conversion,\n processor, limits_response, tool, tool_vue, tool_angular, tool_react, tool_svelte\n"})}),"\n",(0,r.jsx)(n.admonition,{title:"Training Available",type:"note",children:(0,r.jsxs)(n.p,{children:["If any of this gets confusing, contact us at ",(0,r.jsx)("a",{href:"mailto:support@openc3.com",children:(0,r.jsx)(n.a,{href:"mailto:support@openc3.com",children:"support@openc3.com"})}),". We have training classes available!"]})}),"\n",(0,r.jsx)(n.h2,{id:"plugin-generator",children:"Plugin Generator"}),"\n",(0,r.jsxs)(n.p,{children:["The plugin generator creates the scaffolding for a new COSMOS Plugin. It requires a plugin name and will create a new directory called ",(0,r.jsx)(n.code,{children:"openc3-cosmos-<name>"}),". For example:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"% openc3.sh cli generate plugin\nUsage: cli generate plugin <NAME>\n\n% openc3.sh cli generate plugin GSE\nPlugin openc3-cosmos-gse successfully generated!\n"})}),"\n",(0,r.jsx)(n.p,{children:"This creates the following files:"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:".gitignore"}),(0,r.jsx)(n.td,{children:"Tells git to ignore any node_modules directory (for tool development)"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"LICENSE.txt"}),(0,r.jsx)(n.td,{children:"License for the plugin. COSMOS Plugins should be licensed in a manner compatible with the AGPLv3, unless they are designed only for use with COSMOS Enterprise."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"openc3-cosmos-gse.gemspec"}),(0,r.jsxs)(n.td,{children:["Gemspec file which should be edited to add user specific information like description, authors, emails, homepage, etc. The name of this file is used in compiling the plugin contents into the final corresponding gem file: e.g. openc3-cosmos-gse-1.0.0.gem. COSMOS plugins should always begin with the openc3-cosmos prefix to make them easily identifiable in the Rubygems repository. The file is formatted as documented at: ",(0,r.jsx)(n.a,{href:"https://guides.rubygems.org/specification-reference/",children:"https://guides.rubygems.org/specification-reference/"})]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"plugin.txt"}),(0,r.jsxs)(n.td,{children:["COSMOS specific file for Plugin creation. Learn more ",(0,r.jsx)(n.a,{href:"../configuration/plugins",children:"here"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Rakefile"}),(0,r.jsx)(n.td,{children:'Ruby Rakefile configured to support building the plugin by running "openc3.sh cli rake build VERSION=X.X.X" where X.X.X is the plugin version number'})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"README.md"}),(0,r.jsx)(n.td,{children:"Markdown file used to document the plugin"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"requirements.txt"}),(0,r.jsx)(n.td,{children:"Python dependencies file (only for Python plugins)"})]})]})]}),"\n",(0,r.jsx)(n.p,{children:"While this structure is required, it is not very useful by itself. The plugin generator just creates the framework for other generators to use."}),"\n",(0,r.jsx)(n.h2,{id:"target-generator",children:"Target Generator"}),"\n",(0,r.jsx)(n.p,{children:"The target generator creates the scaffolding for a new COSMOS Target. It must operate inside an existing COSMOS plugin and requires a target name. For example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"openc3-cosmos-gse % openc3.sh cli generate target\nUsage: cli generate target <NAME> (--ruby or --python)\n\nopenc3-cosmos-gse % openc3.sh cli generate target GSE --python\nTarget GSE successfully generated!\n"})}),"\n",(0,r.jsx)(n.p,{children:"This creates the following files and directories:"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"targets/GSE"}),(0,r.jsx)(n.td,{children:"Contains the configuration for the GSE target. The target name is always defined in all caps. This is typically the default name of the target, but well-designed targets will allow themselves to be renamed at installation."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"targets/GSE/cmd_tlm"}),(0,r.jsx)(n.td,{children:"Contains the command and telemetry definition files for the GSE target. These files capture the format of the commands that can be sent to the target, and the telemetry packets that are expected to be received by COSMOS from the target. Note that the files in this folder are processed in alphabetical order by default. That can matter if you reference a packet in another file (it must already have been defined)."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"targets/GSE/cmd_tlm/cmd.txt"}),(0,r.jsxs)(n.td,{children:["Example ",(0,r.jsx)(n.a,{href:"../configuration/command",children:"command"})," configuration. Will need to be edited for the target specific commands."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"targets/GSE/cmd_tlm/tlm.txt"}),(0,r.jsxs)(n.td,{children:["Example ",(0,r.jsx)(n.a,{href:"../configuration/telemetry",children:"telemetry"})," configuration. Will need to be edited for the target specific telemetry."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"targets/GSE/lib"}),(0,r.jsxs)(n.td,{children:["Contains any custom code required by the target. Good examples of custom code are library files, custom ",(0,r.jsx)(n.a,{href:"../configuration/interfaces",children:"interface"})," classes and ",(0,r.jsx)(n.a,{href:"../configuration/protocols",children:"protocols"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"targets/GSE/lib/gse.[rb/py]"}),(0,r.jsx)(n.td,{children:"Example library file which can be expanded as the target is developed. COSMOS recommends building up library methods to avoid code duplication and ease reuse."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"targets/GSE/procedures"}),(0,r.jsxs)(n.td,{children:["This folder contains target specific procedures and helper methods which exercise functionality of the target. These procedures should be kept simple and only use the command and telemetry definitions associated with this target. See the ",(0,r.jsx)(n.a,{href:"../guides/script-writing#script-organization",children:"Scripting Guide"})," for more information."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"targets/GSE/procedures/procedure.[rb/py]"}),(0,r.jsx)(n.td,{children:"Procedure with an example of sending a command and checking telemetry"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"targets/GSE/public"}),(0,r.jsxs)(n.td,{children:["Put image files here for use in Telemetry Viewer Canvas Image widgets such as ",(0,r.jsx)(n.a,{href:"/tools/staticdocs/docs/configuration/telemetry-screens#canvasimage",children:"CANVASIMAGE"})," and ",(0,r.jsx)(n.a,{href:"/tools/staticdocs/docs/configuration/telemetry-screens#canvasimagevalue",children:"CANVASIMAGEVALUE"})]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"targets/GSE/screens"}),(0,r.jsxs)(n.td,{children:["Contains telemetry ",(0,r.jsx)(n.a,{href:"/tools/staticdocs/docs/configuration/telemetry-screens",children:"screens"})," for the target"]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"targets/GSE/screens/status.txt"}),(0,r.jsxs)(n.td,{children:["Example ",(0,r.jsx)(n.a,{href:"/tools/staticdocs/docs/configuration/telemetry-screens",children:"screen"})," to display telemetry values"]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"targets/GSE/target.txt"}),(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.a,{href:"../configuration/target",children:"Target"})," configuration such as ignoring command and telemetry items and how to process the cmd/tlm files"]})]})]})]}),"\n",(0,r.jsx)(n.p,{children:"It also updates the plugin.txt file to add the new target:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ruby",children:"VARIABLE gse_target_name GSE\n\nTARGET GSE <%= gse_target_name %>\nINTERFACE <%= gse_target_name %>_INT openc3/interfaces/tcpip_client_interface.py host.docker.internal 8080 8081 10.0 nil BURST\n# INTERFACE <%= gse_target_name %>_INT tcpip_client_interface.rb host.docker.internal 8080 8081 10.0 nil BURST\n MAP_TARGET <%= gse_target_name %>\n"})}),"\n",(0,r.jsx)(n.h2,{id:"microservice-generator",children:"Microservice Generator"}),"\n",(0,r.jsx)(n.p,{children:"The microservice generator creates the scaffolding for a new COSMOS Microservice. It must operate inside an existing COSMOS plugin and requires a target name. For example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"openc3-cosmos-gse % openc3.sh cli generate microservice\nUsage: cli generate microservice <NAME> (--ruby or --python)\n\nopenc3-cosmos-gse % openc3.sh cli generate microservice background --python\nMicroservice BACKGROUND successfully generated!\n"})}),"\n",(0,r.jsx)(n.p,{children:"This creates the following files and directories:"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"microservices/BACKGROUND"}),(0,r.jsx)(n.td,{children:"Contains the code and any necessary configuration for the BACKGROUND microservice. The name is always defined in all caps. This is typically the default name of the microservice, but well-designed microservices will allow themselves to be renamed at installation."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"microservices/BACKGROUND/background.py"}),(0,r.jsxs)(n.td,{children:["Fully functional microservice which will run every minute and log a message. Edit to implement any custom logic that you want to run in the background. Potential uses are safety microservices which can check and autonomously respond to complex events and take action (NOTE: Simple actions might just require a ",(0,r.jsx)(n.a,{href:"/docs/configuration/limits-response",children:"Limits Response"}),")."]})]})]})]}),"\n",(0,r.jsx)(n.p,{children:"It also updates the plugin.txt file to add the new microservice:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ruby",children:"MICROSERVICE BACKGROUND background-microservice\n CMD python background.py\n"})}),"\n",(0,r.jsx)(n.h2,{id:"conversion-generator",children:"Conversion Generator"}),"\n",(0,r.jsxs)(n.p,{children:["The conversion generator creates the scaffolding for a new COSMOS ",(0,r.jsx)(n.a,{href:"/docs/configuration/conversions",children:"Conversion"}),". It must operate inside an existing COSMOS plugin and requires both a target name and conversion name. For example:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"openc3-cosmos-gse % openc3.sh cli generate conversion\nUsage: cli generate conversion <TARGET> <NAME> (--ruby or --python)\n\nopenc3-cosmos-gse % openc3.sh cli generate conversion GSE double --python\nConversion targets/GSE/lib/double_conversion.py successfully generated!\nTo use the conversion add the following to a telemetry item:\n READ_CONVERSION double_conversion.py\n"})}),"\n",(0,r.jsxs)(n.p,{children:["For more information about creating custom conversions and how to apply them, see the ",(0,r.jsx)(n.a,{href:"/docs/configuration/conversions",children:"Conversion"})," documentation."]}),"\n",(0,r.jsx)(n.h2,{id:"processor-generator",children:"Processor Generator"}),"\n",(0,r.jsxs)(n.p,{children:["The processor generator creates the scaffolding for a new COSMOS ",(0,r.jsx)(n.a,{href:"/docs/configuration/processors",children:"Processor"}),". It must operate inside an existing COSMOS plugin and requires both a target name and processor name. For example:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"openc3-cosmos-gse % openc3.sh cli generate processor\nUsage: cli generate processor <TARGET> <NAME> (--ruby or --python)\n\nopenc3-cosmos-gse % openc3.sh cli generate processor GSE slope --python\nProcessor targets/GSE/lib/slope_processor.py successfully generated!\nTo use the processor add the following to a telemetry packet:\n PROCESSOR SLOPE slope_processor.py <PARAMS...>\n"})}),"\n",(0,r.jsxs)(n.p,{children:["For more information about creating custom processors and how to apply them, see the ",(0,r.jsx)(n.a,{href:"/docs/configuration/processors",children:"Processor"})," documentation."]}),"\n",(0,r.jsx)(n.h2,{id:"limits-response-generator",children:"Limits Response Generator"}),"\n",(0,r.jsxs)(n.p,{children:["The limits_response generator creates the scaffolding for a new COSMOS ",(0,r.jsx)(n.a,{href:"/docs/configuration/limits-response",children:"Limits Response"}),". It must operate inside an existing COSMOS plugin and requires both a target name and limits response name. For example:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"openc3-cosmos-gse % openc3.sh cli generate limits_response\nUsage: cli generate limits_response <TARGET> <NAME> (--ruby or --python)\n\nopenc3-cosmos-gse % openc3.sh cli generate limits_response GSE safe --python\nLimits response targets/GSE/lib/safe_limits_response.py successfully generated!\nTo use the limits response add the following to a telemetry item:\n LIMITS_RESPONSE safe_limits_response.py\n"})}),"\n",(0,r.jsxs)(n.p,{children:["For more information about creating limits responses and how to apply them, see the ",(0,r.jsx)(n.a,{href:"/docs/configuration/limits-response",children:"Limits Response"})," documentation."]}),"\n",(0,r.jsx)(n.h2,{id:"widget-generator",children:"Widget Generator"}),"\n",(0,r.jsxs)(n.p,{children:["The widget generator creates the scaffolding for a new COSMOS Widget for use in ",(0,r.jsx)(n.a,{href:"/docs/configuration/telemetry-screens",children:"Telemetry Viewer Screens"}),". For more information see the ",(0,r.jsx)(n.a,{href:"/docs/guides/custom-widgets",children:"Custom Widget"})," guide. It must operate inside an existing COSMOS plugin and requires a widget name. For example:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"openc3-cosmos-gse % openc3.sh cli generate widget\nUsage: cli generate widget <SuperdataWidget>\n\nopenc3-cosmos-gse % openc3.sh cli generate widget HelloworldWidget\nWidget HelloworldWidget successfully generated!\nPlease be sure HelloworldWidget does not overlap an existing widget: https://docs.openc3.com/docs/configuration/telemetry-screens\n"})}),"\n",(0,r.jsx)(n.p,{children:"This creates the following files and directories:"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsx)(n.tbody,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"src/HelloworldWidget.vue"}),(0,r.jsx)(n.td,{children:"Fully functional widget which displays a simple value. This can be expanded using existing COSMOS Vue.js code to create any data visualization imaginable."})]})})]}),"\n",(0,r.jsx)(n.p,{children:"It also updates the plugin.txt file to add the new widget:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ruby",children:"WIDGET Helloworld\n"})}),"\n",(0,r.jsx)(n.h2,{id:"tool-generator",children:"Tool Generator"}),"\n",(0,r.jsxs)(n.p,{children:["The tool generator creates the scaffolding for a new COSMOS Tool. It's It must operate inside an existing COSMOS plugin and requires a tool name. Developing a custom tool requires intensive knowledge of a Javascript framework such as Vue.js, Angular, React, or Svelte. Since all the COSMOS tools are built in Vue.js, that is the recommended framework for new tool development. For additional help on frontend development, see ",(0,r.jsx)(n.a,{href:"../development/developing#running-a-frontend-application",children:"Running a Frontend Application"}),"."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"openc3-cosmos-gse % openc3.sh cli generate tool\nUsage: cli generate tool 'Tool Name'\n\nopenc3-cosmos-gse % openc3.sh cli generate tool DataVis\nTool datavis successfully generated!\nPlease be sure datavis does not conflict with any other tools\n"})}),"\n",(0,r.jsx)(n.p,{children:"This creates the following files and directories:"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"src/App.vue"}),(0,r.jsx)(n.td,{children:"Basic Vue template to render the application."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"src/main.js"}),(0,r.jsx)(n.td,{children:"Entry point for the new tool which loads Vue, Vuetify, and other libraries."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"src/router.js"}),(0,r.jsx)(n.td,{children:"Vue component router."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"src/tools/datavis"}),(0,r.jsx)(n.td,{children:"Contains all the files necessary to serve a web-based tool named datavis. The name is always defined in all lowercase. Due to technical limitations, the toolname must be unique and cannot be renamed at installation."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"src/tools/datavis/datavis.vue"}),(0,r.jsx)(n.td,{children:"Fully functional tool which displays a simple button. This can be expanded using existing COSMOS Vue.js code to create any tool imaginable."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"package.json"}),(0,r.jsx)(n.td,{children:"Build and dependency definition file. Used by npm or yarn to build the tool."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"vue.config.js"}),(0,r.jsx)(n.td,{children:"Vue configuration file used to serve the application in development and build the application."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"<dotfiles>"}),(0,r.jsx)(n.td,{children:"Various dotfiles which help configure formatters and tools for Javascript frontend development"})]})]})]}),"\n",(0,r.jsxs)(n.p,{children:["It also updates the plugin.txt file to add the new tool. The icon can be changed to any of the material design icons found ",(0,r.jsx)(n.a,{href:"https://pictogrammers.com/library/mdi/",children:"here"}),"."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ruby",children:'TOOL datavis "DataVis"\n INLINE_URL main.js\n ICON mdi-file-cad-box\n'})})]})}function h(e={}){let{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},2840:function(e,n,t){t.d(n,{Z:()=>a,a:()=>o});var s=t(2784);let r={},i=s.createContext(r);function o(e){let n=s.useContext(i);return s.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),s.createElement(i.Provider,{value:n},e.children)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["6319"],{6244:function(e,t,i){i.r(t),i.d(t,{frontMatter:()=>c,default:()=>h,toc:()=>d,metadata:()=>r,assets:()=>o,contentTitle:()=>l});var r=JSON.parse('{"id":"guides/reference-architectures","title":"Reference Architectures","description":"Typical COSMOS use-cases","source":"@site/docs/guides/reference-architectures.md","sourceDirName":"guides","slug":"/guides/reference-architectures","permalink":"/tools/staticdocs/docs/guides/reference-architectures","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/guides/reference-architectures.md","tags":[],"version":"current","frontMatter":{"title":"Reference Architectures","description":"Typical COSMOS use-cases","sidebar_custom_props":{"myEmoji":"\uD83C\uDFD7\uFE0F"}},"sidebar":"defaultSidebar","previous":{"title":"Raspberry Pi","permalink":"/tools/staticdocs/docs/guides/raspberrypi"},"next":{"title":"Script Writing Guide","permalink":"/tools/staticdocs/docs/guides/script-writing"}}'),s=i(2322),n=i(2840);let c={title:"Reference Architectures",description:"Typical COSMOS use-cases",sidebar_custom_props:{myEmoji:"\uD83C\uDFD7\uFE0F"}},l=void 0,o={},d=[{value:"Core Single Server Architecture",id:"core-single-server-architecture",level:2},{value:"Enterprise Single Server Architecture",id:"enterprise-single-server-architecture",level:3},{value:"Enterprise Cloud Architecture (High Reliability / High Availability)",id:"enterprise-cloud-architecture-high-reliability--high-availability",level:3}];function a(e){let t={a:"a",h2:"h2",h3:"h3",li:"li",p:"p",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,n.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.p,{children:'COSMOS is the best way to command and control hardware with embedded software. The hardware it can control and the configuration of the software is limitless. However, there are several "Reference Architectures" that are commonly used which describe the vast majority of use-cases for COSMOS.'}),"\n",(0,s.jsx)(t.h2,{id:"core-single-server-architecture",children:"Core Single Server Architecture"}),"\n",(0,s.jsxs)(t.p,{children:["COSMOS Core (Open Source) deployed on a single server is most suitable for evaluation, test or development. COSMOS can be deployed on a individual computer with Windows or Mac OS via ",(0,s.jsx)(t.a,{href:"https://docs.docker.com/desktop/",children:"Docker Desktop"}),". It can deployed on Linux directly using Docker on Ubuntu or Podman on RedHat."]}),"\n",(0,s.jsx)(t.p,{children:"If you deploy COSMOS Core you have to configure COSMOS yourself and build all your hardware plugins from scratch. You must rely on the COSMOS documentation and github issues instead of having direct email support from the OpenC3 team. Core configures a single user with a shared password having admin privileges. The Core license is AGPLv3 which means your users must have access to the COSMOS source code and any extensions you build into COSMOS itself."}),"\n",(0,s.jsx)(t.p,{children:"Most Suitible for:"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"Evaluation of COSMOS"}),"\n",(0,s.jsx)(t.li,{children:"University teams"}),"\n",(0,s.jsx)(t.li,{children:"Individual use"}),"\n",(0,s.jsx)(t.li,{children:"Localized lab development"}),"\n"]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Advantages"}),(0,s.jsx)(t.th,{children:"Considerations"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"\u2705\xa0\xa0Free (AGPLv3 license)"}),(0,s.jsx)(t.td,{children:"\uD83E\uDD14\xa0\xa0No OpenC3 support"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"\u2705\xa0\xa0Easy to deploy"}),(0,s.jsx)(t.td,{children:"\uD83E\uDD14\xa0\xa0No Users, RBAC or SSO"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"\u2705\xa0\xa0Easy to configure"}),(0,s.jsx)(t.td,{children:"\uD83E\uDD14\xa0\xa0Limited scalability"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"\uD83E\uDD14\xa0\xa0No Calendar or Autonomic"})]})]})]}),"\n",(0,s.jsx)(t.h3,{id:"enterprise-single-server-architecture",children:"Enterprise Single Server Architecture"}),"\n",(0,s.jsxs)(t.p,{children:["COSMOS Enterprise deployed on a single server is most suitable for formal test, production or operations. COSMOS Enterprise can be deployed on a individual computer with Windows or Mac OS via ",(0,s.jsx)(t.a,{href:"https://docs.docker.com/desktop/",children:"Docker Desktop"}),". It can deployed on Linux directly using Docker on Ubuntu or Podman on RedHat."]}),"\n",(0,s.jsx)(t.p,{children:"Enterprise comes with a number of plugins that help you jump start your development: CCSDS TC/TM/CFDP, SCPI, SNMP, Gems, Protocol Buffers, gRPC, etc. Enterprise comes with email support from the OpenC3 team. Enterprise includes users, RBAC (role based access control) and SSO (single sign-on) through Keycloak. The Enterprise license is Commercial which means you can build proprietary COSMOS extensions and not be required to give your users access to the source code."}),"\n",(0,s.jsx)(t.p,{children:"Most Suitible for:"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"Quickly connecting to existing hardware via SCPI, SNMP, Gems, gRPC, etc"}),"\n",(0,s.jsx)(t.li,{children:"Controlling hardware utilizing CCSDS TC, TM, CFDP"}),"\n",(0,s.jsxs)(t.li,{children:["Operating cFS (",(0,s.jsx)(t.a,{href:"https://etd.gsfc.nasa.gov/capabilities/core-flight-system/",children:"Core Flight System"}),")"]}),"\n",(0,s.jsx)(t.li,{children:"Formal test with user attribution"}),"\n",(0,s.jsx)(t.li,{children:"Operations for 1 or more satellites"}),"\n"]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Advantages"}),(0,s.jsx)(t.th,{children:"Considerations"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"\u2705\xa0\xa0OpenC3 Supported"}),(0,s.jsx)(t.td,{children:"\uD83E\uDD14\xa0\xa0Limited scalability"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"\u2705\xa0\xa0Commercial License"}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"\u2705\xa0\xa0Library of existing plugins"}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"\u2705\xa0\xa0Users with RBAC and SSO"}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"\u2705\xa0\xa0Calendar and Autonomic"}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"\u2705\xa0\xa0Easy to deploy"}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"\u2705\xa0\xa0Easy to configure"}),(0,s.jsx)(t.td,{})]})]})]}),"\n",(0,s.jsx)(t.h3,{id:"enterprise-cloud-architecture-high-reliability--high-availability",children:"Enterprise Cloud Architecture (High Reliability / High Availability)"}),"\n",(0,s.jsx)(t.p,{children:"COSMOS Enterprise deployed in the cloud (public or private) is most suitable for operations of satellite constellations or as a satellite operations center. In addition to the benefits listed under the Enterprise Single Server Architecture, Enterprise comes with cloud scripts to help create a reference deployment (EKS, GKE, etc). Enterprise also comes with helm charts to deploy COSMOS in Kubernetes. Running COSMOS in Kubernetes is what achieves high reliability and high availability."}),"\n",(0,s.jsx)(t.p,{children:"Most Suitible for:"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"Operating a satellite constellation (10-1000 satellites)"}),"\n",(0,s.jsx)(t.li,{children:"Running a satellite ops center which supports many different satellite buses / payloads"}),"\n"]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Advantages"}),(0,s.jsx)(t.th,{children:"Considerations"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"\u2705\xa0\xa0OpenC3 Supported"}),(0,s.jsx)(t.td,{children:"\uD83E\uDD14\xa0\xa0Cloud configuration / complexity"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"\u2705\xa0\xa0Commercial License"}),(0,s.jsx)(t.td,{children:"\uD83E\uDD14\xa0\xa0Kubernetes management"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"\u2705\xa0\xa0Library of existing plugins"}),(0,s.jsx)(t.td,{children:"\uD83E\uDD14\xa0\xa0Public cloud costs"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"\u2705\xa0\xa0Users with RBAC and SSO"}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"\u2705\xa0\xa0Calendar and Autonomic"}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"\u2705\xa0\xa0Cloud configuration scripts"}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"\u2705\xa0\xa0Helm charts"}),(0,s.jsx)(t.td,{})]})]})]})]})}function h(e={}){let{wrapper:t}={...(0,n.a)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},2840:function(e,t,i){i.d(t,{Z:()=>l,a:()=>c});var r=i(2784);let s={},n=r.createContext(s);function c(e){let t=r.useContext(n);return r.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:c(e.components),r.createElement(n.Provider,{value:t},e.children)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["8110"],{9847:function(e,t,a){a.r(t),a.d(t,{frontMatter:()=>c,default:()=>p,toc:()=>d,metadata:()=>n,assets:()=>r,contentTitle:()=>o});var n=JSON.parse('{"id":"guides/dynamic-packets","title":"Dynamic Packets","description":"How COSMOS dynamically builds packets","source":"@site/docs/guides/dynamic-packets.md","sourceDirName":"guides","slug":"/guides/dynamic-packets","permalink":"/tools/staticdocs/docs/guides/dynamic-packets","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/guides/dynamic-packets.md","tags":[],"version":"current","frontMatter":{"title":"Dynamic Packets","description":"How COSMOS dynamically builds packets","sidebar_custom_props":{"myEmoji":"\uD83E\uDDF1"}},"sidebar":"defaultSidebar","previous":{"title":"Custom Widgets","permalink":"/tools/staticdocs/docs/guides/custom-widgets"},"next":{"title":"Exposing Microservices","permalink":"/tools/staticdocs/docs/guides/exposing-microservices"}}'),i=a(2322),s=a(2840);let c={title:"Dynamic Packets",description:"How COSMOS dynamically builds packets",sidebar_custom_props:{myEmoji:"\uD83E\uDDF1"}},o=void 0,r={},d=[{value:"Using Dynamic Update",id:"using-dynamic-update",level:2}];function l(e){let t={a:"a",code:"code",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(t.p,{children:["COSMOS has the ability to dynamically build packets rather than have them statically defined by our ",(0,i.jsx)(t.a,{href:"/docs/configuration/command",children:"COMMAND"})," and ",(0,i.jsx)(t.a,{href:"/docs/configuration/telemetry",children:"TELEMETRY"})," configuration files. This is useful when your telemetry items are dynamic like when generating ",(0,i.jsx)(t.a,{href:"https://prometheus.io/",children:"prometheus"})," metrics."]}),"\n",(0,i.jsxs)(t.p,{children:["The best way to illustrate this capability is with an example. If you're an Enterprise customer, please see the ",(0,i.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-enterprise-plugins/tree/main/openc3-cosmos-prometheus-metrics",children:"prometheus-metrics"})," plugin."]}),"\n",(0,i.jsx)(t.h2,{id:"using-dynamic-update",children:"Using Dynamic Update"}),"\n",(0,i.jsxs)(t.p,{children:["To use the dynamic update capability in your own code you need to call the ",(0,i.jsx)(t.code,{children:"TargetModel"})," ",(0,i.jsx)(t.code,{children:"dynamic_update"})," method. This method takes an array / list of packets, whether the packets are commands or telemetry, and the filename to create in the config bucket."]}),"\n",(0,i.jsx)(t.p,{children:"Here is the method signature:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ruby",children:'def dynamic_update(packets, cmd_or_tlm = :TELEMETRY, filename = "dynamic_tlm.txt")\n'})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-python",children:'def dynamic_update(self, packets, cmd_or_tlm="TELEMETRY", filename="dynamic_tlm.txt")\n'})}),"\n",(0,i.jsx)(t.p,{children:"Here is an example of using this method:"}),"\n",(0,i.jsx)(t.p,{children:"Ruby:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ruby",children:"# Create a new packet\npacket = Packet.new('INST', 'NEW_PACKET')\n# or get an existing packet\npacket = System.telemetry.packet('INST', 'METRICS')\n# Modify the packet by appending new items to it\npacket.append_item('NEW_ITEM', 32, :FLOAT)\n# Grab the TargetModel associated with the packet's target\ntarget_model = TargetModel.get_model(name: 'INST', scope: 'DEFAULT')\n# Update the target model with the new packet\ntarget_model.dynamic_update([packet])\n"})}),"\n",(0,i.jsx)(t.p,{children:"Python:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-python",children:"# Create a new packet\npacket = Packet('INST', 'NEW_PACKET')\n# or get an existing packet\npacket = System.telemetry.packet('INST', 'METRICS')\n# Modify the packet by appending new items to it\npacket.append_item('NEW_ITEM', 32, 'FLOAT')\n# Grab the TargetModel associated with the packet's target\ntarget_model = TargetModel.get_model(name='INST', scope='DEFAULT')\n# Update the target model with the new packet\ntarget_model.dynamic_update([packet])\n"})}),"\n",(0,i.jsx)(t.p,{children:"When this method is called several things happen:"}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsx)(t.li,{children:"The COSMOS Redis database is updated with the new packets and the current value table is initialized"}),"\n",(0,i.jsxs)(t.li,{children:["A configuration file for the packets is created and stored at <SCOPE>/targets_modified/<TARGET>/cmd_tlm/dynamic_tlm.txt. Note that if you call ",(0,i.jsx)(t.code,{children:"dynamic_update"})," multiple times you should update the filename so it is not written over."]}),"\n",(0,i.jsx)(t.li,{children:"The COSMOS microservices are informed of the new streaming topics which will contain the raw and decommuted packet data. Part of this action is to restart the microservices so they pickup these changes. For COMMANDS the following are restarted: <SCOPE>__COMMANDLOG__<TARGET> and <SCOPE>__DECOMCMDLOG__<TARGET>. For TELEMETRY the following are restarted: <SCOPE>__PACKET_LOG__<TARGET>, <SCOPE>__DECOMLOG__<TARGET>, and <SCOPE>__DECOM__<TARGET>."}),"\n"]}),"\n",(0,i.jsxs)(t.p,{children:["Since ",(0,i.jsx)(t.code,{children:"dynamic_update"})," restarts the LOG microservices there is a potential for a loss of packets during the restart. Thus you should not call ",(0,i.jsx)(t.code,{children:"dynamic_update"})," during critical telemetry processing periods."]})]})}function p(e={}){let{wrapper:t}={...(0,s.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},2840:function(e,t,a){a.d(t,{Z:()=>o,a:()=>c});var n=a(2784);let i={},s=n.createContext(i);function c(e){let t=n.useContext(s);return n.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:c(e.components),n.createElement(s.Provider,{value:t},e.children)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["7810"],{8120:function(e,n,t){t.r(n),t.d(n,{frontMatter:()=>r,default:()=>u,toc:()=>a,metadata:()=>o,assets:()=>l,contentTitle:()=>c});var o=JSON.parse('{"id":"meta/contributing","title":"Contributing","description":"Contributing to COSMOS using the github workflow","source":"@site/docs/meta/contributing.md","sourceDirName":"meta","slug":"/meta/contributing","permalink":"/tools/staticdocs/docs/meta/contributing","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/meta/contributing.md","tags":[],"version":"current","frontMatter":{"title":"Contributing","description":"Contributing to COSMOS using the github workflow","sidebar_custom_props":{"myEmoji":"\uD83D\uDE42"}},"sidebar":"defaultSidebar","previous":{"title":"Meta","permalink":"/tools/staticdocs/docs/meta"},"next":{"title":"Licenses","permalink":"/tools/staticdocs/docs/meta/licenses"}}'),i=t(2322),s=t(2840);let r={title:"Contributing",description:"Contributing to COSMOS using the github workflow",sidebar_custom_props:{myEmoji:"\uD83D\uDE42"}},c=void 0,l={},a=[{value:"Test Dependencies",id:"test-dependencies",level:2},{value:"Workflow",id:"workflow",level:2}];function d(e){let n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",ul:"ul",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.p,{children:"So you've got an awesome idea to throw into COSMOS. Great! This is the basic process:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsx)(n.li,{children:"Fork the project on Github"}),"\n",(0,i.jsx)(n.li,{children:"Create a feature branch"}),"\n",(0,i.jsx)(n.li,{children:"Make your changes"}),"\n",(0,i.jsx)(n.li,{children:"Submit a pull request"}),"\n"]}),"\n",(0,i.jsxs)(n.admonition,{title:"Don't Forget the Contributor License Agreement!",type:"note",children:[(0,i.jsxs)(n.p,{children:["By contributing to this project, you accept our Contributor License Agreement which is found here: ",(0,i.jsx)(n.a,{href:"https://github.com/OpenC3/cosmos/blob/main/CONTRIBUTING.txt",children:"Contributor License Agreement"})]}),(0,i.jsx)(n.p,{children:"This protects both you and us and you retain full rights to any code you write."})]}),"\n",(0,i.jsx)(n.h2,{id:"test-dependencies",children:"Test Dependencies"}),"\n",(0,i.jsxs)(n.p,{children:["To run the test suite and build the gem you'll need to install COSMOS's\ndependencies. COSMOS uses Bundler, so a quick run of the ",(0,i.jsx)(n.code,{children:"bundle"})," command and\nyou're all set!"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"\\$ bundle\n"})}),"\n",(0,i.jsx)(n.p,{children:"Before you start, run the tests and make sure that they pass (to confirm your\nenvironment is configured properly):"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"\\$ bundle exec rake build spec\n"})}),"\n",(0,i.jsx)(n.h2,{id:"workflow",children:"Workflow"}),"\n",(0,i.jsx)(n.p,{children:"Here's the most direct way to get your work merged into the project:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Fork the project."}),"\n",(0,i.jsx)(n.li,{children:"Clone down your fork:"}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"git clone git://github.com/<username>/openc3.git\n"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Create a topic branch to contain your change:"}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"git checkout -b my_awesome_feature\n"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Hack away, add tests. Not necessarily in that order."}),"\n",(0,i.jsxs)(n.li,{children:["Make sure everything still passes by running ",(0,i.jsx)(n.code,{children:"bundle exec rake"}),"."]}),"\n",(0,i.jsx)(n.li,{children:"If necessary, rebase your commits into logical chunks, without errors."}),"\n",(0,i.jsx)(n.li,{children:"Push the branch up:"}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"git push origin my_awesome_feature\n"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Create a pull request against openc3/cosmos",":main"," and describe what your\nchange does and the why you think it should be merged."]}),"\n"]}),"\n",(0,i.jsx)(n.admonition,{title:"Find a problem in the code or documentation?",type:"note",children:(0,i.jsxs)(n.p,{children:["Please ",(0,i.jsx)(n.a,{href:"https://github.com/OpenC3/cosmos/issues/new/choose",children:"create an issue"})," on\nGitHub describing what we can do to make it better."]})})]})}function u(e={}){let{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},2840:function(e,n,t){t.d(n,{Z:()=>c,a:()=>r});var o=t(2784);let i={},s=o.createContext(i);function r(e){let n=o.useContext(s);return o.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),o.createElement(s.Provider,{value:n},e.children)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["4593"],{3814:function(e,t,i){i.r(t),i.d(t,{frontMatter:()=>r,default:()=>c,toc:()=>h,metadata:()=>a,assets:()=>o,contentTitle:()=>l});var a=JSON.parse('{"id":"tools/tlm-grapher","title":"Telemetry Grapher","description":"Graph real time or historical data","source":"@site/docs/tools/tlm-grapher.md","sourceDirName":"tools","slug":"/tools/tlm-grapher","permalink":"/tools/staticdocs/docs/tools/tlm-grapher","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/tools/tlm-grapher.md","tags":[],"version":"current","frontMatter":{"title":"Telemetry Grapher","description":"Graph real time or historical data","sidebar_custom_props":{"myEmoji":"\uD83D\uDCC8"}},"sidebar":"defaultSidebar","previous":{"title":"Table Manager","permalink":"/tools/staticdocs/docs/tools/table-manager"},"next":{"title":"Telemetry Viewer","permalink":"/tools/staticdocs/docs/tools/tlm-viewer"}}'),n=i(2322),s=i(2840);let r={title:"Telemetry Grapher",description:"Graph real time or historical data",sidebar_custom_props:{myEmoji:"\uD83D\uDCC8"}},l=void 0,o={},h=[{value:"Introductions",id:"introductions",level:2},{value:"Telemetry Grapher Menus",id:"telemetry-grapher-menus",level:2},{value:"File Menu Items",id:"file-menu-items",level:3},{value:"Open Configuration",id:"open-configuration",level:4},{value:"Save Configuration",id:"save-configuration",level:4},{value:"Graph Menu Items",id:"graph-menu-items",level:3},{value:"Selecting Items",id:"selecting-items",level:2},{value:"Graph Window Management",id:"graph-window-management",level:2}];function d(e){let t={h2:"h2",h3:"h3",h4:"h4",img:"img",li:"li",p:"p",ul:"ul",...(0,s.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h2,{id:"introductions",children:"Introductions"}),"\n",(0,n.jsx)(t.p,{children:"Telemetry Grapher is a graphing application that allows for one or more telemetry points per graph. It supports multiple graphs per screen which can be resized and reordered. Multiple configurations can be saved and restored for different situations."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Telemetry Grapher",src:i(2603).Z+"",width:"1270",height:"927"})}),"\n",(0,n.jsx)(t.h2,{id:"telemetry-grapher-menus",children:"Telemetry Grapher Menus"}),"\n",(0,n.jsx)(t.h3,{id:"file-menu-items",children:"File Menu Items"}),"\n",(0,n.jsx)("img",{src:i(857).Z,alt:"File Menu",style:{float:"left","margin-right":"50px",height:"90px"}}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsx)(t.li,{children:"Open a saved configuration (graphs and items)"}),"\n",(0,n.jsx)(t.li,{children:"Save the current configuration"}),"\n",(0,n.jsx)(t.li,{children:"Reset the configuration (default settings)"}),"\n"]}),"\n",(0,n.jsx)(t.h4,{id:"open-configuration",children:"Open Configuration"}),"\n",(0,n.jsx)(t.p,{children:"The Open Configuration dialog displays a list of all saved configurations. You select a configuration and then click Ok to load it. You can delete existing configurations by clicking the Trash icon next to a configuration name."}),"\n",(0,n.jsx)(t.h4,{id:"save-configuration",children:"Save Configuration"}),"\n",(0,n.jsx)(t.p,{children:"The Save Configuration dialog also displays a list of all saved configurations. You click the Configuration Name text field, enter the name of your new configuration, and click Ok to save. You can delete existing configurations by clicking the Trash icon next to a configuration name."}),"\n",(0,n.jsx)(t.h3,{id:"graph-menu-items",children:"Graph Menu Items"}),"\n",(0,n.jsx)("img",{src:i(9309).Z,alt:"File Menu",style:{float:"left","margin-right":"50px",height:"150px"}}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsx)(t.li,{children:"Add a new graph"}),"\n",(0,n.jsx)(t.li,{children:"Start / Resume graphing"}),"\n",(0,n.jsx)(t.li,{children:"Pause graph"}),"\n",(0,n.jsx)(t.li,{children:"Stop graph"}),"\n",(0,n.jsx)(t.li,{children:"Edit grapher settings"}),"\n"]}),"\n",(0,n.jsx)(t.p,{children:"Editing the grapher settings brings up a dialog to change settings affecting every graph in the Telemetry Grapher tool. Changing the Seconds Graphed changes the visible windows displaying graph points. The smaller of Seconds Graphed and Points Graphed will be used when calculating the number of points to display. Changing the Points Saved will affect performance of the browser window if set too high. The default of 1,000,000 points can store over 11.5 days of 1Hz data points."}),"\n",(0,n.jsx)(t.p,{children:"Editing an individual graph by clicking the pencil icon in title bar of the graph brings up the edit graph dialog."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Edit Graph",src:i(8422).Z+"",width:"592",height:"766"})}),"\n",(0,n.jsx)(t.p,{children:"Editing the Start Date and Start Time will re-query the data to begin at the specified time. This operation can take several seconds depending on how far back data is requested. Similarly, specifying the End Date and End Time will limit the data request to the specified time. Leaving the End Date / End Time fields blank will cause Telemetry Grapher to continue to graph items in real-time as they arrive."}),"\n",(0,n.jsx)(t.p,{children:"Changing the Min Y and Max Y values simply sets the graph scale. Deleting the Min Y and Max Y values allows the graph to scale automatically as values arrive. Compare the following graph with the minimum set to 0 and the maximum set to 100 with the first graph image (auto-scale)."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Min Max",src:i(7708).Z+"",width:"1247",height:"718"})}),"\n",(0,n.jsx)(t.h2,{id:"selecting-items",children:"Selecting Items"}),"\n",(0,n.jsx)(t.p,{children:"Selecting a target from the Select Target drop down automatically updates the available packets in the Select Packet drop down which updates the available items in the Select Item drop down. Clicking Add Item adds the item to the graph which immediately begins graphing."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Temp 1",src:i(8813).Z+"",width:"1247",height:"829"})}),"\n",(0,n.jsx)(t.p,{children:"As time passes, the main graph fills up and starts scrolling while the overview graph at the bottom shows the entire history."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Temp 1 History",src:i(4854).Z+"",width:"1247",height:"829"})}),"\n",(0,n.jsx)(t.p,{children:"Selecting a new item and adding it to the graph automatically fills the graph with history until the beginning of the first item. This allows you to add items to the graph incrementally and maintain full history."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Temp1 Temp2",src:i(8133).Z+"",width:"1247",height:"829"})}),"\n",(0,n.jsx)(t.h2,{id:"graph-window-management",children:"Graph Window Management"}),"\n",(0,n.jsx)(t.p,{children:"All graphs can be moved around the browser window by clicking their title bar and moving them. Other graphs will move around intelligently to fill the space. This allows you order the graphs no matter which order they were created in."}),"\n",(0,n.jsx)(t.p,{children:"Each graph has a set of window buttons in the upper right corner. The first shrinks or grows the graph both horizontally and vertically to allow for 4 graphs in the same browser tab. Note that half height graphs no longer show the overview graph."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Four Graphs",src:i(3032).Z+"",width:"1247",height:"710"})}),"\n",(0,n.jsx)(t.p,{children:"The second button shrinks or grows the graph horizontally so it will either be half or full width of the browser window. This allows for two full width graphs on top of each other."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Two Full Width",src:i(5813).Z+"",width:"1247",height:"833"})}),"\n",(0,n.jsx)(t.p,{children:"The second button shrinks or grows the graph vertically so it will either be half or full height of the browser window. This allows for two full height graphs side by side."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Two Full Height",src:i(9038).Z+"",width:"1247",height:"833"})}),"\n",(0,n.jsx)(t.p,{children:"The line button minimizes the graph to effectively hide it. This allows you to focus on a single graph without losing existing graphs."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Minimized",src:i(8171).Z+"",width:"1247",height:"833"})}),"\n",(0,n.jsx)(t.p,{children:"The final X button closes the graph."})]})}function c(e={}){let{wrapper:t}={...(0,s.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(d,{...e})}):d(e)}},857:function(e,t,i){i.d(t,{Z:()=>a});let a=i.p+"assets/images/file_menu-1c05cfc08f9d07b3f7122d2fe1ad98ed428dc563d2c5d2edddbed71f46779eb8.png"},9309:function(e,t,i){i.d(t,{Z:()=>a});let a=i.p+"assets/images/graph_menu-289cbbb168622f661c1c98a7bd2c1b43f888e9c3560ba4e1d435ab62d0aad6de.png"},8422:function(e,t,i){i.d(t,{Z:()=>a});let a=i.p+"assets/images/edit_graph-9618076f837e0d358ea0bfbf503d43b377805d818370405536f5a1c049209e99.png"},3032:function(e,t,i){i.d(t,{Z:()=>a});let a=i.p+"assets/images/four_graphs-1aa5a7cb9ce51cec815fc9d8740b40e113bd171c4977711d47ef1e6daf02719e.png"},7708:function(e,t,i){i.d(t,{Z:()=>a});let a=i.p+"assets/images/graph_min_max-75be4a19a7e13a1b9b7a18a9b898b170c8ded7768b01ce6c6effd566ac8e071a.png"},8813:function(e,t,i){i.d(t,{Z:()=>a});let a=i.p+"assets/images/graph_temp1-028d8660c779136ff017b0b8a9fadb294e9ff478a65d7bd73032c3c2ed4f03d0.png"},8133:function(e,t,i){i.d(t,{Z:()=>a});let a=i.p+"assets/images/graph_temp1_temp2-ad650da0ddf1fb5c6e9764b737bfab3027f5abcb935ad86d9716dfdf13032dca.png"},4854:function(e,t,i){i.d(t,{Z:()=>a});let a=i.p+"assets/images/graph_temp1_time-53c18518755d1d1c816db7f0a67e26c5408aba32b644fda519b5ecf7a7ee9b27.png"},8171:function(e,t,i){i.d(t,{Z:()=>a});let a=i.p+"assets/images/minimized-47ddb9b9b68b47aae3d0a12cb39ab767adf446acbe213c0b5565c1bfaf8a463f.png"},2603:function(e,t,i){i.d(t,{Z:()=>a});let a=i.p+"assets/images/telemetry_grapher-3a37c074a25b7912a76d96fd46a1431d27202d71374f78c829f273e5cb342233.png"},9038:function(e,t,i){i.d(t,{Z:()=>a});let a=i.p+"assets/images/two_full_height-ccba2940b80345f3569ea47b7ddd3390c08195de91559f5586f85e36e411afd6.png"},5813:function(e,t,i){i.d(t,{Z:()=>a});let a=i.p+"assets/images/two_full_width-0116adbf994500a24d4717e002d32098f8d6197bcece510b84b90400f23feade.png"},2840:function(e,t,i){i.d(t,{Z:()=>l,a:()=>r});var a=i(2784);let n={},s=a.createContext(n);function r(e){let t=a.useContext(s);return a.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:r(e.components),a.createElement(s.Provider,{value:t},e.children)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["602"],{8540:function(e,n,i){i.r(n),i.d(n,{frontMatter:()=>r,default:()=>d,toc:()=>a,metadata:()=>t,assets:()=>l,contentTitle:()=>c});var t=JSON.parse('{"id":"development/curl","title":"Testing with Curl","description":"How to use Curl to hit the COSMOS APIs","source":"@site/docs/development/curl.md","sourceDirName":"development","slug":"/development/curl","permalink":"/tools/staticdocs/docs/development/curl","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/development/curl.md","tags":[],"version":"current","frontMatter":{"title":"Testing with Curl","description":"How to use Curl to hit the COSMOS APIs","sidebar_custom_props":{"myEmoji":"\uD83C\uDF0A"}},"sidebar":"defaultSidebar","previous":{"title":"Development","permalink":"/tools/staticdocs/docs/development"},"next":{"title":"Developing COSMOS","permalink":"/tools/staticdocs/docs/development/developing"}}'),s=i(2322),o=i(2840);let r={title:"Testing with Curl",description:"How to use Curl to hit the COSMOS APIs",sidebar_custom_props:{myEmoji:"\uD83C\uDF0A"}},c=void 0,l={},a=[{value:"Curl Example with OpenC3 COSMOS Core",id:"curl-example-with-openc3-cosmos-core",level:2},{value:"Curl Example with OpenC3 COSMOS Enterprise",id:"curl-example-with-openc3-cosmos-enterprise",level:2},{value:"Suite Runner Example",id:"suite-runner-example",level:2}];function p(e){let n={admonition:"admonition",code:"code",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",ul:"ul",...(0,o.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.admonition,{title:"This documentation is for COSMOS Developers",type:"note",children:(0,s.jsx)(n.p,{children:"This information is just generally used behind the scenes in COSMOS tools"})}),"\n",(0,s.jsx)(n.p,{children:"The COSMOS APIs are all served over HTTP, which means you can use curl to experiment with them. Curl is a great tool for seeing exactly how the API responds to any given request."}),"\n",(0,s.jsx)(n.h2,{id:"curl-example-with-openc3-cosmos-core",children:"Curl Example with OpenC3 COSMOS Core"}),"\n",(0,s.jsx)(n.p,{children:"OpenC3 COSMOS Core just has a single user account, so all you need to do is pass the single password as the token with your requests like this."}),"\n",(0,s.jsx)(n.p,{children:"Request:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:'curl -i -H "Content-Type: application/json-rpc" -H "Authorization: password" -d \'{"jsonrpc": "2.0", "method": "tlm", "params": ["INST HEALTH_STATUS TEMP1"], "keyword_params": {"scope": "DEFAULT"}, "id": 8}\' -X POST http://127.0.0.1:2900/openc3-api/api\n'})}),"\n",(0,s.jsx)(n.p,{children:"Response:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:'HTTP/1.1 200 OK\nCache-Control: max-age=0, private, must-revalidate\nContent-Length: 51\nContent-Type: application/json-rpc\nEtag: W/"e806aacfdbed0b325e7a5928e3bb5cf4"\nVary: Origin\nX-Request-Id: bbad6c6b-6d22-4374-a86f-b5b0b95e6939\nX-Runtime: 0.059044\nDate: Sat, 04 Nov 2023 21:34:47 GMT\n\n{"jsonrpc":"2.0","id":8,"result":53.26555000000001}\n'})}),"\n",(0,s.jsx)(n.h2,{id:"curl-example-with-openc3-cosmos-enterprise",children:"Curl Example with OpenC3 COSMOS Enterprise"}),"\n",(0,s.jsx)(n.p,{children:"OpenC3 COSMOS Enterprise uses the Keycloak Single Sign-on system, so you must first request a token from Keycloak using a username and password pair, before you make requests. By default this token will expire in 5 minutes, and will need to be refreshed if it expires before your next request."}),"\n",(0,s.jsx)(n.p,{children:"Keycloak Request:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"# Get tokens from Keycloak - You will need to update the username and password with your account\ncurl -i -H \"Content-Type: application/x-www-form-urlencoded\" -d 'username=operator&password=operator&client_id=api&grant_type=password&scope=openid' -X POST http://127.0.0.1:2900/auth/realms/openc3/protocol/openid-connect/token\n"})}),"\n",(0,s.jsx)(n.p,{children:"Keycloak Response:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:'HTTP/1.1 200 OK\nCache-Control: no-store\nContent-Length: 3207\nContent-Type: application/json\nPragma: no-cache\nReferrer-Policy: no-referrer\nSet-Cookie: KEYCLOAK_LOCALE=; Version=1; Comment=Expiring cookie; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Max-Age=0; Path=/auth/realms/openc3/; HttpOnly\nSet-Cookie: KC_RESTART=; Version=1; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Max-Age=0; Path=/auth/realms/openc3/; HttpOnly\nStrict-Transport-Security: max-age=31536000; includeSubDomains\nX-Content-Type-Options: nosniff\nX-Frame-Options: SAMEORIGIN\nX-Xss-Protection: 1; mode=block\nDate: Wed, 10 May 2023 00:40:40 GMT\n\n{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJ0cDlERmpNZGFXMy16WXptdlBqVTZnNTVqMVNhWGhkZHJqU0szQVNvaDhVIn0.eyJleHAiOjE2ODM2Nzk1NDAsImlhdCI6MTY4MzY3OTI0MCwianRpIjoiZmVlOTQwYWYtZDY3Ny00MWUyLWIzNWYtZDI5ODhiM2RhZGQ2IiwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDoyOTAwL2F1dGgvcmVhbG1zL29wZW5jMyIsInN1YiI6ImFjZTFlNmExLTkzMTktNDc2ZS1iZjQzLTZmM2NhYjllZTJkZSIsInR5cCI6IkJlYXJlciIsImF6cCI6ImFwaSIsInNlc3Npb25fc3RhdGUiOiJmMzc4NTk2Ny0yYTQ2LTRjMTItYWQwYy1jZmY3ZmM0NzdkZjkiLCJhY3IiOiIxIiwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbImRlZmF1bHQtcm9sZXMtb3BlbmMzIiwiQUxMU0NPUEVTX19vcGVyYXRvciIsIm9mZmxpbmVfYWNjZXNzIiwiQUxMU0NPUEVTX192aWV3ZXIiXX0sInNjb3BlIjoib3BlbmlkIHByb2ZpbGUgZW1haWwiLCJzaWQiOiJmMzc4NTk2Ny0yYTQ2LTRjMTItYWQwYy1jZmY3ZmM0NzdkZjkiLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsIm5hbWUiOiJUaGUgT3BlcmF0b3IiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJvcGVyYXRvciIsImdpdmVuX25hbWUiOiJUaGUiLCJmYW1pbHlfbmFtZSI6Ik9wZXJhdG9yIn0.eSqSeZrmCTahwltz5jsu5r3w6W15T5h0BvIdqKWQBDcnxAcxKuT-Nwziw_ewySSgHeC172CIWJUpHVp8ACDQG-dfW4KkvA6AcGfSF_f8TBH_rZrVQwlvwwzdA_egGKzhZWcnAC8TDjXRxuaWmnOgWT0aaHZAoW8EvwmKp-1IVz2l0B-hqzfC7dkjMrCI1udLfDvDBza9OtuR-FnKGt8h4nYnRzr8pO2jwebPFyZlR00gVsyK-b411XqprpT-qpRObYZwH5womA-8xIiwRZj9dsfQ1TaHGFkp1LNzxcj_r6pfwVO263bohbeU7ImezQdbvGLJ9NHaglzVNroTui4BXA","expires_in":300,"refresh_expires_in":1800,"refresh_token":"eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI5NjNlMjJiMS0wZmYwLTRmZjktYTg0Zi1hOGI4MzcxOWFiMDEifQ.eyJleHAiOjE2ODM2ODEwNDAsImlhdCI6MTY4MzY3OTI0MCwianRpIjoiMmQyYjIyNmItNjJkOS00YjRjLWI3YTYtMGEwYjk4MGQyMjMwIiwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDoyOTAwL2F1dGgvcmVhbG1zL29wZW5jMyIsImF1ZCI6Imh0dHA6Ly9sb2NhbGhvc3Q6MjkwMC9hdXRoL3JlYWxtcy9vcGVuYzMiLCJzdWIiOiJhY2UxZTZhMS05MzE5LTQ3NmUtYmY0My02ZjNjYWI5ZWUyZGUiLCJ0eXAiOiJSZWZyZXNoIiwiYXpwIjoiYXBpIiwic2Vzc2lvbl9zdGF0ZSI6ImYzNzg1OTY3LTJhNDYtNGMxMi1hZDBjLWNmZjdmYzQ3N2RmOSIsInNjb3BlIjoib3BlbmlkIHByb2ZpbGUgZW1haWwiLCJzaWQiOiJmMzc4NTk2Ny0yYTQ2LTRjMTItYWQwYy1jZmY3ZmM0NzdkZjkifQ.1HlKdxQkaL5tYuHTXsOceLZFmNNLl9BjoA4oUl70x9M","token_type":"Bearer","id_token":"eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJ0cDlERmpNZGFXMy16WXptdlBqVTZnNTVqMVNhWGhkZHJqU0szQVNvaDhVIn0.eyJleHAiOjE2ODM2Nzk1NDAsImlhdCI6MTY4MzY3OTI0MCwiYXV0aF90aW1lIjowLCJqdGkiOiJhNDJkOTY1ZS1lMzU0LTRiM2QtOTIyYS1hOWE0ZDgwZWYxMTkiLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjI5MDAvYXV0aC9yZWFsbXMvb3BlbmMzIiwiYXVkIjoiYXBpIiwic3ViIjoiYWNlMWU2YTEtOTMxOS00NzZlLWJmNDMtNmYzY2FiOWVlMmRlIiwidHlwIjoiSUQiLCJhenAiOiJhcGkiLCJzZXNzaW9uX3N0YXRlIjoiZjM3ODU5NjctMmE0Ni00YzEyLWFkMGMtY2ZmN2ZjNDc3ZGY5IiwiYXRfaGFzaCI6IjNBWE9ISkFKYzFPVldLd2Y0a0Q4TkEiLCJhY3IiOiIxIiwic2lkIjoiZjM3ODU5NjctMmE0Ni00YzEyLWFkMGMtY2ZmN2ZjNDc3ZGY5IiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJuYW1lIjoiVGhlIE9wZXJhdG9yIiwicHJlZmVycmVkX3VzZXJuYW1lIjoib3BlcmF0b3IiLCJnaXZlbl9uYW1lIjoiVGhlIiwiZmFtaWx5X25hbWUiOiJPcGVyYXRvciJ9.gdLl6KOKIIAdl6jYEuAXQrGCNvuwLQb3RDnwrHJdqyFXshiwofBiLMFreRsIE-33xXWNBU6pnSLQHPVlQU5Vmzlk0IOfk-b4yNq0dNa1TV1kmnxRl8w1ulTQYVZjdsN-oyLNwe0v3aJcYtbvIA3DP8rgO6bVv0ogkjWtlda6MbkyZN-har8x3raUVSlUPRP2Basy1xSMNNA1jvB-nEM-aubrUZE6r0PjI6PE1hbLPmuPbcX3uuIwXu2-UoXepkB8H7omUuMm-S98aHpRarwszC0mmHD5b_wiXusMVw4xYw8eavFue4zfw-T2IKuTVtxbMTygXIah6iqi4gkpL8Mx1w","not-before-policy":0,"session_state":"f3785967-2a46-4c12-ad0c-cff7fc477df9","scope":"openid profile email"}\n'})}),"\n",(0,s.jsx)(n.p,{children:"COSMOS Request:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:'# COSMOS Request now looks like this:\n\ncurl -i -H "Content-Type: application/json-rpc" -H "Authorization: eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJ0cDlERmpNZGFXMy16WXptdlBqVTZnNTVqMVNhWGhkZHJqU0szQVNvaDhVIn0.eyJleHAiOjE2ODM2Nzk1NDAsImlhdCI6MTY4MzY3OTI0MCwianRpIjoiZmVlOTQwYWYtZDY3Ny00MWUyLWIzNWYtZDI5ODhiM2RhZGQ2IiwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDoyOTAwL2F1dGgvcmVhbG1zL29wZW5jMyIsInN1YiI6ImFjZTFlNmExLTkzMTktNDc2ZS1iZjQzLTZmM2NhYjllZTJkZSIsInR5cCI6IkJlYXJlciIsImF6cCI6ImFwaSIsInNlc3Npb25fc3RhdGUiOiJmMzc4NTk2Ny0yYTQ2LTRjMTItYWQwYy1jZmY3ZmM0NzdkZjkiLCJhY3IiOiIxIiwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbImRlZmF1bHQtcm9sZXMtb3BlbmMzIiwiQUxMU0NPUEVTX19vcGVyYXRvciIsIm9mZmxpbmVfYWNjZXNzIiwiQUxMU0NPUEVTX192aWV3ZXIiXX0sInNjb3BlIjoib3BlbmlkIHByb2ZpbGUgZW1haWwiLCJzaWQiOiJmMzc4NTk2Ny0yYTQ2LTRjMTItYWQwYy1jZmY3ZmM0NzdkZjkiLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsIm5hbWUiOiJUaGUgT3BlcmF0b3IiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJvcGVyYXRvciIsImdpdmVuX25hbWUiOiJUaGUiLCJmYW1pbHlfbmFtZSI6Ik9wZXJhdG9yIn0.eSqSeZrmCTahwltz5jsu5r3w6W15T5h0BvIdqKWQBDcnxAcxKuT-Nwziw_ewySSgHeC172CIWJUpHVp8ACDQG-dfW4KkvA6AcGfSF_f8TBH_rZrVQwlvwwzdA_egGKzhZWcnAC8TDjXRxuaWmnOgWT0aaHZAoW8EvwmKp-1IVz2l0B-hqzfC7dkjMrCI1udLfDvDBza9OtuR-FnKGt8h4nYnRzr8pO2jwebPFyZlR00gVsyK-b411XqprpT-qpRObYZwH5womA-8xIiwRZj9dsfQ1TaHGFkp1LNzxcj_r6pfwVO263bohbeU7ImezQdbvGLJ9NHaglzVNroTui4BXA" -d \'{"jsonrpc": "2.0", "method": "tlm", "params": ["INST HEALTH_STATUS TEMP1"], "keyword_params": {"scope": "DEFAULT"}, "id": 8}\' -X POST http://127.0.0.1:2900/openc3-api/api\n'})}),"\n",(0,s.jsx)(n.p,{children:"COSMOS Response:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:'HTTP/1.1 200 OK\nCache-Control: max-age=0, private, must-revalidate\nContent-Type: application/json-rpc\nEtag: W/"1e44c0878528687014e1e60a1cbebdae"\nVary: Origin\nX-Request-Id: 47a8dd26-1348-4693-8df1-5375f60abc6c\nX-Runtime: 0.046477\nDate: Wed, 10 May 2023 00:41:33 GMT\nTransfer-Encoding: chunked\n\n{"jsonrpc":"2.0","id":8,"result":29.204100000000007}\n'})}),"\n",(0,s.jsx)(n.h2,{id:"suite-runner-example",children:"Suite Runner Example"}),"\n",(0,s.jsxs)(n.p,{children:["It can be very useful to run the a suite or script remotely from a continuous testing server. COSMOS' REST API allows for this. To figure out what is required to run a certain task on the web GUI you can open up your browser's developer tools to monitor the network traffic. You will see all the requests and responses required to run a command and you can reformat them yourself to suit your own purposes. Below is an example of running a test script from a Chromium-based browser:\n",(0,s.jsx)(n.img,{src:"https://github.com/OpenC3/cosmos/assets/55999897/df642d42-43e0-47f9-9b52-d42746d9746b",alt:"Network Traffic in browser developer tools"})]}),"\n",(0,s.jsxs)(n.p,{children:['You can see that there are 5 transactions total. To investigate just right-click on the network transaction and click "copy as ',(0,s.jsx)(n.code,{children:"curl"}),'" (depends on the browser). Here is an example of the second one:']}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"curl 'http://localhost:2900/script-api/scripts/TARGET/procedures/cmd_tlm_test.rb/lock?scope=DEFAULT' \\\n -X 'POST' \\\n -H 'Accept: application/json' \\\n -H 'Accept-Language: en-US,en;q=0.9' \\\n -H 'Authorization: pass' \\\n -H 'Connection: keep-alive' \\\n -H 'Content-Length: 0' \\\n -H 'Origin: http://ascportal:2900' \\\n -H 'Referer: http://localhost:2900/tools/scriptrunner/?file=TARGET%2Fprocedures%2Fcmd_tlm_test.rb' \\\n -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0' \\\n --insecure\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Many of the browser-specific headers are not required. The important thing to notice here is the URL and the request (in this case ",(0,s.jsx)(n.code,{children:"POST"}),"). If we inspect all of these we'll find out what each one does:"]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["Set the script contents","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"this updates any local changes)"}),"\n",(0,s.jsxs)(n.li,{children:["Note that this is a different request to ",(0,s.jsx)(n.code,{children:"GET"})," the script contents. This is done on the page load."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.li,{children:"Lock the script (so other users can't edit it during execution)"}),"\n",(0,s.jsx)(n.li,{children:"Run script (this takes a JSON with options)"}),"\n",(0,s.jsx)(n.li,{children:"Open Websocket for logs"}),"\n",(0,s.jsx)(n.li,{children:"Request Result (this URL is a little different because the results are saved in redis)"}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["Below is a bash script which does all the above given some options. It requires ",(0,s.jsx)(n.code,{children:"curl"})," for the web requests and ",(0,s.jsx)(n.code,{children:"jq"})," for JSON parsing and formatting. It locks and runs the script, continually checks its status, then requests the result."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:'#!/bin/bash\nset -e\nTARGET=${1:-\'TARGET\'}\nSCRIPT=${2:-\'procedures/cmd_tlm_test.rb\'}\nSUITE=${3:-\'TestSuite\'}\nCOSMOS_HOST=\'http://localhost:2900\'\nSCRIPT_API="$COSMOS_HOST/script-api"\nSCRIPT_PATH="scripts/$TARGET/$SCRIPT"\nCURL_ARGS=(\n -H \'Accept: application/json\'\n -H \'Authorization: password\'\n -H \'Accept-Language: en-US,en;q=0.9\'\n -H \'Connection: keep-alive\'\n -H \'Content-Type: application/json\'\n --insecure\n --silent )\n\n# Lock script #\ncurl "$SCRIPT_API/$SCRIPT_PATH/lock?scope=DEFAULT" -X "POST" "${CURL_ARGS[@]}"\n\n# Run script #\nRUN_OPTS=$(cat <<-json\n{\n "environment": [],\n "suiteRunner": {\n "method": "start",\n "suite": "$SUITE",\n "options": [\n "continueAfterError"\n ]\n }\n}\njson\n)\nRUN_OPTS=$(<<<"$RUN_OPTS" jq -rc .)\nID=$(curl "$SCRIPT_API/$SCRIPT_PATH/run?scope=DEFAULT" --data-raw "$RUN_OPTS" "${CURL_ARGS[@]}")\n\necho "Starting Script \'$SCRIPT_PATH\' at $(date) (may take up to 15 minutes)" > /dev/stderr\necho "You can monitor it in Script Runner here: $COSMOS_HOST/tools/scriptrunner/$ID" > /dev/stderr\n# Loop while Script ID is still running #\nwhile true; do\n SCRIPT_STATUS="$(curl "$SCRIPT_API/running-script?scope=DEFAULT" "${CURL_ARGS[@]}" | jq ".[]|select(.id==$ID)")"\n if [[ -z $SCRIPT_STATUS ]]; then\n break;\n fi\n sleep 2\ndone\n\n# Request results #\nBUCKET_FILE_URI="$(curl "$SCRIPT_API/completed-scripts?scope=DEFAULT" "${CURL_ARGS[@]}" |\\\n jq \'[.[]|select(.name | test("\'"${SCRIPT_PATH#scripts/}"\' "))][0] | .log | @uri\' -r)"\n\nURL="$(curl "$COSMOS_HOST/openc3-api/storage/download/$BUCKET_FILE_URI?bucket=OPENC3_LOGS_BUCKET&scope=DEFAULT" "${CURL_ARGS[@]}" |jq .url -r)"\n\ncurl "$COSMOS_HOST$URL" "${CURL_ARGS[@]}"\n'})})]})}function d(e={}){let{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},2840:function(e,n,i){i.d(n,{Z:()=>c,a:()=>r});var t=i(2784);let s={},o=t.createContext(s);function r(e){let n=t.useContext(o);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),t.createElement(o.Provider,{value:n},e.children)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["8847"],{6094:function(e,n,t){t.r(n),t.d(n,{frontMatter:()=>a,default:()=>h,toc:()=>c,metadata:()=>i,assets:()=>l,contentTitle:()=>o});var i=JSON.parse('{"id":"guides/script-writing","title":"Script Writing Guide","description":"Key concepts and best practices for script writing","source":"@site/docs/guides/script-writing.md","sourceDirName":"guides","slug":"/guides/script-writing","permalink":"/tools/staticdocs/docs/guides/script-writing","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/guides/script-writing.md","tags":[],"version":"current","frontMatter":{"title":"Script Writing Guide","description":"Key concepts and best practices for script writing","sidebar_custom_props":{"myEmoji":"\uD83C\uDFC3\u200D\u27A1\uFE0F"}},"sidebar":"defaultSidebar","previous":{"title":"Reference Architectures","permalink":"/tools/staticdocs/docs/guides/reference-architectures"},"next":{"title":"Scripting API Guide","permalink":"/tools/staticdocs/docs/guides/scripting-api"}}'),s=t(2322),r=t(2840);let a={title:"Script Writing Guide",description:"Key concepts and best practices for script writing",sidebar_custom_props:{myEmoji:"\uD83C\uDFC3\u200D\u27A1\uFE0F"}},o=void 0,l={},c=[{value:"Introduction",id:"introduction",level:2},{value:"Concepts",id:"concepts",level:2},{value:"Ruby vs Python in COSMOS",id:"ruby-vs-python-in-cosmos",level:3},{value:"Scripting Philosophy",id:"scripting-philosophy",level:2},{value:"A Super Basic Script Example",id:"a-super-basic-script-example",level:3},{value:"KISS (Keep It Simple Stupid)",id:"kiss-keep-it-simple-stupid",level:3},{value:"Keep things DRY (Don&#39;t Repeat Yourself)",id:"keep-things-dry-dont-repeat-yourself",level:3},{value:"Use Comments Appropriately",id:"use-comments-appropriately",level:3},{value:"Script Runner",id:"script-runner",level:3},{value:"Looping vs Unrolled Loops",id:"looping-vs-unrolled-loops",level:3},{value:"Script Organization",id:"script-organization",level:2},{value:"Organizing Your Scripts into a Plugin",id:"organizing-your-scripts-into-a-plugin",level:3},{value:"Organize Scripts into Methods",id:"organize-scripts-into-methods",level:3},{value:"Using Classes vs Unscoped Methods",id:"using-classes-vs-unscoped-methods",level:3},{value:"Instrumented vs Uninstrumented Lines (require vs load)",id:"instrumented-vs-uninstrumented-lines-require-vs-load",level:3},{value:"Debugging and Auditing",id:"debugging-and-auditing",level:2},{value:"Built-In Debugging Capabilities",id:"built-in-debugging-capabilities",level:3},{value:"Breakpoints",id:"breakpoints",level:3},{value:"Using Disconnect Mode",id:"using-disconnect-mode",level:3},{value:"Auditing your Scripts",id:"auditing-your-scripts",level:3},{value:"Ruby Syntax Check",id:"ruby-syntax-check",level:4},{value:"Common Scenarios",id:"common-scenarios",level:2},{value:"User Input Best Practices",id:"user-input-best-practices",level:3},{value:"Conditionally Require Manual User Input Steps",id:"conditionally-require-manual-user-input-steps",level:3},{value:"Outputting Extra Information to a Report",id:"outputting-extra-information-to-a-report",level:3},{value:"Getting the Most Recent Value of a Telemetry Point from Multiple Packets",id:"getting-the-most-recent-value-of-a-telemetry-point-from-multiple-packets",level:3},{value:"Checking Every Single Sample of a Telemetry Point",id:"checking-every-single-sample-of-a-telemetry-point",level:3},{value:"Using Variables in Mnemonics",id:"using-variables-in-mnemonics",level:3},{value:"Using Custom wait_check_expression",id:"using-custom-wait_check_expression",level:3},{value:"COSMOS Scripting Differences from Regular Ruby Scripting",id:"cosmos-scripting-differences-from-regular-ruby-scripting",level:3},{value:"Do not use single line if statements",id:"do-not-use-single-line-if-statements",level:4},{value:"When Things Go Wrong",id:"when-things-go-wrong",level:2},{value:"Common Reasons Checks Fail",id:"common-reasons-checks-fail",level:3},{value:"How to Recover from Anomalies",id:"how-to-recover-from-anomalies",level:3},{value:"Advanced Topics",id:"advanced-topics",level:2},{value:"Advanced Script Configuration with CSV or Excel",id:"advanced-script-configuration-with-csv-or-excel",level:3},{value:"When to use Ruby Modules",id:"when-to-use-ruby-modules",level:3}];function d(e){let n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h2,{id:"introduction",children:"Introduction"}),"\n",(0,s.jsx)(n.p,{children:"This guide aims to provide the best practices for using the scripting capabilities provided by COSMOS. Scripts are used to automate a series of activities for operations or testing. The goal of this document is to ensure scripts are written that are simple, easy to understand, maintainable, and correct. Guidance on some of the key details of using the COSMOS Script Runner is also provided."}),"\n",(0,s.jsx)(n.h2,{id:"concepts",children:"Concepts"}),"\n",(0,s.jsx)(n.p,{children:"COSMOS supports both Ruby and Python for writing scripts. Ruby and Python are very similar scripting languages and most of this guide applies directly to both. Where examples are used, both a Ruby and Python example are given."}),"\n",(0,s.jsx)(n.h3,{id:"ruby-vs-python-in-cosmos",children:"Ruby vs Python in COSMOS"}),"\n",(0,s.jsx)(n.p,{children:"There are many similarities and a few key differences between Ruby and Python when it comes to writing COSMOS scripts."}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsx)(n.li,{children:"There is no 80 character limit on line length. Lines can be as long as you like, but be careful to not make them too long as it makes printed reviews of scripts more difficult."}),"\n",(0,s.jsxs)(n.li,{children:["Indentation white space:","\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["Ruby: Not significant. Ruby uses the ",(0,s.jsx)(n.code,{children:"end"})," keyword to determine indented code blocks with a standard of 2 spaces."]}),"\n",(0,s.jsx)(n.li,{children:"Python: Significant. Python uses indentation to determine code blocks with a standard of 4 spaces."}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.li,{children:"Variables do not have to be declared ahead of time and can be reassigned later, i.e. Ruby and Python are dynamically typed."}),"\n",(0,s.jsxs)(n.li,{children:["Variable interpolation:","\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["Ruby: Variable values can be placed into strings using the ",(0,s.jsx)(n.code,{children:'"#{variable}"'})," syntax."]}),"\n",(0,s.jsxs)(n.li,{children:["Python: Variable values can be placed into f-strings using the ",(0,s.jsx)(n.code,{children:'f"{variable}"'})," syntax."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.li,{children:"A variable declared inside of a block or loop will not exist outside of that block unless it was already declared."}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"Both languages provides a script writer a lot of power. But with great power comes great responsibility. Remember when writing your scripts that you or someone else will come along later and need to understand them. Therefore use the following style guidelines:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Use consistent spacing for indentation and do NOT use tabs"}),"\n",(0,s.jsxs)(n.li,{children:["Constants should be all caps with underscores","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"SPEED_OF_LIGHT = 299792458 # meters per s"})}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["Variable names and method names should be in lowercase with underscores","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:'last_name = "Smith"'})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"perform_setup_operation()"})}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["Class names (when used) should be camel case and the files which contain them should match but be lowercase with underscores","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"class DataUploader # in 'data_uploader.rb'"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"class CcsdsUtility: # in 'ccsds_utility.py'"})}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.li,{children:"Don't add useless comments but instead describe intent"}),"\n"]}),"\n",(0,s.jsx)("div",{style:{clear:"both"}}),"\n",(0,s.jsx)(n.p,{children:"The following is an example of good Ruby style:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:"load 'TARGET/lib/upload_utility.rb' # library we do NOT want to show executing\nload_utility 'TARGET/lib/helper_utility.rb' # library we do want to show executing\n\n# Declare constants\nOUR_TARGETS = ['INST','INST2']\n\n# Clear the collect counter of the passed in target name\ndef clear_collects(target)\n cmd(\"#{target} CLEAR\")\n wait_check(\"#{target} HEALTH_STATUS COLLECTS == 0\", 5)\nend\n\n######################################\n# START\n######################################\nhelper = HelperUtility.new\nhelper.setup\n\n# Perform collects on all the targets\nOUR_TARGETS.each do |target|\n collects = tlm(\"#{target} HEALTH_STATUS COLLECTS\")\n cmd(\"#{target} COLLECT with TYPE SPECIAL\")\n wait_check(\"#{target} HEALTH_STATUS COLLECTS == #{collects + 1}\", 5)\nend\n\nclear_collects('INST')\nclear_collects('INST2')\n"})}),"\n",(0,s.jsx)(n.p,{children:"The following is an example of good Python style:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"from openc3.script import *\n\nimport TARGET.lib.upload_utility # library we do NOT want to show executing\nload_utility('TARGET/lib/helper_utility.rb') # library we do want to show executing\n\n# Declare constants\nOUR_TARGETS = ['INST','INST2']\n\n# Clear the collect counter of the passed in target name\ndef clear_collects(target):\n cmd(f\"{target} CLEAR\")\n wait_check(f\"{target} HEALTH_STATUS COLLECTS == 0\", 5)\n\n######################################\n# START\n######################################\nhelper = HelperUtility()\nhelper.setup()\n\n# Perform collects on all the targets\nfor target in OUR_TARGETS:\n collects = tlm(f\"{target} HEALTH_STATUS COLLECTS\")\n cmd(f\"{target} COLLECT with TYPE SPECIAL\")\n wait_check(f\"{target} HEALTH_STATUS COLLECTS == {collects + 1}\", 5)\n\nclear_collects('INST')\nclear_collects('INST2')\n"})}),"\n",(0,s.jsx)(n.p,{children:"Both examples shows several features of COSMOS scripting in action. Notice the difference between 'load' or 'import' and 'load_utility'. The first is to load additional scripts which will NOT be shown in Script Runner when executing. This is a good place to put code which takes a long time to run such as image analysis or other looping code where you just want the output. 'load_utility' will visually execute the code line by line to show the user what is happening."}),"\n",(0,s.jsx)(n.p,{children:"Next we declare our constants and create an array of strings which we store in OUR_TARGETS. Notice the constant is all uppercase with underscores."}),"\n",(0,s.jsx)(n.p,{children:"Then we declare our local methods of which we have one called clear_collects. Please provide a comment at the beginning of each method describing what it does and the parameters that it takes."}),"\n",(0,s.jsx)(n.p,{children:"The 'helper_utility' is then created. Note the similarity in the class name and the file name we loaded."}),"\n",(0,s.jsxs)(n.p,{children:["The collect example shows how you can iterate over the array of strings we previously created and use variables when commanding and checking telemetry. The Ruby pound bracket #",' notation and python f-string f"'," notation puts whatever the variable holds into the string. You can even execute additional code inside the brackets like we do when checking for the collect count to increment."]}),"\n",(0,s.jsx)(n.p,{children:"Finally we call our 'clear_collects' method on each target by passing the target name."}),"\n",(0,s.jsx)(n.h2,{id:"scripting-philosophy",children:"Scripting Philosophy"}),"\n",(0,s.jsx)(n.h3,{id:"a-super-basic-script-example",children:"A Super Basic Script Example"}),"\n",(0,s.jsx)(n.p,{children:"Most COSMOS scripts can be broken down into the simple pattern of sending a command to a system/subsystem and then verifying that the command worked as expected. This pattern is most commonly implemented with cmd() followed by wait_check(), like the following:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'cmd("INST COLLECT with TYPE NORMAL, TEMP 10.0")\nwait_check("INST HEALTH_STATUS TYPE == \'NORMAL\'", 5)\n'})}),"\n",(0,s.jsx)(n.p,{children:"or similarly with a counter that is sampled before the command."}),"\n",(0,s.jsx)(n.p,{children:"Ruby:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'count = tlm("INST HEALTH_STATUS COLLECTS")\ncmd("INST COLLECT with TYPE NORMAL, TEMP 10.0")\nwait_check("INST HEALTH_STATUS COLLECTS >= #{count + 1}", 5)\n'})}),"\n",(0,s.jsx)(n.p,{children:"Python:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:'count = tlm("INST HEALTH_STATUS COLLECTS")\ncmd("INST COLLECT with TYPE NORMAL, TEMP 10.0")\nwait_check(f"INST HEALTH_STATUS COLLECTS >= {count + 1}", 5)\n'})}),"\n",(0,s.jsx)(n.p,{children:"90% of the COSMOS scripts you write should be the simple patterns shown above except that you may need to check more than one item after each command to make sure the command worked as expected."}),"\n",(0,s.jsx)(n.h3,{id:"kiss-keep-it-simple-stupid",children:"KISS (Keep It Simple Stupid)"}),"\n",(0,s.jsx)(n.p,{children:"Ruby and Python are very powerful languages with many ways to accomplish the same thing. Given that, always choose the method that is easiest to understand for yourself and others. While it is possible to create complex one liners or obtuse regular expressions, you'll thank yourself later by expanding complex one liners and breaking up and documenting regular expressions."}),"\n",(0,s.jsx)(n.h3,{id:"keep-things-dry-dont-repeat-yourself",children:"Keep things DRY (Don't Repeat Yourself)"}),"\n",(0,s.jsx)(n.p,{children:"A widespread problem in scripts written for any command and control system is large blocks of code that are repeated multiple times. In extreme cases, this has led to 100,000+ line scripts that are impossible to maintain and review."}),"\n",(0,s.jsx)(n.p,{children:"There are two common ways repetition presents itself: exact blocks of code to perform a common action such as powering on a subsystem, and blocks of code that only differ in the name of the mnemonic being checked or the values checked against. Both are solved by removing the repetition using methods (or functions)."}),"\n",(0,s.jsx)(n.p,{children:"For example, a script that powers on a subsystem and ensures correct telemetry would become:"}),"\n",(0,s.jsx)(n.p,{children:"Ruby:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:"def power_on_subsystem\n # 100 lines of cmd(), wait_check(), etc\nend\n"})}),"\n",(0,s.jsx)(n.p,{children:"Python:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"def power_on_subsystem():\n # 100 lines of cmd(), wait_check(), etc\n"})}),"\n",(0,s.jsx)(n.p,{children:"Ideally, the above methods would be stored in another file where it could be used by other scripts. If it is truly only useful in the one script, then it could be at the top of the file. The updated script would then look like:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:"power_on_subsystem()\n# 150 lines operating the subsystem (e.g.)\n# cmd(...)\n# wait_check(...)\n#...\npower_off_subystem()\n# Unrelated activities\npower_on_subsystem()\n# etc.\n"})}),"\n",(0,s.jsx)(n.p,{children:"Blocks of code where only the only variation is the mnemonics or values checked can be replaced by methods with arguments."}),"\n",(0,s.jsx)(n.p,{children:"Ruby:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'def test_minimum_temp(enable_cmd_name, enable_tlm, temp_tlm, expected_temp)\n cmd("TARGET #{enable_cmd_name} with ENABLE TRUE")\n wait_check("TARGET #{enable_tlm} == \'TRUE\'", 5)\n wait_check("TARGET #{temp_tlm} >= #{expected_temp}", 50)\nend\n'})}),"\n",(0,s.jsx)(n.p,{children:"Python:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:'def test_minimum_temp(enable_cmd_name, enable_tlm, temp_tlm, expected_temp):\n cmd(f"TARGET {enable_cmd_name} with ENABLE TRUE")\n wait_check(f"TARGET {enable_tlm} == \'TRUE\'", 5)\n wait_check(f"TARGET {temp_tlm} >= {expected_temp}", 50)\n'})}),"\n",(0,s.jsx)(n.h3,{id:"use-comments-appropriately",children:"Use Comments Appropriately"}),"\n",(0,s.jsx)(n.p,{children:"Use comments when what you are doing is unclear or there is a higher-level purpose to a set of lines. Try to avoid putting numbers or other details in a comment as they can become out of sync with the underlying code. Ruby and Python comments start with a # pound symbol and can be anywhere on a line."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'# This line sends an abort command - BAD COMMENT, UNNECESSARY\ncmd("INST ABORT")\n# Rotate the gimbal to look at the calibration target - GOOD COMMENT\ncmd("INST ROTATE with ANGLE 180.0") # Rotate 180 degrees - BAD COMMENT\n'})}),"\n",(0,s.jsx)(n.h3,{id:"script-runner",children:"Script Runner"}),"\n",(0,s.jsx)(n.p,{children:"COSMOS provides two unique ways to run scripts (also known as procedures). Script Runner provides both a script execution environment and a script editor. The script editor includes code completion for both COSMOS methods and command/telemetry item names. It is also a great environment to develop and test scripts. Script Runner provides a framework for users that are familiar with a traditional scripting model with longer style procedures, and for users that want to be able to edit their scripts in place."}),"\n",(0,s.jsx)(n.p,{children:"When opening a suite file (named with 'suite') Script Runner provides a more formal, but also more powerful, environment for running scripts. Suite files breaks scripts down into suites, groups, and scripts (individual methods). Suites are the highest-level concept and would typically cover a large procedure such as a thermal vacuum test, or a large operations scenario such as performing on orbit checkout. Groups capture a related set of scripts such as all the scripts regarding a specific mechanism. A Group might be a collection of scripts all related to a subsystem, or a specific series of tests such as an RF checkout. Scripts capture individual activities that can either pass or fail. Script Runner allows for running an entire suite, one or more groups, or one or more scripts easily. It also automatically produces reports containing timing, pass / fail counts, etc."}),"\n",(0,s.jsx)(n.p,{children:"The correct environment for the job is up to individual users, and many programs will use both script formats to complete their goals."}),"\n",(0,s.jsx)(n.h3,{id:"looping-vs-unrolled-loops",children:"Looping vs Unrolled Loops"}),"\n",(0,s.jsx)(n.p,{children:"Loops are powerful constructs that allow you to perform the same operations multiple times without having to rewrite the same code over and over (See the DRY Concept). However, they can make restarting a COSMOS script at the point of a failure difficult or impossible. If there is a low probability of something failing, then loops are an excellent choice. If a script is running a loop over a list of telemetry points, it may be a better choice to \u201Cunroll\u201D the loop by making the loop body into a method, and then calling that method directly for each iteration of a loop that would have occurred."}),"\n",(0,s.jsx)(n.p,{children:"Ruby:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:"10.times do |temperature_number|\n check_temperature(temperature_number + 1)\nend\n"})}),"\n",(0,s.jsx)(n.p,{children:"Python:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"for temperature_number in range(1, 11):\n check_temperature(temperature_number)\n"})}),"\n",(0,s.jsx)(n.p,{children:"If the above script was stopped after temperature number 3, there would be no way to restart the loop at temperature number 4. A better solution for small loop counts is to unroll the loop."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:"check_temperature(1)\ncheck_temperature(2)\ncheck_temperature(3)\ncheck_temperature(4)\ncheck_temperature(5)\ncheck_temperature(6)\ncheck_temperature(7)\ncheck_temperature(8)\ncheck_temperature(9)\ncheck_temperature(10)\n"})}),"\n",(0,s.jsx)(n.p,{children:"In the unrolled version above, the COSMOS \u201CStart script at selected line\u201D feature can be used to resume the script at any point."}),"\n",(0,s.jsx)(n.h2,{id:"script-organization",children:"Script Organization"}),"\n",(0,s.jsxs)(n.p,{children:["All scripts must be part of a ",(0,s.jsx)(n.a,{href:"/tools/staticdocs/docs/configuration/plugins",children:"Plugin"}),". You can create a simple plugin called SCRIPTS or PROCEDURES that only contains lib and procedures directories to store scripts. If COSMOS detects a plugin without defined cmd/tlm it will not spawn microservices for telemetry processing."]}),"\n",(0,s.jsx)(n.h3,{id:"organizing-your-scripts-into-a-plugin",children:"Organizing Your Scripts into a Plugin"}),"\n",(0,s.jsx)(n.p,{children:"As your scripts become large with many methods, it makes sense to break them up into multiple files within a plugin. Here is a recommended organization for your plugin's scripts/procedures."}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Folder"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"targets/TARGET_NAME/lib"}),(0,s.jsx)(n.td,{children:"Place script files containing reusable target specific methods here"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"targets/TARGET_NAME/procedures"}),(0,s.jsx)(n.td,{children:"Place simple procedures that are centered around one specific target here"})]})]})]}),"\n",(0,s.jsx)(n.p,{children:"In your main procedure you will usually bring in the other files with instrumentation using load_utility."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:"# Ruby:\nload_utility('TARGET/lib/my_other_script.rb')\n# Python:\nload_utility('TARGET/procedures/my_other_script.py')\n"})}),"\n",(0,s.jsx)(n.h3,{id:"organize-scripts-into-methods",children:"Organize Scripts into Methods"}),"\n",(0,s.jsx)(n.p,{children:"Put each activity into a distinct method. Putting your scripts into methods makes organization easy and gives a great high-level overview of what the overall script does (assuming you name the methods well). There are no bonus points for vague, short method names. Make your method names long and clear."}),"\n",(0,s.jsx)(n.p,{children:"Ruby:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'def test_1_heater_zone_control\n puts "Verifies requirements 304, 306, and 310"\n # Test code here\nend\n\ndef script_1_heater_zone_control\n puts "Verifies requirements 304, 306, and 310"\n # Test code here\nend\n'})}),"\n",(0,s.jsx)(n.p,{children:"Python:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:'def test_1_heater_zone_control():\n print("Verifies requirements 304, 306, and 310")\n # Test code here\n\ndef script_1_heater_zone_control():\n print("Verifies requirements 304, 306, and 310")\n # Test code here\n'})}),"\n",(0,s.jsx)(n.h3,{id:"using-classes-vs-unscoped-methods",children:"Using Classes vs Unscoped Methods"}),"\n",(0,s.jsx)(n.p,{children:"Classes in object-oriented programming allow you to organize a set of related methods and some associated state. The most important aspect is that the methods work on some shared state. For example, if you have code that moves a gimbal around, and need to keep track of the number of moves, or steps, performed across methods, then that is a wonderful place to use a class. If you just need a helper method to do something that happens multiple times in a script without copy and pasting, it probably does not need to be in a class."}),"\n",(0,s.jsx)(n.p,{children:"NOTE: The convention in COSMOS is to have a TARGET/lib/target.[rb/py] file which is named after the TARGET name and contains a class called Target. This discussion refers to scripts in the TARGET/procedures directory."}),"\n",(0,s.jsx)(n.p,{children:"Ruby:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'class Gimbal\n attr_accessor :gimbal_steps\n def initialize()\n @gimbal_steps = 0\n end\n def move(steps_to_move)\n # Move the gimbal\n @gimbal_steps += steps_to_move\n end\n def home_gimbal\n # Home the gimbal\n @gimbal_steps = 0\n end\nend\n\ndef perform_common_math(x, y)\n x + y\nend\n\ngimbal = Gimbal.new\ngimbal.home_gimbal\ngimbal.move(100)\ngimbal.move(200)\nputs "Moved gimbal #{gimbal.gimbal_steps}"\nresult = perform_common_math(gimbal.gimbal_steps, 10)\nputs "Math:#{result}"\n'})}),"\n",(0,s.jsx)(n.p,{children:"Python:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:'class Gimbal:\n def __init__(self):\n self.gimbal_steps = 0\n\n def move(self, steps_to_move):\n # Move the gimbal\n self.gimbal_steps += steps_to_move\n\n def home_gimbal(self):\n # Home the gimbal\n self.gimbal_steps = 0\n\ndef perform_common_math(x, y):\n return x + y\n\ngimbal = Gimbal()\ngimbal.home_gimbal()\ngimbal.move(100)\ngimbal.move(200)\nprint(f"Moved gimbal {gimbal.gimbal_steps}")\nresult = perform_common_math(gimbal.gimbal_steps, 10)\nprint(f"Math:{result}")\n'})}),"\n",(0,s.jsx)(n.h3,{id:"instrumented-vs-uninstrumented-lines-require-vs-load",children:"Instrumented vs Uninstrumented Lines (require vs load)"}),"\n",(0,s.jsx)(n.p,{children:"COSMOS scripts are normally \u201Cinstrumented\u201D. This means that each line has some extra code added behind the scenes that primarily highlights the current executing line and catches exceptions if things fail such as a wait_check. If your script needs to use code in other files, there are a few ways to bring in that code. Some techniques bring in instrumented code and others bring in uninstrumented code. There are reasons to use both."}),"\n",(0,s.jsx)(n.p,{children:"load_utility (and the deprecated require_utility), bring in instrumented code from other files. When COSMOS runs the code in the other file, Script Runner will dive into the other file and show each line highlighted as it executes. This should be the default way to bring in other files, as it allows continuing if something fails, and provides better visibility to operators."}),"\n",(0,s.jsx)(n.p,{children:"However, sometimes you don't want to display code executing from other files. Externally developed libraries generally do not like to be instrumented, and code that contains large loops or that just takes a long time to execute when highlighting lines, will be much faster if included in a method that does not instrument lines. Ruby provides two ways to bring in uninstrumented code. The first is the \u201Cload\u201D keyword. Load will bring in the code from another file and will bring in any changes to the file if it is updated on the next call to load. \u201Crequire\u201D is like load but is optimized to only bring in the code from another file once. Therefore, if you use require and then change the file it requires, you must restart Script Runner to re-require the file and bring in the changes. In general, load is recommended over require for COSMOS scripting. One gotcha with load is that it requires the full filename including extension, while the require keyword does not."}),"\n",(0,s.jsx)(n.p,{children:"In Python, libraries are included using the import syntax. Any code imported using import is not instrumented. Only the code imported using load_utility is instrumented."}),"\n",(0,s.jsx)(n.p,{children:"Finally, COSMOS scripting has a special syntax for disabling instrumentation in the middle of an instrumented script, with the disable_instrumentation method. This allows you to disable instrumentation for large loops and other activities that are too slow when running instrumented."}),"\n",(0,s.jsx)(n.p,{children:"Ruby:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:"temp = 0\ndisable_instrumentation do\n # Make sure nothing in here will raise exceptions!\n 5000000.times do\n temp += 1\n end\nend\nputs temp\n"})}),"\n",(0,s.jsx)(n.p,{children:"Python:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"temp = 0\nwith disable_instrumentation():\n # Make sure nothing in here will raise exceptions!\n for x in range(0,5000000):\n temp += 1\nprint(temp)\n"})}),"\n",(0,s.jsx)(n.admonition,{title:"When Running Uninstrumented Code",type:"warning",children:(0,s.jsx)(n.p,{children:"Make sure that the code will not raise any exceptions or have any check failures. If an exception is raised from uninstrumented code, then your entire script will stop."})}),"\n",(0,s.jsx)(n.h2,{id:"debugging-and-auditing",children:"Debugging and Auditing"}),"\n",(0,s.jsx)(n.h3,{id:"built-in-debugging-capabilities",children:"Built-In Debugging Capabilities"}),"\n",(0,s.jsx)(n.p,{children:"Script Runner has built in debugging capabilities that can be useful in determining why your script is behaving in a certain way. Of primary importance is the ability to inspect and set script variables."}),"\n",(0,s.jsx)(n.p,{children:"To use the debugging functionality, first select the \u201CToggle Debug\u201D option from the Script Menu. This will add a small Debug: prompt to the bottom of the tool. Any code entered in this prompt will be executed when Enter is pressed. To inspect variables in a running script, pause the script and then type the variable name to print out the value of the variable in the debug prompt."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:"variable_name\n"})}),"\n",(0,s.jsx)(n.p,{children:"Variables can also be set simply by using equals."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:"variable_name = 5\n"})}),"\n",(0,s.jsx)(n.p,{children:"If necessary, you can also inject commands from the debug prompt using the normal commanding methods. These commands will be logged to the Script Runner message log, which may be advantageous over using a different COSMOS tool like CmdSender (where the command would only be logged in the CmdTlmServer message log)."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'cmd("INST COLLECT with TYPE NORMAL")\n'})}),"\n",(0,s.jsx)(n.p,{children:"Note that the debug prompt keeps the command history and you can scroll through the history by using the up and down arrows."}),"\n",(0,s.jsx)(n.h3,{id:"breakpoints",children:"Breakpoints"}),"\n",(0,s.jsx)(n.p,{children:"You can click the line number (left side gutter) in Script Runner to add a breakpoint. The script will automatically pause when it hits the breakpoint. Once stopped at the breakpoint, you can evaluate variables using the Debug line."}),"\n",(0,s.jsx)(n.h3,{id:"using-disconnect-mode",children:"Using Disconnect Mode"}),"\n",(0,s.jsx)(n.p,{children:"Disconnect mode is a feature of Script Runner that allows testing scripts in an environment without real hardware in the loop. Disconnect mode is started by selecting Script -> Toggle Disconnect. Once selected, the user is prompted to select which targets to disconnect. By default, all targets are disconnected, which allows for testing scripts without any real hardware. Optionally, only a subset of targets can be selected which can be useful for trying out scripts in partially integrated environments."}),"\n",(0,s.jsx)(n.p,{children:"While in disconnect mode, commands to the disconnected targets always succeed. Additionally, all checks of disconnected targets' telemetry are immediately successful. This allows for a quick run-through of procedures for logic errors and other script specific errors without having to worry about the behavior and proper functioning of hardware."}),"\n",(0,s.jsx)(n.h3,{id:"auditing-your-scripts",children:"Auditing your Scripts"}),"\n",(0,s.jsx)(n.p,{children:"Script Runner includes several tools to help audit your scripts both before and after execution."}),"\n",(0,s.jsx)(n.h4,{id:"ruby-syntax-check",children:"Ruby Syntax Check"}),"\n",(0,s.jsx)(n.p,{children:"The Ruby Syntax Check tool is found under the Script Menu. This tool uses the ruby executable with the -c flag to run a syntax check on your script. If any syntax errors are found the exact message presented by the Ruby interpreter is shown to the user. These can be cryptic, but the most common faults are not closing a quoted string, forgetting an \u201Cend\u201D keyword, or using a block but forgetting the proceeding \u201Cdo\u201D keyword."}),"\n",(0,s.jsx)(n.h2,{id:"common-scenarios",children:"Common Scenarios"}),"\n",(0,s.jsx)(n.h3,{id:"user-input-best-practices",children:"User Input Best Practices"}),"\n",(0,s.jsx)(n.p,{children:"COSMOS provides several different methods to gather manual user input in scripts. When using user input methods that allow for arbitrary values (like ask() and ask_string()), it is very important to validate the value given in your script before moving on. When asking for text input, it is extra important to handle different casing possibilities and to ensure that invalid input will either re-prompt the user or take a safe path."}),"\n",(0,s.jsx)(n.p,{children:"Ruby:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'answer = ask_string("Do you want to continue (y/n)?")\nif answer != \'y\' and answer != \'Y\'\n raise "User entered: #{answer}"\nend\n\ntemp = 0.0\nwhile temp < 10.0 or temp > 50.0\n temp = ask("Enter the desired temperature between 10.0 and 50.0")\nend\n'})}),"\n",(0,s.jsx)(n.p,{children:"Python:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:'answer = ask_string("Do you want to continue (y/n)?")\nif answer != \'y\' and answer != \'Y\':\n raise RuntimeError(f"User entered: {answer}")\n\ntemp = 0.0\nwhile temp < 10.0 or temp > 50.0:\n temp = ask("Enter the desired temperature between 10.0 and 50.0")\n'})}),"\n",(0,s.jsx)(n.p,{children:"When possible, always use one of the other user input methods that has a constrained list of choices for your users (message_box, vertical_message_box, combo_box)."}),"\n",(0,s.jsx)(n.p,{children:"Note that all these user input methods provide the user the option to \u201CCancel\u201D. When cancel is clicked, the script is paused but remains at the user input line. When hitting \u201CGo\u201D to the continue, the user will be re-prompted to enter the value."}),"\n",(0,s.jsx)(n.h3,{id:"conditionally-require-manual-user-input-steps",children:"Conditionally Require Manual User Input Steps"}),"\n",(0,s.jsx)(n.p,{children:"When possible, a useful design pattern is to write your scripts such that they can run without prompting for any user input. This allows the scripts to be more easily tested and provides a documented default value for any user input choices or values. To implement this pattern, all manual steps such as ask(), prompt(), and infinite wait() statements need to be wrapped with an if statement that checks the value of $manual in Ruby or RunningScript.manual in Python. If the variable is set, then the manual steps should be executed. If not, then a default value should be used."}),"\n",(0,s.jsx)(n.p,{children:"Ruby Example:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'if $manual\n temp = ask("Please enter the temperature")\nelse\n temp = 20.0\nend\nif !$manual\n puts "Skipping infinite wait in auto mode"\nelse\n wait\nend\n'})}),"\n",(0,s.jsx)(n.p,{children:"Python Example:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:'if RunningScript.manual:\n temp = ask("Please enter the temperature")\nelse:\n temp = 20.0\nif not RunningScript.manual:\n print("Skipping infinite wait in auto mode")\nelse:\n wait()\n'})}),"\n",(0,s.jsx)(n.p,{children:"When running suites, there is a checkbox at the top of the tool called \u201CManual\u201D that affects this $manual variable directly."}),"\n",(0,s.jsx)(n.h3,{id:"outputting-extra-information-to-a-report",children:"Outputting Extra Information to a Report"}),"\n",(0,s.jsx)(n.p,{children:"COSMOS Script Runner operating on a script suite automatically generates a report that shows the PASS/FAILED/SKIPPED state for each script. You can also inject arbitrary text into this report using the example as follows. Alternatively, you can simply use print text into the Script Runner message log."}),"\n",(0,s.jsx)(n.p,{children:"Ruby:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'class MyGroup < OpenC3::Group\n def script_1\n # The following text will be placed in the report\n OpenC3::Group.puts "Verifies requirements 304, 306, 310"\n # This puts line will show up in the sr_messages log file\n puts "script_1 complete"\n end\nend\n'})}),"\n",(0,s.jsx)(n.p,{children:"Python:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:'from openc3.script.suite import Group\nclass MyGroup(Group):\n def script_1():\n # The following text will be placed in the report\n Group.print("Verifies requirements 304, 306, 310")\n # This puts line will show up in the sr_messages log file\n print("script_1 complete")\n'})}),"\n",(0,s.jsx)(n.h3,{id:"getting-the-most-recent-value-of-a-telemetry-point-from-multiple-packets",children:"Getting the Most Recent Value of a Telemetry Point from Multiple Packets"}),"\n",(0,s.jsx)(n.p,{children:"Some systems include high rate data points with the same name in every packet. COSMOS supports getting the most recent value of a telemetry point that is in multiple packets using a special packet name of LATEST. Assume the target INST has two packets, PACKET1 and PACKET2. Both packets have a telemetry point called TEMP."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'# Get the value of TEMP from the most recently received PACKET1\nvalue = tlm("INST PACKET1 TEMP")\n# Get the value of TEMP from the most recently received PACKET2\nvalue = tlm("INST PACKET2 TEMP")\n# Get the value of TEMP from the most recently received PACKET1 or PACKET2\nvalue = tlm("INST LATEST TEMP")\n'})}),"\n",(0,s.jsx)(n.h3,{id:"checking-every-single-sample-of-a-telemetry-point",children:"Checking Every Single Sample of a Telemetry Point"}),"\n",(0,s.jsx)(n.p,{children:"When writing COSMOS scripts, checking the most recent value of a telemetry point normally gets the job done. The tlm(), tlm_raw(), etc methods all retrieve the most recent value of a telemetry point. Sometimes you need to perform analysis on every single sample of a telemetry point. This can be done using the COSMOS packet subscription system. The packet subscription system lets you choose one or more packets and receive them all from a queue. You can then pick out the specific telemetry points you care about from each packet."}),"\n",(0,s.jsx)(n.p,{children:"Ruby:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:"id = subscribe_packets([['INST', 'HEALTH_STATUS'], ['INST', 'ADCS']])\nwait 1.5\nid, packets = get_packets(id)\npackets.each do |packet|\n puts \"#{packet['PACKET_TIMESECONDS']}: #{packet['target_name']} #{packet['packet_name']}\"\nend\n# Wait for some time later and reuse the last returned ID\nid, packets = get_packets(id)\n"})}),"\n",(0,s.jsx)(n.p,{children:"Python:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"id = subscribe_packets([['INST', 'HEALTH_STATUS'], ['INST', 'ADCS']])\nwait(1.5)\nid, packets = get_packets(id)\nfor packet in packets:\n print(f\"{packet['PACKET_TIMESECONDS']}: {packet['target_name']} {packet['packet_name']}\")\n# Wait for some time later and reuse the last returned ID\nid, packets = get_packets(id)\n"})}),"\n",(0,s.jsx)(n.h3,{id:"using-variables-in-mnemonics",children:"Using Variables in Mnemonics"}),"\n",(0,s.jsx)(n.p,{children:"Because command and telemetry mnemonics are just strings in COSMOS scripts, you can make use of variables in some contexts to make reusable code. For example, a method can take a target name as an input to support multiple instances of a target. You could also pass in the value for a set of numbered telemetry points."}),"\n",(0,s.jsx)(n.p,{children:"Ruby:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'def example(target_name, temp_number)\n cmd("#{target_name} COLLECT with TYPE NORMAL")\n wait_check("#{target_name} TEMP#{temp_number} > 50.0")\nend\n'})}),"\n",(0,s.jsx)(n.p,{children:"Python:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:'def example(target_name, temp_number):\n cmd(f"{target_name} COLLECT with TYPE NORMAL")\n wait_check(f"{target_name} TEMP{temp_number} > 50.0")\n'})}),"\n",(0,s.jsxs)(n.p,{children:["This can also be useful when looping through a numbered set of telemetry points but be considerate of the downsides of looping as discussed in the ",(0,s.jsx)(n.a,{href:"#looping-vs-unrolled-loops",children:"Looping vs Unrolled Loops"})," section."]}),"\n",(0,s.jsx)(n.h3,{id:"using-custom-wait_check_expression",children:"Using Custom wait_check_expression"}),"\n",(0,s.jsx)(n.p,{children:"The COSMOS wait_check_expression (and check_expression) allow you to perform more complicated checks and still stop the script with a CHECK error message if something goes wrong. For example, you can check variables against each other or check a telemetry point against a range. The exact string of text passed to wait_check_expression is repeatedly evaluated until it passes, or a timeout occurs. It is important to not use string interpolation within the actual expression or the values inside of the string interpolation syntax will only be evaluated once when it is converted into a string."}),"\n",(0,s.jsx)(n.p,{children:"Ruby:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'one = 1\ntwo = 2\n\nwait_check_expression("one == two", 1)\n# ERROR: CHECK: one == two is FALSE after waiting 1.017035 seconds\n\n# Checking an integer range\nwait_check_expression("one > 0 and one < 10 # init value one = #{one}", 1)\n'})}),"\n",(0,s.jsx)(n.p,{children:"Python:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:'one = 1\ntwo = 2\n\nwait_check_expression("one == two", 1, 0.25, locals())\n# ERROR: CHECK: one == two is FALSE after waiting 1.017035 seconds\n\n# Checking an integer range\nwait_check_expression("one > 0 and one < 10", 1, 0.25, locals())\n'})}),"\n",(0,s.jsx)(n.h3,{id:"cosmos-scripting-differences-from-regular-ruby-scripting",children:"COSMOS Scripting Differences from Regular Ruby Scripting"}),"\n",(0,s.jsx)(n.h4,{id:"do-not-use-single-line-if-statements",children:"Do not use single line if statements"}),"\n",(0,s.jsx)(n.p,{children:"COSMOS scripting instruments each line to catch exceptions if things go wrong. With single line if statements the exception handling doesn't know which part of the statement failed and cannot properly continue. If an exception is raised in a single line if statement, then the entire script will stop and not be able to continue. Do not use single line if statements in COSMOS scripts. (However, they are fine to use in interfaces and other Ruby code, just not COSMOS scripts)."}),"\n",(0,s.jsx)(n.p,{children:"Don't do this:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'run_method() if tlm("INST HEALTH_STATUS TEMP1") > 10.0\n'})}),"\n",(0,s.jsx)(n.p,{children:"Do this instead:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'# It is best not to execute any code that could fail in an if statement, ie\n# tlm() could fail if the CmdTlmServer was not running or a mnemonic\n# was misspelled\ntemp1 = tlm("INST HEALTH_STATUS TEMP1")\nif temp1 > 10.0\n run_method()\nend\n'})}),"\n",(0,s.jsx)(n.h2,{id:"when-things-go-wrong",children:"When Things Go Wrong"}),"\n",(0,s.jsx)(n.h3,{id:"common-reasons-checks-fail",children:"Common Reasons Checks Fail"}),"\n",(0,s.jsx)(n.p,{children:"There are three common reasons that checks fail in COSMOS scripts:"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"The delay given was too short"}),"\n",(0,s.jsx)(n.p,{children:"The wait_check() method takes a timeout that indicates how long to wait for the referenced telemetry point to pass the check. The timeout needs to be large enough for the system under test to finish its action and for updated telemetry to be received. Note that the script will continue as soon as the check completes successfully. Thus, the only penalty for a longer timeout is the additional wait time in a failure condition."}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"The range or value checked against was incorrect or too stringent"}),"\n",(0,s.jsx)(n.p,{children:"Often the actual telemetry value is ok, but the expected value checked against was too tight. Loosen the ranges on checks when it makes sense. Ensure your script is using the wait_check_tolerance() routine when checking floating point numbers and verify you're using an appropriate tolerance value."}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"The check really failed"}),"\n",(0,s.jsx)(n.p,{children:"Of course, sometimes there are real failures. See the next section for how to handle them and recover."}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"how-to-recover-from-anomalies",children:"How to Recover from Anomalies"}),"\n",(0,s.jsx)(n.p,{children:"Once something has failed, and your script has stopped with a pink highlighted line, how can you recover? Fortunately, COSMOS provides several mechanisms that can be used to recover after something in your script fails."}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Retry"}),"\n",(0,s.jsx)(n.p,{children:"After a failure, the Script Runner \u201CPause\u201D button changes to \u201CRetry\u201D. Clicking on the Retry button will re-execute the line the failed. For failures due to timing issues, this will often resolve the issue and allow the script to continue. Make note of the failure and be sure to update your script prior to the next run."}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Use the Debug Prompt"}),"\n",(0,s.jsx)(n.p,{children:"By selecting Script -> Toggle Debug, you can perform arbitrary actions that may be needed to correct the situation without stopping the running script. You can also inspect variables to help determine why something failed."}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Execute Selection"}),"\n",(0,s.jsx)(n.p,{children:'If only a small section of a script needs to be run, then \u201CExecute Selection" can be used to execute only a small portion of the script. This can also be used when a script is paused or stopped in error.'}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Run from here"}),"\n",(0,s.jsx)(n.p,{children:'By clicking into a script, and right clicking to select "Run from here", users can restart a script at an arbitrary point. This works well if no required variable definitions exist earlier in the script.'}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"advanced-topics",children:"Advanced Topics"}),"\n",(0,s.jsx)(n.h3,{id:"advanced-script-configuration-with-csv-or-excel",children:"Advanced Script Configuration with CSV or Excel"}),"\n",(0,s.jsx)(n.p,{children:"Using a spreadsheet to store the values for use by a script can be a great option if you have a CM-controlled script but need to be able to tweak some values for a test or if you need to use different values for different serial numbers."}),"\n",(0,s.jsx)(n.p,{children:"The Ruby CSV class be used to easily read data from CSV files (recommended for cross platform projects)."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:"require 'csv'\nvalues = CSV.read('test.csv')\nputs values[0][0]\n"})}),"\n",(0,s.jsx)(n.p,{children:"If you are only using Windows, COSMOS also contains a library for reading Excel files."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:"require 'openc3/win32/excel'\nss = ExcelSpreadsheet.new('C:/git/cosmos/test.xlsx')\nputs ss[0][0][0]\n"})}),"\n",(0,s.jsx)(n.h3,{id:"when-to-use-ruby-modules",children:"When to use Ruby Modules"}),"\n",(0,s.jsx)(n.p,{children:"Modules in Ruby have two purposes: namespacing and mixins. Namespacing allows having classes and methods with the same name, but with different meanings. For example, if they are namespaced, COSMOS can have a Packet class and another Ruby library can have a Packet class. This isn't typically useful for COSMOS scripting though."}),"\n",(0,s.jsx)(n.p,{children:"Mixins allow adding common methods to classes without using inheritance. Mixins can be useful to add common functionality to some classes but not others, or to break up classes into multiple files."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:"module MyModule\n def module_method\n end\nend\nclass MyTest < OpenC3::Group\n include MyModule\n def test_1\n module_method()\n end\nend\n"})})]})}function h(e={}){let{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},2840:function(e,n,t){t.d(n,{Z:()=>o,a:()=>a});var i=t(2784);let s={},r=i.createContext(s);function a(e){let n=i.useContext(r);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]);