From 16bc2ca381ca5083bbe96161529832521e53ae9e Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 11 Feb 2021 16:44:18 -0700 Subject: [PATCH] Corrects spelling mistake and adds check to see if thread is already running before allowing sequence to start --- .../PepperDashEssentialsBase/Utilities/ActionSequence.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Utilities/ActionSequence.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Utilities/ActionSequence.cs index c62b6e47..bc1e8a4e 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Utilities/ActionSequence.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Utilities/ActionSequence.cs @@ -16,7 +16,7 @@ namespace PepperDash.Essentials.Core.Utilities /// /// A device that executes a sequence of actions with optional delays between actions /// - [Description("A device that exectues a sequence of actions with optional delays between actions")] + [Description("A device that executes a sequence of actions with optional delays between actions")] public class ActionSequence : EssentialsDevice { private ActionSequencePropertiesConfig _propertiesConfig; @@ -47,6 +47,12 @@ namespace PepperDash.Essentials.Core.Utilities /// public void StartSequence() { + if (_worker.ThreadState == Thread.eThreadStates.ThreadRunning) + { + Debug.Console(1, this, "Thread already running. Cannot Start Sequence"); + return; + } + Debug.Console(1, this, "Starting Action Sequence"); _allowActionsToExecute = true; AddActionsToQueue();