openc3-cosmos-tool-docs 5.19.0 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (429) hide show
  1. checksums.yaml +4 -4
  2. data/tools/staticdocs/404.html +1 -13
  3. data/tools/staticdocs/assets/css/styles.839a3ee9.css +1 -0
  4. data/tools/staticdocs/assets/images/add_tool-6919be6e6c05db133a8816a9fc03bf98b0789a8525da4cdaa7b041b25bf9edb8.png +0 -0
  5. data/tools/staticdocs/assets/images/array-c0c541246cb3f9e355acc5c510649c29116ce4d6eb8864b9ace48e9958b36421.png +0 -0
  6. data/tools/staticdocs/assets/images/backcolor-39ca0e2a25bd98fe1c9e067f026f3a719a760d3f14ccb404e2da3a0af4235760.png +0 -0
  7. data/tools/staticdocs/assets/images/block-14583c7d26c1a1c6553435d57015bc5282426f7aa176804867de223009a8d4d7.png +0 -0
  8. data/tools/staticdocs/assets/images/bordercolor-a3ac15f24f91c910fcc9c8bd195232205ec44da0b428b11b71108687ce6316d3.png +0 -0
  9. data/tools/staticdocs/assets/images/button-3f6fd69518f4b2c60b15605ca607cda8b596d4d5e804b867f09f750a47b6cbad.png +0 -0
  10. data/tools/staticdocs/assets/images/canvasdot-d634bed1905d13b0da41200e62781cea6e012b5d68fc914f4c11f512c9c4f7fd.png +0 -0
  11. data/tools/staticdocs/assets/images/canvasimage-6f6f83dc6d777fdff0b820287a96ad171a475fda2896c0a3b678b14984e496fd.png +0 -0
  12. data/tools/staticdocs/assets/images/canvasimagevalue-8c835310f99cebbb15ad34632c77370cf4cc9b95535040fa4723df8baedb5b57.png +0 -0
  13. data/tools/staticdocs/assets/images/canvaslabel-68ee99da9ef15924a2b5b41c60ba7de47382d036eece57574411839ff5ec14e4.png +0 -0
  14. data/tools/staticdocs/assets/images/canvaslabelvalue-43254b6647e626939e79ec7e0940e921582039af006e5024c952881ba196b165.png +0 -0
  15. data/tools/staticdocs/assets/images/canvasline-c5120da84530d4a60a04d40d5565daede656639808d1a456f430e9404a2d5bad.png +0 -0
  16. data/tools/staticdocs/assets/images/canvaslinevalue-5540d10997f723fd09b269b75997452622a3c4333ed4f25628747c1212699255.png +0 -0
  17. data/tools/staticdocs/assets/images/checkbutton-c263b840dcdbeca5cd886884fe8f24bedac7daac5a0ca224a1fb2cce3e24bdf6.png +0 -0
  18. data/tools/staticdocs/assets/images/cmd_authority-34cde391ad5109ad53bca40b55cb74d59e8cd1d0e70eedb3e5bf4d258c324787.png +0 -0
  19. data/tools/staticdocs/assets/images/cmd_tlm_server-dbc02e99c1c837efabeba52831d1d2a3445904fb06b758aaa747496725423fe5.png +0 -0
  20. data/tools/staticdocs/assets/images/collect_states-5418d5b4cb901577f2cbdeccceb254dd2e5b81b1f2c975fb15b5fc679cf23dbf.png +0 -0
  21. data/tools/staticdocs/assets/images/combobox-6c8fa241aa7c5ccf31a42a2373dbd4f6f66d9a063e98ba111d5472b5c8e21590.png +0 -0
  22. data/tools/staticdocs/assets/images/command_history-ecc9b618661ad0aefa0700047a8ab3b094372f2aa427e9fcd270dcd352a30408.png +0 -0
  23. data/tools/staticdocs/assets/images/command_sender-83cf2e2343133c2883c405abd0b322f6d3d4a095c6ee800158a04c8eefe474ed.png +0 -0
  24. data/tools/staticdocs/assets/images/critical_cmd_sender-dd81e845489cf1efd3e08cec87da2262eb9f22dbeb3d89359edf0c58146524a1.png +0 -0
  25. data/tools/staticdocs/assets/images/date-d104f822ef7a1b99ade0a334e2e34c27fc6b1d087ed267f13280623a943113ce.png +0 -0
  26. data/tools/staticdocs/assets/images/formatvalue-8e2ddb6cec177fde1846d333d70168479a3bf67dd2b293764f938726b9e7cdf8.png +0 -0
  27. data/tools/staticdocs/assets/images/height-67268e562da2f9b2d0b9adc38d8fb2ba629504b09d798d8c26be9cfbfdad672a.png +0 -0
  28. data/tools/staticdocs/assets/images/history-04aebef1a0fdaaacc5042e5b835f850b48ea04f4fe50271d9bb57803b442d6cd.png +0 -0
  29. data/tools/staticdocs/assets/images/horizontal-11de51b6fc8baf057ca4f38a7f54a5302b58f30099331c22a074f012e53497aa.png +0 -0
  30. data/tools/staticdocs/assets/images/horizontalbox-ddf82f64de700286a742a71e0c1adebbc7e9822a0dff41139f41bc476e4fc4ce.png +0 -0
  31. data/tools/staticdocs/assets/images/horizontalline-0805762eadcc125ed6584a29a60e7cf8e2d76d13c6243e18eecbaba7a3803128.png +0 -0
  32. data/tools/staticdocs/assets/images/iframe-30d5a4104336b84d18ba538d668978a7986679431a7fe1fd0e3179fea08c074f.png +0 -0
  33. data/tools/staticdocs/assets/images/imageviewer-6149159e29a35cd6694926b344836ce034ce17cc019537028a80d95460eec405.png +0 -0
  34. data/tools/staticdocs/assets/images/inst_clear-48f37464d774363be4a5c1d30a48d4bc7803cb806a15d80dcd3741d7a9a37811.png +0 -0
  35. data/tools/staticdocs/assets/images/inst_collect-ef36e8a1e97fde625cde7a9c300c3db61aca30140f5431f089ce6a3e5da9d7f4.png +0 -0
  36. data/tools/staticdocs/assets/images/inst_collect_hazardous-02857bda2b5e7e821d3f42d3301962ede2bb4379c469a9d62f4a0e686336f0c4.png +0 -0
  37. data/tools/staticdocs/assets/images/interfaces-fa10646a27eb9045b70c2c485498a864bed1896ff171b7f31f8698288e08ae73.png +0 -0
  38. data/tools/staticdocs/assets/images/label-25a3052a497d0db7ebf84c788baedcd01d34f4b423aceee53d6d83639a128e82.png +0 -0
  39. data/tools/staticdocs/assets/images/labelled-b8d0f0a157f48e1fa98511f9177f962e69d1e0e8c24b37cf9f355671f9d13ab8.png +0 -0
  40. data/tools/staticdocs/assets/images/labelprogressbar-c3412db92b2f4e6af20233b085ee20915414d6c4da371398a3e8f36b84971cc7.png +0 -0
  41. data/tools/staticdocs/assets/images/labelsparkline-5985a0f034a5d2fb54b040612178ac9f0d5476eb76ca7e04cacc2618a9970c69.png +0 -0
  42. data/tools/staticdocs/assets/images/labelvalue-db97724272df4815b4ecc397974f91a62c31108b98ef0657716c670ca8128051.png +0 -0
  43. data/tools/staticdocs/assets/images/labelvaluedesc-2e174a9f3443ba971683dea9a33f8aa66d0248fb92a3aff41ec26b7424b5e68c.png +0 -0
  44. data/tools/staticdocs/assets/images/labelvaluelimitscolumn-47664affa9d88150ce257e90d32c61b314d7f0b6aa6da4f5e49152be2cce4ef7.png +0 -0
  45. data/tools/staticdocs/assets/images/labelvaluerangebar-641eba160b8ef7872557584de92f046d9e4411fae3280781f9b049265cc6dd52.png +0 -0
  46. data/tools/staticdocs/assets/images/led-d333a6c7e8b1bad13b7775142c74f94b1829ddedd38814d606b2d00e76707751.png +0 -0
  47. data/tools/staticdocs/assets/images/limitsbar-4f2758f846f6f8a1add81aeaf3b58e071792a6d2ccae9eb504e9c07ab8f8dae1.png +0 -0
  48. data/tools/staticdocs/assets/images/limitscolor-7f8e24e4f27f476c3b4c57393ab797268b86aa8ad8b6e7b83d72dd5bf3ca7952.png +0 -0
  49. data/tools/staticdocs/assets/images/limitscolumn-743800180e9558c86a4f5c5d949e2b8355420a98c85ef98a3320b09defa21fe6.png +0 -0
  50. data/tools/staticdocs/assets/images/linegraph-dc3cca59601beb3ea551bbd05e4e09b6cfabd1a7cbc93b757a7d4b22c478a75b.png +0 -0
  51. data/tools/staticdocs/assets/images/log_messages-6da2901ac63928daa3dcaf39a78ca9e455482c48d4ba917ee704f697e5210818.png +0 -0
  52. data/tools/staticdocs/assets/images/margin-4247b51c2c305cb961d08a807f30883b7fc6d9e3316c18174b86afe2356106dd.png +0 -0
  53. data/tools/staticdocs/assets/images/matrixbycolumns-74a67f236a97fffbdf7251fc98da2302a92df20ad16793a1617bc6f77380c9f6.png +0 -0
  54. data/tools/staticdocs/assets/images/microservices-805cc7d137958ac8183579cdb9a9845e7aef79db19723f0773f4ea4d957b48a1.png +0 -0
  55. data/tools/staticdocs/assets/images/mode_menu-04b9187b57a09ed12481a2699a86c7504fdc1c822579b4f762865ea90cb52dd3.png +0 -0
  56. data/tools/staticdocs/assets/images/named_widget-37362db8e310e5639be849d729fd637677f72330d676da4cd6baafc4b961331c.png +0 -0
  57. data/tools/staticdocs/assets/images/packages-3bfae1a91b0534077280c323a40e879a8ac6a7c3ac45376b3c706a098dab12c3.png +0 -0
  58. data/tools/staticdocs/assets/images/padding-e8ceea8ec79def3b14d186971854c44883675d974409366b77c586eedd85025c.png +0 -0
  59. data/tools/staticdocs/assets/images/plugins-aabbe060bec19e6fa2490b737f20758af9000066121f5af85f260a3b14f9b3d8.png +0 -0
  60. data/tools/staticdocs/assets/images/progressbar-cc1095369de0d483c4a9b07ad3a76f9e966990b2aa68b2bc8177d7130ed382a7.png +0 -0
  61. data/tools/staticdocs/assets/images/radiobutton-9151f7cb0dae5120e51e05b5575981c143e19f350e84c7e190d3dd78aa80fae8.png +0 -0
  62. data/tools/staticdocs/assets/images/rangebar-ceae5a30609ab12625e29fd479e88fb3ba16eb12879976edc807da87547a275d.png +0 -0
  63. data/tools/staticdocs/assets/images/raw-63c1dd793f4a734e7d512bf4c0c3722831c38d5392a1a1b0cb77bbef4d16b96b.png +0 -0
  64. data/tools/staticdocs/assets/images/redis-4553b5b35292cca3df1fa08577f2175efef34e0fdfe512f30ca70785b086b24f.png +0 -0
  65. data/tools/staticdocs/assets/images/right_click-371e3683026c0bb2b27187277b4e99727c6b52965e0190a5f81335248f40ef9b.png +0 -0
  66. data/tools/staticdocs/assets/images/rollup-ff0cecc0daa8dbdc84bc2a81efe4625b88f36a699368ada18e70c8d3d0c63c06.png +0 -0
  67. data/tools/staticdocs/assets/images/routers-489fe07165973feede7a63adf71781cca7ecb1f7d17c069761c1c57e70cf926e.png +0 -0
  68. data/tools/staticdocs/assets/images/scrollwindow-03e2823bf392679f0bd26159f476bad2f6d70a7ebb5a31e109fd75ad681cdd50.png +0 -0
  69. data/tools/staticdocs/assets/images/secrets-c8daf324829a0d4dde1d30f9da89d884ca06ce458e400dfa5d1de4ccb10395a1.png +0 -0
  70. data/tools/staticdocs/assets/images/settings1-36a446ec0455ae5ab3a6d225647264647e517e1e2d83da5c639a63756e0339a6.png +0 -0
  71. data/tools/staticdocs/assets/images/settings2-c18e478b65ba569bea37a2bb185b4702e347aecc570fbc7b26a6e66aeecc9129.png +0 -0
  72. data/tools/staticdocs/assets/images/signal-0e5def1ecb42b4688c7c6ab616ae87ef05c8b9afb5b1a27077e6cc9127721668.png +0 -0
  73. data/tools/staticdocs/assets/images/spacer-055e206bed0b13cba778071458407f184a690a8f2d5ff9cd9789f925c60c4886.png +0 -0
  74. data/tools/staticdocs/assets/images/sparkline-c5f8ecd361eef8172a9dea7ff70f3c1b056a3a00b525459429ead67d00c0c0e5.png +0 -0
  75. data/tools/staticdocs/assets/images/subsetting-ef46d38a0ba47b2fd0ad48422ccc7343a6ff88901c8a9675a27c13c9313e222b.png +0 -0
  76. data/tools/staticdocs/assets/images/tabitem-58fb7c6faa16ac04a0561a0315515852ad43ebdfbf709bd65b211af29f2f85f1.png +0 -0
  77. data/tools/staticdocs/assets/images/targets-c02c28769712aa226fdcbd3b90329285aeb39e775b9be1df6ab0e2ad31231518.png +0 -0
  78. data/tools/staticdocs/assets/images/textbox-9e4a1eb37cf68aabf92e326ff248d098a70295ffe6f7cf2e002a5dbff9ff0ef5.png +0 -0
  79. data/tools/staticdocs/assets/images/textcolor-e6d5bb0fba3786e4da7dd5e739306500ddc5fc6a4ead8e212bbe99a80433596c.png +0 -0
  80. data/tools/staticdocs/assets/images/textfield-931f510c2160ed8e5475bee78fa4c6cebd67d9195d92a22600217824ff55943d.png +0 -0
  81. data/tools/staticdocs/assets/images/time-d77e3f94633eb1008d5a382054940052070f5a4cd385f4a9203c0f60d406d7c6.png +0 -0
  82. data/tools/staticdocs/assets/images/title-5817bee0aa4702b4fd22c81a25e8036c1afc88a465a68d79707b2d58fb48789a.png +0 -0
  83. data/tools/staticdocs/assets/images/tools-d3ea80e2fdc04e5b85743146ebaf1fc7f1406b7b5e6ec9b700ed35dedc8d16e6.png +0 -0
  84. data/tools/staticdocs/assets/images/value-825b95d71be2c565e1d3fa5c57ec94be1bbb6e0a1e8166abb8617d5f50a93d39.png +0 -0
  85. data/tools/staticdocs/assets/images/valuelimitsbar-fd7637e8b4287430ab21a888acd1d10276438186bad6d204a4081c1b0423950f.png +0 -0
  86. data/tools/staticdocs/assets/images/valuelimitscolumn-aecfce9016c27e500eb506675bd372f77df1d671fd8fb0f30debe18c5cfee46c.png +0 -0
  87. data/tools/staticdocs/assets/images/valuerangebar-3a860f1fb4af1beeeb846c389c60f08eb633cc15cbb6f1c09509b5f5c0116d56.png +0 -0
  88. data/tools/staticdocs/assets/images/vertical-d4ea61f78a2cfc2cacc725f0a5dea194ab75278f0cb676e4a749f55d58a632f3.png +0 -0
  89. data/tools/staticdocs/assets/images/verticalbox-28fdba6f2c051a499b7f08a1be97edf0297ac9a9ce0dba44f02a7fe1c2616d91.png +0 -0
  90. data/tools/staticdocs/assets/images/width-1a69354459761ea23e4824436ef364124236f9bb96d46a28c97d8ff20d07ab81.png +0 -0
  91. data/tools/staticdocs/assets/js/019369f3.8413befc.js +1 -0
  92. data/tools/staticdocs/assets/js/058ffc22.a4ceeb8e.js +1 -0
  93. data/tools/staticdocs/assets/js/0686a885.ae0a89e8.js +1 -0
  94. data/tools/staticdocs/assets/js/078dbab0.90ef4019.js +1 -0
  95. data/tools/staticdocs/assets/js/0f5d161c.1c827de2.js +1 -0
  96. data/tools/staticdocs/assets/js/0ff569c9.3b7f9c95.js +1 -0
  97. data/tools/staticdocs/assets/js/103cc3be.76716a45.js +1 -0
  98. data/tools/staticdocs/assets/js/13196248.18801ae0.js +1 -0
  99. data/tools/staticdocs/assets/js/13c1b4e4.4457fa9a.js +1 -0
  100. data/tools/staticdocs/assets/js/1602.1e622848.js +1 -0
  101. data/tools/staticdocs/assets/js/1e02e6a3.8e63f255.js +1 -0
  102. data/tools/staticdocs/assets/js/2047b354.9470f5c9.js +1 -0
  103. data/tools/staticdocs/assets/js/2124.0e1f26f5.js +1 -0
  104. data/tools/staticdocs/assets/js/22b3ac48.ac895789.js +1 -0
  105. data/tools/staticdocs/assets/js/26b8abb2.45d268b1.js +1 -0
  106. data/tools/staticdocs/assets/js/2bb7bf90.471e10a1.js +1 -0
  107. data/tools/staticdocs/assets/js/3040.18a0bb2a.js +4 -0
  108. data/tools/staticdocs/assets/js/3687.6fa52db1.js +101 -0
  109. data/tools/staticdocs/assets/js/3dd7ef3b.d8bb37a8.js +1 -0
  110. data/tools/staticdocs/assets/js/40365d27.5f8a5da7.js +1 -0
  111. data/tools/staticdocs/assets/js/411898ad.c8f67fde.js +1 -0
  112. data/tools/staticdocs/assets/js/42170351.86617d4a.js +1 -0
  113. data/tools/staticdocs/assets/js/4303.a84f454a.js +1 -0
  114. data/tools/staticdocs/assets/js/43652efd.0c473c25.js +1 -0
  115. data/tools/staticdocs/assets/js/53ca7c5b.f0e35da3.js +1 -0
  116. data/tools/staticdocs/assets/js/54d0d530.9ace531c.js +1 -0
  117. data/tools/staticdocs/assets/js/5b233ba7.565c0c28.js +1 -0
  118. data/tools/staticdocs/assets/js/5bc719f6.80b7b43c.js +1 -0
  119. data/tools/staticdocs/assets/js/5c6ce5ec.ed839e0d.js +1 -0
  120. data/tools/staticdocs/assets/js/5e3ed378.048e258b.js +1 -0
  121. data/tools/staticdocs/assets/js/5fe211ef.96109971.js +1 -0
  122. data/tools/staticdocs/assets/js/62df909c.dd5f3a0c.js +1 -0
  123. data/tools/staticdocs/assets/js/630e5448.699a9dec.js +1 -0
  124. data/tools/staticdocs/assets/js/6831b732.4008a669.js +1 -0
  125. data/tools/staticdocs/assets/js/696b4199.34aa1d77.js +1 -0
  126. data/tools/staticdocs/assets/js/6b210247.d37e3087.js +1 -0
  127. data/tools/staticdocs/assets/js/6b65133b.f71c0e94.js +1 -0
  128. data/tools/staticdocs/assets/js/6f92e431.c98e31e0.js +1 -0
  129. data/tools/staticdocs/assets/js/72c6d8a8.1053fbd7.js +1 -0
  130. data/tools/staticdocs/assets/js/75897369.522ccdd7.js +1 -0
  131. data/tools/staticdocs/assets/js/75e64983.6b588c87.js +1 -0
  132. data/tools/staticdocs/assets/js/7690.fc05b8e6.js +1 -0
  133. data/tools/staticdocs/assets/js/7f5b2696.72e3b019.js +1 -0
  134. data/tools/staticdocs/assets/js/80c97f38.5a408d9c.js +1 -0
  135. data/tools/staticdocs/assets/js/867640d5.866fe67b.js +1 -0
  136. data/tools/staticdocs/assets/js/89e76475.b4e9da15.js +1 -0
  137. data/tools/staticdocs/assets/js/8f7843ee.59da8025.js +1 -0
  138. data/tools/staticdocs/assets/js/9424f0b3.cc8aa06e.js +1 -0
  139. data/tools/staticdocs/assets/js/97535711.94a5b402.js +1 -0
  140. data/tools/staticdocs/assets/js/99581c43.ebea1d08.js +1 -0
  141. data/tools/staticdocs/assets/js/9d6e81d0.4bc52207.js +1 -0
  142. data/tools/staticdocs/assets/js/{9fb6059a.a5107afb.js → 9fb6059a.57936fbe.js} +1 -1
  143. data/tools/staticdocs/assets/js/a677c089.d8d7a8f5.js +1 -0
  144. data/tools/staticdocs/assets/js/a9987364.2aa836fd.js +1 -0
  145. data/tools/staticdocs/assets/js/aa6b6c1b.4f484861.js +1 -0
  146. data/tools/staticdocs/assets/js/b4596165.a5fe2cea.js +1 -0
  147. data/tools/staticdocs/assets/js/b6d70f94.5df56282.js +1 -0
  148. data/tools/staticdocs/assets/js/b9f60ba6.cdb4a698.js +1 -0
  149. data/tools/staticdocs/assets/js/bd0034eb.5fb449fc.js +1 -0
  150. data/tools/staticdocs/assets/js/c24eae19.f419c8fb.js +1 -0
  151. data/tools/staticdocs/assets/js/c2598f55.85419dc8.js +1 -0
  152. data/tools/staticdocs/assets/js/c5388ca4.32f8f561.js +1 -0
  153. data/tools/staticdocs/assets/js/cb8c3f08.9264e5dd.js +1 -0
  154. data/tools/staticdocs/assets/js/cd879be4.aa3c877c.js +1 -0
  155. data/tools/staticdocs/assets/js/ce89ef36.1d76e86a.js +1 -0
  156. data/tools/staticdocs/assets/js/d1b923aa.de9e8fd6.js +1 -0
  157. data/tools/staticdocs/assets/js/d1bfc316.82dd17ab.js +1 -0
  158. data/tools/staticdocs/assets/js/d24bf9b6.1cb515f4.js +1 -0
  159. data/tools/staticdocs/assets/js/d57a4b5d.09769a64.js +1 -0
  160. data/tools/staticdocs/assets/js/d5d77c37.1704d750.js +1 -0
  161. data/tools/staticdocs/assets/js/d66bf9c0.9a597f56.js +1 -0
  162. data/tools/staticdocs/assets/js/d8ca4191.1861d710.js +1 -0
  163. data/tools/staticdocs/assets/js/d9b92eba.5a40eb6d.js +1 -0
  164. data/tools/staticdocs/assets/js/db8fa1d0.f9f65c91.js +1 -0
  165. data/tools/staticdocs/assets/js/dbe31111.dae4b9bd.js +1 -0
  166. data/tools/staticdocs/assets/js/dc5f7beb.15fc7cc8.js +1 -0
  167. data/tools/staticdocs/assets/js/dfbae5fd.3959d626.js +1 -0
  168. data/tools/staticdocs/assets/js/e501b0d1.cb2ef34f.js +1 -0
  169. data/tools/staticdocs/assets/js/ebec1ccb.086b8668.js +1 -0
  170. data/tools/staticdocs/assets/js/f15615f1.afd4ba93.js +1 -0
  171. data/tools/staticdocs/assets/js/fd886806.fa25adc4.js +1 -0
  172. data/tools/staticdocs/assets/js/main.1a59b278.js +36 -0
  173. data/tools/staticdocs/assets/js/runtime~main.25e99a76.js +1 -0
  174. data/tools/staticdocs/docs/configuration/accessors.html +85 -0
  175. data/tools/staticdocs/docs/configuration/command.html +149 -158
  176. data/tools/staticdocs/docs/configuration/format.html +28 -40
  177. data/tools/staticdocs/docs/configuration/interfaces.html +119 -64
  178. data/tools/staticdocs/docs/configuration/plugins.html +234 -225
  179. data/tools/staticdocs/docs/configuration/protocols.html +106 -92
  180. data/tools/staticdocs/docs/configuration/ssl-tls.html +34 -46
  181. data/tools/staticdocs/docs/configuration/table.html +88 -100
  182. data/tools/staticdocs/docs/configuration/target.html +29 -41
  183. data/tools/staticdocs/docs/configuration/telemetry-screens.html +374 -316
  184. data/tools/staticdocs/docs/configuration/telemetry.html +136 -142
  185. data/tools/staticdocs/docs/configuration.html +1 -13
  186. data/tools/staticdocs/docs/development/curl.html +17 -29
  187. data/tools/staticdocs/docs/development/developing.html +24 -36
  188. data/tools/staticdocs/docs/development/json-api.html +26 -38
  189. data/tools/staticdocs/docs/development/log-structure.html +19 -31
  190. data/tools/staticdocs/docs/development/roadmap.html +26 -44
  191. data/tools/staticdocs/docs/development/streaming-api.html +10 -22
  192. data/tools/staticdocs/docs/development/testing.html +23 -27
  193. data/tools/staticdocs/docs/development.html +1 -13
  194. data/tools/staticdocs/docs/getting-started/generators.html +37 -49
  195. data/tools/staticdocs/docs/getting-started/gettingstarted.html +45 -56
  196. data/tools/staticdocs/docs/getting-started/installation.html +24 -36
  197. data/tools/staticdocs/docs/getting-started/key_concepts.html +32 -44
  198. data/tools/staticdocs/docs/getting-started/podman.html +25 -37
  199. data/tools/staticdocs/docs/getting-started/requirements.html +32 -44
  200. data/tools/staticdocs/docs/getting-started/upgrading.html +134 -24
  201. data/tools/staticdocs/docs/getting-started.html +1 -13
  202. data/tools/staticdocs/docs/guides/bridges.html +17 -30
  203. data/tools/staticdocs/docs/guides/cfs.html +46 -58
  204. data/tools/staticdocs/docs/guides/custom-widgets.html +17 -29
  205. data/tools/staticdocs/docs/guides/little-endian-bitfields.html +3 -15
  206. data/tools/staticdocs/docs/guides/local-mode.html +16 -28
  207. data/tools/staticdocs/docs/guides/logging.html +12 -24
  208. data/tools/staticdocs/docs/guides/monitoring.html +18 -30
  209. data/tools/staticdocs/docs/guides/performance.html +21 -33
  210. data/tools/staticdocs/docs/guides/raspberrypi.html +16 -28
  211. data/tools/staticdocs/docs/guides/script-writing.html +108 -120
  212. data/tools/staticdocs/docs/guides/scripting-api.html +606 -615
  213. data/tools/staticdocs/docs/guides.html +1 -13
  214. data/tools/staticdocs/docs/meta/contributing.html +14 -26
  215. data/tools/staticdocs/docs/meta/licenses.html +36 -25
  216. data/tools/staticdocs/docs/meta/philosophy.html +3 -15
  217. data/tools/staticdocs/docs/meta/xtce.html +13 -25
  218. data/tools/staticdocs/docs/meta.html +1 -13
  219. data/tools/staticdocs/docs/privacy.html +19 -31
  220. data/tools/staticdocs/docs/tools/admin.html +36 -0
  221. data/tools/staticdocs/docs/tools/autonomic.html +22 -34
  222. data/tools/staticdocs/docs/tools/bucket-explorer.html +10 -22
  223. data/tools/staticdocs/docs/tools/calendar.html +21 -33
  224. data/tools/staticdocs/docs/tools/cmd-sender.html +16 -28
  225. data/tools/staticdocs/docs/tools/cmd-tlm-server.html +27 -36
  226. data/tools/staticdocs/docs/tools/command_history.html +10 -0
  227. data/tools/staticdocs/docs/tools/data-extractor.html +29 -41
  228. data/tools/staticdocs/docs/tools/data-viewer.html +11 -23
  229. data/tools/staticdocs/docs/tools/handbooks.html +4 -16
  230. data/tools/staticdocs/docs/tools/limits-monitor.html +18 -30
  231. data/tools/staticdocs/docs/tools/packet-viewer.html +16 -28
  232. data/tools/staticdocs/docs/tools/script-runner.html +44 -50
  233. data/tools/staticdocs/docs/tools/table-manager.html +16 -28
  234. data/tools/staticdocs/docs/tools/tlm-grapher.html +21 -33
  235. data/tools/staticdocs/docs/tools/tlm-viewer.html +16 -28
  236. data/tools/staticdocs/docs/tools.html +1 -13
  237. data/tools/staticdocs/docs.html +12 -24
  238. data/tools/staticdocs/img/admin/add_tool.png +0 -0
  239. data/tools/staticdocs/img/admin/interfaces.png +0 -0
  240. data/tools/staticdocs/img/admin/microservices.png +0 -0
  241. data/tools/staticdocs/img/admin/packages.png +0 -0
  242. data/tools/staticdocs/img/admin/plugins.png +0 -0
  243. data/tools/staticdocs/img/admin/redis.png +0 -0
  244. data/tools/staticdocs/img/admin/routers.png +0 -0
  245. data/tools/staticdocs/img/admin/secrets.png +0 -0
  246. data/tools/staticdocs/img/admin/settings1.png +0 -0
  247. data/tools/staticdocs/img/admin/settings2.png +0 -0
  248. data/tools/staticdocs/img/admin/targets.png +0 -0
  249. data/tools/staticdocs/img/admin/tools.png +0 -0
  250. data/tools/staticdocs/img/cmd_tlm_server/cmd_authority.png +0 -0
  251. data/tools/staticdocs/img/cmd_tlm_server/cmd_tlm_server.png +0 -0
  252. data/tools/staticdocs/img/cmd_tlm_server/critical_cmd_sender.png +0 -0
  253. data/tools/staticdocs/img/cmd_tlm_server/log_messages.png +0 -0
  254. data/tools/staticdocs/img/command_history/command_history.png +0 -0
  255. data/tools/staticdocs/img/command_sender/collect_states.png +0 -0
  256. data/tools/staticdocs/img/command_sender/command_sender.png +0 -0
  257. data/tools/staticdocs/img/command_sender/history.png +0 -0
  258. data/tools/staticdocs/img/command_sender/inst_clear.png +0 -0
  259. data/tools/staticdocs/img/command_sender/inst_collect.png +0 -0
  260. data/tools/staticdocs/img/command_sender/inst_collect_hazardous.png +0 -0
  261. data/tools/staticdocs/img/command_sender/mode_menu.png +0 -0
  262. data/tools/staticdocs/img/script_runner/right_click.png +0 -0
  263. data/tools/staticdocs/img/telemetry_viewer/widgets/array.png +0 -0
  264. data/tools/staticdocs/img/telemetry_viewer/widgets/backcolor.png +0 -0
  265. data/tools/staticdocs/img/telemetry_viewer/widgets/block.png +0 -0
  266. data/tools/staticdocs/img/telemetry_viewer/widgets/bordercolor.png +0 -0
  267. data/tools/staticdocs/img/telemetry_viewer/widgets/button.png +0 -0
  268. data/tools/staticdocs/img/telemetry_viewer/widgets/canvasdot.png +0 -0
  269. data/tools/staticdocs/img/telemetry_viewer/widgets/canvasimage.png +0 -0
  270. data/tools/staticdocs/img/telemetry_viewer/widgets/canvasimagevalue.png +0 -0
  271. data/tools/staticdocs/img/telemetry_viewer/widgets/canvaslabel.png +0 -0
  272. data/tools/staticdocs/img/telemetry_viewer/widgets/canvaslabelvalue.png +0 -0
  273. data/tools/staticdocs/img/telemetry_viewer/widgets/canvasline.png +0 -0
  274. data/tools/staticdocs/img/telemetry_viewer/widgets/canvaslinevalue.png +0 -0
  275. data/tools/staticdocs/img/telemetry_viewer/widgets/checkbutton.png +0 -0
  276. data/tools/staticdocs/img/telemetry_viewer/widgets/combobox.png +0 -0
  277. data/tools/staticdocs/img/telemetry_viewer/widgets/date.png +0 -0
  278. data/tools/staticdocs/img/telemetry_viewer/widgets/formatvalue.png +0 -0
  279. data/tools/staticdocs/img/telemetry_viewer/widgets/height.png +0 -0
  280. data/tools/staticdocs/img/telemetry_viewer/widgets/horizontal.png +0 -0
  281. data/tools/staticdocs/img/telemetry_viewer/widgets/horizontalbox.png +0 -0
  282. data/tools/staticdocs/img/telemetry_viewer/widgets/horizontalline.png +0 -0
  283. data/tools/staticdocs/img/telemetry_viewer/widgets/iframe.png +0 -0
  284. data/tools/staticdocs/img/telemetry_viewer/widgets/imageviewer.png +0 -0
  285. data/tools/staticdocs/img/telemetry_viewer/widgets/label.png +0 -0
  286. data/tools/staticdocs/img/telemetry_viewer/widgets/labelled.png +0 -0
  287. data/tools/staticdocs/img/telemetry_viewer/widgets/labelprogressbar.png +0 -0
  288. data/tools/staticdocs/img/telemetry_viewer/widgets/labelsparkline.png +0 -0
  289. data/tools/staticdocs/img/telemetry_viewer/widgets/labelvalue.png +0 -0
  290. data/tools/staticdocs/img/telemetry_viewer/widgets/labelvaluedesc.png +0 -0
  291. data/tools/staticdocs/img/telemetry_viewer/widgets/labelvaluelimitscolumn.png +0 -0
  292. data/tools/staticdocs/img/telemetry_viewer/widgets/labelvaluerangebar.png +0 -0
  293. data/tools/staticdocs/img/telemetry_viewer/widgets/led.png +0 -0
  294. data/tools/staticdocs/img/telemetry_viewer/widgets/limitsbar.png +0 -0
  295. data/tools/staticdocs/img/telemetry_viewer/widgets/limitscolor.png +0 -0
  296. data/tools/staticdocs/img/telemetry_viewer/widgets/limitscolumn.png +0 -0
  297. data/tools/staticdocs/img/telemetry_viewer/widgets/linegraph.png +0 -0
  298. data/tools/staticdocs/img/telemetry_viewer/widgets/margin.png +0 -0
  299. data/tools/staticdocs/img/telemetry_viewer/widgets/matrixbycolumns.png +0 -0
  300. data/tools/staticdocs/img/telemetry_viewer/widgets/named_widget.png +0 -0
  301. data/tools/staticdocs/img/telemetry_viewer/widgets/padding.png +0 -0
  302. data/tools/staticdocs/img/telemetry_viewer/widgets/progressbar.png +0 -0
  303. data/tools/staticdocs/img/telemetry_viewer/widgets/radiobutton.png +0 -0
  304. data/tools/staticdocs/img/telemetry_viewer/widgets/rangebar.png +0 -0
  305. data/tools/staticdocs/img/telemetry_viewer/widgets/raw.png +0 -0
  306. data/tools/staticdocs/img/telemetry_viewer/widgets/rollup.png +0 -0
  307. data/tools/staticdocs/img/telemetry_viewer/widgets/scrollwindow.png +0 -0
  308. data/tools/staticdocs/img/telemetry_viewer/widgets/signal.png +0 -0
  309. data/tools/staticdocs/img/telemetry_viewer/widgets/spacer.png +0 -0
  310. data/tools/staticdocs/img/telemetry_viewer/widgets/sparkline.png +0 -0
  311. data/tools/staticdocs/img/telemetry_viewer/widgets/subsetting.png +0 -0
  312. data/tools/staticdocs/img/telemetry_viewer/widgets/tabbook.png +0 -0
  313. data/tools/staticdocs/img/telemetry_viewer/widgets/tabitem.png +0 -0
  314. data/tools/staticdocs/img/telemetry_viewer/widgets/textbox.png +0 -0
  315. data/tools/staticdocs/img/telemetry_viewer/widgets/textcolor.png +0 -0
  316. data/tools/staticdocs/img/telemetry_viewer/widgets/textfield.png +0 -0
  317. data/tools/staticdocs/img/telemetry_viewer/widgets/time.png +0 -0
  318. data/tools/staticdocs/img/telemetry_viewer/widgets/title.png +0 -0
  319. data/tools/staticdocs/img/telemetry_viewer/widgets/value.png +0 -0
  320. data/tools/staticdocs/img/telemetry_viewer/widgets/valuelimitsbar.png +0 -0
  321. data/tools/staticdocs/img/telemetry_viewer/widgets/valuelimitscolumn.png +0 -0
  322. data/tools/staticdocs/img/telemetry_viewer/widgets/valuerangebar.png +0 -0
  323. data/tools/staticdocs/img/telemetry_viewer/widgets/vertical.png +0 -0
  324. data/tools/staticdocs/img/telemetry_viewer/widgets/verticalbox.png +0 -0
  325. data/tools/staticdocs/img/telemetry_viewer/widgets/width.png +0 -0
  326. data/tools/staticdocs/index.html +1 -13
  327. data/tools/staticdocs/lunr-index-1734474862542.json +1 -0
  328. data/tools/staticdocs/lunr-index.json +1 -1
  329. data/tools/staticdocs/markdown-page.html +2 -14
  330. data/tools/staticdocs/search-doc-1734474862542.json +1 -0
  331. data/tools/staticdocs/search-doc.json +1 -1
  332. data/tools/staticdocs/sitemap.xml +1 -1
  333. metadata +256 -99
  334. data/tools/staticdocs/assets/css/styles.80ddca08.css +0 -1
  335. data/tools/staticdocs/assets/images/cmd_authority-51594401bfa6d8cc5849aae05b4d2af838360f8a3329f9746aa1307fe3091402.png +0 -0
  336. data/tools/staticdocs/assets/images/cmd_tlm_server-727ea478568988b10e4be4a3ba7255dd48ec56f6ab6444c6c1e32497fe478681.png +0 -0
  337. data/tools/staticdocs/assets/images/collect_states-565ae4b6d02449850585afd7ce35982711d4d677f5a04c1332b2c176f1ec3a25.png +0 -0
  338. data/tools/staticdocs/assets/images/command_sender-bb1543bde21fc1963405de5251d16a80a0c3a1bf5adb5fb78145d4995e2fe541.png +0 -0
  339. data/tools/staticdocs/assets/images/history-2391436f9edc3e00104a7375f88f5de72b0967f9eb154dfecc346c0a70af4389.png +0 -0
  340. data/tools/staticdocs/assets/images/inst_clear-2d5f985c879e8b917fedacdb8c6552bbd383231bf5c8ab8e560e77df4e050026.png +0 -0
  341. data/tools/staticdocs/assets/images/inst_collect-81bc422b3b33c5ebcbe4c2f489c730b32ab0d6ea6c7f81cc79d9f6bc03e9db15.png +0 -0
  342. data/tools/staticdocs/assets/images/inst_collect_hazardous-a8fb19ea296354a0cd276da1e0ad82f74479eea4e7e204fcf64b779596f2c092.png +0 -0
  343. data/tools/staticdocs/assets/images/log_messages-a934181ef59dc82d2624d052faf1023ef8ff2548f074ba9d67abdb6ebfd728d4.png +0 -0
  344. data/tools/staticdocs/assets/images/mode_menu-9c112084937db5bbff02c18a5681ad038caa0838fc88438628b134a6f6823a09.png +0 -0
  345. data/tools/staticdocs/assets/js/019369f3.727d87f1.js +0 -1
  346. data/tools/staticdocs/assets/js/058ffc22.f2d69d72.js +0 -1
  347. data/tools/staticdocs/assets/js/0686a885.83641127.js +0 -1
  348. data/tools/staticdocs/assets/js/078dbab0.945c9f59.js +0 -1
  349. data/tools/staticdocs/assets/js/0f5d161c.9d01fab0.js +0 -1
  350. data/tools/staticdocs/assets/js/0ff569c9.aa4daee5.js +0 -1
  351. data/tools/staticdocs/assets/js/103cc3be.537144c5.js +0 -1
  352. data/tools/staticdocs/assets/js/13196248.6b49e93d.js +0 -1
  353. data/tools/staticdocs/assets/js/13c1b4e4.22a0b1d4.js +0 -1
  354. data/tools/staticdocs/assets/js/1e02e6a3.0445f325.js +0 -1
  355. data/tools/staticdocs/assets/js/2047b354.25d11993.js +0 -1
  356. data/tools/staticdocs/assets/js/22b3ac48.7a5ea984.js +0 -1
  357. data/tools/staticdocs/assets/js/2601.ca992ab9.js +0 -1
  358. data/tools/staticdocs/assets/js/26b8abb2.dcdf815e.js +0 -1
  359. data/tools/staticdocs/assets/js/2bb7bf90.633f7a6c.js +0 -1
  360. data/tools/staticdocs/assets/js/3917.a6366d59.js +0 -1
  361. data/tools/staticdocs/assets/js/3dd7ef3b.d55880a8.js +0 -1
  362. data/tools/staticdocs/assets/js/40365d27.4b4b2ccd.js +0 -1
  363. data/tools/staticdocs/assets/js/411898ad.1d6a609d.js +0 -1
  364. data/tools/staticdocs/assets/js/42170351.d7f6034b.js +0 -1
  365. data/tools/staticdocs/assets/js/43652efd.d1e1add3.js +0 -1
  366. data/tools/staticdocs/assets/js/53ca7c5b.c3111020.js +0 -1
  367. data/tools/staticdocs/assets/js/54d0d530.fa34b0b0.js +0 -1
  368. data/tools/staticdocs/assets/js/5723.f6123e37.js +0 -1
  369. data/tools/staticdocs/assets/js/5778.7d36f1c2.js +0 -1
  370. data/tools/staticdocs/assets/js/5b233ba7.6fdd6b6c.js +0 -1
  371. data/tools/staticdocs/assets/js/5bc719f6.daa2a049.js +0 -1
  372. data/tools/staticdocs/assets/js/5c6ce5ec.61a9cae2.js +0 -1
  373. data/tools/staticdocs/assets/js/5e3ed378.2bee863a.js +0 -1
  374. data/tools/staticdocs/assets/js/5fe211ef.0b54b37a.js +0 -1
  375. data/tools/staticdocs/assets/js/62df909c.906d9999.js +0 -1
  376. data/tools/staticdocs/assets/js/630e5448.6fea087c.js +0 -1
  377. data/tools/staticdocs/assets/js/6831b732.60c3c6d5.js +0 -1
  378. data/tools/staticdocs/assets/js/696b4199.a5ae3d65.js +0 -1
  379. data/tools/staticdocs/assets/js/6b210247.aaa91da1.js +0 -1
  380. data/tools/staticdocs/assets/js/6b65133b.76b83e83.js +0 -1
  381. data/tools/staticdocs/assets/js/6f92e431.d02304f0.js +0 -1
  382. data/tools/staticdocs/assets/js/72c6d8a8.be25aaac.js +0 -1
  383. data/tools/staticdocs/assets/js/75897369.7b31b03e.js +0 -1
  384. data/tools/staticdocs/assets/js/75e64983.6ef0928b.js +0 -1
  385. data/tools/staticdocs/assets/js/7760.7f593c4f.js +0 -2
  386. data/tools/staticdocs/assets/js/7760.7f593c4f.js.LICENSE.txt +0 -61
  387. data/tools/staticdocs/assets/js/7f5b2696.60735273.js +0 -1
  388. data/tools/staticdocs/assets/js/867640d5.48133ad5.js +0 -1
  389. data/tools/staticdocs/assets/js/89e76475.13ce283b.js +0 -1
  390. data/tools/staticdocs/assets/js/8f7843ee.7a68246a.js +0 -1
  391. data/tools/staticdocs/assets/js/9424f0b3.ea51e6e5.js +0 -1
  392. data/tools/staticdocs/assets/js/97535711.5311ddd9.js +0 -1
  393. data/tools/staticdocs/assets/js/99581c43.64e9c551.js +0 -1
  394. data/tools/staticdocs/assets/js/9d6e81d0.c31feabc.js +0 -1
  395. data/tools/staticdocs/assets/js/a507c363.d2cc5d72.js +0 -1
  396. data/tools/staticdocs/assets/js/a677c089.7877e85d.js +0 -1
  397. data/tools/staticdocs/assets/js/a9987364.0358fb0b.js +0 -1
  398. data/tools/staticdocs/assets/js/aa6b6c1b.9f3252e1.js +0 -1
  399. data/tools/staticdocs/assets/js/b4596165.daa24b72.js +0 -1
  400. data/tools/staticdocs/assets/js/b6d70f94.19c327f0.js +0 -1
  401. data/tools/staticdocs/assets/js/b9f60ba6.e55cd937.js +0 -1
  402. data/tools/staticdocs/assets/js/bd0034eb.6691ccc4.js +0 -1
  403. data/tools/staticdocs/assets/js/c24eae19.503774e8.js +0 -1
  404. data/tools/staticdocs/assets/js/c2598f55.c5a1bac3.js +0 -1
  405. data/tools/staticdocs/assets/js/c5388ca4.f526bb0c.js +0 -1
  406. data/tools/staticdocs/assets/js/cb8c3f08.b82ad06f.js +0 -1
  407. data/tools/staticdocs/assets/js/cd879be4.f956406f.js +0 -1
  408. data/tools/staticdocs/assets/js/ce89ef36.aa518a52.js +0 -1
  409. data/tools/staticdocs/assets/js/d1b923aa.d6bafb72.js +0 -1
  410. data/tools/staticdocs/assets/js/d1bfc316.28d99aa4.js +0 -1
  411. data/tools/staticdocs/assets/js/d24bf9b6.6c422113.js +0 -1
  412. data/tools/staticdocs/assets/js/d57a4b5d.8f23a506.js +0 -1
  413. data/tools/staticdocs/assets/js/d5d77c37.fb296e02.js +0 -1
  414. data/tools/staticdocs/assets/js/d8ca4191.2349d796.js +0 -1
  415. data/tools/staticdocs/assets/js/d9b92eba.8f82360d.js +0 -1
  416. data/tools/staticdocs/assets/js/db8fa1d0.b0500934.js +0 -1
  417. data/tools/staticdocs/assets/js/dc5f7beb.e3a82d1e.js +0 -1
  418. data/tools/staticdocs/assets/js/dfbae5fd.d1484e14.js +0 -1
  419. data/tools/staticdocs/assets/js/e501b0d1.0b407477.js +0 -1
  420. data/tools/staticdocs/assets/js/ebec1ccb.a1b5fc97.js +0 -1
  421. data/tools/staticdocs/assets/js/f15615f1.ee14b7d6.js +0 -1
  422. data/tools/staticdocs/assets/js/fd886806.4a41fa80.js +0 -1
  423. data/tools/staticdocs/assets/js/main.a3784266.js +0 -2
  424. data/tools/staticdocs/assets/js/main.a3784266.js.LICENSE.txt +0 -71
  425. data/tools/staticdocs/assets/js/runtime~main.9f7e4d76.js +0 -1
  426. data/tools/staticdocs/docs/development/host-install.html +0 -38
  427. data/tools/staticdocs/docs/v5/host-install/index.html +0 -11
  428. data/tools/staticdocs/lunr-index-1727813111453.json +0 -1
  429. data/tools/staticdocs/search-doc-1727813111453.json +0 -1
