Compare commits

..

11 Commits

Author SHA1 Message Date
Trevor Payne
eb5251cfa4 Merge tag '1.13.3-hotfix-2156' into feature/DmHdcpEnhancements 2023-04-17 09:22:07 -05:00
Andrew Welker
c53cad8119 Merge pull request #1086 from PepperDash/hotfix/pd-core-update-ssh-issues
Update PD Core to 1.2.1 DEV
2023-04-07 11:52:23 -06:00
Andrew Welker
82e8b4b203 Merge branch 'development' into hotfix/pd-core-update-ssh-issues 2023-04-07 11:37:31 -06:00
Andrew Welker
8c3b891255 Merge pull request #1082 from PepperDash/feature/vc4-fileio
Update VC4 file handling
2023-04-07 11:25:01 -06:00
jtalborough
10fc8ee30b Merge remote-tracking branch 'origin/feature/vc4-fileio' into development 2023-03-28 16:26:32 -04:00
Andrew Welker
8da8b8c584 Merge pull request #1080 from PepperDash/hotfix/dge-hdcp
Add HDCP & Bridging support for DGE Devices DEV
2023-03-27 16:40:39 -06:00
Andrew Welker
c7e0326b8c Merge branch 'development' into hotfix/dge-hdcp 2023-03-27 16:27:16 -06:00
Neil Dorin
465aa947cf Merge pull request #1078 from PepperDash/release/1.13.0
1.13.0 DEV
2023-03-24 13:08:18 -06:00
jta
3b2fa8aec5 fix: issue with file path on four sereis
refactor: remove redundnet /
2023-01-09 17:16:03 -05:00
jta
ffa864c71b Merge remote-tracking branch 'origin/development' into feature/vc4-fileio 2023-01-09 15:45:38 -05:00
jta
112a2b7382 feature: fileio now uses Global.FilePathPrefix as its directory
All read wirtes now use the current working essentials directory. This resolves issues between 3 series, 4 series, and VC-4
2022-12-20 15:16:18 -05:00
6 changed files with 89 additions and 86 deletions

View File

