mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-18 15:05:01 +00:00
Compare commits
125 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98d3a4a2fa | ||
|
|
1702c69b73 | ||
|
|
722d28b1b3 | ||
|
|
ef7da0d7af | ||
|
|
77d8e63a31 | ||
|
|
d2d99d4bfa | ||
|
|
4bd71b04bf | ||
|
|
c5bcd89695 | ||
|
|
c7cc98bff7 | ||
|
|
db60f8f1be | ||
|
|
e82efdde2d | ||
|
|
d00c8bed5f | ||
|
|
a91af6bd75 | ||
|
|
2d36b80800 | ||
|
|
e152b9a504 | ||
|
|
eac7c91327 | ||
|
|
ac0d5e59a0 | ||
|
|
78be8ec5f2 | ||
|
|
5fc4ff6027 | ||
|
|
63853739f3 | ||
|
|
c14193f9ac | ||
|
|
da179c01f5 | ||
|
|
0ded3e30f9 | ||
|
|
8d215930d9 | ||
|
|
b4edb021ee | ||
|
|
52caa98f33 | ||
|
|
4e041d1773 | ||
|
|
118bd5a54a | ||
|
|
116abbf962 | ||
|
|
a06333e1c3 | ||
|
|
d937dc14fc | ||
|
|
604f4ca22d | ||
|
|
2d7ad8ba2a | ||
|
|
e4a3933743 | ||
|
|
d6445861f5 | ||
|
|
03b076c8eb | ||
|
|
7c58221acc | ||
|
|
14f7c27b33 | ||
|
|
9ea65883b7 | ||
|
|
9d0020d999 | ||
|
|
fb44a3b93c | ||
|
|
6b7c5c01f8 | ||
|
|
1a3eb9a546 | ||
|
|
44c171c8f4 | ||
|
|
ae9833ffaa | ||
|
|
685c344785 | ||
|
|
e6f5142fc3 | ||
|
|
3c9ca1e527 | ||
|
|
452d0a5a39 | ||
|
|
8643ed2caf | ||
|
|
2787c7fc52 | ||
|
|
babc3e4f1a | ||
|
|
0a4ff82af0 | ||
|
|
b455e1af21 | ||
|
|
e12a5e95bf | ||
|
|
3e7144f7ef | ||
|
|
19e070ed76 | ||
|
|
b818c14713 | ||
|
|
63e7866890 | ||
|
|
922d1d8133 | ||
|
|
d26ea01ed9 | ||
|
|
4ebd1b53b5 | ||
|
|
0226b58b1e | ||
|
|
be41922c54 | ||
|
|
56f93c5491 | ||
|
|
8cfd58bb7e | ||
|
|
6ddfdc4b38 | ||
|
|
7640b95701 | ||
|
|
6c2abc7abd | ||
|
|
1849d118b4 | ||
|
|
22e7f004a5 | ||
|
|
0dcaacb038 | ||
|
|
cf8e673677 | ||
|
|
200080247a | ||
|
|
ba247ee8d6 | ||
|
|
b3617d04c8 | ||
|
|
85cf51876a | ||
|
|
b6f47168c0 | ||
|
|
1e755df9bb | ||
|
|
037f8ed043 | ||
|
|
e327d2d359 | ||
|
|
e832566168 | ||
|
|
252d037380 | ||
|
|
dd0f7a586e | ||
|
|
2feec62052 | ||
|
|
33a1b1697a | ||
|
|
955d68b3f3 | ||
|
|
0f28d46f34 | ||
|
|
275759143b | ||
|
|
3a4737b6f6 | ||
|
|
2b2308d5c2 | ||
|
|
185f03065e | ||
|
|
3803263598 | ||
|
|
358fa1a9c0 | ||
|
|
7fbbc9f2b8 | ||
|
|
f4f400f9b6 | ||
|
|
4f9fa05e3f | ||
|
|
7ab2574912 | ||
|
|
35167d77f9 | ||
|
|
6ab4d4d090 | ||
|
|
fcdee3b9fd | ||
|
|
4e15d7fe5a | ||
|
|
2a76e2b3f9 | ||
|
|
f9522a533a | ||
|
|
ec07ec84f7 | ||
|
|
0457bcf7fe | ||
|
|
ba0b2e169a | ||
|
|
bebcc3c6e1 | ||
|
|
8572191c1e | ||
|
|
00d2159d06 | ||
|
|
7019b62610 | ||
|
|
a583fdb72a | ||
|
|
33bf98303d | ||
|
|
b2f3aa9cfa | ||
|
|
29b77f5629 | ||
|
|
f74fa35ca4 | ||
|
|
74231a428d | ||
|
|
8ba0920cc0 | ||
|
|
e23fe06fef | ||
|
|
79fd1f7424 | ||
|
|
d2ebc340bd | ||
|
|
7c7ae65d40 | ||
|
|
0dcbb652df | ||
|
|
0649cea367 | ||
|
|
9f840fae41 |
27
.github/ISSUE_TEMPLATE/rfi_request.md
vendored
Normal file
27
.github/ISSUE_TEMPLATE/rfi_request.md
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
name: Request for Information
|
||||
about: Request specific information about capabilities of the framework
|
||||
title: "[RFI]-"
|
||||
labels: RFI
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**What is your request?**
|
||||
Please provide as much detail as possible.
|
||||
|
||||
|
||||
**What is the intended use case**
|
||||
- [ ] Essentials Standalone Application
|
||||
- [ ] Essentials + SIMPL Windows Hybrid
|
||||
|
||||
**User Interface Requirements**
|
||||
- [ ] Not Applicable (logic only)
|
||||
- [ ] Crestron Smart Graphics Touchpanel
|
||||
- [ ] Cisco Touch10
|
||||
- [ ] Mobile Control
|
||||
- [ ] Crestron CH5 Touchpanel interface
|
||||
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the request here.
|
||||
@@ -36,6 +36,7 @@ namespace PepperDash.Essentials
|
||||
Thread.MaxNumberOfUserThreads = 400;
|
||||
Global.ControlSystem = this;
|
||||
DeviceManager.Initialize(this);
|
||||
SecretsManager.Initialize();
|
||||
SystemMonitor.ProgramInitialization.ProgramInitializationUnderUserControl = true;
|
||||
}
|
||||
|
||||
@@ -71,7 +72,7 @@ namespace PepperDash.Essentials
|
||||
CrestronConsole.AddNewConsoleCommand(s =>
|
||||
{
|
||||
foreach (var tl in TieLineCollection.Default)
|
||||
CrestronConsole.ConsoleCommandResponse(" {0}\r", tl);
|
||||
CrestronConsole.ConsoleCommandResponse(" {0}\r\n", tl);
|
||||
},
|
||||
"listtielines", "Prints out all tie lines", ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
@@ -85,8 +86,8 @@ namespace PepperDash.Essentials
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(s =>
|
||||
{
|
||||
CrestronConsole.ConsoleCommandResponse("This system can be found at the following URLs:\r" +
|
||||
"System URL: {0}\r" +
|
||||
CrestronConsole.ConsoleCommandResponse("This system can be found at the following URLs:\r\n" +
|
||||
"System URL: {0}\r\n" +
|
||||
"Template URL: {1}", ConfigReader.ConfigObject.SystemUrl, ConfigReader.ConfigObject.TemplateUrl);
|
||||
}, "portalinfo", "Shows portal URLS from configuration", ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Room\Config\EssentialsDualDisplayRoomPropertiesConfig.cs" />
|
||||
<Compile Include="Room\Config\EssentialsNDisplayRoomPropertiesConfig.cs" />
|
||||
<Compile Include="Room\Config\DDVC01RoomPropertiesConfig.cs" />
|
||||
<Compile Include="Room\Config\SimplRoomPropertiesConfig.cs" />
|
||||
<Compile Include="Room\Config\EssentialsPresentationPropertiesConfig.cs" />
|
||||
<Compile Include="Room\Config\EssentialsHuddleRoomPropertiesConfig.cs" />
|
||||
<Compile Include="Room\Config\EssentialsHuddleVtc1PropertiesConfig.cs" />
|
||||
|
||||
@@ -196,9 +196,20 @@ namespace PepperDash.Essentials.Room.Config
|
||||
public string DefaultAudioKey { get; set; }
|
||||
[JsonProperty("sourceListKey")]
|
||||
public string SourceListKey { get; set; }
|
||||
[JsonProperty("destinationListKey")]
|
||||
public string DestinationListKey { get; set; }
|
||||
[JsonProperty("defaultSourceItem")]
|
||||
public string DefaultSourceItem { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates if the room supports advanced sharing
|
||||
/// </summary>
|
||||
[JsonProperty("supportsAdvancedSharing")]
|
||||
public bool SupportsAdvancedSharing { get; set; }
|
||||
/// <summary>
|
||||
/// Indicates if non-tech users can change the share mode
|
||||
/// </summary>
|
||||
[JsonProperty("userCanChangeShareMode")]
|
||||
public bool UserCanChangeShareMode { get; set; }
|
||||
}
|
||||
|
||||
public class EssentialsConferenceRoomPropertiesConfig : EssentialsAvRoomPropertiesConfig
|
||||
|
||||
@@ -8,19 +8,19 @@ using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Config
|
||||
{
|
||||
public class DDVC01RoomPropertiesConfig : EssentialsHuddleVtc1PropertiesConfig
|
||||
public class SimplRoomPropertiesConfig : EssentialsHuddleVtc1PropertiesConfig
|
||||
{
|
||||
[JsonProperty("roomPhoneNumber")]
|
||||
public string RoomPhoneNumber { get; set; }
|
||||
[JsonProperty("roomURI")]
|
||||
public string RoomURI { get; set; }
|
||||
[JsonProperty("speedDials")]
|
||||
public List<DDVC01SpeedDial> SpeedDials { get; set; }
|
||||
public List<SimplSpeedDial> SpeedDials { get; set; }
|
||||
[JsonProperty("volumeSliderNames")]
|
||||
public List<string> VolumeSliderNames { get; set; }
|
||||
}
|
||||
|
||||
public class DDVC01SpeedDial
|
||||
public class SimplSpeedDial
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
@@ -19,7 +19,8 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
public class EssentialsHuddleVtc1Room : EssentialsRoomBase, IHasCurrentSourceInfoChange,
|
||||
IPrivacy, IHasCurrentVolumeControls, IRunRouteAction, IRunDefaultCallRoute, IHasVideoCodec, IHasAudioCodec, IHasDefaultDisplay, IHasInCallFeedback
|
||||
{
|
||||
{
|
||||
private bool _codecExternalSourceChange;
|
||||
public event EventHandler<VolumeDeviceChangeEventArgs> CurrentVolumeDeviceChange;
|
||||
public event SourceInfoChangeHandler CurrentSourceChange;
|
||||
|
||||
@@ -178,10 +179,12 @@ namespace PepperDash.Essentials
|
||||
handler(_CurrentSourceInfo, ChangeType.DidChange);
|
||||
|
||||
var vc = VideoCodec as IHasExternalSourceSwitching;
|
||||
if (vc != null)
|
||||
if (vc != null && !_codecExternalSourceChange)
|
||||
{
|
||||
vc.SetSelectedSource(CurrentSourceInfoKey);
|
||||
}
|
||||
|
||||
_codecExternalSourceChange = false;
|
||||
}
|
||||
}
|
||||
SourceListItem _CurrentSourceInfo;
|
||||
@@ -421,6 +424,12 @@ namespace PepperDash.Essentials
|
||||
return true;
|
||||
}
|
||||
|
||||
public void RunRouteActionCodec(string routeKey, string sourceListKey)
|
||||
{
|
||||
_codecExternalSourceChange = true;
|
||||
RunRouteAction(routeKey, sourceListKey);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -750,7 +759,7 @@ namespace PepperDash.Essentials
|
||||
x => x.DestinationKey == VideoCodec.Key && x.DestinationPort == videoCodecWithExternalSwitching.ExternalSourceInputPort).DestinationPort;
|
||||
|
||||
videoCodecWithExternalSwitching.ClearExternalSources();
|
||||
videoCodecWithExternalSwitching.RunRouteAction = RunRouteAction;
|
||||
videoCodecWithExternalSwitching.RunRouteAction = RunRouteActionCodec;
|
||||
var srcList = ConfigReader.ConfigObject.SourceLists.SingleOrDefault(x => x.Key == SourceListKey).Value.OrderBy(kv => kv.Value.Order); ;
|
||||
|
||||
foreach (var kvp in srcList)
|
||||
|
||||
@@ -107,14 +107,18 @@ namespace PepperDash.Essentials
|
||||
|
||||
private void TunerPresetsOnPresetRecalled(ISetTopBoxNumericKeypad device, string channel)
|
||||
{
|
||||
//Debug.Console(2, this, "TunerPresetsOnPresetRecalled");
|
||||
|
||||
if (!_currentPresets.ContainsKey(device.Key))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//Debug.Console(2, this, "Tuner Key: {0} Channel: {1}", device.Key, channel);
|
||||
|
||||
_currentPresets[device.Key] = channel;
|
||||
|
||||
if (!CurrentPresetsFeedbacks.ContainsKey(device.Key))
|
||||
if (CurrentPresetsFeedbacks.ContainsKey(device.Key))
|
||||
{
|
||||
CurrentPresetsFeedbacks[device.Key].FireUpdate();
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -11,8 +11,10 @@ using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public class CecPortController : Device, IBasicCommunication
|
||||
public class CecPortController : Device, IBasicCommunicationWithStreamDebugging
|
||||
{
|
||||
public CommunicationStreamDebugging StreamDebugging { get; private set; }
|
||||
|
||||
public event EventHandler<GenericCommMethodReceiveBytesArgs> BytesReceived;
|
||||
public event EventHandler<GenericCommMethodReceiveTextArgs> TextReceived;
|
||||
|
||||
@@ -23,6 +25,8 @@ namespace PepperDash.Essentials.Core
|
||||
public CecPortController(string key, Func<EssentialsControlPropertiesConfig, ICec> postActivationFunc,
|
||||
EssentialsControlPropertiesConfig config):base(key)
|
||||
{
|
||||
StreamDebugging = new CommunicationStreamDebugging(key);
|
||||
|
||||
AddPostActivationAction(() =>
|
||||
{
|
||||
Port = postActivationFunc(config);
|
||||
@@ -50,15 +54,21 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
void OnDataReceived(string s)
|
||||
{
|
||||
var bytesHandler = BytesReceived;
|
||||
var bytesHandler = BytesReceived;
|
||||
if (bytesHandler != null)
|
||||
{
|
||||
var bytes = Encoding.GetEncoding(28591).GetBytes(s);
|
||||
if (StreamDebugging.RxStreamDebuggingIsEnabled)
|
||||
Debug.Console(0, this, "Received: '{0}'", ComTextHelper.GetEscapedText(bytes));
|
||||
bytesHandler(this, new GenericCommMethodReceiveBytesArgs(bytes));
|
||||
}
|
||||
var textHandler = TextReceived;
|
||||
if (textHandler != null)
|
||||
textHandler(this, new GenericCommMethodReceiveTextArgs(s));
|
||||
if (textHandler != null)
|
||||
{
|
||||
if (StreamDebugging.RxStreamDebuggingIsEnabled)
|
||||
Debug.Console(0, this, "Received: '{0}'", s);
|
||||
textHandler(this, new GenericCommMethodReceiveTextArgs(s));
|
||||
}
|
||||
}
|
||||
|
||||
#region IBasicCommunication Members
|
||||
@@ -67,6 +77,8 @@ namespace PepperDash.Essentials.Core
|
||||
{
|
||||
if (Port == null)
|
||||
return;
|
||||
if (StreamDebugging.TxStreamDebuggingIsEnabled)
|
||||
Debug.Console(0, this, "Sending {0} characters of text: '{1}'", text.Length, text);
|
||||
Port.StreamCec.Send.StringValue = text;
|
||||
}
|
||||
|
||||
@@ -75,6 +87,8 @@ namespace PepperDash.Essentials.Core
|
||||
if (Port == null)
|
||||
return;
|
||||
var text = Encoding.GetEncoding(28591).GetString(bytes, 0, bytes.Length);
|
||||
if (StreamDebugging.TxStreamDebuggingIsEnabled)
|
||||
Debug.Console(0, this, "Sending {0} bytes: '{1}'", bytes.Length, ComTextHelper.GetEscapedText(bytes));
|
||||
Port.StreamCec.Send.StringValue = text;
|
||||
}
|
||||
|
||||
|
||||
@@ -92,18 +92,20 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
void OnDataReceived(string s)
|
||||
{
|
||||
|
||||
var bytesHandler = BytesReceived;
|
||||
if (bytesHandler != null)
|
||||
{
|
||||
var bytes = Encoding.GetEncoding(28591).GetBytes(s);
|
||||
if (StreamDebugging.RxStreamDebuggingIsEnabled)
|
||||
Debug.Console(0, this, "Received: '{0}'", ComTextHelper.GetEscapedText(bytes));
|
||||
bytesHandler(this, new GenericCommMethodReceiveBytesArgs(bytes));
|
||||
}
|
||||
var textHandler = TextReceived;
|
||||
if (textHandler != null)
|
||||
{
|
||||
if (StreamDebugging.RxStreamDebuggingIsEnabled)
|
||||
Debug.Console(0, this, "Recevied: '{0}'", s);
|
||||
|
||||
if (StreamDebugging.RxStreamDebuggingIsEnabled)
|
||||
Debug.Console(0, this, "Received: '{0}'", s);
|
||||
textHandler(this, new GenericCommMethodReceiveTextArgs(s));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace PepperDash.Essentials.Core
|
||||
{
|
||||
Communication = comm;
|
||||
PortGather = new CommunicationGather(Communication, '\x0d');
|
||||
PortGather.LineReceived += this.Port_LineReceived;
|
||||
//PortGather.LineReceived += this.Port_LineReceived;
|
||||
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, props.CommunicationMonitorProperties);
|
||||
LineEnding = props.LineEnding;
|
||||
}
|
||||
@@ -47,13 +47,6 @@ namespace PepperDash.Essentials.Core
|
||||
return true;
|
||||
}
|
||||
|
||||
void Port_LineReceived(object dev, GenericCommMethodReceiveTextArgs args)
|
||||
{
|
||||
if (Debug.Level == 2)
|
||||
Debug.Console(2, this, "RX: '{0}'",
|
||||
ShowHexResponse ? ComTextHelper.GetEscapedText(args.Text) : args.Text);
|
||||
}
|
||||
|
||||
void SendLine(string s)
|
||||
{
|
||||
//if (Debug.Level == 2)
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace PepperDash.Essentials.Core
|
||||
public GenericComm(DeviceConfig config)
|
||||
: base(config)
|
||||
{
|
||||
|
||||
PropertiesConfig = CommFactory.GetControlPropertiesConfig(config);
|
||||
|
||||
var commPort = CommFactory.CreateCommForDevice(config);
|
||||
@@ -96,7 +97,6 @@ namespace PepperDash.Essentials.Core
|
||||
// this is a permanent event handler. This cannot be -= from event
|
||||
CommPort.TextReceived += (s, a) =>
|
||||
{
|
||||
Debug.Console(2, this, "RX: {0}", a.Text);
|
||||
trilist.SetString(joinMap.TextReceived.JoinNumber, a.Text);
|
||||
};
|
||||
trilist.SetStringSigAction(joinMap.SendText.JoinNumber, s => CommPort.SendText(s));
|
||||
|
||||
@@ -33,7 +33,6 @@ namespace PepperDash.Essentials.Core
|
||||
string url = string.Format("http://{0}/{1}", Client.HostName, path);
|
||||
request.Url = new UrlParser(url);
|
||||
HttpClient.DISPATCHASYNC_ERROR error = Client.DispatchAsyncEx(request, Response, request);
|
||||
Debug.Console(2, this, "GenericHttpClient SentRequest TX:'{0}'", url);
|
||||
}
|
||||
public void SendText(string format, params object[] items)
|
||||
{
|
||||
@@ -41,7 +40,6 @@ namespace PepperDash.Essentials.Core
|
||||
string url = string.Format("http://{0}/{1}", Client.HostName, string.Format(format, items));
|
||||
request.Url = new UrlParser(url);
|
||||
HttpClient.DISPATCHASYNC_ERROR error = Client.DispatchAsyncEx(request, Response, request);
|
||||
Debug.Console(2, this, "GenericHttpClient SentRequest TX:'{0}'", url);
|
||||
}
|
||||
|
||||
public void SendTextNoResponse(string format, params object[] items)
|
||||
@@ -50,7 +48,6 @@ namespace PepperDash.Essentials.Core
|
||||
string url = string.Format("http://{0}/{1}", Client.HostName, string.Format(format, items));
|
||||
request.Url = new UrlParser(url);
|
||||
Client.Dispatch(request);
|
||||
Debug.Console(2, this, "GenericHttpClient SentRequest TX:'{0}'", url);
|
||||
}
|
||||
|
||||
private void Response(HttpClientResponse response, HTTP_CALLBACK_ERROR error, object request)
|
||||
@@ -63,10 +60,6 @@ namespace PepperDash.Essentials.Core
|
||||
{
|
||||
if (ResponseRecived != null)
|
||||
ResponseRecived(this, new GenericHttpClientEventArgs(responseReceived.ContentString, (request as HttpClientRequest).Url.ToString(), error));
|
||||
|
||||
Debug.Console(2, this, "GenericHttpClient ResponseReceived");
|
||||
Debug.Console(2, this, "RX:{0}", responseReceived.ContentString);
|
||||
Debug.Console(2, this, "TX:{0}", (request as HttpClientRequest).Url.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
@@ -25,12 +20,25 @@ namespace PepperDash.Essentials.Core.Config
|
||||
[JsonProperty("sourceLists")]
|
||||
public Dictionary<string, Dictionary<string, SourceListItem>> SourceLists { get; set; }
|
||||
|
||||
[JsonProperty("tieLines")]
|
||||
[JsonProperty("destinationLists")]
|
||||
public Dictionary<string, Dictionary<string,DestinationListItem>> DestinationLists { get; set; }
|
||||
|
||||
[JsonProperty("tieLines")]
|
||||
public List<TieLineConfig> TieLines { get; set; }
|
||||
|
||||
[JsonProperty("joinMaps")]
|
||||
public Dictionary<string, JObject> JoinMaps { get; set; }
|
||||
|
||||
public BasicConfig()
|
||||
{
|
||||
Info = new InfoConfig();
|
||||
Devices = new List<DeviceConfig>();
|
||||
SourceLists = new Dictionary<string, Dictionary<string, SourceListItem>>();
|
||||
DestinationLists = new Dictionary<string, Dictionary<string, DestinationListItem>>();
|
||||
TieLines = new List<TieLineConfig>();
|
||||
JoinMaps = new Dictionary<string, JObject>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks SourceLists for a given list and returns it if found. Otherwise, returns null
|
||||
/// </summary>
|
||||
@@ -42,6 +50,21 @@ namespace PepperDash.Essentials.Core.Config
|
||||
return SourceLists[key];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves a DestinationListItem based on the key
|
||||
/// </summary>
|
||||
/// <param name="key">key of the item to retrieve</param>
|
||||
/// <returns>DestinationListItem if the key exists, null otherwise</returns>
|
||||
public Dictionary<string, DestinationListItem> GetDestinationListForKey(string key)
|
||||
{
|
||||
if (string.IsNullOrEmpty(key) || !DestinationLists.ContainsKey(key))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return DestinationLists[key];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks Devices for an item with a Key that matches and returns it if found. Otherwise, retunes null
|
||||
/// </summary>
|
||||
|
||||
@@ -30,7 +30,19 @@ namespace PepperDash.Essentials.Core.Config
|
||||
|
||||
[JsonProperty("properties")]
|
||||
[JsonConverter(typeof(DevicePropertiesConverter))]
|
||||
public JToken Properties { get; set; }
|
||||
public JToken Properties { get; set; }
|
||||
|
||||
public DeviceConfig(DeviceConfig dc)
|
||||
{
|
||||
Key = dc.Key;
|
||||
Uid = dc.Uid;
|
||||
Name = dc.Name;
|
||||
Group = dc.Group;
|
||||
Type = dc.Type;
|
||||
Properties = JToken.FromObject(dc.Properties);
|
||||
}
|
||||
|
||||
public DeviceConfig() {}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,162 +1,162 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Config
|
||||
{
|
||||
/// <summary>
|
||||
/// Responsible for updating config at runtime, and writing the updates out to a local file
|
||||
/// </summary>
|
||||
public class ConfigWriter
|
||||
{
|
||||
public const string LocalConfigFolder = "LocalConfig";
|
||||
|
||||
public const long WriteTimeout = 30000;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Config
|
||||
{
|
||||
/// <summary>
|
||||
/// Responsible for updating config at runtime, and writing the updates out to a local file
|
||||
/// </summary>
|
||||
public class ConfigWriter
|
||||
{
|
||||
public const string LocalConfigFolder = "LocalConfig";
|
||||
|
||||
public const long WriteTimeout = 30000;
|
||||
|
||||
public static CTimer WriteTimer;
|
||||
static CCriticalSection fileLock = new CCriticalSection();
|
||||
|
||||
/// <summary>
|
||||
/// Updates the config properties of a device
|
||||
/// </summary>
|
||||
/// <param name="deviceKey"></param>
|
||||
/// <param name="properties"></param>
|
||||
/// <returns></returns>
|
||||
public static bool UpdateDeviceProperties(string deviceKey, JToken properties)
|
||||
{
|
||||
bool success = false;
|
||||
|
||||
// Get the current device config
|
||||
var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(deviceKey));
|
||||
|
||||
if (deviceConfig != null)
|
||||
{
|
||||
// Replace the current properties JToken with the new one passed into this method
|
||||
deviceConfig.Properties = properties;
|
||||
|
||||
Debug.Console(1, "Updated properties of device: '{0}'", deviceKey);
|
||||
|
||||
success = true;
|
||||
}
|
||||
|
||||
ResetTimer();
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
public static bool UpdateDeviceConfig(DeviceConfig config)
|
||||
{
|
||||
bool success = false;
|
||||
|
||||
var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(config.Key));
|
||||
|
||||
if (deviceConfig != null)
|
||||
{
|
||||
deviceConfig = config;
|
||||
|
||||
Debug.Console(1, "Updated config of device: '{0}'", config.Key);
|
||||
|
||||
success = true;
|
||||
}
|
||||
|
||||
ResetTimer();
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
public static bool UpdateRoomConfig(DeviceConfig config)
|
||||
{
|
||||
bool success = false;
|
||||
|
||||
var deviceConfig = ConfigReader.ConfigObject.Rooms.FirstOrDefault(d => d.Key.Equals(config.Key));
|
||||
|
||||
if (deviceConfig != null)
|
||||
{
|
||||
deviceConfig = config;
|
||||
|
||||
Debug.Console(1, "Updated config of device: '{0}'", config.Key);
|
||||
|
||||
success = true;
|
||||
}
|
||||
|
||||
ResetTimer();
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets (or starts) the write timer
|
||||
/// </summary>
|
||||
static void ResetTimer()
|
||||
{
|
||||
if (WriteTimer == null)
|
||||
WriteTimer = new CTimer(WriteConfigFile, WriteTimeout);
|
||||
|
||||
WriteTimer.Reset(WriteTimeout);
|
||||
|
||||
Debug.Console(1, "Config File write timer has been reset.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes the current config to a file in the LocalConfig subfolder
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static void WriteConfigFile(object o)
|
||||
{
|
||||
var filePath = Global.FilePathPrefix + LocalConfigFolder + Global.DirectorySeparator + "configurationFile.json";
|
||||
|
||||
var configData = JsonConvert.SerializeObject(ConfigReader.ConfigObject);
|
||||
|
||||
WriteFile(filePath, configData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes
|
||||
/// </summary>
|
||||
/// <param name="filepath"></param>
|
||||
/// <param name="o"></param>
|
||||
public static void WriteFile(string filePath, string configData)
|
||||
{
|
||||
if (WriteTimer != null)
|
||||
WriteTimer.Stop();
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Writing Configuration to file");
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to write config file: '{0}'", filePath);
|
||||
|
||||
try
|
||||
{
|
||||
if (fileLock.TryEnter())
|
||||
{
|
||||
using (StreamWriter sw = new StreamWriter(filePath))
|
||||
{
|
||||
sw.Write(configData);
|
||||
sw.Flush();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to enter FileLock");
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Error, "Error: Config write failed: \r{0}", e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (fileLock != null && !fileLock.Disposed)
|
||||
fileLock.Leave();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
static CCriticalSection fileLock = new CCriticalSection();
|
||||
|
||||
/// <summary>
|
||||
/// Updates the config properties of a device
|
||||
/// </summary>
|
||||
/// <param name="deviceKey"></param>
|
||||
/// <param name="properties"></param>
|
||||
/// <returns></returns>
|
||||
public static bool UpdateDeviceProperties(string deviceKey, JToken properties)
|
||||
{
|
||||
bool success = false;
|
||||
|
||||
// Get the current device config
|
||||
var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(deviceKey));
|
||||
|
||||
if (deviceConfig != null)
|
||||
{
|
||||
// Replace the current properties JToken with the new one passed into this method
|
||||
deviceConfig.Properties = properties;
|
||||
|
||||
Debug.Console(1, "Updated properties of device: '{0}'", deviceKey);
|
||||
|
||||
success = true;
|
||||
}
|
||||
|
||||
ResetTimer();
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
public static bool UpdateDeviceConfig(DeviceConfig config)
|
||||
{
|
||||
bool success = false;
|
||||
|
||||
var deviceConfigIndex = ConfigReader.ConfigObject.Devices.FindIndex(d => d.Key.Equals(config.Key));
|
||||
|
||||
if (deviceConfigIndex >= 0)
|
||||
{
|
||||
ConfigReader.ConfigObject.Devices[deviceConfigIndex] = config;
|
||||
|
||||
Debug.Console(1, "Updated config of device: '{0}'", config.Key);
|
||||
|
||||
success = true;
|
||||
}
|
||||
|
||||
ResetTimer();
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
public static bool UpdateRoomConfig(DeviceConfig config)
|
||||
{
|
||||
bool success = false;
|
||||
|
||||
var roomConfigIndex = ConfigReader.ConfigObject.Rooms.FindIndex(d => d.Key.Equals(config.Key));
|
||||
|
||||
if (roomConfigIndex >= 0)
|
||||
{
|
||||
ConfigReader.ConfigObject.Rooms[roomConfigIndex] = config;
|
||||
|
||||
Debug.Console(1, "Updated room of device: '{0}'", config.Key);
|
||||
|
||||
success = true;
|
||||
}
|
||||
|
||||
ResetTimer();
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets (or starts) the write timer
|
||||
/// </summary>
|
||||
static void ResetTimer()
|
||||
{
|
||||
if (WriteTimer == null)
|
||||
WriteTimer = new CTimer(WriteConfigFile, WriteTimeout);
|
||||
|
||||
WriteTimer.Reset(WriteTimeout);
|
||||
|
||||
Debug.Console(1, "Config File write timer has been reset.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes the current config to a file in the LocalConfig subfolder
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static void WriteConfigFile(object o)
|
||||
{
|
||||
var filePath = Global.FilePathPrefix + LocalConfigFolder + Global.DirectorySeparator + "configurationFile.json";
|
||||
|
||||
var configData = JsonConvert.SerializeObject(ConfigReader.ConfigObject);
|
||||
|
||||
WriteFile(filePath, configData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes
|
||||
/// </summary>
|
||||
/// <param name="filepath"></param>
|
||||
/// <param name="o"></param>
|
||||
public static void WriteFile(string filePath, string configData)
|
||||
{
|
||||
if (WriteTimer != null)
|
||||
WriteTimer.Stop();
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Writing Configuration to file");
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to write config file: '{0}'", filePath);
|
||||
|
||||
try
|
||||
{
|
||||
if (fileLock.TryEnter())
|
||||
{
|
||||
using (StreamWriter sw = new StreamWriter(filePath))
|
||||
{
|
||||
sw.Write(configData);
|
||||
sw.Flush();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to enter FileLock");
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Error, "Error: Config write failed: \r{0}", e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (fileLock != null && !fileLock.Disposed)
|
||||
fileLock.Leave();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -51,6 +51,13 @@ namespace PepperDash.Essentials.Core.Config
|
||||
|
||||
[JsonProperty("rooms")]
|
||||
public List<DeviceConfig> Rooms { get; set; }
|
||||
|
||||
|
||||
public EssentialsConfig()
|
||||
: base()
|
||||
{
|
||||
Rooms = new List<DeviceConfig>();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -20,6 +20,10 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||
{
|
||||
event EventHandler<EventArgs> UserCodeChanged;
|
||||
|
||||
event EventHandler<EventArgs> UserPromptedForCode;
|
||||
|
||||
event EventHandler<EventArgs> ClientJoined;
|
||||
|
||||
string UserCode { get; }
|
||||
|
||||
string QrCodeUrl { get; }
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public class DestinationListItem
|
||||
{
|
||||
[JsonProperty("sinkKey")]
|
||||
public string SinkKey { get; set; }
|
||||
|
||||
private EssentialsDevice _sinkDevice;
|
||||
|
||||
[JsonIgnore]
|
||||
public EssentialsDevice SinkDevice
|
||||
{
|
||||
get { return _sinkDevice ?? (_sinkDevice = DeviceManager.GetDeviceForKey(SinkKey) as EssentialsDevice); }
|
||||
}
|
||||
|
||||
[JsonProperty("preferredName")]
|
||||
public string PreferredName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Name))
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
|
||||
return SinkDevice == null ? "---" : SinkDevice.Name;
|
||||
}
|
||||
}
|
||||
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonProperty("includeInDestinationList")]
|
||||
public bool IncludeInDestinationList { get; set; }
|
||||
|
||||
[JsonProperty("order")]
|
||||
public int Order { get; set; }
|
||||
|
||||
[JsonProperty("surfaceLocation")]
|
||||
public int SurfaceLocation { get; set; }
|
||||
|
||||
[JsonProperty("verticalLocation")]
|
||||
public int VerticalLocation { get; set; }
|
||||
|
||||
[JsonProperty("horizontalLocation")]
|
||||
public int HorizontalLocation { get; set; }
|
||||
|
||||
[JsonProperty("sinkType")]
|
||||
public eRoutingSignalType SinkType { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -20,8 +20,23 @@ namespace PepperDash.Essentials.Core
|
||||
/// <param name="json"></param>
|
||||
public static void DoDeviceActionWithJson(string json)
|
||||
{
|
||||
var action = JsonConvert.DeserializeObject<DeviceActionWrapper>(json);
|
||||
DoDeviceAction(action);
|
||||
if (String.IsNullOrEmpty(json))
|
||||
{
|
||||
CrestronConsole.ConsoleCommandResponse(
|
||||
"Please provide a JSON object matching the format {\"deviceKey\":\"myDevice\", \"methodName\":\"someMethod\", \"params\": [\"param1\", true]}.\r\nIf the method has no parameters, the \"params\" object may be omitted.");
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
var action = JsonConvert.DeserializeObject<DeviceActionWrapper>(json);
|
||||
|
||||
DoDeviceAction(action);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
CrestronConsole.ConsoleCommandResponse("Incorrect format for JSON. Please check that the format matches {\"deviceKey\":\"myDevice\", \"methodName\":\"someMethod\", \"params\": [\"param1\", true]}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -33,29 +48,47 @@ namespace PepperDash.Essentials.Core
|
||||
{
|
||||
var key = action.DeviceKey;
|
||||
var obj = FindObjectOnPath(key);
|
||||
if (obj == null)
|
||||
return;
|
||||
if (obj == null)
|
||||
{
|
||||
CrestronConsole.ConsoleCommandResponse("Unable to find object at path {0}", key);
|
||||
return;
|
||||
}
|
||||
|
||||
CType t = obj.GetType();
|
||||
var method = t.GetMethod(action.MethodName);
|
||||
if (method == null)
|
||||
{
|
||||
Debug.Console(0, "Method '{0}' not found", action.MethodName);
|
||||
return;
|
||||
}
|
||||
var mParams = method.GetParameters();
|
||||
// Add empty params if not provided
|
||||
if (action.Params == null) action.Params = new object[0];
|
||||
if (mParams.Length > action.Params.Length)
|
||||
{
|
||||
Debug.Console(0, "Method '{0}' requires {1} params", action.MethodName, mParams.Length);
|
||||
return;
|
||||
}
|
||||
object[] convertedParams = mParams
|
||||
.Select((p, i) => Convert.ChangeType(action.Params[i], p.ParameterType,
|
||||
System.Globalization.CultureInfo.InvariantCulture))
|
||||
.ToArray();
|
||||
object ret = method.Invoke(obj, convertedParams);
|
||||
if (action.Params == null)
|
||||
{
|
||||
//no params, so setting action.Params to empty array
|
||||
action.Params = new object[0];
|
||||
}
|
||||
|
||||
CType t = obj.GetType();
|
||||
try
|
||||
{
|
||||
var methods = t.GetMethods().Where(m => m.Name == action.MethodName).ToList();
|
||||
|
||||
var method = methods.Count == 1 ? methods[0] : methods.FirstOrDefault(m => m.GetParameters().Length == action.Params.Length);
|
||||
|
||||
if (method == null)
|
||||
{
|
||||
CrestronConsole.ConsoleCommandResponse(
|
||||
"Unable to find method with name {0} and that matches parameters {1}", action.MethodName,
|
||||
action.Params);
|
||||
return;
|
||||
}
|
||||
var mParams = method.GetParameters();
|
||||
|
||||
var convertedParams = mParams
|
||||
.Select((p, i) => Convert.ChangeType(action.Params[i], p.ParameterType,
|
||||
System.Globalization.CultureInfo.InvariantCulture))
|
||||
.ToArray();
|
||||
var ret = method.Invoke(obj, convertedParams);
|
||||
|
||||
CrestronConsole.ConsoleCommandResponse("Method {0} successfully called on device {1}", method.Name,
|
||||
action.DeviceKey);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
CrestronConsole.ConsoleCommandResponse("Unable to call method with name {0}. {1}", action.MethodName,
|
||||
ex.Message);}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace PepperDash.Essentials.Core
|
||||
CrestronConsole.AddNewConsoleCommand(SimulateComReceiveOnDevice, "devsimreceive",
|
||||
"Simulates incoming data on a com device", ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(s => SetDeviceStreamDebugging(s), "setdevicestreamdebug", "set comm debug [deviceKey] [off/rx/tx/both] ([minutes])", ConsoleAccessLevelEnum.AccessOperator);
|
||||
CrestronConsole.AddNewConsoleCommand(SetDeviceStreamDebugging, "setdevicestreamdebug", "set comm debug [deviceKey] [off/rx/tx/both] ([minutes])", ConsoleAccessLevelEnum.AccessOperator);
|
||||
CrestronConsole.AddNewConsoleCommand(s => DisableAllDeviceStreamDebugging(), "disableallstreamdebug", "disables stream debugging on all devices", ConsoleAccessLevelEnum.AccessOperator);
|
||||
}
|
||||
|
||||
@@ -387,6 +387,15 @@ namespace PepperDash.Essentials.Core
|
||||
/// <param name="s"></param>
|
||||
public static void SetDeviceStreamDebugging(string s)
|
||||
{
|
||||
if (String.IsNullOrEmpty(s) || s.Contains("?"))
|
||||
{
|
||||
CrestronConsole.ConsoleCommandResponse(
|
||||
@"SETDEVICESTREAMDEBUG [{deviceKey}] [OFF |TX | RX | BOTH] [timeOutInMinutes]
|
||||
{deviceKey} [OFF | TX | RX | BOTH] - Device to set stream debugging on, and which setting to use
|
||||
timeOutInMinutes - Set timeout for stream debugging. Default is 30 minutes");
|
||||
return;
|
||||
}
|
||||
|
||||
var args = s.Split(' ');
|
||||
|
||||
var deviceKey = args[0];
|
||||
@@ -437,7 +446,7 @@ namespace PepperDash.Essentials.Core
|
||||
else
|
||||
{
|
||||
device.StreamDebugging.SetDebuggingWithDefaultTimeout(debugSetting);
|
||||
Debug.Console(0, "Device: '{0}' debug level set to {1) for default time (30 minutes)", deviceKey, debugSetting);
|
||||
Debug.Console(0, "Device: '{0}' debug level set to {1} for default time (30 minutes)", deviceKey, debugSetting);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@ using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Devices
|
||||
{
|
||||
@@ -52,6 +54,8 @@ namespace PepperDash.Essentials.Core.Devices
|
||||
Name = config.Name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Used by the extending class to allow for any custom actions to be taken (tell the ConfigWriter to write config, etc)
|
||||
/// </summary>
|
||||
|
||||
@@ -130,10 +130,24 @@ namespace PepperDash.Essentials.Core
|
||||
[JsonProperty("sourceListKey")]
|
||||
public string SourceListKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates if the device associated with this source is controllable
|
||||
/// </summary>
|
||||
[JsonProperty("isControllable")]
|
||||
public bool IsControllable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that the device associated with this source has audio available
|
||||
/// </summary>
|
||||
[JsonProperty("isAudioSource")]
|
||||
public bool IsAudioSource { get; set; }
|
||||
|
||||
public SourceListItem()
|
||||
{
|
||||
Icon = "Blank";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class SourceRouteListItem
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public static class JsonExtensions
|
||||
{
|
||||
public static List<JToken> FindTokens(this JToken containerToken, string name)
|
||||
{
|
||||
List<JToken> matches = new List<JToken>();
|
||||
FindTokens(containerToken, name, matches);
|
||||
return matches;
|
||||
}
|
||||
|
||||
private static void FindTokens(JToken containerToken, string name, List<JToken> matches)
|
||||
{
|
||||
if (containerToken.Type == JTokenType.Object)
|
||||
{
|
||||
foreach (JProperty child in containerToken.Children<JProperty>())
|
||||
{
|
||||
if (child.Name == name)
|
||||
{
|
||||
matches.Add(child.Value);
|
||||
}
|
||||
FindTokens(child.Value, name, matches);
|
||||
}
|
||||
}
|
||||
else if (containerToken.Type == JTokenType.Array)
|
||||
{
|
||||
foreach (JToken child in containerToken.Children())
|
||||
{
|
||||
FindTokens(child, name, matches);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,8 @@ using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.GeneralIO;
|
||||
using Crestron.SimplSharp.Reflection;
|
||||
using PepperDash.Core;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Core.CrestronIO;
|
||||
@@ -83,33 +85,81 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
var wrapper = new DeviceFactoryWrapper() { CType = cType, Description = description, FactoryMethod = method };
|
||||
DeviceFactory.FactoryMethods.Add(typeName, wrapper);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The factory method for Core "things". Also iterates the Factory methods that have
|
||||
/// been loaded from plugins
|
||||
/// </summary>
|
||||
/// <param name="dc"></param>
|
||||
/// <returns></returns>
|
||||
public static IKeyed GetDevice(DeviceConfig dc)
|
||||
{
|
||||
var key = dc.Key;
|
||||
var name = dc.Name;
|
||||
var type = dc.Type;
|
||||
var properties = dc.Properties;
|
||||
|
||||
var typeName = dc.Type.ToLower();
|
||||
|
||||
// Check for types that have been added by plugin dlls.
|
||||
if (FactoryMethods.ContainsKey(typeName))
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loading '{0}' from Essentials Core", dc.Type);
|
||||
return FactoryMethods[typeName].FactoryMethod(dc);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static void CheckForSecrets(IEnumerable<JProperty> obj)
|
||||
{
|
||||
foreach (var prop in obj.Where(prop => prop.Value as JObject != null))
|
||||
{
|
||||
if (prop.Name.ToLower() == "secret")
|
||||
{
|
||||
var secret = GetSecret(prop.Children().First().ToObject<SecretsPropertiesConfig>());
|
||||
//var secret = GetSecret(JsonConvert.DeserializeObject<SecretsPropertiesConfig>(prop.Children().First().ToString()));
|
||||
prop.Parent.Replace(secret);
|
||||
}
|
||||
var recurseProp = prop.Value as JObject;
|
||||
if (recurseProp == null) return;
|
||||
CheckForSecrets(recurseProp.Properties());
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetSecret(SecretsPropertiesConfig data)
|
||||
{
|
||||
var secretProvider = SecretsManager.GetSecretProviderByKey(data.Provider);
|
||||
if (secretProvider == null) return null;
|
||||
var secret = secretProvider.GetSecret(data.Key);
|
||||
if (secret != null) return (string) secret.Value;
|
||||
Debug.Console(1,
|
||||
"Unable to retrieve secret {0}{1} - Make sure you've added it to the secrets provider",
|
||||
data.Provider, data.Key);
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The factory method for Core "things". Also iterates the Factory methods that have
|
||||
/// been loaded from plugins
|
||||
/// </summary>
|
||||
/// <param name="dc"></param>
|
||||
/// <returns></returns>
|
||||
public static IKeyed GetDevice(DeviceConfig dc)
|
||||
{
|
||||
try
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loading '{0}' from Essentials Core", dc.Type);
|
||||
|
||||
var localDc = new DeviceConfig(dc);
|
||||
|
||||
var key = localDc.Key;
|
||||
var name = localDc.Name;
|
||||
var type = localDc.Type;
|
||||
var properties = localDc.Properties;
|
||||
//var propRecurse = properties;
|
||||
|
||||
var typeName = localDc.Type.ToLower();
|
||||
|
||||
|
||||
var jObject = properties as JObject;
|
||||
if (jObject != null)
|
||||
{
|
||||
var jProp = jObject.Properties();
|
||||
|
||||
CheckForSecrets(jProp);
|
||||
}
|
||||
|
||||
Debug.Console(2, "typeName = {0}", typeName);
|
||||
// Check for types that have been added by plugin dlls.
|
||||
return !FactoryMethods.ContainsKey(typeName) ? null : FactoryMethods[typeName].FactoryMethod(localDc);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Error, "Exception occurred while creating device {0}: {1}", dc.Key, ex.Message);
|
||||
|
||||
Debug.Console(2, "{0}", ex.StackTrace);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Prints the type names and associated metadata from the FactoryMethods collection.
|
||||
/// </summary>
|
||||
|
||||
@@ -48,39 +48,39 @@
|
||||
<ItemGroup>
|
||||
<Reference Include="Crestron.SimplSharpPro.DeviceSupport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.DM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.EthernetCommunications, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.EthernetCommunications.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.EthernetCommunications.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.Fusion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Fusion.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Fusion.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.Gateways, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Gateways.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Gateways.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.GeneralIO, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.GeneralIO.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.GeneralIO.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.Remotes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Remotes.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Remotes.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.ThreeSeriesCards, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.ThreeSeriesCards.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.ThreeSeriesCards.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="mscorlib" />
|
||||
<Reference Include="PepperDash_Core, Version=1.0.42.30563, Culture=neutral, processorArchitecture=MSIL">
|
||||
@@ -89,30 +89,30 @@
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpPro, Version=1.5.3.17, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpTimerEventInterface, Version=1.0.6197.20052, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpTimerEventInterface.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpTimerEventInterface.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
@@ -189,6 +189,7 @@
|
||||
<Compile Include="Device Info\IDeviceInfoProvider.cs" />
|
||||
<Compile Include="Devices\CodecInterfaces.cs" />
|
||||
<Compile Include="Devices\CrestronProcessor.cs" />
|
||||
<Compile Include="Devices\DestinationListItem.cs" />
|
||||
<Compile Include="Devices\DeviceApiBase.cs" />
|
||||
<Compile Include="Devices\DeviceFeedbackExtensions.cs" />
|
||||
<Compile Include="Devices\EssentialsBridgeableDevice.cs" />
|
||||
@@ -208,6 +209,7 @@
|
||||
<Compile Include="DeviceTypeInterfaces\IHasFarEndContentStatus.cs" />
|
||||
<Compile Include="DeviceTypeInterfaces\IHasPhoneDialing.cs" />
|
||||
<Compile Include="DeviceTypeInterfaces\IMobileControl.cs" />
|
||||
<Compile Include="Extensions\JsonExtensions.cs" />
|
||||
<Compile Include="Factory\DeviceFactory.cs" />
|
||||
<Compile Include="Factory\IDeviceFactory.cs" />
|
||||
<Compile Include="Factory\ReadyEventArgs.cs" />
|
||||
@@ -319,6 +321,10 @@
|
||||
<Compile Include="Feedbacks\BoolFeedbackPulseExtender.cs" />
|
||||
<Compile Include="Routing\RoutingPortNames.cs" />
|
||||
<Compile Include="Routing\TieLineConfig.cs" />
|
||||
<Compile Include="Secrets\CrestronSecretsProvider.cs" />
|
||||
<Compile Include="Secrets\Interfaces.cs" />
|
||||
<Compile Include="Secrets\SecretsManager.cs" />
|
||||
<Compile Include="Secrets\SecretsPropertiesConfig.cs" />
|
||||
<Compile Include="Shades\Shade Interfaces.cs" />
|
||||
<Compile Include="Shades\ShadeBase.cs" />
|
||||
<Compile Include="Shades\ShadeController.cs" />
|
||||
|
||||
@@ -358,14 +358,27 @@ namespace PepperDash.Essentials
|
||||
try
|
||||
{
|
||||
var assy = loadedAssembly.Assembly;
|
||||
var types = assy.GetTypes();
|
||||
CType[] types = {};
|
||||
try
|
||||
{
|
||||
types = assy.GetTypes();
|
||||
}
|
||||
catch (TypeLoadException e)
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Warning, "Unable to get types for assembly {0}: {1}",
|
||||
loadedAssembly.Name, e.Message);
|
||||
Debug.Console(2, e.StackTrace);
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach (var type in types)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (typeof(IPluginDeviceFactory).IsAssignableFrom(type))
|
||||
if (typeof (IPluginDeviceFactory).IsAssignableFrom(type))
|
||||
{
|
||||
var plugin = (IPluginDeviceFactory)Crestron.SimplSharp.Reflection.Activator.CreateInstance(type);
|
||||
var plugin =
|
||||
(IPluginDeviceFactory) Crestron.SimplSharp.Reflection.Activator.CreateInstance(type);
|
||||
LoadCustomPlugin(plugin, loadedAssembly);
|
||||
}
|
||||
else
|
||||
@@ -378,10 +391,15 @@ namespace PepperDash.Essentials
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (NotSupportedException e)
|
||||
{
|
||||
//this happens for dlls that aren't PD dlls, like ports of Mono classes into S#. Swallowing.
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(2, "Load Plugin not found. {0}.{2} is not a plugin factory. Exception: {1}",
|
||||
loadedAssembly.Name, e, type.Name);
|
||||
loadedAssembly.Name, e.Message, type.Name);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -389,7 +407,9 @@ namespace PepperDash.Essentials
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(2, "Error Loading Assembly: {0} Exception: {1} ", loadedAssembly.Name, e);
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Warning, "Error Loading assembly {0}: {1}",
|
||||
loadedAssembly.Name, e.Message);
|
||||
Debug.Console(2, "{0}", e.StackTrace);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace PepperDash.Essentials.Core.Queues
|
||||
protected readonly CrestronQueue<IQueueMessage> _queue;
|
||||
protected readonly Thread _worker;
|
||||
protected readonly CEvent _waitHandle = new CEvent();
|
||||
|
||||
|
||||
private bool _delayEnabled;
|
||||
private int _delayTime;
|
||||
|
||||
@@ -155,10 +155,10 @@ namespace PepperDash.Essentials.Core.Queues
|
||||
if (programEvent != eProgramStatusEventType.Stopping)
|
||||
return;
|
||||
|
||||
Dispose();
|
||||
Dispose(true);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Thread callback
|
||||
/// </summary>
|
||||
@@ -180,7 +180,7 @@ namespace PepperDash.Essentials.Core.Queues
|
||||
{
|
||||
try
|
||||
{
|
||||
Debug.Console(2, this, "Processing queue item: '{0}'", item.ToString());
|
||||
//Debug.Console(2, this, "Processing queue item: '{0}'", item.ToString());
|
||||
item.Dispatch();
|
||||
|
||||
if (_delayEnabled)
|
||||
@@ -231,8 +231,13 @@ namespace PepperDash.Essentials.Core.Queues
|
||||
|
||||
if (disposing)
|
||||
{
|
||||
Enqueue(null);
|
||||
_worker.Join();
|
||||
Debug.Console(2, this, "Disposing...");
|
||||
if (_queue != null && !_queue.Disposed)
|
||||
{
|
||||
_queue.Clear();
|
||||
Enqueue(null);
|
||||
}
|
||||
_worker.Abort();
|
||||
_waitHandle.Close();
|
||||
}
|
||||
|
||||
@@ -241,7 +246,7 @@ namespace PepperDash.Essentials.Core.Queues
|
||||
|
||||
~GenericQueue()
|
||||
{
|
||||
Dispose(false);
|
||||
Dispose(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -407,7 +412,7 @@ namespace PepperDash_Essentials_Core.Queues
|
||||
if (programEvent != eProgramStatusEventType.Stopping)
|
||||
return;
|
||||
|
||||
Dispose();
|
||||
Dispose(true);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -477,8 +482,13 @@ namespace PepperDash_Essentials_Core.Queues
|
||||
|
||||
if (disposing)
|
||||
{
|
||||
Enqueue(null);
|
||||
_worker.Join();
|
||||
Debug.Console(2, this, "Disposing...");
|
||||
if (_queue != null && !_queue.Disposed)
|
||||
{
|
||||
_queue.Clear();
|
||||
Enqueue(null);
|
||||
}
|
||||
_worker.Abort();
|
||||
_waitHandle.Close();
|
||||
}
|
||||
|
||||
@@ -487,7 +497,7 @@ namespace PepperDash_Essentials_Core.Queues
|
||||
|
||||
~GenericQueue()
|
||||
{
|
||||
Dispose(false);
|
||||
Dispose(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -123,25 +123,34 @@ namespace PepperDash.Essentials.Core
|
||||
// No direct tie? Run back out on the inputs' attached devices...
|
||||
// Only the ones that are routing devices
|
||||
var attachedMidpoints = destDevInputTies.Where(t => t.SourcePort.ParentDevice is IRoutingInputsOutputs);
|
||||
|
||||
//Create a list for tracking already checked devices to avoid loops, if it doesn't already exist from previous iteration
|
||||
if (alreadyCheckedDevices == null)
|
||||
alreadyCheckedDevices = new List<IRoutingInputsOutputs>();
|
||||
alreadyCheckedDevices.Add(destination as IRoutingInputsOutputs);
|
||||
|
||||
foreach (var inputTieToTry in attachedMidpoints)
|
||||
{
|
||||
Debug.Console(2, destination, "Trying to find route on {0}", inputTieToTry.SourcePort.ParentDevice.Key);
|
||||
var upstreamDeviceOutputPort = inputTieToTry.SourcePort;
|
||||
var upstreamRoutingDevice = upstreamDeviceOutputPort.ParentDevice as IRoutingInputsOutputs;
|
||||
Debug.Console(2, destination, "Trying to find route on {0}", upstreamRoutingDevice.Key);
|
||||
|
||||
// Check if this previous device has already been walked
|
||||
if (!(alreadyCheckedDevices != null && alreadyCheckedDevices.Contains(upstreamRoutingDevice)))
|
||||
{
|
||||
// haven't seen this device yet. Do it. Pass the output port to the next
|
||||
// level to enable switching on success
|
||||
var upstreamRoutingSuccess = upstreamRoutingDevice.GetRouteToSource(source, upstreamDeviceOutputPort,
|
||||
alreadyCheckedDevices, signalType, cycle, routeTable);
|
||||
if (upstreamRoutingSuccess)
|
||||
{
|
||||
Debug.Console(2, destination, "Upstream device route found");
|
||||
goodInputPort = inputTieToTry.DestinationPort;
|
||||
break; // Stop looping the inputs in this cycle
|
||||
}
|
||||
}
|
||||
if (alreadyCheckedDevices.Contains(upstreamRoutingDevice))
|
||||
{
|
||||
Debug.Console(2, destination, "Skipping input {0} on {1}, this was already checked", upstreamRoutingDevice.Key, destination.Key);
|
||||
continue;
|
||||
}
|
||||
// haven't seen this device yet. Do it. Pass the output port to the next
|
||||
// level to enable switching on success
|
||||
var upstreamRoutingSuccess = upstreamRoutingDevice.GetRouteToSource(source, upstreamDeviceOutputPort,
|
||||
alreadyCheckedDevices, signalType, cycle, routeTable);
|
||||
if (upstreamRoutingSuccess)
|
||||
{
|
||||
Debug.Console(2, destination, "Upstream device route found");
|
||||
goodInputPort = inputTieToTry.DestinationPort;
|
||||
break; // Stop looping the inputs in this cycle
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,10 +172,6 @@ namespace PepperDash.Essentials.Core
|
||||
//Debug.Console(2, destination, "Exiting cycle {0}", cycle);
|
||||
return true;
|
||||
}
|
||||
|
||||
if(alreadyCheckedDevices == null)
|
||||
alreadyCheckedDevices = new List<IRoutingInputsOutputs>();
|
||||
alreadyCheckedDevices.Add(destination as IRoutingInputsOutputs);
|
||||
|
||||
Debug.Console(2, destination, "No route found to {0}", source.Key);
|
||||
return false;
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
using System;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronDataStore;
|
||||
using PepperDash.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public class CrestronSecretsProvider : ISecretProvider
|
||||
{
|
||||
public string Key { get; set; }
|
||||
//Added for reference
|
||||
private static readonly bool SecureSupported;
|
||||
public CrestronSecretsProvider(string key)
|
||||
{
|
||||
Key = key;
|
||||
}
|
||||
|
||||
static CrestronSecretsProvider()
|
||||
{
|
||||
//Added for future encrypted reference
|
||||
SecureSupported = CrestronSecureStorage.Supported;
|
||||
|
||||
CrestronDataStoreStatic.InitCrestronDataStore();
|
||||
if (SecureSupported)
|
||||
{
|
||||
//doThingsFuture
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set secret for item in the CrestronSecretsProvider
|
||||
/// </summary>
|
||||
/// <param name="key">Secret Key</param>
|
||||
/// <param name="value">Secret Value</param>
|
||||
public bool SetSecret(string key, object value)
|
||||
{
|
||||
var secret = value as string;
|
||||
if (String.IsNullOrEmpty(secret))
|
||||
{
|
||||
Debug.Console(2, this, "Unable to set secret for {0}:{1} - value is empty.", Key, key);
|
||||
return false;
|
||||
}
|
||||
var setErrorCode = CrestronDataStoreStatic.SetLocalStringValue(key, secret);
|
||||
switch (setErrorCode)
|
||||
{
|
||||
case CrestronDataStore.CDS_ERROR.CDS_SUCCESS:
|
||||
Debug.Console(1, this,"Secret Successfully Set for {0}:{1}", Key, key);
|
||||
return true;
|
||||
default:
|
||||
Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Unable to set secret for {0}:{1} - {2}", Key, key, setErrorCode.ToString());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve secret for item in the CrestronSecretsProvider
|
||||
/// </summary>
|
||||
/// <param name="key">Secret Key</param>
|
||||
/// <returns>ISecret Object containing key, provider, and value</returns>
|
||||
public ISecret GetSecret(string key)
|
||||
{
|
||||
string mySecret;
|
||||
var getErrorCode = CrestronDataStoreStatic.GetLocalStringValue(key, out mySecret);
|
||||
|
||||
switch (getErrorCode)
|
||||
{
|
||||
case CrestronDataStore.CDS_ERROR.CDS_SUCCESS:
|
||||
Debug.Console(2, this, "Secret Successfully retrieved for {0}:{1}", Key, key);
|
||||
return new CrestronSecret(key, mySecret, this);
|
||||
default:
|
||||
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Unable to retrieve secret for {0}:{1} - {2}",
|
||||
Key, key, getErrorCode.ToString());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Special container class for CrestronSecret provider
|
||||
/// </summary>
|
||||
public class CrestronSecret : ISecret
|
||||
{
|
||||
public ISecretProvider Provider { get; private set; }
|
||||
public string Key { get; private set; }
|
||||
|
||||
public object Value { get; private set; }
|
||||
|
||||
public CrestronSecret(string key, string value, ISecretProvider provider)
|
||||
{
|
||||
Key = key;
|
||||
Value = value;
|
||||
Provider = provider;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// All ISecrecretProvider classes must implement this interface.
|
||||
/// </summary>
|
||||
public interface ISecretProvider : IKeyed
|
||||
{
|
||||
bool SetSecret(string key, object value);
|
||||
|
||||
ISecret GetSecret(string key);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// interface for delivering secrets in Essentials.
|
||||
/// </summary>
|
||||
public interface ISecret
|
||||
{
|
||||
ISecretProvider Provider { get; }
|
||||
string Key { get; }
|
||||
object Value { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,281 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public static class SecretsManager
|
||||
{
|
||||
public static Dictionary<string, ISecretProvider> Secrets { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the SecretsManager
|
||||
/// </summary>
|
||||
public static void Initialize()
|
||||
{
|
||||
|
||||
AddSecretProvider("default", new CrestronSecretsProvider("default"));
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(SetSecretProcess, "setsecret",
|
||||
"Adds secrets to secret provider",
|
||||
ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(UpdateSecretProcess, "updatesecret",
|
||||
"Updates secrets in secret provider",
|
||||
ConsoleAccessLevelEnum.AccessAdministrator);
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(DeleteSecretProcess, "deletesecret",
|
||||
"Deletes secrets in secret provider",
|
||||
ConsoleAccessLevelEnum.AccessAdministrator);
|
||||
}
|
||||
|
||||
static SecretsManager()
|
||||
{
|
||||
Secrets = new Dictionary<string, ISecretProvider>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get Secret Provider from dictionary by key
|
||||
/// </summary>
|
||||
/// <param name="key">Dictionary Key for provider</param>
|
||||
/// <returns>ISecretProvider</returns>
|
||||
public static ISecretProvider GetSecretProviderByKey(string key)
|
||||
{
|
||||
ISecretProvider secret;
|
||||
|
||||
Secrets.TryGetValue(key, out secret);
|
||||
|
||||
if (secret == null)
|
||||
{
|
||||
Debug.Console(1, "SecretsManager unable to retrieve SecretProvider with the key '{0}'", key);
|
||||
}
|
||||
return secret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add secret provider to secrets dictionary
|
||||
/// </summary>
|
||||
/// <param name="key">Key of new entry</param>
|
||||
/// <param name="provider">New Provider Entry</param>
|
||||
public static void AddSecretProvider(string key, ISecretProvider provider)
|
||||
{
|
||||
if (!Secrets.ContainsKey(key))
|
||||
{
|
||||
Secrets.Add(key, provider);
|
||||
Debug.Console(1, "Secrets provider '{0}' added to SecretsManager", key);
|
||||
}
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Unable to add Provider '{0}' to Secrets. Provider with that key already exists", key );
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add secret provider to secrets dictionary, with optional overwrite parameter
|
||||
/// </summary>
|
||||
/// <param name="key">Key of new entry</param>
|
||||
/// <param name="provider">New provider entry</param>
|
||||
/// <param name="overwrite">true to overwrite any existing providers in the dictionary</param>
|
||||
public static void AddSecretProvider(string key, ISecretProvider provider, bool overwrite)
|
||||
{
|
||||
if (!Secrets.ContainsKey(key))
|
||||
{
|
||||
Secrets.Add(key, provider);
|
||||
Debug.Console(1, "Secrets provider '{0}' added to SecretsManager", key);
|
||||
|
||||
}
|
||||
if (overwrite)
|
||||
{
|
||||
Secrets.Add(key, provider);
|
||||
Debug.Console(1, Debug.ErrorLogLevel.Notice, "Provider with the key '{0}' already exists in secrets. Overwriting with new secrets provider.", key);
|
||||
|
||||
}
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Unable to add Provider '{0}' to Secrets. Provider with that key already exists", key);
|
||||
}
|
||||
|
||||
private static void SetSecretProcess(string cmd)
|
||||
{
|
||||
string response;
|
||||
var args = cmd.Split(' ');
|
||||
|
||||
if (args.Length == 0)
|
||||
{
|
||||
//some Instructional Text
|
||||
response = "Adds secrets to secret provider. Format 'setsecret <provider> <secretKey> <secret>";
|
||||
CrestronConsole.ConsoleCommandResponse(response);
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.Length == 1 && args[0] == "?")
|
||||
{
|
||||
response = "Adds secrets to secret provider. Format 'setsecret <provider> <secretKey> <secret>";
|
||||
CrestronConsole.ConsoleCommandResponse(response);
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.Length < 3)
|
||||
{
|
||||
response = "Improper number of arguments";
|
||||
CrestronConsole.ConsoleCommandResponse(response);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
var provider = GetSecretProviderByKey(args[0]);
|
||||
|
||||
if (provider == null)
|
||||
{
|
||||
//someFail
|
||||
response = "Provider key invalid";
|
||||
CrestronConsole.ConsoleCommandResponse(response);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
var key = args[1];
|
||||
var secret = args[2];
|
||||
|
||||
if (provider.GetSecret(key) == null)
|
||||
{
|
||||
|
||||
response = provider.SetSecret(key, secret)
|
||||
? String.Format(
|
||||
"Secret successfully set for {0}:{1}",
|
||||
provider.Key, key)
|
||||
: String.Format(
|
||||
"Unable to set secret for {0}:{1}",
|
||||
provider.Key, key);
|
||||
CrestronConsole.ConsoleCommandResponse(response);
|
||||
return;
|
||||
}
|
||||
response =
|
||||
String.Format(
|
||||
"Unable to set secret for {0}:{1} - Please use the 'UpdateSecret' command to modify it");
|
||||
CrestronConsole.ConsoleCommandResponse(response);
|
||||
}
|
||||
|
||||
private static void UpdateSecretProcess(string cmd)
|
||||
{
|
||||
string response;
|
||||
var args = cmd.Split(' ');
|
||||
|
||||
if (args.Length == 0)
|
||||
{
|
||||
//some Instructional Text
|
||||
response = "Updates secrets in secret provider. Format 'updatesecret <provider> <secretKey> <secret>";
|
||||
CrestronConsole.ConsoleCommandResponse(response);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if (args.Length == 1 && args[0] == "?")
|
||||
{
|
||||
response = "Updates secrets in secret provider. Format 'updatesecret <provider> <secretKey> <secret>";
|
||||
CrestronConsole.ConsoleCommandResponse(response);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (args.Length < 3)
|
||||
{
|
||||
//someFail
|
||||
response = "Improper number of arguments";
|
||||
CrestronConsole.ConsoleCommandResponse(response);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
var provider = GetSecretProviderByKey(args[0]);
|
||||
|
||||
if (provider == null)
|
||||
{
|
||||
//someFail
|
||||
response = "Provider key invalid";
|
||||
CrestronConsole.ConsoleCommandResponse(response);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
var key = args[1];
|
||||
var secret = args[2];
|
||||
|
||||
if (provider.GetSecret(key) != null)
|
||||
{
|
||||
response = provider.SetSecret(key, secret)
|
||||
? String.Format(
|
||||
"Secret successfully set for {0}:{1}",
|
||||
provider.Key, key)
|
||||
: String.Format(
|
||||
"Unable to set secret for {0}:{1}",
|
||||
provider.Key, key);
|
||||
CrestronConsole.ConsoleCommandResponse(response);
|
||||
return;
|
||||
}
|
||||
|
||||
response =
|
||||
String.Format(
|
||||
"Unable to update secret for {0}:{1} - Please use the 'SetSecret' command to create a new secret");
|
||||
CrestronConsole.ConsoleCommandResponse(response);
|
||||
}
|
||||
|
||||
private static void DeleteSecretProcess(string cmd)
|
||||
{
|
||||
string response;
|
||||
var args = cmd.Split(' ');
|
||||
|
||||
if (args.Length == 0)
|
||||
{
|
||||
//some Instructional Text
|
||||
response = "Deletes secrets in secret provider. Format 'deletesecret <provider> <secretKey>";
|
||||
CrestronConsole.ConsoleCommandResponse(response);
|
||||
return;
|
||||
|
||||
}
|
||||
if (args.Length == 1 && args[0] == "?")
|
||||
{
|
||||
response = "Deletes secrets in secret provider. Format 'deletesecret <provider> <secretKey>";
|
||||
CrestronConsole.ConsoleCommandResponse(response);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (args.Length < 2)
|
||||
{
|
||||
//someFail
|
||||
response = "Improper number of arguments";
|
||||
CrestronConsole.ConsoleCommandResponse(response);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
var provider = GetSecretProviderByKey(args[0]);
|
||||
|
||||
if (provider == null)
|
||||
{
|
||||
//someFail
|
||||
response = "Provider key invalid";
|
||||
CrestronConsole.ConsoleCommandResponse(response);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
var key = args[1];
|
||||
|
||||
|
||||
provider.SetSecret(key, "");
|
||||
response = provider.SetSecret(key, "")
|
||||
? String.Format(
|
||||
"Secret successfully deleted for {0}:{1}",
|
||||
provider.Key, key)
|
||||
: String.Format(
|
||||
"Unable to delete secret for {0}:{1}",
|
||||
provider.Key, key);
|
||||
CrestronConsole.ConsoleCommandResponse(response);
|
||||
return;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Provide a way to easily deserialize into a secret object from config
|
||||
/// </summary>
|
||||
public class SecretsPropertiesConfig
|
||||
{
|
||||
[JsonProperty("provider")]
|
||||
public string Provider { get; set; }
|
||||
[JsonProperty("key")]
|
||||
public string Key { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -671,7 +671,7 @@ namespace PepperDash.Essentials.DM {
|
||||
var ioSlotJoin = ioSlot - 1;
|
||||
|
||||
// Control
|
||||
trilist.SetUShortSigAction(joinMap.OutputVideo.JoinNumber + ioSlotJoin, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video));
|
||||
trilist.SetUShortSigAction(joinMap.OutputVideo.JoinNumber + ioSlotJoin, o => ExecuteNumericSwitch(o, (ushort) ioSlot, eRoutingSignalType.Video));
|
||||
|
||||
if (TxDictionary.ContainsKey(ioSlot))
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -228,9 +228,9 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
// Control
|
||||
trilist.SetUShortSigAction(joinMap.OutputVideo.JoinNumber + ioSlotJoin,
|
||||
o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video));
|
||||
o => ExecuteNumericSwitch(o, (ushort) ioSlot, eRoutingSignalType.Video));
|
||||
trilist.SetUShortSigAction(joinMap.OutputAudio.JoinNumber + ioSlotJoin,
|
||||
o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Audio));
|
||||
o => ExecuteNumericSwitch(o, (ushort) ioSlot, eRoutingSignalType.Audio));
|
||||
|
||||
trilist.SetStringSigAction(joinMap.OutputNames.JoinNumber + ioSlotJoin, s =>
|
||||
{
|
||||
|
||||
@@ -48,15 +48,15 @@
|
||||
<ItemGroup>
|
||||
<Reference Include="Crestron.SimplSharpPro.DeviceSupport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.DM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="mscorlib" />
|
||||
<Reference Include="PepperDash_Core, Version=1.0.42.30563, Culture=neutral, processorArchitecture=MSIL">
|
||||
@@ -65,26 +65,26 @@
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpPro, Version=1.5.3.17, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
|
||||
@@ -8,6 +8,8 @@ using Crestron.SimplSharp.Reflection;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Devices;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash.Essentials.Core.Presets;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
@@ -25,7 +27,7 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||
Focus = 8
|
||||
}
|
||||
|
||||
public abstract class CameraBase : EssentialsDevice, IRoutingOutputs
|
||||
public abstract class CameraBase : ReconfigurableDevice, IRoutingOutputs
|
||||
{
|
||||
public eCameraControlMode ControlMode { get; protected set; }
|
||||
|
||||
@@ -70,12 +72,18 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||
// A bitmasked value to indicate the movement capabilites of this camera
|
||||
protected eCameraCapabilities Capabilities { get; set; }
|
||||
|
||||
protected CameraBase(string key, string name) :
|
||||
base(key, name)
|
||||
{
|
||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
||||
protected CameraBase(DeviceConfig config) : base(config)
|
||||
{
|
||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
||||
|
||||
ControlMode = eCameraControlMode.Manual;
|
||||
ControlMode = eCameraControlMode.Manual;
|
||||
|
||||
}
|
||||
|
||||
protected CameraBase(string key, string name) :
|
||||
this (new DeviceConfig{Name = name, Key = key})
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void LinkCameraToApi(CameraBase cameraDevice, BasicTriList trilist, uint joinStart, string joinMapKey,
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,19 +48,19 @@
|
||||
<ItemGroup>
|
||||
<Reference Include="Crestron.SimplSharpPro.DeviceSupport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.Gateways, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Gateways.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Gateways.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.GeneralIO, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.GeneralIO.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.GeneralIO.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.Lighting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Lighting.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Lighting.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="mscorlib" />
|
||||
<Reference Include="PepperDash_Core, Version=1.0.42.30563, Culture=neutral, processorArchitecture=MSIL">
|
||||
@@ -69,26 +69,26 @@
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpPro, Version=1.5.3.17, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
@@ -176,6 +176,7 @@
|
||||
<Compile Include="VideoCodec\ZoomRoom\ResponseObjects.cs" />
|
||||
<Compile Include="VideoCodec\ZoomRoom\ZoomRoom.cs" />
|
||||
<Compile Include="VideoCodec\ZoomRoom\ZoomRoomCamera.cs" />
|
||||
<Compile Include="VideoCodec\ZoomRoom\ZoomRoomJoinMap.cs" />
|
||||
<Compile Include="VideoCodec\ZoomRoom\ZoomRoomPropertiesConfig.cs" />
|
||||
<None Include="Properties\ControlSystem.cfg" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -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)
|
||||
@@ -142,24 +141,18 @@ namespace PepperDash.Essentials.Devices.Common
|
||||
}
|
||||
else if (args.Text.IndexOf("!Done Preset.Take =") > -1)
|
||||
{
|
||||
|
||||
string presetNumberParse = args.Text.Remove(0, args.Text.IndexOf("=") + 2);
|
||||
|
||||
Debug.Console(1, this, "Preset Parse: {0}", presetNumberParse);
|
||||
CurrentPreset = ushort.Parse(presetNumberParse);
|
||||
PresetFeedback.FireUpdate();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (Debug.Level == 2)
|
||||
Debug.Console(2, this, "Error parsing response: '{0}'\n{1}", args.Text, e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -168,7 +161,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");
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
@@ -148,11 +147,7 @@ namespace PepperDash.Essentials.Devices.Common
|
||||
Debug.Console(1, this, "Preset Parse: {0}", presetNumberParse);
|
||||
CurrentPreset = ushort.Parse(presetNumberParse);
|
||||
PresetFeedback.FireUpdate();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -168,7 +163,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");
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -30,6 +30,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
IHasScheduleAwareness, IOccupancyStatusProvider, IHasCodecLayouts, IHasCodecSelfView,
|
||||
ICommunicationMonitor, IRouting, IHasCodecCameras, IHasCameraAutoMode, IHasCodecRoomPresets, IHasExternalSourceSwitching, IHasBranding, IHasCameraOff, IHasCameraMute
|
||||
{
|
||||
private bool _externalSourceChangeRequested;
|
||||
|
||||
public event EventHandler<DirectoryEventArgs> DirectoryResultReturned;
|
||||
|
||||
private CTimer _brandingTimer;
|
||||
@@ -490,11 +492,21 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
Debug.Console(2, this, "Setting QR code URL: {0}", mcBridge.QrCodeUrl);
|
||||
|
||||
mcBridge.UserCodeChanged += (o, a) => SendMcBrandingUrl(mcBridge);
|
||||
mcBridge.UserPromptedForCode += (o, a) => DisplayUserCode(mcBridge.UserCode);
|
||||
|
||||
SendMcBrandingUrl(mcBridge);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Displays the code for the specified duration
|
||||
/// </summary>
|
||||
/// <param name="code">Mobile Control user code</param>
|
||||
private void DisplayUserCode(string code)
|
||||
{
|
||||
SendText(string.Format("xcommand userinterface message alert display title:\"Mobile Control User Code:\" text:\"{0}\" duration: 30", code));
|
||||
}
|
||||
|
||||
private void SendMcBrandingUrl(IMobileControlRoomBridge mcBridge)
|
||||
{
|
||||
if (mcBridge == null)
|
||||
@@ -561,6 +573,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
prefix + "/Status/Standby" + Delimiter +
|
||||
prefix + "/Status/Video/Selfview" + Delimiter +
|
||||
prefix + "/Status/Video/Layout" + Delimiter +
|
||||
prefix + "/Status/Video/Input/MainVideoMute" + Delimiter +
|
||||
prefix + "/Bookings" + Delimiter +
|
||||
prefix + "/Event/CallDisconnect" + Delimiter +
|
||||
prefix + "/Event/Bookings" + Delimiter +
|
||||
@@ -654,7 +667,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
{
|
||||
if (CommDebuggingIsOn)
|
||||
{
|
||||
if(!JsonFeedbackMessageIsIncoming)
|
||||
if (!JsonFeedbackMessageIsIncoming)
|
||||
Debug.Console(1, this, "RX: '{0}'", args.Text);
|
||||
}
|
||||
|
||||
@@ -950,10 +963,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
JsonConvert.PopulateObject(response, eventReceived);
|
||||
Debug.Console(2, this, "*** Got an External Source Selection {0} {1}", eventReceived, eventReceived.Event.UserInterface, eventReceived.Event.UserInterface.Presentation.ExternalSource.Selected.SourceIdentifier.Value);
|
||||
|
||||
if (RunRouteAction != null)
|
||||
if (RunRouteAction != null && !_externalSourceChangeRequested)
|
||||
{
|
||||
RunRouteAction(eventReceived.Event.UserInterface.Presentation.ExternalSource.Selected.SourceIdentifier.Value, null);
|
||||
}
|
||||
|
||||
_externalSourceChangeRequested = false;
|
||||
}
|
||||
}
|
||||
else if (response.IndexOf("\"CommandResponse\":{") > -1 || response.IndexOf("\"CommandResponse\": {") > -1)
|
||||
@@ -1650,12 +1665,21 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
|
||||
public void CameraAutoModeOn()
|
||||
{
|
||||
if (CameraIsOffFeedback.BoolValue)
|
||||
{
|
||||
CameraMuteOff();
|
||||
}
|
||||
|
||||
SendText("xCommand Cameras SpeakerTrack Activate");
|
||||
CameraMuteOff();
|
||||
}
|
||||
|
||||
public void CameraAutoModeOff()
|
||||
{
|
||||
if (CameraIsOffFeedback.BoolValue)
|
||||
{
|
||||
CameraMuteOff();
|
||||
}
|
||||
|
||||
SendText("xCommand Cameras SpeakerTrack Deactivate");
|
||||
}
|
||||
|
||||
@@ -1974,6 +1998,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
public void SetSelectedSource(string key)
|
||||
{
|
||||
SendText(string.Format("xCommand UserInterface Presentation ExternalSource Select SourceIdentifier: {0}", key));
|
||||
_externalSourceChangeRequested = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2011,7 +2036,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
/// </summary>
|
||||
public void CameraMuteOn()
|
||||
{
|
||||
SendText("xCommand Video InputMainVideo Mute");
|
||||
SendText("xCommand Video Input MainVideo Mute");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2019,7 +2044,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
/// </summary>
|
||||
public void CameraMuteOff()
|
||||
{
|
||||
SendText("xCommand Video InputMainVideo Unmute");
|
||||
SendText("xCommand Video Input MainVideo Unmute");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -19,4 +19,32 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
void LocalLayoutToggleSingleProminent();
|
||||
void MinMaxLayoutToggle();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines the requirements for Zoom Room layout control
|
||||
/// </summary>
|
||||
public interface IHasZoomRoomLayouts : IHasCodecLayouts
|
||||
{
|
||||
event EventHandler<LayoutInfoChangedEventArgs> AvailableLayoutsChanged;
|
||||
|
||||
BoolFeedback LayoutViewIsOnFirstPageFeedback { get; } // TODO: #697 [*] Consider modifying to report button visibility in func
|
||||
BoolFeedback LayoutViewIsOnLastPageFeedback { get; } // TODO: #697 [*] Consider modifying to report button visibility in func
|
||||
BoolFeedback CanSwapContentWithThumbnailFeedback { get; }
|
||||
BoolFeedback ContentSwappedWithThumbnailFeedback { get; }
|
||||
|
||||
ZoomRoom.zConfiguration.eLayoutStyle LastSelectedLayout { get; }
|
||||
ZoomRoom.zConfiguration.eLayoutStyle AvailableLayouts { get; }
|
||||
|
||||
void GetAvailableLayouts(); // Mot sure this is necessary if we're already subscribed to zStatus Call Layout
|
||||
void SetLayout(ZoomRoom.zConfiguration.eLayoutStyle layoutStyle);
|
||||
void SwapContentWithThumbnail();
|
||||
|
||||
void LayoutTurnNextPage();
|
||||
void LayoutTurnPreviousPage();
|
||||
}
|
||||
|
||||
public class LayoutInfoChangedEventArgs : EventArgs
|
||||
{
|
||||
public ZoomRoom.zConfiguration.eLayoutStyle AvailableLayouts { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// Describes a device that has call participants
|
||||
/// </summary>
|
||||
public interface IHasParticipants
|
||||
{
|
||||
CodecParticipants Participants { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Describes the ability to mute and unmute a participant's video in a meeting
|
||||
/// </summary>
|
||||
public interface IHasParticipantVideoMute:IHasParticipants
|
||||
{
|
||||
void MuteVideoForParticipant(int userId);
|
||||
@@ -15,13 +22,29 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces
|
||||
void ToggleVideoForParticipant(int userId);
|
||||
}
|
||||
|
||||
public interface IHasParticipantAudioMute:IHasParticipantVideoMute
|
||||
/// <summary>
|
||||
/// Describes the ability to mute and unmute a participant's audio in a meeting
|
||||
/// </summary>
|
||||
public interface IHasParticipantAudioMute : IHasParticipantVideoMute
|
||||
{
|
||||
void MuteAudioForParticipant(int userId);
|
||||
void UnmuteAudioForParticipant(int userId);
|
||||
void ToggleAudioForParticipant(int userId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Describes the ability to pin and unpin a participant in a meeting
|
||||
/// </summary>
|
||||
public interface IHasParticipantPinUnpin : IHasParticipants
|
||||
{
|
||||
IntFeedback NumberOfScreensFeedback { get; }
|
||||
int ScreenIndexToPinUserTo { get; }
|
||||
|
||||
void PinParticipant(int userId, int screenIndex);
|
||||
void UnPinParticipant(int userId);
|
||||
void ToggleParticipantPinState(int userId, int screenIndex);
|
||||
}
|
||||
|
||||
public class CodecParticipants
|
||||
{
|
||||
private List<Participant> _currentParticipants;
|
||||
@@ -31,11 +54,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces
|
||||
set
|
||||
{
|
||||
_currentParticipants = value;
|
||||
var handler = ParticipantsListHasChanged;
|
||||
|
||||
if(handler == null) return;
|
||||
|
||||
handler(this, new EventArgs());
|
||||
OnParticipantsChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,15 +64,31 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces
|
||||
{
|
||||
_currentParticipants = new List<Participant>();
|
||||
}
|
||||
|
||||
public void OnParticipantsChanged()
|
||||
{
|
||||
var handler = ParticipantsListHasChanged;
|
||||
|
||||
if (handler == null) return;
|
||||
|
||||
handler(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a call participant
|
||||
/// </summary>
|
||||
public class Participant
|
||||
{
|
||||
public int UserId { get; set; }
|
||||
public bool IsHost { get; set; }
|
||||
public string Name { get; set; }
|
||||
public bool CanMuteVideo { get; set; }
|
||||
public bool CanUnmuteVideo { get; set; }
|
||||
public bool VideoMuteFb { get; set; }
|
||||
public bool AudioMuteFb { get; set; }
|
||||
public bool HandIsRaisedFb { get; set; }
|
||||
public bool IsPinnedFb { get; set; }
|
||||
public int ScreenIndexIsPinnedToFb { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
IUsageTracking, IHasDialer, IHasContentSharing, ICodecAudio, iVideoCodecInfo, IBridgeAdvanced
|
||||
{
|
||||
private const int XSigEncoding = 28591;
|
||||
protected const int MaxParticipants = 50;
|
||||
private readonly byte[] _clearBytes = XSigHelpers.ClearOutputs();
|
||||
protected VideoCodecBase(DeviceConfig config)
|
||||
: base(config)
|
||||
@@ -271,6 +272,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
|
||||
public abstract void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge);
|
||||
|
||||
/// <summary>
|
||||
/// Use this method when using a plain VideoCodecControllerJoinMap
|
||||
/// </summary>
|
||||
/// <param name="codec"></param>
|
||||
/// <param name="trilist"></param>
|
||||
/// <param name="joinStart"></param>
|
||||
/// <param name="joinMapKey"></param>
|
||||
/// <param name="bridge"></param>
|
||||
protected void LinkVideoCodecToApi(VideoCodecBase codec, BasicTriList trilist, uint joinStart, string joinMapKey,
|
||||
EiscApiAdvanced bridge)
|
||||
{
|
||||
@@ -288,10 +297,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
bridge.AddJoinMap(Key, joinMap);
|
||||
}
|
||||
|
||||
LinkVideoCodecToApi(codec, trilist, joinMap);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use this method when you need to pass in a join map that extends VideoCodecControllerJoinMap
|
||||
/// </summary>
|
||||
/// <param name="codec"></param>
|
||||
/// <param name="trilist"></param>
|
||||
/// <param name="joinMap"></param>
|
||||
protected void LinkVideoCodecToApi(VideoCodecBase codec, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
||||
{
|
||||
Debug.Console(1, this, "Linking to Trilist {0}", trilist.ID.ToString("X"));
|
||||
|
||||
|
||||
|
||||
LinkVideoCodecDtmfToApi(trilist, joinMap);
|
||||
|
||||
LinkVideoCodecCallControlsToApi(trilist, joinMap);
|
||||
@@ -524,6 +542,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
return;
|
||||
}
|
||||
|
||||
SetParticipantActions(trilist, joinMap, codec.Participants.CurrentParticipants);
|
||||
|
||||
participantsXSig = UpdateParticipantsXSig(codec.Participants.CurrentParticipants);
|
||||
|
||||
trilist.SetString(joinMap.CurrentParticipants.JoinNumber, participantsXSig);
|
||||
@@ -532,14 +552,59 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the actions for each participant in the list
|
||||
/// </summary>
|
||||
private void SetParticipantActions(BasicTriList trilist, VideoCodecControllerJoinMap joinMap, List<Participant> currentParticipants)
|
||||
{
|
||||
uint index = 0; // track the index of the participant in the
|
||||
|
||||
foreach (var participant in currentParticipants)
|
||||
{
|
||||
var p = participant;
|
||||
if (index > MaxParticipants) break;
|
||||
|
||||
var audioMuteCodec = this as IHasParticipantAudioMute;
|
||||
if (audioMuteCodec != null)
|
||||
{
|
||||
trilist.SetSigFalseAction(joinMap.ParticipantAudioMuteToggleStart.JoinNumber + index,
|
||||
() => audioMuteCodec.ToggleAudioForParticipant(p.UserId));
|
||||
|
||||
trilist.SetSigFalseAction(joinMap.ParticipantVideoMuteToggleStart.JoinNumber + index,
|
||||
() => audioMuteCodec.ToggleVideoForParticipant(p.UserId));
|
||||
}
|
||||
|
||||
var pinCodec = this as IHasParticipantPinUnpin;
|
||||
if (pinCodec != null)
|
||||
{
|
||||
trilist.SetSigFalseAction(joinMap.ParticipantPinToggleStart.JoinNumber + index,
|
||||
() => pinCodec.ToggleParticipantPinState(p.UserId, pinCodec.ScreenIndexToPinUserTo));
|
||||
}
|
||||
|
||||
index++;
|
||||
}
|
||||
|
||||
// Clear out any previously set actions
|
||||
while (index < MaxParticipants)
|
||||
{
|
||||
trilist.ClearBoolSigAction(joinMap.ParticipantAudioMuteToggleStart.JoinNumber + index);
|
||||
trilist.ClearBoolSigAction(joinMap.ParticipantVideoMuteToggleStart.JoinNumber + index);
|
||||
trilist.ClearBoolSigAction(joinMap.ParticipantPinToggleStart.JoinNumber + index);
|
||||
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
private string UpdateParticipantsXSig(List<Participant> currentParticipants)
|
||||
{
|
||||
const int maxParticipants = 50;
|
||||
const int maxDigitals = 5;
|
||||
const int maxParticipants = MaxParticipants;
|
||||
const int maxDigitals = 7;
|
||||
const int maxStrings = 1;
|
||||
const int offset = maxDigitals + maxStrings;
|
||||
var digitalIndex = maxStrings * maxParticipants; //15
|
||||
const int maxAnalogs = 1;
|
||||
const int offset = maxDigitals + maxStrings + maxAnalogs; // 9
|
||||
var digitalIndex = (maxStrings + maxAnalogs) * maxParticipants; // 100
|
||||
var stringIndex = 0;
|
||||
var analogIndex = stringIndex + maxParticipants;
|
||||
var meetingIndex = 0;
|
||||
|
||||
var tokenArray = new XSigToken[maxParticipants * offset];
|
||||
@@ -554,29 +619,42 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
tokenArray[digitalIndex + 2] = new XSigDigitalToken(digitalIndex + 3, participant.CanMuteVideo);
|
||||
tokenArray[digitalIndex + 3] = new XSigDigitalToken(digitalIndex + 4, participant.CanUnmuteVideo);
|
||||
tokenArray[digitalIndex + 4] = new XSigDigitalToken(digitalIndex + 5, participant.IsHost);
|
||||
tokenArray[digitalIndex + 5] = new XSigDigitalToken(digitalIndex + 6, participant.HandIsRaisedFb);
|
||||
tokenArray[digitalIndex + 6] = new XSigDigitalToken(digitalIndex + 7, participant.IsPinnedFb);
|
||||
|
||||
//serials
|
||||
tokenArray[stringIndex] = new XSigSerialToken(stringIndex + 1, participant.Name);
|
||||
|
||||
//analogs
|
||||
tokenArray[analogIndex] = new XSigAnalogToken(analogIndex + 1, (ushort)participant.ScreenIndexIsPinnedToFb);
|
||||
|
||||
digitalIndex += maxDigitals;
|
||||
meetingIndex += offset;
|
||||
stringIndex += maxStrings;
|
||||
analogIndex += maxAnalogs;
|
||||
}
|
||||
|
||||
while (meetingIndex < maxParticipants * offset)
|
||||
{
|
||||
//digitals
|
||||
tokenArray[digitalIndex] = new XSigDigitalToken(digitalIndex + 1, false);
|
||||
tokenArray[digitalIndex + 1] = new XSigDigitalToken(digitalIndex + 2, false);
|
||||
tokenArray[digitalIndex + 2] = new XSigDigitalToken(digitalIndex + 3, false);
|
||||
tokenArray[digitalIndex + 3] = new XSigDigitalToken(digitalIndex + 4, false);
|
||||
tokenArray[digitalIndex + 4] = new XSigDigitalToken(digitalIndex + 5, false);
|
||||
tokenArray[digitalIndex + 5] = new XSigDigitalToken(digitalIndex + 6, false);
|
||||
tokenArray[digitalIndex + 6] = new XSigDigitalToken(digitalIndex + 7, false);
|
||||
|
||||
//serials
|
||||
tokenArray[stringIndex] = new XSigSerialToken(stringIndex + 1, String.Empty);
|
||||
|
||||
//analogs
|
||||
tokenArray[analogIndex] = new XSigAnalogToken(analogIndex + 1, 0);
|
||||
|
||||
digitalIndex += maxDigitals;
|
||||
meetingIndex += offset;
|
||||
stringIndex += maxStrings;
|
||||
analogIndex += maxAnalogs;
|
||||
}
|
||||
|
||||
return GetXSigString(tokenArray);
|
||||
@@ -595,7 +673,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
trilist.SetBoolSigAction(joinMap.SourceShareAutoStart.JoinNumber, (b) => AutoShareContentWhileInCall = b);
|
||||
}
|
||||
|
||||
// TODO [ ] 2021-01-06, jkd: Added to debug OBTP dialing issues
|
||||
private List<Meeting> _currentMeetings = new List<Meeting>();
|
||||
|
||||
private void LinkVideoCodecScheduleToApi(IHasScheduleAwareness codec, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
||||
@@ -607,7 +684,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
codec.CodecSchedule.MeetingWarningMinutes = i;
|
||||
});
|
||||
|
||||
// TODO [ ] 2021-01-06, jkd: Added to debug OBTP dialing issues
|
||||
trilist.SetSigFalseAction(joinMap.DialMeeting1.JoinNumber, () =>
|
||||
{
|
||||
var mtg = 1;
|
||||
@@ -617,7 +693,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
if (_currentMeetings[index] != null)
|
||||
Dial(_currentMeetings[index]);
|
||||
});
|
||||
// TODO [ ] 2021-01-06, jkd: Added to debug OBTP dialing issues
|
||||
|
||||
trilist.SetSigFalseAction(joinMap.DialMeeting2.JoinNumber, () =>
|
||||
{
|
||||
var mtg = 2;
|
||||
@@ -627,7 +703,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
if (_currentMeetings[index] != null)
|
||||
Dial(_currentMeetings[index]);
|
||||
});
|
||||
// TODO [ ] 2021-01-06, jkd: Added to debug OBTP dialing issues
|
||||
|
||||
trilist.SetSigFalseAction(joinMap.DialMeeting3.JoinNumber, () =>
|
||||
{
|
||||
var mtg = 3;
|
||||
@@ -652,14 +728,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
{
|
||||
var currentTime = DateTime.Now;
|
||||
|
||||
// TODO [ ] 2021-01-06, jkd: Added to debug OBTP dialing issues
|
||||
// - changed var currentMeetings >> field _currentMeetings
|
||||
//_currentMeetings.Clear();
|
||||
_currentMeetings = codec.CodecSchedule.Meetings.Where(m => m.StartTime >= currentTime || m.EndTime >= currentTime).ToList();
|
||||
|
||||
// TODO [ ] 2021-01-06, jkd: Added to debug OBTP dialing issues
|
||||
// - moved the trilist.SetSigFlaseAction(joinMap.DialMeeting1..3.JoinNumber) lambda's to LinkVideoCodecScheduleToApi
|
||||
|
||||
var meetingsData = UpdateMeetingsListXSig(_currentMeetings);
|
||||
trilist.SetString(joinMap.Schedule.JoinNumber, meetingsData);
|
||||
trilist.SetUshort(joinMap.MeetingCount.JoinNumber, (ushort)_currentMeetings.Count);
|
||||
@@ -847,7 +917,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
|
||||
Debug.Console(1, this, "Call Direction: {0}", args.CallItem.Direction);
|
||||
Debug.Console(1, this, "Call is incoming: {0}", args.CallItem.Direction == eCodecCallDirection.Incoming);
|
||||
trilist.SetBool(joinMap.IncomingCall.JoinNumber, args.CallItem.Direction == eCodecCallDirection.Incoming && args.CallItem.Status == eCodecCallStatus.Ringing);
|
||||
trilist.SetBool(joinMap.IncomingCall.JoinNumber, args.CallItem.Direction == eCodecCallDirection.Incoming && args.CallItem.Status == eCodecCallStatus.Ringing);
|
||||
|
||||
if (args.CallItem.Direction == eCodecCallDirection.Incoming)
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,273 @@
|
||||
using System;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges.JoinMaps;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
{
|
||||
public class ZoomRoomJoinMap : VideoCodecControllerJoinMap
|
||||
{
|
||||
// TODO: #697 [X] Set join numbers
|
||||
|
||||
#region Digital
|
||||
|
||||
[JoinName("CanSwapContentWithThumbnail")]
|
||||
public JoinDataComplete CanSwapContentWithThumbnail = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 206,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "FB Indicates if content can be swapped with thumbnail",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("SwapContentWithThumbnail")]
|
||||
public JoinDataComplete SwapContentWithThumbnail = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 206,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Pulse to swap content with thumbnail. FB reports current state",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("GetAvailableLayouts")]
|
||||
public JoinDataComplete GetAvailableLayouts = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 215,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Gets the available layouts. Will update the LayoutXXXXXIsAvailbale signals.",
|
||||
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("LayoutIsOnFirstPage")]
|
||||
public JoinDataComplete LayoutIsOnFirstPage = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 216,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Indicates if layout is on first page",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("LayoutIsOnLastPage")]
|
||||
public JoinDataComplete LayoutIsOnLastPage = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 217,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Indicates if layout is on first page",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("LayoutTurnToNextPage")]
|
||||
public JoinDataComplete LayoutTurnToNextPage = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 216,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Turns layout view to next page",
|
||||
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("LayoutTurnToPreviousPage")]
|
||||
public JoinDataComplete LayoutTurnToPreviousPage = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 217,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Turns layout view to previous page",
|
||||
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("LayoutGalleryIsAvailable")]
|
||||
public JoinDataComplete LayoutGalleryIsAvailable = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 221,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "FB Indicates if layout 'Gallery' is available",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.DigitalSerial
|
||||
});
|
||||
|
||||
[JoinName("LayoutSpeakerIsAvailable")]
|
||||
public JoinDataComplete LayoutSpeakerIsAvailable = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 222,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "FB Indicates if layout 'Speaker' is available",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.DigitalSerial
|
||||
});
|
||||
|
||||
[JoinName("LayoutStripIsAvailable")]
|
||||
public JoinDataComplete LayoutStripIsAvailable = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 223,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "FB Indicates if layout 'Strip' is available",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.DigitalSerial
|
||||
});
|
||||
|
||||
[JoinName("LayoutShareAllIsAvailable")]
|
||||
public JoinDataComplete LayoutShareAllIsAvailable = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 224,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "FB Indicates if layout 'ShareAll' is available",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.DigitalSerial
|
||||
});
|
||||
|
||||
//[JoinName("ParticipantAudioMuteToggleStart")]
|
||||
//public JoinDataComplete ParticipantAudioMuteToggleStart = new JoinDataComplete(
|
||||
// new JoinData
|
||||
// {
|
||||
// JoinNumber = 500,
|
||||
// JoinSpan = 100
|
||||
// },
|
||||
// new JoinMetadata
|
||||
// {
|
||||
// Description = "Toggles the participant's audio mute status",
|
||||
// JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
// JoinType = eJoinType.Digital
|
||||
// });
|
||||
|
||||
//[JoinName("ParticipantVideoMuteToggleStart")]
|
||||
//public JoinDataComplete ParticipantVideoMuteToggleStart = new JoinDataComplete(
|
||||
// new JoinData
|
||||
// {
|
||||
// JoinNumber = 800,
|
||||
// JoinSpan = 100
|
||||
// },
|
||||
// new JoinMetadata
|
||||
// {
|
||||
// Description = "Toggles the participant's video mute status",
|
||||
// JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
// JoinType = eJoinType.Digital
|
||||
// });
|
||||
|
||||
//[JoinName("ParticipantPinToggleStart")]
|
||||
//public JoinDataComplete ParticipantPinToggleStart = new JoinDataComplete(
|
||||
// new JoinData
|
||||
// {
|
||||
// JoinNumber = 1100,
|
||||
// JoinSpan = 100
|
||||
// },
|
||||
// new JoinMetadata
|
||||
// {
|
||||
// Description = "Toggles the participant's pin status",
|
||||
// JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
// JoinType = eJoinType.Digital
|
||||
// });
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Analog
|
||||
|
||||
[JoinName("NumberOfScreens")]
|
||||
public JoinDataComplete NumberOfScreens = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 11,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Reports the number of screens connected",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Analog
|
||||
});
|
||||
|
||||
[JoinName("ScreenIndexToPinUserTo")]
|
||||
public JoinDataComplete ScreenIndexToPinUserTo = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 11,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Specifies the screen index a participant should be pinned to",
|
||||
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||
JoinType = eJoinType.Analog
|
||||
});
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Serials
|
||||
|
||||
[JoinName("GetSetCurrentLayout")]
|
||||
public JoinDataComplete GetSetCurrentLayout = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 215,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sets and reports the current layout. Use the LayoutXXXXIsAvailable signals to determine valid layouts",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Serial
|
||||
});
|
||||
|
||||
#endregion
|
||||
|
||||
public ZoomRoomJoinMap(uint joinStart)
|
||||
: base(joinStart, typeof(ZoomRoomJoinMap))
|
||||
{
|
||||
}
|
||||
|
||||
public ZoomRoomJoinMap(uint joinStart, Type type)
|
||||
: base(joinStart, type)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user