@@ -1,18 +1,8 @@
1
- <!doctype html>
2
- <html lang="en" dir="ltr" class="docs-wrapper plugin-docs plugin-id-default docs-version-current docs-doc-page docs-doc-id-guides/script-writing" data-has-hydrated="false">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="generator" content="Docusaurus v3.5.2">
6
- <title data-rh="true">Script Writing Guide | OpenC3 Docs</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:url" content="https://docs.openc3.com/tools/staticdocs/docs/guides/script-writing"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="Script Writing Guide | OpenC3 Docs"><meta data-rh="true" name="description" content="Introduction"><meta data-rh="true" property="og:description" content="Introduction"><link data-rh="true" rel="icon" href="/tools/staticdocs/img/favicon.png"><link data-rh="true" rel="canonical" href="https://docs.openc3.com/tools/staticdocs/docs/guides/script-writing"><link data-rh="true" rel="alternate" href="https://docs.openc3.com/tools/staticdocs/docs/guides/script-writing" hreflang="en"><link data-rh="true" rel="alternate" href="https://docs.openc3.com/tools/staticdocs/docs/guides/script-writing" hreflang="x-default"><link rel="stylesheet" href="/tools/staticdocs/assets/css/styles.80ddca08.css">
7
- <script src="/tools/staticdocs/assets/js/runtime~main.9f7e4d76.js" defer="defer"></script>
8
- <script src="/tools/staticdocs/assets/js/main.a3784266.js" defer="defer"></script>
9
- </head>
10
- <body class="navigation-with-keyboard">
11
- <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return window.localStorage.getItem("theme")}catch(t){}}();t(null!==e?e:"dark")}(),function(){try{const n=new URLSearchParams(window.location.search).entries();for(var[t,e]of n)if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}()</script><div id="__docusaurus"><div role="region" aria-label="Skip to main content"><a class="skipToContent_G6ar" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/tools/staticdocs/"><div class="navbar__logo"><img src="/tools/staticdocs/img/logo.svg" alt="OpenC3 Logo" class="themedComponent_DHUr themedComponent--light_DIHH"><img src="/tools/staticdocs/img/logo.svg" alt="OpenC3 Logo" class="themedComponent_DHUr themedComponent--dark_Bv2M"></div><b class="navbar__title text--truncate">OpenC3 Docs</b></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/tools/staticdocs/docs">Documentation</a><a href="https://openc3.com/enterprise/" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">Enterprise</a></div><div class="navbar__items navbar__items--right"><div class="navbarSearchContainer_bmvg"><div class="navbar__search"><span aria-label="expand searchbar" role="button" class="search-icon" tabindex="0"></span><input id="search_input_react" type="search" placeholder="Loading..." aria-label="Search" class="navbar__search-input search-bar" disabled=""></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_UyTV"><div class="docsWrapper_XLvK"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_z1FD" type="button"></button><div class="docRoot_HciC"><aside class="theme-doc-sidebar-container docSidebarContainer_e5ai"><div class="sidebarViewport_N8x0"><div class="sidebar_vJCc"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_qiME"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/tools/staticdocs/docs">Introduction</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/tools/staticdocs/docs/getting-started">Getting Started</a><button aria-label="Expand sidebar category &#x27;Getting Started&#x27;" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/tools/staticdocs/docs/configuration">Configuration</a><button aria-label="Expand sidebar category &#x27;Configuration&#x27;" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/tools/staticdocs/docs/tools">Tools</a><button aria-label="Expand sidebar category &#x27;Tools&#x27;" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" href="/tools/staticdocs/docs/guides">Guides</a><button aria-label="Collapse sidebar category &#x27;Guides&#x27;" aria-expanded="true" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/tools/staticdocs/docs/guides/bridges">Bridges</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/tools/staticdocs/docs/guides/cfs">COSMOS and NASA cFS</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/tools/staticdocs/docs/guides/custom-widgets">Custom Widgets</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/tools/staticdocs/docs/guides/little-endian-bitfields">Little Endian Bitfields</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/tools/staticdocs/docs/guides/local-mode">Local Mode</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/tools/staticdocs/docs/guides/logging">Logging</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/tools/staticdocs/docs/guides/monitoring">Monitoring</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/tools/staticdocs/docs/guides/performance">Performance</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/tools/staticdocs/docs/guides/raspberrypi">Raspberry Pi</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/tools/staticdocs/docs/guides/script-writing">Script Writing Guide</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/tools/staticdocs/docs/guides/scripting-api">Scripting API Guide</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/tools/staticdocs/docs/development">Development</a><button aria-label="Expand sidebar category &#x27;Development&#x27;" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/tools/staticdocs/docs/meta">Meta</a><button aria-label="Expand sidebar category &#x27;Meta&#x27;" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/tools/staticdocs/docs/privacy">OpenC3, Inc. Privacy Policy</a></li></ul></nav></div></div></aside><main class="docMainContainer_namt"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_YAwJ"><div class="docItemContainer_Rv5Z"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_zCmv" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/tools/staticdocs/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_JFrk"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/tools/staticdocs/docs/guides"><span itemprop="name">Guides</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Script Writing Guide</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_O_Qc theme-doc-toc-mobile tocMobile_tjDr"><button type="button" class="clean-btn tocCollapsibleButton_htYj">On this page</button></div><div class="theme-doc-markdown markdown"><header><h1>Script Writing Guide</h1></header><h2 class="anchor anchorWithStickyNavbar_fF9Z" id="introduction">Introduction<a href="#introduction" class="hash-link" aria-label="Direct link to Introduction" title="Direct link to Introduction">​</a></h2>
1
+ <!doctype html><html lang=en dir=ltr class="docs-wrapper plugin-docs plugin-id-default docs-version-current docs-doc-page docs-doc-id-guides/script-writing" data-has-hydrated=false><meta charset=UTF-8><meta name=generator content="Docusaurus v3.6.3"><title data-rh=true>Script Writing Guide | OpenC3 Docs</title><meta data-rh=true name=viewport content="width=device-width,initial-scale=1.0"><meta data-rh=true name=twitter:card content=summary_large_image><meta data-rh=true property=og:url content=https://docs.openc3.com/tools/staticdocs/docs/guides/script-writing><meta data-rh=true property=og:locale content=en><meta data-rh=true name=docusaurus_locale content=en><meta data-rh=true name=docsearch:language content=en><meta data-rh=true name=docusaurus_version content=current><meta data-rh=true name=docusaurus_tag content=docs-default-current><meta data-rh=true name=docsearch:version content=current><meta data-rh=true name=docsearch:docusaurus_tag content=docs-default-current><meta data-rh=true property=og:title content="Script Writing Guide | OpenC3 Docs"><meta data-rh=true name=description content="Key concepts and best practices for script writing"><meta data-rh=true property=og:description content="Key concepts and best practices for script writing"><link data-rh=true rel=icon href=/tools/staticdocs/img/favicon.png><link data-rh=true rel=canonical href=https://docs.openc3.com/tools/staticdocs/docs/guides/script-writing><link data-rh=true rel=alternate href=https://docs.openc3.com/tools/staticdocs/docs/guides/script-writing hreflang=en><link data-rh=true rel=alternate href=https://docs.openc3.com/tools/staticdocs/docs/guides/script-writing hreflang=x-default><link rel=stylesheet href=/tools/staticdocs/assets/css/styles.839a3ee9.css><script src=/tools/staticdocs/assets/js/runtime~main.25e99a76.js defer></script><script src=/tools/staticdocs/assets/js/main.1a59b278.js defer></script><body class=navigation-with-keyboard><script>!function(){var t,e=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return window.localStorage.getItem("theme")}catch(t){}}();t=null!==e?e:"dark",document.documentElement.setAttribute("data-theme",t)}(),function(){try{for(var[t,e]of new URLSearchParams(window.location.search).entries())if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}()</script><div id=__docusaurus><div role=region aria-label="Skip to main content"><a class=skipToContent_G6ar href=#__docusaurus_skipToContent_fallback>Skip to main content</a></div><nav aria-label=Main class="navbar navbar--fixed-top"><div class=navbar__inner><div class=navbar__items><button aria-label="Toggle navigation bar" aria-expanded=false class="navbar__toggle clean-btn" type=button><svg width=30 height=30 viewBox="0 0 30 30" aria-hidden=true><path stroke=currentColor stroke-linecap=round stroke-miterlimit=10 stroke-width=2 d="M4 7h22M4 15h22M4 23h22"/></svg></button><a class=navbar__brand href=/tools/staticdocs/><div class=navbar__logo><img src=/tools/staticdocs/img/logo.svg alt="OpenC3 Logo" class="themedComponent_DHUr themedComponent--light_DIHH"><img src=/tools/staticdocs/img/logo.svg alt="OpenC3 Logo" class="themedComponent_DHUr themedComponent--dark_Bv2M"></div><b class="navbar__title text--truncate">OpenC3 Docs</b></a><a aria-current=page class="navbar__item navbar__link navbar__link--active" href=/tools/staticdocs/docs>Documentation</a><a href=https://openc3.com/enterprise/ target=_blank rel="noopener noreferrer" class="navbar__item navbar__link">Enterprise</a></div><div class="navbar__items navbar__items--right"><div class=navbarSearchContainer_bmvg><div class=navbar__search><span aria-label="expand searchbar" role=button class=search-icon tabindex=0></span><input id=search_input_react type=search placeholder=Loading... aria-label=Search class="navbar__search-input search-bar" disabled></div></div></div></div><div role=presentation class=navbar-sidebar__backdrop></div></nav><div id=__docusaurus_skipToContent_fallback class="main-wrapper mainWrapper_UyTV"><div class=docsWrapper_XLvK><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_z1FD" type=button></button><div class=docRoot_HciC><aside class="theme-doc-sidebar-container docSidebarContainer_e5ai"><div class=sidebarViewport_N8x0><div class=sidebar_vJCc><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_qiME"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class=menu__link href=/tools/staticdocs/docs>Introduction</a><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist" href=/tools/staticdocs/docs/getting-started>Getting Started</a><button aria-label="Expand sidebar category 'Getting Started'" aria-expanded=false type=button class="clean-btn menu__caret"></button></div><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist" href=/tools/staticdocs/docs/configuration>Configuration</a><button aria-label="Expand sidebar category 'Configuration'" aria-expanded=false type=button class="clean-btn menu__caret"></button></div><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist" href=/tools/staticdocs/docs/tools>Tools</a><button aria-label="Expand sidebar category 'Tools'" aria-expanded=false type=button class="clean-btn menu__caret"></button></div><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist menu__link--active" href=/tools/staticdocs/docs/guides>Guides</a><button aria-label="Collapse sidebar category 'Guides'" aria-expanded=true type=button class="clean-btn menu__caret"></button></div><ul style=display:block;overflow:visible;height:auto class=menu__list><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class=menu__link tabindex=0 href=/tools/staticdocs/docs/guides/bridges>Bridges</a><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class=menu__link tabindex=0 href=/tools/staticdocs/docs/guides/cfs>COSMOS and NASA cFS</a><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class=menu__link tabindex=0 href=/tools/staticdocs/docs/guides/custom-widgets>Custom Widgets</a><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class=menu__link tabindex=0 href=/tools/staticdocs/docs/guides/little-endian-bitfields>Little Endian Bitfields</a><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class=menu__link tabindex=0 href=/tools/staticdocs/docs/guides/local-mode>Local Mode</a><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class=menu__link tabindex=0 href=/tools/staticdocs/docs/guides/logging>Logging</a><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class=menu__link tabindex=0 href=/tools/staticdocs/docs/guides/monitoring>Monitoring</a><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class=menu__link tabindex=0 href=/tools/staticdocs/docs/guides/performance>Performance</a><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class=menu__link tabindex=0 href=/tools/staticdocs/docs/guides/raspberrypi>Raspberry Pi</a><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current=page tabindex=0 href=/tools/staticdocs/docs/guides/script-writing>Script Writing Guide</a><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class=menu__link tabindex=0 href=/tools/staticdocs/docs/guides/scripting-api>Scripting API Guide</a></ul><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist" href=/tools/staticdocs/docs/development>Development</a><button aria-label="Expand sidebar category 'Development'" aria-expanded=false type=button class="clean-btn menu__caret"></button></div><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist" href=/tools/staticdocs/docs/meta>Meta</a><button aria-label="Expand sidebar category 'Meta'" aria-expanded=false type=button class="clean-btn menu__caret"></button></div><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class=menu__link href=/tools/staticdocs/docs/privacy>OpenC3, Inc. Privacy Policy</a></ul></nav></div></div></aside><main class=docMainContainer_namt><div class="container padding-top--md padding-bottom--lg"><div class=row><div class="col docItemCol_YAwJ"><div class=docItemContainer_Rv5Z><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_zCmv" aria-label=Breadcrumbs><ul class=breadcrumbs itemscope itemtype=https://schema.org/BreadcrumbList><li class=breadcrumbs__item><a aria-label="Home page" class=breadcrumbs__link href=/tools/staticdocs/><svg viewBox="0 0 24 24" class=breadcrumbHomeIcon_JFrk><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill=currentColor /></svg></a><li itemscope itemprop=itemListElement itemtype=https://schema.org/ListItem class=breadcrumbs__item><a class=breadcrumbs__link itemprop=item href=/tools/staticdocs/docs/guides><span itemprop=name>Guides</span></a><meta itemprop=position content=1><li itemscope itemprop=itemListElement itemtype=https://schema.org/ListItem class="breadcrumbs__item breadcrumbs__item--active"><span class=breadcrumbs__link itemprop=name>Script Writing Guide</span><meta itemprop=position content=2></ul></nav><div class="tocCollapsible_O_Qc theme-doc-toc-mobile tocMobile_tjDr"><button type=button class="clean-btn tocCollapsibleButton_htYj">On this page</button></div><div class="theme-doc-markdown markdown"><header><h1>Script Writing Guide</h1></header><h2 class="anchor anchorWithStickyNavbar_fF9Z" id=introduction>Introduction<a href=#introduction class=hash-link aria-label="Direct link to Introduction" title="Direct link to Introduction">​</a></h2>
12
2
  <p>This guide aims to provide the best practices for using the scripting capabilities provided by COSMOS. Scripts are used to automate a series of activities for operations or testing. The goal of this document is to ensure scripts are written that are simple, easy to understand, maintainable, and correct. Guidance on some of the key details of using the COSMOS Script Runner is also provided.</p>
13
- <h2 class="anchor anchorWithStickyNavbar_fF9Z" id="concepts">Concepts<a href="#concepts" class="hash-link" aria-label="Direct link to Concepts" title="Direct link to Concepts">​</a></h2>
3
+ <h2 class="anchor anchorWithStickyNavbar_fF9Z" id=concepts>Concepts<a href=#concepts class=hash-link aria-label="Direct link to Concepts" title="Direct link to Concepts">​</a></h2>
14
4
  <p>COSMOS supports both Ruby and Python for writing scripts. Ruby and Python are very similar scripting languages and most of this guide applies directly to both. Where examples are used, both a Ruby and Python example are given.</p>
15
- <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="ruby-vs-python-in-cosmos">Ruby vs Python in COSMOS<a href="#ruby-vs-python-in-cosmos" class="hash-link" aria-label="Direct link to Ruby vs Python in COSMOS" title="Direct link to Ruby vs Python in COSMOS">​</a></h3>
5
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id=ruby-vs-python-in-cosmos>Ruby vs Python in COSMOS<a href=#ruby-vs-python-in-cosmos class=hash-link aria-label="Direct link to Ruby vs Python in COSMOS" title="Direct link to Ruby vs Python in COSMOS">​</a></h3>
16
6
  <p>There are many similarities and a few key differences between Ruby and Python when it comes to writing COSMOS scripts.</p>
17
7
  <ol>
18
8
  <li>There is no 80 character limit on line length. Lines can be as long as you like, but be careful to not make them too long as it makes printed reviews of scripts more difficult.</li>
@@ -25,8 +15,8 @@
25
15
  <li>Variables do not have to be declared ahead of time and can be reassigned later, i.e. Ruby and Python are dynamically typed.</li>
26
16
  <li>Variable interpolation:<!-- -->
27
17
  <ol>
28
- <li>Ruby: Variable values can be placed into strings using the <code>&quot;#{variable}&quot;</code> syntax.</li>
29
- <li>Python: Variable values can be placed into f-strings using the <code>f&quot;{variable}&quot;</code> syntax.</li>
18
+ <li>Ruby: Variable values can be placed into strings using the <code>"#{variable}"</code> syntax.</li>
19
+ <li>Python: Variable values can be placed into f-strings using the <code>f"{variable}"</code> syntax.</li>
30
20
  </ol>
31
21
  </li>
32
22
  <li>A variable declared inside of a block or loop will not exist outside of that block unless it was already declared.</li>
@@ -41,175 +31,175 @@
41
31
  </li>
42
32
  <li>Variable names and method names should be in lowercase with underscores<!-- -->
43
33
  <ul>
44
- <li><code>last_name = &quot;Smith&quot;</code></li>
34
+ <li><code>last_name = "Smith"</code></li>
45
35
  <li><code>perform_setup_operation()</code></li>
46
36
  </ul>
47
37
  </li>
48
38
  <li>Class names (when used) should be camel case and the files which contain them should match but be lowercase with underscores<!-- -->
49
39
  <ul>
50
- <li><code>class DataUploader # in &#x27;data_uploader.rb&#x27;</code></li>
51
- <li><code>class CcsdsUtility: # in &#x27;ccsds_utility.py&#x27;</code></li>
40
+ <li><code>class DataUploader # in 'data_uploader.rb'</code></li>
41
+ <li><code>class CcsdsUtility: # in 'ccsds_utility.py'</code></li>
52
42
  </ul>
53
43
  </li>
54
- <li>Don&#x27;t add useless comments but instead describe intent</li>
44
+ <li>Don't add useless comments but instead describe intent</li>
55
45
  </ul>
56
- <div style="clear:both"></div>
46
+ <div style=clear:both></div>
57
47
  <p>The following is an example of good Ruby style:</p>
58
- <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token plain">load </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&#x27;TARGET/lib/upload_utility.rb&#x27;</span><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># library we do NOT want to show executing</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">load_utility </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&#x27;TARGET/lib/helper_utility.rb&#x27;</span><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># library we do want to show executing</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Declare constants</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token constant" style="color:rgb(130, 170, 255)">OUR_TARGETS</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&#x27;INST&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&#x27;INST2&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Clear the collect counter of the passed in target name</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">clear_collects</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">target</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">target</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)"> CLEAR&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> wait_check</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">target</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)"> HEALTH_STATUS COLLECTS == 0&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">5</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic">######################################</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># START</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic">######################################</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">helper </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token class-name" style="color:rgb(255, 203, 139)">HelperUtility</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token keyword" style="color:rgb(127, 219, 202)">new</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">helper</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">setup</span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Perform collects on all the targets</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token constant" style="color:rgb(130, 170, 255)">OUR_TARGETS</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token keyword" style="color:rgb(127, 219, 202)">each</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">do</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">|</span><span class="token plain">target</span><span class="token operator" style="color:rgb(127, 219, 202)">|</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> collects </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> tlm</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">target</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)"> HEALTH_STATUS COLLECTS&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">target</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)"> COLLECT with TYPE SPECIAL&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> wait_check</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">target</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)"> HEALTH_STATUS COLLECTS == </span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">collects </span><span class="token string-literal interpolation content operator" style="color:rgb(127, 219, 202)">+</span><span class="token string-literal interpolation content"> </span><span class="token string-literal interpolation content number" style="color:rgb(247, 140, 108)">1</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">5</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">clear_collects</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&#x27;INST&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">clear_collects</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&#x27;INST2&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
48
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token plain">load </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">'TARGET/lib/upload_utility.rb'</span><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># library we do NOT want to show executing</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">load_utility </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">'TARGET/lib/helper_utility.rb'</span><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># library we do want to show executing</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain" style=display:inline-block></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Declare constants</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token constant" style="color:rgb(130, 170, 255)">OUR_TARGETS</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">'INST'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">'INST2'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain" style=display:inline-block></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Clear the collect counter of the passed in target name</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">clear_collects</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">target</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">target</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)"> CLEAR"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> wait_check</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">target</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)"> HEALTH_STATUS COLLECTS == 0"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">5</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain" style=display:inline-block></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic">######################################</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># START</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic">######################################</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">helper </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token class-name" style="color:rgb(255, 203, 139)">HelperUtility</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token keyword" style="color:rgb(127, 219, 202)">new</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">helper</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">setup</span><br></span><span class=token-line style=color:#d6deeb><span class="token plain" style=display:inline-block></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Perform collects on all the targets</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token constant" style="color:rgb(130, 170, 255)">OUR_TARGETS</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token keyword" style="color:rgb(127, 219, 202)">each</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">do</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">|</span><span class="token plain">target</span><span class="token operator" style="color:rgb(127, 219, 202)">|</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> collects </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> tlm</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">target</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)"> HEALTH_STATUS COLLECTS"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">target</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)"> COLLECT with TYPE SPECIAL"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> wait_check</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">target</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)"> HEALTH_STATUS COLLECTS == </span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">collects </span><span class="token string-literal interpolation content operator" style="color:rgb(127, 219, 202)">+</span><span class="token string-literal interpolation content"> </span><span class="token string-literal interpolation content number" style="color:rgb(247, 140, 108)">1</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">5</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain" style=display:inline-block></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">clear_collects</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">'INST'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">clear_collects</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">'INST2'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
59
49
  <p>The following is an example of good Python style:</p>
60
- <div class="language-python codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-python codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">from</span><span class="token plain"> openc3</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">script </span><span class="token keyword" style="color:rgb(127, 219, 202)">import</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">*</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">import</span><span class="token plain"> TARGET</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">lib</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">upload_utility </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># library we do NOT want to show executing</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">load_utility</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">&#x27;TARGET/lib/helper_utility.rb&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># library we do want to show executing</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Declare constants</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">OUR_TARGETS </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(173, 219, 103)">&#x27;INST&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token string" style="color:rgb(173, 219, 103)">&#x27;INST2&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Clear the collect counter of the passed in target name</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">clear_collects</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">target</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f&quot;</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">target</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)"> CLEAR&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> wait_check</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f&quot;</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">target</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)"> HEALTH_STATUS COLLECTS == 0&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">5</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic">######################################</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># START</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic">######################################</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">helper </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> HelperUtility</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">helper</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">setup</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Perform collects on all the targets</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">for</span><span class="token plain"> target </span><span class="token keyword" style="color:rgb(127, 219, 202)">in</span><span class="token plain"> OUR_TARGETS</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> collects </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> tlm</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f&quot;</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">target</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)"> HEALTH_STATUS COLLECTS&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f&quot;</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">target</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)"> COLLECT with TYPE SPECIAL&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> wait_check</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f&quot;</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">target</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)"> HEALTH_STATUS COLLECTS == </span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">collects </span><span class="token string-interpolation interpolation operator" style="color:rgb(127, 219, 202)">+</span><span class="token string-interpolation interpolation"> </span><span class="token string-interpolation interpolation number" style="color:rgb(247, 140, 108)">1</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">5</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">clear_collects</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">&#x27;INST&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">clear_collects</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">&#x27;INST2&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
61
- <p>Both examples shows several features of COSMOS scripting in action. Notice the difference between &#x27;load&#x27; or &#x27;import&#x27; and &#x27;load_utility&#x27;. The first is to load additional scripts which will NOT be shown in Script Runner when executing. This is a good place to put code which takes a long time to run such as image analysis or other looping code where you just want the output. &#x27;load_utility&#x27; will visually execute the code line by line to show the user what is happening.</p>
50
+ <div class="language-python codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-python codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token keyword" style="color:rgb(127, 219, 202)">from</span><span class="token plain"> openc3</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">script </span><span class="token keyword" style="color:rgb(127, 219, 202)">import</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">*</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain" style=display:inline-block></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">import</span><span class="token plain"> TARGET</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">lib</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">upload_utility </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># library we do NOT want to show executing</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">load_utility</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">'TARGET/lib/helper_utility.rb'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># library we do want to show executing</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain" style=display:inline-block></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Declare constants</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">OUR_TARGETS </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(173, 219, 103)">'INST'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token string" style="color:rgb(173, 219, 103)">'INST2'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain" style=display:inline-block></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Clear the collect counter of the passed in target name</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">clear_collects</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">target</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f"</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">target</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)"> CLEAR"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> wait_check</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f"</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">target</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)"> HEALTH_STATUS COLLECTS == 0"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">5</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain" style=display:inline-block></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic">######################################</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># START</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic">######################################</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">helper </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> HelperUtility</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">helper</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">setup</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain" style=display:inline-block></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Perform collects on all the targets</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">for</span><span class="token plain"> target </span><span class="token keyword" style="color:rgb(127, 219, 202)">in</span><span class="token plain"> OUR_TARGETS</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> collects </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> tlm</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f"</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">target</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)"> HEALTH_STATUS COLLECTS"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f"</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">target</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)"> COLLECT with TYPE SPECIAL"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> wait_check</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f"</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">target</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)"> HEALTH_STATUS COLLECTS == </span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">collects </span><span class="token string-interpolation interpolation operator" style="color:rgb(127, 219, 202)">+</span><span class="token string-interpolation interpolation"> </span><span class="token string-interpolation interpolation number" style="color:rgb(247, 140, 108)">1</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">5</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain" style=display:inline-block></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">clear_collects</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">'INST'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">clear_collects</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">'INST2'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
51
+ <p>Both examples shows several features of COSMOS scripting in action. Notice the difference between 'load' or 'import' and 'load_utility'. The first is to load additional scripts which will NOT be shown in Script Runner when executing. This is a good place to put code which takes a long time to run such as image analysis or other looping code where you just want the output. 'load_utility' will visually execute the code line by line to show the user what is happening.</p>
62
52
  <p>Next we declare our constants and create an array of strings which we store in OUR_TARGETS. Notice the constant is all uppercase with underscores.</p>
63
53
  <p>Then we declare our local methods of which we have one called clear_collects. Please provide a comment at the beginning of each method describing what it does and the parameters that it takes.</p>
64
- <p>The &#x27;helper_utility&#x27; is then created. Note the similarity in the class name and the file name we loaded.</p>
65
- <p>The collect example shows how you can iterate over the array of strings we previously created and use variables when commanding and checking telemetry. The Ruby pound bracket #<!-- --> notation and python f-string f&quot;<!-- --> notation puts whatever the variable holds into the string. You can even execute additional code inside the brackets like we do when checking for the collect count to increment.</p>
66
- <p>Finally we call our &#x27;clear_collects&#x27; method on each target by passing the target name.</p>
67
- <h2 class="anchor anchorWithStickyNavbar_fF9Z" id="scripting-philosophy">Scripting Philosophy<a href="#scripting-philosophy" class="hash-link" aria-label="Direct link to Scripting Philosophy" title="Direct link to Scripting Philosophy">​</a></h2>
68
- <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="a-super-basic-script-example">A Super Basic Script Example<a href="#a-super-basic-script-example" class="hash-link" aria-label="Direct link to A Super Basic Script Example" title="Direct link to A Super Basic Script Example">​</a></h3>
54
+ <p>The 'helper_utility' is then created. Note the similarity in the class name and the file name we loaded.</p>
55
+ <p>The collect example shows how you can iterate over the array of strings we previously created and use variables when commanding and checking telemetry. The Ruby pound bracket #<!-- --> notation and python f-string f"<!-- --> notation puts whatever the variable holds into the string. You can even execute additional code inside the brackets like we do when checking for the collect count to increment.</p>
56
+ <p>Finally we call our 'clear_collects' method on each target by passing the target name.</p>
57
+ <h2 class="anchor anchorWithStickyNavbar_fF9Z" id=scripting-philosophy>Scripting Philosophy<a href=#scripting-philosophy class=hash-link aria-label="Direct link to Scripting Philosophy" title="Direct link to Scripting Philosophy">​</a></h2>
58
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id=a-super-basic-script-example>A Super Basic Script Example<a href=#a-super-basic-script-example class=hash-link aria-label="Direct link to A Super Basic Script Example" title="Direct link to A Super Basic Script Example">​</a></h3>
69
59
  <p>Most COSMOS scripts can be broken down into the simple pattern of sending a command to a system/subsystem and then verifying that the command worked as expected. This pattern is most commonly implemented with cmd() followed by wait_check(), like the following:</p>
70
- <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token plain">cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;INST COLLECT with TYPE NORMAL, TEMP 10.0&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">wait_check</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;INST HEALTH_STATUS TYPE == &#x27;NORMAL&#x27;&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">5</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
60
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token plain">cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"INST COLLECT with TYPE NORMAL, TEMP 10.0"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">wait_check</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"INST HEALTH_STATUS TYPE == 'NORMAL'"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">5</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
71
61
  <p>or similarly with a counter that is sampled before the command.</p>
72
62
  <p>Ruby:</p>
73
- <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token plain">count </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> tlm</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;INST HEALTH_STATUS COLLECTS&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;INST COLLECT with TYPE NORMAL, TEMP 10.0&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">wait_check</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;INST HEALTH_STATUS COLLECTS &gt;= </span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">count </span><span class="token string-literal interpolation content operator" style="color:rgb(127, 219, 202)">+</span><span class="token string-literal interpolation content"> </span><span class="token string-literal interpolation content number" style="color:rgb(247, 140, 108)">1</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">5</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
63
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token plain">count </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> tlm</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"INST HEALTH_STATUS COLLECTS"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"INST COLLECT with TYPE NORMAL, TEMP 10.0"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">wait_check</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"INST HEALTH_STATUS COLLECTS >= </span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">count </span><span class="token string-literal interpolation content operator" style="color:rgb(127, 219, 202)">+</span><span class="token string-literal interpolation content"> </span><span class="token string-literal interpolation content number" style="color:rgb(247, 140, 108)">1</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">5</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
74
64
  <p>Python:</p>
75
- <div class="language-python codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-python codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token plain">count </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> tlm</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">&quot;INST HEALTH_STATUS COLLECTS&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">&quot;INST COLLECT with TYPE NORMAL, TEMP 10.0&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">wait_check</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f&quot;INST HEALTH_STATUS COLLECTS &gt;= </span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">count </span><span class="token string-interpolation interpolation operator" style="color:rgb(127, 219, 202)">+</span><span class="token string-interpolation interpolation"> </span><span class="token string-interpolation interpolation number" style="color:rgb(247, 140, 108)">1</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">5</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
65
+ <div class="language-python codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-python codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token plain">count </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> tlm</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">"INST HEALTH_STATUS COLLECTS"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">"INST COLLECT with TYPE NORMAL, TEMP 10.0"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">wait_check</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f"INST HEALTH_STATUS COLLECTS >= </span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">count </span><span class="token string-interpolation interpolation operator" style="color:rgb(127, 219, 202)">+</span><span class="token string-interpolation interpolation"> </span><span class="token string-interpolation interpolation number" style="color:rgb(247, 140, 108)">1</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">5</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
76
66
  <p>90% of the COSMOS scripts you write should be the simple patterns shown above except that you may need to check more than one item after each command to make sure the command worked as expected.</p>
77
- <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="kiss-keep-it-simple-stupid">KISS (Keep It Simple Stupid)<a href="#kiss-keep-it-simple-stupid" class="hash-link" aria-label="Direct link to KISS (Keep It Simple Stupid)" title="Direct link to KISS (Keep It Simple Stupid)">​</a></h3>
78
- <p>Ruby and Python are very powerful languages with many ways to accomplish the same thing. Given that, always choose the method that is easiest to understand for yourself and others. While it is possible to create complex one liners or obtuse regular expressions, you&#x27;ll thank yourself later by expanding complex one liners and breaking up and documenting regular expressions.</p>
79
- <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="keep-things-dry-dont-repeat-yourself">Keep things DRY (Don&#x27;t Repeat Yourself)<a href="#keep-things-dry-dont-repeat-yourself" class="hash-link" aria-label="Direct link to Keep things DRY (Don&#x27;t Repeat Yourself)" title="Direct link to Keep things DRY (Don&#x27;t Repeat Yourself)">​</a></h3>
67
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id=kiss-keep-it-simple-stupid>KISS (Keep It Simple Stupid)<a href=#kiss-keep-it-simple-stupid class=hash-link aria-label="Direct link to KISS (Keep It Simple Stupid)" title="Direct link to KISS (Keep It Simple Stupid)">​</a></h3>
68
+ <p>Ruby and Python are very powerful languages with many ways to accomplish the same thing. Given that, always choose the method that is easiest to understand for yourself and others. While it is possible to create complex one liners or obtuse regular expressions, you'll thank yourself later by expanding complex one liners and breaking up and documenting regular expressions.</p>
69
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id=keep-things-dry-dont-repeat-yourself>Keep things DRY (Don't Repeat Yourself)<a href=#keep-things-dry-dont-repeat-yourself class=hash-link aria-label="Direct link to Keep things DRY (Don't Repeat Yourself)" title="Direct link to Keep things DRY (Don't Repeat Yourself)">​</a></h3>
80
70
  <p>A widespread problem in scripts written for any command and control system is large blocks of code that are repeated multiple times. In extreme cases, this has led to 100,000+ line scripts that are impossible to maintain and review.</p>
81
71
  <p>There are two common ways repetition presents itself: exact blocks of code to perform a common action such as powering on a subsystem, and blocks of code that only differ in the name of the mnemonic being checked or the values checked against. Both are solved by removing the repetition using methods (or functions).</p>
82
72
  <p>For example, a script that powers on a subsystem and ensures correct telemetry would become:</p>
83
73
  <p>Ruby:</p>
84
- <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">power_on_subsystem</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># 100 lines of cmd(), wait_check(), etc</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
74
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">power_on_subsystem</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># 100 lines of cmd(), wait_check(), etc</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
85
75
  <p>Python:</p>
86
- <div class="language-python codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-python codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">power_on_subsystem</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># 100 lines of cmd(), wait_check(), etc</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
76
+ <div class="language-python codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-python codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">power_on_subsystem</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># 100 lines of cmd(), wait_check(), etc</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
87
77
  <p>Ideally, the above methods would be stored in another file where it could be used by other scripts. If it is truly only useful in the one script, then it could be at the top of the file. The updated script would then look like:</p>
88
- <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token plain">power_on_subsystem</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># 150 lines operating the subsystem (e.g.)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># cmd(...)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># wait_check(...)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic">#...</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">power_off_subystem</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Unrelated activities</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">power_on_subsystem</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># etc.</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
78
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token plain">power_on_subsystem</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># 150 lines operating the subsystem (e.g.)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># cmd(...)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># wait_check(...)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic">#...</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">power_off_subystem</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Unrelated activities</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">power_on_subsystem</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># etc.</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
89
79
  <p>Blocks of code where only the only variation is the mnemonics or values checked can be replaced by methods with arguments.</p>
90
80
  <p>Ruby:</p>
91
- <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">test_minimum_temp</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">enable_cmd_name</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> enable_tlm</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> temp_tlm</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> expected_temp</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;TARGET </span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">enable_cmd_name</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)"> with ENABLE TRUE&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> wait_check</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;TARGET </span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">enable_tlm</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)"> == &#x27;TRUE&#x27;&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">5</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> wait_check</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;TARGET </span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">temp_tlm</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)"> &gt;= </span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">expected_temp</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">50</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
81
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">test_minimum_temp</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">enable_cmd_name</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> enable_tlm</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> temp_tlm</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> expected_temp</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"TARGET </span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">enable_cmd_name</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)"> with ENABLE TRUE"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> wait_check</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"TARGET </span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">enable_tlm</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)"> == 'TRUE'"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">5</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> wait_check</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"TARGET </span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">temp_tlm</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)"> >= </span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">expected_temp</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">50</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
92
82
  <p>Python:</p>
93
- <div class="language-python codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-python codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">test_minimum_temp</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">enable_cmd_name</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> enable_tlm</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> temp_tlm</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> expected_temp</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f&quot;TARGET </span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">enable_cmd_name</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)"> with ENABLE TRUE&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> wait_check</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f&quot;TARGET </span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">enable_tlm</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)"> == &#x27;TRUE&#x27;&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">5</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> wait_check</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f&quot;TARGET </span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">temp_tlm</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)"> &gt;= </span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">expected_temp</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">50</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
94
- <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="use-comments-appropriately">Use Comments Appropriately<a href="#use-comments-appropriately" class="hash-link" aria-label="Direct link to Use Comments Appropriately" title="Direct link to Use Comments Appropriately">​</a></h3>
83
+ <div class="language-python codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-python codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">test_minimum_temp</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">enable_cmd_name</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> enable_tlm</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> temp_tlm</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> expected_temp</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f"TARGET </span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">enable_cmd_name</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)"> with ENABLE TRUE"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> wait_check</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f"TARGET </span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">enable_tlm</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)"> == 'TRUE'"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">5</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> wait_check</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f"TARGET </span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">temp_tlm</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)"> >= </span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">expected_temp</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">50</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
84
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id=use-comments-appropriately>Use Comments Appropriately<a href=#use-comments-appropriately class=hash-link aria-label="Direct link to Use Comments Appropriately" title="Direct link to Use Comments Appropriately">​</a></h3>
95
85
  <p>Use comments when what you are doing is unclear or there is a higher-level purpose to a set of lines. Try to avoid putting numbers or other details in a comment as they can become out of sync with the underlying code. Ruby and Python comments start with a # pound symbol and can be anywhere on a line.</p>
