mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-24 01:45:07 +00:00
Compare commits
32 Commits
1.11.0
...
1.12.1-alp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e44e7c976f | ||
|
|
fea3189a18 | ||
|
|
578754de85 | ||
|
|
969abcc8b6 | ||
|
|
c136943c3a | ||
|
|
c6495577e7 | ||
|
|
5359604098 | ||
|
|
6715a680cc | ||
|
|
f3fc0f2b26 | ||
|
|
26b968463b | ||
|
|
d33b89f232 | ||
|
|
10d77ac006 | ||
|
|
c19ab76a4c | ||
|
|
040c57b5e1 | ||
|
|
d6864bf214 | ||
|
|
62275890cb | ||
|
|
2a6b845fde | ||
|
|
4fb2d6d755 | ||
|
|
5994704fbd | ||
|
|
ca1cbb6e05 | ||
|
|
f82b7f8f12 | ||
|
|
dbd77f5f9f | ||
|
|
55031d16af | ||
|
|
4938071f70 | ||
|
|
3670bde7cf | ||
|
|
4deb9a0828 | ||
|
|
a524b1607d | ||
|
|
93435b60b5 | ||
|
|
b67eb6325b | ||
|
|
38cb86218c | ||
|
|
c0c67f6c15 | ||
|
|
eb3922aa43 |
@@ -83,10 +83,10 @@ namespace PepperDash.Essentials
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(BridgeHelper.PrintJoinMap, "getjoinmap", "map(s) for bridge or device on bridge [brKey [devKey]]", ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(s =>
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "CONSOLE MESSAGE: {0}", s);
|
||||
}, "appdebugmessage", "Writes message to log", ConsoleAccessLevelEnum.AccessOperator);
|
||||
CrestronConsole.AddNewConsoleCommand(BridgeHelper.JoinmapMarkdown, "getjoinmapmarkdown"
|
||||
, "generate markdown of map(s) for bridge or device on bridge [brKey [devKey]]", ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(s => Debug.Console(0, Debug.ErrorLogLevel.Notice, "CONSOLE MESSAGE: {0}", s), "appdebugmessage", "Writes message to log", ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(s =>
|
||||
{
|
||||
@@ -103,12 +103,16 @@ namespace PepperDash.Essentials
|
||||
(ConfigReader.ConfigObject, Newtonsoft.Json.Formatting.Indented));
|
||||
}, "showconfig", "Shows the current running merged config", ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(s =>
|
||||
{
|
||||
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);
|
||||
CrestronConsole.AddNewConsoleCommand(s =>
|
||||
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);
|
||||
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(DeviceManager.GetRoutingPorts,
|
||||
@@ -296,6 +300,10 @@ namespace PepperDash.Essentials
|
||||
if (!Directory.Exists(pluginDir))
|
||||
Directory.Create(pluginDir);
|
||||
|
||||
var joinmapDir = Global.FilePathPrefix + "joinmaps";
|
||||
if(!Directory.Exists(joinmapDir))
|
||||
Directory.Create(joinmapDir);
|
||||
|
||||
return configExists;
|
||||
}
|
||||
|
||||
|
||||
@@ -97,10 +97,10 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
TriList.SetSigFalseAction(ButtonPressJoinBase + 1, ShadeDevice.Open);
|
||||
|
||||
TriList.SetSigFalseAction(ButtonPressJoinBase + 2, (ShadeDevice as IShadesOpenCloseStop).StopOrPreset);
|
||||
|
||||
if(ShadeDevice is RelayControlledShade)
|
||||
TriList.SetString(StringJoinBase + 2, (ShadeDevice as RelayControlledShade).StopOrPresetButtonLabel);
|
||||
TriList.SetSigFalseAction(ButtonPressJoinBase + 2, (ShadeDevice as IShadesOpenCloseStop).Stop);
|
||||
|
||||
if (ShadeDevice is IShadesOpenCloseStop)
|
||||
TriList.SetString(StringJoinBase + 2, "Stop");
|
||||
|
||||
TriList.SetSigFalseAction(ButtonPressJoinBase + 3, ShadeDevice.Close);
|
||||
}
|
||||
|
||||
@@ -46,6 +46,33 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
bridge.PrintJoinMaps();
|
||||
}
|
||||
}
|
||||
public static void JoinmapMarkdown(string command)
|
||||
{
|
||||
var targets = command.Split(' ');
|
||||
|
||||
var bridgeKey = targets[0].Trim();
|
||||
|
||||
var bridge = DeviceManager.GetDeviceForKey(bridgeKey) as EiscApiAdvanced;
|
||||
|
||||
if (bridge == null)
|
||||
{
|
||||
Debug.Console(0, "Unable to find advanced bridge with key: '{0}'", bridgeKey);
|
||||
return;
|
||||
}
|
||||
|
||||
if (targets.Length > 1)
|
||||
{
|
||||
var deviceKey = targets[1].Trim();
|
||||
|
||||
if (string.IsNullOrEmpty(deviceKey)) return;
|
||||
bridge.MarkdownJoinMapForDevice(deviceKey, bridgeKey);
|
||||
}
|
||||
else
|
||||
{
|
||||
bridge.MarkdownForBridge(bridgeKey);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -227,6 +254,19 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
joinMap.Value.PrintJoinMapInfo();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Generates markdown for all join maps on this bridge
|
||||
/// </summary>
|
||||
public virtual void MarkdownForBridge(string bridgeKey)
|
||||
{
|
||||
Debug.Console(0, this, "Writing Joinmaps to files for EISC IPID: {0}", Eisc.ID.ToString("X"));
|
||||
|
||||
foreach (var joinMap in JoinMaps)
|
||||
{
|
||||
Debug.Console(0, "Generating markdown for device '{0}':", joinMap.Key);
|
||||
joinMap.Value.MarkdownJoinMapInfo(joinMap.Key, bridgeKey);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Prints the join map for a device by key
|
||||
@@ -242,9 +282,26 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Console(0, "Join map for device '{0}' on EISC '{1}':", deviceKey, Key);
|
||||
Debug.Console(0, "Join map for device '{0}' on EISC '{1}':", deviceKey, Key);
|
||||
joinMap.PrintJoinMapInfo();
|
||||
}
|
||||
/// <summary>
|
||||
/// Prints the join map for a device by key
|
||||
/// </summary>
|
||||
/// <param name="deviceKey"></param>
|
||||
public void MarkdownJoinMapForDevice(string deviceKey, string bridgeKey)
|
||||
{
|
||||
var joinMap = JoinMaps[deviceKey];
|
||||
|
||||
if (joinMap == null)
|
||||
{
|
||||
Debug.Console(0, this, "Unable to find joinMap for device with key: '{0}'", deviceKey);
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Console(0, "Join map for device '{0}' on EISC '{1}':", deviceKey, Key);
|
||||
joinMap.MarkdownJoinMapInfo(deviceKey, bridgeKey);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used for debugging to trigger an action based on a join number and type
|
||||
|
||||
@@ -1,61 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Describes the functionality required to prompt a user to enter a password
|
||||
/// </summary>
|
||||
public interface IPasswordPrompt
|
||||
{
|
||||
/// <summary>
|
||||
/// Notifies when a password is required or is entered incorrectly
|
||||
/// </summary>
|
||||
event EventHandler<PasswordPromptEventArgs> PasswordRequired;
|
||||
|
||||
/// <summary>
|
||||
/// Submits the password
|
||||
/// </summary>
|
||||
/// <param name="password"></param>
|
||||
void SubmitPassword(string password);
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Describes the functionality required to prompt a user to enter a password
|
||||
/// </summary>
|
||||
public interface IPasswordPrompt
|
||||
{
|
||||
/// <summary>
|
||||
/// Notifies when a password is required or is entered incorrectly
|
||||
/// </summary>
|
||||
event EventHandler<PasswordPromptEventArgs> PasswordRequired;
|
||||
|
||||
/// <summary>
|
||||
/// Cancels the password submission
|
||||
/// Submits the password
|
||||
/// </summary>
|
||||
void CancelPasswordPrompt();
|
||||
}
|
||||
|
||||
public class PasswordPromptEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates if the last submitted password was incorrect
|
||||
/// </summary>
|
||||
public bool LastAttemptWasIncorrect { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that the login attempt has failed
|
||||
/// </summary>
|
||||
public bool LoginAttemptFailed { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that the process was cancelled and the prompt should be dismissed
|
||||
/// </summary>
|
||||
public bool LoginAttemptCancelled { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// A message to be displayed to the user
|
||||
/// </summary>
|
||||
public string Message { get; private set; }
|
||||
|
||||
public PasswordPromptEventArgs(bool lastAttemptIncorrect, bool loginFailed, bool loginCancelled, string message)
|
||||
{
|
||||
LastAttemptWasIncorrect = lastAttemptIncorrect;
|
||||
LoginAttemptFailed = loginFailed;
|
||||
LoginAttemptCancelled = loginCancelled;
|
||||
Message = message;
|
||||
}
|
||||
}
|
||||
/// <param name="password"></param>
|
||||
void SubmitPassword(string password);
|
||||
}
|
||||
|
||||
public class PasswordPromptEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates if the last submitted password was incorrect
|
||||
/// </summary>
|
||||
public bool LastAttemptWasIncorrect { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that the login attempt has failed
|
||||
/// </summary>
|
||||
public bool LoginAttemptFailed { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that the process was cancelled and the prompt should be dismissed
|
||||
/// </summary>
|
||||
public bool LoginAttemptCancelled { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// A message to be displayed to the user
|
||||
/// </summary>
|
||||
public string Message { get; private set; }
|
||||
|
||||
public PasswordPromptEventArgs(bool lastAttemptIncorrect, bool loginFailed, bool loginCancelled, string message)
|
||||
{
|
||||
LastAttemptWasIncorrect = lastAttemptIncorrect;
|
||||
LoginAttemptFailed = loginFailed;
|
||||
LoginAttemptCancelled = loginCancelled;
|
||||
Message = message;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,5 +16,9 @@ namespace PepperDash.Essentials.Core
|
||||
{
|
||||
return string.IsNullOrEmpty(s.Trim()) ? null : s;
|
||||
}
|
||||
public static string ReplaceIfNullOrEmpty(this string s, string newString)
|
||||
{
|
||||
return string.IsNullOrEmpty(s) ? newString : s;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp.Reflection;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
@@ -193,19 +198,6 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
protected void AddJoins(Type type)
|
||||
{
|
||||
// Add all the JoinDataComplete properties to the Joins Dictionary and pass in the offset
|
||||
//Joins = this.GetType()
|
||||
// .GetCType()
|
||||
// .GetFields(BindingFlags.Public | BindingFlags.Instance)
|
||||
// .Where(field => field.IsDefined(typeof(JoinNameAttribute), true))
|
||||
// .Select(field => (JoinDataComplete)field.GetValue(this))
|
||||
// .ToDictionary(join => join.GetNameAttribute(), join =>
|
||||
// {
|
||||
// join.SetJoinOffset(_joinOffset);
|
||||
// return join;
|
||||
// });
|
||||
|
||||
//type = this.GetType(); <- this wasn't working because 'this' was always the base class, never the derived class
|
||||
var fields =
|
||||
type.GetCType()
|
||||
.GetFields(BindingFlags.Public | BindingFlags.Instance)
|
||||
@@ -219,7 +211,7 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
if (value == null)
|
||||
{
|
||||
Debug.Console(0, "Unable to caset base class to {0}", type.Name);
|
||||
Debug.Console(0, "Unable to cast base class to {0}", type.Name);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -256,12 +248,64 @@ namespace PepperDash.Essentials.Core
|
||||
var analogs = Joins.Where(j => (j.Value.Metadata.JoinType & eJoinType.Analog) == eJoinType.Analog).ToDictionary(j => j.Key, j => j.Value);
|
||||
Debug.Console(2, "Found {0} Analog Joins", analogs.Count);
|
||||
PrintJoinList(GetSortedJoins(analogs));
|
||||
|
||||
|
||||
Debug.Console(0, "Serials:");
|
||||
var serials = Joins.Where(j => (j.Value.Metadata.JoinType & eJoinType.Serial) == eJoinType.Serial).ToDictionary(j => j.Key, j => j.Value);
|
||||
Debug.Console(2, "Found {0} Serial Joins", serials.Count);
|
||||
PrintJoinList(GetSortedJoins(serials));
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Prints the join information to console
|
||||
/// </summary>
|
||||
public void MarkdownJoinMapInfo(string deviceKey, string bridgeKey)
|
||||
{
|
||||
var pluginType = GetType().Name;
|
||||
|
||||
Debug.Console(0, "{0}:\n", pluginType);
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
sb.AppendLine(String.Format("# {0}", GetType().Name));
|
||||
sb.AppendLine(String.Format("Generated from '{0}' on bridge '{1}'", deviceKey, bridgeKey));
|
||||
sb.AppendLine();
|
||||
sb.AppendLine("## Digitals");
|
||||
// Get the joins of each type and print them
|
||||
var digitals = Joins.Where(j => (j.Value.Metadata.JoinType & eJoinType.Digital) == eJoinType.Digital).ToDictionary(j => j.Key, j => j.Value);
|
||||
Debug.Console(2, "Found {0} Digital Joins", digitals.Count);
|
||||
var digitalSb = AppendJoinList(GetSortedJoins(digitals));
|
||||
digitalSb.AppendLine("## Analogs");
|
||||
digitalSb.AppendLine();
|
||||
|
||||
Debug.Console(0, "Analogs:");
|
||||
var analogs = Joins.Where(j => (j.Value.Metadata.JoinType & eJoinType.Analog) == eJoinType.Analog).ToDictionary(j => j.Key, j => j.Value);
|
||||
Debug.Console(2, "Found {0} Analog Joins", analogs.Count);
|
||||
var analogSb = AppendJoinList(GetSortedJoins(analogs));
|
||||
analogSb.AppendLine("## Serials");
|
||||
analogSb.AppendLine();
|
||||
|
||||
Debug.Console(0, "Serials:");
|
||||
var serials = Joins.Where(j => (j.Value.Metadata.JoinType & eJoinType.Serial) == eJoinType.Serial).ToDictionary(j => j.Key, j => j.Value);
|
||||
Debug.Console(2, "Found {0} Serial Joins", serials.Count);
|
||||
var serialSb = AppendJoinList(GetSortedJoins(serials));
|
||||
|
||||
sb.EnsureCapacity(sb.Length + digitalSb.Length + analogSb.Length + serialSb.Length);
|
||||
sb.Append(digitalSb).Append(analogSb).Append(serialSb);
|
||||
|
||||
WriteJoinmapMarkdown(sb, pluginType, bridgeKey, deviceKey);
|
||||
|
||||
}
|
||||
|
||||
private static void WriteJoinmapMarkdown(StringBuilder stringBuilder, string pluginType, string bridgeKey, string deviceKey)
|
||||
{
|
||||
var fileName = String.Format("{0}{1}{2}__{3}__{4}.md", Global.FilePathPrefix, "joinMaps/", pluginType, bridgeKey, deviceKey);
|
||||
|
||||
using (var sw = new StreamWriter(fileName))
|
||||
{
|
||||
sw.WriteLine(stringBuilder.ToString());
|
||||
Debug.Console(0, "Joinmap Readme generated and written to {0}", fileName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -283,15 +327,49 @@ namespace PepperDash.Essentials.Core
|
||||
foreach (var join in joins)
|
||||
{
|
||||
Debug.Console(0,
|
||||
@"Join Number: {0} | JoinSpan: '{1}' | Description: '{2}' | Type: '{3}' | Capabilities: '{4}'",
|
||||
@"Join Number: {0} | JoinSpan: '{1}' | JoinName: {2} | Description: '{3}' | Type: '{4}' | Capabilities: '{5}'",
|
||||
join.Value.JoinNumber,
|
||||
join.Value.JoinSpan,
|
||||
join.Key,
|
||||
String.IsNullOrEmpty(join.Value.AttributeName) ? join.Value.Metadata.Label : join.Value.AttributeName,
|
||||
join.Value.Metadata.JoinType.ToString(),
|
||||
join.Value.Metadata.JoinCapabilities.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
static StringBuilder AppendJoinList(List<KeyValuePair<string, JoinDataComplete>> joins)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
const string stringFormatter = "| {0} | {1} | {2} | {3} | {4} |";
|
||||
const int joinNumberLen = 11;
|
||||
const int joinSpanLen = 9;
|
||||
const int typeLen = 19;
|
||||
const int capabilitiesLen = 12;
|
||||
var descriptionLen = (from @join in joins select @join.Value into j select j.Metadata.Description.Length).Concat(new[] {11}).Max();
|
||||
|
||||
//build header
|
||||
sb.AppendLine(String.Format(stringFormatter,
|
||||
String.Format("Join Number").PadRight(joinNumberLen, ' '),
|
||||
String.Format("Join Span").PadRight(joinSpanLen, ' '),
|
||||
String.Format("Description").PadRight(descriptionLen, ' '),
|
||||
String.Format("Type").PadRight(typeLen, ' '),
|
||||
String.Format("Capabilities").PadRight(capabilitiesLen, ' ')));
|
||||
//build table seperator
|
||||
sb.AppendLine(String.Format(stringFormatter,
|
||||
new String('-', joinNumberLen),
|
||||
new String('-', joinSpanLen),
|
||||
new String('-', descriptionLen),
|
||||
new String('-', typeLen),
|
||||
new String('-', capabilitiesLen)));
|
||||
|
||||
foreach (var join in joins)
|
||||
{
|
||||
sb.AppendLine(join.Value.GetMarkdownFormattedData(stringFormatter, descriptionLen));
|
||||
}
|
||||
sb.AppendLine();
|
||||
return sb;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to find the matching key for the custom join and if found overwrites the default JoinData with the custom
|
||||
/// </summary>
|
||||
@@ -458,6 +536,64 @@ namespace PepperDash.Essentials.Core
|
||||
Metadata = metadata;
|
||||
}
|
||||
|
||||
public string GetMarkdownFormattedData(string stringFormatter, int descriptionLen)
|
||||
{
|
||||
|
||||
//Fixed Width Headers
|
||||
var joinNumberLen = String.Format("Join Number").Length;
|
||||
var joinSpanLen = String.Format("Join Span").Length;
|
||||
var typeLen = String.Format("AnalogDigitalSerial").Length;
|
||||
var capabilitiesLen = String.Format("ToFromFusion").Length;
|
||||
|
||||
//Track which one failed, if it did
|
||||
const string placeholder = "unknown";
|
||||
var dataArray = new Dictionary<string, string>
|
||||
{
|
||||
{"joinNumber", placeholder.PadRight(joinNumberLen, ' ')},
|
||||
{"joinSpan", placeholder.PadRight(joinSpanLen, ' ')},
|
||||
{"description", placeholder.PadRight(descriptionLen, ' ')},
|
||||
{"joinType", placeholder.PadRight(typeLen, ' ')},
|
||||
{"capabilities", placeholder.PadRight(capabilitiesLen, ' ')}
|
||||
};
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
dataArray["joinNumber"] = String.Format("{0}", JoinNumber.ToString(CultureInfo.InvariantCulture).ReplaceIfNullOrEmpty(placeholder)).PadRight(joinNumberLen, ' ');
|
||||
dataArray["joinSpan"] = String.Format("{0}", JoinSpan.ToString(CultureInfo.InvariantCulture).ReplaceIfNullOrEmpty(placeholder)).PadRight(joinSpanLen, ' ');
|
||||
dataArray["description"] = String.Format("{0}", Metadata.Description.ReplaceIfNullOrEmpty(placeholder)).PadRight(descriptionLen, ' ');
|
||||
dataArray["joinType"] = String.Format("{0}", Metadata.JoinType.ToString().ReplaceIfNullOrEmpty(placeholder)).PadRight(typeLen, ' ');
|
||||
dataArray["capabilities"] = String.Format("{0}", Metadata.JoinCapabilities.ToString().ReplaceIfNullOrEmpty(placeholder)).PadRight(capabilitiesLen, ' ');
|
||||
|
||||
return String.Format(stringFormatter,
|
||||
dataArray["joinNumber"],
|
||||
dataArray["joinSpan"],
|
||||
dataArray["description"],
|
||||
dataArray["joinType"],
|
||||
dataArray["capabilities"]);
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
//Don't Throw - we don't want to kill the system if this falls over - it's not mission critical. Print the error, use placeholder data
|
||||
var errorKey = string.Empty;
|
||||
foreach (var item in dataArray)
|
||||
{
|
||||
if (item.Value.TrimEnd() == placeholder) ;
|
||||
errorKey = item.Key;
|
||||
break;
|
||||
}
|
||||
Debug.Console(0, "Unable to decode join metadata {1}- {0}", e.Message, !String.IsNullOrEmpty(errorKey) ? (' ' + errorKey) : String.Empty);
|
||||
return String.Format(stringFormatter,
|
||||
dataArray["joinNumber"],
|
||||
dataArray["joinSpan"],
|
||||
dataArray["description"],
|
||||
dataArray["joinType"],
|
||||
dataArray["capabilities"]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Sets the join offset value
|
||||
/// </summary>
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace PepperDash.Essentials.Core.Shades
|
||||
/// <summary>
|
||||
/// Requirements for a device that implements basic Open/Close shade control
|
||||
/// </summary>
|
||||
[Obsolete("Please use IShadesOpenCloseStop instead")]
|
||||
public interface IShadesOpenClose
|
||||
{
|
||||
void Open();
|
||||
@@ -28,15 +29,26 @@ namespace PepperDash.Essentials.Core.Shades
|
||||
/// <summary>
|
||||
/// Requirements for a device that implements basic Open/Close/Stop shade control (Uses 3 relays)
|
||||
/// </summary>
|
||||
public interface IShadesOpenCloseStop : IShadesOpenClose
|
||||
{
|
||||
void StopOrPreset();
|
||||
string StopOrPresetButtonLabel { get; }
|
||||
public interface IShadesOpenCloseStop
|
||||
{
|
||||
void Open();
|
||||
void Close();
|
||||
void Stop();
|
||||
}
|
||||
|
||||
public interface IShadesOpenClosePreset : IShadesOpenCloseStop
|
||||
{
|
||||
void RecallPreset(uint presetNumber);
|
||||
void SavePreset(uint presetNumber);
|
||||
string StopOrPresetButtonLabel { get; }
|
||||
|
||||
event EventHandler PresetSaved;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Requirements for a shade that implements press/hold raise/lower functions
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
[Obsolete("Please use IShadesOpenCloseStop instead")]
|
||||
public interface IShadesRaiseLower
|
||||
{
|
||||
void Raise(bool state);
|
||||
@@ -55,7 +67,7 @@ namespace PepperDash.Essentials.Core.Shades
|
||||
/// <summary>
|
||||
/// Requirements for a shade/scene that is open or closed
|
||||
/// </summary>
|
||||
public interface IShadesOpenClosedFeedback: IShadesOpenClose
|
||||
public interface IShadesOpenClosedFeedback: IShadesOpenCloseStop
|
||||
{
|
||||
BoolFeedback ShadeIsOpenFeedback { get; }
|
||||
BoolFeedback ShadeIsClosedFeedback { get; }
|
||||
@@ -63,15 +75,16 @@ namespace PepperDash.Essentials.Core.Shades
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public interface IShadesStop
|
||||
/// </summary>
|
||||
[Obsolete("Please use IShadesOpenCloseStop instead")]
|
||||
public interface IShadesStop
|
||||
{
|
||||
void Stop();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// Used to implement raise/stop/lower/stop from single button
|
||||
/// </summary>
|
||||
public interface IShadesStopOrMove
|
||||
{
|
||||
void OpenOrStop();
|
||||
@@ -82,7 +95,7 @@ namespace PepperDash.Essentials.Core.Shades
|
||||
/// <summary>
|
||||
/// Basic feedback for shades/scene stopped
|
||||
/// </summary>
|
||||
public interface IShadesStopFeedback
|
||||
public interface IShadesStopFeedback : IShadesOpenCloseStop
|
||||
{
|
||||
BoolFeedback IsStoppedFeedback { get; }
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace PepperDash.Essentials.Core.Shades
|
||||
/// <summary>
|
||||
/// Base class for a shade device
|
||||
/// </summary>
|
||||
public abstract class ShadeBase : EssentialsDevice, IShadesOpenClose
|
||||
public abstract class ShadeBase : EssentialsDevice, IShadesOpenCloseStop
|
||||
{
|
||||
public ShadeBase(string key, string name)
|
||||
: base(key, name)
|
||||
@@ -23,7 +23,7 @@ namespace PepperDash.Essentials.Core.Shades
|
||||
#region iShadesOpenClose Members
|
||||
|
||||
public abstract void Open();
|
||||
public abstract void StopOrPreset();
|
||||
public abstract void Stop();
|
||||
public abstract void Close();
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -56,9 +56,9 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Somfy
|
||||
PulseOutput(OpenRelay, RelayPulseTime);
|
||||
}
|
||||
|
||||
public override void StopOrPreset()
|
||||
public override void Stop()
|
||||
{
|
||||
Debug.Console(1, this, "Stopping or recalling preset on Shade: '{0}'", this.Name);
|
||||
Debug.Console(1, this, "Stopping Shade: '{0}'", this.Name);
|
||||
|
||||
PulseOutput(StopOrPresetRelay, RelayPulseTime);
|
||||
}
|
||||
|
||||
@@ -43,10 +43,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces
|
||||
[JsonProperty("isLocked", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public Boolean IsLocked { get; private set; }
|
||||
[JsonProperty("isRecording", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public Boolean IsRecording { get; private set; }
|
||||
public Boolean IsRecording { get; private set; }
|
||||
[JsonProperty("canRecord", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public Boolean CanRecord { get; private set; }
|
||||
|
||||
|
||||
public MeetingInfo(string id, string name, string host, string password, string shareStatus, bool isHost, bool isSharingMeeting, bool waitingForHost, bool isLocked, bool isRecording)
|
||||
public MeetingInfo(string id, string name, string host, string password, string shareStatus, bool isHost, bool isSharingMeeting, bool waitingForHost, bool isLocked, bool isRecording, bool canRecord)
|
||||
{
|
||||
Id = id;
|
||||
Name = name;
|
||||
@@ -57,7 +59,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces
|
||||
IsSharingMeeting = isSharingMeeting;
|
||||
WaitingForHost = waitingForHost;
|
||||
IsLocked = isLocked;
|
||||
IsRecording = isRecording;
|
||||
IsRecording = isRecording;
|
||||
CanRecord = CanRecord;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
public interface IHasPresentationOnlyMeeting
|
||||
{
|
||||
void StartSharingOnlyMeeting();
|
||||
void StartSharingOnlyMeeting(eSharingMeetingMode mode);
|
||||
void StartSharingOnlyMeeting(eSharingMeetingMode mode, ushort duration);
|
||||
void StartSharingOnlyMeeting(eSharingMeetingMode mode, ushort duration, string password);
|
||||
void StartSharingOnlyMeeting(eSharingMeetingMode displayMode);
|
||||
void StartSharingOnlyMeeting(eSharingMeetingMode displayMode, uint duration);
|
||||
void StartSharingOnlyMeeting(eSharingMeetingMode displayMode, uint duration, string password);
|
||||
void StartNormalMeetingFromSharingOnlyMeeting();
|
||||
}
|
||||
|
||||
|
||||
@@ -1393,11 +1393,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
tokenArray[digitalIndex + 1] = new XSigDigitalToken(digitalIndex + 2, call.IsOnHold);
|
||||
|
||||
//serials
|
||||
tokenArray[arrayIndex + 1] = new XSigSerialToken(stringIndex + 1, call.Name ?? String.Empty);
|
||||
tokenArray[arrayIndex + 2] = new XSigSerialToken(stringIndex + 2, call.Number ?? String.Empty);
|
||||
tokenArray[arrayIndex + 3] = new XSigSerialToken(stringIndex + 3, call.Direction.ToString());
|
||||
tokenArray[arrayIndex + 4] = new XSigSerialToken(stringIndex + 4, call.Type.ToString());
|
||||
tokenArray[arrayIndex + 5] = new XSigSerialToken(stringIndex + 5, call.Status.ToString());
|
||||
tokenArray[arrayIndex] = new XSigSerialToken(stringIndex + 1, call.Name ?? String.Empty);
|
||||
tokenArray[arrayIndex + 1] = new XSigSerialToken(stringIndex + 2, call.Number ?? String.Empty);
|
||||
tokenArray[arrayIndex + 2] = new XSigSerialToken(stringIndex + 3, call.Direction.ToString());
|
||||
tokenArray[arrayIndex + 3] = new XSigSerialToken(stringIndex + 4, call.Type.ToString());
|
||||
tokenArray[arrayIndex + 4] = new XSigSerialToken(stringIndex + 5, call.Status.ToString());
|
||||
if(call.Duration != null)
|
||||
{
|
||||
// May need to verify correct string format here
|
||||
@@ -1407,9 +1407,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
|
||||
arrayIndex += offset;
|
||||
stringIndex += maxStrings;
|
||||
digitalIndex++;
|
||||
digitalIndex += maxDigitals;
|
||||
}
|
||||
while (digitalIndex < maxCalls)
|
||||
while (arrayIndex < maxCalls * offset)
|
||||
{
|
||||
//digitals
|
||||
tokenArray[digitalIndex] = new XSigDigitalToken(digitalIndex + 1, false);
|
||||
@@ -1417,16 +1417,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
|
||||
|
||||
//serials
|
||||
tokenArray[arrayIndex + 1] = new XSigSerialToken(stringIndex + 1, String.Empty);
|
||||
tokenArray[arrayIndex + 2] = new XSigSerialToken(stringIndex + 2, String.Empty);
|
||||
tokenArray[arrayIndex + 3] = new XSigSerialToken(stringIndex + 3, String.Empty);
|
||||
tokenArray[arrayIndex + 4] = new XSigSerialToken(stringIndex + 4, String.Empty);
|
||||
tokenArray[arrayIndex + 5] = new XSigSerialToken(stringIndex + 5, String.Empty);
|
||||
tokenArray[arrayIndex + 6] = new XSigSerialToken(stringIndex + 6, String.Empty);
|
||||
tokenArray[arrayIndex] = new XSigSerialToken(stringIndex + 1, String.Empty);
|
||||
tokenArray[arrayIndex + 1] = new XSigSerialToken(stringIndex + 2, String.Empty);
|
||||
tokenArray[arrayIndex + 2] = new XSigSerialToken(stringIndex + 3, String.Empty);
|
||||
tokenArray[arrayIndex + 3] = new XSigSerialToken(stringIndex + 4, String.Empty);
|
||||
tokenArray[arrayIndex + 4] = new XSigSerialToken(stringIndex + 5, String.Empty);
|
||||
tokenArray[arrayIndex + 5] = new XSigSerialToken(stringIndex + 6, String.Empty);
|
||||
|
||||
arrayIndex += offset;
|
||||
stringIndex += maxStrings;
|
||||
digitalIndex++;
|
||||
digitalIndex += maxDigitals;
|
||||
}
|
||||
|
||||
return GetXSigString(tokenArray);
|
||||
|
||||
@@ -448,6 +448,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
private bool _isAirHostClientConnected;
|
||||
private bool _isSharingBlackMagic;
|
||||
private bool _isDirectPresentationConnected;
|
||||
private bool _isBlackMagicConnected;
|
||||
|
||||
|
||||
public string directPresentationPairingCode { get; set; }
|
||||
@@ -484,7 +485,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
}
|
||||
}
|
||||
|
||||
public bool isBlackMagicConnected { get; set; }
|
||||
public bool isBlackMagicConnected
|
||||
{
|
||||
get { return _isBlackMagicConnected; }
|
||||
set
|
||||
{
|
||||
if (value != _isBlackMagicConnected)
|
||||
{
|
||||
_isBlackMagicConnected = value;
|
||||
NotifyPropertyChanged("isBlackMagicConnected");
|
||||
}
|
||||
}
|
||||
}
|
||||
public bool isBlackMagicDataAvailable { get; set; }
|
||||
|
||||
public bool isDirectPresentationConnected
|
||||
@@ -627,6 +639,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
// backer variables
|
||||
private bool _can_Switch_Speaker_View;
|
||||
private bool _can_Switch_Wall_View;
|
||||
private bool _can_Switch_Strip_View;
|
||||
private bool _can_Switch_Share_On_All_Screens;
|
||||
private bool _can_Switch_Floating_Share_Content;
|
||||
private bool _is_In_First_Page;
|
||||
@@ -714,6 +727,23 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
}
|
||||
}
|
||||
|
||||
[JsonProperty("can_Switch_Strip_View")]
|
||||
public bool can_Switch_Strip_View
|
||||
{
|
||||
get
|
||||
{
|
||||
return _can_Switch_Strip_View;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value != _can_Switch_Strip_View)
|
||||
{
|
||||
_can_Switch_Strip_View = value;
|
||||
NotifyPropertyChanged("can_Switch_Strip_View");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[JsonProperty("is_In_First_Page")]
|
||||
public bool is_In_First_Page
|
||||
{
|
||||
@@ -775,11 +805,43 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
public class CallRecordInfo : NotifiableObject
|
||||
{
|
||||
private bool _meetingIsBeingRecorded;
|
||||
private bool _canRecord;
|
||||
private bool _emailRequired;
|
||||
|
||||
public bool canRecord { get; set; }
|
||||
public bool emailRequired { get; set; }
|
||||
public bool amIRecording { get; set; }
|
||||
|
||||
public bool canRecord
|
||||
{
|
||||
get
|
||||
{
|
||||
return _canRecord;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value != _canRecord)
|
||||
{
|
||||
_canRecord = value;
|
||||
NotifyPropertyChanged("canRecord");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool emailRequired
|
||||
{
|
||||
get
|
||||
{
|
||||
return _emailRequired;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value != _emailRequired)
|
||||
{
|
||||
_emailRequired = value;
|
||||
NotifyPropertyChanged("emailRequired");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool meetingIsBeingRecorded
|
||||
{
|
||||
get
|
||||
@@ -798,6 +860,17 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Indicates if recording is allowed (when meeting capable and and email is not required to be entered by the user)
|
||||
/// </summary>
|
||||
public bool AllowRecord
|
||||
{
|
||||
get
|
||||
{
|
||||
return canRecord && !emailRequired;
|
||||
}
|
||||
}
|
||||
|
||||
public CallRecordInfo()
|
||||
{
|
||||
Debug.Console(2, Debug.ErrorLogLevel.Notice, "********************************************* CallRecordInfo() ******************************************");
|
||||
|
||||
@@ -62,6 +62,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
private readonly ZoomRoomPropertiesConfig _props;
|
||||
|
||||
private bool _meetingPasswordRequired;
|
||||
|
||||
public void Poll(string pollString)
|
||||
{
|
||||
if(_meetingPasswordRequired) return;
|
||||
|
||||
SendText(string.Format("{0}{1}", pollString, SendDelimiter));
|
||||
}
|
||||
|
||||
public ZoomRoom(DeviceConfig config, IBasicCommunication comm)
|
||||
: base(config)
|
||||
{
|
||||
@@ -75,13 +84,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
if (_props.CommunicationMonitorProperties != null)
|
||||
{
|
||||
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication,
|
||||
_props.CommunicationMonitorProperties);
|
||||
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, _props.CommunicationMonitorProperties.PollInterval, _props.CommunicationMonitorProperties.TimeToWarning, _props.CommunicationMonitorProperties.TimeToError,
|
||||
() => Poll(_props.CommunicationMonitorProperties.PollString));
|
||||
}
|
||||
else
|
||||
{
|
||||
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 30000, 120000, 300000,
|
||||
"zStatus SystemUnit" + SendDelimiter);
|
||||
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 30000, 120000, 300000, () => Poll("zStatus SystemUnit"));
|
||||
}
|
||||
|
||||
DeviceManager.AddDevice(CommunicationMonitor);
|
||||
@@ -252,7 +260,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
protected override Func<bool> SharingContentIsOnFeedbackFunc
|
||||
{
|
||||
get { return () => Status.Call.Sharing.IsSharing; }
|
||||
get { return () => Status.Sharing.isAirHostClientConnected || Status.Sharing.isDirectPresentationConnected || Status.Sharing.isSharingBlackMagic; }
|
||||
}
|
||||
|
||||
protected Func<bool> FarEndIsSharingContentFeedbackFunc
|
||||
@@ -529,6 +537,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
/// </summary>
|
||||
private void SetUpCallFeedbackActions()
|
||||
{
|
||||
Status.Sharing.PropertyChanged -= HandleSharingStateUpdate;
|
||||
Status.Sharing.PropertyChanged += HandleSharingStateUpdate;
|
||||
|
||||
Status.Call.Sharing.PropertyChanged -= HandleSharingStateUpdate;
|
||||
Status.Call.Sharing.PropertyChanged += HandleSharingStateUpdate;
|
||||
|
||||
@@ -541,7 +552,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
private void HandleCallRecordInfoStateUpdate(object sender, PropertyChangedEventArgs a)
|
||||
{
|
||||
if (a.PropertyName == "meetingIsBeingRecorded")
|
||||
if (a.PropertyName == "meetingIsBeingRecorded" || a.PropertyName == "emailRequired" || a.PropertyName == "canRecord")
|
||||
{
|
||||
MeetingIsRecordingFeedback.FireUpdate();
|
||||
|
||||
@@ -554,7 +565,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
MeetingInfo.IsSharingMeeting,
|
||||
MeetingInfo.WaitingForHost,
|
||||
MeetingIsLockedFeedback.BoolValue,
|
||||
MeetingIsRecordingFeedback.BoolValue);
|
||||
MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord);
|
||||
MeetingInfo = meetingInfo;
|
||||
}
|
||||
}
|
||||
@@ -580,10 +591,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
private void HandleSharingStateUpdate(object sender, PropertyChangedEventArgs a)
|
||||
{
|
||||
if (a.PropertyName != "State")
|
||||
{
|
||||
return;
|
||||
}
|
||||
//if (a.PropertyName != "State")
|
||||
//{
|
||||
// return;
|
||||
//}
|
||||
|
||||
SharingContentIsOnFeedback.FireUpdate();
|
||||
ReceivingContent.FireUpdate();
|
||||
@@ -593,21 +604,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
// Update the share status of the meeting info
|
||||
if (MeetingInfo == null)
|
||||
{
|
||||
var sharingStatus = GetSharingStatus();
|
||||
|
||||
MeetingInfo = new MeetingInfo("", "", "", "", sharingStatus, GetIsHostMyself(), true, false, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue);
|
||||
MeetingInfo = new MeetingInfo("", "", "", "", GetSharingStatus(), GetIsHostMyself(), true, false, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord);
|
||||
return;
|
||||
}
|
||||
|
||||
var meetingInfo = new MeetingInfo(MeetingInfo.Id, MeetingInfo.Name, Participants.Host != null ? Participants.Host.Name : "None",
|
||||
MeetingInfo.Password, GetSharingStatus(), GetIsHostMyself(), MeetingInfo.IsSharingMeeting, MeetingInfo.WaitingForHost, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue);
|
||||
MeetingInfo.Password, GetSharingStatus(), GetIsHostMyself(), MeetingInfo.IsSharingMeeting, MeetingInfo.WaitingForHost, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord);
|
||||
MeetingInfo = meetingInfo;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(1, this, "Error processing state property update. {0}", e.Message);
|
||||
Debug.Console(2, this, e.StackTrace);
|
||||
MeetingInfo = new MeetingInfo("", "", "", "", "None", false, false, false, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue);
|
||||
MeetingInfo = new MeetingInfo("", "", "", "", "None", false, false, false, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -714,7 +723,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
MeetingInfo.IsSharingMeeting,
|
||||
MeetingInfo.WaitingForHost,
|
||||
MeetingIsLockedFeedback.BoolValue,
|
||||
MeetingIsRecordingFeedback.BoolValue
|
||||
MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -776,7 +785,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
MeetingInfo.IsSharingMeeting,
|
||||
MeetingInfo.WaitingForHost,
|
||||
MeetingIsLockedFeedback.BoolValue,
|
||||
MeetingIsRecordingFeedback.BoolValue);
|
||||
MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord);
|
||||
MeetingInfo = meetingInfo;
|
||||
break;
|
||||
}
|
||||
@@ -810,8 +819,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
Debug.Console(1, this, "Status.Layout.PropertyChanged a.PropertyName: {0}", a.PropertyName);
|
||||
switch (a.PropertyName.ToLower())
|
||||
{
|
||||
case "can_switch_speaker_view":
|
||||
case "can_Switch_speaker_view":
|
||||
case "can_switch_wall_view":
|
||||
case "can_switch_strip_view":
|
||||
case "video_type":
|
||||
case "can_switch_share_on_all_screens":
|
||||
{
|
||||
ComputeAvailableLayouts();
|
||||
@@ -827,7 +838,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
LayoutViewIsOnLastPageFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
case "can_Switch_Floating_Share_Content":
|
||||
case "can_switch_floating_share_content":
|
||||
{
|
||||
CanSwapContentWithThumbnailFeedback.FireUpdate();
|
||||
break;
|
||||
@@ -1468,13 +1479,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
MeetingInfo.Id,
|
||||
MeetingInfo.Name,
|
||||
Participants.Host.Name,
|
||||
MeetingInfo.Password,
|
||||
MeetingInfo.ShareStatus,
|
||||
MeetingInfo.Password,
|
||||
GetSharingStatus(),
|
||||
GetIsHostMyself(),
|
||||
MeetingInfo.IsSharingMeeting,
|
||||
MeetingInfo.WaitingForHost,
|
||||
MeetingIsLockedFeedback.BoolValue,
|
||||
MeetingIsRecordingFeedback.BoolValue);
|
||||
MeetingIsRecordingFeedback.BoolValue,
|
||||
Status.Call.CallRecordInfo.AllowRecord
|
||||
);
|
||||
MeetingInfo = meetingInfo;
|
||||
|
||||
PrintCurrentCallParticipants();
|
||||
@@ -1559,7 +1572,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
{
|
||||
JsonConvert.PopulateObject(responseObj.ToString(), Status.Call.Sharing);
|
||||
|
||||
SetLayout();
|
||||
SetDefaultLayout();
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -1689,14 +1702,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
if (MeetingInfo == null)
|
||||
{
|
||||
MeetingInfo = new MeetingInfo("Waiting For Host", "Waiting For Host", "Waiting For Host", "",
|
||||
GetSharingStatus(), false, false, true, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue);
|
||||
GetSharingStatus(), false, false, true, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord);
|
||||
|
||||
UpdateCallStatus();
|
||||
break;
|
||||
}
|
||||
|
||||
MeetingInfo = new MeetingInfo("Waiting For Host", "Waiting For Host", "Waiting For Host", "",
|
||||
GetSharingStatus(), false, false, true, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue);
|
||||
GetSharingStatus(), false, false, true, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord);
|
||||
|
||||
UpdateCallStatus();
|
||||
|
||||
@@ -1706,12 +1719,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
if (MeetingInfo == null)
|
||||
{
|
||||
MeetingInfo = new MeetingInfo("Waiting For Host", "Waiting For Host", "Waiting For Host", "",
|
||||
GetSharingStatus(), false, false, false, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue);
|
||||
GetSharingStatus(), false, false, false, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord);
|
||||
break;
|
||||
}
|
||||
|
||||
MeetingInfo = new MeetingInfo(MeetingInfo.Id, MeetingInfo.Name, MeetingInfo.Host, MeetingInfo.Password,
|
||||
GetSharingStatus(), GetIsHostMyself(), false, false, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue);
|
||||
GetSharingStatus(), GetIsHostMyself(), false, false, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -1801,7 +1814,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
if (result.Success)
|
||||
{
|
||||
MeetingInfo = new MeetingInfo("", "", "", "", "", true, true, MeetingInfo.WaitingForHost, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue);
|
||||
MeetingInfo = new MeetingInfo("", "", "", "", GetSharingStatus(), true, true, MeetingInfo.WaitingForHost, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1935,7 +1948,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
}
|
||||
}
|
||||
|
||||
private void SetLayout()
|
||||
private void SetDefaultLayout()
|
||||
{
|
||||
if (!_props.AutoDefaultLayouts) return;
|
||||
|
||||
@@ -1948,8 +1961,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
}
|
||||
else
|
||||
{
|
||||
SendText(String.Format("zconfiguration call layout style: {0}",
|
||||
_props.DefaultCallLayout));
|
||||
if (_props.DefaultCallLayout == (_props.DefaultCallLayout & AvailableLayouts))
|
||||
{
|
||||
SendText(String.Format("zconfiguration call layout style: {0}",
|
||||
_props.DefaultCallLayout));
|
||||
}
|
||||
else
|
||||
Debug.Console(0, this, "Unable to set default Layout. {0} not currently an available layout based on meeting state", _props.DefaultCallLayout);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1982,6 +2000,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
/// </summary>
|
||||
private void GetBookings()
|
||||
{
|
||||
if (_meetingPasswordRequired) return;
|
||||
|
||||
SendText("zCommand Bookings List");
|
||||
}
|
||||
|
||||
@@ -2147,10 +2167,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
!String.Equals(Status.Call.Info.meeting_type,"NORMAL"),
|
||||
false,
|
||||
MeetingIsLockedFeedback.BoolValue,
|
||||
MeetingIsRecordingFeedback.BoolValue
|
||||
MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord
|
||||
);
|
||||
|
||||
SetDefaultLayout();
|
||||
}
|
||||
// TODO [ ] Issue #868
|
||||
|
||||
else if (item.Status == eCodecCallStatus.Disconnected)
|
||||
{
|
||||
MeetingInfo = new MeetingInfo(
|
||||
@@ -2163,19 +2185,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
false, Status.Call.CallRecordInfo.AllowRecord
|
||||
);
|
||||
}
|
||||
|
||||
_meetingPasswordRequired = false;
|
||||
base.OnCallStatusChange(item);
|
||||
|
||||
Debug.Console(1, this, "[OnCallStatusChange] Current Call Status: {0}",
|
||||
Status.Call != null ? Status.Call.Status.ToString() : "no call");
|
||||
|
||||
if (_props.AutoDefaultLayouts)
|
||||
{
|
||||
SetLayout();
|
||||
}
|
||||
}
|
||||
|
||||
private string GetSharingStatus()
|
||||
@@ -2243,6 +2261,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts sharing HDMI source
|
||||
/// </summary>
|
||||
public override void StartSharing()
|
||||
{
|
||||
SendText("zCommand Call Sharing HDMI Start");
|
||||
@@ -2388,6 +2409,20 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
/// <param name="joinMap"></param>
|
||||
public void LinkZoomRoomToApi(BasicTriList trilist, ZoomRoomJoinMap joinMap)
|
||||
{
|
||||
var meetingInfoCodec = this as IHasMeetingInfo;
|
||||
if (meetingInfoCodec != null)
|
||||
{
|
||||
if (meetingInfoCodec.MeetingInfo != null)
|
||||
{
|
||||
trilist.SetBool(joinMap.MeetingCanRecord.JoinNumber, meetingInfoCodec.MeetingInfo.CanRecord);
|
||||
}
|
||||
|
||||
meetingInfoCodec.MeetingInfoChanged += (o, a) =>
|
||||
{
|
||||
trilist.SetBool(joinMap.MeetingCanRecord.JoinNumber, a.Info.CanRecord);
|
||||
};
|
||||
}
|
||||
|
||||
var recordingCodec = this as IHasMeetingRecordingWithPrompt;
|
||||
if (recordingCodec != null)
|
||||
{
|
||||
@@ -2502,13 +2537,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
//trilist.SetString(joinMap.CurrentSource.JoinNumber, args.Info.ShareStatus);
|
||||
};
|
||||
|
||||
trilist.SetSigTrueAction(joinMap.StartMeetingNow.JoinNumber, () => StartMeeting(0));
|
||||
trilist.SetSigTrueAction(joinMap.ShareOnlyMeeting.JoinNumber, StartSharingOnlyMeeting);
|
||||
trilist.SetSigTrueAction(joinMap.StartNormalMeetingFromSharingOnlyMeeting.JoinNumber, StartNormalMeetingFromSharingOnlyMeeting);
|
||||
trilist.SetSigFalseAction(joinMap.StartMeetingNow.JoinNumber, () => StartMeeting(0));
|
||||
trilist.SetSigFalseAction(joinMap.ShareOnlyMeeting.JoinNumber, StartSharingOnlyMeeting);
|
||||
trilist.SetSigFalseAction(joinMap.StartNormalMeetingFromSharingOnlyMeeting.JoinNumber, StartNormalMeetingFromSharingOnlyMeeting);
|
||||
|
||||
trilist.SetStringSigAction(joinMap.SubmitPassword.JoinNumber, SubmitPassword);
|
||||
//trilist.SetSigFalseAction(joinMap.CancelPasswordPrompt.JoinNumber, () =>
|
||||
// OnPasswordRequired(false, false, true, ""));
|
||||
|
||||
// Subscribe to call status to clear ShowPasswordPrompt when in meeting
|
||||
this.CallStatusChange += (o, a) =>
|
||||
@@ -2567,7 +2600,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
var wirelessInfoCodec = this as IZoomWirelessShareInstructions;
|
||||
if (wirelessInfoCodec != null)
|
||||
{
|
||||
SetSharingStateJoins(Status.Sharing, trilist, joinMap);
|
||||
if (Status != null && Status.Sharing != null)
|
||||
{
|
||||
SetSharingStateJoins(Status.Sharing, trilist, joinMap);
|
||||
}
|
||||
|
||||
wirelessInfoCodec.ShareInfoChanged += (o, a) =>
|
||||
{
|
||||
@@ -3264,7 +3300,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
// There is no property that directly reports if strip mode is valid, but API stipulates
|
||||
// that strip mode is available if the number of screens is 1
|
||||
if (Status.NumberOfScreens.NumOfScreens == 1)
|
||||
if (Status.NumberOfScreens.NumOfScreens == 1 || Status.Layout.can_Switch_Strip_View || Status.Layout.video_type.ToLower() == "strip")
|
||||
{
|
||||
availableLayouts |= zConfiguration.eLayoutStyle.Strip;
|
||||
}
|
||||
@@ -3279,10 +3315,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
var handler = LayoutInfoChanged;
|
||||
if (handler != null)
|
||||
{
|
||||
|
||||
var currentLayout = zConfiguration.eLayoutStyle.None;
|
||||
|
||||
currentLayout = (zConfiguration.eLayoutStyle)Enum.Parse(typeof(zConfiguration.eLayoutStyle), string.IsNullOrEmpty(LocalLayoutFeedback.StringValue) ? "None" : LocalLayoutFeedback.StringValue, true);
|
||||
|
||||
handler(this, new LayoutInfoChangedEventArgs()
|
||||
{
|
||||
AvailableLayouts = AvailableLayouts,
|
||||
CurrentSelectedLayout = (zConfiguration.eLayoutStyle)Enum.Parse(typeof(zConfiguration.eLayoutStyle),string.IsNullOrEmpty(LocalLayoutFeedback.StringValue) ? "None" : LocalLayoutFeedback.StringValue , true),
|
||||
CurrentSelectedLayout = currentLayout,
|
||||
LayoutViewIsOnFirstPage = LayoutViewIsOnFirstPageFeedback.BoolValue,
|
||||
LayoutViewIsOnLastPage = LayoutViewIsOnLastPageFeedback.BoolValue,
|
||||
CanSwapContentWithThumbnail = CanSwapContentWithThumbnailFeedback.BoolValue,
|
||||
@@ -3415,16 +3456,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
//OnPasswordRequired(false, false, true, "");
|
||||
}
|
||||
|
||||
public void CancelPasswordPrompt()
|
||||
{
|
||||
OnPasswordRequired(false, false, true, "Login Cancelled");
|
||||
}
|
||||
|
||||
void OnPasswordRequired(bool lastAttemptIncorrect, bool loginFailed, bool loginCancelled, string message)
|
||||
{
|
||||
var handler = PasswordRequired;
|
||||
if (handler != null)
|
||||
{
|
||||
if(!loginFailed || !loginCancelled)
|
||||
_meetingPasswordRequired = true;
|
||||
|
||||
handler(this, new PasswordPromptEventArgs(lastAttemptIncorrect, loginFailed, loginCancelled, message));
|
||||
}
|
||||
}
|
||||
@@ -3464,19 +3503,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
StartSharingOnlyMeeting(eSharingMeetingMode.None, 30, String.Empty);
|
||||
}
|
||||
|
||||
public void StartSharingOnlyMeeting(eSharingMeetingMode mode)
|
||||
public void StartSharingOnlyMeeting(eSharingMeetingMode displayMode)
|
||||
{
|
||||
StartSharingOnlyMeeting(mode, 30, String.Empty);
|
||||
StartSharingOnlyMeeting(displayMode, DefaultMeetingDurationMin, String.Empty);
|
||||
}
|
||||
|
||||
public void StartSharingOnlyMeeting(eSharingMeetingMode mode, ushort duration)
|
||||
public void StartSharingOnlyMeeting(eSharingMeetingMode displayMode, uint duration)
|
||||
{
|
||||
StartSharingOnlyMeeting(mode, duration, String.Empty);
|
||||
StartSharingOnlyMeeting(displayMode, duration, String.Empty);
|
||||
}
|
||||
|
||||
public void StartSharingOnlyMeeting(eSharingMeetingMode mode, ushort duration, string password)
|
||||
public void StartSharingOnlyMeeting(eSharingMeetingMode displayMode, uint duration, string password)
|
||||
{
|
||||
SendText(String.Format("zCommand Dial Sharing Duration: {0} DisplayState: {1} Password: {2}", duration, mode, password));
|
||||
SendText(String.Format("zCommand Dial Sharing Duration: {0} DisplayState: {1} Password: {2}", duration, displayMode, password));
|
||||
}
|
||||
|
||||
public void StartNormalMeetingFromSharingOnlyMeeting()
|
||||
@@ -3568,6 +3607,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
void OnShareInfoChanged(zStatus.Sharing status)
|
||||
{
|
||||
Debug.Console(2, this,
|
||||
@"ShareInfoChanged:
|
||||
isSharingHDMI: {0}
|
||||
isSharingAirplay: {1}
|
||||
AirplayPassword: {2}
|
||||
OSD Display State: {3}
|
||||
",
|
||||
status.isSharingBlackMagic,
|
||||
status.isAirHostClientConnected,
|
||||
status.password,
|
||||
status.dispState);
|
||||
|
||||
var handler = ShareInfoChanged;
|
||||
if (handler != null)
|
||||
{
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "FB Indicates the password prompt is active",
|
||||
Description = "Pulse to start an ad-hoc meeting with the default duration",
|
||||
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
@@ -373,6 +373,20 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("MeetingCanRecord")]
|
||||
public JoinDataComplete MeetingCanRecord = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 246,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "When high, indicated that the current meeting can be recorded",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
|
||||
#region Sharing Status
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
@@ -29,11 +30,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
/* This layout will be selected when Sharing starts (either from Far end or locally)*/
|
||||
[JsonProperty("defaultSharingLayout")]
|
||||
public string DefaultSharingLayout { get; set; }
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public zConfiguration.eLayoutStyle DefaultSharingLayout { get; set; }
|
||||
|
||||
//This layout will be selected when a call is connected and no content is being shared
|
||||
[JsonProperty("defaultCallLayout")]
|
||||
public string DefaultCallLayout { get; set; }
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public zConfiguration.eLayoutStyle DefaultCallLayout { get; set; }
|
||||
|
||||
[JsonProperty("minutesBeforeMeetingStart")]
|
||||
public int MinutesBeforeMeetingStart { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user