mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-29 12:24:59 +00:00
wip: update XML comments
This commit is contained in:
@@ -13,9 +13,15 @@ namespace PepperDash.Essentials.Core.Config
|
||||
/// </summary>
|
||||
public class AudioControlPointListItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Level controls for this audio control point
|
||||
/// </summary>
|
||||
[JsonProperty("levelControls")]
|
||||
public Dictionary<string, LevelControlListItem> LevelControls { get; set; } = new Dictionary<string, LevelControlListItem>();
|
||||
|
||||
/// <summary>
|
||||
/// Presets for this audio control point
|
||||
/// </summary>
|
||||
[JsonProperty("presets")]
|
||||
public Dictionary<string, PresetListItem> Presets { get; set; } = new Dictionary<string, PresetListItem>();
|
||||
|
||||
|
||||
@@ -14,33 +14,57 @@ namespace PepperDash.Essentials.Core.Config
|
||||
/// </summary>
|
||||
public class BasicConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Info
|
||||
/// </summary>
|
||||
[JsonProperty("info")]
|
||||
public InfoConfig Info { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Devices
|
||||
/// </summary>
|
||||
[JsonProperty("devices")]
|
||||
public List<DeviceConfig> Devices { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the SourceLists
|
||||
/// </summary>
|
||||
[JsonProperty("sourceLists")]
|
||||
public Dictionary<string, Dictionary<string, SourceListItem>> SourceLists { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the DestinationLists
|
||||
/// </summary>
|
||||
[JsonProperty("destinationLists")]
|
||||
public Dictionary<string, Dictionary<string, DestinationListItem>> DestinationLists { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the AudioControlPointLists
|
||||
/// </summary>
|
||||
[JsonProperty("audioControlPointLists")]
|
||||
public Dictionary<string, AudioControlPointListItem> AudioControlPointLists { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the CameraLists
|
||||
/// </summary>
|
||||
[JsonProperty("cameraLists")]
|
||||
public Dictionary<string, Dictionary<string, CameraListItem>> CameraLists { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the TieLines
|
||||
/// </summary>
|
||||
[JsonProperty("tieLines")]
|
||||
/// <summary>
|
||||
/// Gets or sets the TieLines
|
||||
/// </summary>
|
||||
public List<TieLineConfig> TieLines { get; set; }
|
||||
public List<TieLineConfig> TieLines { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the JoinMaps
|
||||
/// </summary>
|
||||
[JsonProperty("joinMaps")]
|
||||
public Dictionary<string, JObject> JoinMaps { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// BasicConfig Constructor
|
||||
/// </summary>
|
||||
public BasicConfig()
|
||||
{
|
||||
Info = new InfoConfig();
|
||||
@@ -98,6 +122,7 @@ namespace PepperDash.Essentials.Core.Config
|
||||
/// <summary>
|
||||
/// Checks CameraLists for a given list and returns it if found. Otherwise, returns null
|
||||
/// </summary>
|
||||
/// <param name="key">Key of desired camera list</param>
|
||||
public Dictionary<string, CameraListItem> 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
|
||||
/// </summary>
|
||||
/// <param name="key">Key of desired device</param>
|
||||
/// <returns></returns>
|
||||
/// <summary>
|
||||
/// GetDeviceForKey method
|
||||
/// </summary>
|
||||
public DeviceConfig GetDeviceForKey(string key)
|
||||
{
|
||||
if (string.IsNullOrEmpty(key))
|
||||
|
||||
@@ -18,17 +18,23 @@ namespace PepperDash.Essentials.Core.Config
|
||||
/// </summary>
|
||||
public class ConfigReader
|
||||
{
|
||||
/// <summary>
|
||||
/// Local Config Present Message
|
||||
/// </summary>
|
||||
public const string LocalConfigPresent =
|
||||
@"
|
||||
***************************************************
|
||||
************* Using Local config file *************
|
||||
***************************************************";
|
||||
|
||||
/// <summary>
|
||||
/// The loaded config object
|
||||
/// </summary>
|
||||
public static EssentialsConfig ConfigObject { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// LoadConfig2 method
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// LoadConfig2 method
|
||||
/// </summary>
|
||||
public static bool LoadConfig2()
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Information, "Loading unmerged system/template portal configuration file.");
|
||||
@@ -171,11 +177,8 @@ namespace PepperDash.Essentials.Core.Config
|
||||
/// <summary>
|
||||
/// Returns all the files from the directory specified.
|
||||
/// </summary>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
/// <summary>
|
||||
/// GetConfigFiles method
|
||||
/// </summary>
|
||||
/// <param name="filePath">path to the directory</param>
|
||||
/// <returns>config files</returns>
|
||||
public static FileInfo[] GetConfigFiles(string filePath)
|
||||
{
|
||||
// Get the directory
|
||||
@@ -206,11 +209,8 @@ namespace PepperDash.Essentials.Core.Config
|
||||
/// <summary>
|
||||
/// Returns the group for a given device key in config
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
/// <summary>
|
||||
/// GetGroupForDeviceKey method
|
||||
/// </summary>
|
||||
/// <param name="key">Key of the device</param>
|
||||
/// <returns>Group name if the device is found, null otherwise</returns>
|
||||
public static string GetGroupForDeviceKey(string key)
|
||||
{
|
||||
var dev = ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(key, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
@@ -16,13 +16,20 @@ using Serilog.Events;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Config
|
||||
{
|
||||
/// <summary>
|
||||
/// ConfigUpdater class
|
||||
/// </summary>
|
||||
public static class ConfigUpdater
|
||||
{
|
||||
/// <summary>
|
||||
/// ConfigStatusChanged event
|
||||
/// </summary>
|
||||
public static event EventHandler<ConfigStatusEventArgs> ConfigStatusChanged;
|
||||
|
||||
/// <summary>
|
||||
/// GetConfigFromServer method
|
||||
/// </summary>
|
||||
/// <param name="url">URL of the config server</param>
|
||||
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
|
||||
/// </summary>
|
||||
public enum eUpdateStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// UpdateStarted status
|
||||
/// </summary>
|
||||
UpdateStarted,
|
||||
|
||||
/// <summary>
|
||||
/// ConfigFileReceived status
|
||||
/// </summary>
|
||||
ConfigFileReceived,
|
||||
|
||||
/// <summary>
|
||||
/// ArchivingConfigs status
|
||||
/// </summary>
|
||||
ArchivingConfigs,
|
||||
|
||||
/// <summary>
|
||||
/// DeletingLocalConfig status
|
||||
/// </summary>
|
||||
DeletingLocalConfig,
|
||||
|
||||
/// <summary>
|
||||
/// WritingConfigFile status
|
||||
/// </summary>
|
||||
WritingConfigFile,
|
||||
|
||||
/// <summary>
|
||||
/// RestartingProgram status
|
||||
/// </summary>
|
||||
RestartingProgram,
|
||||
|
||||
/// <summary>
|
||||
/// UpdateSucceeded status
|
||||
/// </summary>
|
||||
UpdateSucceeded,
|
||||
|
||||
/// <summary>
|
||||
/// UpdateFailed status
|
||||
/// </summary>
|
||||
UpdateFailed
|
||||
}
|
||||
|
||||
@@ -230,6 +268,10 @@ namespace PepperDash.Essentials.Core.Config
|
||||
/// </summary>
|
||||
public eUpdateStatus UpdateStatus { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// ConfigStatusEventArgs Constructor
|
||||
/// </summary>
|
||||
/// <param name="status"></param>
|
||||
public ConfigStatusEventArgs(eUpdateStatus status)
|
||||
{
|
||||
UpdateStatus = status;
|
||||
|
||||
@@ -18,22 +18,29 @@ namespace PepperDash.Essentials.Core.Config
|
||||
/// </summary>
|
||||
public class ConfigWriter
|
||||
{
|
||||
/// <summary>
|
||||
/// LocalConfigFolder constant
|
||||
/// </summary>
|
||||
public const string LocalConfigFolder = "LocalConfig";
|
||||
|
||||
/// <summary>
|
||||
/// WriteTimeout constant
|
||||
/// </summary>
|
||||
public const long WriteTimeout = 30000;
|
||||
|
||||
/// <summary>
|
||||
/// WriteTimer variable
|
||||
/// </summary>
|
||||
public static CTimer WriteTimer;
|
||||
|
||||
static CCriticalSection fileLock = new CCriticalSection();
|
||||
|
||||
/// <summary>
|
||||
/// Updates the config properties of a device
|
||||
/// </summary>
|
||||
/// <param name="deviceKey"></param>
|
||||
/// <param name="properties"></param>
|
||||
/// <returns></returns>
|
||||
/// <summary>
|
||||
/// UpdateDeviceProperties method
|
||||
/// </summary>
|
||||
/// <param name="deviceKey">The key of the device to update</param>
|
||||
/// <param name="properties">The new properties for the device</param>
|
||||
/// <returns>True if the update was successful, otherwise false</returns>
|
||||
public static bool UpdateDeviceProperties(string deviceKey, JToken properties)
|
||||
{
|
||||
bool success = false;
|
||||
@@ -59,6 +66,8 @@ namespace PepperDash.Essentials.Core.Config
|
||||
/// <summary>
|
||||
/// UpdateDeviceConfig method
|
||||
/// </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)
|
||||
{
|
||||
bool success = false;
|
||||
@@ -82,6 +91,8 @@ namespace PepperDash.Essentials.Core.Config
|
||||
/// <summary>
|
||||
/// UpdateRoomConfig method
|
||||
/// </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)
|
||||
{
|
||||
bool success = false;
|
||||
@@ -118,7 +129,6 @@ namespace PepperDash.Essentials.Core.Config
|
||||
/// <summary>
|
||||
/// Writes the current config to a file in the LocalConfig subfolder
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static void WriteConfigFile(object o)
|
||||
{
|
||||
var filePath = Global.FilePathPrefix + LocalConfigFolder + Global.DirectorySeparator + "configurationFile.json";
|
||||
@@ -129,13 +139,10 @@ namespace PepperDash.Essentials.Core.Config
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes
|
||||
/// </summary>
|
||||
/// <param name="filepath"></param>
|
||||
/// <param name="o"></param>
|
||||
/// <summary>
|
||||
/// WriteFile method
|
||||
/// Writes the current config data to a file
|
||||
/// </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)
|
||||
{
|
||||
if (WriteTimer != null)
|
||||
|
||||
@@ -11,6 +11,9 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
public interface ILoadConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// GoWithLoad method
|
||||
/// </summary>
|
||||
void GoWithLoad();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,45 +12,57 @@ namespace PepperDash.Essentials.Core.Config
|
||||
/// </summary>
|
||||
public class InfoConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Name
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Date
|
||||
/// </summary>
|
||||
[JsonProperty("date")]
|
||||
public DateTime Date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Type
|
||||
/// </summary>
|
||||
[JsonProperty("type")]
|
||||
public string Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Version
|
||||
/// </summary>
|
||||
[JsonProperty("version")]
|
||||
/// <summary>
|
||||
/// Gets or sets the Version
|
||||
/// </summary>
|
||||
public string Version { get; set; }
|
||||
|
||||
[JsonProperty("runtimeInfo")]
|
||||
/// <summary>
|
||||
/// Gets or sets the RuntimeInfo
|
||||
/// </summary>
|
||||
[JsonProperty("runtimeInfo")]
|
||||
public RuntimeInfo RuntimeInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Comment
|
||||
/// </summary>
|
||||
[JsonProperty("comment")]
|
||||
/// <summary>
|
||||
/// Gets or sets the Comment
|
||||
/// </summary>
|
||||
public string Comment { get; set; }
|
||||
|
||||
[JsonProperty("hostname")]
|
||||
/// <summary>
|
||||
/// Gets or sets the HostName
|
||||
/// </summary>
|
||||
[JsonProperty("hostname")]
|
||||
public string HostName { get; set; }
|
||||
|
||||
[JsonProperty("appNumber")]
|
||||
/// <summary>
|
||||
/// Gets or sets the AppNumber
|
||||
/// </summary>
|
||||
[JsonProperty("appNumber")]
|
||||
public uint AppNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// InfoConfig Constructor
|
||||
/// </summary>
|
||||
public InfoConfig()
|
||||
{
|
||||
Name = "";
|
||||
|
||||
Reference in New Issue
Block a user