96
- <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># This line sends an abort command - BAD COMMENT, UNNECESSARY</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;INST ABORT&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Rotate the gimbal to look at the calibration target - GOOD COMMENT</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;INST ROTATE with ANGLE 180.0&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Rotate 180 degrees - BAD COMMENT</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
97
- <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="script-runner">Script Runner<a href="#script-runner" class="hash-link" aria-label="Direct link to Script Runner" title="Direct link to Script Runner">​</a></h3>
86
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># This line sends an abort command - BAD COMMENT, UNNECESSARY</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"INST ABORT"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Rotate the gimbal to look at the calibration target - GOOD COMMENT</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"INST ROTATE with ANGLE 180.0"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Rotate 180 degrees - BAD COMMENT</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
87
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id=script-runner>Script Runner<a href=#script-runner class=hash-link aria-label="Direct link to Script Runner" title="Direct link to Script Runner">​</a></h3>
98
88
  <p>COSMOS provides two unique ways to run scripts (also known as procedures). Script Runner provides both a script execution environment and a script editor. The script editor includes code completion for both COSMOS methods and command/telemetry item names. It is also a great environment to develop and test scripts. Script Runner provides a framework for users that are familiar with a traditional scripting model with longer style procedures, and for users that want to be able to edit their scripts in place.</p>
