mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 20:54:55 +00:00
Merge pull request #913 from PepperDash/feature/cleanup-debug-statements
Feature/cleanup debug statements
This commit is contained in:
@@ -493,10 +493,10 @@ namespace PepperDash.Essentials
|
|||||||
// and the LastMeetingDismissed != this meeting
|
// and the LastMeetingDismissed != this meeting
|
||||||
|
|
||||||
var lastMeetingDismissed = meetings.FirstOrDefault(m => m.Id == LastMeetingDismissedId);
|
var lastMeetingDismissed = meetings.FirstOrDefault(m => m.Id == LastMeetingDismissedId);
|
||||||
Debug.Console(0, "*#* Room on: {0}, lastMeetingDismissedId: {1} {2} *#*",
|
//Debug.Console(0, "*#* Room on: {0}, lastMeetingDismissedId: {1} {2} *#*",
|
||||||
CurrentRoom.OnFeedback.BoolValue,
|
// CurrentRoom.OnFeedback.BoolValue,
|
||||||
LastMeetingDismissedId,
|
// LastMeetingDismissedId,
|
||||||
lastMeetingDismissed != null ? lastMeetingDismissed.StartTime.ToString("t", Global.Culture) : "");
|
// lastMeetingDismissed != null ? lastMeetingDismissed.StartTime.ToString("t", Global.Culture) : "");
|
||||||
|
|
||||||
var meeting = meetings.LastOrDefault(m => m.Joinable);
|
var meeting = meetings.LastOrDefault(m => m.Joinable);
|
||||||
if (CurrentRoom.OnFeedback.BoolValue
|
if (CurrentRoom.OnFeedback.BoolValue
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
var prevJoin = CurrentJoin;
|
var prevJoin = CurrentJoin;
|
||||||
var wasShown = _IsShown;
|
var wasShown = _IsShown;
|
||||||
Debug.Console(2, "Trilist {0:X2}, interlock swapping {1} for {2}", TriList.ID, CurrentJoin, join);
|
//Debug.Console(2, "Trilist {0:X2}, interlock swapping {1} for {2}", TriList.ID, CurrentJoin, join);
|
||||||
if (CurrentJoin == join && TriList.BooleanInput[join].BoolValue)
|
if (CurrentJoin == join && TriList.BooleanInput[join].BoolValue)
|
||||||
return;
|
return;
|
||||||
SetButDontShow(join);
|
SetButDontShow(join);
|
||||||
@@ -71,7 +71,7 @@ namespace PepperDash.Essentials
|
|||||||
var prevJoin = CurrentJoin;
|
var prevJoin = CurrentJoin;
|
||||||
var wasShown = IsShown;
|
var wasShown = IsShown;
|
||||||
|
|
||||||
Debug.Console(2, "Trilist {0:X2}, interlock swapping {1} for {2}", TriList.ID, CurrentJoin, join);
|
//Debug.Console(2, "Trilist {0:X2}, interlock swapping {1} for {2}", TriList.ID, CurrentJoin, join);
|
||||||
if (CurrentJoin == join)
|
if (CurrentJoin == join)
|
||||||
HideAndClear();
|
HideAndClear();
|
||||||
else
|
else
|
||||||
@@ -92,7 +92,7 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
var prevJoin = CurrentJoin;
|
var prevJoin = CurrentJoin;
|
||||||
var wasShown = IsShown;
|
var wasShown = IsShown;
|
||||||
Debug.Console(2, "Trilist {0:X2}, interlock hiding {1}", TriList.ID, CurrentJoin);
|
//Debug.Console(2, "Trilist {0:X2}, interlock hiding {1}", TriList.ID, CurrentJoin);
|
||||||
Hide();
|
Hide();
|
||||||
CurrentJoin = 0;
|
CurrentJoin = 0;
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ namespace PepperDash.Essentials
|
|||||||
var prevJoin = CurrentJoin;
|
var prevJoin = CurrentJoin;
|
||||||
var wasShown = IsShown;
|
var wasShown = IsShown;
|
||||||
|
|
||||||
Debug.Console(2, "Trilist {0:X2}, interlock hiding {1}", TriList.ID, CurrentJoin);
|
//Debug.Console(2, "Trilist {0:X2}, interlock hiding {1}", TriList.ID, CurrentJoin);
|
||||||
if (CurrentJoin > 0)
|
if (CurrentJoin > 0)
|
||||||
{
|
{
|
||||||
TriList.BooleanInput[CurrentJoin].BoolValue = false;
|
TriList.BooleanInput[CurrentJoin].BoolValue = false;
|
||||||
@@ -125,7 +125,7 @@ namespace PepperDash.Essentials
|
|||||||
var prevJoin = CurrentJoin;
|
var prevJoin = CurrentJoin;
|
||||||
var wasShown = IsShown;
|
var wasShown = IsShown;
|
||||||
|
|
||||||
Debug.Console(2, "Trilist {0:X2}, interlock showing {1}", TriList.ID, CurrentJoin);
|
//Debug.Console(2, "Trilist {0:X2}, interlock showing {1}", TriList.ID, CurrentJoin);
|
||||||
if (CurrentJoin > 0)
|
if (CurrentJoin > 0)
|
||||||
{
|
{
|
||||||
TriList.BooleanInput[CurrentJoin].BoolValue = true;
|
TriList.BooleanInput[CurrentJoin].BoolValue = true;
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
public override void Show()
|
public override void Show()
|
||||||
{
|
{
|
||||||
Debug.Console(2, "Showing ScreenSaverController: {0:X2}", TriList.ID);
|
//Debug.Console(2, "Showing ScreenSaverController: {0:X2}", TriList.ID);
|
||||||
|
|
||||||
if (_parent.AvDriver != null)
|
if (_parent.AvDriver != null)
|
||||||
{
|
{
|
||||||
@@ -67,11 +67,11 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
public override void Hide()
|
public override void Hide()
|
||||||
{
|
{
|
||||||
Debug.Console(2, "Hiding ScreenSaverController: {0:X2}", TriList.ID);
|
//Debug.Console(2, "Hiding ScreenSaverController: {0:X2}", TriList.ID);
|
||||||
|
|
||||||
if (PositionTimer != null)
|
if (PositionTimer != null)
|
||||||
{
|
{
|
||||||
Debug.Console(2, "Stopping PositionTimer: {0:X2}", TriList.ID);
|
//Debug.Console(2, "Stopping PositionTimer: {0:X2}", TriList.ID);
|
||||||
PositionTimer.Stop();
|
PositionTimer.Stop();
|
||||||
PositionTimer.Dispose();
|
PositionTimer.Dispose();
|
||||||
PositionTimer = null;
|
PositionTimer = null;
|
||||||
@@ -89,7 +89,7 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
void StartPositionTimer()
|
void StartPositionTimer()
|
||||||
{
|
{
|
||||||
Debug.Console(2, "Starting Position Timer: {0:X2}", TriList.ID);
|
//Debug.Console(2, "Starting Position Timer: {0:X2}", TriList.ID);
|
||||||
|
|
||||||
if (PositionTimer == null)
|
if (PositionTimer == null)
|
||||||
{
|
{
|
||||||
@@ -122,7 +122,7 @@ namespace PepperDash.Essentials
|
|||||||
CurrentPositionIndex = 0;
|
CurrentPositionIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.Console(2, "ScreenSaver Position Timer Expired: Setting new position: {0} ID: {1:X2}", CurrentPositionIndex, TriList.ID);
|
//Debug.Console(2, "ScreenSaver Position Timer Expired: Setting new position: {0} ID: {1:X2}", CurrentPositionIndex, TriList.ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -134,7 +134,7 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
void ClearAllPositions()
|
void ClearAllPositions()
|
||||||
{
|
{
|
||||||
Debug.Console(2, "Hiding all screensaver positions: {0:X2}", TriList.ID);
|
//Debug.Console(2, "Hiding all screensaver positions: {0:X2}", TriList.ID);
|
||||||
|
|
||||||
PositionInterlock.HideAndClear();
|
PositionInterlock.HideAndClear();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,11 +16,28 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Used for monitoring comms that are IBasicCommunication. Will send a poll string and provide an event when
|
/// Used for monitoring comms that are IBasicCommunication. Will send a poll string and provide an event when
|
||||||
/// statuses change.
|
/// statuses change.
|
||||||
|
/// Default monitoring uses TextReceived event on Client.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class GenericCommunicationMonitor : StatusMonitorBase
|
public class GenericCommunicationMonitor : StatusMonitorBase
|
||||||
{
|
{
|
||||||
public IBasicCommunication Client { get; private set; }
|
public IBasicCommunication Client { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Will monitor Client.BytesReceived if set to true. Otherwise the default is to monitor Client.TextReceived
|
||||||
|
/// </summary>
|
||||||
|
public bool MonitorBytesReceived { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Return true if the Client is ISocketStatus
|
||||||
|
/// </summary>
|
||||||
|
public bool IsSocket
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Client is ISocketStatus;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
long PollTime;
|
long PollTime;
|
||||||
CTimer PollTimer;
|
CTimer PollTimer;
|
||||||
string PollString;
|
string PollString;
|
||||||
@@ -46,8 +63,20 @@ namespace PepperDash.Essentials.Core
|
|||||||
Client = client;
|
Client = client;
|
||||||
PollTime = pollTime;
|
PollTime = pollTime;
|
||||||
PollString = pollString;
|
PollString = pollString;
|
||||||
|
|
||||||
|
if (IsSocket)
|
||||||
|
{
|
||||||
|
(Client as ISocketStatus).ConnectionChange += new EventHandler<GenericSocketStatusChageEventArgs>(socket_ConnectionChange);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GenericCommunicationMonitor(IKeyed parent, IBasicCommunication client, long pollTime,
|
||||||
|
long warningTime, long errorTime, string pollString, bool monitorBytesReceived) :
|
||||||
|
this(parent, client, pollTime, warningTime, errorTime, pollString)
|
||||||
|
{
|
||||||
|
SetMonitorBytesReceived(monitorBytesReceived);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Poll is a provided action instead of string
|
/// Poll is a provided action instead of string
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -69,6 +98,19 @@ namespace PepperDash.Essentials.Core
|
|||||||
Client = client;
|
Client = client;
|
||||||
PollTime = pollTime;
|
PollTime = pollTime;
|
||||||
PollAction = pollAction;
|
PollAction = pollAction;
|
||||||
|
|
||||||
|
if (IsSocket)
|
||||||
|
{
|
||||||
|
(Client as ISocketStatus).ConnectionChange += new EventHandler<GenericSocketStatusChageEventArgs>(socket_ConnectionChange);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public GenericCommunicationMonitor(IKeyed parent, IBasicCommunication client, long pollTime,
|
||||||
|
long warningTime, long errorTime, Action pollAction, bool monitorBytesReceived) :
|
||||||
|
this(parent, client, pollTime, warningTime, errorTime, pollAction)
|
||||||
|
{
|
||||||
|
SetMonitorBytesReceived(monitorBytesReceived);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -79,23 +121,96 @@ namespace PepperDash.Essentials.Core
|
|||||||
CommunicationMonitorConfig props) :
|
CommunicationMonitorConfig props) :
|
||||||
this(parent, client, props.PollInterval, props.TimeToWarning, props.TimeToError, props.PollString)
|
this(parent, client, props.PollInterval, props.TimeToWarning, props.TimeToError, props.PollString)
|
||||||
{
|
{
|
||||||
|
if (IsSocket)
|
||||||
|
{
|
||||||
|
(Client as ISocketStatus).ConnectionChange += new EventHandler<GenericSocketStatusChageEventArgs>(socket_ConnectionChange);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Builds the monitor from a config object and takes a bool to specify whether to monitor BytesReceived
|
||||||
|
/// Default is to monitor TextReceived
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parent"></param>
|
||||||
|
/// <param name="client"></param>
|
||||||
|
/// <param name="props"></param>
|
||||||
|
/// <param name="monitorBytesReceived"></param>
|
||||||
|
public GenericCommunicationMonitor(IKeyed parent, IBasicCommunication client, CommunicationMonitorConfig props, bool monitorBytesReceived) :
|
||||||
|
this(parent, client, props.PollInterval, props.TimeToWarning, props.TimeToError, props.PollString)
|
||||||
|
{
|
||||||
|
SetMonitorBytesReceived(monitorBytesReceived);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetMonitorBytesReceived(bool monitorBytesReceived)
|
||||||
|
{
|
||||||
|
MonitorBytesReceived = monitorBytesReceived;
|
||||||
|
}
|
||||||
|
|
||||||
public override void Start()
|
public override void Start()
|
||||||
{
|
{
|
||||||
Client.BytesReceived += Client_BytesReceived;
|
if (MonitorBytesReceived)
|
||||||
Poll();
|
{
|
||||||
PollTimer = new CTimer(o => Poll(), null, PollTime, PollTime);
|
Client.BytesReceived += Client_BytesReceived;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Client.TextReceived += Client_TextReceived;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!IsSocket)
|
||||||
|
{
|
||||||
|
BeginPolling();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e)
|
||||||
|
{
|
||||||
|
if (!e.Client.IsConnected)
|
||||||
|
{
|
||||||
|
// Immediately stop polling and notify that device is offline
|
||||||
|
Stop();
|
||||||
|
Status = MonitorStatus.InError;
|
||||||
|
ResetErrorTimers();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Start polling and set status to unknow and let poll result update the status to IsOk when a response is received
|
||||||
|
Status = MonitorStatus.StatusUnknown;
|
||||||
|
Start();
|
||||||
|
BeginPolling();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void BeginPolling()
|
||||||
|
{
|
||||||
|
Poll();
|
||||||
|
PollTimer = new CTimer(o => Poll(), null, PollTime, PollTime);
|
||||||
|
}
|
||||||
|
|
||||||
public override void Stop()
|
public override void Stop()
|
||||||
{
|
{
|
||||||
Client.BytesReceived -= this.Client_BytesReceived;
|
if(MonitorBytesReceived)
|
||||||
PollTimer.Stop();
|
{
|
||||||
PollTimer = null;
|
Client.BytesReceived -= this.Client_BytesReceived;
|
||||||
StopErrorTimers();
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Client.TextReceived -= Client_TextReceived;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PollTimer != null)
|
||||||
|
{
|
||||||
|
PollTimer.Stop();
|
||||||
|
PollTimer = null;
|
||||||
|
StopErrorTimers();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Client_TextReceived(object sender, GenericCommMethodReceiveTextArgs e)
|
||||||
|
{
|
||||||
|
DataReceived();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Upon any receipt of data, set everything to ok!
|
/// Upon any receipt of data, set everything to ok!
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -103,10 +218,14 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
void Client_BytesReceived(object sender, GenericCommMethodReceiveBytesArgs e)
|
void Client_BytesReceived(object sender, GenericCommMethodReceiveBytesArgs e)
|
||||||
{
|
{
|
||||||
Status = MonitorStatus.IsOk;
|
DataReceived();
|
||||||
ResetErrorTimers();
|
}
|
||||||
//
|
|
||||||
}
|
void DataReceived()
|
||||||
|
{
|
||||||
|
Status = MonitorStatus.IsOk;
|
||||||
|
ResetErrorTimers();
|
||||||
|
}
|
||||||
|
|
||||||
void Poll()
|
void Poll()
|
||||||
{
|
{
|
||||||
@@ -124,19 +243,6 @@ namespace PepperDash.Essentials.Core
|
|||||||
Debug.Console(2, this, "Comm not connected");
|
Debug.Console(2, this, "Comm not connected");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// When the client connects, and we're waiting for it, respond and disconect from event
|
|
||||||
/// </summary>
|
|
||||||
void OneTimeConnectHandler(object o, EventArgs a)
|
|
||||||
{
|
|
||||||
if (Client.IsConnected)
|
|
||||||
{
|
|
||||||
//Client.IsConnected -= OneTimeConnectHandler;
|
|
||||||
Debug.Console(2, this, "Comm connected");
|
|
||||||
Poll();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
|||||||
|
|
||||||
public abstract class CameraBase : ReconfigurableDevice, IRoutingOutputs
|
public abstract class CameraBase : ReconfigurableDevice, IRoutingOutputs
|
||||||
{
|
{
|
||||||
|
[JsonProperty("controlMode", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public eCameraControlMode ControlMode { get; protected set; }
|
public eCameraControlMode ControlMode { get; protected set; }
|
||||||
|
|
||||||
#region IRoutingOutputs Members
|
#region IRoutingOutputs Members
|
||||||
@@ -37,6 +38,7 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
[JsonProperty("canPan", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public bool CanPan
|
public bool CanPan
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -44,7 +46,7 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
|||||||
return (Capabilities & eCameraCapabilities.Pan) == eCameraCapabilities.Pan;
|
return (Capabilities & eCameraCapabilities.Pan) == eCameraCapabilities.Pan;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
[JsonProperty("canTilt", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public bool CanTilt
|
public bool CanTilt
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -52,7 +54,7 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
|||||||
return (Capabilities & eCameraCapabilities.Tilt) == eCameraCapabilities.Tilt;
|
return (Capabilities & eCameraCapabilities.Tilt) == eCameraCapabilities.Tilt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
[JsonProperty("canZoom", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public bool CanZoom
|
public bool CanZoom
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -60,7 +62,7 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
|||||||
return (Capabilities & eCameraCapabilities.Zoom) == eCameraCapabilities.Zoom;
|
return (Capabilities & eCameraCapabilities.Zoom) == eCameraCapabilities.Zoom;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
[JsonProperty("canFocus", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public bool CanFocus
|
public bool CanFocus
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|||||||
@@ -57,6 +57,11 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
|||||||
void CameraMuteToggle();
|
void CameraMuteToggle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public interface IHasCameraMuteWithUnmuteReqeust : IHasCameraMute
|
||||||
|
{
|
||||||
|
event EventHandler VideoUnmuteRequested;
|
||||||
|
}
|
||||||
|
|
||||||
public class CameraSelectedEventArgs : EventArgs
|
public class CameraSelectedEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
public CameraBase SelectedCamera { get; private set; }
|
public CameraBase SelectedCamera { get; private set; }
|
||||||
|
|||||||
@@ -65,8 +65,9 @@ namespace PepperDash.Essentials.Devices.Common.Codec
|
|||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents the contents of the directory
|
/// Represents the contents of the directory
|
||||||
|
/// We don't want to serialize this for messages to MobileControl. MC can combine Contacts and Folders to get the same data
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("directoryResults")]
|
[JsonIgnore]
|
||||||
public List<DirectoryItem> CurrentDirectoryResults { get; private set; }
|
public List<DirectoryItem> CurrentDirectoryResults { get; private set; }
|
||||||
|
|
||||||
[JsonProperty("contacts")]
|
[JsonProperty("contacts")]
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ namespace PepperDash.Essentials.Devices.Displays
|
|||||||
WarmupTime = 10000;
|
WarmupTime = 10000;
|
||||||
CooldownTime = 8000;
|
CooldownTime = 8000;
|
||||||
|
|
||||||
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 2000, 120000, 300000, StatusGet);
|
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 2000, 120000, 300000, StatusGet, true);
|
||||||
DeviceManager.AddDevice(CommunicationMonitor);
|
DeviceManager.AddDevice(CommunicationMonitor);
|
||||||
|
|
||||||
VolumeIncrementer = new ActionIncrementer(655, 0, 65535, 800, 80,
|
VolumeIncrementer = new ActionIncrementer(655, 0, 65535, 800, 80,
|
||||||
|
|||||||
@@ -359,7 +359,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 30000, 120000, 300000, "xStatus SystemUnit Software Version\r\n");
|
var command = string.Format("xCommand Peripherals HeartBeat ID: {0}{1}", CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_MAC_ADDRESS, Delimiter);
|
||||||
|
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 30000, 120000, 300000, command);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.Sharing != null)
|
if (props.Sharing != null)
|
||||||
|
|||||||
@@ -24,23 +24,25 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
{
|
{
|
||||||
public class ZoomRoom : VideoCodecBase, IHasCodecSelfView, IHasDirectoryHistoryStack, ICommunicationMonitor,
|
public class ZoomRoom : VideoCodecBase, IHasCodecSelfView, IHasDirectoryHistoryStack, ICommunicationMonitor,
|
||||||
IRouting,
|
IRouting,
|
||||||
IHasScheduleAwareness, IHasCodecCameras, IHasParticipants, IHasCameraOff, IHasCameraMute, IHasCameraAutoMode,
|
IHasScheduleAwareness, IHasCodecCameras, IHasParticipants, IHasCameraOff, IHasCameraMuteWithUnmuteReqeust, IHasCameraAutoMode,
|
||||||
IHasFarEndContentStatus, IHasSelfviewPosition, IHasPhoneDialing, IHasZoomRoomLayouts, IHasParticipantPinUnpin,
|
IHasFarEndContentStatus, IHasSelfviewPosition, IHasPhoneDialing, IHasZoomRoomLayouts, IHasParticipantPinUnpin,
|
||||||
IHasParticipantAudioMute, IHasSelfviewSize, IPasswordPrompt, IHasStartMeeting, IHasMeetingInfo, IHasPresentationOnlyMeeting,
|
IHasParticipantAudioMute, IHasSelfviewSize, IPasswordPrompt, IHasStartMeeting, IHasMeetingInfo, IHasPresentationOnlyMeeting,
|
||||||
IHasMeetingLock, IHasMeetingRecording
|
IHasMeetingLock, IHasMeetingRecording
|
||||||
{
|
{
|
||||||
|
public event EventHandler VideoUnmuteRequested;
|
||||||
|
|
||||||
private const long MeetingRefreshTimer = 60000;
|
private const long MeetingRefreshTimer = 60000;
|
||||||
public uint DefaultMeetingDurationMin { get; private set; }
|
public uint DefaultMeetingDurationMin { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// CR LF
|
/// CR LF CR LF Delimits an echoed response to a command
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private const string EchoDelimiter = "\x0D\x0A\x0D\x0A";
|
private const string EchoDelimiter = "\x0D\x0A\x0D\x0A";
|
||||||
|
|
||||||
private const string SendDelimiter = "\x0D";
|
private const string SendDelimiter = "\x0D";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// CR LF } CR LF
|
/// CR LF } CR LF Delimits a JSON response
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private const string JsonDelimiter = "\x0D\x0A\x7D\x0D\x0A";
|
private const string JsonDelimiter = "\x0D\x0A\x7D\x0D\x0A";
|
||||||
|
|
||||||
@@ -342,6 +344,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
{
|
{
|
||||||
Debug.Console(1, this, "Selected Camera with key: '{0}'", camera.Key);
|
Debug.Console(1, this, "Selected Camera with key: '{0}'", camera.Key);
|
||||||
SelectedCamera = camera;
|
SelectedCamera = camera;
|
||||||
|
|
||||||
|
if (CameraIsMutedFeedback.BoolValue)
|
||||||
|
{
|
||||||
|
CameraMuteOff();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -400,10 +407,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
{
|
{
|
||||||
_currentDirectoryResult = value;
|
_currentDirectoryResult = value;
|
||||||
|
|
||||||
Debug.Console(2, this, "CurrentDirectoryResult Updated. ResultsFolderId: {0}",
|
Debug.Console(2, this, "CurrentDirectoryResult Updated. ResultsFolderId: {0} Contact Count: {1}",
|
||||||
_currentDirectoryResult.ResultsFolderId);
|
_currentDirectoryResult.ResultsFolderId, _currentDirectoryResult.CurrentDirectoryResults.Count);
|
||||||
|
|
||||||
CurrentDirectoryResultIsNotDirectoryRoot.FireUpdate();
|
|
||||||
|
|
||||||
OnDirectoryResultReturned(_currentDirectoryResult);
|
OnDirectoryResultReturned(_currentDirectoryResult);
|
||||||
}
|
}
|
||||||
@@ -1305,6 +1310,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
// This result will always be the complete contents of the directory and never
|
// This result will always be the complete contents of the directory and never
|
||||||
// A subset of the results via a search
|
// A subset of the results via a search
|
||||||
|
|
||||||
|
// Clear out any existing data
|
||||||
|
Status.Phonebook = new zStatus.Phonebook();
|
||||||
|
|
||||||
JsonConvert.PopulateObject(responseObj.ToString(), Status.Phonebook);
|
JsonConvert.PopulateObject(responseObj.ToString(), Status.Phonebook);
|
||||||
|
|
||||||
var directoryResults =
|
var directoryResults =
|
||||||
@@ -1318,10 +1326,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
PhonebookSyncState.SetNumberOfContacts(Status.Phonebook.Contacts.Count);
|
PhonebookSyncState.SetNumberOfContacts(Status.Phonebook.Contacts.Count);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (directoryResults.ResultsFolderId != "root")
|
directoryResults.ResultsFolderId = "root";
|
||||||
{
|
|
||||||
directoryResults.ResultsFolderId = "root";
|
|
||||||
}
|
|
||||||
|
|
||||||
DirectoryRoot = directoryResults;
|
DirectoryRoot = directoryResults;
|
||||||
|
|
||||||
@@ -1608,7 +1613,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
}
|
}
|
||||||
case "videounmuterequest":
|
case "videounmuterequest":
|
||||||
{
|
{
|
||||||
// TODO: notify room of a request to unmute video
|
var handler = VideoUnmuteRequested;
|
||||||
|
|
||||||
|
if (handler != null)
|
||||||
|
{
|
||||||
|
handler(this, null);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "meetingneedspassword":
|
case "meetingneedspassword":
|
||||||
@@ -1841,6 +1852,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
}
|
}
|
||||||
case "video camera line":
|
case "video camera line":
|
||||||
{
|
{
|
||||||
|
Status.Cameras.Clear();
|
||||||
|
|
||||||
JsonConvert.PopulateObject(responseObj.ToString(), Status.Cameras);
|
JsonConvert.PopulateObject(responseObj.ToString(), Status.Cameras);
|
||||||
|
|
||||||
if (!_syncState.CamerasHaveBeenSetUp)
|
if (!_syncState.CamerasHaveBeenSetUp)
|
||||||
@@ -2696,27 +2709,27 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "OnDirectoryResultReturned");
|
Debug.Console(2, this, "OnDirectoryResultReturned. Result has {0} contacts", result.Contacts.Count);
|
||||||
|
|
||||||
var directoryResult = new CodecDirectory();
|
var directoryResult = result;
|
||||||
|
|
||||||
// If result is Root, create a copy and filter out contacts whose parent folder is not root
|
// If result is Root, create a copy and filter out contacts whose parent folder is not root
|
||||||
if (!CurrentDirectoryResultIsNotDirectoryRoot.BoolValue)
|
//if (!CurrentDirectoryResultIsNotDirectoryRoot.BoolValue)
|
||||||
{
|
//{
|
||||||
Debug.Console(2, this, "Filtering DirectoryRoot to remove contacts for display");
|
// Debug.Console(2, this, "Filtering DirectoryRoot to remove contacts for display");
|
||||||
|
|
||||||
directoryResult.ResultsFolderId = result.ResultsFolderId;
|
// directoryResult.ResultsFolderId = result.ResultsFolderId;
|
||||||
directoryResult.AddFoldersToDirectory(result.Folders);
|
// directoryResult.AddFoldersToDirectory(result.Folders);
|
||||||
directoryResult.AddContactsToDirectory(
|
// directoryResult.AddContactsToDirectory(
|
||||||
result.Contacts.Where((c) => c.ParentFolderId == result.ResultsFolderId).ToList());
|
// result.Contacts.Where((c) => c.ParentFolderId == result.ResultsFolderId).ToList());
|
||||||
}
|
//}
|
||||||
else
|
//else
|
||||||
{
|
//{
|
||||||
directoryResult = result;
|
// directoryResult = result;
|
||||||
}
|
//}
|
||||||
|
|
||||||
Debug.Console(2, this, "Updating directoryResult. IsOnRoot: {0}",
|
Debug.Console(2, this, "Updating directoryResult. IsOnRoot: {0} Contact Count: {1}",
|
||||||
!CurrentDirectoryResultIsNotDirectoryRoot.BoolValue);
|
!CurrentDirectoryResultIsNotDirectoryRoot.BoolValue, directoryResult.Contacts.Count);
|
||||||
|
|
||||||
// This will return the latest results to all UIs. Multiple indendent UI Directory browsing will require a different methodology
|
// This will return the latest results to all UIs. Multiple indendent UI Directory browsing will require a different methodology
|
||||||
var handler = DirectoryResultReturned;
|
var handler = DirectoryResultReturned;
|
||||||
@@ -2728,6 +2741,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
DirectoryIsOnRoot = !CurrentDirectoryResultIsNotDirectoryRoot.BoolValue
|
DirectoryIsOnRoot = !CurrentDirectoryResultIsNotDirectoryRoot.BoolValue
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CurrentDirectoryResultIsNotDirectoryRoot.FireUpdate();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -2758,14 +2773,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var camera = new ZoomRoomCamera(cam.id, cam.Name, this);
|
var existingCam = Cameras.FirstOrDefault((c) => c.Key.Equals(cam.id));
|
||||||
|
|
||||||
Cameras.Add(camera);
|
if (existingCam == null)
|
||||||
|
{
|
||||||
|
var camera = new ZoomRoomCamera(cam.id, cam.Name, this);
|
||||||
|
|
||||||
if (cam.Selected)
|
Cameras.Add(camera);
|
||||||
{
|
|
||||||
SelectedCamera = camera;
|
if (cam.Selected)
|
||||||
}
|
{
|
||||||
|
SelectedCamera = camera;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsInCall)
|
if (IsInCall)
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ using Crestron.SimplSharpPro.DeviceSupport;
|
|||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
using PepperDash.Essentials.Devices.Common.Cameras;
|
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||||
{
|
{
|
||||||
public enum eZoomRoomCameraState
|
public enum eZoomRoomCameraState
|
||||||
@@ -34,7 +36,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
{
|
{
|
||||||
protected ZoomRoom ParentCodec { get; private set; }
|
protected ZoomRoom ParentCodec { get; private set; }
|
||||||
|
|
||||||
public int Id = 0; // ID of near end selected camara is always 0
|
[JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
|
public int? Id = 0; // ID of near end selected camara is always 0
|
||||||
|
|
||||||
private int ContinueTime = 10; // number of milliseconds between issuing continue commands
|
private int ContinueTime = 10; // number of milliseconds between issuing continue commands
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user