mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-14 20:24:57 +00:00
Merge remote-tracking branch 'origin/development' into feature/vc4-fileio
This commit is contained in:
@@ -42,16 +42,17 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
|||||||
OutputPort = postActivationFunc(config);
|
OutputPort = postActivationFunc(config);
|
||||||
|
|
||||||
OutputPort.Register();
|
OutputPort.Register();
|
||||||
|
if (!OutputPort.SupportsDigitalOutput)
|
||||||
OutputPort.SetVersiportConfiguration(eVersiportConfiguration.DigitalOutput);
|
{
|
||||||
if (config.DisablePullUpResistor)
|
Debug.Console(0, this, "Device does not support configuration as a Digital Output");
|
||||||
OutputPort.DisablePullUpResistor = true;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
OutputPort.VersiportChange += OutputPort_VersiportChange;
|
OutputPort.VersiportChange += OutputPort_VersiportChange;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Debug.Console(1, this, "Created GenericVersiportDigitalInputDevice on port '{0}'. DisablePullUpResistor: '{1}'", config.PortNumber, OutputPort.DisablePullUpResistor);
|
Debug.Console(1, this, "Created GenericVersiportDigitalOutputDevice on port '{0}'.", config.PortNumber);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
using Crestron.SimplSharp.Reflection;
|
||||||
using Crestron.SimplSharpPro.CrestronThread;
|
using Crestron.SimplSharpPro.CrestronThread;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
|
|
||||||
@@ -187,9 +188,20 @@ namespace PepperDash.Essentials.Core.Queues
|
|||||||
if (_delayEnabled)
|
if (_delayEnabled)
|
||||||
Thread.Sleep(_delayTime);
|
Thread.Sleep(_delayTime);
|
||||||
}
|
}
|
||||||
|
catch (System.Threading.ThreadAbortException)
|
||||||
|
{
|
||||||
|
//swallowing this exception, as it should only happen on shut down
|
||||||
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Debug.Console(0, this, Debug.ErrorLogLevel.Error, "Caught an exception in the Queue {0}\r{1}\r{2}", ex.Message, ex.InnerException, ex.StackTrace);
|
Debug.Console(0, this, Debug.ErrorLogLevel.Error, "Caught an exception in the Queue: {1}:{0}", ex.Message, ex);
|
||||||
|
Debug.Console(2, this, Debug.ErrorLogLevel.Error, "Stack Trace: {0}", ex.StackTrace);
|
||||||
|
|
||||||
|
if (ex.InnerException != null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, Debug.ErrorLogLevel.Error, "---\r\n{0}", ex.InnerException.Message);
|
||||||
|
Debug.Console(2, this, Debug.ErrorLogLevel.Error, "Stack Trace: {0}", ex.InnerException.StackTrace);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else _waitHandle.Wait();
|
else _waitHandle.Wait();
|
||||||
@@ -202,7 +214,7 @@ namespace PepperDash.Essentials.Core.Queues
|
|||||||
{
|
{
|
||||||
if (Disposed)
|
if (Disposed)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "I've been disposed so you can't enqueue any messages. Are you trying to dispatch a message while the program is stopping?");
|
Debug.Console(1, this, "Queue has been disposed. Enqueuing messages not allowed while program is stopping.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -446,7 +458,14 @@ namespace PepperDash_Essentials_Core.Queues
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Debug.Console(0, this, Debug.ErrorLogLevel.Error, "Caught an exception in the Queue {0}\r{1}\r{2}", ex.Message, ex.InnerException, ex.StackTrace);
|
Debug.Console(0, this, Debug.ErrorLogLevel.Error, "Caught an exception in the Queue {0}", ex.Message);
|
||||||
|
Debug.Console(2, this, Debug.ErrorLogLevel.Error, "Stack Trace: {0}", ex.StackTrace);
|
||||||
|
|
||||||
|
if (ex.InnerException != null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, Debug.ErrorLogLevel.Error, "Caught an exception in the Queue {0}", ex.InnerException.Message);
|
||||||
|
Debug.Console(2, this, Debug.ErrorLogLevel.Error, "Stack Trace: {0}", ex.InnerException.StackTrace);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else _waitHandle.Wait();
|
else _waitHandle.Wait();
|
||||||
|
|||||||
@@ -59,6 +59,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
private CameraBase _selectedCamera;
|
private CameraBase _selectedCamera;
|
||||||
private string _lastDialedMeetingNumber;
|
private string _lastDialedMeetingNumber;
|
||||||
|
|
||||||
|
private CTimer contactsDebounceTimer;
|
||||||
|
|
||||||
|
|
||||||
private readonly ZoomRoomPropertiesConfig _props;
|
private readonly ZoomRoomPropertiesConfig _props;
|
||||||
|
|
||||||
@@ -1382,22 +1384,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
|
|
||||||
JsonConvert.PopulateObject(responseObj.ToString(), Status.Phonebook);
|
JsonConvert.PopulateObject(responseObj.ToString(), Status.Phonebook);
|
||||||
|
|
||||||
var directoryResults =
|
UpdateDirectory();
|
||||||
zStatus.Phonebook.ConvertZoomContactsToGeneric(Status.Phonebook.Contacts);
|
|
||||||
|
|
||||||
if (!PhonebookSyncState.InitialSyncComplete)
|
|
||||||
{
|
|
||||||
PhonebookSyncState.InitialPhonebookFoldersReceived();
|
|
||||||
PhonebookSyncState.PhonebookRootEntriesReceived();
|
|
||||||
PhonebookSyncState.SetPhonebookHasFolders(true);
|
|
||||||
PhonebookSyncState.SetNumberOfContacts(Status.Phonebook.Contacts.Count);
|
|
||||||
}
|
|
||||||
|
|
||||||
directoryResults.ResultsFolderId = "root";
|
|
||||||
|
|
||||||
DirectoryRoot = directoryResults;
|
|
||||||
|
|
||||||
CurrentDirectoryResult = directoryResults;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1526,36 +1513,37 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
{
|
{
|
||||||
case "phonebook":
|
case "phonebook":
|
||||||
{
|
{
|
||||||
|
zStatus.Contact contact = new zStatus.Contact();
|
||||||
|
|
||||||
if (responseObj["Updated Contact"] != null)
|
if (responseObj["Updated Contact"] != null)
|
||||||
{
|
{
|
||||||
var updatedContact =
|
contact = responseObj["Updated Contact"].ToObject<zStatus.Contact>();
|
||||||
JsonConvert.DeserializeObject<zStatus.Contact>(
|
|
||||||
responseObj["Updated Contact"].ToString());
|
|
||||||
|
|
||||||
var existingContact =
|
|
||||||
Status.Phonebook.Contacts.FirstOrDefault(c => c.Jid.Equals(updatedContact.Jid));
|
|
||||||
|
|
||||||
if (existingContact != null)
|
|
||||||
{
|
|
||||||
// Update existing contact
|
|
||||||
JsonConvert.PopulateObject(responseObj["Updated Contact"].ToString(),
|
|
||||||
existingContact);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (responseObj["Added Contact"] != null)
|
else if (responseObj["Added Contact"] != null)
|
||||||
{
|
{
|
||||||
var jToken = responseObj["Updated Contact"];
|
contact = responseObj["Added Contact"].ToObject<zStatus.Contact>();
|
||||||
if (jToken != null)
|
|
||||||
{
|
|
||||||
var newContact =
|
|
||||||
JsonConvert.DeserializeObject<zStatus.Contact>(
|
|
||||||
jToken.ToString());
|
|
||||||
|
|
||||||
// Add a new contact
|
|
||||||
Status.Phonebook.Contacts.Add(newContact);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var existingContactIndex = Status.Phonebook.Contacts.FindIndex(c => c.Jid.Equals(contact.Jid));
|
||||||
|
|
||||||
|
if (existingContactIndex > 0)
|
||||||
|
{
|
||||||
|
Status.Phonebook.Contacts[existingContactIndex] = contact;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Status.Phonebook.Contacts.Add(contact);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(contactsDebounceTimer == null)
|
||||||
|
{
|
||||||
|
contactsDebounceTimer = new CTimer(o => UpdateDirectory(), 2000);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
contactsDebounceTimer.Reset();
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "bookingslistresult":
|
case "bookingslistresult":
|
||||||
@@ -2252,6 +2240,42 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void UpdateDirectory()
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Updating directory");
|
||||||
|
var directoryResults = zStatus.Phonebook.ConvertZoomContactsToGeneric(Status.Phonebook.Contacts);
|
||||||
|
|
||||||
|
if (!PhonebookSyncState.InitialSyncComplete)
|
||||||
|
{
|
||||||
|
PhonebookSyncState.InitialPhonebookFoldersReceived();
|
||||||
|
PhonebookSyncState.PhonebookRootEntriesReceived();
|
||||||
|
PhonebookSyncState.SetPhonebookHasFolders(true);
|
||||||
|
PhonebookSyncState.SetNumberOfContacts(Status.Phonebook.Contacts.Count);
|
||||||
|
}
|
||||||
|
|
||||||
|
directoryResults.ResultsFolderId = "root";
|
||||||
|
|
||||||
|
DirectoryRoot = directoryResults;
|
||||||
|
|
||||||
|
CurrentDirectoryResult = directoryResults;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (contactsDebounceTimer != null)
|
||||||
|
{
|
||||||
|
ClearContactDebounceTimer();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ClearContactDebounceTimer()
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Clearing Timer");
|
||||||
|
if (!contactsDebounceTimer.Disposed && contactsDebounceTimer != null)
|
||||||
|
{
|
||||||
|
contactsDebounceTimer.Dispose();
|
||||||
|
contactsDebounceTimer = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Will return true if the host is myself (this zoom room)
|
/// Will return true if the host is myself (this zoom room)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user