99
- <p>When opening a suite file (named with &#x27;suite&#x27;) Script Runner provides a more formal, but also more powerful, environment for running scripts. Suite files breaks scripts down into suites, groups, and scripts (individual methods). Suites are the highest-level concept and would typically cover a large procedure such as a thermal vacuum test, or a large operations scenario such as performing on orbit checkout. Groups capture a related set of scripts such as all the scripts regarding a specific mechanism. A Group might be a collection of scripts all related to a subsystem, or a specific series of tests such as an RF checkout. Scripts capture individual activities that can either pass or fail. Script Runner allows for running an entire suite, one or more groups, or one or more scripts easily. It also automatically produces reports containing timing, pass / fail counts, etc.</p>
89
+ <p>When opening a suite file (named with 'suite') Script Runner provides a more formal, but also more powerful, environment for running scripts. Suite files breaks scripts down into suites, groups, and scripts (individual methods). Suites are the highest-level concept and would typically cover a large procedure such as a thermal vacuum test, or a large operations scenario such as performing on orbit checkout. Groups capture a related set of scripts such as all the scripts regarding a specific mechanism. A Group might be a collection of scripts all related to a subsystem, or a specific series of tests such as an RF checkout. Scripts capture individual activities that can either pass or fail. Script Runner allows for running an entire suite, one or more groups, or one or more scripts easily. It also automatically produces reports containing timing, pass / fail counts, etc.</p>
100
90
  <p>The correct environment for the job is up to individual users, and many programs will use both script formats to complete their goals.</p>
101
- <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="looping-vs-unrolled-loops">Looping vs Unrolled Loops<a href="#looping-vs-unrolled-loops" class="hash-link" aria-label="Direct link to Looping vs Unrolled Loops" title="Direct link to Looping vs Unrolled Loops">​</a></h3>
91
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id=looping-vs-unrolled-loops>Looping vs Unrolled Loops<a href=#looping-vs-unrolled-loops class=hash-link aria-label="Direct link to Looping vs Unrolled Loops" title="Direct link to Looping vs Unrolled Loops">​</a></h3>
102
92
  <p>Loops are powerful constructs that allow you to perform the same operations multiple times without having to rewrite the same code over and over (See the DRY Concept). However, they can make restarting a COSMOS script at the point of a failure difficult or impossible. If there is a low probability of something failing, then loops are an excellent choice. If a script is running a loop over a list of telemetry points, it may be a better choice to “unroll” the loop by making the loop body into a method, and then calling that method directly for each iteration of a loop that would have occurred.</p>
103
93
  <p>Ruby:</p>
104
- <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token number" style="color:rgb(247, 140, 108)">10.</span><span class="token plain">times </span><span class="token keyword" style="color:rgb(127, 219, 202)">do</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">|</span><span class="token plain">temperature_number</span><span class="token operator" style="color:rgb(127, 219, 202)">|</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> check_temperature</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">temperature_number </span><span class="token operator" style="color:rgb(127, 219, 202)">+</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
94
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token number" style="color:rgb(247, 140, 108)">10.</span><span class="token plain">times </span><span class="token keyword" style="color:rgb(127, 219, 202)">do</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">|</span><span class="token plain">temperature_number</span><span class="token operator" style="color:rgb(127, 219, 202)">|</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> check_temperature</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">temperature_number </span><span class="token operator" style="color:rgb(127, 219, 202)">+</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
105
95
  <p>Python:</p>
106
- <div class="language-python codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-python codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">for</span><span class="token plain"> temperature_number </span><span class="token keyword" style="color:rgb(127, 219, 202)">in</span><span class="token plain"> </span><span class="token builtin" style="color:rgb(130, 170, 255)">range</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">11</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> check_temperature</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">temperature_number</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
96
+ <div class="language-python codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-python codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token keyword" style="color:rgb(127, 219, 202)">for</span><span class="token plain"> temperature_number </span><span class="token keyword" style="color:rgb(127, 219, 202)">in</span><span class="token plain"> </span><span class="token builtin" style="color:rgb(130, 170, 255)">range</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">11</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> check_temperature</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">temperature_number</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
107
97
  <p>If the above script was stopped after temperature number 3, there would be no way to restart the loop at temperature number 4. A better solution for small loop counts is to unroll the loop.</p>
108
- <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token plain">check_temperature</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">check_temperature</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">2</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">check_temperature</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">3</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">check_temperature</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">4</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">check_temperature</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">5</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">check_temperature</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">6</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">check_temperature</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">7</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">check_temperature</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">8</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">check_temperature</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">9</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">check_temperature</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">10</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
98
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token plain">check_temperature</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">check_temperature</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">2</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">check_temperature</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">3</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">check_temperature</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">4</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">check_temperature</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">5</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">check_temperature</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">6</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">check_temperature</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">7</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">check_temperature</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">8</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">check_temperature</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">9</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">check_temperature</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">10</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
109
99
  <p>In the unrolled version above, the COSMOS “Start script at selected line” feature can be used to resume the script at any point.</p>
110
- <h2 class="anchor anchorWithStickyNavbar_fF9Z" id="script-organization">Script Organization<a href="#script-organization" class="hash-link" aria-label="Direct link to Script Organization" title="Direct link to Script Organization">​</a></h2>
111
- <p>All scripts must be part of a <a href="/tools/staticdocs/docs/configuration/plugins">Plugin</a>. You can create a simple plugin called SCRIPTS or PROCEDURES that only contains lib and procedures directories to store scripts. If COSMOS detects a plugin without defined cmd/tlm it will not spawn microservices for telemetry processing.</p>
112
- <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="organizing-your-scripts-into-a-plugin">Organizing Your Scripts into a Plugin<a href="#organizing-your-scripts-into-a-plugin" class="hash-link" aria-label="Direct link to Organizing Your Scripts into a Plugin" title="Direct link to Organizing Your Scripts into a Plugin">​</a></h3>
113
- <p>As your scripts become large with many methods, it makes sense to break them up into multiple files within a plugin. Here is a recommended organization for your plugin&#x27;s scripts/procedures.</p>
114
- <table><thead><tr><th>Folder</th><th>Description</th></tr></thead><tbody><tr><td>targets/TARGET_NAME/lib</td><td>Place script files containing reusable target specific methods here</td></tr><tr><td>targets/TARGET_NAME/procedures</td><td>Place simple procedures that are centered around one specific target here</td></tr></tbody></table>
100
+ <h2 class="anchor anchorWithStickyNavbar_fF9Z" id=script-organization>Script Organization<a href=#script-organization class=hash-link aria-label="Direct link to Script Organization" title="Direct link to Script Organization">​</a></h2>
101
+ <p>All scripts must be part of a <a href=/tools/staticdocs/docs/configuration/plugins>Plugin</a>. You can create a simple plugin called SCRIPTS or PROCEDURES that only contains lib and procedures directories to store scripts. If COSMOS detects a plugin without defined cmd/tlm it will not spawn microservices for telemetry processing.</p>
102
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id=organizing-your-scripts-into-a-plugin>Organizing Your Scripts into a Plugin<a href=#organizing-your-scripts-into-a-plugin class=hash-link aria-label="Direct link to Organizing Your Scripts into a Plugin" title="Direct link to Organizing Your Scripts into a Plugin">​</a></h3>
103
+ <p>As your scripts become large with many methods, it makes sense to break them up into multiple files within a plugin. Here is a recommended organization for your plugin's scripts/procedures.</p>
104
+ <table><thead><tr><th>Folder<th>Description<tbody><tr><td>targets/TARGET_NAME/lib<td>Place script files containing reusable target specific methods here<tr><td>targets/TARGET_NAME/procedures<td>Place simple procedures that are centered around one specific target here</table>
115
105
  <p>In your main procedure you will usually bring in the other files with instrumentation using load_utility.</p>
116
- <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Ruby:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">load_utility</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&#x27;TARGET/lib/my_other_script.rb&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Python:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">load_utility</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&#x27;TARGET/procedures/my_other_script.py&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
117
- <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="organize-scripts-into-methods">Organize Scripts into Methods<a href="#organize-scripts-into-methods" class="hash-link" aria-label="Direct link to Organize Scripts into Methods" title="Direct link to Organize Scripts into Methods">​</a></h3>
106
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Ruby:</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">load_utility</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">'TARGET/lib/my_other_script.rb'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Python:</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">load_utility</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">'TARGET/procedures/my_other_script.py'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
107
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id=organize-scripts-into-methods>Organize Scripts into Methods<a href=#organize-scripts-into-methods class=hash-link aria-label="Direct link to Organize Scripts into Methods" title="Direct link to Organize Scripts into Methods">​</a></h3>
118
108
  <p>Put each activity into a distinct method. Putting your scripts into methods makes organization easy and gives a great high-level overview of what the overall script does (assuming you name the methods well). There are no bonus points for vague, short method names. Make your method names long and clear.</p>
119
109
  <p>Ruby:</p>
120
- <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">test_1_heater_zone_control</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> puts </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;Verifies requirements 304, 306, and 310&quot;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Test code here</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">script_1_heater_zone_control</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> puts </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;Verifies requirements 304, 306, and 310&quot;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Test code here</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
110
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">test_1_heater_zone_control</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> puts </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"Verifies requirements 304, 306, and 310"</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Test code here</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain" style=display:inline-block></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">script_1_heater_zone_control</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> puts </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"Verifies requirements 304, 306, and 310"</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Test code here</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
121
111
  <p>Python:</p>
122
- <div class="language-python codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-python codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">test_1_heater_zone_control</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">print</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">&quot;Verifies requirements 304, 306, and 310&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Test code here</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">script_1_heater_zone_control</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">print</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">&quot;Verifies requirements 304, 306, and 310&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Test code here</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
123
- <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="using-classes-vs-unscoped-methods">Using Classes vs Unscoped Methods<a href="#using-classes-vs-unscoped-methods" class="hash-link" aria-label="Direct link to Using Classes vs Unscoped Methods" title="Direct link to Using Classes vs Unscoped Methods">​</a></h3>
112
+ <div class="language-python codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-python codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">test_1_heater_zone_control</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">print</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">"Verifies requirements 304, 306, and 310"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Test code here</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain" style=display:inline-block></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">script_1_heater_zone_control</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">print</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">"Verifies requirements 304, 306, and 310"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Test code here</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
113
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id=using-classes-vs-unscoped-methods>Using Classes vs Unscoped Methods<a href=#using-classes-vs-unscoped-methods class=hash-link aria-label="Direct link to Using Classes vs Unscoped Methods" title="Direct link to Using Classes vs Unscoped Methods">​</a></h3>
124
114
  <p>Classes in object-oriented programming allow you to organize a set of related methods and some associated state. The most important aspect is that the methods work on some shared state. For example, if you have code that moves a gimbal around, and need to keep track of the number of moves, or steps, performed across methods, then that is a wonderful place to use a class. If you just need a helper method to do something that happens multiple times in a script without copy and pasting, it probably does not need to be in a class.</p>
125
115
  <p>NOTE: The convention in COSMOS is to have a TARGET/lib/target.[rb/py] file which is named after the TARGET name and contains a class called Target. This discussion refers to scripts in the TARGET/procedures directory.</p>
126
116
  <p>Ruby:</p>
127
- <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">class</span><span class="token plain"> </span><span class="token class-name" style="color:rgb(255, 203, 139)">Gimbal</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> attr_accessor </span><span class="token symbol">:gimbal_steps</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">initialize</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token variable" style="color:rgb(214, 222, 235)">@gimbal_steps</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">move</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">steps_to_move</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Move the gimbal</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token variable" style="color:rgb(214, 222, 235)">@gimbal_steps</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">+=</span><span class="token plain"> steps_to_move</span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">home_gimbal</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Home the gimbal</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token variable" style="color:rgb(214, 222, 235)">@gimbal_steps</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">perform_common_math</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">x</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> y</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> x </span><span class="token operator" style="color:rgb(127, 219, 202)">+</span><span class="token plain"> y</span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">gimbal </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token class-name" style="color:rgb(255, 203, 139)">Gimbal</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token keyword" style="color:rgb(127, 219, 202)">new</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">gimbal</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">home_gimbal</span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">gimbal</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">move</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">100</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">gimbal</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">move</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">200</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">puts </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;Moved gimbal </span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">gimbal</span><span class="token string-literal interpolation content punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token string-literal interpolation content">gimbal_steps</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">result </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> perform_common_math</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">gimbal</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">gimbal_steps</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">10</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">puts </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;Math:</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">result</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
117
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token keyword" style="color:rgb(127, 219, 202)">class</span><span class="token plain"> </span><span class="token class-name" style="color:rgb(255, 203, 139)">Gimbal</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> attr_accessor </span><span class="token symbol">:gimbal_steps</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">initialize</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token variable" style="color:rgb(214, 222, 235)">@gimbal_steps</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">move</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">steps_to_move</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Move the gimbal</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token variable" style="color:rgb(214, 222, 235)">@gimbal_steps</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">+=</span><span class="token plain"> steps_to_move</span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">home_gimbal</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Home the gimbal</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token variable" style="color:rgb(214, 222, 235)">@gimbal_steps</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain" style=display:inline-block></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">perform_common_math</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">x</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> y</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> x </span><span class="token operator" style="color:rgb(127, 219, 202)">+</span><span class="token plain"> y</span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain" style=display:inline-block></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">gimbal </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token class-name" style="color:rgb(255, 203, 139)">Gimbal</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token keyword" style="color:rgb(127, 219, 202)">new</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">gimbal</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">home_gimbal</span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">gimbal</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">move</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">100</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">gimbal</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">move</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">200</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">puts </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"Moved gimbal </span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">gimbal</span><span class="token string-literal interpolation content punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token string-literal interpolation content">gimbal_steps</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">result </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> perform_common_math</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">gimbal</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">gimbal_steps</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">10</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">puts </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"Math:</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">result</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
128
118
  <p>Python:</p>
129
- <div class="language-python codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-python codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">class</span><span class="token plain"> </span><span class="token class-name" style="color:rgb(255, 203, 139)">Gimbal</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">__init__</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">gimbal_steps </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">move</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> steps_to_move</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Move the gimbal</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">gimbal_steps </span><span class="token operator" style="color:rgb(127, 219, 202)">+=</span><span class="token plain"> steps_to_move</span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">home_gimbal</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Home the gimbal</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">gimbal_steps </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">perform_common_math</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">x</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> y</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">return</span><span class="token plain"> x </span><span class="token operator" style="color:rgb(127, 219, 202)">+</span><span class="token plain"> y</span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">gimbal </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> Gimbal</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">gimbal</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">home_gimbal</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">gimbal</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">move</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">100</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">gimbal</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">move</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">200</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">print</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f&quot;Moved gimbal </span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">gimbal</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token string-interpolation interpolation">gimbal_steps</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">result </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> perform_common_math</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">gimbal</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">gimbal_steps</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">10</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">print</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f&quot;Math:</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">result</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
130
- <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="instrumented-vs-uninstrumented-lines-require-vs-load">Instrumented vs Uninstrumented Lines (require vs load)<a href="#instrumented-vs-uninstrumented-lines-require-vs-load" class="hash-link" aria-label="Direct link to Instrumented vs Uninstrumented Lines (require vs load)" title="Direct link to Instrumented vs Uninstrumented Lines (require vs load)">​</a></h3>
131
- <p>COSMOS scripts are normally “instrumented”. This means that each line has some extra code added behind the scenes that primarily highlights the current executing line and catches exceptions if things fail such as a wait_check. If your script needs to use code in other files, there are a few ways to bring in that code. Some techniques bring in instrumented code and others bring in uninstrumented code. There are reasons to use both.</p>
119
+ <div class="language-python codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-python codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token keyword" style="color:rgb(127, 219, 202)">class</span><span class="token plain"> </span><span class="token class-name" style="color:rgb(255, 203, 139)">Gimbal</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">__init__</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">gimbal_steps </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain" style=display:inline-block></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">move</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> steps_to_move</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Move the gimbal</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">gimbal_steps </span><span class="token operator" style="color:rgb(127, 219, 202)">+=</span><span class="token plain"> steps_to_move</span><br></span><span class=token-line style=color:#d6deeb><span class="token plain" style=display:inline-block></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">home_gimbal</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Home the gimbal</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> self</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">gimbal_steps </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain" style=display:inline-block></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">perform_common_math</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">x</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> y</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">return</span><span class="token plain"> x </span><span class="token operator" style="color:rgb(127, 219, 202)">+</span><span class="token plain"> y</span><br></span><span class=token-line style=color:#d6deeb><span class="token plain" style=display:inline-block></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">gimbal </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> Gimbal</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">gimbal</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">home_gimbal</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">gimbal</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">move</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">100</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">gimbal</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">move</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">200</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">print</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f"Moved gimbal </span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">gimbal</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token string-interpolation interpolation">gimbal_steps</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">result </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> perform_common_math</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">gimbal</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">gimbal_steps</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">10</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">print</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f"Math:</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">result</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
120
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id=instrumented-vs-uninstrumented-lines-require-vs-load>Instrumented vs Uninstrumented Lines (require vs load)<a href=#instrumented-vs-uninstrumented-lines-require-vs-load class=hash-link aria-label="Direct link to Instrumented vs Uninstrumented Lines (require vs load)" title="Direct link to Instrumented vs Uninstrumented Lines (require vs load)">​</a></h3>
121
+ <p>COSMOS scripts are normally “instrumented”. This means that each line has some extra code added behind the scenes that primarily highlights the current executing line and catches exceptions if things fail such as a wait_check. If your script needs to use code in other files, there are a few ways to bring in that code. Some techniques bring in instrumented code and others bring in uninstrumented code. There are reasons to use both.</p>
132
122
  <p>load_utility (and the deprecated require_utility), bring in instrumented code from other files. When COSMOS runs the code in the other file, Script Runner will dive into the other file and show each line highlighted as it executes. This should be the default way to bring in other files, as it allows continuing if something fails, and provides better visibility to operators.</p>
133
- <p>However, sometimes you don&#x27;t want to display code executing from other files. Externally developed libraries generally do not like to be instrumented, and code that contains large loops or that just takes a long time to execute when highlighting lines, will be much faster if included in a method that does not instrument lines. Ruby provides two ways to bring in uninstrumented code. The first is the “load” keyword. Load will bring in the code from another file and will bring in any changes to the file if it is updated on the next call to load. “require” is like load but is optimized to only bring in the code from another file once. Therefore, if you use require and then change the file it requires, you must restart Script Runner to re-require the file and bring in the changes. In general, load is recommended over require for COSMOS scripting. One gotcha with load is that it requires the full filename including extension, while the require keyword does not.</p>
123
+ <p>However, sometimes you don't want to display code executing from other files. Externally developed libraries generally do not like to be instrumented, and code that contains large loops or that just takes a long time to execute when highlighting lines, will be much faster if included in a method that does not instrument lines. Ruby provides two ways to bring in uninstrumented code. The first is the “load” keyword. Load will bring in the code from another file and will bring in any changes to the file if it is updated on the next call to load. “require” is like load but is optimized to only bring in the code from another file once. Therefore, if you use require and then change the file it requires, you must restart Script Runner to re-require the file and bring in the changes. In general, load is recommended over require for COSMOS scripting. One gotcha with load is that it requires the full filename including extension, while the require keyword does not.</p>
134
124
  <p>In Python, libraries are included using the import syntax. Any code imported using import is not instrumented. Only the code imported using load_utility is instrumented.</p>
135
125
  <p>Finally, COSMOS scripting has a special syntax for disabling instrumentation in the middle of an instrumented script, with the disable_instrumentation method. This allows you to disable instrumentation for large loops and other activities that are too slow when running instrumented.</p>
136
126
  <p>Ruby:</p>
137
- <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token plain">temp </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">disable_instrumentation </span><span class="token keyword" style="color:rgb(127, 219, 202)">do</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Make sure nothing in here will raise exceptions!</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">5000000.</span><span class="token plain">times </span><span class="token keyword" style="color:rgb(127, 219, 202)">do</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> temp </span><span class="token operator" style="color:rgb(127, 219, 202)">+=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">puts temp</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
127
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token plain">temp </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">disable_instrumentation </span><span class="token keyword" style="color:rgb(127, 219, 202)">do</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Make sure nothing in here will raise exceptions!</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">5000000.</span><span class="token plain">times </span><span class="token keyword" style="color:rgb(127, 219, 202)">do</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> temp </span><span class="token operator" style="color:rgb(127, 219, 202)">+=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">puts temp</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
138
128
  <p>Python:</p>
139
- <div class="language-python codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-python codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token plain">temp </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">with</span><span class="token plain"> disable_instrumentation</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Make sure nothing in here will raise exceptions!</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">for</span><span class="token plain"> x </span><span class="token keyword" style="color:rgb(127, 219, 202)">in</span><span class="token plain"> </span><span class="token builtin" style="color:rgb(130, 170, 255)">range</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token number" style="color:rgb(247, 140, 108)">5000000</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> temp </span><span class="token operator" style="color:rgb(127, 219, 202)">+=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">print</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">temp</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
140
- <div class="theme-admonition theme-admonition-warning admonition_IZjC alert alert--warning"><div class="admonitionHeading_uVvU"><span class="admonitionIcon_HiR3"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>When Running Uninstrumented Code</div><div class="admonitionContent_bl22"><p>Make sure that the code will not raise any exceptions or have any check failures. If an exception is raised from uninstrumented code, then your entire script will stop.</p></div></div>
141
- <h2 class="anchor anchorWithStickyNavbar_fF9Z" id="debugging-and-auditing">Debugging and Auditing<a href="#debugging-and-auditing" class="hash-link" aria-label="Direct link to Debugging and Auditing" title="Direct link to Debugging and Auditing">​</a></h2>
142
- <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="built-in-debugging-capabilities">Built-In Debugging Capabilities<a href="#built-in-debugging-capabilities" class="hash-link" aria-label="Direct link to Built-In Debugging Capabilities" title="Direct link to Built-In Debugging Capabilities">​</a></h3>
129
+ <div class="language-python codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-python codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token plain">temp </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">with</span><span class="token plain"> disable_instrumentation</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Make sure nothing in here will raise exceptions!</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">for</span><span class="token plain"> x </span><span class="token keyword" style="color:rgb(127, 219, 202)">in</span><span class="token plain"> </span><span class="token builtin" style="color:rgb(130, 170, 255)">range</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token number" style="color:rgb(247, 140, 108)">5000000</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> temp </span><span class="token operator" style="color:rgb(127, 219, 202)">+=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">print</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">temp</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
130
+ <div class="theme-admonition theme-admonition-warning admonition_IZjC alert alert--warning"><div class=admonitionHeading_uVvU><span class=admonitionIcon_HiR3><svg viewBox="0 0 16 16"><path fill-rule=evenodd d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"/></svg></span>When Running Uninstrumented Code</div><div class=admonitionContent_bl22><p>Make sure that the code will not raise any exceptions or have any check failures. If an exception is raised from uninstrumented code, then your entire script will stop.</div></div>
131
+ <h2 class="anchor anchorWithStickyNavbar_fF9Z" id=debugging-and-auditing>Debugging and Auditing<a href=#debugging-and-auditing class=hash-link aria-label="Direct link to Debugging and Auditing" title="Direct link to Debugging and Auditing">​</a></h2>
132
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id=built-in-debugging-capabilities>Built-In Debugging Capabilities<a href=#built-in-debugging-capabilities class=hash-link aria-label="Direct link to Built-In Debugging Capabilities" title="Direct link to Built-In Debugging Capabilities">​</a></h3>
143
133
  <p>Script Runner has built in debugging capabilities that can be useful in determining why your script is behaving in a certain way. Of primary importance is the ability to inspect and set script variables.</p>
144
134
  <p>To use the debugging functionality, first select the “Toggle Debug” option from the Script Menu. This will add a small Debug: prompt to the bottom of the tool. Any code entered in this prompt will be executed when Enter is pressed. To inspect variables in a running script, pause the script and then type the variable name to print out the value of the variable in the debug prompt.</p>
145
- <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token plain">variable_name</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
135
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token plain">variable_name</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
146
136
  <p>Variables can also be set simply by using equals.</p>
147
- <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token plain">variable_name </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">5</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
137
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token plain">variable_name </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">5</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
148
138
  <p>If necessary, you can also inject commands from the debug prompt using the normal commanding methods. These commands will be logged to the Script Runner message log, which may be advantageous over using a different COSMOS tool like CmdSender (where the command would only be logged in the CmdTlmServer message log).</p>
149
- <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token plain">cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;INST COLLECT with TYPE NORMAL&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
139
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token plain">cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"INST COLLECT with TYPE NORMAL"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
150
140
  <p>Note that the debug prompt keeps the command history and you can scroll through the history by using the up and down arrows.</p>
151
- <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="breakpoints">Breakpoints<a href="#breakpoints" class="hash-link" aria-label="Direct link to Breakpoints" title="Direct link to Breakpoints">​</a></h3>
141
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id=breakpoints>Breakpoints<a href=#breakpoints class=hash-link aria-label="Direct link to Breakpoints" title="Direct link to Breakpoints">​</a></h3>
152
142
  <p>You can click the line number (left side gutter) in Script Runner to add a breakpoint. The script will automatically pause when it hits the breakpoint. Once stopped at the breakpoint, you can evaluate variables using the Debug line.</p>
153
- <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="using-disconnect-mode">Using Disconnect Mode<a href="#using-disconnect-mode" class="hash-link" aria-label="Direct link to Using Disconnect Mode" title="Direct link to Using Disconnect Mode">​</a></h3>
154
- <p>Disconnect mode is a feature of Script Runner that allows testing scripts in an environment without real hardware in the loop. Disconnect mode is started by selecting Script -&gt; Toggle Disconnect. Once selected, the user is prompted to select which targets to disconnect. By default, all targets are disconnected, which allows for testing scripts without any real hardware. Optionally, only a subset of targets can be selected which can be useful for trying out scripts in partially integrated environments.</p>
155
- <p>While in disconnect mode, commands to the disconnected targets always succeed. Additionally, all checks of disconnected targets&#x27; telemetry are immediately successful. This allows for a quick run-through of procedures for logic errors and other script specific errors without having to worry about the behavior and proper functioning of hardware.</p>
156
- <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="auditing-your-scripts">Auditing your Scripts<a href="#auditing-your-scripts" class="hash-link" aria-label="Direct link to Auditing your Scripts" title="Direct link to Auditing your Scripts">​</a></h3>
143
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id=using-disconnect-mode>Using Disconnect Mode<a href=#using-disconnect-mode class=hash-link aria-label="Direct link to Using Disconnect Mode" title="Direct link to Using Disconnect Mode">​</a></h3>
144
+ <p>Disconnect mode is a feature of Script Runner that allows testing scripts in an environment without real hardware in the loop. Disconnect mode is started by selecting Script -> Toggle Disconnect. Once selected, the user is prompted to select which targets to disconnect. By default, all targets are disconnected, which allows for testing scripts without any real hardware. Optionally, only a subset of targets can be selected which can be useful for trying out scripts in partially integrated environments.</p>
145
+ <p>While in disconnect mode, commands to the disconnected targets always succeed. Additionally, all checks of disconnected targets' telemetry are immediately successful. This allows for a quick run-through of procedures for logic errors and other script specific errors without having to worry about the behavior and proper functioning of hardware.</p>
146
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id=auditing-your-scripts>Auditing your Scripts<a href=#auditing-your-scripts class=hash-link aria-label="Direct link to Auditing your Scripts" title="Direct link to Auditing your Scripts">​</a></h3>
157
147
  <p>Script Runner includes several tools to help audit your scripts both before and after execution.</p>
158
- <h4 class="anchor anchorWithStickyNavbar_fF9Z" id="ruby-syntax-check">Ruby Syntax Check<a href="#ruby-syntax-check" class="hash-link" aria-label="Direct link to Ruby Syntax Check" title="Direct link to Ruby Syntax Check">​</a></h4>
148
+ <h4 class="anchor anchorWithStickyNavbar_fF9Z" id=ruby-syntax-check>Ruby Syntax Check<a href=#ruby-syntax-check class=hash-link aria-label="Direct link to Ruby Syntax Check" title="Direct link to Ruby Syntax Check">​</a></h4>
159
149
  <p>The Ruby Syntax Check tool is found under the Script Menu. This tool uses the ruby executable with the -c flag to run a syntax check on your script. If any syntax errors are found the exact message presented by the Ruby interpreter is shown to the user. These can be cryptic, but the most common faults are not closing a quoted string, forgetting an “end” keyword, or using a block but forgetting the proceeding “do” keyword.</p>
160
- <h2 class="anchor anchorWithStickyNavbar_fF9Z" id="common-scenarios">Common Scenarios<a href="#common-scenarios" class="hash-link" aria-label="Direct link to Common Scenarios" title="Direct link to Common Scenarios">​</a></h2>
161
- <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="user-input-best-practices">User Input Best Practices<a href="#user-input-best-practices" class="hash-link" aria-label="Direct link to User Input Best Practices" title="Direct link to User Input Best Practices">​</a></h3>
150
+ <h2 class="anchor anchorWithStickyNavbar_fF9Z" id=common-scenarios>Common Scenarios<a href=#common-scenarios class=hash-link aria-label="Direct link to Common Scenarios" title="Direct link to Common Scenarios">​</a></h2>
151
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id=user-input-best-practices>User Input Best Practices<a href=#user-input-best-practices class=hash-link aria-label="Direct link to User Input Best Practices" title="Direct link to User Input Best Practices">​</a></h3>
162
152
  <p>COSMOS provides several different methods to gather manual user input in scripts. When using user input methods that allow for arbitrary values (like ask() and ask_string()), it is very important to validate the value given in your script before moving on. When asking for text input, it is extra important to handle different casing possibilities and to ensure that invalid input will either re-prompt the user or take a safe path.</p>
163
153
  <p>Ruby:</p>
164
- <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token plain">answer </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> ask_string</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;Do you want to continue (y/n)?&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">if</span><span class="token plain"> answer </span><span class="token operator" style="color:rgb(127, 219, 202)">!=</span><span class="token plain"> </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&#x27;y&#x27;</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">and</span><span class="token plain"> answer </span><span class="token operator" style="color:rgb(127, 219, 202)">!=</span><span class="token plain"> </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&#x27;Y&#x27;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">raise</span><span class="token plain"> </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;User entered: </span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">answer</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">temp </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">0.0</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">while</span><span class="token plain"> temp </span><span class="token operator" style="color:rgb(127, 219, 202)">&lt;</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">10.0</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">or</span><span class="token plain"> temp </span><span class="token operator" style="color:rgb(127, 219, 202)">&gt;</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">50.0</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> temp </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> ask</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;Enter the desired temperature between 10.0 and 50.0&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
154
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token plain">answer </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> ask_string</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"Do you want to continue (y/n)?"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">if</span><span class="token plain"> answer </span><span class="token operator" style="color:rgb(127, 219, 202)">!=</span><span class="token plain"> </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">'y'</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">and</span><span class="token plain"> answer </span><span class="token operator" style="color:rgb(127, 219, 202)">!=</span><span class="token plain"> </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">'Y'</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">raise</span><span class="token plain"> </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"User entered: </span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">answer</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain" style=display:inline-block></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">temp </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">0.0</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">while</span><span class="token plain"> temp </span><span class="token operator" style="color:rgb(127, 219, 202)">&lt;</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">10.0</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">or</span><span class="token plain"> temp </span><span class="token operator" style="color:rgb(127, 219, 202)">></span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">50.0</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> temp </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> ask</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"Enter the desired temperature between 10.0 and 50.0"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
165
155
  <p>Python:</p>
166
- <div class="language-python codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-python codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token plain">answer </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> ask_string</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">&quot;Do you want to continue (y/n)?&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">if</span><span class="token plain"> answer </span><span class="token operator" style="color:rgb(127, 219, 202)">!=</span><span class="token plain"> </span><span class="token string" style="color:rgb(173, 219, 103)">&#x27;y&#x27;</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">and</span><span class="token plain"> answer </span><span class="token operator" style="color:rgb(127, 219, 202)">!=</span><span class="token plain"> </span><span class="token string" style="color:rgb(173, 219, 103)">&#x27;Y&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">raise</span><span class="token plain"> RuntimeError</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f&quot;User entered: </span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">answer</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">temp </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">0.0</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">while</span><span class="token plain"> temp </span><span class="token operator" style="color:rgb(127, 219, 202)">&lt;</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">10.0</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">or</span><span class="token plain"> temp </span><span class="token operator" style="color:rgb(127, 219, 202)">&gt;</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">50.0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> temp </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> ask</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">&quot;Enter the desired temperature between 10.0 and 50.0&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
156
+ <div class="language-python codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-python codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token plain">answer </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> ask_string</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">"Do you want to continue (y/n)?"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">if</span><span class="token plain"> answer </span><span class="token operator" style="color:rgb(127, 219, 202)">!=</span><span class="token plain"> </span><span class="token string" style="color:rgb(173, 219, 103)">'y'</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">and</span><span class="token plain"> answer </span><span class="token operator" style="color:rgb(127, 219, 202)">!=</span><span class="token plain"> </span><span class="token string" style="color:rgb(173, 219, 103)">'Y'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">raise</span><span class="token plain"> RuntimeError</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f"User entered: </span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">answer</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain" style=display:inline-block></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">temp </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">0.0</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">while</span><span class="token plain"> temp </span><span class="token operator" style="color:rgb(127, 219, 202)">&lt;</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">10.0</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">or</span><span class="token plain"> temp </span><span class="token operator" style="color:rgb(127, 219, 202)">></span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">50.0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> temp </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> ask</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">"Enter the desired temperature between 10.0 and 50.0"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
167
157
  <p>When possible, always use one of the other user input methods that has a constrained list of choices for your users (message_box, vertical_message_box, combo_box).</p>
168
158
  <p>Note that all these user input methods provide the user the option to “Cancel”. When cancel is clicked, the script is paused but remains at the user input line. When hitting “Go” to the continue, the user will be re-prompted to enter the value.</p>
169
- <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="conditionally-require-manual-user-input-steps">Conditionally Require Manual User Input Steps<a href="#conditionally-require-manual-user-input-steps" class="hash-link" aria-label="Direct link to Conditionally Require Manual User Input Steps" title="Direct link to Conditionally Require Manual User Input Steps">​</a></h3>
159
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id=conditionally-require-manual-user-input-steps>Conditionally Require Manual User Input Steps<a href=#conditionally-require-manual-user-input-steps class=hash-link aria-label="Direct link to Conditionally Require Manual User Input Steps" title="Direct link to Conditionally Require Manual User Input Steps">​</a></h3>
170
160
  <p>When possible, a useful design pattern is to write your scripts such that they can run without prompting for any user input. This allows the scripts to be more easily tested and provides a documented default value for any user input choices or values. To implement this pattern, all manual steps such as ask(), prompt(), and infinite wait() statements need to be wrapped with an if statement that checks the value of $manual in Ruby or RunningScript.manual in Python. If the variable is set, then the manual steps should be executed. If not, then a default value should be used.</p>
171
161
  <p>Ruby Example:</p>
172
- <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">if</span><span class="token plain"> </span><span class="token variable" style="color:rgb(214, 222, 235)">$manual</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> temp </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> ask</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;Please enter the temperature&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">else</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> temp </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">20.0</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">if</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">!</span><span class="token variable" style="color:rgb(214, 222, 235)">$manual</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> puts </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;Skipping infinite wait in auto mode&quot;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">else</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> wait</span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
162
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token keyword" style="color:rgb(127, 219, 202)">if</span><span class="token plain"> </span><span class="token variable" style="color:rgb(214, 222, 235)">$manual</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> temp </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> ask</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"Please enter the temperature"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">else</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> temp </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">20.0</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">if</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">!</span><span class="token variable" style="color:rgb(214, 222, 235)">$manual</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> puts </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"Skipping infinite wait in auto mode"</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">else</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> wait</span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
173
163
  <p>Python Example:</p>
174
- <div class="language-python codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-python codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">if</span><span class="token plain"> RunningScript</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">manual</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> temp </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> ask</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">&quot;Please enter the temperature&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">else</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> temp </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">20.0</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">if</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">not</span><span class="token plain"> RunningScript</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">manual</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">print</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">&quot;Skipping infinite wait in auto mode&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">else</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> wait</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
164
+ <div class="language-python codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-python codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token keyword" style="color:rgb(127, 219, 202)">if</span><span class="token plain"> RunningScript</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">manual</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> temp </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> ask</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">"Please enter the temperature"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">else</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> temp </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">20.0</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">if</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">not</span><span class="token plain"> RunningScript</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">manual</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">print</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">"Skipping infinite wait in auto mode"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">else</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> wait</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
175
165
  <p>When running suites, there is a checkbox at the top of the tool called “Manual” that affects this $manual variable directly.</p>
176
- <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="outputting-extra-information-to-a-report">Outputting Extra Information to a Report<a href="#outputting-extra-information-to-a-report" class="hash-link" aria-label="Direct link to Outputting Extra Information to a Report" title="Direct link to Outputting Extra Information to a Report">​</a></h3>
166
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id=outputting-extra-information-to-a-report>Outputting Extra Information to a Report<a href=#outputting-extra-information-to-a-report class=hash-link aria-label="Direct link to Outputting Extra Information to a Report" title="Direct link to Outputting Extra Information to a Report">​</a></h3>
177
167
  <p>COSMOS Script Runner operating on a script suite automatically generates a report that shows the PASS/FAILED/SKIPPED state for each script. You can also inject arbitrary text into this report using the example as follows. Alternatively, you can simply use print text into the Script Runner message log.</p>
178
168
  <p>Ruby:</p>
179
- <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">class</span><span class="token plain"> </span><span class="token class-name" style="color:rgb(255, 203, 139)">MyGroup</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">&lt;</span><span class="token plain"> OpenC3</span><span class="token double-colon punctuation" style="color:rgb(199, 146, 234)">::</span><span class="token plain">Group</span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">script_1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># The following text will be placed in the report</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> OpenC3</span><span class="token double-colon punctuation" style="color:rgb(199, 146, 234)">::</span><span class="token plain">Group</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">puts </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;Verifies requirements 304, 306, 310&quot;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># This puts line will show up in the sr_messages log file</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> puts </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;script_1 complete&quot;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
169
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token keyword" style="color:rgb(127, 219, 202)">class</span><span class="token plain"> </span><span class="token class-name" style="color:rgb(255, 203, 139)">MyGroup</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">&lt;</span><span class="token plain"> OpenC3</span><span class="token double-colon punctuation" style="color:rgb(199, 146, 234)">::</span><span class="token plain">Group</span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">script_1</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># The following text will be placed in the report</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> OpenC3</span><span class="token double-colon punctuation" style="color:rgb(199, 146, 234)">::</span><span class="token plain">Group</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">puts </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"Verifies requirements 304, 306, 310"</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># This puts line will show up in the sr_messages log file</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> puts </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"script_1 complete"</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
180
170
  <p>Python:</p>
181
- <div class="language-python codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-python codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">from</span><span class="token plain"> openc3</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">script</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">suite </span><span class="token keyword" style="color:rgb(127, 219, 202)">import</span><span class="token plain"> Group</span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">class</span><span class="token plain"> </span><span class="token class-name" style="color:rgb(255, 203, 139)">MyGroup</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">Group</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">script_1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># The following text will be placed in the report</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> Group</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token keyword" style="color:rgb(127, 219, 202)">print</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">&quot;Verifies requirements 304, 306, 310&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># This puts line will show up in the sr_messages log file</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">print</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">&quot;script_1 complete&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
182
- <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="getting-the-most-recent-value-of-a-telemetry-point-from-multiple-packets">Getting the Most Recent Value of a Telemetry Point from Multiple Packets<a href="#getting-the-most-recent-value-of-a-telemetry-point-from-multiple-packets" class="hash-link" aria-label="Direct link to Getting the Most Recent Value of a Telemetry Point from Multiple Packets" title="Direct link to Getting the Most Recent Value of a Telemetry Point from Multiple Packets">​</a></h3>
171
+ <div class="language-python codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-python codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token keyword" style="color:rgb(127, 219, 202)">from</span><span class="token plain"> openc3</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">script</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">suite </span><span class="token keyword" style="color:rgb(127, 219, 202)">import</span><span class="token plain"> Group</span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">class</span><span class="token plain"> </span><span class="token class-name" style="color:rgb(255, 203, 139)">MyGroup</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">Group</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">script_1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># The following text will be placed in the report</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> Group</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token keyword" style="color:rgb(127, 219, 202)">print</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">"Verifies requirements 304, 306, 310"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># This puts line will show up in the sr_messages log file</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">print</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">"script_1 complete"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
172
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id=getting-the-most-recent-value-of-a-telemetry-point-from-multiple-packets>Getting the Most Recent Value of a Telemetry Point from Multiple Packets<a href=#getting-the-most-recent-value-of-a-telemetry-point-from-multiple-packets class=hash-link aria-label="Direct link to Getting the Most Recent Value of a Telemetry Point from Multiple Packets" title="Direct link to Getting the Most Recent Value of a Telemetry Point from Multiple Packets">​</a></h3>
183
173
  <p>Some systems include high rate data points with the same name in every packet. COSMOS supports getting the most recent value of a telemetry point that is in multiple packets using a special packet name of LATEST. Assume the target INST has two packets, PACKET1 and PACKET2. Both packets have a telemetry point called TEMP.</p>
184
- <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Get the value of TEMP from the most recently received PACKET1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">value </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> tlm</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;INST PACKET1 TEMP&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Get the value of TEMP from the most recently received PACKET2</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">value </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> tlm</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;INST PACKET2 TEMP&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Get the value of TEMP from the most recently received PACKET1 or PACKET2</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">value </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> tlm</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;INST LATEST TEMP&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
185
- <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="checking-every-single-sample-of-a-telemetry-point">Checking Every Single Sample of a Telemetry Point<a href="#checking-every-single-sample-of-a-telemetry-point" class="hash-link" aria-label="Direct link to Checking Every Single Sample of a Telemetry Point" title="Direct link to Checking Every Single Sample of a Telemetry Point">​</a></h3>
174
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Get the value of TEMP from the most recently received PACKET1</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">value </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> tlm</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"INST PACKET1 TEMP"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Get the value of TEMP from the most recently received PACKET2</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">value </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> tlm</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"INST PACKET2 TEMP"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Get the value of TEMP from the most recently received PACKET1 or PACKET2</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">value </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> tlm</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"INST LATEST TEMP"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
175
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id=checking-every-single-sample-of-a-telemetry-point>Checking Every Single Sample of a Telemetry Point<a href=#checking-every-single-sample-of-a-telemetry-point class=hash-link aria-label="Direct link to Checking Every Single Sample of a Telemetry Point" title="Direct link to Checking Every Single Sample of a Telemetry Point">​</a></h3>
186
176
  <p>When writing COSMOS scripts, checking the most recent value of a telemetry point normally gets the job done. The tlm(), tlm_raw(), etc methods all retrieve the most recent value of a telemetry point. Sometimes you need to perform analysis on every single sample of a telemetry point. This can be done using the COSMOS packet subscription system. The packet subscription system lets you choose one or more packets and receive them all from a queue. You can then pick out the specific telemetry points you care about from each packet.</p>
187
177
  <p>Ruby:</p>
188
- <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token plain">id </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> subscribe_packets</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&#x27;INST&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&#x27;HEALTH_STATUS&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&#x27;INST&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&#x27;ADCS&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">wait </span><span class="token number" style="color:rgb(247, 140, 108)">1.5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">id</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> packets </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> get_packets</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">id</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">packets</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token keyword" style="color:rgb(127, 219, 202)">each</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">do</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">|</span><span class="token plain">packet</span><span class="token operator" style="color:rgb(127, 219, 202)">|</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> puts </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">packet</span><span class="token string-literal interpolation content punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string-literal interpolation content string-literal string" style="color:rgb(173, 219, 103)">&#x27;PACKET_TIMESECONDS&#x27;</span><span class="token string-literal interpolation content punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">: </span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">packet</span><span class="token string-literal interpolation content punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string-literal interpolation content string-literal string" style="color:rgb(173, 219, 103)">&#x27;target_name&#x27;</span><span class="token string-literal interpolation content punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)"> </span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">packet</span><span class="token string-literal interpolation content punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string-literal interpolation content string-literal string" style="color:rgb(173, 219, 103)">&#x27;packet_name&#x27;</span><span class="token string-literal interpolation content punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Wait for some time later and reuse the last returned ID</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">id</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> packets </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> get_packets</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">id</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
178
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token plain">id </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> subscribe_packets</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">'INST'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">'HEALTH_STATUS'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">'INST'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">'ADCS'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">wait </span><span class="token number" style="color:rgb(247, 140, 108)">1.5</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">id</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> packets </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> get_packets</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">id</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">packets</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token keyword" style="color:rgb(127, 219, 202)">each</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">do</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">|</span><span class="token plain">packet</span><span class="token operator" style="color:rgb(127, 219, 202)">|</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> puts </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">packet</span><span class="token string-literal interpolation content punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string-literal interpolation content string-literal string" style="color:rgb(173, 219, 103)">'PACKET_TIMESECONDS'</span><span class="token string-literal interpolation content punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">: </span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">packet</span><span class="token string-literal interpolation content punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string-literal interpolation content string-literal string" style="color:rgb(173, 219, 103)">'target_name'</span><span class="token string-literal interpolation content punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)"> </span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">packet</span><span class="token string-literal interpolation content punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string-literal interpolation content string-literal string" style="color:rgb(173, 219, 103)">'packet_name'</span><span class="token string-literal interpolation content punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Wait for some time later and reuse the last returned ID</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">id</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> packets </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> get_packets</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">id</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
189
179
  <p>Python:</p>
190
- <div class="language-python codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-python codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token builtin" style="color:rgb(130, 170, 255)">id</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> subscribe_packets</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(173, 219, 103)">&#x27;INST&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(173, 219, 103)">&#x27;HEALTH_STATUS&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(173, 219, 103)">&#x27;INST&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(173, 219, 103)">&#x27;ADCS&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">wait</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">1.5</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token builtin" style="color:rgb(130, 170, 255)">id</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> packets </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> get_packets</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token builtin" style="color:rgb(130, 170, 255)">id</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">for</span><span class="token plain"> packet </span><span class="token keyword" style="color:rgb(127, 219, 202)">in</span><span class="token plain"> packets</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">print</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f&quot;</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">packet</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string-interpolation interpolation string" style="color:rgb(173, 219, 103)">&#x27;PACKET_TIMESECONDS&#x27;</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">: </span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">packet</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string-interpolation interpolation string" style="color:rgb(173, 219, 103)">&#x27;target_name&#x27;</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)"> </span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">packet</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string-interpolation interpolation string" style="color:rgb(173, 219, 103)">&#x27;packet_name&#x27;</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Wait for some time later and reuse the last returned ID</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token builtin" style="color:rgb(130, 170, 255)">id</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> packets </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> get_packets</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token builtin" style="color:rgb(130, 170, 255)">id</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
191
- <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="using-variables-in-mnemonics">Using Variables in Mnemonics<a href="#using-variables-in-mnemonics" class="hash-link" aria-label="Direct link to Using Variables in Mnemonics" title="Direct link to Using Variables in Mnemonics">​</a></h3>
180
+ <div class="language-python codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-python codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token builtin" style="color:rgb(130, 170, 255)">id</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> subscribe_packets</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(173, 219, 103)">'INST'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(173, 219, 103)">'HEALTH_STATUS'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(173, 219, 103)">'INST'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(173, 219, 103)">'ADCS'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">wait</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">1.5</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token builtin" style="color:rgb(130, 170, 255)">id</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> packets </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> get_packets</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token builtin" style="color:rgb(130, 170, 255)">id</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">for</span><span class="token plain"> packet </span><span class="token keyword" style="color:rgb(127, 219, 202)">in</span><span class="token plain"> packets</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">print</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f"</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">packet</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string-interpolation interpolation string" style="color:rgb(173, 219, 103)">'PACKET_TIMESECONDS'</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">: </span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">packet</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string-interpolation interpolation string" style="color:rgb(173, 219, 103)">'target_name'</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)"> </span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">packet</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string-interpolation interpolation string" style="color:rgb(173, 219, 103)">'packet_name'</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Wait for some time later and reuse the last returned ID</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token builtin" style="color:rgb(130, 170, 255)">id</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> packets </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> get_packets</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token builtin" style="color:rgb(130, 170, 255)">id</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
181
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id=using-variables-in-mnemonics>Using Variables in Mnemonics<a href=#using-variables-in-mnemonics class=hash-link aria-label="Direct link to Using Variables in Mnemonics" title="Direct link to Using Variables in Mnemonics">​</a></h3>
192
182
  <p>Because command and telemetry mnemonics are just strings in COSMOS scripts, you can make use of variables in some contexts to make reusable code. For example, a method can take a target name as an input to support multiple instances of a target. You could also pass in the value for a set of numbered telemetry points.</p>
