This commit is contained in:
Neil Dorin
2021-08-11 17:47:50 +00:00
committed by GitHub
6 changed files with 383 additions and 345 deletions

View File

@@ -454,7 +454,8 @@ namespace PepperDash.Essentials
else else
{ {
Debug.Console(1, this, "sourceListKey present but not yet implemented"); Debug.Console(1, this, "sourceListKey present but not yet implemented");
throw new NotImplementedException();
RunRouteAction(routeKey, new Action(() => { }));
} }
} }
@@ -471,7 +472,11 @@ namespace PepperDash.Essentials
RunRouteAction(routeKey, successCallback); RunRouteAction(routeKey, successCallback);
} }
else else
throw new NotImplementedException(); {
Debug.Console(1, this, "sourceListKey present but not yet implemented");
RunRouteAction(routeKey, successCallback);
}
} }
/// <summary> /// <summary>

View File

@@ -1,326 +1,326 @@
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 System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DeviceSupport; using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials; using PepperDash.Essentials;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.SmartObjects; using PepperDash.Essentials.Core.SmartObjects;
using PepperDash.Essentials.Core.Touchpanels.Keyboards; using PepperDash.Essentials.Core.Touchpanels.Keyboards;
using PepperDash.Essentials.Devices.Displays; using PepperDash.Essentials.Devices.Displays;
using PepperDash.Essentials.Room.Config; using PepperDash.Essentials.Room.Config;
namespace PepperDash.Essentials.UIDrivers namespace PepperDash.Essentials.UIDrivers
{ {
public class EssentialsHuddleTechPageDriver : PanelDriverBase public class EssentialsHuddleTechPageDriver : PanelDriverBase
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
SmartObjectDynamicList MenuList; SmartObjectDynamicList MenuList;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
SubpageReferenceList StatusList; SubpageReferenceList StatusList;
/// <summary> /// <summary>
/// The list of display controls /// The list of display controls
/// </summary> /// </summary>
SubpageReferenceList DisplayList; SubpageReferenceList DisplayList;
/// <summary> /// <summary>
/// References lines in the list against device instances /// References lines in the list against device instances
/// </summary> /// </summary>
Dictionary<ICommunicationMonitor, uint> StatusListDeviceIndexes; Dictionary<ICommunicationMonitor, uint> StatusListDeviceIndexes;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
JoinedSigInterlock PagesInterlock; JoinedSigInterlock PagesInterlock;
/// <summary> /// <summary>
/// 1 /// 1
/// </summary> /// </summary>
public const uint JoinText = 1; public const uint JoinText = 1;
CTimer PinAuthorizedTimer; CTimer PinAuthorizedTimer;
EssentialsRoomTechConfig Config; EssentialsRoomTechConfig Config;
StringBuilder PinEntryBuilder = new StringBuilder(4); StringBuilder PinEntryBuilder = new StringBuilder(4);
bool IsAuthorized; bool IsAuthorized;
SmartObjectNumeric PinKeypad; SmartObjectNumeric PinKeypad;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="trilist"></param> /// <param name="trilist"></param>
/// <param name="parent"></param> /// <param name="parent"></param>
public EssentialsHuddleTechPageDriver(BasicTriListWithSmartObject trilist, EssentialsRoomTechConfig config) public EssentialsHuddleTechPageDriver(BasicTriListWithSmartObject trilist, EssentialsRoomTechConfig config)
: base(trilist) : base(trilist)
{ {
Config = config; Config = config;
PagesInterlock = new JoinedSigInterlock(trilist); PagesInterlock = new JoinedSigInterlock(trilist);
PagesInterlock.SetButDontShow(UIBoolJoin.TechSystemStatusVisible); PagesInterlock.SetButDontShow(UIBoolJoin.TechSystemStatusVisible);
trilist.SetSigFalseAction(UIBoolJoin.TechExitButton, Hide); trilist.SetSigFalseAction(UIBoolJoin.TechExitButton, Hide);
MenuList = new SmartObjectDynamicList(trilist.SmartObjects[UISmartObjectJoin.TechMenuList], MenuList = new SmartObjectDynamicList(trilist.SmartObjects[UISmartObjectJoin.TechMenuList],
true, 3100); true, 3100);
MenuList.SetFeedback(1, true); // initial fb MenuList.SetFeedback(1, true); // initial fb
ushort count = 0; ushort count = 0;
MenuList.SetItemMainText(1, "System Status"); MenuList.SetItemMainText(1, "System Status");
MenuList.SetItemButtonAction(1, b => { MenuList.SetItemButtonAction(1, b => {
if (b) PagesInterlock.ShowInterlocked(UIBoolJoin.TechSystemStatusVisible); if (b) PagesInterlock.ShowInterlocked(UIBoolJoin.TechSystemStatusVisible);
MenuList.SetFeedback(1, true); MenuList.SetFeedback(1, true);
}); });
MenuList.SetItemMainText(2, "Display Controls"); MenuList.SetItemMainText(2, "Display Controls");
MenuList.SetItemButtonAction(2, b => { MenuList.SetItemButtonAction(2, b => {
if (b) PagesInterlock.ShowInterlocked(UIBoolJoin.TechDisplayControlsVisible); if (b) PagesInterlock.ShowInterlocked(UIBoolJoin.TechDisplayControlsVisible);
MenuList.SetFeedback(2, true); MenuList.SetFeedback(2, true);
}); });
count = 2; count = 2;
// Don't show panel setup on iPad or xpanel // Don't show panel setup on iPad or xpanel
if (TriList is Crestron.SimplSharpPro.DeviceSupport.TswFt5Button) if (TriList is Crestron.SimplSharpPro.DeviceSupport.TswFt5Button)
{ {
count++; count++;
MenuList.SetItemMainText(count, "Panel Setup"); MenuList.SetItemMainText(count, "Panel Setup");
MenuList.SetItemButtonAction(count, b => MenuList.SetItemButtonAction(count, b =>
{ {
if (b) PagesInterlock.ShowInterlocked(UIBoolJoin.TechPanelSetupVisible); if (b) PagesInterlock.ShowInterlocked(UIBoolJoin.TechPanelSetupVisible);
MenuList.SetFeedback(count, true); MenuList.SetFeedback(count, true);
}); });
} }
MenuList.Count = count; MenuList.Count = count;
BuildStatusList(); BuildStatusList();
BuildDisplayList(); BuildDisplayList();
SetupPinModal(); SetupPinModal();
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public override void Show() public override void Show()
{ {
// divert to PIN if we need auth // divert to PIN if we need auth
if (IsAuthorized) if (IsAuthorized)
{ {
// Cancel the auth timer so we don't deauth after coming back in // Cancel the auth timer so we don't deauth after coming back in
if (PinAuthorizedTimer != null) if (PinAuthorizedTimer != null)
PinAuthorizedTimer.Stop(); PinAuthorizedTimer.Stop();
TriList.SetBool(UIBoolJoin.TechCommonItemsVisbible, true); TriList.SetBool(UIBoolJoin.TechCommonItemsVisbible, true);
PagesInterlock.Show(); PagesInterlock.Show();
base.Show(); base.Show();
} }
else else
{ {
TriList.SetBool(UIBoolJoin.PinDialog4DigitVisible, true); TriList.SetBool(UIBoolJoin.PinDialog4DigitVisible, true);
} }
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public override void Hide() public override void Hide()
{ {
// Leave it authorized for 60 seconds. // Leave it authorized for 60 seconds.
if (IsAuthorized) if (IsAuthorized)
PinAuthorizedTimer = new CTimer(o => { PinAuthorizedTimer = new CTimer(o => {
IsAuthorized = false; IsAuthorized = false;
PinAuthorizedTimer = null; PinAuthorizedTimer = null;
}, 60000); }, 60000);
TriList.SetBool(UIBoolJoin.TechCommonItemsVisbible, false); TriList.SetBool(UIBoolJoin.TechCommonItemsVisbible, false);
PagesInterlock.Hide(); PagesInterlock.Hide();
base.Hide(); base.Hide();
} }
/// <summary> /// <summary>
/// Wire up the keypad and buttons /// Wire up the keypad and buttons
/// </summary> /// </summary>
void SetupPinModal() void SetupPinModal()
{ {
TriList.SetSigFalseAction(UIBoolJoin.PinDialogCancelPress, CancelPinDialog); TriList.SetSigFalseAction(UIBoolJoin.PinDialogCancelPress, CancelPinDialog);
PinKeypad = new SmartObjectNumeric(TriList.SmartObjects[UISmartObjectJoin.TechPinDialogKeypad], true); PinKeypad = new SmartObjectNumeric(TriList.SmartObjects[UISmartObjectJoin.TechPinDialogKeypad], true);
PinKeypad.Digit0.UserObject = new Action<bool>(b => { if (b)DialPinDigit('0'); }); PinKeypad.Digit0.UserObject = new Action<bool>(b => { if (b)DialPinDigit('0'); });
PinKeypad.Digit1.UserObject = new Action<bool>(b => { if (b)DialPinDigit('1'); }); PinKeypad.Digit1.UserObject = new Action<bool>(b => { if (b)DialPinDigit('1'); });
PinKeypad.Digit2.UserObject = new Action<bool>(b => { if (b)DialPinDigit('2'); }); PinKeypad.Digit2.UserObject = new Action<bool>(b => { if (b)DialPinDigit('2'); });
PinKeypad.Digit3.UserObject = new Action<bool>(b => { if (b)DialPinDigit('3'); }); PinKeypad.Digit3.UserObject = new Action<bool>(b => { if (b)DialPinDigit('3'); });
PinKeypad.Digit4.UserObject = new Action<bool>(b => { if (b)DialPinDigit('4'); }); PinKeypad.Digit4.UserObject = new Action<bool>(b => { if (b)DialPinDigit('4'); });
PinKeypad.Digit5.UserObject = new Action<bool>(b => { if (b)DialPinDigit('5'); }); PinKeypad.Digit5.UserObject = new Action<bool>(b => { if (b)DialPinDigit('5'); });
PinKeypad.Digit6.UserObject = new Action<bool>(b => { if (b)DialPinDigit('6'); }); PinKeypad.Digit6.UserObject = new Action<bool>(b => { if (b)DialPinDigit('6'); });
PinKeypad.Digit7.UserObject = new Action<bool>(b => { if (b)DialPinDigit('7'); }); PinKeypad.Digit7.UserObject = new Action<bool>(b => { if (b)DialPinDigit('7'); });
PinKeypad.Digit8.UserObject = new Action<bool>(b => { if (b)DialPinDigit('8'); }); PinKeypad.Digit8.UserObject = new Action<bool>(b => { if (b)DialPinDigit('8'); });
PinKeypad.Digit9.UserObject = new Action<bool>(b => { if (b)DialPinDigit('9'); }); PinKeypad.Digit9.UserObject = new Action<bool>(b => { if (b)DialPinDigit('9'); });
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="d"></param> /// <param name="d"></param>
void DialPinDigit(char d) void DialPinDigit(char d)
{ {
PinEntryBuilder.Append(d); PinEntryBuilder.Append(d);
var len = PinEntryBuilder.Length; var len = PinEntryBuilder.Length;
SetPinDotsFeedback(len); SetPinDotsFeedback(len);
// check it! // check it!
if (len == 4) if (len == 4)
{ {
if (Config.Password == PinEntryBuilder.ToString()) if (Config.Password == PinEntryBuilder.ToString())
{ {
IsAuthorized = true; IsAuthorized = true;
SetPinDotsFeedback(0); SetPinDotsFeedback(0);
TriList.SetBool(UIBoolJoin.PinDialog4DigitVisible, false); TriList.SetBool(UIBoolJoin.PinDialog4DigitVisible, false);
Show(); Show();
} }
else else
{ {
SetPinDotsFeedback(0); SetPinDotsFeedback(0);
TriList.SetBool(UIBoolJoin.PinDialogErrorVisible, true); TriList.SetBool(UIBoolJoin.PinDialogErrorVisible, true);
new CTimer(o => new CTimer(o =>
{ {
TriList.SetBool(UIBoolJoin.PinDialogErrorVisible, false); TriList.SetBool(UIBoolJoin.PinDialogErrorVisible, false);
}, 1500); }, 1500);
} }
PinEntryBuilder.Remove(0, len); // clear it either way PinEntryBuilder.Remove(0, len); // clear it either way
} }
} }
/// <summary> /// <summary>
/// Draws the dots as pin is entered /// Draws the dots as pin is entered
/// </summary> /// </summary>
/// <param name="len"></param> /// <param name="len"></param>
void SetPinDotsFeedback(int len) void SetPinDotsFeedback(int len)
{ {
TriList.SetBool(UIBoolJoin.PinDialogDot1, len >= 1); TriList.SetBool(UIBoolJoin.PinDialogDot1, len >= 1);
TriList.SetBool(UIBoolJoin.PinDialogDot2, len >= 2); TriList.SetBool(UIBoolJoin.PinDialogDot2, len >= 2);
TriList.SetBool(UIBoolJoin.PinDialogDot3, len >= 3); TriList.SetBool(UIBoolJoin.PinDialogDot3, len >= 3);
TriList.SetBool(UIBoolJoin.PinDialogDot4, len == 4); TriList.SetBool(UIBoolJoin.PinDialogDot4, len == 4);
} }
/// <summary> /// <summary>
/// Does what it says /// Does what it says
/// </summary> /// </summary>
void CancelPinDialog() void CancelPinDialog()
{ {
PinEntryBuilder.Remove(0, PinEntryBuilder.Length); PinEntryBuilder.Remove(0, PinEntryBuilder.Length);
TriList.SetBool(UIBoolJoin.PinDialog4DigitVisible, false); TriList.SetBool(UIBoolJoin.PinDialog4DigitVisible, false);
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
void BuildStatusList() void BuildStatusList()
{ {
StatusList = new SubpageReferenceList(TriList, UISmartObjectJoin.TechStatusList, 3, 3, 3); StatusList = new SubpageReferenceList(TriList, UISmartObjectJoin.TechStatusList, 3, 3, 3);
StatusListDeviceIndexes = new Dictionary<ICommunicationMonitor, uint>(); StatusListDeviceIndexes = new Dictionary<ICommunicationMonitor, uint>();
uint i = 0; uint i = 0;
foreach (var d in DeviceManager.AllDevices) foreach (var d in DeviceManager.AllDevices)
{ {
// make sure it is both ICommunicationMonitor and a Device // make sure it is both ICommunicationMonitor and a Device
var sd = d as ICommunicationMonitor; var sd = d as ICommunicationMonitor;
if (sd == null) if (sd == null)
continue; continue;
var dd = sd as Device; var dd = sd as Device;
if(dd == null) if(dd == null)
continue; continue;
i++; i++;
StatusList.StringInputSig(i, 1).StringValue = dd.Name; StatusList.StringInputSig(i, 1).StringValue = dd.Name;
StatusList.UShortInputSig(i, 1).UShortValue = (ushort)sd.CommunicationMonitor.Status; StatusList.UShortInputSig(i, 1).UShortValue = (ushort)sd.CommunicationMonitor.Status;
StatusListDeviceIndexes.Add(sd, i); StatusListDeviceIndexes.Add(sd, i);
sd.CommunicationMonitor.StatusChange += CommunicationMonitor_StatusChange ; sd.CommunicationMonitor.StatusChange += CommunicationMonitor_StatusChange ;
} }
StatusList.Count = (ushort)i; StatusList.Count = (ushort)i;
} }
/// <summary> /// <summary>
/// Builds the list of display controls /// Builds the list of display controls
/// </summary> /// </summary>
void BuildDisplayList() void BuildDisplayList()
{ {
DisplayList = new SubpageReferenceList(TriList, UISmartObjectJoin.TechDisplayControlsList, 10, 3, 3); DisplayList = new SubpageReferenceList(TriList, UISmartObjectJoin.TechDisplayControlsList, 10, 3, 3);
var devKeys = ConfigReader.ConfigObject.Devices.Where(d => var devKeys = ConfigReader.ConfigObject.Devices.Where(d =>
d.Group.Equals("display", StringComparison.OrdinalIgnoreCase) d.Group.Equals("display", StringComparison.OrdinalIgnoreCase)
|| d.Group.Equals("projector", StringComparison.OrdinalIgnoreCase)) || d.Group.Equals("projector", StringComparison.OrdinalIgnoreCase))
.Select(dd => dd.Key); .Select(dd => dd.Key);
var disps = DeviceManager.AllDevices.Where(d => var disps = DeviceManager.AllDevices.Where(d =>
devKeys.Contains(d.Key)); devKeys.Contains(d.Key));
ushort i = 0; ushort i = 0;
foreach (var disp in disps) foreach (var disp in disps)
{ {
var display = disp as DisplayBase; var display = disp as DisplayBase;
if (display != null) if (display != null)
{ {
i++; i++;
DisplayList.StringInputSig(i, 1).StringValue = display.Name; DisplayList.StringInputSig(i, 1).StringValue = display.Name;
DisplayList.GetBoolFeedbackSig(i, 1).SetSigFalseAction(display.PowerOn); DisplayList.GetBoolFeedbackSig(i, 1).SetSigFalseAction(display.PowerOn);
DisplayList.GetBoolFeedbackSig(i, 2).SetSigFalseAction(display.PowerOff); DisplayList.GetBoolFeedbackSig(i, 2).SetSigFalseAction(display.PowerOff);
if (display is TwoWayDisplayBase) if (display is TwoWayDisplayBase)
{ {
var powerOnSig = DisplayList.BoolInputSig(i, 1); var powerOnSig = DisplayList.BoolInputSig(i, 1);
(display as TwoWayDisplayBase).PowerIsOnFeedback.LinkInputSig(powerOnSig); (display as TwoWayDisplayBase).PowerIsOnFeedback.LinkInputSig(powerOnSig);
var powerOffSig = DisplayList.BoolInputSig(1, 2); var powerOffSig = DisplayList.BoolInputSig(1, 2);
(display as TwoWayDisplayBase).PowerIsOnFeedback.LinkComplementInputSig(powerOffSig); (display as TwoWayDisplayBase).PowerIsOnFeedback.LinkComplementInputSig(powerOffSig);
} }
DisplayList.GetBoolFeedbackSig(i, 3).SetSigFalseAction(() => DisplayList.GetBoolFeedbackSig(i, 3).SetSigFalseAction(() =>
{ if (display is IInputHdmi1) (display as IInputHdmi1).InputHdmi1(); }); { if (display is IInputHdmi1) (display as IInputHdmi1).InputHdmi1(); });
DisplayList.GetBoolFeedbackSig(i, 4).SetSigFalseAction(() => DisplayList.GetBoolFeedbackSig(i, 4).SetSigFalseAction(() =>
{ if (display is IInputHdmi2) (display as IInputHdmi2).InputHdmi2(); }); { if (display is IInputHdmi2) (display as IInputHdmi2).InputHdmi2(); });
DisplayList.GetBoolFeedbackSig(i, 5).SetSigFalseAction(() => DisplayList.GetBoolFeedbackSig(i, 5).SetSigFalseAction(() =>
{ if (display is IInputHdmi3) (display as IInputHdmi3).InputHdmi3(); }); { if (display is IInputHdmi3) (display as IInputHdmi3).InputHdmi3(); });
//DisplayList.GetBoolFeedbackSig(i, 6).SetSigFalseAction(() => //DisplayList.GetBoolFeedbackSig(i, 6).SetSigFalseAction(() =>
//{ if (display is IInputHdmi4) (display as IInputHdmi4).InputHdmi4(); }); //{ if (display is IInputHdmi4) (display as IInputHdmi4).InputHdmi4(); });
DisplayList.GetBoolFeedbackSig(i, 6).SetSigFalseAction(() => DisplayList.GetBoolFeedbackSig(i, 6).SetSigFalseAction(() =>
{ if (display is IInputDisplayPort1) (display as IInputDisplayPort1).InputDisplayPort1(); }); { if (display is IInputDisplayPort1) (display as IInputDisplayPort1).InputDisplayPort1(); });
// Figure out some way to provide current input feedback // Figure out some way to provide current input feedback
if (display is TwoWayDisplayBase) if (display is TwoWayDisplayBase)
{ {
(display as TwoWayDisplayBase).CurrentInputFeedback.OutputChange += CurrentInputFeedback_OutputChange; (display as TwoWayDisplayBase).CurrentInputFeedback.OutputChange += CurrentInputFeedback_OutputChange;
} }
} }
} }
DisplayList.Count = i; DisplayList.Count = i;
} }
void CurrentInputFeedback_OutputChange(object sender, EventArgs e) void CurrentInputFeedback_OutputChange(object sender, EventArgs e)
{ {
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
void CommunicationMonitor_StatusChange(object sender, MonitorStatusChangeEventArgs e) void CommunicationMonitor_StatusChange(object sender, MonitorStatusChangeEventArgs e)
{ {
var c = sender as ICommunicationMonitor; var c = sender as ICommunicationMonitor;
if (StatusListDeviceIndexes.ContainsKey(c)) if (c != null && StatusListDeviceIndexes.ContainsKey(c))
{ {
var i = StatusListDeviceIndexes[c]; var i = StatusListDeviceIndexes[c];
StatusList.UShortInputSig(i, 1).UShortValue = (ushort)e.Status; StatusList.UShortInputSig(i, 1).UShortValue = (ushort)e.Status;
} }
} }
} }
} }

View File

@@ -782,12 +782,14 @@ namespace PepperDash.Essentials.UIDrivers.VC
if (camerasCodec != null && camerasCodec.SelectedCamera != null) if (camerasCodec != null && camerasCodec.SelectedCamera != null)
{ {
Debug.Console(2, "Attempting to map camera actions to selected camera: '{0}'", camerasCodec.SelectedCamera.Key);
var dpad = CameraPtzPad; var dpad = CameraPtzPad;
var camera = camerasCodec.SelectedCamera as IHasCameraPtzControl; var camera = camerasCodec.SelectedCamera as IHasCameraPtzControl;
if (camera != null) if (camera != null)
{ {
Debug.Console(2, "Selected camera is IHasCameraPtzControl");
if (camerasCodec.SelectedCamera.CanTilt) if (camerasCodec.SelectedCamera.CanTilt)
{ {
dpad.SigUp.SetBoolSigAction((b) => dpad.SigUp.SetBoolSigAction((b) =>
@@ -852,6 +854,14 @@ namespace PepperDash.Essentials.UIDrivers.VC
} }
} }
else
{
Debug.Console(2, "Selected Camera is not IHasCameraPtzControl. No controls to map");
}
}
else
{
Debug.Console(2, "Codec does not have cameras of selected camera is null");
} }
} }

View File

@@ -1,17 +1,17 @@
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;
namespace PepperDash.Essentials.Devices.Displays namespace PepperDash.Essentials.Devices.Displays
{ {
public interface IInputHdmi1 { void InputHdmi1(); } public interface IInputHdmi1 { void InputHdmi1(); }
public interface IInputHdmi2 { void InputHdmi2(); } public interface IInputHdmi2 { void InputHdmi2(); }
public interface IInputHdmi3 { void InputHdmi3(); } public interface IInputHdmi3 { void InputHdmi3(); }
public interface IInputHdmi4 { void InputHdmi4(); } public interface IInputHdmi4 { void InputHdmi4(); }
public interface IInputDisplayPort1 { void InputDisplayPort1(); } public interface IInputDisplayPort1 { void InputDisplayPort1(); }
public interface IInputDisplayPort2 { void InputDisplayPort2(); } public interface IInputDisplayPort2 { void InputDisplayPort2(); }
public interface IInputVga1 { void InputVga1(); } public interface IInputVga1 { void InputVga1(); }
} }

View File

@@ -157,7 +157,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
{ {
get get
{ {
return () => CrestronEnvironment.ScaleWithLimits(Configuration.Audio.Output.Volume, 100, 0, 65535, 0); return () =>
{
var scaledVol = CrestronEnvironment.ScaleWithLimits(Configuration.Audio.Output.Volume, 100, 0, 65535, 0);
if (Configuration.Audio.Output.Volume != 0)
{
Debug.Console(2, this, "Storing previous volume level as: {0}, scaled: {1}", Configuration.Audio.Output.Volume, scaledVol);
_previousVolumeLevel = scaledVol; // Store the previous level for recall
}
return scaledVol;
};
} }
} }
@@ -281,7 +292,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
var handler = CameraSelected; var handler = CameraSelected;
if (handler != null) if (handler != null)
{ {
handler(this, new CameraSelectedEventArgs(SelectedCamera)); handler(this, new CameraSelectedEventArgs(_selectedCamera));
} }
} }
} }
@@ -1693,12 +1704,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public override void MuteOff() public override void MuteOff()
{ {
Debug.Console(2, this, "Unmuting to previous level: {0}", _previousVolumeLevel);
SetVolume((ushort)_previousVolumeLevel); SetVolume((ushort)_previousVolumeLevel);
} }
public override void MuteOn() public override void MuteOn()
{ {
_previousVolumeLevel = Configuration.Audio.Output.Volume; // Store the previous level for recall
SetVolume(0); SetVolume(0);
} }
@@ -2024,6 +2035,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
foreach (var cam in Status.Cameras) foreach (var cam in Status.Cameras)
{ {
// Known Issue:
// Crestron UC engine systems seem to report an item in the cameras list that represnts the USB bridge device.
// If we know the name and it's reliably consistent, we could ignore it here...
if (cam.Name.IndexOf("HD-CONV-USB") > -1)
{
// Skip this as it's the Crestron USB box, not a real camera
continue;
}
var camera = new ZoomRoomCamera(cam.id, cam.Name, this); var camera = new ZoomRoomCamera(cam.id, cam.Name, this);
Cameras.Add(camera); Cameras.Add(camera);

View File

@@ -63,6 +63,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
: base(key, name) : base(key, name)
{ {
ParentCodec = codec; ParentCodec = codec;
Capabilities = eCameraCapabilities.Pan | eCameraCapabilities.Tilt | eCameraCapabilities.Zoom;
} }
/// <summary> /// <summary>