@openc3/vue-common 6.5.1 → 6.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/dist/ArrayWidget-Bb_Ldxq7.cjs.map +1 -1
  2. package/dist/ArrayWidget-Ck6pzAyW.js.map +1 -1
  3. package/dist/ArrayplotWidget-DC41cpv1.cjs.map +1 -1
  4. package/dist/ArrayplotWidget-ntRLh6-B.js.map +1 -1
  5. package/dist/AstroStatus-CILMWL6F.cjs.map +1 -1
  6. package/dist/AstroStatus-CY9VkeTN.js.map +1 -1
  7. package/dist/BarColumn-Bgz2YJ59.js.map +1 -1
  8. package/dist/BarColumn-DtRNuOpa.cjs.map +1 -1
  9. package/dist/BlockWidget-DGH3Zz5p.js.map +1 -1
  10. package/dist/BlockWidget-DOY5lVfa.cjs.map +1 -1
  11. package/dist/ButtonWidget-CFyZXGt6.cjs.map +1 -1
  12. package/dist/ButtonWidget-D_tupiPB.js.map +1 -1
  13. package/dist/CanvasWidget-C6dc7mUw.cjs.map +1 -1
  14. package/dist/CanvasWidget-CzG2jYQb.js.map +1 -1
  15. package/dist/CanvasimageWidget-CNJlzLqo.js.map +1 -1
  16. package/dist/CanvasimageWidget-DjvdDCRS.cjs.map +1 -1
  17. package/dist/CanvasimagevalueWidget-C1fI-ftP.cjs.map +1 -1
  18. package/dist/CanvasimagevalueWidget-DudwwOD6.js.map +1 -1
  19. package/dist/CanvaslabelWidget--6Sjc4E8.cjs.map +1 -1
  20. package/dist/CanvaslabelWidget-BZQp16dH.js.map +1 -1
  21. package/dist/CanvaslabelvalueWidget-CHS36Te9.js.map +1 -1
  22. package/dist/CanvaslabelvalueWidget-DZCxsIKk.cjs.map +1 -1
  23. package/dist/CanvaslineWidget-Bn83Rb10.cjs.map +1 -1
  24. package/dist/CanvaslineWidget-nhKEAGhs.js.map +1 -1
  25. package/dist/CanvaslinevalueWidget-C6x_4Gc9.cjs.map +1 -1
  26. package/dist/CanvaslinevalueWidget-DsyIDkJy.js.map +1 -1
  27. package/dist/CheckbuttonWidget-BvggsGZY.cjs.map +1 -1
  28. package/dist/CheckbuttonWidget-DCam7Jd0.js.map +1 -1
  29. package/dist/ComboboxWidget-BS5WSbrK.cjs.map +1 -1
  30. package/dist/ComboboxWidget-ZX-k-_aK.js.map +1 -1
  31. package/dist/CriticalCmdDialog-7tOK2XQk.cjs.map +1 -1
  32. package/dist/CriticalCmdDialog-Dylpoz_4.js.map +1 -1
  33. package/dist/CustomIcon-Bop2mEnu.cjs.map +1 -1
  34. package/dist/CustomIcon-h5X7369N.js.map +1 -1
  35. package/dist/DateWidget-DuJ5uC2t.js.map +1 -1
  36. package/dist/DateWidget-jejbk2-G.cjs.map +1 -1
  37. package/dist/DetailsDialog-BQE0TraI.js.map +1 -1
  38. package/dist/DetailsDialog-DmKpPDNn.cjs.map +1 -1
  39. package/dist/DynamicWidget-BWEVCUfd.cjs.map +1 -1
  40. package/dist/DynamicWidget-CfMtj7H8.js.map +1 -1
  41. package/dist/EventListDialog-CDcJcxy5.cjs.map +1 -1
  42. package/dist/EventListDialog-CGUFCrJF.js.map +1 -1
  43. package/dist/FormatvalueWidget-DYICPNcx.js.map +1 -1
  44. package/dist/FormatvalueWidget-wu7Q3sXu.cjs.map +1 -1
  45. package/dist/Graph-DCihpnT0.js.map +1 -1
  46. package/dist/Graph-mSqImgca.cjs.map +1 -1
  47. package/dist/GraphWidget-CQjKAMPR.cjs.map +1 -1
  48. package/dist/GraphWidget-cTVq29cY.js.map +1 -1
  49. package/dist/HorizontalWidget--AkRJPlL.cjs.map +1 -1
  50. package/dist/HorizontalWidget-v1pfd94Z.js.map +1 -1
  51. package/dist/HorizontalboxWidget-B06-c_n4.js.map +1 -1
  52. package/dist/HorizontalboxWidget-synL-Bar.cjs.map +1 -1
  53. package/dist/IframeWidget-ByhwW9yG.cjs.map +1 -1
  54. package/dist/IframeWidget-n8lNXrpt.js.map +1 -1
  55. package/dist/ImageLoader-CfcErydq.js.map +1 -1
  56. package/dist/ImageLoader-DBWVFtNu.cjs.map +1 -1
  57. package/dist/ImageviewerWidget-D4mU6wLX.cjs.map +1 -1
  58. package/dist/ImageviewerWidget-DE8fj06Z.js.map +1 -1
  59. package/dist/InterfacesTab-BF-Wx5gk.js.map +1 -1
  60. package/dist/InterfacesTab-DTAAIx-y.cjs.map +1 -1
  61. package/dist/LabelWidget-DQZqRxKF.cjs.map +1 -1
  62. package/dist/LabelWidget-iUIJLhdA.js.map +1 -1
  63. package/dist/LabelledWidget-9HWChRmv.cjs.map +1 -1
  64. package/dist/LabelledWidget-KI6fMlsr.js.map +1 -1
  65. package/dist/LabelprogressbarWidget-C2lzmqBH.js.map +1 -1
  66. package/dist/LabelprogressbarWidget-DwzTP73u.cjs.map +1 -1
  67. package/dist/LabelsparklineWidget-Ci6GGm29.js.map +1 -1
  68. package/dist/LabelsparklineWidget-DMjBshq8.cjs.map +1 -1
  69. package/dist/LabelvalueWidget-mAb0eLA8.cjs.map +1 -1
  70. package/dist/LabelvalueWidget-oiW-JDw6.js.map +1 -1
  71. package/dist/LabelvaluedescWidget-CZJ0kZN-.cjs.map +1 -1
  72. package/dist/LabelvaluedescWidget-Ck0AJ9g0.js.map +1 -1
  73. package/dist/LabelvaluelimitsbarWidget-DjBqYxRr.cjs.map +1 -1
  74. package/dist/LabelvaluelimitsbarWidget-aaVLaejn.js.map +1 -1
  75. package/dist/LabelvaluerangebarWidget-Bs9locqu.js.map +1 -1
  76. package/dist/LabelvaluerangebarWidget-Ci-n_hxk.cjs.map +1 -1
  77. package/dist/LedWidget-BN8IgAxJ.js.map +1 -1
  78. package/dist/LedWidget-BUTbyEBi.cjs.map +1 -1
  79. package/dist/LimitsbarWidget-BxxoKTjp.js.map +1 -1
  80. package/dist/LimitsbarWidget-Co5GAHro.cjs.map +1 -1
  81. package/dist/LimitscolorWidget-BpTcgqRC.cjs.map +1 -1
  82. package/dist/LimitscolorWidget-DFDwf4In.js.map +1 -1
  83. package/dist/LimitscolumnWidget-CdBh2mJu.js.map +1 -1
  84. package/dist/LimitscolumnWidget-CqJJKDzz.cjs.map +1 -1
  85. package/dist/MatrixbycolumnsWidget-DCwxPjwS.js.map +1 -1
  86. package/dist/MatrixbycolumnsWidget-DxRhvPGv.cjs.map +1 -1
  87. package/dist/MicroservicesTab-B-SdMwek.js.map +1 -1
  88. package/dist/MicroservicesTab-DGaTcj-y.cjs.map +1 -1
  89. package/dist/Openc3Screen-BZN0Wtrm.js.map +1 -1
  90. package/dist/Openc3Screen-dtpBWZdA.cjs.map +1 -1
  91. package/dist/OutputDialog-CcSp-Uqo.js.map +1 -1
  92. package/dist/OutputDialog-CxKDhrg6.cjs.map +1 -1
  93. package/dist/PackagesTab-B4V2n4io.cjs.map +1 -1
  94. package/dist/PackagesTab-Dx25CfF0.js.map +1 -1
  95. package/dist/PluginsTab-DHO1tK2S.cjs.map +1 -1
  96. package/dist/PluginsTab-lHDR5v6S.js.map +1 -1
  97. package/dist/ProgressbarWidget-C0AkbX_o.cjs.map +1 -1
  98. package/dist/ProgressbarWidget-Cdu5nJC3.js.map +1 -1
  99. package/dist/RadiobuttonWidget-CZZGbvdG.js.map +1 -1
  100. package/dist/RadiobuttonWidget-DslmJO31.cjs.map +1 -1
  101. package/dist/RadiogroupWidget-CQN3v8Ip.js.map +1 -1
  102. package/dist/RadiogroupWidget-DKgBAR9E.cjs.map +1 -1
  103. package/dist/RangebarWidget-Tq80I5zA.cjs.map +1 -1
  104. package/dist/RangebarWidget-dZN9WjoZ.js.map +1 -1
  105. package/dist/RedisTab-CdiSo-CO.cjs.map +1 -1
  106. package/dist/RedisTab-CkSwEwTZ.js.map +1 -1
  107. package/dist/RollupWidget-CHdZAUCb.cjs.map +1 -1
  108. package/dist/RollupWidget-i9DnNJl6.js.map +1 -1
  109. package/dist/RoutersTab-Cp8wM-mS.cjs.map +1 -1
  110. package/dist/RoutersTab-DiYEI1Nq.js.map +1 -1
  111. package/dist/ScriptChooser-BnTP6ucF.cjs.map +1 -1
  112. package/dist/ScriptChooser-Cua8ObYv.js.map +1 -1
  113. package/dist/ScrollwindowWidget-54GU96Ve.js.map +1 -1
  114. package/dist/ScrollwindowWidget-C5_X-KwQ.cjs.map +1 -1
  115. package/dist/SecretsTab-DY16usGc.cjs.map +1 -1
  116. package/dist/SecretsTab-uWRVI1EE.js.map +1 -1
  117. package/dist/SettingsTab-BVnr4OtU.js.map +1 -1
  118. package/dist/SettingsTab-BkwaDhYo.cjs.map +1 -1
  119. package/dist/SignalWidget-B_kA9eCJ.js.map +1 -1
  120. package/dist/SignalWidget-COL8kXSJ.cjs.map +1 -1
  121. package/dist/SimpleTextDialog-BWUqPlTv.cjs.map +1 -1
  122. package/dist/SimpleTextDialog-BulqUrdH.js.map +1 -1
  123. package/dist/SpacerWidget-D_Ya_b1j.cjs.map +1 -1
  124. package/dist/SpacerWidget-XoMPHak8.js.map +1 -1
  125. package/dist/SparklineWidget-CRzXTS5z.cjs.map +1 -1
  126. package/dist/SparklineWidget-DQNsvEj9.js.map +1 -1
  127. package/dist/TabbookWidget-Bh-GDBXg.cjs.map +1 -1
  128. package/dist/TabbookWidget-_HVA72t5.js.map +1 -1
  129. package/dist/TargetsTab-BfoRYnTP.js.map +1 -1
  130. package/dist/TargetsTab-CGE-jQAz.cjs.map +1 -1
  131. package/dist/TextBoxDialog-C60jmnyN.js.map +1 -1
  132. package/dist/TextBoxDialog-DWt30tB8.cjs.map +1 -1
  133. package/dist/TextboxWidget-0JXn4bMH.js.map +1 -1
  134. package/dist/TextboxWidget-uDptDK_z.cjs.map +1 -1
  135. package/dist/TextfieldWidget-B0FCskrL.cjs.map +1 -1
  136. package/dist/TextfieldWidget-BXr9MkVW.js.map +1 -1
  137. package/dist/TimeWidget-C67uwMGH.js.map +1 -1
  138. package/dist/TimeWidget-q5tUvHC6.cjs.map +1 -1
  139. package/dist/TitleWidget-REsd7MqR.cjs.map +1 -1
  140. package/dist/TitleWidget-t_YLgUMB.js.map +1 -1
  141. package/dist/ToolsTab-CGztf9_j.cjs.map +1 -1
  142. package/dist/ToolsTab-DKYeIlXu.js.map +1 -1
  143. package/dist/TopBar-B0UcAtIW.cjs.map +1 -1
  144. package/dist/TopBar-BrCfgCxc.js.map +1 -1
  145. package/dist/UpgradeToEnterpriseDialog-CGyR2v7U.js.map +1 -1
  146. package/dist/UpgradeToEnterpriseDialog-DJ3oth3I.cjs.map +1 -1
  147. package/dist/UpgradeToEnterpriseDialog.vue_vue_type_style_index_0_scoped_2c757408_lang-C_HFbtFB.cjs.map +1 -1
  148. package/dist/UpgradeToEnterpriseDialog.vue_vue_type_style_index_0_scoped_2c757408_lang-NIAkCgU6.js.map +1 -1
  149. package/dist/VWidget-BMxLXtSO.cjs.map +1 -1
  150. package/dist/VWidget-j2GIGGSX.js.map +1 -1
  151. package/dist/ValueWidget-3jNtnh5i.js.map +1 -1
  152. package/dist/ValueWidget-CjZeSiPQ.cjs.map +1 -1
  153. package/dist/ValuerangebarWidget-CpZYmUl_.cjs.map +1 -1
  154. package/dist/ValuerangebarWidget-DnZrho8S.js.map +1 -1
  155. package/dist/VerticalWidget-CcJMMaK_.cjs.map +1 -1
  156. package/dist/VerticalWidget-DJvoxqLE.js.map +1 -1
  157. package/dist/VerticalboxWidget-CJR_mOLa.cjs.map +1 -1
  158. package/dist/VerticalboxWidget-CYYyLBoO.js.map +1 -1
  159. package/dist/Widget-Bn_S-zBo.js.map +1 -1
  160. package/dist/Widget-O7wkmc39.cjs.map +1 -1
  161. package/dist/components.cjs.map +1 -1
  162. package/dist/components.js.map +1 -1
  163. package/dist/fileIcon-BduOQcTc.cjs.map +1 -1
  164. package/dist/fileIcon-DqRHb1_Z.js.map +1 -1
  165. package/dist/format-B22VpiOS.cjs.map +1 -1
  166. package/dist/format-CVeawcIv.js.map +1 -1
  167. package/dist/icons.cjs.map +1 -1
  168. package/dist/icons.js.map +1 -1
  169. package/dist/index-DcL65Mqb.cjs.map +1 -1
  170. package/dist/index-qCq0L4jN.js.map +1 -1
  171. package/dist/parse-DnkEsW-3.js.map +1 -1
  172. package/dist/parse-DwfgQboe.cjs.map +1 -1
  173. package/dist/plugins.cjs.map +1 -1
  174. package/dist/plugins.js.map +1 -1
  175. package/dist/timeFilters-BKnCM4rv.js.map +1 -1
  176. package/dist/timeFilters-CJFxfjqN.cjs.map +1 -1
  177. package/dist/tools/admin.cjs.map +1 -1
  178. package/dist/tools/admin.js.map +1 -1
  179. package/dist/tools/base.cjs.map +1 -1
  180. package/dist/tools/base.js.map +1 -1
  181. package/dist/tools/scriptrunner.cjs.map +1 -1
  182. package/dist/tools/scriptrunner.js.map +1 -1
  183. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"ArrayWidget-Bb_Ldxq7.cjs","sources":["../src/widgets/ArrayWidget.vue"],"sourcesContent":["<!--\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# Modified by OpenC3, Inc.\n# All changes Copyright 2024, OpenC3, Inc.\n# All Rights Reserved\n#\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n-->\n\n<template>\n <div class=\"array-widget-container\">\n <v-textarea\n variant=\"solo\"\n density=\"compact\"\n readonly\n no-resize\n auto-grow\n rows=\"2\"\n hide-details\n :model-value=\"_value\"\n :class=\"valueClass\"\n :style=\"[computedStyle, aging]\"\n data-test=\"array-widget\"\n @contextmenu=\"showContextMenu\"\n />\n <v-menu v-model=\"contextMenuShown\" :target=\"[x, y]\">\n <v-list>\n <v-list-item\n v-for=\"(item, index) in contextMenuOptions\"\n :key=\"index\"\n @click.stop=\"item.action\"\n >\n <v-list-item-title>{{ item.title }}</v-list-item-title>\n </v-list-item>\n </v-list>\n </v-menu>\n\n <details-dialog\n :target-name=\"parameters[0]\"\n :packet-name=\"parameters[1]\"\n :item-name=\"parameters[2]\"\n v-model=\"viewDetails\"\n />\n </div>\n</template>\n\n<script>\nimport { DetailsDialog } from '@/components'\nimport VWidget from './VWidget'\nimport 'sprintf-js'\n\nexport default {\n components: {\n DetailsDialog,\n },\n data: function () {\n return {\n width: 200,\n height: 100,\n itemsPerRow: 4,\n formatter: null,\n }\n },\n mixins: [VWidget],\n computed: {\n aging() {\n return {\n '--aging': this.grayLevel,\n }\n },\n },\n created: function () {\n this.width = this.setWidth(this.parameters[3], 'px', this.width)\n this.height = this.setHeight(this.parameters[4], 'px', this.height)\n if (this.parameters[5]) {\n this.formatter = this.parameters[5]\n }\n if (this.parameters[6]) {\n this.itemsPerRow = parseInt(this.parameters[6])\n }\n },\n methods: {\n getType: function () {\n let type = 'CONVERTED'\n if (this.parameters[7]) {\n type = this.parameters[7]\n }\n return type\n },\n formatValue: function (data) {\n let text = ''\n let space = ' '\n let newLine = '\\n'\n let count = 0\n\n if (Array.isArray(data)) {\n for (const value of data) {\n if (this.formatter && this.formatter?.toLowerCase() !== 'nil') {\n text += sprintf(this.formatter, value)\n } else {\n text += value\n }\n count += 1\n if (count % this.itemsPerRow === 0) {\n count = 0\n text += newLine\n } else {\n text += space\n }\n }\n return text.trim()\n } else {\n return data\n }\n },\n },\n}\n</script>\n\n<style scoped>\n.array-widget-container :deep(.v-input__slot) {\n background: rgba(var(--aging), var(--aging), var(--aging), 1) !important;\n}\n.value :deep(div) {\n min-height: 24px !important;\n display: flex !important;\n align-items: center !important;\n}\n.array-widget-container :deep(.v-field__loader) {\n display: none !important;\n}\n.openc3-green :deep(input) {\n color: rgb(0, 200, 0);\n}\n.openc3-yellow :deep(input) {\n color: rgb(255, 220, 0);\n}\n.openc3-red :deep(input) {\n color: rgb(255, 45, 45);\n}\n.openc3-blue :deep(input) {\n color: rgb(0, 153, 255);\n}\n.openc3-purple :deep(input) {\n color: rgb(200, 0, 200);\n}\n.openc3-black :deep(input) {\n color: black;\n}\n.openc3-white :deep(input) {\n color: white;\n}\n</style>\n"],"names":["_sfc_main","DetailsDialog","VWidget","type","data","text","space","newLine","count","value","_a","_hoisted_1","_openBlock","_createElementBlock","_createVNode","_component_v_textarea","_ctx","_normalizeClass","_normalizeStyle","$options","_component_v_menu","_cache","$event","_withCtx","_component_v_list","_Fragment","_renderList","item","index","_createBlock","_component_v_list_item","_withModifiers","_component_v_list_item_title","_createTextVNode","_toDisplayString","_component_details_dialog"],"mappings":"4VAgEKA,EAAU,CACb,WAAY,eACVC,EAAAA,eAEF,KAAM,UAAY,CAChB,MAAO,CACL,MAAO,IACP,OAAQ,IACR,YAAa,EACb,UAAW,IACb,GAEF,OAAQ,CAACC,EAAAA,OAAO,EAChB,SAAU,CACR,OAAQ,CACN,MAAO,CACL,UAAW,KAAK,SAClB,IAGJ,QAAS,UAAY,CACnB,KAAK,MAAQ,KAAK,SAAS,KAAK,WAAW,CAAC,EAAG,KAAM,KAAK,KAAK,EAC/D,KAAK,OAAS,KAAK,UAAU,KAAK,WAAW,CAAC,EAAG,KAAM,KAAK,MAAM,EAC9D,KAAK,WAAW,CAAC,IACnB,KAAK,UAAY,KAAK,WAAW,CAAC,GAEhC,KAAK,WAAW,CAAC,IACnB,KAAK,YAAc,SAAS,KAAK,WAAW,CAAC,CAAC,IAGlD,QAAS,CACP,QAAS,UAAY,CACnB,IAAIC,EAAO,YACX,OAAI,KAAK,WAAW,CAAC,IACnBA,EAAO,KAAK,WAAW,CAAC,GAEnBA,GAET,YAAa,SAAUC,EAAM,OAC3B,IAAIC,EAAO,GACPC,EAAQ,IACRC,EAAU;AAAA,EACVC,EAAQ,EAEZ,GAAI,MAAM,QAAQJ,CAAI,EAAG,CACvB,UAAWK,KAASL,EACd,KAAK,aAAaM,EAAA,KAAK,YAAL,YAAAA,EAAgB,iBAAkB,MACtDL,GAAQ,QAAQ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A,EAAA,MAAA,EAAA,8BAkDIb,EAAAA,YAKEqB,EAAA,CAJC,cAAanB,EAAA,WAAU,CAAA,EACvB,cAAaA,EAAA,WAAU,CAAA,EACvB,YAAWA,EAAA,WAAU,CAAA,EArD5B,WAsDeA,EAAA,YAtDf,sBAAAK,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAsDeN,EAAA,YAAWM"}
