mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 04:34:56 +00:00
Merge 40151c5f8f into 4210df693a
This commit is contained in:
@@ -483,7 +483,7 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
|
||||||
|
|
||||||
CreateMobileControlBridge(room);
|
CreateMobileControlBridge(room as EssentialsRoomBase);
|
||||||
}
|
}
|
||||||
else if (room is IEssentialsHuddleVtc1Room)
|
else if (room is IEssentialsHuddleVtc1Room)
|
||||||
{
|
{
|
||||||
@@ -494,7 +494,7 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
|
||||||
|
|
||||||
CreateMobileControlBridge(room);
|
CreateMobileControlBridge(room as EssentialsRoomBase);
|
||||||
}
|
}
|
||||||
else if (room is EssentialsTechRoom)
|
else if (room is EssentialsTechRoom)
|
||||||
{
|
{
|
||||||
@@ -506,7 +506,7 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge");
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge");
|
||||||
|
|
||||||
CreateMobileControlBridge(room);
|
CreateMobileControlBridge(room as EssentialsRoomBase);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -527,7 +527,7 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void CreateMobileControlBridge(IEssentialsRoom room)
|
private static void CreateMobileControlBridge(EssentialsRoomBase room)
|
||||||
{
|
{
|
||||||
var mobileControl = GetMobileControlDevice();
|
var mobileControl = GetMobileControlDevice();
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ namespace PepperDash.Essentials
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 1202
|
/// 1202
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const uint VCStagingInactivePopoverVisible = 1202;
|
public const uint VCStagingInactivePopoverWithRecentsVisible = 1202;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -121,6 +121,11 @@ namespace PepperDash.Essentials
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public const uint VCRecentsVisible = 1206;
|
public const uint VCRecentsVisible = 1206;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 1202
|
||||||
|
/// </summary>
|
||||||
|
public const uint VCStagingInactivePopoverWithoutRecentsVisible = 1207;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 1208
|
/// 1208
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -243,6 +248,10 @@ namespace PepperDash.Essentials
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public const uint VCCameraSelectBarWithoutModeVisible = 1261;
|
public const uint VCCameraSelectBarWithoutModeVisible = 1261;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 1262
|
||||||
|
/// </summary>
|
||||||
|
public const uint VCCameraAutoModeIsOnFb = 1262;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 1271
|
/// 1271
|
||||||
|
|||||||
@@ -142,7 +142,10 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
VCControlsInterlock.SetButDontShow(UIBoolJoin.VCKeypadVisible);
|
VCControlsInterlock.SetButDontShow(UIBoolJoin.VCKeypadVisible);
|
||||||
|
|
||||||
StagingBarsInterlock = new JoinedSigInterlock(triList);
|
StagingBarsInterlock = new JoinedSigInterlock(triList);
|
||||||
StagingBarsInterlock.SetButDontShow(UIBoolJoin.VCStagingInactivePopoverVisible);
|
if(Codec is IHasCallHistory)
|
||||||
|
StagingBarsInterlock.SetButDontShow(UIBoolJoin.VCStagingInactivePopoverWithRecentsVisible);
|
||||||
|
else
|
||||||
|
StagingBarsInterlock.SetButDontShow(UIBoolJoin.VCStagingInactivePopoverWithoutRecentsVisible);
|
||||||
|
|
||||||
StagingButtonsFeedbackInterlock = new JoinedSigInterlock(triList);
|
StagingButtonsFeedbackInterlock = new JoinedSigInterlock(triList);
|
||||||
StagingButtonsFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingKeypadPress);
|
StagingButtonsFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingKeypadPress);
|
||||||
@@ -351,10 +354,15 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
TriList.UShortInput[UIUshortJoin.VCStagingConnectButtonMode].UShortValue = (ushort)(Codec.IsInCall ? 1 : 0);
|
TriList.UShortInput[UIUshortJoin.VCStagingConnectButtonMode].UShortValue = (ushort)(Codec.IsInCall ? 1 : 0);
|
||||||
|
|
||||||
uint stageJoin;
|
uint stageJoin;
|
||||||
if (Codec.IsInCall)
|
if (Codec.IsInCall)
|
||||||
stageJoin = UIBoolJoin.VCStagingActivePopoverVisible;
|
stageJoin = UIBoolJoin.VCStagingActivePopoverVisible;
|
||||||
else
|
else
|
||||||
stageJoin = UIBoolJoin.VCStagingInactivePopoverVisible;
|
{
|
||||||
|
if (Codec is IHasCallHistory)
|
||||||
|
stageJoin = UIBoolJoin.VCStagingInactivePopoverWithRecentsVisible;
|
||||||
|
else
|
||||||
|
stageJoin = UIBoolJoin.VCStagingInactivePopoverWithoutRecentsVisible;
|
||||||
|
}
|
||||||
if (IsVisible)
|
if (IsVisible)
|
||||||
StagingBarsInterlock.ShowInterlocked(stageJoin);
|
StagingBarsInterlock.ShowInterlocked(stageJoin);
|
||||||
else
|
else
|
||||||
@@ -513,13 +521,18 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
|
|
||||||
var codecOffCameras = Codec as IHasCameraOff;
|
var codecOffCameras = Codec as IHasCameraOff;
|
||||||
|
|
||||||
|
var supportsCameraOffMode = Codec.SupportsCameraOff;
|
||||||
|
|
||||||
var codecAutoCameras = Codec as IHasCameraAutoMode;
|
var codecAutoCameras = Codec as IHasCameraAutoMode;
|
||||||
|
|
||||||
if (codecAutoCameras != null)
|
var supportsAutoCameraMode = Codec.SupportsCameraAutoMode;
|
||||||
|
|
||||||
|
if (codecAutoCameras != null && supportsAutoCameraMode)
|
||||||
{
|
{
|
||||||
CameraModeList.SetItemButtonAction(1,(b) => codecAutoCameras.CameraAutoModeOn());
|
CameraModeList.SetItemButtonAction(1,(b) => codecAutoCameras.CameraAutoModeOn());
|
||||||
TriList.SmartObjects[UISmartObjectJoin.VCCameraMode].BooleanInput["Item 1 Visible"].BoolValue = true;
|
TriList.SmartObjects[UISmartObjectJoin.VCCameraMode].BooleanInput["Item 1 Visible"].BoolValue = true;
|
||||||
codecAutoCameras.CameraAutoModeIsOnFeedback.LinkInputSig(CameraModeList.SmartObject.BooleanInput["Item 1 Selected"]);
|
codecAutoCameras.CameraAutoModeIsOnFeedback.LinkInputSig(CameraModeList.SmartObject.BooleanInput["Item 1 Selected"]);
|
||||||
|
codecAutoCameras.CameraAutoModeIsOnFeedback.LinkInputSig(TriList.BooleanInput[UIBoolJoin.VCCameraAutoModeIsOnFb]);
|
||||||
//TriList.SmartObjects[UISmartObjectJoin.VCCameraMode].BooleanOutput["Item 1 Pressed"].SetSigFalseAction(
|
//TriList.SmartObjects[UISmartObjectJoin.VCCameraMode].BooleanOutput["Item 1 Pressed"].SetSigFalseAction(
|
||||||
//() => codecAutoCameras.CameraAutoModeOn());
|
//() => codecAutoCameras.CameraAutoModeOn());
|
||||||
|
|
||||||
@@ -554,7 +567,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
//TriList.SmartObjects[UISmartObjectJoin.VCCameraMode].BooleanOutput["Item 2 Pressed"].SetSigFalseAction(
|
//TriList.SmartObjects[UISmartObjectJoin.VCCameraMode].BooleanOutput["Item 2 Pressed"].SetSigFalseAction(
|
||||||
// () => ShowCameraManualMode());
|
// () => ShowCameraManualMode());
|
||||||
|
|
||||||
if (codecOffCameras != null)
|
if (codecOffCameras != null && supportsCameraOffMode)
|
||||||
{
|
{
|
||||||
TriList.SmartObjects[UISmartObjectJoin.VCCameraMode].BooleanInput["Item 3 Visible"].BoolValue = true;
|
TriList.SmartObjects[UISmartObjectJoin.VCCameraMode].BooleanInput["Item 3 Visible"].BoolValue = true;
|
||||||
codecOffCameras.CameraIsOffFeedback.LinkInputSig(CameraModeList.SmartObject.BooleanInput["Item 3 Selected"]);
|
codecOffCameras.CameraIsOffFeedback.LinkInputSig(CameraModeList.SmartObject.BooleanInput["Item 3 Selected"]);
|
||||||
@@ -845,19 +858,32 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
// Determines if codec is in manual camera control mode and shows feedback
|
// Determines if codec is in manual camera control mode and shows feedback
|
||||||
void ShowCameraManualMode()
|
void ShowCameraManualMode()
|
||||||
{
|
{
|
||||||
|
Debug.Console(2, "ShowCameraManualMode");
|
||||||
|
|
||||||
var inManualMode = true;
|
var inManualMode = true;
|
||||||
|
|
||||||
var codecOffCameras = Codec as IHasCameraOff;
|
var codecOffCameras = Codec as IHasCameraOff;
|
||||||
|
|
||||||
var codecAutoCameras = Codec as IHasCameraAutoMode;
|
var codecAutoCameras = Codec as IHasCameraAutoMode;
|
||||||
|
|
||||||
|
var supportsAutoCameras = codecAutoCameras != null && Codec.SupportsCameraAutoMode;
|
||||||
|
|
||||||
if (codecOffCameras != null && codecOffCameras.CameraIsOffFeedback.BoolValue)
|
if (codecOffCameras != null && codecOffCameras.CameraIsOffFeedback.BoolValue)
|
||||||
{
|
{
|
||||||
inManualMode = false;
|
inManualMode = false;
|
||||||
|
|
||||||
|
var codecCameraMute = Codec as IHasCameraMute;
|
||||||
|
|
||||||
|
if (codecCameraMute != null)
|
||||||
|
{
|
||||||
|
codecCameraMute.CameraMuteOff();
|
||||||
|
inManualMode = true;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear auto mode
|
// Clear auto mode
|
||||||
if (codecAutoCameras != null )
|
if (supportsAutoCameras)
|
||||||
{
|
{
|
||||||
if (codecAutoCameras.CameraAutoModeIsOnFeedback.BoolValue)
|
if (codecAutoCameras.CameraAutoModeIsOnFeedback.BoolValue)
|
||||||
{
|
{
|
||||||
@@ -1201,7 +1227,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
var lc = Codec as IHasCodecLayouts;
|
var lc = Codec as IHasCodecLayouts;
|
||||||
if (lc != null)
|
if (lc != null)
|
||||||
{
|
{
|
||||||
TriList.SetSigFalseAction(UIBoolJoin.VCLayoutTogglePress, lc.LocalLayoutToggleSingleProminent);
|
|
||||||
lc.LocalLayoutFeedback.LinkInputSig(TriList.StringInput[UIStringJoin.VCLayoutModeText]);
|
lc.LocalLayoutFeedback.LinkInputSig(TriList.StringInput[UIStringJoin.VCLayoutModeText]);
|
||||||
lc.LocalLayoutFeedback.OutputChange += (o,a) =>
|
lc.LocalLayoutFeedback.OutputChange += (o,a) =>
|
||||||
{
|
{
|
||||||
@@ -1214,14 +1240,24 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
var cisco = Codec as PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoSparkCodec;
|
var cisco = Codec as PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoSparkCodec;
|
||||||
if (cisco != null)
|
if (cisco != null)
|
||||||
{
|
{
|
||||||
|
TriList.SetSigFalseAction(UIBoolJoin.VCLayoutTogglePress, lc.LocalLayoutToggleSingleProminent);
|
||||||
// Cisco has min/max buttons that need special sauce
|
// Cisco has min/max buttons that need special sauce
|
||||||
cisco.SharingContentIsOnFeedback.OutputChange += CiscoSharingAndPresentation_OutputChanges;
|
cisco.SharingContentIsOnFeedback.OutputChange += CiscoSharingAndPresentation_OutputChanges;
|
||||||
//cisco.PresentationViewMaximizedFeedback.OutputChange += CiscoSharingAndPresentation_OutputChanges;
|
//cisco.PresentationViewMaximizedFeedback.OutputChange += CiscoSharingAndPresentation_OutputChanges;
|
||||||
|
|
||||||
TriList.SetSigFalseAction(UIBoolJoin.VCMinMaxPress, cisco.MinMaxLayoutToggle);
|
TriList.SetSigFalseAction(UIBoolJoin.VCMinMaxPress, cisco.MinMaxLayoutToggle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var zoomRoom = Codec as PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom.ZoomRoom;
|
||||||
|
if (zoomRoom != null)
|
||||||
|
{
|
||||||
|
TriList.BooleanInput[UIBoolJoin.VCLayoutToggleEnable].BoolValue = true;
|
||||||
|
TriList.SetSigFalseAction(UIBoolJoin.VCLayoutTogglePress, lc.LocalLayoutToggle);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IMobileControl : IKeyed
|
public interface IMobileControl : IKeyed
|
||||||
{
|
{
|
||||||
void CreateMobileControlRoomBridge(IEssentialsRoom room, IMobileControl parent);
|
void CreateMobileControlRoomBridge(EssentialsRoomBase room, IMobileControl parent);
|
||||||
|
|
||||||
void LinkSystemMonitorToAppServer();
|
void LinkSystemMonitorToAppServer();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,90 +1,90 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.GeneralIO;
|
using Crestron.SimplSharpPro.GeneralIO;
|
||||||
using Crestron.SimplSharp.Reflection;
|
using Crestron.SimplSharp.Reflection;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Core.CrestronIO;
|
using PepperDash.Essentials.Core.CrestronIO;
|
||||||
using PepperDash.Essentials.Core.Touchpanels;
|
using PepperDash.Essentials.Core.Touchpanels;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
public class DeviceFactoryWrapper
|
public class DeviceFactoryWrapper
|
||||||
{
|
{
|
||||||
public CType CType { get; set; }
|
public CType CType { get; set; }
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
public Func<DeviceConfig, IKeyed> FactoryMethod { get; set; }
|
public Func<DeviceConfig, IKeyed> FactoryMethod { get; set; }
|
||||||
|
|
||||||
public DeviceFactoryWrapper()
|
public DeviceFactoryWrapper()
|
||||||
{
|
{
|
||||||
CType = null;
|
CType = null;
|
||||||
Description = "Not Available";
|
Description = "Not Available";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DeviceFactory
|
public class DeviceFactory
|
||||||
{
|
{
|
||||||
public DeviceFactory()
|
public DeviceFactory()
|
||||||
{
|
{
|
||||||
var assy = Assembly.GetExecutingAssembly();
|
var assy = Assembly.GetExecutingAssembly();
|
||||||
PluginLoader.SetEssentialsAssembly(assy.GetName().Name, assy);
|
PluginLoader.SetEssentialsAssembly(assy.GetName().Name, assy);
|
||||||
|
|
||||||
var types = assy.GetTypes().Where(ct => typeof(IDeviceFactory).IsAssignableFrom(ct) && !ct.IsInterface && !ct.IsAbstract);
|
var types = assy.GetTypes().Where(ct => typeof(IDeviceFactory).IsAssignableFrom(ct) && !ct.IsInterface && !ct.IsAbstract);
|
||||||
|
|
||||||
if (types != null)
|
if (types != null)
|
||||||
{
|
{
|
||||||
foreach (var type in types)
|
foreach (var type in types)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var factory = (IDeviceFactory)Crestron.SimplSharp.Reflection.Activator.CreateInstance(type);
|
var factory = (IDeviceFactory)Crestron.SimplSharp.Reflection.Activator.CreateInstance(type);
|
||||||
factory.LoadTypeFactories();
|
factory.LoadTypeFactories();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to load type: '{1}' DeviceFactory: {0}", e, type.Name);
|
Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to load type: '{1}' DeviceFactory: {0}", e, type.Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A dictionary of factory methods, keyed by config types, added by plugins.
|
/// A dictionary of factory methods, keyed by config types, added by plugins.
|
||||||
/// These methods are looked up and called by GetDevice in this class.
|
/// These methods are looked up and called by GetDevice in this class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
static Dictionary<string, DeviceFactoryWrapper> FactoryMethods =
|
static Dictionary<string, DeviceFactoryWrapper> FactoryMethods =
|
||||||
new Dictionary<string, DeviceFactoryWrapper>(StringComparer.OrdinalIgnoreCase);
|
new Dictionary<string, DeviceFactoryWrapper>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds a plugin factory method
|
/// Adds a plugin factory method
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="dc"></param>
|
/// <param name="dc"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static void AddFactoryForType(string typeName, Func<DeviceConfig, IKeyed> method)
|
public static void AddFactoryForType(string typeName, Func<DeviceConfig, IKeyed> method)
|
||||||
{
|
{
|
||||||
Debug.Console(1, Debug.ErrorLogLevel.Notice, "Adding factory method for type '{0}'", typeName);
|
Debug.Console(1, Debug.ErrorLogLevel.Notice, "Adding factory method for type '{0}'", typeName);
|
||||||
DeviceFactory.FactoryMethods.Add(typeName, new DeviceFactoryWrapper() { FactoryMethod = method});
|
DeviceFactory.FactoryMethods.Add(typeName, new DeviceFactoryWrapper() { FactoryMethod = method});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AddFactoryForType(string typeName, string description, CType cType, Func<DeviceConfig, IKeyed> method)
|
public static void AddFactoryForType(string typeName, string description, CType cType, Func<DeviceConfig, IKeyed> method)
|
||||||
{
|
{
|
||||||
Debug.Console(1, Debug.ErrorLogLevel.Notice, "Adding factory method for type '{0}'", typeName);
|
Debug.Console(1, Debug.ErrorLogLevel.Notice, "Adding factory method for type '{0}'", typeName);
|
||||||
|
|
||||||
if(FactoryMethods.ContainsKey(typeName))
|
if(FactoryMethods.ContainsKey(typeName))
|
||||||
{
|
{
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to add type: '{0}'. Already exists in DeviceFactory", typeName);
|
Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to add type: '{0}'. Already exists in DeviceFactory", typeName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var wrapper = new DeviceFactoryWrapper() { CType = cType, Description = description, FactoryMethod = method };
|
var wrapper = new DeviceFactoryWrapper() { CType = cType, Description = description, FactoryMethod = method };
|
||||||
DeviceFactory.FactoryMethods.Add(typeName, wrapper);
|
DeviceFactory.FactoryMethods.Add(typeName, wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void CheckForSecrets(IEnumerable<JProperty> obj)
|
private static void CheckForSecrets(IEnumerable<JProperty> obj)
|
||||||
@@ -156,44 +156,53 @@ namespace PepperDash.Essentials.Core
|
|||||||
Debug.Console(0, Debug.ErrorLogLevel.Error, "Exception occurred while creating device {0}: {1}", dc.Key, ex.Message);
|
Debug.Console(0, Debug.ErrorLogLevel.Error, "Exception occurred while creating device {0}: {1}", dc.Key, ex.Message);
|
||||||
|
|
||||||
Debug.Console(2, "{0}", ex.StackTrace);
|
Debug.Console(2, "{0}", ex.StackTrace);
|
||||||
|
|
||||||
|
if (ex.InnerException == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Error, "Inner exception while creating device {0}: {1}", dc.Key,
|
||||||
|
ex.InnerException.Message);
|
||||||
|
Debug.Console(2, "{0}", ex.InnerException.StackTrace);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Prints the type names and associated metadata from the FactoryMethods collection.
|
/// Prints the type names and associated metadata from the FactoryMethods collection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="command"></param>
|
/// <param name="command"></param>
|
||||||
public static void GetDeviceFactoryTypes(string filter)
|
public static void GetDeviceFactoryTypes(string filter)
|
||||||
{
|
{
|
||||||
Dictionary<string, DeviceFactoryWrapper> types = new Dictionary<string, DeviceFactoryWrapper>();
|
Dictionary<string, DeviceFactoryWrapper> types = new Dictionary<string, DeviceFactoryWrapper>();
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(filter))
|
if (!string.IsNullOrEmpty(filter))
|
||||||
{
|
{
|
||||||
types = FactoryMethods.Where(k => k.Key.Contains(filter)).ToDictionary(k => k.Key, k => k.Value);
|
types = FactoryMethods.Where(k => k.Key.Contains(filter)).ToDictionary(k => k.Key, k => k.Value);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
types = FactoryMethods;
|
types = FactoryMethods;
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.Console(0, "Device Types:");
|
Debug.Console(0, "Device Types:");
|
||||||
|
|
||||||
foreach (var type in types.OrderBy(t => t.Key))
|
foreach (var type in types.OrderBy(t => t.Key))
|
||||||
{
|
{
|
||||||
var description = type.Value.Description;
|
var description = type.Value.Description;
|
||||||
var cType = "Not Specified by Plugin";
|
var cType = "Not Specified by Plugin";
|
||||||
|
|
||||||
if(type.Value.CType != null)
|
if(type.Value.CType != null)
|
||||||
{
|
{
|
||||||
cType = type.Value.CType.FullName;
|
cType = type.Value.CType.FullName;
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.Console(0,
|
Debug.Console(0,
|
||||||
@"Type: '{0}'
|
@"Type: '{0}'
|
||||||
CType: '{1}'
|
CType: '{1}'
|
||||||
Description: {2}", type.Key, cType, description);
|
Description: {2}", type.Key, cType, description);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -314,7 +314,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
FarEndIsSharingContentFeedback = new BoolFeedback(FarEndIsSharingContentFeedbackFunc);
|
FarEndIsSharingContentFeedback = new BoolFeedback(FarEndIsSharingContentFeedbackFunc);
|
||||||
CameraIsOffFeedback = new BoolFeedback(() => CodecStatus.Status.Video.Input.MainVideoMute.BoolValue);
|
CameraIsOffFeedback = new BoolFeedback(() => CodecStatus.Status.Video.Input.MainVideoMute.BoolValue);
|
||||||
CameraIsMutedFeedback = CameraIsOffFeedback;
|
CameraIsMutedFeedback = CameraIsOffFeedback;
|
||||||
|
SupportsCameraOff = true;
|
||||||
|
|
||||||
PresentationViewMaximizedFeedback = new BoolFeedback(() => CurrentPresentationView == "Maximized");
|
PresentationViewMaximizedFeedback = new BoolFeedback(() => CurrentPresentationView == "Maximized");
|
||||||
|
|
||||||
@@ -417,6 +417,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
CodecStatus.Status.RoomAnalytics.PeoplePresence.ValueChangedAction = RoomIsOccupiedFeedback.FireUpdate;
|
CodecStatus.Status.RoomAnalytics.PeoplePresence.ValueChangedAction = RoomIsOccupiedFeedback.FireUpdate;
|
||||||
CodecStatus.Status.RoomAnalytics.PeopleCount.Current.ValueChangedAction = PeopleCountFeedback.FireUpdate;
|
CodecStatus.Status.RoomAnalytics.PeopleCount.Current.ValueChangedAction = PeopleCountFeedback.FireUpdate;
|
||||||
CodecStatus.Status.Cameras.SpeakerTrack.Status.ValueChangedAction = CameraAutoModeIsOnFeedback.FireUpdate;
|
CodecStatus.Status.Cameras.SpeakerTrack.Status.ValueChangedAction = CameraAutoModeIsOnFeedback.FireUpdate;
|
||||||
|
CodecStatus.Status.Cameras.SpeakerTrack.Availability.ValueChangedAction = () => { SupportsCameraAutoMode = CodecStatus.Status.Cameras.SpeakerTrack.Availability.BoolValue; };
|
||||||
CodecStatus.Status.Video.Selfview.Mode.ValueChangedAction = SelfviewIsOnFeedback.FireUpdate;
|
CodecStatus.Status.Video.Selfview.Mode.ValueChangedAction = SelfviewIsOnFeedback.FireUpdate;
|
||||||
CodecStatus.Status.Video.Selfview.PIPPosition.ValueChangedAction = ComputeSelfviewPipStatus;
|
CodecStatus.Status.Video.Selfview.PIPPosition.ValueChangedAction = ComputeSelfviewPipStatus;
|
||||||
CodecStatus.Status.Video.Layout.LayoutFamily.Local.ValueChangedAction = ComputeLocalLayout;
|
CodecStatus.Status.Video.Layout.LayoutFamily.Local.ValueChangedAction = ComputeLocalLayout;
|
||||||
|
|||||||
@@ -277,9 +277,25 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
public SoftwareID SoftwareID { get; set; }
|
public SoftwareID SoftwareID { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Availability
|
public class Availability : ValueProperty
|
||||||
{
|
{
|
||||||
public string Value { get; set; }
|
string _Value;
|
||||||
|
public bool BoolValue { get; private set; }
|
||||||
|
|
||||||
|
public string Value
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _Value;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
// If the incoming value is "Available" it sets the BoolValue true, otherwise sets it false
|
||||||
|
_Value = value;
|
||||||
|
BoolValue = value == "Available";
|
||||||
|
OnValueChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Status2 : ValueProperty
|
public class Status2 : ValueProperty
|
||||||
|
|||||||
@@ -65,8 +65,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
|
|
||||||
public bool ShowSelfViewByDefault { get; protected set; }
|
public bool ShowSelfViewByDefault { get; protected set; }
|
||||||
|
|
||||||
protected bool SupportsCameraOff;
|
public bool SupportsCameraOff { get; protected set; }
|
||||||
protected bool SupportsCameraAutoMode;
|
public bool SupportsCameraAutoMode { get; protected set; }
|
||||||
|
|
||||||
public bool IsReady { get; protected set; }
|
public bool IsReady { get; protected set; }
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ using PepperDash.Essentials.Core.Bridges;
|
|||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||||
using PepperDash.Essentials.Core.Routing;
|
using PepperDash.Essentials.Core.Routing;
|
||||||
|
using PepperDash.Essentials.Core.Queues;
|
||||||
using PepperDash.Essentials.Devices.Common.Cameras;
|
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||||
using PepperDash.Essentials.Devices.Common.Codec;
|
using PepperDash.Essentials.Devices.Common.Codec;
|
||||||
using PepperDash.Essentials.Devices.Common.VideoCodec.Cisco;
|
using PepperDash.Essentials.Devices.Common.VideoCodec.Cisco;
|
||||||
@@ -30,10 +31,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
private const long MeetingRefreshTimer = 60000;
|
private const long MeetingRefreshTimer = 60000;
|
||||||
private const uint DefaultMeetingDurationMin = 30;
|
private const uint DefaultMeetingDurationMin = 30;
|
||||||
private const string Delimiter = "\x0D\x0A";
|
private const string Delimiter = "\x0D\x0A";
|
||||||
private readonly CrestronQueue<string> _receiveQueue;
|
|
||||||
|
private readonly GenericQueue _receiveQueue;
|
||||||
|
//private readonly CrestronQueue<string> _receiveQueue;
|
||||||
|
|
||||||
|
|
||||||
private readonly Thread _receiveThread;
|
//private readonly Thread _receiveThread;
|
||||||
|
|
||||||
private readonly ZoomRoomSyncState _syncState;
|
private readonly ZoomRoomSyncState _syncState;
|
||||||
public bool CommDebuggingIsOn;
|
public bool CommDebuggingIsOn;
|
||||||
@@ -51,11 +54,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
{
|
{
|
||||||
_props = JsonConvert.DeserializeObject<ZoomRoomPropertiesConfig>(config.Properties.ToString());
|
_props = JsonConvert.DeserializeObject<ZoomRoomPropertiesConfig>(config.Properties.ToString());
|
||||||
|
|
||||||
// The queue that will collect the repsonses in the order they are received
|
_receiveQueue = new GenericQueue(Key + "-rxQueue", Thread.eThreadPriority.MediumPriority, 512);
|
||||||
_receiveQueue = new CrestronQueue<string>(1024);
|
|
||||||
|
|
||||||
// The thread responsible for dequeuing and processing the messages
|
|
||||||
_receiveThread = new Thread(o => ProcessQueue(), null) { Priority = Thread.eThreadPriority.MediumPriority };
|
|
||||||
|
|
||||||
Communication = comm;
|
Communication = comm;
|
||||||
|
|
||||||
@@ -95,6 +94,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||||
eRoutingPortConnectionType.Hdmi, null, this);
|
eRoutingPortConnectionType.Hdmi, null, this);
|
||||||
|
|
||||||
|
Output2 = new RoutingOutputPort(RoutingPortNames.AnyVideoOut,
|
||||||
|
eRoutingSignalType.Video,
|
||||||
|
eRoutingPortConnectionType.DisplayPort, null, this);
|
||||||
|
|
||||||
SelfviewIsOnFeedback = new BoolFeedback(SelfViewIsOnFeedbackFunc);
|
SelfviewIsOnFeedback = new BoolFeedback(SelfViewIsOnFeedbackFunc);
|
||||||
|
|
||||||
CameraIsOffFeedback = new BoolFeedback(CameraIsOffFeedbackFunc);
|
CameraIsOffFeedback = new BoolFeedback(CameraIsOffFeedbackFunc);
|
||||||
@@ -120,7 +123,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
|
|
||||||
Participants = new CodecParticipants();
|
Participants = new CodecParticipants();
|
||||||
|
|
||||||
SupportsCameraOff = _props.SupportsCameraOff;
|
SupportsCameraOff = true; // Always allow turning off the camera for zoom calls?
|
||||||
SupportsCameraAutoMode = _props.SupportsCameraAutoMode;
|
SupportsCameraAutoMode = _props.SupportsCameraAutoMode;
|
||||||
|
|
||||||
PhoneOffHookFeedback = new BoolFeedback(PhoneOffHookFeedbackFunc);
|
PhoneOffHookFeedback = new BoolFeedback(PhoneOffHookFeedbackFunc);
|
||||||
@@ -252,6 +255,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
|
|
||||||
public RoutingInputPort CodecOsdIn { get; private set; }
|
public RoutingInputPort CodecOsdIn { get; private set; }
|
||||||
public RoutingOutputPort Output1 { get; private set; }
|
public RoutingOutputPort Output1 { get; private set; }
|
||||||
|
public RoutingOutputPort Output2 { get; private set; }
|
||||||
|
|
||||||
#region ICommunicationMonitor Members
|
#region ICommunicationMonitor Members
|
||||||
|
|
||||||
@@ -685,6 +689,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
|
|
||||||
// Set up output ports
|
// Set up output ports
|
||||||
OutputPorts.Add(Output1);
|
OutputPorts.Add(Output1);
|
||||||
|
OutputPorts.Add(Output2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -790,37 +795,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
//if (CommDebuggingIsOn)
|
//if (CommDebuggingIsOn)
|
||||||
// Debug.Console(1, this, "Gathered: '{0}'", args.Text);
|
// Debug.Console(1, this, "Gathered: '{0}'", args.Text);
|
||||||
|
|
||||||
_receiveQueue.Enqueue(args.Text);
|
_receiveQueue.Enqueue(new ProcessStringMessage(args.Text, ProcessMessage));
|
||||||
|
|
||||||
// If the receive thread has for some reason stopped, this will restart it
|
|
||||||
if (_receiveThread.ThreadState != Thread.eThreadStates.ThreadRunning)
|
|
||||||
{
|
|
||||||
_receiveThread.Start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Runs in it's own thread to dequeue messages in the order they were received to be processed
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
private object ProcessQueue()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
while (true)
|
|
||||||
{
|
|
||||||
var message = _receiveQueue.Dequeue();
|
|
||||||
|
|
||||||
ProcessMessage(message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Debug.Console(1, this, "Error Processing Queue: {0}", e);
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2480,9 +2455,51 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
|
|
||||||
public void LocalLayoutToggle()
|
public void LocalLayoutToggle()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
var currentLayout = LocalLayoutFeedback.StringValue;
|
||||||
|
|
||||||
|
var eCurrentLayout = (int)Enum.Parse(typeof(zConfiguration.eLayoutStyle), currentLayout, true);
|
||||||
|
|
||||||
|
var nextLayout = GetNextLayout(eCurrentLayout);
|
||||||
|
|
||||||
|
if (nextLayout != zConfiguration.eLayoutStyle.None)
|
||||||
|
{
|
||||||
|
SetLayout(nextLayout);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Tries to get the next available layout
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="currentLayout"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private zConfiguration.eLayoutStyle GetNextLayout(int currentLayout)
|
||||||
|
{
|
||||||
|
if (AvailableLayouts == zConfiguration.eLayoutStyle.None)
|
||||||
|
{
|
||||||
|
return zConfiguration.eLayoutStyle.None;
|
||||||
|
}
|
||||||
|
|
||||||
|
zConfiguration.eLayoutStyle nextLayout;
|
||||||
|
|
||||||
|
if (((zConfiguration.eLayoutStyle)currentLayout & zConfiguration.eLayoutStyle.ShareAll) == zConfiguration.eLayoutStyle.ShareAll)
|
||||||
|
{
|
||||||
|
nextLayout = zConfiguration.eLayoutStyle.Gallery;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nextLayout = (zConfiguration.eLayoutStyle)(currentLayout << 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((AvailableLayouts & nextLayout) == nextLayout)
|
||||||
|
{
|
||||||
|
return nextLayout;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return GetNextLayout((int)nextLayout);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void LocalLayoutToggleSingleProminent()
|
public void LocalLayoutToggleSingleProminent()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
|
|||||||
Reference in New Issue
Block a user