From acf9514fc50b28ddff5a7ac8e215446a37a2dbdf Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Fri, 15 Nov 2019 12:57:31 -0700 Subject: [PATCH] Adds a flag to the debug context class to save whether or not an application should start after the next boot. --- Pepperdash Core/Pepperdash Core/Logging/Debug.cs | 12 ++++++++++++ .../Pepperdash Core/Logging/DebugMemory.cs | 9 +++++++++ 2 files changed, 21 insertions(+) diff --git a/Pepperdash Core/Pepperdash Core/Logging/Debug.cs b/Pepperdash Core/Pepperdash Core/Logging/Debug.cs index 14da95e..083baa2 100644 --- a/Pepperdash Core/Pepperdash Core/Logging/Debug.cs +++ b/Pepperdash Core/Pepperdash Core/Logging/Debug.cs @@ -237,6 +237,18 @@ namespace PepperDash.Core } } + /// + /// Sets the flag to prevent application starting on next boot + /// + /// + public static void SetDoNotStartOnNextBoot(bool state) + { + Contexts.DoNotStartOnNextBoot = state; + CrestronConsole.PrintLine("[Application {0}], Do Not Start on Next Boot set to {1}", + InitialParametersClass.ApplicationNumber, Contexts.DoNotStartOnNextBoot); + SaveMemoryOnTimeout(); + } + /// /// /// diff --git a/Pepperdash Core/Pepperdash Core/Logging/DebugMemory.cs b/Pepperdash Core/Pepperdash Core/Logging/DebugMemory.cs index 82ad51f..d75e3b9 100644 --- a/Pepperdash Core/Pepperdash Core/Logging/DebugMemory.cs +++ b/Pepperdash Core/Pepperdash Core/Logging/DebugMemory.cs @@ -10,6 +10,12 @@ namespace PepperDash.Core.DebugThings { public class DebugContextCollection { + /// + /// Property to tell the program not to intitialize when it boots, if desired + /// + [JsonProperty("doNotStartOnNextBoot")] + public bool DoNotStartOnNextBoot { get; set; } + [JsonProperty("items")] Dictionary Items; @@ -47,6 +53,9 @@ namespace PepperDash.Core.DebugThings public class DebugContextItem { + /// + /// The level of debug messages to print + /// [JsonProperty("level")] public int Level { get; set; }