diff --git a/Essentials Core/PepperDashEssentialsBase/Cues and DevAction/Cues.cs b/Essentials Core/PepperDashEssentialsBase/Cues and DevAction/Cues.cs index 69f993a9..a3940a98 100644 --- a/Essentials Core/PepperDashEssentialsBase/Cues and DevAction/Cues.cs +++ b/Essentials Core/PepperDashEssentialsBase/Cues and DevAction/Cues.cs @@ -27,7 +27,7 @@ namespace PepperDash.Essentials.Core public enum eCueType { - Bool, Int, String, Void, Other + Bool, Int, String, Serial, Void, Other } diff --git a/Essentials Core/PepperDashEssentialsBase/Display/BasicIrDisplay.cs b/Essentials Core/PepperDashEssentialsBase/Display/BasicIrDisplay.cs index 230b52da..a1fd6287 100644 --- a/Essentials Core/PepperDashEssentialsBase/Display/BasicIrDisplay.cs +++ b/Essentials Core/PepperDashEssentialsBase/Display/BasicIrDisplay.cs @@ -186,7 +186,7 @@ namespace PepperDash.Essentials.Core if (!PowerIsOnFeedback.BoolValue) { PowerOn(); - EventHandler oneTimer = null; + EventHandler oneTimer = null; oneTimer = (o, a) => { if (IsWarmingUpFeedback.BoolValue) return; // Only catch done warming diff --git a/Essentials Core/PepperDashEssentialsBase/Display/DisplayBase.cs b/Essentials Core/PepperDashEssentialsBase/Display/DisplayBase.cs index 38640219..39cbbdf2 100644 --- a/Essentials Core/PepperDashEssentialsBase/Display/DisplayBase.cs +++ b/Essentials Core/PepperDashEssentialsBase/Display/DisplayBase.cs @@ -54,7 +54,7 @@ namespace PepperDash.Essentials.Core InputPorts = new RoutingPortCollection(); - PowerIsOnFeedback.OutputChange += new EventHandler(PowerIsOnFeedback_OutputChange); + PowerIsOnFeedback.OutputChange += PowerIsOnFeedback_OutputChange; } void PowerIsOnFeedback_OutputChange(object sender, EventArgs e) diff --git a/Essentials Core/PepperDashEssentialsBase/Feedbacks/BoolFeedback.cs b/Essentials Core/PepperDashEssentialsBase/Feedbacks/BoolFeedback.cs new file mode 100644 index 00000000..db007fc4 --- /dev/null +++ b/Essentials Core/PepperDashEssentialsBase/Feedbacks/BoolFeedback.cs @@ -0,0 +1,110 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; +using Crestron.SimplSharpPro; + +namespace PepperDash.Essentials.Core +{ + /// + /// A Feedback whose output is derived from the return value of a provided Func. + /// + public class BoolFeedback : Feedback + { + /// + /// Returns the current value of the feedback, derived from the ValueFunc. The ValueFunc is + /// evaluated whenever FireUpdate() is called + /// + public override bool BoolValue { get { return _BoolValue; } } + bool _BoolValue; + + public override eCueType Type { get { return eCueType.Bool; } } + + /// + /// Fake value to be used in test mode + /// + public bool TestValue { get; private set; } + + /// + /// Func that evaluates on FireUpdate + /// + public Func ValueFunc { get; private set; } + + List LinkedInputSigs = new List(); + List LinkedComplementInputSigs = new List(); + + public BoolFeedback(Func valueFunc) + : this(Cue.DefaultBoolCue, valueFunc) + { + } + + public BoolFeedback(Cue cue, Func valueFunc) + : base(cue) + { + if (cue == null) throw new ArgumentNullException("cue"); + ValueFunc = valueFunc; + } + + public override void FireUpdate() + { + bool newValue = InTestMode ? TestValue : ValueFunc.Invoke(); + if (newValue != _BoolValue) + { + _BoolValue = newValue; + LinkedInputSigs.ForEach(s => UpdateSig(s)); + LinkedComplementInputSigs.ForEach(s => UpdateComplementSig(s)); + OnOutputChange(newValue); + } + } + + public void LinkInputSig(BoolInputSig sig) + { + LinkedInputSigs.Add(sig); + UpdateSig(sig); + } + + public void UnlinkInputSig(BoolInputSig sig) + { + LinkedInputSigs.Remove(sig); + } + + public void LinkComplementInputSig(BoolInputSig sig) + { + LinkedComplementInputSigs.Add(sig); + UpdateComplementSig(sig); + } + + public void UnlinkComplementInputSig(BoolInputSig sig) + { + LinkedComplementInputSigs.Remove(sig); + } + + public override string ToString() + { + return (InTestMode ? "TEST -- " : "") + BoolValue.ToString(); + } + + /// + /// Puts this in test mode, sets the test value and fires an update. + /// + /// + public void SetTestValue(bool value) + { + TestValue = value; + InTestMode = true; + FireUpdate(); + } + + void UpdateSig(BoolInputSig sig) + { + sig.BoolValue = _BoolValue; + } + + void UpdateComplementSig(BoolInputSig sig) + { + sig.BoolValue = !_BoolValue; + } + } + +} \ No newline at end of file diff --git a/Essentials Core/PepperDashEssentialsBase/Feedbacks/FeedbackBase.cs b/Essentials Core/PepperDashEssentialsBase/Feedbacks/FeedbackBase.cs new file mode 100644 index 00000000..f5672e0d --- /dev/null +++ b/Essentials Core/PepperDashEssentialsBase/Feedbacks/FeedbackBase.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; +using Crestron.SimplSharpPro; + +namespace PepperDash.Essentials.Core +{ + public abstract class Feedback + { + public event EventHandler OutputChange; + + public virtual bool BoolValue { get { return false; } } + public virtual int IntValue { get { return 0; } } + public virtual string StringValue { get { return ""; } } + public virtual string SerialValue { get { return ""; } } + + public Cue Cue { get; private set; } + + public abstract eCueType Type { get; } + + /// + /// Feedbacks can be put into test mode for simulation of events without real data. + /// Using JSON debugging methods and the Set/ClearTestValue methods, we can simulate + /// Feedback behaviors + /// + public bool InTestMode { get; protected set; } + + /// + /// Base Constructor - empty + /// + protected Feedback() + { + } + + protected Feedback(Cue cue) + { + Cue = cue; + } + + /// + /// Clears test mode and fires update. + /// + public void ClearTestValue() + { + InTestMode = false; + FireUpdate(); + } + + /// + /// Fires an update synchronously + /// + public abstract void FireUpdate(); + + /// + /// Fires the update asynchronously within a CrestronInvoke + /// + public void InvokeFireUpdate() + { + CrestronInvoke.BeginInvoke(o => FireUpdate()); + } + + ///// + ///// Helper method that fires event. Use this intstead of calling OutputChange + ///// + //protected void OnOutputChange() + //{ + // if (OutputChange != null) OutputChange(this, EventArgs.Empty); + //} + + protected void OnOutputChange(bool value) + { + if (OutputChange != null) OutputChange(this, new FeedbackEventArgs(value)); + } + + protected void OnOutputChange(int value) + { + if (OutputChange != null) OutputChange(this, new FeedbackEventArgs(value)); + } + + + protected void OnOutputChange(string value) + { + if (OutputChange != null) OutputChange(this, new FeedbackEventArgs(value)); + } + } +} \ No newline at end of file diff --git a/Essentials Core/PepperDashEssentialsBase/Feedbacks/FeedbackTest.cs b/Essentials Core/PepperDashEssentialsBase/Feedbacks/FeedbackTest.cs deleted file mode 100644 index 87b94d95..00000000 --- a/Essentials Core/PepperDashEssentialsBase/Feedbacks/FeedbackTest.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; - -using PepperDash.Core; - -namespace PepperDash.Essentials.Core -{ - public class FeedbackTest - { - public void doit() - { - var sf = new StringFeedback(() => "Ho"); - - sf.OutputChange += new EventHandler(sf_OutputChange); - } - - void sf_OutputChange(object sender, EventArgs e) - { - throw new NotImplementedException(); - } - - } - - public class Hmmm - { - IBasicCommunication comm; - - public Hmmm() - { - comm.TextReceived += new EventHandler(comm_TextReceived); - - var d = new Dictionary> - { - { "textReceived1", comm_TextReceived} - }; - } - - void comm_TextReceived(object sender, GenericCommMethodReceiveTextArgs e) - { - throw new NotImplementedException(); - } - } -} \ No newline at end of file diff --git a/Essentials Core/PepperDashEssentialsBase/Feedbacks/Feedbacks.cs b/Essentials Core/PepperDashEssentialsBase/Feedbacks/Feedbacks.cs deleted file mode 100644 index d06afdd7..00000000 --- a/Essentials Core/PepperDashEssentialsBase/Feedbacks/Feedbacks.cs +++ /dev/null @@ -1,337 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; -using Crestron.SimplSharpPro; - -namespace PepperDash.Essentials.Core -{ - public abstract class Feedback - { - public event EventHandler OutputChange; - - public virtual bool BoolValue { get { return false; } } - public virtual int IntValue { get { return 0; } } - public virtual string StringValue { get { return ""; } } - - public Cue Cue { get; private set; } - - public abstract eCueType Type { get; } - - /// - /// Feedbacks can be put into test mode for simulation of events without real data. - /// Using JSON debugging methods and the Set/ClearTestValue methods, we can simulate - /// Feedback behaviors - /// - public bool InTestMode { get; protected set; } - - /// - /// Base Constructor - empty - /// - protected Feedback() - { - } - - protected Feedback(Cue cue) - { - Cue = cue; - } - - /// - /// Clears test mode and fires update. - /// - public void ClearTestValue() - { - InTestMode = false; - FireUpdate(); - } - - /// - /// Fires an update synchronously - /// - public abstract void FireUpdate(); - - /// - /// Fires the update asynchronously within a CrestronInvoke - /// - public void InvokeFireUpdate() - { - CrestronInvoke.BeginInvoke(o => FireUpdate()); - } - - ///// - ///// Helper method that fires event. Use this intstead of calling OutputChange - ///// - //protected void OnOutputChange() - //{ - // if (OutputChange != null) OutputChange(this, EventArgs.Empty); - //} - - protected void OnOutputChange(bool value) - { - if (OutputChange != null) OutputChange(this, new FeedbackEventArgs(value)); - } - - protected void OnOutputChange(int value) - { - if (OutputChange != null) OutputChange(this, new FeedbackEventArgs(value)); - } - - - protected void OnOutputChange(string value) - { - if (OutputChange != null) OutputChange(this, new FeedbackEventArgs(value)); - } - } - - /// - /// A Feedback whose output is derived from the return value of a provided Func. - /// - public class BoolFeedback : Feedback - { - /// - /// Returns the current value of the feedback, derived from the ValueFunc. The ValueFunc is - /// evaluated whenever FireUpdate() is called - /// - public override bool BoolValue { get { return _BoolValue; } } - bool _BoolValue; - - public override eCueType Type { get { return eCueType.Bool; } } - - /// - /// Fake value to be used in test mode - /// - public bool TestValue { get; private set; } - - /// - /// Func that evaluates on FireUpdate - /// - public Func ValueFunc { get; private set; } - - List LinkedInputSigs = new List(); - List LinkedComplementInputSigs = new List(); - - public BoolFeedback(Func valueFunc) - : this(Cue.DefaultBoolCue, valueFunc) - { - } - - public BoolFeedback(Cue cue, Func valueFunc) - : base(cue) - { - if (cue == null) throw new ArgumentNullException("cue"); - ValueFunc = valueFunc; - } - - public override void FireUpdate() - { - bool newValue = InTestMode ? TestValue : ValueFunc.Invoke(); - if (newValue != _BoolValue) - { - _BoolValue = newValue; - LinkedInputSigs.ForEach(s => UpdateSig(s)); - LinkedComplementInputSigs.ForEach(s => UpdateComplementSig(s)); - OnOutputChange(newValue); - } - } - - public void LinkInputSig(BoolInputSig sig) - { - LinkedInputSigs.Add(sig); - UpdateSig(sig); - } - - public void UnlinkInputSig(BoolInputSig sig) - { - LinkedInputSigs.Remove(sig); - } - - public void LinkComplementInputSig(BoolInputSig sig) - { - LinkedComplementInputSigs.Add(sig); - UpdateComplementSig(sig); - } - - public void UnlinkComplementInputSig(BoolInputSig sig) - { - LinkedComplementInputSigs.Remove(sig); - } - - public override string ToString() - { - return (InTestMode ? "TEST -- " : "") + BoolValue.ToString(); - } - - /// - /// Puts this in test mode, sets the test value and fires an update. - /// - /// - public void SetTestValue(bool value) - { - TestValue = value; - InTestMode = true; - FireUpdate(); - } - - void UpdateSig(BoolInputSig sig) - { - sig.BoolValue = _BoolValue; - } - - void UpdateComplementSig(BoolInputSig sig) - { - sig.BoolValue = !_BoolValue; - } - } - - //****************************************************************************** - public class IntFeedback : Feedback - { - public override int IntValue { get { return _IntValue; } } // ValueFunc.Invoke(); } } - int _IntValue; - public ushort UShortValue { get { return (ushort)_IntValue; } } - - public override eCueType Type { get { return eCueType.Int; } } - - public int TestValue { get; private set; } - - /// - /// Func evaluated on FireUpdate - /// - Func ValueFunc; - List LinkedInputSigs = new List(); - - public IntFeedback(Func valueFunc) - : this(Cue.DefaultIntCue, valueFunc) - { - } - - public IntFeedback(Cue cue, Func valueFunc) - : base(cue) - { - if (cue == null) throw new ArgumentNullException("cue"); - ValueFunc = valueFunc; - } - - public override void FireUpdate() - { - var newValue = InTestMode ? TestValue : ValueFunc.Invoke(); - if (newValue != _IntValue) - { - _IntValue = newValue; - LinkedInputSigs.ForEach(s => UpdateSig(s)); - OnOutputChange(newValue); - } - } - - public void LinkInputSig(UShortInputSig sig) - { - LinkedInputSigs.Add(sig); - UpdateSig(sig); - } - - public void UnlinkInputSig(UShortInputSig sig) - { - LinkedInputSigs.Remove(sig); - } - - public override string ToString() - { - return (InTestMode ? "TEST -- " : "") + IntValue.ToString(); - } - - /// - /// Puts this in test mode, sets the test value and fires an update. - /// - /// - public void SetTestValue(int value) - { - TestValue = value; - InTestMode = true; - FireUpdate(); - } - - void UpdateSig(UShortInputSig sig) - { - sig.UShortValue = UShortValue; - } - } - - - //****************************************************************************** - public class StringFeedback : Feedback - { - public override string StringValue { get { return _StringValue; } } // ValueFunc.Invoke(); } } - string _StringValue; - - public override eCueType Type { get { return eCueType.String; } } - - /// - /// Used in testing. Set/Clear functions - /// - public string TestValue { get; private set; } - - /// - /// Evalutated on FireUpdate - /// - public Func ValueFunc { get; private set; } - List LinkedInputSigs = new List(); - - public StringFeedback(Func valueFunc) - : this(Cue.DefaultStringCue, valueFunc) - { - } - - public StringFeedback(Cue cue, Func valueFunc) - : base(cue) - { - if (cue == null) throw new ArgumentNullException("cue"); - ValueFunc = valueFunc; - - } - - public override void FireUpdate() - { - var newValue = InTestMode ? TestValue : ValueFunc.Invoke(); - if (newValue != _StringValue) - { - _StringValue = newValue; - LinkedInputSigs.ForEach(s => UpdateSig(s)); - OnOutputChange(newValue); - } - } - - public void LinkInputSig(StringInputSig sig) - { - LinkedInputSigs.Add(sig); - UpdateSig(sig); - } - - public void UnlinkInputSig(StringInputSig sig) - { - LinkedInputSigs.Remove(sig); - } - - public override string ToString() - { - return (InTestMode ? "TEST -- " : "") + StringValue; - } - - /// - /// Puts this in test mode, sets the test value and fires an update. - /// - /// - public void SetTestValue(string value) - { - TestValue = value; - InTestMode = true; - FireUpdate(); - } - - void UpdateSig(StringInputSig sig) - { - sig.StringValue = _StringValue; - } - } -} \ No newline at end of file diff --git a/Essentials Core/PepperDashEssentialsBase/Feedbacks/IntFeedback.cs b/Essentials Core/PepperDashEssentialsBase/Feedbacks/IntFeedback.cs new file mode 100644 index 00000000..878f11e2 --- /dev/null +++ b/Essentials Core/PepperDashEssentialsBase/Feedbacks/IntFeedback.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; +using Crestron.SimplSharpPro; + +namespace PepperDash.Essentials.Core +{ + public class IntFeedback : Feedback + { + public override int IntValue { get { return _IntValue; } } // ValueFunc.Invoke(); } } + int _IntValue; + public ushort UShortValue { get { return (ushort)_IntValue; } } + + public override eCueType Type { get { return eCueType.Int; } } + + public int TestValue { get; private set; } + + /// + /// Func evaluated on FireUpdate + /// + Func ValueFunc; + List LinkedInputSigs = new List(); + + public IntFeedback(Func valueFunc) + : this(Cue.DefaultIntCue, valueFunc) + { + } + + public IntFeedback(Cue cue, Func valueFunc) + : base(cue) + { + if (cue == null) throw new ArgumentNullException("cue"); + ValueFunc = valueFunc; + } + + public override void FireUpdate() + { + var newValue = InTestMode ? TestValue : ValueFunc.Invoke(); + if (newValue != _IntValue) + { + _IntValue = newValue; + LinkedInputSigs.ForEach(s => UpdateSig(s)); + OnOutputChange(newValue); + } + } + + public void LinkInputSig(UShortInputSig sig) + { + LinkedInputSigs.Add(sig); + UpdateSig(sig); + } + + public void UnlinkInputSig(UShortInputSig sig) + { + LinkedInputSigs.Remove(sig); + } + + public override string ToString() + { + return (InTestMode ? "TEST -- " : "") + IntValue.ToString(); + } + + /// + /// Puts this in test mode, sets the test value and fires an update. + /// + /// + public void SetTestValue(int value) + { + TestValue = value; + InTestMode = true; + FireUpdate(); + } + + void UpdateSig(UShortInputSig sig) + { + sig.UShortValue = UShortValue; + } + } +} \ No newline at end of file diff --git a/Essentials Core/PepperDashEssentialsBase/Feedbacks/SerialFeedback.cs b/Essentials Core/PepperDashEssentialsBase/Feedbacks/SerialFeedback.cs new file mode 100644 index 00000000..d64400de --- /dev/null +++ b/Essentials Core/PepperDashEssentialsBase/Feedbacks/SerialFeedback.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; +using Crestron.SimplSharpPro; + +namespace PepperDash.Essentials.Core +{ + /// + /// To be used for serial data feedback where the event chain / asynchronicity must be maintained + /// and calculating the value based on a Func when it is needed will not suffice. + /// + public class SerialFeedback : Feedback + { + public override string SerialValue { get { return _SerialValue; } } + string _SerialValue; + + public override eCueType Type { get { return eCueType.Serial; } } + + /// + /// Used in testing. Set/Clear functions + /// + public string TestValue { get; private set; } + + List LinkedInputSigs = new List(); + + public SerialFeedback() + { + } + + public override void FireUpdate() + { + throw new NotImplementedException("This feedback type does not use Funcs"); + } + + public void FireUpdate(string newValue) + { + _SerialValue = newValue; + LinkedInputSigs.ForEach(s => UpdateSig(s, newValue)); + OnOutputChange(newValue); + } + + public void LinkInputSig(StringInputSig sig) + { + LinkedInputSigs.Add(sig); + UpdateSig(sig); + } + + public void UnlinkInputSig(StringInputSig sig) + { + LinkedInputSigs.Remove(sig); + } + + public override string ToString() + { + return (InTestMode ? "TEST -- " : "") + SerialValue; + } + + /// + /// Puts this in test mode, sets the test value and fires an update. + /// + /// + public void SetTestValue(string value) + { + TestValue = value; + InTestMode = true; + FireUpdate(TestValue); + } + + void UpdateSig(StringInputSig sig) + { + sig.StringValue = _SerialValue; + } + + void UpdateSig(StringInputSig sig, string value) + { + sig.StringValue = value; + } + } +} \ No newline at end of file diff --git a/Essentials Core/PepperDashEssentialsBase/Feedbacks/StringFeedback.cs b/Essentials Core/PepperDashEssentialsBase/Feedbacks/StringFeedback.cs new file mode 100644 index 00000000..bf7b772a --- /dev/null +++ b/Essentials Core/PepperDashEssentialsBase/Feedbacks/StringFeedback.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; +using Crestron.SimplSharpPro; + +namespace PepperDash.Essentials.Core +{ + public class StringFeedback : Feedback + { + public override string StringValue { get { return _StringValue; } } // ValueFunc.Invoke(); } } + string _StringValue; + + public override eCueType Type { get { return eCueType.String; } } + + /// + /// Used in testing. Set/Clear functions + /// + public string TestValue { get; private set; } + + /// + /// Evalutated on FireUpdate + /// + public Func ValueFunc { get; private set; } + List LinkedInputSigs = new List(); + + public StringFeedback(Func valueFunc) + : this(Cue.DefaultStringCue, valueFunc) + { + } + + public StringFeedback(Cue cue, Func valueFunc) + : base(cue) + { + if (cue == null) throw new ArgumentNullException("cue"); + ValueFunc = valueFunc; + + } + + public override void FireUpdate() + { + var newValue = InTestMode ? TestValue : ValueFunc.Invoke(); + if (newValue != _StringValue) + { + _StringValue = newValue; + LinkedInputSigs.ForEach(s => UpdateSig(s)); + OnOutputChange(newValue); + } + } + + public void LinkInputSig(StringInputSig sig) + { + LinkedInputSigs.Add(sig); + UpdateSig(sig); + } + + public void UnlinkInputSig(StringInputSig sig) + { + LinkedInputSigs.Remove(sig); + } + + public override string ToString() + { + return (InTestMode ? "TEST -- " : "") + StringValue; + } + + /// + /// Puts this in test mode, sets the test value and fires an update. + /// + /// + public void SetTestValue(string value) + { + TestValue = value; + InTestMode = true; + FireUpdate(); + } + + void UpdateSig(StringInputSig sig) + { + sig.StringValue = _StringValue; + } + } +} \ No newline at end of file diff --git a/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj b/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj index f24f3778..1216cc82 100644 --- a/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj +++ b/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj @@ -111,8 +111,11 @@ - + + + + @@ -214,7 +217,7 @@ - + diff --git a/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs b/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs index 10a545a6..79a20f66 100644 --- a/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs +++ b/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs @@ -103,7 +103,7 @@ namespace PepperDash.Essentials.DM InputPorts = new RoutingPortCollection(); OutputPorts = new RoutingPortCollection(); VolumeControls = new Dictionary(); - IsOnline.OutputChange += new EventHandler(IsOnline_OutputChange); + IsOnline.OutputChange += IsOnline_OutputChange; Chassis.DMOutputChange += new DMOutputEventHandler(Chassis_DMOutputChange); } diff --git a/Essentials DM/Essentials_DM/Essentials_DM.csproj b/Essentials DM/Essentials_DM/Essentials_DM.csproj index 6c80575f..96053804 100644 --- a/Essentials DM/Essentials_DM/Essentials_DM.csproj +++ b/Essentials DM/Essentials_DM/Essentials_DM.csproj @@ -112,6 +112,7 @@ + diff --git a/Essentials DM/Essentials_DM/app.config b/Essentials DM/Essentials_DM/app.config new file mode 100644 index 00000000..476ee3b3 --- /dev/null +++ b/Essentials DM/Essentials_DM/app.config @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Essentials Devices Common/Essentials Devices Common/Display/AvocorVTFDisplay.cs b/Essentials Devices Common/Essentials Devices Common/Display/AvocorVTFDisplay.cs index 51790d7f..961e9291 100644 --- a/Essentials Devices Common/Essentials Devices Common/Display/AvocorVTFDisplay.cs +++ b/Essentials Devices Common/Essentials Devices Common/Display/AvocorVTFDisplay.cs @@ -606,7 +606,7 @@ namespace PepperDash.Essentials.Devices.Displays else // if power is off, wait until we get on FB to send it. { // One-time event handler to wait for power on before executing switch - EventHandler handler = null; // necessary to allow reference inside lambda to handler + EventHandler handler = null; // necessary to allow reference inside lambda to handler handler = (o, a) => { if (!_IsWarmingUp) // Done warming diff --git a/Essentials Devices Common/Essentials Devices Common/Display/SamsungMDCDisplay.cs b/Essentials Devices Common/Essentials Devices Common/Display/SamsungMDCDisplay.cs index 217186cf..4e3ca9ed 100644 --- a/Essentials Devices Common/Essentials Devices Common/Display/SamsungMDCDisplay.cs +++ b/Essentials Devices Common/Essentials Devices Common/Display/SamsungMDCDisplay.cs @@ -491,7 +491,7 @@ namespace PepperDash.Essentials.Devices.Displays else // if power is off, wait until we get on FB to send it. { // One-time event handler to wait for power on before executing switch - EventHandler handler = null; // necessary to allow reference inside lambda to handler + EventHandler handler = null; // necessary to allow reference inside lambda to handler handler = (o, a) => { if (!_IsWarmingUp) // Done warming diff --git a/Essentials Devices Common/Essentials Devices Common/MIcrophone/MicrophonePrivacyController.cs b/Essentials Devices Common/Essentials Devices Common/MIcrophone/MicrophonePrivacyController.cs index 81e37246..99050089 100644 --- a/Essentials Devices Common/Essentials Devices Common/MIcrophone/MicrophonePrivacyController.cs +++ b/Essentials Devices Common/Essentials Devices Common/MIcrophone/MicrophonePrivacyController.cs @@ -98,7 +98,7 @@ namespace PepperDash.Essentials.Devices.Common.Microphones { PrivacyDevice = privacyDevice; - PrivacyDevice.PrivacyModeIsOnFeedback.OutputChange += new EventHandler(PrivacyModeIsOnFeedback_OutputChange); + PrivacyDevice.PrivacyModeIsOnFeedback.OutputChange += PrivacyModeIsOnFeedback_OutputChange; } void PrivacyModeIsOnFeedback_OutputChange(object sender, EventArgs e) @@ -124,7 +124,7 @@ namespace PepperDash.Essentials.Devices.Common.Microphones { Inputs.Add(input); - input.InputStateFeedback.OutputChange += new EventHandler(InputStateFeedback_OutputChange); + input.InputStateFeedback.OutputChange += InputStateFeedback_OutputChange; } void RemoveInput(IDigitalInput input) diff --git a/Essentials/PepperDashEssentials/ControlSystem.cs b/Essentials/PepperDashEssentials/ControlSystem.cs index f9708f48..4f854139 100644 --- a/Essentials/PepperDashEssentials/ControlSystem.cs +++ b/Essentials/PepperDashEssentials/ControlSystem.cs @@ -5,7 +5,6 @@ using Crestron.SimplSharp.CrestronIO; using Crestron.SimplSharpPro; using Crestron.SimplSharpPro.CrestronThread; using PepperDash.Core; -using PepperDash.Core.PortalSync; using PepperDash.Essentials.Core; using PepperDash.Essentials.Devices.Common; using PepperDash.Essentials.DM; @@ -16,7 +15,6 @@ namespace PepperDash.Essentials { public class ControlSystem : CrestronControlSystem { - PepperDashPortalSyncClient PortalSync; HttpLogoServer LogoServer; public ControlSystem() @@ -59,7 +57,7 @@ namespace PepperDash.Essentials "Template URL: {1}", ConfigReader.ConfigObject.SystemUrl, ConfigReader.ConfigObject.TemplateUrl); }, "portalinfo", "Shows portal URLS from configuration", ConsoleAccessLevelEnum.AccessOperator); - //GoWithLoad(); + GoWithLoad(); } /// @@ -174,7 +172,6 @@ namespace PepperDash.Essentials if (s.ToLower() == "enable") { CrestronConsole.ConsoleCommandResponse("Portal Sync features enabled"); - PortalSync = new PepperDashPortalSyncClient(); } } diff --git a/Essentials/PepperDashEssentials/Room/Cotija/RoomBridges/CotijaEssentialsHuddleSpaceRoomBridge.cs b/Essentials/PepperDashEssentials/Room/Cotija/RoomBridges/CotijaEssentialsHuddleSpaceRoomBridge.cs index 80111ee0..2f3cf440 100644 --- a/Essentials/PepperDashEssentials/Room/Cotija/RoomBridges/CotijaEssentialsHuddleSpaceRoomBridge.cs +++ b/Essentials/PepperDashEssentials/Room/Cotija/RoomBridges/CotijaEssentialsHuddleSpaceRoomBridge.cs @@ -68,12 +68,12 @@ namespace PepperDash.Essentials Room.CurrentVolumeDeviceChange += new EventHandler(Room_CurrentVolumeDeviceChange); Room.OnFeedback.OutputChange += OnFeedback_OutputChange; - Room.IsCoolingDownFeedback.OutputChange += new EventHandler(IsCoolingDownFeedback_OutputChange); - Room.IsWarmingUpFeedback.OutputChange += new EventHandler(IsWarmingUpFeedback_OutputChange); + Room.IsCoolingDownFeedback.OutputChange += IsCoolingDownFeedback_OutputChange; + Room.IsWarmingUpFeedback.OutputChange += IsWarmingUpFeedback_OutputChange; - Room.ShutdownPromptTimer.HasStarted += new EventHandler(ShutdownPromptTimer_HasStarted); - Room.ShutdownPromptTimer.HasFinished += new EventHandler(ShutdownPromptTimer_HasFinished); - Room.ShutdownPromptTimer.WasCancelled += new EventHandler(ShutdownPromptTimer_WasCancelled); + Room.ShutdownPromptTimer.HasStarted += ShutdownPromptTimer_HasStarted; + Room.ShutdownPromptTimer.HasFinished += ShutdownPromptTimer_HasFinished; + Room.ShutdownPromptTimer.WasCancelled += ShutdownPromptTimer_WasCancelled; // Registers for initial volume events, if possible var currentVolumeDevice = Room.CurrentVolumeControls; @@ -84,8 +84,8 @@ namespace PepperDash.Essentials { var newDev = currentVolumeDevice as IBasicVolumeWithFeedback; - newDev.MuteFeedback.OutputChange += new EventHandler(VolumeLevelFeedback_OutputChange); - newDev.VolumeLevelFeedback.OutputChange += new EventHandler(VolumeLevelFeedback_OutputChange); + newDev.MuteFeedback.OutputChange += VolumeLevelFeedback_OutputChange; + newDev.VolumeLevelFeedback.OutputChange += VolumeLevelFeedback_OutputChange; } } } @@ -210,8 +210,8 @@ namespace PepperDash.Essentials { var newDev = e.NewDev as IBasicVolumeWithFeedback; - newDev.MuteFeedback.OutputChange += new EventHandler(VolumeLevelFeedback_OutputChange); - newDev.VolumeLevelFeedback.OutputChange += new EventHandler(VolumeLevelFeedback_OutputChange); + newDev.MuteFeedback.OutputChange += VolumeLevelFeedback_OutputChange; + newDev.VolumeLevelFeedback.OutputChange += VolumeLevelFeedback_OutputChange; } } diff --git a/Essentials/PepperDashEssentials/Room/Types/EssentialsRoomBase.cs b/Essentials/PepperDashEssentials/Room/Types/EssentialsRoomBase.cs index 6a72929a..e138211e 100644 --- a/Essentials/PepperDashEssentials/Room/Types/EssentialsRoomBase.cs +++ b/Essentials/PepperDashEssentials/Room/Types/EssentialsRoomBase.cs @@ -210,7 +210,7 @@ namespace PepperDash.Essentials RoomOccupancy = statusProvider; - RoomOccupancy.RoomIsOccupiedFeedback.OutputChange += new EventHandler(RoomIsOccupiedFeedback_OutputChange); + RoomOccupancy.RoomIsOccupiedFeedback.OutputChange += RoomIsOccupiedFeedback_OutputChange; } void RoomIsOccupiedFeedback_OutputChange(object sender, EventArgs e) diff --git a/Essentials/PepperDashEssentials/UIDrivers/Environment Drivers/EssentialsEnvironmentDriver.cs b/Essentials/PepperDashEssentials/UIDrivers/Environment Drivers/EssentialsEnvironmentDriver.cs index 6e0f49f5..158a916c 100644 --- a/Essentials/PepperDashEssentials/UIDrivers/Environment Drivers/EssentialsEnvironmentDriver.cs +++ b/Essentials/PepperDashEssentials/UIDrivers/Environment Drivers/EssentialsEnvironmentDriver.cs @@ -45,7 +45,7 @@ namespace PepperDash.Essentials Devices = new List(); DeviceSubDrivers = new List(); - Parent.AvDriver.PopupInterlock.IsShownFeedback.OutputChange += new EventHandler(IsShownFeedback_OutputChange); + Parent.AvDriver.PopupInterlock.IsShownFeedback.OutputChange += IsShownFeedback_OutputChange; // Calculate the join offests for each device page and assign join actions for each button } diff --git a/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddlePanelAvFunctionsDriver.cs b/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddlePanelAvFunctionsDriver.cs index 589cf734..fbdfa36c 100644 --- a/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddlePanelAvFunctionsDriver.cs +++ b/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddlePanelAvFunctionsDriver.cs @@ -603,7 +603,7 @@ namespace PepperDash.Essentials // respond to offs by cancelling dialog var onFb = CurrentRoom.OnFeedback; - EventHandler offHandler = null; + EventHandler offHandler = null; offHandler = (o, a) => { if (!onFb.BoolValue) diff --git a/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddleTechPageDriver.cs b/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddleTechPageDriver.cs index 36363834..cb89b329 100644 --- a/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddleTechPageDriver.cs +++ b/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddleTechPageDriver.cs @@ -293,7 +293,7 @@ namespace PepperDash.Essentials.UIDrivers // Figure out some way to provide current input feedback if (display is TwoWayDisplayBase) { - (display as TwoWayDisplayBase).CurrentInputFeedback.OutputChange += new EventHandler(CurrentInputFeedback_OutputChange); + (display as TwoWayDisplayBase).CurrentInputFeedback.OutputChange += CurrentInputFeedback_OutputChange; } } diff --git a/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs b/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs index 83a125f8..5f407ead 100644 --- a/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs +++ b/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs @@ -531,7 +531,7 @@ namespace PepperDash.Essentials else { // Rig a one-time handler to catch when the room is warmed and then dial call - EventHandler oneTimeHandler = null; + EventHandler oneTimeHandler = null; oneTimeHandler = (o, a) => { if (!CurrentRoom.IsWarmingUpFeedback.BoolValue) @@ -774,7 +774,7 @@ namespace PepperDash.Essentials // respond to offs by cancelling dialog var onFb = CurrentRoom.OnFeedback; - EventHandler offHandler = null; + EventHandler offHandler = null; offHandler = (o, a) => { if (!onFb.BoolValue) @@ -932,7 +932,7 @@ namespace PepperDash.Essentials (_CurrentRoom.VideoCodec as IHasScheduleAwareness).CodecSchedule.MeetingsListHasChanged += CodecSchedule_MeetingsListHasChanged; CallSharingInfoVisibleFeedback = new BoolFeedback(() => _CurrentRoom.VideoCodec.SharingContentIsOnFeedback.BoolValue); - _CurrentRoom.VideoCodec.SharingContentIsOnFeedback.OutputChange += new EventHandler(SharingContentIsOnFeedback_OutputChange); + _CurrentRoom.VideoCodec.SharingContentIsOnFeedback.OutputChange += SharingContentIsOnFeedback_OutputChange; CallSharingInfoVisibleFeedback.LinkInputSig(TriList.BooleanInput[UIBoolJoin.CallSharedSourceInfoVisible]); SetActiveCallListSharingContentStatus(); diff --git a/Release Package/PepperDashEssentials.cpz b/Release Package/PepperDashEssentials.cpz index e31f1e88..e5c2e99c 100644 Binary files a/Release Package/PepperDashEssentials.cpz and b/Release Package/PepperDashEssentials.cpz differ diff --git a/Release Package/PepperDashEssentials.dll b/Release Package/PepperDashEssentials.dll index b7ce2626..e11444a5 100644 Binary files a/Release Package/PepperDashEssentials.dll and b/Release Package/PepperDashEssentials.dll differ