@@ -93,28 +93,27 @@ namespace PepperDash.Essentials
CrestronConsole.AddNewConsoleCommand(s => CrestronConsole.AddNewConsoleCommand(s =>
{ {
foreach (var tl in TieLineCollection.Default) foreach (var tl in TieLineCollection.Default)
CrestronConsole.ConsoleCommandResponse(" {0}{1}", tl, CrestronEnvironment.NewLine); CrestronConsole.ConsoleCommandResponse(" {0}\r\n", tl);
}, },
"listtielines", "Prints out all tie lines", ConsoleAccessLevelEnum.AccessOperator); "listtielines", "Prints out all tie lines", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(s => CrestronConsole.AddNewConsoleCommand(s =>
{ {
CrestronConsole.ConsoleCommandResponse CrestronConsole.ConsoleCommandResponse
("Current running configuration. This is the merged system and template configuration" + CrestronEnvironment.NewLine); ("Current running configuration. This is the merged system and template configuration");
CrestronConsole.ConsoleCommandResponse(Newtonsoft.Json.JsonConvert.SerializeObject CrestronConsole.ConsoleCommandResponse(Newtonsoft.Json.JsonConvert.SerializeObject
(ConfigReader.ConfigObject, Newtonsoft.Json.Formatting.Indented)); (ConfigReader.ConfigObject, Newtonsoft.Json.Formatting.Indented));
}, "showconfig", "Shows the current running merged config", ConsoleAccessLevelEnum.AccessOperator); }, "showconfig", "Shows the current running merged config", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(s => CrestronConsole.AddNewConsoleCommand(s =>
CrestronConsole.ConsoleCommandResponse( CrestronConsole.ConsoleCommandResponse(
"This system can be found at the following URLs:{2}" + "This system can be found at the following URLs:\r\n" +
"System URL: {0}{2}" + "System URL: {0}\r\n" +
"Template URL: {1}{2}", "Template URL: {1}",
ConfigReader.ConfigObject.SystemUrl, ConfigReader.ConfigObject.SystemUrl,
ConfigReader.ConfigObject.TemplateUrl, ConfigReader.ConfigObject.TemplateUrl),
CrestronEnvironment.NewLine), "portalinfo",
"portalinfo", "Shows portal URLS from configuration",
"Shows portal URLS from configuration",
ConsoleAccessLevelEnum.AccessOperator); ConsoleAccessLevelEnum.AccessOperator);

View File

@@ -165,7 +165,7 @@ namespace PepperDash.Essentials.Core.Bridges
Debug.Console(1, this, "Linking Device: '{0}'", device.Key); Debug.Console(1, this, "Linking Device: '{0}'", device.Key);
if (!typeof(IBridgeAdvanced).IsAssignableFrom(device.GetType().GetCType())) if (!typeof (IBridgeAdvanced).IsAssignableFrom(device.GetType().GetCType()))
{ {
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, Debug.Console(0, this, Debug.ErrorLogLevel.Notice,
"{0} is not compatible with this bridge type. Please use 'eiscapi' instead, or updae the device.", "{0} is not compatible with this bridge type. Please use 'eiscapi' instead, or updae the device.",
@@ -409,7 +409,7 @@ namespace PepperDash.Essentials.Core.Bridges
public List<ApiDevicePropertiesConfig> Devices { get; set; } public List<ApiDevicePropertiesConfig> Devices { get; set; }
[JsonProperty("rooms")] [JsonProperty("rooms")]
public List<ApiRoomPropertiesConfig> Rooms { get; set; } public List<ApiRoomPropertiesConfig> Rooms { get; set; }
public class ApiDevicePropertiesConfig public class ApiDevicePropertiesConfig
@@ -442,7 +442,7 @@ namespace PepperDash.Essentials.Core.Bridges
{ {
public EiscApiAdvancedFactory() public EiscApiAdvancedFactory()
{ {
TypeNames = new List<string> { "eiscapiadv", "eiscapiadvanced", "eiscapiadvancedserver", "eiscapiadvancedclient", "vceiscapiadv", "vceiscapiadvanced" }; TypeNames = new List<string> { "eiscapiadv", "eiscapiadvanced", "eiscapiadvancedserver", "eiscapiadvancedclient", "vceiscapiadv", "vceiscapiadvanced" };
} }
public override EssentialsDevice BuildDevice(DeviceConfig dc) public override EssentialsDevice BuildDevice(DeviceConfig dc)
@@ -457,34 +457,34 @@ namespace PepperDash.Essentials.Core.Bridges
{ {
case "eiscapiadv": case "eiscapiadv":
case "eiscapiadvanced": case "eiscapiadvanced":
{ {
eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(controlProperties.IpIdInt, eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(controlProperties.IpIdInt,
controlProperties.TcpSshProperties.Address, Global.ControlSystem); controlProperties.TcpSshProperties.Address, Global.ControlSystem);
break; break;
} }
case "eiscapiadvancedserver": case "eiscapiadvancedserver":
{ {
eisc = new EISCServer(controlProperties.IpIdInt, Global.ControlSystem); eisc = new EISCServer(controlProperties.IpIdInt, Global.ControlSystem);
break; break;
} }
case "eiscapiadvancedclient": case "eiscapiadvancedclient":
{ {
eisc = new EISCClient(controlProperties.IpIdInt, controlProperties.TcpSshProperties.Address, Global.ControlSystem); eisc = new EISCClient(controlProperties.IpIdInt, controlProperties.TcpSshProperties.Address, Global.ControlSystem);
break; break;
} }
case "vceiscapiadv": case "vceiscapiadv":
case "vceiscapiadvanced": case "vceiscapiadvanced":
{
if (string.IsNullOrEmpty(controlProperties.RoomId))
{ {
if (string.IsNullOrEmpty(controlProperties.RoomId)) Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to build VC-4 EISC Client for device {0}. Room ID is missing or empty", dc.Key);
{ eisc = null;
Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to build VC-4 EISC Client for device {0}. Room ID is missing or empty", dc.Key);
eisc = null;
break;
}
eisc = new VirtualControlEISCClient(controlProperties.IpIdInt, controlProperties.RoomId,
Global.ControlSystem);
break; break;
} }
eisc = new VirtualControlEISCClient(controlProperties.IpIdInt, controlProperties.RoomId,
Global.ControlSystem);
break;
}
default: default:
eisc = null; eisc = null;
break; break;

View File

@@ -379,28 +379,28 @@ namespace PepperDash.Essentials.Core
/// Prints a list of routing inputs and outputs by device key. /// Prints a list of routing inputs and outputs by device key.
/// </summary> /// </summary>
/// <param name="s">Device key from which to report data</param> /// <param name="s">Device key from which to report data</param>
public static void GetRoutingPorts(string s) public static void GetRoutingPorts(string s)
{ {
var device = GetDeviceForKey(s); var device = GetDeviceForKey(s);
if (device == null) return; if (device == null) return;
var inputPorts = ((device as IRoutingInputs) != null) ? (device as IRoutingInputs).InputPorts : null; var inputPorts = ((device as IRoutingInputs) != null) ? (device as IRoutingInputs).InputPorts : null;
var outputPorts = ((device as IRoutingOutputs) != null) ? (device as IRoutingOutputs).OutputPorts : null; var outputPorts = ((device as IRoutingOutputs) != null) ? (device as IRoutingOutputs).OutputPorts : null;
if (inputPorts != null) if (inputPorts != null)
{ {
CrestronConsole.ConsoleCommandResponse("Device {0} has {1} Input Ports:{2}", s, inputPorts.Count, CrestronEnvironment.NewLine); CrestronConsole.ConsoleCommandResponse("Device {0} has {1} Input Ports:", s, inputPorts.Count);
foreach (var routingInputPort in inputPorts) foreach (var routingInputPort in inputPorts)
{ {
CrestronConsole.ConsoleCommandResponse("{0}{1}", routingInputPort.Key, CrestronEnvironment.NewLine); CrestronConsole.ConsoleCommandResponse("{0}", routingInputPort.Key);
} }
} }
if (outputPorts == null) return; if (outputPorts == null) return;
CrestronConsole.ConsoleCommandResponse("Device {0} has {1} Output Ports:{2}", s, outputPorts.Count, CrestronEnvironment.NewLine); CrestronConsole.ConsoleCommandResponse("Device {0} has {1} Output Ports:", s, outputPorts.Count);
foreach (var routingOutputPort in outputPorts) foreach (var routingOutputPort in outputPorts)
{ {
CrestronConsole.ConsoleCommandResponse("{0}{1}", routingOutputPort.Key, CrestronEnvironment.NewLine); CrestronConsole.ConsoleCommandResponse("{0}", routingOutputPort.Key);
} }
} }
/// <summary> /// <summary>
/// Attempts to set the debug level of a device /// Attempts to set the debug level of a device

View File

@@ -175,8 +175,8 @@ namespace PepperDash.Essentials.Core
/// <param name="filter"></param> /// <param name="filter"></param>
public static void GetDeviceFactoryTypes(string filter) public static void GetDeviceFactoryTypes(string filter)
{ {
var types = !string.IsNullOrEmpty(filter) var types = !string.IsNullOrEmpty(filter)
? FactoryMethods.Where(k => k.Key.Contains(filter)).ToDictionary(k => k.Key, k => k.Value) ? FactoryMethods.Where(k => k.Key.Contains(filter)).ToDictionary(k => k.Key, k => k.Value)
: FactoryMethods; : FactoryMethods;
CrestronConsole.ConsoleCommandResponse("Device Types:"); CrestronConsole.ConsoleCommandResponse("Device Types:");
@@ -186,12 +186,12 @@ namespace PepperDash.Essentials.Core
var description = type.Value.Description; var description = type.Value.Description;
var cType = "Not Specified by Plugin"; var cType = "Not Specified by Plugin";
if (type.Value.CType != null) if(type.Value.CType != null)
{ {
cType = type.Value.CType.FullName; cType = type.Value.CType.FullName;
} }
CrestronConsole.ConsoleCommandResponse( CrestronConsole.ConsoleCommandResponse(
@"Type: '{0}' @"Type: '{0}'
CType: '{1}' CType: '{1}'
Description: {2}", type.Key, cType, description); Description: {2}", type.Key, cType, description);

View File

@@ -21,35 +21,37 @@ namespace PepperDash.Essentials.Core
/// </summary> /// </summary>
/// <param name="fileName"></param> /// <param name="fileName"></param>
/// <returns></returns> /// <returns></returns>
public static FileInfo[] GetFiles(string fileName) public static FileInfo[] GetFiles(string fileName)
{ {
DirectoryInfo dirInfo = new DirectoryInfo(Path.GetDirectoryName(fileName)); string fullFilePath = Global.FilePathPrefix + fileName;
var files = dirInfo.GetFiles(Path.GetFileName(fileName)); DirectoryInfo dirInfo = new DirectoryInfo(Path.GetDirectoryName(fullFilePath));
Debug.Console(0, "FileIO found: {0}, {1}", files.Count(), fileName); var files = dirInfo.GetFiles(Path.GetFileName(fullFilePath));
if (files.Count() > 0) Debug.Console(0, "FileIO found: {0}, {1}", files.Count(), fullFilePath);
{ if (files.Count() > 0)
return files; {
} return files;
else }
{ else
return null; {
} return null;
} }
}
public static FileInfo GetFile(string fileName) public static FileInfo GetFile(string fileName)
{ {
DirectoryInfo dirInfo = new DirectoryInfo(Path.GetDirectoryName(fileName)); string fullFilePath = Global.FilePathPrefix + fileName;
var files = dirInfo.GetFiles(Path.GetFileName(fileName)); DirectoryInfo dirInfo = new DirectoryInfo(Path.GetDirectoryName(fullFilePath));
Debug.Console(0, "FileIO found: {0}, {1}", files.Count(), fileName); var files = dirInfo.GetFiles(Path.GetFileName(fullFilePath));
if (files.Count() > 0) Debug.Console(0, "FileIO found: {0}, {1}", files.Count(), fullFilePath);
{ if (files.Count() > 0)
return files.FirstOrDefault(); {
} return files.FirstOrDefault();
else }
{ else
return null; {
} return null;
} }
}
/// <summary> /// <summary>
@@ -81,7 +83,7 @@ namespace PepperDash.Essentials.Core
{ {
if (fileLock.TryEnter()) if (fileLock.TryEnter())
{ {
DirectoryInfo dirInfo = new DirectoryInfo(file.Name); DirectoryInfo dirInfo = new DirectoryInfo(file.DirectoryName);
Debug.Console(2, "FileIO Getting Data {0}", file.FullName); Debug.Console(2, "FileIO Getting Data {0}", file.FullName);
if (File.Exists(file.FullName)) if (File.Exists(file.FullName))
@@ -202,7 +204,7 @@ namespace PepperDash.Essentials.Core
public static void WriteDataToFile(string data, string filePath) public static void WriteDataToFile(string data, string filePath)
{ {
Thread _WriteFileThread; Thread _WriteFileThread;
_WriteFileThread = new Thread((O) => _WriteFileMethod(data, filePath), null, Thread.eThreadStartOptions.CreateSuspended); _WriteFileThread = new Thread((O) => _WriteFileMethod(data, Global.FilePathPrefix + "/" + filePath), null, Thread.eThreadStartOptions.CreateSuspended);
_WriteFileThread.Priority = Thread.eThreadPriority.LowestPriority; _WriteFileThread.Priority = Thread.eThreadPriority.LowestPriority;
_WriteFileThread.Start(); _WriteFileThread.Start();
Debug.Console(0, Debug.ErrorLogLevel.Notice, "New WriteFile Thread"); Debug.Console(0, Debug.ErrorLogLevel.Notice, "New WriteFile Thread");
@@ -217,7 +219,8 @@ namespace PepperDash.Essentials.Core
{ {
if (fileLock.TryEnter()) if (fileLock.TryEnter())
{ {
using (StreamWriter sw = new StreamWriter(filePath))
using (StreamWriter sw = new StreamWriter(filePath))
{ {
sw.Write(data); sw.Write(data);
sw.Flush(); sw.Flush();

View File

@@ -195,12 +195,13 @@ namespace PepperDash.Essentials
public static void ReportAssemblyVersions(string command) public static void ReportAssemblyVersions(string command)
{ {
CrestronConsole.ConsoleCommandResponse("Loaded Assemblies:" + CrestronEnvironment.NewLine); CrestronConsole.ConsoleCommandResponse("Loaded Assemblies:");
foreach (var assembly in LoadedAssemblies) foreach (var assembly in LoadedAssemblies)
{ {
CrestronConsole.ConsoleCommandResponse("{0} Version: {1}" + CrestronEnvironment.NewLine, assembly.Name, assembly.Version); CrestronConsole.ConsoleCommandResponse("{0} Version: {1}", assembly.Name, assembly.Version);
} }
} }
/// <summary> /// <summary>
/// Moves any .dll assemblies not already loaded from the plugins folder to loadedPlugins folder /// Moves any .dll assemblies not already loaded from the plugins folder to loadedPlugins folder
/// </summary> /// </summary>