got it building...

This commit is contained in:
Andrew Welker
2020-11-19 14:16:34 -07:00
parent ef215e8b16
commit f3ddce99d5
21 changed files with 1260 additions and 766 deletions

View File

@@ -46,6 +46,13 @@ namespace PepperDash.Essentials.Core.Devices.Codec
RecentCalls = new List<CallHistoryEntry> {_listEmptyEntry};
}
public void UpdateRecentCallsList(List<CallHistoryEntry> entries)
{
RecentCalls = entries;
OnRecentCallsListChange();
}
private void OnRecentCallsListChange()
{
var handler = RecentCallsListHasChanged;

View File

@@ -22,24 +22,32 @@ namespace PepperDash.Essentials.Core.Devices.Codec
public class CodecScheduleAwareness
{
List<Meeting> _Meetings;
List<Meeting> _meetings;
public event EventHandler<MeetingEventArgs> MeetingEventChange;
public event EventHandler<EventArgs> MeetingsListHasChanged;
/// <summary>
/// Setter triggers MeetingsListHasChanged event
/// </summary>
private int _meetingWarningMinutes = 5;
public int MeetingWarningMinutes
{
get { return _meetingWarningMinutes; }
set { _meetingWarningMinutes = value; }
}
/// <summary>
/// Setter triggers MeetingsListHasChanged event
/// </summary>
public List<Meeting> Meetings
{
get
{
return _Meetings;
return _meetings;
}
set
{
_Meetings = value;
_meetings = value;
var handler = MeetingsListHasChanged;
if (handler != null)
@@ -49,13 +57,20 @@ namespace PepperDash.Essentials.Core.Devices.Codec
}
}
private CTimer ScheduleChecker;
private CTimer _scheduleChecker;
public CodecScheduleAwareness()
{
Meetings = new List<Meeting>();
ScheduleChecker = new CTimer(CheckSchedule, null, 1000, 1000);
_scheduleChecker = new CTimer(CheckSchedule, null, 1000, 1000);
}
public CodecScheduleAwareness(long pollTime)
{
Meetings = new List<Meeting>();
_scheduleChecker = new CTimer(CheckSchedule, null, pollTime, pollTime);
}
private void OnMeetingChange(eMeetingEventChangeType changeType, Meeting meeting)
@@ -72,9 +87,9 @@ namespace PepperDash.Essentials.Core.Devices.Codec
// Iterate the meeting list and check if any meeting need to do anythingk
const double meetingTimeEpsilon = 0.0001;
foreach (Meeting m in Meetings)
foreach (var m in Meetings)
{
eMeetingEventChangeType changeType = eMeetingEventChangeType.Unkown;
var changeType = eMeetingEventChangeType.Unkown;
if (m.TimeToMeetingStart.TotalMinutes <= m.MeetingWarningMinutes.TotalMinutes) // Meeting is about to start
changeType = eMeetingEventChangeType.MeetingStartWarning;
@@ -98,12 +113,17 @@ namespace PepperDash.Essentials.Core.Devices.Codec
/// </summary>
public class Meeting
{
public TimeSpan MeetingWarningMinutes = TimeSpan.FromMinutes(5);
public int MinutesBeforeMeeting;
public string Id { get; set; }
public string Organizer { get; set; }
public string Title { get; set; }
public string Agenda { get; set; }
public TimeSpan MeetingWarningMinutes
{
get { return TimeSpan.FromMinutes(MinutesBeforeMeeting); }
}
public TimeSpan TimeToMeetingStart
{
get
@@ -132,7 +152,7 @@ namespace PepperDash.Essentials.Core.Devices.Codec
{
get
{
return StartTime.AddMinutes(-5) <= DateTime.Now
return StartTime.AddMinutes(-MinutesBeforeMeeting) <= DateTime.Now
&& DateTime.Now <= EndTime; //.AddMinutes(-5);
}
}

View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Devices.Common.Cameras
{
/// <summary>
/// Describes a camera with preset functionality
/// </summary>
public interface IHasCameraPresets
{
event EventHandler<EventArgs> PresetsListHasChanged;
List<CameraPreset> Presets { get; }
void PresetSelect(int preset);
void PresetStore(int preset, string description);
}
}

View File

@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core.Presets;
namespace PepperDash.Essentials.Devices.Common.VideoCodec
{
/// <summary>
/// Interface for camera presets
/// </summary>
public interface IHasCodecRoomPresets
{
event EventHandler<EventArgs> CodecRoomPresetsListHasChanged;
List<CodecRoomPreset> NearEndPresets { get; }
List<CodecRoomPreset> FarEndRoomPresets { get; }
void CodecRoomPresetSelect(int preset);
void CodecRoomPresetStore(int preset, string description);
}
/// <summary>
/// Represents a room preset on a video codec. Typically stores camera position(s) and video routing. Can be recalled by Far End if enabled.
/// </summary>
public class CodecRoomPreset : PresetBase
{
public CodecRoomPreset(int id, string description, bool def, bool isDef)
: base(id, description, def, isDef)
{
}
}
}

View File

@@ -199,11 +199,13 @@
<Compile Include="Devices\DeviceFeedbackExtensions.cs" />
<Compile Include="Devices\GenericIRController.cs" />
<Compile Include="Devices\IDspPreset.cs" />
<Compile Include="Devices\Interfaces\IHasCameraPresets.cs" />
<Compile Include="Devices\Interfaces\IProjectorInterfaces.cs" />
<Compile Include="Devices\PC\InRoomPc.cs" />
<Compile Include="Devices\PC\Laptop.cs" />
<Compile Include="Devices\Base Classes\ReconfigurableDevice.cs" />
<Compile Include="Devices\Base Classes\VideoCodecBase.cs" />
<Compile Include="Devices\RoomPresets.cs" />
<Compile Include="Devices\VolumeDeviceChangeEventArgs.cs" />
<Compile Include="DeviceTypeInterfaces\Codec\IHasExternalSourceSwitching.cs" />
<Compile Include="DeviceTypeInterfaces\Codec\IHasParticipants.cs" />

View File

@@ -1,4 +1,4 @@
namespace PepperDash.Essentials
namespace PepperDash.Essentials.Core
{
/// <summary>
///

View File

@@ -5,6 +5,7 @@ using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Devices;
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
using PepperDash.Essentials.Core.Rooms.Config;
namespace PepperDash.Essentials.Core
@@ -20,6 +21,21 @@ namespace PepperDash.Essentials.Core
protected Func<bool> IsWarmingFeedbackFunc;
protected string LastSourceKey;
public string LogoUrlLightBkgnd { get; set; }
public string LogoUrlDarkBkgnd { get; set; }
/// <summary>
/// Indicates if this room is Mobile Control Enabled
/// </summary>
public bool IsMobileControlEnabled { get; private set; }
/// <summary>
/// The bridge for this room if Mobile Control is enabled
/// </summary>
public IMobileControlRoomBridge MobileControlRoomBridge { get; private set; }
/// <summary>
///
/// </summary>
@@ -222,6 +238,27 @@ namespace PepperDash.Essentials.Core
VacancyMode = eVacancyMode.None;
}
/// <summary>
/// If mobile control is enabled, sets the appropriate properties
/// </summary>
void SetUpMobileControl()
{
var mcBridgeKey = string.Format("mobileControlBridge-{0}", Key);
var mcBridge = DeviceManager.GetDeviceForKey(mcBridgeKey);
if (mcBridge == null)
{
Debug.Console(1, this, "*********************Mobile Control Bridge Not found for this room.");
IsMobileControlEnabled = false;
return;
}
else
{
MobileControlRoomBridge = mcBridge as IMobileControlRoomBridge;
Debug.Console(1, this, "*********************Mobile Control Bridge found and enabled for this room");
IsMobileControlEnabled = true;
}
}
private void SetupShutdownPrompt()
{
// Setup the ShutdownPromptTimer