mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-13 19:54:59 +00:00
Compare commits
2 Commits
feature/Ge
...
1.8.1-alph
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8bcc56c8ee | ||
|
|
921819592e |
@@ -5,30 +5,62 @@ namespace PepperDash.Essentials.Room.Config
|
|||||||
{
|
{
|
||||||
public class EssentialsTechRoomConfig
|
public class EssentialsTechRoomConfig
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The key of the dummy device used to enable routing
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("dummySourceKey")]
|
[JsonProperty("dummySourceKey")]
|
||||||
public string DummySourceKey { get; set; }
|
public string DummySourceKey { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The keys of the displays assigned to this room
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("displays")]
|
[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")]
|
[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")]
|
[JsonProperty("userPin")]
|
||||||
public string UserPin;
|
public string UserPin { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// PIN to access the room as a tech user
|
||||||
|
/// </summary>
|
||||||
[JsonProperty("techPin")]
|
[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")]
|
[JsonProperty("presetsFileName")]
|
||||||
public string PresetsFileName;
|
public string PresetsFileName { get; set; }
|
||||||
|
|
||||||
[JsonProperty("scheduledEvents")]
|
[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()
|
public EssentialsTechRoomConfig()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -373,13 +373,32 @@ Params: {2}"
|
|||||||
uint i;
|
uint i;
|
||||||
if (_config.IsPrimary)
|
if (_config.IsPrimary)
|
||||||
{
|
{
|
||||||
i = 0;
|
Debug.Console(1, this, "Linking Primary system Tuner Preset Mirroring");
|
||||||
foreach (var feedback in CurrentPresetsFeedbacks)
|
if (_config.MirroredTuners != null && _config.MirroredTuners.Count > 0)
|
||||||
{
|
{
|
||||||
feedback.Value.LinkInputSig(trilist.StringInput[(uint) (joinMap.CurrentPreset.JoinNumber + i)]);
|
foreach (var tuner in _config.MirroredTuners)
|
||||||
i++;
|
{
|
||||||
|
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) =>
|
trilist.OnlineStatusChange += (device, args) =>
|
||||||
{
|
{
|
||||||
if (!args.DeviceOnLine)
|
if (!args.DeviceOnLine)
|
||||||
@@ -395,15 +414,35 @@ Params: {2}"
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
i = 0;
|
|
||||||
foreach (var setTopBox in _tuners)
|
|
||||||
{
|
{
|
||||||
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));
|
||||||
|
|
||||||
|
//}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ namespace PepperDash.Essentials.Core
|
|||||||
{
|
{
|
||||||
Communication = comm;
|
Communication = comm;
|
||||||
PortGather = new CommunicationGather(Communication, '\x0d');
|
PortGather = new CommunicationGather(Communication, '\x0d');
|
||||||
PortGather.LineReceived += this.Port_LineReceived;
|
|
||||||
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, props.CommunicationMonitorProperties);
|
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, props.CommunicationMonitorProperties);
|
||||||
LineEnding = props.LineEnding;
|
LineEnding = props.LineEnding;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ namespace PepperDash.Essentials.Core.Utilities
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void StartSequence()
|
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");
|
Debug.Console(1, this, "Thread already running. Cannot Start Sequence");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -820,7 +820,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
if (RouteOffTimers.ContainsKey(pnt))
|
if (RouteOffTimers.ContainsKey(pnt))
|
||||||
return;
|
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
|
#region IRouting Members
|
||||||
|
|||||||
@@ -165,12 +165,6 @@ namespace PepperDash.Essentials.Devices.Common.DSP
|
|||||||
/// <param name="args"></param>
|
/// <param name="args"></param>
|
||||||
private void Port_LineReceived(object dev, GenericCommMethodReceiveTextArgs args)
|
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
|
try
|
||||||
{
|
{
|
||||||
if (args.Text.IndexOf("Welcome to the Tesira Text Protocol Server...") > -1)
|
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>
|
/// <param name="s">Command to send</param>
|
||||||
public void SendLine(string s)
|
public void SendLine(string s)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "TX: '{0}'", s);
|
|
||||||
Communication.SendText(s + "\x0a");
|
Communication.SendText(s + "\x0a");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -232,7 +232,6 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Lutron
|
|||||||
/// <param name="s"></param>
|
/// <param name="s"></param>
|
||||||
public void SendLine(string s)
|
public void SendLine(string s)
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "TX: '{0}'", s);
|
|
||||||
Communication.SendText(s + Delimiter);
|
Communication.SendText(s + Delimiter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,7 +133,6 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
/// <param name="args"></param>
|
/// <param name="args"></param>
|
||||||
void Port_LineReceived(object dev, GenericCommMethodReceiveTextArgs args)
|
void Port_LineReceived(object dev, GenericCommMethodReceiveTextArgs args)
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "TVOneCurio RX: '{0}'", args.Text);
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (args.Text.IndexOf("login") > -1)
|
if (args.Text.IndexOf("login") > -1)
|
||||||
@@ -168,7 +167,6 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
/// <param name="s">Command to send</param>
|
/// <param name="s">Command to send</param>
|
||||||
public void SendLine(string s)
|
public void SendLine(string s)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "TVOne Cusio TX: '{0}'", s);
|
|
||||||
Communication.SendText(s + "\x0d\x0a");
|
Communication.SendText(s + "\x0d\x0a");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -133,7 +133,6 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
/// <param name="args"></param>
|
/// <param name="args"></param>
|
||||||
void Port_LineReceived(object dev, GenericCommMethodReceiveTextArgs args)
|
void Port_LineReceived(object dev, GenericCommMethodReceiveTextArgs args)
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "TVOneCurio RX: '{0}'", args.Text);
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (args.Text.IndexOf("login") > -1)
|
if (args.Text.IndexOf("login") > -1)
|
||||||
@@ -168,7 +167,6 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
/// <param name="s">Command to send</param>
|
/// <param name="s">Command to send</param>
|
||||||
public void SendLine(string s)
|
public void SendLine(string s)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "TVOne Cusio TX: '{0}'", s);
|
|
||||||
Communication.SendText(s + "\x0d\x0a");
|
Communication.SendText(s + "\x0d\x0a");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -219,8 +219,6 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
string url = string.Format("http://{0}{1}", this.address, s);
|
string url = string.Format("http://{0}{1}", this.address, s);
|
||||||
request.Url = new UrlParser(url);
|
request.Url = new UrlParser(url);
|
||||||
HttpClientResponse response = WebClient.Dispatch(request);
|
HttpClientResponse response = WebClient.Dispatch(request);
|
||||||
|
|
||||||
Debug.Console(2, this, "DigitalLogger TX:\n'{0}'\nRX:\n'{1}'", url, response.ContentString);
|
|
||||||
return response.ContentString;
|
return response.ContentString;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -236,9 +234,6 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
request.Url = new UrlParser(url);
|
request.Url = new UrlParser(url);
|
||||||
|
|
||||||
HttpClientResponse response = WebClient.Dispatch(request);
|
HttpClientResponse response = WebClient.Dispatch(request);
|
||||||
|
|
||||||
Debug.Console(2, this, "DigitalLogger TX:\n'{0}'\nRX:\n'{1}'", url, response.ContentString);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CycleCircuit(uint circuit)
|
public void CycleCircuit(uint circuit)
|
||||||
|
|||||||
@@ -635,12 +635,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
/// <param name="args"></param>
|
/// <param name="args"></param>
|
||||||
void Port_LineReceived(object dev, GenericCommMethodReceiveTextArgs args)
|
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
|
if (args.Text == "{" + Delimiter) // Check for the beginning of a new JSON message
|
||||||
{
|
{
|
||||||
JsonFeedbackMessageIsIncoming = true;
|
JsonFeedbackMessageIsIncoming = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user