openc3-cosmos-tool-docs 6.9.2 → 6.10.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 (239) hide show
  1. checksums.yaml +4 -4
  2. data/tools/staticdocs/404.html +2 -2
  3. data/tools/staticdocs/assets/css/styles.9a220ac7.css +1 -0
  4. data/tools/staticdocs/assets/js/{019369f3.4a1653c3.js → 019369f3.d7bbc5e1.js} +1 -1
  5. data/tools/staticdocs/assets/js/{058ffc22.32f2b3f7.js → 058ffc22.e446ff0d.js} +1 -1
  6. data/tools/staticdocs/assets/js/0686a885.5b4c4b4d.js +1 -0
  7. data/tools/staticdocs/assets/js/{078dbab0.64ae8502.js → 078dbab0.656de457.js} +1 -1
  8. data/tools/staticdocs/assets/js/0f5d161c.7e54cdcf.js +1 -0
  9. data/tools/staticdocs/assets/js/0ff569c9.9566d390.js +1 -0
  10. data/tools/staticdocs/assets/js/10209fc9.b137dbd6.js +1 -0
  11. data/tools/staticdocs/assets/js/{103cc3be.6610d68d.js → 103cc3be.ee6acb84.js} +1 -1
  12. data/tools/staticdocs/assets/js/1202.d22d6899.js +101 -0
  13. data/tools/staticdocs/assets/js/13196248.8bbc13cd.js +1 -0
  14. data/tools/staticdocs/assets/js/13c1b4e4.4c262e75.js +1 -0
  15. data/tools/staticdocs/assets/js/1596.e0bc0cb8.js +1 -0
  16. data/tools/staticdocs/assets/js/{1c0a0c05.c66d2cd5.js → 1c0a0c05.ddb465d3.js} +1 -1
  17. data/tools/staticdocs/assets/js/{1e02e6a3.9bd7e41d.js → 1e02e6a3.73b5cfe6.js} +1 -1
  18. data/tools/staticdocs/assets/js/2047b354.6cacf929.js +1 -0
  19. data/tools/staticdocs/assets/js/{22b3ac48.afad8999.js → 22b3ac48.7b94bcf3.js} +1 -1
  20. data/tools/staticdocs/assets/js/26b8abb2.237c47e9.js +1 -0
  21. data/tools/staticdocs/assets/js/{2bb7bf90.417c7c24.js → 2bb7bf90.3bde2607.js} +1 -1
  22. data/tools/staticdocs/assets/js/{2c15ad40.9ac78174.js → 2c15ad40.4b4b971e.js} +1 -1
  23. data/tools/staticdocs/assets/js/3140.8b312c79.js +1 -0
  24. data/tools/staticdocs/assets/js/35398c5c.0f3180d9.js +1 -0
  25. data/tools/staticdocs/assets/js/3dd7ef3b.0221eef2.js +1 -0
  26. data/tools/staticdocs/assets/js/4015.6d6a3d14.js +1 -0
  27. data/tools/staticdocs/assets/js/40365d27.41de4945.js +1 -0
  28. data/tools/staticdocs/assets/js/{411898ad.2ba42394.js → 411898ad.6f36be2d.js} +1 -1
  29. data/tools/staticdocs/assets/js/42170351.3618f599.js +1 -0
  30. data/tools/staticdocs/assets/js/{43652efd.658da795.js → 43652efd.e2fc7748.js} +1 -1
  31. data/tools/staticdocs/assets/js/4581.bbe04eae.js +4 -0
  32. data/tools/staticdocs/assets/js/{53ca7c5b.dfd52859.js → 53ca7c5b.eccd9100.js} +1 -1
  33. data/tools/staticdocs/assets/js/54d0d530.cec50ece.js +1 -0
  34. data/tools/staticdocs/assets/js/{567dad64.2839bb3d.js → 567dad64.50613669.js} +1 -1
  35. data/tools/staticdocs/assets/js/{5738ba7a.d3cf18a7.js → 5738ba7a.cede7d7a.js} +1 -1
  36. data/tools/staticdocs/assets/js/{59ed27a4.eb69cbc8.js → 59ed27a4.1b2efe08.js} +1 -1
  37. data/tools/staticdocs/assets/js/{5b233ba7.c96c3512.js → 5b233ba7.9faed769.js} +1 -1
  38. data/tools/staticdocs/assets/js/{5bc719f6.1ac7eb68.js → 5bc719f6.789ebf64.js} +1 -1
  39. data/tools/staticdocs/assets/js/5c6ce5ec.16226a4e.js +1 -0
  40. data/tools/staticdocs/assets/js/5e3ed378.9ad2dcd2.js +1 -0
  41. data/tools/staticdocs/assets/js/5fe211ef.bfe87c27.js +1 -0
  42. data/tools/staticdocs/assets/js/{62df909c.1abd26b3.js → 62df909c.829748fb.js} +1 -1
  43. data/tools/staticdocs/assets/js/{630e5448.8195b015.js → 630e5448.5c8f1aee.js} +1 -1
  44. data/tools/staticdocs/assets/js/6831b732.1790429a.js +1 -0
  45. data/tools/staticdocs/assets/js/696b4199.7520348a.js +1 -0
  46. data/tools/staticdocs/assets/js/{6b210247.9645038a.js → 6b210247.fc77f080.js} +1 -1
  47. data/tools/staticdocs/assets/js/6b65133b.f2b11b07.js +1 -0
  48. data/tools/staticdocs/assets/js/{6f92e431.4af1d84b.js → 6f92e431.26f4227b.js} +1 -1
  49. data/tools/staticdocs/assets/js/72c6d8a8.0b8c5d2f.js +1 -0
  50. data/tools/staticdocs/assets/js/7399.857e78fe.js +1 -0
  51. data/tools/staticdocs/assets/js/75897369.e4626b79.js +1 -0
  52. data/tools/staticdocs/assets/js/75e64983.8112c73c.js +1 -0
  53. data/tools/staticdocs/assets/js/7f5b2696.176aadb5.js +1 -0
  54. data/tools/staticdocs/assets/js/{867640d5.8e389f8a.js → 867640d5.6bc9ed72.js} +1 -1
  55. data/tools/staticdocs/assets/js/89e76475.6411e788.js +1 -0
  56. data/tools/staticdocs/assets/js/8b939c74.5e039b7a.js +1 -0
  57. data/tools/staticdocs/assets/js/{8f7843ee.fffd1922.js → 8f7843ee.fb130406.js} +1 -1
  58. data/tools/staticdocs/assets/js/9424f0b3.90296433.js +1 -0
  59. data/tools/staticdocs/assets/js/{4212.6d8bdfa0.js → 9601.e8389133.js} +1 -1
  60. data/tools/staticdocs/assets/js/{964eb012.ee8b3c36.js → 964eb012.94a1dac1.js} +1 -1
  61. data/tools/staticdocs/assets/js/{97535711.237fc358.js → 97535711.3e76daa6.js} +1 -1
  62. data/tools/staticdocs/assets/js/{99581c43.0582936a.js → 99581c43.48391a19.js} +1 -1
  63. data/tools/staticdocs/assets/js/{9d6e81d0.2e825d3a.js → 9d6e81d0.c9e12517.js} +1 -1
  64. data/tools/staticdocs/assets/js/{9fb6059a.10a4e6be.js → 9fb6059a.2473a196.js} +1 -1
  65. data/tools/staticdocs/assets/js/{a677c089.b21f50bd.js → a677c089.4e7df83d.js} +1 -1
  66. data/tools/staticdocs/assets/js/a9987364.5ca31d27.js +1 -0
  67. data/tools/staticdocs/assets/js/{a9b2dc27.a75a110f.js → a9b2dc27.1f8d5c81.js} +1 -1
  68. data/tools/staticdocs/assets/js/aa6b6c1b.750dc927.js +1 -0
  69. data/tools/staticdocs/assets/js/b062d239.cd8e5784.js +1 -0
  70. data/tools/staticdocs/assets/js/b38a6d74.b0b07b64.js +1 -0
  71. data/tools/staticdocs/assets/js/b4596165.8792340f.js +1 -0
  72. data/tools/staticdocs/assets/js/{b6d70f94.5c2fecd8.js → b6d70f94.43a5cd5a.js} +1 -1
  73. data/tools/staticdocs/assets/js/b9f60ba6.f2b60175.js +1 -0
  74. data/tools/staticdocs/assets/js/{bd0034eb.4f47d05b.js → bd0034eb.f33ae892.js} +1 -1
  75. data/tools/staticdocs/assets/js/{c24eae19.59d90845.js → c24eae19.4d25de93.js} +1 -1
  76. data/tools/staticdocs/assets/js/c2598f55.0b5b0aff.js +1 -0
  77. data/tools/staticdocs/assets/js/{c5388ca4.0ddcb653.js → c5388ca4.09e2580f.js} +1 -1
  78. data/tools/staticdocs/assets/js/{c956ad1e.78603023.js → c956ad1e.38882e03.js} +1 -1
  79. data/tools/staticdocs/assets/js/{cb8c3f08.2df335b2.js → cb8c3f08.7ca03d18.js} +1 -1
  80. data/tools/staticdocs/assets/js/{cd879be4.c7304d91.js → cd879be4.f77d4fff.js} +1 -1
  81. data/tools/staticdocs/assets/js/{ce89ef36.73fcb368.js → ce89ef36.7b0f9079.js} +1 -1
  82. data/tools/staticdocs/assets/js/cf1c01b8.f5a9a237.js +1 -0
  83. data/tools/staticdocs/assets/js/d1b923aa.a5b3429d.js +1 -0
  84. data/tools/staticdocs/assets/js/d1bfc316.7c605bc5.js +1 -0
  85. data/tools/staticdocs/assets/js/{d24bf9b6.a79f1a36.js → d24bf9b6.f380debf.js} +1 -1
  86. data/tools/staticdocs/assets/js/{d57a4b5d.1c05ac31.js → d57a4b5d.7ce9d24e.js} +1 -1
  87. data/tools/staticdocs/assets/js/d59d8a14.41f22286.js +1 -0
  88. data/tools/staticdocs/assets/js/d5d77c37.ae6fba94.js +1 -0
  89. data/tools/staticdocs/assets/js/{d66bf9c0.742ff681.js → d66bf9c0.c87e9dc0.js} +1 -1
  90. data/tools/staticdocs/assets/js/{d8ca4191.1c930b0b.js → d8ca4191.b24de36d.js} +1 -1
  91. data/tools/staticdocs/assets/js/d9b92eba.b08eeda4.js +1 -0
  92. data/tools/staticdocs/assets/js/{db8fa1d0.7f3090fa.js → db8fa1d0.a05e2bae.js} +1 -1
  93. data/tools/staticdocs/assets/js/dbe31111.4f18bf2b.js +1 -0
  94. data/tools/staticdocs/assets/js/dc5f7beb.d439e98e.js +1 -0
  95. data/tools/staticdocs/assets/js/{dfbae5fd.011fc630.js → dfbae5fd.24d7316e.js} +1 -1
  96. data/tools/staticdocs/assets/js/{e501b0d1.c2d8ca29.js → e501b0d1.e7e284e5.js} +1 -1
  97. data/tools/staticdocs/assets/js/f15615f1.7dcf0c73.js +1 -0
  98. data/tools/staticdocs/assets/js/{f75a5f33.bc43f96a.js → f75a5f33.a7c7ff1d.js} +1 -1
  99. data/tools/staticdocs/assets/js/{fd886806.e52d2c97.js → fd886806.4b383c00.js} +1 -1
  100. data/tools/staticdocs/assets/js/main.05839669.js +38 -0
  101. data/tools/staticdocs/assets/js/runtime~main.e35f5fea.js +1 -0
  102. data/tools/staticdocs/docs/configuration/accessors.html +46 -46
  103. data/tools/staticdocs/docs/configuration/command.html +97 -81
  104. data/tools/staticdocs/docs/configuration/conversions.html +48 -48
  105. data/tools/staticdocs/docs/configuration/format.html +21 -21
  106. data/tools/staticdocs/docs/configuration/interfaces.html +55 -55
  107. data/tools/staticdocs/docs/configuration/limits-response.html +10 -10
  108. data/tools/staticdocs/docs/configuration/plugins.html +121 -121
  109. data/tools/staticdocs/docs/configuration/processors.html +15 -15
  110. data/tools/staticdocs/docs/configuration/protocols.html +66 -66
  111. data/tools/staticdocs/docs/configuration/ssl-tls.html +15 -15
  112. data/tools/staticdocs/docs/configuration/table.html +45 -45
  113. data/tools/staticdocs/docs/configuration/target.html +20 -20
  114. data/tools/staticdocs/docs/configuration/telemetry-screens.html +253 -253
  115. data/tools/staticdocs/docs/configuration/telemetry.html +93 -77
  116. data/tools/staticdocs/docs/configuration.html +2 -2
  117. data/tools/staticdocs/docs/development/curl.html +14 -14
  118. data/tools/staticdocs/docs/development/developing.html +17 -17
  119. data/tools/staticdocs/docs/development/json-api.html +15 -15
  120. data/tools/staticdocs/docs/development/log-structure.html +13 -15
  121. data/tools/staticdocs/docs/development/roadmap.html +4 -4
  122. data/tools/staticdocs/docs/development/streaming-api.html +26 -26
  123. data/tools/staticdocs/docs/development/testing.html +17 -17
  124. data/tools/staticdocs/docs/development.html +2 -2
  125. data/tools/staticdocs/docs/getting-started/cli.html +42 -42
  126. data/tools/staticdocs/docs/getting-started/generators.html +24 -24
  127. data/tools/staticdocs/docs/getting-started/gettingstarted.html +19 -19
  128. data/tools/staticdocs/docs/getting-started/installation.html +20 -20
  129. data/tools/staticdocs/docs/getting-started/key-concepts.html +20 -20
  130. data/tools/staticdocs/docs/getting-started/podman.html +23 -23
  131. data/tools/staticdocs/docs/getting-started/requirements.html +19 -19
  132. data/tools/staticdocs/docs/getting-started/upgrading.html +69 -42
  133. data/tools/staticdocs/docs/getting-started/util.html +25 -25
  134. data/tools/staticdocs/docs/getting-started.html +2 -2
  135. data/tools/staticdocs/docs/guides/bridges.html +14 -14
  136. data/tools/staticdocs/docs/guides/cfs.html +32 -32
  137. data/tools/staticdocs/docs/guides/custom-widgets.html +33 -33
  138. data/tools/staticdocs/docs/guides/dynamic-packets.html +6 -10
  139. data/tools/staticdocs/docs/guides/exposing-microservices.html +11 -11
  140. data/tools/staticdocs/docs/guides/little-endian-bitfields.html +4 -4
  141. data/tools/staticdocs/docs/guides/local-mode.html +13 -13
  142. data/tools/staticdocs/docs/guides/logging.html +9 -9
  143. data/tools/staticdocs/docs/guides/monitoring.html +18 -18
  144. data/tools/staticdocs/docs/guides/performance.html +10 -10
  145. data/tools/staticdocs/docs/guides/raspberrypi.html +4 -4
  146. data/tools/staticdocs/docs/guides/reference-architectures.html +6 -6
  147. data/tools/staticdocs/docs/guides/roles-permissions.html +29 -29
  148. data/tools/staticdocs/docs/guides/script-writing.html +68 -104
  149. data/tools/staticdocs/docs/guides/scripting-api.html +673 -666
  150. data/tools/staticdocs/docs/guides/troubleshooting.html +7 -7
  151. data/tools/staticdocs/docs/guides.html +2 -2
  152. data/tools/staticdocs/docs/meta/contributing.html +12 -12
  153. data/tools/staticdocs/docs/meta/licenses.html +9 -9
  154. data/tools/staticdocs/docs/meta/philosophy.html +3 -3
  155. data/tools/staticdocs/docs/meta/vulnerabilities.html +5 -5
  156. data/tools/staticdocs/docs/meta/xtce.html +12 -12
  157. data/tools/staticdocs/docs/meta.html +2 -2
  158. data/tools/staticdocs/docs/privacy.html +17 -17
  159. data/tools/staticdocs/docs/tools/admin.html +28 -28
  160. data/tools/staticdocs/docs/tools/autonomic.html +19 -19
  161. data/tools/staticdocs/docs/tools/bucket-explorer.html +12 -9
  162. data/tools/staticdocs/docs/tools/calendar.html +24 -24
  163. data/tools/staticdocs/docs/tools/cmd-sender.html +13 -13
  164. data/tools/staticdocs/docs/tools/cmd-tlm-server.html +24 -24
  165. data/tools/staticdocs/docs/tools/command-history.html +6 -6
  166. data/tools/staticdocs/docs/tools/command-queue.html +8 -8
  167. data/tools/staticdocs/docs/tools/data-extractor.html +23 -23
  168. data/tools/staticdocs/docs/tools/data-viewer.html +10 -10
  169. data/tools/staticdocs/docs/tools/handbooks.html +4 -4
  170. data/tools/staticdocs/docs/tools/limits-monitor.html +15 -15
  171. data/tools/staticdocs/docs/tools/log-explorer.html +9 -9
  172. data/tools/staticdocs/docs/tools/packet-viewer.html +10 -10
  173. data/tools/staticdocs/docs/tools/script-runner.html +39 -44
  174. data/tools/staticdocs/docs/tools/systemhealth.html +21 -21
  175. data/tools/staticdocs/docs/tools/table-manager.html +10 -10
  176. data/tools/staticdocs/docs/tools/tlm-grapher.html +20 -20
  177. data/tools/staticdocs/docs/tools/tlm-viewer.html +15 -15
  178. data/tools/staticdocs/docs/tools.html +2 -2
  179. data/tools/staticdocs/docs.html +12 -12
  180. data/tools/staticdocs/index.html +2 -2
  181. data/tools/staticdocs/lunr-index-1765327504765.json +1 -0
  182. data/tools/staticdocs/lunr-index.json +1 -1
  183. data/tools/staticdocs/markdown-page.html +3 -3
  184. data/tools/staticdocs/search-doc-1765327504765.json +1 -0
  185. data/tools/staticdocs/search-doc.json +1 -1
  186. metadata +102 -102
  187. data/tools/staticdocs/assets/css/styles.41902cce.css +0 -1
  188. data/tools/staticdocs/assets/js/0686a885.a7333b95.js +0 -1
  189. data/tools/staticdocs/assets/js/0f5d161c.7e279344.js +0 -1
  190. data/tools/staticdocs/assets/js/0ff569c9.2aab45f2.js +0 -1
  191. data/tools/staticdocs/assets/js/10209fc9.4565c03f.js +0 -1
  192. data/tools/staticdocs/assets/js/13196248.d66fca61.js +0 -1
  193. data/tools/staticdocs/assets/js/13c1b4e4.5bb027bf.js +0 -1
  194. data/tools/staticdocs/assets/js/2047b354.57091c5c.js +0 -1
  195. data/tools/staticdocs/assets/js/26b8abb2.dcaf4a64.js +0 -1
  196. data/tools/staticdocs/assets/js/2754.1aabb61a.js +0 -4
  197. data/tools/staticdocs/assets/js/35398c5c.e106e87e.js +0 -1
  198. data/tools/staticdocs/assets/js/3dd7ef3b.d7f8b9cd.js +0 -1
  199. data/tools/staticdocs/assets/js/40365d27.d9f50fa2.js +0 -1
  200. data/tools/staticdocs/assets/js/42170351.067ef5bf.js +0 -1
  201. data/tools/staticdocs/assets/js/4684.14bc5dde.js +0 -1
  202. data/tools/staticdocs/assets/js/5072.9a0a2752.js +0 -1
  203. data/tools/staticdocs/assets/js/54d0d530.2cb8d081.js +0 -1
  204. data/tools/staticdocs/assets/js/5c6ce5ec.507ee82d.js +0 -1
  205. data/tools/staticdocs/assets/js/5e3ed378.4df9c862.js +0 -1
  206. data/tools/staticdocs/assets/js/5fe211ef.f88f4388.js +0 -1
  207. data/tools/staticdocs/assets/js/6822.e7d145ca.js +0 -1
  208. data/tools/staticdocs/assets/js/6831b732.e1f6dba2.js +0 -1
  209. data/tools/staticdocs/assets/js/696b4199.ca5589ac.js +0 -1
  210. data/tools/staticdocs/assets/js/6b65133b.e20fd90a.js +0 -1
  211. data/tools/staticdocs/assets/js/72c6d8a8.33b4ade8.js +0 -1
  212. data/tools/staticdocs/assets/js/7453.c108c718.js +0 -101
  213. data/tools/staticdocs/assets/js/75897369.f13aa17b.js +0 -1
  214. data/tools/staticdocs/assets/js/75e64983.180a00e7.js +0 -1
  215. data/tools/staticdocs/assets/js/7724.decf13c5.js +0 -1
  216. data/tools/staticdocs/assets/js/7f5b2696.e1f3d862.js +0 -1
  217. data/tools/staticdocs/assets/js/89e76475.19eee62b.js +0 -1
  218. data/tools/staticdocs/assets/js/8b939c74.695b23ba.js +0 -1
  219. data/tools/staticdocs/assets/js/9424f0b3.b69449bb.js +0 -1
  220. data/tools/staticdocs/assets/js/a9987364.7fc39b81.js +0 -1
  221. data/tools/staticdocs/assets/js/aa6b6c1b.fe979b93.js +0 -1
  222. data/tools/staticdocs/assets/js/b062d239.17662e64.js +0 -1
  223. data/tools/staticdocs/assets/js/b38a6d74.8868b9d0.js +0 -1
  224. data/tools/staticdocs/assets/js/b4596165.2ed4461b.js +0 -1
  225. data/tools/staticdocs/assets/js/b9f60ba6.b670205f.js +0 -1
  226. data/tools/staticdocs/assets/js/c2598f55.7a2138ca.js +0 -1
  227. data/tools/staticdocs/assets/js/cf1c01b8.0e7608a1.js +0 -1
  228. data/tools/staticdocs/assets/js/d1b923aa.9f1cb7ab.js +0 -1
  229. data/tools/staticdocs/assets/js/d1bfc316.61e55cb2.js +0 -1
  230. data/tools/staticdocs/assets/js/d59d8a14.849274f0.js +0 -1
  231. data/tools/staticdocs/assets/js/d5d77c37.efea20c9.js +0 -1
  232. data/tools/staticdocs/assets/js/d9b92eba.df6e59c2.js +0 -1
  233. data/tools/staticdocs/assets/js/dbe31111.2d5f3225.js +0 -1
  234. data/tools/staticdocs/assets/js/dc5f7beb.53bef49e.js +0 -1
  235. data/tools/staticdocs/assets/js/f15615f1.7cc36bfe.js +0 -1
  236. data/tools/staticdocs/assets/js/main.1ae7ceb9.js +0 -38
  237. data/tools/staticdocs/assets/js/runtime~main.44a60fd4.js +0 -1
  238. data/tools/staticdocs/lunr-index-1762372934557.json +0 -1
  239. data/tools/staticdocs/search-doc-1762372934557.json +0 -1
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["2102"],{5150:function(e,t,a){a.r(t),a.d(t,{frontMatter:()=>d,toc:()=>r,default:()=>h,metadata:()=>i,assets:()=>l,contentTitle:()=>c});var i=JSON.parse('{"id":"tools/calendar","title":"Calendar (Enterprise)","description":"Calendar visualization of metadata, notes, and timelines","source":"@site/docs/tools/calendar.md","sourceDirName":"tools","slug":"/tools/calendar","permalink":"/tools/staticdocs/docs/tools/calendar","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/tools/calendar.md","tags":[],"version":"current","frontMatter":{"title":"Calendar (Enterprise)","description":"Calendar visualization of metadata, notes, and timelines","sidebar_custom_props":{"myEmoji":"\u{1F5D3}\uFE0F"}},"sidebar":"defaultSidebar","previous":{"title":"Bucket Explorer","permalink":"/tools/staticdocs/docs/tools/bucket-explorer"},"next":{"title":"Command Sender","permalink":"/tools/staticdocs/docs/tools/cmd-sender"}}'),n=a(7259),s=a(5511);let d={title:"Calendar (Enterprise)",description:"Calendar visualization of metadata, notes, and timelines",sidebar_custom_props:{myEmoji:"\u{1F5D3}\uFE0F"}},c,l={},r=[{value:"Introduction",id:"introduction",level:2},{value:"Adding Timelines",id:"adding-timelines",level:3},{value:"Types of Events",id:"types-of-events",level:2},{value:"Metadata",id:"metadata",level:3},{value:"Note",id:"note",level:3},{value:"Activity",id:"activity",level:3},{value:"Gantt View",id:"gantt-view",level:3},{value:"List View",id:"list-view",level:3},{value:"Settings",id:"settings",level:3},{value:"Timeline Implementation Details",id:"timeline-implementation-details",level:2}];function o(e){let t={h2:"h2",h3:"h3",img:"img",li:"li",p:"p",ul:"ul",...(0,s.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h2,{id:"introduction",children:"Introduction"}),"\n",(0,n.jsx)(t.p,{children:"Calendar visualizes metadata, notes, and timeline information in one easy to understand place. Timelines allow for the simple execution of commands and scripts based on future dates and times."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Calendar",src:a(6914).A+"",width:"2562",height:"1640"})}),"\n",(0,n.jsx)(t.h3,{id:"adding-timelines",children:"Adding Timelines"}),"\n",(0,n.jsx)(t.p,{children:"Adding a Timeline to COSMOS is as simple as clicking Create -> Timeline and giving it a unique name. Timelines can be created for organizational purposes or for overlapping activities as no activities can overlap on a given timeline. However, each additional timeline consists of several threads so only create timelines as necessary."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Timeline",src:a(1620).A+"",width:"2056",height:"1362"})}),"\n",(0,n.jsx)(t.h2,{id:"types-of-events",children:"Types of Events"}),"\n",(0,n.jsx)(t.h3,{id:"metadata",children:"Metadata"}),"\n",(0,n.jsx)(t.p,{children:"Metadata allows you to record arbitrary data into the COSMOS system. For example, you could ask the user for inputs which fall outside the available target telemetry including operators, environmental factors, procedural steps, etc. This allows for searching metadata based on these fields and correlating the related telemetry data."}),"\n",(0,n.jsx)(t.p,{children:"You can create a new metadata item from either the Create menu or by right-clicking on the calendar in the given time slot you want the metadata item to appear. Note that metadata entries only have a start time, they do not have an end time."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"CreateMetadata1",src:a(5872).A+"",width:"1254",height:"954"})}),"\n",(0,n.jsx)(t.p,{children:"You then add key / value pairs for all the metadata items you want to create."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"CreateMetadata2",src:a(3515).A+"",width:"1704",height:"1190"})}),"\n",(0,n.jsx)(t.h3,{id:"note",children:"Note"}),"\n",(0,n.jsx)(t.p,{children:"Notes require both a start and end time."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"CreateNote1",src:a(6149).A+"",width:"1642",height:"1238"})}),"\n",(0,n.jsx)(t.p,{children:"You then record the note to create the note event on the calendar."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"CreateNote2",src:a(8798).A+"",width:"1534",height:"1286"})}),"\n",(0,n.jsx)(t.h3,{id:"activity",children:"Activity"}),"\n",(0,n.jsx)(t.p,{children:"Scheduled on a timeline, activities take both a start and end time. A custom title and notes can also be specified. If a custom title is specified, that title will appear on the calendar instead of the default title that is generated."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"CreateActivity1",src:a(3860).A+"",width:"1440",height:"1420"})}),"\n",(0,n.jsx)(t.p,{children:'Activities can run single commands, run a script, or simply "Reserve" space on the calendar for reference or other bookkeeping.'}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"CreateActivity2",src:a(5327).A+"",width:"1930",height:"1290"})}),"\n",(0,n.jsx)(t.p,{children:"When calendar activities are scheduled they appear with a status icon, compliant with the AstroUX standards. As calendar activities are executed, there are lifecycle hooks set to track and display the latest status update from the executed script or command. Green circle will signify nominal (created, started, completed states), yellow square signifies warnings (script stopped, paused, hit breakpoint, completed with errors, disabled), and red triangle signifies error states (error, failed, crashed). Clicking into a Calendar Activity will show the details of the status updates."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Activity",src:a(1138).A+"",width:"1590",height:"1346"})}),"\n",(0,n.jsx)(t.h3,{id:"gantt-view",children:"Gantt View"}),"\n",(0,n.jsx)(t.p,{children:"Calendar events can be viewed as a Gantt chart view via the \"Gantt\" button. Gantt view shows a day's worth of activity, and users can click the next day / previous day buttons to view other day's events."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Gantt View",src:a(2171).A+"",width:"2570",height:"1488"})}),"\n",(0,n.jsx)(t.h3,{id:"list-view",children:"List View"}),"\n",(0,n.jsx)(t.p,{children:"Calendar events can be viewed as a List view via the \"List\" button. List view shows a day's worth of activity, and users can click the next day / previous day buttons to view other day's events."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"List View",src:a(2877).A+"",width:"2566",height:"1290"})}),"\n",(0,n.jsx)(t.h3,{id:"settings",children:"Settings"}),"\n",(0,n.jsx)(t.p,{children:"By clicking File -> Options, the options can be modified. The configurations include:"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsx)(t.li,{children:"Calendar view can be modified to be Sunday - Saturday view or Monday - Sunday"}),"\n",(0,n.jsx)(t.li,{children:"The default view modified to Calendar, Gantt, or List"}),"\n",(0,n.jsx)(t.li,{children:"The progress icon indicating the script is currently running can be modified"}),"\n"]}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Options",src:a(1467).A+"",width:"1270",height:"1296"})}),"\n",(0,n.jsx)(t.h2,{id:"timeline-implementation-details",children:"Timeline Implementation Details"}),"\n",(0,n.jsx)(t.p,{children:"When a user creates a timeline, a new timeline microservice starts. The timeline microservice is the main thread of execution for the timeline. This starts a scheduler manager thread. The scheduler manager thread contains a thread pool that hosts more than one thread to run the activity. The scheduler manager will evaluate the schedule and based on the start time of the activity it will add the activity to the queue."}),"\n",(0,n.jsx)(t.p,{children:'The main thread will block on the web socket to listen to request changes to the timeline, these could be adding, removing, or updating activities. The main thread will make the changes to the in memory schedule if these changes are within the hour of the current time. When the web socket gets an update it has an action lookup table. These actions are "created", "updated", "deleted", etc... Some actions require updating the schedule from the database to ensure the schedule and the database are always in sync.'}),"\n",(0,n.jsx)(t.p,{children:"The schedule thread checks every second to make sure if a task can be run. If the start time is equal or less then the last 15 seconds it will then check the previously queued jobs list in the schedule. If the activity has not been queued and is not fulfilled the activity will be queued, this adds an event to the activity but is not saved to the database."}),"\n",(0,n.jsx)(t.p,{children:"The workers block on the queue until an activity is placed on the queue. Once a job is pulled from the queue they check the type and run the activity. The thread will mark the activity fulfillment true and update the database record with the complete. If the worker gets an error while trying to run the task the activity will NOT be fulfilled and record the error in the database."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Timeline Lifecycle",src:a(2637).A+"",width:"1065",height:"514"})})]})}function h(e={}){let{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(o,{...e})}):o(e)}},1138:function(e,t,a){a.d(t,{A:()=>i});let i=a.p+"assets/images/activity-35dc5e3ab907ff79a599ab728b7a4ace155d86835a09f0c6fa8ceebf184b7984.png"},6914:function(e,t,a){a.d(t,{A:()=>i});let i=a.p+"assets/images/blank_calendar-e02977fafde5379efc62fbaf82686898bfc4745dd081d62e52e3ee94c46bff69.png"},3860:function(e,t,a){a.d(t,{A:()=>i});let i=a.p+"assets/images/create_activity1-5e5a8cee97e818c21e3447d96797b950fe25eb5d0e153ffc899183d28b7fd1be.png"},5327:function(e,t,a){a.d(t,{A:()=>i});let i=a.p+"assets/images/create_activity2-12024f05a06874c9e7b544bac4bec1a263de1715dcb9fa2dc1aea054682e8269.png"},5872:function(e,t,a){a.d(t,{A:()=>i});let i=a.p+"assets/images/create_metadata1-70387fe6ea1aafaee24b4192e76000b31ed60d3a54f957d761cefb5d21498814.png"},3515:function(e,t,a){a.d(t,{A:()=>i});let i=a.p+"assets/images/create_metadata2-ebb8f148142b387c81df70f8a565b27942ff5f6cd5bc098a6d58a27a9b36c09e.png"},6149:function(e,t,a){a.d(t,{A:()=>i});let i=a.p+"assets/images/create_note1-28feb5cf0ad0899db78059dc4ea2567dc9cb03c8c776f1c65dd959f2910481f4.png"},8798:function(e,t,a){a.d(t,{A:()=>i});let i=a.p+"assets/images/create_note2-c0929ea9194606f256465cd6a6c97c60c175cf2ecbf56e6597d4886b4249fe1f.png"},2171:function(e,t,a){a.d(t,{A:()=>i});let i=a.p+"assets/images/gantt_view-3fe75622572f4a5bab2f73311127b71db5bf5aed475b90a2938c9ae61810ea54.png"},2877:function(e,t,a){a.d(t,{A:()=>i});let i=a.p+"assets/images/list_view-edfc7b6fa90e43b85dd862f06c3662dee33b3c79be923a955706001d2f07eca4.png"},1467:function(e,t,a){a.d(t,{A:()=>i});let i=a.p+"assets/images/options-4cb5e315138437db9f25c87feb4be2c61738c03bc3344d46977f44a94b0af738.png"},1620:function(e,t,a){a.d(t,{A:()=>i});let i=a.p+"assets/images/timeline-78e3ab74af1b600eb6640831133f0240a9c20047956b18b729263988a66b8e00.png"},2637:function(e,t,a){a.d(t,{A:()=>i});let i=a.p+"assets/images/timeline_lifecycle-0bd916dee06bf67936b043abfdbc4d5fdec7cc5a32a889ee6c05e9faf74f4c6a.png"},5511:function(e,t,a){a.d(t,{R:()=>d,x:()=>c});var i=a(6363);let n={},s=i.createContext(n);function d(e){let t=i.useContext(s);return i.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:d(e.components),i.createElement(s.Provider,{value:t},e.children)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["7343"],{6669:function(e,t,n){n.r(t),n.d(t,{frontMatter:()=>s,toc:()=>l,default:()=>u,metadata:()=>i,assets:()=>d,contentTitle:()=>c});var i=JSON.parse('{"id":"tools/data-viewer","title":"Data Viewer","description":"View packet or item data","source":"@site/docs/tools/data-viewer.md","sourceDirName":"tools","slug":"/tools/data-viewer","permalink":"/tools/staticdocs/docs/tools/data-viewer","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/tools/data-viewer.md","tags":[],"version":"current","frontMatter":{"title":"Data Viewer","description":"View packet or item data","sidebar_custom_props":{"myEmoji":"\u{1F5A5}\uFE0F"}},"sidebar":"defaultSidebar","previous":{"title":"Data Extractor","permalink":"/tools/staticdocs/docs/tools/data-extractor"},"next":{"title":"Handbooks","permalink":"/tools/staticdocs/docs/tools/handbooks"}}'),o=n(7259),a=n(5511);let s={title:"Data Viewer",description:"View packet or item data",sidebar_custom_props:{myEmoji:"\u{1F5A5}\uFE0F"}},c,d={},l=[{value:"Introduction",id:"introduction",level:2},{value:"Data Viewer Menus",id:"data-viewer-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:"Adding Components",id:"adding-components",level:3}];function r(e){let t={h2:"h2",h3:"h3",h4:"h4",img:"img",li:"li",p:"p",ul:"ul",...(0,a.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.h2,{id:"introduction",children:"Introduction"}),"\n",(0,o.jsx)(t.p,{children:"Data Viewer allows you to view packet data or individual item data in both the past and in real time."}),"\n",(0,o.jsx)(t.p,{children:(0,o.jsx)(t.img,{alt:"Data Viewer",src:n(3789).A+"",width:"1273",height:"732"})}),"\n",(0,o.jsx)(t.h2,{id:"data-viewer-menus",children:"Data Viewer Menus"}),"\n",(0,o.jsx)(t.h3,{id:"file-menu-items",children:"File Menu Items"}),"\n",(0,o.jsx)("img",{src:n(2136).A,alt:"File Menu",style:{float:"left","margin-right":"50px",height:"6em"}}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsx)(t.li,{children:"Opens a saved configuration"}),"\n",(0,o.jsx)(t.li,{children:"Save the current configuration"}),"\n",(0,o.jsx)(t.li,{children:"Reset the configuration (default settings)"}),"\n"]}),"\n",(0,o.jsx)(t.h4,{id:"open-configuration",children:"Open Configuration"}),"\n",(0,o.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,o.jsx)(t.h4,{id:"save-configuration",children:"Save Configuration"}),"\n",(0,o.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,o.jsx)(t.h3,{id:"adding-components",children:"Adding Components"}),"\n",(0,o.jsx)(t.p,{children:"DataViewer displays data in a component. To add a new component to the interface click the plus icon. This brings up the Add Component dialog. First you select the component you want to use to visual the data. Next you add packets which will populate the component. Finally click Create to see the DataViewer component visualization."}),"\n",(0,o.jsx)(t.p,{children:(0,o.jsx)(t.img,{alt:"Add Component",src:n(8029).A+"",width:"798",height:"591"})}),"\n",(0,o.jsx)(t.p,{children:"To adjust the settings of the COSMOS Raw/Decom component click the gear icon to bring up the Display Settings dialog. You can turn on and off various visualizations, increase the number of packets displayed and the history."}),"\n",(0,o.jsx)(t.p,{children:(0,o.jsx)(t.img,{alt:"Add a packet",src:n(2804).A+"",width:"1270",height:"931"})})]})}function u(e={}){let{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(r,{...e})}):r(e)}},2136:function(e,t,n){n.d(t,{A:()=>i});let i=n.p+"assets/images/file_menu-368e6f03ad620e01bf83fb991aace23312d45629bfcef2d3fbccd4dd9e4dbdbd.png"},8029:function(e,t,n){n.d(t,{A:()=>i});let i=n.p+"assets/images/add_component-883814db1de410921a1d46247be60a87a51f1c51eb98d4a7f499875c83225294.png"},3789:function(e,t,n){n.d(t,{A:()=>i});let i=n.p+"assets/images/data_viewer-9eb6ce20988554325e15a6e404da9fef35b06c23548d5d136b4420f444ef94f7.png"},2804:function(e,t,n){n.d(t,{A:()=>i});let i=n.p+"assets/images/display_settings-726614b4eda5f74fc563e4d3b1798eb3893e152a15b9420a6053f6a2e0980944.png"},5511:function(e,t,n){n.d(t,{R:()=>s,x:()=>c});var i=n(6363);let o={},a=i.createContext(o);function s(e){let t=i.useContext(a);return i.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),i.createElement(a.Provider,{value:t},e.children)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["9065"],{593:function(e,t,i){i.r(t),i.d(t,{frontMatter:()=>r,toc:()=>o,default:()=>h,metadata:()=>n,assets:()=>c,contentTitle:()=>a});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":"\u{1F5A5}\uFE0F"}},"sidebar":"defaultSidebar","previous":{"title":"Log Explorer (Enterprise)","permalink":"/tools/staticdocs/docs/tools/log-explorer"},"next":{"title":"Script Runner","permalink":"/tools/staticdocs/docs/tools/script-runner"}}'),s=i(7259),l=i(5511);let r={title:"Packet Viewer",description:"Displays all packets with their items",sidebar_custom_props:{myEmoji:"\u{1F5A5}\uFE0F"}},a,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.R)(),...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(2677).A+"",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(6180).A,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(187).A,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(1800).A+"",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.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},6180:function(e,t,i){i.d(t,{A:()=>n});let n=i.p+"assets/images/file_menu-d9ac5efbe78e58f024666452b9f28af72c6d09a3460fc7c0737c2bb74e4ea409.png"},187:function(e,t,i){i.d(t,{A:()=>n});let n=i.p+"assets/images/view_menu-a02cfbd5e6fafa5d3b4f1ae76bfbd63f49388939b4732bf91709f48e44498d19.png"},2677:function(e,t,i){i.d(t,{A:()=>n});let n=i.p+"assets/images/packet_viewer-505c517c9a838a41d6fe668ff7ca2efb1b89ced4b75df638cd11a45484bc6533.png"},1800:function(e,t,i){i.d(t,{A:()=>n});let n=i.p+"assets/images/temp1_details-4c4bbe7c2d60e636f0304ee8ac7237af8db2bdba8666c9ae2dc0a105eca248f2.png"},5511:function(e,t,i){i.d(t,{R:()=>r,x:()=>a});var n=i(6363);let s={},l=n.createContext(s);function r(e){let t=n.useContext(l);return n.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(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([["2009"],{7047:function(e,c,s){s.r(c),s.d(c,{default:()=>d});var r=s(7259);s(6363);var n=s(4014),o=s(5032),u=s(1443),a=s(2073),t=s(9074);function d(e){return(0,r.jsx)(o.e3,{className:(0,n.A)(u.G.wrapper.docsPages),children:(0,r.jsx)(t.A,{children:(0,a.v)(e.route.routes)})})}}}]);
@@ -1,4 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["2754"],{3329:function(e,n,s){s.d(n,{A:()=>j});var r=s(7259);s(6363);var t=s(4014),a=s(1443),i=s(3266),l=s(7285),o=s(3151),c=s(6593),d=s(1476);function u(e){return(0,r.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,r.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 h(){let e=(0,d.Ay)("/");return(0,r.jsx)("li",{className:"breadcrumbs__item",children:(0,r.jsx)(o.A,{"aria-label":(0,c.T)({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,r.jsx)(u,{className:"breadcrumbHomeIcon_bFVZ"})})})}var m=s(1941),b=s(3079);function x(e){let n=function({breadcrumbs:e}){let{siteConfig:n}=(0,b.A)();return{"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:e.filter(e=>e.href).map((e,s)=>({"@type":"ListItem",position:s+1,name:e.label,item:`${n.url}${e.href}`}))}}({breadcrumbs:e.breadcrumbs});return(0,r.jsx)(m.A,{children:(0,r.jsx)("script",{type:"application/ld+json",children:JSON.stringify(n)})})}function v({children:e,href:n,isLast:s}){let t="breadcrumbs__link";return s?(0,r.jsx)("span",{className:t,children:e}):n?(0,r.jsx)(o.A,{className:t,href:n,children:(0,r.jsx)("span",{children:e})}):(0,r.jsx)("span",{className:t,children:e})}function p({children:e,active:n}){return(0,r.jsx)("li",{className:(0,t.A)("breadcrumbs__item",{"breadcrumbs__item--active":n}),children:e})}function j(){let e=(0,i.OF)(),n=(0,l.Dt)();return e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x,{breadcrumbs:e}),(0,r.jsx)("nav",{className:(0,t.A)(a.G.docs.docBreadcrumbs,"breadcrumbsContainer_j0mV"),"aria-label":(0,c.T)({id:"theme.docs.breadcrumbs.navAriaLabel",message:"Breadcrumbs",description:"The ARIA label for the breadcrumbs"}),children:(0,r.jsxs)("ul",{className:"breadcrumbs",children:[n&&(0,r.jsx)(h,{}),e.map((n,s)=>{let t=s===e.length-1,a="category"===n.type&&n.linkUnlisted?void 0:n.href;return(0,r.jsx)(p,{active:t,children:(0,r.jsx)(v,{href:a,isLast:t,children:n.label})},s)})]})})]}):null}},7853:function(e,n,s){s.r(n),s.d(n,{default:()=>f});var r=s(7259);s(6363);var t=s(5032),a=s(3266),i=s(1476),l=s(4014),o=s(5034);function c({className:e}){let n=(0,a.a4)();return(0,r.jsx)(u,{items:n,className:e})}function d({item:e}){return(0,r.jsx)("article",{className:(0,l.A)("docCardListItem_VoKr","col col--6"),children:(0,r.jsx)(o.A,{item:e})})}function u(e){let{items:n,className:s}=e;if(!n)return(0,r.jsx)(c,{...e});let t=(0,a.d1)(n);return(0,r.jsx)("section",{className:(0,l.A)("row",s),children:t.map((e,n)=>(0,r.jsx)(d,{item:e},n))})}var h=s(9441),m=s(5024),b=s(841),x=s(3329),v=s(2834);let p={generatedIndexPage:"generatedIndexPage_Cx4z",title:"title_IUPg"};function j({categoryGeneratedIndex:e}){return(0,r.jsx)(t.be,{title:e.title,description:e.description,keywords:e.keywords,image:(0,i.Ay)(e.image)})}function g({categoryGeneratedIndex:e}){let n=(0,a.$S)();return(0,r.jsxs)("div",{className:p.generatedIndexPage,children:[(0,r.jsx)(m.A,{}),(0,r.jsx)(x.A,{}),(0,r.jsx)(b.A,{}),(0,r.jsxs)("header",{children:[(0,r.jsx)(v.A,{as:"h1",className:p.title,children:e.title}),e.description&&(0,r.jsx)("p",{children:e.description})]}),(0,r.jsx)("article",{className:"margin-top--lg",children:(0,r.jsx)(u,{items:n.items,className:p.list})}),(0,r.jsx)("footer",{className:"margin-top--md",children:(0,r.jsx)(h.A,{previous:e.navigation.previous,next:e.navigation.next})})]})}function f(e){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(j,{...e}),(0,r.jsx)(g,{...e})]})}},9441:function(e,n,s){s.d(n,{A:()=>o});var r=s(7259);s(6363);var t=s(4014),a=s(6593),i=s(3151);function l(e){let{permalink:n,title:s,subLabel:a,isNext:l}=e;return(0,r.jsxs)(i.A,{className:(0,t.A)("pagination-nav__link",l?"pagination-nav__link--next":"pagination-nav__link--prev"),to:n,children:[a&&(0,r.jsx)("div",{className:"pagination-nav__sublabel",children:a}),(0,r.jsx)("div",{className:"pagination-nav__label",children:s})]})}function o(e){let{className:n,previous:s,next:i}=e;return(0,r.jsxs)("nav",{className:(0,t.A)(n,"pagination-nav"),"aria-label":(0,a.T)({id:"theme.docs.paginator.navAriaLabel",message:"Docs pages",description:"The ARIA label for the docs pagination"}),children:[s&&(0,r.jsx)(l,{...s,subLabel:(0,r.jsx)(a.A,{id:"theme.docs.paginator.previous",description:"The label used to navigate to the previous doc",children:"Previous"})}),i&&(0,r.jsx)(l,{...i,subLabel:(0,r.jsx)(a.A,{id:"theme.docs.paginator.next",description:"The label used to navigate to the next doc",children:"Next"}),isNext:!0})]})}},841:function(e,n,s){s.d(n,{A:()=>o});var r=s(7259);s(6363);var t=s(4014),a=s(6593),i=s(1443),l=s(9303);function o({className:e}){let n=(0,l.r)();return n.badge?(0,r.jsx)("span",{className:(0,t.A)(e,i.G.docs.docVersionBadge,"badge badge--secondary"),children:(0,r.jsx)(a.A,{id:"theme.docs.versionBadge.label",values:{versionLabel:n.label},children:"Version: {versionLabel}"})}):null}},5024:function(e,n,s){s.d(n,{A:()=>v});var r=s(7259);s(6363);var t=s(4014),a=s(3079),i=s(3151),l=s(6593),o=s(9053),c=s(1443),d=s(4856),u=s(9303);let h={unreleased:function({siteTitle:e,versionMetadata:n}){return(0,r.jsx)(l.A,{id:"theme.docs.versions.unreleasedVersionLabel",description:"The label used to tell the user that he's browsing an unreleased doc version",values:{siteTitle:e,versionLabel:(0,r.jsx)("b",{children:n.label})},children:"This is unreleased documentation for {siteTitle} {versionLabel} version."})},unmaintained:function({siteTitle:e,versionMetadata:n}){return(0,r.jsx)(l.A,{id:"theme.docs.versions.unmaintainedVersionLabel",description:"The label used to tell the user that he's browsing an unmaintained doc version",values:{siteTitle:e,versionLabel:(0,r.jsx)("b",{children:n.label})},children:"This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained."})}};function m(e){let n=h[e.versionMetadata.banner];return(0,r.jsx)(n,{...e})}function b({versionLabel:e,to:n,onClick:s}){return(0,r.jsx)(l.A,{id:"theme.docs.versions.latestVersionSuggestionLabel",description:"The label used to tell the user to check the latest version",values:{versionLabel:e,latestVersionLink:(0,r.jsx)("b",{children:(0,r.jsx)(i.A,{to:n,onClick:s,children:(0,r.jsx)(l.A,{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({className:e,versionMetadata:n}){let{siteConfig:{title:s}}=(0,a.A)(),{pluginId:i}=(0,o.vT)({failfast:!0}),{savePreferredVersionName:l}=(0,d.g1)(i),{latestDocSuggestion:u,latestVersionSuggestion:h}=(0,o.HW)(i),x=u??h.docs.find(e=>e.id===h.mainDocId);return(0,r.jsxs)("div",{className:(0,t.A)(e,c.G.docs.docVersionBanner,"alert alert--warning margin-bottom--md"),role:"alert",children:[(0,r.jsx)("div",{children:(0,r.jsx)(m,{siteTitle:s,versionMetadata:n})}),(0,r.jsx)("div",{className:"margin-top--md",children:(0,r.jsx)(b,{versionLabel:h.label,to:x.path,onClick:()=>l(h.name)})})]})}function v({className:e}){let n=(0,u.r)();return n.banner?(0,r.jsx)(x,{className:e,versionMetadata:n}):null}},6773:function(e,n,s){s.d(n,{W:()=>o});var r=s(6363),t=s(3079);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,t.A)();return(0,r.useMemo)(()=>{try{let n;return n=new Intl.PluralRules(e),{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 r=e.split("|");if(1===r.length)return r[0];r.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 ${r.length}: ${e}`);let t=s.select(n);return r[Math.min(s.pluralForms.indexOf(t),r.length-1)]})(s,n,e)}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["7397"],{6511:function(e,t,n){n.r(t),n.d(t,{frontMatter:()=>c,toc:()=>d,default:()=>p,metadata:()=>a,assets:()=>r,contentTitle:()=>o});var a=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":"\u{1F9F1}"}},"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=n(7259),s=n(5511);let c={title:"Dynamic Packets",description:"How COSMOS dynamically builds packets",sidebar_custom_props:{myEmoji:"\u{1F9F1}"}},o,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.R)(),...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.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},5511:function(e,t,n){n.d(t,{R:()=>c,x:()=>o});var a=n(6363);let i={},s=a.createContext(i);function c(e){let t=a.useContext(s);return a.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),a.createElement(s.Provider,{value:t},e.children)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["9512"],{461:function(e,n,t){t.r(n),t.d(n,{frontMatter:()=>r,toc:()=>a,default:()=>u,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":"\u{1F642}"}},"sidebar":"defaultSidebar","previous":{"title":"Meta","permalink":"/tools/staticdocs/docs/meta"},"next":{"title":"Licenses","permalink":"/tools/staticdocs/docs/meta/licenses"}}'),i=t(7259),s=t(5511);let r={title:"Contributing",description:"Contributing to COSMOS using the github workflow",sidebar_custom_props:{myEmoji:"\u{1F642}"}},c,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.R)(),...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.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},5511:function(e,n,t){t.d(n,{R:()=>r,x:()=>c});var o=t(6363);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([["8539"],{5254:function(e,t,i){i.r(t),i.d(t,{frontMatter:()=>r,toc:()=>h,default:()=>c,metadata:()=>n,assets:()=>o,contentTitle:()=>l});var n=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":"\u{1F4C8}"}},"sidebar":"defaultSidebar","previous":{"title":"Table Manager","permalink":"/tools/staticdocs/docs/tools/table-manager"},"next":{"title":"Telemetry Viewer","permalink":"/tools/staticdocs/docs/tools/tlm-viewer"}}'),a=i(7259),s=i(5511);let r={title:"Telemetry Grapher",description:"Graph real time or historical data",sidebar_custom_props:{myEmoji:"\u{1F4C8}"}},l,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.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.h2,{id:"introductions",children:"Introductions"}),"\n",(0,a.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,a.jsx)(t.p,{children:(0,a.jsx)(t.img,{alt:"Telemetry Grapher",src:i(4749).A+"",width:"1270",height:"927"})}),"\n",(0,a.jsx)(t.h2,{id:"telemetry-grapher-menus",children:"Telemetry Grapher Menus"}),"\n",(0,a.jsx)(t.h3,{id:"file-menu-items",children:"File Menu Items"}),"\n",(0,a.jsx)("img",{src:i(3092).A,alt:"File Menu",style:{float:"left","margin-right":"50px",height:"90px"}}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsx)(t.li,{children:"Open a saved configuration (graphs and items)"}),"\n",(0,a.jsx)(t.li,{children:"Save the current configuration"}),"\n",(0,a.jsx)(t.li,{children:"Reset the configuration (default settings)"}),"\n"]}),"\n",(0,a.jsx)(t.h4,{id:"open-configuration",children:"Open Configuration"}),"\n",(0,a.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,a.jsx)(t.h4,{id:"save-configuration",children:"Save Configuration"}),"\n",(0,a.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,a.jsx)(t.h3,{id:"graph-menu-items",children:"Graph Menu Items"}),"\n",(0,a.jsx)("img",{src:i(1048).A,alt:"File Menu",style:{float:"left","margin-right":"50px",height:"150px"}}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsx)(t.li,{children:"Add a new graph"}),"\n",(0,a.jsx)(t.li,{children:"Start / Resume graphing"}),"\n",(0,a.jsx)(t.li,{children:"Pause graph"}),"\n",(0,a.jsx)(t.li,{children:"Stop graph"}),"\n",(0,a.jsx)(t.li,{children:"Edit grapher settings"}),"\n"]}),"\n",(0,a.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,a.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,a.jsx)(t.p,{children:(0,a.jsx)(t.img,{alt:"Edit Graph",src:i(999).A+"",width:"592",height:"766"})}),"\n",(0,a.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,a.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,a.jsx)(t.p,{children:(0,a.jsx)(t.img,{alt:"Min Max",src:i(3378).A+"",width:"1247",height:"718"})}),"\n",(0,a.jsx)(t.h2,{id:"selecting-items",children:"Selecting Items"}),"\n",(0,a.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,a.jsx)(t.p,{children:(0,a.jsx)(t.img,{alt:"Temp 1",src:i(9362).A+"",width:"1247",height:"829"})}),"\n",(0,a.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,a.jsx)(t.p,{children:(0,a.jsx)(t.img,{alt:"Temp 1 History",src:i(324).A+"",width:"1247",height:"829"})}),"\n",(0,a.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,a.jsx)(t.p,{children:(0,a.jsx)(t.img,{alt:"Temp1 Temp2",src:i(2859).A+"",width:"1247",height:"829"})}),"\n",(0,a.jsx)(t.h2,{id:"graph-window-management",children:"Graph Window Management"}),"\n",(0,a.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,a.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,a.jsx)(t.p,{children:(0,a.jsx)(t.img,{alt:"Four Graphs",src:i(8836).A+"",width:"1247",height:"710"})}),"\n",(0,a.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,a.jsx)(t.p,{children:(0,a.jsx)(t.img,{alt:"Two Full Width",src:i(7785).A+"",width:"1247",height:"833"})}),"\n",(0,a.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,a.jsx)(t.p,{children:(0,a.jsx)(t.img,{alt:"Two Full Height",src:i(4184).A+"",width:"1247",height:"833"})}),"\n",(0,a.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,a.jsx)(t.p,{children:(0,a.jsx)(t.img,{alt:"Minimized",src:i(4796).A+"",width:"1247",height:"833"})}),"\n",(0,a.jsx)(t.p,{children:"The final X button closes the graph."})]})}function c(e={}){let{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},3092:function(e,t,i){i.d(t,{A:()=>n});let n=i.p+"assets/images/file_menu-1c05cfc08f9d07b3f7122d2fe1ad98ed428dc563d2c5d2edddbed71f46779eb8.png"},1048:function(e,t,i){i.d(t,{A:()=>n});let n=i.p+"assets/images/graph_menu-289cbbb168622f661c1c98a7bd2c1b43f888e9c3560ba4e1d435ab62d0aad6de.png"},999:function(e,t,i){i.d(t,{A:()=>n});let n=i.p+"assets/images/edit_graph-9618076f837e0d358ea0bfbf503d43b377805d818370405536f5a1c049209e99.png"},8836:function(e,t,i){i.d(t,{A:()=>n});let n=i.p+"assets/images/four_graphs-1aa5a7cb9ce51cec815fc9d8740b40e113bd171c4977711d47ef1e6daf02719e.png"},3378:function(e,t,i){i.d(t,{A:()=>n});let n=i.p+"assets/images/graph_min_max-75be4a19a7e13a1b9b7a18a9b898b170c8ded7768b01ce6c6effd566ac8e071a.png"},9362:function(e,t,i){i.d(t,{A:()=>n});let n=i.p+"assets/images/graph_temp1-028d8660c779136ff017b0b8a9fadb294e9ff478a65d7bd73032c3c2ed4f03d0.png"},2859:function(e,t,i){i.d(t,{A:()=>n});let n=i.p+"assets/images/graph_temp1_temp2-ad650da0ddf1fb5c6e9764b737bfab3027f5abcb935ad86d9716dfdf13032dca.png"},324:function(e,t,i){i.d(t,{A:()=>n});let n=i.p+"assets/images/graph_temp1_time-53c18518755d1d1c816db7f0a67e26c5408aba32b644fda519b5ecf7a7ee9b27.png"},4796:function(e,t,i){i.d(t,{A:()=>n});let n=i.p+"assets/images/minimized-47ddb9b9b68b47aae3d0a12cb39ab767adf446acbe213c0b5565c1bfaf8a463f.png"},4749:function(e,t,i){i.d(t,{A:()=>n});let n=i.p+"assets/images/telemetry_grapher-3a37c074a25b7912a76d96fd46a1431d27202d71374f78c829f273e5cb342233.png"},4184:function(e,t,i){i.d(t,{A:()=>n});let n=i.p+"assets/images/two_full_height-ccba2940b80345f3569ea47b7ddd3390c08195de91559f5586f85e36e411afd6.png"},7785:function(e,t,i){i.d(t,{A:()=>n});let n=i.p+"assets/images/two_full_width-0116adbf994500a24d4717e002d32098f8d6197bcece510b84b90400f23feade.png"},5511:function(e,t,i){i.d(t,{R:()=>r,x:()=>l});var n=i(6363);let a={},s=n.createContext(a);function r(e){let t=n.useContext(s);return n.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(a):e.components||a:r(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([["7785"],{5595:function(e,n,t){t.r(n),t.d(n,{frontMatter:()=>o,toc:()=>c,default:()=>h,metadata:()=>i,assets:()=>l,contentTitle:()=>a});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":"\u{1F3C3}\u200D\u27A1\uFE0F"}},"sidebar":"defaultSidebar","previous":{"title":"Roles and Permissions","permalink":"/tools/staticdocs/docs/guides/roles-permissions"},"next":{"title":"Scripting API Guide","permalink":"/tools/staticdocs/docs/guides/scripting-api"}}'),s=t(7259),r=t(5511);let o={title:"Script Writing Guide",description:"Key concepts and best practices for script writing",sidebar_custom_props:{myEmoji:"\u{1F3C3}\u200D\u27A1\uFE0F"}},a,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.R)(),...e.components},{TabItem:t,Tabs:i}=n;return t||u("TabItem",!0),i||u("Tabs",!0),(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.jsxs)(i,{groupId:"script-language",children:[(0,s.jsx)(t,{value:"python",label:"Python",children:(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'})})}),(0,s.jsx)(t,{value:"ruby",label:"Ruby",children:(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:"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.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}function u(e,n){throw Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},5511:function(e,n,t){t.d(n,{R:()=>o,x:()=>a});var i=t(6363);let s={},r=i.createContext(s);function o(e){let n=i.useContext(r);return i.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(s):e.components||s:o(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["4684"],{3329:function(e,n,s){s.d(n,{A:()=>p});var t=s(7259);s(6363);var a=s(4014),i=s(1443),l=s(3266),r=s(7285),o=s(3151),c=s(6593),d=s(1476);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 h(){let e=(0,d.Ay)("/");return(0,t.jsx)("li",{className:"breadcrumbs__item",children:(0,t.jsx)(o.A,{"aria-label":(0,c.T)({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_bFVZ"})})})}var m=s(1941),b=s(3079);function x(e){let n=function({breadcrumbs:e}){let{siteConfig:n}=(0,b.A)();return{"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:e.filter(e=>e.href).map((e,s)=>({"@type":"ListItem",position:s+1,name:e.label,item:`${n.url}${e.href}`}))}}({breadcrumbs:e.breadcrumbs});return(0,t.jsx)(m.A,{children:(0,t.jsx)("script",{type:"application/ld+json",children:JSON.stringify(n)})})}function v({children:e,href:n,isLast:s}){let a="breadcrumbs__link";return s?(0,t.jsx)("span",{className:a,children:e}):n?(0,t.jsx)(o.A,{className:a,href:n,children:(0,t.jsx)("span",{children:e})}):(0,t.jsx)("span",{className:a,children:e})}function j({children:e,active:n}){return(0,t.jsx)("li",{className:(0,a.A)("breadcrumbs__item",{"breadcrumbs__item--active":n}),children:e})}function p(){let e=(0,l.OF)(),n=(0,r.Dt)();return e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x,{breadcrumbs:e}),(0,t.jsx)("nav",{className:(0,a.A)(i.G.docs.docBreadcrumbs,"breadcrumbsContainer_j0mV"),"aria-label":(0,c.T)({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)(h,{}),e.map((n,s)=>{let a=s===e.length-1,i="category"===n.type&&n.linkUnlisted?void 0:n.href;return(0,t.jsx)(j,{active:a,children:(0,t.jsx)(v,{href:i,isLast:a,children:n.label})},s)})]})})]}):null}},4519:function(e,n,s){s.r(n),s.d(n,{default:()=>I});var t=s(7259),a=s(6363),i=s(5032),l=s(40);let r=a.createContext(null);function o({children:e,content:n}){let s=(0,a.useMemo)(()=>({metadata:n.metadata,frontMatter:n.frontMatter,assets:n.assets,contentTitle:n.contentTitle,toc:n.toc}),[n]);return(0,t.jsx)(r.Provider,{value:s,children:e})}function c(){let e=(0,a.useContext)(r);if(null===e)throw new l.dV("DocProvider");return e}function d(){let{metadata:e,frontMatter:n,assets:s}=c();return(0,t.jsx)(i.be,{title:e.title,description:e.description,keywords:n.keywords,image:s.image??n.image})}var u=s(4014),h=s(4121),m=s(9441);function b(){let{metadata:e}=c();return(0,t.jsx)(m.A,{className:"docusaurus-mt-lg",previous:e.previous,next:e.next})}var x=s(5024),v=s(841),j=s(1443),p=s(6593),g=s(3151);function f({permalink:e,label:n,count:s,description:a}){return(0,t.jsxs)(g.A,{rel:"tag",href:e,title:a,className:(0,u.A)("tag_BK9L",s?"tagWithCount_LJDF":"tagRegular_A5bT"),children:[n,s&&(0,t.jsx)("span",{children:s})]})}function A({tags:e}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:(0,t.jsx)(p.A,{id:"theme.tags.tagsListLabel",description:"The label alongside a tag list",children:"Tags:"})}),(0,t.jsx)("ul",{className:(0,u.A)("tags_iZXR","padding--none","margin-left--sm"),children:e.map(e=>(0,t.jsx)("li",{className:"tag_B7Up",children:(0,t.jsx)(f,{...e})},e.permalink))})]})}var _=s(3275);function N(){let{metadata:e}=c(),{editUrl:n,lastUpdatedAt:s,lastUpdatedBy:a,tags:i}=e,l=i.length>0,r=!!(n||s||a);return l||r?(0,t.jsxs)("footer",{className:(0,u.A)(j.G.docs.docFooter,"docusaurus-mt-lg"),children:[l&&(0,t.jsx)("div",{className:(0,u.A)("row margin-top--sm",j.G.docs.docFooterTagsRow),children:(0,t.jsx)("div",{className:"col",children:(0,t.jsx)(A,{tags:i})})}),r&&(0,t.jsx)(_.A,{className:(0,u.A)("margin-top--sm",j.G.docs.docFooterEditMetaRow),editUrl:n,lastUpdatedAt:s,lastUpdatedBy:a})]}):null}var L=s(8218),T=s(9288);function k({collapsed:e,...n}){return(0,t.jsx)("button",{type:"button",...n,className:(0,u.A)("clean-btn","tocCollapsibleButton_hLJL",!e&&"tocCollapsibleButtonExpanded_HpVR",n.className),children:(0,t.jsx)(p.A,{id:"theme.TOCCollapsible.toggleButtonLabel",description:"The label used by the button on the collapsible TOC component",children:"On this page"})})}function C({toc:e,className:n,minHeadingLevel:s,maxHeadingLevel:a}){let{collapsed:i,toggleCollapsed:l}=(0,L.u)({initialState:!0});return(0,t.jsxs)("div",{className:(0,u.A)("tocCollapsible_XYrz",!i&&"tocCollapsibleExpanded_W4o9",n),children:[(0,t.jsx)(k,{collapsed:i,onClick:l}),(0,t.jsx)(L.N,{lazy:!0,className:"tocCollapsibleContent_i3RS",collapsed:i,children:(0,t.jsx)(T.A,{toc:e,minHeadingLevel:s,maxHeadingLevel:a})})]})}function w(){let{toc:e,frontMatter:n}=c();return(0,t.jsx)(C,{toc:e,minHeadingLevel:n.toc_min_heading_level,maxHeadingLevel:n.toc_max_heading_level,className:(0,u.A)(j.G.docs.docTocMobile,"tocMobile_SBzZ")})}var y=s(4488);function B(){let{toc:e,frontMatter:n}=c();return(0,t.jsx)(y.A,{toc:e,minHeadingLevel:n.toc_min_heading_level,maxHeadingLevel:n.toc_max_heading_level,className:j.G.docs.docTocDesktop})}var V=s(2834),H=s(3324);function M({children:e}){let n=function(){let{metadata:e,frontMatter:n,contentTitle:s}=c();return n.hide_title||void 0!==s?null:e.title}();return(0,t.jsxs)("div",{className:(0,u.A)(j.G.docs.docMarkdown,"markdown"),children:[n&&(0,t.jsx)("header",{children:(0,t.jsx)(V.A,{as:"h1",children:n})}),(0,t.jsx)(H.A,{children:e})]})}var F=s(3329),G=s(9598);function R({children:e}){let n=function(){let{frontMatter:e,toc:n}=c(),s=(0,h.l)(),a=e.hide_table_of_contents,i=!a&&n.length>0;return{hidden:a,mobile:i?(0,t.jsx)(w,{}):void 0,desktop:i&&("desktop"===s||"ssr"===s)?(0,t.jsx)(B,{}):void 0}}(),{metadata:s}=c();return(0,t.jsxs)("div",{className:"row",children:[(0,t.jsxs)("div",{className:(0,u.A)("col",!n.hidden&&"docItemCol_Vt7O"),children:[(0,t.jsx)(G.A,{metadata:s}),(0,t.jsx)(x.A,{}),(0,t.jsxs)("div",{className:"docItemContainer_E44C",children:[(0,t.jsxs)("article",{children:[(0,t.jsx)(F.A,{}),(0,t.jsx)(v.A,{}),n.mobile,(0,t.jsx)(M,{children:e}),(0,t.jsx)(N,{})]}),(0,t.jsx)(b,{})]})]}),n.desktop&&(0,t.jsx)("div",{className:"col col--3",children:n.desktop})]})}function I(e){let n=`docs-doc-id-${e.content.metadata.id}`,s=e.content;return(0,t.jsx)(o,{content:e.content,children:(0,t.jsxs)(i.e3,{className:n,children:[(0,t.jsx)(d,{}),(0,t.jsx)(R,{children:(0,t.jsx)(s,{})})]})})}},9441:function(e,n,s){s.d(n,{A:()=>o});var t=s(7259);s(6363);var a=s(4014),i=s(6593),l=s(3151);function r(e){let{permalink:n,title:s,subLabel:i,isNext:r}=e;return(0,t.jsxs)(l.A,{className:(0,a.A)("pagination-nav__link",r?"pagination-nav__link--next":"pagination-nav__link--prev"),to:n,children:[i&&(0,t.jsx)("div",{className:"pagination-nav__sublabel",children:i}),(0,t.jsx)("div",{className:"pagination-nav__label",children:s})]})}function o(e){let{className:n,previous:s,next:l}=e;return(0,t.jsxs)("nav",{className:(0,a.A)(n,"pagination-nav"),"aria-label":(0,i.T)({id:"theme.docs.paginator.navAriaLabel",message:"Docs pages",description:"The ARIA label for the docs pagination"}),children:[s&&(0,t.jsx)(r,{...s,subLabel:(0,t.jsx)(i.A,{id:"theme.docs.paginator.previous",description:"The label used to navigate to the previous doc",children:"Previous"})}),l&&(0,t.jsx)(r,{...l,subLabel:(0,t.jsx)(i.A,{id:"theme.docs.paginator.next",description:"The label used to navigate to the next doc",children:"Next"}),isNext:!0})]})}},841:function(e,n,s){s.d(n,{A:()=>o});var t=s(7259);s(6363);var a=s(4014),i=s(6593),l=s(1443),r=s(9303);function o({className:e}){let n=(0,r.r)();return n.badge?(0,t.jsx)("span",{className:(0,a.A)(e,l.G.docs.docVersionBadge,"badge badge--secondary"),children:(0,t.jsx)(i.A,{id:"theme.docs.versionBadge.label",values:{versionLabel:n.label},children:"Version: {versionLabel}"})}):null}},5024:function(e,n,s){s.d(n,{A:()=>v});var t=s(7259);s(6363);var a=s(4014),i=s(3079),l=s(3151),r=s(6593),o=s(9053),c=s(1443),d=s(4856),u=s(9303);let h={unreleased:function({siteTitle:e,versionMetadata:n}){return(0,t.jsx)(r.A,{id:"theme.docs.versions.unreleasedVersionLabel",description:"The label used to tell the user that he's browsing an unreleased doc version",values:{siteTitle:e,versionLabel:(0,t.jsx)("b",{children:n.label})},children:"This is unreleased documentation for {siteTitle} {versionLabel} version."})},unmaintained:function({siteTitle:e,versionMetadata:n}){return(0,t.jsx)(r.A,{id:"theme.docs.versions.unmaintainedVersionLabel",description:"The label used to tell the user that he's browsing an unmaintained doc version",values:{siteTitle:e,versionLabel:(0,t.jsx)("b",{children:n.label})},children:"This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained."})}};function m(e){let n=h[e.versionMetadata.banner];return(0,t.jsx)(n,{...e})}function b({versionLabel:e,to:n,onClick:s}){return(0,t.jsx)(r.A,{id:"theme.docs.versions.latestVersionSuggestionLabel",description:"The label used to tell the user to check the latest version",values:{versionLabel:e,latestVersionLink:(0,t.jsx)("b",{children:(0,t.jsx)(l.A,{to:n,onClick:s,children:(0,t.jsx)(r.A,{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({className:e,versionMetadata:n}){let{siteConfig:{title:s}}=(0,i.A)(),{pluginId:l}=(0,o.vT)({failfast:!0}),{savePreferredVersionName:r}=(0,d.g1)(l),{latestDocSuggestion:u,latestVersionSuggestion:h}=(0,o.HW)(l),x=u??h.docs.find(e=>e.id===h.mainDocId);return(0,t.jsxs)("div",{className:(0,a.A)(e,c.G.docs.docVersionBanner,"alert alert--warning margin-bottom--md"),role:"alert",children:[(0,t.jsx)("div",{children:(0,t.jsx)(m,{siteTitle:s,versionMetadata:n})}),(0,t.jsx)("div",{className:"margin-top--md",children:(0,t.jsx)(b,{versionLabel:h.label,to:x.path,onClick:()=>r(h.name)})})]})}function v({className:e}){let n=(0,u.r)();return n.banner?(0,t.jsx)(x,{className:e,versionMetadata:n}):null}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["5072"],{6718:function(c,e,n){n.d(e,{A:()=>o});let o=n(6430)},7236:function(){}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["4553"],{5851:function(e,i,t){t.r(i),t.d(i,{frontMatter:()=>a,toc:()=>d,default:()=>h,metadata:()=>n,assets:()=>r,contentTitle:()=>l});var n=JSON.parse('{"id":"tools/limits-monitor","title":"Limits Monitor","description":"View out of limit items and log messages","source":"@site/docs/tools/limits-monitor.md","sourceDirName":"tools","slug":"/tools/limits-monitor","permalink":"/tools/staticdocs/docs/tools/limits-monitor","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/tools/limits-monitor.md","tags":[],"version":"current","frontMatter":{"title":"Limits Monitor","description":"View out of limit items and log messages","sidebar_custom_props":{"myEmoji":"\u{1F6A5}"}},"sidebar":"defaultSidebar","previous":{"title":"Handbooks","permalink":"/tools/staticdocs/docs/tools/handbooks"},"next":{"title":"Log Explorer (Enterprise)","permalink":"/tools/staticdocs/docs/tools/log-explorer"}}'),s=t(7259),o=t(5511);let a={title:"Limits Monitor",description:"View out of limit items and log messages",sidebar_custom_props:{myEmoji:"\u{1F6A5}"}},l,r={},d=[{value:"Introduction",id:"introduction",level:2},{value:"Limits Monitor Menus",id:"limits-monitor-menus",level:2},{value:"File Menu Items",id:"file-menu-items",level:3},{value:"Show Ignored",id:"show-ignored",level:4},{value:"Change Limits Set",id:"change-limits-set",level:4},{value:"Open Configuration",id:"open-configuration",level:4},{value:"Save Configuration",id:"save-configuration",level:4},{value:"Limits Items",id:"limits-items",level:2},{value:"Limits Log",id:"limits-log",level:2}];function c(e){let i={a:"a",h2:"h2",h3:"h3",h4:"h4",img:"img",li:"li",p:"p",ul:"ul",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.h2,{id:"introduction",children:"Introduction"}),"\n",(0,s.jsx)(i.p,{children:"The Limits Monitor application provides situational awareness for all telemetry items with limits. All limits items which violate their yellow or red limits are shown and continue to be shown until explicitly dismissed. Individual items and entire packets can be manually ignored to filter out known issues. In addition, all limits events are logged in a table which can be searched."}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.img,{alt:"Cmd Tlm Server",src:t(9181).A+"",width:"1270",height:"803"})}),"\n",(0,s.jsx)(i.h2,{id:"limits-monitor-menus",children:"Limits Monitor Menus"}),"\n",(0,s.jsx)(i.h3,{id:"file-menu-items",children:"File Menu Items"}),"\n",(0,s.jsx)("img",{src:t(4648).A,alt:"File Menu",style:{float:"left","margin-right":"50px",height:"150px"}}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsx)(i.li,{children:"Show the list of ignored items"}),"\n",(0,s.jsx)(i.li,{children:"Change the overall COSMOS limits set"}),"\n",(0,s.jsx)(i.li,{children:"Opens a saved configuration"}),"\n",(0,s.jsx)(i.li,{children:"Save the current configuration (ignored items)"}),"\n",(0,s.jsx)(i.li,{children:"Reset the configuration (defaults settings)"}),"\n"]}),"\n",(0,s.jsx)(i.h4,{id:"show-ignored",children:"Show Ignored"}),"\n",(0,s.jsx)(i.p,{children:"This dialog displays all the items which the user has manually ignored by clicking the ignore icons next to out of limits items. Note that entire Packets which have been ignored are listed as TARGET PACKET without an item (as shown by INST MECH). Ignored items are removed by clicking the Trash icon. This means that the next time this item goes out of limits it will be displayed."}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.img,{alt:"Ignored",src:t(226).A+"",width:"594",height:"306"})}),"\n",(0,s.jsx)(i.h4,{id:"change-limits-set",children:"Change Limits Set"}),"\n",(0,s.jsxs)(i.p,{children:["Limits sets are defined with the ",(0,s.jsx)(i.a,{href:"../configuration/telemetry#limits",children:"LIMITS"})," keyword on telemetry items. Each item must have at least a DEFAULT limits set but can also have other named limit sets. COSMOS only has a single limits set active at one time. This dialog allows the user to change the active limits set and apply new limit values across all of COSMOS."]}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.img,{alt:"Change Limits Set",src:t(2078).A+"",width:"647",height:"217"})}),"\n",(0,s.jsx)(i.h4,{id:"open-configuration",children:"Open Configuration"}),"\n",(0,s.jsx)(i.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,s.jsx)(i.h4,{id:"save-configuration",children:"Save Configuration"}),"\n",(0,s.jsx)(i.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,s.jsx)(i.h2,{id:"limits-items",children:"Limits Items"}),"\n",(0,s.jsx)(i.p,{children:"The main interface of Limits Monitor is the top where items are displayed when they violate a yellow or red limit."}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.img,{alt:"Limits",src:t(9181).A+"",width:"1270",height:"803"})}),"\n",(0,s.jsxs)(i.p,{children:["Items with limits values are displayed using a red yellow green limits bar displaying where the current value lies within the defined limits (as shown by the various TEMP items). Items with yellow or red ",(0,s.jsx)(i.a,{href:"/tools/staticdocs/docs/configuration/telemetry#state",children:"states"})," are simply displayed with their state color (as shown by GROUND1STATUS). The COSMOS Demo contains both INST HEALTH_STATUS TEMP2 and INST2 HEALTH_STATUS TEMP2 which are identically named items within different target packets. Limits Monitor only displays the item name to save space, however if you mouse over the value box the full target and packet name is displayed."]}),"\n",(0,s.jsx)(i.p,{children:"Clicking the first nested 'X' icon ignores the entire packet where the item resides. Any additional items in that packet which go out of limits are also ignored by Limits Monitor. Clicking the second (middle) 'X' ignores ONLY that specific item. If any packets or items are ignored the Overall Limits State is updated to indicate \"(Some items ignored)\" to indicate the Limits State is potentially being affected by ignored items."}),"\n",(0,s.jsx)(i.p,{children:"Clicking the last icon (eye with strike-through) temporarily hides the specified item. This is different from ignoring an item because if this item goes out of limits it will be again be displayed. Hiding an item is useful if the item has gone back to green and you want to continue to track it but want to clean up the current list of items. For example, we might hide the GROUND1STATUS items in the above example as they have transitioned back to green."}),"\n",(0,s.jsx)(i.h2,{id:"limits-log",children:"Limits Log"}),"\n",(0,s.jsx)(i.p,{children:"The Log section lists all limits events. Events can be filtered by using the Search box as shown."}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.img,{alt:"Log",src:t(9022).A+"",width:"1261",height:"522"})})]})}function h(e={}){let{wrapper:i}={...(0,o.R)(),...e.components};return i?(0,s.jsx)(i,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},4648:function(e,i,t){t.d(i,{A:()=>n});let n=t.p+"assets/images/file_menu-953e2fc0c1a5b30c90d6f748add6ee28f8b42f30fc33d0b3c8709d6c85f06585.png"},2078:function(e,i,t){t.d(i,{A:()=>n});let n=t.p+"assets/images/change_limits_set-b72da282ea28d783bd7e1d0cd48db72486dacb4e76e1cd46d52c7999028d9c0d.png"},226:function(e,i,t){t.d(i,{A:()=>n});let n=t.p+"assets/images/ignored-0917bd9f41f4e93704daa45cc0a7b70809bdbba03615d6de254336141b598992.png"},9181:function(e,i,t){t.d(i,{A:()=>n});let n=t.p+"assets/images/limits_monitor-34ca441e5a7198b4dc57a27b2e6fcb973dddad5eaaa5e9bf0d60738f4143c73a.png"},9022:function(e,i,t){t.d(i,{A:()=>n});let n=t.p+"assets/images/log-6cf3276d9e6b7dc30573b2b6a5989c6c5defc658e2c0ae4c2150a5fd11fd49d3.png"},5511:function(e,i,t){t.d(i,{R:()=>a,x:()=>l});var n=t(6363);let s={},o=n.createContext(s);function a(e){let i=n.useContext(o);return n.useMemo(function(){return"function"==typeof e?e(i):{...i,...e}},[i,e])}function l(e){let i;return i=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),n.createElement(o.Provider,{value:i},e.children)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["9621"],{7588:function(e,n,t){t.r(n),t.d(n,{frontMatter:()=>r,toc:()=>d,default:()=>h,metadata:()=>i,assets:()=>c,contentTitle:()=>o});var i=JSON.parse('{"id":"development/streaming-api","title":"Streaming API","description":"Using the websocket streaming API to retrieve data","source":"@site/docs/development/streaming-api.md","sourceDirName":"development","slug":"/development/streaming-api","permalink":"/tools/staticdocs/docs/development/streaming-api","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/development/streaming-api.md","tags":[],"version":"current","frontMatter":{"title":"Streaming API","description":"Using the websocket streaming API to retrieve data","sidebar_custom_props":{"myEmoji":"\u{1F4DD}"}},"sidebar":"defaultSidebar","previous":{"title":"Roadmap","permalink":"/tools/staticdocs/docs/development/roadmap"},"next":{"title":"Testing COSMOS","permalink":"/tools/staticdocs/docs/development/testing"}}'),a=t(7259),s=t(5511);let r={title:"Streaming API",description:"Using the websocket streaming API to retrieve data",sidebar_custom_props:{myEmoji:"\u{1F4DD}"}},o,c={},d=[{value:"Ruby Example",id:"ruby-example",level:2},{value:"StreamingApi Architecture",id:"streamingapi-architecture",level:2},{value:"Architecture Overview",id:"architecture-overview",level:3},{value:"Key Components",id:"key-components",level:3},{value:"StreamingApi",id:"streamingapi",level:4},{value:"StreamingThread",id:"streamingthread",level:4},{value:"RealtimeStreamingThread",id:"realtimestreamingthread",level:4},{value:"LoggedStreamingThread",id:"loggedstreamingthread",level:4},{value:"StreamingObject",id:"streamingobject",level:4},{value:"StreamingObjectCollection",id:"streamingobjectcollection",level:4},{value:"Data Flow",id:"data-flow",level:3},{value:"Performance Considerations",id:"performance-considerations",level:3},{value:"Security",id:"security",level:3}];function l(e){let n={admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",ul:"ul",...(0,s.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.admonition,{title:"This documentation is for COSMOS Developers",type:"note",children:(0,a.jsx)(n.p,{children:"This information is just generally used behind the scenes in COSMOS tools"})}),"\n",(0,a.jsx)(n.p,{children:"The COSMOS 5 Streaming Api is the primary interface to receive a stream of the telemetry packets and/or command packets that have passed through the COSMOS system, both logged and continuously in realtime. Either raw binary packets or decommutated JSON packets can be requested."}),"\n",(0,a.jsx)(n.p,{children:"This API is implemented over Websockets using the Rails ActionCable framework. Actioncable client libraries are known to exist for at least Javascript, Ruby, and Python. Other languages may exist or could be created. Websockets allow for easy interaction with the new COSMOS 5 Javascript based frontend."}),"\n",(0,a.jsx)(n.p,{children:"The following interactions are all shown in Javascript, but would be very similar in any language.\nConnecting to this API begins by initiating an ActionCable connection."}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{children:"cable = ActionCable.createConsumer('/openc3-api/cable')\n"})}),"\n",(0,a.jsx)(n.p,{children:"This call opens the HTTP connection to the given URL and upgrades it to a websocket connection. This connection can then be shared with multiple \u201Csubscriptions\u201D."}),"\n",(0,a.jsx)(n.p,{children:"A subscription describes a set of data that you want the API to stream to you. Creating a subscription looks like this:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-javascript",children:'subscription = cable.subscriptions.create(\n {\n channel: "StreamingChannel",\n scope: "DEFAULT",\n token: token,\n },\n {\n received: (data) => {\n // Handle received data\n },\n connected: () => {\n // First chance to add what you want to stream here\n },\n disconnected: () => {\n // Handle the subscription being disconnected\n },\n rejected: () => {\n // Handle the subscription being rejected\n },\n }\n);\n'})}),"\n",(0,a.jsxs)(n.p,{children:["Subscribing to the StreamingApi requires passing a channel name set to \u201CStreamingChannel\u201D, a scope which is typically \u201CDEFAULT\u201D, and an access token (a password in COSMOS Core). In Javascript you also pass a set of callback functions that run at various lifecycle points in the subscription. The most important of these are ",(0,a.jsx)(n.code,{children:"connected"})," and ",(0,a.jsx)(n.code,{children:"received"}),"."]}),"\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.code,{children:"connected"})," runs when the subscription is accepted by the StreamApi. This callback is the first opportunity to request specific data that you would like streamed. Data can also be added or removed at any time while the subscription is open."]}),"\n",(0,a.jsx)(n.p,{children:"Data can be added to the stream by requesting individual items from a packet or by requesting the entire packet."}),"\n",(0,a.jsx)(n.p,{children:"Adding items to stream is done as follows:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-javascript",children:'var items = [\n ["DECOM__TLM__INST__ADCS__Q1__RAW", "0"],\n ["DECOM__CMD__INST__COLLECT__DURATION__WITH_UNITS", "1"],\n];\nOpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity).then(() => {\n this.subscription.perform("add", {\n scope: window.openc3Scope,\n token: localStorage.openc3Token,\n items: items,\n start_time: this.startDateTime,\n end_time: this.endDateTime,\n });\n});\n'})}),"\n",(0,a.jsxs)(n.p,{children:["The values in the item name are separated by double underscores, e.g. ",(0,a.jsx)(n.code,{children:"<MODE>__<CMD or TLM>__<TARGET NAME>__<PACKET NAME>__<ITEM NAME>__<VALUE TYPE>__<REDUCED TYPE>"}),". Mode is either RAW, DECOM, REDUCED_MINUTE, REDUCED_HOUR, or REDUCED_DAY. The next parameter is CMD or TLM followed by the target, packet and item names. The Value Type is one of RAW, CONVERTED, FORMATTED, or WITH_UNITS. The last parameter is optional if you want to use the reduced data types. Reduced Type is one of SAMPLE, MIN, MAX, AVG, or STDDEV."]}),"\n",(0,a.jsx)(n.p,{children:"Adding packets to stream is done as follows:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-javascript",children:'var packets = [\n ["RAW__TLM__INST__ADCS", "0"],\n ["DECOM__TLM__INST__HEALTH_STATUS__FORMATTED", "1"],\n];\nOpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity).then(() => {\n this.subscription.perform("add", {\n scope: window.openc3Scope,\n token: localStorage.openc3Token,\n packets: packets,\n start_time: this.startDateTime,\n end_time: this.endDateTime,\n });\n});\n'})}),"\n",(0,a.jsxs)(n.p,{children:["The values in the packet name are separated by double underscores, e.g. ",(0,a.jsx)(n.code,{children:"<MODE>__<CMD or TLM>__<TARGET NAME>__<PACKET NAME>__<VALUE TYPE>"}),". Mode is either RAW or DECOM. The next parameter is CMD or TLM followed by the target and packet names. The Value Type is one of RAW, CONVERTED, FORMATTED, or WITH_UNITS."]}),"\n",(0,a.jsx)(n.p,{children:"For Raw mode, VALUE TYPE should be set to RAW or omitted (e.g. TLM__INST__ADCS__RAW or TLM__INST__ADCS).\nstart_time and end_time are standard COSMOS 64-bit integer timestamps in nanoseconds since the Unix Epoch (midnight January 1st, 1970). If start_time is null, that indicates to start streaming from the current time in realtime, indefinitely until items are removed, or the subscription is unsubscribed. end_time is ignored if start_time is null. If start_time is given and end_time is null, that indicates to playback from the given starttime and then continue indefinitely in realtime. If both start_time and end_time are given, then that indicates a temporary playback of historical data."}),"\n",(0,a.jsx)(n.p,{children:"Data returned by the streaming API is handled by the received callback in Javascript. Data is returned as a JSON Array, with a JSON object in the array for each packet returned. Results are batched, and the current implementation will return up to 100 packets in each batch (the array will have 100 entries). 100 packets per batch is not guaranteed, and batches may take on varying sizes based on the size of the data returned, or other factors. An empty array indicates that all data has been sent for a purely historical query and can be used as an end of data indicator."}),"\n",(0,a.jsx)(n.p,{children:"For decommutated items, each packet is represented as a JSON object with a 'time' field holding the COSMOS nanosecond timestamp of the packet, and then each of the requested item keys with their corresponding value from the packet."}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-json",children:'[\n {\n "time": 1234657585858,\n "TLM__INST__ADCS__Q1__RAW": 50.0,\n "TLM__INST__ADCS__Q2__RAW": 100.0\n },\n {\n "time": 1234657585859,\n "TLM__INST__ADCS__Q1__RAW": 60.0,\n "TLM__INST__ADCS__Q2__RAW": 110.0\n }\n]\n'})}),"\n",(0,a.jsx)(n.p,{children:"For raw packets, each packet is represented as a JSON object with a time field holding the COSMOS nanosecond timestamp of the packet, a packet field holding the topic the packet was read from in the form of SCOPE__TELEMETRY__TARGETNAME__PACKETNAME, and a buffer field holding a BASE64 encoded copy of the packet data."}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-json",children:'[\n {\n "time": 1234657585858,\n "packet": "DEFAULT__TELEMETRY__INST__ADCS",\n "buffer": "SkdfjGodkdfjdfoekfsg"\n },\n {\n "time": 1234657585859,\n "packet": "DEFAULT__TELEMETRY__INST__ADCS",\n "buffer": "3i5n49dmnfg9fl32k3"\n }\n]\n'})}),"\n",(0,a.jsx)(n.h2,{id:"ruby-example",children:"Ruby Example"}),"\n",(0,a.jsx)(n.p,{children:"Below is a simple Ruby example for using the streaming API to retrieve telemetry data:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-ruby",children:"require 'openc3'\nrequire 'openc3/script/web_socket_api'\n\n$openc3_scope = 'DEFAULT'\nENV['OPENC3_API_HOSTNAME'] = '127.0.0.1'\nENV['OPENC3_API_PORT'] = '2900'\nENV['OPENC3_API_PASSWORD'] = 'password'\n# The following are needed for Enterprise (change user/pass as necessary)\n#ENV['OPENC3_API_USER'] = 'operator'\n#ENV['OPENC3_API_PASSWORD'] = 'operator'\n#ENV['OPENC3_KEYCLOAK_REALM'] = 'openc3'\n#ENV['OPENC3_KEYCLOAK_URL'] = 'http://127.0.0.1:2900/auth'\n\n# Open a file to write CSV data\ncsv = File.open('telemetry_data.csv', 'w')\n\n# Connect to the streaming API\nOpenC3::StreamingWebSocketApi.new() do |api|\n # Add items to stream - request data from yesterday to 1 minute ago\n api.add(items: [\n 'DECOM__TLM__INST__HEALTH_STATUS__TEMP1__CONVERTED',\n 'DECOM__TLM__INST__HEALTH_STATUS__TEMP2__CONVERTED'\n ],\n start_time: (Time.now - 86400).to_nsec_from_epoch, # 24 hours ago\n end_time: (Time.now - 60).to_nsec_from_epoch) # 1 minute ago\n\n # Write CSV header\n csv.puts \"Time,TEMP1,TEMP2\"\n\n # Read all data from the stream\n data = api.read\n\n # Process each data point\n data.each do |item|\n csv.puts \"#{item['__time']/1_000_000_000.0},#{item['DECOM__TLM__INST__HEALTH_STATUS__TEMP1__CONVERTED']},#{item['DECOM__TLM__INST__HEALTH_STATUS__TEMP2__CONVERTED']}\"\n end\nend\ncsv.close()\n"})}),"\n",(0,a.jsx)(n.h2,{id:"streamingapi-architecture",children:"StreamingApi Architecture"}),"\n",(0,a.jsx)(n.p,{children:"The StreamingApi is a core component of COSMOS that provides real-time and historical data streaming capabilities. Below is an overview of its architecture and design."}),"\n",(0,a.jsx)(n.h3,{id:"architecture-overview",children:"Architecture Overview"}),"\n",(0,a.jsx)(n.p,{children:"The StreamingApi uses a modular architecture with several key components:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{children:"StreamingApi\n\u251C\u2500\u2500 StreamingThread (abstract)\n\u2502 \u251C\u2500\u2500 RealtimeStreamingThread\n\u2502 \u2514\u2500\u2500 LoggedStreamingThread\n\u2514\u2500\u2500 StreamingObjectCollection\n \u2514\u2500\u2500 StreamingObject\n"})}),"\n",(0,a.jsx)(n.h3,{id:"key-components",children:"Key Components"}),"\n",(0,a.jsx)(n.h4,{id:"streamingapi",children:"StreamingApi"}),"\n",(0,a.jsx)(n.p,{children:"The main class that manages streaming connections and handles client requests:"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"Initializes with a client UUID, channel, and scope"}),"\n",(0,a.jsx)(n.li,{children:"Manages thread lifecycle for both real-time and historical data"}),"\n",(0,a.jsx)(n.li,{children:"Processes client requests to add or remove data streams"}),"\n",(0,a.jsx)(n.li,{children:"Coordinates handoff from historical to real-time streaming"}),"\n",(0,a.jsx)(n.li,{children:"Sends batched data back to clients via ActionCable"}),"\n"]}),"\n",(0,a.jsx)(n.h4,{id:"streamingthread",children:"StreamingThread"}),"\n",(0,a.jsx)(n.p,{children:"Abstract base class that defines common thread functionality:"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"Manages thread lifecycle (start, stop)"}),"\n",(0,a.jsx)(n.li,{children:"Processes data from various sources"}),"\n",(0,a.jsx)(n.li,{children:"Handles batching and transmission of results"}),"\n",(0,a.jsx)(n.li,{children:"Determines when streaming is complete"}),"\n"]}),"\n",(0,a.jsx)(n.h4,{id:"realtimestreamingthread",children:"RealtimeStreamingThread"}),"\n",(0,a.jsx)(n.p,{children:"Specialized thread for real-time data:"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"Subscribes to Redis topics"}),"\n",(0,a.jsx)(n.li,{children:"Processes incoming messages in real-time"}),"\n",(0,a.jsx)(n.li,{children:"Continuous streaming from current time"}),"\n"]}),"\n",(0,a.jsx)(n.h4,{id:"loggedstreamingthread",children:"LoggedStreamingThread"}),"\n",(0,a.jsx)(n.p,{children:"Specialized thread for historical data:"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"Reads from archived log files"}),"\n",(0,a.jsx)(n.li,{children:"Handles time-based sorting of data"}),"\n",(0,a.jsx)(n.li,{children:"Transitions to real-time streaming when historical data is exhausted"}),"\n"]}),"\n",(0,a.jsx)(n.h4,{id:"streamingobject",children:"StreamingObject"}),"\n",(0,a.jsx)(n.p,{children:"Represents a single subscription item:"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"Parses and validates stream keys"}),"\n",(0,a.jsx)(n.li,{children:"Stores metadata about the stream (mode, target, packet, item)"}),"\n",(0,a.jsx)(n.li,{children:"Tracks timestamps and offsets"}),"\n",(0,a.jsx)(n.li,{children:"Handles authorization"}),"\n"]}),"\n",(0,a.jsx)(n.h4,{id:"streamingobjectcollection",children:"StreamingObjectCollection"}),"\n",(0,a.jsx)(n.p,{children:"Manages groups of StreamingObjects:"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"Organizes objects by topic"}),"\n",(0,a.jsx)(n.li,{children:"Tracks collective state"}),"\n",(0,a.jsx)(n.li,{children:"Provides efficient lookups"}),"\n"]}),"\n",(0,a.jsx)(n.h3,{id:"data-flow",children:"Data Flow"}),"\n",(0,a.jsxs)(n.ol,{children:["\n",(0,a.jsx)(n.li,{children:"Client connects to ActionCable and subscribes to StreamingChannel"}),"\n",(0,a.jsx)(n.li,{children:"Client sends 'add' request with items/packets to stream"}),"\n",(0,a.jsx)(n.li,{children:"StreamingApi creates appropriate StreamingObjects with authorization"}),"\n",(0,a.jsxs)(n.li,{children:["For historical requests:","\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"LoggedStreamingThread reads from log files"}),"\n",(0,a.jsx)(n.li,{children:"Data is sent in batches to client"}),"\n",(0,a.jsx)(n.li,{children:"When historical data is exhausted, handoff to real-time"}),"\n"]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["For real-time requests:","\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"RealtimeStreamingThread subscribes to Redis topics"}),"\n",(0,a.jsx)(n.li,{children:"Data is sent to client as it arrives"}),"\n"]}),"\n"]}),"\n",(0,a.jsx)(n.li,{children:"Client can add/remove items at any time"}),"\n",(0,a.jsx)(n.li,{children:"When client disconnects, all threads are terminated"}),"\n"]}),"\n",(0,a.jsx)(n.h3,{id:"performance-considerations",children:"Performance Considerations"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"Uses thread-per-request model for historical data"}),"\n",(0,a.jsx)(n.li,{children:"Maintains a single thread for real-time data"}),"\n",(0,a.jsx)(n.li,{children:"Batches results to reduce network overhead (up to 100 items per batch)"}),"\n",(0,a.jsx)(n.li,{children:"File caching for efficient historical data access"}),"\n",(0,a.jsx)(n.li,{children:"Seamless transition from historical to real-time data"}),"\n"]}),"\n",(0,a.jsx)(n.h3,{id:"security",children:"Security"}),"\n",(0,a.jsx)(n.p,{children:"Every StreamingObject verifies authorization for the specific target and packet being requested, ensuring users only access data they have permission to view."})]})}function h(e={}){let{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(l,{...e})}):l(e)}},5511:function(e,n,t){t.d(n,{R:()=>r,x:()=>o});var i=t(6363);let a={},s=i.createContext(a);function r(e){let n=i.useContext(s);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(a):e.components||a:r(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["2452"],{861:function(e,a,s){s.r(a),s.d(a,{default:()=>x});var c=s(7259);s(6363);var t=s(4014),l=s(5032),n=s(1443),i=s(9074),d=s(3324),o=s(4488),r=s(9598),m=s(3275);function x(e){let{content:a}=e,{metadata:s,assets:x}=a,{title:g,editUrl:p,description:h,frontMatter:A,lastUpdatedBy:_,lastUpdatedAt:j}=s,{keywords:v,wrapperClassName:u,hide_table_of_contents:f}=A,b=x.image??A.image,w=!!(p||j||_);return(0,c.jsx)(l.e3,{className:(0,t.A)(u??n.G.wrapper.mdxPages,n.G.page.mdxPage),children:(0,c.jsxs)(i.A,{children:[(0,c.jsx)(l.be,{title:g,description:h,keywords:v,image:b}),(0,c.jsx)("main",{className:"container container--fluid margin-vert--lg",children:(0,c.jsxs)("div",{className:(0,t.A)("row","mdxPageWrapper_VvmS"),children:[(0,c.jsxs)("div",{className:(0,t.A)("col",!f&&"col--8"),children:[(0,c.jsx)(r.A,{metadata:s}),(0,c.jsx)("article",{children:(0,c.jsx)(d.A,{children:(0,c.jsx)(a,{})})}),w&&(0,c.jsx)(m.A,{className:(0,t.A)("margin-top--sm",n.G.pages.pageFooterEditMetaRow),editUrl:p,lastUpdatedAt:j,lastUpdatedBy:_})]}),!f&&a.toc.length>0&&(0,c.jsx)("div",{className:"col col--2",children:(0,c.jsx)(o.A,{toc:a.toc,minHeadingLevel:A.toc_min_heading_level,maxHeadingLevel:A.toc_max_heading_level})})]})})]})})}},4057:function(e,a,s){s.d(a,{A:()=>n});var c=s(6655),t=s(6529),l=s(680);let n={...c.A,Tabs:t.A,TabItem:l.A}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["1625"],{1424:function(e,i,n){n.r(i),n.d(i,{frontMatter:()=>d,toc:()=>h,default:()=>o,metadata:()=>t,assets:()=>a,contentTitle:()=>l});var t=JSON.parse('{"id":"configuration/table","title":"Tables","description":"Table definition file format and keywords","source":"@site/docs/configuration/table.md","sourceDirName":"configuration","slug":"/configuration/table","permalink":"/tools/staticdocs/docs/configuration/table","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/configuration/table.md","tags":[],"version":"current","sidebarPosition":12,"frontMatter":{"sidebar_position":12,"title":"Tables","description":"Table definition file format and keywords","sidebar_custom_props":{"myEmoji":"\u{1FA91}"}},"sidebar":"defaultSidebar","previous":{"title":"Limits Response","permalink":"/tools/staticdocs/docs/configuration/limits-response"},"next":{"title":"Screens","permalink":"/tools/staticdocs/docs/configuration/telemetry-screens"}}'),s=n(7259),r=n(5511);let d={sidebar_position:12,title:"Tables",description:"Table definition file format and keywords",sidebar_custom_props:{myEmoji:"\u{1FA91}"}},l,a={},h=[{value:"Table Definition Files",id:"table-definition-files",level:2},{value:"TABLEFILE",id:"tablefile",level:2},{value:"TABLE",id:"table",level:2},{value:"TABLE Modifiers",id:"table-modifiers",level:2},{value:"PARAMETER",id:"parameter",level:3},{value:"PARAMETER Modifiers",id:"parameter-modifiers",level:3},{value:"FORMAT_STRING",id:"format_string",level:4},{value:"UNITS",id:"units",level:4},{value:"DESCRIPTION",id:"description",level:4},{value:"META",id:"meta",level:4},{value:"OVERLAP",id:"overlap",level:4},{value:"KEY",id:"key",level:4},{value:"VARIABLE_BIT_SIZE",id:"variable_bit_size",level:4},{value:"OBFUSCATE",id:"obfuscate",level:4},{value:"REQUIRED",id:"required",level:4},{value:"MINIMUM_VALUE",id:"minimum_value",level:4},{value:"MAXIMUM_VALUE",id:"maximum_value",level:4},{value:"DEFAULT_VALUE",id:"default_value",level:4},{value:"STATE",id:"state",level:4},{value:"WRITE_CONVERSION",id:"write_conversion",level:4},{value:"POLY_WRITE_CONVERSION",id:"poly_write_conversion",level:4},{value:"SEG_POLY_WRITE_CONVERSION",id:"seg_poly_write_conversion",level:4},{value:"GENERIC_WRITE_CONVERSION_START",id:"generic_write_conversion_start",level:4},{value:"GENERIC_WRITE_CONVERSION_END",id:"generic_write_conversion_end",level:4},{value:"OVERFLOW",id:"overflow",level:4},{value:"HIDDEN",id:"hidden",level:4},{value:"UNEDITABLE",id:"uneditable",level:4},{value:"APPEND_PARAMETER",id:"append_parameter",level:3},{value:"SELECT_TABLE",id:"select_table",level:2},{value:"DEFAULT",id:"default",level:2},{value:"Example File",id:"example-file",level:2}];function c(e){let i={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components},{TabItem:n,Tabs:t}=i;return n||x("TabItem",!0),t||x("Tabs",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.h2,{id:"table-definition-files",children:"Table Definition Files"}),"\n",(0,s.jsxs)(i.p,{children:["Table definition files define the binary tables that can be displayed in COSMOS ",(0,s.jsx)(i.a,{href:"/tools/staticdocs/docs/tools/table-manager",children:"Table Manager"}),"\n. Table definitions are defined in the target's tables/config directory and are typically named after the table such as ",(0,s.jsx)(i.code,{children:"PPSSelectionTable_def.txt"}),". The ",(0,s.jsx)(i.code,{children:"_def.txt"})," extension helps to identify the file as a table definition. Table definitions can be combined using the ",(0,s.jsx)(i.code,{children:"TABLEFILE"})," keyword. This allows you to build individual table components into a larger binary."]}),"\n",(0,s.jsxs)(i.p,{children:["The Table definition files share a lot of similarity with the ",(0,s.jsx)(i.a,{href:"/tools/staticdocs/docs/configuration/command",children:"Command Configuration"}),". You have the same data types: INT, UINT, FLOAT, STRING, BLOCK. These correspond to integers, unsigned integers, floating point numbers, strings and binary blocks of data."]}),"\n",(0,s.jsx)("div",{style:{clear:"both"}}),"\n",(0,s.jsx)(i.h1,{id:"table-keywords",children:"Table Keywords"}),"\n",(0,s.jsx)(i.h2,{id:"tablefile",children:"TABLEFILE"}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.strong,{children:"Specify another file to open and process for table definitions"})}),"\n",(0,s.jsxs)(i.table,{children:[(0,s.jsx)(i.thead,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.th,{children:"Parameter"}),(0,s.jsx)(i.th,{children:"Description"}),(0,s.jsx)(i.th,{children:"Required"})]})}),(0,s.jsx)(i.tbody,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"File Name"}),(0,s.jsx)(i.td,{children:"Name of the file. The file will be looked for in the directory of the current definition file."}),(0,s.jsx)(i.td,{children:"True"})]})})]}),"\n",(0,s.jsx)(i.h2,{id:"table",children:"TABLE"}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.strong,{children:"Start a new table definition"})}),"\n",(0,s.jsxs)(i.table,{children:[(0,s.jsx)(i.thead,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.th,{children:"Parameter"}),(0,s.jsx)(i.th,{children:"Description"}),(0,s.jsx)(i.th,{children:"Required"})]})}),(0,s.jsxs)(i.tbody,{children:[(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Name"}),(0,s.jsx)(i.td,{children:"Name of the table in quotes. The name will appear on the GUI tab."}),(0,s.jsx)(i.td,{children:"True"})]}),(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Endianness"}),(0,s.jsxs)(i.td,{children:["Indicates if the data in this table is in Big Endian or Little Endian format",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Valid Values: ",(0,s.jsx)("span",{class:"values",children:"BIG_ENDIAN, LITTLE_ENDIAN"})]}),(0,s.jsx)(i.td,{children:"True"})]}),(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Display"}),(0,s.jsxs)(i.td,{children:["Indicates the table contains KEY_VALUE rows (e.g. each row is unique), or a ROW_COLUMN table with identical rows containing different values.",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Valid Values: ",(0,s.jsx)("span",{class:"values",children:"KEY_VALUE, ROW_COLUMN"})]}),(0,s.jsx)(i.td,{children:"False"})]})]})]}),"\n",(0,s.jsx)(i.p,{children:"When Display is KEY_VALUE the remaining parameters are:"}),"\n",(0,s.jsxs)(i.table,{children:[(0,s.jsx)(i.thead,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.th,{children:"Parameter"}),(0,s.jsx)(i.th,{children:"Description"}),(0,s.jsx)(i.th,{children:"Required"})]})}),(0,s.jsx)(i.tbody,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Description"}),(0,s.jsx)(i.td,{children:"Description of the table in quotes. The description is used in mouseover popups and status line information."}),(0,s.jsx)(i.td,{children:"False"})]})})]}),"\n",(0,s.jsx)(i.p,{children:"When Display is ROW_COLUMN the remaining parameters are:"}),"\n",(0,s.jsxs)(i.table,{children:[(0,s.jsx)(i.thead,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.th,{children:"Parameter"}),(0,s.jsx)(i.th,{children:"Description"}),(0,s.jsx)(i.th,{children:"Required"})]})}),(0,s.jsxs)(i.tbody,{children:[(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Rows"}),(0,s.jsx)(i.td,{children:"The number of rows in the table"}),(0,s.jsx)(i.td,{children:"False"})]}),(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Description"}),(0,s.jsx)(i.td,{children:"Description of the table in quotes. The description is used in mouseover popups and status line information."}),(0,s.jsx)(i.td,{children:"False"})]})]})]}),"\n",(0,s.jsx)(i.h2,{id:"table-modifiers",children:"TABLE Modifiers"}),"\n",(0,s.jsx)(i.p,{children:"The following keywords must follow a TABLE keyword."}),"\n",(0,s.jsx)(i.h3,{id:"parameter",children:"PARAMETER"}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.strong,{children:"Defines a parameter in the current table"})}),"\n",(0,s.jsxs)(i.table,{children:[(0,s.jsx)(i.thead,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.th,{children:"Parameter"}),(0,s.jsx)(i.th,{children:"Description"}),(0,s.jsx)(i.th,{children:"Required"})]})}),(0,s.jsxs)(i.tbody,{children:[(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Name"}),(0,s.jsx)(i.td,{children:"Name of the parameter. Must be unique within the table."}),(0,s.jsx)(i.td,{children:"True"})]}),(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Bit Offset"}),(0,s.jsx)(i.td,{children:"Bit offset into the table of the Most Significant Bit of this parameter. May be negative to indicate an offset from the end of the table. Always use a bit offset of 0 for derived parameters."}),(0,s.jsx)(i.td,{children:"True"})]}),(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Bit Size"}),(0,s.jsx)(i.td,{children:"Bit size of this parameter. Zero or Negative values may be used to indicate that a string fills the packet up to the offset from the end of the packet specified by this value. If Bit Offset is 0 and Bit Size is 0 then this is a derived parameter and the Data Type must be set to 'DERIVED'."}),(0,s.jsx)(i.td,{children:"True"})]}),(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Data Type"}),(0,s.jsxs)(i.td,{children:["Data Type of this parameter",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Valid Values: ",(0,s.jsx)("span",{class:"values",children:"INT, UINT, FLOAT, DERIVED, STRING, BLOCK"})]}),(0,s.jsx)(i.td,{children:"True"})]})]})]}),"\n",(0,s.jsx)(i.p,{children:"When Data Type is INT, UINT, FLOAT, DERIVED the remaining parameters are:"}),"\n",(0,s.jsxs)(i.table,{children:[(0,s.jsx)(i.thead,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.th,{children:"Parameter"}),(0,s.jsx)(i.th,{children:"Description"}),(0,s.jsx)(i.th,{children:"Required"})]})}),(0,s.jsxs)(i.tbody,{children:[(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Minimum Value"}),(0,s.jsx)(i.td,{children:"Minimum allowed value for this parameter"}),(0,s.jsx)(i.td,{children:"True"})]}),(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Maximum Value"}),(0,s.jsx)(i.td,{children:"Maximum allowed value for this parameter"}),(0,s.jsx)(i.td,{children:"True"})]}),(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Default Value"}),(0,s.jsx)(i.td,{children:"Default value for this parameter. You must provide a default but if you mark the parameter REQUIRED then scripts will be forced to specify a value."}),(0,s.jsx)(i.td,{children:"True"})]}),(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Description"}),(0,s.jsx)(i.td,{children:"Description for this parameter which must be enclosed with quotes"}),(0,s.jsx)(i.td,{children:"False"})]}),(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Endianness"}),(0,s.jsxs)(i.td,{children:["Indicates if the data in this command is to be sent in Big Endian or Little Endian format. See guide on ",(0,s.jsx)(i.a,{href:"/tools/staticdocs/docs/guides/little-endian-bitfields",children:"Little Endian Bitfields"}),".",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Valid Values: ",(0,s.jsx)("span",{class:"values",children:"BIG_ENDIAN, LITTLE_ENDIAN"})]}),(0,s.jsx)(i.td,{children:"False"})]})]})]}),"\n",(0,s.jsx)(i.p,{children:"When Data Type is STRING, BLOCK the remaining parameters are:"}),"\n",(0,s.jsxs)(i.table,{children:[(0,s.jsx)(i.thead,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.th,{children:"Parameter"}),(0,s.jsx)(i.th,{children:"Description"}),(0,s.jsx)(i.th,{children:"Required"})]})}),(0,s.jsxs)(i.tbody,{children:[(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Default Value"}),(0,s.jsx)(i.td,{children:"Default value for this parameter. You must provide a default but if you mark the parameter REQUIRED then scripts will be forced to specify a value."}),(0,s.jsx)(i.td,{children:"True"})]}),(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Description"}),(0,s.jsx)(i.td,{children:"Description for this parameter which must be enclosed with quotes"}),(0,s.jsx)(i.td,{children:"False"})]}),(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Endianness"}),(0,s.jsxs)(i.td,{children:["Indicates if the data in this command is to be sent in Big Endian or Little Endian format",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Valid Values: ",(0,s.jsx)("span",{class:"values",children:"BIG_ENDIAN, LITTLE_ENDIAN"})]}),(0,s.jsx)(i.td,{children:"False"})]})]})]}),"\n",(0,s.jsx)(i.h3,{id:"parameter-modifiers",children:"PARAMETER Modifiers"}),"\n",(0,s.jsx)(i.p,{children:"The following keywords must follow a PARAMETER keyword."}),"\n",(0,s.jsx)(i.h4,{id:"format_string",children:"FORMAT_STRING"}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.strong,{children:"Adds printf style formatting"})}),"\n",(0,s.jsxs)(i.table,{children:[(0,s.jsx)(i.thead,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.th,{children:"Parameter"}),(0,s.jsx)(i.th,{children:"Description"}),(0,s.jsx)(i.th,{children:"Required"})]})}),(0,s.jsx)(i.tbody,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Format"}),(0,s.jsx)(i.td,{children:"How to format using printf syntax. For example, '0x%0X' will display the value in hex."}),(0,s.jsx)(i.td,{children:"True"})]})})]}),"\n",(0,s.jsx)(i.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(i.pre,{children:(0,s.jsx)(i.code,{className:"language-ruby",children:'FORMAT_STRING "0x%0X"\n'})}),"\n",(0,s.jsx)(i.h4,{id:"units",children:"UNITS"}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.strong,{children:"Add displayed units"})}),"\n",(0,s.jsxs)(i.table,{children:[(0,s.jsx)(i.thead,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.th,{children:"Parameter"}),(0,s.jsx)(i.th,{children:"Description"}),(0,s.jsx)(i.th,{children:"Required"})]})}),(0,s.jsxs)(i.tbody,{children:[(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Full Name"}),(0,s.jsx)(i.td,{children:"Full name of the units type, e.g. Celsius"}),(0,s.jsx)(i.td,{children:"True"})]}),(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Abbreviated"}),(0,s.jsx)(i.td,{children:"Abbreviation for the units, e.g. C"}),(0,s.jsx)(i.td,{children:"True"})]})]})]}),"\n",(0,s.jsx)(i.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(i.pre,{children:(0,s.jsx)(i.code,{className:"language-ruby",children:"UNITS Celsius C\nUNITS Kilometers KM\n"})}),"\n",(0,s.jsx)(i.h4,{id:"description",children:"DESCRIPTION"}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.strong,{children:"Override the defined description"})}),"\n",(0,s.jsxs)(i.table,{children:[(0,s.jsx)(i.thead,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.th,{children:"Parameter"}),(0,s.jsx)(i.th,{children:"Description"}),(0,s.jsx)(i.th,{children:"Required"})]})}),(0,s.jsx)(i.tbody,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Value"}),(0,s.jsx)(i.td,{children:"The new description"}),(0,s.jsx)(i.td,{children:"True"})]})})]}),"\n",(0,s.jsx)(i.h4,{id:"meta",children:"META"}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.strong,{children:"Stores custom user metadata"})}),"\n",(0,s.jsx)(i.p,{children:"Meta data is user specific data that can be used by custom tools for various purposes. One example is to store additional information needed to generate source code header files."}),"\n",(0,s.jsxs)(i.table,{children:[(0,s.jsx)(i.thead,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.th,{children:"Parameter"}),(0,s.jsx)(i.th,{children:"Description"}),(0,s.jsx)(i.th,{children:"Required"})]})}),(0,s.jsxs)(i.tbody,{children:[(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Meta Name"}),(0,s.jsx)(i.td,{children:"Name of the metadata to store"}),(0,s.jsx)(i.td,{children:"True"})]}),(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Meta Values"}),(0,s.jsx)(i.td,{children:"One or more values to be stored for this Meta Name"}),(0,s.jsx)(i.td,{children:"False"})]})]})]}),"\n",(0,s.jsx)(i.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(i.pre,{children:(0,s.jsx)(i.code,{className:"language-ruby",children:'META TEST "This parameter is for test purposes only"\n'})}),"\n",(0,s.jsx)(i.h4,{id:"overlap",children:"OVERLAP"}),"\n",(0,s.jsxs)(i.p,{children:[(0,s.jsx)("div",{class:"right",children:"(Since 4.4.1)"}),(0,s.jsx)(i.strong,{children:"This item is allowed to overlap other items in the packet"})]}),"\n",(0,s.jsx)(i.p,{children:"If an item's bit offset overlaps another item, OpenC3 issues a warning. This keyword explicitly allows an item to overlap another and suppresses the warning message."}),"\n",(0,s.jsx)(i.h4,{id:"key",children:"KEY"}),"\n",(0,s.jsxs)(i.p,{children:[(0,s.jsx)("div",{class:"right",children:"(Since 5.0.10)"}),(0,s.jsx)(i.strong,{children:"Defines the key used to access this raw value in the packet."})]}),"\n",(0,s.jsxs)(i.p,{children:["Keys are often ",(0,s.jsx)(i.a,{href:"https://en.wikipedia.org/wiki/JSONPath",children:"JSONPath"})," or ",(0,s.jsx)(i.a,{href:"https://en.wikipedia.org/wiki/XPath",children:"XPath"})," strings"]}),"\n",(0,s.jsxs)(i.table,{children:[(0,s.jsx)(i.thead,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.th,{children:"Parameter"}),(0,s.jsx)(i.th,{children:"Description"}),(0,s.jsx)(i.th,{children:"Required"})]})}),(0,s.jsx)(i.tbody,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Key string"}),(0,s.jsx)(i.td,{children:"The key to access this item"}),(0,s.jsx)(i.td,{children:"True"})]})})]}),"\n",(0,s.jsx)(i.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(i.pre,{children:(0,s.jsx)(i.code,{className:"language-ruby",children:"KEY $.book.title\n"})}),"\n",(0,s.jsx)(i.h4,{id:"variable_bit_size",children:"VARIABLE_BIT_SIZE"}),"\n",(0,s.jsxs)(i.p,{children:[(0,s.jsx)("div",{class:"right",children:"(Since 5.18.0)"}),(0,s.jsx)(i.strong,{children:"Marks an item as having its bit size defined by another length item"})]}),"\n",(0,s.jsxs)(i.table,{children:[(0,s.jsx)(i.thead,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.th,{children:"Parameter"}),(0,s.jsx)(i.th,{children:"Description"}),(0,s.jsx)(i.th,{children:"Required"})]})}),(0,s.jsxs)(i.tbody,{children:[(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Length Item Name"}),(0,s.jsx)(i.td,{children:"The name of the associated length item"}),(0,s.jsx)(i.td,{children:"True"})]}),(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Length Bits Per Count"}),(0,s.jsx)(i.td,{children:"Bits per count of the length item. Defaults to 8"}),(0,s.jsx)(i.td,{children:"False"})]}),(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Length Value Bit Offset"}),(0,s.jsx)(i.td,{children:"Offset in Bits to Apply to Length Field Value. Defaults to 0"}),(0,s.jsx)(i.td,{children:"False"})]})]})]}),"\n",(0,s.jsx)(i.h4,{id:"obfuscate",children:"OBFUSCATE"}),"\n",(0,s.jsxs)(i.p,{children:[(0,s.jsx)("div",{class:"right",children:"(Since 6.6.0)"}),(0,s.jsx)(i.strong,{children:"Hides the item value in the UI, text logs, and raw binary file"})]}),"\n",(0,s.jsx)(i.h4,{id:"required",children:"REQUIRED"}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.strong,{children:"Parameter is required to be populated in scripts"})}),"\n",(0,s.jsx)(i.p,{children:"When sending the command via Script Runner a value must always be given for the current command parameter. This prevents the user from relying on a default value. Note that this does not affect Command Sender which will still populate the field with the default value provided in the PARAMETER definition."}),"\n",(0,s.jsx)(i.h4,{id:"minimum_value",children:"MINIMUM_VALUE"}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.strong,{children:"Override the defined minimum value"})}),"\n",(0,s.jsxs)(i.table,{children:[(0,s.jsx)(i.thead,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.th,{children:"Parameter"}),(0,s.jsx)(i.th,{children:"Description"}),(0,s.jsx)(i.th,{children:"Required"})]})}),(0,s.jsx)(i.tbody,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Value"}),(0,s.jsx)(i.td,{children:"The new minimum value for the parameter"}),(0,s.jsx)(i.td,{children:"True"})]})})]}),"\n",(0,s.jsx)(i.h4,{id:"maximum_value",children:"MAXIMUM_VALUE"}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.strong,{children:"Override the defined maximum value"})}),"\n",(0,s.jsxs)(i.table,{children:[(0,s.jsx)(i.thead,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.th,{children:"Parameter"}),(0,s.jsx)(i.th,{children:"Description"}),(0,s.jsx)(i.th,{children:"Required"})]})}),(0,s.jsx)(i.tbody,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Value"}),(0,s.jsx)(i.td,{children:"The new maximum value for the parameter"}),(0,s.jsx)(i.td,{children:"True"})]})})]}),"\n",(0,s.jsx)(i.h4,{id:"default_value",children:"DEFAULT_VALUE"}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.strong,{children:"Override the defined default value"})}),"\n",(0,s.jsxs)(i.table,{children:[(0,s.jsx)(i.thead,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.th,{children:"Parameter"}),(0,s.jsx)(i.th,{children:"Description"}),(0,s.jsx)(i.th,{children:"Required"})]})}),(0,s.jsx)(i.tbody,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Value"}),(0,s.jsx)(i.td,{children:"The new default value for the parameter"}),(0,s.jsx)(i.td,{children:"True"})]})})]}),"\n",(0,s.jsx)(i.h4,{id:"state",children:"STATE"}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.strong,{children:"Defines a key/value pair for the current command parameter"})}),"\n",(0,s.jsx)(i.p,{children:"Key value pairs allow for user friendly strings. For example, you might define states for ON = 1 and OFF = 0. This allows the word ON to be used rather than the number 1 when sending the command parameter and allows for much greater clarity and less chance for user error."}),"\n",(0,s.jsxs)(i.table,{children:[(0,s.jsx)(i.thead,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.th,{children:"Parameter"}),(0,s.jsx)(i.th,{children:"Description"}),(0,s.jsx)(i.th,{children:"Required"})]})}),(0,s.jsxs)(i.tbody,{children:[(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Key"}),(0,s.jsx)(i.td,{children:"The string state name"}),(0,s.jsx)(i.td,{children:"True"})]}),(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Value"}),(0,s.jsx)(i.td,{children:"The numerical state value"}),(0,s.jsx)(i.td,{children:"True"})]}),(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Hazardous / Disable Messages"}),(0,s.jsxs)(i.td,{children:["Indicates the state is hazardous. This will cause a popup to ask for user confirmation when sending this command. For non-hazardous states you can also set DISABLE_MESSAGES which will not print the command when using that state.",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Valid Values: ",(0,s.jsx)("span",{class:"values",children:"HAZARDOUS"})]}),(0,s.jsx)(i.td,{children:"False"})]}),(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Hazardous Description"}),(0,s.jsx)(i.td,{children:"String describing why this state is hazardous"}),(0,s.jsx)(i.td,{children:"False"})]})]})]}),"\n",(0,s.jsx)(i.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(i.pre,{children:(0,s.jsx)(i.code,{className:"language-ruby",children:'APPEND_PARAMETER ENABLE 32 UINT 0 1 0 "Enable setting"\n STATE FALSE 0\n STATE TRUE 1\nAPPEND_PARAMETER STRING 1024 STRING "NOOP" "String parameter"\n STATE "NOOP" "NOOP" DISABLE_MESSAGES\n STATE "ARM LASER" "ARM LASER" HAZARDOUS "Arming the laser is an eye safety hazard"\n STATE "FIRE LASER" "FIRE LASER" HAZARDOUS "WARNING! Laser will be fired!"\n'})}),"\n",(0,s.jsx)(i.h4,{id:"write_conversion",children:"WRITE_CONVERSION"}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.strong,{children:"Applies a conversion when writing the current command parameter"})}),"\n",(0,s.jsxs)(i.p,{children:["Conversions are implemented in a custom Ruby or Python file which should be\nlocated in the target's lib folder. The class must inherit from Conversion.\nIt must implement the ",(0,s.jsx)(i.code,{children:"initialize"})," (Ruby) or ",(0,s.jsx)(i.code,{children:"__init__"})," (Python) method if it\ntakes extra parameters and must always implement the ",(0,s.jsx)(i.code,{children:"call"})," method. The conversion\nfactor is applied to the value entered by the user before it is written into\nthe binary command packet and sent. For more information see the ",(0,s.jsx)(i.a,{href:"/docs/configuration/conversions",children:"Conversion"})," documentation."]}),"\n",(0,s.jsxs)(i.p,{children:["When applying a write_conversion sometimes the data type changes,\ne.g. creating a UINT from an input STRING (for an example of this see\n",(0,s.jsx)(i.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/conversions/ip_write_conversion.rb",children:"ip_write_conversion.rb"}),"\nor ",(0,s.jsx)(i.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/python/openc3/conversions/ip_write_conversion.py",children:"ip_write_conversion.py"}),").\nIn this case, the command definition data type is UINT and the min, max values don't matter\n(but must be given) so are typically set to MIN MAX. The default value is important\nand should be specified as a string. For a full example see the IP_ADDRESS parameter\nin the TIME_OFFSET command definition of the COSMOS Demo\n",(0,s.jsx)(i.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/targets/INST/cmd_tlm/inst_cmds.txt",children:"INST inst_cmds.txt"}),"\nor ",(0,s.jsx)(i.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/targets/INST2/cmd_tlm/inst_cmds.txt",children:"INST2 inst_cmds.txt"}),"."]}),"\n",(0,s.jsx)(i.admonition,{title:"Multiple write conversions on command parameters",type:"info",children:(0,s.jsx)(i.p,{children:"When a command is built, each item gets written (and write conversions are run)\nto set the default value. Then items are written (again write conversions are run)\nwith user provided values. Thus write conversions can be run twice. Also there are\nno guarantees which parameters have already been written. The packet itself has a\ngiven_values() method which can be used to retrieve a hash of the user provided\nvalues to the command. That can be used to check parameter values passed in."})}),"\n",(0,s.jsxs)(i.table,{children:[(0,s.jsx)(i.thead,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.th,{children:"Parameter"}),(0,s.jsx)(i.th,{children:"Description"}),(0,s.jsx)(i.th,{children:"Required"})]})}),(0,s.jsxs)(i.tbody,{children:[(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Class Filename"}),(0,s.jsx)(i.td,{children:"The filename which contains the Ruby or Python class. The filename must be named after the class such that the class is a CamelCase version of the underscored filename. For example, 'the_great_conversion.rb' should contain 'class TheGreatConversion'. Note the built-in Python conversions must specify the full path to the file, e.g. 'openc3/conversions/bit_reverse_conversion.py'."}),(0,s.jsx)(i.td,{children:"True"})]}),(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Parameter"}),(0,s.jsx)(i.td,{children:"Additional parameter values for the conversion which are passed to the class constructor."}),(0,s.jsx)(i.td,{children:"False"})]})]})]}),"\n",(0,s.jsxs)(t,{groupId:"script-language",children:[(0,s.jsx)(n,{value:"python",label:"Python",children:(0,s.jsx)(i.pre,{children:(0,s.jsx)(i.code,{className:"language-python",children:"WRITE_CONVERSION openc3/conversions/ip_write_conversion.py\n"})})}),(0,s.jsx)(n,{value:"ruby",label:"Ruby",children:(0,s.jsx)(i.pre,{children:(0,s.jsx)(i.code,{className:"language-ruby",children:"WRITE_CONVERSION ip_write_conversion.rb\n"})})})]}),"\n",(0,s.jsx)(i.h4,{id:"poly_write_conversion",children:"POLY_WRITE_CONVERSION"}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.strong,{children:"Adds a polynomial conversion factor to the current command parameter"})}),"\n",(0,s.jsxs)(i.p,{children:["See ",(0,s.jsx)(i.a,{href:"/docs/configuration/conversions#polynomial_conversion",children:"Polynomial Conversion"})," for more information."]}),"\n",(0,s.jsx)(i.h4,{id:"seg_poly_write_conversion",children:"SEG_POLY_WRITE_CONVERSION"}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.strong,{children:"Adds a segmented polynomial conversion factor to the current command parameter"})}),"\n",(0,s.jsxs)(i.p,{children:["See ",(0,s.jsx)(i.a,{href:"/docs/configuration/conversions#segmented_polynomial_conversion",children:"Segmented Polynomial Conversion"})," for more information."]}),"\n",(0,s.jsx)(i.h4,{id:"generic_write_conversion_start",children:"GENERIC_WRITE_CONVERSION_START"}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.strong,{children:"Start a generic write conversion"})}),"\n",(0,s.jsx)(i.p,{children:"Adds a generic conversion function to the current command parameter.\nThis conversion factor is applied to the value entered by the user before it\nis written into the binary command packet and sent. The conversion is specified\nas Ruby or Python code that receives two implied parameters. 'value' which is the raw\nvalue being written and 'packet' which is a reference to the command packet\nclass (Note, referencing the packet as 'myself' is still supported for backwards\ncompatibility). The last line of code should return the converted\nvalue. The GENERIC_WRITE_CONVERSION_END keyword specifies that all lines of\ncode for the conversion have been given."}),"\n",(0,s.jsx)(i.admonition,{title:"Multiple write conversions on command parameters",type:"info",children:(0,s.jsx)(i.p,{children:"When a command is built, each item gets written (and write conversions are run)\nto set the default value. Then items are written (again write conversions are run)\nwith user provided values. Thus write conversions can be run twice. Also there are\nno guarantees which parameters have already been written. The packet itself has a\ngiven_values() method which can be used to retrieve a hash of the user provided\nvalues to the command. That can be used to check parameter values passed in."})}),"\n",(0,s.jsx)(i.admonition,{type:"warning",children:(0,s.jsx)(i.p,{children:"Generic conversions are not a good long term solution. Consider creating a conversion class and using WRITE_CONVERSION instead. WRITE_CONVERSION is easier to debug and higher performance."})}),"\n",(0,s.jsxs)(t,{groupId:"script-language",children:[(0,s.jsx)(n,{value:"python",label:"Python",children:(0,s.jsx)(i.pre,{children:(0,s.jsx)(i.code,{className:"language-python",children:"APPEND_PARAMETER ITEM1 32 UINT 0 0xFFFFFFFF 0\n GENERIC_WRITE_CONVERSION_START\n return int(value * 1.5) # Convert the value by a scale factor\n GENERIC_WRITE_CONVERSION_END\n"})})}),(0,s.jsx)(n,{value:"ruby",label:"Ruby",children:(0,s.jsx)(i.pre,{children:(0,s.jsx)(i.code,{className:"language-ruby",children:"APPEND_PARAMETER ITEM1 32 UINT 0 0xFFFFFFFF 0\n GENERIC_WRITE_CONVERSION_START\n return (value * 1.5).to_i # Convert the value by a scale factor\n GENERIC_WRITE_CONVERSION_END\n"})})})]}),"\n",(0,s.jsx)(i.h4,{id:"generic_write_conversion_end",children:"GENERIC_WRITE_CONVERSION_END"}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.strong,{children:"Complete a generic write conversion"})}),"\n",(0,s.jsx)(i.h4,{id:"overflow",children:"OVERFLOW"}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.strong,{children:"Set the behavior when writing a value overflows the type"})}),"\n",(0,s.jsx)(i.p,{children:"By default OpenC3 throws an error if you try to write a value which overflows its specified type, e.g. writing 255 to a 8 bit signed value. Setting the overflow behavior also allows for OpenC3 to 'TRUNCATE' the value by eliminating any high order bits. You can also set 'SATURATE' which causes OpenC3 to replace the value with the maximum or minimum allowable value for that type. Finally you can specify 'ERROR_ALLOW_HEX' which will allow for a maximum hex value to be written, e.g. you can successfully write 255 to a 8 bit signed value."}),"\n",(0,s.jsxs)(i.table,{children:[(0,s.jsx)(i.thead,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.th,{children:"Parameter"}),(0,s.jsx)(i.th,{children:"Description"}),(0,s.jsx)(i.th,{children:"Required"})]})}),(0,s.jsx)(i.tbody,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Behavior"}),(0,s.jsxs)(i.td,{children:["How OpenC3 treats an overflow value. Only applies to signed and unsigned integer data types.",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Valid Values: ",(0,s.jsx)("span",{class:"values",children:"ERROR, ERROR_ALLOW_HEX, TRUNCATE, SATURATE"})]}),(0,s.jsx)(i.td,{children:"True"})]})})]}),"\n",(0,s.jsx)(i.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(i.pre,{children:(0,s.jsx)(i.code,{className:"language-ruby",children:"OVERFLOW TRUNCATE\n"})}),"\n",(0,s.jsx)(i.h4,{id:"hidden",children:"HIDDEN"}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.strong,{children:"Indicates that the parameter should not be shown to the user in the Table Manager GUI"})}),"\n",(0,s.jsx)(i.p,{children:"Hidden parameters still exist and will be saved to the resulting binary. This is useful for padding and other essential but non-user editable fields."}),"\n",(0,s.jsx)(i.h4,{id:"uneditable",children:"UNEDITABLE"}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.strong,{children:"Indicates that the parameter should be shown to the user but not editable."})}),"\n",(0,s.jsx)(i.p,{children:"Uneditable parameters are useful for control fields which the user may be interested in but should not be able to edit."}),"\n",(0,s.jsx)(i.h3,{id:"append_parameter",children:"APPEND_PARAMETER"}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.strong,{children:"Defines a parameter in the current table"})}),"\n",(0,s.jsxs)(i.table,{children:[(0,s.jsx)(i.thead,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.th,{children:"Parameter"}),(0,s.jsx)(i.th,{children:"Description"}),(0,s.jsx)(i.th,{children:"Required"})]})}),(0,s.jsxs)(i.tbody,{children:[(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Name"}),(0,s.jsx)(i.td,{children:"Name of the parameter. Must be unique within the table."}),(0,s.jsx)(i.td,{children:"True"})]}),(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Bit Size"}),(0,s.jsx)(i.td,{children:"Bit size of this parameter. Zero or Negative values may be used to indicate that a string fills the packet up to the offset from the end of the packet specified by this value. If Bit Offset is 0 and Bit Size is 0 then this is a derived parameter and the Data Type must be set to 'DERIVED'."}),(0,s.jsx)(i.td,{children:"True"})]}),(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Data Type"}),(0,s.jsxs)(i.td,{children:["Data Type of this parameter",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Valid Values: ",(0,s.jsx)("span",{class:"values",children:"INT, UINT, FLOAT, DERIVED, STRING, BLOCK"})]}),(0,s.jsx)(i.td,{children:"True"})]})]})]}),"\n",(0,s.jsx)(i.p,{children:"When Data Type is INT, UINT, FLOAT, DERIVED the remaining parameters are:"}),"\n",(0,s.jsxs)(i.table,{children:[(0,s.jsx)(i.thead,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.th,{children:"Parameter"}),(0,s.jsx)(i.th,{children:"Description"}),(0,s.jsx)(i.th,{children:"Required"})]})}),(0,s.jsxs)(i.tbody,{children:[(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Minimum Value"}),(0,s.jsx)(i.td,{children:"Minimum allowed value for this parameter"}),(0,s.jsx)(i.td,{children:"True"})]}),(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Maximum Value"}),(0,s.jsx)(i.td,{children:"Maximum allowed value for this parameter"}),(0,s.jsx)(i.td,{children:"True"})]}),(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Default Value"}),(0,s.jsx)(i.td,{children:"Default value for this parameter. You must provide a default but if you mark the parameter REQUIRED then scripts will be forced to specify a value."}),(0,s.jsx)(i.td,{children:"True"})]}),(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Description"}),(0,s.jsx)(i.td,{children:"Description for this parameter which must be enclosed with quotes"}),(0,s.jsx)(i.td,{children:"False"})]}),(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Endianness"}),(0,s.jsxs)(i.td,{children:["Indicates if the data in this command is to be sent in Big Endian or Little Endian format. See guide on ",(0,s.jsx)(i.a,{href:"/tools/staticdocs/docs/guides/little-endian-bitfields",children:"Little Endian Bitfields"}),".",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Valid Values: ",(0,s.jsx)("span",{class:"values",children:"BIG_ENDIAN, LITTLE_ENDIAN"})]}),(0,s.jsx)(i.td,{children:"False"})]})]})]}),"\n",(0,s.jsx)(i.p,{children:"When Data Type is STRING, BLOCK the remaining parameters are:"}),"\n",(0,s.jsxs)(i.table,{children:[(0,s.jsx)(i.thead,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.th,{children:"Parameter"}),(0,s.jsx)(i.th,{children:"Description"}),(0,s.jsx)(i.th,{children:"Required"})]})}),(0,s.jsxs)(i.tbody,{children:[(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Default Value"}),(0,s.jsx)(i.td,{children:"Default value for this parameter. You must provide a default but if you mark the parameter REQUIRED then scripts will be forced to specify a value."}),(0,s.jsx)(i.td,{children:"True"})]}),(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Description"}),(0,s.jsx)(i.td,{children:"Description for this parameter which must be enclosed with quotes"}),(0,s.jsx)(i.td,{children:"False"})]}),(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Endianness"}),(0,s.jsxs)(i.td,{children:["Indicates if the data in this command is to be sent in Big Endian or Little Endian format",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Valid Values: ",(0,s.jsx)("span",{class:"values",children:"BIG_ENDIAN, LITTLE_ENDIAN"})]}),(0,s.jsx)(i.td,{children:"False"})]})]})]}),"\n",(0,s.jsx)(i.h2,{id:"select_table",children:"SELECT_TABLE"}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.strong,{children:"Select an existing table for editing, typically done to override an existing definition"})}),"\n",(0,s.jsxs)(i.table,{children:[(0,s.jsx)(i.thead,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.th,{children:"Parameter"}),(0,s.jsx)(i.th,{children:"Description"}),(0,s.jsx)(i.th,{children:"Required"})]})}),(0,s.jsx)(i.tbody,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Table"}),(0,s.jsx)(i.td,{children:"The name of the existing table"}),(0,s.jsx)(i.td,{children:"True"})]})})]}),"\n",(0,s.jsx)(i.h2,{id:"default",children:"DEFAULT"}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.strong,{children:"Specify default values for a SINGLE row in a multi-column table"})}),"\n",(0,s.jsx)(i.p,{children:"If you have multiple rows you need a DEFAULT line for each row. If all your rows are identical consider using ERB as shown in the OpenC3 demo."}),"\n",(0,s.jsxs)(i.table,{children:[(0,s.jsx)(i.thead,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.th,{children:"Parameter"}),(0,s.jsx)(i.th,{children:"Description"}),(0,s.jsx)(i.th,{children:"Required"})]})}),(0,s.jsx)(i.tbody,{children:(0,s.jsxs)(i.tr,{children:[(0,s.jsx)(i.td,{children:"Default values"}),(0,s.jsx)(i.td,{children:"A STATE value or data value corresponding to the data type"}),(0,s.jsx)(i.td,{children:"False"})]})})]}),"\n",(0,s.jsx)(i.h2,{id:"example-file",children:"Example File"}),"\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.strong,{children:"Example File: TARGET/tables/config/MCConfigurationTable_def.txt"})}),"\n",(0,s.jsx)(i.pre,{children:(0,s.jsx)(i.code,{className:"language-ruby",children:'TABLE "MC_Configuration" BIG_ENDIAN KEY_VALUE "Memory Control Configuration Table"\n APPEND_PARAMETER "Scrub_Region_1_Start_Addr" 32 UINT 0 0x03FFFFFB 0\n FORMAT_STRING "0x%0X"\n APPEND_PARAMETER "Scrub_Region_1_End_Addr" 32 UINT 0 0x03FFFFFF 0x03FFFFFF\n FORMAT_STRING "0x%0X"\n APPEND_PARAMETER "Scrub_Region_2_Start_Addr" 32 UINT 0 0x03FFFFB 0\n FORMAT_STRING "0x%0X"\n APPEND_PARAMETER "Scrub_Region_2_End_Addr" 32 UINT 0 0x03FFFFF 0x03FFFFF\n FORMAT_STRING "0x%0X"\n APPEND_PARAMETER "Dump_Packet_Throttle_(sec)" 32 UINT 0 0x0FFFFFFFF 2 "Number of seconds to wait between dumping large packets"\n APPEND_PARAMETER "Memory_Scrubbing" 8 UINT 0 1 1\n STATE DISABLE 0\n STATE ENABLE 1\n APPEND_PARAMETER "SIOC_Memory_Config" 8 UINT 1 3 3\n APPEND_PARAMETER "Uneditable_Text" 32 UINT MIN MAX 0xDEADBEEF "Uneditable field"\n FORMAT_STRING "0x%0X"\n UNEDITABLE\n APPEND_PARAMETER "Uneditable_State" 16 UINT MIN MAX 0 "Uneditable field"\n STATE DISABLE 0\n STATE ENABLE 1\n UNEDITABLE\n APPEND_PARAMETER "Uneditable_Check" 16 UINT MIN MAX 1 "Uneditable field"\n STATE UNCHECKED 0\n STATE CHECKED 1\n UNEDITABLE\n APPEND_PARAMETER "Binary" 32 STRING 0xDEADBEEF "Binary string"\n APPEND_PARAMETER "Pad" 16 UINT 0 0 0\n HIDDEN\n'})})]})}function o(e={}){let{wrapper:i}={...(0,r.R)(),...e.components};return i?(0,s.jsx)(i,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}function x(e,i){throw Error("Expected "+(i?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},5511:function(e,i,n){n.d(i,{R:()=>d,x:()=>l});var t=n(6363);let s={},r=t.createContext(s);function d(e){let i=t.useContext(r);return t.useMemo(function(){return"function"==typeof e?e(i):{...i,...e}},[i,e])}function l(e){let i;return i=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:d(e.components),t.createElement(r.Provider,{value:i},e.children)}}}]);