193
183
  <p>Ruby:</p>
194
- <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">example</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">target_name</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> temp_number</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">target_name</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)"> COLLECT with TYPE NORMAL&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> wait_check</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">target_name</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)"> TEMP</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">temp_number</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)"> &gt; 50.0&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
184
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">example</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">target_name</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> temp_number</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">target_name</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)"> COLLECT with TYPE NORMAL"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> wait_check</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">target_name</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)"> TEMP</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">temp_number</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)"> > 50.0"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
195
185
  <p>Python:</p>
196
- <div class="language-python codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-python codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">example</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">target_name</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> temp_number</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f&quot;</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">target_name</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)"> COLLECT with TYPE NORMAL&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> wait_check</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f&quot;</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">target_name</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)"> TEMP</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">temp_number</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)"> &gt; 50.0&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
197
- <p>This can also be useful when looping through a numbered set of telemetry points but be considerate of the downsides of looping as discussed in the <a href="#looping-vs-unrolled-loops">Looping vs Unrolled Loops</a> section.</p>
198
- <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="using-custom-wait_check_expression">Using Custom wait_check_expression<a href="#using-custom-wait_check_expression" class="hash-link" aria-label="Direct link to Using Custom wait_check_expression" title="Direct link to Using Custom wait_check_expression">​</a></h3>
186
+ <div class="language-python codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-python codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">example</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">target_name</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> temp_number</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">:</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> cmd</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f"</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">target_name</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)"> COLLECT with TYPE NORMAL"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> wait_check</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)">f"</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">target_name</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)"> TEMP</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token string-interpolation interpolation">temp_number</span><span class="token string-interpolation interpolation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-interpolation string" style="color:rgb(173, 219, 103)"> > 50.0"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
187
+ <p>This can also be useful when looping through a numbered set of telemetry points but be considerate of the downsides of looping as discussed in the <a href=#looping-vs-unrolled-loops>Looping vs Unrolled Loops</a> section.</p>
188
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id=using-custom-wait_check_expression>Using Custom wait_check_expression<a href=#using-custom-wait_check_expression class=hash-link aria-label="Direct link to Using Custom wait_check_expression" title="Direct link to Using Custom wait_check_expression">​</a></h3>
199
189
  <p>The COSMOS wait_check_expression (and check_expression) allow you to perform more complicated checks and still stop the script with a CHECK error message if something goes wrong. For example, you can check variables against each other or check a telemetry point against a range. The exact string of text passed to wait_check_expression is repeatedly evaluated until it passes, or a timeout occurs. It is important to not use string interpolation within the actual expression or the values inside of the string interpolation syntax will only be evaluated once when it is converted into a string.</p>
