diff --git a/src/PepperDash.Essentials.Core/Config/AudioControlPointListItem.cs b/src/PepperDash.Essentials.Core/Config/AudioControlPointListItem.cs index 8b2aea54..54cc3574 100644 --- a/src/PepperDash.Essentials.Core/Config/AudioControlPointListItem.cs +++ b/src/PepperDash.Essentials.Core/Config/AudioControlPointListItem.cs @@ -13,9 +13,15 @@ namespace PepperDash.Essentials.Core.Config /// public class AudioControlPointListItem { + /// + /// Level controls for this audio control point + /// [JsonProperty("levelControls")] public Dictionary LevelControls { get; set; } = new Dictionary(); + /// + /// Presets for this audio control point + /// [JsonProperty("presets")] public Dictionary Presets { get; set; } = new Dictionary(); diff --git a/src/PepperDash.Essentials.Core/Config/BasicConfig.cs b/src/PepperDash.Essentials.Core/Config/BasicConfig.cs index c4cbc63a..435d448f 100644 --- a/src/PepperDash.Essentials.Core/Config/BasicConfig.cs +++ b/src/PepperDash.Essentials.Core/Config/BasicConfig.cs @@ -14,33 +14,57 @@ namespace PepperDash.Essentials.Core.Config /// public class BasicConfig { + /// + /// Gets or sets the Info + /// [JsonProperty("info")] public InfoConfig Info { get; set; } + /// + /// Gets or sets the Devices + /// [JsonProperty("devices")] public List Devices { get; set; } + /// + /// Gets or sets the SourceLists + /// [JsonProperty("sourceLists")] public Dictionary> SourceLists { get; set; } + /// + /// Gets or sets the DestinationLists + /// [JsonProperty("destinationLists")] public Dictionary> DestinationLists { get; set; } + /// + /// Gets or sets the AudioControlPointLists + /// [JsonProperty("audioControlPointLists")] public Dictionary AudioControlPointLists { get; set; } + /// + /// Gets or sets the CameraLists + /// [JsonProperty("cameraLists")] public Dictionary> CameraLists { get; set; } + /// + /// Gets or sets the TieLines + /// [JsonProperty("tieLines")] - /// - /// Gets or sets the TieLines - /// - public List TieLines { get; set; } + public List TieLines { get; set; } + /// + /// Gets or sets the JoinMaps + /// [JsonProperty("joinMaps")] public Dictionary JoinMaps { get; set; } + /// + /// BasicConfig Constructor + /// public BasicConfig() { Info = new InfoConfig(); @@ -98,6 +122,7 @@ namespace PepperDash.Essentials.Core.Config /// /// Checks CameraLists for a given list and returns it if found. Otherwise, returns null /// + /// Key of desired camera list public Dictionary GetCameraListForKey(string key) { if (CameraLists == null || string.IsNullOrEmpty(key) || !CameraLists.ContainsKey(key)) @@ -110,10 +135,6 @@ namespace PepperDash.Essentials.Core.Config /// Checks Devices for an item with a Key that matches and returns it if found. Otherwise, retunes null /// /// Key of desired device - /// - /// - /// GetDeviceForKey method - /// public DeviceConfig GetDeviceForKey(string key) { if (string.IsNullOrEmpty(key)) diff --git a/src/PepperDash.Essentials.Core/Config/Essentials/ConfigReader.cs b/src/PepperDash.Essentials.Core/Config/Essentials/ConfigReader.cs index 2591e8aa..40c6c0cf 100644 --- a/src/PepperDash.Essentials.Core/Config/Essentials/ConfigReader.cs +++ b/src/PepperDash.Essentials.Core/Config/Essentials/ConfigReader.cs @@ -18,17 +18,23 @@ namespace PepperDash.Essentials.Core.Config /// public class ConfigReader { + /// + /// Local Config Present Message + /// public const string LocalConfigPresent = @" *************************************************** ************* Using Local config file ************* ***************************************************"; + /// + /// The loaded config object + /// public static EssentialsConfig ConfigObject { get; private set; } - /// - /// LoadConfig2 method - /// + /// + /// LoadConfig2 method + /// public static bool LoadConfig2() { Debug.LogMessage(LogEventLevel.Information, "Loading unmerged system/template portal configuration file."); @@ -171,11 +177,8 @@ namespace PepperDash.Essentials.Core.Config /// /// Returns all the files from the directory specified. /// - /// - /// - /// - /// GetConfigFiles method - /// + /// path to the directory + /// config files public static FileInfo[] GetConfigFiles(string filePath) { // Get the directory @@ -206,11 +209,8 @@ namespace PepperDash.Essentials.Core.Config /// /// Returns the group for a given device key in config /// - /// - /// - /// - /// GetGroupForDeviceKey method - /// + /// Key of the device + /// Group name if the device is found, null otherwise public static string GetGroupForDeviceKey(string key) { var dev = ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(key, StringComparison.OrdinalIgnoreCase)); diff --git a/src/PepperDash.Essentials.Core/Config/Essentials/ConfigUpdater.cs b/src/PepperDash.Essentials.Core/Config/Essentials/ConfigUpdater.cs index d7322cc4..9df673bf 100644 --- a/src/PepperDash.Essentials.Core/Config/Essentials/ConfigUpdater.cs +++ b/src/PepperDash.Essentials.Core/Config/Essentials/ConfigUpdater.cs @@ -16,13 +16,20 @@ using Serilog.Events; namespace PepperDash.Essentials.Core.Config { + /// + /// ConfigUpdater class + /// public static class ConfigUpdater { + /// + /// ConfigStatusChanged event + /// public static event EventHandler ConfigStatusChanged; /// /// GetConfigFromServer method /// + /// URL of the config server public static void GetConfigFromServer(string url) { Debug.LogMessage(LogEventLevel.Information, "Attempting to get new config from '{0}'", url); @@ -210,13 +217,44 @@ namespace PepperDash.Essentials.Core.Config /// public enum eUpdateStatus { + /// + /// UpdateStarted status + /// UpdateStarted, + + /// + /// ConfigFileReceived status + /// ConfigFileReceived, + + /// + /// ArchivingConfigs status + /// ArchivingConfigs, + + /// + /// DeletingLocalConfig status + /// DeletingLocalConfig, + + /// + /// WritingConfigFile status + /// WritingConfigFile, + + /// + /// RestartingProgram status + /// RestartingProgram, + + /// + /// UpdateSucceeded status + /// UpdateSucceeded, + + /// + /// UpdateFailed status + /// UpdateFailed } @@ -230,6 +268,10 @@ namespace PepperDash.Essentials.Core.Config /// public eUpdateStatus UpdateStatus { get; private set; } + /// + /// ConfigStatusEventArgs Constructor + /// + /// public ConfigStatusEventArgs(eUpdateStatus status) { UpdateStatus = status; diff --git a/src/PepperDash.Essentials.Core/Config/Essentials/ConfigWriter.cs b/src/PepperDash.Essentials.Core/Config/Essentials/ConfigWriter.cs index 665da856..93517a3c 100644 --- a/src/PepperDash.Essentials.Core/Config/Essentials/ConfigWriter.cs +++ b/src/PepperDash.Essentials.Core/Config/Essentials/ConfigWriter.cs @@ -18,22 +18,29 @@ namespace PepperDash.Essentials.Core.Config /// public class ConfigWriter { + /// + /// LocalConfigFolder constant + /// public const string LocalConfigFolder = "LocalConfig"; + /// + /// WriteTimeout constant + /// public const long WriteTimeout = 30000; + /// + /// WriteTimer variable + /// public static CTimer WriteTimer; + static CCriticalSection fileLock = new CCriticalSection(); /// /// Updates the config properties of a device /// - /// - /// - /// - /// - /// UpdateDeviceProperties method - /// + /// The key of the device to update + /// The new properties for the device + /// True if the update was successful, otherwise false public static bool UpdateDeviceProperties(string deviceKey, JToken properties) { bool success = false; @@ -59,6 +66,8 @@ namespace PepperDash.Essentials.Core.Config /// /// UpdateDeviceConfig method /// + /// The new device config + /// True if the update was successful, otherwise false public static bool UpdateDeviceConfig(DeviceConfig config) { bool success = false; @@ -82,6 +91,8 @@ namespace PepperDash.Essentials.Core.Config /// /// UpdateRoomConfig method /// + /// The new room config + /// True if the update was successful, otherwise false public static bool UpdateRoomConfig(DeviceConfig config) { bool success = false; @@ -118,7 +129,6 @@ namespace PepperDash.Essentials.Core.Config /// /// Writes the current config to a file in the LocalConfig subfolder /// - /// private static void WriteConfigFile(object o) { var filePath = Global.FilePathPrefix + LocalConfigFolder + Global.DirectorySeparator + "configurationFile.json"; @@ -129,13 +139,10 @@ namespace PepperDash.Essentials.Core.Config } /// - /// Writes - /// - /// - /// - /// - /// WriteFile method + /// Writes the current config data to a file /// + /// The file path to write to + /// The config data to write public static void WriteFile(string filePath, string configData) { if (WriteTimer != null) diff --git a/src/PepperDash.Essentials.Core/Config/ILoadConfig.cs b/src/PepperDash.Essentials.Core/Config/ILoadConfig.cs index 9780bd44..ed6ff61f 100644 --- a/src/PepperDash.Essentials.Core/Config/ILoadConfig.cs +++ b/src/PepperDash.Essentials.Core/Config/ILoadConfig.cs @@ -11,6 +11,9 @@ namespace PepperDash.Essentials.Core /// public interface ILoadConfig { + /// + /// GoWithLoad method + /// void GoWithLoad(); } } diff --git a/src/PepperDash.Essentials.Core/Config/InfoConfig.cs b/src/PepperDash.Essentials.Core/Config/InfoConfig.cs index 8c506f17..1ce2c60b 100644 --- a/src/PepperDash.Essentials.Core/Config/InfoConfig.cs +++ b/src/PepperDash.Essentials.Core/Config/InfoConfig.cs @@ -12,45 +12,57 @@ namespace PepperDash.Essentials.Core.Config /// public class InfoConfig { + /// + /// Gets or sets the Name + /// [JsonProperty("name")] public string Name { get; set; } + /// + /// Gets or sets the Date + /// [JsonProperty("date")] public DateTime Date { get; set; } + /// + /// Gets or sets the Type + /// [JsonProperty("type")] public string Type { get; set; } + /// + /// Gets or sets the Version + /// [JsonProperty("version")] - /// - /// Gets or sets the Version - /// public string Version { get; set; } - [JsonProperty("runtimeInfo")] /// /// Gets or sets the RuntimeInfo /// + [JsonProperty("runtimeInfo")] public RuntimeInfo RuntimeInfo { get; set; } + /// + /// Gets or sets the Comment + /// [JsonProperty("comment")] - /// - /// Gets or sets the Comment - /// public string Comment { get; set; } - [JsonProperty("hostname")] /// /// Gets or sets the HostName /// + [JsonProperty("hostname")] public string HostName { get; set; } - [JsonProperty("appNumber")] /// /// Gets or sets the AppNumber /// + [JsonProperty("appNumber")] public uint AppNumber { get; set; } + /// + /// InfoConfig Constructor + /// public InfoConfig() { Name = "";