From 0d5c93bbdec1cf2204740672e3437289c67b9ed7 Mon Sep 17 00:00:00 2001 From: Jason T Alborough Date: Mon, 13 Aug 2018 13:51:23 -0400 Subject: [PATCH] WHAR-1397 Removes extraneous debug traces --- .../Bridges/Bridges.BridgeFactory.cs | 10 +- .../Bridges/EssentialComms.cs | 286 +++++++++--------- PepperDashEssentials/Bridges/EssentialDsp.cs | 2 +- .../Bridges/EssentialTVOne.cs | 2 +- 4 files changed, 150 insertions(+), 150 deletions(-) diff --git a/PepperDashEssentials/Bridges/Bridges.BridgeFactory.cs b/PepperDashEssentials/Bridges/Bridges.BridgeFactory.cs index c09eb700..fe859e93 100644 --- a/PepperDashEssentials/Bridges/Bridges.BridgeFactory.cs +++ b/PepperDashEssentials/Bridges/Bridges.BridgeFactory.cs @@ -27,24 +27,24 @@ namespace PepperDash.Essentials { var typeName = dc.Type.ToLower(); var groupName = dc.Group.ToLower(); - Debug.Console(0, "Name {0}, Key {1}, Type {2}, Properties {3}", name, key, type, properties.ToString()); + Debug.Console(2, "Name {0}, Key {1}, Type {2}, Properties {3}", name, key, type, properties.ToString()); if (typeName == "essentialdm") { return new EssentialDM(key, name, properties); } else if (typeName == "essentialcomm") { - Debug.Console(0, "Launch Essential Comm"); + Debug.Console(2, "Launch Essential Comm"); return new EssentialComm(key, name, properties); } else if (typeName == "essentialdsp") { - Debug.Console(0, "Launch EssentialDsp"); + Debug.Console(2, "Launch EssentialDsp"); return new EssentialDsp(key, name, properties); } else if (typeName == "essentialstvone") { - Debug.Console(0, "Launch essentialstvone"); + Debug.Console(2, "Launch essentialstvone"); return new EssentialsTVOne(key, name, properties); } return null; @@ -58,7 +58,7 @@ namespace PepperDash.Essentials { Eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(Ipid, "127.0.0.2", Global.ControlSystem); Eisc.Register(); Eisc.SigChange += Eisc_SigChange; - Debug.Console(0, "BridgeApiEisc Created at Ipid {0}", ipid); + Debug.Console(2, "BridgeApiEisc Created at Ipid {0}", ipid); } void Eisc_SigChange(object currentDevice, Crestron.SimplSharpPro.SigEventArgs args) { if (Debug.Level >= 1) diff --git a/PepperDashEssentials/Bridges/EssentialComms.cs b/PepperDashEssentials/Bridges/EssentialComms.cs index 25ca8bfa..461715fc 100644 --- a/PepperDashEssentials/Bridges/EssentialComms.cs +++ b/PepperDashEssentials/Bridges/EssentialComms.cs @@ -1,144 +1,144 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using PepperDash.Essentials.Core; -using PepperDash.Essentials.Core.Config; -using PepperDash.Core; -using PepperDash.Essentials.Core.Routing; -using Crestron.SimplSharpPro; -using Crestron.SimplSharpPro.EthernetCommunication; -using Crestron.SimplSharpPro.CrestronThread; - -namespace PepperDash.Essentials { - public class EssentialCommConfig { - public string[] EiscApiIpids; - public EssentialCommCommConnectionConfigs[] CommConnections; - } - public class EssentialCommCommConnectionConfigs { - public uint joinNumber {get; set; } - public EssentialsControlPropertiesConfig control { get; set; } - } - - public class EssentialCommsPort { - public IBasicCommunication Comm; - public IntFeedback StatusFeedback; - public BoolFeedback ConnectedFeedback; - public List Outputs = new List(); - public String RxBuffer; - public EssentialCommsPort(EssentialsControlPropertiesConfig config, string keyPrefix) { - Comm = CommFactory.CreateCommForConfig(config, keyPrefix); - // var PortGather = new CommunicationGather(Comm, config.EndOfLineChar); - Comm.TextReceived += new EventHandler(Communication_TextReceived); - - var socket = Comm as ISocketStatus; - StatusFeedback = new IntFeedback(() => { return (int)socket.ClientStatus; }); - ConnectedFeedback = new BoolFeedback(() => { return Comm.IsConnected; }); - - if (socket != null) { - socket.ConnectionChange += new EventHandler(socket_ConnectionChange); - } else { - } - - } - void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e) { - StatusFeedback.FireUpdate(); - ConnectedFeedback.FireUpdate(); - if (e.Client.IsConnected) { - // Tasks on connect - } else { - // Cleanup items from this session - } - } - void Communication_TextReceived(object sender, GenericCommMethodReceiveTextArgs args) { - try { - foreach (var Output in Outputs) { - Output.Api.Eisc.StringInput[Output.Join].StringValue = args.Text; - } - - } - catch (Exception) { - throw new FormatException(string.Format("ERROR:{0}")); - } - } - } - - public class EssentialComm : Device { - public EssentialCommConfig Properties; - - public CommunicationGather PortGather { get; private set; } - public List Apis {get; set;} - public Dictionary CommFeedbacks {get; private set; } - public StatusMonitorBase CommunicationMonitor { get; private set; } - public Dictionary CommDictionary { get; private set; } - - public EssentialComm(string key, string name, JToken properties) : base(key, name) { - Properties = JsonConvert.DeserializeObject(properties.ToString()); - CommFeedbacks = new Dictionary(); - CommDictionary = new Dictionary(); - Apis = new List(); - int commNumber = 1; - foreach (var commConfig in Properties.CommConnections) { - var commPort = new EssentialCommsPort(commConfig.control, string.Format("{0}-{1}", this.Key, commConfig.joinNumber)); - CommDictionary.Add(commConfig.joinNumber, commPort); - - commNumber++; - } - - foreach (var Ipid in Properties.EiscApiIpids) { - var ApiEisc = new BridgeApiEisc(Ipid); - Apis.Add(ApiEisc); - foreach (var commConnection in CommDictionary) { - Debug.Console(0, "Joining Api{0} to comm {1}", Ipid, commConnection.Key); - var tempComm = commConnection.Value; - var tempJoin = (uint)commConnection.Key; - EssentialComApiMap ApiMap = new EssentialComApiMap(ApiEisc, (uint)tempJoin); - - tempComm.Outputs.Add(ApiMap); - // Check for ApiMap Overide Values here - - ApiEisc.Eisc.SetBoolSigAction(tempJoin, b => {if (b) { tempComm.Comm.Connect(); } else { tempComm.Comm.Disconnect(); }}); - ApiEisc.Eisc.SetStringSigAction(tempJoin, s => tempComm.Comm.SendText(s)); - - tempComm.StatusFeedback.LinkInputSig(ApiEisc.Eisc.UShortInput[tempJoin]); - tempComm.ConnectedFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[tempJoin]); - - - - } - ApiEisc.Eisc.Register(); - } - } - - - - public override bool CustomActivate() - { - try { - - - - Debug.Console(0, "Name {0} Activated", this.Name); - return true; - } - catch (Exception e) { - Debug.Console(0, "BRidge {0}", e); - return false; - } - } - - - } - public class EssentialComApiMap { - public uint Join; - public BridgeApiEisc Api; - public uint connectJoin; - public EssentialComApiMap(BridgeApiEisc api, uint join) { - Join = join; - Api = api; - } - } +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using PepperDash.Essentials.Core; +using PepperDash.Essentials.Core.Config; +using PepperDash.Core; +using PepperDash.Essentials.Core.Routing; +using Crestron.SimplSharpPro; +using Crestron.SimplSharpPro.EthernetCommunication; +using Crestron.SimplSharpPro.CrestronThread; + +namespace PepperDash.Essentials { + public class EssentialCommConfig { + public string[] EiscApiIpids; + public EssentialCommCommConnectionConfigs[] CommConnections; + } + public class EssentialCommCommConnectionConfigs { + public uint joinNumber {get; set; } + public EssentialsControlPropertiesConfig control { get; set; } + } + + public class EssentialCommsPort { + public IBasicCommunication Comm; + public IntFeedback StatusFeedback; + public BoolFeedback ConnectedFeedback; + public List Outputs = new List(); + public String RxBuffer; + public EssentialCommsPort(EssentialsControlPropertiesConfig config, string keyPrefix) { + Comm = CommFactory.CreateCommForConfig(config, keyPrefix); + // var PortGather = new CommunicationGather(Comm, config.EndOfLineChar); + Comm.TextReceived += new EventHandler(Communication_TextReceived); + + var socket = Comm as ISocketStatus; + StatusFeedback = new IntFeedback(() => { return (int)socket.ClientStatus; }); + ConnectedFeedback = new BoolFeedback(() => { return Comm.IsConnected; }); + + if (socket != null) { + socket.ConnectionChange += new EventHandler(socket_ConnectionChange); + } else { + } + + } + void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e) { + StatusFeedback.FireUpdate(); + ConnectedFeedback.FireUpdate(); + if (e.Client.IsConnected) { + // Tasks on connect + } else { + // Cleanup items from this session + } + } + void Communication_TextReceived(object sender, GenericCommMethodReceiveTextArgs args) { + try { + foreach (var Output in Outputs) { + Output.Api.Eisc.StringInput[Output.Join].StringValue = args.Text; + } + + } + catch (Exception) { + throw new FormatException(string.Format("ERROR:{0}")); + } + } + } + + public class EssentialComm : Device { + public EssentialCommConfig Properties; + + public CommunicationGather PortGather { get; private set; } + public List Apis {get; set;} + public Dictionary CommFeedbacks {get; private set; } + public StatusMonitorBase CommunicationMonitor { get; private set; } + public Dictionary CommDictionary { get; private set; } + + public EssentialComm(string key, string name, JToken properties) : base(key, name) { + Properties = JsonConvert.DeserializeObject(properties.ToString()); + CommFeedbacks = new Dictionary(); + CommDictionary = new Dictionary(); + Apis = new List(); + int commNumber = 1; + foreach (var commConfig in Properties.CommConnections) { + var commPort = new EssentialCommsPort(commConfig.control, string.Format("{0}-{1}", this.Key, commConfig.joinNumber)); + CommDictionary.Add(commConfig.joinNumber, commPort); + + commNumber++; + } + + foreach (var Ipid in Properties.EiscApiIpids) { + var ApiEisc = new BridgeApiEisc(Ipid); + Apis.Add(ApiEisc); + foreach (var commConnection in CommDictionary) { + Debug.Console(2, "Joining Api{0} to comm {1}", Ipid, commConnection.Key); + var tempComm = commConnection.Value; + var tempJoin = (uint)commConnection.Key; + EssentialComApiMap ApiMap = new EssentialComApiMap(ApiEisc, (uint)tempJoin); + + tempComm.Outputs.Add(ApiMap); + // Check for ApiMap Overide Values here + + ApiEisc.Eisc.SetBoolSigAction(tempJoin, b => {if (b) { tempComm.Comm.Connect(); } else { tempComm.Comm.Disconnect(); }}); + ApiEisc.Eisc.SetStringSigAction(tempJoin, s => tempComm.Comm.SendText(s)); + + tempComm.StatusFeedback.LinkInputSig(ApiEisc.Eisc.UShortInput[tempJoin]); + tempComm.ConnectedFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[tempJoin]); + + + + } + ApiEisc.Eisc.Register(); + } + } + + + + public override bool CustomActivate() + { + try { + + + + Debug.Console(2, "Name {0} Activated", this.Name); + return true; + } + catch (Exception e) { + Debug.Console(0, "Bridge {0}", e); + return false; + } + } + + + } + public class EssentialComApiMap { + public uint Join; + public BridgeApiEisc Api; + public uint connectJoin; + public EssentialComApiMap(BridgeApiEisc api, uint join) { + Join = join; + Api = api; + } + } } \ No newline at end of file diff --git a/PepperDashEssentials/Bridges/EssentialDsp.cs b/PepperDashEssentials/Bridges/EssentialDsp.cs index 95d1cabf..34703410 100644 --- a/PepperDashEssentials/Bridges/EssentialDsp.cs +++ b/PepperDashEssentials/Bridges/EssentialDsp.cs @@ -83,7 +83,7 @@ namespace PepperDash.Essentials { return true; } catch (Exception e) { - Debug.Console(2, "BRidge {0}", e); + Debug.Console(0, "Bridge {0}", e); return false; } } diff --git a/PepperDashEssentials/Bridges/EssentialTVOne.cs b/PepperDashEssentials/Bridges/EssentialTVOne.cs index be2db474..12fb0c49 100644 --- a/PepperDashEssentials/Bridges/EssentialTVOne.cs +++ b/PepperDashEssentials/Bridges/EssentialTVOne.cs @@ -68,7 +68,7 @@ namespace PepperDash.Essentials return true; } catch (Exception e) { - Debug.Console(2, "BRidge {0}", e); + Debug.Console(0, "Bridge {0}", e); return false; } }