From c8e3f752dbb6056c187e17e28fc8a8cfd06569d1 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 28 Sep 2020 19:15:39 -0600 Subject: [PATCH] added properties to support dynamic time before meeting start for warnings --- .../JoinMaps/VideoCodecControllerJoinMap.cs | 8 ++++++++ .../Codec/iHasScheduleAwareness.cs | 14 ++++++++++++-- .../VideoCodec/VideoCodecBase.cs | 10 +++++++--- .../VideoCodec/ZoomRoom/ResponseObjects.cs | 14 +++++++++++++- .../VideoCodec/ZoomRoom/ZoomRoom.cs | 3 ++- 5 files changed, 42 insertions(+), 7 deletions(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/VideoCodecControllerJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/VideoCodecControllerJoinMap.cs index 147bc840..77c19ca4 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/VideoCodecControllerJoinMap.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/VideoCodecControllerJoinMap.cs @@ -701,6 +701,14 @@ namespace PepperDash_Essentials_Core.Bridges.JoinMaps JoinType = eJoinType.Analog }); + [JoinName("MinutesBeforeMeetingStart")] public JoinDataComplete MinutesBeforeMeetingStart = + new JoinDataComplete(new JoinData {JoinNumber = 41, JoinSpan = 1}, + new JoinMetadata + { + Description = "Minutes before meeting start that a meeting is joinable", + JoinCapabilities = eJoinCapabilities.FromSIMPL, + JoinType = eJoinType.Analog + }); public VideoCodecControllerJoinMap(uint joinStart) : base(joinStart, typeof (VideoCodecControllerJoinMap)) { diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Codec/iHasScheduleAwareness.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Codec/iHasScheduleAwareness.cs index 57839471..43cc0343 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Codec/iHasScheduleAwareness.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Codec/iHasScheduleAwareness.cs @@ -30,7 +30,15 @@ namespace PepperDash.Essentials.Devices.Common.Codec public event EventHandler MeetingsListHasChanged; - /// + private int _meetingWarningMinutes = 5; + + public int MeetingWarningMinutes + { + get { return _meetingWarningMinutes; } + set { _meetingWarningMinutes = value; } + } + + /// /// Setter triggers MeetingsListHasChanged event /// public List Meetings @@ -102,6 +110,8 @@ namespace PepperDash.Essentials.Devices.Common.Codec { public TimeSpan MeetingWarningMinutes = TimeSpan.FromMinutes(5); + public int MinutesBeforeMeeting; + public string Id { get; set; } public string Organizer { get; set; } public string Title { get; set; } @@ -134,7 +144,7 @@ namespace PepperDash.Essentials.Devices.Common.Codec { get { - return StartTime.AddMinutes(-5) <= DateTime.Now + return StartTime.AddMinutes(-MinutesBeforeMeeting) <= DateTime.Now && DateTime.Now <= EndTime; //.AddMinutes(-5); } } diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs index b7602b3b..e91de18f 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs @@ -484,6 +484,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec { trilist.SetSigFalseAction(joinMap.UpdateMeetings.JoinNumber, codec.GetSchedule); + trilist.SetUShortSigAction(joinMap.MinutesBeforeMeetingStart.JoinNumber, (i) => + { + codec.CodecSchedule.MeetingWarningMinutes = i; + }); + codec.CodecSchedule.MeetingsListHasChanged += (sender, args) => { var clearBytes = XSigHelpers.ClearOutputs(); @@ -532,9 +537,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec * Serials * Organizer - 1 * Title - 2 - * Agenda - 3 - * Start Time - 4 - * End Time - 5 + * Start Time - 3 + * End Time - 4 */ foreach(var meeting in meetings) diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ResponseObjects.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ResponseObjects.cs index 3425e45b..2c33317e 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ResponseObjects.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ResponseObjects.cs @@ -946,8 +946,20 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom public ThirdParty ThirdParty { get; set; } } + public static List GetGenericMeetingsFromBookingResult(List bookings, + int minutesBeforeMeetingStart) + { + var rv = GetGenericMeetingsFromBookingResult(bookings); + + foreach (var meeting in rv) + { + meeting.MinutesBeforeMeeting = minutesBeforeMeetingStart; + } + + return rv; + } /// - /// Extracts the necessary meeting values from the Cisco bookings response ans converts them to the generic class + /// Extracts the necessary meeting values from the Zoom bookings response and converts them to the generic class /// /// /// diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs index 6113db4a..3a57bb43 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs @@ -947,7 +947,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom if (codecBookings != null && codecBookings.Count > 0) { - CodecSchedule.Meetings = zCommand.GetGenericMeetingsFromBookingResult(codecBookings); + CodecSchedule.Meetings = zCommand.GetGenericMeetingsFromBookingResult( + codecBookings, CodecSchedule.MeetingWarningMinutes); } break;