mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 12:44:58 +00:00
Meetings list on-screen with Mock VC
This commit is contained in:
@@ -73,6 +73,40 @@ namespace PepperDash.Essentials.Core
|
|||||||
return SetSigHeldAction(tl, sigNum, heldMs, heldAction, null);
|
return SetSigHeldAction(tl, sigNum, heldMs, heldAction, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets an action to a held sig as well as a released-without-hold action
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static BoolOutputSig SetSigHeldAction(this BoolOutputSig sig, uint heldMs, Action heldAction, Action releaseAction)
|
||||||
|
{
|
||||||
|
CTimer heldTimer = null;
|
||||||
|
bool wasHeld = false;
|
||||||
|
return sig.SetBoolSigAction(press =>
|
||||||
|
{
|
||||||
|
if (press)
|
||||||
|
{
|
||||||
|
wasHeld = false;
|
||||||
|
// Could insert a pressed action here
|
||||||
|
heldTimer = new CTimer(o =>
|
||||||
|
{
|
||||||
|
// if still held and there's an action
|
||||||
|
if (sig.BoolValue && heldAction != null)
|
||||||
|
{
|
||||||
|
wasHeld = true;
|
||||||
|
// Hold action here
|
||||||
|
heldAction();
|
||||||
|
}
|
||||||
|
}, heldMs);
|
||||||
|
}
|
||||||
|
else if (!wasHeld) // released
|
||||||
|
{
|
||||||
|
heldTimer.Stop();
|
||||||
|
if (releaseAction != null)
|
||||||
|
releaseAction();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets an action to a held sig as well as a released-without-hold action
|
/// Sets an action to a held sig as well as a released-without-hold action
|
||||||
@@ -80,35 +114,9 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// <returns>The sig</returns>
|
/// <returns>The sig</returns>
|
||||||
public static BoolOutputSig SetSigHeldAction(this BasicTriList tl, uint sigNum, uint heldMs, Action heldAction, Action releaseAction)
|
public static BoolOutputSig SetSigHeldAction(this BasicTriList tl, uint sigNum, uint heldMs, Action heldAction, Action releaseAction)
|
||||||
{
|
{
|
||||||
CTimer heldTimer = null;
|
return tl.BooleanOutput[sigNum].SetSigHeldAction(heldMs, heldAction, releaseAction);
|
||||||
bool wasHeld = false;
|
|
||||||
return tl.SetBoolSigAction(sigNum, press =>
|
|
||||||
{
|
|
||||||
if (press)
|
|
||||||
{
|
|
||||||
wasHeld = false;
|
|
||||||
// Could insert a pressed action here
|
|
||||||
heldTimer = new CTimer(o =>
|
|
||||||
{
|
|
||||||
// if still held and there's an action
|
|
||||||
if (tl.BooleanOutput[sigNum].BoolValue && heldAction != null)
|
|
||||||
{
|
|
||||||
wasHeld = true;
|
|
||||||
// Hold action here
|
|
||||||
heldAction();
|
|
||||||
}
|
|
||||||
}, heldMs);
|
|
||||||
}
|
|
||||||
else if(!wasHeld) // released
|
|
||||||
{
|
|
||||||
heldTimer.Stop();
|
|
||||||
if (releaseAction != null)
|
|
||||||
releaseAction();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -44,15 +44,8 @@ namespace PepperDash.Essentials.Devices.Common.Codec
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
var timeToMeetingStart = StartTime - DateTime.Now;
|
return StartTime.AddMinutes(-5) <= DateTime.Now
|
||||||
|
&& DateTime.Now <= EndTime.AddMinutes(-5);
|
||||||
var timetoMeetingEnd = DateTime.Now - EndTime;
|
|
||||||
|
|
||||||
// Meeting is joinable from 5 minutes before start until 5 minutes before end
|
|
||||||
if (timeToMeetingStart.Minutes <= 5 && timetoMeetingEnd.Minutes >= 5)
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public string ConferenceNumberToDial { get; set; }
|
public string ConferenceNumberToDial { get; set; }
|
||||||
|
|||||||
@@ -333,8 +333,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
for(int i = 0; i < 5; i++)
|
for(int i = 0; i < 5; i++)
|
||||||
{
|
{
|
||||||
var m = new Meeting();
|
var m = new Meeting();
|
||||||
m.StartTime = DateTime.Now.AddHours(1 + i);
|
m.StartTime = DateTime.Now.AddMinutes(3).AddHours(i);
|
||||||
m.EndTime = DateTime.Now.AddHours(1 + i).AddMinutes(30);
|
m.EndTime = DateTime.Now.AddHours(i).AddMinutes(30);
|
||||||
m.Title = "Meeting " + i;
|
m.Title = "Meeting " + i;
|
||||||
m.ConferenceNumberToDial = i + "meeting@fake.com";
|
m.ConferenceNumberToDial = i + "meeting@fake.com";
|
||||||
sch.Meetings.Add(m);
|
sch.Meetings.Add(m);
|
||||||
|
|||||||
@@ -517,6 +517,10 @@ namespace PepperDash.Essentials
|
|||||||
/// 15045 - Visibility for the bar containing call navigation button list
|
/// 15045 - Visibility for the bar containing call navigation button list
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const uint CallStagingBarVisible = 15045;
|
public const uint CallStagingBarVisible = 15045;
|
||||||
|
/// <summary>
|
||||||
|
/// 15046
|
||||||
|
/// </summary>
|
||||||
|
public const uint MeetingsListVisible = 15046;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 15051
|
/// 15051
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -61,5 +61,9 @@
|
|||||||
/// 15022 The main activity footer
|
/// 15022 The main activity footer
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const uint ActivityFooterSRL = 15022;
|
public const uint ActivityFooterSRL = 15022;
|
||||||
|
/// <summary>
|
||||||
|
/// 15023 - The header meetings SRL
|
||||||
|
/// </summary>
|
||||||
|
public const uint MeetingListSRL = 15023;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -25,7 +25,7 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
public BoolInputSig SelectedSig { get; private set; }
|
public BoolInputSig SelectedSig { get; private set; }
|
||||||
public BoolInputSig VisibleSig { get; private set; }
|
public BoolInputSig VisibleSig { get; private set; }
|
||||||
BoolOutputSig OutputSig;
|
public BoolOutputSig OutputSig { get; private set; }
|
||||||
StringInputSig IconSig;
|
StringInputSig IconSig;
|
||||||
|
|
||||||
public HeaderListButton(SmartObjectHeaderButtonList list, uint index)
|
public HeaderListButton(SmartObjectHeaderButtonList list, uint index)
|
||||||
@@ -37,11 +37,6 @@ namespace PepperDash.Essentials
|
|||||||
IconSig = so.StringInput["Set Item " + index + " Icon Serial"];
|
IconSig = so.StringInput["Set Item " + index + " Icon Serial"];
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetBoolFalseAction(Action a)
|
|
||||||
{
|
|
||||||
OutputSig.SetSigFalseAction(a);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetIcon(string i)
|
public void SetIcon(string i)
|
||||||
{
|
{
|
||||||
IconSig.StringValue = i;
|
IconSig.StringValue = i;
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ using PepperDash.Essentials.Core;
|
|||||||
using PepperDash.Essentials.Core.SmartObjects;
|
using PepperDash.Essentials.Core.SmartObjects;
|
||||||
using PepperDash.Essentials.Core.PageManagers;
|
using PepperDash.Essentials.Core.PageManagers;
|
||||||
using PepperDash.Essentials.Room.Config;
|
using PepperDash.Essentials.Room.Config;
|
||||||
|
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
@@ -85,6 +86,11 @@ namespace PepperDash.Essentials
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
SubpageReferenceList ActivityFooterSrl;
|
SubpageReferenceList ActivityFooterSrl;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
SubpageReferenceList MeetingsSrl;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The list of buttons on the header. Managed with visibility only
|
/// The list of buttons on the header. Managed with visibility only
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -188,6 +194,9 @@ namespace PepperDash.Essentials
|
|||||||
ShareButtonSig = ActivityFooterSrl.BoolInputSig(1, 1);
|
ShareButtonSig = ActivityFooterSrl.BoolInputSig(1, 1);
|
||||||
EndMeetingButtonSig = ActivityFooterSrl.BoolInputSig(3, 1);
|
EndMeetingButtonSig = ActivityFooterSrl.BoolInputSig(3, 1);
|
||||||
|
|
||||||
|
MeetingsSrl = new SubpageReferenceList(TriList, UISmartObjectJoin.MeetingListSRL, 3, 3, 5);
|
||||||
|
|
||||||
|
|
||||||
// buttons are added in SetCurrentRoom
|
// buttons are added in SetCurrentRoom
|
||||||
HeaderButtonsList = new SmartObjectHeaderButtonList(TriList.SmartObjects[UISmartObjectJoin.HeaderButtonList]);
|
HeaderButtonsList = new SmartObjectHeaderButtonList(TriList.SmartObjects[UISmartObjectJoin.HeaderButtonList]);
|
||||||
|
|
||||||
@@ -408,6 +417,15 @@ namespace PepperDash.Essentials
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Calendar should only be visible when it's supposed to
|
||||||
|
/// </summary>
|
||||||
|
void CalendarPress()
|
||||||
|
{
|
||||||
|
RefreshMeetingsList();
|
||||||
|
PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.MeetingsListVisible);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Reveals the tech page and puts away anything that's in the way.
|
/// Reveals the tech page and puts away anything that's in the way.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -803,12 +821,9 @@ namespace PepperDash.Essentials
|
|||||||
//
|
//
|
||||||
var setupButton = new HeaderListButton(HeaderButtonsList, 5);
|
var setupButton = new HeaderListButton(HeaderButtonsList, 5);
|
||||||
setupButton.SetIcon(HeaderListButton.Gear);
|
setupButton.SetIcon(HeaderListButton.Gear);
|
||||||
setupButton.SetBoolFalseAction(() => PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.VolumesPageVisible));
|
setupButton.OutputSig.SetSigHeldAction(2000,
|
||||||
#warning Add held action - and add press/hold to SIG helper
|
ShowTech,
|
||||||
//// Setup button - shows volumes with default button OR hold for tech page
|
() => PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.VolumesPageVisible));
|
||||||
//TriList.SetSigHeldAction(UIBoolJoin.HeaderGearButtonPress, 2000,
|
|
||||||
// ShowTech,
|
|
||||||
// () => PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.VolumesPageVisible));
|
|
||||||
|
|
||||||
TriList.SetSigFalseAction(UIBoolJoin.TechExitButton, () =>
|
TriList.SetSigFalseAction(UIBoolJoin.TechExitButton, () =>
|
||||||
PopupInterlock.HideAndClear());
|
PopupInterlock.HideAndClear());
|
||||||
@@ -833,7 +848,7 @@ namespace PepperDash.Essentials
|
|||||||
}
|
}
|
||||||
var helpButton = new HeaderListButton(HeaderButtonsList, 4);
|
var helpButton = new HeaderListButton(HeaderButtonsList, 4);
|
||||||
helpButton.SetIcon(HeaderListButton.Help);
|
helpButton.SetIcon(HeaderListButton.Help);
|
||||||
helpButton.SetBoolFalseAction(() =>
|
helpButton.OutputSig.SetSigFalseAction(() =>
|
||||||
{
|
{
|
||||||
string message = null;
|
string message = null;
|
||||||
var room = DeviceManager.GetDeviceForKey(Config.DefaultRoomKey)
|
var room = DeviceManager.GetDeviceForKey(Config.DefaultRoomKey)
|
||||||
@@ -859,14 +874,14 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
var calBut = new HeaderListButton(HeaderButtonsList, nextIndex);
|
var calBut = new HeaderListButton(HeaderButtonsList, nextIndex);
|
||||||
calBut.SetIcon(HeaderListButton.Calendar);
|
calBut.SetIcon(HeaderListButton.Calendar);
|
||||||
calBut.SetBoolFalseAction(() => { });
|
calBut.OutputSig.SetSigFalseAction(CalendarPress);
|
||||||
nextIndex--;
|
nextIndex--;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call button
|
// Call button
|
||||||
var callBut = new HeaderListButton(HeaderButtonsList, nextIndex);
|
var callBut = new HeaderListButton(HeaderButtonsList, nextIndex);
|
||||||
callBut.SetIcon(HeaderListButton.OnHook);
|
callBut.SetIcon(HeaderListButton.OnHook);
|
||||||
callBut.SetBoolFalseAction(() =>
|
callBut.OutputSig.SetSigFalseAction(() =>
|
||||||
PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.HeaderActiveCallsListVisible));
|
PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.HeaderActiveCallsListVisible));
|
||||||
nextIndex--;
|
nextIndex--;
|
||||||
|
|
||||||
@@ -875,10 +890,36 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
var blankBut = new HeaderListButton(HeaderButtonsList, i);
|
var blankBut = new HeaderListButton(HeaderButtonsList, i);
|
||||||
blankBut.ClearIcon();
|
blankBut.ClearIcon();
|
||||||
blankBut.SetBoolFalseAction(() => { });
|
blankBut.OutputSig.SetSigFalseAction(() => { });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
void RefreshMeetingsList()
|
||||||
|
{
|
||||||
|
ushort i = 0;
|
||||||
|
foreach (var m in CurrentRoom.ScheduleSource.CodecSchedule.Meetings)
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
MeetingsSrl.StringInputSig(i, 1).StringValue = m.StartTime.ToShortTimeString();
|
||||||
|
MeetingsSrl.StringInputSig(i, 2).StringValue = m.EndTime.ToShortTimeString();
|
||||||
|
MeetingsSrl.StringInputSig(i, 3).StringValue = m.Title;
|
||||||
|
MeetingsSrl.StringInputSig(i, 4).StringValue = "Join";
|
||||||
|
MeetingsSrl.BoolInputSig(i, 2).BoolValue = m.Joinable;
|
||||||
|
var mm = m; // lambda scope
|
||||||
|
MeetingsSrl.GetBoolFeedbackSig(i, 1).SetSigFalseAction(() =>
|
||||||
|
{
|
||||||
|
PopupInterlock.Hide();
|
||||||
|
var d = CurrentRoom.ScheduleSource as VideoCodecBase;
|
||||||
|
if (d != null)
|
||||||
|
d.Dial(mm.ConferenceNumberToDial);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
MeetingsSrl.Count = i;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// For room on/off changes
|
/// For room on/off changes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user