Compare commits

..

4 Commits

6 changed files with 175 additions and 34 deletions

View File

@@ -77,9 +77,10 @@ namespace PepperDash.Essentials.Core
var mParams = method.GetParameters();
var convertedParams = mParams
.Select((p, i) => ConvertType(action.Params[i], p.ParameterType))
.Select((p, i) => Convert.ChangeType(action.Params[i], p.ParameterType,
System.Globalization.CultureInfo.InvariantCulture))
.ToArray();
method.Invoke(obj, convertedParams);
var ret = method.Invoke(obj, convertedParams);
CrestronConsole.ConsoleCommandResponse("Method {0} successfully called on device {1}", method.Name,
action.DeviceKey);
@@ -90,23 +91,6 @@ namespace PepperDash.Essentials.Core
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>
@@ -291,8 +275,6 @@ namespace PepperDash.Essentials.Core
//var props = t.GetProperties().Select(p => new PropertyNameType(p, obj));
//return JsonConvert.SerializeObject(props, Formatting.Indented);
}
}
public class DeviceActionWrapper

View File

@@ -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)

View File

@@ -375,7 +375,7 @@ namespace PepperDash.Essentials
{
try
{
if (typeof (IPluginDeviceFactory).IsAssignableFrom(type) && !type.IsAbstract)
if (typeof (IPluginDeviceFactory).IsAssignableFrom(type))
{
var plugin =
(IPluginDeviceFactory) Crestron.SimplSharp.Reflection.Activator.CreateInstance(type);

View File

@@ -31,6 +31,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
BoolFeedback LayoutViewIsOnLastPageFeedback { get; } // TODO: #697 [*] Consider modifying to report button visibility in func
BoolFeedback CanSwapContentWithThumbnailFeedback { get; }
BoolFeedback ContentSwappedWithThumbnailFeedback { get; }
StringFeedback LayoutSizeFeedback { get; } // TODO: #714 [ ] Feature Layout Size
ZoomRoom.zConfiguration.eLayoutStyle LastSelectedLayout { get; }
ZoomRoom.zConfiguration.eLayoutStyle AvailableLayouts { get; }
@@ -41,6 +42,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
void LayoutTurnNextPage();
void LayoutTurnPreviousPage();
void GetCurrentLayoutSize(); // TODO: #714 [ ] Feature Layout Size
void SetLayoutSize(ZoomRoom.zConfiguration.eLayoutSize layoutSize); // TODO: #714 [ ] Feature Layout Size
}
public class LayoutInfoChangedEventArgs : EventArgs

View File

@@ -108,7 +108,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
ReceivingContent = new BoolFeedback(FarEndIsSharingContentFeedbackFunc);
SelfviewPipPositionFeedback = new StringFeedback(SelfviewPipPositionFeedbackFunc);
SetUpFeedbackActions();
Cameras = new List<CameraBase>();
@@ -126,6 +126,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
LocalLayoutFeedback = new StringFeedback(LocalLayoutFeedbackFunc);
// TODO: #714 [ ] Feature Layout Size
LayoutSizeFeedback = new StringFeedback(LayoutSizeFeedbackFunc);
LayoutViewIsOnFirstPageFeedback = new BoolFeedback(LayoutViewIsOnFirstPageFeedbackFunc);
LayoutViewIsOnLastPageFeedback = new BoolFeedback(LayoutViewIsOnLastPageFeedbackFunc);
CanSwapContentWithThumbnailFeedback = new BoolFeedback(CanSwapContentWithThumbnailFeedbackFunc);
@@ -511,6 +514,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
LocalLayoutFeedback.FireUpdate();
break;
}
case "Size":
{
break;
}
}
};
@@ -1483,7 +1491,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 +1578,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 +1594,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);
}
}
@@ -1795,7 +1803,28 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
}
});
layoutsCodec.LocalLayoutFeedback.LinkInputSig(trilist.StringInput[joinMap.GetSetCurrentLayout.JoinNumber]);
layoutsCodec.LocalLayoutFeedback.LinkInputSig(trilist.StringInput[joinMap.GetSetCurrentLayout.JoinNumber]);
// TODO: #714 [ ] Feature Layout Size
trilist.SetSigFalseAction(joinMap.SetLayoutSizeOff.JoinNumber, () => layoutsCodec.SetLayoutSize(zConfiguration.eLayoutSize.Off));
trilist.SetSigFalseAction(joinMap.SetLayoutSize1.JoinNumber, () => layoutsCodec.SetLayoutSize(zConfiguration.eLayoutSize.Size1));
trilist.SetSigFalseAction(joinMap.SetLayoutSize2.JoinNumber, () => layoutsCodec.SetLayoutSize(zConfiguration.eLayoutSize.Size2));
trilist.SetSigFalseAction(joinMap.SetLayoutSize3.JoinNumber, () => layoutsCodec.SetLayoutSize(zConfiguration.eLayoutSize.Size3));
trilist.SetSigFalseAction(joinMap.SetLayoutSizeStrip.JoinNumber, () => layoutsCodec.SetLayoutSize(zConfiguration.eLayoutSize.Strip));
trilist.SetSigFalseAction(joinMap.GetSetCurrentLayoutSize.JoinNumber, layoutsCodec.GetCurrentLayoutSize);
trilist.SetStringSigAction(joinMap.GetSetCurrentLayoutSize.JoinNumber, (s) =>
{
try
{
var size = (zConfiguration.eLayoutSize)Enum.Parse(typeof(zConfiguration.eLayoutSize), s, true);
SetLayoutSize(size);
}
catch (Exception e)
{
Debug.Console(1, this, "Unable to parse '{0}' to zConfiguration.eLayoutSize: {1}", s, e);
}
});
layoutsCodec.LayoutSizeFeedback.LinkInputSig(trilist.StringInput[joinMap.GetSetCurrentLayoutSize.JoinNumber]);
}
var pinCodec = this as IHasParticipantPinUnpin;
@@ -2241,8 +2270,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
private void ComputeAvailableLayouts()
{
zConfiguration.eLayoutStyle availableLayouts = zConfiguration.eLayoutStyle.None;
// TODO: #697 [X] 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;
@@ -2306,6 +2333,46 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
SendText("zCommand Call Layout TurnPage Forward: Off");
}
// TODO: #714 [ ] Feature Layout Size
/// <summary>
/// Stores last selected layout size
/// </summary>
public zConfiguration.eLayoutSize LastSelectedLayoutSize { get; private set; }
// TODO: #714 [ ] Feature Layout Size
/// <summary>
/// Queries for current layout size
/// </summary>
public void GetCurrentLayoutSize()
{
SendText("zConfiguration Call Layout Size");
}
// TODO: #714 [ ] Feature Layout Size
/// <summary>
/// Sets selected layout size
/// </summary>
/// <param name="layoutSize">zConfiguration.eLayoutSize</param>
public void SetLayoutSize(zConfiguration.eLayoutSize layoutSize)
{
LastSelectedLayoutSize = layoutSize;
SendText(String.Format("zConfiguration Call Layout Size: {0}", layoutSize.ToString()));
}
// TODO: #714 [ ] Feature Layout Size
private Func<string> LayoutSizeFeedbackFunc
{
get
{
return () => Configuration.Call.Layout.Size.ToString();
}
}
/// <summary>
/// Layout size feedback
/// </summary>
public StringFeedback LayoutSizeFeedback { get; private set; }
#endregion
#region IHasCodecLayouts Members
@@ -2339,7 +2406,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public void MinMaxLayoutToggle()
{
throw new NotImplementedException();
}
}
#endregion

