diff --git a/Essentials Devices Common/Essentials Devices Common/Codec/iHasScheduleAwareness.cs b/Essentials Devices Common/Essentials Devices Common/Codec/iHasScheduleAwareness.cs index d756d2eb..dc368fcd 100644 --- a/Essentials Devices Common/Essentials Devices Common/Codec/iHasScheduleAwareness.cs +++ b/Essentials Devices Common/Essentials Devices Common/Codec/iHasScheduleAwareness.cs @@ -30,6 +30,9 @@ namespace PepperDash.Essentials.Devices.Common.Codec public event EventHandler MeetingsListHasChanged; + /// + /// Setter triggers MeetingsListHasChanged event + /// public List Meetings { get @@ -131,7 +134,7 @@ namespace PepperDash.Essentials.Devices.Common.Codec get { return StartTime.AddMinutes(-5) <= DateTime.Now - && DateTime.Now <= EndTime.AddMinutes(-5); + && DateTime.Now <= EndTime; //.AddMinutes(-5); } } //public string ConferenceNumberToDial { get; set; } diff --git a/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs index 7d5a4d14..a23fe2a3 100644 --- a/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs +++ b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs @@ -668,6 +668,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco EvalutateDisconnectEvent(eventReceived); } + else if (response.IndexOf("\"Bookings\":{") > -1) // The list has changed, reload it + { + GetBookings(null); + } } else if (response.IndexOf("\"CommandResponse\":{") > -1) { diff --git a/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs b/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs index 820ad774..7fcfb444 100644 --- a/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs +++ b/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs @@ -190,7 +190,7 @@ namespace PepperDash.Essentials /// /// Tracks the last meeting that was cancelled /// - Meeting LastMeetingDismissed; + string LastMeetingDismissedId; /// /// Constructor @@ -422,37 +422,42 @@ namespace PepperDash.Essentials var ss = CurrentRoom.ScheduleSource; if (ss != null) { - NextMeetingTimer = new CTimer(o => ShowNextMeetingCallback(), null, 0, 60000); + NextMeetingTimer = new CTimer(o => ShowNextMeetingTimerCallback(), null, 0, 60000); } } /// /// /// - void ShowNextMeetingCallback() + void ShowNextMeetingTimerCallback() { - // Every 60 seconds, check meetings list for the closest, joinable meeting + // Every 60 seconds, refresh the calendar + RefreshMeetingsList(); + // check meetings list for the closest, joinable meeting var ss = CurrentRoom.ScheduleSource; var meetings = ss.CodecSchedule.Meetings; if (meetings.Count > 0) { - var meeting = meetings.FirstOrDefault(m => m.Joinable); - // If the room is off pester the user // If the room is on, and the meeting is joinable // and the LastMeetingDismissed != this meeting + var lastMeetingDismissed = meetings.FirstOrDefault(m => m.Id == LastMeetingDismissedId); + Debug.Console(0, "*#* Room on: {0}, lastMeetingDismissedId: {1} {2} *#*", + CurrentRoom.OnFeedback.BoolValue, + LastMeetingDismissedId, + lastMeetingDismissed != null ? lastMeetingDismissed.StartTime.ToShortTimeString() : ""); - Debug.Console(0, "*#* Room on: {0}, LastMeetingDismissed: {1} *#*", CurrentRoom.OnFeedback.BoolValue, - LastMeetingDismissed != null ? LastMeetingDismissed.StartTime.ToShortTimeString() : "null"); + var meeting = meetings.LastOrDefault(m => m.Joinable); if (CurrentRoom.OnFeedback.BoolValue - && LastMeetingDismissed == meeting) + && lastMeetingDismissed == meeting) { return; } - LastMeetingDismissed = null; + LastMeetingDismissedId = null; + // Clear the popup when we run out of meetings if (meeting == null) { HideNextMeetingPopup(); @@ -468,13 +473,16 @@ namespace PepperDash.Essentials TriList.SetSigFalseAction(UIBoolJoin.NextMeetingJoinPress, () => { HideNextMeetingPopup(); + PopupInterlock.Hide(); RoomOnAndDialMeeting(meeting); }); TriList.SetString(UIStringJoin.NextMeetingSecondaryButtonLabel, "Show Schedule"); TriList.SetSigFalseAction(UIBoolJoin.CalendarHeaderButtonPress, () => { HideNextMeetingPopup(); - CalendarPress(); + //CalendarPress(); + RefreshMeetingsList(); + PopupInterlock.ShowInterlocked(UIBoolJoin.MeetingsOrContacMethodsListVisible); }); var indexOfNext = meetings.IndexOf(meeting) + 1; @@ -489,7 +497,7 @@ namespace PepperDash.Essentials { // Mark the meeting to not re-harass the user if(CurrentRoom.OnFeedback.BoolValue) - LastMeetingDismissed = meeting; + LastMeetingDismissedId = meeting.Id; HideNextMeetingPopup(); }); @@ -512,7 +520,7 @@ namespace PepperDash.Essentials /// void CalendarPress() { - RefreshMeetingsList(); + //RefreshMeetingsList(); // List should be up-to-date PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.MeetingsOrContacMethodsListVisible); } @@ -527,6 +535,7 @@ namespace PepperDash.Essentials if (d != null) { d.Dial(meeting); + LastMeetingDismissedId = meeting.Id; // To prevent prompts for already-joined call } }; if (CurrentRoom.OnFeedback.BoolValue) @@ -942,6 +951,7 @@ namespace PepperDash.Essentials _CurrentRoom.CurrentSingleSourceChange += CurrentRoom_SourceInfoChange; RefreshSourceInfo(); + (_CurrentRoom.VideoCodec as IHasScheduleAwareness).CodecSchedule.MeetingsListHasChanged += CodecSchedule_MeetingsListHasChanged; CallSharingInfoVisibleFeedback = new BoolFeedback(() => _CurrentRoom.VideoCodec.SharingContentIsOnFeedback.BoolValue); _CurrentRoom.VideoCodec.SharingContentIsOnFeedback.OutputChange += new EventHandler(SharingContentIsOnFeedback_OutputChange); @@ -963,6 +973,16 @@ namespace PepperDash.Essentials } } + /// + /// If the schedule changes, this event will fire + /// + /// + /// + void CodecSchedule_MeetingsListHasChanged(object sender, EventArgs e) + { + RefreshMeetingsList(); + } + /// /// Updates the current shared source label on the call list when the source changes /// @@ -1161,7 +1181,8 @@ namespace PepperDash.Essentials void RefreshMeetingsList() { // See if this is helpful or if the callback response in the codec class maybe doesn't come it time? - CurrentRoom.ScheduleSource.GetSchedule(); + // Let's build list from event + // CurrentRoom.ScheduleSource.GetSchedule(); TriList.SetString(UIStringJoin.MeetingsOrContactMethodListIcon, "Calendar"); TriList.SetString(UIStringJoin.MeetingsOrContactMethodListTitleText, "Today's Meetings"); @@ -1236,7 +1257,7 @@ namespace PepperDash.Essentials TriList.BooleanInput[UIBoolJoin.VolumeDualMute1Visible].BoolValue = false; TriList.BooleanInput[UIBoolJoin.SourceStagingBarVisible].BoolValue = false; // Clear this so that the pesky meeting warning can resurface every minute when off - LastMeetingDismissed = null; + LastMeetingDismissedId = null; } } diff --git a/Release Package/PepperDashEssentials.cpz b/Release Package/PepperDashEssentials.cpz index 6c1d7144..75028f14 100644 Binary files a/Release Package/PepperDashEssentials.cpz and b/Release Package/PepperDashEssentials.cpz differ diff --git a/Release Package/PepperDashEssentials.dll b/Release Package/PepperDashEssentials.dll index 329dc7d0..c2b8f780 100644 Binary files a/Release Package/PepperDashEssentials.dll and b/Release Package/PepperDashEssentials.dll differ