200
190
  <p>Ruby:</p>
201
- <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token plain">one </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">two </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">2</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">wait_check_expression</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;one == two&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># ERROR: CHECK: one == two is FALSE after waiting 1.017035 seconds</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Checking an integer range</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">wait_check_expression</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;one &gt; 0 and one &lt; 10 # init value one = </span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">one</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
191
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token plain">one </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">two </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">2</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain" style=display:inline-block></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">wait_check_expression</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"one == two"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># ERROR: CHECK: one == two is FALSE after waiting 1.017035 seconds</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain" style=display:inline-block></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Checking an integer range</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">wait_check_expression</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"one > 0 and one &lt; 10 # init value one = </span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">#{</span><span class="token string-literal interpolation content">one</span><span class="token string-literal interpolation delimiter punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
202
192
  <p>Python:</p>
203
- <div class="language-python codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-python codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token plain">one </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">two </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">2</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">wait_check_expression</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">&quot;one == two&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">0.25</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token builtin" style="color:rgb(130, 170, 255)">locals</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># ERROR: CHECK: one == two is FALSE after waiting 1.017035 seconds</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Checking an integer range</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">wait_check_expression</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">&quot;one &gt; 0 and one &lt; 10&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">0.25</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token builtin" style="color:rgb(130, 170, 255)">locals</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
204
- <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="cosmos-scripting-differences-from-regular-ruby-scripting">COSMOS Scripting Differences from Regular Ruby Scripting<a href="#cosmos-scripting-differences-from-regular-ruby-scripting" class="hash-link" aria-label="Direct link to COSMOS Scripting Differences from Regular Ruby Scripting" title="Direct link to COSMOS Scripting Differences from Regular Ruby Scripting">​</a></h3>
205
- <h4 class="anchor anchorWithStickyNavbar_fF9Z" id="do-not-use-single-line-if-statements">Do not use single line if statements<a href="#do-not-use-single-line-if-statements" class="hash-link" aria-label="Direct link to Do not use single line if statements" title="Direct link to Do not use single line if statements">​</a></h4>
206
- <p>COSMOS scripting instruments each line to catch exceptions if things go wrong. With single line if statements the exception handling doesn&#x27;t know which part of the statement failed and cannot properly continue. If an exception is raised in a single line if statement, then the entire script will stop and not be able to continue. Do not use single line if statements in COSMOS scripts. (However, they are fine to use in interfaces and other Ruby code, just not COSMOS scripts).</p>
207
- <p>Don&#x27;t do this:</p>
208
- <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token plain">run_method</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">if</span><span class="token plain"> tlm</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;INST HEALTH_STATUS TEMP1&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">&gt;</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">10.0</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
193
+ <div class="language-python codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-python codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token plain">one </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">two </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">2</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain" style=display:inline-block></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">wait_check_expression</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">"one == two"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">0.25</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token builtin" style="color:rgb(130, 170, 255)">locals</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># ERROR: CHECK: one == two is FALSE after waiting 1.017035 seconds</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain" style=display:inline-block></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># Checking an integer range</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">wait_check_expression</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(173, 219, 103)">"one > 0 and one &lt; 10"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">0.25</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token builtin" style="color:rgb(130, 170, 255)">locals</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
194
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id=cosmos-scripting-differences-from-regular-ruby-scripting>COSMOS Scripting Differences from Regular Ruby Scripting<a href=#cosmos-scripting-differences-from-regular-ruby-scripting class=hash-link aria-label="Direct link to COSMOS Scripting Differences from Regular Ruby Scripting" title="Direct link to COSMOS Scripting Differences from Regular Ruby Scripting">​</a></h3>
195
+ <h4 class="anchor anchorWithStickyNavbar_fF9Z" id=do-not-use-single-line-if-statements>Do not use single line if statements<a href=#do-not-use-single-line-if-statements class=hash-link aria-label="Direct link to Do not use single line if statements" title="Direct link to Do not use single line if statements">​</a></h4>
196
+ <p>COSMOS scripting instruments each line to catch exceptions if things go wrong. With single line if statements the exception handling doesn't know which part of the statement failed and cannot properly continue. If an exception is raised in a single line if statement, then the entire script will stop and not be able to continue. Do not use single line if statements in COSMOS scripts. (However, they are fine to use in interfaces and other Ruby code, just not COSMOS scripts).</p>
197
+ <p>Don't do this:</p>
198
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token plain">run_method</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">if</span><span class="token plain"> tlm</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"INST HEALTH_STATUS TEMP1"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">></span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">10.0</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
209
199
  <p>Do this instead:</p>