View File

@@ -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,6 +160,81 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
Description = "FB Indicates if layout 'ShareAll' is available",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.DigitalSerial
});
// TODO: #714 [ ] Feature Layout Size
[JoinName("SetLayoutSizeOff")]
public JoinDataComplete SetLayoutSizeOff = new JoinDataComplete(
new JoinData
{
JoinNumber = 231,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Sets layout size off",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
// TODO: #714 [ ] Feature Layout Size
[JoinName("SetLayoutSize1")]
public JoinDataComplete SetLayoutSize1 = new JoinDataComplete(
new JoinData
{
JoinNumber = 232,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Sets layout size 1",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
// TODO: #714 [ ] Feature Layout Size
[JoinName("SetLayoutSize2")]
public JoinDataComplete SetLayoutSize2 = new JoinDataComplete(
new JoinData
{
JoinNumber = 233,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Sets layout size 2",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
// TODO: #714 [ ] Feature Layout Size
[JoinName("SetLayoutSize3")]
public JoinDataComplete SetLayoutSize3 = new JoinDataComplete(
new JoinData
{
JoinNumber = 234,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Sets layout size 3",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
// TODO: #714 [ ] Feature Layout Size
[JoinName("SetLayoutSizeStrip")]
public JoinDataComplete SetLayoutSizeStrip = new JoinDataComplete(
new JoinData
{
JoinNumber = 235,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Sets layout size strip",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
//[JoinName("ParticipantAudioMuteToggleStart")]
@@ -256,7 +329,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 [ ] Feature Layout Size
[JoinName("GetSetCurrentLayoutSize")]
public JoinDataComplete GetSetCurrentLayoutSize = new JoinDataComplete(
new JoinData
{
JoinNumber = 230,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Sets and reports the current layout size.",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.DigitalSerial
});
#endregion