wip: update XML comments

This commit is contained in:
Erik Meyer
2026-01-28 10:05:37 -05:00
parent 34f236868b
commit 2a748824ae
7 changed files with 134 additions and 43 deletions

View File

@@ -13,9 +13,15 @@ namespace PepperDash.Essentials.Core.Config
/// </summary> /// </summary>
public class AudioControlPointListItem public class AudioControlPointListItem
{ {
/// <summary>
/// Level controls for this audio control point
/// </summary>
[JsonProperty("levelControls")] [JsonProperty("levelControls")]
public Dictionary<string, LevelControlListItem> LevelControls { get; set; } = new Dictionary<string, LevelControlListItem>(); public Dictionary<string, LevelControlListItem> LevelControls { get; set; } = new Dictionary<string, LevelControlListItem>();
/// <summary>
/// Presets for this audio control point
/// </summary>
[JsonProperty("presets")] [JsonProperty("presets")]
public Dictionary<string, PresetListItem> Presets { get; set; } = new Dictionary<string, PresetListItem>(); public Dictionary<string, PresetListItem> Presets { get; set; } = new Dictionary<string, PresetListItem>();

View File

@@ -14,33 +14,57 @@ namespace PepperDash.Essentials.Core.Config
/// </summary> /// </summary>
public class BasicConfig public class BasicConfig
{ {
/// <summary>
/// Gets or sets the Info
/// </summary>
[JsonProperty("info")] [JsonProperty("info")]
public InfoConfig Info { get; set; } public InfoConfig Info { get; set; }
/// <summary>
/// Gets or sets the Devices
/// </summary>
[JsonProperty("devices")] [JsonProperty("devices")]
public List<DeviceConfig> Devices { get; set; } public List<DeviceConfig> Devices { get; set; }
/// <summary>
/// Gets or sets the SourceLists
/// </summary>
[JsonProperty("sourceLists")] [JsonProperty("sourceLists")]
public Dictionary<string, Dictionary<string, SourceListItem>> SourceLists { get; set; } public Dictionary<string, Dictionary<string, SourceListItem>> SourceLists { get; set; }
/// <summary>
/// Gets or sets the DestinationLists
/// </summary>
[JsonProperty("destinationLists")] [JsonProperty("destinationLists")]
public Dictionary<string, Dictionary<string, DestinationListItem>> DestinationLists { get; set; } public Dictionary<string, Dictionary<string, DestinationListItem>> DestinationLists { get; set; }
/// <summary>
/// Gets or sets the AudioControlPointLists
/// </summary>
[JsonProperty("audioControlPointLists")] [JsonProperty("audioControlPointLists")]
public Dictionary<string, AudioControlPointListItem> AudioControlPointLists { get; set; } public Dictionary<string, AudioControlPointListItem> AudioControlPointLists { get; set; }
/// <summary>
/// Gets or sets the CameraLists
/// </summary>
[JsonProperty("cameraLists")] [JsonProperty("cameraLists")]
public Dictionary<string, Dictionary<string, CameraListItem>> CameraLists { get; set; } public Dictionary<string, Dictionary<string, CameraListItem>> CameraLists { get; set; }
/// <summary>
/// Gets or sets the TieLines
/// </summary>
[JsonProperty("tieLines")] [JsonProperty("tieLines")]
/// <summary> public List<TieLineConfig> TieLines { get; set; }
/// Gets or sets the TieLines
/// </summary>
public List<TieLineConfig> TieLines { get; set; }
/// <summary>
/// Gets or sets the JoinMaps
/// </summary>
[JsonProperty("joinMaps")] [JsonProperty("joinMaps")]
public Dictionary<string, JObject> JoinMaps { get; set; } public Dictionary<string, JObject> JoinMaps { get; set; }
/// <summary>
/// BasicConfig Constructor
/// </summary>
public BasicConfig() public BasicConfig()
{ {
Info = new InfoConfig(); Info = new InfoConfig();
@@ -98,6 +122,7 @@ namespace PepperDash.Essentials.Core.Config
/// <summary> /// <summary>
/// Checks CameraLists for a given list and returns it if found. Otherwise, returns null /// Checks CameraLists for a given list and returns it if found. Otherwise, returns null
/// </summary> /// </summary>
/// <param name="key">Key of desired camera list</param>
public Dictionary<string, CameraListItem> GetCameraListForKey(string key) public Dictionary<string, CameraListItem> GetCameraListForKey(string key)
{ {
if (CameraLists == null || string.IsNullOrEmpty(key) || !CameraLists.ContainsKey(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 /// Checks Devices for an item with a Key that matches and returns it if found. Otherwise, retunes null
/// </summary> /// </summary>
/// <param name="key">Key of desired device</param> /// <param name="key">Key of desired device</param>
/// <returns></returns>
/// <summary>
/// GetDeviceForKey method
/// </summary>
public DeviceConfig GetDeviceForKey(string key) public DeviceConfig GetDeviceForKey(string key)
{ {
if (string.IsNullOrEmpty(key)) if (string.IsNullOrEmpty(key))

View File

@@ -18,17 +18,23 @@ namespace PepperDash.Essentials.Core.Config
/// </summary> /// </summary>
public class ConfigReader public class ConfigReader
{ {
/// <summary>
/// Local Config Present Message
/// </summary>
public const string LocalConfigPresent = public const string LocalConfigPresent =
@" @"
*************************************************** ***************************************************
************* Using Local config file ************* ************* Using Local config file *************
***************************************************"; ***************************************************";
/// <summary>
/// The loaded config object
/// </summary>
public static EssentialsConfig ConfigObject { get; private set; } public static EssentialsConfig ConfigObject { get; private set; }
/// <summary> /// <summary>
/// LoadConfig2 method /// LoadConfig2 method
/// </summary> /// </summary>
public static bool LoadConfig2() public static bool LoadConfig2()
{ {
Debug.LogMessage(LogEventLevel.Information, "Loading unmerged system/template portal configuration file."); Debug.LogMessage(LogEventLevel.Information, "Loading unmerged system/template portal configuration file.");
@@ -171,11 +177,8 @@ namespace PepperDash.Essentials.Core.Config
/// <summary> /// <summary>
/// Returns all the files from the directory specified. /// Returns all the files from the directory specified.
/// </summary> /// </summary>
/// <param name="filePath"></param> /// <param name="filePath">path to the directory</param>
/// <returns></returns> /// <returns>config files</returns>
/// <summary>
/// GetConfigFiles method
/// </summary>
public static FileInfo[] GetConfigFiles(string filePath) public static FileInfo[] GetConfigFiles(string filePath)
{ {
// Get the directory // Get the directory
@@ -206,11 +209,8 @@ namespace PepperDash.Essentials.Core.Config
/// <summary> /// <summary>
/// Returns the group for a given device key in config /// Returns the group for a given device key in config
/// </summary> /// </summary>
/// <param name="key"></param> /// <param name="key">Key of the device</param>
/// <returns></returns> /// <returns>Group name if the device is found, null otherwise</returns>
/// <summary>
/// GetGroupForDeviceKey method
/// </summary>
public static string GetGroupForDeviceKey(string key) public static string GetGroupForDeviceKey(string key)
{ {
var dev = ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(key, StringComparison.OrdinalIgnoreCase)); var dev = ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(key, StringComparison.OrdinalIgnoreCase));

View File

@@ -16,13 +16,20 @@ using Serilog.Events;
namespace PepperDash.Essentials.Core.Config namespace PepperDash.Essentials.Core.Config
{ {
/// <summary>
/// ConfigUpdater class
/// </summary>
public static class ConfigUpdater public static class ConfigUpdater
{ {
/// <summary>
/// ConfigStatusChanged event
/// </summary>
public static event EventHandler<ConfigStatusEventArgs> ConfigStatusChanged; public static event EventHandler<ConfigStatusEventArgs> ConfigStatusChanged;
/// <summary> /// <summary>
/// GetConfigFromServer method /// GetConfigFromServer method
/// </summary> /// </summary>
/// <param name="url">URL of the config server</param>
public static void GetConfigFromServer(string url) public static void GetConfigFromServer(string url)
{ {
Debug.LogMessage(LogEventLevel.Information, "Attempting to get new config from '{0}'", url); Debug.LogMessage(LogEventLevel.Information, "Attempting to get new config from '{0}'", url);
@@ -210,13 +217,44 @@ namespace PepperDash.Essentials.Core.Config
/// </summary> /// </summary>
public enum eUpdateStatus public enum eUpdateStatus
{ {
/// <summary>
/// UpdateStarted status
/// </summary>
UpdateStarted, UpdateStarted,
/// <summary>
/// ConfigFileReceived status
/// </summary>
ConfigFileReceived, ConfigFileReceived,
/// <summary>
/// ArchivingConfigs status
/// </summary>
ArchivingConfigs, ArchivingConfigs,
/// <summary>
/// DeletingLocalConfig status
/// </summary>
DeletingLocalConfig, DeletingLocalConfig,
/// <summary>
/// WritingConfigFile status
/// </summary>
WritingConfigFile, WritingConfigFile,
/// <summary>
/// RestartingProgram status
/// </summary>
RestartingProgram, RestartingProgram,
/// <summary>
/// UpdateSucceeded status
/// </summary>
UpdateSucceeded, UpdateSucceeded,
/// <summary>
/// UpdateFailed status
/// </summary>
UpdateFailed UpdateFailed
} }
@@ -230,6 +268,10 @@ namespace PepperDash.Essentials.Core.Config
/// </summary> /// </summary>
public eUpdateStatus UpdateStatus { get; private set; } public eUpdateStatus UpdateStatus { get; private set; }
/// <summary>
/// ConfigStatusEventArgs Constructor
/// </summary>
/// <param name="status"></param>
public ConfigStatusEventArgs(eUpdateStatus status) public ConfigStatusEventArgs(eUpdateStatus status)
{ {
UpdateStatus = status; UpdateStatus = status;

View File

@@ -18,22 +18,29 @@ namespace PepperDash.Essentials.Core.Config
/// </summary> /// </summary>
public class ConfigWriter public class ConfigWriter
{ {
/// <summary>
/// LocalConfigFolder constant
/// </summary>
public const string LocalConfigFolder = "LocalConfig"; public const string LocalConfigFolder = "LocalConfig";
/// <summary>
/// WriteTimeout constant
/// </summary>
public const long WriteTimeout = 30000; public const long WriteTimeout = 30000;
/// <summary>
/// WriteTimer variable
/// </summary>
public static CTimer WriteTimer; public static CTimer WriteTimer;
static CCriticalSection fileLock = new CCriticalSection(); static CCriticalSection fileLock = new CCriticalSection();
/// <summary> /// <summary>
/// Updates the config properties of a device /// Updates the config properties of a device
/// </summary> /// </summary>
/// <param name="deviceKey"></param> /// <param name="deviceKey">The key of the device to update</param>
/// <param name="properties"></param> /// <param name="properties">The new properties for the device</param>
/// <returns></returns> /// <returns>True if the update was successful, otherwise false</returns>
/// <summary>
/// UpdateDeviceProperties method
/// </summary>
public static bool UpdateDeviceProperties(string deviceKey, JToken properties) public static bool UpdateDeviceProperties(string deviceKey, JToken properties)
{ {
bool success = false; bool success = false;
@@ -59,6 +66,8 @@ namespace PepperDash.Essentials.Core.Config
/// <summary> /// <summary>
/// UpdateDeviceConfig method /// UpdateDeviceConfig method
/// </summary> /// </summary>
/// <param name="config">The new device config</param>
/// <returns>True if the update was successful, otherwise false</returns>
public static bool UpdateDeviceConfig(DeviceConfig config) public static bool UpdateDeviceConfig(DeviceConfig config)
{ {
bool success = false; bool success = false;
@@ -82,6 +91,8 @@ namespace PepperDash.Essentials.Core.Config
/// <summary> /// <summary>
/// UpdateRoomConfig method /// UpdateRoomConfig method
/// </summary> /// </summary>
/// <param name="config">The new room config</param>
/// <returns>True if the update was successful, otherwise false</returns>
public static bool UpdateRoomConfig(DeviceConfig config) public static bool UpdateRoomConfig(DeviceConfig config)
{ {
bool success = false; bool success = false;
@@ -118,7 +129,6 @@ namespace PepperDash.Essentials.Core.Config
/// <summary> /// <summary>
/// Writes the current config to a file in the LocalConfig subfolder /// Writes the current config to a file in the LocalConfig subfolder
/// </summary> /// </summary>
/// <returns></returns>
private static void WriteConfigFile(object o) private static void WriteConfigFile(object o)
{ {
var filePath = Global.FilePathPrefix + LocalConfigFolder + Global.DirectorySeparator + "configurationFile.json"; var filePath = Global.FilePathPrefix + LocalConfigFolder + Global.DirectorySeparator + "configurationFile.json";
@@ -129,13 +139,10 @@ namespace PepperDash.Essentials.Core.Config
} }
/// <summary> /// <summary>
/// Writes /// Writes the current config data to a file
/// </summary>
/// <param name="filepath"></param>
/// <param name="o"></param>
/// <summary>
/// WriteFile method
/// </summary> /// </summary>
/// <param name="filePath">The file path to write to</param>
/// <param name="configData">The config data to write</param>
public static void WriteFile(string filePath, string configData) public static void WriteFile(string filePath, string configData)
{ {
if (WriteTimer != null) if (WriteTimer != null)

View File

@@ -11,6 +11,9 @@ namespace PepperDash.Essentials.Core
/// </summary> /// </summary>
public interface ILoadConfig public interface ILoadConfig
{ {
/// <summary>
/// GoWithLoad method
/// </summary>
void GoWithLoad(); void GoWithLoad();
} }
} }

View File

@@ -12,45 +12,57 @@ namespace PepperDash.Essentials.Core.Config
/// </summary> /// </summary>
public class InfoConfig public class InfoConfig
{ {
/// <summary>
/// Gets or sets the Name
/// </summary>
[JsonProperty("name")] [JsonProperty("name")]
public string Name { get; set; } public string Name { get; set; }
/// <summary>
/// Gets or sets the Date
/// </summary>
[JsonProperty("date")] [JsonProperty("date")]
public DateTime Date { get; set; } public DateTime Date { get; set; }
/// <summary>
/// Gets or sets the Type
/// </summary>
[JsonProperty("type")] [JsonProperty("type")]
public string Type { get; set; } public string Type { get; set; }
/// <summary>
/// Gets or sets the Version
/// </summary>
[JsonProperty("version")] [JsonProperty("version")]
/// <summary>
/// Gets or sets the Version
/// </summary>
public string Version { get; set; } public string Version { get; set; }
[JsonProperty("runtimeInfo")]
/// <summary> /// <summary>
/// Gets or sets the RuntimeInfo /// Gets or sets the RuntimeInfo
/// </summary> /// </summary>
[JsonProperty("runtimeInfo")]
public RuntimeInfo RuntimeInfo { get; set; } public RuntimeInfo RuntimeInfo { get; set; }
/// <summary>
/// Gets or sets the Comment
/// </summary>
[JsonProperty("comment")] [JsonProperty("comment")]
/// <summary>
/// Gets or sets the Comment
/// </summary>
public string Comment { get; set; } public string Comment { get; set; }
[JsonProperty("hostname")]
/// <summary> /// <summary>
/// Gets or sets the HostName /// Gets or sets the HostName
/// </summary> /// </summary>
[JsonProperty("hostname")]
public string HostName { get; set; } public string HostName { get; set; }
[JsonProperty("appNumber")]
/// <summary> /// <summary>
/// Gets or sets the AppNumber /// Gets or sets the AppNumber
/// </summary> /// </summary>
[JsonProperty("appNumber")]
public uint AppNumber { get; set; } public uint AppNumber { get; set; }
/// <summary>
/// InfoConfig Constructor
/// </summary>
public InfoConfig() public InfoConfig()
{ {
Name = ""; Name = "";