210
- <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># It is best not to execute any code that could fail in an if statement, ie</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># tlm() could fail if the CmdTlmServer was not running or a mnemonic</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># was misspelled</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">temp1 </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> tlm</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&quot;INST HEALTH_STATUS TEMP1&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">if</span><span class="token plain"> temp1 </span><span class="token operator" style="color:rgb(127, 219, 202)">&gt;</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">10.0</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> run_method</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
211
- <h2 class="anchor anchorWithStickyNavbar_fF9Z" id="when-things-go-wrong">When Things Go Wrong<a href="#when-things-go-wrong" class="hash-link" aria-label="Direct link to When Things Go Wrong" title="Direct link to When Things Go Wrong">​</a></h2>
212
- <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="common-reasons-checks-fail">Common Reasons Checks Fail<a href="#common-reasons-checks-fail" class="hash-link" aria-label="Direct link to Common Reasons Checks Fail" title="Direct link to Common Reasons Checks Fail">​</a></h3>
200
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># It is best not to execute any code that could fail in an if statement, ie</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># tlm() could fail if the CmdTlmServer was not running or a mnemonic</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token comment" style="color:rgb(99, 119, 119);font-style:italic"># was misspelled</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">temp1 </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> tlm</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"INST HEALTH_STATUS TEMP1"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">if</span><span class="token plain"> temp1 </span><span class="token operator" style="color:rgb(127, 219, 202)">></span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">10.0</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> run_method</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
201
+ <h2 class="anchor anchorWithStickyNavbar_fF9Z" id=when-things-go-wrong>When Things Go Wrong<a href=#when-things-go-wrong class=hash-link aria-label="Direct link to When Things Go Wrong" title="Direct link to When Things Go Wrong">​</a></h2>
202
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id=common-reasons-checks-fail>Common Reasons Checks Fail<a href=#common-reasons-checks-fail class=hash-link aria-label="Direct link to Common Reasons Checks Fail" title="Direct link to Common Reasons Checks Fail">​</a></h3>
213
203
  <p>There are three common reasons that checks fail in COSMOS scripts:</p>
214
204
  <ol>
215
205
  <li>
@@ -218,14 +208,14 @@
218
208
  </li>
219
209
  <li>
220
210
  <p>The range or value checked against was incorrect or too stringent</p>
221
- <p>Often the actual telemetry value is ok, but the expected value checked against was too tight. Loosen the ranges on checks when it makes sense. Ensure your script is using the wait_check_tolerance() routine when checking floating point numbers and verify you&#x27;re using an appropriate tolerance value.</p>
211
+ <p>Often the actual telemetry value is ok, but the expected value checked against was too tight. Loosen the ranges on checks when it makes sense. Ensure your script is using the wait_check_tolerance() routine when checking floating point numbers and verify you're using an appropriate tolerance value.</p>
222
212
  </li>
223
213
  <li>
224
214
  <p>The check really failed</p>
225
215
  <p>Of course, sometimes there are real failures. See the next section for how to handle them and recover.</p>
226
216
  </li>
227
217
  </ol>
228
- <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="how-to-recover-from-anomalies">How to Recover from Anomalies<a href="#how-to-recover-from-anomalies" class="hash-link" aria-label="Direct link to How to Recover from Anomalies" title="Direct link to How to Recover from Anomalies">​</a></h3>
218
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id=how-to-recover-from-anomalies>How to Recover from Anomalies<a href=#how-to-recover-from-anomalies class=hash-link aria-label="Direct link to How to Recover from Anomalies" title="Direct link to How to Recover from Anomalies">​</a></h3>
229
219
  <p>Once something has failed, and your script has stopped with a pink highlighted line, how can you recover? Fortunately, COSMOS provides several mechanisms that can be used to recover after something in your script fails.</p>
230
220
  <ol>
231
221
  <li>
@@ -234,27 +224,25 @@
234
224
  </li>
235
225
  <li>
236
226
  <p>Use the Debug Prompt</p>
237
- <p>By selecting Script -&gt; Toggle Debug, you can perform arbitrary actions that may be needed to correct the situation without stopping the running script. You can also inspect variables to help determine why something failed.</p>
227
+ <p>By selecting Script -> Toggle Debug, you can perform arbitrary actions that may be needed to correct the situation without stopping the running script. You can also inspect variables to help determine why something failed.</p>
238
228
  </li>
239
229
  <li>
240
230
  <p>Execute Selection</p>
