openc3-cosmos-tool-docs 5.12.0 → 5.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/plugin.txt +3 -3
- data/tools/staticdocs/404.html +13 -0
- data/tools/staticdocs/assets/css/styles.6e885bef.css +1 -0
- data/tools/staticdocs/assets/js/019369f3.d8613c30.js +1 -0
- data/tools/staticdocs/assets/js/058ffc22.acfac831.js +1 -0
- data/tools/staticdocs/assets/js/0686a885.4e302d8a.js +1 -0
- data/tools/staticdocs/assets/js/07876b9c.990c8af0.js +1 -0
- data/tools/staticdocs/assets/js/078dbab0.d34d0a8f.js +1 -0
- data/tools/staticdocs/assets/js/0f5d161c.d985bc97.js +1 -0
- data/tools/staticdocs/assets/js/0ff569c9.e271df4e.js +1 -0
- data/tools/staticdocs/assets/js/103cc3be.4cf4eeb0.js +1 -0
- data/tools/staticdocs/assets/js/12.ef103c80.js +1 -0
- data/tools/staticdocs/assets/js/13196248.51e9b91e.js +1 -0
- data/tools/staticdocs/assets/js/13c1b4e4.82c72cb7.js +1 -0
- data/tools/staticdocs/assets/js/1b2b4b61.b662e271.js +1 -0
- data/tools/staticdocs/assets/js/2047b354.fd40457e.js +1 -0
- data/tools/staticdocs/assets/js/22b3ac48.10ffd4c3.js +1 -0
- data/tools/staticdocs/assets/js/2624.ae6ba6f0.js +1 -0
- data/tools/staticdocs/assets/js/26b8abb2.a77dc1e7.js +1 -0
- data/tools/staticdocs/assets/js/3dd7ef3b.e063c83a.js +1 -0
- data/tools/staticdocs/assets/js/3df159b4.7047e215.js +1 -0
- data/tools/staticdocs/assets/js/40365d27.cfe2d836.js +1 -0
- data/tools/staticdocs/assets/js/411898ad.fb3b44cb.js +1 -0
- data/tools/staticdocs/assets/js/42170351.cee0ce87.js +1 -0
- data/tools/staticdocs/assets/js/43652efd.a68af7c2.js +1 -0
- data/tools/staticdocs/assets/js/4657.9492019f.js +2 -0
- data/tools/staticdocs/assets/js/53ca7c5b.5ba66d69.js +1 -0
- data/tools/staticdocs/assets/js/54d0d530.ae86bb53.js +1 -0
- data/tools/staticdocs/assets/js/55cdbca5.9562da85.js +1 -0
- data/tools/staticdocs/assets/js/5bc719f6.3f10a4f9.js +1 -0
- data/tools/staticdocs/assets/js/5c6ce5ec.3cb1b75a.js +1 -0
- data/tools/staticdocs/assets/js/5e3ed378.98a98907.js +1 -0
- data/tools/staticdocs/assets/js/5fe211ef.943a1325.js +1 -0
- data/tools/staticdocs/assets/js/64630c4f.d3aaa17e.js +1 -0
- data/tools/staticdocs/assets/js/6831b732.677fead8.js +1 -0
- data/tools/staticdocs/assets/js/696b4199.68411c90.js +1 -0
- data/tools/staticdocs/assets/js/6b210247.f17d074a.js +1 -0
- data/tools/staticdocs/assets/js/6b65133b.1691ed32.js +1 -0
- data/tools/staticdocs/assets/js/6f92e431.0e99b0f7.js +1 -0
- data/tools/staticdocs/assets/js/7158.db39a041.js +1 -0
- data/tools/staticdocs/assets/js/72c6d8a8.895d48ed.js +1 -0
- data/tools/staticdocs/assets/js/75373ac0.f2ff00fb.js +1 -0
- data/tools/staticdocs/assets/js/75e64983.a5199202.js +1 -0
- data/tools/staticdocs/assets/js/867640d5.52676c0c.js +1 -0
- data/tools/staticdocs/assets/js/89e76475.da0a4de8.js +1 -0
- data/tools/staticdocs/assets/js/8f7843ee.5069508d.js +1 -0
- data/tools/staticdocs/assets/js/9424f0b3.d0685f0f.js +1 -0
- data/tools/staticdocs/assets/js/97535711.7354a61a.js +1 -0
- data/tools/staticdocs/assets/js/99581c43.d6c28a4e.js +1 -0
- data/tools/staticdocs/assets/js/99b59eea.56ab3bff.js +1 -0
- data/tools/staticdocs/assets/js/9d6e81d0.9a3ba2db.js +1 -0
- data/tools/staticdocs/assets/js/9fb6059a.709498de.js +1 -0
- data/tools/staticdocs/assets/js/a507c363.b04cc959.js +1 -0
- data/tools/staticdocs/assets/js/a677c089.759b7b09.js +1 -0
- data/tools/staticdocs/assets/js/a9987364.e1bf97fd.js +1 -0
- data/tools/staticdocs/assets/js/aa6b6c1b.eb0299eb.js +1 -0
- data/tools/staticdocs/assets/js/b4596165.d2ef4105.js +1 -0
- data/tools/staticdocs/assets/js/b6d70f94.67e3cf1e.js +1 -0
- data/tools/staticdocs/assets/js/b9f60ba6.4f87cb90.js +1 -0
- data/tools/staticdocs/assets/js/bd0034eb.caedd00a.js +1 -0
- data/tools/staticdocs/assets/js/c24eae19.541e6a95.js +1 -0
- data/tools/staticdocs/assets/js/cb8c3f08.9ca026be.js +1 -0
- data/tools/staticdocs/assets/js/cd879be4.4b9bf792.js +1 -0
- data/tools/staticdocs/assets/js/d1b923aa.2c753a51.js +1 -0
- data/tools/staticdocs/assets/js/d1bfc316.f860e15e.js +1 -0
- data/tools/staticdocs/assets/js/d24bf9b6.a8d698fc.js +1 -0
- data/tools/staticdocs/assets/js/d57a4b5d.743b976b.js +1 -0
- data/tools/staticdocs/assets/js/d5d77c37.c1e1579f.js +1 -0
- data/tools/staticdocs/assets/js/d8ca4191.abd56e6c.js +1 -0
- data/tools/staticdocs/assets/js/d9b92eba.cd5125b1.js +1 -0
- data/tools/staticdocs/assets/js/db8fa1d0.c1a3930b.js +1 -0
- data/tools/staticdocs/assets/js/dc5f7beb.87e69867.js +1 -0
- data/tools/staticdocs/assets/js/e501b0d1.64985b23.js +1 -0
- data/tools/staticdocs/assets/js/ebec1ccb.15788749.js +1 -0
- data/tools/staticdocs/assets/js/f15615f1.0d1e925a.js +1 -0
- data/tools/staticdocs/assets/js/fd886806.5a283ff8.js +1 -0
- data/tools/staticdocs/assets/js/main.1b3209ca.js +2 -0
- data/tools/{docs/assets/js/main.b5a535c2.js.LICENSE.txt → staticdocs/assets/js/main.1b3209ca.js.LICENSE.txt} +24 -23
- data/tools/staticdocs/assets/js/runtime~main.6ca622b3.js +1 -0
- data/tools/staticdocs/docs/configuration/command.html +252 -0
- data/tools/staticdocs/docs/configuration/format.html +51 -0
- data/tools/staticdocs/docs/configuration/interfaces.html +72 -0
- data/tools/staticdocs/docs/configuration/plugins.html +339 -0
- data/tools/staticdocs/docs/configuration/protocols.html +118 -0
- data/tools/staticdocs/docs/configuration/ssl-tls.html +97 -0
- data/tools/staticdocs/docs/configuration/table.html +178 -0
- data/tools/staticdocs/docs/configuration/target.html +60 -0
- data/tools/staticdocs/docs/configuration/telemetry-screens.html +526 -0
- data/tools/staticdocs/docs/configuration/telemetry.html +198 -0
- data/tools/staticdocs/docs/configuration.html +13 -0
- data/tools/staticdocs/docs/development/curl.html +30 -0
- data/tools/staticdocs/docs/development/developing.html +111 -0
- data/tools/staticdocs/docs/development/host-install.html +38 -0
- data/tools/staticdocs/docs/development/json-api.html +59 -0
- data/tools/staticdocs/docs/development/log-structure.html +38 -0
- data/tools/staticdocs/docs/development/roadmap.html +15 -0
- data/tools/staticdocs/docs/development/streaming-api.html +37 -0
- data/tools/staticdocs/docs/development/testing.html +60 -0
- data/tools/staticdocs/docs/development.html +13 -0
- data/tools/staticdocs/docs/getting-started/gettingstarted.html +128 -0
- data/tools/staticdocs/docs/getting-started/installation.html +66 -0
- data/tools/staticdocs/docs/getting-started/key_concepts.html +45 -0
- data/tools/staticdocs/docs/getting-started/podman.html +95 -0
- data/tools/staticdocs/docs/getting-started/requirements.html +84 -0
- data/tools/staticdocs/docs/getting-started/upgrading.html +47 -0
- data/tools/staticdocs/docs/getting-started.html +13 -0
- data/tools/staticdocs/docs/guides/bridges.html +63 -0
- data/tools/staticdocs/docs/guides/cfs.html +115 -0
- data/tools/staticdocs/docs/guides/custom-widgets.html +30 -0
- data/tools/staticdocs/docs/guides/little-endian-bitfields.html +31 -0
- data/tools/staticdocs/docs/guides/local-mode.html +37 -0
- data/tools/staticdocs/docs/guides/logging.html +31 -0
- data/tools/staticdocs/docs/guides/monitoring.html +52 -0
- data/tools/staticdocs/docs/guides/performance.html +59 -0
- data/tools/staticdocs/docs/guides/raspberrypi.html +81 -0
- data/tools/staticdocs/docs/guides/script-writing.html +260 -0
- data/tools/staticdocs/docs/guides/scripting-api.html +1073 -0
- data/tools/staticdocs/docs/guides.html +13 -0
- data/tools/staticdocs/docs/meta/contributing.html +52 -0
- data/tools/staticdocs/docs/meta/philosophy.html +39 -0
- data/tools/staticdocs/docs/meta/xtce.html +110 -0
- data/tools/staticdocs/docs/meta.html +13 -0
- data/tools/staticdocs/docs/privacy.html +68 -0
- data/tools/staticdocs/docs/tools/autonomic.html +28 -0
- data/tools/staticdocs/docs/tools/bucket-explorer.html +23 -0
- data/tools/staticdocs/docs/tools/calendar.html +47 -0
- data/tools/staticdocs/docs/tools/cmd-sender.html +39 -0
- data/tools/staticdocs/docs/tools/cmd-tlm-server.html +45 -0
- data/tools/staticdocs/docs/tools/data-extractor.html +73 -0
- data/tools/staticdocs/docs/tools/data-viewer.html +32 -0
- data/tools/staticdocs/docs/tools/handbooks.html +16 -0
- data/tools/staticdocs/docs/tools/limits-monitor.html +30 -0
- data/tools/staticdocs/docs/tools/packet-viewer.html +37 -0
- data/tools/staticdocs/docs/tools/script-runner.html +91 -0
- data/tools/staticdocs/docs/tools/table-manager.html +34 -0
- data/tools/staticdocs/docs/tools/tlm-grapher.html +61 -0
- data/tools/staticdocs/docs/tools/tlm-viewer.html +45 -0
- data/tools/staticdocs/docs/tools.html +13 -0
- data/tools/staticdocs/docs/v5/bridges/index.html +11 -0
- data/tools/staticdocs/docs/v5/bucket-explorer/index.html +11 -0
- data/tools/staticdocs/docs/v5/calendar/index.html +11 -0
- data/tools/staticdocs/docs/v5/cfs/index.html +11 -0
- data/tools/staticdocs/docs/v5/cmd-sender/index.html +11 -0
- data/tools/staticdocs/docs/v5/cmd-tlm-server/index.html +11 -0
- data/tools/staticdocs/docs/v5/command/index.html +11 -0
- data/tools/staticdocs/docs/v5/contributing/index.html +11 -0
- data/tools/staticdocs/docs/v5/custom-widgets/index.html +11 -0
- data/tools/staticdocs/docs/v5/data-extractor/index.html +11 -0
- data/tools/staticdocs/docs/v5/data-viewer/index.html +11 -0
- data/tools/staticdocs/docs/v5/development/index.html +11 -0
- data/tools/staticdocs/docs/v5/format/index.html +11 -0
- data/tools/staticdocs/docs/v5/gettingstarted/index.html +11 -0
- data/tools/staticdocs/docs/v5/handbooks/index.html +11 -0
- data/tools/staticdocs/docs/v5/host-install/index.html +11 -0
- data/tools/staticdocs/docs/v5/index.html +11 -0
- data/tools/staticdocs/docs/v5/installation/index.html +11 -0
- data/tools/staticdocs/docs/v5/interfaces/index.html +11 -0
- data/tools/staticdocs/docs/v5/json-api/index.html +11 -0
- data/tools/staticdocs/docs/v5/limits-monitor/index.html +11 -0
- data/tools/staticdocs/docs/v5/little-endian-bitfields/index.html +11 -0
- data/tools/staticdocs/docs/v5/local-mode/index.html +11 -0
- data/tools/staticdocs/docs/v5/log-structure/index.html +11 -0
- data/tools/staticdocs/docs/v5/logging/index.html +11 -0
- data/tools/staticdocs/docs/v5/monitoring/index.html +11 -0
- data/tools/staticdocs/docs/v5/packet-viewer/index.html +11 -0
- data/tools/staticdocs/docs/v5/performance/index.html +11 -0
- data/tools/staticdocs/docs/v5/philosophy/index.html +11 -0
- data/tools/staticdocs/docs/v5/plugins/index.html +11 -0
- data/tools/staticdocs/docs/v5/podman/index.html +11 -0
- data/tools/staticdocs/docs/v5/protocols/index.html +11 -0
- data/tools/staticdocs/docs/v5/raspberrypi/index.html +11 -0
- data/tools/staticdocs/docs/v5/requirements/index.html +11 -0
- data/tools/staticdocs/docs/v5/roadmap/index.html +11 -0
- data/tools/staticdocs/docs/v5/script-runner/index.html +11 -0
- data/tools/staticdocs/docs/v5/script-writing/index.html +11 -0
- data/tools/staticdocs/docs/v5/scripting-api/index.html +11 -0
- data/tools/staticdocs/docs/v5/ssl-tls/index.html +11 -0
- data/tools/staticdocs/docs/v5/streaming-api/index.html +11 -0
- data/tools/staticdocs/docs/v5/table/index.html +11 -0
- data/tools/staticdocs/docs/v5/table-manager/index.html +11 -0
- data/tools/staticdocs/docs/v5/target/index.html +11 -0
- data/tools/staticdocs/docs/v5/telemetry/index.html +11 -0
- data/tools/staticdocs/docs/v5/telemetry-screens/index.html +11 -0
- data/tools/staticdocs/docs/v5/testing/index.html +11 -0
- data/tools/staticdocs/docs/v5/tlm-grapher/index.html +11 -0
- data/tools/staticdocs/docs/v5/tlm-viewer/index.html +11 -0
- data/tools/staticdocs/docs/v5/tools/index.html +11 -0
- data/tools/staticdocs/docs/v5/upgrading/index.html +11 -0
- data/tools/staticdocs/docs/v5/xtce/index.html +11 -0
- data/tools/staticdocs/docs.html +34 -0
- data/tools/staticdocs/index.html +13 -0
- data/tools/staticdocs/lunr-index-1702922896263.json +1 -0
- data/tools/staticdocs/lunr-index.json +1 -0
- data/tools/staticdocs/markdown-page.html +14 -0
- data/tools/staticdocs/search-doc-1702922896263.json +1 -0
- data/tools/staticdocs/search-doc.json +1 -0
- data/tools/staticdocs/sitemap.xml +1 -0
- metadata +432 -428
- data/tools/docs/404.html +0 -16
- data/tools/docs/assets/css/styles.7bc79028.css +0 -1
- data/tools/docs/assets/js/019369f3.bb600de8.js +0 -1
- data/tools/docs/assets/js/058ffc22.ce27f074.js +0 -1
- data/tools/docs/assets/js/0686a885.5fe3bfd4.js +0 -1
- data/tools/docs/assets/js/078dbab0.0a98e0c9.js +0 -1
- data/tools/docs/assets/js/0f5d161c.3a7b00e4.js +0 -1
- data/tools/docs/assets/js/0ff569c9.930bab08.js +0 -1
- data/tools/docs/assets/js/103cc3be.451dd416.js +0 -1
- data/tools/docs/assets/js/13196248.1be5ac81.js +0 -1
- data/tools/docs/assets/js/13c1b4e4.ad24c4f6.js +0 -1
- data/tools/docs/assets/js/15a39a64.4138456c.js +0 -1
- data/tools/docs/assets/js/2029.9e268a82.js +0 -1
- data/tools/docs/assets/js/2047b354.7995865f.js +0 -1
- data/tools/docs/assets/js/22b3ac48.73a6c979.js +0 -1
- data/tools/docs/assets/js/2846.a87f3fc4.js +0 -1
- data/tools/docs/assets/js/3477.783e2e37.js +0 -2
- data/tools/docs/assets/js/3dd7ef3b.8f77876c.js +0 -1
- data/tools/docs/assets/js/3df159b4.dded3e78.js +0 -1
- data/tools/docs/assets/js/40365d27.9322abd8.js +0 -1
- data/tools/docs/assets/js/411898ad.a1d949a2.js +0 -1
- data/tools/docs/assets/js/42170351.46c774f8.js +0 -1
- data/tools/docs/assets/js/43652efd.cbac4bc0.js +0 -1
- data/tools/docs/assets/js/5109.6a372217.js +0 -1
- data/tools/docs/assets/js/54d0d530.e9c8193b.js +0 -1
- data/tools/docs/assets/js/5bc719f6.fce76244.js +0 -1
- data/tools/docs/assets/js/5c6ce5ec.f909714f.js +0 -1
- data/tools/docs/assets/js/5e3ed378.cdfe0362.js +0 -1
- data/tools/docs/assets/js/5fe211ef.809c3f96.js +0 -1
- data/tools/docs/assets/js/6831b732.735c11e9.js +0 -1
- data/tools/docs/assets/js/696b4199.ff9185d0.js +0 -1
- data/tools/docs/assets/js/6b210247.248680ef.js +0 -1
- data/tools/docs/assets/js/6b65133b.2144fb1b.js +0 -1
- data/tools/docs/assets/js/6f92e431.608f28e7.js +0 -1
- data/tools/docs/assets/js/72c6d8a8.062b7650.js +0 -1
- data/tools/docs/assets/js/75e64983.d42f03f8.js +0 -1
- data/tools/docs/assets/js/7efc9fb0.6164fbad.js +0 -1
- data/tools/docs/assets/js/867640d5.28196e2c.js +0 -1
- data/tools/docs/assets/js/89e76475.5131b624.js +0 -1
- data/tools/docs/assets/js/8f7843ee.69e537b0.js +0 -1
- data/tools/docs/assets/js/9424f0b3.73086bed.js +0 -1
- data/tools/docs/assets/js/97535711.c7556831.js +0 -1
- data/tools/docs/assets/js/99581c43.30aef54d.js +0 -1
- data/tools/docs/assets/js/9d6e81d0.84fe3bb3.js +0 -1
- data/tools/docs/assets/js/9fb6059a.dc4760ab.js +0 -1
- data/tools/docs/assets/js/a182b3b3.25afec82.js +0 -1
- data/tools/docs/assets/js/a507c363.71a89240.js +0 -1
- data/tools/docs/assets/js/a677c089.2ec103f7.js +0 -1
- data/tools/docs/assets/js/a9987364.de63d165.js +0 -1
- data/tools/docs/assets/js/aa6b6c1b.6b24256f.js +0 -1
- data/tools/docs/assets/js/ada50b5c.1c75d3de.js +0 -1
- data/tools/docs/assets/js/b4596165.ab1c689f.js +0 -1
- data/tools/docs/assets/js/b6d70f94.ec27318b.js +0 -1
- data/tools/docs/assets/js/b9f60ba6.bb514133.js +0 -1
- data/tools/docs/assets/js/bd0034eb.0c60929d.js +0 -1
- data/tools/docs/assets/js/c24eae19.12176204.js +0 -1
- data/tools/docs/assets/js/cb8c3f08.762bb287.js +0 -1
- data/tools/docs/assets/js/cd879be4.3641a5cb.js +0 -1
- data/tools/docs/assets/js/d1b923aa.bf4b0c9e.js +0 -1
- data/tools/docs/assets/js/d24bf9b6.6ed3b576.js +0 -1
- data/tools/docs/assets/js/d370d7a7.28ef1aad.js +0 -1
- data/tools/docs/assets/js/d57a4b5d.017675ee.js +0 -1
- data/tools/docs/assets/js/d5d77c37.f472b18b.js +0 -1
- data/tools/docs/assets/js/d5f295fb.e008c3ec.js +0 -1
- data/tools/docs/assets/js/d7c988eb.2670948e.js +0 -1
- data/tools/docs/assets/js/d8ca4191.717db664.js +0 -1
- data/tools/docs/assets/js/d9b92eba.5eff70b2.js +0 -1
- data/tools/docs/assets/js/db8fa1d0.85784608.js +0 -1
- data/tools/docs/assets/js/dc5f7beb.120c148d.js +0 -1
- data/tools/docs/assets/js/e501b0d1.ae564e73.js +0 -1
- data/tools/docs/assets/js/f15615f1.3126a842.js +0 -1
- data/tools/docs/assets/js/fd886806.d2d0bdf4.js +0 -1
- data/tools/docs/assets/js/main.b5a535c2.js +0 -2
- data/tools/docs/assets/js/runtime~main.e3a6c705.js +0 -1
- data/tools/docs/docs/configuration/command.html +0 -40
- data/tools/docs/docs/configuration/format.html +0 -16
- data/tools/docs/docs/configuration/interfaces.html +0 -16
- data/tools/docs/docs/configuration/plugins.html +0 -17
- data/tools/docs/docs/configuration/protocols.html +0 -23
- data/tools/docs/docs/configuration/ssl-tls.html +0 -17
- data/tools/docs/docs/configuration/table.html +0 -30
- data/tools/docs/docs/configuration/target.html +0 -16
- data/tools/docs/docs/configuration/telemetry-screens.html +0 -36
- data/tools/docs/docs/configuration/telemetry.html +0 -16
- data/tools/docs/docs/configuration.html +0 -16
- data/tools/docs/docs/development/curl.html +0 -16
- data/tools/docs/docs/development/developing.html +0 -19
- data/tools/docs/docs/development/host-install.html +0 -16
- data/tools/docs/docs/development/json-api.html +0 -16
- data/tools/docs/docs/development/log-structure.html +0 -17
- data/tools/docs/docs/development/roadmap.html +0 -16
- data/tools/docs/docs/development/streaming-api.html +0 -18
- data/tools/docs/docs/development/testing.html +0 -16
- data/tools/docs/docs/development.html +0 -16
- data/tools/docs/docs/getting-started/gettingstarted.html +0 -16
- data/tools/docs/docs/getting-started/installation.html +0 -18
- data/tools/docs/docs/getting-started/podman.html +0 -18
- data/tools/docs/docs/getting-started/requirements.html +0 -16
- data/tools/docs/docs/getting-started/upgrading.html +0 -16
- data/tools/docs/docs/getting-started.html +0 -16
- data/tools/docs/docs/guides/bridges.html +0 -23
- data/tools/docs/docs/guides/cfs.html +0 -46
- data/tools/docs/docs/guides/custom-widgets.html +0 -16
- data/tools/docs/docs/guides/little-endian-bitfields.html +0 -16
- data/tools/docs/docs/guides/local-mode.html +0 -16
- data/tools/docs/docs/guides/logging.html +0 -16
- data/tools/docs/docs/guides/monitoring.html +0 -16
- data/tools/docs/docs/guides/performance.html +0 -16
- data/tools/docs/docs/guides/raspberrypi.html +0 -16
- data/tools/docs/docs/guides/script-writing.html +0 -18
- data/tools/docs/docs/guides/scripting-api.html +0 -17
- data/tools/docs/docs/guides.html +0 -16
- data/tools/docs/docs/meta/contributing.html +0 -20
- data/tools/docs/docs/meta/philosophy.html +0 -16
- data/tools/docs/docs/meta/xtce.html +0 -16
- data/tools/docs/docs/meta.html +0 -16
- data/tools/docs/docs/privacy.html +0 -23
- data/tools/docs/docs/tools/autonomic.html +0 -16
- data/tools/docs/docs/tools/bucket-explorer.html +0 -16
- data/tools/docs/docs/tools/calendar.html +0 -16
- data/tools/docs/docs/tools/cmd-sender.html +0 -16
- data/tools/docs/docs/tools/cmd-tlm-server.html +0 -17
- data/tools/docs/docs/tools/data-extractor.html +0 -16
- data/tools/docs/docs/tools/data-viewer.html +0 -16
- data/tools/docs/docs/tools/handbooks.html +0 -16
- data/tools/docs/docs/tools/limits-monitor.html +0 -16
- data/tools/docs/docs/tools/packet-viewer.html +0 -16
- data/tools/docs/docs/tools/script-runner.html +0 -16
- data/tools/docs/docs/tools/table-manager.html +0 -16
- data/tools/docs/docs/tools/tlm-grapher.html +0 -16
- data/tools/docs/docs/tools/tlm-viewer.html +0 -17
- data/tools/docs/docs/tools.html +0 -16
- data/tools/docs/docs/v5/bridges/index.html +0 -11
- data/tools/docs/docs/v5/bucket-explorer/index.html +0 -11
- data/tools/docs/docs/v5/calendar/index.html +0 -11
- data/tools/docs/docs/v5/cfs/index.html +0 -11
- data/tools/docs/docs/v5/cmd-sender/index.html +0 -11
- data/tools/docs/docs/v5/cmd-tlm-server/index.html +0 -11
- data/tools/docs/docs/v5/command/index.html +0 -11
- data/tools/docs/docs/v5/contributing/index.html +0 -11
- data/tools/docs/docs/v5/custom-widgets/index.html +0 -11
- data/tools/docs/docs/v5/data-extractor/index.html +0 -11
- data/tools/docs/docs/v5/data-viewer/index.html +0 -11
- data/tools/docs/docs/v5/development/index.html +0 -11
- data/tools/docs/docs/v5/format/index.html +0 -11
- data/tools/docs/docs/v5/gettingstarted/index.html +0 -11
- data/tools/docs/docs/v5/handbooks/index.html +0 -11
- data/tools/docs/docs/v5/host-install/index.html +0 -11
- data/tools/docs/docs/v5/index.html +0 -11
- data/tools/docs/docs/v5/installation/index.html +0 -11
- data/tools/docs/docs/v5/interfaces/index.html +0 -11
- data/tools/docs/docs/v5/json-api/index.html +0 -11
- data/tools/docs/docs/v5/limits-monitor/index.html +0 -11
- data/tools/docs/docs/v5/little-endian-bitfields/index.html +0 -11
- data/tools/docs/docs/v5/local-mode/index.html +0 -11
- data/tools/docs/docs/v5/log-structure/index.html +0 -11
- data/tools/docs/docs/v5/logging/index.html +0 -11
- data/tools/docs/docs/v5/monitoring/index.html +0 -11
- data/tools/docs/docs/v5/packet-viewer/index.html +0 -11
- data/tools/docs/docs/v5/performance/index.html +0 -11
- data/tools/docs/docs/v5/philosophy/index.html +0 -11
- data/tools/docs/docs/v5/plugins/index.html +0 -11
- data/tools/docs/docs/v5/podman/index.html +0 -11
- data/tools/docs/docs/v5/protocols/index.html +0 -11
- data/tools/docs/docs/v5/raspberrypi/index.html +0 -11
- data/tools/docs/docs/v5/requirements/index.html +0 -11
- data/tools/docs/docs/v5/roadmap/index.html +0 -11
- data/tools/docs/docs/v5/script-runner/index.html +0 -11
- data/tools/docs/docs/v5/script-writing/index.html +0 -11
- data/tools/docs/docs/v5/scripting-api/index.html +0 -11
- data/tools/docs/docs/v5/ssl-tls/index.html +0 -11
- data/tools/docs/docs/v5/streaming-api/index.html +0 -11
- data/tools/docs/docs/v5/table/index.html +0 -11
- data/tools/docs/docs/v5/table-manager/index.html +0 -11
- data/tools/docs/docs/v5/target/index.html +0 -11
- data/tools/docs/docs/v5/telemetry/index.html +0 -11
- data/tools/docs/docs/v5/telemetry-screens/index.html +0 -11
- data/tools/docs/docs/v5/testing/index.html +0 -11
- data/tools/docs/docs/v5/tlm-grapher/index.html +0 -11
- data/tools/docs/docs/v5/tlm-viewer/index.html +0 -11
- data/tools/docs/docs/v5/tools/index.html +0 -11
- data/tools/docs/docs/v5/upgrading/index.html +0 -11
- data/tools/docs/docs/v5/xtce/index.html +0 -11
- data/tools/docs/docs.html +0 -25
- data/tools/docs/index.html +0 -16
- data/tools/docs/lunr-index-1699630949575.json +0 -1
- data/tools/docs/lunr-index.json +0 -1
- data/tools/docs/markdown-page.html +0 -16
- data/tools/docs/search-doc-1699630949575.json +0 -1
- data/tools/docs/search-doc.json +0 -1
- data/tools/docs/sitemap.xml +0 -1
- /data/tools/{docs → staticdocs}/CNAME +0 -0
- /data/tools/{docs → staticdocs}/assets/images/add_packet-f318d0e92e8a13bd56331350aa341c88c8b12f2c54a4424f6e287817f22fb327.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/architecture-b78f12eba076a0c07af7abdd9dd4187c59aa6b4f5c51b47ad03f73e9f98a6ed6.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/autonomic-3d6d152f700c8fc1878d0f952d013ace31fccd7872d28587dc761610a0959e9c.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/bucket_explorer-983c087ee3bdcf8626219e782620b6c580fd82bfe2e8b0c662a0f90cdca43838.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/calendar-9fbd635cf3df1ba684bb0c1ebc4f6ad34991efc582e9fd07820c8b74cbb66aa1.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/checks_rb-a6049cdd99613cea2ee12d76fcfe798ff05270e39d208e93d37da7347049b2b3.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/cmd_tlm_server-313e3f64afc0e374d9d28b46364235d7b793001f84690fc0ae90e1eefdd9142d.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/command_sender-a0b113b65368263529d0f8f2d93276a0a44ed81af0d0100f56379346ba592928.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/commands-3608d5c856fd34e771d1f9e69f9f449f52929249bdf4f0e7feed0aa2bd2d9fd7.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/connecting-6e453f3d99800d4cb8fdc78f5b8fce1e8cf1bb04840a29dec7c5caefd07c004f.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/data_extractor-62c5b1743ba9dfdff2e393bcbdf863c36effc5ef5319d845cfd17186bd757bca.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/data_viewer-8c547cb5ad2ebd179aac5e46c2f4c147889ebad53a5359a5e6b6c580de7184fe.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/date_chooser-10f7b740b9acc76604e5dc86fe409b6b777abe0fb3fa5ebf8f47cb1ac58b9676.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/debug-04088348cc04bb8e1a1063fc44920dc8e39616840ef4b09a36c823f185c28669.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/delete_all_mouseover-06083f3d3d712d39f21bc5eda45adbfff449732a2061e53cb1a0baf6c5f5d4b8.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/delete_modified-a7ec0ceb61c37398d57fcecf11ebe2453ebd0110be6cfc960a5073a13a557638.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/edit_all_items-2c57aff19d3b1ce52149c37f50dcaad8c30baa0c9931fdc629f1d163bb56ce96.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/edit_all_mouseover-f6646df5320045ee10d4c0a15d0349fed6ede075f9cea6f9e449b3785c4f4f8d.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/edit_graph-4ca61635376fae26cf5eb82fb9fd803f1a51c4d3584aaf9833a270b7916bf531.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/edit_screen-5724ae13958c1631b3c187cf7cdb6dc9672ecd71f8b0786ac17c0266001edac3.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/edit_temp1-7446e7c5b7869ccc9ddd467779fa86f44301a5e5896751b016a527587c483cb2.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/file_menu-2fe13872737c0f3fef84ba5b58b80b609082733acce536ec1f56910c36f68299.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/file_open-319761fd383fc513b3689ef0a7498c73ce9459a3967c8a395cc2da07c89240d0.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/file_save_as-44468ed6a48bea3bc4fdd8f50d802569e4582b453e5bf946bfdcba400030d499.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/four_graphs-826cf8145338fa46e037556df94c59aeb4448330b601953daa94c89de8494cfd.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/graph_min_max-80a2bd83230c71b00ba9d6da24b8c32a09e4983976cdbf32c33d2680b534b106.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/graph_temp1-de937a79b314cf856b783c936d2460a6c942bdd45e4d9b3fe488957df5bfa9bc.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/graph_temp1_temp2-e96370f7d73a6cb68beaa92bcaaf18b72e6619ce948fe835762cca1048efbd18.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/graph_temp1_time-fec5e99e3cc05ea87208abe9c4b66b63b7497bbefee55f65d034417e966b1c46.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/handbooks-1d301c83c80a7cb96c548006f5139fe8ec967ed10a49df0142b37328cd987f33.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/ignored-1e20d4ffe7fd88ffab610340957b1176294269f985e8fdb20a9af07d7a78215f.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/inst_clear-5ecb859f06f14d91d2ebba27e5a7848d6393db5ad2357f95c12e776c45f6bc64.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/inst_collect-4f4e453a6521b779e10c4d2be6a8b1acf15fcb083af0164b0df1de27ca250132.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/inst_collect_hazardous-3aeabedb96bf114b4eb56b6b2ee7bcc601302ec8905a82a16c47ae7870f97978.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/inst_collect_hazardous_history-952a6e6ff2fb1b5fdf2c6b3d84a3ccf9e303eeb310f35514dc4a6e95f2a7420e.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/inst_collect_sent-0de429f724264ce8c52a6cb22d4bbb96f14e22b559c091ff4375bb59f124a7a2.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/inst_collect_sent_3-91cf4e053d246917964330ab93534a0a5eb878b652e7ea879effca7c4eaefbea.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/interface_read_logic-0deef27c1d2fec9de2a3720a3c9ecedb21a00dca7aabd13da0b8815c037e4c26.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/interface_write_logic-3360afe1b4af20b10dafba848a21e09baccaacc06e2ec8b6c132ac7a3c99e994.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/interfaces-5622abf50e3df63980661a48216bf71187f38cb636bd512f48917ca4a425f083.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/items_table-2fc1bb4d03a2348c4af7df442e13cee2f310cf455228005d76cbfda7a706aa53.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/items_table_raw-c4d454679c4503ec35710dcee6be5cd1940984595145b333d8604bc505dfe291.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/items_table_temp1-ea091eaf8005cea839800f4514f72f94e9664993111b935f33e7c5aa3061ca64.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/limits_monitor-c58d70daea7586b93d5069b9df068a90cea5f7cf2e51a445f3162bf3f66db3d0.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/list_view-926f42bc1e43283c61616b0cd8fd630cad8e15c9b7298acd98536842472e673b.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/log-ba64fd307e53adafae55fcea7eb31829ee1aacdf4aafe8b40b270b793be3aa27.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/log_messages-19c3ce9c7ff86e43d459cb6591df8c05d25e1390d857728cb462a57b9d3ccc69.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/log_messages-2cfad0fd6f6f980f69b5564a4b7ecfecf3331c6256c78bcfb2b084970db305ca.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/minimized-59d0d8d8a179ff0475787e87237b77b24d59d78826d43dbc1a554a51380eb37f.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/minimized-a658bd8f2115d3f9a386844e886de770b23bbf9c0c8c55a4ca587cea67ec320e.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/minio-150460ac77a50711835de6f0150d019000e5515afae0f3adfcdda8e891484f47.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/mouseover-95b774047b3c2ca23a3bc645caf75d90511c378729dd9cfb781510a1452e09fe.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/new_screen-295720ec60219194c8c8dd64c755e8a188cc4a68c2b6cf66197b54514644d52a.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/notifications-5b32d6619542431027ddd67491eb445469fa2d16fa8352a2b0917b9298b7bbb2.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/open_config-2e61415a3c2d7a4ce427cf325f3708dd4a761092b7dd0c869279c4354dc34ae4.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/open_config-3cd3be1ce4560d9e72bb37b83dc830149091dec9a088c36187e0e72660c6ec34.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/open_config-55ef2f241d02047b252bb8201742f99cffed5680d0e9eb46b3cb53a644ca3dc9.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/open_config-f848a8b371ae0ec31776834148e9f978d9be94efef03534e5ca3a59c0ae3847f.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/packet_viewer-19c1015cc704a98d1f6d90dd0dadc13188d25f1d5d2e838b7cfb226e8c173c7b.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/plugin-variables-5bc00c744182c9a9591e84cb3bbb1c4deb53ff22e05f62ce1b807c26bed782e5.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/processing-b0c50908284739a76e1bbcfcb3eb34dc9446f8716117cb0e9089ad9df53ebed6.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/project-fe7ac90f3e45971fca8f1be94be9dbabe494bafe705e7f8f485676e9d96e47ea.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/project_update-8e7de3b0658b95d4d9931eb52ff8bf339d633cbdc273ce096eb11ceb357c009e.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/raw_command-759d93759a73a6a3dd7e30f89fc4d1a544dfb6f7355abfed03897d404279161d.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/raw_telemetry-ffeb6b603f9a9abbe0cb77afaaeb4b4f07dfee479682a5c9661f85589a679049.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/raw_tlm_logs-8dcba4f020b36f8efbb793271b70d40d9cad627196afaeb5bf6f3931ed53fa52.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/reactions-dd4a8ebf22eed921a82a5478d23178c62e2cf944d295c2b9e3f4d7ce555b0fcc.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/reload_file-8e26cd3e1bc1eab7bb6c046d9a6a8231fcd76e56682d819b1e549182890c6486.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/reloaded-9effa15527244928ee503eb0c3a48cc5e82c07cfb5d5c4300eacfcab913069d1.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/running_scripts-78bfd36a6c8c7167234e03bd188e974927c2beea1f730498583169a81639e7a3.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/save_config-0ae36ac1f8114665f2558e936ba3b30e5cba2a16cc01d3494e14ed689b4637f7.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/save_config-8b028134b07c70d6de019825cbb328623fc485d72aad9ba5b1980246b316fec2.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/save_config-e4ed80276ebdc2c4eaf9aaeb859cff8aecb380b22da8c659741c31ca66914098.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/save_config-e748a338526ffd8f9e49def5c0d15f8a80cd987f40d210ff6c6d4b61b713555c.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/script_error-ce060b3086e7b466e51a276fb6b27245b4d042f07a60fe121b0071dd65a42075.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/script_runner-7d7f01b90be962b4de46c20568727c55488eec5d9844823b53a262c9cfc470fa.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/script_suite-42832d936f91417740b76a39841996c8e4a7cf5391dbb19abe9d7b31ab07dd7d.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/select_item-f063106a8d836656496ba81e7e7428f51bd8ab95aebab0aa4eb6ad41ed42e026.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/select_packet-0b6d5a2b012445ab2bf0fd3e1545f015cd7787280d05d2bccb0a9c9220102529.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/select_packet-be9d63c49f898cccb73f9e4b2b39c4b5879cead34a8ab2ede0bb08e953498e95.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/select_target-71ebcab6cbefafd8958939130861a75f7544e99a043d90fa0734ec2f983d835f.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/simple_screen-3c9d6d2366c716c03a301396a4ce0ea418532890f349d9bc9ebb8be90983a6e6.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/status-80010882300d2f1c453fbc4cb35bdb1f06d3db578266dda95c56ea7ec230ac72.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/table_manager-9a5357ce536102bc1bb0c859be552f4ac82f62e538935a3c45a8e76d4f9744db.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/targets-d15296b133787be4997c3d5e7d43eec9030831f1758508a8f6a71d40d04478ce.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/telemetry-3f1169fc67b3d2427047ba66a9b2f3ddf71f61edf498ee70d14e78f0ef3c1e3c.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/telemetry_grapher-a96b7e0101f5e377a73a186683e967e79d748c5dff2dfed6ec0afcea5694d7c8.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/telemetry_viewer-be6ee576f1efceb39c2f744889deb4c18f571c4922c69d5d0e5f49a653776a46.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/temp1_details-f0b6e62bc28da18febacc936112735e1dbd5718ef675668f04d8b3e060d7f87a.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/time_chooser-e4ca0705d5b97c3056b0de3ab7f71f8091482b9b2e8904e69866a43ce4e616f2.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/timeline_lifecycle-0bd916dee06bf67936b043abfdbc4d5fdec7cc5a32a889ee6c05e9faf74f4c6a.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/triggers-0b0b3f9cc2850c1b83b9a7aab6f8a936626fd847c3158e993e4baa0e64b38096.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/two_full_height-7cf9d0bbdf0269ad85e312f6dcb77930e1e3c4319f9750968a9347fafcf26084.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/two_full_width-db2d88c0e2e6fc417016f47e3bac0bf68374957d8fc014220f53870429ea1ef3.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/view_portal-b2e5fef00be80f1551b965d170fc3cd8ed95597f0a1e475a8177ab2d306215f5.png +0 -0
- /data/tools/{docs → staticdocs}/assets/images/view_portal_add-56f06135fc56f1fa85cbc22ea3b7ad52f311641aad25df08b6f4a6f979b30e3f.png +0 -0
- /data/tools/{docs → staticdocs}/assets/js/1131.f9e1547d.js +0 -0
- /data/tools/{docs → staticdocs}/assets/js/2923e883.0cbdcbc5.js +0 -0
- /data/tools/{docs/assets/js/3477.783e2e37.js.LICENSE.txt → staticdocs/assets/js/4657.9492019f.js.LICENSE.txt} +0 -0
- /data/tools/{docs → staticdocs}/assets/js/d797a795.9243eac2.js +0 -0
- /data/tools/{docs → staticdocs}/img/BCT.png +0 -0
- /data/tools/{docs → staticdocs}/img/OpenC3.png +0 -0
- /data/tools/{docs → staticdocs}/img/article-footer.png +0 -0
- /data/tools/{docs → staticdocs}/img/ball.jpg +0 -0
- /data/tools/{docs → staticdocs}/img/black_logo.svg +0 -0
- /data/tools/{docs → staticdocs}/img/captech.gif +0 -0
- /data/tools/{docs → staticdocs}/img/docusaurus-social-card.jpg +0 -0
- /data/tools/{docs → staticdocs}/img/docusaurus.png +0 -0
- /data/tools/{docs → staticdocs}/img/favicon.png +0 -0
- /data/tools/{docs → staticdocs}/img/footer-logo.png +0 -0
- /data/tools/{docs → staticdocs}/img/interface_read_logic.png +0 -0
- /data/tools/{docs → staticdocs}/img/interface_write_logic.png +0 -0
- /data/tools/{docs → staticdocs}/img/johnh.gif +0 -0
- /data/tools/{docs → staticdocs}/img/lockheed.png +0 -0
- /data/tools/{docs → staticdocs}/img/logo.svg +0 -0
- /data/tools/{docs → staticdocs}/img/nasa.gif +0 -0
- /data/tools/{docs → staticdocs}/img/sdlusu.gif +0 -0
- /data/tools/{docs → staticdocs}/img/v5/architecture.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/autonomic/autonomic.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/autonomic/reactions.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/autonomic/triggers.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/bucket_explorer/bucket_explorer.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/calendar/calendar.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/calendar/list_view.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/calendar/timeline_lifecycle.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/cmd_tlm_server/cmd_tlm_server.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/cmd_tlm_server/commands.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/cmd_tlm_server/file_menu.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/cmd_tlm_server/interfaces.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/cmd_tlm_server/log_messages.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/cmd_tlm_server/raw_command.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/cmd_tlm_server/raw_telemetry.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/cmd_tlm_server/routers.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/cmd_tlm_server/status.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/cmd_tlm_server/targets.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/cmd_tlm_server/telemetry.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/command_sender/command_sender.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/command_sender/inst_clear.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/command_sender/inst_collect.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/command_sender/inst_collect_hazardous.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/command_sender/inst_collect_hazardous_history.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/command_sender/inst_collect_sent.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/command_sender/inst_collect_sent_3.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/command_sender/mode_menu.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/contact/jason.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/contact/ryan.jpeg +0 -0
- /data/tools/{docs → staticdocs}/img/v5/data_extractor/data_extractor.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/data_extractor/date_chooser.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/data_extractor/delete_all_mouseover.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/data_extractor/download.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/data_extractor/edit_all_items.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/data_extractor/edit_all_mouseover.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/data_extractor/edit_temp1.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/data_extractor/file_menu.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/data_extractor/items_table.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/data_extractor/items_table_raw.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/data_extractor/items_table_temp1.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/data_extractor/mode_menu.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/data_extractor/open_config.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/data_extractor/processing.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/data_extractor/save_config.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/data_extractor/select_item.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/data_extractor/select_packet.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/data_extractor/select_target.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/data_extractor/time_chooser.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/data_viewer/add_packet.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/data_viewer/data_viewer.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/data_viewer/file_menu.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/data_viewer/open_config.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/data_viewer/rename_tab.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/data_viewer/save_config.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/data_viewer/tab_right_click.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/data_viewer/view_portal.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/data_viewer/view_portal_add.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/guides/local_mode/delete_modified.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/guides/local_mode/minio.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/guides/local_mode/project.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/guides/local_mode/project_update.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/guides/local_mode/reload_file.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/guides/local_mode/reloaded.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/guides/logging/browser.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/guides/logging/log_messages.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/guides/logging/notifications.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/guides/logging/raw_tlm_logs.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/guides/plugin-variables.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/guides/simple_screen.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/handbooks/handbooks.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/limits_monitor/ignored.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/limits_monitor/limits_monitor.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/limits_monitor/log.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/limits_monitor/mouseover.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/navigation.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/packet_viewer/file_menu.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/packet_viewer/packet_viewer.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/packet_viewer/select_packet.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/packet_viewer/temp1_details.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/packet_viewer/view_menu.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/script_runner/checks_rb.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/script_runner/connecting.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/script_runner/debug.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/script_runner/file_menu.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/script_runner/file_open.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/script_runner/file_save_as.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/script_runner/running_scripts.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/script_runner/script_error.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/script_runner/script_menu.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/script_runner/script_runner.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/script_runner/script_suite.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/table_manager/file_menu.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/table_manager/table_manager.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/telemetry_grapher/edit_graph.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/telemetry_grapher/file_menu.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/telemetry_grapher/four_graphs.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/telemetry_grapher/graph_menu.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/telemetry_grapher/graph_min_max.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/telemetry_grapher/graph_temp1.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/telemetry_grapher/graph_temp1_temp2.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/telemetry_grapher/graph_temp1_time.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/telemetry_grapher/grapher_controls.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/telemetry_grapher/minimized.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/telemetry_grapher/open_config.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/telemetry_grapher/save_config.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/telemetry_grapher/stop_start.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/telemetry_grapher/telemetry_grapher.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/telemetry_grapher/two_full_height.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/telemetry_grapher/two_full_width.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/telemetry_viewer/edit_screen.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/telemetry_viewer/file_menu.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/telemetry_viewer/minimized.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/telemetry_viewer/new_screen.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/telemetry_viewer/open_config.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/telemetry_viewer/save_config.png +0 -0
- /data/tools/{docs → staticdocs}/img/v5/telemetry_viewer/telemetry_viewer.png +0 -0
@@ -0,0 +1,260 @@
|
|
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.0.0">
|
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.6e885bef.css">
|
7
|
+
<script src="/tools/staticdocs/assets/js/runtime~main.6ca622b3.js" defer="defer"></script>
|
8
|
+
<script src="/tools/staticdocs/assets/js/main.1b3209ca.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 localStorage.getItem("theme")}catch(t){}}();t(null!==e?e:"dark")}(),function(){try{const c=new URLSearchParams(window.location.search).entries();for(var[t,e]of c)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" aria-expanded="false" href="/tools/staticdocs/docs/getting-started">Getting Started</a><button aria-label="Expand sidebar category 'Getting Started'" 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" aria-expanded="false" href="/tools/staticdocs/docs/configuration">Configuration</a><button aria-label="Expand sidebar category 'Configuration'" 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" aria-expanded="false" href="/tools/staticdocs/docs/tools">Tools</a><button aria-label="Expand sidebar category 'Tools'" 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" aria-expanded="true" href="/tools/staticdocs/docs/guides">Guides</a><button aria-label="Collapse sidebar category 'Guides'" 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" aria-expanded="false" href="/tools/staticdocs/docs/development">Development</a><button aria-label="Expand sidebar category 'Development'" 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" aria-expanded="false" href="/tools/staticdocs/docs/meta">Meta</a><button aria-label="Expand sidebar category 'Meta'" 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>
|
12
|
+
<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>
|
14
|
+
<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>
|
16
|
+
<p>There are many similarities and a few key differences between Ruby and Python when it comes to writing COSMOS scripts.</p>
|
17
|
+
<ol>
|
18
|
+
<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>
|
19
|
+
<li>Indentation white space:<!-- -->
|
20
|
+
<ol>
|
21
|
+
<li>Ruby: Not significant. Ruby uses the <code>end</code> keyword to determine indented code blocks with a standard of 2 spaces.</li>
|
22
|
+
<li>Python: Significant. Python uses indentation to determine code blocks with a standard of 4 spaces.</li>
|
23
|
+
</ol>
|
24
|
+
</li>
|
25
|
+
<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
|
+
<li>Variable interpolation:<!-- -->
|
27
|
+
<ol>
|
28
|
+
<li>Ruby: Variable values can be placed into strings using the <code>"#{variable}"</code> syntax.</li>
|
29
|
+
<li>Python: Variable values can be placed into f-strings using the <code>f"{variable}"</code> syntax.</li>
|
30
|
+
</ol>
|
31
|
+
</li>
|
32
|
+
<li>A variable declared inside of a block or loop will not exist outside of that block unless it was already declared.</li>
|
33
|
+
</ol>
|
34
|
+
<p>Both languages provides a script writer a lot of power. But with great power comes great responsibility. Remember when writing your scripts that you or someone else will come along later and need to understand them. Therefore use the following style guidelines:</p>
|
35
|
+
<ul>
|
36
|
+
<li>Use consistent spacing for indentation and do NOT use tabs</li>
|
37
|
+
<li>Constants should be all caps with underscores<!-- -->
|
38
|
+
<ul>
|
39
|
+
<li><code>SPEED_OF_LIGHT = 299792458 # meters per s</code></li>
|
40
|
+
</ul>
|
41
|
+
</li>
|
42
|
+
<li>Variable names and method names should be in lowercase with underscores<!-- -->
|
43
|
+
<ul>
|
44
|
+
<li><code>last_name = "Smith"</code></li>
|
45
|
+
<li><code>perform_setup_operation()</code></li>
|
46
|
+
</ul>
|
47
|
+
</li>
|
48
|
+
<li>Class names (when used) should be camel case and the files which contain them should match but be lowercase with underscores<!-- -->
|
49
|
+
<ul>
|
50
|
+
<li><code>class DataUploader # in 'data_uploader.rb'</code></li>
|
51
|
+
<li><code>class CcsdsUtility: # in 'ccsds_utility.py'</code></li>
|
52
|
+
</ul>
|
53
|
+
</li>
|
54
|
+
<li>Don't add useless comments but instead describe intent</li>
|
55
|
+
</ul>
|
56
|
+
<div style="clear:both"></div>
|
57
|
+
<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)">'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"></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>
|
59
|
+
<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)">'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"></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 '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
|
+
<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
|
+
<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 'helper_utility' 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"<!-- --> 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 'clear_collects' 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>
|
69
|
+
<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)">"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"></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>
|
71
|
+
<p>or similarly with a counter that is sampled before the command.</p>
|
72
|
+
<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)">"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"></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
|
+
<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)">"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"></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
|
+
<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'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'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
|
+
<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
|
+
<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
|
+
<p>For example, a script that powers on a subsystem and ensures correct telemetry would become:</p>
|
83
|
+
<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>
|
85
|
+
<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>
|
87
|
+
<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>
|
89
|
+
<p>Blocks of code where only the only variation is the mnemonics or values checked can be replaced by methods with arguments.</p>
|
90
|
+
<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)">"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"></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>
|
92
|
+
<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"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"></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>
|
95
|
+
<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, UNNECCESSARY</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"></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>
|
98
|
+
<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 '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
|
+
<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>
|
102
|
+
<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
|
+
<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>
|
105
|
+
<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>
|
107
|
+
<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>
|
109
|
+
<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's scripts/procedures.</p>
|
114
|
+
<p>| Folder | Description |
|
115
|
+
| targets/TARGET_NAME/lib | Place script files containing reusable target specific methods here |
|
116
|
+
| targets/TARGET_NAME/procedures | Place simple procedures that are centered around one specific target here |</p>
|
117
|
+
<p>In your main procedure you will usually bring in the other files with instrumentation using load_utility.</p>
|
118
|
+
<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"></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>
|
119
|
+
<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>
|
120
|
+
<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>
|
121
|
+
<p>Ruby:</p>
|
122
|
+
<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"></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
|
+
<p>Python:</p>
|
124
|
+
<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"></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>
|
125
|
+
<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>
|
126
|
+
<p>Classes in object-oriented programing 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>
|
127
|
+
<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>
|
128
|
+
<p>Ruby:</p>
|
129
|
+
<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"></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
|
+
<p>Python:</p>
|
131
|
+
<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"></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>
|
132
|
+
<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>
|
133
|
+
<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>
|
134
|
+
<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>
|
135
|
+
<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>
|
136
|
+
<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>
|
137
|
+
<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>
|
138
|
+
<p>Ruby:</p>
|
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">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>
|
140
|
+
<p>Python:</p>
|
141
|
+
<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>
|
142
|
+
<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>
|
143
|
+
<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>
|
144
|
+
<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>
|
145
|
+
<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>
|
146
|
+
<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>
|
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><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>
|
148
|
+
<p>Variables can also be set simply by using equals.</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">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>
|
150
|
+
<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>
|
151
|
+
<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"></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>
|
152
|
+
<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>
|
153
|
+
<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>
|
154
|
+
<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>
|
155
|
+
<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>
|
156
|
+
<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>
|
157
|
+
<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>
|
158
|
+
<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>
|
159
|
+
<p>Script Runner includes several tools to help audit your scripts both before and after execution.</p>
|
160
|
+
<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>
|
161
|
+
<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>
|
162
|
+
<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>
|
163
|
+
<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>
|
164
|
+
<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>
|
165
|
+
<p>Ruby:</p>
|
166
|
+
<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)"><</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"></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>
|
167
|
+
<p>Python:</p>
|
168
|
+
<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)"><</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"></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
|
+
<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>
|
170
|
+
<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>
|
171
|
+
<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>
|
172
|
+
<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 the $manual variable. If $manual is set, then the manual steps should be executed. If not, then a default value should be used.</p>
|
173
|
+
<p>Ruby Only:</p>
|
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"># Set the $manual variable – Only needed outside of suites</span><span class="token plain"></span><br></span><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</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string-literal string" style="color:rgb(173, 219, 103)">"Prompt for manual entry (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)">'n'</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(127, 219, 202)">or</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)">'N'</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)">$manual</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 boolean" style="color:rgb(255, 88, 116)">false</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"> </span><span class="token variable" style="color:rgb(214, 222, 235)">$manual</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 boolean" style="color:rgb(255, 88, 116)">true</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 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"></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>
|
175
|
+
<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="outputing-extra-information-to-a-report">Outputing Extra Information to a Report<a href="#outputing-extra-information-to-a-report" class="hash-link" aria-label="Direct link to Outputing Extra Information to a Report" title="Direct link to Outputing Extra Information to a Report"></a></h3>
|
177
|
+
<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
|
+
<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)"><</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"></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>
|
180
|
+
<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)">"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"></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>
|
183
|
+
<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)">"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"></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>
|
186
|
+
<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
|
+
<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)">'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_packet</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 re-use 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_packet</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>
|
189
|
+
<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)">'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_packet</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 re-use 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_packet</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>
|
192
|
+
<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
|
+
<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)">"</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"></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>
|
195
|
+
<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"</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"></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>
|
199
|
+
<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
|
+
<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)">"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 < 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"></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>
|
202
|
+
<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)">"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 < 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"></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'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'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)">"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"></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>
|
209
|
+
<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)">"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"></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>
|
213
|
+
<p>There are three common reasons that checks fail in COSMOS scripts:</p>
|
214
|
+
<ol>
|
215
|
+
<li>
|
216
|
+
<p>The delay given was too short</p>
|
217
|
+
<p>The wait_check() method takes a timeout that indicates how long to wait for the referenced telemetry point to pass the check. The timeout needs to be large enough for the system under test to finish its action and for updated telemetry to be received. Note that the script will continue as soon as the check completes successfully. Thus, the only penalty for a longer timeout is the additional wait time in a failure condition.</p>
|
218
|
+
</li>
|
219
|
+
<li>
|
220
|
+
<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're using an appropriate tolerance value.</p>
|
222
|
+
</li>
|
223
|
+
<li>
|
224
|
+
<p>The check really failed</p>
|
225
|
+
<p>Of course, sometimes there are real failures. See the next section for how to handle them and recover.</p>
|
226
|
+
</li>
|
227
|
+
</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>
|
229
|
+
<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
|
+
<ol>
|
231
|
+
<li>
|
232
|
+
<p>Retry</p>
|
233
|
+
<p>After a failure, the Script Runner “Pause” button changes to “Retry”. Clicking on the Retry button will re-execute the line the failed. For failures due to timing issues, this will often resolve the issue and allow the script to continue. Make note of the failure and be sure to update your script prior to the next run.</p>
|
234
|
+
</li>
|
235
|
+
<li>
|
236
|
+
<p>Use the Debug Prompt</p>
|
237
|
+
<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
|
+
</li>
|
239
|
+
<li>
|
240
|
+
<p>Execute Selection</p>
|
241
|
+
<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
|
+
</li>
|
243
|
+
<li>
|
244
|
+
<p>Run from here</p>
|
245
|
+
<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
|
+
</li>
|
247
|
+
</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>
|
250
|
+
<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
|
+
<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)">'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"></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>
|
253
|
+
<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)">'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"></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't typically useful for COSMOS scripting though.</p>
|
257
|
+
<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)"><</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="theme-doc-footer-edit-meta-row 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_T23F"></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'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="#outputing-extra-information-to-a-report" class="table-of-contents__link toc-highlight">Outputing 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 © 2023 OpenC3, Inc.</div></div></div></footer></div>
|
259
|
+
</body>
|
260
|
+
</html>
|