Compare commits

...

2 Commits

Author SHA1 Message Date
Jonathan Arndt
8bcc56c8ee Removed all TX: and RX: Debug.Console statements I could find and recompiled clean. 2021-03-10 22:06:17 -08:00
Jonathan Arndt
921819592e Reset branch back to latest DEVELOPMENT head 2021-03-10 21:34:19 -08:00
11 changed files with 91 additions and 44 deletions

View File

@@ -5,30 +5,62 @@ namespace PepperDash.Essentials.Room.Config
{
public class EssentialsTechRoomConfig
{
/// <summary>
/// The key of the dummy device used to enable routing
/// </summary>
[JsonProperty("dummySourceKey")]
public string DummySourceKey { get; set; }
/// <summary>
/// The keys of the displays assigned to this room
/// </summary>
[JsonProperty("displays")]
public List<string> Displays;
public List<string> Displays { get; set; }
/// <summary>
/// The keys of the tuners assinged to this room
/// </summary>
[JsonProperty("tuners")]
public List<string> Tuners;
public List<string> Tuners { get; set; }
/// <summary>
/// PIN to access the room as a normal user
/// </summary>
[JsonProperty("userPin")]
public string UserPin;
public string UserPin { get; set; }
/// <summary>
/// PIN to access the room as a tech user
/// </summary>
[JsonProperty("techPin")]
public string TechPin;
public string TechPin { get; set; }
/// <summary>
/// Name of the presets file. Path prefix is assumed to be /html/presets/lists/
/// </summary>
[JsonProperty("presetsFileName")]
public string PresetsFileName;
public string PresetsFileName { get; set; }
[JsonProperty("scheduledEvents")]
public List<ScheduledEventConfig> ScheduledEvents;
public List<ScheduledEventConfig> ScheduledEvents { get; set; }
[JsonProperty("isPrimary")] public bool IsPrimary;
/// <summary>
/// Indicates that the room is the primary when true
/// </summary>
[JsonProperty("isPrimary")]
public bool IsPrimary { get; set; }
[JsonProperty("isTvPresetsProvider")] public bool IsTvPresetsProvider;
/// <summary>
/// Indicates which tuners should mirror preset recall when two rooms are configured in a primary->secondary scenario
/// </summary>
[JsonProperty("mirroredTuners")]
public Dictionary<uint, string> MirroredTuners { get; set; }
/// <summary>
/// Indicates the room
/// </summary>
[JsonProperty("isTvPresetsProvider")]
public bool IsTvPresetsProvider;
public EssentialsTechRoomConfig()
{

View File

@@ -373,13 +373,32 @@ Params: {2}"
uint i;
if (_config.IsPrimary)
{
i = 0;
foreach (var feedback in CurrentPresetsFeedbacks)
Debug.Console(1, this, "Linking Primary system Tuner Preset Mirroring");
if (_config.MirroredTuners != null && _config.MirroredTuners.Count > 0)
{
feedback.Value.LinkInputSig(trilist.StringInput[(uint) (joinMap.CurrentPreset.JoinNumber + i)]);
i++;
foreach (var tuner in _config.MirroredTuners)
{
var f = CurrentPresetsFeedbacks[tuner.Value];
if (f == null)
{
Debug.Console(1, this, "Unable to find feedback with key: {0}", tuner.Value);
continue;
}
var join = joinMap.CurrentPreset.JoinNumber + tuner.Key;
f.LinkInputSig(trilist.StringInput[(uint)(join)]);
Debug.Console(1, this, "Linked Current Preset feedback for tuner: {0} to serial join: {1}", tuner.Value, join);
}
}
//i = 0;
//foreach (var feedback in CurrentPresetsFeedbacks)
//{
// feedback.Value.LinkInputSig(trilist.StringInput[(uint) (joinMap.CurrentPreset.JoinNumber + i)]);
// i++;
//}
trilist.OnlineStatusChange += (device, args) =>
{
if (!args.DeviceOnLine)
@@ -395,15 +414,35 @@ Params: {2}"
return;
}
i = 0;
foreach (var setTopBox in _tuners)
else
{
var tuner = setTopBox;
Debug.Console(1, this, "Linking Secondary system Tuner Preset Mirroring");
trilist.SetStringSigAction(joinMap.CurrentPreset.JoinNumber + i, s => _tunerPresets.Dial(s, tuner.Value));
if (_config.MirroredTuners != null && _config.MirroredTuners.Count > 0)
{
foreach (var tuner in _config.MirroredTuners)
{
var t = _tuners[tuner.Value];
i++;
if (t == null)
{
Debug.Console(1, this, "Unable to find tuner with key: {0}", tuner.Value);
continue;
}
var join = joinMap.CurrentPreset.JoinNumber + tuner.Key;
trilist.SetStringSigAction(join, s => _tunerPresets.Dial(s, t));
Debug.Console(1, this, "Linked preset recall action for tuner: {0} to serial join: {1}", tuner.Value, join);
}
//foreach (var setTopBox in _tuners)
//{
// var tuner = setTopBox;
// trilist.SetStringSigAction(joinMap.CurrentPreset.JoinNumber + i, s => _tunerPresets.Dial(s, tuner.Value));
//}
}
}
}

View File

@@ -31,7 +31,6 @@ namespace PepperDash.Essentials.Core
{
Communication = comm;
PortGather = new CommunicationGather(Communication, '\x0d');
PortGather.LineReceived += this.Port_LineReceived;
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, props.CommunicationMonitorProperties);
LineEnding = props.LineEnding;
}

View File

@@ -47,7 +47,7 @@ namespace PepperDash.Essentials.Core.Utilities
/// </summary>
public void StartSequence()
{
if (_worker.ThreadState == Thread.eThreadStates.ThreadRunning)
if (_worker !=null && _worker.ThreadState == Thread.eThreadStates.ThreadRunning)
{
Debug.Console(1, this, "Thread already running. Cannot Start Sequence");
return;

View File

@@ -820,7 +820,7 @@ namespace PepperDash.Essentials.DM
{
if (RouteOffTimers.ContainsKey(pnt))
return;
RouteOffTimers[pnt] = new CTimer(o => ExecuteSwitch(0, pnt.Number, pnt.Type), RouteOffTime);
RouteOffTimers[pnt] = new CTimer(o => ExecuteSwitch(null, pnt.Selector, pnt.Type), RouteOffTime);
}
#region IRouting Members

View File

@@ -165,12 +165,6 @@ namespace PepperDash.Essentials.Devices.Common.DSP
/// <param name="args"></param>
private void Port_LineReceived(object dev, GenericCommMethodReceiveTextArgs args)
{
if (Debug.Level == 2)
Debug.Console(2, this, "RX: '{0}'",
ShowHexResponse ? ComTextHelper.GetEscapedText(args.Text) : args.Text);
Debug.Console(1, this, "RX: '{0}'", args.Text);
try
{
if (args.Text.IndexOf("Welcome to the Tesira Text Protocol Server...") > -1)
@@ -288,7 +282,6 @@ namespace PepperDash.Essentials.Devices.Common.DSP
/// <param name="s">Command to send</param>
public void SendLine(string s)
{
Debug.Console(1, this, "TX: '{0}'", s);
Communication.SendText(s + "\x0a");
}

View File

@@ -232,7 +232,6 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Lutron
/// <param name="s"></param>
public void SendLine(string s)
{
Debug.Console(2, this, "TX: '{0}'", s);
Communication.SendText(s + Delimiter);
}
}

View File

@@ -133,7 +133,6 @@ namespace PepperDash.Essentials.Devices.Common
/// <param name="args"></param>
void Port_LineReceived(object dev, GenericCommMethodReceiveTextArgs args)
{
Debug.Console(2, this, "TVOneCurio RX: '{0}'", args.Text);
try
{
if (args.Text.IndexOf("login") > -1)
@@ -168,7 +167,6 @@ namespace PepperDash.Essentials.Devices.Common
/// <param name="s">Command to send</param>
public void SendLine(string s)
{
Debug.Console(1, this, "TVOne Cusio TX: '{0}'", s);
Communication.SendText(s + "\x0d\x0a");
}

View File

@@ -133,7 +133,6 @@ namespace PepperDash.Essentials.Devices.Common
/// <param name="args"></param>
void Port_LineReceived(object dev, GenericCommMethodReceiveTextArgs args)
{
Debug.Console(2, this, "TVOneCurio RX: '{0}'", args.Text);
try
{
if (args.Text.IndexOf("login") > -1)
@@ -168,7 +167,6 @@ namespace PepperDash.Essentials.Devices.Common
/// <param name="s">Command to send</param>
public void SendLine(string s)
{
Debug.Console(1, this, "TVOne Cusio TX: '{0}'", s);
Communication.SendText(s + "\x0d\x0a");
}

View File

@@ -219,8 +219,6 @@ namespace PepperDash.Essentials.Devices.Common
string url = string.Format("http://{0}{1}", this.address, s);
request.Url = new UrlParser(url);
HttpClientResponse response = WebClient.Dispatch(request);
Debug.Console(2, this, "DigitalLogger TX:\n'{0}'\nRX:\n'{1}'", url, response.ContentString);
return response.ContentString;
}
/// <summary>
@@ -236,9 +234,6 @@ namespace PepperDash.Essentials.Devices.Common
request.Url = new UrlParser(url);
HttpClientResponse response = WebClient.Dispatch(request);
Debug.Console(2, this, "DigitalLogger TX:\n'{0}'\nRX:\n'{1}'", url, response.ContentString);
}
public void CycleCircuit(uint circuit)

View File

@@ -635,12 +635,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
/// <param name="args"></param>
void Port_LineReceived(object dev, GenericCommMethodReceiveTextArgs args)
{
if (CommDebuggingIsOn)
{
if(!JsonFeedbackMessageIsIncoming)
Debug.Console(1, this, "RX: '{0}'", args.Text);
}
if (args.Text == "{" + Delimiter) // Check for the beginning of a new JSON message
{
JsonFeedbackMessageIsIncoming = true;