241
- <p>If only a small section of a script needs to be run, then “Execute Selection&quot; can be used to execute only a small portion of the script. This can also be used when a script is paused or stopped in error.</p>
231
+ <p>If only a small section of a script needs to be run, then “Execute Selection" can be used to execute only a small portion of the script. This can also be used when a script is paused or stopped in error.</p>
242
232
  </li>
243
233
  <li>
244
234
  <p>Run from here</p>
245
- <p>By clicking into a script, and right clicking to select &quot;Run from here&quot;, users can restart a script at an arbitrary point. This works well if no required variable definitions exist earlier in the script.</p>
235
+ <p>By clicking into a script, and right clicking to select "Run from here", users can restart a script at an arbitrary point. This works well if no required variable definitions exist earlier in the script.</p>
246
236
  </li>
247
237
  </ol>
248
- <h2 class="anchor anchorWithStickyNavbar_fF9Z" id="advanced-topics">Advanced Topics<a href="#advanced-topics" class="hash-link" aria-label="Direct link to Advanced Topics" title="Direct link to Advanced Topics">​</a></h2>
249
- <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="advanced-script-configuration-with-csv-or-excel">Advanced Script Configuration with CSV or Excel<a href="#advanced-script-configuration-with-csv-or-excel" class="hash-link" aria-label="Direct link to Advanced Script Configuration with CSV or Excel" title="Direct link to Advanced Script Configuration with CSV or Excel">​</a></h3>
238
+ <h2 class="anchor anchorWithStickyNavbar_fF9Z" id=advanced-topics>Advanced Topics<a href=#advanced-topics class=hash-link aria-label="Direct link to Advanced Topics" title="Direct link to Advanced Topics">​</a></h2>
239
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id=advanced-script-configuration-with-csv-or-excel>Advanced Script Configuration with CSV or Excel<a href=#advanced-script-configuration-with-csv-or-excel class=hash-link aria-label="Direct link to Advanced Script Configuration with CSV or Excel" title="Direct link to Advanced Script Configuration with CSV or Excel">​</a></h3>
250
240
  <p>Using a spreadsheet to store the values for use by a script can be a great option if you have a CM-controlled script but need to be able to tweak some values for a test or if you need to use different values for different serial numbers.</p>
251
241
  <p>The Ruby CSV class be used to easily read data from CSV files (recommended for cross platform projects).</p>
252
- <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">require</span><span class="token plain"> </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&#x27;csv&#x27;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">values </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token constant" style="color:rgb(130, 170, 255)">CSV</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">read</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&#x27;test.csv&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">puts values</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
242
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token keyword" style="color:rgb(127, 219, 202)">require</span><span class="token plain"> </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">'csv'</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">values </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token constant" style="color:rgb(130, 170, 255)">CSV</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">read</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">'test.csv'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">puts values</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
253
243
  <p>If you are only using Windows, COSMOS also contains a library for reading Excel files.</p>
254
- <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">require</span><span class="token plain"> </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&#x27;openc3/win32/excel&#x27;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">ss </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token class-name" style="color:rgb(255, 203, 139)">ExcelSpreadsheet</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token keyword" style="color:rgb(127, 219, 202)">new</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">&#x27;C:/git/cosmos/test.xlsx&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain">puts ss</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
255
- <h3 class="anchor anchorWithStickyNavbar_fF9Z" id="when-to-use-ruby-modules">When to use Ruby Modules<a href="#when-to-use-ruby-modules" class="hash-link" aria-label="Direct link to When to use Ruby Modules" title="Direct link to When to use Ruby Modules">​</a></h3>
256
- <p>Modules in Ruby have two purposes: namespacing and mixins. Namespacing allows having classes and methods with the same name, but with different meanings. For example, if they are namespaced, COSMOS can have a Packet class and another Ruby library can have a Packet class. This isn&#x27;t typically useful for COSMOS scripting though.</p>
244
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token keyword" style="color:rgb(127, 219, 202)">require</span><span class="token plain"> </span><span class="token string-literal string" style="color:rgb(173, 219, 103)">'openc3/win32/excel'</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">ss </span><span class="token operator" style="color:rgb(127, 219, 202)">=</span><span class="token plain"> </span><span class="token class-name" style="color:rgb(255, 203, 139)">ExcelSpreadsheet</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token keyword" style="color:rgb(127, 219, 202)">new</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">'C:/git/cosmos/test.xlsx'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain">puts ss</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div>
245
+ <h3 class="anchor anchorWithStickyNavbar_fF9Z" id=when-to-use-ruby-modules>When to use Ruby Modules<a href=#when-to-use-ruby-modules class=hash-link aria-label="Direct link to When to use Ruby Modules" title="Direct link to When to use Ruby Modules">​</a></h3>
246
+ <p>Modules in Ruby have two purposes: namespacing and mixins. Namespacing allows having classes and methods with the same name, but with different meanings. For example, if they are namespaced, COSMOS can have a Packet class and another Ruby library can have a Packet class. This isn't typically useful for COSMOS scripting though.</p>
257
247
  <p>Mixins allow adding common methods to classes without using inheritance. Mixins can be useful to add common functionality to some classes but not others, or to break up classes into multiple files.</p>
258
- <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style="--prism-color:#d6deeb;--prism-background-color:#011627"><div class="codeBlockContent_qZBB"><pre tabindex="0" class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style="color:#d6deeb;background-color:#011627"><code class="codeBlockLines_AdAo"><span class="token-line" style="color:#d6deeb"><span class="token keyword" style="color:rgb(127, 219, 202)">module</span><span class="token plain"> </span><span class="token class-name" style="color:rgb(255, 203, 139)">MyModule</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">module_method</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">class</span><span class="token plain"> </span><span class="token class-name" style="color:rgb(255, 203, 139)">MyTest</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">&lt;</span><span class="token plain"> OpenC3</span><span class="token double-colon punctuation" style="color:rgb(199, 146, 234)">::</span><span class="token plain">Group</span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">include</span><span class="token plain"> MyModule</span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">test_1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> module_method</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class="token-line" style="color:#d6deeb"><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class="buttonGroup_TNwR"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_MVhB" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_yxgH"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_QJLJ"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="row margin-top--sm theme-doc-footer-edit-meta-row"><div class="col"><a href="https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/guides/script-writing.md" target="_blank" rel="noopener noreferrer" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_UohW" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_g62E"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/tools/staticdocs/docs/guides/raspberrypi"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Raspberry Pi</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/tools/staticdocs/docs/guides/scripting-api"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Scripting API Guide</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_TN1Q thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#introduction" class="table-of-contents__link toc-highlight">Introduction</a></li><li><a href="#concepts" class="table-of-contents__link toc-highlight">Concepts</a><ul><li><a href="#ruby-vs-python-in-cosmos" class="table-of-contents__link toc-highlight">Ruby vs Python in COSMOS</a></li></ul></li><li><a href="#scripting-philosophy" class="table-of-contents__link toc-highlight">Scripting Philosophy</a><ul><li><a href="#a-super-basic-script-example" class="table-of-contents__link toc-highlight">A Super Basic Script Example</a></li><li><a href="#kiss-keep-it-simple-stupid" class="table-of-contents__link toc-highlight">KISS (Keep It Simple Stupid)</a></li><li><a href="#keep-things-dry-dont-repeat-yourself" class="table-of-contents__link toc-highlight">Keep things DRY (Don&#39;t Repeat Yourself)</a></li><li><a href="#use-comments-appropriately" class="table-of-contents__link toc-highlight">Use Comments Appropriately</a></li><li><a href="#script-runner" class="table-of-contents__link toc-highlight">Script Runner</a></li><li><a href="#looping-vs-unrolled-loops" class="table-of-contents__link toc-highlight">Looping vs Unrolled Loops</a></li></ul></li><li><a href="#script-organization" class="table-of-contents__link toc-highlight">Script Organization</a><ul><li><a href="#organizing-your-scripts-into-a-plugin" class="table-of-contents__link toc-highlight">Organizing Your Scripts into a Plugin</a></li><li><a href="#organize-scripts-into-methods" class="table-of-contents__link toc-highlight">Organize Scripts into Methods</a></li><li><a href="#using-classes-vs-unscoped-methods" class="table-of-contents__link toc-highlight">Using Classes vs Unscoped Methods</a></li><li><a href="#instrumented-vs-uninstrumented-lines-require-vs-load" class="table-of-contents__link toc-highlight">Instrumented vs Uninstrumented Lines (require vs load)</a></li></ul></li><li><a href="#debugging-and-auditing" class="table-of-contents__link toc-highlight">Debugging and Auditing</a><ul><li><a href="#built-in-debugging-capabilities" class="table-of-contents__link toc-highlight">Built-In Debugging Capabilities</a></li><li><a href="#breakpoints" class="table-of-contents__link toc-highlight">Breakpoints</a></li><li><a href="#using-disconnect-mode" class="table-of-contents__link toc-highlight">Using Disconnect Mode</a></li><li><a href="#auditing-your-scripts" class="table-of-contents__link toc-highlight">Auditing your Scripts</a><ul><li><a href="#ruby-syntax-check" class="table-of-contents__link toc-highlight">Ruby Syntax Check</a></li></ul></li></ul></li><li><a href="#common-scenarios" class="table-of-contents__link toc-highlight">Common Scenarios</a><ul><li><a href="#user-input-best-practices" class="table-of-contents__link toc-highlight">User Input Best Practices</a></li><li><a href="#conditionally-require-manual-user-input-steps" class="table-of-contents__link toc-highlight">Conditionally Require Manual User Input Steps</a></li><li><a href="#outputting-extra-information-to-a-report" class="table-of-contents__link toc-highlight">Outputting Extra Information to a Report</a></li><li><a href="#getting-the-most-recent-value-of-a-telemetry-point-from-multiple-packets" class="table-of-contents__link toc-highlight">Getting the Most Recent Value of a Telemetry Point from Multiple Packets</a></li><li><a href="#checking-every-single-sample-of-a-telemetry-point" class="table-of-contents__link toc-highlight">Checking Every Single Sample of a Telemetry Point</a></li><li><a href="#using-variables-in-mnemonics" class="table-of-contents__link toc-highlight">Using Variables in Mnemonics</a></li><li><a href="#using-custom-wait_check_expression" class="table-of-contents__link toc-highlight">Using Custom wait_check_expression</a></li><li><a href="#cosmos-scripting-differences-from-regular-ruby-scripting" class="table-of-contents__link toc-highlight">COSMOS Scripting Differences from Regular Ruby Scripting</a><ul><li><a href="#do-not-use-single-line-if-statements" class="table-of-contents__link toc-highlight">Do not use single line if statements</a></li></ul></li></ul></li><li><a href="#when-things-go-wrong" class="table-of-contents__link toc-highlight">When Things Go Wrong</a><ul><li><a href="#common-reasons-checks-fail" class="table-of-contents__link toc-highlight">Common Reasons Checks Fail</a></li><li><a href="#how-to-recover-from-anomalies" class="table-of-contents__link toc-highlight">How to Recover from Anomalies</a></li></ul></li><li><a href="#advanced-topics" class="table-of-contents__link toc-highlight">Advanced Topics</a><ul><li><a href="#advanced-script-configuration-with-csv-or-excel" class="table-of-contents__link toc-highlight">Advanced Script Configuration with CSV or Excel</a></li><li><a href="#when-to-use-ruby-modules" class="table-of-contents__link toc-highlight">When to use Ruby Modules</a></li></ul></li></ul></div></div></div></div></main></div></div></div><footer class="footer footer--dark"><div class="container container-fluid"><div class="row footer__links"><div class="col footer__col"><div class="footer__title">Homepage</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://openc3.com" target="_blank" rel="noopener noreferrer" class="footer__link-item">Home</a></li></ul></div><div class="col footer__col"><div class="footer__title">Docs</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item" href="/tools/staticdocs/docs">Documentation</a></li></ul></div><div class="col footer__col"><div class="footer__title">Community</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://www.linkedin.com/company/openc3" target="_blank" rel="noopener noreferrer" class="footer__link-item">LinkedIn<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_awgD"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div><div class="col footer__col"><div class="footer__title">More</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://github.com/OpenC3/cosmos" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_awgD"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a class="footer__link-item" href="/tools/staticdocs/docs/privacy">Privacy</a></li></ul></div></div><div class="footer__bottom text--center"><div class="footer__copyright">Copyright © 2024 OpenC3, Inc.</div></div></div></footer></div>
259
- </body>
260
- </html>
248
+ <div class="language-ruby codeBlockContainer_ZGJx theme-code-block" style=--prism-color:#d6deeb;--prism-background-color:#011627><div class=codeBlockContent_qZBB><pre tabindex=0 class="prism-code language-ruby codeBlock_TAPP thin-scrollbar" style=color:#d6deeb;background-color:#011627><code class=codeBlockLines_AdAo><span class=token-line style=color:#d6deeb><span class="token keyword" style="color:rgb(127, 219, 202)">module</span><span class="token plain"> </span><span class="token class-name" style="color:rgb(255, 203, 139)">MyModule</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">module_method</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">class</span><span class="token plain"> </span><span class="token class-name" style="color:rgb(255, 203, 139)">MyTest</span><span class="token plain"> </span><span class="token operator" style="color:rgb(127, 219, 202)">&lt;</span><span class="token plain"> OpenC3</span><span class="token double-colon punctuation" style="color:rgb(199, 146, 234)">::</span><span class="token plain">Group</span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">include</span><span class="token plain"> MyModule</span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">def</span><span class="token plain"> </span><span class="token method-definition function" style="color:rgb(130, 170, 255)">test_1</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> module_method</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><span class="token plain"></span><br></span><span class=token-line style=color:#d6deeb><span class="token plain"></span><span class="token keyword" style="color:rgb(127, 219, 202)">end</span><br></span></code></pre><div class=buttonGroup_TNwR><button type=button aria-label="Copy code to clipboard" title=Copy class=clean-btn><span class=copyButtonIcons_MVhB aria-hidden=true><svg viewBox="0 0 24 24" class=copyButtonIcon_yxgH><path fill=currentColor d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg><svg viewBox="0 0 24 24" class=copyButtonSuccessIcon_QJLJ><path fill=currentColor d=M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z /></svg></span></button></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="row margin-top--sm theme-doc-footer-edit-meta-row"><div class=col><a href=https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/guides/script-writing.md target=_blank rel="noopener noreferrer" class=theme-edit-this-page><svg fill=currentColor height=20 width=20 viewBox="0 0 40 40" class=iconEdit_UohW aria-hidden=true><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"/></g></svg>Edit this page</a></div><div class="col lastUpdated_g62E"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href=/tools/staticdocs/docs/guides/raspberrypi><div class=pagination-nav__sublabel>Previous</div><div class=pagination-nav__label>Raspberry Pi</div></a><a class="pagination-nav__link pagination-nav__link--next" href=/tools/staticdocs/docs/guides/scripting-api><div class=pagination-nav__sublabel>Next</div><div class=pagination-nav__label>Scripting API Guide</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_TN1Q thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href=#introduction class="table-of-contents__link toc-highlight">Introduction</a><li><a href=#concepts class="table-of-contents__link toc-highlight">Concepts</a><ul><li><a href=#ruby-vs-python-in-cosmos class="table-of-contents__link toc-highlight">Ruby vs Python in COSMOS</a></ul><li><a href=#scripting-philosophy class="table-of-contents__link toc-highlight">Scripting Philosophy</a><ul><li><a href=#a-super-basic-script-example class="table-of-contents__link toc-highlight">A Super Basic Script Example</a><li><a href=#kiss-keep-it-simple-stupid class="table-of-contents__link toc-highlight">KISS (Keep It Simple Stupid)</a><li><a href=#keep-things-dry-dont-repeat-yourself class="table-of-contents__link toc-highlight">Keep things DRY (Don't Repeat Yourself)</a><li><a href=#use-comments-appropriately class="table-of-contents__link toc-highlight">Use Comments Appropriately</a><li><a href=#script-runner class="table-of-contents__link toc-highlight">Script Runner</a><li><a href=#looping-vs-unrolled-loops class="table-of-contents__link toc-highlight">Looping vs Unrolled Loops</a></ul><li><a href=#script-organization class="table-of-contents__link toc-highlight">Script Organization</a><ul><li><a href=#organizing-your-scripts-into-a-plugin class="table-of-contents__link toc-highlight">Organizing Your Scripts into a Plugin</a><li><a href=#organize-scripts-into-methods class="table-of-contents__link toc-highlight">Organize Scripts into Methods</a><li><a href=#using-classes-vs-unscoped-methods class="table-of-contents__link toc-highlight">Using Classes vs Unscoped Methods</a><li><a href=#instrumented-vs-uninstrumented-lines-require-vs-load class="table-of-contents__link toc-highlight">Instrumented vs Uninstrumented Lines (require vs load)</a></ul><li><a href=#debugging-and-auditing class="table-of-contents__link toc-highlight">Debugging and Auditing</a><ul><li><a href=#built-in-debugging-capabilities class="table-of-contents__link toc-highlight">Built-In Debugging Capabilities</a><li><a href=#breakpoints class="table-of-contents__link toc-highlight">Breakpoints</a><li><a href=#using-disconnect-mode class="table-of-contents__link toc-highlight">Using Disconnect Mode</a><li><a href=#auditing-your-scripts class="table-of-contents__link toc-highlight">Auditing your Scripts</a><ul><li><a href=#ruby-syntax-check class="table-of-contents__link toc-highlight">Ruby Syntax Check</a></ul></ul><li><a href=#common-scenarios class="table-of-contents__link toc-highlight">Common Scenarios</a><ul><li><a href=#user-input-best-practices class="table-of-contents__link toc-highlight">User Input Best Practices</a><li><a href=#conditionally-require-manual-user-input-steps class="table-of-contents__link toc-highlight">Conditionally Require Manual User Input Steps</a><li><a href=#outputting-extra-information-to-a-report class="table-of-contents__link toc-highlight">Outputting Extra Information to a Report</a><li><a href=#getting-the-most-recent-value-of-a-telemetry-point-from-multiple-packets class="table-of-contents__link toc-highlight">Getting the Most Recent Value of a Telemetry Point from Multiple Packets</a><li><a href=#checking-every-single-sample-of-a-telemetry-point class="table-of-contents__link toc-highlight">Checking Every Single Sample of a Telemetry Point</a><li><a href=#using-variables-in-mnemonics class="table-of-contents__link toc-highlight">Using Variables in Mnemonics</a><li><a href=#using-custom-wait_check_expression class="table-of-contents__link toc-highlight">Using Custom wait_check_expression</a><li><a href=#cosmos-scripting-differences-from-regular-ruby-scripting class="table-of-contents__link toc-highlight">COSMOS Scripting Differences from Regular Ruby Scripting</a><ul><li><a href=#do-not-use-single-line-if-statements class="table-of-contents__link toc-highlight">Do not use single line if statements</a></ul></ul><li><a href=#when-things-go-wrong class="table-of-contents__link toc-highlight">When Things Go Wrong</a><ul><li><a href=#common-reasons-checks-fail class="table-of-contents__link toc-highlight">Common Reasons Checks Fail</a><li><a href=#how-to-recover-from-anomalies class="table-of-contents__link toc-highlight">How to Recover from Anomalies</a></ul><li><a href=#advanced-topics class="table-of-contents__link toc-highlight">Advanced Topics</a><ul><li><a href=#advanced-script-configuration-with-csv-or-excel class="table-of-contents__link toc-highlight">Advanced Script Configuration with CSV or Excel</a><li><a href=#when-to-use-ruby-modules class="table-of-contents__link toc-highlight">When to use Ruby Modules</a></ul></ul></div></div></div></div></main></div></div></div><footer class="footer footer--dark"><div class="container container-fluid"><div class="row footer__links"><div class="col footer__col"><div class=footer__title>Homepage</div><ul class="footer__items clean-list"><li class=footer__item><a href=https://openc3.com target=_blank rel="noopener noreferrer" class=footer__link-item>Home</a></ul></div><div class="col footer__col"><div class=footer__title>Docs</div><ul class="footer__items clean-list"><li class=footer__item><a class=footer__link-item href=/tools/staticdocs/docs>Documentation</a></ul></div><div class="col footer__col"><div class=footer__title>Community</div><ul class="footer__items clean-list"><li class=footer__item><a href=https://www.linkedin.com/company/openc3 target=_blank rel="noopener noreferrer" class=footer__link-item>LinkedIn<svg width=13.5 height=13.5 aria-hidden=true viewBox="0 0 24 24" class=iconExternalLink_awgD><path fill=currentColor d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/></svg></a></ul></div><div class="col footer__col"><div class=footer__title>More</div><ul class="footer__items clean-list"><li class=footer__item><a href=https://github.com/OpenC3/cosmos target=_blank rel="noopener noreferrer" class=footer__link-item>GitHub<svg width=13.5 height=13.5 aria-hidden=true viewBox="0 0 24 24" class=iconExternalLink_awgD><path fill=currentColor d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/></svg></a><li class=footer__item><a class=footer__link-item href=/tools/staticdocs/docs/privacy>Privacy</a></ul></div></div><div class="footer__bottom text--center"><div class=footer__copyright>Copyright © 2024 OpenC3, Inc.</div></div></div></footer></div>