1
+ {"version":3,"file":"ArrayWidget-Bb_Ldxq7.cjs","sources":["../src/widgets/ArrayWidget.vue"],"sourcesContent":["<!--\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# Modified by OpenC3, Inc.\n# All changes Copyright 2024, OpenC3, Inc.\n# All Rights Reserved\n#\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n-->\n\n<template>\n <div class=\"array-widget-container\">\n <v-textarea\n variant=\"solo\"\n density=\"compact\"\n readonly\n no-resize\n auto-grow\n rows=\"2\"\n hide-details\n :model-value=\"_value\"\n :class=\"valueClass\"\n :style=\"[computedStyle, aging]\"\n data-test=\"array-widget\"\n @contextmenu=\"showContextMenu\"\n />\n <v-menu v-model=\"contextMenuShown\" :target=\"[x, y]\">\n <v-list>\n <v-list-item\n v-for=\"(item, index) in contextMenuOptions\"\n :key=\"index\"\n @click.stop=\"item.action\"\n >\n <v-list-item-title>{{ item.title }}</v-list-item-title>\n </v-list-item>\n </v-list>\n </v-menu>\n\n <details-dialog\n :target-name=\"parameters[0]\"\n :packet-name=\"parameters[1]\"\n :item-name=\"parameters[2]\"\n v-model=\"viewDetails\"\n />\n </div>\n</template>\n\n<script>\nimport { DetailsDialog } from '@/components'\nimport VWidget from './VWidget'\nimport 'sprintf-js'\n\nexport default {\n components: {\n DetailsDialog,\n },\n data: function () {\n return {\n width: 200,\n height: 100,\n itemsPerRow: 4,\n formatter: null,\n }\n },\n mixins: [VWidget],\n computed: {\n aging() {\n return {\n '--aging': this.grayLevel,\n }\n },\n },\n created: function () {\n this.width = this.setWidth(this.parameters[3], 'px', this.width)\n this.height = this.setHeight(this.parameters[4], 'px', this.height)\n if (this.parameters[5]) {\n this.formatter = this.parameters[5]\n }\n if (this.parameters[6]) {\n this.itemsPerRow = parseInt(this.parameters[6])\n }\n },\n methods: {\n getType: function () {\n let type = 'CONVERTED'\n if (this.parameters[7]) {\n type = this.parameters[7]\n }\n return type\n },\n formatValue: function (data) {\n let text = ''\n let space = ' '\n let newLine = '\\n'\n let count = 0\n\n if (Array.isArray(data)) {\n for (const value of data) {\n if (this.formatter && this.formatter?.toLowerCase() !== 'nil') {\n text += sprintf(this.formatter, value)\n } else {\n text += value\n }\n count += 1\n if (count % this.itemsPerRow === 0) {\n count = 0\n text += newLine\n } else {\n text += space\n }\n }\n return text.trim()\n } else {\n return data\n }\n },\n },\n}\n</script>\n\n<style scoped>\n.array-widget-container :deep(.v-input__slot) {\n background: rgba(var(--aging), var(--aging), var(--aging), 1) !important;\n}\n.value :deep(div) {\n min-height: 24px !important;\n display: flex !important;\n align-items: center !important;\n}\n.array-widget-container :deep(.v-field__loader) {\n display: none !important;\n}\n.openc3-green :deep(input) {\n color: rgb(0, 200, 0);\n}\n.openc3-yellow :deep(input) {\n color: rgb(255, 220, 0);\n}\n.openc3-red :deep(input) {\n color: rgb(255, 45, 45);\n}\n.openc3-blue :deep(input) {\n color: rgb(0, 153, 255);\n}\n.openc3-purple :deep(input) {\n color: rgb(200, 0, 200);\n}\n.openc3-black :deep(input) {\n color: black;\n}\n.openc3-white :deep(input) {\n color: white;\n}\n</style>\n"],"names":["_sfc_main","DetailsDialog","VWidget","type","data","text","space","newLine","count","value","_a","_hoisted_1","_openBlock","_createElementBlock","_createVNode","_component_v_textarea","_ctx","_normalizeClass","_normalizeStyle","$options","_component_v_menu","_cache","$event","_withCtx","_component_v_list","_Fragment","_renderList","item","index","_createBlock","_component_v_list_item","_withModifiers","_component_v_list_item_title","_createTextVNode","_toDisplayString","_component_details_dialog"],"mappings":"4VAgEKA,EAAU,CACb,WAAY,eACVC,EAAAA,eAEF,KAAM,UAAY,CAChB,MAAO,CACL,MAAO,IACP,OAAQ,IACR,YAAa,EACb,UAAW,IACb,CACF,EACA,OAAQ,CAACC,EAAAA,OAAO,EAChB,SAAU,CACR,OAAQ,CACN,MAAO,CACL,UAAW,KAAK,SAClB,CACF,GAEF,QAAS,UAAY,CACnB,KAAK,MAAQ,KAAK,SAAS,KAAK,WAAW,CAAC,EAAG,KAAM,KAAK,KAAK,EAC/D,KAAK,OAAS,KAAK,UAAU,KAAK,WAAW,CAAC,EAAG,KAAM,KAAK,MAAM,EAC9D,KAAK,WAAW,CAAC,IACnB,KAAK,UAAY,KAAK,WAAW,CAAC,GAEhC,KAAK,WAAW,CAAC,IACnB,KAAK,YAAc,SAAS,KAAK,WAAW,CAAC,CAAC,EAElD,EACA,QAAS,CACP,QAAS,UAAY,CACnB,IAAIC,EAAO,YACX,OAAI,KAAK,WAAW,CAAC,IACnBA,EAAO,KAAK,WAAW,CAAC,GAEnBA,CACT,EACA,YAAa,SAAUC,EAAM,OAC3B,IAAIC,EAAO,GACPC,EAAQ,IACRC,EAAU;AAAA,EACVC,EAAQ,EAEZ,GAAI,MAAM,QAAQJ,CAAI,EAAG,CACvB,UAAWK,KAASL,EACd,KAAK,aAAaM,EAAA,KAAK,YAAL,YAAAA,EAAgB,iBAAkB,MACtDL,GAAQ,QAAQ,KAAK,UAAWI,CAAK,EAErCJ,GAAQI,EAEVD,GAAS,EACLA,EAAQ,KAAK,cAAgB,GAC/BA,EAAQ,EACRH,GAAQE,GAERF,GAAQC,EAGZ,OAAOD,EAAK,KAAI,CAClB,KAC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A,EArD5B,WAsDeA,EAAA,YAtDf,sBAAAK,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAsDeN,EAAA,YAAWM"}
@@ -1 +1 @@
1
- {"version":3,"file":"ArrayWidget-Ck6pzAyW.js","sources":["../src/widgets/ArrayWidget.vue"],"sourcesContent":["<!--\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# Modified by OpenC3, Inc.\n# All changes Copyright 2024, OpenC3, Inc.\n# All Rights Reserved\n#\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n-->\n\n<template>\n <div class=\"array-widget-container\">\n <v-textarea\n variant=\"solo\"\n density=\"compact\"\n readonly\n no-resize\n auto-grow\n rows=\"2\"\n hide-details\n :model-value=\"_value\"\n :class=\"valueClass\"\n :style=\"[computedStyle, aging]\"\n data-test=\"array-widget\"\n @contextmenu=\"showContextMenu\"\n />\n <v-menu v-model=\"contextMenuShown\" :target=\"[x, y]\">\n <v-list>\n <v-list-item\n v-for=\"(item, index) in contextMenuOptions\"\n :key=\"index\"\n @click.stop=\"item.action\"\n >\n <v-list-item-title>{{ item.title }}</v-list-item-title>\n </v-list-item>\n </v-list>\n </v-menu>\n\n <details-dialog\n :target-name=\"parameters[0]\"\n :packet-name=\"parameters[1]\"\n :item-name=\"parameters[2]\"\n v-model=\"viewDetails\"\n />\n </div>\n</template>\n\n<script>\nimport { DetailsDialog } from '@/components'\nimport VWidget from './VWidget'\nimport 'sprintf-js'\n\nexport default {\n components: {\n DetailsDialog,\n },\n data: function () {\n return {\n width: 200,\n height: 100,\n itemsPerRow: 4,\n formatter: null,\n }\n },\n mixins: [VWidget],\n computed: {\n aging() {\n return {\n '--aging': this.grayLevel,\n }\n },\n },\n created: function () {\n this.width = this.setWidth(this.parameters[3], 'px', this.width)\n this.height = this.setHeight(this.parameters[4], 'px', this.height)\n if (this.parameters[5]) {\n this.formatter = this.parameters[5]\n }\n if (this.parameters[6]) {\n this.itemsPerRow = parseInt(this.parameters[6])\n }\n },\n methods: {\n getType: function () {\n let type = 'CONVERTED'\n if (this.parameters[7]) {\n type = this.parameters[7]\n }\n return type\n },\n formatValue: function (data) {\n let text = ''\n let space = ' '\n let newLine = '\\n'\n let count = 0\n\n if (Array.isArray(data)) {\n for (const value of data) {\n if (this.formatter && this.formatter?.toLowerCase() !== 'nil') {\n text += sprintf(this.formatter, value)\n } else {\n text += value\n }\n count += 1\n if (count % this.itemsPerRow === 0) {\n count = 0\n text += newLine\n } else {\n text += space\n }\n }\n return text.trim()\n } else {\n return data\n }\n },\n },\n}\n</script>\n\n<style scoped>\n.array-widget-container :deep(.v-input__slot) {\n background: rgba(var(--aging), var(--aging), var(--aging), 1) !important;\n}\n.value :deep(div) {\n min-height: 24px !important;\n display: flex !important;\n align-items: center !important;\n}\n.array-widget-container :deep(.v-field__loader) {\n display: none !important;\n}\n.openc3-green :deep(input) {\n color: rgb(0, 200, 0);\n}\n.openc3-yellow :deep(input) {\n color: rgb(255, 220, 0);\n}\n.openc3-red :deep(input) {\n color: rgb(255, 45, 45);\n}\n.openc3-blue :deep(input) {\n color: rgb(0, 153, 255);\n}\n.openc3-purple :deep(input) {\n color: rgb(200, 0, 200);\n}\n.openc3-black :deep(input) {\n color: black;\n}\n.openc3-white :deep(input) {\n color: white;\n}\n</style>\n"],"names":["_sfc_main","DetailsDialog","VWidget","type","data","text","space","newLine","count","value","_a","_hoisted_1","_openBlock","_createElementBlock","_createVNode","_component_v_textarea","_ctx","_normalizeClass","_normalizeStyle","$options","_component_v_menu","_cache","$event","_withCtx","_component_v_list","_Fragment","_renderList","item","index","_createBlock","_component_v_list_item","_withModifiers","_component_v_list_item_title","_createTextVNode","_toDisplayString","_component_details_dialog"],"mappings":";;;;;;AAgEA,MAAKA,IAAU;AAAA,EACb,YAAY;AAAA,IACV,eAAAC;AAAA;EAEF,MAAM,WAAY;AAChB,WAAO;AAAA,MACL,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,WAAW;AAAA,IACb;AAAA;EAEF,QAAQ,CAACC,CAAO;AAAA,EAChB,UAAU;AAAA,IACR,QAAQ;AACN,aAAO;AAAA,QACL,WAAW,KAAK;AAAA,MAClB;AAAA;;EAGJ,SAAS,WAAY;AACnB,SAAK,QAAQ,KAAK,SAAS,KAAK,WAAW,CAAC,GAAG,MAAM,KAAK,KAAK,GAC/D,KAAK,SAAS,KAAK,UAAU,KAAK,WAAW,CAAC,GAAG,MAAM,KAAK,MAAM,GAC9D,KAAK,WAAW,CAAC,MACnB,KAAK,YAAY,KAAK,WAAW,CAAC,IAEhC,KAAK,WAAW,CAAC,MACnB,KAAK,cAAc,SAAS,KAAK,WAAW,CAAC,CAAC;AAAA;EAGlD,SAAS;AAAA,IACP,SAAS,WAAY;AACnB,UAAIC,IAAO;AACX,aAAI,KAAK,WAAW,CAAC,MACnBA,IAAO,KAAK,WAAW,CAAC,IAEnBA;AAAA;IAET,aAAa,SAAUC,GAAM;;AAC3B,UAAIC,IAAO,IACPC,IAAQ,KACRC,IAAU;AAAA,GACVC,IAAQ;AAEZ,UAAI,MAAM,QAAQJ,CAAI,GAAG;AACvB,mBAAWK,KAASL;AAClB,UAAI,KAAK,eAAaM,IAAA,KAAK,cAAL,gBAAAA,EAAgB,mBAAkB,QACtDL,KAAQ,QAAQ,KAAK,WAAWI,CAAK,IAErCJ,KAAQI,GAEVD,KAAS,GACLA,IAAQ,KAAK,gBAAgB,KAC/BA,IAAQ,GACRH,KAAQE,KAERF,KAAQC;AAGZ,eAAOD,EAAK,KAAI;AAAA;AAEhB,eAAOD;AAAA;;AAIf,GA1GO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aA,EAAA,WAAU,CAAA;AAAA,MACvB,aAAWA,EAAA,WAAU,CAAA;AAAA,MArD5B,YAsDeA,EAAA;AAAA,MAtDf,uBAAAK,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAsDeN,EAAA,cAAWM;AAAA;;;;"}
1
+ {"version":3,"file":"ArrayWidget-Ck6pzAyW.js","sources":["../src/widgets/ArrayWidget.vue"],"sourcesContent":["<!--\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# Modified by OpenC3, Inc.\n# All changes Copyright 2024, OpenC3, Inc.\n# All Rights Reserved\n#\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n-->\n\n<template>\n <div class=\"array-widget-container\">\n <v-textarea\n variant=\"solo\"\n density=\"compact\"\n readonly\n no-resize\n auto-grow\n rows=\"2\"\n hide-details\n :model-value=\"_value\"\n :class=\"valueClass\"\n :style=\"[computedStyle, aging]\"\n data-test=\"array-widget\"\n @contextmenu=\"showContextMenu\"\n />\n <v-menu v-model=\"contextMenuShown\" :target=\"[x, y]\">\n <v-list>\n <v-list-item\n v-for=\"(item, index) in contextMenuOptions\"\n :key=\"index\"\n @click.stop=\"item.action\"\n >\n <v-list-item-title>{{ item.title }}</v-list-item-title>\n </v-list-item>\n </v-list>\n </v-menu>\n\n <details-dialog\n :target-name=\"parameters[0]\"\n :packet-name=\"parameters[1]\"\n :item-name=\"parameters[2]\"\n v-model=\"viewDetails\"\n />\n </div>\n</template>\n\n<script>\nimport { DetailsDialog } from '@/components'\nimport VWidget from './VWidget'\nimport 'sprintf-js'\n\nexport default {\n components: {\n DetailsDialog,\n },\n data: function () {\n return {\n width: 200,\n height: 100,\n itemsPerRow: 4,\n formatter: null,\n }\n },\n mixins: [VWidget],\n computed: {\n aging() {\n return {\n '--aging': this.grayLevel,\n }\n },\n },\n created: function () {\n this.width = this.setWidth(this.parameters[3], 'px', this.width)\n this.height = this.setHeight(this.parameters[4], 'px', this.height)\n if (this.parameters[5]) {\n this.formatter = this.parameters[5]\n }\n if (this.parameters[6]) {\n this.itemsPerRow = parseInt(this.parameters[6])\n }\n },\n methods: {\n getType: function () {\n let type = 'CONVERTED'\n if (this.parameters[7]) {\n type = this.parameters[7]\n }\n return type\n },\n formatValue: function (data) {\n let text = ''\n let space = ' '\n let newLine = '\\n'\n let count = 0\n\n if (Array.isArray(data)) {\n for (const value of data) {\n if (this.formatter && this.formatter?.toLowerCase() !== 'nil') {\n text += sprintf(this.formatter, value)\n } else {\n text += value\n }\n count += 1\n if (count % this.itemsPerRow === 0) {\n count = 0\n text += newLine\n } else {\n text += space\n }\n }\n return text.trim()\n } else {\n return data\n }\n },\n },\n}\n</script>\n\n<style scoped>\n.array-widget-container :deep(.v-input__slot) {\n background: rgba(var(--aging), var(--aging), var(--aging), 1) !important;\n}\n.value :deep(div) {\n min-height: 24px !important;\n display: flex !important;\n align-items: center !important;\n}\n.array-widget-container :deep(.v-field__loader) {\n display: none !important;\n}\n.openc3-green :deep(input) {\n color: rgb(0, 200, 0);\n}\n.openc3-yellow :deep(input) {\n color: rgb(255, 220, 0);\n}\n.openc3-red :deep(input) {\n color: rgb(255, 45, 45);\n}\n.openc3-blue :deep(input) {\n color: rgb(0, 153, 255);\n}\n.openc3-purple :deep(input) {\n color: rgb(200, 0, 200);\n}\n.openc3-black :deep(input) {\n color: black;\n}\n.openc3-white :deep(input) {\n color: white;\n}\n</style>\n"],"names":["_sfc_main","DetailsDialog","VWidget","type","data","text","space","newLine","count","value","_a","_hoisted_1","_openBlock","_createElementBlock","_createVNode","_component_v_textarea","_ctx","_normalizeClass","_normalizeStyle","$options","_component_v_menu","_cache","$event","_withCtx","_component_v_list","_Fragment","_renderList","item","index","_createBlock","_component_v_list_item","_withModifiers","_component_v_list_item_title","_createTextVNode","_toDisplayString","_component_details_dialog"],"mappings":";;;;;;AAgEA,MAAKA,IAAU;AAAA,EACb,YAAY;AAAA,IACV,eAAAC;AAAA;EAEF,MAAM,WAAY;AAChB,WAAO;AAAA,MACL,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EACA,QAAQ,CAACC,CAAO;AAAA,EAChB,UAAU;AAAA,IACR,QAAQ;AACN,aAAO;AAAA,QACL,WAAW,KAAK;AAAA,MAClB;AAAA,IACF;AAAA;EAEF,SAAS,WAAY;AACnB,SAAK,QAAQ,KAAK,SAAS,KAAK,WAAW,CAAC,GAAG,MAAM,KAAK,KAAK,GAC/D,KAAK,SAAS,KAAK,UAAU,KAAK,WAAW,CAAC,GAAG,MAAM,KAAK,MAAM,GAC9D,KAAK,WAAW,CAAC,MACnB,KAAK,YAAY,KAAK,WAAW,CAAC,IAEhC,KAAK,WAAW,CAAC,MACnB,KAAK,cAAc,SAAS,KAAK,WAAW,CAAC,CAAC;AAAA,EAElD;AAAA,EACA,SAAS;AAAA,IACP,SAAS,WAAY;AACnB,UAAIC,IAAO;AACX,aAAI,KAAK,WAAW,CAAC,MACnBA,IAAO,KAAK,WAAW,CAAC,IAEnBA;AAAA,IACT;AAAA,IACA,aAAa,SAAUC,GAAM;;AAC3B,UAAIC,IAAO,IACPC,IAAQ,KACRC,IAAU;AAAA,GACVC,IAAQ;AAEZ,UAAI,MAAM,QAAQJ,CAAI,GAAG;AACvB,mBAAWK,KAASL;AAClB,UAAI,KAAK,eAAaM,IAAA,KAAK,cAAL,gBAAAA,EAAgB,mBAAkB,QACtDL,KAAQ,QAAQ,KAAK,WAAWI,CAAK,IAErCJ,KAAQI,GAEVD,KAAS,GACLA,IAAQ,KAAK,gBAAg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GAAA;AAAA;;UAAA,GAAA;AAAA;;MAAA,GAAA;AAAA;IAkDIb,EAKEqB,GAAA;AAAA,MAJC,eAAanB,EAAA,WAAU,CAAA;AAAA,MACvB,eAAaA,EAAA,WAAU,CAAA;AAAA,MACvB,aAAWA,EAAA,WAAU,CAAA;AAAA,MArD5B,YAsDeA,EAAA;AAAA,MAtDf,uBAAAK,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAsDeN,EAAA,cAAWM;AAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ArrayplotWidget-DC41cpv1.cjs","sources":["../src/widgets/ArrayplotWidget.vue"],"sourcesContent":["<!--\n# Copyright 2025 OpenC3, Inc.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n#\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n-->\n\n<template>\n <div class=\"pa-1\" :id=\"`chart${id}`\"></div>\n</template>\n\n<script>\nimport uPlot from 'uplot'\nimport 'uplot/dist/uPlot.min.css'\nimport { Cable } from '@openc3/js-common/services'\nimport GraphWidget from './GraphWidget'\n\nexport default {\n data: function () {\n return {\n items: [],\n indexes: {},\n data: [[]],\n cable: new Cable(),\n subscription: null,\n graph: null,\n xAxis: null,\n title: 'Array Plot',\n colorIndex: 0,\n colors: [\n // The first 3 are taken from the Astro css definitions for\n // --color-data-visualization-1 through 3\n '#00c7cb',\n '#938bdb',\n '#4dacff',\n 'lime',\n 'darkorange',\n 'red',\n 'gold',\n 'hotpink',\n 'tan',\n 'cyan',\n 'maroon',\n 'blue',\n 'teal',\n 'purple',\n 'green',\n 'brown',\n 'lightblue',\n 'white',\n 'black',\n ],\n }\n },\n mixins: [GraphWidget],\n created() {\n for (const [index, item] of this.items.entries()) {\n this.data.push([]) // initialize the empty data arrays\n this.indexes[this.subscriptionKey(item)] = index + 1\n item.color = this.colors[this.colorIndex]\n this.colorIndex++\n }\n\n this.appliedSettings.forEach((setting) => {\n switch (setting[0]) {\n case 'TITLE':\n this.title = setting[1]\n break\n case 'X_AXIS':\n this.xAxis = {\n start: parseFloat(setting[1]),\n step: parseFloat(setting[2]),\n }\n break\n }\n })\n },\n mounted() {\n let chartSeries = []\n this.items.forEach((item) => {\n chartSeries.push({\n label: this.itemName(item),\n stroke: item.color,\n width: 2,\n value: (self, rawValue) => {\n if (typeof rawValue === 'string' || isNaN(rawValue)) {\n return 'NaN'\n } else {\n return rawValue == null ? '--' : rawValue.toFixed(3)\n }\n },\n })\n })\n\n let chartOpts = {\n title: this.title,\n width: this.size.width,\n height: this.size.height,\n scales: {\n x: {\n time: false,\n },\n y: {\n time: false,\n range: (u, min, max) => [min, max],\n },\n },\n axes: [\n {\n stroke: 'white',\n grid: {\n show: true,\n stroke: 'rgba(255, 255, 255, .1)',\n width: 2,\n },\n },\n {\n stroke: 'white',\n grid: {\n show: true,\n stroke: 'rgba(255, 255, 255, .1)',\n width: 2,\n },\n },\n ],\n series: [\n {\n label: 'X Value',\n },\n ...chartSeries,\n ],\n }\n this.graph = new uPlot(\n chartOpts,\n this.data,\n document.getElementById(`chart${this.id}`),\n )\n this.subscribe()\n },\n beforeUnmount: function () {\n this.cable.disconnect()\n },\n computed: {\n dataOnly() {\n return this.data[1] // Ignore the x axis data\n },\n },\n watch: {\n // This is always firing even when the data is the same\n // Is it because we're setting the whole array data[1]?\n dataOnly: function () {\n if (this.graph) {\n this.graph.setData(this.data)\n }\n },\n },\n methods: {\n subscribe: function () {\n this.cable\n .createSubscription('StreamingChannel', window.openc3Scope, {\n received: (data) => this.received(data),\n connected: () => {\n this.addItemsToSubscription(this.items)\n },\n disconnected: (data) => {\n // If allowReconnect is true it means we got a disconnect due to connection lost or server disconnect\n // If allowReconnect is false this is a normal server close or client close\n if (data.allowReconnect) {\n this.errors.push({\n type: 'disconnected',\n message: 'OpenC3 backend connection disconnected',\n time: new Date().getTime(),\n })\n }\n },\n rejected: () => {\n this.errors.push({\n type: 'rejected',\n message: 'OpenC3 backend connection rejected',\n time: new Date().getTime(),\n })\n },\n })\n .then((subscription) => {\n this.subscription = subscription\n })\n },\n received: function (data_array) {\n for (let data of data_array) {\n let xaxis = [] // Declare outside the loop so we can use it for the X axis values\n for (const [key, value] of Object.entries(data)) {\n // We support 2 different kind of data, a simple array of Y values\n // or an array with both X and Y values, e.g. [[x1,x2,x3...], [y1,y2,y3...]]\n if (key === '__time') {\n // Explicitly setting the X axis values always wins\n if (this.xAxis) {\n xaxis = Array.from(\n { length: this.data[1].length },\n (_, i) => this.xAxis.start + i * this.xAxis.step,\n )\n } else if (xaxis.length === 0) {\n // If we don't have an array of X values we generate them\n xaxis = Array.from({ length: this.data[1].length }, (_, i) => i)\n }\n this.data[0] = xaxis\n }\n let key_index = this.indexes[key]\n if (key_index) {\n // Check for the array of arrays case\n if (Array.isArray(value[0])) {\n this.data[key_index] = value[1]\n xaxis = value[0]\n } else {\n this.data[key_index] = value\n }\n }\n }\n }\n },\n addItemsToSubscription: function (itemArray = this.items) {\n if (this.subscription) {\n OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity).then(\n (refreshed) => {\n if (refreshed) {\n OpenC3Auth.setTokens()\n }\n this.subscription.perform('add', {\n scope: window.openc3Scope,\n token: localStorage.openc3Token,\n items: itemArray.map(this.subscriptionKey),\n start_time: null,\n end_time: null,\n })\n },\n )\n }\n },\n itemName: function (item) {\n return `${item.targetName} ${item.packetName} ${item.itemName}`\n },\n subscriptionKey: function (item) {\n let key = `${item.reduced}__TLM__${item.targetName}__${item.packetName}__${item.itemName}__${item.valueType}`\n if (\n item.reduced === 'REDUCED_MINUTE' ||\n item.reduced === 'REDUCED_HOUR' ||\n item.reduced === 'REDUCED_DAY'\n ) {\n key += `__${item.reducedType}`\n }\n return key\n },\n },\n}\n</script>\n"],"names":["_sfc_main","Cable","GraphWidget","index","item","setting","chartSeries","self","rawValue","chartOpts","u","min","max","uPlot","data","subscription","data_array","xaxis","key","value","_","i","key_index","itemArray","refreshed","_hoisted_1","_createElementBlock","_ctx"],"mappings":"4RA4BKA,EAAU,CACb,KAAM,UAAY,CAChB,MAAO,CACL,MAAO,CAAA,EACP,QAAS,CAAA,EACT,KAAM,CAAC,CAAA,CAAE,EACT,MAAO,IAAIC,EAAAA,GACX,aAAc,KACd,MAAO,KACP,MAAO,KACP,MAAO,aACP,WAAY,EACZ,OAAQ,CAGN,UACA,UACA,UACA,OACA,aACA,MACA,OACA,UACA,MACA,OACA,SACA,OACA,OACA,SACA,QACA,QACA,YACA,QACA,QAEJ,GAEF,OAAQ,CAACC,EAAAA,WAAW,EACpB,SAAU,CACR,SAAW,CAACC,EAAOC,CAAI,IAAK,KAAK,MAAM,UACrC,KAAK,KAAK,KAAK,EAAE,EACjB,KAAK,QAAQ,KAAK,gBAAgBA,CAAI,CAAC,EAAID,EAAQ,EACnDC,EAAK,MAAQ,KAAK,OAAO,KAAK,UAAU,EACxC,KAAK,aAGP,KAAK,gBAAgB,QAASC,GAAY,CACxC,OAAQA,EAAQ,CAAC,EAAC,CAChB,IAAK,QACH,KAAK,MAAQA,EAAQ,CAAC,EACtB,MACF,IAAK,SACH,KAAK,MAAQ,CACX,MAAO,WAAWA,EAAQ,CAAC,CAAC,EAC5B,KAAM,WAAWA,EAAQ,CAAC,CAAC,CAC7B,EACA,KACJ,EACD,GAEH,SAAU,CACR,IAAIC,EAAc,CAAA,EAClB,KAAK,MAAM,QAASF,GAAS,CAC3BE,EAAY,KAAK,CACf,MAAO,KAAK,SAASF,CAAI,EACzB,OAAQA,EAAK,MACb,MAAO,EACP,MAAO,CAACG,EAAMC,IACR,OAAOA,GAAa,UAAY,MAAMA,CAAQ,EACzC,MAEAA,GAAY,KAAO,KAA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AA,CAAA,IAAA,+CAmBEC,EAAAA,mBAA2C,MAAA,CAAtC,MAAM,OAAQ,WAAYC,EAAA,EAAE,EAnBnC,EAAA,KAAA,EAAAF,CAAA"}
1
+ {"version":3,"file":"ArrayplotWidget-DC41cpv1.cjs","sources":["../src/widgets/ArrayplotWidget.vue"],"sourcesContent":["<!--\n# Copyright 2025 OpenC3, Inc.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n#\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n-->\n\n<template>\n <div class=\"pa-1\" :id=\"`chart${id}`\"></div>\n</template>\n\n<script>\nimport uPlot from 'uplot'\nimport 'uplot/dist/uPlot.min.css'\nimport { Cable } from '@openc3/js-common/services'\nimport GraphWidget from './GraphWidget'\n\nexport default {\n data: function () {\n return {\n items: [],\n indexes: {},\n data: [[]],\n cable: new Cable(),\n subscription: null,\n graph: null,\n xAxis: null,\n title: 'Array Plot',\n colorIndex: 0,\n colors: [\n // The first 3 are taken from the Astro css definitions for\n // --color-data-visualization-1 through 3\n '#00c7cb',\n '#938bdb',\n '#4dacff',\n 'lime',\n 'darkorange',\n 'red',\n 'gold',\n 'hotpink',\n 'tan',\n 'cyan',\n 'maroon',\n 'blue',\n 'teal',\n 'purple',\n 'green',\n 'brown',\n 'lightblue',\n 'white',\n 'black',\n ],\n }\n },\n mixins: [GraphWidget],\n created() {\n for (const [index, item] of this.items.entries()) {\n this.data.push([]) // initialize the empty data arrays\n this.indexes[this.subscriptionKey(item)] = index + 1\n item.color = this.colors[this.colorIndex]\n this.colorIndex++\n }\n\n this.appliedSettings.forEach((setting) => {\n switch (setting[0]) {\n case 'TITLE':\n this.title = setting[1]\n break\n case 'X_AXIS':\n this.xAxis = {\n start: parseFloat(setting[1]),\n step: parseFloat(setting[2]),\n }\n break\n }\n })\n },\n mounted() {\n let chartSeries = []\n this.items.forEach((item) => {\n chartSeries.push({\n label: this.itemName(item),\n stroke: item.color,\n width: 2,\n value: (self, rawValue) => {\n if (typeof rawValue === 'string' || isNaN(rawValue)) {\n return 'NaN'\n } else {\n return rawValue == null ? '--' : rawValue.toFixed(3)\n }\n },\n })\n })\n\n let chartOpts = {\n title: this.title,\n width: this.size.width,\n height: this.size.height,\n scales: {\n x: {\n time: false,\n },\n y: {\n time: false,\n range: (u, min, max) => [min, max],\n },\n },\n axes: [\n {\n stroke: 'white',\n grid: {\n show: true,\n stroke: 'rgba(255, 255, 255, .1)',\n width: 2,\n },\n },\n {\n stroke: 'white',\n grid: {\n show: true,\n stroke: 'rgba(255, 255, 255, .1)',\n width: 2,\n },\n },\n ],\n series: [\n {\n label: 'X Value',\n },\n ...chartSeries,\n ],\n }\n this.graph = new uPlot(\n chartOpts,\n this.data,\n document.getElementById(`chart${this.id}`),\n )\n this.subscribe()\n },\n beforeUnmount: function () {\n this.cable.disconnect()\n },\n computed: {\n dataOnly() {\n return this.data[1] // Ignore the x axis data\n },\n },\n watch: {\n // This is always firing even when the data is the same\n // Is it because we're setting the whole array data[1]?\n dataOnly: function () {\n if (this.graph) {\n this.graph.setData(this.data)\n }\n },\n },\n methods: {\n subscribe: function () {\n this.cable\n .createSubscription('StreamingChannel', window.openc3Scope, {\n received: (data) => this.received(data),\n connected: () => {\n this.addItemsToSubscription(this.items)\n },\n disconnected: (data) => {\n // If allowReconnect is true it means we got a disconnect due to connection lost or server disconnect\n // If allowReconnect is false this is a normal server close or client close\n if (data.allowReconnect) {\n this.errors.push({\n type: 'disconnected',\n message: 'OpenC3 backend connection disconnected',\n time: new Date().getTime(),\n })\n }\n },\n rejected: () => {\n this.errors.push({\n type: 'rejected',\n message: 'OpenC3 backend connection rejected',\n time: new Date().getTime(),\n })\n },\n })\n .then((subscription) => {\n this.subscription = subscription\n })\n },\n received: function (data_array) {\n for (let data of data_array) {\n let xaxis = [] // Declare outside the loop so we can use it for the X axis values\n for (const [key, value] of Object.entries(data)) {\n // We support 2 different kind of data, a simple array of Y values\n // or an array with both X and Y values, e.g. [[x1,x2,x3...], [y1,y2,y3...]]\n if (key === '__time') {\n // Explicitly setting the X axis values always wins\n if (this.xAxis) {\n xaxis = Array.from(\n { length: this.data[1].length },\n (_, i) => this.xAxis.start + i * this.xAxis.step,\n )\n } else if (xaxis.length === 0) {\n // If we don't have an array of X values we generate them\n xaxis = Array.from({ length: this.data[1].length }, (_, i) => i)\n }\n this.data[0] = xaxis\n }\n let key_index = this.indexes[key]\n if (key_index) {\n // Check for the array of arrays case\n if (Array.isArray(value[0])) {\n this.data[key_index] = value[1]\n xaxis = value[0]\n } else {\n this.data[key_index] = value\n }\n }\n }\n }\n },\n addItemsToSubscription: function (itemArray = this.items) {\n if (this.subscription) {\n OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity).then(\n (refreshed) => {\n if (refreshed) {\n OpenC3Auth.setTokens()\n }\n this.subscription.perform('add', {\n scope: window.openc3Scope,\n token: localStorage.openc3Token,\n items: itemArray.map(this.subscriptionKey),\n start_time: null,\n end_time: null,\n })\n },\n )\n }\n },\n itemName: function (item) {\n return `${item.targetName} ${item.packetName} ${item.itemName}`\n },\n subscriptionKey: function (item) {\n let key = `${item.reduced}__TLM__${item.targetName}__${item.packetName}__${item.itemName}__${item.valueType}`\n if (\n item.reduced === 'REDUCED_MINUTE' ||\n item.reduced === 'REDUCED_HOUR' ||\n item.reduced === 'REDUCED_DAY'\n ) {\n key += `__${item.reducedType}`\n }\n return key\n },\n },\n}\n</script>\n"],"names":["_sfc_main","Cable","GraphWidget","index","item","setting","chartSeries","self","rawValue","chartOpts","u","min","max","uPlot","data","subscription","data_array","xaxis","key","value","_","i","key_index","itemArray","refreshed","_hoisted_1","_createElementBlock","_ctx"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@@ -1 +1 @@
1
- {"version":3,"file":"ArrayplotWidget-ntRLh6-B.js","sources":["../src/widgets/ArrayplotWidget.vue"],"sourcesContent":["<!--\n# Copyright 2025 OpenC3, Inc.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n#\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n-->\n\n<template>\n <div class=\"pa-1\" :id=\"`chart${id}`\"></div>\n</template>\n\n<script>\nimport uPlot from 'uplot'\nimport 'uplot/dist/uPlot.min.css'\nimport { Cable } from '@openc3/js-common/services'\nimport GraphWidget from './GraphWidget'\n\nexport default {\n data: function () {\n return {\n items: [],\n indexes: {},\n data: [[]],\n cable: new Cable(),\n subscription: null,\n graph: null,\n xAxis: null,\n title: 'Array Plot',\n colorIndex: 0,\n colors: [\n // The first 3 are taken from the Astro css definitions for\n // --color-data-visualization-1 through 3\n '#00c7cb',\n '#938bdb',\n '#4dacff',\n 'lime',\n 'darkorange',\n 'red',\n 'gold',\n 'hotpink',\n 'tan',\n 'cyan',\n 'maroon',\n 'blue',\n 'teal',\n 'purple',\n 'green',\n 'brown',\n 'lightblue',\n 'white',\n 'black',\n ],\n }\n },\n mixins: [GraphWidget],\n created() {\n for (const [index, item] of this.items.entries()) {\n this.data.push([]) // initialize the empty data arrays\n this.indexes[this.subscriptionKey(item)] = index + 1\n item.color = this.colors[this.colorIndex]\n this.colorIndex++\n }\n\n this.appliedSettings.forEach((setting) => {\n switch (setting[0]) {\n case 'TITLE':\n this.title = setting[1]\n break\n case 'X_AXIS':\n this.xAxis = {\n start: parseFloat(setting[1]),\n step: parseFloat(setting[2]),\n }\n break\n }\n })\n },\n mounted() {\n let chartSeries = []\n this.items.forEach((item) => {\n chartSeries.push({\n label: this.itemName(item),\n stroke: item.color,\n width: 2,\n value: (self, rawValue) => {\n if (typeof rawValue === 'string' || isNaN(rawValue)) {\n return 'NaN'\n } else {\n return rawValue == null ? '--' : rawValue.toFixed(3)\n }\n },\n })\n })\n\n let chartOpts = {\n title: this.title,\n width: this.size.width,\n height: this.size.height,\n scales: {\n x: {\n time: false,\n },\n y: {\n time: false,\n range: (u, min, max) => [min, max],\n },\n },\n axes: [\n {\n stroke: 'white',\n grid: {\n show: true,\n stroke: 'rgba(255, 255, 255, .1)',\n width: 2,\n },\n },\n {\n stroke: 'white',\n grid: {\n show: true,\n stroke: 'rgba(255, 255, 255, .1)',\n width: 2,\n },\n },\n ],\n series: [\n {\n label: 'X Value',\n },\n ...chartSeries,\n ],\n }\n this.graph = new uPlot(\n chartOpts,\n this.data,\n document.getElementById(`chart${this.id}`),\n )\n this.subscribe()\n },\n beforeUnmount: function () {\n this.cable.disconnect()\n },\n computed: {\n dataOnly() {\n return this.data[1] // Ignore the x axis data\n },\n },\n watch: {\n // This is always firing even when the data is the same\n // Is it because we're setting the whole array data[1]?\n dataOnly: function () {\n if (this.graph) {\n this.graph.setData(this.data)\n }\n },\n },\n methods: {\n subscribe: function () {\n this.cable\n .createSubscription('StreamingChannel', window.openc3Scope, {\n received: (data) => this.received(data),\n connected: () => {\n this.addItemsToSubscription(this.items)\n },\n disconnected: (data) => {\n // If allowReconnect is true it means we got a disconnect due to connection lost or server disconnect\n // If allowReconnect is false this is a normal server close or client close\n if (data.allowReconnect) {\n this.errors.push({\n type: 'disconnected',\n message: 'OpenC3 backend connection disconnected',\n time: new Date().getTime(),\n })\n }\n },\n rejected: () => {\n this.errors.push({\n type: 'rejected',\n message: 'OpenC3 backend connection rejected',\n time: new Date().getTime(),\n })\n },\n })\n .then((subscription) => {\n this.subscription = subscription\n })\n },\n received: function (data_array) {\n for (let data of data_array) {\n let xaxis = [] // Declare outside the loop so we can use it for the X axis values\n for (const [key, value] of Object.entries(data)) {\n // We support 2 different kind of data, a simple array of Y values\n // or an array with both X and Y values, e.g. [[x1,x2,x3...], [y1,y2,y3...]]\n if (key === '__time') {\n // Explicitly setting the X axis values always wins\n if (this.xAxis) {\n xaxis = Array.from(\n { length: this.data[1].length },\n (_, i) => this.xAxis.start + i * this.xAxis.step,\n )\n } else if (xaxis.length === 0) {\n // If we don't have an array of X values we generate them\n xaxis = Array.from({ length: this.data[1].length }, (_, i) => i)\n }\n this.data[0] = xaxis\n }\n let key_index = this.indexes[key]\n if (key_index) {\n // Check for the array of arrays case\n if (Array.isArray(value[0])) {\n this.data[key_index] = value[1]\n xaxis = value[0]\n } else {\n this.data[key_index] = value\n }\n }\n }\n }\n },\n addItemsToSubscription: function (itemArray = this.items) {\n if (this.subscription) {\n OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity).then(\n (refreshed) => {\n if (refreshed) {\n OpenC3Auth.setTokens()\n }\n this.subscription.perform('add', {\n scope: window.openc3Scope,\n token: localStorage.openc3Token,\n items: itemArray.map(this.subscriptionKey),\n start_time: null,\n end_time: null,\n })\n },\n )\n }\n },\n itemName: function (item) {\n return `${item.targetName} ${item.packetName} ${item.itemName}`\n },\n subscriptionKey: function (item) {\n let key = `${item.reduced}__TLM__${item.targetName}__${item.packetName}__${item.itemName}__${item.valueType}`\n if (\n item.reduced === 'REDUCED_MINUTE' ||\n item.reduced === 'REDUCED_HOUR' ||\n item.reduced === 'REDUCED_DAY'\n ) {\n key += `__${item.reducedType}`\n }\n return key\n },\n },\n}\n</script>\n"],"names":["_sfc_main","Cable","GraphWidget","index","item","setting","chartSeries","self","rawValue","chartOpts","u","min","max","uPlot","data","subscription","data_array","xaxis","key","value","_","i","key_index","itemArray","refreshed","_hoisted_1","_createElementBlock","_ctx"],"mappings":";;;;AA4BA,MAAKA,IAAU;AAAA,EACb,MAAM,WAAY;AAChB,WAAO;AAAA,MACL,OAAO,CAAA;AAAA,MACP,SAAS,CAA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YACpB,OAAOD,EAAU,IAAI,KAAK,eAAe;AAAA,YACzC,YAAY;AAAA,YACZ,UAAU;AAAA,WACX;AAAA;MAEL;AAAA;IAGJ,UAAU,SAAUnB,GAAM;AACxB,aAAO,GAAGA,EAAK,UAAU,IAAIA,EAAK,UAAU,IAAIA,EAAK,QAAQ;AAAA;IAE/D,iBAAiB,SAAUA,GAAM;AAC/B,UAAIc,IAAM,GAAGd,EAAK,OAAO,UAAUA,EAAK,UAAU,KAAKA,EAAK,UAAU,KAAKA,EAAK,QAAQ,KAAKA,EAAK,SAAS;AAC3G,cACEA,EAAK,YAAY,oBACjBA,EAAK,YAAY,kBACjBA,EAAK,YAAY,mBAEjBc,KAAO,KAAKd,EAAK,WAAW,KAEvBc;AAAA;;AAGb,GAvQAO,IAAA,CAAA,IAAA;;cAmBEC,EAA2C,OAAA;AAAA,IAAtC,OAAM;AAAA,IAAQ,YAAYC,EAAA,EAAE;AAAA,EAnBnC,GAAA,MAAA,GAAAF,CAAA;;;"}
1
+ {"version":3,"file":"ArrayplotWidget-ntRLh6-B.js","sources":["../src/widgets/ArrayplotWidget.vue"],"sourcesContent":["<!--\n# Copyright 2025 OpenC3, Inc.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n#\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n-->\n\n<template>\n <div class=\"pa-1\" :id=\"`chart${id}`\"></div>\n</template>\n\n<script>\nimport uPlot from 'uplot'\nimport 'uplot/dist/uPlot.min.css'\nimport { Cable } from '@openc3/js-common/services'\nimport GraphWidget from './GraphWidget'\n\nexport default {\n data: function () {\n return {\n items: [],\n indexes: {},\n data: [[]],\n cable: new Cable(),\n subscription: null,\n graph: null,\n xAxis: null,\n title: 'Array Plot',\n colorIndex: 0,\n colors: [\n // The first 3 are taken from the Astro css definitions for\n // --color-data-visualization-1 through 3\n '#00c7cb',\n '#938bdb',\n '#4dacff',\n 'lime',\n 'darkorange',\n 'red',\n 'gold',\n 'hotpink',\n 'tan',\n 'cyan',\n 'maroon',\n 'blue',\n 'teal',\n 'purple',\n 'green',\n 'brown',\n 'lightblue',\n 'white',\n 'black',\n ],\n }\n },\n mixins: [GraphWidget],\n created() {\n for (const [index, item] of this.items.entries()) {\n this.data.push([]) // initialize the empty data arrays\n this.indexes[this.subscriptionKey(item)] = index + 1\n item.color = this.colors[this.colorIndex]\n this.colorIndex++\n }\n\n this.appliedSettings.forEach((setting) => {\n switch (setting[0]) {\n case 'TITLE':\n this.title = setting[1]\n break\n case 'X_AXIS':\n this.xAxis = {\n start: parseFloat(setting[1]),\n step: parseFloat(setting[2]),\n }\n break\n }\n })\n },\n mounted() {\n let chartSeries = []\n this.items.forEach((item) => {\n chartSeries.push({\n label: this.itemName(item),\n stroke: item.color,\n width: 2,\n value: (self, rawValue) => {\n if (typeof rawValue === 'string' || isNaN(rawValue)) {\n return 'NaN'\n } else {\n return rawValue == null ? '--' : rawValue.toFixed(3)\n }\n },\n })\n })\n\n let chartOpts = {\n title: this.title,\n width: this.size.width,\n height: this.size.height,\n scales: {\n x: {\n time: false,\n },\n y: {\n time: false,\n range: (u, min, max) => [min, max],\n },\n },\n axes: [\n {\n stroke: 'white',\n grid: {\n show: true,\n stroke: 'rgba(255, 255, 255, .1)',\n width: 2,\n },\n },\n {\n stroke: 'white',\n grid: {\n show: true,\n stroke: 'rgba(255, 255, 255, .1)',\n width: 2,\n },\n },\n ],\n series: [\n {\n label: 'X Value',\n },\n ...chartSeries,\n ],\n }\n this.graph = new uPlot(\n chartOpts,\n this.data,\n document.getElementById(`chart${this.id}`),\n )\n this.subscribe()\n },\n beforeUnmount: function () {\n this.cable.disconnect()\n },\n computed: {\n dataOnly() {\n return this.data[1] // Ignore the x axis data\n },\n },\n watch: {\n // This is always firing even when the data is the same\n // Is it because we're setting the whole array data[1]?\n dataOnly: function () {\n if (this.graph) {\n this.graph.setData(this.data)\n }\n },\n },\n methods: {\n subscribe: function () {\n this.cable\n .createSubscription('StreamingChannel', window.openc3Scope, {\n received: (data) => this.received(data),\n connected: () => {\n this.addItemsToSubscription(this.items)\n },\n disconnected: (data) => {\n // If allowReconnect is true it means we got a disconnect due to connection lost or server disconnect\n // If allowReconnect is false this is a normal server close or client close\n if (data.allowReconnect) {\n this.errors.push({\n type: 'disconnected',\n message: 'OpenC3 backend connection disconnected',\n time: new Date().getTime(),\n })\n }\n },\n rejected: () => {\n this.errors.push({\n type: 'rejected',\n message: 'OpenC3 backend connection rejected',\n time: new Date().getTime(),\n })\n },\n })\n .then((subscription) => {\n this.subscription = subscription\n })\n },\n received: function (data_array) {\n for (let data of data_array) {\n let xaxis = [] // Declare outside the loop so we can use it for the X axis values\n for (const [key, value] of Object.entries(data)) {\n // We support 2 different kind of data, a simple array of Y values\n // or an array with both X and Y values, e.g. [[x1,x2,x3...], [y1,y2,y3...]]\n if (key === '__time') {\n // Explicitly setting the X axis values always wins\n if (this.xAxis) {\n xaxis = Array.from(\n { length: this.data[1].length },\n (_, i) => this.xAxis.start + i * this.xAxis.step,\n )\n } else if (xaxis.length === 0) {\n // If we don't have an array of X values we generate them\n xaxis = Array.from({ length: this.data[1].length }, (_, i) => i)\n }\n this.data[0] = xaxis\n }\n let key_index = this.indexes[key]\n if (key_index) {\n // Check for the array of arrays case\n if (Array.isArray(value[0])) {\n this.data[key_index] = value[1]\n xaxis = value[0]\n } else {\n this.data[key_index] = value\n }\n }\n }\n }\n },\n addItemsToSubscription: function (itemArray = this.items) {\n if (this.subscription) {\n OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity).then(\n (refreshed) => {\n if (refreshed) {\n OpenC3Auth.setTokens()\n }\n this.subscription.perform('add', {\n scope: window.openc3Scope,\n token: localStorage.openc3Token,\n items: itemArray.map(this.subscriptionKey),\n start_time: null,\n end_time: null,\n })\n },\n )\n }\n },\n itemName: function (item) {\n return `${item.targetName} ${item.packetName} ${item.itemName}`\n },\n subscriptionKey: function (item) {\n let key = `${item.reduced}__TLM__${item.targetName}__${item.packetName}__${item.itemName}__${item.valueType}`\n if (\n item.reduced === 'REDUCED_MINUTE' ||\n item.reduced === 'REDUCED_HOUR' ||\n item.reduced === 'REDUCED_DAY'\n ) {\n key += `__${item.reducedType}`\n }\n return key\n },\n },\n}\n</script>\n"],"names":["_sfc_main","Cable","GraphWidget","index","item","setting","chartSeries","self","rawValue","chartOpts","u","min","max","uPlot","data","subscription","data_array","xaxis","key","value","_","i","key_index","itemArray","refreshed","_hoisted_1","_createElementBlock","_ctx"],"mappings":";;;;AA4BA,MAAKA,IAAU;AAAA,EACb,MAAM,WAAY;AAChB,WAAO;AAAA,MACL,OAAO,CAAA;AAAA,MACP,SAAS,CAAA;AAAA,MACT,MAAM,CAAC,CAAA,CAAE;AAAA,MACT,OAAO,IAAIC,EAAK;AAAA,MAChB,cAAc;AAAA,MACd,OAAO;AAAA,MACP,OAAO;AAAA,MACP,OAAO;AAAA,MACP,YAAY;AAAA,MACZ,QAAQ;AAAA;AAAA;AAAA,QAGN;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;IAEJ;AAAA,EACF;AAAA,EACA,QAAQ,CAACC,CAAW;AAAA,EACpB,UAAU;AACR,eAAW,CAACC,GAAOC,CAAI,KAAK,KAAK,MAAM;AACrC,WAAK,KAAK,KAAK,EAAE,GACjB,KAAK,QAAQ,KAAK,gBAAgBA,CAAI,CAAC,IAAID,IAAQ,GACnDC,EAAK,QAAQ,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AAA,IACT;AAAA;AAEJ,GAvQAO,IAAA,CAAA,IAAA;;cAmBEC,EAA2C,OAAA;AAAA,IAAtC,OAAM;AAAA,IAAQ,YAAYC,EAAA,EAAE;AAAA,EAnBnC,GAAA,MAAA,GAAAF,CAAA;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AstroStatus-CILMWL6F.cjs","sources":["../src/util/AstroStatus.js"],"sourcesContent":["/*\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# Modified by OpenC3, Inc.\n# All changes Copyright 2023, OpenC3, Inc.\n# All Rights Reserved\n#\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n*/\n\nconst _levels = [\n // order of levels from highest to lowest\n 'FATAL',\n 'fatal',\n 'ERROR',\n 'critical',\n 'serious',\n 'WARN',\n 'caution',\n 'INFO',\n 'normal',\n 'standby',\n 'off',\n 'DEBUG',\n]\n\nconst _getLevelIndeces = function (levels) {\n return levels.map((level) => _levels.indexOf(level))\n}\n\nconst highestLevel = function (levels) {\n const indices = _getLevelIndeces(levels)\n const index = Math.min(...indices)\n return _levels[index]\n}\n\nconst lowestLevel = function (levels) {\n const indices = _getLevelIndeces(levels)\n const index = Math.max(...indices)\n return _levels[index]\n}\n\nconst orderByLevel = function (objects, levelGetter = (x) => x.level) {\n return objects.sort((a, b) => {\n return _levels.indexOf(levelGetter(a)) - _levels.indexOf(levelGetter(b))\n })\n}\n\nconst groupByLevel = function (objects, levelGetter = (x) => x.level) {\n return objects.reduce((groups, obj) => {\n const level = levelGetter(obj)\n groups[level] ||= []\n groups[level].push(obj)\n return groups\n }, {})\n}\n\nexport { highestLevel, lowestLevel, orderByLevel, groupByLevel }\n"],"names":["_levels","_getLevelIndeces","levels","level","highestLevel","indices","index","lowestLevel","orderByLevel","objects","levelGetter","x","a","b","groupByLevel","groups","obj"],"mappings":"aAsBA,MAAMA,EAAU,CAEd,QACA,QACA,QACA,WACA,UACA,OACA,UACA,OACA,SACA,UACA,MACA,OACF,EAEMC,EAAmB,SAAUC,EAAQ,CACzC,OAAOA,EAAO,IAAKC,GAAUH,EAAQ,QAAQG,CAAK,CAAC,CACrD,EAEMC,EAAe,SAAUF,EAAQ,CACrC,MAAMG,EAAUJ,EAAiBC,CAAM,EACjCI,EAAQ,KAAK,IAAI,GAAGD,CAAO,EACjC,OAAOL,EAAQM,CAAK,CACtB,EAEMC,EAAc,SAAUL,EAAQ,CACpC,MAAMG,EAAUJ,EAAiBC,CAAM,EACjCI,EAAQ,KAAK,IAAI,GAAGD,CAAO,EACjC,OAAOL,EAAQM,CAAK,CACtB,EAEME,EAAe,SAAUC,EAASC,EAAeC,GAAMA,EAAE,MAAO,CACpE,OAAOF,EAAQ,KAAK,CAACG,EAAGC,IACfb,EAAQ,QAAQU,EAAYE,CAAC,CAAC,EAAIZ,EAAQ,QAAQU,EAAYG,CAAC,CAAC,CACxE,CACH,EAEMC,EAAe,SAAUL,EAASC,EAAeC,GAAMA,EAAE,MAAO,CACpE,OAAOF,EAAQ,OAAO,CAACM,EAAQC,IAAQ,CACrC,MAAMb,EAAQO,EAAYM,CAAG,EAC7B,OAAAD,EAAAZ,KAAAY,EAAAZ,GAAkB,CAAA,GAClBY,EAAOZ,CAAK,EAAE,KAAKa,CAAG,EACfD,CACX,EAAK,CAAA,CAAE,CACP"}
1
+ {"version":3,"file":"AstroStatus-CILMWL6F.cjs","sources":["../src/util/AstroStatus.js"],"sourcesContent":["/*\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# Modified by OpenC3, Inc.\n# All changes Copyright 2023, OpenC3, Inc.\n# All Rights Reserved\n#\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n*/\n\nconst _levels = [\n // order of levels from highest to lowest\n 'FATAL',\n 'fatal',\n 'ERROR',\n 'critical',\n 'serious',\n 'WARN',\n 'caution',\n 'INFO',\n 'normal',\n 'standby',\n 'off',\n 'DEBUG',\n]\n\nconst _getLevelIndeces = function (levels) {\n return levels.map((level) => _levels.indexOf(level))\n}\n\nconst highestLevel = function (levels) {\n const indices = _getLevelIndeces(levels)\n const index = Math.min(...indices)\n return _levels[index]\n}\n\nconst lowestLevel = function (levels) {\n const indices = _getLevelIndeces(levels)\n const index = Math.max(...indices)\n return _levels[index]\n}\n\nconst orderByLevel = function (objects, levelGetter = (x) => x.level) {\n return objects.sort((a, b) => {\n return _levels.indexOf(levelGetter(a)) - _levels.indexOf(levelGetter(b))\n })\n}\n\nconst groupByLevel = function (objects, levelGetter = (x) => x.level) {\n return objects.reduce((groups, obj) => {\n const level = levelGetter(obj)\n groups[level] ||= []\n groups[level].push(obj)\n return groups\n }, {})\n}\n\nexport { highestLevel, lowestLevel, orderByLevel, groupByLevel }\n"],"names":["_levels","_getLevelIndeces","levels","level","highestLevel","indices","index","lowestLevel","orderByLevel","objects","levelGetter","x","a","b","groupByLevel","groups","obj"],"mappings":"aAsBA,MAAMA,EAAU,CAEd,QACA,QACA,QACA,WACA,UACA,OACA,UACA,OACA,SACA,UACA,MACA,OACF,EAEMC,EAAmB,SAAUC,EAAQ,CACzC,OAAOA,EAAO,IAAKC,GAAUH,EAAQ,QAAQG,CAAK,CAAC,CACrD,EAEMC,EAAe,SAAUF,EAAQ,CACrC,MAAMG,EAAUJ,EAAiBC,CAAM,EACjCI,EAAQ,KAAK,IAAI,GAAGD,CAAO,EACjC,OAAOL,EAAQM,CAAK,CACtB,EAEMC,EAAc,SAAUL,EAAQ,CACpC,MAAMG,EAAUJ,EAAiBC,CAAM,EACjCI,EAAQ,KAAK,IAAI,GAAGD,CAAO,EACjC,OAAOL,EAAQM,CAAK,CACtB,EAEME,EAAe,SAAUC,EAASC,EAAeC,GAAMA,EAAE,MAAO,CACpE,OAAOF,EAAQ,KAAK,CAACG,EAAGC,IACfb,EAAQ,QAAQU,EAAYE,CAAC,CAAC,EAAIZ,EAAQ,QAAQU,EAAYG,CAAC,CAAC,CACxE,CACH,EAEMC,EAAe,SAAUL,EAASC,EAAeC,GAAMA,EAAE,MAAO,CACpE,OAAOF,EAAQ,OAAO,CAACM,EAAQC,IAAQ,CACrC,MAAMb,EAAQO,EAAYM,CAAG,EAC7B,OAAAD,EAAAZ,KAAAY,EAAAZ,GAAkB,CAAA,GAClBY,EAAOZ,CAAK,EAAE,KAAKa,CAAG,EACfD,CACT,EAAG,CAAA,CAAE,CACP"}
@@ -1 +1 @@
1
- {"version":3,"file":"AstroStatus-CY9VkeTN.js","sources":["../src/util/AstroStatus.js"],"sourcesContent":["/*\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# Modified by OpenC3, Inc.\n# All changes Copyright 2023, OpenC3, Inc.\n# All Rights Reserved\n#\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n*/\n\nconst _levels = [\n // order of levels from highest to lowest\n 'FATAL',\n 'fatal',\n 'ERROR',\n 'critical',\n 'serious',\n 'WARN',\n 'caution',\n 'INFO',\n 'normal',\n 'standby',\n 'off',\n 'DEBUG',\n]\n\nconst _getLevelIndeces = function (levels) {\n return levels.map((level) => _levels.indexOf(level))\n}\n\nconst highestLevel = function (levels) {\n const indices = _getLevelIndeces(levels)\n const index = Math.min(...indices)\n return _levels[index]\n}\n\nconst lowestLevel = function (levels) {\n const indices = _getLevelIndeces(levels)\n const index = Math.max(...indices)\n return _levels[index]\n}\n\nconst orderByLevel = function (objects, levelGetter = (x) => x.level) {\n return objects.sort((a, b) => {\n return _levels.indexOf(levelGetter(a)) - _levels.indexOf(levelGetter(b))\n })\n}\n\nconst groupByLevel = function (objects, levelGetter = (x) => x.level) {\n return objects.reduce((groups, obj) => {\n const level = levelGetter(obj)\n groups[level] ||= []\n groups[level].push(obj)\n return groups\n }, {})\n}\n\nexport { highestLevel, lowestLevel, orderByLevel, groupByLevel }\n"],"names":["_levels","_getLevelIndeces","levels","level","highestLevel","indices","index","lowestLevel","orderByLevel","objects","levelGetter","x","a","b","groupByLevel","groups","obj"],"mappings":"AAsBA,MAAMA,IAAU;AAAA;AAAA,EAEd;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEMC,IAAmB,SAAUC,GAAQ;AACzC,SAAOA,EAAO,IAAI,CAACC,MAAUH,EAAQ,QAAQG,CAAK,CAAC;AACrD,GAEMC,IAAe,SAAUF,GAAQ;AACrC,QAAMG,IAAUJ,EAAiBC,CAAM,GACjCI,IAAQ,KAAK,IAAI,GAAGD,CAAO;AACjC,SAAOL,EAAQM,CAAK;AACtB,GAEMC,IAAc,SAAUL,GAAQ;AACpC,QAAMG,IAAUJ,EAAiBC,CAAM,GACjCI,IAAQ,KAAK,IAAI,GAAGD,CAAO;AACjC,SAAOL,EAAQM,CAAK;AACtB,GAEME,IAAe,SAAUC,GAASC,IAAc,CAACC,MAAMA,EAAE,OAAO;AACpE,SAAOF,EAAQ,KAAK,CAACG,GAAGC,MACfb,EAAQ,QAAQU,EAAYE,CAAC,CAAC,IAAIZ,EAAQ,QAAQU,EAAYG,CAAC,CAAC,CACxE;AACH,GAEMC,IAAe,SAAUL,GAASC,IAAc,CAACC,MAAMA,EAAE,OAAO;AACpE,SAAOF,EAAQ,OAAO,CAACM,GAAQC,MAAQ;AACrC,UAAMb,IAAQO,EAAYM,CAAG;AAC7B,WAAAD,EAAAZ,OAAAY,EAAAZ,KAAkB,CAAA,IAClBY,EAAOZ,CAAK,EAAE,KAAKa,CAAG,GACfD;AAAA,EACX,GAAK,CAAA,CAAE;AACP;;;;;;;"}
1
+ {"version":3,"file":"AstroStatus-CY9VkeTN.js","sources":["../src/util/AstroStatus.js"],"sourcesContent":["/*\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# Modified by OpenC3, Inc.\n# All changes Copyright 2023, OpenC3, Inc.\n# All Rights Reserved\n#\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n*/\n\nconst _levels = [\n // order of levels from highest to lowest\n 'FATAL',\n 'fatal',\n 'ERROR',\n 'critical',\n 'serious',\n 'WARN',\n 'caution',\n 'INFO',\n 'normal',\n 'standby',\n 'off',\n 'DEBUG',\n]\n\nconst _getLevelIndeces = function (levels) {\n return levels.map((level) => _levels.indexOf(level))\n}\n\nconst highestLevel = function (levels) {\n const indices = _getLevelIndeces(levels)\n const index = Math.min(...indices)\n return _levels[index]\n}\n\nconst lowestLevel = function (levels) {\n const indices = _getLevelIndeces(levels)\n const index = Math.max(...indices)\n return _levels[index]\n}\n\nconst orderByLevel = function (objects, levelGetter = (x) => x.level) {\n return objects.sort((a, b) => {\n return _levels.indexOf(levelGetter(a)) - _levels.indexOf(levelGetter(b))\n })\n}\n\nconst groupByLevel = function (objects, levelGetter = (x) => x.level) {\n return objects.reduce((groups, obj) => {\n const level = levelGetter(obj)\n groups[level] ||= []\n groups[level].push(obj)\n return groups\n }, {})\n}\n\nexport { highestLevel, lowestLevel, orderByLevel, groupByLevel }\n"],"names":["_levels","_getLevelIndeces","levels","level","highestLevel","indices","index","lowestLevel","orderByLevel","objects","levelGetter","x","a","b","groupByLevel","groups","obj"],"mappings":"AAsBA,MAAMA,IAAU;AAAA;AAAA,EAEd;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEMC,IAAmB,SAAUC,GAAQ;AACzC,SAAOA,EAAO,IAAI,CAACC,MAAUH,EAAQ,QAAQG,CAAK,CAAC;AACrD,GAEMC,IAAe,SAAUF,GAAQ;AACrC,QAAMG,IAAUJ,EAAiBC,CAAM,GACjCI,IAAQ,KAAK,IAAI,GAAGD,CAAO;AACjC,SAAOL,EAAQM,CAAK;AACtB,GAEMC,IAAc,SAAUL,GAAQ;AACpC,QAAMG,IAAUJ,EAAiBC,CAAM,GACjCI,IAAQ,KAAK,IAAI,GAAGD,CAAO;AACjC,SAAOL,EAAQM,CAAK;AACtB,GAEME,IAAe,SAAUC,GAASC,IAAc,CAACC,MAAMA,EAAE,OAAO;AACpE,SAAOF,EAAQ,KAAK,CAACG,GAAGC,MACfb,EAAQ,QAAQU,EAAYE,CAAC,CAAC,IAAIZ,EAAQ,QAAQU,EAAYG,CAAC,CAAC,CACxE;AACH,GAEMC,IAAe,SAAUL,GAASC,IAAc,CAACC,MAAMA,EAAE,OAAO;AACpE,SAAOF,EAAQ,OAAO,CAACM,GAAQC,MAAQ;AACrC,UAAMb,IAAQO,EAAYM,CAAG;AAC7B,WAAAD,EAAAZ,OAAAY,EAAAZ,KAAkB,CAAA,IAClBY,EAAOZ,CAAK,EAAE,KAAKa,CAAG,GACfD;AAAA,EACT,GAAG,CAAA,CAAE;AACP;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"BarColumn-Bgz2YJ59.js","sources":["../src/widgets/BarColumn.js"],"sourcesContent":["/*\n# Copyright 2024 OpenC3, Inc.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n*/\n\nimport Widget from './Widget'\nimport { OpenC3Api } from '@openc3/js-common/services'\n\nexport default {\n mixins: [Widget],\n data() {\n return {\n minValue: null,\n maxValue: null,\n redLow: 0,\n yellowLow: 0,\n greenLow: 0,\n greenHigh: 0,\n yellowHigh: 0,\n redHigh: 0,\n blue: 0,\n api: null,\n limitsSettings: {\n DEFAULT: [],\n },\n currentLimitsSet: 'DEFAULT',\n currentSetRefreshInterval: null,\n }\n },\n computed: {\n cssProps: function () {\n let value = this.screenValues[this.valueId][0]\n let limits = this.modifyLimits(\n this.limitsSettings[this.selectedLimitsSet],\n )\n this.calcLimits(limits)\n return {\n '--height': this.height + 'px',\n '--width': this.width + 'px',\n '--container-height': this.height - 5 + 'px',\n '--position': this.calcPosition(value, limits) + '%',\n '--redlow-width': this.redLow + '%',\n '--redhigh-width': this.redHigh + '%',\n '--yellowlow-width': this.yellowLow + '%',\n '--yellowhigh-width': this.yellowHigh + '%',\n '--greenlow-width': this.greenLow + '%',\n '--greenhigh-width': this.greenHigh + '%',\n '--blue-width': this.blue + '%',\n }\n },\n selectedLimitsSet: function () {\n return this.limitsSettings.hasOwnProperty(this.currentLimitsSet)\n ? this.currentLimitsSet\n : 'DEFAULT'\n },\n },\n created() {\n this.api = new OpenC3Api()\n this.api\n .get_limits(this.parameters[0], this.parameters[1], this.parameters[2])\n .then((data) => {\n this.limitsSettings = data\n })\n this.getCurrentLimitsSet()\n this.currentSetRefreshInterval = setInterval(\n this.getCurrentLimitsSet,\n 60 * 1000,\n )\n\n this.appliedSettings.forEach((setting) => {\n if (setting[0] === 'MIN_VALUE') {\n this.minValue = parseInt(setting[1])\n }\n if (setting[0] === 'MAX_VALUE') {\n this.maxValue = parseInt(setting[1])\n }\n })\n this.width = this.setWidth(this.parameters[4], 'px', this.width)\n this.height = this.setHeight(this.parameters[5], 'px', this.height)\n // Always pass CONVERTED so we can calculate the value against the limits (in converted units)\n this.valueId = `${this.parameters[0]}__${this.parameters[1]}__${this.parameters[2]}__CONVERTED`\n\n this.$emit('addItem', this.valueId)\n },\n destroyed() {\n this.$emit('deleteItem', this.valueId)\n clearInterval(this.currentSetRefreshInterval)\n },\n methods: {\n modifyLimits(limitsSettings) {\n if (!limitsSettings) {\n return\n }\n // By default the red bars take 10% of the display\n this.redLow = 10\n this.redHigh = 10\n\n // Modify values to respect the user defined minimum\n if (this.minValue !== null) {\n if (limitsSettings[0] <= this.minValue) {\n limitsSettings[0] = this.minValue\n // No red low will be displayed\n this.redLow = 0\n }\n if (limitsSettings[1] <= this.minValue) {\n limitsSettings[1] = this.minValue\n }\n if (limitsSettings[2] <= this.minValue) {\n limitsSettings[2] = this.minValue\n }\n if (limitsSettings[3] <= this.minValue) {\n limitsSettings[3] = this.minValue\n }\n if (limitsSettings.length > 4 && limitsSettings[4] <= this.minValue) {\n limitsSettings[4] = this.minValue\n }\n if (limitsSettings.length > 4 && limitsSettings[5] <= this.minValue) {\n limitsSettings[5] = this.minValue\n }\n }\n if (this.maxValue !== null) {\n if (limitsSettings[0] >= this.maxValue) {\n limitsSettings[0] = this.maxValue\n }\n if (limitsSettings[1] >= this.maxValue) {\n limitsSettings[1] = this.maxValue\n }\n if (limitsSettings[2] >= this.maxValue) {\n limitsSettings[2] = this.maxValue\n }\n if (limitsSettings[3] >= this.maxValue) {\n limitsSettings[3] = this.maxValue\n // No red high will be displayed\n this.redHigh = 0\n }\n if (limitsSettings.length > 4 && limitsSettings[4] >= this.maxValue) {\n limitsSettings[4] = this.maxValue\n }\n if (limitsSettings.length > 4 && limitsSettings[5] >= this.maxValue) {\n limitsSettings[5] = this.maxValue\n }\n }\n // If the red low matches yellow low there is no yellow low\n if (limitsSettings[0] == limitsSettings[1]) {\n this.yellowLow = 0\n }\n // If the red high matches yellow high there is no yellow high\n if (limitsSettings[2] == limitsSettings[3]) {\n this.yellowHigh = 0\n }\n\n let divisor = 80\n if (this.redLow == 0) {\n divisor += 10\n }\n if (this.redHigh == 0) {\n divisor += 10\n }\n this.scale = (limitsSettings[3] - limitsSettings[0]) / divisor\n\n return limitsSettings\n },\n calcPosition(value, limitsSettings) {\n if (!value || !limitsSettings) {\n return\n }\n let lowValue = limitsSettings[0] - 10 * this.scale\n if (this.minValue && this.minValue == limitsSettings[0]) {\n lowValue = limitsSettings[0]\n }\n let highValue = limitsSettings[3] - 10 * this.scale\n if (this.maxValue && this.maxValue == limitsSettings[3]) {\n highValue = limitsSettings[3]\n }\n\n if (value.raw) {\n if (value.raw === '-Infinity') {\n return 0\n } else {\n // NaN and Infinity\n return 100\n }\n }\n if (value < this.min) {\n return 0\n } else if (value > this.max) {\n return 100\n } else {\n const result = parseInt((value - lowValue) / this.scale)\n if (result > 100) {\n return 100\n } else if (result < 0) {\n return 0\n } else {\n return result\n }\n }\n },\n calcLimits(limitsSettings) {\n if (!limitsSettings) {\n return\n }\n this.yellowLow = Math.round(\n (limitsSettings[1] - limitsSettings[0]) / this.scale,\n )\n this.yellowHigh = Math.round(\n (limitsSettings[3] - limitsSettings[2]) / this.scale,\n )\n if (limitsSettings.length > 4) {\n this.greenLow = Math.round(\n (limitsSettings[4] - limitsSettings[1]) / this.scale,\n )\n this.greenHigh = Math.round(\n (limitsSettings[2] - limitsSettings[5]) / this.scale,\n )\n this.blue = Math.round(\n 100 -\n this.redLow -\n this.yellowLow -\n this.greenLow -\n this.greenHigh -\n this.yellowHigh -\n this.redHigh,\n )\n } else {\n this.greenLow = Math.round(\n 100 - this.redLow - this.yellowLow - this.yellowHigh - this.redHigh,\n )\n this.greenHigh = 0\n this.blue = 0\n }\n },\n getCurrentLimitsSet: function () {\n this.api.get_limits_set().then((result) => {\n this.currentLimitsSet = result\n })\n },\n },\n}\n"],"names":["BarColumn","Widget","value","limits","OpenC3Api","data","setting","limitsSettings","divisor","lowValue","result"],"mappings":";;AAqBA,MAAAA,IAAe;AAAA,EACb,QAAQ,CAACC,CAAM;AAAA,EACf,OAAO;AACL,WAAO;AAAA,MACL,UAAU;AAAA,MACV,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,UAAU;AAAA,MACV,WAAW;AAAA,MACX,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,MAAM;AAAA,MACN,KAAK;AAAA,MACL,gBAAgB;AAAA,QACd,SAAS,CAAA;AAAA,MACjB;AAAA,MACM,kBAAkB;AAAA,MAClB,2BAA2B;AAAA,IACjC;AAAA,EACA;AAAA,EACE,UAAU;AAAA,IACR,UAAU,WAAY;AACpB,UAAIC,IAAQ,KAAK,aAAa,KAAK,OAAO,EAAE,CAAC,GACzCC,IAAS,KAAK;AAAA,QAChB,KAAK,eAAe,KAAK,iBAAiB;AAAA,MAClD;AACM,kBAAK,WAAWA,CAAM,GACf;AAAA,QACL,YAAY,KAAK,SAAS;AAAA,QAC1B,WAAW,KAAK,QAAQ;AAAA,QACxB,sBAAsB,KAAK,SAAS,IAAI;AAAA,QACxC,cAAc,KAAK,aAAaD,GAAOC,CAAM,IAAI;AAAA,QACjD,kBAAkB,KAAK,SAAS;A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AAAA,MACtE,GACQ,KAAK,YAAY,GACjB,KAAK,OAAO;AAAA,IAEpB;AAAA,IACI,qBAAqB,WAAY;AAC/B,WAAK,IAAI,eAAc,EAAG,KAAK,CAACG,MAAW;AACzC,aAAK,mBAAmBA;AAAA,MAChC,CAAO;AAAA,IACP;AAAA,EACA;AACA;"}
1
+ {"version":3,"file":"BarColumn-Bgz2YJ59.js","sources":["../src/widgets/BarColumn.js"],"sourcesContent":["/*\n# Copyright 2024 OpenC3, Inc.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n*/\n\nimport Widget from './Widget'\nimport { OpenC3Api } from '@openc3/js-common/services'\n\nexport default {\n mixins: [Widget],\n data() {\n return {\n minValue: null,\n maxValue: null,\n redLow: 0,\n yellowLow: 0,\n greenLow: 0,\n greenHigh: 0,\n yellowHigh: 0,\n redHigh: 0,\n blue: 0,\n api: null,\n limitsSettings: {\n DEFAULT: [],\n },\n currentLimitsSet: 'DEFAULT',\n currentSetRefreshInterval: null,\n }\n },\n computed: {\n cssProps: function () {\n let value = this.screenValues[this.valueId][0]\n let limits = this.modifyLimits(\n this.limitsSettings[this.selectedLimitsSet],\n )\n this.calcLimits(limits)\n return {\n '--height': this.height + 'px',\n '--width': this.width + 'px',\n '--container-height': this.height - 5 + 'px',\n '--position': this.calcPosition(value, limits) + '%',\n '--redlow-width': this.redLow + '%',\n '--redhigh-width': this.redHigh + '%',\n '--yellowlow-width': this.yellowLow + '%',\n '--yellowhigh-width': this.yellowHigh + '%',\n '--greenlow-width': this.greenLow + '%',\n '--greenhigh-width': this.greenHigh + '%',\n '--blue-width': this.blue + '%',\n }\n },\n selectedLimitsSet: function () {\n return this.limitsSettings.hasOwnProperty(this.currentLimitsSet)\n ? this.currentLimitsSet\n : 'DEFAULT'\n },\n },\n created() {\n this.api = new OpenC3Api()\n this.api\n .get_limits(this.parameters[0], this.parameters[1], this.parameters[2])\n .then((data) => {\n this.limitsSettings = data\n })\n this.getCurrentLimitsSet()\n this.currentSetRefreshInterval = setInterval(\n this.getCurrentLimitsSet,\n 60 * 1000,\n )\n\n this.appliedSettings.forEach((setting) => {\n if (setting[0] === 'MIN_VALUE') {\n this.minValue = parseInt(setting[1])\n }\n if (setting[0] === 'MAX_VALUE') {\n this.maxValue = parseInt(setting[1])\n }\n })\n this.width = this.setWidth(this.parameters[4], 'px', this.width)\n this.height = this.setHeight(this.parameters[5], 'px', this.height)\n // Always pass CONVERTED so we can calculate the value against the limits (in converted units)\n this.valueId = `${this.parameters[0]}__${this.parameters[1]}__${this.parameters[2]}__CONVERTED`\n\n this.$emit('addItem', this.valueId)\n },\n destroyed() {\n this.$emit('deleteItem', this.valueId)\n clearInterval(this.currentSetRefreshInterval)\n },\n methods: {\n modifyLimits(limitsSettings) {\n if (!limitsSettings) {\n return\n }\n // By default the red bars take 10% of the display\n this.redLow = 10\n this.redHigh = 10\n\n // Modify values to respect the user defined minimum\n if (this.minValue !== null) {\n if (limitsSettings[0] <= this.minValue) {\n limitsSettings[0] = this.minValue\n // No red low will be displayed\n this.redLow = 0\n }\n if (limitsSettings[1] <= this.minValue) {\n limitsSettings[1] = this.minValue\n }\n if (limitsSettings[2] <= this.minValue) {\n limitsSettings[2] = this.minValue\n }\n if (limitsSettings[3] <= this.minValue) {\n limitsSettings[3] = this.minValue\n }\n if (limitsSettings.length > 4 && limitsSettings[4] <= this.minValue) {\n limitsSettings[4] = this.minValue\n }\n if (limitsSettings.length > 4 && limitsSettings[5] <= this.minValue) {\n limitsSettings[5] = this.minValue\n }\n }\n if (this.maxValue !== null) {\n if (limitsSettings[0] >= this.maxValue) {\n limitsSettings[0] = this.maxValue\n }\n if (limitsSettings[1] >= this.maxValue) {\n limitsSettings[1] = this.maxValue\n }\n if (limitsSettings[2] >= this.maxValue) {\n limitsSettings[2] = this.maxValue\n }\n if (limitsSettings[3] >= this.maxValue) {\n limitsSettings[3] = this.maxValue\n // No red high will be displayed\n this.redHigh = 0\n }\n if (limitsSettings.length > 4 && limitsSettings[4] >= this.maxValue) {\n limitsSettings[4] = this.maxValue\n }\n if (limitsSettings.length > 4 && limitsSettings[5] >= this.maxValue) {\n limitsSettings[5] = this.maxValue\n }\n }\n // If the red low matches yellow low there is no yellow low\n if (limitsSettings[0] == limitsSettings[1]) {\n this.yellowLow = 0\n }\n // If the red high matches yellow high there is no yellow high\n if (limitsSettings[2] == limitsSettings[3]) {\n this.yellowHigh = 0\n }\n\n let divisor = 80\n if (this.redLow == 0) {\n divisor += 10\n }\n if (this.redHigh == 0) {\n divisor += 10\n }\n this.scale = (limitsSettings[3] - limitsSettings[0]) / divisor\n\n return limitsSettings\n },\n calcPosition(value, limitsSettings) {\n if (!value || !limitsSettings) {\n return\n }\n let lowValue = limitsSettings[0] - 10 * this.scale\n if (this.minValue && this.minValue == limitsSettings[0]) {\n lowValue = limitsSettings[0]\n }\n let highValue = limitsSettings[3] - 10 * this.scale\n if (this.maxValue && this.maxValue == limitsSettings[3]) {\n highValue = limitsSettings[3]\n }\n\n if (value.raw) {\n if (value.raw === '-Infinity') {\n return 0\n } else {\n // NaN and Infinity\n return 100\n }\n }\n if (value < this.min) {\n return 0\n } else if (value > this.max) {\n return 100\n } else {\n const result = parseInt((value - lowValue) / this.scale)\n if (result > 100) {\n return 100\n } else if (result < 0) {\n return 0\n } else {\n return result\n }\n }\n },\n calcLimits(limitsSettings) {\n if (!limitsSettings) {\n return\n }\n this.yellowLow = Math.round(\n (limitsSettings[1] - limitsSettings[0]) / this.scale,\n )\n this.yellowHigh = Math.round(\n (limitsSettings[3] - limitsSettings[2]) / this.scale,\n )\n if (limitsSettings.length > 4) {\n this.greenLow = Math.round(\n (limitsSettings[4] - limitsSettings[1]) / this.scale,\n )\n this.greenHigh = Math.round(\n (limitsSettings[2] - limitsSettings[5]) / this.scale,\n )\n this.blue = Math.round(\n 100 -\n this.redLow -\n this.yellowLow -\n this.greenLow -\n this.greenHigh -\n this.yellowHigh -\n this.redHigh,\n )\n } else {\n this.greenLow = Math.round(\n 100 - this.redLow - this.yellowLow - this.yellowHigh - this.redHigh,\n )\n this.greenHigh = 0\n this.blue = 0\n }\n },\n getCurrentLimitsSet: function () {\n this.api.get_limits_set().then((result) => {\n this.currentLimitsSet = result\n })\n },\n },\n}\n"],"names":["BarColumn","Widget","value","limits","OpenC3Api","data","setting","limitsSettings","divisor","lowValue","result"],"mappings":";;AAqBA,MAAAA,IAAe;AAAA,EACb,QAAQ,CAACC,CAAM;AAAA,EACf,OAAO;AACL,WAAO;AAAA,MACL,UAAU;AAAA,MACV,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,UAAU;AAAA,MACV,WAAW;AAAA,MACX,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,MAAM;AAAA,MACN,KAAK;AAAA,MACL,gBAAgB;AAAA,QACd,SAAS,CAAA;AAAA,MACjB;AAAA,MACM,kBAAkB;AAAA,MAClB,2BAA2B;AAAA,IACjC;AAAA,EACE;AAAA,EACA,UAAU;AAAA,IACR,UAAU,WAAY;AACpB,UAAIC,IAAQ,KAAK,aAAa,KAAK,OAAO,EAAE,CAAC,GACzCC,IAAS,KAAK;AAAA,QAChB,KAAK,eAAe,KAAK,iBAAiB;AAAA,MAClD;AACM,kBAAK,WAAWA,CAAM,GACf;AAAA,QACL,YAAY,KAAK,SAAS;AAAA,QAC1B,WAAW,KAAK,QAAQ;AAAA,QACxB,sBAAsB,KAAK,SAAS,IAAI;AAAA,QACxC,cAAc,KAAK,aAAaD,GAAOC,CAAM,IAAI;AAAA,QACjD,kBAAkB,KAAK,SAAS;AAAA,QAChC,mBAAmB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KAAK,YAAY,GACjB,KAAK,OAAO;AAAA,IAEhB;AAAA,IACA,qBAAqB,WAAY;AAC/B,WAAK,IAAI,eAAc,EAAG,KAAK,CAACG,MAAW;AACzC,aAAK,mBAAmBA;AAAA,MAC1B,CAAC;AAAA,IACH;AAAA,EACJ;AACA;"}
@@ -1 +1 @@
1
- {"version":3,"file":"BarColumn-DtRNuOpa.cjs","sources":["../src/widgets/BarColumn.js"],"sourcesContent":["/*\n# Copyright 2024 OpenC3, Inc.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n*/\n\nimport Widget from './Widget'\nimport { OpenC3Api } from '@openc3/js-common/services'\n\nexport default {\n mixins: [Widget],\n data() {\n return {\n minValue: null,\n maxValue: null,\n redLow: 0,\n yellowLow: 0,\n greenLow: 0,\n greenHigh: 0,\n yellowHigh: 0,\n redHigh: 0,\n blue: 0,\n api: null,\n limitsSettings: {\n DEFAULT: [],\n },\n currentLimitsSet: 'DEFAULT',\n currentSetRefreshInterval: null,\n }\n },\n computed: {\n cssProps: function () {\n let value = this.screenValues[this.valueId][0]\n let limits = this.modifyLimits(\n this.limitsSettings[this.selectedLimitsSet],\n )\n this.calcLimits(limits)\n return {\n '--height': this.height + 'px',\n '--width': this.width + 'px',\n '--container-height': this.height - 5 + 'px',\n '--position': this.calcPosition(value, limits) + '%',\n '--redlow-width': this.redLow + '%',\n '--redhigh-width': this.redHigh + '%',\n '--yellowlow-width': this.yellowLow + '%',\n '--yellowhigh-width': this.yellowHigh + '%',\n '--greenlow-width': this.greenLow + '%',\n '--greenhigh-width': this.greenHigh + '%',\n '--blue-width': this.blue + '%',\n }\n },\n selectedLimitsSet: function () {\n return this.limitsSettings.hasOwnProperty(this.currentLimitsSet)\n ? this.currentLimitsSet\n : 'DEFAULT'\n },\n },\n created() {\n this.api = new OpenC3Api()\n this.api\n .get_limits(this.parameters[0], this.parameters[1], this.parameters[2])\n .then((data) => {\n this.limitsSettings = data\n })\n this.getCurrentLimitsSet()\n this.currentSetRefreshInterval = setInterval(\n this.getCurrentLimitsSet,\n 60 * 1000,\n )\n\n this.appliedSettings.forEach((setting) => {\n if (setting[0] === 'MIN_VALUE') {\n this.minValue = parseInt(setting[1])\n }\n if (setting[0] === 'MAX_VALUE') {\n this.maxValue = parseInt(setting[1])\n }\n })\n this.width = this.setWidth(this.parameters[4], 'px', this.width)\n this.height = this.setHeight(this.parameters[5], 'px', this.height)\n // Always pass CONVERTED so we can calculate the value against the limits (in converted units)\n this.valueId = `${this.parameters[0]}__${this.parameters[1]}__${this.parameters[2]}__CONVERTED`\n\n this.$emit('addItem', this.valueId)\n },\n destroyed() {\n this.$emit('deleteItem', this.valueId)\n clearInterval(this.currentSetRefreshInterval)\n },\n methods: {\n modifyLimits(limitsSettings) {\n if (!limitsSettings) {\n return\n }\n // By default the red bars take 10% of the display\n this.redLow = 10\n this.redHigh = 10\n\n // Modify values to respect the user defined minimum\n if (this.minValue !== null) {\n if (limitsSettings[0] <= this.minValue) {\n limitsSettings[0] = this.minValue\n // No red low will be displayed\n this.redLow = 0\n }\n if (limitsSettings[1] <= this.minValue) {\n limitsSettings[1] = this.minValue\n }\n if (limitsSettings[2] <= this.minValue) {\n limitsSettings[2] = this.minValue\n }\n if (limitsSettings[3] <= this.minValue) {\n limitsSettings[3] = this.minValue\n }\n if (limitsSettings.length > 4 && limitsSettings[4] <= this.minValue) {\n limitsSettings[4] = this.minValue\n }\n if (limitsSettings.length > 4 && limitsSettings[5] <= this.minValue) {\n limitsSettings[5] = this.minValue\n }\n }\n if (this.maxValue !== null) {\n if (limitsSettings[0] >= this.maxValue) {\n limitsSettings[0] = this.maxValue\n }\n if (limitsSettings[1] >= this.maxValue) {\n limitsSettings[1] = this.maxValue\n }\n if (limitsSettings[2] >= this.maxValue) {\n limitsSettings[2] = this.maxValue\n }\n if (limitsSettings[3] >= this.maxValue) {\n limitsSettings[3] = this.maxValue\n // No red high will be displayed\n this.redHigh = 0\n }\n if (limitsSettings.length > 4 && limitsSettings[4] >= this.maxValue) {\n limitsSettings[4] = this.maxValue\n }\n if (limitsSettings.length > 4 && limitsSettings[5] >= this.maxValue) {\n limitsSettings[5] = this.maxValue\n }\n }\n // If the red low matches yellow low there is no yellow low\n if (limitsSettings[0] == limitsSettings[1]) {\n this.yellowLow = 0\n }\n // If the red high matches yellow high there is no yellow high\n if (limitsSettings[2] == limitsSettings[3]) {\n this.yellowHigh = 0\n }\n\n let divisor = 80\n if (this.redLow == 0) {\n divisor += 10\n }\n if (this.redHigh == 0) {\n divisor += 10\n }\n this.scale = (limitsSettings[3] - limitsSettings[0]) / divisor\n\n return limitsSettings\n },\n calcPosition(value, limitsSettings) {\n if (!value || !limitsSettings) {\n return\n }\n let lowValue = limitsSettings[0] - 10 * this.scale\n if (this.minValue && this.minValue == limitsSettings[0]) {\n lowValue = limitsSettings[0]\n }\n let highValue = limitsSettings[3] - 10 * this.scale\n if (this.maxValue && this.maxValue == limitsSettings[3]) {\n highValue = limitsSettings[3]\n }\n\n if (value.raw) {\n if (value.raw === '-Infinity') {\n return 0\n } else {\n // NaN and Infinity\n return 100\n }\n }\n if (value < this.min) {\n return 0\n } else if (value > this.max) {\n return 100\n } else {\n const result = parseInt((value - lowValue) / this.scale)\n if (result > 100) {\n return 100\n } else if (result < 0) {\n return 0\n } else {\n return result\n }\n }\n },\n calcLimits(limitsSettings) {\n if (!limitsSettings) {\n return\n }\n this.yellowLow = Math.round(\n (limitsSettings[1] - limitsSettings[0]) / this.scale,\n )\n this.yellowHigh = Math.round(\n (limitsSettings[3] - limitsSettings[2]) / this.scale,\n )\n if (limitsSettings.length > 4) {\n this.greenLow = Math.round(\n (limitsSettings[4] - limitsSettings[1]) / this.scale,\n )\n this.greenHigh = Math.round(\n (limitsSettings[2] - limitsSettings[5]) / this.scale,\n )\n this.blue = Math.round(\n 100 -\n this.redLow -\n this.yellowLow -\n this.greenLow -\n this.greenHigh -\n this.yellowHigh -\n this.redHigh,\n )\n } else {\n this.greenLow = Math.round(\n 100 - this.redLow - this.yellowLow - this.yellowHigh - this.redHigh,\n )\n this.greenHigh = 0\n this.blue = 0\n }\n },\n getCurrentLimitsSet: function () {\n this.api.get_limits_set().then((result) => {\n this.currentLimitsSet = result\n })\n },\n },\n}\n"],"names":["BarColumn","Widget","value","limits","OpenC3Api","data","setting","limitsSettings","divisor","lowValue","result"],"mappings":"4JAqBAA,EAAe,CACb,OAAQ,CAACC,EAAAA,MAAM,EACf,MAAO,CACL,MAAO,CACL,SAAU,KACV,SAAU,KACV,OAAQ,EACR,UAAW,EACX,SAAU,EACV,UAAW,EACX,WAAY,EACZ,QAAS,EACT,KAAM,EACN,IAAK,KACL,eAAgB,CACd,QAAS,CAAA,CACjB,EACM,iBAAkB,UAClB,0BAA2B,IACjC,CACA,EACE,SAAU,CACR,SAAU,UAAY,CACpB,IAAIC,EAAQ,KAAK,aAAa,KAAK,OAAO,EAAE,CAAC,EACzCC,EAAS,KAAK,aAChB,KAAK,eAAe,KAAK,iBAAiB,CAClD,EACM,YAAK,WAAWA,CAAM,EACf,CACL,WAAY,KAAK,OAAS,KAC1B,UAAW,KAAK,MAAQ,KACxB,qBAAsB,KAAK,OAAS,EAAI,KACxC,aAAc,KAAK,aAAaD,EAAOC,CAAM,EAAI,IACjD,iBAAkB,KAAK,OAAS,IAChC,kBAAmB,KAAK,QAAU,IAClC,oBAAqB,KAAK,UAAY,IACtC,qBAAsB,KAAK,WAAa,IACxC,mBAAoB,KAAK,SAAW,IACpC,oBAAqB,KAAK,UAAY,IACtC,eAAgB,KAAK,KAAO,GACpC,CACA,EACI,kBAAmB,UAAY,CA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G1BL,EAAM,IACR,OAAIA,EAAM,MAAQ,YACT,EAGA,IAGX,GAAIA,EAAQ,KAAK,IACf,MAAO,GACF,GAAIA,EAAQ,KAAK,IACtB,MAAO,KACF,CACL,MAAMQ,EAAS,UAAUR,EAAQO,GAAY,KAAK,KAAK,EACvD,OAAIC,EAAS,IACJ,IACEA,EAAS,EACX,EAEAA,CAEjB,CACA,EACI,WAAWH,EAAgB,CACpBA,IAGL,KAAK,UAAY,KAAK,OACnBA,EAAe,CAAC,EAAIA,EAAe,CAAC,GAAK,KAAK,KACvD,EACM,KAAK,WAAa,KAAK,OACpBA,EAAe,CAAC,EAAIA,EAAe,CAAC,GAAK,KAAK,KACvD,EACUA,EAAe,OAAS,GAC1B,KAAK,SAAW,KAAK,OAClBA,EAAe,CAAC,EAAIA,EAAe,CAAC,GAAK,KAAK,KACzD,EACQ,KAAK,UAAY,KAAK,OACnBA,EAAe,CAAC,EAAIA,EAAe,CAAC,GAAK,KAAK,KACzD,EACQ,KAAK,KAAO,KAAK,MACf,IACE,KAAK,OACL,KAAK,UACL,KAAK,SACL,KAAK,UACL,KAAK,WACL,KAAK,OACjB,IAEQ,KAAK,SAAW,KAAK,MACnB,IAAM,KAAK,OAAS,KAAK,UAAY,KAAK,WAAa,KAAK,OACtE,EACQ,KAAK,UAAY,EACjB,KAAK,KAAO,GAEpB,EACI,oBAAqB,UAAY,CAC/B,KAAK,IAAI,eAAc,EAAG,KAAMG,GAAW,CACzC,KAAK,iBAAmBA,CAChC,CAAO,CACP,CACA,CACA"}
1
+ {"version":3,"file":"BarColumn-DtRNuOpa.cjs","sources":["../src/widgets/BarColumn.js"],"sourcesContent":["/*\n# Copyright 2024 OpenC3, Inc.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n*/\n\nimport Widget from './Widget'\nimport { OpenC3Api } from '@openc3/js-common/services'\n\nexport default {\n mixins: [Widget],\n data() {\n return {\n minValue: null,\n maxValue: null,\n redLow: 0,\n yellowLow: 0,\n greenLow: 0,\n greenHigh: 0,\n yellowHigh: 0,\n redHigh: 0,\n blue: 0,\n api: null,\n limitsSettings: {\n DEFAULT: [],\n },\n currentLimitsSet: 'DEFAULT',\n currentSetRefreshInterval: null,\n }\n },\n computed: {\n cssProps: function () {\n let value = this.screenValues[this.valueId][0]\n let limits = this.modifyLimits(\n this.limitsSettings[this.selectedLimitsSet],\n )\n this.calcLimits(limits)\n return {\n '--height': this.height + 'px',\n '--width': this.width + 'px',\n '--container-height': this.height - 5 + 'px',\n '--position': this.calcPosition(value, limits) + '%',\n '--redlow-width': this.redLow + '%',\n '--redhigh-width': this.redHigh + '%',\n '--yellowlow-width': this.yellowLow + '%',\n '--yellowhigh-width': this.yellowHigh + '%',\n '--greenlow-width': this.greenLow + '%',\n '--greenhigh-width': this.greenHigh + '%',\n '--blue-width': this.blue + '%',\n }\n },\n selectedLimitsSet: function () {\n return this.limitsSettings.hasOwnProperty(this.currentLimitsSet)\n ? this.currentLimitsSet\n : 'DEFAULT'\n },\n },\n created() {\n this.api = new OpenC3Api()\n this.api\n .get_limits(this.parameters[0], this.parameters[1], this.parameters[2])\n .then((data) => {\n this.limitsSettings = data\n })\n this.getCurrentLimitsSet()\n this.currentSetRefreshInterval = setInterval(\n this.getCurrentLimitsSet,\n 60 * 1000,\n )\n\n this.appliedSettings.forEach((setting) => {\n if (setting[0] === 'MIN_VALUE') {\n this.minValue = parseInt(setting[1])\n }\n if (setting[0] === 'MAX_VALUE') {\n this.maxValue = parseInt(setting[1])\n }\n })\n this.width = this.setWidth(this.parameters[4], 'px', this.width)\n this.height = this.setHeight(this.parameters[5], 'px', this.height)\n // Always pass CONVERTED so we can calculate the value against the limits (in converted units)\n this.valueId = `${this.parameters[0]}__${this.parameters[1]}__${this.parameters[2]}__CONVERTED`\n\n this.$emit('addItem', this.valueId)\n },\n destroyed() {\n this.$emit('deleteItem', this.valueId)\n clearInterval(this.currentSetRefreshInterval)\n },\n methods: {\n modifyLimits(limitsSettings) {\n if (!limitsSettings) {\n return\n }\n // By default the red bars take 10% of the display\n this.redLow = 10\n this.redHigh = 10\n\n // Modify values to respect the user defined minimum\n if (this.minValue !== null) {\n if (limitsSettings[0] <= this.minValue) {\n limitsSettings[0] = this.minValue\n // No red low will be displayed\n this.redLow = 0\n }\n if (limitsSettings[1] <= this.minValue) {\n limitsSettings[1] = this.minValue\n }\n if (limitsSettings[2] <= this.minValue) {\n limitsSettings[2] = this.minValue\n }\n if (limitsSettings[3] <= this.minValue) {\n limitsSettings[3] = this.minValue\n }\n if (limitsSettings.length > 4 && limitsSettings[4] <= this.minValue) {\n limitsSettings[4] = this.minValue\n }\n if (limitsSettings.length > 4 && limitsSettings[5] <= this.minValue) {\n limitsSettings[5] = this.minValue\n }\n }\n if (this.maxValue !== null) {\n if (limitsSettings[0] >= this.maxValue) {\n limitsSettings[0] = this.maxValue\n }\n if (limitsSettings[1] >= this.maxValue) {\n limitsSettings[1] = this.maxValue\n }\n if (limitsSettings[2] >= this.maxValue) {\n limitsSettings[2] = this.maxValue\n }\n if (limitsSettings[3] >= this.maxValue) {\n limitsSettings[3] = this.maxValue\n // No red high will be displayed\n this.redHigh = 0\n }\n if (limitsSettings.length > 4 && limitsSettings[4] >= this.maxValue) {\n limitsSettings[4] = this.maxValue\n }\n if (limitsSettings.length > 4 && limitsSettings[5] >= this.maxValue) {\n limitsSettings[5] = this.maxValue\n }\n }\n // If the red low matches yellow low there is no yellow low\n if (limitsSettings[0] == limitsSettings[1]) {\n this.yellowLow = 0\n }\n // If the red high matches yellow high there is no yellow high\n if (limitsSettings[2] == limitsSettings[3]) {\n this.yellowHigh = 0\n }\n\n let divisor = 80\n if (this.redLow == 0) {\n divisor += 10\n }\n if (this.redHigh == 0) {\n divisor += 10\n }\n this.scale = (limitsSettings[3] - limitsSettings[0]) / divisor\n\n return limitsSettings\n },\n calcPosition(value, limitsSettings) {\n if (!value || !limitsSettings) {\n return\n }\n let lowValue = limitsSettings[0] - 10 * this.scale\n if (this.minValue && this.minValue == limitsSettings[0]) {\n lowValue = limitsSettings[0]\n }\n let highValue = limitsSettings[3] - 10 * this.scale\n if (this.maxValue && this.maxValue == limitsSettings[3]) {\n highValue = limitsSettings[3]\n }\n\n if (value.raw) {\n if (value.raw === '-Infinity') {\n return 0\n } else {\n // NaN and Infinity\n return 100\n }\n }\n if (value < this.min) {\n return 0\n } else if (value > this.max) {\n return 100\n } else {\n const result = parseInt((value - lowValue) / this.scale)\n if (result > 100) {\n return 100\n } else if (result < 0) {\n return 0\n } else {\n return result\n }\n }\n },\n calcLimits(limitsSettings) {\n if (!limitsSettings) {\n return\n }\n this.yellowLow = Math.round(\n (limitsSettings[1] - limitsSettings[0]) / this.scale,\n )\n this.yellowHigh = Math.round(\n (limitsSettings[3] - limitsSettings[2]) / this.scale,\n )\n if (limitsSettings.length > 4) {\n this.greenLow = Math.round(\n (limitsSettings[4] - limitsSettings[1]) / this.scale,\n )\n this.greenHigh = Math.round(\n (limitsSettings[2] - limitsSettings[5]) / this.scale,\n )\n this.blue = Math.round(\n 100 -\n this.redLow -\n this.yellowLow -\n this.greenLow -\n this.greenHigh -\n this.yellowHigh -\n this.redHigh,\n )\n } else {\n this.greenLow = Math.round(\n 100 - this.redLow - this.yellowLow - this.yellowHigh - this.redHigh,\n )\n this.greenHigh = 0\n this.blue = 0\n }\n },\n getCurrentLimitsSet: function () {\n this.api.get_limits_set().then((result) => {\n this.currentLimitsSet = result\n })\n },\n },\n}\n"],"names":["BarColumn","Widget","value","limits","OpenC3Api","data","setting","limitsSettings","divisor","lowValue","result"],"mappings":"4JAqBAA,EAAe,CACb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AAC,EAAIA,EAAe,CAAC,GAAK,KAAK,KACzD,EACQ,KAAK,UAAY,KAAK,OACnBA,EAAe,CAAC,EAAIA,EAAe,CAAC,GAAK,KAAK,KACzD,EACQ,KAAK,KAAO,KAAK,MACf,IACE,KAAK,OACL,KAAK,UACL,KAAK,SACL,KAAK,UACL,KAAK,WACL,KAAK,OACjB,IAEQ,KAAK,SAAW,KAAK,MACnB,IAAM,KAAK,OAAS,KAAK,UAAY,KAAK,WAAa,KAAK,OACtE,EACQ,KAAK,UAAY,EACjB,KAAK,KAAO,GAEhB,EACA,oBAAqB,UAAY,CAC/B,KAAK,IAAI,eAAc,EAAG,KAAMG,GAAW,CACzC,KAAK,iBAAmBA,CAC1B,CAAC,CACH,CACJ,CACA"}
@@ -1 +1 @@
1
- {"version":3,"file":"BlockWidget-DGH3Zz5p.js","sources":["../src/widgets/BlockWidget.vue"],"sourcesContent":["<!--\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# Modified by OpenC3, Inc.\n# All changes Copyright 2024, OpenC3, Inc.\n# All Rights Reserved\n#\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n-->\n\n<template>\n <div class=\"block-widget-container\">\n <v-textarea\n variant=\"solo\"\n density=\"compact\"\n readonly\n no-resize\n hide-details\n :rows=\"rows\"\n :width=\"width\"\n :model-value=\"_value\"\n :class=\"valueClass\"\n :style=\"[computedStyle, aging]\"\n data-test=\"valueText\"\n @contextmenu=\"showContextMenu\"\n />\n <v-menu v-model=\"contextMenuShown\" :target=\"[x, y]\">\n <v-list>\n <v-list-item\n v-for=\"(item, index) in contextMenuOptions\"\n :key=\"index\"\n @click.stop=\"item.action\"\n >\n <v-list-item-title>{{ item.title }}</v-list-item-title>\n </v-list-item>\n </v-list>\n </v-menu>\n\n <details-dialog\n :target-name=\"parameters[0]\"\n :packet-name=\"parameters[1]\"\n :item-name=\"parameters[2]\"\n v-model=\"viewDetails\"\n />\n </div>\n</template>\n\n<script>\nimport { DetailsDialog } from '@/components'\nimport VWidget from './VWidget'\nimport 'sprintf-js'\n\nexport default {\n components: {\n DetailsDialog,\n },\n data: function () {\n return {\n width: 400,\n height: 400,\n bytesPerWord: 4,\n wordsPerRow: 4,\n addrFormat: null,\n formatter: '%02X',\n }\n },\n mixins: [VWidget],\n computed: {\n aging() {\n return {\n '--aging': this.grayLevel,\n }\n },\n rows: function () {\n // hack to set height since vuetify 3 removed the ability to set the\n // <textarea>'s height by px and I can't get styling the element to work, either\n const paddingHeight = 16 // px\n const rowHeight = 24 // px\n return (this.height - paddingHeight) / rowHeight\n },\n },\n created: function () {\n this.width = this.setWidth(this.parameters[3], 'px', this.width)\n this.height = this.setHeight(this.parameters[4], 'px', this.height)\n if (this.parameters[5]) {\n this.formatter = this.parameters[5]\n }\n if (this.parameters[6]) {\n this.bytesPerWord = parseInt(this.parameters[6])\n }\n if (this.parameters[7]) {\n this.wordsPerRow = parseInt(this.parameters[7])\n }\n if (this.parameters[8]) {\n this.addrFormat = this.parameters[8]\n }\n // parameter[9] is the type ... see getType()\n },\n methods: {\n getType: function () {\n let type = 'RAW'\n if (this.parameters[9]) {\n type = this.parameters[9]\n }\n return type\n },\n formatValue: function (data) {\n let text = ''\n if (data && data.raw) {\n let space = ' '\n let newLine = '\\n'\n\n let byteCount = 0\n let addr = 0\n const bytesPerRow = this.bytesPerWord * this.wordsPerRow\n\n for (const value of data.raw) {\n if (this.addrFormat && byteCount === 0) {\n text += sprintf(this.addrFormat, addr)\n addr += bytesPerRow\n }\n text += sprintf(this.formatter, value)\n byteCount += 1\n if (byteCount % bytesPerRow === 0) {\n byteCount = 0\n text += newLine\n } else if (byteCount % this.bytesPerWord === 0) {\n text += space\n }\n }\n } else {\n text = data\n }\n return text\n },\n },\n}\n</script>\n\n<style scoped>\n.block-widget-container :deep(.v-input__slot) {\n background: rgba(var(--aging), var(--aging), var(--aging), 1) !important;\n}\n.v-textarea :deep(textarea) {\n font-family: 'Courier New', Courier, monospace;\n}\n.value :deep(div) {\n min-height: 24px !important;\n display: flex !important;\n align-items: center !important;\n}\n.block-widget-container :deep(.v-field__loader) {\n display: none !important;\n}\n.block-widget-container :deep(textarea) {\n padding-right: 0 !important;\n padding-left: 12px !important;\n}\n.openc3-green :deep(input) {\n color: rgb(0, 200, 0);\n}\n.openc3-yellow :deep(input) {\n color: rgb(255, 220, 0);\n}\n.openc3-red :deep(input) {\n color: rgb(255, 45, 45);\n}\n.openc3-blue :deep(input) {\n color: rgb(0, 153, 255);\n}\n.openc3-purple :deep(input) {\n color: rgb(200, 0, 200);\n}\n.openc3-black :deep(input) {\n color: black;\n}\n.openc3-white :deep(input) {\n color: white;\n}\n</style>\n"],"names":["_sfc_main","DetailsDialog","VWidget","type","data","text","space","newLine","byteCount","addr","bytesPerRow","value","_hoisted_1","_openBlock","_createElementBlock","_createVNode","_component_v_textarea","$options","_ctx","_normalizeClass","_normalizeStyle","_component_v_menu","_cache","$event","_withCtx","_component_v_list","_Fragment","_renderList","item","index","_createBlock","_component_v_list_item","_withModifiers","_component_v_list_item_title","_createTextVNode","_toDisplayString","_component_details_dialog"],"mappings":";;;;;;AAgEA,MAAKA,IAAU;AAAA,EACb,YAAY;AAAA,IACV,eAAAC;AAAA;EAEF,MAAM,WAAY;AAChB,WAAO;AAAA,MACL,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,cAAc;AAAA,MACd,aAAa;AAAA,MACb,YAAY;AAAA,MACZ,WAAW;AAAA,IACb;AAAA;EAEF,QAAQ,CAACC,CAAO;AAAA,EAChB,UAAU;AAAA,IACR,QAAQ;AACN,aAAO;AAAA,QACL,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ArD5B,YAsDeA,EAAA;AAAA,MAtDf,uBAAAI,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAsDeL,EAAA,cAAWK;AAAA;;;;"}
1
+ {"version":3,"file":"BlockWidget-DGH3Zz5p.js","sources":["../src/widgets/BlockWidget.vue"],"sourcesContent":["<!--\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# Modified by OpenC3, Inc.\n# All changes Copyright 2024, OpenC3, Inc.\n# All Rights Reserved\n#\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n-->\n\n<template>\n <div class=\"block-widget-container\">\n <v-textarea\n variant=\"solo\"\n density=\"compact\"\n readonly\n no-resize\n hide-details\n :rows=\"rows\"\n :width=\"width\"\n :model-value=\"_value\"\n :class=\"valueClass\"\n :style=\"[computedStyle, aging]\"\n data-test=\"valueText\"\n @contextmenu=\"showContextMenu\"\n />\n <v-menu v-model=\"contextMenuShown\" :target=\"[x, y]\">\n <v-list>\n <v-list-item\n v-for=\"(item, index) in contextMenuOptions\"\n :key=\"index\"\n @click.stop=\"item.action\"\n >\n <v-list-item-title>{{ item.title }}</v-list-item-title>\n </v-list-item>\n </v-list>\n </v-menu>\n\n <details-dialog\n :target-name=\"parameters[0]\"\n :packet-name=\"parameters[1]\"\n :item-name=\"parameters[2]\"\n v-model=\"viewDetails\"\n />\n </div>\n</template>\n\n<script>\nimport { DetailsDialog } from '@/components'\nimport VWidget from './VWidget'\nimport 'sprintf-js'\n\nexport default {\n components: {\n DetailsDialog,\n },\n data: function () {\n return {\n width: 400,\n height: 400,\n bytesPerWord: 4,\n wordsPerRow: 4,\n addrFormat: null,\n formatter: '%02X',\n }\n },\n mixins: [VWidget],\n computed: {\n aging() {\n return {\n '--aging': this.grayLevel,\n }\n },\n rows: function () {\n // hack to set height since vuetify 3 removed the ability to set the\n // <textarea>'s height by px and I can't get styling the element to work, either\n const paddingHeight = 16 // px\n const rowHeight = 24 // px\n return (this.height - paddingHeight) / rowHeight\n },\n },\n created: function () {\n this.width = this.setWidth(this.parameters[3], 'px', this.width)\n this.height = this.setHeight(this.parameters[4], 'px', this.height)\n if (this.parameters[5]) {\n this.formatter = this.parameters[5]\n }\n if (this.parameters[6]) {\n this.bytesPerWord = parseInt(this.parameters[6])\n }\n if (this.parameters[7]) {\n this.wordsPerRow = parseInt(this.parameters[7])\n }\n if (this.parameters[8]) {\n this.addrFormat = this.parameters[8]\n }\n // parameter[9] is the type ... see getType()\n },\n methods: {\n getType: function () {\n let type = 'RAW'\n if (this.parameters[9]) {\n type = this.parameters[9]\n }\n return type\n },\n formatValue: function (data) {\n let text = ''\n if (data && data.raw) {\n let space = ' '\n let newLine = '\\n'\n\n let byteCount = 0\n let addr = 0\n const bytesPerRow = this.bytesPerWord * this.wordsPerRow\n\n for (const value of data.raw) {\n if (this.addrFormat && byteCount === 0) {\n text += sprintf(this.addrFormat, addr)\n addr += bytesPerRow\n }\n text += sprintf(this.formatter, value)\n byteCount += 1\n if (byteCount % bytesPerRow === 0) {\n byteCount = 0\n text += newLine\n } else if (byteCount % this.bytesPerWord === 0) {\n text += space\n }\n }\n } else {\n text = data\n }\n return text\n },\n },\n}\n</script>\n\n<style scoped>\n.block-widget-container :deep(.v-input__slot) {\n background: rgba(var(--aging), var(--aging), var(--aging), 1) !important;\n}\n.v-textarea :deep(textarea) {\n font-family: 'Courier New', Courier, monospace;\n}\n.value :deep(div) {\n min-height: 24px !important;\n display: flex !important;\n align-items: center !important;\n}\n.block-widget-container :deep(.v-field__loader) {\n display: none !important;\n}\n.block-widget-container :deep(textarea) {\n padding-right: 0 !important;\n padding-left: 12px !important;\n}\n.openc3-green :deep(input) {\n color: rgb(0, 200, 0);\n}\n.openc3-yellow :deep(input) {\n color: rgb(255, 220, 0);\n}\n.openc3-red :deep(input) {\n color: rgb(255, 45, 45);\n}\n.openc3-blue :deep(input) {\n color: rgb(0, 153, 255);\n}\n.openc3-purple :deep(input) {\n color: rgb(200, 0, 200);\n}\n.openc3-black :deep(input) {\n color: black;\n}\n.openc3-white :deep(input) {\n color: white;\n}\n</style>\n"],"names":["_sfc_main","DetailsDialog","VWidget","type","data","text","space","newLine","byteCount","addr","bytesPerRow","value","_hoisted_1","_openBlock","_createElementBlock","_createVNode","_component_v_textarea","$options","_ctx","_normalizeClass","_normalizeStyle","_component_v_menu","_cache","$event","_withCtx","_component_v_list","_Fragment","_renderList","item","index","_createBlock","_component_v_list_item","_withModifiers","_component_v_list_item_title","_createTextVNode","_toDisplayString","_component_details_dialog"],"mappings":";;;;;;AAgEA,MAAKA,IAAU;AAAA,EACb,YAAY;AAAA,IACV,eAAAC;AAAA;EAEF,MAAM,WAAY;AAChB,WAAO;AAAA,MACL,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,cAAc;AAAA,MACd,aAAa;AAAA,MACb,YAAY;AAAA,MACZ,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EACA,QAAQ,CAACC,CAAO;AAAA,EAChB,UAAU;AAAA,IACR,QAAQ;AACN,aAAO;AAAA,QACL,WAAW,KAAK;AAAA,MAClB;AAAA,IACF;AAAA,IACA,MAAM,WAAY;AAKhB,cAAQ,KAAK,SAAS,MAAiB;AAAA,IACzC;AAAA;EAEF,SAAS,WAAY;AACnB,SAAK,QAAQ,KAAK,SAAS,KAAK,WAAW,CAAC,GAAG,MAAM,KAAK,KAAK,GAC/D,KAAK,SAAS,KAAK,UAAU,KAAK,WAAW,CAAC,GAAG,MAAM,KAAK,MAAM,GAC9D,KAAK,WAAW,CAAC,MACnB,KAAK,YAAY,KAAK,WAAW,CAAC,IAEhC,KAAK,W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A;AAAA,MAC7B,aAAU;AAAA,MACT,eAAaC,EAAA;AAAA;IAEhBH,EAUSM,GAAA;AAAA,MAhDb,YAsCqBH,EAAA;AAAA,MAtCrB,uBAAAI,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAsCqBL,EAAA,mBAAgBK;AAAA,MAAG,QAAM,CAAGL,EAAA,GAAGA,EAAA,CAAC;AAAA;MAtCrD,SAAAM,EAuCM,MAQS;AAAA,QARTT,EAQSU,GAAA,MAAA;AAAA,UA/Cf,SAAAD,EAyCU,MAA2C;AAAA,aAD7CX,EAAA,EAAA,GAAAC,EAMcY,SA9CtBC,EAyCkCT,EAAA,oBAzClC,CAyCkBU,GAAMC,YADhBC,EAMcC,GAAA;AAAA,cAJX,KAAKF;AAAA,cACL,SA3CXG,EA2CuBJ,EAAK,QAAM,CAAA,MAAA,CAAA;AAAA;cA3ClC,SAAAJ,EA6CU,MAAuD;AAAA,gBAAvDT,EAAuDkB,GAAA,MAAA;AAAA,kBA7CjE,SAAAT,EA6C6B,MAAgB;AAAA,oBA7C7CU,EAAAC,EA6CgCP,EAAK,KAAK,GAAA,CAAA;AAAA;kBA7C1C,GAAA;AAAA;;cAAA,GAAA;AAAA;;UAAA,GAAA;AAAA;;MAAA,GAAA;AAAA;IAkDIb,EAKEqB,GAAA;AAAA,MAJC,eAAalB,EAAA,WAAU,CAAA;AAAA,MACvB,eAAaA,EAAA,WAAU,CAAA;AAAA,MACvB,aAAWA,EAAA,WAAU,CAAA;AAAA,MArD5B,YAsDeA,EAAA;AAAA,MAtDf,uBAAAI,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAsDeL,EAAA,cAAWK;AAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"BlockWidget-DOY5lVfa.cjs","sources":["../src/widgets/BlockWidget.vue"],"sourcesContent":["<!--\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# Modified by OpenC3, Inc.\n# All changes Copyright 2024, OpenC3, Inc.\n# All Rights Reserved\n#\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n-->\n\n<template>\n <div class=\"block-widget-container\">\n <v-textarea\n variant=\"solo\"\n density=\"compact\"\n readonly\n no-resize\n hide-details\n :rows=\"rows\"\n :width=\"width\"\n :model-value=\"_value\"\n :class=\"valueClass\"\n :style=\"[computedStyle, aging]\"\n data-test=\"valueText\"\n @contextmenu=\"showContextMenu\"\n />\n <v-menu v-model=\"contextMenuShown\" :target=\"[x, y]\">\n <v-list>\n <v-list-item\n v-for=\"(item, index) in contextMenuOptions\"\n :key=\"index\"\n @click.stop=\"item.action\"\n >\n <v-list-item-title>{{ item.title }}</v-list-item-title>\n </v-list-item>\n </v-list>\n </v-menu>\n\n <details-dialog\n :target-name=\"parameters[0]\"\n :packet-name=\"parameters[1]\"\n :item-name=\"parameters[2]\"\n v-model=\"viewDetails\"\n />\n </div>\n</template>\n\n<script>\nimport { DetailsDialog } from '@/components'\nimport VWidget from './VWidget'\nimport 'sprintf-js'\n\nexport default {\n components: {\n DetailsDialog,\n },\n data: function () {\n return {\n width: 400,\n height: 400,\n bytesPerWord: 4,\n wordsPerRow: 4,\n addrFormat: null,\n formatter: '%02X',\n }\n },\n mixins: [VWidget],\n computed: {\n aging() {\n return {\n '--aging': this.grayLevel,\n }\n },\n rows: function () {\n // hack to set height since vuetify 3 removed the ability to set the\n // <textarea>'s height by px and I can't get styling the element to work, either\n const paddingHeight = 16 // px\n const rowHeight = 24 // px\n return (this.height - paddingHeight) / rowHeight\n },\n },\n created: function () {\n this.width = this.setWidth(this.parameters[3], 'px', this.width)\n this.height = this.setHeight(this.parameters[4], 'px', this.height)\n if (this.parameters[5]) {\n this.formatter = this.parameters[5]\n }\n if (this.parameters[6]) {\n this.bytesPerWord = parseInt(this.parameters[6])\n }\n if (this.parameters[7]) {\n this.wordsPerRow = parseInt(this.parameters[7])\n }\n if (this.parameters[8]) {\n this.addrFormat = this.parameters[8]\n }\n // parameter[9] is the type ... see getType()\n },\n methods: {\n getType: function () {\n let type = 'RAW'\n if (this.parameters[9]) {\n type = this.parameters[9]\n }\n return type\n },\n formatValue: function (data) {\n let text = ''\n if (data && data.raw) {\n let space = ' '\n let newLine = '\\n'\n\n let byteCount = 0\n let addr = 0\n const bytesPerRow = this.bytesPerWord * this.wordsPerRow\n\n for (const value of data.raw) {\n if (this.addrFormat && byteCount === 0) {\n text += sprintf(this.addrFormat, addr)\n addr += bytesPerRow\n }\n text += sprintf(this.formatter, value)\n byteCount += 1\n if (byteCount % bytesPerRow === 0) {\n byteCount = 0\n text += newLine\n } else if (byteCount % this.bytesPerWord === 0) {\n text += space\n }\n }\n } else {\n text = data\n }\n return text\n },\n },\n}\n</script>\n\n<style scoped>\n.block-widget-container :deep(.v-input__slot) {\n background: rgba(var(--aging), var(--aging), var(--aging), 1) !important;\n}\n.v-textarea :deep(textarea) {\n font-family: 'Courier New', Courier, monospace;\n}\n.value :deep(div) {\n min-height: 24px !important;\n display: flex !important;\n align-items: center !important;\n}\n.block-widget-container :deep(.v-field__loader) {\n display: none !important;\n}\n.block-widget-container :deep(textarea) {\n padding-right: 0 !important;\n padding-left: 12px !important;\n}\n.openc3-green :deep(input) {\n color: rgb(0, 200, 0);\n}\n.openc3-yellow :deep(input) {\n color: rgb(255, 220, 0);\n}\n.openc3-red :deep(input) {\n color: rgb(255, 45, 45);\n}\n.openc3-blue :deep(input) {\n color: rgb(0, 153, 255);\n}\n.openc3-purple :deep(input) {\n color: rgb(200, 0, 200);\n}\n.openc3-black :deep(input) {\n color: black;\n}\n.openc3-white :deep(input) {\n color: white;\n}\n</style>\n"],"names":["_sfc_main","DetailsDialog","VWidget","type","data","text","space","newLine","byteCount","addr","bytesPerRow","value","_hoisted_1","_openBlock","_createElementBlock","_createVNode","_component_v_textarea","$options","_ctx","_normalizeClass","_normalizeStyle","_component_v_menu","_cache","$event","_withCtx","_component_v_list","_Fragment","_renderList","item","index","_createBlock","_component_v_list_item","_withModifiers","_component_v_list_item_title","_createTextVNode","_toDisplayString","_component_details_dialog"],"mappings":"4VAgEKA,EAAU,CACb,WAAY,eACVC,EAAAA,eAEF,KAAM,UAAY,CAChB,MAAO,CACL,MAAO,IACP,OAAQ,IACR,aAAc,EACd,YAAa,EACb,WAAY,KACZ,UAAW,MACb,GAEF,OAAQ,CAACC,EAAAA,OAAO,EAChB,SAAU,CACR,OAAQ,CACN,MAAO,CACL,UAAW,KAAK,SAClB,GAEF,KAAM,UAAY,CAKhB,OAAQ,KAAK,OAAS,IAAiB,KAG3C,QAAS,UAAY,CACnB,KAAK,MAAQ,KAAK,SAAS,KAAK,WAAW,CAAC,EAAG,KAAM,KAAK,KAAK,EAC/D,KAAK,OAAS,KAAK,UAAU,KAAK,WAAW,CAAC,EAAG,KAAM,KAAK,MAAM,EAC9D,KAAK,WAAW,CAAC,IACnB,KAAK,UAAY,KAAK,WAAW,CAAC,GAEhC,KAAK,WAAW,CAAC,IACnB,KAAK,aAAe,SAAS,KAAK,WAAW,CAAC,CAAC,GAE7C,KAAK,WAAW,CAAC,IACnB,KAAK,YAAc,SAAS,KAAK,WAAW,CAAC,CAAC,GAE5C,KAAK,WAAW,CAAC,IACnB,KAAK,WAAa,KAAK,WAAW,CAAC,IAIvC,QAAS,CACP,QAAS,UAAY,CACnB,IAAIC,EAAO,MACX,OAAI,KAAK,WAAW,CAAC,IACnBA,EAAO,KAAK,WAAW,CAAC,GAEnBA,GAET,YAAa,SAAUC,EAAM,CAC3B,IAAIC,EAAO,GACX,GAAID,GAAQA,EAAK,IAAK,CACpB,IAAIE,EAAQ,IACRC,EA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AJ,EAAAA,QA6CU,IAAuD,CAAvDT,EAAAA,YAAuDkB,EAAA,KAAA,CA7CjE,QAAAT,EAAAA,QA6C6B,IAAgB,CA7C7CU,EAAAA,gBAAAC,EAAAA,gBA6CgCP,EAAK,KAAK,EAAA,CAAA,IA7C1C,EAAA,WAAA,EAAA,+BAAA,EAAA,MAAA,EAAA,8BAkDIb,EAAAA,YAKEqB,EAAA,CAJC,cAAalB,EAAA,WAAU,CAAA,EACvB,cAAaA,EAAA,WAAU,CAAA,EACvB,YAAWA,EAAA,WAAU,CAAA,EArD5B,WAsDeA,EAAA,YAtDf,sBAAAI,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAsDeL,EAAA,YAAWK"}
1
+ {"version":3,"file":"BlockWidget-DOY5lVfa.cjs","sources":["../src/widgets/BlockWidget.vue"],"sourcesContent":["<!--\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# Modified by OpenC3, Inc.\n# All changes Copyright 2024, OpenC3, Inc.\n# All Rights Reserved\n#\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n-->\n\n<template>\n <div class=\"block-widget-container\">\n <v-textarea\n variant=\"solo\"\n density=\"compact\"\n readonly\n no-resize\n hide-details\n :rows=\"rows\"\n :width=\"width\"\n :model-value=\"_value\"\n :class=\"valueClass\"\n :style=\"[computedStyle, aging]\"\n data-test=\"valueText\"\n @contextmenu=\"showContextMenu\"\n />\n <v-menu v-model=\"contextMenuShown\" :target=\"[x, y]\">\n <v-list>\n <v-list-item\n v-for=\"(item, index) in contextMenuOptions\"\n :key=\"index\"\n @click.stop=\"item.action\"\n >\n <v-list-item-title>{{ item.title }}</v-list-item-title>\n </v-list-item>\n </v-list>\n </v-menu>\n\n <details-dialog\n :target-name=\"parameters[0]\"\n :packet-name=\"parameters[1]\"\n :item-name=\"parameters[2]\"\n v-model=\"viewDetails\"\n />\n </div>\n</template>\n\n<script>\nimport { DetailsDialog } from '@/components'\nimport VWidget from './VWidget'\nimport 'sprintf-js'\n\nexport default {\n components: {\n DetailsDialog,\n },\n data: function () {\n return {\n width: 400,\n height: 400,\n bytesPerWord: 4,\n wordsPerRow: 4,\n addrFormat: null,\n formatter: '%02X',\n }\n },\n mixins: [VWidget],\n computed: {\n aging() {\n return {\n '--aging': this.grayLevel,\n }\n },\n rows: function () {\n // hack to set height since vuetify 3 removed the ability to set the\n // <textarea>'s height by px and I can't get styling the element to work, either\n const paddingHeight = 16 // px\n const rowHeight = 24 // px\n return (this.height - paddingHeight) / rowHeight\n },\n },\n created: function () {\n this.width = this.setWidth(this.parameters[3], 'px', this.width)\n this.height = this.setHeight(this.parameters[4], 'px', this.height)\n if (this.parameters[5]) {\n this.formatter = this.parameters[5]\n }\n if (this.parameters[6]) {\n this.bytesPerWord = parseInt(this.parameters[6])\n }\n if (this.parameters[7]) {\n this.wordsPerRow = parseInt(this.parameters[7])\n }\n if (this.parameters[8]) {\n this.addrFormat = this.parameters[8]\n }\n // parameter[9] is the type ... see getType()\n },\n methods: {\n getType: function () {\n let type = 'RAW'\n if (this.parameters[9]) {\n type = this.parameters[9]\n }\n return type\n },\n formatValue: function (data) {\n let text = ''\n if (data && data.raw) {\n let space = ' '\n let newLine = '\\n'\n\n let byteCount = 0\n let addr = 0\n const bytesPerRow = this.bytesPerWord * this.wordsPerRow\n\n for (const value of data.raw) {\n if (this.addrFormat && byteCount === 0) {\n text += sprintf(this.addrFormat, addr)\n addr += bytesPerRow\n }\n text += sprintf(this.formatter, value)\n byteCount += 1\n if (byteCount % bytesPerRow === 0) {\n byteCount = 0\n text += newLine\n } else if (byteCount % this.bytesPerWord === 0) {\n text += space\n }\n }\n } else {\n text = data\n }\n return text\n },\n },\n}\n</script>\n\n<style scoped>\n.block-widget-container :deep(.v-input__slot) {\n background: rgba(var(--aging), var(--aging), var(--aging), 1) !important;\n}\n.v-textarea :deep(textarea) {\n font-family: 'Courier New', Courier, monospace;\n}\n.value :deep(div) {\n min-height: 24px !important;\n display: flex !important;\n align-items: center !important;\n}\n.block-widget-container :deep(.v-field__loader) {\n display: none !important;\n}\n.block-widget-container :deep(textarea) {\n padding-right: 0 !important;\n padding-left: 12px !important;\n}\n.openc3-green :deep(input) {\n color: rgb(0, 200, 0);\n}\n.openc3-yellow :deep(input) {\n color: rgb(255, 220, 0);\n}\n.openc3-red :deep(input) {\n color: rgb(255, 45, 45);\n}\n.openc3-blue :deep(input) {\n color: rgb(0, 153, 255);\n}\n.openc3-purple :deep(input) {\n color: rgb(200, 0, 200);\n}\n.openc3-black :deep(input) {\n color: black;\n}\n.openc3-white :deep(input) {\n color: white;\n}\n</style>\n"],"names":["_sfc_main","DetailsDialog","VWidget","type","data","text","space","newLine","byteCount","addr","bytesPerRow","value","_hoisted_1","_openBlock","_createElementBlock","_createVNode","_component_v_textarea","$options","_ctx","_normalizeClass","_normalizeStyle","_component_v_menu","_cache","$event","_withCtx","_component_v_list","_Fragment","_renderList","item","index","_createBlock","_component_v_list_item","_withModifiers","_component_v_list_item_title","_createTextVNode","_toDisplayString","_component_details_dialog"],"mappings":"4VAgEKA,EAAU,CACb,WAAY,eACVC,EAAAA,eAEF,KAAM,UAAY,CAChB,MAAO,CACL,MAAO,IACP,OAAQ,IACR,aAAc,EACd,YAAa,EACb,WAAY,KACZ,UAAW,MACb,CACF,EACA,OAAQ,CAACC,EAAAA,OAAO,EAChB,SAAU,CACR,OAAQ,CACN,MAAO,CACL,UAAW,KAAK,SAClB,CACF,EACA,KAAM,UAAY,CAKhB,OAAQ,KAAK,OAAS,IAAiB,EACzC,GAEF,QAAS,UAAY,CACnB,KAAK,MAAQ,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#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# Modified by OpenC3, Inc.\n# All changes Copyright 2022, OpenC3, Inc.\n# All Rights Reserved\n#\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n-->\n\n<template>\n <div>\n <v-btn class=\"ma-1\" color=\"primary\" :style=\"computedStyle\" @click=\"onClick\">\n {{ buttonText }}\n </v-btn>\n <v-dialog v-model=\"displaySendHazardous\" max-width=\"300\">\n <v-card>\n <v-card-title>Hazardous</v-card-title>\n <v-card-text>\n <div class=\"mx-1\">\n <v-row class=\"my-2\">\n <span> Warning: Command is Hazardous. Send? </span>\n </v-row>\n <v-row>\n <v-spacer />\n <v-btn @click=\"cancelHazardousCmd\" variant=\"outlined\">\n Cancel\n </v-btn>\n <v-btn @click=\"sendHazardousCmd\" class=\"bg-primary mx-1\">\n Send\n </v-btn>\n </v-row>\n </div>\n </v-card-text>\n </v-card>\n </v-dialog>\n <critical-cmd-dialog\n :uuid=\"criticalCmdUuid\"\n :cmdString=\"criticalCmdString\"\n :cmdUser=\"criticalCmdUser\"\n v-model=\"displayCriticalCmd\"\n />\n </div>\n</template>\n\n<script>\nimport { Api, OpenC3Api } from '@openc3/js-common/services'\nimport { CriticalCmdDialog } from '@/components'\nimport Widget from './Widget'\n\nexport default {\n mixins: [Widget],\n components: {\n CriticalCmdDialog,\n },\n data() {\n return {\n api: null,\n displaySendHazardous: false,\n lastCmd: '',\n criticalCmdUuid: null,\n criticalCmdString: null,\n criticalCmdUser: null,\n displayCriticalCmd: false,\n }\n },\n computed: {\n buttonText() {\n return this.parameters[0]\n },\n eval() {\n return this.parameters[1]\n },\n },\n created() {\n this.api = new OpenC3Api()\n },\n methods: {\n async onClick() {\n const lines = this.eval.split(';;')\n // Create local references to variables so users don't need to use 'this'\n const self = this\n const screen = this.screen\n const screenValues = this.screenValues\n const screenTimeZone = this.screenTimeZone\n const api = this.api\n const runScript = this.runScript\n if (\n self ||\n screen ||\n screenValues ||\n screenTimeZone ||\n api ||\n runScript\n ) {\n // Add a noop to preserve the variables in the if statement\n // from being removed by compiler optimizations\n this.$nextTick(() => {})\n }\n for (let i = 0; i < lines.length; i++) {\n try {\n const result = eval(lines[i].trim())\n if (result instanceof Promise) {\n await result\n }\n } catch (error) {\n // This text is in top_level.rb HazardousError.to_s\n if (error.message.includes('CriticalCmdError')) {\n this.criticalCmdUuid = error.object.data.instance_variables['@uuid']\n this.criticalCmdString =\n error.object.data.instance_variables['@cmd_string']\n this.criticalCmdUser =\n error.object.data.instance_variables['@username']\n this.displayCriticalCmd = true\n } else if (error.message.includes('is Hazardous')) {\n this.lastCmd = error.message.split('\\n').pop()\n this.displaySendHazardous = true\n while (this.displaySendHazardous) {\n await new Promise((resolve) => setTimeout(resolve, 500))\n }\n } else {\n // eslint-disable-next-line\n console.error(error)\n }\n }\n }\n },\n async sendHazardousCmd() {\n // TODO: This only handles basic cmd() calls in buttons, do we need to handle other? cmd_raw()?\n this.lastCmd = this.lastCmd.replace(\n 'cmd(',\n 'this.api.cmd_no_hazardous_check(',\n )\n\n try {\n const result = eval(this.lastCmd)\n\n if (result instanceof Promise) {\n await result\n }\n } catch (error) {\n // This text is in top_level.rb HazardousError.to_s\n if (error.message.includes('CriticalCmdError')) {\n this.criticalCmdUuid = error.object.data.instance_variables['@uuid']\n this.criticalCmdString =\n error.object.data.instance_variables['@cmd_string']\n this.criticalCmdUser =\n error.object.data.instance_variables['@username']\n this.displayCriticalCmd = true\n }\n }\n\n this.displaySendHazardous = false\n },\n cancelHazardousCmd() {\n this.displaySendHazardous = false\n },\n runScript(scriptName, openScript = true, env = {}) {\n let envArray = []\n for (const key in env) {\n envArray.push({ key: key, value: env[key], readonly: false })\n }\n Api.post(`/script-api/scripts/${scriptName}/run`, {\n data: { environment: envArray },\n }).then((response) => {\n if (openScript) {\n window.open(`/tools/scriptrunner/${response.data}`, '_blank')\n }\n })\n },\n },\n}\n</script>\n"],"names":["Widget","CriticalCmdDialog","OpenC3Api","error","resolve","scriptName","openScript","env","envArray","key","Api","response","_createElementBlock","_createVNode","_component_v_btn","_normalizeStyle","_ctx","$options","_withCtx","_createTextVNode","_toDisplayString","_component_v_dialog","$data","_cache","$event","_component_v_card","_component_v_card_title","_component_v_card_text","_createElementVNode","_component_v_row","_component_v_spacer","_component_critical_cmd_dialog"],"mappings":"ycA8DK,UAAU,CACb,OAAQ,CAACA,OAAAA,MAAM,EACf,WAAY,CACV,kBAAAC,kBAAAA,mBAEF,MAAO,CACL,MAAO,CACL,IAAK,KACL,qBAAsB,GACtB,QAAS,GACT,gBAAiB,KACjB,kBAAmB,KACnB,gBAAiB,KACjB,mBAAoB,EACtB,GAEF,SAAU,CACR,YAAa,CACX,OAAO,KAAK,WAAW,CAAC,GAE1B,MAAO,CACL,OAAO,KAAK,WAAW,CAAC,IAG5B,SAAU,CACR,KAAK,IAAM,IAAIC,0EAAAA,IAEjB,QAAS,CACP,MAAM,SAAU,CACd,MAAM,MAAQ,KAAK,KAAK,MAAM,IAAI,EAE5B,KAAO,KACP,OAAS,KAAK,OACd,aAAe,KAAK,aACpB,eAAiB,KAAK,eACtB,IAAM,KAAK,IACX,UAAY,KAAK,WAErB,MACA,QACA,cACA,gBACA,KACA,YAIA,KAAK,UAAU,IAAM,CAAA,CAAE,EAEzB,QAAS,EAAI,EAAG,EAAI,MAAM,OAAQ,IAChC,GAAI,CACF,MAAM,OAAS,KAAK,MAAM,CAAC,EAAE,KAAI,CAAE,EAC/B,kBAAkB,SACpB,MAAM,aAEDC,EAAO,CAEd,GAAIA,EAAM,QAAQ,SAAS,kBAAkB,EAC3C,KAAK,gBAAkBA,EAAM,OAAO,KAAK,mBAAmB,OAAO,EAC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A,YAEQC,EAAA,CAFA,QAAOG,EAAA,iBAAkB,MAAM,oBAxCrD,QAAAC,IAAAA,QAwCuE,IAEzDK,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,CA1CdJ,IAAAA,gBAwCuE,QAEzD,KA1Cd,EAAA,oBAAA,EAAA,QAAA,EAAA,MAAA,EAAA,MAAA,EAAA,qBAgDIN,IAAAA,YAKEkB,EAAA,CAJC,KAAMT,EAAA,gBACN,UAAWA,EAAA,kBACX,QAASA,EAAA,gBAnDhB,WAoDeA,EAAA,mBApDf,sBAAAC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAoDeF,EAAA,mBAAkBE"}
1
+ {"version":3,"file":"ButtonWidget-CFyZXGt6.cjs","sources":["../src/widgets/ButtonWidget.vue"],"sourcesContent":["<!--\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# Modified by OpenC3, Inc.\n# All changes Copyright 2022, OpenC3, Inc.\n# All Rights Reserved\n#\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n-->\n\n<template>\n <div>\n <v-btn class=\"ma-1\" color=\"primary\" :style=\"computedStyle\" @click=\"onClick\">\n {{ buttonText }}\n </v-btn>\n <v-dialog v-model=\"displaySendHazardous\" max-width=\"300\">\n <v-card>\n <v-card-title>Hazardous</v-card-title>\n <v-card-text>\n <div class=\"mx-1\">\n <v-row class=\"my-2\">\n <span> Warning: Command is Hazardous. Send? </span>\n </v-row>\n <v-row>\n <v-spacer />\n <v-btn @click=\"cancelHazardousCmd\" variant=\"outlined\">\n Cancel\n </v-btn>\n <v-btn @click=\"sendHazardousCmd\" class=\"bg-primary mx-1\">\n Send\n </v-btn>\n </v-row>\n </div>\n </v-card-text>\n </v-card>\n </v-dialog>\n <critical-cmd-dialog\n :uuid=\"criticalCmdUuid\"\n :cmdString=\"criticalCmdString\"\n :cmdUser=\"criticalCmdUser\"\n v-model=\"displayCriticalCmd\"\n />\n </div>\n</template>\n\n<script>\nimport { Api, OpenC3Api } from '@openc3/js-common/services'\nimport { CriticalCmdDialog } from '@/components'\nimport Widget from './Widget'\n\nexport default {\n mixins: [Widget],\n components: {\n CriticalCmdDialog,\n },\n data() {\n return {\n api: null,\n displaySendHazardous: false,\n lastCmd: '',\n criticalCmdUuid: null,\n criticalCmdString: null,\n criticalCmdUser: null,\n displayCriticalCmd: false,\n }\n },\n computed: {\n buttonText() {\n return this.parameters[0]\n },\n eval() {\n return this.parameters[1]\n },\n },\n created() {\n this.api = new OpenC3Api()\n },\n methods: {\n async onClick() {\n const lines = this.eval.split(';;')\n // Create local references to variables so users don't need to use 'this'\n const self = this\n const screen = this.screen\n const screenValues = this.screenValues\n const screenTimeZone = this.screenTimeZone\n const api = this.api\n const runScript = this.runScript\n if (\n self ||\n screen ||\n screenValues ||\n screenTimeZone ||\n api ||\n runScript\n ) {\n // Add a noop to preserve the variables in the if statement\n // from being removed by compiler optimizations\n this.$nextTick(() => {})\n }\n for (let i = 0; i < lines.length; i++) {\n try {\n const result = eval(lines[i].trim())\n if (result instanceof Promise) {\n await result\n }\n } catch (error) {\n // This text is in top_level.rb HazardousError.to_s\n if (error.message.includes('CriticalCmdError')) {\n this.criticalCmdUuid = error.object.data.instance_variables['@uuid']\n this.criticalCmdString =\n error.object.data.instance_variables['@cmd_string']\n this.criticalCmdUser =\n error.object.data.instance_variables['@username']\n this.displayCriticalCmd = true\n } else if (error.message.includes('is Hazardous')) {\n this.lastCmd = error.message.split('\\n').pop()\n this.displaySendHazardous = true\n while (this.displaySendHazardous) {\n await new Promise((resolve) => setTimeout(resolve, 500))\n }\n } else {\n // eslint-disable-next-line\n console.error(error)\n }\n }\n }\n },\n async sendHazardousCmd() {\n // TODO: This only handles basic cmd() calls in buttons, do we need to handle other? cmd_raw()?\n this.lastCmd = this.lastCmd.replace(\n 'cmd(',\n 'this.api.cmd_no_hazardous_check(',\n )\n\n try {\n const result = eval(this.lastCmd)\n\n if (result instanceof Promise) {\n await result\n }\n } catch (error) {\n // This text is in top_level.rb HazardousError.to_s\n if (error.message.includes('CriticalCmdError')) {\n this.criticalCmdUuid = error.object.data.instance_variables['@uuid']\n this.criticalCmdString =\n error.object.data.instance_variables['@cmd_string']\n this.criticalCmdUser =\n error.object.data.instance_variables['@username']\n this.displayCriticalCmd = true\n }\n }\n\n this.displaySendHazardous = false\n },\n cancelHazardousCmd() {\n this.displaySendHazardous = false\n },\n runScript(scriptName, openScript = true, env = {}) {\n let envArray = []\n for (const key in env) {\n envArray.push({ key: key, value: env[key], readonly: false })\n }\n Api.post(`/script-api/scripts/${scriptName}/run`, {\n data: { environment: envArray },\n }).then((response) => {\n if (openScript) {\n window.open(`/tools/scriptrunner/${response.data}`, '_blank')\n }\n })\n },\n },\n}\n</script>\n"],"names":["Widget","CriticalCmdDialog","OpenC3Api","error","resolve","scriptName","openScript","env","envArray","key","Api","response","_createElementBlock","_createVNode","_component_v_btn","_normalizeStyle","_ctx","$options","_withCtx","_createTextVNode","_toDisplayString","_component_v_dialog","$data","_cache","$event","_component_v_card","_component_v_card_title","_component_v_card_text","_createElementVNode","_component_v_row","_component_v_spacer","_component_critical_cmd_dialog"],"mappings":"ycA8DK,UAAU,CACb,OAAQ,CAACA,OAAAA,MAAM,EACf,WAAY,CACV,kBAAAC,kBAAAA,mBAEF,MAAO,CACL,MAAO,CACL,IAAK,KACL,qBAAsB,GACtB,QAAS,GACT,gBAAiB,KACjB,kBAAmB,KACnB,gBAAiB,KACjB,mBAAoB,EACtB,CACF,EACA,SAAU,CACR,YAAa,CACX,OAAO,KAAK,WAAW,CAAC,CAC1B,EACA,MAAO,CACL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A7B/B,EAAA,IA8BQN,IAAAA,YAecc,EAAA,KAAA,CA7CtB,QAAAT,IAAAA,QA+BU,IAaM,CAbNU,IAAAA,mBAaM,MAbN,WAaM,CAZJf,IAAAA,YAEQgB,EAAA,CAFD,MAAM,MAAM,EAAA,CAhC/B,QAAAX,IAAAA,QAiCc,IAAmDK,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,CAAnDK,IAAAA,mBAAmD,YAA7C,yCAAsC,EAAA,KAjC1D,EAAA,IAmCYf,IAAAA,YAQQgB,EAAA,KAAA,CA3CpB,QAAAX,IAAAA,QAoCc,IAAY,CAAZL,IAAAA,YAAYiB,CAAA,EACZjB,IAAAA,YAEQC,EAAA,CAFA,QAAOG,EAAA,mBAAoB,QAAQ,aArCzD,QAAAC,IAAAA,QAqCoE,IAEtDK,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,CAvCdJ,IAAAA,gBAqCoE,UAEtD,KAvCd,EAAA,kBAwCcN,IAAAA,YAEQC,EAAA,CAFA,QAAOG,EAAA,iBAAkB,MAAM,oBAxCrD,QAAAC,IAAAA,QAwCuE,IAEzDK,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,CA1CdJ,IAAAA,gBAwCuE,QAEzD,KA1Cd,EAAA,oBAAA,EAAA,QAAA,EAAA,MAAA,EAAA,MAAA,EAAA,qBAgDIN,IAAAA,YAKEkB,EAAA,CAJC,KAAMT,EAAA,gBACN,UAAWA,EAAA,kBACX,QAASA,EAAA,gBAnDhB,WAoDeA,EAAA,mBApDf,sBAAAC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAoDeF,EAAA,mBAAkBE"}
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonWidget-D_tupiPB.js","sources":["../src/widgets/ButtonWidget.vue"],"sourcesContent":["<!--\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# Modified by OpenC3, Inc.\n# All changes Copyright 2022, OpenC3, Inc.\n# All Rights Reserved\n#\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n-->\n\n<template>\n <div>\n <v-btn class=\"ma-1\" color=\"primary\" :style=\"computedStyle\" @click=\"onClick\">\n {{ buttonText }}\n </v-btn>\n <v-dialog v-model=\"displaySendHazardous\" max-width=\"300\">\n <v-card>\n <v-card-title>Hazardous</v-card-title>\n <v-card-text>\n <div class=\"mx-1\">\n <v-row class=\"my-2\">\n <span> Warning: Command is Hazardous. Send? </span>\n </v-row>\n <v-row>\n <v-spacer />\n <v-btn @click=\"cancelHazardousCmd\" variant=\"outlined\">\n Cancel\n </v-btn>\n <v-btn @click=\"sendHazardousCmd\" class=\"bg-primary mx-1\">\n Send\n </v-btn>\n </v-row>\n </div>\n </v-card-text>\n </v-card>\n </v-dialog>\n <critical-cmd-dialog\n :uuid=\"criticalCmdUuid\"\n :cmdString=\"criticalCmdString\"\n :cmdUser=\"criticalCmdUser\"\n v-model=\"displayCriticalCmd\"\n />\n </div>\n</template>\n\n<script>\nimport { Api, OpenC3Api } from '@openc3/js-common/services'\nimport { CriticalCmdDialog } from '@/components'\nimport Widget from './Widget'\n\nexport default {\n mixins: [Widget],\n components: {\n CriticalCmdDialog,\n },\n data() {\n return {\n api: null,\n displaySendHazardous: false,\n lastCmd: '',\n criticalCmdUuid: null,\n criticalCmdString: null,\n criticalCmdUser: null,\n displayCriticalCmd: false,\n }\n },\n computed: {\n buttonText() {\n return this.parameters[0]\n },\n eval() {\n return this.parameters[1]\n },\n },\n created() {\n this.api = new OpenC3Api()\n },\n methods: {\n async onClick() {\n const lines = this.eval.split(';;')\n // Create local references to variables so users don't need to use 'this'\n const self = this\n const screen = this.screen\n const screenValues = this.screenValues\n const screenTimeZone = this.screenTimeZone\n const api = this.api\n const runScript = this.runScript\n if (\n self ||\n screen ||\n screenValues ||\n screenTimeZone ||\n api ||\n runScript\n ) {\n // Add a noop to preserve the variables in the if statement\n // from being removed by compiler optimizations\n this.$nextTick(() => {})\n }\n for (let i = 0; i < lines.length; i++) {\n try {\n const result = eval(lines[i].trim())\n if (result instanceof Promise) {\n await result\n }\n } catch (error) {\n // This text is in top_level.rb HazardousError.to_s\n if (error.message.includes('CriticalCmdError')) {\n this.criticalCmdUuid = error.object.data.instance_variables['@uuid']\n this.criticalCmdString =\n error.object.data.instance_variables['@cmd_string']\n this.criticalCmdUser =\n error.object.data.instance_variables['@username']\n this.displayCriticalCmd = true\n } else if (error.message.includes('is Hazardous')) {\n this.lastCmd = error.message.split('\\n').pop()\n this.displaySendHazardous = true\n while (this.displaySendHazardous) {\n await new Promise((resolve) => setTimeout(resolve, 500))\n }\n } else {\n // eslint-disable-next-line\n console.error(error)\n }\n }\n }\n },\n async sendHazardousCmd() {\n // TODO: This only handles basic cmd() calls in buttons, do we need to handle other? cmd_raw()?\n this.lastCmd = this.lastCmd.replace(\n 'cmd(',\n 'this.api.cmd_no_hazardous_check(',\n )\n\n try {\n const result = eval(this.lastCmd)\n\n if (result instanceof Promise) {\n await result\n }\n } catch (error) {\n // This text is in top_level.rb HazardousError.to_s\n if (error.message.includes('CriticalCmdError')) {\n this.criticalCmdUuid = error.object.data.instance_variables['@uuid']\n this.criticalCmdString =\n error.object.data.instance_variables['@cmd_string']\n this.criticalCmdUser =\n error.object.data.instance_variables['@username']\n this.displayCriticalCmd = true\n }\n }\n\n this.displaySendHazardous = false\n },\n cancelHazardousCmd() {\n this.displaySendHazardous = false\n },\n runScript(scriptName, openScript = true, env = {}) {\n let envArray = []\n for (const key in env) {\n envArray.push({ key: key, value: env[key], readonly: false })\n }\n Api.post(`/script-api/scripts/${scriptName}/run`, {\n data: { environment: envArray },\n }).then((response) => {\n if (openScript) {\n window.open(`/tools/scriptrunner/${response.data}`, '_blank')\n }\n })\n },\n },\n}\n</script>\n"],"names":["OpenC3Api","error","resolve","scriptName","openScript","env","envArray","key","Api","response","_createElementBlock","_createVNode","_component_v_btn","_normalizeStyle","_ctx","$options","_withCtx","_createTextVNode","_toDisplayString","_component_v_dialog","$data","_cache","$event","_component_v_card","_component_v_card_title","_component_v_card_text","_createElementVNode","_component_v_row","_component_v_spacer","_component_critical_cmd_dialog"],"mappings":";;;;;;AA8DA,MAAK,YAAU;AAAA,EACb,QAAQ,CAAC,MAAM;AAAA,EACf,YAAY;AAAA,IACV;AAAA;EAEF,OAAO;AACL,WAAO;AAAA,MACL,KAAK;AAAA,MACL,sBAAsB;AAAA,MACtB,SAAS;AAAA,MACT,iBAAiB;AAAA,MACjB,mBAAmB;AAAA,MACnB,iBAAiB;AAAA,MACjB,oBAAoB;AAAA,IACtB;AAAA;EAEF,UAAU;AAAA,IACR,aAAa;AACX,aAAO,KAAK,WAAW,CAAC;AAAA;IAE1B,OAAO;AACL,aAAO,KAAK,WAAW,CAAC;AAAA;;EAG5B,UAAU;AACR,SAAK,MAAM,IAAIA,GAAS;AAAA;EAE1B,SAAS;AAAA,IACP,MAAM,UAAU;AACd,YAAM,QAAQ,KAAK,KAAK,MAAM,IAAI,GAE5B,OAAO,MACP,SAAS,KAAK,QACd,eAAe,KAAK,cACpB,iBAAiB,KAAK,gBACtB,MAAM,KAAK,KACX,YAAY,KAAK;AACvB,OACE,QACA,UACA,gBACA,kBACA,OACA,cAIA,KAAK,UAAU,MAAM;AAAA,MAAA,CAAE;AAEzB,eAAS,IAAI,GAAG,IAAI,MAAM,QAAQ;AAChC,YAAI;AACF,gBAAM,SAAS,KAAK,MAAM,CAAC,EAAE,KAAI,CAAE;AACnC,UAAI,kBAAkB,WACpB,MAAM;AAAA,iBAEDC,GAAO;AAEd,cAAIA,EAAM,QAAQ,SAAS,kBAAkB;AAC3C,iBAAK,kBAA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A;AAAA,sBACZjB,YAEQC,GAAA;AAAA,wBAFA,SAAOG,EAAA;AAAA,wBAAoB,SAAQ;AAAA;wBArCzD,SAAAC,QAqCoE,MAEtDK,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA;AAAA,0BAvCdJ,gBAqCoE,UAEtD;AAAA;wBAvCd,GAAA;AAAA;sBAwCcN,YAEQC,GAAA;AAAA,wBAFA,SAAOG,EAAA;AAAA,wBAAkB,OAAM;AAAA;wBAxCrD,SAAAC,QAwCuE,MAEzDK,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA;AAAA,0BA1CdJ,gBAwCuE,QAEzD;AAAA;wBA1Cd,GAAA;AAAA;;oBAAA,GAAA;AAAA;;;cAAA,GAAA;AAAA;;UAAA,GAAA;AAAA;;MAAA,GAAA;AAAA;IAgDIN,YAKEkB,GAAA;AAAA,MAJC,MAAMT,EAAA;AAAA,MACN,WAAWA,EAAA;AAAA,MACX,SAASA,EAAA;AAAA,MAnDhB,YAoDeA,EAAA;AAAA,MApDf,uBAAAC,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAoDeF,EAAA,qBAAkBE;AAAA;;;;"}
1
+ {"version":3,"file":"ButtonWidget-D_tupiPB.js","sources":["../src/widgets/ButtonWidget.vue"],"sourcesContent":["<!--\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# Modified by OpenC3, Inc.\n# All changes Copyright 2022, OpenC3, Inc.\n# All Rights Reserved\n#\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n-->\n\n<template>\n <div>\n <v-btn class=\"ma-1\" color=\"primary\" :style=\"computedStyle\" @click=\"onClick\">\n {{ buttonText }}\n </v-btn>\n <v-dialog v-model=\"displaySendHazardous\" max-width=\"300\">\n <v-card>\n <v-card-title>Hazardous</v-card-title>\n <v-card-text>\n <div class=\"mx-1\">\n <v-row class=\"my-2\">\n <span> Warning: Command is Hazardous. Send? </span>\n </v-row>\n <v-row>\n <v-spacer />\n <v-btn @click=\"cancelHazardousCmd\" variant=\"outlined\">\n Cancel\n </v-btn>\n <v-btn @click=\"sendHazardousCmd\" class=\"bg-primary mx-1\">\n Send\n </v-btn>\n </v-row>\n </div>\n </v-card-text>\n </v-card>\n </v-dialog>\n <critical-cmd-dialog\n :uuid=\"criticalCmdUuid\"\n :cmdString=\"criticalCmdString\"\n :cmdUser=\"criticalCmdUser\"\n v-model=\"displayCriticalCmd\"\n />\n </div>\n</template>\n\n<script>\nimport { Api, OpenC3Api } from '@openc3/js-common/services'\nimport { CriticalCmdDialog } from '@/components'\nimport Widget from './Widget'\n\nexport default {\n mixins: [Widget],\n components: {\n CriticalCmdDialog,\n },\n data() {\n return {\n api: null,\n displaySendHazardous: false,\n lastCmd: '',\n criticalCmdUuid: null,\n criticalCmdString: null,\n criticalCmdUser: null,\n displayCriticalCmd: false,\n }\n },\n computed: {\n buttonText() {\n return this.parameters[0]\n },\n eval() {\n return this.parameters[1]\n },\n },\n created() {\n this.api = new OpenC3Api()\n },\n methods: {\n async onClick() {\n const lines = this.eval.split(';;')\n // Create local references to variables so users don't need to use 'this'\n const self = this\n const screen = this.screen\n const screenValues = this.screenValues\n const screenTimeZone = this.screenTimeZone\n const api = this.api\n const runScript = this.runScript\n if (\n self ||\n screen ||\n screenValues ||\n screenTimeZone ||\n api ||\n runScript\n ) {\n // Add a noop to preserve the variables in the if statement\n // from being removed by compiler optimizations\n this.$nextTick(() => {})\n }\n for (let i = 0; i < lines.length; i++) {\n try {\n const result = eval(lines[i].trim())\n if (result instanceof Promise) {\n await result\n }\n } catch (error) {\n // This text is in top_level.rb HazardousError.to_s\n if (error.message.includes('CriticalCmdError')) {\n this.criticalCmdUuid = error.object.data.instance_variables['@uuid']\n this.criticalCmdString =\n error.object.data.instance_variables['@cmd_string']\n this.criticalCmdUser =\n error.object.data.instance_variables['@username']\n this.displayCriticalCmd = true\n } else if (error.message.includes('is Hazardous')) {\n this.lastCmd = error.message.split('\\n').pop()\n this.displaySendHazardous = true\n while (this.displaySendHazardous) {\n await new Promise((resolve) => setTimeout(resolve, 500))\n }\n } else {\n // eslint-disable-next-line\n console.error(error)\n }\n }\n }\n },\n async sendHazardousCmd() {\n // TODO: This only handles basic cmd() calls in buttons, do we need to handle other? cmd_raw()?\n this.lastCmd = this.lastCmd.replace(\n 'cmd(',\n 'this.api.cmd_no_hazardous_check(',\n )\n\n try {\n const result = eval(this.lastCmd)\n\n if (result instanceof Promise) {\n await result\n }\n } catch (error) {\n // This text is in top_level.rb HazardousError.to_s\n if (error.message.includes('CriticalCmdError')) {\n this.criticalCmdUuid = error.object.data.instance_variables['@uuid']\n this.criticalCmdString =\n error.object.data.instance_variables['@cmd_string']\n this.criticalCmdUser =\n error.object.data.instance_variables['@username']\n this.displayCriticalCmd = true\n }\n }\n\n this.displaySendHazardous = false\n },\n cancelHazardousCmd() {\n this.displaySendHazardous = false\n },\n runScript(scriptName, openScript = true, env = {}) {\n let envArray = []\n for (const key in env) {\n envArray.push({ key: key, value: env[key], readonly: false })\n }\n Api.post(`/script-api/scripts/${scriptName}/run`, {\n data: { environment: envArray },\n }).then((response) => {\n if (openScript) {\n window.open(`/tools/scriptrunner/${response.data}`, '_blank')\n }\n })\n },\n },\n}\n</script>\n"],"names":["OpenC3Api","error","resolve","scriptName","openScript","env","envArray","key","Api","response","_createElementBlock","_createVNode","_component_v_btn","_normalizeStyle","_ctx","$options","_withCtx","_createTextVNode","_toDisplayString","_component_v_dialog","$data","_cache","$event","_component_v_card","_component_v_card_title","_component_v_card_text","_createElementVNode","_component_v_row","_component_v_spacer","_component_critical_cmd_dial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AAA;sBAwCcN,YAEQC,GAAA;AAAA,wBAFA,SAAOG,EAAA;AAAA,wBAAkB,OAAM;AAAA;wBAxCrD,SAAAC,QAwCuE,MAEzDK,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA;AAAA,0BA1CdJ,gBAwCuE,QAEzD;AAAA;wBA1Cd,GAAA;AAAA;;oBAAA,GAAA;AAAA;;;cAAA,GAAA;AAAA;;UAAA,GAAA;AAAA;;MAAA,GAAA;AAAA;IAgDIN,YAKEkB,GAAA;AAAA,MAJC,MAAMT,EAAA;AAAA,MACN,WAAWA,EAAA;AAAA,MACX,SAASA,EAAA;AAAA,MAnDhB,YAoDeA,EAAA;AAAA,MApDf,uBAAAC,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAoDeF,EAAA,qBAAkBE;AAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CanvasWidget-C6dc7mUw.cjs","sources":["../src/widgets/CanvasWidget.vue"],"sourcesContent":["<!--\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# Modified by OpenC3, Inc.\n# All changes Copyright 2022, OpenC3, Inc.\n# All Rights Reserved\n#\n# This file may also be used under the terms of a commercial license \n# if purchased from OpenC3, Inc.\n-->\n\n<template>\n <svg id=\"canvas\" :width=\"width\" :height=\"height\">\n <component\n v-for=\"(widget, index) in widgets\"\n v-bind=\"listeners\"\n :key=\"index\"\n :is=\"widget.type\"\n :target=\"widget.target\"\n :parameters=\"widget.parameters\"\n :settings=\"widget.settings\"\n :screen-values=\"screenValues\"\n :screen-time-zone=\"screenTimeZone\"\n :widgets=\"widget.widgets\"\n :name=\"widget.name\"\n :line=\"widget.line\"\n :line-number=\"widget.lineNumber\"\n />\n </svg>\n</template>\n\n<script>\nimport Layout from './Layout'\nexport default {\n mixins: [Layout],\n computed: {\n width() {\n return this.parameters[0] + 'px'\n },\n height() {\n return this.parameters[1] + 'px'\n },\n },\n}\n</script>\n\n<style lang=\"scss\" scoped>\nsvg {\n background-color: white;\n}\n</style>\n"],"names":["_sfc_main","Layout","_hoisted_1","_createElementBlock","$options","_openBlock","_Fragment","_renderList","_ctx","widget","index","_createBlock","_resolveDynamicComponent","_mergeProps"],"mappings":"iLA4CKA,EAAU,CACb,OAAQ,CAACC,EAAAA,MAAM,EACf,SAAU,CACR,OAAQ,CACN,OAAO,KAAK,WAAW,CAAC,EAAI,MAE9B,QAAS,CACP,OAAO,KAAK,WAAW,CAAC,EAAI,MAGlC,EAtDAC,EAAA,CAAA,QAAA,QAAA,+CAuBEC,EAAAA,mBAgBM,MAAA,CAhBD,GAAG,SAAU,MAAOC,EAAA,MAAQ,OAAQA,EAAA,UACvCC,EAAAA,UAAA,EAAA,EAAAF,EAAAA,mBAcEG,gBAtCNC,EAAAA,WAyBgCC,EAAA,QAzBhC,CAyBcC,EAAQC,mBADlBC,EAAAA,YAxBJC,EAAAA,wBA4BWH,EAAO,IAAI,EAJlBI,EAAAA,WAcE,CAtCN,QAAA,IA0BcL,EAAA,UAAS,CAChB,IAAKE,EAEL,OAAQD,EAAO,OACf,WAAYA,EAAO,WACnB,SAAUA,EAAO,SACjB,gBAAeD,EAAA,aACf,mBAAkBA,EAAA,eAClB,QAASC,EAAO,QAChB,KAAMA,EAAO,KACb,KAAMA,EAAO,KACb,cAAaA,EAAO,yIArC3B,EAAA,EAAAP,CAAA"}
1
+ {"version":3,"file":"CanvasWidget-C6dc7mUw.cjs","sources":["../src/widgets/CanvasWidget.vue"],"sourcesContent":["<!--\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# Modified by OpenC3, Inc.\n# All changes Copyright 2022, OpenC3, Inc.\n# All Rights Reserved\n#\n# This file may also be used under the terms of a commercial license \n# if purchased from OpenC3, Inc.\n-->\n\n<template>\n <svg id=\"canvas\" :width=\"width\" :height=\"height\">\n <component\n v-for=\"(widget, index) in widgets\"\n v-bind=\"listeners\"\n :key=\"index\"\n :is=\"widget.type\"\n :target=\"widget.target\"\n :parameters=\"widget.parameters\"\n :settings=\"widget.settings\"\n :screen-values=\"screenValues\"\n :screen-time-zone=\"screenTimeZone\"\n :widgets=\"widget.widgets\"\n :name=\"widget.name\"\n :line=\"widget.line\"\n :line-number=\"widget.lineNumber\"\n />\n </svg>\n</template>\n\n<script>\nimport Layout from './Layout'\nexport default {\n mixins: [Layout],\n computed: {\n width() {\n return this.parameters[0] + 'px'\n },\n height() {\n return this.parameters[1] + 'px'\n },\n },\n}\n</script>\n\n<style lang=\"scss\" scoped>\nsvg {\n background-color: white;\n}\n</style>\n"],"names":["_sfc_main","Layout","_hoisted_1","_createElementBlock","$options","_openBlock","_Fragment","_renderList","_ctx","widget","index","_createBlock","_resolveDynamicComponent","_mergeProps"],"mappings":"iLA4CKA,EAAU,CACb,OAAQ,CAACC,EAAAA,MAAM,EACf,SAAU,CACR,OAAQ,CACN,OAAO,KAAK,WAAW,CAAC,EAAI,IAC9B,EACA,QAAS,CACP,OAAO,KAAK,WAAW,CAAC,EAAI,IAC9B,EAEJ,EAtDAC,EAAA,CAAA,QAAA,QAAA,+CAuBEC,EAAAA,mBAgBM,MAAA,CAhBD,GAAG,SAAU,MAAOC,EAAA,MAAQ,OAAQA,EAAA,UACvCC,EAAAA,UAAA,EAAA,EAAAF,EAAAA,mBAcEG,gBAtCNC,EAAAA,WAyBgCC,EAAA,QAzBhC,CAyBcC,EAAQC,mBADlBC,EAAAA,YAxBJC,EAAAA,wBA4BWH,EAAO,IAAI,EAJlBI,EAAAA,WAcE,CAtCN,QAAA,IA0BcL,EAAA,UAAS,CAChB,IAAKE,EAEL,OAAQD,EAAO,OACf,WAAYA,EAAO,WACnB,SAAUA,EAAO,SACjB,gBAAeD,EAAA,aACf,mBAAkBA,EAAA,eAClB,QAASC,EAAO,QAChB,KAAMA,EAAO,KACb,KAAMA,EAAO,KACb,cAAaA,EAAO,yIArC3B,EAAA,EAAAP,CAAA"}