mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-11 19:44:52 +00:00
Premerge call history
This commit is contained in:
@@ -11,7 +11,7 @@ using PepperDash.Essentials.Devices.Common.Codec;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
{
|
||||
public class MockVC : VideoCodecBase, IRoutingSource
|
||||
public class MockVC : VideoCodecBase, IRoutingSource, IHasCallHistory
|
||||
{
|
||||
public RoutingInputPort CodecOsdIn { get; private set; }
|
||||
public RoutingInputPort HdmiIn1 { get; private set; }
|
||||
@@ -43,6 +43,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
InputPorts.Add(HdmiIn2);
|
||||
OutputPorts.Add(HdmiOut);
|
||||
|
||||
CallHistory = new CodecCallHistory();
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
var call = new CodecCallHistory.CallHistoryEntry();
|
||||
call.Name = "Call " + i;
|
||||
call.Number = i + "@call.com";
|
||||
CallHistory.RecentCalls.Add(call);
|
||||
}
|
||||
// eventually fire history event here
|
||||
|
||||
SetIsReady();
|
||||
}
|
||||
|
||||
@@ -302,6 +312,17 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
Debug.Console(1, this, "TestFarEndHangup");
|
||||
|
||||
}
|
||||
|
||||
#region IHasCallHistory Members
|
||||
|
||||
public CodecCallHistory CallHistory { get; private set; }
|
||||
|
||||
public void RemoveCallHistoryEntry(CodecCallHistory.CallHistoryEntry entry)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -37,8 +37,12 @@ namespace PepperDash.Essentials.Room
|
||||
|
||||
if (config.Trigger.Type.Equals("contact", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (config.Trigger.Number <= cs.NumberOfDigitalInputPorts)
|
||||
cs.DigitalInputPorts[(uint)config.Trigger.Number].StateChange += new DigitalInputEventHandler(EsentialsRoomEmergencyContactClosure_StateChange);
|
||||
var portNum = (uint)config.Trigger.Number;
|
||||
if (portNum <= cs.NumberOfDigitalInputPorts)
|
||||
{
|
||||
cs.DigitalInputPorts[portNum].Register();
|
||||
cs.DigitalInputPorts[portNum].StateChange += EsentialsRoomEmergencyContactClosure_StateChange;
|
||||
}
|
||||
}
|
||||
Behavior = config.Behavior;
|
||||
TriggerOnClose = config.Trigger.TriggerOnClose;
|
||||
|
||||
@@ -16,7 +16,19 @@
|
||||
/// </summary>
|
||||
public const uint VCDialKeypad = 1201;
|
||||
|
||||
/// <summary>
|
||||
/// 1202
|
||||
/// </summary>
|
||||
public const uint VCDirectoryList = 1202;
|
||||
/// <summary>
|
||||
/// 1203
|
||||
/// </summary>
|
||||
public const uint VCRecentsList = 1203;
|
||||
/// <summary>
|
||||
/// 1204
|
||||
/// </summary>
|
||||
public const uint VCFavoritesList = 1204;
|
||||
|
||||
|
||||
//******************************************************
|
||||
// General
|
||||
|
||||
@@ -20,6 +20,11 @@ namespace PepperDash.Essentials
|
||||
/// </summary>
|
||||
public const uint CodecAddressEntryText = 1001;
|
||||
|
||||
/// <summary>
|
||||
/// 1201 - 1230 range of joins for recents list
|
||||
/// </summary>
|
||||
public const uint VCRecentListTextStart = 1201;
|
||||
|
||||
|
||||
//******************************************************
|
||||
// Keyboard
|
||||
|
||||
@@ -58,6 +58,8 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
|
||||
SubpageReferenceList ActiveCallsSRL;
|
||||
|
||||
SmartObjectDynamicList RecentCallsList;
|
||||
|
||||
// These are likely temp until we get a keyboard built
|
||||
StringFeedback DialStringFeedback;
|
||||
StringBuilder DialStringBuilder = new StringBuilder();
|
||||
@@ -82,6 +84,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
SetupCallStagingPopover();
|
||||
SetupDialKeypad();
|
||||
ActiveCallsSRL = new SubpageReferenceList(TriList, UISmartObjectJoin.CodecActiveCallsHeaderList, 3, 3, 3);
|
||||
SetupRecentCallsList();
|
||||
|
||||
codec.CallStatusChange += new EventHandler<CodecCallStatusItemChangeEventArgs>(Codec_CallStatusChange);
|
||||
|
||||
@@ -333,6 +336,40 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
TriList.ID, UISmartObjectJoin.VCDialKeypad);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void SetupRecentCallsList()
|
||||
{
|
||||
var codec = Codec as IHasCallHistory;
|
||||
if (codec != null)
|
||||
{
|
||||
// EVENT??????????????? Pointed at refresh
|
||||
RefreshRecentCallsList();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void RefreshRecentCallsList()
|
||||
{
|
||||
var codec = Codec as IHasCallHistory;
|
||||
if (codec != null)
|
||||
{
|
||||
RecentCallsList = new SmartObjectDynamicList(TriList.SmartObjects[UISmartObjectJoin.VCRecentsList], true, 1200);
|
||||
ushort i = 0;
|
||||
foreach (var c in codec.CallHistory.RecentCalls)
|
||||
{
|
||||
i++;
|
||||
RecentCallsList.SetItemMainText(i, c.Name);
|
||||
var call = c; // for lambda scope
|
||||
RecentCallsList.SetItemButtonAction(i, b => { if(!b) Codec.Dial(call.Number); });
|
||||
}
|
||||
RecentCallsList.Count = i;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -404,7 +441,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
void ShowRecents()
|
||||
{
|
||||
//populate recents
|
||||
VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCDirectoryVisible);
|
||||
VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCRecentsVisible);
|
||||
StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingRecentsPress);
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user