Meeting popup fixes; calendar list event and update fixes

This commit is contained in:
Heath Volmer
2017-11-22 14:01:01 -07:00
parent 19860be486
commit 385dd8a482
5 changed files with 44 additions and 16 deletions

View File

@@ -30,6 +30,9 @@ namespace PepperDash.Essentials.Devices.Common.Codec
public event EventHandler<EventArgs> MeetingsListHasChanged; public event EventHandler<EventArgs> MeetingsListHasChanged;
/// <summary>
/// Setter triggers MeetingsListHasChanged event
/// </summary>
public List<Meeting> Meetings public List<Meeting> Meetings
{ {
get get
@@ -131,7 +134,7 @@ namespace PepperDash.Essentials.Devices.Common.Codec
get get
{ {
return StartTime.AddMinutes(-5) <= DateTime.Now return StartTime.AddMinutes(-5) <= DateTime.Now
&& DateTime.Now <= EndTime.AddMinutes(-5); && DateTime.Now <= EndTime; //.AddMinutes(-5);
} }
} }
//public string ConferenceNumberToDial { get; set; } //public string ConferenceNumberToDial { get; set; }

View File

@@ -668,6 +668,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
EvalutateDisconnectEvent(eventReceived); EvalutateDisconnectEvent(eventReceived);
} }
else if (response.IndexOf("\"Bookings\":{") > -1) // The list has changed, reload it
{
GetBookings(null);
}
} }
else if (response.IndexOf("\"CommandResponse\":{") > -1) else if (response.IndexOf("\"CommandResponse\":{") > -1)
{ {

View File

@@ -190,7 +190,7 @@ namespace PepperDash.Essentials
/// <summary> /// <summary>
/// Tracks the last meeting that was cancelled /// Tracks the last meeting that was cancelled
/// </summary> /// </summary>
Meeting LastMeetingDismissed; string LastMeetingDismissedId;
/// <summary> /// <summary>
/// Constructor /// Constructor
@@ -422,37 +422,42 @@ namespace PepperDash.Essentials
var ss = CurrentRoom.ScheduleSource; var ss = CurrentRoom.ScheduleSource;
if (ss != null) if (ss != null)
{ {
NextMeetingTimer = new CTimer(o => ShowNextMeetingCallback(), null, 0, 60000); NextMeetingTimer = new CTimer(o => ShowNextMeetingTimerCallback(), null, 0, 60000);
} }
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
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 ss = CurrentRoom.ScheduleSource;
var meetings = ss.CodecSchedule.Meetings; var meetings = ss.CodecSchedule.Meetings;
if (meetings.Count > 0) if (meetings.Count > 0)
{ {
var meeting = meetings.FirstOrDefault(m => m.Joinable);
// If the room is off pester the user // If the room is off pester the user
// If the room is on, and the meeting is joinable // If the room is on, and the meeting is joinable
// and the LastMeetingDismissed != this meeting // 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, var meeting = meetings.LastOrDefault(m => m.Joinable);
LastMeetingDismissed != null ? LastMeetingDismissed.StartTime.ToShortTimeString() : "null");
if (CurrentRoom.OnFeedback.BoolValue if (CurrentRoom.OnFeedback.BoolValue
&& LastMeetingDismissed == meeting) && lastMeetingDismissed == meeting)
{ {
return; return;
} }
LastMeetingDismissed = null; LastMeetingDismissedId = null;
// Clear the popup when we run out of meetings
if (meeting == null) if (meeting == null)
{ {
HideNextMeetingPopup(); HideNextMeetingPopup();
@@ -468,13 +473,16 @@ namespace PepperDash.Essentials
TriList.SetSigFalseAction(UIBoolJoin.NextMeetingJoinPress, () => TriList.SetSigFalseAction(UIBoolJoin.NextMeetingJoinPress, () =>
{ {
HideNextMeetingPopup(); HideNextMeetingPopup();
PopupInterlock.Hide();
RoomOnAndDialMeeting(meeting); RoomOnAndDialMeeting(meeting);
}); });
TriList.SetString(UIStringJoin.NextMeetingSecondaryButtonLabel, "Show Schedule"); TriList.SetString(UIStringJoin.NextMeetingSecondaryButtonLabel, "Show Schedule");
TriList.SetSigFalseAction(UIBoolJoin.CalendarHeaderButtonPress, () => TriList.SetSigFalseAction(UIBoolJoin.CalendarHeaderButtonPress, () =>
{ {
HideNextMeetingPopup(); HideNextMeetingPopup();
CalendarPress(); //CalendarPress();
RefreshMeetingsList();
PopupInterlock.ShowInterlocked(UIBoolJoin.MeetingsOrContacMethodsListVisible);
}); });
var indexOfNext = meetings.IndexOf(meeting) + 1; var indexOfNext = meetings.IndexOf(meeting) + 1;
@@ -489,7 +497,7 @@ namespace PepperDash.Essentials
{ {
// Mark the meeting to not re-harass the user // Mark the meeting to not re-harass the user
if(CurrentRoom.OnFeedback.BoolValue) if(CurrentRoom.OnFeedback.BoolValue)
LastMeetingDismissed = meeting; LastMeetingDismissedId = meeting.Id;
HideNextMeetingPopup(); HideNextMeetingPopup();
}); });
@@ -512,7 +520,7 @@ namespace PepperDash.Essentials
/// </summary> /// </summary>
void CalendarPress() void CalendarPress()
{ {
RefreshMeetingsList(); //RefreshMeetingsList(); // List should be up-to-date
PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.MeetingsOrContacMethodsListVisible); PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.MeetingsOrContacMethodsListVisible);
} }
@@ -527,6 +535,7 @@ namespace PepperDash.Essentials
if (d != null) if (d != null)
{ {
d.Dial(meeting); d.Dial(meeting);
LastMeetingDismissedId = meeting.Id; // To prevent prompts for already-joined call
} }
}; };
if (CurrentRoom.OnFeedback.BoolValue) if (CurrentRoom.OnFeedback.BoolValue)
@@ -942,6 +951,7 @@ namespace PepperDash.Essentials
_CurrentRoom.CurrentSingleSourceChange += CurrentRoom_SourceInfoChange; _CurrentRoom.CurrentSingleSourceChange += CurrentRoom_SourceInfoChange;
RefreshSourceInfo(); RefreshSourceInfo();
(_CurrentRoom.VideoCodec as IHasScheduleAwareness).CodecSchedule.MeetingsListHasChanged += CodecSchedule_MeetingsListHasChanged;
CallSharingInfoVisibleFeedback = new BoolFeedback(() => _CurrentRoom.VideoCodec.SharingContentIsOnFeedback.BoolValue); CallSharingInfoVisibleFeedback = new BoolFeedback(() => _CurrentRoom.VideoCodec.SharingContentIsOnFeedback.BoolValue);
_CurrentRoom.VideoCodec.SharingContentIsOnFeedback.OutputChange += new EventHandler<EventArgs>(SharingContentIsOnFeedback_OutputChange); _CurrentRoom.VideoCodec.SharingContentIsOnFeedback.OutputChange += new EventHandler<EventArgs>(SharingContentIsOnFeedback_OutputChange);
@@ -963,6 +973,16 @@ namespace PepperDash.Essentials
} }
} }
/// <summary>
/// If the schedule changes, this event will fire
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void CodecSchedule_MeetingsListHasChanged(object sender, EventArgs e)
{
RefreshMeetingsList();
}
/// <summary> /// <summary>
/// Updates the current shared source label on the call list when the source changes /// Updates the current shared source label on the call list when the source changes
/// </summary> /// </summary>
@@ -1161,7 +1181,8 @@ namespace PepperDash.Essentials
void RefreshMeetingsList() void RefreshMeetingsList()
{ {
// See if this is helpful or if the callback response in the codec class maybe doesn't come it time? // 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.MeetingsOrContactMethodListIcon, "Calendar");
TriList.SetString(UIStringJoin.MeetingsOrContactMethodListTitleText, "Today's Meetings"); TriList.SetString(UIStringJoin.MeetingsOrContactMethodListTitleText, "Today's Meetings");
@@ -1236,7 +1257,7 @@ namespace PepperDash.Essentials
TriList.BooleanInput[UIBoolJoin.VolumeDualMute1Visible].BoolValue = false; TriList.BooleanInput[UIBoolJoin.VolumeDualMute1Visible].BoolValue = false;
TriList.BooleanInput[UIBoolJoin.SourceStagingBarVisible].BoolValue = false; TriList.BooleanInput[UIBoolJoin.SourceStagingBarVisible].BoolValue = false;
// Clear this so that the pesky meeting warning can resurface every minute when off // Clear this so that the pesky meeting warning can resurface every minute when off
LastMeetingDismissed = null; LastMeetingDismissedId = null;
} }
} }