openc3-cosmos-tool-docs 5.17.1 → 5.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) hide show
  1. checksums.yaml +4 -4
  2. data/tools/staticdocs/404.html +4 -4
  3. data/tools/staticdocs/assets/css/{styles.8a0f1b26.css → styles.80ddca08.css} +1 -1
  4. data/tools/staticdocs/assets/js/{019369f3.34291acc.js → 019369f3.727d87f1.js} +1 -1
  5. data/tools/staticdocs/assets/js/{058ffc22.8d9049f4.js → 058ffc22.f2d69d72.js} +1 -1
  6. data/tools/staticdocs/assets/js/{0686a885.dde7b18b.js → 0686a885.83641127.js} +1 -1
  7. data/tools/staticdocs/assets/js/078dbab0.945c9f59.js +1 -0
  8. data/tools/staticdocs/assets/js/{0f5d161c.ca02c5b2.js → 0f5d161c.e26d88b8.js} +1 -1
  9. data/tools/staticdocs/assets/js/{0ff569c9.ad025a56.js → 0ff569c9.aa4daee5.js} +1 -1
  10. data/tools/staticdocs/assets/js/{103cc3be.6b6cd0fa.js → 103cc3be.78f97eb1.js} +1 -1
  11. data/tools/staticdocs/assets/js/{13196248.9e7794e3.js → 13196248.ca2e8950.js} +1 -1
  12. data/tools/staticdocs/assets/js/{13c1b4e4.cec67b9c.js → 13c1b4e4.22a0b1d4.js} +1 -1
  13. data/tools/staticdocs/assets/js/{2047b354.bdd2586a.js → 2047b354.25d11993.js} +1 -1
  14. data/tools/staticdocs/assets/js/22b3ac48.7a5ea984.js +1 -0
  15. data/tools/staticdocs/assets/js/{2bb7bf90.043455de.js → 2bb7bf90.fa05d998.js} +1 -1
  16. data/tools/staticdocs/assets/js/3917.1ec7d126.js +1 -0
  17. data/tools/staticdocs/assets/js/{3dd7ef3b.c7c1d93f.js → 3dd7ef3b.d55880a8.js} +1 -1
  18. data/tools/staticdocs/assets/js/{40365d27.7eb3f7b1.js → 40365d27.4b4b2ccd.js} +1 -1
  19. data/tools/staticdocs/assets/js/{411898ad.d5f62a27.js → 411898ad.1d6a609d.js} +1 -1
  20. data/tools/staticdocs/assets/js/{42170351.69a8ed02.js → 42170351.c68b85e1.js} +1 -1
  21. data/tools/staticdocs/assets/js/43652efd.d1e1add3.js +1 -0
  22. data/tools/staticdocs/assets/js/53ca7c5b.c3111020.js +1 -0
  23. data/tools/staticdocs/assets/js/{54d0d530.28ba5be7.js → 54d0d530.d3f9a4ac.js} +1 -1
  24. data/tools/staticdocs/assets/js/{5b233ba7.9c621552.js → 5b233ba7.6fdd6b6c.js} +1 -1
  25. data/tools/staticdocs/assets/js/{5bc719f6.7fa17221.js → 5bc719f6.daa2a049.js} +1 -1
  26. data/tools/staticdocs/assets/js/{5c6ce5ec.5e6ca46b.js → 5c6ce5ec.61a9cae2.js} +1 -1
  27. data/tools/staticdocs/assets/js/5e3ed378.2bee863a.js +1 -0
  28. data/tools/staticdocs/assets/js/5fe211ef.a9f21277.js +1 -0
  29. data/tools/staticdocs/assets/js/6831b732.185eb427.js +1 -0
  30. data/tools/staticdocs/assets/js/{696b4199.0335bd94.js → 696b4199.a5ae3d65.js} +1 -1
  31. data/tools/staticdocs/assets/js/{6b210247.2cbd59e6.js → 6b210247.e96f3982.js} +1 -1
  32. data/tools/staticdocs/assets/js/{6b65133b.87dc7da6.js → 6b65133b.4e84b1c2.js} +1 -1
  33. data/tools/staticdocs/assets/js/6f92e431.65aa0240.js +1 -0
  34. data/tools/staticdocs/assets/js/72c6d8a8.98daa27a.js +1 -0
  35. data/tools/staticdocs/assets/js/{75e64983.932fbc0e.js → 75e64983.6ef0928b.js} +1 -1
  36. data/tools/staticdocs/assets/js/{867640d5.ffd4cf4c.js → 867640d5.48133ad5.js} +1 -1
  37. data/tools/staticdocs/assets/js/{89e76475.97389cc5.js → 89e76475.13ce283b.js} +1 -1
  38. data/tools/staticdocs/assets/js/{8f7843ee.d1ffd5ee.js → 8f7843ee.7a68246a.js} +1 -1
  39. data/tools/staticdocs/assets/js/9424f0b3.61c6bd97.js +1 -0
  40. data/tools/staticdocs/assets/js/{97535711.fc45ced1.js → 97535711.5311ddd9.js} +1 -1
  41. data/tools/staticdocs/assets/js/{99581c43.8e571df8.js → 99581c43.527aab44.js} +1 -1
  42. data/tools/staticdocs/assets/js/{9fb6059a.42881e94.js → 9fb6059a.a5107afb.js} +1 -1
  43. data/tools/staticdocs/assets/js/{a507c363.04b98d2c.js → a507c363.d2cc5d72.js} +1 -1
  44. data/tools/staticdocs/assets/js/{a677c089.b2928bac.js → a677c089.abc52ace.js} +1 -1
  45. data/tools/staticdocs/assets/js/{a9987364.8f065f19.js → a9987364.5ef1644f.js} +1 -1
  46. data/tools/staticdocs/assets/js/{aa6b6c1b.d78e5212.js → aa6b6c1b.c51c044d.js} +1 -1
  47. data/tools/staticdocs/assets/js/{b4596165.6806d46b.js → b4596165.daa24b72.js} +1 -1
  48. data/tools/staticdocs/assets/js/b6d70f94.4923c793.js +1 -0
  49. data/tools/staticdocs/assets/js/b9f60ba6.e55cd937.js +1 -0
  50. data/tools/staticdocs/assets/js/{bd0034eb.b4e3d6c1.js → bd0034eb.6691ccc4.js} +1 -1
  51. data/tools/staticdocs/assets/js/c24eae19.251e0038.js +1 -0
  52. data/tools/staticdocs/assets/js/{cb8c3f08.a0ef4b5f.js → cb8c3f08.b82ad06f.js} +1 -1
  53. data/tools/staticdocs/assets/js/cd879be4.f956406f.js +1 -0
  54. data/tools/staticdocs/assets/js/d1b923aa.d6bafb72.js +1 -0
  55. data/tools/staticdocs/assets/js/{d1bfc316.2d823a88.js → d1bfc316.0a5ff560.js} +1 -1
  56. data/tools/staticdocs/assets/js/{d24bf9b6.53eca5e8.js → d24bf9b6.6c422113.js} +1 -1
  57. data/tools/staticdocs/assets/js/{d57a4b5d.aaa48891.js → d57a4b5d.8f23a506.js} +1 -1
  58. data/tools/staticdocs/assets/js/{d5d77c37.be6fe7b6.js → d5d77c37.70fdbbc6.js} +1 -1
  59. data/tools/staticdocs/assets/js/{d8ca4191.c6632184.js → d8ca4191.2349d796.js} +1 -1
  60. data/tools/staticdocs/assets/js/{d9b92eba.c6a2c7e5.js → d9b92eba.8f82360d.js} +1 -1
  61. data/tools/staticdocs/assets/js/{db8fa1d0.f078bc02.js → db8fa1d0.8f1b2c9f.js} +1 -1
  62. data/tools/staticdocs/assets/js/{dc5f7beb.a4afe7cd.js → dc5f7beb.e3a82d1e.js} +1 -1
  63. data/tools/staticdocs/assets/js/{e501b0d1.d108a8a9.js → e501b0d1.0b407477.js} +1 -1
  64. data/tools/staticdocs/assets/js/ebec1ccb.9bea92b0.js +1 -0
  65. data/tools/staticdocs/assets/js/f15615f1.5c433923.js +1 -0
  66. data/tools/staticdocs/assets/js/{fd886806.a21dd400.js → fd886806.4a41fa80.js} +1 -1
  67. data/tools/staticdocs/assets/js/main.b5390098.js +2 -0
  68. data/tools/staticdocs/assets/js/runtime~main.12d1e41d.js +1 -0
  69. data/tools/staticdocs/docs/configuration/command.html +96 -180
  70. data/tools/staticdocs/docs/configuration/format.html +25 -54
  71. data/tools/staticdocs/docs/configuration/interfaces.html +25 -80
  72. data/tools/staticdocs/docs/configuration/plugins.html +138 -178
  73. data/tools/staticdocs/docs/configuration/protocols.html +91 -110
  74. data/tools/staticdocs/docs/configuration/ssl-tls.html +33 -104
  75. data/tools/staticdocs/docs/configuration/table.html +67 -125
  76. data/tools/staticdocs/docs/configuration/target.html +23 -31
  77. data/tools/staticdocs/docs/configuration/telemetry-screens.html +194 -455
  78. data/tools/staticdocs/docs/configuration/telemetry.html +104 -187
  79. data/tools/staticdocs/docs/configuration.html +4 -4
  80. data/tools/staticdocs/docs/development/curl.html +17 -126
  81. data/tools/staticdocs/docs/development/developing.html +29 -80
  82. data/tools/staticdocs/docs/development/host-install.html +10 -23
  83. data/tools/staticdocs/docs/development/json-api.html +20 -32
  84. data/tools/staticdocs/docs/development/log-structure.html +14 -14
  85. data/tools/staticdocs/docs/development/roadmap.html +15 -15
  86. data/tools/staticdocs/docs/development/streaming-api.html +11 -83
  87. data/tools/staticdocs/docs/development/testing.html +17 -26
  88. data/tools/staticdocs/docs/development.html +4 -4
  89. data/tools/staticdocs/docs/getting-started/generators.html +35 -109
  90. data/tools/staticdocs/docs/getting-started/gettingstarted.html +26 -74
  91. data/tools/staticdocs/docs/getting-started/installation.html +24 -35
  92. data/tools/staticdocs/docs/getting-started/key_concepts.html +35 -35
  93. data/tools/staticdocs/docs/getting-started/podman.html +26 -57
  94. data/tools/staticdocs/docs/getting-started/requirements.html +21 -21
  95. data/tools/staticdocs/docs/getting-started/upgrading.html +12 -17
  96. data/tools/staticdocs/docs/getting-started.html +4 -4
  97. data/tools/staticdocs/docs/guides/bridges.html +19 -63
  98. data/tools/staticdocs/docs/guides/cfs.html +44 -184
  99. data/tools/staticdocs/docs/guides/custom-widgets.html +20 -47
  100. data/tools/staticdocs/docs/guides/little-endian-bitfields.html +5 -14
  101. data/tools/staticdocs/docs/guides/local-mode.html +16 -21
  102. data/tools/staticdocs/docs/guides/logging.html +12 -12
  103. data/tools/staticdocs/docs/guides/monitoring.html +22 -137
  104. data/tools/staticdocs/docs/guides/performance.html +18 -27
  105. data/tools/staticdocs/docs/guides/raspberrypi.html +10 -23
  106. data/tools/staticdocs/docs/guides/script-writing.html +85 -391
  107. data/tools/staticdocs/docs/guides/scripting-api.html +482 -1353
  108. data/tools/staticdocs/docs/guides.html +4 -4
  109. data/tools/staticdocs/docs/meta/contributing.html +14 -19
  110. data/tools/staticdocs/docs/meta/licenses.html +13 -31
  111. data/tools/staticdocs/docs/meta/philosophy.html +4 -4
  112. data/tools/staticdocs/docs/meta/xtce.html +15 -17
  113. data/tools/staticdocs/docs/meta.html +4 -4
  114. data/tools/staticdocs/docs/privacy.html +20 -20
  115. data/tools/staticdocs/docs/tools/autonomic.html +22 -22
  116. data/tools/staticdocs/docs/tools/bucket-explorer.html +13 -13
  117. data/tools/staticdocs/docs/tools/calendar.html +21 -21
  118. data/tools/staticdocs/docs/tools/cmd-sender.html +16 -16
  119. data/tools/staticdocs/docs/tools/cmd-tlm-server.html +23 -23
  120. data/tools/staticdocs/docs/tools/data-extractor.html +27 -27
  121. data/tools/staticdocs/docs/tools/data-viewer.html +13 -13
  122. data/tools/staticdocs/docs/tools/handbooks.html +7 -7
  123. data/tools/staticdocs/docs/tools/limits-monitor.html +19 -19
  124. data/tools/staticdocs/docs/tools/packet-viewer.html +16 -16
  125. data/tools/staticdocs/docs/tools/script-runner.html +36 -75
  126. data/tools/staticdocs/docs/tools/table-manager.html +13 -48
  127. data/tools/staticdocs/docs/tools/tlm-grapher.html +23 -23
  128. data/tools/staticdocs/docs/tools/tlm-viewer.html +18 -18
  129. data/tools/staticdocs/docs/tools.html +4 -4
  130. data/tools/staticdocs/docs.html +14 -14
  131. data/tools/staticdocs/index.html +4 -4
  132. data/tools/staticdocs/lunr-index-1724101625047.json +1 -0
  133. data/tools/staticdocs/lunr-index.json +1 -1
  134. data/tools/staticdocs/markdown-page.html +5 -5
  135. data/tools/staticdocs/search-doc-1724101625047.json +1 -0
  136. data/tools/staticdocs/search-doc.json +1 -1
  137. metadata +71 -71
  138. data/tools/staticdocs/assets/js/078dbab0.b275e04c.js +0 -1
  139. data/tools/staticdocs/assets/js/22b3ac48.0f4fbe9d.js +0 -1
  140. data/tools/staticdocs/assets/js/43652efd.be2c1d02.js +0 -1
  141. data/tools/staticdocs/assets/js/4650.292aca67.js +0 -1
  142. data/tools/staticdocs/assets/js/53ca7c5b.3f1245d5.js +0 -1
  143. data/tools/staticdocs/assets/js/5e3ed378.77db7b87.js +0 -1
  144. data/tools/staticdocs/assets/js/5fe211ef.71dc8326.js +0 -1
  145. data/tools/staticdocs/assets/js/6831b732.5714d508.js +0 -1
  146. data/tools/staticdocs/assets/js/6f92e431.300a9857.js +0 -1
  147. data/tools/staticdocs/assets/js/72c6d8a8.cfccace6.js +0 -1
  148. data/tools/staticdocs/assets/js/9424f0b3.29299bde.js +0 -1
  149. data/tools/staticdocs/assets/js/b6d70f94.f5514e8b.js +0 -1
  150. data/tools/staticdocs/assets/js/b9f60ba6.c3b3046d.js +0 -1
  151. data/tools/staticdocs/assets/js/c24eae19.6b084c7c.js +0 -1
  152. data/tools/staticdocs/assets/js/cd879be4.6f19050a.js +0 -1
  153. data/tools/staticdocs/assets/js/d1b923aa.3f3e186d.js +0 -1
  154. data/tools/staticdocs/assets/js/ebec1ccb.1ded1149.js +0 -1
  155. data/tools/staticdocs/assets/js/f15615f1.f9b655a6.js +0 -1
  156. data/tools/staticdocs/assets/js/main.c2e2b617.js +0 -2
  157. data/tools/staticdocs/assets/js/runtime~main.2bb31799.js +0 -1
  158. data/tools/staticdocs/lunr-index-1719505302032.json +0 -1
  159. data/tools/staticdocs/search-doc-1719505302032.json +0 -1
  160. /data/tools/staticdocs/assets/js/{main.c2e2b617.js.LICENSE.txt → main.b5390098.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([[8499],{6736:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>l,default:()=>h,frontMatter:()=>a,metadata:()=>s,toc:()=>r});var i=n(1085),o=n(1184);const a={title:"Table Manager"},l=void 0,s={id:"tools/table-manager",title:"Table Manager",description:"Introduction",source:"@site/docs/tools/table-manager.md",sourceDirName:"tools",slug:"/tools/table-manager",permalink:"/tools/staticdocs/docs/tools/table-manager",draft:!1,unlisted:!1,editUrl:"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/tools/table-manager.md",tags:[],version:"current",frontMatter:{title:"Table Manager"},sidebar:"defaultSidebar",previous:{title:"Script Runner",permalink:"/tools/staticdocs/docs/tools/script-runner"},next:{title:"Telemetry Grapher",permalink:"/tools/staticdocs/docs/tools/tlm-grapher"}},d={},r=[{value:"Introduction",id:"introduction",level:2},{value:"File Menu Items",id:"file-menu-items",level:3},{value:"File Download",id:"file-download",level:2},{value:"Upload / Download",id:"upload--download",level:2},{value:"upload.rb",id:"uploadrb",level:3},{value:"download.rb",id:"downloadrb",level:3}];function c(e){const t={a:"a",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h2,{id:"introduction",children:"Introduction"}),"\n",(0,i.jsxs)(t.p,{children:["Table Manager is a binary file editor. It takes binary file ",(0,i.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/table",children:"definitions"})," similar to the COSMOS command packet definitions and builds a GUI to edit the fields in the binary file."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"Table Manager",src:n(6714).A+"",width:"1272",height:"849"})}),"\n",(0,i.jsx)(t.h3,{id:"file-menu-items",children:"File Menu Items"}),"\n",(0,i.jsx)("img",{src:n(132).A,alt:"File Menu",style:{float:"left","margin-right":"50px",height:"150px"}}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["Create a new binary based on ",(0,i.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/table",children:"definition"})]}),"\n",(0,i.jsx)(t.li,{children:"Open an existing binary"}),"\n",(0,i.jsx)(t.li,{children:"Save the current binary"}),"\n",(0,i.jsx)(t.li,{children:"Rename the current binary"}),"\n",(0,i.jsx)(t.li,{children:"Delete the current binary"}),"\n"]}),"\n",(0,i.jsx)(t.h2,{id:"file-download",children:"File Download"}),"\n",(0,i.jsxs)(t.p,{children:["The three buttons next to File Download download the binary file, the ",(0,i.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/table",children:"definition"})," file, and the report file. The binary is the raw bits defined by the table. The ",(0,i.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/table",children:"definition"})," is the structure definition of those raw bits. The report file is a Table Manager generated CSV that shows all the table values in the binary."]}),"\n",(0,i.jsx)(t.h2,{id:"upload--download",children:"Upload / Download"}),"\n",(0,i.jsxs)(t.p,{children:["Table Manager has the ability to directly call a COSMOS script to upload a binary file to a target or download a file into Table Manager. If a file called ",(0,i.jsx)(t.code,{children:"upload.rb"})," is found in the Target's procedures directory then the Upload button becomes active. If a file called ",(0,i.jsx)(t.code,{children:"download.rb"})," is found in the Target's procedures directory then the Download button becomes active. The B/G button indicates whether to run the upload / download scripts in the background. If you uncheck this box a new Script Runner window will show the line by line execution of the script."]}),"\n",(0,i.jsx)(t.h3,{id:"uploadrb",children:"upload.rb"}),"\n",(0,i.jsxs)(t.p,{children:["The COSMOS demo creates the following ",(0,i.jsx)(t.code,{children:"upload.rb"})," script. Note that the ",(0,i.jsx)(t.code,{children:"ENV['TBL_FILENAME']"})," is set to the name of the table file and the script uses ",(0,i.jsx)(t.code,{children:"get_target_file"})," to get access to the file. At this point the logic to upload the file to the target is specific to the commanding defined by the target but an example script is given."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ruby",children:'# TBL_FILENAME is set to the name of the table file\nputs "file:#{ENV[\'TBL_FILENAME\']}"\n# Open the file\nfile = get_target_file(ENV[\'TBL_FILENAME\'])\nbuffer = file.read\n# puts buffer.formatted\n# Implement custom commanding logic to upload the table\n# Note that buffer is a Ruby string of bytes\n# You probably want to do something like:\n# buf_size = 512 # Size of a buffer in the upload command\n# i = 0\n# while i < buffer.length\n# # Send a part of the buffer\n# # NOTE: triple dots means start index, up to but not including, end index\n# # while double dots means start index, up to AND including, end index\n# cmd("TGT", "UPLOAD", "DATA" => buffer[i...(i + buf_size)])\n# i += buf_size\n# end\nfile.delete\n'})}),"\n",(0,i.jsx)(t.h3,{id:"downloadrb",children:"download.rb"}),"\n",(0,i.jsxs)(t.p,{children:["The COSMOS demo creates the following ",(0,i.jsx)(t.code,{children:"download.rb"})," script. Note that the ",(0,i.jsx)(t.code,{children:"ENV['TBL_FILENAME']"})," is set to the name of the table file to OVERWRITE and the script uses ",(0,i.jsx)(t.code,{children:"put_target_file"})," to get access to the file. At this point the logic to download the file from the target is specific to the commanding defined by the target but an example script is given."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ruby",children:"# TBL_FILENAME is set to the name of the table file to overwrite\nputs \"file:#{ENV['TBL_FILENAME']}\"\n# Download the file\n# Implement custom commanding logic to download the table\n# You probably want to do something like:\nbuffer = ''\n# i = 1\n# num_segments = 5 # calculate based on TBL_FILENAME\n# table_id = 1 # calculate based on TBL_FILENAME\n# while i < num_segments\n# # Request a part of the table buffer\n# cmd(\"TGT DUMP with TABLE_ID #{table_id}, SEGMENT #{i}\")\n# buffer += tlm(\"TGT DUMP_PKT DATA\")\n# i += 1\n# end\nput_target_file(ENV['TBL_FILENAME'], buffer)\n"})})]})}function h(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},132:(e,t,n)=>{n.d(t,{A:()=>i});const i=n.p+"assets/images/file_menu-d672c1f8064e5f847a2464397c1e75ee423452f1ba4a7d0861319bc7c7891196.png"},6714:(e,t,n)=>{n.d(t,{A:()=>i});const i=n.p+"assets/images/table_manager-816d7a683e6883cb8049e5ec8ffef3076b37a489edcc0e5331bc5d81ab506da2.png"},1184:(e,t,n)=>{n.d(t,{R:()=>l});var i=n(4041);const o={},a=i.createContext(o);function l(e){const t=i.useContext(a);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}}}]);
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([[8499],{6736:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>l,default:()=>h,frontMatter:()=>a,metadata:()=>s,toc:()=>r});var i=n(1085),o=n(1184);const a={title:"Table Manager"},l=void 0,s={id:"tools/table-manager",title:"Table Manager",description:"Introduction",source:"@site/docs/tools/table-manager.md",sourceDirName:"tools",slug:"/tools/table-manager",permalink:"/tools/staticdocs/docs/tools/table-manager",draft:!1,unlisted:!1,editUrl:"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/tools/table-manager.md",tags:[],version:"current",frontMatter:{title:"Table Manager"},sidebar:"defaultSidebar",previous:{title:"Script Runner",permalink:"/tools/staticdocs/docs/tools/script-runner"},next:{title:"Telemetry Grapher",permalink:"/tools/staticdocs/docs/tools/tlm-grapher"}},d={},r=[{value:"Introduction",id:"introduction",level:2},{value:"File Menu Items",id:"file-menu-items",level:3},{value:"File Download",id:"file-download",level:2},{value:"Upload / Download",id:"upload--download",level:2},{value:"upload.rb",id:"uploadrb",level:3},{value:"download.rb",id:"downloadrb",level:3}];function c(e){const t={a:"a",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h2,{id:"introduction",children:"Introduction"}),"\n",(0,i.jsxs)(t.p,{children:["Table Manager is a binary file editor. It takes binary file ",(0,i.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/table",children:"definitions"})," similar to the COSMOS command packet definitions and builds a GUI to edit the fields in the binary file."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"Table Manager",src:n(6714).A+"",width:"1272",height:"849"})}),"\n",(0,i.jsx)(t.h3,{id:"file-menu-items",children:"File Menu Items"}),"\n",(0,i.jsx)("img",{src:n(132).A,alt:"File Menu",style:{float:"left","margin-right":"50px",height:"150px"}}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["Create a new binary based on ",(0,i.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/table",children:"definition"})]}),"\n",(0,i.jsx)(t.li,{children:"Open an existing binary"}),"\n",(0,i.jsx)(t.li,{children:"Save the current binary"}),"\n",(0,i.jsx)(t.li,{children:"Rename the current binary"}),"\n",(0,i.jsx)(t.li,{children:"Delete the current binary"}),"\n"]}),"\n",(0,i.jsx)(t.h2,{id:"file-download",children:"File Download"}),"\n",(0,i.jsxs)(t.p,{children:["The three buttons next to File Download download the binary file, the ",(0,i.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/table",children:"definition"})," file, and the report file. The binary is the raw bits defined by the table. The ",(0,i.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/table",children:"definition"})," is the structure definition of those raw bits. The report file is a Table Manager generated CSV that shows all the table values in the binary."]}),"\n",(0,i.jsx)(t.h2,{id:"upload--download",children:"Upload / Download"}),"\n",(0,i.jsxs)(t.p,{children:["Table Manager has the ability to directly call a COSMOS script to upload a binary file to a target or download a file into Table Manager. If a file called ",(0,i.jsx)(t.code,{children:"upload.rb"})," is found in the Target's procedures directory then the Upload button becomes active. If a file called ",(0,i.jsx)(t.code,{children:"download.rb"})," is found in the Target's procedures directory then the Download button becomes active. The B/G button indicates whether to run the upload / download scripts in the background. If you uncheck this box a new Script Runner window will show the line by line execution of the script."]}),"\n",(0,i.jsx)(t.h3,{id:"uploadrb",children:"upload.rb"}),"\n",(0,i.jsxs)(t.p,{children:["The COSMOS demo creates the following ",(0,i.jsx)(t.code,{children:"upload.rb"})," script. Note that the ",(0,i.jsx)(t.code,{children:"ENV['TBL_FILENAME']"})," is set to the name of the table file and the script uses ",(0,i.jsx)(t.code,{children:"get_target_file"})," to get access to the file. At this point the logic to upload the file to the target is specific to the commanding defined by the target but an example script is given."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ruby",children:'# TBL_FILENAME is set to the name of the table file\nputs "file:#{ENV[\'TBL_FILENAME\']}"\n# Open the file\nfile = get_target_file(ENV[\'TBL_FILENAME\'])\nbuffer = file.read\n# puts buffer.formatted\n# Implement custom commanding logic to upload the table\n# Note that buffer is a Ruby string of bytes\n# You probably want to do something like:\n# buf_size = 512 # Size of a buffer in the upload command\n# i = 0\n# while i < buffer.length\n# # Send a part of the buffer\n# # NOTE: triple dots means start index, up to but not including, end index\n# # while double dots means start index, up to AND including, end index\n# cmd("TGT", "UPLOAD", "DATA" => buffer[i...(i + buf_size)])\n# i += buf_size\n# end\nfile.delete\n'})}),"\n",(0,i.jsx)(t.h3,{id:"downloadrb",children:"download.rb"}),"\n",(0,i.jsxs)(t.p,{children:["The COSMOS demo creates the following ",(0,i.jsx)(t.code,{children:"download.rb"})," script. Note that the ",(0,i.jsx)(t.code,{children:"ENV['TBL_FILENAME']"})," is set to the name of the table file to OVERWRITE and the script uses ",(0,i.jsx)(t.code,{children:"put_target_file"})," to get access to the file. At this point the logic to download the file from the target is specific to the commanding defined by the target but an example script is given."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ruby",children:"# TBL_FILENAME is set to the name of the table file to overwrite\nputs \"file:#{ENV['TBL_FILENAME']}\"\n# Download the file\n# Implement custom commanding logic to download the table\n# You probably want to do something like:\nbuffer = ''\n# i = 1\n# num_segments = 5 # calculate based on TBL_FILENAME\n# table_id = 1 # calculate based on TBL_FILENAME\n# while i < num_segments\n# # Request a part of the table buffer\n# cmd(\"TGT DUMP with TABLE_ID #{table_id}, SEGMENT #{i}\")\n# buffer += tlm(\"TGT DUMP_PKT DATA\")\n# i += 1\n# end\nput_target_file(ENV['TBL_FILENAME'], buffer)\n"})})]})}function h(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},132:(e,t,n)=>{n.d(t,{A:()=>i});const i=n.p+"assets/images/file_menu-d672c1f8064e5f847a2464397c1e75ee423452f1ba4a7d0861319bc7c7891196.png"},6714:(e,t,n)=>{n.d(t,{A:()=>i});const i=n.p+"assets/images/table_manager-816d7a683e6883cb8049e5ec8ffef3076b37a489edcc0e5331bc5d81ab506da2.png"},1184:(e,t,n)=>{n.d(t,{R:()=>l,x:()=>s});var i=n(4041);const o={},a=i.createContext(o);function l(e){const t=i.useContext(a);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:l(e.components),i.createElement(a.Provider,{value:t},e.children)}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([[9005],{158:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>i,default:()=>h,frontMatter:()=>a,metadata:()=>o,toc:()=>c});var s=n(1085),r=n(1184);const a={sidebar_position:7,title:"Protocols"},i=void 0,o={id:"configuration/protocols",title:"Protocols",description:"Protocols process data on behalf of an Interface. They can modify the data being written, data being read, or both. Protocols can also mark a packet as stored instead of real-time which means COSMOS will not update the current value table with the packet data. Protocols can be layered and will be processed in order. For example, if you have a low-level encryption layer that must be first removed before processing a higher level buffer length protocol.",source:"@site/docs/configuration/protocols.md",sourceDirName:"configuration",slug:"/configuration/protocols",permalink:"/tools/staticdocs/docs/configuration/protocols",draft:!1,unlisted:!1,editUrl:"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/configuration/protocols.md",tags:[],version:"current",sidebarPosition:7,frontMatter:{sidebar_position:7,title:"Protocols"},sidebar:"defaultSidebar",previous:{title:"Interfaces",permalink:"/tools/staticdocs/docs/configuration/interfaces"},next:{title:"Tables",permalink:"/tools/staticdocs/docs/configuration/table"}},d={},c=[{value:"Packet Delineation Protocols",id:"packet-delineation-protocols",level:2},{value:"COBS Protocol",id:"cobs-protocol",level:3},{value:"SLIP Protocol",id:"slip-protocol",level:3},{value:"Burst Protocol",id:"burst-protocol",level:3},{value:"Fixed Protocol",id:"fixed-protocol",level:3},{value:"Length Protocol",id:"length-protocol",level:3},{value:"Terminated Protocol",id:"terminated-protocol",level:3},{value:"Template Protocol",id:"template-protocol",level:3},{value:"Preidentified Protocol",id:"preidentified-protocol",level:3},{value:"Helper Protocols",id:"helper-protocols",level:2},{value:"CmdResponse Protocol",id:"cmdresponse-protocol",level:3},{value:"CRC Protocol",id:"crc-protocol",level:3},{value:"Ignore Packet Protocol",id:"ignore-packet-protocol",level:3},{value:"Custom Protocols",id:"custom-protocols",level:2},{value:"Method discussions",id:"method-discussions",level:2},{value:"initialize or <strong>init</strong>",id:"initialize-or-init",level:3},{value:"reset",id:"reset",level:3},{value:"connect_reset",id:"connect_reset",level:3},{value:"disconnect_reset",id:"disconnect_reset",level:3},{value:"read_data",id:"read_data",level:3},{value:"read_packet",id:"read_packet",level:3},{value:"write_packet",id:"write_packet",level:3},{value:"write_data",id:"write_data",level:3},{value:"post_write_interface",id:"post_write_interface",level:3},{value:"protocol_cmd",id:"protocol_cmd",level:3},{value:"Examples",id:"examples",level:2}];function l(e){const t={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",img:"img",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.p,{children:"Protocols process data on behalf of an Interface. They can modify the data being written, data being read, or both. Protocols can also mark a packet as stored instead of real-time which means COSMOS will not update the current value table with the packet data. Protocols can be layered and will be processed in order. For example, if you have a low-level encryption layer that must be first removed before processing a higher level buffer length protocol."}),"\n",(0,s.jsx)(t.admonition,{title:"Protocol Run Order",type:"info",children:(0,s.jsx)(t.p,{children:"Read protocols execute in the order specified (First specified runs first). Write protocols execute in the reverse order (Last specified executes first)."})}),"\n",(0,s.jsx)(t.p,{children:"Protocols are typically used to define the logic to delineate packets and manipulate data as it written to and read from Interfaces. COSMOS includes Interfaces for TCP/IP Client, TCP/IP Server, Udp Client / Server, and Serial connections. For 99% of use cases these Interfaces should not require any changes as they universally handle the low-level details of reading and writing from these types of connections. All unique behavior should now be defined in Protocols."}),"\n",(0,s.jsx)(t.p,{children:"At a minimum, any byte stream based Interface will require a Protocol to delineate packets. TCP/IP and Serial are examples of byte stream based Interfaces. A byte stream is just a simple stream of bytes and thus you need some way to know where packets begin and end within the stream."}),"\n",(0,s.jsx)(t.p,{children:"TCP/IP is a friendly byte stream. Unless you are dealing with a very poorly written system, the first byte received on a TCP/IP connection will always be the start of a packet. Also, TCP/IP is a reliable connection in that it ensures that all data is received in the correct order, that no data is lost, and that the data is not corrupted (TCP/IP is protected by a CRC32 which is pretty good for avoiding unrecognized data corruption)."}),"\n",(0,s.jsx)(t.p,{children:"Serial is a much less friendly byte stream. With serial connections, it is very likely that when you open a serial port and start receiving data you will receive the middle of a message. (This problem is only avoided when interfacing with a system that only writes to the serial port in response to a command). For this reason, sync patterns are highly beneficial for serial interfaces. Additionally, serial interfaces may use some method to protect against unrecognized data corruption (Checksums, CRCs, etc.)"}),"\n",(0,s.jsx)(t.p,{children:"UDP is an inherently packet based connection. If you read from a UDP socket, you will always receive back an entire packet. The best UDP based Protocols take advantage of this fact. Some implementations try to make UDP act like a byte stream, but this is a misuse of the protocol because it is highly likely that you will lose data and have no way to recover."}),"\n",(0,s.jsx)(t.h2,{id:"packet-delineation-protocols",children:"Packet Delineation Protocols"}),"\n",(0,s.jsx)(t.p,{children:"COSMOS provides the following packet delineation protocols: COBS, SLIP, Burst, Fixed, Length, Template (deprecated), Terminated and Preidentified. Each of these protocols has the primary purpose of separating out packets from a byte stream."}),"\n",(0,s.jsxs)(t.p,{children:['Note that all protocols take a final parameter called "Allow Empty Data". This indicates whether the protocol will allow an empty string to be passed down to later Protocols (instead of returning ',":STOP","). Can be true, false, or nil, where nil is interpreted as true unless the Protocol is the last Protocol of the chain. End users of a protocol will almost always simply leave off this parameter. For more information read the ",(0,s.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/protocols#custom-protocols",children:"Custom Protocols"})," documentation."]}),"\n",(0,s.jsx)(t.h3,{id:"cobs-protocol",children:"COBS Protocol"}),"\n",(0,s.jsxs)(t.p,{children:["The Consistent Overhead Byte Stuffing (COBS) Protocol is an algorithm for encoding data bytes that results in efficient, reliable, unambiguous packet framing regardless of packet content, thus making it easy for receiving applications to recover from malformed packets. It employs the zero byte value to serve as a packet delimiter (a special value that indicates the boundary between packets). The algorithm replaces each zero data byte with a non-zero value so that no zero data bytes will appear in the packet and thus be misinterpreted as packet boundaries (See ",(0,s.jsx)(t.a,{href:"https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing",children:"https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing"})," for more)."]}),"\n",(0,s.jsx)(t.h3,{id:"slip-protocol",children:"SLIP Protocol"}),"\n",(0,s.jsxs)(t.p,{children:["The Serial Line IP (SLIP) Protocol defines a sequence of characters that frame IP packets on a serial line. It defines two special characters: END and ESC. END is 0xC0 and ESC is 0xDB. To send a packet, a SLIP host simply starts sending the data in the packet. If a data byte is the same code as END character, a two byte sequence of ESC and 0xDC is sent instead. If a data bytes is the same as an ESC character, an two byte sequence of ESC and 0xDD is sent instead. When the last byte in the packet has been sent, an END character is then transmitted (See ",(0,s.jsx)(t.a,{href:"https://datatracker.ietf.org/doc/html/rfc1055",children:"https://datatracker.ietf.org/doc/html/rfc1055"})," for more)."]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"}),(0,s.jsx)(t.th,{children:"Default"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Start Char"}),(0,s.jsx)(t.td,{children:"Character to place at the start of frames"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"nil (no character)"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Read Strip Characters"}),(0,s.jsx)(t.td,{children:"Strip off start_char and end_char from reads"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"true"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Read Enable Escaping"}),(0,s.jsx)(t.td,{children:"Whether to enable character escaping on reads"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"true"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Write Enable Escaping"}),(0,s.jsx)(t.td,{children:"Whether to enable character escaping on writes"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"true"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"End Char"}),(0,s.jsx)(t.td,{children:"Character to place at the end of frames"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"0xC0"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Esc Char"}),(0,s.jsx)(t.td,{children:"Escape character"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"0xDB"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Escape End Char"}),(0,s.jsx)(t.td,{children:"Character to escape End character"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"0xDC"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Escape Esc Char"}),(0,s.jsx)(t.td,{children:"Character to escape Esc character"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"0xDD"})]})]})]}),"\n",(0,s.jsx)(t.h3,{id:"burst-protocol",children:"Burst Protocol"}),"\n",(0,s.jsx)(t.p,{children:"The Burst Protocol simply reads as much data as it can from the interface before returning the data as a COSMOS Packet (It returns a packet for each burst of data read). This Protocol relies on regular bursts of data delimited by time and thus is not very robust. However, it can utilize a sync pattern which does allow it to re-sync if necessary. It can also discard bytes from the incoming data to remove the sync pattern. Finally, it can add sync patterns to data being written out of the Interface."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"}),(0,s.jsx)(t.th,{children:"Default"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Discard Leading Bytes"}),(0,s.jsx)(t.td,{children:"The number of bytes to discard from the binary data after reading. Note that this applies to bytes starting with the sync pattern if the sync pattern is being used."}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"0 (do not discard bytes)"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Sync Pattern"}),(0,s.jsx)(t.td,{children:"Hex string representing a byte pattern that will be searched for in the raw data. This pattern represents a packet delimiter and all data found including the sync pattern will be returned"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"nil (no sync pattern)"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Fill Fields"}),(0,s.jsx)(t.td,{children:"Whether to fill in the sync pattern on outgoing packets"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"false"})]})]})]}),"\n",(0,s.jsx)(t.h3,{id:"fixed-protocol",children:"Fixed Protocol"}),"\n",(0,s.jsx)(t.p,{children:"The Fixed Protocol reads a preset minimum amount of data which is necessary to properly identify all the defined packets using the interface. It then identifies the packet and proceeds to read as much data from the interface as necessary to create the packet which it then returns. This protocol relies on all the packets on the interface being fixed in length. For example, all the packets using the interface are a fixed size and contain a simple header with a 32-bit sync pattern followed by a 16 bit ID. The Fixed Protocol would elegantly handle this case with a minimum read size of 6 bytes. The Fixed Protocol also supports a sync pattern, discarding leading bytes, and filling the sync pattern similar to the Burst Protocol."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"}),(0,s.jsx)(t.th,{children:"Default"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Minimum ID Size"}),(0,s.jsx)(t.td,{children:"The minimum number of bytes needed to identify a packet. All the packet definitions must declare their ID_ITEM(s) within this given number of bytes."}),(0,s.jsx)(t.td,{children:"Yes"}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Discard Leading Bytes"}),(0,s.jsx)(t.td,{children:"The number of bytes to discard from the binary data after reading. Note that this applies to bytes starting with the sync pattern if the sync pattern is being used."}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"0 (do not discard bytes)"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Sync Pattern"}),(0,s.jsx)(t.td,{children:"Hex string representing a byte pattern that will be searched for in the raw data. This pattern represents a packet delimiter and all data found including the sync pattern will be returned."}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"nil (no sync pattern)"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Telemetry"}),(0,s.jsx)(t.td,{children:"Whether the data is telemetry"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"true (false means command)"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Fill Fields"}),(0,s.jsx)(t.td,{children:"Whether to fill in the sync pattern on outgoing packets"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"false"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Unknown Raise"}),(0,s.jsx)(t.td,{children:"Whether to raise an exception for an unknown packet"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"false"})]})]})]}),"\n",(0,s.jsx)(t.h3,{id:"length-protocol",children:"Length Protocol"}),"\n",(0,s.jsx)(t.p,{children:"The Length Protocol depends on a length field at a fixed location in the defined packets using the interface. It then reads enough data to grab the length field, decodes it, and reads the remaining length of the packet. For example, all the packets using the interface contain a CCSDS header with a length field. The Length Protocol can be set up to handle the length field and even the length offset CCSDS uses. The Length Protocol also supports a sync pattern, discarding leading bytes, and filling the length and sync pattern similar to the Burst Protocol."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"}),(0,s.jsx)(t.th,{children:"Default"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Length Bit Offset"}),(0,s.jsx)(t.td,{children:"The bit offset from the start of the packet to the length field. Every packet using this interface must have the same structure such that the length field is the same size at the same location. Be sure to account for the length of the Sync Pattern in this value (if present)."}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"0 bits"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Length Bit Size"}),(0,s.jsx)(t.td,{children:"The size in bits of the length field"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"16 bits"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Length Value Offset"}),(0,s.jsx)(t.td,{children:"The offset to apply to the length field value. The actual value of the length field plus this offset should equal the exact number of bytes required to read all data for the packet (including the length field itself, sync pattern, etc). For example, if the length field indicates packet length minus one, this value should be one. Be sure to account for the length of the Sync Pattern in this value (if present)."}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"0"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Bytes per Count"}),(0,s.jsx)(t.td,{children:"The number of bytes per each length field 'count'. This is used if the units of the length field is something other than bytes, e.g. if the length field count is in words."}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"1 byte"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Length Endianness"}),(0,s.jsx)(t.td,{children:"The endianness of the length field. Must be either 'BIG_ENDIAN' or 'LITTLE_ENDIAN'."}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"'BIG_ENDIAN'"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Discard Leading Bytes"}),(0,s.jsx)(t.td,{children:"The number of bytes to discard from the binary data after reading. Note that this applies to bytes including the sync pattern if the sync pattern is being used. Discarding is one of the very last steps so any size and offsets above need to account for all the data before discarding."}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"0 (do not discard bytes)"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Sync Pattern"}),(0,s.jsx)(t.td,{children:"Hex string representing a byte pattern that will be searched for in the raw data. This pattern represents a packet delimiter and all data found including the sync pattern will be returned."}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"nil (no sync pattern)"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Max Length"}),(0,s.jsx)(t.td,{children:"The maximum allowed value in the length field"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"nil (no maximum length)"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Fill Length and Sync Pattern"}),(0,s.jsx)(t.td,{children:"Setting this flag to true causes the length field and sync pattern (if present) to be filled automatically on outgoing packets."}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"false"})]})]})]}),"\n",(0,s.jsx)(t.p,{children:"The most confusing aspect of the Length Protocol is calculating the Length Value Offset. This is especially true in the commonly used CCSDS Space Packet Protocol. The best way to illustrate this is with an example. Suppose you have CCSDS Space Packets prepended with a Sync Pattern of 0x1ACFFC1D. This would look like the following:"}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Sync (4 bytes)"}),(0,s.jsx)(t.th,{children:"Header (4 bytes)"}),(0,s.jsx)(t.th,{children:"Length (2 bytes)"}),(0,s.jsx)(t.th,{children:"Data (4 bytes)"})]})}),(0,s.jsx)(t.tbody,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"0x1ACFFC1D"}),(0,s.jsx)(t.td,{children:"0x0001CADB"}),(0,s.jsx)(t.td,{children:"0x0003"}),(0,s.jsx)(t.td,{children:"0xDEADBEEF"})]})})]}),"\n",(0,s.jsxs)(t.p,{children:["In this case the total length of the packet is 14 bytes: ",(0,s.jsx)(t.strong,{children:"4 + 4 + 2 + 4 = 14"}),". With 4 bytes of data, the length field is 3 because in CCSDS the length field is calculated as (data length - 1). So how would we calculate the Length Value Offset? COSMOS reads all the bytes in the packet (including the Sync Pattern) so the total length is 14 bytes. The length field is 3 so the Length Value Offset (offset to apply to the length field value) should be 11 (",(0,s.jsx)(t.strong,{children:"3 + 11 = 14"}),")."]}),"\n",(0,s.jsx)(t.h3,{id:"terminated-protocol",children:"Terminated Protocol"}),"\n",(0,s.jsx)(t.p,{children:"The Terminated Protocol delineates packets using termination characters found at the end of every packet. It continuously reads data until the termination characters are found at which point it returns the packet data. For example, all the packets using the interface are followed by 0xABCD. This data can either be a part of each packet that is kept or something which is known only by the Terminated Protocol and simply thrown away."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"}),(0,s.jsx)(t.th,{children:"Default"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Write Termination Characters"}),(0,s.jsx)(t.td,{children:"The data to write after writing a command packet. Given as a hex string such as 0xABCD."}),(0,s.jsx)(t.td,{children:"Yes"}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Read Termination Characters"}),(0,s.jsx)(t.td,{children:"The characters which delineate the end of a telemetry packet. Given as a hex string such as 0xABCD."}),(0,s.jsx)(t.td,{children:"Yes"}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Strip Read Termination"}),(0,s.jsx)(t.td,{children:"Whether to remove the read termination characters before returning the telemetry packet"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"true"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Discard Leading Bytes"}),(0,s.jsx)(t.td,{children:"The number of bytes to discard from the binary data after reading. Note that this applies to bytes including the sync pattern if the sync pattern is being used."}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"0 (do not discard bytes)"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Sync Pattern"}),(0,s.jsx)(t.td,{children:"Hex string representing a byte pattern that will be searched for in the raw data. This pattern represents a packet delimiter and all data found including the sync pattern will be returned."}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"nil (no sync pattern)"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Fill Fields"}),(0,s.jsx)(t.td,{children:"Whether to fill in the sync pattern on outgoing packets"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"false"})]})]})]}),"\n",(0,s.jsx)(t.h3,{id:"template-protocol",children:"Template Protocol"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Deprecated"})}),"\n",(0,s.jsx)(t.p,{children:"This protocol is now deprecated because it is not able to capture the original SCPI messages in COSMOS raw logging. Please use the TemplateAccessor with the CmdResponseProtocol instead."}),"\n",(0,s.jsxs)(t.p,{children:["The Template Protocol works much like the Terminated Protocol except it is designed for text-based command and response type interfaces such as SCPI (Standard Commands for Programmable Instruments). It delineates packets in the same way as the Terminated Protocol except each packet is referred to as a line (because each usually contains a line of text). For outgoing packets, a CMD_TEMPLATE field is expected to exist in the packet. This field contains a template string with items to be filled in delineated within HTML tag style brackets ",(0,s.jsx)(t.code,{children:'"<EXAMPLE>"'}),". The Template Protocol will read the named items from within the packet and fill in the CMD_TEMPLATE. This filled in string is then sent out rather than the originally passed in packet. Correspondingly, if a response is expected the outgoing packet should include a RSP_TEMPLATE and RSP_PACKET field. The RSP_TEMPLATE is used to extract data from the response string and build a corresponding RSP_PACKET. See the TEMPLATE target within the COSMOS Demo configuration for an example of usage."]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"}),(0,s.jsx)(t.th,{children:"Default"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Write Termination Characters"}),(0,s.jsx)(t.td,{children:"The data to write after writing a command packet. Given as a hex string such as 0xABCD."}),(0,s.jsx)(t.td,{children:"Yes"}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Read Termination Characters"}),(0,s.jsx)(t.td,{children:"The characters which delineate the end of a telemetry packet. Given as a hex string such as 0xABCD."}),(0,s.jsx)(t.td,{children:"Yes"}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Ignore Lines"}),(0,s.jsx)(t.td,{children:"Number of response lines to ignore (completely drop)"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"0 lines"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Initial Read Delay"}),(0,s.jsx)(t.td,{children:"An initial delay after connecting after which the interface will be read till empty and data dropped. Useful for discarding connect headers and initial prompts."}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"nil (no initial read)"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Response Lines"}),(0,s.jsx)(t.td,{children:"The number of lines that make up expected responses"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"1 line"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Strip Read Termination"}),(0,s.jsx)(t.td,{children:"Whether to remove the read termination characters before returning the telemetry packet"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"true"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Discard Leading Bytes"}),(0,s.jsx)(t.td,{children:"The number of bytes to discard from the binary data after reading. Note that this applies to bytes including the sync pattern if the sync pattern is being used."}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"0 (do not discard bytes)"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Sync Pattern"}),(0,s.jsx)(t.td,{children:"Hex string representing a byte pattern that will be searched for in the raw data. This pattern represents a packet delimiter and all data found including the sync pattern will be returned."}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"nil (no sync pattern)"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Fill Fields"}),(0,s.jsx)(t.td,{children:"Whether to fill in the sync pattern on outgoing packets"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"false"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Response Timeout"}),(0,s.jsx)(t.td,{children:"Number of seconds to wait for a response before timing out"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"5.0"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Response Polling Period"}),(0,s.jsx)(t.td,{children:"Number of seconds to wait between polling for a response"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"0.02"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Raise Exceptions"}),(0,s.jsx)(t.td,{children:"Whether to raise exceptions when errors occur like timeouts or unexpected responses"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"false"})]})]})]}),"\n",(0,s.jsx)(t.h3,{id:"preidentified-protocol",children:"Preidentified Protocol"}),"\n",(0,s.jsx)(t.p,{children:"The Preidentified Protocol delineates packets using a custom COSMOS header. This Protocol is created to allow tools to connect and receive the entire packet stream. It can also be used to chain COSMOS instances together although that should rarely be needed with the new web native implementation."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"}),(0,s.jsx)(t.th,{children:"Default"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Sync Pattern"}),(0,s.jsx)(t.td,{children:"Hex string representing a byte pattern that will be searched for in the raw data. This pattern represents a packet delimiter and all data found AFTER the sync pattern will be returned. The sync pattern itself is discarded."}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"nil (no sync pattern)"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Max Length"}),(0,s.jsx)(t.td,{children:"The maximum allowed value in the length field"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"nil (no maximum length)"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Mode"}),(0,s.jsx)(t.td,{children:"The Version of the preidentified protocol to support (2 or 4).3"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"4"})]})]})]}),"\n",(0,s.jsx)(t.h2,{id:"helper-protocols",children:"Helper Protocols"}),"\n",(0,s.jsx)(t.p,{children:"COSMOS provides the following helper protocols: CmdResponse, Crc and Ignore. These protocols provide helper functionality to Interfaces."}),"\n",(0,s.jsx)(t.h3,{id:"cmdresponse-protocol",children:"CmdResponse Protocol"}),"\n",(0,s.jsx)(t.p,{children:"The CmdResponse Protocol waits for a response for any commands with a defined response packet (TODO: More documentation and examples)."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"}),(0,s.jsx)(t.th,{children:"Default"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Response Timeout"}),(0,s.jsx)(t.td,{children:"Number of seconds to wait before timing out when waiting for a response"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"5"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Response Polling Period"}),(0,s.jsx)(t.td,{children:"Number of seconds to wait between polling for a response"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"0.02"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Raise Exceptions"}),(0,s.jsx)(t.td,{children:"Whether to raise exceptions when errors occur in the protocol like unexpected responses or response timeouts"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"false"})]})]})]}),"\n",(0,s.jsx)(t.h3,{id:"crc-protocol",children:"CRC Protocol"}),"\n",(0,s.jsx)(t.p,{children:"The CRC protocol can add CRCs to outgoing commands and verify CRCs on incoming telemetry packets."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"}),(0,s.jsx)(t.th,{children:"Default"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Write Item Name"}),(0,s.jsx)(t.td,{children:"Item to fill with calculated CRC value for outgoing packets (nil = don't fill)"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"nil"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Strip CRC"}),(0,s.jsx)(t.td,{children:"Whether to remove the CRC from incoming packets"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"false"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Bad Strategy"}),(0,s.jsx)(t.td,{children:"How to handle CRC errors on incoming packets. ERROR = Just log the error, DISCONNECT = Disconnect interface"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:'"ERROR"'})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Bit Offset"}),(0,s.jsx)(t.td,{children:"Bit offset of the CRC in the data. Can be negative to indicate distance from end of packet"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"-32"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Bit Size"}),(0,s.jsx)(t.td,{children:"Bit size of the CRC - Must be 16, 32, or 64"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"32"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Endianness"}),(0,s.jsx)(t.td,{children:"Endianness of the CRC (BIG_ENDIAN/LITTLE_ENDIAN)"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:'"BIG_ENDIAN"'})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Poly"}),(0,s.jsx)(t.td,{children:"Polynomial to use when calculating the CRC expressed as an integer"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"nil (use default polynomial - 16-bit=0x1021, 32-bit=0x04C11DB7, 64-bit=0x42F0E1EBA9EA3693)"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Seed"}),(0,s.jsx)(t.td,{children:"Seed value to start the calculation"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"nil (use default seed - 16-bit=0xFFFF, 32-bit=0xFFFFFFFF, 64-bit=0xFFFFFFFFFFFFFFFF)"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Xor"}),(0,s.jsx)(t.td,{children:"Whether to XOR the CRC result with 0xFFFF"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"nil (use default value - 16-bit=false, 32-bit=true, 64-bit=true)"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Reflect"}),(0,s.jsx)(t.td,{children:"Whether to bit reverse each byte of data before calculating the CRC"}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"nil (use default value - 16-bit=false, 32-bit=true, 64-bit=true)"})]})]})]}),"\n",(0,s.jsx)(t.h3,{id:"ignore-packet-protocol",children:"Ignore Packet Protocol"}),"\n",(0,s.jsx)(t.p,{children:"The Ignore Packet protocol drops specified command packets sent by COSMOS or drops incoming telemetry packets."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"}),(0,s.jsx)(t.th,{children:"Default"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Target Name"}),(0,s.jsx)(t.td,{children:"Target name of the packet to ignore"}),(0,s.jsx)(t.td,{children:"Yes"}),(0,s.jsx)(t.td,{children:"nil"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Packet Name"}),(0,s.jsx)(t.td,{children:"Packet name of the packet to ignore"}),(0,s.jsx)(t.td,{children:"Yes"}),(0,s.jsx)(t.td,{children:"nil"})]})]})]}),"\n",(0,s.jsx)(t.h2,{id:"custom-protocols",children:"Custom Protocols"}),"\n",(0,s.jsx)(t.p,{children:"Creating a custom protocol is easy and should be the default solution for customizing COSMOS Interfaces (rather than creating a new Interface class). However, creating custom Interfaces is still useful for defaulting parameters to values that always are fixed for your target and for including the necessary Protocols. The base COSMOS Interfaces take a lot of parameters that can be confusing to your end users. Thus you may want to create a custom Interface just to hard coded these values and cut the available parameters down to something like the hostname and port to connect to."}),"\n",(0,s.jsxs)(t.p,{children:["All custom Protocols should derive from the Protocol class ",(0,s.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/interfaces/protocols/protocol.rb",children:"openc3/interfaces/protocols/protocol.rb"})," (Ruby) and ",(0,s.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/python/openc3/interfaces/protocols/protocol.py",children:"openc3/interfaces/protocols/protocol.py"})," (Python). This class defines the 9 methods that are relevant to writing your own protocol. The base class implementation for each method is included below as well as a discussion as to how the methods should be overridden and used in your own Protocols."]}),"\n",(0,s.jsx)(t.admonition,{title:"Ruby Protocol APIs",type:"info",children:(0,s.jsxs)(t.p,{children:["Protocols should not ",(0,s.jsx)(t.code,{children:"require 'openc3/script'"})," since they are part of a COSMOS interface. They should use the COSMOS library code directly like ",(0,s.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/system/system.rb",children:"System"}),", ",(0,s.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/packets/packet.rb",children:"Packet"}),", ",(0,s.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/utilities/bucket.rb",children:"Bucket"}),", ",(0,s.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/accessors/binary_accessor.rb",children:"BinaryAccessor"}),", etc. When in doubt, consult the existing COSMOS ",(0,s.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/tree/main/openc3/lib/openc3/interfaces/protocols",children:"protocol"})," classes."]})}),"\n",(0,s.jsx)(t.admonition,{title:"Python Protocol APIs",type:"info",children:(0,s.jsxs)(t.p,{children:["Protocols should not ",(0,s.jsx)(t.code,{children:"from openc3.script import *"})," since they are part of a COSMOS interface. They should use the COSMOS library code directly like ",(0,s.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/python/openc3/system/system.py",children:"System"}),", ",(0,s.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/python/openc3/packets/packet.py",children:"Packet"}),", ",(0,s.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/python/openc3/utilities/bucket.py",children:"Bucket"}),", ",(0,s.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/python/openc3/accessors/binary_accessor.py",children:"BinaryAccessor"}),", etc. When in doubt, consult the existing COSMOS ",(0,s.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/tree/main/openc3/python/openc3/interfaces/protocols",children:"protocol"})," classes."]})}),"\n",(0,s.jsx)(t.p,{children:"To really understand how Protocols work, you first must understand the logic within the base Interface class read and write methods."}),"\n",(0,s.jsx)(t.p,{children:"Let's first discuss the read method."}),"\n",(0,s.jsx)(t.admonition,{title:"Ruby Symbols, Python Strings",type:"info",children:(0,s.jsxs)(t.p,{children:["In the following discussions an all caps word is a symbol in Ruby and a string in Python. So a reference to STOP means ",":STOP",' in Ruby and "STOP" in Python.']})}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{alt:"Interface Read Logic",src:n(367).A+"",width:"1063",height:"542"})}),"\n",(0,s.jsxs)(t.p,{children:["On ",(0,s.jsx)(t.em,{children:"every"}),' call to read, an empty string "" is first passed down to each of the read Protocol\'s ',(0,s.jsx)(t.code,{children:"read_data()"})," method ",(0,s.jsx)(t.em,{children:"before"})," new raw data is attempted to be read using the Interface's ",(0,s.jsx)(t.code,{children:"read_interface()"})," method. This is a signal to Protocols that have cached up more than one packet worth of data to output those cached packets before any new data is read from the Interface. Typically no data will be cached up and one of the Protocols ",(0,s.jsx)(t.code,{children:"read_data()"})," methods will return STOP in response to the empty string, indicating that more data is required to generate a packet. Each Protocol's ",(0,s.jsx)(t.code,{children:"read_data()"})," method can return one of three things: data that will be passed down to any additional Protocols or turned into a Packet, STOP which means more data is required from the Interface for the Protocol to continue, or DISCONNECT which means that something has happened that requires disconnecting the Interface (and by default trying to reconnect). Each Protocol's ",(0,s.jsx)(t.code,{children:"read_data()"})," method is passed the data that will eventually be turned into a packet and returns a possibly modified set of data. If the data passes through all Protocol's ",(0,s.jsx)(t.code,{children:"read_data()"})," methods it is then converted into a COSMOS packet using the Interface's convert_data_to_packet() method. This packet is then run in a similar fashion through each Read Protocol's read_packet() method. This method has essentially the same return possibilities: a Packet (instead of data as in ",(0,s.jsx)(t.code,{children:"read_data()"}),"), STOP, or DISCONNECT. If the Packet makes it through all read_packet() methods then the Interface packet read counter is incremented and the Packet is returned to the Interface."]}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{alt:"Interface Write Logic",src:n(8129).A+"",width:"931",height:"944"})}),"\n",(0,s.jsx)(t.p,{children:"The Interface write() method works very similarly to read. (It should be mentioned that by default write protocols run in the reverse order of read protocols. This makes sense because when reading you're typically stripping layers of data and when writing you're typically adding on layers in reverse order.)"}),"\n",(0,s.jsx)(t.p,{children:"First, the packet write counter is incremented. Then each write Protocol is given a chance to modify the packet by its write_packet() method being called. This method can either return a potentially modified packet, STOP, or DISCONNECT. If a write Protocol returns STOP no data will be written out the Interface and it is assumed that more packets are necessary before a final packet can be output. DISCONNECT will disconnect the Interface. If the packet makes it through all the write Protocol's write_packet() methods, then it is converted to binary data using the Interface's convert_packet_to_data() method. Next the write_data() method is called for each write Protocol giving it a chance to modify the lower level data. The same return options are available except a Ruby string of data is returned instead of a COSMOS packet. If the data makes it through all write_data() methods, then it is written out on the Interface using the write_interface() method. Afterwards, each Protocol's post_write_interface() method is called with both the final modified Packet, and the actual data written out to the Interface. This method allows follow-up such as waiting for a response after writing out a message."}),"\n",(0,s.jsx)(t.h2,{id:"method-discussions",children:"Method discussions"}),"\n",(0,s.jsxs)(t.h3,{id:"initialize-or-init",children:["initialize or ",(0,s.jsx)(t.strong,{children:"init"})]}),"\n",(0,s.jsx)(t.p,{children:"This is the constructor for your custom Protocol. It should always call super(allow_empty_data) to initialize the base Protocol class."}),"\n",(0,s.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:"# @param allow_empty_data [true/false] Whether STOP should be returned on empty data\ndef initialize(allow_empty_data = false)\n @interface = nil\n @allow_empty_data = ConfigParser.handle_true_false(allow_empty_data)\n reset()\nend\n"})}),"\n",(0,s.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-python",children:"def __init__(self, allow_empty_data=None):\n self.interface = None\n self.allow_empty_data = ConfigParser.handle_true_false_none(allow_empty_data)\n self.reset()\n"})}),"\n",(0,s.jsxs)(t.p,{children:["As you can see, every Protocol maintains state on at least two items. The interface variable holds the Interface class instance that the protocol is associated with. This is sometimes necessary to introspect details that only the Interface knows. allow_empty_data is a flag used by the ",(0,s.jsx)(t.code,{children:"read_data(data)"})," method that is discussed later in this document."]}),"\n",(0,s.jsx)(t.h3,{id:"reset",children:"reset"}),"\n",(0,s.jsx)(t.p,{children:"The reset method is used to reset internal protocol state when the Interface is connected and/or disconnected. This method should be used for common resetting logic. Connect and Disconnect specific logic are handled in the next two methods."}),"\n",(0,s.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:"def reset\nend\n"})}),"\n",(0,s.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-python",children:"def reset(self):\n pass\n"})}),"\n",(0,s.jsx)(t.p,{children:"As you can see, the base class reset implementation doesn't do anything."}),"\n",(0,s.jsx)(t.h3,{id:"connect_reset",children:"connect_reset"}),"\n",(0,s.jsx)(t.p,{children:"The connect_reset method is used to reset internal Protocol state each time the Interface is connected."}),"\n",(0,s.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:"def connect_reset\n reset()\nend\n"})}),"\n",(0,s.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-python",children:"def connect_reset(self):\n self.reset()\n"})}),"\n",(0,s.jsx)(t.p,{children:"The base class connect_reset implementation just calls the reset method to ensure common reset logic is run."}),"\n",(0,s.jsx)(t.h3,{id:"disconnect_reset",children:"disconnect_reset"}),"\n",(0,s.jsx)(t.p,{children:"The disconnect_reset method is used to reset internal Protocol state each time the Interface is disconnected."}),"\n",(0,s.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:"def disconnect_reset\n reset()\nend\n"})}),"\n",(0,s.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-python",children:"def disconnect_reset(self):\n self.reset()\n"})}),"\n",(0,s.jsx)(t.p,{children:"The base class disconnect_reset implementation just calls the reset method to ensure common reset logic is run."}),"\n",(0,s.jsx)(t.h3,{id:"read_data",children:"read_data"}),"\n",(0,s.jsx)(t.p,{children:"The read_data method is used to analyze and potentially modify any raw data read by an Interface. It takes one parameter as the current state of the data to be analyzed. It can return either a string of data, STOP, or DISCONNECT. If it returns a string, then it believes that data may be ready to be a full packet, and is ready for processing by any following Protocols. If STOP is returned then the Protocol believes it needs more data to complete a full packet. If DISCONNECT is returned then the Protocol believes the Interface should be disconnected (and typically automatically reconnected)."}),"\n",(0,s.jsx)(t.p,{children:"Base class Ruby implemenation:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:"def read_data(data)\n if (data.length <= 0)\n if @allow_empty_data.nil?\n if @interface and @interface.read_protocols[-1] == self # Last read interface in chain with auto @allow_empty_data\n return :STOP\n end\n elsif !@allow_empty_data # Don't @allow_empty_data means STOP\n return :STOP\n end\n end\n data\nend\n"})}),"\n",(0,s.jsx)(t.p,{children:"Base class Python implemenation:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-python",children:'def read_data(self, data, extra=None):\n if len(data) <= 0:\n if self.allow_empty_data is None:\n if self.interface and self.interface.read_protocols[-1] == self:\n # Last read interface in chain with auto self.allow_empty_data\n return ("STOP", extra)\n elif self.allow_empty_data:\n # Don\'t self.allow_empty_data means STOP\n return ("STOP", extra)\n return (data, extra)\n'})}),"\n",(0,s.jsxs)(t.p,{children:["The base class implementation does nothing except return the data it was given. The only exception to this is when handling an empty string. If the allow_empty_data flag is false / False or if it is nil / None and the Protocol is the last in the chain, then the base implementation will return STOP to indicate that it is time to call the Interface ",(0,s.jsx)(t.code,{children:"read_interface()"})," method to get more data. Blank strings are used to signal Protocols that they have an opportunity to return a cached packet."]}),"\n",(0,s.jsx)(t.h3,{id:"read_packet",children:"read_packet"}),"\n",(0,s.jsx)(t.p,{children:"The read_packet method is used to analyze and potentially modify a COSMOS packet before it is returned by the Interface. It takes one parameter as the current state of the packet to be analyzed. It can return either a COSMOS packet, STOP, or DISCONNECT. If it returns a COSMOS packet, then it believes that the packet is valid, should be returned, and is ready for processing by any following Protocols. If STOP is returned then the Protocol believes the packet should be silently dropped. If DISCONNECT is returned then the Protocol believes the Interface should be disconnected (and typically automatically reconnected). This method is where a Protocol would set the stored flag on a packet if it determines that the packet is stored telemetry instead of real-time telemetry."}),"\n",(0,s.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:"def read_packet(packet)\n return packet\nend\n"})}),"\n",(0,s.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-python",children:"def read_packet(self, packet):\n return packet\n"})}),"\n",(0,s.jsx)(t.p,{children:"The base class always just returns the packet given."}),"\n",(0,s.jsx)(t.h3,{id:"write_packet",children:"write_packet"}),"\n",(0,s.jsx)(t.p,{children:"The write_packet method is used to analyze and potentially modify a COSMOS packet before it is output by the Interface. It takes one parameter as the current state of the packet to be analyzed. It can return either a COSMOS packet, STOP, or DISCONNECT. If it returns a COSMOS packet, then it believes that the packet is valid, should be written out the Interface, and is ready for processing by any following Protocols. If STOP is returned then the Protocol believes the packet should be silently dropped. If DISCONNECT is returned then the Protocol believes the Interface should be disconnected (and typically automatically reconnected)."}),"\n",(0,s.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:"def write_packet(packet)\n return packet\nend\n"})}),"\n",(0,s.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-python",children:"def write_packet(self, packet):\n return packet\n"})}),"\n",(0,s.jsx)(t.p,{children:"The base class always just returns the packet given."}),"\n",(0,s.jsx)(t.h3,{id:"write_data",children:"write_data"}),"\n",(0,s.jsx)(t.p,{children:"The write_data method is used to analyze and potentially modify data before it is written out by the Interface. It takes one parameter as the current state of the data to be analyzed and sent. It can return either a string of data, STOP, or DISCONNECT. If it returns a string of data, then it believes that the data is valid, should be written out the Interface, and is ready for processing by any following Protocols. If STOP is returned then the Protocol believes the data should be silently dropped. If DISCONNECT is returned then the Protocol believes the Interface should be disconnected (and typically automatically reconnected)."}),"\n",(0,s.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:"def write_data(data)\n return data\nend\n"})}),"\n",(0,s.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-python",children:"def write_data(self, data, extra=None):\n return (data, extra)\n"})}),"\n",(0,s.jsx)(t.p,{children:"The base class always just returns the data given."}),"\n",(0,s.jsx)(t.h3,{id:"post_write_interface",children:"post_write_interface"}),"\n",(0,s.jsxs)(t.p,{children:["The post_write_interface method is called after data has been written out the Interface. The typical use of this method is to provide a hook to implement command/response type interfaces where a response is always immediately expected in response to a command. It takes two parameters, the packet after all modifications by ",(0,s.jsx)(t.code,{children:"write_packet()"})," and the data that was actually written out the Interface. It can return either the same pair of packet/data, STOP, or DISCONNECT. If it returns a packet/data pair then they are passed on to any other Protocols. If STOP is returned then the Interface write() call completes and no further Protocols ",(0,s.jsx)(t.code,{children:"post_write_interface()"}),' methods are called. If DISCONNECT is returned then the Protocol believes the Interface should be disconnected (and typically automatically reconnected). Note that only the first parameter "packet", is checked to be STOP, or DISCONNECT on the return.']}),"\n",(0,s.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:"def post_write_interface(packet, data)\n return packet, data\nend\n"})}),"\n",(0,s.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-python",children:"def post_write_interface(self, packet, data, extra=None):\n return (packet, data, extra)\n"})}),"\n",(0,s.jsx)(t.p,{children:"The base class always just returns the packet/data given."}),"\n",(0,s.jsx)(t.h3,{id:"protocol_cmd",children:"protocol_cmd"}),"\n",(0,s.jsxs)(t.p,{children:["The protocol_cmd method is used to send commands to the protocol itself. This is useful to change protocol behavior during runtime. See ",(0,s.jsx)(t.a,{href:"../guides/scripting-api#interface_protocol_cmd",children:"interface_protocol_cmd"})," for more information."]}),"\n",(0,s.jsx)(t.p,{children:"Base class Ruby implementation:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:"def protocol_cmd(cmd_name, *cmd_args)\n # Default do nothing - Implemented by subclasses\n return false\nend\n"})}),"\n",(0,s.jsx)(t.p,{children:"Base class Python implementation:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-python",children:"def protocol_cmd(self, cmd_name, *cmd_args):\n # Default do nothing - Implemented by subclasses\n return False\n"})}),"\n",(0,s.jsx)(t.p,{children:"The base class does nothing as this is special functionality implemented by subclasses."}),"\n",(0,s.jsx)(t.h2,{id:"examples",children:"Examples"}),"\n",(0,s.jsxs)(t.p,{children:["Please see the linked ",(0,s.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/interfaces/protocols",children:"Ruby Protocol"})," and ",(0,s.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/python/openc3/interfaces/protocols",children:"Python Protocol"})," code for examples of the above methods in action."]})]})}function h(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(l,{...e})}):l(e)}},367:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/interface_read_logic-0deef27c1d2fec9de2a3720a3c9ecedb21a00dca7aabd13da0b8815c037e4c26.png"},8129:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/interface_write_logic-3360afe1b4af20b10dafba848a21e09baccaacc06e2ec8b6c132ac7a3c99e994.png"},1184:(e,t,n)=>{n.d(t,{R:()=>i,x:()=>o});var s=n(4041);const r={},a=s.createContext(r);function i(e){const t=s.useContext(a);return s.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(r):e.components||r:i(e.components),s.createElement(a.Provider,{value:t},e.children)}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([[3307],{5918:(e,t,i)=>{i.r(t),i.d(t,{assets:()=>a,contentTitle:()=>d,default:()=>h,frontMatter:()=>s,metadata:()=>l,toc:()=>o});var n=i(1085),r=i(1184);const s={sidebar_position:3,title:"Targets"},d="target.txt Keywords",l={id:"configuration/target",title:"Targets",description:"Targets are the external embedded systems that COSMOS connects to. Targets are defined by the top level TARGET keyword in the plugin.txt file. Each target is self contained in a target directory named after the target. In the root of the target directory there is a configuration file named target.txt which configures the individual target.",source:"@site/docs/configuration/target.md",sourceDirName:"configuration",slug:"/configuration/target",permalink:"/tools/staticdocs/docs/configuration/target",draft:!1,unlisted:!1,editUrl:"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/configuration/target.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3,title:"Targets"},sidebar:"defaultSidebar",previous:{title:"Plugins",permalink:"/tools/staticdocs/docs/configuration/plugins"},next:{title:"Commands",permalink:"/tools/staticdocs/docs/configuration/command"}},a={},o=[{value:"LANGUAGE",id:"language",level:2},{value:"REQUIRE",id:"require",level:2},{value:"IGNORE_PARAMETER",id:"ignore_parameter",level:2},{value:"IGNORE_ITEM",id:"ignore_item",level:2},{value:"COMMANDS",id:"commands",level:2},{value:"TELEMETRY",id:"telemetry",level:2},{value:"CMD_UNIQUE_ID_MODE",id:"cmd_unique_id_mode",level:2},{value:"TLM_UNIQUE_ID_MODE",id:"tlm_unique_id_mode",level:2}];function c(e){const t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",header:"header",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(t.p,{children:["Targets are the external embedded systems that COSMOS connects to. Targets are defined by the top level ",(0,n.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/plugins#target-1",children:"TARGET"})," keyword in the plugin.txt file. Each target is self contained in a target directory named after the target. In the root of the target directory there is a configuration file named target.txt which configures the individual target."]}),"\n",(0,n.jsx)(t.header,{children:(0,n.jsx)(t.h1,{id:"targettxt-keywords",children:"target.txt Keywords"})}),"\n",(0,n.jsx)(t.h2,{id:"language",children:"LANGUAGE"}),"\n",(0,n.jsxs)(t.p,{children:[(0,n.jsx)("div",{class:"right",children:"(Since 5.11.1)"}),(0,n.jsx)(t.strong,{children:"Programming language of the target interfaces and microservices"})]}),"\n",(0,n.jsx)(t.p,{children:"The target language must be either Ruby or Python. The language determines how the target's interfaces and microservices are run. Note that both Ruby and Python still use ERB to perform templating."}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{children:"Parameter"}),(0,n.jsx)(t.th,{children:"Description"}),(0,n.jsx)(t.th,{children:"Required"})]})}),(0,n.jsx)(t.tbody,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{}),(0,n.jsxs)(t.td,{children:["Ruby or Python",(0,n.jsx)("br",{}),(0,n.jsx)("br",{}),"Valid Values: ",(0,n.jsx)("span",{class:"values",children:"ruby, python"})]}),(0,n.jsx)(t.td,{children:"True"})]})})]}),"\n",(0,n.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-ruby",children:"LANGUAGE python\n"})}),"\n",(0,n.jsx)(t.h2,{id:"require",children:"REQUIRE"}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.strong,{children:"Requires a Ruby file"})}),"\n",(0,n.jsx)(t.p,{children:"List the Ruby files required to explicitly declare dependencies. This is now completely optional."}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{children:"Parameter"}),(0,n.jsx)(t.th,{children:"Description"}),(0,n.jsx)(t.th,{children:"Required"})]})}),(0,n.jsx)(t.tbody,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Filename"}),(0,n.jsx)(t.td,{children:'Filename to require. For files in the target\'s lib directory simply supply the filename, e.g. "REQUIRE my_file". Files in the base OpenC3 lib directory also should just list the filename. If a file is in a folder under the lib directory then you must specify the folder name, e.g. "REQUIRE folder/my_file". Note the ".rb" extension is optional when specifying the filename.'}),(0,n.jsx)(t.td,{children:"True"})]})})]}),"\n",(0,n.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-ruby",children:"REQUIRE limits_response.rb\n"})}),"\n",(0,n.jsx)(t.h2,{id:"ignore_parameter",children:"IGNORE_PARAMETER"}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.strong,{children:"Ignore the given command parameter"})}),"\n",(0,n.jsx)(t.p,{children:"Hint to other OpenC3 tools to hide or ignore this command parameter when processing the command. For example, Command Sender and Command Sequence will not display the parameter (by default) when showing the command and Script Runner code completion will not display the parameter."}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{children:"Parameter"}),(0,n.jsx)(t.th,{children:"Description"}),(0,n.jsx)(t.th,{children:"Required"})]})}),(0,n.jsx)(t.tbody,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Parameter Name"}),(0,n.jsx)(t.td,{children:"The name of a command parameter. Note that this parameter will be ignored in ALL the commands it appears in."}),(0,n.jsx)(t.td,{children:"True"})]})})]}),"\n",(0,n.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-ruby",children:"IGNORE_PARAMETER CCSDS_VERSION\n"})}),"\n",(0,n.jsx)(t.h2,{id:"ignore_item",children:"IGNORE_ITEM"}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.strong,{children:"Ignore the given telemetry item"})}),"\n",(0,n.jsx)(t.p,{children:"Hint to other OpenC3 tools to hide or ignore this telemetry item when processing the telemetry. For example, Packet Viewer will not display the item (by default) when showing the packet."}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{children:"Parameter"}),(0,n.jsx)(t.th,{children:"Description"}),(0,n.jsx)(t.th,{children:"Required"})]})}),(0,n.jsx)(t.tbody,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Item name"}),(0,n.jsx)(t.td,{children:"The name of a telemetry item. Note that this item will be ignored in ALL the telemetry it appears in."}),(0,n.jsx)(t.td,{children:"True"})]})})]}),"\n",(0,n.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-ruby",children:"IGNORE_ITEM CCSDS_VERSION\n"})}),"\n",(0,n.jsx)(t.h2,{id:"commands",children:"COMMANDS"}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.strong,{children:"Process the given command definition file"})}),"\n",(0,n.jsx)(t.p,{children:"This keyword is used to explicitly add the command definition file to the list of command and telemetry files to process."}),"\n",(0,n.jsx)(t.admonition,{type:"warning",children:(0,n.jsx)(t.p,{children:"Usage of this keyword overrides automatic command and telemetry file discovery. If this keyword is used, you must also use the TELEMETRY keyword to specify the telemetry files to process."})}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{children:"Parameter"}),(0,n.jsx)(t.th,{children:"Description"}),(0,n.jsx)(t.th,{children:"Required"})]})}),(0,n.jsx)(t.tbody,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Filename"}),(0,n.jsx)(t.td,{children:'Name of a command definition file in the target\'s cmd_tlm directory, e.g. "cmd.txt".'}),(0,n.jsx)(t.td,{children:"True"})]})})]}),"\n",(0,n.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-ruby",children:"COMMANDS inst_cmds_v2.txt\nTELEMETRY inst_tlm_v2.txt\n"})}),"\n",(0,n.jsx)(t.h2,{id:"telemetry",children:"TELEMETRY"}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.strong,{children:"Process the given telemetry definition file"})}),"\n",(0,n.jsx)(t.p,{children:"This keyword is used to explicitly add the telemetry definition file to the list of command and telemetry files to process."}),"\n",(0,n.jsx)(t.admonition,{type:"warning",children:(0,n.jsx)(t.p,{children:"Usage of this keyword overrides automatic command and telemetry file discovery. If this keyword is used, you must also use the COMMAND keyword to specify the command files to process."})}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{children:"Parameter"}),(0,n.jsx)(t.th,{children:"Description"}),(0,n.jsx)(t.th,{children:"Required"})]})}),(0,n.jsx)(t.tbody,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Filename"}),(0,n.jsx)(t.td,{children:'Name of a telemetry definition file in the target\'s cmd_tlm directory, e.g. "tlm.txt".'}),(0,n.jsx)(t.td,{children:"True"})]})})]}),"\n",(0,n.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-ruby",children:"COMMANDS inst_cmds_v2.txt\nTELEMETRY inst_tlm_v2.txt\n"})}),"\n",(0,n.jsx)(t.h2,{id:"cmd_unique_id_mode",children:"CMD_UNIQUE_ID_MODE"}),"\n",(0,n.jsxs)(t.p,{children:[(0,n.jsx)("div",{class:"right",children:"(Since 4.4.0)"}),(0,n.jsx)(t.strong,{children:"Command packet identifiers don't all share the same bit offset, size, and type"})]}),"\n",(0,n.jsx)(t.p,{children:"Ideally all commands for a target are identified using the exact same bit offset, size, and type field in each command. If ANY command identifiers differ then this flag must be set to force a brute force identification method."}),"\n",(0,n.jsx)(t.admonition,{type:"warning",children:(0,n.jsx)(t.p,{children:"Using this mode significantly slows packet identification"})}),"\n",(0,n.jsx)(t.h2,{id:"tlm_unique_id_mode",children:"TLM_UNIQUE_ID_MODE"}),"\n",(0,n.jsxs)(t.p,{children:[(0,n.jsx)("div",{class:"right",children:"(Since 4.4.0)"}),(0,n.jsx)(t.strong,{children:"Telemetry packets identifiers don't all share the same bit offset, size, and type"})]}),"\n",(0,n.jsx)(t.p,{children:"Ideally all telemetry for a target are identified using the exact same bit offset, size, and type field in each packet. If ANY telemetry identifiers differ then this flag must be set to force a brute force identification method."}),"\n",(0,n.jsx)(t.admonition,{type:"warning",children:(0,n.jsx)(t.p,{children:"Using this mode significantly slows packet identification"})})]})}function h(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(c,{...e})}):c(e)}},1184:(e,t,i)=>{i.d(t,{R:()=>d,x:()=>l});var n=i(4041);const r={},s=n.createContext(r);function d(e){const 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(r):e.components||r:d(e.components),n.createElement(s.Provider,{value:t},e.children)}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([[313],{8168:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>u,frontMatter:()=>s,metadata:()=>a,toc:()=>c});var t=i(1085),r=i(1184);const s={title:"Bridges"},o=void 0,a={id:"guides/bridges",title:"Bridges",description:"COSMOS Bridges provide an easy solution for getting data from devices that don't speak Ethernet into COSMOS.",source:"@site/docs/guides/bridges.md",sourceDirName:"guides",slug:"/guides/bridges",permalink:"/tools/staticdocs/docs/guides/bridges",draft:!1,unlisted:!1,editUrl:"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/guides/bridges.md",tags:[],version:"current",frontMatter:{title:"Bridges"},sidebar:"defaultSidebar",previous:{title:"Guides",permalink:"/tools/staticdocs/docs/guides"},next:{title:"COSMOS and NASA cFS",permalink:"/tools/staticdocs/docs/guides/cfs"}},d={},c=[{value:"Bridges are Generally Just an Interface and Router",id:"bridges-are-generally-just-an-interface-and-router",level:2},{value:"Host Requirements for Running Bridges",id:"host-requirements-for-running-bridges",level:2},{value:"Bridge Configuration: bridge.txt",id:"bridge-configuration-bridgetxt",level:2},{value:"Bridge Commands: openc3cli",id:"bridge-commands-openc3cli",level:2},{value:"Example Bridge Gems",id:"example-bridge-gems",level:2},{value:"Note on Serial Ports",id:"note-on-serial-ports",level:2}];function l(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,r.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.p,{children:"COSMOS Bridges provide an easy solution for getting data from devices that don't speak Ethernet into COSMOS.\nSerial ports are the most common, but other devices such as USB, PCI cards, and Bluetooth devices can also be\nsupported by using bridges to convert from a host computer accessible device, into an Ethernet byte stream that\nCOSMOS can process from inside of containers."}),"\n",(0,t.jsx)(n.admonition,{title:"Bridges are Meant to be Dumb",type:"warning",children:(0,t.jsx)(n.p,{children:"The purpose of bridges is to get bytes into COSMOS. Processing should be done in COSMOS itself, including details such as\npacket delineation."})}),"\n",(0,t.jsx)(n.h2,{id:"bridges-are-generally-just-an-interface-and-router",children:"Bridges are Generally Just an Interface and Router"}),"\n",(0,t.jsx)(n.p,{children:"Bridges are generally made up of a COSMOS Interface class that pull data from a host connected device, and a Router that forwards that data to\nCOSMOS over TCP/IP. In most cases, data can be safely sent to COSMOS using the BURST protocol, and let the COSMOS side use the correct packet delineation\nprotocol like LENGTH."}),"\n",(0,t.jsx)(n.h2,{id:"host-requirements-for-running-bridges",children:"Host Requirements for Running Bridges"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"Requires a host Ruby installation (Ruby 3)"}),"\n",(0,t.jsxs)(n.li,{children:["Install the OpenC3 gem","\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"gem install openc3"}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["Make sure the Ruby gem executable path is in your PATH environment variable","\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["You can find this path by running ",(0,t.jsx)(n.code,{children:"gem environment"})," and looking for EXECUTABLE DIRECTORY"]}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["If successful, you should be able to run ",(0,t.jsx)(n.code,{children:"openc3cli"})," from a terminal"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"bridge-configuration-bridgetxt",children:"Bridge Configuration: bridge.txt"}),"\n",(0,t.jsx)(n.p,{children:"Bridges are run using an configuration file named bridge.txt. This file is a subset of the plugin.txt configuration syntax supporting VARIABLE, INTERFACE, ROUTER, and associated modifier keywords. However, BRIDGES HAVE NO KNOWLEDGE OF TARGETS. So instead of MAP_TARGETS, the INTERFACE is associated with the ROUTER using the ROUTE keyword."}),"\n",(0,t.jsxs)(n.p,{children:["The following is the default bridge.txt that is generated by running ",(0,t.jsx)(n.code,{children:"openc3cli bridgesetup"})]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ruby",children:"# Write serial port name\nVARIABLE write_port_name COM1\n\n# Read serial port name\nVARIABLE read_port_name COM1\n\n# Baud Rate\nVARIABLE baud_rate 115200\n\n# Parity - NONE, ODD, or EVEN\nVARIABLE parity NONE\n\n# Stop bits - 0, 1, or 2\nVARIABLE stop_bits 1\n\n# Write Timeout\nVARIABLE write_timeout 10.0\n\n# Read Timeout\nVARIABLE read_timeout nil\n\n# Flow Control - NONE, or RTSCTS\nVARIABLE flow_control NONE\n\n# Data bits per word - Typically 8\nVARIABLE data_bits 8\n\n# Port to listen for connections from COSMOS - Plugin must match\nVARIABLE router_port 2950\n\n# Port to listen on for connections from COSMOS. Defaults to localhost for security. Will need to be opened\n# if COSMOS is on another machine.\nVARIABLE router_listen_address 127.0.0.1\n\nINTERFACE SERIAL_INT serial_interface.rb <%= write_port_name %> <%= read_port_name %> <%= baud_rate %> <%= parity %> <%= stop_bits %> <%= write_timeout %> <%= read_timeout %>\n OPTION FLOW_CONTROL <%= flow_control %>\n OPTION DATA_BITS <%= data_bits %>\n\nROUTER SERIAL_ROUTER tcpip_server_interface.rb <%= router_port %> <%= router_port %> 10.0 nil BURST\n ROUTE SERIAL_INT\n OPTION LISTEN_ADDRESS <%= router_listen_address %>\n"})}),"\n",(0,t.jsx)(n.p,{children:"VARIABLE provides default values to variables that can be changed when the bridge is started. This example shows an INTERFACE that is configured to use the serial_interface.rb class. It also includes a standard ROUTER using tcpip_server_interface.rb that COSMOS can connect to and get the data from the serial port. The LISTEN_ADDRESS is set to 127.0.0.1 in this example to prevent access from outside of the host system. Docker running on the same machine can access\nthis server using the host.docker.internal hostname and the configured port (2950 in this example)."}),"\n",(0,t.jsx)(n.h2,{id:"bridge-commands-openc3cli",children:"Bridge Commands: openc3cli"}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.code,{children:"openc3cli bridgesetup"})}),"\n",(0,t.jsx)(n.p,{children:"Generates a bridge.txt example file"}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.code,{children:"openc3cli bridge [filename] [variable1=value1] [variable2=value2]"})}),"\n",(0,t.jsx)(n.p,{children:"Runs a bridge from a given configuration file. Defaults to bridge.txt in the current directory. Variables can also be passed into to override VARIABLE defaults."}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.code,{children:"openc3cli bridgegem [gem_name] [variable1=value1] [variable2=value2]"})}),"\n",(0,t.jsx)(n.p,{children:"Runs a bridge using the bridge.txt provided in a bridge gem. Variables can also be passed into to override VARIABLE defaults."}),"\n",(0,t.jsx)(n.h2,{id:"example-bridge-gems",children:"Example Bridge Gems"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Serial Port: ",(0,t.jsx)(n.a,{href:"https://github.com/OpenC3/openc3-cosmos-bridge-serial",children:"openc3-cosmos-bridge-serial"})]}),"\n",(0,t.jsxs)(n.li,{children:["Host: ",(0,t.jsx)(n.a,{href:"https://github.com/OpenC3/openc3-cosmos-bridge-host",children:"openc3-cosmos-bridge-host"})]}),"\n",(0,t.jsxs)(n.li,{children:["HIDAPI: ",(0,t.jsx)(n.a,{href:"https://github.com/OpenC3/openc3-cosmos-bridge-hidapi",children:"openc3-cosmos-bridge-hidapi"})]}),"\n",(0,t.jsxs)(n.li,{children:["PS5 Dual Sense Controller: ",(0,t.jsx)(n.a,{href:"https://github.com/OpenC3/openc3-cosmos-bridge-dualsense",children:"openc3-cosmos-bridge-dualsense"})]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"note-on-serial-ports",children:"Note on Serial Ports"}),"\n",(0,t.jsx)(n.p,{children:"Serial ports can be used directly without bridges on Linux Docker installations."}),"\n",(0,t.jsx)(n.p,{children:"Add the following to the operator service in compose.yaml:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:' devices:\n - "/dev/ttyUSB0:/dev/ttyUSB0"\n'})}),"\n",(0,t.jsx)(n.p,{children:"Make sure the serial device has permissions for the user running Docker to access:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"sudo chmod 666 /dev/ttyUSB0\n"})})]})}function u(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(l,{...e})}):l(e)}},1184:(e,n,i)=>{i.d(n,{R:()=>o});var t=i(4041);const r={},s=t.createContext(r);function o(e){const n=t.useContext(s);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}}}]);
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([[313],{8168:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>u,frontMatter:()=>s,metadata:()=>a,toc:()=>c});var i=t(1085),r=t(1184);const s={title:"Bridges"},o=void 0,a={id:"guides/bridges",title:"Bridges",description:"COSMOS Bridges provide an easy solution for getting data from devices that don't speak Ethernet into COSMOS.",source:"@site/docs/guides/bridges.md",sourceDirName:"guides",slug:"/guides/bridges",permalink:"/tools/staticdocs/docs/guides/bridges",draft:!1,unlisted:!1,editUrl:"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/guides/bridges.md",tags:[],version:"current",frontMatter:{title:"Bridges"},sidebar:"defaultSidebar",previous:{title:"Guides",permalink:"/tools/staticdocs/docs/guides"},next:{title:"COSMOS and NASA cFS",permalink:"/tools/staticdocs/docs/guides/cfs"}},d={},c=[{value:"Bridges are Generally Just an Interface and Router",id:"bridges-are-generally-just-an-interface-and-router",level:2},{value:"Host Requirements for Running Bridges",id:"host-requirements-for-running-bridges",level:2},{value:"Bridge Configuration: bridge.txt",id:"bridge-configuration-bridgetxt",level:2},{value:"Bridge Commands: openc3cli",id:"bridge-commands-openc3cli",level:2},{value:"Example Bridge Gems",id:"example-bridge-gems",level:2},{value:"Note on Serial Ports",id:"note-on-serial-ports",level:2}];function l(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.p,{children:"COSMOS Bridges provide an easy solution for getting data from devices that don't speak Ethernet into COSMOS.\nSerial ports are the most common, but other devices such as USB, PCI cards, and Bluetooth devices can also be\nsupported by using bridges to convert from a host computer accessible device, into an Ethernet byte stream that\nCOSMOS can process from inside of containers."}),"\n",(0,i.jsx)(n.admonition,{title:"Bridges are Meant to be Dumb",type:"warning",children:(0,i.jsx)(n.p,{children:"The purpose of bridges is to get bytes into COSMOS. Processing should be done in COSMOS itself, including details such as\npacket delineation."})}),"\n",(0,i.jsx)(n.h2,{id:"bridges-are-generally-just-an-interface-and-router",children:"Bridges are Generally Just an Interface and Router"}),"\n",(0,i.jsx)(n.p,{children:"Bridges are generally made up of a COSMOS Interface class that pull data from a host connected device, and a Router that forwards that data to\nCOSMOS over TCP/IP. In most cases, data can be safely sent to COSMOS using the BURST protocol, and let the COSMOS side use the correct packet delineation\nprotocol like LENGTH."}),"\n",(0,i.jsx)(n.h2,{id:"host-requirements-for-running-bridges",children:"Host Requirements for Running Bridges"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Requires a host Ruby installation (Ruby 3)"}),"\n",(0,i.jsxs)(n.li,{children:["Install the OpenC3 gem","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"gem install openc3"}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["Make sure the Ruby gem executable path is in your PATH environment variable","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["You can find this path by running ",(0,i.jsx)(n.code,{children:"gem environment"})," and looking for EXECUTABLE DIRECTORY"]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["If successful, you should be able to run ",(0,i.jsx)(n.code,{children:"openc3cli"})," from a terminal"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"bridge-configuration-bridgetxt",children:"Bridge Configuration: bridge.txt"}),"\n",(0,i.jsx)(n.p,{children:"Bridges are run using an configuration file named bridge.txt. This file is a subset of the plugin.txt configuration syntax supporting VARIABLE, INTERFACE, ROUTER, and associated modifier keywords. However, BRIDGES HAVE NO KNOWLEDGE OF TARGETS. So instead of MAP_TARGETS, the INTERFACE is associated with the ROUTER using the ROUTE keyword."}),"\n",(0,i.jsxs)(n.p,{children:["The following is the default bridge.txt that is generated by running ",(0,i.jsx)(n.code,{children:"openc3cli bridgesetup"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ruby",children:"# Write serial port name\nVARIABLE write_port_name COM1\n\n# Read serial port name\nVARIABLE read_port_name COM1\n\n# Baud Rate\nVARIABLE baud_rate 115200\n\n# Parity - NONE, ODD, or EVEN\nVARIABLE parity NONE\n\n# Stop bits - 0, 1, or 2\nVARIABLE stop_bits 1\n\n# Write Timeout\nVARIABLE write_timeout 10.0\n\n# Read Timeout\nVARIABLE read_timeout nil\n\n# Flow Control - NONE, or RTSCTS\nVARIABLE flow_control NONE\n\n# Data bits per word - Typically 8\nVARIABLE data_bits 8\n\n# Port to listen for connections from COSMOS - Plugin must match\nVARIABLE router_port 2950\n\n# Port to listen on for connections from COSMOS. Defaults to localhost for security. Will need to be opened\n# if COSMOS is on another machine.\nVARIABLE router_listen_address 127.0.0.1\n\nINTERFACE SERIAL_INT serial_interface.rb <%= write_port_name %> <%= read_port_name %> <%= baud_rate %> <%= parity %> <%= stop_bits %> <%= write_timeout %> <%= read_timeout %>\n OPTION FLOW_CONTROL <%= flow_control %>\n OPTION DATA_BITS <%= data_bits %>\n\nROUTER SERIAL_ROUTER tcpip_server_interface.rb <%= router_port %> <%= router_port %> 10.0 nil BURST\n ROUTE SERIAL_INT\n OPTION LISTEN_ADDRESS <%= router_listen_address %>\n"})}),"\n",(0,i.jsx)(n.p,{children:"VARIABLE provides default values to variables that can be changed when the bridge is started. This example shows an INTERFACE that is configured to use the serial_interface.rb class. It also includes a standard ROUTER using tcpip_server_interface.rb that COSMOS can connect to and get the data from the serial port. The LISTEN_ADDRESS is set to 127.0.0.1 in this example to prevent access from outside of the host system. Docker running on the same machine can access\nthis server using the host.docker.internal hostname and the configured port (2950 in this example)."}),"\n",(0,i.jsx)(n.h2,{id:"bridge-commands-openc3cli",children:"Bridge Commands: openc3cli"}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"openc3cli bridgesetup"})}),"\n",(0,i.jsx)(n.p,{children:"Generates a bridge.txt example file"}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"openc3cli bridge [filename] [variable1=value1] [variable2=value2]"})}),"\n",(0,i.jsx)(n.p,{children:"Runs a bridge from a given configuration file. Defaults to bridge.txt in the current directory. Variables can also be passed into to override VARIABLE defaults."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"openc3cli bridgegem [gem_name] [variable1=value1] [variable2=value2]"})}),"\n",(0,i.jsx)(n.p,{children:"Runs a bridge using the bridge.txt provided in a bridge gem. Variables can also be passed into to override VARIABLE defaults."}),"\n",(0,i.jsx)(n.h2,{id:"example-bridge-gems",children:"Example Bridge Gems"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Serial Port: ",(0,i.jsx)(n.a,{href:"https://github.com/OpenC3/openc3-cosmos-bridge-serial",children:"openc3-cosmos-bridge-serial"})]}),"\n",(0,i.jsxs)(n.li,{children:["Host: ",(0,i.jsx)(n.a,{href:"https://github.com/OpenC3/openc3-cosmos-bridge-host",children:"openc3-cosmos-bridge-host"})]}),"\n",(0,i.jsxs)(n.li,{children:["HIDAPI: ",(0,i.jsx)(n.a,{href:"https://github.com/OpenC3/openc3-cosmos-bridge-hidapi",children:"openc3-cosmos-bridge-hidapi"})]}),"\n",(0,i.jsxs)(n.li,{children:["PS5 Dual Sense Controller: ",(0,i.jsx)(n.a,{href:"https://github.com/OpenC3/openc3-cosmos-bridge-dualsense",children:"openc3-cosmos-bridge-dualsense"})]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"note-on-serial-ports",children:"Note on Serial Ports"}),"\n",(0,i.jsx)(n.p,{children:"Serial ports can be used directly without bridges on Linux Docker installations."}),"\n",(0,i.jsx)(n.p,{children:"Add the following to the operator service in compose.yaml:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:' devices:\n - "/dev/ttyUSB0:/dev/ttyUSB0"\n'})}),"\n",(0,i.jsx)(n.p,{children:"Make sure the serial device has permissions for the user running Docker to access:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"sudo chmod 666 /dev/ttyUSB0\n"})})]})}function u(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},1184:(e,n,t)=>{t.d(n,{R:()=>o,x:()=>a});var i=t(4041);const r={},s=i.createContext(r);function o(e){const n=i.useContext(s);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(r):e.components||r:o(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([[2577],{1117:(e,n,o)=>{o.r(n),o.d(n,{assets:()=>l,contentTitle:()=>c,default:()=>p,frontMatter:()=>i,metadata:()=>r,toc:()=>a});var t=o(1085),s=o(1184);const i={title:"Developing COSMOS"},c="Developing COSMOS",r={id:"development/developing",title:"Developing COSMOS",description:"So you want to help develop COSMOS? All of our open source COSMOS code is on Github so the first thing to do is get an account. Next clone the COSMOS repository. We accept contributions from others as Pull Requests.",source:"@site/docs/development/developing.md",sourceDirName:"development",slug:"/development/developing",permalink:"/tools/staticdocs/docs/development/developing",draft:!1,unlisted:!1,editUrl:"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/development/developing.md",tags:[],version:"current",frontMatter:{title:"Developing COSMOS"},sidebar:"defaultSidebar",previous:{title:"Testing with Curl",permalink:"/tools/staticdocs/docs/development/curl"},next:{title:"Host Install",permalink:"/tools/staticdocs/docs/development/host-install"}},l={},a=[{value:"Development Tools",id:"development-tools",level:2},{value:"Running a Frontend Application",id:"running-a-frontend-application",level:2},{value:"Running a Backend Server",id:"running-a-backend-server",level:2}];function d(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"developing-cosmos",children:"Developing COSMOS"})}),"\n",(0,t.jsxs)(n.p,{children:["So you want to help develop COSMOS? All of our open source COSMOS code is on ",(0,t.jsx)(n.a,{href:"https://github.com/",children:"Github"})," so the first thing to do is get an ",(0,t.jsx)(n.a,{href:"https://github.com/join",children:"account"}),". Next ",(0,t.jsx)(n.a,{href:"https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository",children:"clone"})," the ",(0,t.jsx)(n.a,{href:"https://github.com/openc3/cosmos",children:"COSMOS"})," repository. We accept contributions from others as ",(0,t.jsx)(n.a,{href:"https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests",children:"Pull Requests"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"development-tools",children:"Development Tools"}),"\n",(0,t.jsxs)(n.p,{children:["The core COSMOS team develops with the ",(0,t.jsx)(n.a,{href:"https://code.visualstudio.com/",children:"Visual Studio Code"})," editor and we highly recommend it. We also utilize a number of extensions including docker, kubernetes, gitlens, prettier, eslint, python, vetur, and ruby. We commit our ",(0,t.jsx)(n.code,{children:"openc3.code-workspace"})," configuration for VSCode to help configure these plugins. You also need ",(0,t.jsx)(n.a,{href:"https://www.docker.com/products/docker-desktop",children:"Docker Desktop"})," which you should already have as it is a requirement to run COSMOS. You'll also need ",(0,t.jsx)(n.a,{href:"https://nodejs.org/en/download/",children:"NodeJS"})," and ",(0,t.jsx)(n.a,{href:"https://yarnpkg.com/getting-started/install",children:"yarn"})," installed."]}),"\n",(0,t.jsx)(n.h1,{id:"building-cosmos",children:"Building COSMOS"}),"\n",(0,t.jsx)(n.p,{children:"Note: We primarily develop COSMOS in MacOS so the commands here will reference bash scripts but the same files exist in Windows as batch scripts."}),"\n",(0,t.jsxs)(n.p,{children:["Build COSMOS using the ",(0,t.jsx)(n.code,{children:"openc3.sh"})," script:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"% ./openc3.sh build\n"})}),"\n",(0,t.jsx)(n.p,{children:"This will pull all the COSMOS container dependencies and build our local containers. Note: This can take a long time especially for your first build!"}),"\n",(0,t.jsx)(n.p,{children:"Once the build completes you can see the built images with the following command:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'% docker image ls | grep "openc3"\nopenc3inc/openc3-cosmos-init latest 4cac7a3ea9d3 29 hours ago 446MB\nopenc3inc/openc3-cosmos-script-runner-api latest 4aacbaf49f7a 29 hours ago 431MB\nopenc3inc/openc3-cosmos-cmd-tlm-api latest 9a8806bd4be3 3 days ago 432MB\nopenc3inc/openc3-operator latest 223e98129fe9 3 days ago 405MB\nopenc3inc/openc3-base latest 98df5c0378c2 3 days ago 405MB\nopenc3inc/openc3-redis latest 5a3003a49199 8 days ago 111MB\nopenc3inc/openc3-traefik latest ec13a8d16a2f 8 days ago 104MB\nopenc3inc/openc3-minio latest 787f6e3fc0be 8 days ago 238MB\nopenc3inc/openc3-node latest b3ee86d3620a 8 days ago 372MB\nopenc3inc/openc3-ruby latest aa158bbb9539 8 days ago 326MB\n'})}),"\n",(0,t.jsxs)(n.admonition,{title:"Offline Building",type:"info",children:[(0,t.jsxs)(n.p,{children:["If you're building in a offline environment or want to use a private Rubygems, NPM or APK server (e.g. Nexus), you can update the following environment variables: RUBYGEMS_URL, NPM_URL, APK_URL, and more in the ",(0,t.jsx)(n.a,{href:"https://github.com/openc3/cosmos/blob/main/.env",children:".env"})," file. Example values:"]}),(0,t.jsxs)(n.p,{children:["ALPINE_VERSION=3.18",(0,t.jsx)("br",{}),"\nALPINE_BUILD=6",(0,t.jsx)("br",{}),"\nRUBYGEMS_URL=",(0,t.jsx)(n.a,{href:"https://rubygems.org",children:"https://rubygems.org"}),(0,t.jsx)("br",{}),"\nNPM_URL=",(0,t.jsx)(n.a,{href:"https://registry.npmjs.org",children:"https://registry.npmjs.org"}),(0,t.jsx)("br",{}),"\nAPK_URL=",(0,t.jsx)(n.a,{href:"http://dl-cdn.alpinelinux.org",children:"http://dl-cdn.alpinelinux.org"}),(0,t.jsx)("br",{})]})]}),"\n",(0,t.jsx)(n.h1,{id:"running-cosmos",children:"Running COSMOS"}),"\n",(0,t.jsxs)(n.p,{children:["Running COSMOS in development mode enables localhost access to internal API ports as well as sets ",(0,t.jsx)(n.code,{children:"RAILS_ENV=development"})," in the cmd-tlm-api and script-runner-api Rails servers. To run in development mode:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"% ./openc3.sh dev\n"})}),"\n",(0,t.jsx)(n.p,{children:"You can now see the running containers (I removed CONTAINER ID, CREATED and STATUS to save space):"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'% docker ps\nIMAGE COMMAND PORTS NAMES\nopenc3/openc3-cmd-tlm-api:latest "/sbin/tini -- rails\u2026" 127.0.0.1:2901->2901/tcp cosmos-openc3-cmd-tlm-api-1\nopenc3/openc3-script-runner-api:latest "/sbin/tini -- rails\u2026" 127.0.0.1:2902->2902/tcp cosmos-openc3-script-runner-api-1\nopenc3/openc3-traefik:latest "/entrypoint.sh trae\u2026" 0.0.0.0:2900->80/tcp cosmos-openc3-traefik-1\nopenc3/openc3-operator:latest "/sbin/tini -- ruby \u2026" cosmos-openc3-operator-1\nopenc3/openc3-minio:latest "/usr/bin/docker-ent\u2026" 127.0.0.1:9000->9000/tcp cosmos-openc3-minio-1\nopenc3/openc3-redis:latest "docker-entrypoint.s\u2026" 127.0.0.1:6379->6379/tcp cosmos-openc3-redis-1\n'})}),"\n",(0,t.jsx)(n.p,{children:"If you go to localhost:2900 you should see COSMOS up and running!"}),"\n",(0,t.jsx)(n.h2,{id:"running-a-frontend-application",children:"Running a Frontend Application"}),"\n",(0,t.jsx)(n.p,{children:"So now that you have COSMOS up and running how do you develop an individual COSMOS application?"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsx)(n.li,{children:"Bootstrap the frontend with yarn"}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"openc3-init % yarn\n"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsx)(n.li,{children:"Serve a local COSMOS application (CmdTlmServer, ScriptRunner, etc)"}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"openc3-init % cd plugins/packages/openc3-tool-scriptrunner\nopenc3-tool-scriptrunner % yarn serve\n\nDONE Compiled successfully in 128722ms\nApp running at:\n- Local: http://localhost:2914/tools/scriptrunner/\n- Network: http://localhost:2914/tools/scriptrunner/\n\nNote that the development build is not optimized.\nTo create a production build, run npm run build.\n"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Set the ",(0,t.jsx)(n.a,{href:"https://single-spa.js.org/",children:"single SPA"})," override for the application"]}),"\n",(0,t.jsxs)(n.p,{children:["Visit localhost:2900 and Right-click 'Inspect'",(0,t.jsx)("br",{}),"\nIn the console paste:"]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-javascript",children:'localStorage.setItem("devtools", true);\n'})}),"\n",(0,t.jsxs)(n.p,{children:["Refresh and you should see ",(0,t.jsx)(n.code,{children:"{...}"})," in the bottom right",(0,t.jsx)("br",{}),"\nClick the Default button next to the application (@openc3/tool-scriptrunner)",(0,t.jsx)("br",{}),"\nPaste in the development path which is dependent on the port returned by the local yarn serve and the tool name (scriptrunner)"]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.a,{href:"http://localhost:2914/tools/scriptrunner/js/app.js",children:"http://localhost:2914/tools/scriptrunner/js/app.js"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Refresh the page and you should see your local copy of the application (Script Runner in this example). If you dynamically add code (like ",(0,t.jsx)(n.code,{children:"console.log"}),") the yarn window should re-compile and the browser should refresh displaying your new code. It is highly recommended to get familiar with your browser's ",(0,t.jsx)(n.a,{href:"https://developer.chrome.com/docs/devtools/overview/",children:"development tools"})," if you plan to do frontend development."]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"running-a-backend-server",children:"Running a Backend Server"}),"\n",(0,t.jsx)(n.p,{children:"If the code you want to develop is the cmd-tlm-api or script-runner-api backend servers there are several steps to enable access to a development copy."}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsx)(n.li,{children:"Run a development version of traefik. COSMOS uses traefik to direct API requests to the correct locations."}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"% cd openc3-traefik\nopenc3-traefik % docker ps\n# Look for the container with name including traefik\nopenc3-traefik % docker stop cosmos-openc3-traefik-1\nopenc3-traefik % docker build --build-arg TRAEFIK_CONFIG=traefik-dev.yaml -t openc3-traefik-dev .\nopenc3-traefik % docker run --network=openc3-cosmos-network -p 2900:2900 -it --rm openc3-traefik-dev\n"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsx)(n.li,{children:"Run a local copy of the cmd-tlm-api or script-runner-api"}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"% cd openc3-cosmos-cmd-tlm-api\nopenc3-cosmos-cmd-tlm-api % docker ps\n# Look for the container with name including cmd-tlm-api\nopenc3-cosmos-cmd-tlm-api % docker stop cosmos-openc3-cosmos-cmd-tlm-api-1\n# Run the following on Windows:\nopenc3-cosmos-cmd-tlm-api> dev_server.bat\n# In Linux, set all the environment variables in the .env file, but override REDIS to be local\nopenc3-cosmos-cmd-tlm-api % set -a; source ../.env; set +a\nopenc3-cosmos-cmd-tlm-api % export OPENC3_REDIS_HOSTNAME=127.0.0.1\nopenc3-cosmos-cmd-tlm-api % export OPENC3_REDIS_EPHEMERAL_HOSTNAME=127.0.0.1\nopenc3-cosmos-cmd-tlm-api % bundle install\nopenc3-cosmos-cmd-tlm-api % bundle exec rails s\n"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Once the ",(0,t.jsx)(n.code,{children:"bundle exec rails s"})," command returns you should see API requests coming from interations in the frontend code. If you add code (like Ruby debugging statements) to the cmd-tlm-api code you need to stop the server (CTRL-C) and restart it to see the effect."]}),"\n"]})]})}function p(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},1184:(e,n,o)=>{o.d(n,{R:()=>c,x:()=>r});var t=o(4041);const s={},i=t.createContext(s);function c(e){const n=t.useContext(i);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:c(e.components),t.createElement(i.Provider,{value:n},e.children)}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([[6360],{8022:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>m,frontMatter:()=>d,metadata:()=>i,toc:()=>r});var s=n(1085),a=n(1184);const d={title:"Command Sender"},o=void 0,i={id:"tools/cmd-sender",title:"Command Sender",description:"Introduction",source:"@site/docs/tools/cmd-sender.md",sourceDirName:"tools",slug:"/tools/cmd-sender",permalink:"/tools/staticdocs/docs/tools/cmd-sender",draft:!1,unlisted:!1,editUrl:"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/tools/cmd-sender.md",tags:[],version:"current",frontMatter:{title:"Command Sender"},sidebar:"defaultSidebar",previous:{title:"Calendar (Enterprise)",permalink:"/tools/staticdocs/docs/tools/calendar"},next:{title:"Command and Telemetry Server",permalink:"/tools/staticdocs/docs/tools/cmd-tlm-server"}},c={},r=[{value:"Introduction",id:"introduction",level:2},{value:"Command Sender Menus",id:"command-sender-menus",level:2},{value:"Mode Menu Items",id:"mode-menu-items",level:3},{value:"Sending Commands",id:"sending-commands",level:2},{value:"Hazardous Commands",id:"hazardous-commands",level:3}];function l(e){const t={a:"a",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",ul:"ul",...(0,a.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:"Command Sender provides the ability to send any command defined by COSMOS. Commands are selected using the Target and Packet drop down fields which populate the command parameter (if any). A command history is stored which is also editable. Commands in the command history can be re-executed by pressing Enter."}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{alt:"Command Sender",src:n(9650).A+"",width:"1274",height:"664"})}),"\n",(0,s.jsx)(t.h2,{id:"command-sender-menus",children:"Command Sender Menus"}),"\n",(0,s.jsx)(t.h3,{id:"mode-menu-items",children:"Mode Menu Items"}),"\n",(0,s.jsx)("img",{src:n(4467).A,alt:"Mode Menu",style:{float:"left","margin-right":"50px",height:"120px"}}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"Ignores parameter range checking"}),"\n",(0,s.jsx)(t.li,{children:"Displays parameter state values in hex"}),"\n",(0,s.jsx)(t.li,{children:"Shows ignored parameters"}),"\n",(0,s.jsx)(t.li,{children:"Disables all parameter conversions"}),"\n"]}),"\n",(0,s.jsx)(t.h2,{id:"sending-commands",children:"Sending Commands"}),"\n",(0,s.jsx)(t.p,{children:"Select a command by first selecting the target from the Select Target drop down. Changing the target automatically updates the Select Packet options to only display commands from that target. If the command has parameters a table is generated with all the parameters."}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{alt:"INST COLLECT",src:n(7564).A+"",width:"1276",height:"642"})}),"\n",(0,s.jsx)(t.p,{children:"Clicking on a parameter with States (like TYPE in the above example) brings up a drop down to select a state. Selecting a state populates the value field next to it. Sending a command updates the Status text and the Command History."}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{alt:"States",src:n(8132).A+"",width:"1276",height:"664"})}),"\n",(0,s.jsx)(t.p,{children:"You can directly edit the Command History to change a parameter value. Pressing Enter on the line will then execute the command. If the command has changed a new line will be entered in the Command History. Pressing Enter several times on the same line updates the Status text with the number of commands sent (3 in the next example)."}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{alt:"History",src:n(1071).A+"",width:"1276",height:"664"})}),"\n",(0,s.jsx)(t.h3,{id:"hazardous-commands",children:"Hazardous Commands"}),"\n",(0,s.jsxs)(t.p,{children:["Sending ",(0,s.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/command#hazardous",children:"hazardous"})," commands will prompt the user whether to send the command."]}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{alt:"INST CLEAR",src:n(1513).A+"",width:"1274",height:"546"})}),"\n",(0,s.jsxs)(t.p,{children:["Commands can also have hazardous ",(0,s.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/command#state",children:"states"})," (INST COLLECT with TYPE SPECIAL) which also prompt the user. In this example, we've also checked all the menu options to show ignored parameters, display state values in hex (see SPECIAL, 0x1), disabled range checking (DURATION 1000), and disabled parameter conversions."]}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{alt:"INST COLLECT Hazardous",src:n(4805).A+"",width:"1276",height:"919"})}),"\n",(0,s.jsxs)(t.p,{children:["Selecting Yes will send the command and update the history with all the parameters shown. Note that when writing Scripts all parameters are optional unless explicitly marked ",(0,s.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/command#required",children:"required"}),"."]})]})}function m(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(l,{...e})}):l(e)}},4467:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/mode_menu-9c112084937db5bbff02c18a5681ad038caa0838fc88438628b134a6f6823a09.png"},8132:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/collect_states-565ae4b6d02449850585afd7ce35982711d4d677f5a04c1332b2c176f1ec3a25.png"},9650:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/command_sender-bb1543bde21fc1963405de5251d16a80a0c3a1bf5adb5fb78145d4995e2fe541.png"},1071:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/history-2391436f9edc3e00104a7375f88f5de72b0967f9eb154dfecc346c0a70af4389.png"},1513:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/inst_clear-2d5f985c879e8b917fedacdb8c6552bbd383231bf5c8ab8e560e77df4e050026.png"},7564:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/inst_collect-81bc422b3b33c5ebcbe4c2f489c730b32ab0d6ea6c7f81cc79d9f6bc03e9db15.png"},4805:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/inst_collect_hazardous-a8fb19ea296354a0cd276da1e0ad82f74479eea4e7e204fcf64b779596f2c092.png"},1184:(e,t,n)=>{n.d(t,{R:()=>o});var s=n(4041);const a={},d=s.createContext(a);function o(e){const t=s.useContext(d);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}}}]);
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([[6360],{8022:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>m,frontMatter:()=>d,metadata:()=>i,toc:()=>r});var s=n(1085),a=n(1184);const d={title:"Command Sender"},o=void 0,i={id:"tools/cmd-sender",title:"Command Sender",description:"Introduction",source:"@site/docs/tools/cmd-sender.md",sourceDirName:"tools",slug:"/tools/cmd-sender",permalink:"/tools/staticdocs/docs/tools/cmd-sender",draft:!1,unlisted:!1,editUrl:"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/tools/cmd-sender.md",tags:[],version:"current",frontMatter:{title:"Command Sender"},sidebar:"defaultSidebar",previous:{title:"Calendar (Enterprise)",permalink:"/tools/staticdocs/docs/tools/calendar"},next:{title:"Command and Telemetry Server",permalink:"/tools/staticdocs/docs/tools/cmd-tlm-server"}},c={},r=[{value:"Introduction",id:"introduction",level:2},{value:"Command Sender Menus",id:"command-sender-menus",level:2},{value:"Mode Menu Items",id:"mode-menu-items",level:3},{value:"Sending Commands",id:"sending-commands",level:2},{value:"Hazardous Commands",id:"hazardous-commands",level:3}];function l(e){const t={a:"a",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",ul:"ul",...(0,a.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:"Command Sender provides the ability to send any command defined by COSMOS. Commands are selected using the Target and Packet drop down fields which populate the command parameter (if any). A command history is stored which is also editable. Commands in the command history can be re-executed by pressing Enter."}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{alt:"Command Sender",src:n(9650).A+"",width:"1274",height:"664"})}),"\n",(0,s.jsx)(t.h2,{id:"command-sender-menus",children:"Command Sender Menus"}),"\n",(0,s.jsx)(t.h3,{id:"mode-menu-items",children:"Mode Menu Items"}),"\n",(0,s.jsx)("img",{src:n(4467).A,alt:"Mode Menu",style:{float:"left","margin-right":"50px",height:"120px"}}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"Ignores parameter range checking"}),"\n",(0,s.jsx)(t.li,{children:"Displays parameter state values in hex"}),"\n",(0,s.jsx)(t.li,{children:"Shows ignored parameters"}),"\n",(0,s.jsx)(t.li,{children:"Disables all parameter conversions"}),"\n"]}),"\n",(0,s.jsx)(t.h2,{id:"sending-commands",children:"Sending Commands"}),"\n",(0,s.jsx)(t.p,{children:"Select a command by first selecting the target from the Select Target drop down. Changing the target automatically updates the Select Packet options to only display commands from that target. If the command has parameters a table is generated with all the parameters."}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{alt:"INST COLLECT",src:n(7564).A+"",width:"1276",height:"642"})}),"\n",(0,s.jsx)(t.p,{children:"Clicking on a parameter with States (like TYPE in the above example) brings up a drop down to select a state. Selecting a state populates the value field next to it. Sending a command updates the Status text and the Command History."}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{alt:"States",src:n(8132).A+"",width:"1276",height:"664"})}),"\n",(0,s.jsx)(t.p,{children:"You can directly edit the Command History to change a parameter value. Pressing Enter on the line will then execute the command. If the command has changed a new line will be entered in the Command History. Pressing Enter several times on the same line updates the Status text with the number of commands sent (3 in the next example)."}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{alt:"History",src:n(1071).A+"",width:"1276",height:"664"})}),"\n",(0,s.jsx)(t.h3,{id:"hazardous-commands",children:"Hazardous Commands"}),"\n",(0,s.jsxs)(t.p,{children:["Sending ",(0,s.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/command#hazardous",children:"hazardous"})," commands will prompt the user whether to send the command."]}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{alt:"INST CLEAR",src:n(1513).A+"",width:"1274",height:"546"})}),"\n",(0,s.jsxs)(t.p,{children:["Commands can also have hazardous ",(0,s.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/command#state",children:"states"})," (INST COLLECT with TYPE SPECIAL) which also prompt the user. In this example, we've also checked all the menu options to show ignored parameters, display state values in hex (see SPECIAL, 0x1), disabled range checking (DURATION 1000), and disabled parameter conversions."]}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{alt:"INST COLLECT Hazardous",src:n(7186).A+"",width:"1276",height:"919"})}),"\n",(0,s.jsxs)(t.p,{children:["Selecting Yes will send the command and update the history with all the parameters shown. Note that when writing Scripts all parameters are optional unless explicitly marked ",(0,s.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/command#required",children:"required"}),"."]})]})}function m(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(l,{...e})}):l(e)}},4467:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/mode_menu-9c112084937db5bbff02c18a5681ad038caa0838fc88438628b134a6f6823a09.png"},8132:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/collect_states-565ae4b6d02449850585afd7ce35982711d4d677f5a04c1332b2c176f1ec3a25.png"},9650:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/command_sender-bb1543bde21fc1963405de5251d16a80a0c3a1bf5adb5fb78145d4995e2fe541.png"},1071:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/history-2391436f9edc3e00104a7375f88f5de72b0967f9eb154dfecc346c0a70af4389.png"},1513:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/inst_clear-2d5f985c879e8b917fedacdb8c6552bbd383231bf5c8ab8e560e77df4e050026.png"},7564:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/inst_collect-81bc422b3b33c5ebcbe4c2f489c730b32ab0d6ea6c7f81cc79d9f6bc03e9db15.png"},7186:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/inst_collect_hazardous-a8fb19ea296354a0cd276da1e0ad82f74479eea4e7e204fcf64b779596f2c092.png"},1184:(e,t,n)=>{n.d(t,{R:()=>o,x:()=>i});var s=n(4041);const a={},d=s.createContext(a);function o(e){const t=s.useContext(d);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function i(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:o(e.components),s.createElement(d.Provider,{value:t},e.children)}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([[407],{2279:(t,o,e)=>{e.r(o),e.d(o,{assets:()=>r,contentTitle:()=>c,default:()=>u,frontMatter:()=>a,metadata:()=>i,toc:()=>d});var n=e(1085),s=e(1184);const a={title:"Handbooks"},c=void 0,i={id:"tools/handbooks",title:"Handbooks",description:"Introduction",source:"@site/docs/tools/handbooks.md",sourceDirName:"tools",slug:"/tools/handbooks",permalink:"/tools/staticdocs/docs/tools/handbooks",draft:!1,unlisted:!1,editUrl:"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/tools/handbooks.md",tags:[],version:"current",frontMatter:{title:"Handbooks"},sidebar:"defaultSidebar",previous:{title:"Data Viewer",permalink:"/tools/staticdocs/docs/tools/data-viewer"},next:{title:"Limits Monitor",permalink:"/tools/staticdocs/docs/tools/limits-monitor"}},r={},d=[{value:"Introduction",id:"introduction",level:2}];function l(t){const o={a:"a",h2:"h2",img:"img",p:"p",...(0,s.R)(),...t.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.h2,{id:"introduction",children:"Introduction"}),"\n",(0,n.jsxs)(o.p,{children:["Handbooks formats the COSMOS ",(0,n.jsx)(o.a,{href:"/tools/staticdocs/docs/configuration/command",children:"command"})," and ",(0,n.jsx)(o.a,{href:"/tools/staticdocs/docs/configuration/telemetry",children:"telemetry"})," definitions into a nicely formatted webpage that can be exported to a PDF."]}),"\n",(0,n.jsx)(o.p,{children:(0,n.jsx)(o.img,{alt:"Handbooks",src:e(1226).A+"",width:"1270",height:"710"})}),"\n",(0,n.jsx)(o.p,{children:"You can select the targets you want to display and the number of columns to display on the page. You can then use the browser to Print the page. Most browsers have the capability to Save as PDF rather than print to save the resulting page as PDF."})]})}function u(t={}){const{wrapper:o}={...(0,s.R)(),...t.components};return o?(0,n.jsx)(o,{...t,children:(0,n.jsx)(l,{...t})}):l(t)}},1226:(t,o,e)=>{e.d(o,{A:()=>n});const n=e.p+"assets/images/handbooks-948da6f5aad7a4175441235f2aac82668f9233c60412e412439b2e2af0bd1a45.png"},1184:(t,o,e)=>{e.d(o,{R:()=>c,x:()=>i});var n=e(4041);const s={},a=n.createContext(s);function c(t){const o=n.useContext(a);return n.useMemo((function(){return"function"==typeof t?t(o):{...o,...t}}),[o,t])}function i(t){let o;return o=t.disableParentContext?"function"==typeof t.components?t.components(s):t.components||s:c(t.components),n.createElement(a.Provider,{value:o},t.children)}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([[3718],{3236:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>d,contentTitle:()=>l,default:()=>a,frontMatter:()=>r,metadata:()=>o,toc:()=>c});var n=s(1085),i=s(1184);const r={title:"Performance"},l="COSMOS Hardware Requirements",o={id:"guides/performance",title:"Performance",description:"The COSMOS architecture was created with scalability in mind. Our goal is to support an unlimited number of connections and use cloud technologies to scale. Only COSMOS Enterprise Edition supports Kubernetes and the various cloud platforms which allow this level of scalability. While true scalability is only achieved in COSMOS Enterprise, both Open Source and Enterprise have various levels of observability and configuration settings which can affect performance.",source:"@site/docs/guides/performance.md",sourceDirName:"guides",slug:"/guides/performance",permalink:"/tools/staticdocs/docs/guides/performance",draft:!1,unlisted:!1,editUrl:"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/guides/performance.md",tags:[],version:"current",frontMatter:{title:"Performance"},sidebar:"defaultSidebar",previous:{title:"Monitoring",permalink:"/tools/staticdocs/docs/guides/monitoring"},next:{title:"Raspberry Pi",permalink:"/tools/staticdocs/docs/guides/raspberrypi"}},d={},c=[{value:"Memory",id:"memory",level:2},{value:"CPU",id:"cpu",level:2},{value:"Performance Comparison",id:"performance-comparison",level:2}];function h(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",section:"section",sup:"sup",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(t.p,{children:["The COSMOS architecture was created with scalability in mind. Our goal is to support an unlimited number of connections and use cloud technologies to scale. Only ",(0,n.jsx)(t.a,{href:"https://openc3.com/enterprise",children:"COSMOS Enterprise Edition"})," supports Kubernetes and the various cloud platforms which allow this level of scalability. While true scalability is only achieved in COSMOS Enterprise, both Open Source and Enterprise have various levels of observability and configuration settings which can affect performance."]}),"\n",(0,n.jsx)(t.header,{children:(0,n.jsx)(t.h1,{id:"cosmos-hardware-requirements",children:"COSMOS Hardware Requirements"})}),"\n",(0,n.jsx)(t.h2,{id:"memory",children:"Memory"}),"\n",(0,n.jsx)(t.p,{children:"COSMOS can run on a Raspberry Pi up to a Kubernetes cluster in the cloud. On all platforms the key performance factor is the number and complexity of the targets and their defined packets. Targets can vary from simple targets taking 100 MB of RAM to complex targets taking 400 MB. The base COSMOS containers require about 800 MB of RAM. A good rule of thumb is to average about 300 MB of RAM for targets. As an example data point, the COSMOS Demo has 4 targets, two complex (INST & INST2) and two relatively simple (EXAMPLE & TEMPLATED), and requires 800 MB of RAM (on top of the 800 MB of base container RAM)."}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsx)(t.li,{children:"Base RAM MB Calculator = 800 + (num targets) * 300"}),"\n"]}),"\n",(0,n.jsxs)(t.p,{children:["In addition, the Redis streams contain the last 10 min of both raw and decommutated data from all targets. Thus you must wait ~15min to truly see what the high water memory mark will be. In the COSMOS Demo the INST & INST2 targets are fairly simple with four 1Hz packet of ~15 items and one 10Hz packet with 20 items. This only causes 50 MiB of redis RAM usage according to ",(0,n.jsx)(t.code,{children:"docker stats"}),". Installing the COSMOS ",(0,n.jsx)(t.a,{href:"https://github.com/OpenC3/openc3-cosmos-load-sim",children:"LoadSim"})," with 10 packets with 1000 items each at 10Hz pushed the redis memory usage to about 350 MiB."]}),"\n",(0,n.jsx)(t.h2,{id:"cpu",children:"CPU"}),"\n",(0,n.jsx)(t.p,{children:"Another consideration is the CPU performance. In the Open Source Edition, by default COSMOS spawns off 2 microservices per target. One combines packet logging and decommutation of the data and the other performs data reduction. In COSMOS Enterprise Edition on Kubernetes, each process becomes an independent container that is deployed on the cluster allowing horizontal scaling."}),"\n",(0,n.jsxs)(t.p,{children:["The COSMOS command and telemetry API and script running API servers should have a dedicated core while targets can generally share cores. It's hard to provide a general rule of thumb with the wide variety of architectures, clock speeds, and core counts. The best practice is to install COSMOS with the expected load and do some monitoring with ",(0,n.jsx)(t.code,{children:"htop"})," to visualize the load on the various cores. Any time a single core gets overloaded (100%) this is a concern and system slowdown can occur."]}),"\n",(0,n.jsx)(t.h2,{id:"performance-comparison",children:"Performance Comparison"}),"\n",(0,n.jsxs)(t.p,{children:["Performance characterization was performed in Azure on a Standard D4s v5 (4 vcpus, 16 GiB memory) chosen to allow virtualization per ",(0,n.jsx)(t.a,{href:"https://docs.docker.com/desktop/vm-vdi/#turn-on-nested-virtualization-on-microsoft-hyper-v",children:"Docker"}),". COSMOS ",(0,n.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-enterprise/releases/tag/v5.9.1",children:"5.9.1"})," Enterprise Edition was installed on both Windows 11 Pro ",(0,n.jsx)(t.sup,{children:(0,n.jsx)(t.a,{href:"#user-content-fn-1",id:"user-content-fnref-1","data-footnote-ref":!0,"aria-describedby":"footnote-label",children:"1"})})," and Ubuntu 22. Note: Enterprise Edition was not utilizing Kubernetes, just Docker. Testing involved starting the COSMOS Demo, connecting all targets (EXAMPLE, INST, INST2, TEMPLATED), opening the following TlmViewer screens (ADCS, ARRAY, BLOCK, COMMANDING, HS, LATEST, LIMITS, OTHER, PARAMS, SIMPLE, TABS) and creating two TlmGrapher graphs consisting of INST HEALTH_STATUS TEMP[1-4] and INST ADCS POS[X,Y,Z] and INST ADCS VEL[X,Y,Z]. This was allowed to run for 1hr and results were collected using ",(0,n.jsx)(t.code,{children:"htop"}),":"]}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{style:{textAlign:"left"},children:"Platform"}),(0,n.jsx)(t.th,{style:{textAlign:"left"},children:"Core CPU %"}),(0,n.jsx)(t.th,{style:{textAlign:"left"},children:"RAM"})]})}),(0,n.jsxs)(t.tbody,{children:[(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"Windows 11 Pro"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"12% 12% 10% 10%"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"3.9G / 7.7G"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"Headless Ubuntu 22"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"7% 7% 8% 6%"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"3.2G / 15.6G"})]})]})]}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:["Windows was only allocated 8 GB of RAM due to the ",(0,n.jsx)(t.a,{href:"https://learn.microsoft.com/en-us/windows/wsl/wsl-config#configuration-setting-for-wslconfig",children:".wslconfig"})," settings."]}),"\n",(0,n.jsx)(t.li,{children:"Since Ubuntu was running headless, the screens and graphs were brought up on another machine."}),"\n"]}),"\n",(0,n.jsxs)(t.p,{children:[(0,n.jsx)(t.code,{children:"docker stats"})," was also run to show individual container cpu and memory usage:"]}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{style:{textAlign:"left"},children:"NAME"}),(0,n.jsx)(t.th,{style:{textAlign:"left"},children:"Windows CPU %"}),(0,n.jsx)(t.th,{children:"Ubuntu CPU %"}),(0,n.jsx)(t.th,{style:{textAlign:"left"},children:"Windows MEM"}),(0,n.jsx)(t.th,{children:"Ubuntu MEM"})]})}),(0,n.jsxs)(t.tbody,{children:[(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-traefik-1"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"4.16%"}),(0,n.jsx)(t.td,{children:"1.32%"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"43.54MiB"}),(0,n.jsx)(t.td,{children:"51.38MiB"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-cosmos-cmd-tlm-api-1"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"10.16%"}),(0,n.jsx)(t.td,{children:"6.14%"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"401.6MiB"}),(0,n.jsx)(t.td,{children:"392MiB"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-keycloak-1"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"0.17%"}),(0,n.jsx)(t.td,{children:"0.13%"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"476.8MiB"}),(0,n.jsx)(t.td,{children:"476.8MiB"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-operator-1"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"21.27%"}),(0,n.jsx)(t.td,{children:"13.91%"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"1.214GiB"}),(0,n.jsx)(t.td,{children:"1.207GiB"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-cosmos-script-runner-api-1"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"0.01%"}),(0,n.jsx)(t.td,{children:"0.01%"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"127.4MiB"}),(0,n.jsx)(t.td,{children:"117.1MiB"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-metrics-1"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"0.01%"}),(0,n.jsx)(t.td,{children:"0.00%"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"105.2MiB"}),(0,n.jsx)(t.td,{children:"83.87MiB"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-redis-ephemeral-1"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"4.05%"}),(0,n.jsx)(t.td,{children:"1.89%"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"46.22MiB"}),(0,n.jsx)(t.td,{children:"69.84MiB"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-redis-1"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"1.56%"}),(0,n.jsx)(t.td,{children:"0.72%"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"12.82MiB"}),(0,n.jsx)(t.td,{children:"9.484MiB"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-minio-1"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"0.01%"}),(0,n.jsx)(t.td,{children:"0.00%"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"152.9MiB"}),(0,n.jsx)(t.td,{children:"169.8MiB"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-postgresql-1"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"0.00%"}),(0,n.jsx)(t.td,{children:"0.39%"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"37.33MiB"}),(0,n.jsx)(t.td,{children:"41.02MiB"})]})]})]}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsx)(t.li,{children:"memory profiles are similar between the two platforms"}),"\n",(0,n.jsx)(t.li,{children:"redis-ephemeral isn't using much memory on the base Demo with its small packets"}),"\n"]}),"\n",(0,n.jsxs)(t.p,{children:["At this point the COSMOS ",(0,n.jsx)(t.a,{href:"https://github.com/OpenC3/openc3-cosmos-load-sim",children:"LoadSim"})," was installed with default settings which creates 10 packets with 1000 items each at 10Hz (110kB/s). After a 1 hr soak, htop now indicated:"]}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{style:{textAlign:"left"},children:"Platform"}),(0,n.jsx)(t.th,{style:{textAlign:"left"},children:"Core CPU %"}),(0,n.jsx)(t.th,{style:{textAlign:"left"},children:"RAM"})]})}),(0,n.jsxs)(t.tbody,{children:[(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"Windows 11 Pro"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"40% 35% 39% 42%"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"4.64G / 7.7G"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"Headless Ubuntu 22"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"17% 20% 16% 18%"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"3.74G / 15.6G"})]})]})]}),"\n",(0,n.jsx)(t.p,{children:"The larger packets and data rate of the LoadSim target caused both platforms to dramatically increase CPU utilization but the Linux machine stays quite performant."}),"\n",(0,n.jsxs)(t.p,{children:[(0,n.jsx)(t.code,{children:"docker stats"})," was also run to show individual container cpu and memory usage:"]}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{style:{textAlign:"left"},children:"NAME"}),(0,n.jsx)(t.th,{style:{textAlign:"left"},children:"Windows CPU %"}),(0,n.jsx)(t.th,{children:"Ubuntu CPU %"}),(0,n.jsx)(t.th,{style:{textAlign:"left"},children:"Windows MEM"}),(0,n.jsx)(t.th,{children:"Ubuntu MEM"})]})}),(0,n.jsxs)(t.tbody,{children:[(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-traefik-1"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"4.09%"}),(0,n.jsx)(t.td,{children:"0.01%"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"44.3MiB"}),(0,n.jsx)(t.td,{children:"0.34MiB"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-cosmos-cmd-tlm-api-1"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"17.78%"}),(0,n.jsx)(t.td,{children:"6.18%"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"407.9MiB"}),(0,n.jsx)(t.td,{children:"405.8MiB"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-keycloak-1"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"0.20%"}),(0,n.jsx)(t.td,{children:"0.12%"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"480.2MiB"}),(0,n.jsx)(t.td,{children:"481.5MiB"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-operator-1"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"221.15%"}),(0,n.jsx)(t.td,{children:"66.72%"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"1.6GiB"}),(0,n.jsx)(t.td,{children:"1.512GiB"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-cosmos-script-runner-api-1"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"0.01%"}),(0,n.jsx)(t.td,{children:"0.01%"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"136.6MiB"}),(0,n.jsx)(t.td,{children:"127.5MiB"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-metrics-1"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"0.01%"}),(0,n.jsx)(t.td,{children:"0.01%"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"106.3MiB"}),(0,n.jsx)(t.td,{children:"84.87MiB"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-redis-ephemeral-1"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"19.63%"}),(0,n.jsx)(t.td,{children:"3.91%"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"333.8MiB"}),(0,n.jsx)(t.td,{children:"370.8MiB"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-redis-1"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"7.42%"}),(0,n.jsx)(t.td,{children:"1.49%"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"15.87MiB"}),(0,n.jsx)(t.td,{children:"11.81MiB"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-minio-1"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"0.10%"}),(0,n.jsx)(t.td,{children:"0.02%"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"167.8MiB"}),(0,n.jsx)(t.td,{children:"179.2MiB"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-postgresql-1"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"0.00%"}),(0,n.jsx)(t.td,{children:"0.00%"}),(0,n.jsx)(t.td,{style:{textAlign:"left"},children:"35.4MiB"}),(0,n.jsx)(t.td,{children:"42.93MiB"})]})]})]}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsx)(t.li,{children:"memory profiles are similar between the two platforms"}),"\n",(0,n.jsx)(t.li,{children:"redis-ephemeral is now using much more RAM as it is storing the large LoadSim packets"}),"\n",(0,n.jsx)(t.li,{children:"Windows is using much more CPU power running the operator, cmd-tlm, and redis"}),"\n"]}),"\n",(0,n.jsx)(t.h1,{id:"conclusions",children:"Conclusions"}),"\n",(0,n.jsxs)(t.p,{children:["While it is easy to run COSMOS on any Docker platform, increasing the number and complexity of the targets requires choosing the correct hardware. Sizing can be approximated but the best solution is to install representative targets and use ",(0,n.jsx)(t.code,{children:"docker stats"})," and ",(0,n.jsx)(t.code,{children:"htop"})," to judge the CPU and memory pressure on the given hardware."]}),"\n",(0,n.jsxs)(t.p,{children:[(0,n.jsx)(t.a,{href:"https://openc3.com/enterprise",children:"COSMOS Enterprise Edition"})," on Kubernetes helps to eliminate the hardware sizing issue by scaling the cluster to meet the needs of the system. Check out ",(0,n.jsx)(t.a,{href:"https://openc3.com/news/scaling",children:"this recent talk"})," Ryan gave at GSAW showing how we scaled to over 160 satellites on a 4 node kubernetes cluster on EKS."]}),"\n",(0,n.jsx)("hr",{}),"\n","\n",(0,n.jsxs)(t.section,{"data-footnotes":!0,className:"footnotes",children:[(0,n.jsx)(t.h2,{className:"sr-only",id:"footnote-label",children:"Footnotes"}),"\n",(0,n.jsxs)(t.ol,{children:["\n",(0,n.jsxs)(t.li,{id:"user-content-fn-1",children:["\n",(0,n.jsx)(t.p,{children:"Full specs of the Windows Platform:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{children:"Windows 11 Pro\nDocker Desktop 4.22.0\nWSL version: 1.2.5.0\nKernel version: 5.15.90.1\nWSLg version: 1.0.51\nMSRDC version: 1.2.3770\nDirect3D version: 1.608.2-61064218\nDXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp\nWindows version: 10.0.22621.2134\n"})}),"\n",(0,n.jsx)(t.a,{href:"#user-content-fnref-1","data-footnote-backref":"","aria-label":"Back to reference 1",className:"data-footnote-backref",children:"\u21a9"}),"\n"]}),"\n"]}),"\n"]})]})}function a(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},1184:(e,t,s)=>{s.d(t,{R:()=>l,x:()=>o});var n=s(4041);const i={},r=n.createContext(i);function l(e){const t=n.useContext(r);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),n.createElement(r.Provider,{value:t},e.children)}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([[7209],{9016:(e,t,n)=>{n.r(t),n.d(t,{default:()=>be});var a=n(4041),o=n(4357),i=n(145),s=n(7473),l=n(5096),c=n(7186),r=n(9082),d=n(1034),u=n(9404);const m={backToTopButton:"backToTopButton_z1FD",backToTopButtonShow:"backToTopButtonShow_w1wE"};var b=n(1085);function h(){const{shown:e,scrollToTop:t}=function(e){let{threshold:t}=e;const[n,o]=(0,a.useState)(!1),i=(0,a.useRef)(!1),{startScroll:s,cancelScroll:l}=(0,d.gk)();return(0,d.Mq)(((e,n)=>{let{scrollY:a}=e;const s=n?.scrollY;s&&(i.current?i.current=!1:a>=s?(l(),o(!1)):a<t?o(!1):a+window.innerHeight<document.documentElement.scrollHeight&&o(!0))})),(0,u.$)((e=>{e.location.hash&&(i.current=!0,o(!1))})),{shown:n,scrollToTop:()=>s(0)}}({threshold:300});return(0,b.jsx)("button",{"aria-label":(0,r.T)({id:"theme.BackToTopButton.buttonAriaLabel",message:"Scroll back to top",description:"The ARIA label for the back to top button"}),className:(0,o.A)("clean-btn",s.G.common.backToTopButton,m.backToTopButton,e&&m.backToTopButtonShow),type:"button",onClick:t})}var p=n(2631),x=n(6090),f=n(1187),j=n(2520),v=n(1631);function _(e){return(0,b.jsx)("svg",{width:"20",height:"20","aria-hidden":"true",...e,children:(0,b.jsxs)("g",{fill:"#7a7a7a",children:[(0,b.jsx)("path",{d:"M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"}),(0,b.jsx)("path",{d:"M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"})]})})}const g={collapseSidebarButton:"collapseSidebarButton_Ftvb",collapseSidebarButtonIcon:"collapseSidebarButtonIcon_c4WT"};function C(e){let{onClick:t}=e;return(0,b.jsx)("button",{type:"button",title:(0,r.T)({id:"theme.docs.sidebar.collapseButtonTitle",message:"Collapse sidebar",description:"The title attribute for collapse button of doc sidebar"}),"aria-label":(0,r.T)({id:"theme.docs.sidebar.collapseButtonAriaLabel",message:"Collapse sidebar",description:"The title attribute for collapse button of doc sidebar"}),className:(0,o.A)("button button--secondary button--outline",g.collapseSidebarButton),onClick:t,children:(0,b.jsx)(_,{className:g.collapseSidebarButtonIcon})})}var A=n(9303),S=n(1786);const k=Symbol("EmptyContext"),T=a.createContext(k);function N(e){let{children:t}=e;const[n,o]=(0,a.useState)(null),i=(0,a.useMemo)((()=>({expandedItem:n,setExpandedItem:o})),[n]);return(0,b.jsx)(T.Provider,{value:i,children:t})}var I=n(6476),B=n(4271),y=n(2436),w=n(213);function L(e){let{collapsed:t,categoryLabel:n,onClick:a}=e;return(0,b.jsx)("button",{"aria-label":t?(0,r.T)({id:"theme.DocSidebarItem.expandCategoryAriaLabel",message:"Expand sidebar category '{label}'",description:"The ARIA label to expand the sidebar category"},{label:n}):(0,r.T)({id:"theme.DocSidebarItem.collapseCategoryAriaLabel",message:"Collapse sidebar category '{label}'",description:"The ARIA label to collapse the sidebar category"},{label:n}),"aria-expanded":!t,type:"button",className:"clean-btn menu__caret",onClick:a})}function E(e){let{item:t,onItemClick:n,activePath:i,level:c,index:r,...d}=e;const{items:u,label:m,collapsible:h,className:p,href:x}=t,{docs:{sidebar:{autoCollapseCategories:f}}}=(0,j.p)(),v=function(e){const t=(0,w.A)();return(0,a.useMemo)((()=>e.href&&!e.linkUnlisted?e.href:!t&&e.collapsible?(0,l.Nr)(e):void 0),[e,t])}(t),_=(0,l.w8)(t,i),g=(0,B.ys)(x,i),{collapsed:C,setCollapsed:A}=(0,I.u)({initialState:()=>!!h&&(!_&&t.collapsed)}),{expandedItem:N,setExpandedItem:E}=function(){const e=(0,a.useContext)(T);if(e===k)throw new S.dV("DocSidebarItemsExpandedStateProvider");return e}(),M=function(e){void 0===e&&(e=!C),E(e?null:r),A(e)};return function(e){let{isActive:t,collapsed:n,updateCollapsed:o}=e;const i=(0,S.ZC)(t);(0,a.useEffect)((()=>{t&&!i&&n&&o(!1)}),[t,i,n,o])}({isActive:_,collapsed:C,updateCollapsed:M}),(0,a.useEffect)((()=>{h&&null!=N&&N!==r&&f&&A(!0)}),[h,N,r,A,f]),(0,b.jsxs)("li",{className:(0,o.A)(s.G.docs.docSidebarItemCategory,s.G.docs.docSidebarItemCategoryLevel(c),"menu__list-item",{"menu__list-item--collapsed":C},p),children:[(0,b.jsxs)("div",{className:(0,o.A)("menu__list-item-collapsible",{"menu__list-item-collapsible--active":g}),children:[(0,b.jsx)(y.A,{className:(0,o.A)("menu__link",{"menu__link--sublist":h,"menu__link--sublist-caret":!x&&h,"menu__link--active":_}),onClick:h?e=>{n?.(t),x?M(!1):(e.preventDefault(),M())}:()=>{n?.(t)},"aria-current":g?"page":void 0,role:h&&!x?"button":void 0,"aria-expanded":h&&!x?!C:void 0,href:h?v??"#":v,...d,children:m}),x&&h&&(0,b.jsx)(L,{collapsed:C,categoryLabel:m,onClick:e=>{e.preventDefault(),M()}})]}),(0,b.jsx)(I.N,{lazy:!0,as:"ul",className:"menu__list",collapsed:C,children:(0,b.jsx)(V,{items:u,tabIndex:C?-1:0,onItemClick:n,activePath:i,level:c+1})})]})}var M=n(5436),H=n(7545);const R={menuExternalLink:"menuExternalLink_xK2O"};function W(e){let{item:t,onItemClick:n,activePath:a,level:i,index:c,...r}=e;const{href:d,label:u,className:m,autoAddBaseUrl:h}=t,p=(0,l.w8)(t,a),x=(0,M.A)(d);return(0,b.jsx)("li",{className:(0,o.A)(s.G.docs.docSidebarItemLink,s.G.docs.docSidebarItemLinkLevel(i),"menu__list-item",m),children:(0,b.jsxs)(y.A,{className:(0,o.A)("menu__link",!x&&R.menuExternalLink,{"menu__link--active":p}),autoAddBaseUrl:h,"aria-current":p?"page":void 0,to:d,...x&&{onClick:n?()=>n(t):void 0},...r,children:[u,!x&&(0,b.jsx)(H.A,{})]})},u)}const G={menuHtmlItem:"menuHtmlItem_anEq"};function P(e){let{item:t,level:n,index:a}=e;const{value:i,defaultStyle:l,className:c}=t;return(0,b.jsx)("li",{className:(0,o.A)(s.G.docs.docSidebarItemLink,s.G.docs.docSidebarItemLinkLevel(n),l&&[G.menuHtmlItem,"menu__list-item"],c),dangerouslySetInnerHTML:{__html:i}},a)}function D(e){let{item:t,...n}=e;switch(t.type){case"category":return(0,b.jsx)(E,{item:t,...n});case"html":return(0,b.jsx)(P,{item:t,...n});default:return(0,b.jsx)(W,{item:t,...n})}}function F(e){let{items:t,...n}=e;const a=(0,l.Y)(t,n.activePath);return(0,b.jsx)(N,{children:a.map(((e,t)=>(0,b.jsx)(D,{item:e,index:t,...n},t)))})}const V=(0,a.memo)(F),q={menu:"menu_qiME",menuWithAnnouncementBar:"menuWithAnnouncementBar_hRfJ"};function z(e){let{path:t,sidebar:n,className:i}=e;const l=function(){const{isActive:e}=(0,A.M)(),[t,n]=(0,a.useState)(e);return(0,d.Mq)((t=>{let{scrollY:a}=t;e&&n(0===a)}),[e]),e&&t}();return(0,b.jsx)("nav",{"aria-label":(0,r.T)({id:"theme.docs.sidebar.navAriaLabel",message:"Docs sidebar",description:"The ARIA label for the sidebar navigation"}),className:(0,o.A)("menu thin-scrollbar",q.menu,l&&q.menuWithAnnouncementBar,i),children:(0,b.jsx)("ul",{className:(0,o.A)(s.G.docs.docSidebarMenu,"menu__list"),children:(0,b.jsx)(V,{items:n,activePath:t,level:1})})})}const Y="sidebar_vJCc",K="sidebarWithHideableNavbar_Fo4g",U="sidebarHidden_vBKa",O="sidebarLogo_nlll";function X(e){let{path:t,sidebar:n,onCollapse:a,isHidden:i}=e;const{navbar:{hideOnScroll:s},docs:{sidebar:{hideable:l}}}=(0,j.p)();return(0,b.jsxs)("div",{className:(0,o.A)(Y,s&&K,i&&U),children:[s&&(0,b.jsx)(v.A,{tabIndex:-1,className:O}),(0,b.jsx)(z,{path:t,sidebar:n}),l&&(0,b.jsx)(C,{onClick:a})]})}const J=a.memo(X);var Z=n(7226),Q=n(2106);const $=e=>{let{sidebar:t,path:n}=e;const a=(0,Q.M)();return(0,b.jsx)("ul",{className:(0,o.A)(s.G.docs.docSidebarMenu,"menu__list"),children:(0,b.jsx)(V,{items:t,activePath:n,onItemClick:e=>{"category"===e.type&&e.href&&a.toggle(),"link"===e.type&&a.toggle()},level:1})})};function ee(e){return(0,b.jsx)(Z.GX,{component:$,props:e})}const te=a.memo(ee);function ne(e){const t=(0,f.l)(),n="desktop"===t||"ssr"===t,a="mobile"===t;return(0,b.jsxs)(b.Fragment,{children:[n&&(0,b.jsx)(J,{...e}),a&&(0,b.jsx)(te,{...e})]})}const ae={expandButton:"expandButton_SZY_",expandButtonIcon:"expandButtonIcon_CMLm"};function oe(e){let{toggleSidebar:t}=e;return(0,b.jsx)("div",{className:ae.expandButton,title:(0,r.T)({id:"theme.docs.sidebar.expandButtonTitle",message:"Expand sidebar",description:"The ARIA label and title attribute for expand button of doc sidebar"}),"aria-label":(0,r.T)({id:"theme.docs.sidebar.expandButtonAriaLabel",message:"Expand sidebar",description:"The ARIA label and title attribute for expand button of doc sidebar"}),tabIndex:0,role:"button",onKeyDown:t,onClick:t,children:(0,b.jsx)(_,{className:ae.expandButtonIcon})})}const ie={docSidebarContainer:"docSidebarContainer_e5ai",docSidebarContainerHidden:"docSidebarContainerHidden_vqQo",sidebarViewport:"sidebarViewport_N8x0"};function se(e){let{children:t}=e;const n=(0,c.t)();return(0,b.jsx)(a.Fragment,{children:t},n?.name??"noSidebar")}function le(e){let{sidebar:t,hiddenSidebarContainer:n,setHiddenSidebarContainer:i}=e;const{pathname:l}=(0,x.zy)(),[c,r]=(0,a.useState)(!1),d=(0,a.useCallback)((()=>{c&&r(!1),!c&&(0,p.O)()&&r(!0),i((e=>!e))}),[i,c]);return(0,b.jsx)("aside",{className:(0,o.A)(s.G.docs.docSidebarContainer,ie.docSidebarContainer,n&&ie.docSidebarContainerHidden),onTransitionEnd:e=>{e.currentTarget.classList.contains(ie.docSidebarContainer)&&n&&r(!0)},children:(0,b.jsx)(se,{children:(0,b.jsxs)("div",{className:(0,o.A)(ie.sidebarViewport,c&&ie.sidebarViewportHidden),children:[(0,b.jsx)(ne,{sidebar:t,path:l,onCollapse:d,isHidden:c}),c&&(0,b.jsx)(oe,{toggleSidebar:d})]})})})}const ce={docMainContainer:"docMainContainer_namt",docMainContainerEnhanced:"docMainContainerEnhanced_sRjM",docItemWrapperEnhanced:"docItemWrapperEnhanced_TX_6"};function re(e){let{hiddenSidebarContainer:t,children:n}=e;const a=(0,c.t)();return(0,b.jsx)("main",{className:(0,o.A)(ce.docMainContainer,(t||!a)&&ce.docMainContainerEnhanced),children:(0,b.jsx)("div",{className:(0,o.A)("container padding-top--md padding-bottom--lg",ce.docItemWrapper,t&&ce.docItemWrapperEnhanced),children:n})})}const de={docRoot:"docRoot_HciC",docsWrapper:"docsWrapper_XLvK"};function ue(e){let{children:t}=e;const n=(0,c.t)(),[o,i]=(0,a.useState)(!1);return(0,b.jsxs)("div",{className:de.docsWrapper,children:[(0,b.jsx)(h,{}),(0,b.jsxs)("div",{className:de.docRoot,children:[n&&(0,b.jsx)(le,{sidebar:n.items,hiddenSidebarContainer:o,setHiddenSidebarContainer:i}),(0,b.jsx)(re,{hiddenSidebarContainer:o,children:t})]})]})}var me=n(2757);function be(e){const t=(0,l.B5)(e);if(!t)return(0,b.jsx)(me.A,{});const{docElement:n,sidebarName:a,sidebarItems:r}=t;return(0,b.jsx)(i.e3,{className:(0,o.A)(s.G.page.docsDocPage),children:(0,b.jsx)(c.V,{name:a,items:r,children:(0,b.jsx)(ue,{children:n})})})}},2757:(e,t,n)=>{n.d(t,{A:()=>l});n(4041);var a=n(4357),o=n(9082),i=n(4775),s=n(1085);function l(e){let{className:t}=e;return(0,s.jsx)("main",{className:(0,a.A)("container margin-vert--xl",t),children:(0,s.jsx)("div",{className:"row",children:(0,s.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,s.jsx)(i.A,{as:"h1",className:"hero__title",children:(0,s.jsx)(o.A,{id:"theme.NotFound.title",description:"The title of the 404 page",children:"Page Not Found"})}),(0,s.jsx)("p",{children:(0,s.jsx)(o.A,{id:"theme.NotFound.p1",description:"The first paragraph of the 404 page",children:"We could not find what you were looking for."})}),(0,s.jsx)("p",{children:(0,s.jsx)(o.A,{id:"theme.NotFound.p2",description:"The 2nd paragraph of the 404 page",children:"Please contact the owner of the site that linked you to the original URL and let them know their link is broken."})})]})})})}}}]);
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([[7209],{4236:(e,t,n)=>{n.r(t),n.d(t,{default:()=>be});var a=n(4041),o=n(4357),i=n(145),s=n(7473),l=n(3348),c=n(5487),r=n(9082),d=n(1034),u=n(9404);const m={backToTopButton:"backToTopButton_z1FD",backToTopButtonShow:"backToTopButtonShow_w1wE"};var b=n(1085);function h(){const{shown:e,scrollToTop:t}=function(e){let{threshold:t}=e;const[n,o]=(0,a.useState)(!1),i=(0,a.useRef)(!1),{startScroll:s,cancelScroll:l}=(0,d.gk)();return(0,d.Mq)(((e,n)=>{let{scrollY:a}=e;const s=n?.scrollY;s&&(i.current?i.current=!1:a>=s?(l(),o(!1)):a<t?o(!1):a+window.innerHeight<document.documentElement.scrollHeight&&o(!0))})),(0,u.$)((e=>{e.location.hash&&(i.current=!0,o(!1))})),{shown:n,scrollToTop:()=>s(0)}}({threshold:300});return(0,b.jsx)("button",{"aria-label":(0,r.T)({id:"theme.BackToTopButton.buttonAriaLabel",message:"Scroll back to top",description:"The ARIA label for the back to top button"}),className:(0,o.A)("clean-btn",s.G.common.backToTopButton,m.backToTopButton,e&&m.backToTopButtonShow),type:"button",onClick:t})}var p=n(2631),x=n(6090),f=n(1187),j=n(2520),v=n(1631);function _(e){return(0,b.jsx)("svg",{width:"20",height:"20","aria-hidden":"true",...e,children:(0,b.jsxs)("g",{fill:"#7a7a7a",children:[(0,b.jsx)("path",{d:"M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"}),(0,b.jsx)("path",{d:"M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"})]})})}const g={collapseSidebarButton:"collapseSidebarButton_Ftvb",collapseSidebarButtonIcon:"collapseSidebarButtonIcon_c4WT"};function C(e){let{onClick:t}=e;return(0,b.jsx)("button",{type:"button",title:(0,r.T)({id:"theme.docs.sidebar.collapseButtonTitle",message:"Collapse sidebar",description:"The title attribute for collapse button of doc sidebar"}),"aria-label":(0,r.T)({id:"theme.docs.sidebar.collapseButtonAriaLabel",message:"Collapse sidebar",description:"The title attribute for collapse button of doc sidebar"}),className:(0,o.A)("button button--secondary button--outline",g.collapseSidebarButton),onClick:t,children:(0,b.jsx)(_,{className:g.collapseSidebarButtonIcon})})}var A=n(9303),S=n(1786);const k=Symbol("EmptyContext"),T=a.createContext(k);function N(e){let{children:t}=e;const[n,o]=(0,a.useState)(null),i=(0,a.useMemo)((()=>({expandedItem:n,setExpandedItem:o})),[n]);return(0,b.jsx)(T.Provider,{value:i,children:t})}var I=n(6476),B=n(4271),y=n(2436),w=n(213);function L(e){let{collapsed:t,categoryLabel:n,onClick:a}=e;return(0,b.jsx)("button",{"aria-label":t?(0,r.T)({id:"theme.DocSidebarItem.expandCategoryAriaLabel",message:"Expand sidebar category '{label}'",description:"The ARIA label to expand the sidebar category"},{label:n}):(0,r.T)({id:"theme.DocSidebarItem.collapseCategoryAriaLabel",message:"Collapse sidebar category '{label}'",description:"The ARIA label to collapse the sidebar category"},{label:n}),"aria-expanded":!t,type:"button",className:"clean-btn menu__caret",onClick:a})}function E(e){let{item:t,onItemClick:n,activePath:i,level:c,index:r,...d}=e;const{items:u,label:m,collapsible:h,className:p,href:x}=t,{docs:{sidebar:{autoCollapseCategories:f}}}=(0,j.p)(),v=function(e){const t=(0,w.A)();return(0,a.useMemo)((()=>e.href&&!e.linkUnlisted?e.href:!t&&e.collapsible?(0,l.Nr)(e):void 0),[e,t])}(t),_=(0,l.w8)(t,i),g=(0,B.ys)(x,i),{collapsed:C,setCollapsed:A}=(0,I.u)({initialState:()=>!!h&&(!_&&t.collapsed)}),{expandedItem:N,setExpandedItem:E}=function(){const e=(0,a.useContext)(T);if(e===k)throw new S.dV("DocSidebarItemsExpandedStateProvider");return e}(),M=function(e){void 0===e&&(e=!C),E(e?null:r),A(e)};return function(e){let{isActive:t,collapsed:n,updateCollapsed:o}=e;const i=(0,S.ZC)(t);(0,a.useEffect)((()=>{t&&!i&&n&&o(!1)}),[t,i,n,o])}({isActive:_,collapsed:C,updateCollapsed:M}),(0,a.useEffect)((()=>{h&&null!=N&&N!==r&&f&&A(!0)}),[h,N,r,A,f]),(0,b.jsxs)("li",{className:(0,o.A)(s.G.docs.docSidebarItemCategory,s.G.docs.docSidebarItemCategoryLevel(c),"menu__list-item",{"menu__list-item--collapsed":C},p),children:[(0,b.jsxs)("div",{className:(0,o.A)("menu__list-item-collapsible",{"menu__list-item-collapsible--active":g}),children:[(0,b.jsx)(y.A,{className:(0,o.A)("menu__link",{"menu__link--sublist":h,"menu__link--sublist-caret":!x&&h,"menu__link--active":_}),onClick:h?e=>{n?.(t),x?M(!1):(e.preventDefault(),M())}:()=>{n?.(t)},"aria-current":g?"page":void 0,role:h&&!x?"button":void 0,"aria-expanded":h&&!x?!C:void 0,href:h?v??"#":v,...d,children:m}),x&&h&&(0,b.jsx)(L,{collapsed:C,categoryLabel:m,onClick:e=>{e.preventDefault(),M()}})]}),(0,b.jsx)(I.N,{lazy:!0,as:"ul",className:"menu__list",collapsed:C,children:(0,b.jsx)(V,{items:u,tabIndex:C?-1:0,onItemClick:n,activePath:i,level:c+1})})]})}var M=n(5436),H=n(7545);const R={menuExternalLink:"menuExternalLink_xK2O"};function W(e){let{item:t,onItemClick:n,activePath:a,level:i,index:c,...r}=e;const{href:d,label:u,className:m,autoAddBaseUrl:h}=t,p=(0,l.w8)(t,a),x=(0,M.A)(d);return(0,b.jsx)("li",{className:(0,o.A)(s.G.docs.docSidebarItemLink,s.G.docs.docSidebarItemLinkLevel(i),"menu__list-item",m),children:(0,b.jsxs)(y.A,{className:(0,o.A)("menu__link",!x&&R.menuExternalLink,{"menu__link--active":p}),autoAddBaseUrl:h,"aria-current":p?"page":void 0,to:d,...x&&{onClick:n?()=>n(t):void 0},...r,children:[u,!x&&(0,b.jsx)(H.A,{})]})},u)}const G={menuHtmlItem:"menuHtmlItem_anEq"};function P(e){let{item:t,level:n,index:a}=e;const{value:i,defaultStyle:l,className:c}=t;return(0,b.jsx)("li",{className:(0,o.A)(s.G.docs.docSidebarItemLink,s.G.docs.docSidebarItemLinkLevel(n),l&&[G.menuHtmlItem,"menu__list-item"],c),dangerouslySetInnerHTML:{__html:i}},a)}function D(e){let{item:t,...n}=e;switch(t.type){case"category":return(0,b.jsx)(E,{item:t,...n});case"html":return(0,b.jsx)(P,{item:t,...n});default:return(0,b.jsx)(W,{item:t,...n})}}function F(e){let{items:t,...n}=e;const a=(0,l.Y)(t,n.activePath);return(0,b.jsx)(N,{children:a.map(((e,t)=>(0,b.jsx)(D,{item:e,index:t,...n},t)))})}const V=(0,a.memo)(F),q={menu:"menu_qiME",menuWithAnnouncementBar:"menuWithAnnouncementBar_hRfJ"};function z(e){let{path:t,sidebar:n,className:i}=e;const l=function(){const{isActive:e}=(0,A.M)(),[t,n]=(0,a.useState)(e);return(0,d.Mq)((t=>{let{scrollY:a}=t;e&&n(0===a)}),[e]),e&&t}();return(0,b.jsx)("nav",{"aria-label":(0,r.T)({id:"theme.docs.sidebar.navAriaLabel",message:"Docs sidebar",description:"The ARIA label for the sidebar navigation"}),className:(0,o.A)("menu thin-scrollbar",q.menu,l&&q.menuWithAnnouncementBar,i),children:(0,b.jsx)("ul",{className:(0,o.A)(s.G.docs.docSidebarMenu,"menu__list"),children:(0,b.jsx)(V,{items:n,activePath:t,level:1})})})}const Y="sidebar_vJCc",K="sidebarWithHideableNavbar_Fo4g",U="sidebarHidden_vBKa",O="sidebarLogo_nlll";function X(e){let{path:t,sidebar:n,onCollapse:a,isHidden:i}=e;const{navbar:{hideOnScroll:s},docs:{sidebar:{hideable:l}}}=(0,j.p)();return(0,b.jsxs)("div",{className:(0,o.A)(Y,s&&K,i&&U),children:[s&&(0,b.jsx)(v.A,{tabIndex:-1,className:O}),(0,b.jsx)(z,{path:t,sidebar:n}),l&&(0,b.jsx)(C,{onClick:a})]})}const J=a.memo(X);var Z=n(7226),Q=n(2106);const $=e=>{let{sidebar:t,path:n}=e;const a=(0,Q.M)();return(0,b.jsx)("ul",{className:(0,o.A)(s.G.docs.docSidebarMenu,"menu__list"),children:(0,b.jsx)(V,{items:t,activePath:n,onItemClick:e=>{"category"===e.type&&e.href&&a.toggle(),"link"===e.type&&a.toggle()},level:1})})};function ee(e){return(0,b.jsx)(Z.GX,{component:$,props:e})}const te=a.memo(ee);function ne(e){const t=(0,f.l)(),n="desktop"===t||"ssr"===t,a="mobile"===t;return(0,b.jsxs)(b.Fragment,{children:[n&&(0,b.jsx)(J,{...e}),a&&(0,b.jsx)(te,{...e})]})}const ae={expandButton:"expandButton_SZY_",expandButtonIcon:"expandButtonIcon_CMLm"};function oe(e){let{toggleSidebar:t}=e;return(0,b.jsx)("div",{className:ae.expandButton,title:(0,r.T)({id:"theme.docs.sidebar.expandButtonTitle",message:"Expand sidebar",description:"The ARIA label and title attribute for expand button of doc sidebar"}),"aria-label":(0,r.T)({id:"theme.docs.sidebar.expandButtonAriaLabel",message:"Expand sidebar",description:"The ARIA label and title attribute for expand button of doc sidebar"}),tabIndex:0,role:"button",onKeyDown:t,onClick:t,children:(0,b.jsx)(_,{className:ae.expandButtonIcon})})}const ie={docSidebarContainer:"docSidebarContainer_e5ai",docSidebarContainerHidden:"docSidebarContainerHidden_vqQo",sidebarViewport:"sidebarViewport_N8x0"};function se(e){let{children:t}=e;const n=(0,c.t)();return(0,b.jsx)(a.Fragment,{children:t},n?.name??"noSidebar")}function le(e){let{sidebar:t,hiddenSidebarContainer:n,setHiddenSidebarContainer:i}=e;const{pathname:l}=(0,x.zy)(),[c,r]=(0,a.useState)(!1),d=(0,a.useCallback)((()=>{c&&r(!1),!c&&(0,p.O)()&&r(!0),i((e=>!e))}),[i,c]);return(0,b.jsx)("aside",{className:(0,o.A)(s.G.docs.docSidebarContainer,ie.docSidebarContainer,n&&ie.docSidebarContainerHidden),onTransitionEnd:e=>{e.currentTarget.classList.contains(ie.docSidebarContainer)&&n&&r(!0)},children:(0,b.jsx)(se,{children:(0,b.jsxs)("div",{className:(0,o.A)(ie.sidebarViewport,c&&ie.sidebarViewportHidden),children:[(0,b.jsx)(ne,{sidebar:t,path:l,onCollapse:d,isHidden:c}),c&&(0,b.jsx)(oe,{toggleSidebar:d})]})})})}const ce={docMainContainer:"docMainContainer_namt",docMainContainerEnhanced:"docMainContainerEnhanced_sRjM",docItemWrapperEnhanced:"docItemWrapperEnhanced_TX_6"};function re(e){let{hiddenSidebarContainer:t,children:n}=e;const a=(0,c.t)();return(0,b.jsx)("main",{className:(0,o.A)(ce.docMainContainer,(t||!a)&&ce.docMainContainerEnhanced),children:(0,b.jsx)("div",{className:(0,o.A)("container padding-top--md padding-bottom--lg",ce.docItemWrapper,t&&ce.docItemWrapperEnhanced),children:n})})}const de={docRoot:"docRoot_HciC",docsWrapper:"docsWrapper_XLvK"};function ue(e){let{children:t}=e;const n=(0,c.t)(),[o,i]=(0,a.useState)(!1);return(0,b.jsxs)("div",{className:de.docsWrapper,children:[(0,b.jsx)(h,{}),(0,b.jsxs)("div",{className:de.docRoot,children:[n&&(0,b.jsx)(le,{sidebar:n.items,hiddenSidebarContainer:o,setHiddenSidebarContainer:i}),(0,b.jsx)(re,{hiddenSidebarContainer:o,children:t})]})]})}var me=n(2757);function be(e){const t=(0,l.B5)(e);if(!t)return(0,b.jsx)(me.A,{});const{docElement:n,sidebarName:a,sidebarItems:r}=t;return(0,b.jsx)(i.e3,{className:(0,o.A)(s.G.page.docsDocPage),children:(0,b.jsx)(c.V,{name:a,items:r,children:(0,b.jsx)(ue,{children:n})})})}},2757:(e,t,n)=>{n.d(t,{A:()=>l});n(4041);var a=n(4357),o=n(9082),i=n(4775),s=n(1085);function l(e){let{className:t}=e;return(0,s.jsx)("main",{className:(0,a.A)("container margin-vert--xl",t),children:(0,s.jsx)("div",{className:"row",children:(0,s.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,s.jsx)(i.A,{as:"h1",className:"hero__title",children:(0,s.jsx)(o.A,{id:"theme.NotFound.title",description:"The title of the 404 page",children:"Page Not Found"})}),(0,s.jsx)("p",{children:(0,s.jsx)(o.A,{id:"theme.NotFound.p1",description:"The first paragraph of the 404 page",children:"We could not find what you were looking for."})}),(0,s.jsx)("p",{children:(0,s.jsx)(o.A,{id:"theme.NotFound.p2",description:"The 2nd paragraph of the 404 page",children:"Please contact the owner of the site that linked you to the original URL and let them know their link is broken."})})]})})})}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([[1392],{5528:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>r,default:()=>h,frontMatter:()=>a,metadata:()=>o,toc:()=>d});var i=t(1085),s=t(1184);const a={sidebar_position:1,title:"File Format"},r=void 0,o={id:"configuration/format",title:"File Format",description:"COSMOS configuration files are just text files. They can (and should) be checked into your configuration management system and thus can be easily diffed throughout their history. They support ERB syntax, partials, and various line continuations which make them extremely flexible.",source:"@site/docs/configuration/format.md",sourceDirName:"configuration",slug:"/configuration/format",permalink:"/tools/staticdocs/docs/configuration/format",draft:!1,unlisted:!1,editUrl:"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/configuration/format.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,title:"File Format"},sidebar:"defaultSidebar",previous:{title:"Configuration",permalink:"/tools/staticdocs/docs/configuration"},next:{title:"Plugins",permalink:"/tools/staticdocs/docs/configuration/plugins"}},l={},d=[{value:"Keyword / Parameters",id:"keyword--parameters",level:2},{value:"ERB",id:"erb",level:2},{value:"render",id:"render",level:3},{value:"Line Continuation",id:"line-continuation",level:2},{value:"String Concatenation",id:"string-concatenation",level:2}];function c(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.p,{children:"COSMOS configuration files are just text files. They can (and should) be checked into your configuration management system and thus can be easily diffed throughout their history. They support ERB syntax, partials, and various line continuations which make them extremely flexible."}),"\n",(0,i.jsx)(n.h2,{id:"keyword--parameters",children:"Keyword / Parameters"}),"\n",(0,i.jsx)(n.p,{children:"Each line of a COSMOS configuration file contains a single keyword followed by parameters. For example:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ruby",children:'COMMAND TARGET COLLECT BIG_ENDIAN "Collect command"\n'})}),"\n",(0,i.jsxs)(n.p,{children:["The keyword is ",(0,i.jsx)(n.code,{children:"COMMAND"})," and the parameters are ",(0,i.jsx)(n.code,{children:"TARGET"}),", ",(0,i.jsx)(n.code,{children:"COLLECT"}),", ",(0,i.jsx)(n.code,{children:"BIG_ENDIAN"}),", and ",(0,i.jsx)(n.code,{children:'"Collect command"'}),". Keywords are parsed by COSMOS and parameters are checked for validity. Parameters can be required or optional although required parameters always come first. Some parameters have a limited set of valid values. For example, the ",(0,i.jsx)(n.code,{children:"COMMAND"})," keyword above has the following documentation:"]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"PARAMETER"}),(0,i.jsx)(n.th,{children:"DESCRIPTION"}),(0,i.jsx)(n.th,{children:"REQUIRED"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Target"}),(0,i.jsx)(n.td,{children:"Name of the target this command is associated with"}),(0,i.jsx)(n.td,{children:"True"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Command"}),(0,i.jsx)(n.td,{children:"Name of this command. Also referred to as its mnemonic. Must be unique to commands to this target. Ideally will be as short and clear as possible."}),(0,i.jsx)(n.td,{children:"True"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Endianness"}),(0,i.jsxs)(n.td,{children:["Indicates if the data in this command is to be sent in Big Endian or Little Endian format",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Valid Values: ",(0,i.jsx)(n.code,{children:"BIG_ENDIAN, LITTLE_ENDIAN"})]}),(0,i.jsx)(n.td,{children:"True"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Description"}),(0,i.jsx)(n.td,{children:"Description of this command which must be enclosed with quotes"}),(0,i.jsx)(n.td,{children:"False"})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["The Target and Command parameters can be any string and are required. The Endianness parameter is required and must be ",(0,i.jsx)(n.code,{children:"BIG_ENDIAN"})," or ",(0,i.jsx)(n.code,{children:"LITTLE_ENDIAN"}),". Other values will cause an error when parsed. The Description parameter must be enclosed in quotes and is optional. All the COSMOS configuration files document their keyword and parameters in this fashion. In addition, Example Usage is provided similar to the example given above."]}),"\n",(0,i.jsx)(n.h2,{id:"erb",children:"ERB"}),"\n",(0,i.jsxs)(n.p,{children:["ERB stands for Embedded Ruby. ",(0,i.jsx)(n.a,{href:"https://github.com/ruby/erb",children:"ERB"})," is a templating system for Ruby which allows you to use Ruby logic and variables to generate text files. There are two basic forms of ERB:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-erb",children:"<% Ruby code -- no output %>\n<%= Ruby expression -- insert result %>\n"})}),"\n",(0,i.jsxs)(n.p,{children:["In a COSMOS ",(0,i.jsx)(n.a,{href:"/tools/staticdocs/docs/configuration/telemetry",children:"Telemetry"})," configuration file we could write the following:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-erb",children:'<% (1..5).each do |i| %>\n APPEND_ITEM VALUE<%= i %> 16 UINT "Value <%= i %> setting"\n<% end %>\n'})}),"\n",(0,i.jsxs)(n.p,{children:["The first line is Ruby code which iterates from 1 up to and including 5 and places the value in the variable i. The code inside the block will be output to the file every time the iteration runs. The APPEND_ITEM line uses the value of i and directly outputs it to the file by using the ",(0,i.jsx)(n.code,{children:"<%="})," syntax. The result of the parsing will look like the following:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ruby",children:'APPEND_ITEM VALUE1 16 UINT "Value 1 setting"\nAPPEND_ITEM VALUE2 16 UINT "Value 2 setting"\nAPPEND_ITEM VALUE3 16 UINT "Value 3 setting"\nAPPEND_ITEM VALUE4 16 UINT "Value 4 setting"\nAPPEND_ITEM VALUE5 16 UINT "Value 5 setting"\n'})}),"\n",(0,i.jsxs)(n.p,{children:["COSMOS uses ERB syntax extensively in a Plugin's ",(0,i.jsx)(n.a,{href:"/tools/staticdocs/docs/configuration/plugins#plugintxt-configuration-file",children:"plugin.txt"})," configuration file."]}),"\n",(0,i.jsx)(n.h3,{id:"render",children:"render"}),"\n",(0,i.jsxs)(n.p,{children:["COSMOS provides a method used inside ERB called ",(0,i.jsx)(n.code,{children:"render"})," which renders a configuration file into another configuration file. For example:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ruby",children:'TELEMETRY INST HEALTH_STATUS BIG_ENDIAN "Health and status"\n <%= render "_ccsds_apid.txt", locals: {apid: 1} %>\n APPEND_ITEM COLLECTS 16 UINT "Number of collects"\n ...\n'})}),"\n",(0,i.jsx)(n.p,{children:"The render method takes a parameter which is the name of the configuration file to inject into the top level file. This file is required to start with underscore to avoid being processed as a regular configuration file. This file is called a partial since it's part of a larger file. For example, _ccsds_apid.txt is defined as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ruby",children:' APPEND_ID_ITEM CCSDSAPID 11 UINT <%= apid %> "CCSDS application process id"\n'})}),"\n",(0,i.jsx)(n.p,{children:"This would result in output as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ruby",children:'TELEMETRY INST HEALTH_STATUS BIG_ENDIAN "Health and status"\n APPEND_ID_ITEM CCSDSAPID 11 UINT 1 "CCSDS application process id"\n APPEND_ITEM COLLECTS 16 UINT "Number of collects"\n ...\n'})}),"\n",(0,i.jsxs)(n.p,{children:["Note the variable ",(0,i.jsx)(n.code,{children:"apid"})," was set to 1 using the ",(0,i.jsx)(n.code,{children:"locals:"})," syntax. This is a very powerful way to add common headers and footer to every packet definition. See the INST target's cmd_tlm definitions in the ",(0,i.jsx)(n.a,{href:"https://github.com/OpenC3/cosmos/tree/main/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/targets/INST/cmd_tlm",children:"Demo"})," for a more comprehensive example."]}),"\n",(0,i.jsx)(n.h2,{id:"line-continuation",children:"Line Continuation"}),"\n",(0,i.jsxs)(n.p,{children:["COSMOS supports a line continuation character in configuration files. For a simple line continuation use the ampersand character: ",(0,i.jsx)(n.code,{children:"&"}),". For example:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ruby",children:'TELEMETRY INST HEALTH_STATUS BIG_ENDIAN &\n "Health and status"\n'})}),"\n",(0,i.jsx)(n.p,{children:"This will strip the ampersand character and merge the two lines to result in:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ruby",children:'TELEMETRY INST HEALTH_STATUS BIG_ENDIAN "Health and status"\n'})}),"\n",(0,i.jsx)(n.p,{children:"Spaces around the second line are stripped so indentation does not matter."}),"\n",(0,i.jsx)(n.h2,{id:"string-concatenation",children:"String Concatenation"}),"\n",(0,i.jsxs)(n.p,{children:["COSMOS supports two different string concatenation characters in configuration files. To concatenate strings with a newline use the plus character: ",(0,i.jsx)(n.code,{children:"+"}),". For example:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ruby",children:'TELEMETRY INST HEALTH_STATUS BIG_ENDIAN "Health and status" +\n "Additional description"\n'})}),"\n",(0,i.jsx)(n.p,{children:"The strings will be merged with a newline to result in:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ruby",children:'TELEMETRY INST HEALTH_STATUS BIG_ENDIAN "Health and status\\nAdditional description"\n'})}),"\n",(0,i.jsxs)(n.p,{children:["To concatenate strings without a newline use the backslash character: ",(0,i.jsx)(n.code,{children:"\\"}),". For example:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ruby",children:"TELEMETRY INST HEALTH_STATUS BIG_ENDIAN 'Health and status' \\\n 'Additional description'\n"})}),"\n",(0,i.jsx)(n.p,{children:"The strings will be merged without a newline to result in:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ruby",children:"TELEMETRY INST HEALTH_STATUS BIG_ENDIAN 'Health and statusAdditional description'\n"})}),"\n",(0,i.jsx)(n.p,{children:"The string continuation characters work with both single or double quoted strings but note that both lines MUST use the same syntax. You can not concatenate a single quoted string with a double quoted string or vice versa. Also note the indentation of the second line does not matter as whitespace is stripped."})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},1184:(e,n,t)=>{t.d(n,{R:()=>r});var i=t(4041);const s={},a=i.createContext(s);function r(e){const n=i.useContext(a);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}}}]);
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([[1392],{5528:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>r,default:()=>h,frontMatter:()=>a,metadata:()=>o,toc:()=>d});var i=t(1085),s=t(1184);const a={sidebar_position:1,title:"File Format"},r=void 0,o={id:"configuration/format",title:"File Format",description:"COSMOS configuration files are just text files. They can (and should) be checked into your configuration management system and thus can be easily diffed throughout their history. They support ERB syntax, partials, and various line continuations which make them extremely flexible.",source:"@site/docs/configuration/format.md",sourceDirName:"configuration",slug:"/configuration/format",permalink:"/tools/staticdocs/docs/configuration/format",draft:!1,unlisted:!1,editUrl:"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/configuration/format.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,title:"File Format"},sidebar:"defaultSidebar",previous:{title:"Configuration",permalink:"/tools/staticdocs/docs/configuration"},next:{title:"Plugins",permalink:"/tools/staticdocs/docs/configuration/plugins"}},l={},d=[{value:"Keyword / Parameters",id:"keyword--parameters",level:2},{value:"ERB",id:"erb",level:2},{value:"render",id:"render",level:3},{value:"Line Continuation",id:"line-continuation",level:2},{value:"String Concatenation",id:"string-concatenation",level:2}];function c(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.p,{children:"COSMOS configuration files are just text files. They can (and should) be checked into your configuration management system and thus can be easily diffed throughout their history. They support ERB syntax, partials, and various line continuations which make them extremely flexible."}),"\n",(0,i.jsx)(n.h2,{id:"keyword--parameters",children:"Keyword / Parameters"}),"\n",(0,i.jsx)(n.p,{children:"Each line of a COSMOS configuration file contains a single keyword followed by parameters. For example:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ruby",children:'COMMAND TARGET COLLECT BIG_ENDIAN "Collect command"\n'})}),"\n",(0,i.jsxs)(n.p,{children:["The keyword is ",(0,i.jsx)(n.code,{children:"COMMAND"})," and the parameters are ",(0,i.jsx)(n.code,{children:"TARGET"}),", ",(0,i.jsx)(n.code,{children:"COLLECT"}),", ",(0,i.jsx)(n.code,{children:"BIG_ENDIAN"}),", and ",(0,i.jsx)(n.code,{children:'"Collect command"'}),". Keywords are parsed by COSMOS and parameters are checked for validity. Parameters can be required or optional although required parameters always come first. Some parameters have a limited set of valid values. For example, the ",(0,i.jsx)(n.code,{children:"COMMAND"})," keyword above has the following documentation:"]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"PARAMETER"}),(0,i.jsx)(n.th,{children:"DESCRIPTION"}),(0,i.jsx)(n.th,{children:"REQUIRED"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Target"}),(0,i.jsx)(n.td,{children:"Name of the target this command is associated with"}),(0,i.jsx)(n.td,{children:"True"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Command"}),(0,i.jsx)(n.td,{children:"Name of this command. Also referred to as its mnemonic. Must be unique to commands to this target. Ideally will be as short and clear as possible."}),(0,i.jsx)(n.td,{children:"True"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Endianness"}),(0,i.jsxs)(n.td,{children:["Indicates if the data in this command is to be sent in Big Endian or Little Endian format",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Valid Values: ",(0,i.jsx)(n.code,{children:"BIG_ENDIAN, LITTLE_ENDIAN"})]}),(0,i.jsx)(n.td,{children:"True"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Description"}),(0,i.jsx)(n.td,{children:"Description of this command which must be enclosed with quotes"}),(0,i.jsx)(n.td,{children:"False"})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["The Target and Command parameters can be any string and are required. The Endianness parameter is required and must be ",(0,i.jsx)(n.code,{children:"BIG_ENDIAN"})," or ",(0,i.jsx)(n.code,{children:"LITTLE_ENDIAN"}),". Other values will cause an error when parsed. The Description parameter must be enclosed in quotes and is optional. All the COSMOS configuration files document their keyword and parameters in this fashion. In addition, Example Usage is provided similar to the example given above."]}),"\n",(0,i.jsx)(n.h2,{id:"erb",children:"ERB"}),"\n",(0,i.jsxs)(n.p,{children:["ERB stands for Embedded Ruby. ",(0,i.jsx)(n.a,{href:"https://github.com/ruby/erb",children:"ERB"})," is a templating system for Ruby which allows you to use Ruby logic and variables to generate text files. There are two basic forms of ERB:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-erb",children:"<% Ruby code -- no output %>\n<%= Ruby expression -- insert result %>\n"})}),"\n",(0,i.jsxs)(n.p,{children:["In a COSMOS ",(0,i.jsx)(n.a,{href:"/tools/staticdocs/docs/configuration/telemetry",children:"Telemetry"})," configuration file we could write the following:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-erb",children:'<% (1..5).each do |i| %>\n APPEND_ITEM VALUE<%= i %> 16 UINT "Value <%= i %> setting"\n<% end %>\n'})}),"\n",(0,i.jsxs)(n.p,{children:["The first line is Ruby code which iterates from 1 up to and including 5 and places the value in the variable i. The code inside the block will be output to the file every time the iteration runs. The APPEND_ITEM line uses the value of i and directly outputs it to the file by using the ",(0,i.jsx)(n.code,{children:"<%="})," syntax. The result of the parsing will look like the following:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ruby",children:'APPEND_ITEM VALUE1 16 UINT "Value 1 setting"\nAPPEND_ITEM VALUE2 16 UINT "Value 2 setting"\nAPPEND_ITEM VALUE3 16 UINT "Value 3 setting"\nAPPEND_ITEM VALUE4 16 UINT "Value 4 setting"\nAPPEND_ITEM VALUE5 16 UINT "Value 5 setting"\n'})}),"\n",(0,i.jsxs)(n.p,{children:["COSMOS uses ERB syntax extensively in a Plugin's ",(0,i.jsx)(n.a,{href:"/tools/staticdocs/docs/configuration/plugins#plugintxt-configuration-file",children:"plugin.txt"})," configuration file."]}),"\n",(0,i.jsx)(n.h3,{id:"render",children:"render"}),"\n",(0,i.jsxs)(n.p,{children:["COSMOS provides a method used inside ERB called ",(0,i.jsx)(n.code,{children:"render"})," which renders a configuration file into another configuration file. For example:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ruby",children:'TELEMETRY INST HEALTH_STATUS BIG_ENDIAN "Health and status"\n <%= render "_ccsds_apid.txt", locals: {apid: 1} %>\n APPEND_ITEM COLLECTS 16 UINT "Number of collects"\n ...\n'})}),"\n",(0,i.jsx)(n.p,{children:"The render method takes a parameter which is the name of the configuration file to inject into the top level file. This file is required to start with underscore to avoid being processed as a regular configuration file. This file is called a partial since it's part of a larger file. For example, _ccsds_apid.txt is defined as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ruby",children:' APPEND_ID_ITEM CCSDSAPID 11 UINT <%= apid %> "CCSDS application process id"\n'})}),"\n",(0,i.jsx)(n.p,{children:"This would result in output as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ruby",children:'TELEMETRY INST HEALTH_STATUS BIG_ENDIAN "Health and status"\n APPEND_ID_ITEM CCSDSAPID 11 UINT 1 "CCSDS application process id"\n APPEND_ITEM COLLECTS 16 UINT "Number of collects"\n ...\n'})}),"\n",(0,i.jsxs)(n.p,{children:["Note the variable ",(0,i.jsx)(n.code,{children:"apid"})," was set to 1 using the ",(0,i.jsx)(n.code,{children:"locals:"})," syntax. This is a very powerful way to add common headers and footer to every packet definition. See the INST target's cmd_tlm definitions in the ",(0,i.jsx)(n.a,{href:"https://github.com/OpenC3/cosmos/tree/main/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/targets/INST/cmd_tlm",children:"Demo"})," for a more comprehensive example."]}),"\n",(0,i.jsx)(n.h2,{id:"line-continuation",children:"Line Continuation"}),"\n",(0,i.jsxs)(n.p,{children:["COSMOS supports a line continuation character in configuration files. For a simple line continuation use the ampersand character: ",(0,i.jsx)(n.code,{children:"&"}),". For example:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ruby",children:'TELEMETRY INST HEALTH_STATUS BIG_ENDIAN &\n "Health and status"\n'})}),"\n",(0,i.jsx)(n.p,{children:"This will strip the ampersand character and merge the two lines to result in:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ruby",children:'TELEMETRY INST HEALTH_STATUS BIG_ENDIAN "Health and status"\n'})}),"\n",(0,i.jsx)(n.p,{children:"Spaces around the second line are stripped so indentation does not matter."}),"\n",(0,i.jsx)(n.h2,{id:"string-concatenation",children:"String Concatenation"}),"\n",(0,i.jsxs)(n.p,{children:["COSMOS supports two different string concatenation characters in configuration files. To concatenate strings with a newline use the plus character: ",(0,i.jsx)(n.code,{children:"+"}),". For example:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ruby",children:'TELEMETRY INST HEALTH_STATUS BIG_ENDIAN "Health and status" +\n "Additional description"\n'})}),"\n",(0,i.jsx)(n.p,{children:"The strings will be merged with a newline to result in:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ruby",children:'TELEMETRY INST HEALTH_STATUS BIG_ENDIAN "Health and status\\nAdditional description"\n'})}),"\n",(0,i.jsxs)(n.p,{children:["To concatenate strings without a newline use the backslash character: ",(0,i.jsx)(n.code,{children:"\\"}),". For example:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ruby",children:"TELEMETRY INST HEALTH_STATUS BIG_ENDIAN 'Health and status' \\\n 'Additional description'\n"})}),"\n",(0,i.jsx)(n.p,{children:"The strings will be merged without a newline to result in:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ruby",children:"TELEMETRY INST HEALTH_STATUS BIG_ENDIAN 'Health and statusAdditional description'\n"})}),"\n",(0,i.jsx)(n.p,{children:"The string continuation characters work with both single or double quoted strings but note that both lines MUST use the same syntax. You can not concatenate a single quoted string with a double quoted string or vice versa. Also note the indentation of the second line does not matter as whitespace is stripped."})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},1184:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>o});var i=t(4041);const s={},a=i.createContext(s);function r(e){const n=i.useContext(a);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(a.Provider,{value:n},e.children)}}}]);