mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-31 13:25:00 +00:00
Compare commits
51 Commits
1.8.5-alph
...
1.9.2-beta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b19e2e38ad | ||
|
|
9a7fe553f9 | ||
|
|
895b76a0cd | ||
|
|
5c9996e728 | ||
|
|
0cc2328276 | ||
|
|
8fadfa98f2 | ||
|
|
1ccf54003f | ||
|
|
54769ce270 | ||
|
|
6b85323949 | ||
|
|
319d8f99c5 | ||
|
|
cc742f4291 | ||
|
|
6beff106ec | ||
|
|
cb35aa13f5 | ||
|
|
b71523bd2d | ||
|
|
0c56da112c | ||
|
|
08f4d8e9a2 | ||
|
|
25e7e9634a | ||
|
|
7ac3f81ea5 | ||
|
|
1c06e8381b | ||
|
|
f5305197b3 | ||
|
|
1805ebaf0f | ||
|
|
ca8207f2bd | ||
|
|
4e81859695 | ||
|
|
655bb954fa | ||
|
|
1ebacf3f0f | ||
|
|
7de0251188 | ||
|
|
492e593263 | ||
|
|
afe2046c81 | ||
|
|
98d3a4a2fa | ||
|
|
1702c69b73 | ||
|
|
722d28b1b3 | ||
|
|
ef7da0d7af | ||
|
|
77d8e63a31 | ||
|
|
d2d99d4bfa | ||
|
|
4bd71b04bf | ||
|
|
c5bcd89695 | ||
|
|
c7cc98bff7 | ||
|
|
db60f8f1be | ||
|
|
e82efdde2d | ||
|
|
d00c8bed5f | ||
|
|
a91af6bd75 | ||
|
|
2d36b80800 | ||
|
|
e152b9a504 | ||
|
|
eac7c91327 | ||
|
|
ac0d5e59a0 | ||
|
|
78be8ec5f2 | ||
|
|
5fc4ff6027 | ||
|
|
da179c01f5 | ||
|
|
0ded3e30f9 | ||
|
|
8d215930d9 | ||
|
|
685c344785 |
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.
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -385,7 +385,7 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public EiscApiAdvancedFactory()
|
||||
{
|
||||
TypeNames = new List<string> { "eiscapiadv", "eiscapiadvanced", "vceiscapiadv", "vceiscapiadvanced" };
|
||||
TypeNames = new List<string> { "eiscapiadv", "eiscapiadvanced", "eiscapiadvancedserver", "eiscapiadvancedclient", "vceiscapiadv", "vceiscapiadvanced" };
|
||||
}
|
||||
|
||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||
@@ -403,6 +403,16 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
controlProperties.TcpSshProperties.Address, Global.ControlSystem);
|
||||
return new EiscApiAdvanced(dc, eisc);
|
||||
}
|
||||
case "eiscapiadvancedserver":
|
||||
{
|
||||
var eisc = new EISCServer(controlProperties.IpIdInt, Global.ControlSystem);
|
||||
return new EiscApiAdvanced(dc, eisc);
|
||||
}
|
||||
case "eiscapiadvancedclient":
|
||||
{
|
||||
var eisc = new EISCClient(controlProperties.IpIdInt, controlProperties.TcpSshProperties.Address, Global.ControlSystem);
|
||||
return new EiscApiAdvanced(dc, eisc);
|
||||
}
|
||||
case "vceiscapiadv":
|
||||
case "vceiscapiadvanced":
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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,31 +48,65 @@ 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) => ConvertType(action.Params[i], p.ParameterType))
|
||||
.ToArray();
|
||||
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);}
|
||||
}
|
||||
|
||||
private static object ConvertType(object value, Type conversionType)
|
||||
{
|
||||
if (!conversionType.IsEnum)
|
||||
{
|
||||
return Convert.ChangeType(value, conversionType, System.Globalization.CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
var stringValue = Convert.ToString(value);
|
||||
|
||||
if (String.IsNullOrEmpty(stringValue))
|
||||
{
|
||||
throw new InvalidCastException(
|
||||
String.Format("{0} cannot be converted to a string prior to conversion to enum"));
|
||||
}
|
||||
return Enum.Parse(conversionType, stringValue, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the properties on a device
|
||||
/// </summary>
|
||||
@@ -242,6 +291,8 @@ namespace PepperDash.Essentials.Core
|
||||
//var props = t.GetProperties().Select(p => new PropertyNameType(p, obj));
|
||||
//return JsonConvert.SerializeObject(props, Formatting.Indented);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class DeviceActionWrapper
|
||||
|
||||
@@ -435,7 +435,7 @@ namespace PepperDash.Essentials.Core
|
||||
var min = Convert.ToUInt32(timeout);
|
||||
|
||||
device.StreamDebugging.SetDebuggingWithSpecificTimeout(debugSetting, min);
|
||||
Debug.Console(0, "Device: '{0}' debug level set to {1) for {2} minutes", deviceKey, debugSetting, min);
|
||||
Debug.Console(0, "Device: '{0}' debug level set to {1} for {2} minutes", deviceKey, debugSetting, min);
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -375,7 +375,7 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
try
|
||||
{
|
||||
if (typeof (IPluginDeviceFactory).IsAssignableFrom(type))
|
||||
if (typeof (IPluginDeviceFactory).IsAssignableFrom(type) && !type.IsAbstract)
|
||||
{
|
||||
var plugin =
|
||||
(IPluginDeviceFactory) Crestron.SimplSharp.Reflection.Activator.CreateInstance(type);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -122,6 +122,7 @@
|
||||
<Compile Include="Display\PanasonicThDisplay.cs" />
|
||||
<Compile Include="VideoCodec\Interfaces\IHasParticipants.cs" />
|
||||
<Compile Include="VideoCodec\Interfaces\IHasSelfviewPosition.cs" />
|
||||
<Compile Include="VideoCodec\Interfaces\IHasSelfviewSize.cs" />
|
||||
<Compile Include="VideoCodec\Interfaces\iVideoCodecInfo.cs" />
|
||||
<Compile Include="Codec\iHasCallFavorites.cs" />
|
||||
<Compile Include="Codec\iHasCallHistory.cs" />
|
||||
|
||||
@@ -27,8 +27,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
{
|
||||
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 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; }
|
||||
|
||||
|
||||
@@ -90,5 +90,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces
|
||||
public bool HandIsRaisedFb { get; set; }
|
||||
public bool IsPinnedFb { get; set; }
|
||||
public int ScreenIndexIsPinnedToFb { get; set; }
|
||||
|
||||
public Participant()
|
||||
{
|
||||
// Initialize to -1 (no screen)
|
||||
ScreenIndexIsPinnedToFb = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec.Cisco;
|
||||
|
||||
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||
{
|
||||
public interface IHasSelfviewSize
|
||||
{
|
||||
StringFeedback SelfviewPipSizeFeedback { get; }
|
||||
|
||||
void SelfviewPipSizeSet(CodecCommandWithLabel size);
|
||||
|
||||
void SelfviewPipSizeToggle();
|
||||
}
|
||||
}
|
||||
@@ -530,28 +530,43 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
|
||||
private void LinkVideoCodecParticipantsToApi(IHasParticipants codec, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
||||
{
|
||||
// make sure to update the values when the EISC comes online
|
||||
trilist.OnlineStatusChange += (sender, args) =>
|
||||
{
|
||||
if (sender.IsOnline)
|
||||
{
|
||||
UpdateParticipantsXSig(codec, trilist, joinMap);
|
||||
}
|
||||
};
|
||||
|
||||
// set actions and update the values when the list changes
|
||||
codec.Participants.ParticipantsListHasChanged += (sender, args) =>
|
||||
{
|
||||
string participantsXSig;
|
||||
|
||||
if (codec.Participants.CurrentParticipants.Count == 0)
|
||||
{
|
||||
participantsXSig = Encoding.GetEncoding(XSigEncoding).GetString(_clearBytes, 0, _clearBytes.Length);
|
||||
trilist.SetString(joinMap.CurrentParticipants.JoinNumber, participantsXSig);
|
||||
trilist.SetUshort(joinMap.ParticipantCount.JoinNumber, (ushort)codec.Participants.CurrentParticipants.Count);
|
||||
return;
|
||||
}
|
||||
|
||||
SetParticipantActions(trilist, joinMap, codec.Participants.CurrentParticipants);
|
||||
|
||||
participantsXSig = UpdateParticipantsXSig(codec.Participants.CurrentParticipants);
|
||||
|
||||
trilist.SetString(joinMap.CurrentParticipants.JoinNumber, participantsXSig);
|
||||
|
||||
trilist.SetUshort(joinMap.ParticipantCount.JoinNumber, (ushort)codec.Participants.CurrentParticipants.Count);
|
||||
UpdateParticipantsXSig(codec, trilist, joinMap);
|
||||
};
|
||||
}
|
||||
|
||||
private void UpdateParticipantsXSig(IHasParticipants codec, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
||||
{
|
||||
string participantsXSig;
|
||||
|
||||
if (codec.Participants.CurrentParticipants.Count == 0)
|
||||
{
|
||||
participantsXSig = Encoding.GetEncoding(XSigEncoding).GetString(_clearBytes, 0, _clearBytes.Length);
|
||||
trilist.SetString(joinMap.CurrentParticipants.JoinNumber, participantsXSig);
|
||||
trilist.SetUshort(joinMap.ParticipantCount.JoinNumber, (ushort)codec.Participants.CurrentParticipants.Count);
|
||||
return;
|
||||
}
|
||||
|
||||
participantsXSig = UpdateParticipantsXSig(codec.Participants.CurrentParticipants);
|
||||
|
||||
trilist.SetString(joinMap.CurrentParticipants.JoinNumber, participantsXSig);
|
||||
|
||||
trilist.SetUshort(joinMap.ParticipantCount.JoinNumber, (ushort)codec.Participants.CurrentParticipants.Count);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the actions for each participant in the list
|
||||
/// </summary>
|
||||
@@ -613,6 +628,39 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
{
|
||||
if (meetingIndex >= maxParticipants * offset) break;
|
||||
|
||||
Debug.Console(2, this,
|
||||
@"Updating Participant on xsig:
|
||||
Name: {0} (s{9})
|
||||
AudioMute: {1} (d{10})
|
||||
VideoMute: {2} (d{11})
|
||||
CanMuteVideo: {3} (d{12})
|
||||
CanUMuteVideo: {4} (d{13})
|
||||
IsHost: {5} (d{14})
|
||||
HandIsRaised: {6} (d{15})
|
||||
IsPinned: {7} (d{16})
|
||||
ScreenIndexIsPinnedTo: {8} (a{17})
|
||||
",
|
||||
participant.Name,
|
||||
participant.AudioMuteFb,
|
||||
participant.VideoMuteFb,
|
||||
participant.CanMuteVideo,
|
||||
participant.CanUnmuteVideo,
|
||||
participant.IsHost,
|
||||
participant.HandIsRaisedFb,
|
||||
participant.IsPinnedFb,
|
||||
participant.ScreenIndexIsPinnedToFb,
|
||||
stringIndex + 1,
|
||||
digitalIndex + 1,
|
||||
digitalIndex + 2,
|
||||
digitalIndex + 3,
|
||||
digitalIndex + 4,
|
||||
digitalIndex + 5,
|
||||
digitalIndex + 6,
|
||||
digitalIndex + 7,
|
||||
analogIndex + 1
|
||||
);
|
||||
|
||||
|
||||
//digitals
|
||||
tokenArray[digitalIndex] = new XSigDigitalToken(digitalIndex + 1, participant.AudioMuteFb);
|
||||
tokenArray[digitalIndex + 1] = new XSigDigitalToken(digitalIndex + 2, participant.VideoMuteFb);
|
||||
@@ -622,6 +670,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
tokenArray[digitalIndex + 5] = new XSigDigitalToken(digitalIndex + 6, participant.HandIsRaisedFb);
|
||||
tokenArray[digitalIndex + 6] = new XSigDigitalToken(digitalIndex + 7, participant.IsPinnedFb);
|
||||
|
||||
Debug.Console(2, this, "Index: {0} byte value: {1}", digitalIndex + 7, ComTextHelper.GetEscapedText(tokenArray[digitalIndex + 6].GetBytes()));
|
||||
|
||||
//serials
|
||||
tokenArray[stringIndex] = new XSigSerialToken(stringIndex + 1, participant.Name);
|
||||
|
||||
@@ -657,7 +707,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
analogIndex += maxAnalogs;
|
||||
}
|
||||
|
||||
return GetXSigString(tokenArray);
|
||||
var returnString = GetXSigString(tokenArray);
|
||||
|
||||
//Debug.Console(2, this, "{0}", ComTextHelper.GetEscapedText(Encoding.GetEncoding(28591).GetBytes(returnString)));
|
||||
|
||||
|
||||
return returnString;
|
||||
}
|
||||
|
||||
private void LinkVideoCodecContentSharingToApi(BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
||||
@@ -673,7 +728,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)
|
||||
@@ -685,7 +739,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;
|
||||
@@ -695,7 +748,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;
|
||||
@@ -705,7 +758,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;
|
||||
@@ -730,14 +783,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);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
public class ZoomRoom : VideoCodecBase, IHasCodecSelfView, IHasDirectoryHistoryStack, ICommunicationMonitor,
|
||||
IRouting,
|
||||
IHasScheduleAwareness, IHasCodecCameras, IHasParticipants, IHasCameraOff, IHasCameraMute, IHasCameraAutoMode,
|
||||
IHasFarEndContentStatus, IHasSelfviewPosition, IHasPhoneDialing, IHasZoomRoomLayouts, IHasParticipantPinUnpin, IHasParticipantAudioMute
|
||||
IHasFarEndContentStatus, IHasSelfviewPosition, IHasPhoneDialing, IHasZoomRoomLayouts, IHasParticipantPinUnpin, IHasParticipantAudioMute, IHasSelfviewSize
|
||||
{
|
||||
private const long MeetingRefreshTimer = 60000;
|
||||
private const uint DefaultMeetingDurationMin = 30;
|
||||
@@ -109,6 +109,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
SelfviewPipPositionFeedback = new StringFeedback(SelfviewPipPositionFeedbackFunc);
|
||||
|
||||
// TODO: #714 [ ] SelfviewPipSizeFeedback
|
||||
SelfviewPipSizeFeedback = new StringFeedback(SelfviewPipSizeFeedbackFunc);
|
||||
|
||||
SetUpFeedbackActions();
|
||||
|
||||
Cameras = new List<CameraBase>();
|
||||
@@ -228,6 +231,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: #714 [ ] SelfviewPipSizeFeedbackFunc
|
||||
protected Func<string> SelfviewPipSizeFeedbackFunc
|
||||
{
|
||||
get
|
||||
{
|
||||
return
|
||||
() =>
|
||||
_currentSelfviewPipSize != null
|
||||
? _currentSelfviewPipSize.Command ?? "Unknown"
|
||||
: "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
protected Func<bool> LocalLayoutIsProminentFeedbackFunc
|
||||
{
|
||||
get { return () => false; }
|
||||
@@ -495,7 +511,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
{
|
||||
case "Position":
|
||||
{
|
||||
ComputeSelfviewPipStatus();
|
||||
ComputeSelfviewPipPositionStatus();
|
||||
|
||||
SelfviewPipPositionFeedback.FireUpdate();
|
||||
|
||||
@@ -511,6 +527,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
LocalLayoutFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
case "Size":
|
||||
{
|
||||
// TODO: #714 [ ] SetupFeedbackActions >> Size
|
||||
ComputeSelfviewPipSizeStatus();
|
||||
|
||||
SelfviewPipSizeFeedback.FireUpdate();
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
@@ -522,7 +547,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
{
|
||||
case "Position":
|
||||
{
|
||||
ComputeSelfviewPipStatus();
|
||||
ComputeSelfviewPipPositionStatus();
|
||||
|
||||
SelfviewPipPositionFeedback.FireUpdate();
|
||||
|
||||
@@ -596,21 +621,22 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
Status.Layout.PropertyChanged += (o, a) =>
|
||||
{
|
||||
switch (a.PropertyName)
|
||||
Debug.Console(1, this, "Status.Layout.PropertyChanged a.PropertyName: {0}", a.PropertyName);
|
||||
switch (a.PropertyName.ToLower())
|
||||
{
|
||||
case "can_Switch_Speaker_View":
|
||||
case "can_Switch_Wall_View":
|
||||
case "can_Switch_Share_On_All_Screens":
|
||||
case "can_switch_speaker_view":
|
||||
case "can_switch_wall_view":
|
||||
case "can_switch_share_on_all_screens":
|
||||
{
|
||||
ComputeAvailableLayouts();
|
||||
break;
|
||||
}
|
||||
case "is_In_First_Page":
|
||||
case "is_in_first_page":
|
||||
{
|
||||
LayoutViewIsOnFirstPageFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
case "is_In_Last_Page":
|
||||
case "is_in_last_page":
|
||||
{
|
||||
LayoutViewIsOnLastPageFeedback.FireUpdate();
|
||||
break;
|
||||
@@ -870,7 +896,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
_jsonCurlyBraceCounter--;
|
||||
}
|
||||
|
||||
Debug.Console(2, this, "JSON Curly Brace Count: {0}", _jsonCurlyBraceCounter);
|
||||
//Debug.Console(2, this, "JSON Curly Brace Count: {0}", _jsonCurlyBraceCounter);
|
||||
|
||||
if (!_jsonFeedbackMessageIsIncoming && message.Trim('\x20') == "{" + Delimiter)
|
||||
// Check for the beginning of a new JSON message
|
||||
@@ -1319,6 +1345,25 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
{
|
||||
var status = responseObj.ToObject<zEvent.PinStatusOfScreenNotification>();
|
||||
|
||||
Debug.Console(1, this, "Pin Status notification for UserId: {0}, ScreenIndex: {1}", status.PinnedUserId, status.ScreenIndex);
|
||||
|
||||
Participant alreadyPinnedParticipant = null;
|
||||
|
||||
// Check for a participant already pinned to the same screen index.
|
||||
if (status.PinnedUserId > 0)
|
||||
{
|
||||
alreadyPinnedParticipant = Participants.CurrentParticipants.FirstOrDefault(p => p.ScreenIndexIsPinnedToFb.Equals(status.ScreenIndex));
|
||||
|
||||
// Make sure that the already pinned participant isn't the same ID as for this message. If true, clear the pinned fb.
|
||||
if (alreadyPinnedParticipant != null && alreadyPinnedParticipant.UserId != status.PinnedUserId)
|
||||
{
|
||||
Debug.Console(1, this, "Participant: {0} with id: {1} already pinned to screenIndex {2}. Clearing pinned fb.",
|
||||
alreadyPinnedParticipant.Name, alreadyPinnedParticipant.UserId, alreadyPinnedParticipant.ScreenIndexIsPinnedToFb);
|
||||
alreadyPinnedParticipant.IsPinnedFb = false;
|
||||
alreadyPinnedParticipant.ScreenIndexIsPinnedToFb = -1;
|
||||
}
|
||||
}
|
||||
|
||||
var participant = Participants.CurrentParticipants.FirstOrDefault(p => p.UserId.Equals(status.PinnedUserId));
|
||||
|
||||
if (participant != null)
|
||||
@@ -1330,13 +1375,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
{
|
||||
participant = Participants.CurrentParticipants.FirstOrDefault(p => p.ScreenIndexIsPinnedToFb.Equals(status.ScreenIndex));
|
||||
|
||||
if (participant == null)
|
||||
if (participant == null && alreadyPinnedParticipant == null)
|
||||
{
|
||||
Debug.Console(2, this, "no matching participant found by pinned_user_id: {0} or screen_index: {1}", status.PinnedUserId, status.ScreenIndex);
|
||||
Debug.Console(1, this, "no matching participant found by pinned_user_id: {0} or screen_index: {1}", status.PinnedUserId, status.ScreenIndex);
|
||||
return;
|
||||
}
|
||||
else
|
||||
else if (participant != null)
|
||||
{
|
||||
Debug.Console(2, this, "Unpinning {0} with id: {1} from screen index: {2}", participant.Name, participant.UserId, status.ScreenIndex);
|
||||
participant.IsPinnedFb = false;
|
||||
participant.ScreenIndexIsPinnedToFb = -1;
|
||||
}
|
||||
@@ -1483,7 +1529,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Console(1, this, "****************************Call Participants***************************");
|
||||
Debug.Console(1, this, "*************************** Call Participants **************************");
|
||||
foreach (var participant in Participants.CurrentParticipants)
|
||||
{
|
||||
Debug.Console(1, this, "Name: {0} Audio: {1} IsHost: {2}", participant.Name,
|
||||
@@ -1570,7 +1616,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Console(1, this, "****************************Active Calls*********************************");
|
||||
Debug.Console(1, this, "*************************** Active Calls ********************************");
|
||||
|
||||
// Clean up any disconnected calls left in the list
|
||||
for (int i = 0; i < ActiveCalls.Count; i++)
|
||||
@@ -1586,7 +1632,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
if (!call.IsActiveCall)
|
||||
{
|
||||
Debug.Console(1, this, "******Removing Inactive Call: {0}******", call.Name);
|
||||
Debug.Console(1, this, "***** Removing Inactive Call: {0} *****", call.Name);
|
||||
ActiveCalls.Remove(call);
|
||||
}
|
||||
}
|
||||
@@ -1741,7 +1787,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
LinkVideoCodecToApi(this, trilist, joinMap);
|
||||
|
||||
LinkZoomRoomToApi(trilist, joinMap);
|
||||
LinkZoomRoomToApi(trilist, joinMap);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1771,9 +1817,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
trilist.SetString(joinMap.LayoutStripIsAvailable.JoinNumber, zConfiguration.eLayoutStyle.Strip.ToString());
|
||||
trilist.SetString(joinMap.LayoutShareAllIsAvailable.JoinNumber, zConfiguration.eLayoutStyle.ShareAll.ToString());
|
||||
};
|
||||
|
||||
trilist.SetSigFalseAction(joinMap.SwapContentWithThumbnail.JoinNumber, () => layoutsCodec.SwapContentWithThumbnail());
|
||||
|
||||
layoutsCodec.CanSwapContentWithThumbnailFeedback.LinkInputSig(trilist.BooleanInput[joinMap.CanSwapContentWithThumbnail.JoinNumber]);
|
||||
trilist.SetSigFalseAction(joinMap.SwapContentWithThumbnail.JoinNumber, () => layoutsCodec.SwapContentWithThumbnail());
|
||||
layoutsCodec.ContentSwappedWithThumbnailFeedback.LinkInputSig(trilist.BooleanInput[joinMap.SwapContentWithThumbnail.JoinNumber]);
|
||||
|
||||
layoutsCodec.LayoutViewIsOnFirstPageFeedback.LinkInputSig(trilist.BooleanInput[joinMap.LayoutIsOnFirstPage.JoinNumber]);
|
||||
@@ -1795,7 +1842,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
}
|
||||
});
|
||||
|
||||
layoutsCodec.LocalLayoutFeedback.LinkInputSig(trilist.StringInput[joinMap.GetSetCurrentLayout.JoinNumber]);
|
||||
layoutsCodec.LocalLayoutFeedback.LinkInputSig(trilist.StringInput[joinMap.GetSetCurrentLayout.JoinNumber]);
|
||||
}
|
||||
|
||||
var pinCodec = this as IHasParticipantPinUnpin;
|
||||
@@ -1806,7 +1853,43 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
// Set the value of the local property to be used when pinning a participant
|
||||
trilist.SetUShortSigAction(joinMap.ScreenIndexToPinUserTo.JoinNumber, (u) => ScreenIndexToPinUserTo = u);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: #714 [ ] LinkZoomRoomToApi >> layoutSizeCoodec
|
||||
var layoutSizeCodec = this as IHasSelfviewSize;
|
||||
if (layoutSizeCodec != null)
|
||||
{
|
||||
trilist.SetSigFalseAction(joinMap.GetSetSelfviewPipSize.JoinNumber, layoutSizeCodec.SelfviewPipSizeToggle);
|
||||
trilist.SetStringSigAction(joinMap.GetSetSelfviewPipSize.JoinNumber, (s) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var size = (zConfiguration.eLayoutSize)Enum.Parse(typeof(zConfiguration.eLayoutSize), s, true);
|
||||
var cmd = SelfviewPipSizes.FirstOrDefault(c => c.Command.Equals(size.ToString()));
|
||||
SelfviewPipSizeSet(cmd);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(1, this, "Unable to parse '{0}' to zConfiguration.eLayoutSize: {1}", s, e);
|
||||
}
|
||||
});
|
||||
|
||||
layoutSizeCodec.SelfviewPipSizeFeedback.LinkInputSig(trilist.StringInput[joinMap.GetSetSelfviewPipSize.JoinNumber]);
|
||||
}
|
||||
|
||||
trilist.OnlineStatusChange += (device, args) =>
|
||||
{
|
||||
if (!args.DeviceOnLine) return;
|
||||
|
||||
ComputeAvailableLayouts();
|
||||
layoutsCodec.LocalLayoutFeedback.FireUpdate();
|
||||
layoutsCodec.CanSwapContentWithThumbnailFeedback.FireUpdate();
|
||||
layoutsCodec.ContentSwappedWithThumbnailFeedback.FireUpdate();
|
||||
layoutsCodec.LayoutViewIsOnFirstPageFeedback.FireUpdate();
|
||||
layoutsCodec.LayoutViewIsOnLastPageFeedback.FireUpdate();
|
||||
pinCodec.NumberOfScreensFeedback.FireUpdate();
|
||||
layoutSizeCodec.SelfviewPipSizeFeedback.FireUpdate();
|
||||
};
|
||||
}
|
||||
|
||||
public override void ExecuteSwitch(object selector)
|
||||
{
|
||||
@@ -2177,13 +2260,58 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
new CodecCommandWithLabel("DownLeft", "Lower Left")
|
||||
};
|
||||
|
||||
private void ComputeSelfviewPipStatus()
|
||||
private void ComputeSelfviewPipPositionStatus()
|
||||
{
|
||||
_currentSelfviewPipPosition =
|
||||
SelfviewPipPositions.FirstOrDefault(
|
||||
p => p.Command.ToLower().Equals(Configuration.Call.Layout.Position.ToString().ToLower()));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// TODO: #714 [ ] Implementation of IHasSelfviewPipSize
|
||||
#region Implementation of IHasSelfviewPipSize
|
||||
|
||||
private CodecCommandWithLabel _currentSelfviewPipSize;
|
||||
|
||||
public StringFeedback SelfviewPipSizeFeedback { get; private set; }
|
||||
|
||||
public void SelfviewPipSizeSet(CodecCommandWithLabel size)
|
||||
{
|
||||
SendText(String.Format("zConfiguration Call Layout Size: {0}", size.Command));
|
||||
}
|
||||
|
||||
public void SelfviewPipSizeToggle()
|
||||
{
|
||||
if (_currentSelfviewPipSize != null)
|
||||
{
|
||||
var nextPipSizeIndex = SelfviewPipSizes.IndexOf(_currentSelfviewPipSize) + 1;
|
||||
|
||||
if (nextPipSizeIndex >= SelfviewPipSizes.Count)
|
||||
// Check if we need to loop back to the first item in the list
|
||||
nextPipSizeIndex = 0;
|
||||
|
||||
SelfviewPipSizeSet(SelfviewPipSizes[nextPipSizeIndex]);
|
||||
}
|
||||
}
|
||||
|
||||
public List<CodecCommandWithLabel> SelfviewPipSizes = new List<CodecCommandWithLabel>()
|
||||
{
|
||||
new CodecCommandWithLabel("Off", "Off"),
|
||||
new CodecCommandWithLabel("Size1", "Size 1"),
|
||||
new CodecCommandWithLabel("Size2", "Size 2"),
|
||||
new CodecCommandWithLabel("Size3", "Size 3"),
|
||||
new CodecCommandWithLabel("Strip", "Strip")
|
||||
};
|
||||
|
||||
private void ComputeSelfviewPipSizeStatus()
|
||||
{
|
||||
_currentSelfviewPipSize =
|
||||
SelfviewPipSizes.FirstOrDefault(
|
||||
p => p.Command.ToLower().Equals(Configuration.Call.Layout.Size.ToString().ToLower()));
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Implementation of IHasPhoneDialing
|
||||
@@ -2240,9 +2368,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
/// </summary>
|
||||
private void ComputeAvailableLayouts()
|
||||
{
|
||||
Debug.Console(1, this, "Computing available layouts...");
|
||||
zConfiguration.eLayoutStyle availableLayouts = zConfiguration.eLayoutStyle.None;
|
||||
// TODO: #697 [ ] Compute the avaialble layouts and set the value of AvailableLayouts
|
||||
// Will need to test and confirm that this logic evaluates correctly
|
||||
if (Status.Layout.can_Switch_Wall_View)
|
||||
{
|
||||
availableLayouts |= zConfiguration.eLayoutStyle.Gallery;
|
||||
@@ -2265,6 +2392,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
availableLayouts |= zConfiguration.eLayoutStyle.Strip;
|
||||
}
|
||||
|
||||
Debug.Console(1, this, "availablelayouts: {0}", availableLayouts);
|
||||
|
||||
var handler = AvailableLayoutsChanged;
|
||||
if (handler != null)
|
||||
{
|
||||
@@ -2290,7 +2419,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
if (CanSwapContentWithThumbnailFeedback.BoolValue)
|
||||
{
|
||||
var oppositeValue = ContentSwappedWithThumbnailFeedback.BoolValue ? "on" : "off"; // Get the value based on the opposite of the current state
|
||||
// TODO: #697 [ ] Need to verify the ternary above and make sure that the correct on/off value is being send based on the true/false value of the feedback
|
||||
// TODO: #697 [*] Need to verify the ternary above and make sure that the correct on/off value is being send based on the true/false value of the feedback
|
||||
// to toggle the state
|
||||
SendText(String.Format("zConfiguration Call Layout ShareThumb: {0}", oppositeValue));
|
||||
}
|
||||
@@ -2339,7 +2468,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
public void MinMaxLayoutToggle()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -6,8 +6,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
{
|
||||
public class ZoomRoomJoinMap : VideoCodecControllerJoinMap
|
||||
{
|
||||
// TODO: #697 [X] Set join numbers
|
||||
|
||||
#region Digital
|
||||
|
||||
[JoinName("CanSwapContentWithThumbnail")]
|
||||
@@ -162,7 +160,22 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
Description = "FB Indicates if layout 'ShareAll' is available",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.DigitalSerial
|
||||
});
|
||||
});
|
||||
|
||||
// TODO: #714 [ ] JoinMap >> SelfivewPipSizeToggle
|
||||
[JoinName("SelfviewPipSizeToggle")]
|
||||
public JoinDataComplete SelfviewPipSizeToggle = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 231,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Toggles the selfview pip size, (aka layout size)",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
//[JoinName("ParticipantAudioMuteToggleStart")]
|
||||
//public JoinDataComplete ParticipantAudioMuteToggleStart = new JoinDataComplete(
|
||||
@@ -256,7 +269,22 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
Description = "Sets and reports the current layout. Use the LayoutXXXXIsAvailable signals to determine valid layouts",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Serial
|
||||
});
|
||||
});
|
||||
|
||||
// TODO: #714 [ ] JoinMap >> GetSetSelfviewPipSize
|
||||
[JoinName("GetSetSelfviewPipSize")]
|
||||
public JoinDataComplete GetSetSelfviewPipSize = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 230,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sets and reports the selfview pip size, (aka layout size).",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.DigitalSerial
|
||||
});
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<packages>
|
||||
<package id="PepperDashCore" version="1.0.45" targetFramework="net35" allowedVersions="[1.0,1.1)"/>
|
||||
<package id="PepperDashCore" version="1.0.47" targetFramework="net35" allowedVersions="[1.0,1.1)"/>
|
||||
</packages>
|
||||
Reference in New Issue
Block a user