mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-08-31 19:08:29 +00:00
fix: remove references to Crestron.SimplSharp.CrestronIO
Replaced with System.IO. Also modified calls as necessary due to differences in API
This commit is contained in:
parent
9c81546a07
commit
083c270cf3
32 changed files with 3504 additions and 3509 deletions
|
|
@ -1,7 +1,7 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
|
|
@ -12,8 +12,8 @@ namespace PepperDash.Core.Config;
|
|||
/// <summary>
|
||||
/// Reads a Portal formatted config file
|
||||
/// </summary>
|
||||
public class PortalConfigReader
|
||||
{
|
||||
public class PortalConfigReader
|
||||
{
|
||||
/// <summary>
|
||||
/// Reads the config file, checks if it needs a merge, merges and saves, then returns the merged Object.
|
||||
/// </summary>
|
||||
|
|
@ -31,7 +31,7 @@ namespace PepperDash.Core.Config;
|
|||
using (StreamReader fs = new StreamReader(filePath))
|
||||
{
|
||||
var jsonObj = JObject.Parse(fs.ReadToEnd());
|
||||
if(jsonObj["template"] != null && jsonObj["system"] != null)
|
||||
if (jsonObj["template"] != null && jsonObj["system"] != null)
|
||||
{
|
||||
// it's a double-config, merge it.
|
||||
var merged = MergeConfigs(jsonObj);
|
||||
|
|
@ -231,4 +231,4 @@ namespace PepperDash.Core.Config;
|
|||
}
|
||||
return o1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3,8 +3,8 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using static Crestron.SimplSharp.Net.Http;
|
||||
using static Crestron.SimplSharp.Net.Https;
|
||||
using Crestron.SimplSharp.Net.Http;
|
||||
using Crestron.SimplSharp.Net.Https;
|
||||
|
||||
namespace PepperDash.Core.GenericRESTfulCommunications;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace PepperDash.Core.JsonToSimpl;
|
||||
|
|
@ -92,7 +92,7 @@ public class JsonToSimplFileMaster : JsonToSimplMaster
|
|||
OnStringChange(roomName, 0, JsonToSimplConstants.RoomNameChange);
|
||||
}
|
||||
|
||||
var rootDirectory = Directory.GetApplicationRootDirectory();
|
||||
var rootDirectory = Directory.GetCurrentDirectory();
|
||||
OnStringChange(rootDirectory, 0, JsonToSimplConstants.RootDirectoryChange);
|
||||
|
||||
var splusPath = string.Empty;
|
||||
|
|
@ -161,7 +161,7 @@ public class JsonToSimplFileMaster : JsonToSimplMaster
|
|||
OnStringChange(string.Format(@"JSON File Path is {0}", actualFile.DirectoryName), 0, JsonToSimplConstants.StringValueChange);
|
||||
Debug.Console(1, "JSON File Path is {0}", FilePathName);
|
||||
|
||||
var json = File.ReadToEnd(ActualFilePath, System.Text.Encoding.ASCII);
|
||||
var json = File.ReadAllText(ActualFilePath, System.Text.Encoding.ASCII);
|
||||
|
||||
JsonObject = JObject.Parse(json);
|
||||
foreach (var child in Children)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core.Config;
|
||||
|
||||
|
|
@ -92,7 +92,7 @@ public class JsonToSimplPortalFileMaster : JsonToSimplMaster
|
|||
// At this point we should have a local file. Do it.
|
||||
Debug.Console(1, "Reading local JSON file {0}", ActualFilePath);
|
||||
|
||||
string json = File.ReadToEnd(ActualFilePath, System.Text.Encoding.ASCII);
|
||||
string json = File.ReadAllText(ActualFilePath, System.Text.Encoding.ASCII);
|
||||
|
||||
try
|
||||
{
|
||||
|
|
@ -187,4 +187,4 @@ public class JsonToSimplPortalFileMaster : JsonToSimplMaster
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Text.RegularExpressions;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronDataStore;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharp.CrestronLogger;
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Core.Logging;
|
||||
|
|
@ -142,8 +142,8 @@ public static class Debug
|
|||
_websocketSink = new DebugWebsocketSink(new JsonFormatter(renderMessage: true));
|
||||
|
||||
var logFilePath = CrestronEnvironment.DevicePlatform == eDevicePlatform.Appliance ?
|
||||
$@"{Directory.GetApplicationRootDirectory()}{Path.DirectorySeparatorChar}user{Path.DirectorySeparatorChar}debug{Path.DirectorySeparatorChar}app{InitialParametersClass.ApplicationNumber}{Path.DirectorySeparatorChar}global-log.log" :
|
||||
$@"{Directory.GetApplicationRootDirectory()}{Path.DirectorySeparatorChar}user{Path.DirectorySeparatorChar}debug{Path.DirectorySeparatorChar}room{InitialParametersClass.RoomId}{Path.DirectorySeparatorChar}global-log.log";
|
||||
$@"{Directory.GetCurrentDirectory()}{Path.DirectorySeparatorChar}user{Path.DirectorySeparatorChar}debug{Path.DirectorySeparatorChar}app{InitialParametersClass.ApplicationNumber}{Path.DirectorySeparatorChar}global-log.log" :
|
||||
$@"{Directory.GetCurrentDirectory()}{Path.DirectorySeparatorChar}user{Path.DirectorySeparatorChar}debug{Path.DirectorySeparatorChar}room{InitialParametersClass.RoomId}{Path.DirectorySeparatorChar}global-log.log";
|
||||
|
||||
CrestronConsole.PrintLine($"Saving log files to {logFilePath}");
|
||||
|
||||
|
|
@ -1004,7 +1004,7 @@ public static class Debug
|
|||
return string.Format(@"\user\debugSettings\program{0}", InitialParametersClass.ApplicationNumber);
|
||||
}
|
||||
|
||||
return string.Format("{0}{1}user{1}debugSettings{1}{2}.json", Directory.GetApplicationRootDirectory(), Path.DirectorySeparatorChar, InitialParametersClass.RoomId);
|
||||
return string.Format("{0}{1}user{1}debugSettings{1}{2}.json", Directory.GetCurrentDirectory(), Path.DirectorySeparatorChar, InitialParametersClass.RoomId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,15 +2,15 @@
|
|||
|
||||
namespace PepperDash.Core.Web.RequestHandlers;
|
||||
|
||||
/// <summary>
|
||||
/// Web API default request handler
|
||||
/// </summary>
|
||||
public class DefaultRequestHandler : WebApiBaseRequestHandler
|
||||
{
|
||||
/// <summary>
|
||||
/// Web API default request handler
|
||||
/// </summary>
|
||||
public class DefaultRequestHandler : WebApiBaseRequestHandler
|
||||
{
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
public DefaultRequestHandler()
|
||||
: base(true)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
using Crestron.SimplSharp.WebScripting;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Crestron.SimplSharp.WebScripting;
|
||||
|
||||
namespace PepperDash.Core.Web.RequestHandlers;
|
||||
|
||||
public abstract class WebApiBaseRequestAsyncHandler:IHttpCwsHandler
|
||||
public abstract class WebApiBaseRequestAsyncHandler : IHttpCwsHandler
|
||||
{
|
||||
private readonly Dictionary<string, Func<HttpCwsContext, Task>> _handlers;
|
||||
protected readonly bool EnableCors;
|
||||
|
|
|
|||
|
|
@ -4,11 +4,11 @@ using Crestron.SimplSharp.WebScripting;
|
|||
|
||||
namespace PepperDash.Core.Web.RequestHandlers;
|
||||
|
||||
/// <summary>
|
||||
/// CWS Base Handler, implements IHttpCwsHandler
|
||||
/// </summary>
|
||||
public abstract class WebApiBaseRequestHandler : IHttpCwsHandler
|
||||
{
|
||||
/// <summary>
|
||||
/// CWS Base Handler, implements IHttpCwsHandler
|
||||
/// </summary>
|
||||
public abstract class WebApiBaseRequestHandler : IHttpCwsHandler
|
||||
{
|
||||
private readonly Dictionary<string, Action<HttpCwsContext>> _handlers;
|
||||
protected readonly bool EnableCors;
|
||||
|
||||
|
|
@ -161,4 +161,4 @@ namespace PepperDash.Core.Web.RequestHandlers;
|
|||
|
||||
handler(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -9,11 +9,11 @@ using PepperDash.Core.Web.RequestHandlers;
|
|||
|
||||
namespace PepperDash.Core.Web;
|
||||
|
||||
/// <summary>
|
||||
/// Web API server
|
||||
/// </summary>
|
||||
public class WebApiServer : IKeyName
|
||||
{
|
||||
/// <summary>
|
||||
/// Web API server
|
||||
/// </summary>
|
||||
public class WebApiServer : IKeyName
|
||||
{
|
||||
private const string SplusKey = "Uninitialized Web API Server";
|
||||
private const string DefaultName = "Web API Server";
|
||||
private const string DefaultBasePath = "/api";
|
||||
|
|
@ -280,4 +280,4 @@ namespace PepperDash.Core.Web;
|
|||
Debug.Console(DebugVerbose, this, "ReceivedRequestEventHandler Exception InnerException: {0}", ex.InnerException);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using Crestron.SimplSharp; // For Basic SIMPL# Classes
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharp.Net.Http;
|
||||
using Crestron.SimplSharp.Net.Https;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core.JsonToSimpl;
|
||||
using static Crestron.SimplSharp.Net.Http;
|
||||
using static Crestron.SimplSharp.Net.Https;
|
||||
|
||||
|
||||
namespace PepperDash.Core.WebApi.Presets;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using PepperDash.Core.Intersystem.Serialization;
|
||||
using PepperDash.Core.Intersystem.Tokens;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using System.IO;
|
||||
using PepperDash.Core.Intersystem.Serialization;
|
||||
using PepperDash.Core.Intersystem.Tokens;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using PepperDash.Core.Intersystem.Serialization;
|
||||
using PepperDash.Core.Intersystem.Tokens;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,9 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
|
|
@ -14,11 +13,11 @@ using Serilog.Events;
|
|||
|
||||
namespace PepperDash.Essentials.Core;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static class IRPortHelper
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static class IRPortHelper
|
||||
{
|
||||
public static string IrDriverPathPrefix
|
||||
{
|
||||
get
|
||||
|
|
@ -151,18 +150,18 @@ namespace PepperDash.Essentials.Core;
|
|||
return null;
|
||||
}
|
||||
|
||||
var postActivationFunc = new Func<DeviceConfig,IROutputPort> (GetIrOutputPort);
|
||||
var postActivationFunc = new Func<DeviceConfig, IROutputPort>(GetIrOutputPort);
|
||||
var irDevice = new IrOutputPortController(config.Key + "-ir", postActivationFunc, config);
|
||||
|
||||
return irDevice;
|
||||
}
|
||||
|
||||
/*
|
||||
/// <summary>
|
||||
/// Returns a ready-to-go IrOutputPortController from a DeviceConfig object.
|
||||
/// </summary>
|
||||
public static IrOutputPortController GetIrOutputPortController(DeviceConfig devConf)
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns a ready-to-go IrOutputPortController from a DeviceConfig object.
|
||||
/// </summary>
|
||||
public static IrOutputPortController GetIrOutputPortController(DeviceConfig devConf)
|
||||
{
|
||||
var irControllerKey = devConf.Key + "-ir";
|
||||
if (devConf.Properties == null)
|
||||
{
|
||||
|
|
@ -219,14 +218,14 @@ namespace PepperDash.Essentials.Core;
|
|||
portDevKey, portNum);
|
||||
return c;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wrapper to help in IR port creation
|
||||
/// </summary>
|
||||
public class IrOutPortConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Wrapper to help in IR port creation
|
||||
/// </summary>
|
||||
public class IrOutPortConfig
|
||||
{
|
||||
[JsonProperty("port")]
|
||||
public IROutputPort Port { get; set; }
|
||||
|
||||
|
|
@ -240,4 +239,4 @@ namespace PepperDash.Essentials.Core;
|
|||
{
|
||||
FileName = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2,10 +2,9 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
|
|
@ -47,7 +46,7 @@ public class DeviceConfig
|
|||
//Properties = JToken.FromObject(dc.Properties);
|
||||
}
|
||||
|
||||
public DeviceConfig() {}
|
||||
public DeviceConfig() { }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
|
|
@ -13,11 +13,11 @@ using Serilog.Events;
|
|||
|
||||
namespace PepperDash.Essentials.Core.Config;
|
||||
|
||||
/// <summary>
|
||||
/// Loads the ConfigObject from the file
|
||||
/// </summary>
|
||||
public class ConfigReader
|
||||
{
|
||||
/// <summary>
|
||||
/// Loads the ConfigObject from the file
|
||||
/// </summary>
|
||||
public class ConfigReader
|
||||
{
|
||||
public const string LocalConfigPresent =
|
||||
@"
|
||||
***************************************************
|
||||
|
|
@ -50,7 +50,7 @@ namespace PepperDash.Essentials.Core.Config;
|
|||
"****Error: Multiple Local Configuration files present. Please ensure only a single file exists and reset program.****");
|
||||
return false;
|
||||
}
|
||||
if(configFiles.Length == 1)
|
||||
if (configFiles.Length == 1)
|
||||
{
|
||||
localConfigFound = true;
|
||||
|
||||
|
|
@ -64,7 +64,7 @@ namespace PepperDash.Essentials.Core.Config;
|
|||
}
|
||||
|
||||
// Check for Portal Config
|
||||
if(!localConfigFound)
|
||||
if (!localConfigFound)
|
||||
{
|
||||
filePath = Global.FilePathPrefix + Global.ConfigFileName;
|
||||
|
||||
|
|
@ -253,4 +253,4 @@ namespace PepperDash.Essentials.Core.Config;
|
|||
Debug.LogMessage(LogEventLevel.Information, newDebugString.ToString());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -2,15 +2,14 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Crestron.SimplSharp.Net.Http;
|
||||
using Crestron.SimplSharpPro.Diagnostics;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
using Serilog.Events;
|
||||
|
||||
|
|
@ -71,7 +70,7 @@ public static class ConfigUpdater
|
|||
{
|
||||
var handler = ConfigStatusChanged;
|
||||
|
||||
if(handler != null)
|
||||
if (handler != null)
|
||||
{
|
||||
handler(typeof(ConfigUpdater), new ConfigStatusEventArgs(status));
|
||||
}
|
||||
|
|
@ -79,7 +78,7 @@ public static class ConfigUpdater
|
|||
|
||||
static void WriteConfigToFile(string configData)
|
||||
{
|
||||
var filePath = Global.FilePathPrefix+ "configurationFile-updated.json";
|
||||
var filePath = Global.FilePathPrefix + "configurationFile-updated.json";
|
||||
|
||||
try
|
||||
{
|
||||
|
|
@ -132,18 +131,18 @@ public static class ConfigUpdater
|
|||
if (!Directory.Exists(archiveDirectoryPath))
|
||||
{
|
||||
// Directory does not exist, create it
|
||||
Directory.Create(archiveDirectoryPath);
|
||||
Directory.CreateDirectory(archiveDirectoryPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Directory exists, first clear any contents
|
||||
var archivedConfigFiles = ConfigReader.GetConfigFiles(archiveDirectoryPath + Global.DirectorySeparator + Global.ConfigFileName + ".bak");
|
||||
|
||||
if(archivedConfigFiles != null || archivedConfigFiles.Length > 0)
|
||||
if (archivedConfigFiles != null || archivedConfigFiles.Length > 0)
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Information, "{0} Existing files found in archive folder. Deleting.", archivedConfigFiles.Length);
|
||||
|
||||
for (int i = 0; i < archivedConfigFiles.Length; i++ )
|
||||
for (int i = 0; i < archivedConfigFiles.Length; i++)
|
||||
{
|
||||
var file = archivedConfigFiles[i];
|
||||
Debug.LogMessage(LogEventLevel.Information, "Deleting archived file: '{0}'", file.FullName);
|
||||
|
|
@ -160,7 +159,7 @@ public static class ConfigUpdater
|
|||
|
||||
// Moves the file and appends the .bak extension
|
||||
var fileDest = archiveDirectoryPath + "/" + file.Name + ".bak";
|
||||
if(!File.Exists(fileDest))
|
||||
if (!File.Exists(fileDest))
|
||||
{
|
||||
file.MoveTo(fileDest);
|
||||
}
|
||||
|
|
@ -202,7 +201,7 @@ public static class ConfigUpdater
|
|||
|
||||
}
|
||||
|
||||
public enum eUpdateStatus
|
||||
public enum eUpdateStatus
|
||||
{
|
||||
UpdateStarted,
|
||||
ConfigFileReceived,
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
|
|
|
|||
|
|
@ -2,20 +2,18 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Config;
|
||||
|
||||
/// <summary>
|
||||
/// Loads the ConfigObject from the file
|
||||
/// </summary>
|
||||
public class EssentialsConfig : BasicConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Loads the ConfigObject from the file
|
||||
/// </summary>
|
||||
public class EssentialsConfig : BasicConfig
|
||||
{
|
||||
[JsonProperty("system_url")]
|
||||
public string SystemUrl { get; set; }
|
||||
|
||||
|
|
@ -36,7 +34,8 @@ namespace PepperDash.Essentials.Core.Config;
|
|||
var result = Regex.Match(SystemUrl, @"https?:\/\/.*\/systems\/(.*)\/#.*");
|
||||
string uuid = result.Groups[1].Value;
|
||||
return uuid;
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
var result = Regex.Match(SystemUrl, @"https?:\/\/.*\/systems\/(.*)\/.*");
|
||||
string uuid = result.Groups[1].Value;
|
||||
|
|
@ -58,7 +57,8 @@ namespace PepperDash.Essentials.Core.Config;
|
|||
var result = Regex.Match(TemplateUrl, @"https?:\/\/.*\/templates\/(.*)\/#.*");
|
||||
string uuid = result.Groups[1].Value;
|
||||
return uuid;
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
var result = Regex.Match(TemplateUrl, @"https?:\/\/.*\/system-templates\/(.*)\/system-template-versions\/(.*)\/.*");
|
||||
string uuid = result.Groups[2].Value;
|
||||
|
|
@ -76,14 +76,14 @@ namespace PepperDash.Essentials.Core.Config;
|
|||
{
|
||||
Rooms = new List<DeviceConfig>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class SystemTemplateConfigs
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class SystemTemplateConfigs
|
||||
{
|
||||
public EssentialsConfig System { get; set; }
|
||||
|
||||
public EssentialsConfig Template { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,17 +1,17 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using PepperDash.Core;
|
||||
using Crestron.SimplSharpPro.CrestronThread;
|
||||
using PepperDash.Core;
|
||||
using Serilog.Events;
|
||||
|
||||
namespace PepperDash.Essentials.Core;
|
||||
|
||||
public static class FileIO
|
||||
{
|
||||
public static class FileIO
|
||||
{
|
||||
|
||||
static CCriticalSection fileLock = new CCriticalSection();
|
||||
public delegate void GotFileEventHandler(object sender, FileEventArgs e);
|
||||
|
|
@ -267,10 +267,10 @@ namespace PepperDash.Essentials.Core;
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
public class FileEventArgs
|
||||
{
|
||||
}
|
||||
public class FileEventArgs
|
||||
{
|
||||
public FileEventArgs(string data) { Data = data; }
|
||||
public string Data { get; private set; } // readonly
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,11 @@
|
|||
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharp.CrestronXml;
|
||||
using Crestron.SimplSharp.CrestronXml.Serialization;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
|
@ -11,10 +15,6 @@ using PepperDash.Core;
|
|||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||
using Serilog.Events;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Fusion;
|
||||
|
||||
|
|
@ -301,7 +301,7 @@ public class EssentialsHuddleSpaceFusionSystemControllerBase : Device, IOccupanc
|
|||
|
||||
if (File.Exists(filePath))
|
||||
{
|
||||
var json = File.ReadToEnd(filePath, Encoding.ASCII);
|
||||
var json = File.ReadAllText(filePath, Encoding.ASCII);
|
||||
|
||||
_guiDs = JsonConvert.DeserializeObject<FusionRoomGuids>(json);
|
||||
|
||||
|
|
@ -490,7 +490,7 @@ public class EssentialsHuddleSpaceFusionSystemControllerBase : Device, IOccupanc
|
|||
{
|
||||
var join = JoinMap.ProgramNameStart.JoinNumber + i;
|
||||
var progNum = i + 1;
|
||||
_program[i] = FusionRoom.CreateOffsetStringSig((uint) join,
|
||||
_program[i] = FusionRoom.CreateOffsetStringSig((uint)join,
|
||||
string.Format("{0} {1}", JoinMap.ProgramNameStart.AttributeName, progNum), eSigIoMask.InputSigOnly);
|
||||
}
|
||||
}
|
||||
|
|
@ -519,7 +519,7 @@ public class EssentialsHuddleSpaceFusionSystemControllerBase : Device, IOccupanc
|
|||
{
|
||||
if (args.DeviceOnLine)
|
||||
{
|
||||
CrestronInvoke.BeginInvoke( (o) =>
|
||||
CrestronInvoke.BeginInvoke((o) =>
|
||||
{
|
||||
CrestronEnvironment.Sleep(200);
|
||||
|
||||
|
|
@ -658,7 +658,7 @@ public class EssentialsHuddleSpaceFusionSystemControllerBase : Device, IOccupanc
|
|||
var extendTime = _currentMeeting.dtEnd - DateTime.Now;
|
||||
var extendMinutesRaw = extendTime.TotalMinutes;
|
||||
|
||||
extendMinutes += (int) Math.Round(extendMinutesRaw);
|
||||
extendMinutes += (int)Math.Round(extendMinutesRaw);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -827,9 +827,9 @@ public class EssentialsHuddleSpaceFusionSystemControllerBase : Device, IOccupanc
|
|||
Debug.LogMessage(LogEventLevel.Debug, this, "DateTime from Fusion Server: {0}", currentTime);
|
||||
|
||||
// Parse time and date from response and insert values
|
||||
CrestronEnvironment.SetTimeAndDate((ushort) currentTime.Hour, (ushort) currentTime.Minute,
|
||||
(ushort) currentTime.Second, (ushort) currentTime.Month, (ushort) currentTime.Day,
|
||||
(ushort) currentTime.Year);
|
||||
CrestronEnvironment.SetTimeAndDate((ushort)currentTime.Hour, (ushort)currentTime.Minute,
|
||||
(ushort)currentTime.Second, (ushort)currentTime.Month, (ushort)currentTime.Day,
|
||||
(ushort)currentTime.Year);
|
||||
|
||||
Debug.LogMessage(LogEventLevel.Debug, this, "Processor time set to {0}", CrestronEnvironment.GetLocalTime());
|
||||
}
|
||||
|
|
@ -1093,7 +1093,7 @@ public class EssentialsHuddleSpaceFusionSystemControllerBase : Device, IOccupanc
|
|||
|
||||
foreach (var usageDevice in dict.Select(kvp => kvp.Value.SourceDevice).OfType<IUsageTracking>())
|
||||
{
|
||||
usageDevice.UsageTracker = new UsageTracking(usageDevice as Device) {UsageIsTracked = true};
|
||||
usageDevice.UsageTracker = new UsageTracking(usageDevice as Device) { UsageIsTracked = true };
|
||||
usageDevice.UsageTracker.DeviceUsageEnded += UsageTracker_DeviceUsageEnded;
|
||||
}
|
||||
}
|
||||
|
|
@ -1279,7 +1279,7 @@ public class EssentialsHuddleSpaceFusionSystemControllerBase : Device, IOccupanc
|
|||
|
||||
foreach (var display in displays.Cast<IDisplay>())
|
||||
{
|
||||
display.UsageTracker = new UsageTracking(display as Device) {UsageIsTracked = true};
|
||||
display.UsageTracker = new UsageTracking(display as Device) { UsageIsTracked = true };
|
||||
display.UsageTracker.DeviceUsageEnded += UsageTracker_DeviceUsageEnded;
|
||||
}
|
||||
|
||||
|
|
@ -1392,7 +1392,7 @@ public class EssentialsHuddleSpaceFusionSystemControllerBase : Device, IOccupanc
|
|||
|
||||
|
||||
// Power on
|
||||
var defaultDisplayPowerOn = FusionRoom.CreateOffsetBoolSig((uint) joinOffset, displayName + "Power On",
|
||||
var defaultDisplayPowerOn = FusionRoom.CreateOffsetBoolSig((uint)joinOffset, displayName + "Power On",
|
||||
eSigIoMask.InputOutputSig);
|
||||
defaultDisplayPowerOn.OutputSig.UserObject = new Action<bool>(b =>
|
||||
{
|
||||
|
|
@ -1403,7 +1403,7 @@ public class EssentialsHuddleSpaceFusionSystemControllerBase : Device, IOccupanc
|
|||
});
|
||||
|
||||
// Power Off
|
||||
var defaultDisplayPowerOff = FusionRoom.CreateOffsetBoolSig((uint) joinOffset + 1, displayName + "Power Off",
|
||||
var defaultDisplayPowerOff = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 1, displayName + "Power Off",
|
||||
eSigIoMask.InputOutputSig);
|
||||
defaultDisplayPowerOn.OutputSig.UserObject = new Action<bool>(b =>
|
||||
{
|
||||
|
|
@ -1421,7 +1421,7 @@ public class EssentialsHuddleSpaceFusionSystemControllerBase : Device, IOccupanc
|
|||
}
|
||||
|
||||
// Current Source
|
||||
var defaultDisplaySourceNone = FusionRoom.CreateOffsetBoolSig((uint) joinOffset + 8,
|
||||
var defaultDisplaySourceNone = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 8,
|
||||
displayName + "Source None", eSigIoMask.InputOutputSig);
|
||||
defaultDisplaySourceNone.OutputSig.UserObject = new Action<bool>(b =>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,27 +1,25 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Globalization;
|
||||
using Crestron.SimplSharp;
|
||||
using System.Collections.Generic;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharp.CrestronDataStore;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.License;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json.Schema;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.License;
|
||||
using Serilog.Events;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core;
|
||||
|
||||
public static class Global
|
||||
{
|
||||
public static class Global
|
||||
{
|
||||
public static CrestronControlSystem ControlSystem { get; set; }
|
||||
|
||||
public static eDevicePlatform Platform { get { return CrestronEnvironment.DevicePlatform; } }
|
||||
|
|
@ -43,9 +41,9 @@ namespace PepperDash.Essentials.Core;
|
|||
{
|
||||
get
|
||||
{
|
||||
if(ControlSystem.SystemControl != null)
|
||||
if (ControlSystem.SystemControl != null)
|
||||
{
|
||||
if(ControlSystem.SystemControl.SystemControlType > 0)
|
||||
if (ControlSystem.SystemControl.SystemControlType > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
@ -61,9 +59,9 @@ namespace PepperDash.Essentials.Core;
|
|||
{
|
||||
get
|
||||
{
|
||||
if(ControlSystem.SystemControl != null)
|
||||
if (ControlSystem.SystemControl != null)
|
||||
{
|
||||
if(ControlSystem.SystemControl.SystemControlType == eSystemControlType.Dmps34K150CSystemControl ||
|
||||
if (ControlSystem.SystemControl.SystemControlType == eSystemControlType.Dmps34K150CSystemControl ||
|
||||
ControlSystem.SystemControl.SystemControlType == eSystemControlType.Dmps34K200CSystemControl ||
|
||||
ControlSystem.SystemControl.SystemControlType == eSystemControlType.Dmps34K250CSystemControl ||
|
||||
ControlSystem.SystemControl.SystemControlType == eSystemControlType.Dmps34K300CSystemControl ||
|
||||
|
|
@ -83,9 +81,9 @@ namespace PepperDash.Essentials.Core;
|
|||
{
|
||||
get
|
||||
{
|
||||
if(ControlSystem.SystemControl != null)
|
||||
if (ControlSystem.SystemControl != null)
|
||||
{
|
||||
if(ControlSystem.SystemControl.SystemControlType == eSystemControlType.Dmps34K200CSystemControl ||
|
||||
if (ControlSystem.SystemControl.SystemControlType == eSystemControlType.Dmps34K200CSystemControl ||
|
||||
ControlSystem.SystemControl.SystemControlType == eSystemControlType.Dmps34K250CSystemControl ||
|
||||
ControlSystem.SystemControl.SystemControlType == eSystemControlType.Dmps34K300CSystemControl ||
|
||||
ControlSystem.SystemControl.SystemControlType == eSystemControlType.Dmps34K350CSystemControl)
|
||||
|
|
@ -109,7 +107,7 @@ namespace PepperDash.Essentials.Core;
|
|||
{
|
||||
get
|
||||
{
|
||||
return Crestron.SimplSharp.CrestronIO.Directory.GetApplicationDirectory();
|
||||
return Directory.GetCurrentDirectory();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -209,7 +207,7 @@ namespace PepperDash.Essentials.Core;
|
|||
|
||||
if (String.IsNullOrEmpty(minimumVersion))
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Information,"Plugin does not specify a minimum version. Loading plugin may not work as expected. Proceeding with loading plugin");
|
||||
Debug.LogMessage(LogEventLevel.Information, "Plugin does not specify a minimum version. Loading plugin may not work as expected. Proceeding with loading plugin");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -292,4 +290,4 @@ namespace PepperDash.Essentials.Core;
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -3,16 +3,14 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Reflection;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Serilog.Events;
|
||||
|
||||
namespace PepperDash.Essentials.Core;
|
||||
|
|
@ -101,7 +99,7 @@ public abstract class JoinMapBaseAdvanced
|
|||
JoinOffset = joinStart - 1;
|
||||
}
|
||||
|
||||
protected JoinMapBaseAdvanced(uint joinStart, Type type):this(joinStart)
|
||||
protected JoinMapBaseAdvanced(uint joinStart, Type type) : this(joinStart)
|
||||
{
|
||||
AddJoins(type);
|
||||
}
|
||||
|
|
@ -110,7 +108,7 @@ public abstract class JoinMapBaseAdvanced
|
|||
{
|
||||
var fields =
|
||||
type.GetFields(BindingFlags.Public | BindingFlags.Instance)
|
||||
.Where(f => f.IsDefined(typeof (JoinNameAttribute), true)).ToList();
|
||||
.Where(f => f.IsDefined(typeof(JoinNameAttribute), true)).ToList();
|
||||
|
||||
Debug.LogMessage(LogEventLevel.Debug, "Got {fields} with JoinNameAttribute", fields.Count);
|
||||
|
||||
|
|
@ -244,7 +242,7 @@ public abstract class JoinMapBaseAdvanced
|
|||
const int joinSpanLen = 9;
|
||||
const int typeLen = 19;
|
||||
const int capabilitiesLen = 12;
|
||||
var descriptionLen = (from @join in joins select @join.Value into j select j.Metadata.Description.Length).Concat(new[] {11}).Max();
|
||||
var descriptionLen = (from @join in joins select @join.Value into j select j.Metadata.Description.Length).Concat(new[] { 11 }).Max();
|
||||
|
||||
//build header
|
||||
sb.Append(string.Format(stringFormatter,
|
||||
|
|
@ -488,7 +486,7 @@ public class JoinDataComplete
|
|||
/// </summary>
|
||||
public uint JoinNumber
|
||||
{
|
||||
get { return _data.JoinNumber+ _joinOffset; }
|
||||
get { return _data.JoinNumber + _joinOffset; }
|
||||
set { _data.JoinNumber = value; }
|
||||
}
|
||||
|
||||
|
|
@ -529,7 +527,7 @@ public class JoinNameAttribute : Attribute
|
|||
|
||||
public JoinNameAttribute(string name)
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Verbose, "Setting Attribute Name: {0}",null, name);
|
||||
Debug.LogMessage(LogEventLevel.Verbose, "Setting Attribute Name: {0}", null, name);
|
||||
_Name = name;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,12 +2,11 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Core;
|
||||
|
||||
//using SSMono.IO;
|
||||
using PepperDash.Core.WebApi.Presets;
|
||||
using Serilog.Events;
|
||||
|
|
@ -127,7 +126,7 @@ public class DevicePresetsModel : Device
|
|||
PresetsAreLoaded = false;
|
||||
try
|
||||
{
|
||||
var pl = JsonConvert.DeserializeObject<PresetsList>(File.ReadToEnd(_filePath, Encoding.ASCII));
|
||||
var pl = JsonConvert.DeserializeObject<PresetsList>(File.ReadAllText(_filePath, Encoding.ASCII));
|
||||
Name = pl.Name;
|
||||
PresetsList = pl.Channels;
|
||||
|
||||
|
|
@ -271,12 +270,13 @@ public class DevicePresetsModel : Device
|
|||
try
|
||||
{
|
||||
_fileOps.Enter();
|
||||
var pl = new PresetsList {Channels = PresetsList, Name = Name};
|
||||
var pl = new PresetsList { Channels = PresetsList, Name = Name };
|
||||
var json = JsonConvert.SerializeObject(pl, Formatting.Indented);
|
||||
|
||||
using (var file = File.Open(_filePath, FileMode.Truncate))
|
||||
{
|
||||
file.Write(json, Encoding.UTF8);
|
||||
var bytes = Encoding.UTF8.GetBytes(json);
|
||||
file.Write(bytes, 0, bytes.Length);
|
||||
}
|
||||
}
|
||||
finally
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
|
@ -13,11 +12,11 @@ using Serilog.Events;
|
|||
|
||||
namespace PepperDash.Essentials.Core.Config;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the configuration data for a single tie line between two routing ports.
|
||||
/// </summary>
|
||||
public class TieLineConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the configuration data for a single tie line between two routing ports.
|
||||
/// </summary>
|
||||
public class TieLineConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// The key of the source device.
|
||||
/// </summary>
|
||||
|
|
@ -62,7 +61,7 @@ namespace PepperDash.Essentials.Core.Config;
|
|||
/// <returns>null if config data does not match ports, cards or devices</returns>
|
||||
public TieLine GetTieLine()
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Information, "Build TieLine: {0}",null, this);
|
||||
Debug.LogMessage(LogEventLevel.Information, "Build TieLine: {0}", null, this);
|
||||
// Get the source device
|
||||
var sourceDev = DeviceManager.GetDeviceForKey(SourceKey) as IRoutingOutputs;
|
||||
if (sourceDev == null)
|
||||
|
|
@ -106,7 +105,7 @@ namespace PepperDash.Essentials.Core.Config;
|
|||
/// <param name="msg">The specific error message.</param>
|
||||
void LogError(string msg)
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Error, "WARNING: Cannot create tie line: {message}:\r {tieLineConfig}",null, msg, this);
|
||||
Debug.LogMessage(LogEventLevel.Error, "WARNING: Cannot create tie line: {message}:\r {tieLineConfig}", null, msg, this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -118,4 +117,4 @@ namespace PepperDash.Essentials.Core.Config;
|
|||
return string.Format("{0}.{1}.{2} --> {3}.{4}.{5}", SourceKey, SourceCard, SourcePort,
|
||||
DestinationKey, DestinationCard, DestinationPort);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,19 +1,19 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using PepperDash.Core;
|
||||
using Crestron.SimplSharpPro.UI;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.UI;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using Serilog.Events;
|
||||
|
||||
namespace PepperDash.Essentials.Core.UI;
|
||||
|
||||
public abstract class TouchpanelBase: EssentialsDevice, IHasBasicTriListWithSmartObject
|
||||
public abstract class TouchpanelBase : EssentialsDevice, IHasBasicTriListWithSmartObject
|
||||
{
|
||||
protected CrestronTouchpanelPropertiesConfig _config;
|
||||
public BasicTriListWithSmartObject Panel { get; private set; }
|
||||
|
|
@ -29,7 +29,7 @@ public abstract class TouchpanelBase: EssentialsDevice, IHasBasicTriListWithSmar
|
|||
/// <param name="config">Touchpanel Configuration</param>
|
||||
/// <param name="id">IP-ID to use for touch panel</param>
|
||||
protected TouchpanelBase(string key, string name, BasicTriListWithSmartObject panel, CrestronTouchpanelPropertiesConfig config)
|
||||
:base(key, name)
|
||||
: base(key, name)
|
||||
{
|
||||
|
||||
if (panel == null)
|
||||
|
|
@ -54,7 +54,8 @@ public abstract class TouchpanelBase: EssentialsDevice, IHasBasicTriListWithSmar
|
|||
|
||||
_config = config;
|
||||
|
||||
AddPreActivationAction(() => {
|
||||
AddPreActivationAction(() =>
|
||||
{
|
||||
if (Panel.Register() != eDeviceRegistrationUnRegistrationResponse.Success)
|
||||
Debug.LogMessage(LogEventLevel.Information, this, "WARNING: Registration failed. Continuing, but panel may not function: {0}", Panel.RegistrationFailureReason);
|
||||
|
||||
|
|
@ -168,7 +169,7 @@ public abstract class TouchpanelBase: EssentialsDevice, IHasBasicTriListWithSmar
|
|||
private void Tsw_ButtonStateChange(GenericBase device, ButtonEventArgs args)
|
||||
{
|
||||
var uo = args.Button.UserObject;
|
||||
if(uo is Action<bool>)
|
||||
if (uo is Action<bool>)
|
||||
(uo as Action<bool>)(args.Button.State == eButtonState.Pressed);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,32 +1,32 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using System.Reflection;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Core.Intersystem;
|
||||
using PepperDash.Core.Intersystem.Tokens;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash.Essentials.Core.Bridges.JoinMaps;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Core.Devices;
|
||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||
using PepperDash.Essentials.Core.Routing;
|
||||
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces;
|
||||
using PepperDash.Essentials.Core.Bridges.JoinMaps;
|
||||
using Feedback = PepperDash.Essentials.Core.Feedback;
|
||||
using Serilog.Events;
|
||||
using PepperDash.Essentials.Core.Routing;
|
||||
using System.Text;
|
||||
using Feedback = PepperDash.Essentials.Core.Feedback;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||
|
||||
public abstract class VideoCodecBase : ReconfigurableDevice, IRoutingInputsOutputs,
|
||||
public abstract class VideoCodecBase : ReconfigurableDevice, IRoutingInputsOutputs,
|
||||
IUsageTracking, IHasDialer, IHasContentSharing, ICodecAudio, iVideoCodecInfo, IBridgeAdvanced, IHasStandbyMode
|
||||
{
|
||||
{
|
||||
private const int XSigEncoding = 28591;
|
||||
protected const int MaxParticipants = 50;
|
||||
private readonly byte[] _clearBytes = XSigHelpers.ClearOutputs();
|
||||
|
|
@ -872,8 +872,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec;
|
|||
protected int MeetingsToDisplay
|
||||
{
|
||||
get { return _meetingsToDisplay; }
|
||||
set {
|
||||
_meetingsToDisplay = (ushort) (value == 0 ? 3 : value);
|
||||
set
|
||||
{
|
||||
_meetingsToDisplay = (ushort)(value == 0 ? 3 : value);
|
||||
MeetingsToDisplayFeedback.FireUpdate();
|
||||
}
|
||||
}
|
||||
|
|
@ -1384,7 +1385,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec;
|
|||
tokenArray[stringIndex + 2] = new XSigSerialToken(stringIndex + 3, call.Direction.ToString());
|
||||
tokenArray[stringIndex + 3] = new XSigSerialToken(stringIndex + 4, call.Type.ToString());
|
||||
tokenArray[stringIndex + 4] = new XSigSerialToken(stringIndex + 5, call.Status.ToString());
|
||||
if(call.Duration != null)
|
||||
if (call.Duration != null)
|
||||
{
|
||||
// May need to verify correct string format here
|
||||
var dur = string.Format("{0:c}", call.Duration);
|
||||
|
|
@ -1871,14 +1872,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec;
|
|||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Used to track the status of syncronizing the phonebook values when connecting to a codec or refreshing the phonebook info
|
||||
/// </summary>
|
||||
public class CodecPhonebookSyncState : IKeyed
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to track the status of syncronizing the phonebook values when connecting to a codec or refreshing the phonebook info
|
||||
/// </summary>
|
||||
public class CodecPhonebookSyncState : IKeyed
|
||||
{
|
||||
private bool _InitialSyncComplete;
|
||||
|
||||
public CodecPhonebookSyncState(string key)
|
||||
|
|
@ -1970,7 +1971,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec;
|
|||
InitialSyncComplete = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Represents a codec command that might need to have a friendly label applied for UI feedback purposes
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharp.Net.Http;
|
||||
using Crestron.SimplSharp.WebScripting;
|
||||
using Newtonsoft.Json;
|
||||
|
|
@ -1829,7 +1829,7 @@ public class MobileControlSystemController : EssentialsDevice, IMobileControl
|
|||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void HandleError(object sender, ErrorEventArgs e)
|
||||
private void HandleError(object sender, WebSocketSharp.ErrorEventArgs e)
|
||||
{
|
||||
this.LogError("Websocket error {0}", e.Message);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.CrestronThread;
|
||||
using Crestron.SimplSharpPro.Diagnostics;
|
||||
|
|
@ -9,12 +12,9 @@ using PepperDash.Essentials.Core;
|
|||
using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||
using PepperDash.Essentials.Core.Web;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Serilog.Events;
|
||||
using PepperDash.Essentials.Core.Routing;
|
||||
using System.Threading;
|
||||
using PepperDash.Essentials.Core.Web;
|
||||
using Serilog.Events;
|
||||
using Timeout = Crestron.SimplSharp.Timeout;
|
||||
|
||||
namespace PepperDash.Essentials;
|
||||
|
|
@ -185,7 +185,7 @@ public class ControlSystem : CrestronControlSystem, ILoadConfig
|
|||
|
||||
string directoryPrefix;
|
||||
|
||||
directoryPrefix = Directory.GetApplicationRootDirectory();
|
||||
directoryPrefix = Directory.GetCurrentDirectory();
|
||||
|
||||
Global.SetAssemblyVersion(PluginLoader.GetAssemblyVersion(Assembly.GetExecutingAssembly()));
|
||||
|
||||
|
|
@ -312,23 +312,23 @@ public class ControlSystem : CrestronControlSystem, ILoadConfig
|
|||
Debug.LogMessage(LogEventLevel.Information, "FilePathPrefix: {filePathPrefix:l}", configDir);
|
||||
var configExists = Directory.Exists(configDir);
|
||||
if (!configExists)
|
||||
Directory.Create(configDir);
|
||||
Directory.CreateDirectory(configDir);
|
||||
|
||||
var irDir = Global.FilePathPrefix + "ir";
|
||||
if (!Directory.Exists(irDir))
|
||||
Directory.Create(irDir);
|
||||
Directory.CreateDirectory(irDir);
|
||||
|
||||
var sgdDir = Global.FilePathPrefix + "sgd";
|
||||
if (!Directory.Exists(sgdDir))
|
||||
Directory.Create(sgdDir);
|
||||
Directory.CreateDirectory(sgdDir);
|
||||
|
||||
var pluginDir = Global.FilePathPrefix + "plugins";
|
||||
if (!Directory.Exists(pluginDir))
|
||||
Directory.Create(pluginDir);
|
||||
Directory.CreateDirectory(pluginDir);
|
||||
|
||||
var joinmapDir = Global.FilePathPrefix + "joinmaps";
|
||||
if(!Directory.Exists(joinmapDir))
|
||||
Directory.Create(joinmapDir);
|
||||
if (!Directory.Exists(joinmapDir))
|
||||
Directory.CreateDirectory(joinmapDir);
|
||||
|
||||
return configExists;
|
||||
}
|
||||
|
|
@ -424,7 +424,7 @@ public class ControlSystem : CrestronControlSystem, ILoadConfig
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogMessage(e, "ERROR: Creating device {deviceKey:l}. Skipping device.",args: new[] { devConf.Key });
|
||||
Debug.LogMessage(e, "ERROR: Creating device {deviceKey:l}. Skipping device.", args: new[] { devConf.Key });
|
||||
}
|
||||
}
|
||||
Debug.LogMessage(LogEventLevel.Information, "All Devices Loaded.");
|
||||
|
|
@ -475,14 +475,15 @@ public class ControlSystem : CrestronControlSystem, ILoadConfig
|
|||
{
|
||||
var room = Core.DeviceFactory.GetDevice(roomConfig);
|
||||
|
||||
if(room == null)
|
||||
if (room == null)
|
||||
{
|
||||
Debug.LogWarning("ERROR: Cannot load unknown room type '{roomType:l}', key '{roomKey:l}'.", roomConfig.Type, roomConfig.Key);
|
||||
continue;
|
||||
}
|
||||
|
||||
DeviceManager.AddDevice(room);
|
||||
} catch (Exception ex)
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogMessage(ex, "Exception loading room {roomKey}:{roomType}", null, roomConfig.Key, roomConfig.Type);
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -2,12 +2,11 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharpPro;
|
||||
using System.Reflection;
|
||||
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharp.Net.Http;
|
||||
|
||||
using PepperDash.Core;
|
||||
using Serilog.Events;
|
||||
|
||||
|
|
@ -48,7 +47,7 @@ public class HttpLogoServer
|
|||
//{ ".txt", "text/plain" },
|
||||
};
|
||||
|
||||
_server = new HttpServer {Port = port};
|
||||
_server = new HttpServer { Port = port };
|
||||
_fileDirectory = directory;
|
||||
_server.OnHttpRequest += Server_OnHttpRequest;
|
||||
_server.Open();
|
||||
|
|
@ -75,7 +74,9 @@ public class HttpLogoServer
|
|||
if (File.Exists(localPath))
|
||||
{
|
||||
args.Response.Header.ContentType = GetContentType(new FileInfo(localPath).Extension);
|
||||
args.Response.ContentStream = new FileStream(localPath, FileMode.Open, FileAccess.Read);
|
||||
// For .NET 8 migration, read file content as bytes since ContentStream expects Crestron.SimplSharp.CrestronIO.Stream
|
||||
var fileBytes = File.ReadAllBytes(localPath);
|
||||
args.Response.ContentBytes = fileBytes;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue