mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 20:54:55 +00:00
fix: update console responses to properly use explicit NewLine characters
fix: Resolve #1084
This commit is contained in:
@@ -93,27 +93,28 @@ namespace PepperDash.Essentials
|
|||||||
CrestronConsole.AddNewConsoleCommand(s =>
|
CrestronConsole.AddNewConsoleCommand(s =>
|
||||||
{
|
{
|
||||||
foreach (var tl in TieLineCollection.Default)
|
foreach (var tl in TieLineCollection.Default)
|
||||||
CrestronConsole.ConsoleCommandResponse(" {0}\r\n", tl);
|
CrestronConsole.ConsoleCommandResponse(" {0}{1}", tl, CrestronEnvironment.NewLine);
|
||||||
},
|
},
|
||||||
"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");
|
("Current running configuration. This is the merged system and template configuration" + CrestronEnvironment.NewLine);
|
||||||
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:\r\n" +
|
"This system can be found at the following URLs:{2}" +
|
||||||
"System URL: {0}\r\n" +
|
"System URL: {0}{2}" +
|
||||||
"Template URL: {1}",
|
"Template URL: {1}{2}",
|
||||||
ConfigReader.ConfigObject.SystemUrl,
|
ConfigReader.ConfigObject.SystemUrl,
|
||||||
ConfigReader.ConfigObject.TemplateUrl),
|
ConfigReader.ConfigObject.TemplateUrl,
|
||||||
"portalinfo",
|
CrestronEnvironment.NewLine),
|
||||||
"Shows portal URLS from configuration",
|
"portalinfo",
|
||||||
|
"Shows portal URLS from configuration",
|
||||||
ConsoleAccessLevelEnum.AccessOperator);
|
ConsoleAccessLevelEnum.AccessOperator);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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,
|
|
||||||
controlProperties.TcpSshProperties.Address, Global.ControlSystem);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "eiscapiadvancedserver":
|
|
||||||
{
|
|
||||||
eisc = new EISCServer(controlProperties.IpIdInt, Global.ControlSystem);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "eiscapiadvancedclient":
|
|
||||||
{
|
|
||||||
eisc = new EISCClient(controlProperties.IpIdInt, controlProperties.TcpSshProperties.Address, Global.ControlSystem);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "vceiscapiadv":
|
|
||||||
case "vceiscapiadvanced":
|
|
||||||
{
|
|
||||||
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 = new ThreeSeriesTcpIpEthernetIntersystemCommunications(controlProperties.IpIdInt,
|
||||||
eisc = null;
|
controlProperties.TcpSshProperties.Address, Global.ControlSystem);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "eiscapiadvancedserver":
|
||||||
|
{
|
||||||
|
eisc = new EISCServer(controlProperties.IpIdInt, Global.ControlSystem);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "eiscapiadvancedclient":
|
||||||
|
{
|
||||||
|
eisc = new EISCClient(controlProperties.IpIdInt, controlProperties.TcpSshProperties.Address, Global.ControlSystem);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "vceiscapiadv":
|
||||||
|
case "vceiscapiadvanced":
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
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;
|
||||||
|
|||||||
@@ -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:", s, inputPorts.Count);
|
CrestronConsole.ConsoleCommandResponse("Device {0} has {1} Input Ports:{2}", s, inputPorts.Count, CrestronEnvironment.NewLine);
|
||||||
foreach (var routingInputPort in inputPorts)
|
foreach (var routingInputPort in inputPorts)
|
||||||
{
|
{
|
||||||
CrestronConsole.ConsoleCommandResponse("{0}", routingInputPort.Key);
|
CrestronConsole.ConsoleCommandResponse("{0}{1}", routingInputPort.Key, CrestronEnvironment.NewLine);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (outputPorts == null) return;
|
if (outputPorts == null) return;
|
||||||
CrestronConsole.ConsoleCommandResponse("Device {0} has {1} Output Ports:", s, outputPorts.Count);
|
CrestronConsole.ConsoleCommandResponse("Device {0} has {1} Output Ports:{2}", s, outputPorts.Count, CrestronEnvironment.NewLine);
|
||||||
foreach (var routingOutputPort in outputPorts)
|
foreach (var routingOutputPort in outputPorts)
|
||||||
{
|
{
|
||||||
CrestronConsole.ConsoleCommandResponse("{0}", routingOutputPort.Key);
|
CrestronConsole.ConsoleCommandResponse("{0}{1}", routingOutputPort.Key, CrestronEnvironment.NewLine);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Attempts to set the debug level of a device
|
/// Attempts to set the debug level of a device
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -195,13 +195,12 @@ namespace PepperDash.Essentials
|
|||||||
public static void ReportAssemblyVersions(string command)
|
public static void ReportAssemblyVersions(string command)
|
||||||
{
|
{
|
||||||
|
|
||||||
CrestronConsole.ConsoleCommandResponse("Loaded Assemblies:");
|
CrestronConsole.ConsoleCommandResponse("Loaded Assemblies:" + CrestronEnvironment.NewLine);
|
||||||
foreach (var assembly in LoadedAssemblies)
|
foreach (var assembly in LoadedAssemblies)
|
||||||
{
|
{
|
||||||
CrestronConsole.ConsoleCommandResponse("{0} Version: {1}", assembly.Name, assembly.Version);
|
CrestronConsole.ConsoleCommandResponse("{0} Version: {1}" + CrestronEnvironment.NewLine, 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>
|
||||||
|
|||||||
Reference in New Issue
Block a user