From 777d939e9a41c49fbfd234ae05966d6cdebe761c Mon Sep 17 00:00:00 2001 From: Jason Thomas Date: Fri, 18 Oct 2024 17:02:42 -0600 Subject: [PATCH] Allow execute selection while paused --- .../src/tools/ScriptRunner/ScriptRunner.vue | 43 ++++++++++++------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/src/tools/ScriptRunner/ScriptRunner.vue b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/src/tools/ScriptRunner/ScriptRunner.vue index ade635827..1bcddefee 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/src/tools/ScriptRunner/ScriptRunner.vue +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/src/tools/ScriptRunner/ScriptRunner.vue @@ -249,7 +249,6 @@ v-for="item in executeSelectionMenuItems" link :key="item.label" - :disabled="scriptId" > {{ item.label }} @@ -887,20 +886,34 @@ export default { ] }, executeSelectionMenuItems: function () { - return [ - { - label: 'Execute selection', - command: this.executeSelection, - }, - { - label: 'Run from here', - command: this.runFromCursor, - }, - { - label: 'Clear local breakpoints', - command: this.clearBreakpoints, - }, - ] + if (this.scriptId) { + return [ + { + label: 'Execute selection', + command: this.executeSelection, + }, + { + label: 'Run from here', + command: this.runFromCursor, + }, + // Can't clear local breakpoints in a running script + ] + } else { + return [ + { + label: 'Execute selection', + command: this.executeSelection, + }, + { + label: 'Run from here', + command: this.runFromCursor, + }, + { + label: 'Clear local breakpoints', + command: this.clearBreakpoints, + }, + ] + } }, }, watch: {