Worked on VC directory and favorites. Fixed various bugs.

This commit is contained in:
Neil Dorin
2017-10-11 21:43:14 -06:00
parent 2def648596
commit fb0a91b454
16 changed files with 1895 additions and 1674 deletions

View File

@@ -5,6 +5,7 @@ using System.Text;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Devices.Common.Codec;
using PepperDash.Essentials.Devices.Common.VideoCodec; using PepperDash.Essentials.Devices.Common.VideoCodec;
namespace PepperDash.Essentials.Devices.Common.Codec namespace PepperDash.Essentials.Devices.Common.Codec
@@ -54,16 +55,16 @@ namespace PepperDash.Essentials.Devices.Common.Codec
{ {
handler(this, new EventArgs()); handler(this, new EventArgs());
if (Debug.Level == 1) //if (Debug.Level == 1)
{ //{
Debug.Console(1, "RecentCalls:\n"); // Debug.Console(1, "RecentCalls:\n");
foreach (CodecCallHistory.CallHistoryEntry entry in RecentCalls) // foreach (CodecCallHistory.CallHistoryEntry entry in RecentCalls)
{ // {
Debug.Console(1, "\nName: {0}\nNumber: {1}\nStartTime: {2}\nType: {3}\n", entry.Name, entry.Number, entry.StartTime.ToString(), entry.OccurenceType); // Debug.Console(1, "\nName: {0}\nNumber: {1}\nStartTime: {2}\nType: {3}\n", entry.Name, entry.Number, entry.StartTime.ToString(), entry.OccurenceType);
} // }
} //}
} }
} }
@@ -94,6 +95,7 @@ namespace PepperDash.Essentials.Devices.Common.Codec
foreach (CiscoCallHistory.Entry entry in entries) foreach (CiscoCallHistory.Entry entry in entries)
{ {
genericEntries.Add(new CallHistoryEntry() genericEntries.Add(new CallHistoryEntry()
{ {
Name = entry.DisplayName.Value, Name = entry.DisplayName.Value,

View File

@@ -15,6 +15,8 @@ namespace PepperDash.Essentials.Devices.Common.Codec
CodecDirectory DirectoryRoot { get; } CodecDirectory DirectoryRoot { get; }
CodecPhonebookSyncState PhonebookSyncState { get; }
void SearchDirectory(string searchString); void SearchDirectory(string searchString);
void GetDirectoryFolderContents(string folderId); void GetDirectoryFolderContents(string folderId);
@@ -29,7 +31,7 @@ namespace PepperDash.Essentials.Devices.Common.Codec
{ {
public List<DirectoryItem> DirectoryResults { get; private set; } public List<DirectoryItem> DirectoryResults { get; private set; }
//public int Offset { get; private set; } public string ResultsFolderId { get; set; }
//public int Limit { get; private set; } //public int Limit { get; private set; }

View File

@@ -132,8 +132,24 @@ namespace PepperDash.Essentials.Devices.Common.Codec
&& DateTime.Now <= EndTime.AddMinutes(-5); && DateTime.Now <= EndTime.AddMinutes(-5);
} }
} }
public string ConferenceNumberToDial { get; set; } //public string ConferenceNumberToDial { get; set; }
public string ConferencePassword { get; set; } public string ConferencePassword { get; set; }
public bool IsOneButtonToPushMeeting { get; set; }
public List<Call> Calls { get; private set; }
public Meeting()
{
Calls = new List<Call>();
}
}
public class Call
{
public string Number { get; set; }
public string Protocol { get; set; }
public string CallRate { get; set; }
public string CallType { get; set; }
} }
public class MeetingEventArgs : EventArgs public class MeetingEventArgs : EventArgs

View File

@@ -136,8 +136,8 @@
<Compile Include="Streaming\Roku.cs" /> <Compile Include="Streaming\Roku.cs" />
<Compile Include="VideoCodec\CiscoCodec\BookingsDataClasses.cs" /> <Compile Include="VideoCodec\CiscoCodec\BookingsDataClasses.cs" />
<Compile Include="VideoCodec\CiscoCodec\CallHistoryDataClasses.cs" /> <Compile Include="VideoCodec\CiscoCodec\CallHistoryDataClasses.cs" />
<Compile Include="VideoCodec\CiscoCodec\CiscoCodec.cs" /> <Compile Include="VideoCodec\CiscoCodec\CiscoSparkCodec.cs" />
<Compile Include="VideoCodec\CiscoCodec\CiscoCodecPropertiesConfig.cs" /> <Compile Include="VideoCodec\CiscoCodec\CiscoSparkCodecPropertiesConfig.cs" />
<Compile Include="VideoCodec\MockVC\MockVcPropertiesConfig.cs" /> <Compile Include="VideoCodec\MockVC\MockVcPropertiesConfig.cs" />
<Compile Include="VideoCodec\CiscoCodec\PhonebookDataClasses.cs" /> <Compile Include="VideoCodec\CiscoCodec\PhonebookDataClasses.cs" />
<Compile Include="VideoCodec\CiscoCodec\xConfiguration.cs" /> <Compile Include="VideoCodec\CiscoCodec\xConfiguration.cs" />

View File

@@ -109,11 +109,11 @@ namespace PepperDash.Essentials.Devices.Common
.MockVC(key, name, props); .MockVC(key, name, props);
} }
else if (typeName == "ciscocodec") else if (typeName.StartsWith("ciscospark"))
{ {
var comm = CommFactory.CreateCommForDevice(dc); var comm = CommFactory.CreateCommForDevice(dc);
var props = JsonConvert.DeserializeObject<Codec.CiscoCodecPropertiesConfig>(properties.ToString()); var props = JsonConvert.DeserializeObject<Codec.CiscoSparkCodecPropertiesConfig>(properties.ToString());
return new PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoCodec(key, name, comm, props); return new PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoSparkCodec(key, name, comm, props);
} }
else if (groupName == "settopbox") //(typeName == "irstbbase") else if (groupName == "settopbox") //(typeName == "irstbbase")

View File

@@ -189,8 +189,32 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
public string Value { get; set; } public string Value { get; set; }
} }
public class Calls public class Number
{ {
public string Value { get; set; }
}
public class Protocol
{
public string Value { get; set; }
}
public class CallRate
{
public string Value { get; set; }
}
public class CallType
{
public string Value { get; set; }
}
public class Call
{
public Number Number { get; set; }
public Protocol Protocol { get; set; }
public CallRate CallRate { get; set; }
public CallType CallType { get; set; }
} }
public class ConnectMode public class ConnectMode
@@ -200,8 +224,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
public class DialInfo public class DialInfo
{ {
public Calls Calls { get; set; } public List<Call> Calls { get; set; }
public ConnectMode ConnectMode { get; set; } public ConnectMode ConnectMode { get; set; }
public DialInfo()
{
Calls = new List<Call>();
}
} }
public class Booking public class Booking
@@ -231,6 +260,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
Title = new Title(); Title = new Title();
Agenda = new Agenda(); Agenda = new Agenda();
Privacy = new Privacy(); Privacy = new Privacy();
DialInfo = new DialInfo();
} }
} }
@@ -270,21 +300,44 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
{ {
var meeting = new Meeting(); var meeting = new Meeting();
if(b.Id != null)
meeting.Id = b.Id.Value; meeting.Id = b.Id.Value;
if(b.Organizer != null)
meeting.Organizer = string.Format("{0}, {1}", b.Organizer.LastName.Value, b.Organizer.FirstName.Value); meeting.Organizer = string.Format("{0}, {1}", b.Organizer.LastName.Value, b.Organizer.FirstName.Value);
if(b.Title != null)
meeting.Title = b.Title.Value; meeting.Title = b.Title.Value;
if(b.Agenda != null)
meeting.Agenda = b.Agenda.Value; meeting.Agenda = b.Agenda.Value;
if(b.Time != null)
meeting.StartTime = b.Time.StartTime.Value; meeting.StartTime = b.Time.StartTime.Value;
meeting.EndTime = b.Time.EndTime.Value; meeting.EndTime = b.Time.EndTime.Value;
if(b.Privacy != null)
meeting.Privacy = CodecCallPrivacy.ConvertToDirectionEnum(b.Privacy.Value); meeting.Privacy = CodecCallPrivacy.ConvertToDirectionEnum(b.Privacy.Value);
#warning Update this ConnectMode conversion after testing onsite. Expected value is "OBTP", but in PD NYC Test scenarios, "Manual" is being returned for OBTP meetings
if (b.DialInfo.ConnectMode != null)
if (b.DialInfo.ConnectMode.Value.ToLower() == "obtp" || b.DialInfo.ConnectMode.Value.ToLower() == "manual")
meeting.IsOneButtonToPushMeeting = true;
foreach (Call c in b.DialInfo.Calls)
{
meeting.Calls.Add(new PepperDash.Essentials.Devices.Common.Codec.Call()
{
Number = c.Number.Value,
Protocol = c.Protocol.Value,
CallRate = c.CallRate.Value,
CallType = c.CallType.Value
});
}
meetings.Add(meeting); meetings.Add(meeting);
if(Debug.Level > 0) if(Debug.Level > 0)
{ {
Debug.Console(1, "Title: {0}, ID: {1}, Organizer: {2}, Agenda: {3}", meeting.Title, meeting.Id, meeting.Organizer, meeting.Agenda); Debug.Console(1, "Title: {0}, ID: {1}, Organizer: {2}, Agenda: {3}", meeting.Title, meeting.Id, meeting.Organizer, meeting.Agenda);
Debug.Console(1, " Start Time: {0}, End Time: {1}, Duration: {2}", meeting.StartTime, meeting.EndTime, meeting.Duration); Debug.Console(1, " Start Time: {0}, End Time: {1}, Duration: {2}", meeting.StartTime, meeting.EndTime, meeting.Duration);
Debug.Console(1, " Joinable: {0}", meeting.Joinable); Debug.Console(1, " Joinable: {0}\n", meeting.Joinable);
} }
} }

View File

@@ -21,7 +21,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
{ {
enum eCommandType { SessionStart, SessionEnd, Command, GetStatus, GetConfiguration }; enum eCommandType { SessionStart, SessionEnd, Command, GetStatus, GetConfiguration };
public class CiscoCodec : VideoCodecBase, IHasCallHistory, IHasCallFavorites, IHasDirectory, public class CiscoSparkCodec : VideoCodecBase, IHasCallHistory, IHasCallFavorites, IHasDirectory,
IHasScheduleAwareness, IOccupancyStatusProvider, IHasCodecLayouts, IHasCodecSelfview IHasScheduleAwareness, IOccupancyStatusProvider, IHasCodecLayouts, IHasCodecSelfview
{ {
public event EventHandler<DirectoryEventArgs> DirectoryResultReturned; public event EventHandler<DirectoryEventArgs> DirectoryResultReturned;
@@ -188,7 +188,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
private CodecSyncState SyncState; private CodecSyncState SyncState;
private CodecPhonebookSyncState PhonebookSyncState; public CodecPhonebookSyncState PhonebookSyncState { get; private set; }
private StringBuilder JsonMessage; private StringBuilder JsonMessage;
@@ -214,7 +214,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public RoutingOutputPort HdmiOut { get; private set; } public RoutingOutputPort HdmiOut { get; private set; }
// Constructor for IBasicCommunication // Constructor for IBasicCommunication
public CiscoCodec(string key, string name, IBasicCommunication comm, CiscoCodecPropertiesConfig props ) public CiscoSparkCodec(string key, string name, IBasicCommunication comm, CiscoSparkCodecPropertiesConfig props )
: base(key, name) : base(key, name)
{ {
StandbyIsOnFeedback = new BoolFeedback(StandbyStateFeedbackFunc); StandbyIsOnFeedback = new BoolFeedback(StandbyStateFeedbackFunc);
@@ -329,6 +329,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
prefix + "/Status/RoomAnalytics" + Delimiter + prefix + "/Status/RoomAnalytics" + Delimiter +
prefix + "/Status/Standby" + Delimiter + prefix + "/Status/Standby" + Delimiter +
prefix + "/Status/Video/Selfview" + Delimiter + prefix + "/Status/Video/Selfview" + Delimiter +
prefix + "/Status/Video/Layout" + Delimiter +
prefix + "/Bookings" + Delimiter + prefix + "/Bookings" + Delimiter +
prefix + "/Event/CallDisconnect" + Delimiter; prefix + "/Event/CallDisconnect" + Delimiter;
@@ -675,9 +676,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
JsonConvert.PopulateObject(response, codecBookings); JsonConvert.PopulateObject(response, codecBookings);
if(codecBookings.CommandResponse.BookingsListResult.ResultInfo.TotalRows.Value != "0")
CodecSchedule.Meetings = CiscoCodecBookings.GetGenericMeetingsFromBookingResult(codecBookings.CommandResponse.BookingsListResult.Booking); CodecSchedule.Meetings = CiscoCodecBookings.GetGenericMeetingsFromBookingResult(codecBookings.CommandResponse.BookingsListResult.Booking);
} }
} }
@@ -795,7 +796,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
/// <param name="folderId"></param> /// <param name="folderId"></param>
public void GetDirectoryFolderContents(string folderId) public void GetDirectoryFolderContents(string folderId)
{ {
SendText(string.Format("xCommand Phonebook Search FolderId: {0} PhonebookType: {1} ContactType: Contact Limit: {2}", folderId, PhonebookMode, PhonebookResultsLimit)); SendText(string.Format("xCommand Phonebook Search FolderId: {0} PhonebookType: {1} ContactType: Any Limit: {2}", folderId, PhonebookMode, PhonebookResultsLimit));
} }
void PrintPhonebook(CodecDirectory directory) void PrintPhonebook(CodecDirectory directory)
@@ -808,7 +809,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
{ {
if (item is DirectoryFolder) if (item is DirectoryFolder)
{ {
Debug.Console(1, this, "+ {0}", item.Name); Debug.Console(1, this, "[+] {0}", item.Name);
} }
else if (item is DirectoryContact) else if (item is DirectoryContact)
{ {
@@ -818,14 +819,38 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
} }
} }
public override void Dial(string s) /// <summary>
/// Simple dial method
/// </summary>
/// <param name="number"></param>
public override void Dial(string number)
{ {
SendText(string.Format("xCommand Dial Number: \"{0}\"", s)); SendText(string.Format("xCommand Dial Number: \"{0}\"", number));
} }
public void DialBookingId(string s) /// <summary>
/// Dials a specific meeting
/// </summary>
/// <param name="meeting"></param>
public override void Dial(Meeting meeting)
{ {
SendText(string.Format("xCommand Dial BookingId: {0}", s)); foreach (Call c in meeting.Calls)
{
Dial(c.Number, c.Protocol, c.CallRate, c.CallType, meeting.Id);
}
}
/// <summary>
/// Detailed dial method
/// </summary>
/// <param name="number"></param>
/// <param name="protocol"></param>
/// <param name="callRate"></param>
/// <param name="callType"></param>
/// <param name="meetingId"></param>
public void Dial(string number, string protocol, string callRate, string callType, string meetingId)
{
SendText(string.Format("xCommand Dial Number: \"{0}\" Protocol: {1} CallRate: {2} CallType: {3} BookingId: {4}", number, protocol, callRate, callType, meetingId));
} }
public override void EndCall(CodecActiveCallItem activeCall) public override void EndCall(CodecActiveCallItem activeCall)
@@ -1259,98 +1284,4 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
} }
} }
/// <summary>
/// Used to track the status of syncronizing the phonebook values when connecting to a codec or refreshing the phonebook info
/// </summary>
public class CodecPhonebookSyncState : IKeyed
{
bool _InitialSyncComplete;
public event EventHandler<EventArgs> InitialSyncCompleted;
public string Key { get; private set; }
public bool InitialSyncComplete
{
get { return _InitialSyncComplete; }
private set
{
if (value == true)
{
var handler = InitialSyncCompleted;
if (handler != null)
handler(this, new EventArgs());
}
_InitialSyncComplete = value;
}
}
public bool InitialPhonebookFoldersWasReceived { get; private set; }
public bool NumberOfContactsWasReceived { get; private set; }
public bool PhonebookRootEntriesWasRecieved { get; private set; }
public bool PhonebookHasFolders { get; private set; }
public int NumberOfContacts { get; private set; }
public CodecPhonebookSyncState(string key)
{
Key = key;
CodecDisconnected();
}
public void InitialPhonebookFoldersReceived()
{
InitialPhonebookFoldersWasReceived = true;
CheckSyncStatus();
}
public void PhonebookRootEntriesReceived()
{
PhonebookRootEntriesWasRecieved = true;
CheckSyncStatus();
}
public void SetPhonebookHasFolders(bool value)
{
PhonebookHasFolders = value;
Debug.Console(1, this, "Phonebook has folders: {0}", PhonebookHasFolders);
}
public void SetNumberOfContacts(int contacts)
{
NumberOfContacts = contacts;
NumberOfContactsWasReceived = true;
Debug.Console(1, this, "Phonebook contains {0} contacts.", NumberOfContacts);
CheckSyncStatus();
}
public void CodecDisconnected()
{
InitialPhonebookFoldersWasReceived = false;
PhonebookHasFolders = false;
NumberOfContacts = 0;
NumberOfContactsWasReceived = false;
}
void CheckSyncStatus()
{
if (InitialPhonebookFoldersWasReceived && NumberOfContactsWasReceived && PhonebookRootEntriesWasRecieved)
{
InitialSyncComplete = true;
Debug.Console(1, this, "Initial Phonebook Sync Complete!");
}
else
InitialSyncComplete = false;
}
}
} }

View File

@@ -9,7 +9,7 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Devices.Common.Codec namespace PepperDash.Essentials.Devices.Common.Codec
{ {
public class CiscoCodecPropertiesConfig public class CiscoSparkCodecPropertiesConfig
{ {
public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; } public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; }

View File

@@ -278,6 +278,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
/// Converts data returned from a cisco codec to the generic Directory format. /// Converts data returned from a cisco codec to the generic Directory format.
/// </summary> /// </summary>
/// <param name="result"></param> /// <param name="result"></param>
/// <param name="resultFolder"></param>
/// <returns></returns> /// <returns></returns>
public static CodecDirectory ConvertCiscoPhonebookToGeneric(PhonebookSearchResult result) public static CodecDirectory ConvertCiscoPhonebookToGeneric(PhonebookSearchResult result)
{ {

View File

@@ -98,10 +98,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
/// <summary> /// <summary>
/// Dials, yo! /// Dials, yo!
/// </summary> /// </summary>
public override void Dial(string s) public override void Dial(string number)
{ {
Debug.Console(1, this, "Dial: {0}", s); Debug.Console(1, this, "Dial: {0}", number);
var call = new CodecActiveCallItem() { Name = s, Number = s, Id = s, Status = eCodecCallStatus.Dialing }; var call = new CodecActiveCallItem() { Name = number, Number = number, Id = number, Status = eCodecCallStatus.Dialing };
ActiveCalls.Add(call); ActiveCalls.Add(call);
OnCallStatusChange(eCodecCallStatus.Unknown, call.Status, call); OnCallStatusChange(eCodecCallStatus.Unknown, call.Status, call);
//ActiveCallCountFeedback.FireUpdate(); //ActiveCallCountFeedback.FireUpdate();
@@ -114,6 +114,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
}, 2000); }, 2000);
} }
public override void Dial(Meeting meeting)
{
throw new NotImplementedException();
}
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@@ -349,7 +354,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
m.StartTime = DateTime.Now.AddMinutes(3).AddHours(i); m.StartTime = DateTime.Now.AddMinutes(3).AddHours(i);
m.EndTime = DateTime.Now.AddHours(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.Calls[0].Number = i + "meeting@fake.com";
_CodecSchedule.Meetings.Add(m); _CodecSchedule.Meetings.Add(m);
} }
} }

View File

@@ -71,7 +71,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
#region IHasDialer Members #region IHasDialer Members
public abstract void Dial(string s); public abstract void Dial(string number);
public abstract void Dial(Meeting meeting);
public abstract void EndCall(CodecActiveCallItem call); public abstract void EndCall(CodecActiveCallItem call);
public abstract void EndAllCalls(); public abstract void EndAllCalls();
public abstract void AcceptCall(CodecActiveCallItem call); public abstract void AcceptCall(CodecActiveCallItem call);
@@ -198,4 +199,98 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
CallItem = item; CallItem = item;
} }
} }
/// <summary>
/// Used to track the status of syncronizing the phonebook values when connecting to a codec or refreshing the phonebook info
/// </summary>
public class CodecPhonebookSyncState : IKeyed
{
bool _InitialSyncComplete;
public event EventHandler<EventArgs> InitialSyncCompleted;
public string Key { get; private set; }
public bool InitialSyncComplete
{
get { return _InitialSyncComplete; }
private set
{
if (value == true)
{
var handler = InitialSyncCompleted;
if (handler != null)
handler(this, new EventArgs());
}
_InitialSyncComplete = value;
}
}
public bool InitialPhonebookFoldersWasReceived { get; private set; }
public bool NumberOfContactsWasReceived { get; private set; }
public bool PhonebookRootEntriesWasRecieved { get; private set; }
public bool PhonebookHasFolders { get; private set; }
public int NumberOfContacts { get; private set; }
public CodecPhonebookSyncState(string key)
{
Key = key;
CodecDisconnected();
}
public void InitialPhonebookFoldersReceived()
{
InitialPhonebookFoldersWasReceived = true;
CheckSyncStatus();
}
public void PhonebookRootEntriesReceived()
{
PhonebookRootEntriesWasRecieved = true;
CheckSyncStatus();
}
public void SetPhonebookHasFolders(bool value)
{
PhonebookHasFolders = value;
Debug.Console(1, this, "Phonebook has folders: {0}", PhonebookHasFolders);
}
public void SetNumberOfContacts(int contacts)
{
NumberOfContacts = contacts;
NumberOfContactsWasReceived = true;
Debug.Console(1, this, "Phonebook contains {0} contacts.", NumberOfContacts);
CheckSyncStatus();
}
public void CodecDisconnected()
{
InitialPhonebookFoldersWasReceived = false;
PhonebookHasFolders = false;
NumberOfContacts = 0;
NumberOfContactsWasReceived = false;
}
void CheckSyncStatus()
{
if (InitialPhonebookFoldersWasReceived && NumberOfContactsWasReceived && PhonebookRootEntriesWasRecieved)
{
InitialSyncComplete = true;
Debug.Console(1, this, "Initial Phonebook Sync Complete!");
}
else
InitialSyncComplete = false;
}
}
} }

View File

@@ -190,12 +190,17 @@ namespace PepperDash.Essentials
/// <summary> /// <summary>
/// 1241 For touching the text area to bring up keyboard /// 1241 For touching the text area to bring up keyboard
/// </summary> /// </summary>
public const uint VcDirectoryTextEntryPress = 1241; public const uint VCDirectoryTextEntryPress = 1241;
/// <summary> /// <summary>
/// 1242 /// 1242
/// </summary> /// </summary>
public const uint VCStagingSelfViewLayoutPress = 1242; public const uint VCStagingSelfViewLayoutPress = 1242;
/// <summary>
/// 1243
/// </summary>
public const uint VCDirectoryBackVisible = 1243;
/// <summary> /// <summary>
/// 1251 /// 1251
/// </summary> /// </summary>

View File

@@ -30,7 +30,7 @@ namespace PepperDash.Essentials
/// 1231 - 1261 range of joins for recent list time /// 1231 - 1261 range of joins for recent list time
/// </summary> /// </summary>
public const uint VCRecentListTimeTextStart = 1231; public const uint VCRecentListTimeTextStart = 1231;
// // RANGE IN USE
public const uint VCRecentListTimeTextEnd = 1260; public const uint VCRecentListTimeTextEnd = 1260;
/// <summary> /// <summary>
/// 1291 - the current layout mode /// 1291 - the current layout mode
@@ -44,6 +44,32 @@ namespace PepperDash.Essentials
// RANGE IN USE // RANGE IN USE
public const uint VCDirectoryListTextEnd = 1400; public const uint VCDirectoryListTextEnd = 1400;
/// <summary>
/// 141112
/// </summary>
public const uint VCFavorites1Text = 1411;
/// <summary>
/// 1412
/// </summary>
public const uint VCFavorites2Text = 1412;
/// <summary>
/// 1413
/// </summary>
public const uint VCFavorites3Text = 1413;
/// <summary>
/// 1414
/// </summary>
public const uint VCFavorites4Text = 1414;
/// <summary>
/// 1415
/// </summary>
public const uint VCFavorites5Text = 1415;
//****************************************************** //******************************************************
// Keyboard // Keyboard
/// <summary> /// <summary>

View File

@@ -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.Codec;
using PepperDash.Essentials.Devices.Common.VideoCodec; using PepperDash.Essentials.Devices.Common.VideoCodec;
namespace PepperDash.Essentials namespace PepperDash.Essentials
@@ -408,7 +409,7 @@ namespace PepperDash.Essentials
TriList.SetSigFalseAction(UIBoolJoin.NextMeetingRibbonJoinPress, () => TriList.SetSigFalseAction(UIBoolJoin.NextMeetingRibbonJoinPress, () =>
{ {
HideNextMeetingPopup(); HideNextMeetingPopup();
RoomOnAndDialMeeting(meeting.ConferenceNumberToDial); RoomOnAndDialMeeting(meeting);
}); });
TriList.SetString(UIStringJoin.NextMeetingSecondaryButtonLabel, "Show Schedule"); TriList.SetString(UIStringJoin.NextMeetingSecondaryButtonLabel, "Show Schedule");
TriList.SetSigFalseAction(UIBoolJoin.CalendarHeaderButtonPress, () => TriList.SetSigFalseAction(UIBoolJoin.CalendarHeaderButtonPress, () =>
@@ -459,13 +460,15 @@ namespace PepperDash.Essentials
/// <summary> /// <summary>
/// Dials a meeting after turning on room (if necessary) /// Dials a meeting after turning on room (if necessary)
/// </summary> /// </summary>
void RoomOnAndDialMeeting(string number) void RoomOnAndDialMeeting(Meeting meeting)
{ {
Action dialAction = () => Action dialAction = () =>
{ {
var d = CurrentRoom.ScheduleSource as VideoCodecBase; var d = CurrentRoom.ScheduleSource as VideoCodecBase;
if (d != null) if (d != null)
d.Dial(number); {
d.Dial(meeting);
}
}; };
if (CurrentRoom.OnFeedback.BoolValue) if (CurrentRoom.OnFeedback.BoolValue)
dialAction(); dialAction();
@@ -980,7 +983,7 @@ namespace PepperDash.Essentials
PopupInterlock.Hide(); PopupInterlock.Hide();
var d = CurrentRoom.ScheduleSource as VideoCodecBase; var d = CurrentRoom.ScheduleSource as VideoCodecBase;
if (d != null) if (d != null)
RoomOnAndDialMeeting(mm.ConferenceNumberToDial); RoomOnAndDialMeeting(mm);
}); });
} }
MeetingsSrl.Count = i; MeetingsSrl.Count = i;

View File

@@ -61,6 +61,10 @@ namespace PepperDash.Essentials.UIDrivers.VC
CodecDirectory CurrentDirectoryResult; CodecDirectory CurrentDirectoryResult;
string LastFolderRequestedParentFolderId;
BoolFeedback DirectoryBackButtonVisibleFeedback;
// These are likely temp until we get a keyboard built // These are likely temp until we get a keyboard built
StringFeedback DialStringFeedback; StringFeedback DialStringFeedback;
StringBuilder DialStringBuilder = new StringBuilder(); StringBuilder DialStringBuilder = new StringBuilder();
@@ -130,6 +134,12 @@ namespace PepperDash.Essentials.UIDrivers.VC
DialStringBackspaceVisibleFeedback DialStringBackspaceVisibleFeedback
.LinkInputSig(TriList.BooleanInput[UIBoolJoin.VCKeypadBackspaceVisible]); .LinkInputSig(TriList.BooleanInput[UIBoolJoin.VCKeypadBackspaceVisible]);
TriList.SetSigFalseAction(UIBoolJoin.VCDirectoryBackPress, GetDirectoryParentFolderContents);
DirectoryBackButtonVisibleFeedback = new BoolFeedback(() => CurrentDirectoryResult != (codec as IHasDirectory).DirectoryRoot);
DirectoryBackButtonVisibleFeedback
.LinkInputSig(TriList.BooleanInput[UIBoolJoin.VCDirectoryBackVisible]);
TriList.SetSigFalseAction(UIBoolJoin.VCKeypadTextPress, RevealKeyboard); TriList.SetSigFalseAction(UIBoolJoin.VCKeypadTextPress, RevealKeyboard);
// Address and number // Address and number
@@ -389,9 +399,9 @@ namespace PepperDash.Essentials.UIDrivers.VC
TriList.SetString(timeTextOffset + i, timeText); TriList.SetString(timeTextOffset + i, timeText);
string iconName = null; string iconName = null;
if (c.Direction == eCodecCallDirection.Incoming) if (c.OccurenceType == eCodecOccurrenceType.Received)
iconName = "Left"; iconName = "Left";
else if (c.Direction == eCodecCallDirection.Outgoing) else if (c.OccurenceType == eCodecOccurrenceType.Placed)
iconName = "Right"; iconName = "Right";
else else
iconName = "Help"; iconName = "Help";
@@ -419,7 +429,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
if (i < favs.Count) if (i < favs.Count)
{ {
var fav = favs[(int)i]; var fav = favs[(int)i];
TriList.SetString(1211 + i, fav.Name); TriList.SetString(1411 + i, fav.Name);
TriList.SetBool(1221 + i, true); TriList.SetBool(1221 + i, true);
TriList.SetSigFalseAction(1211 + i, () => TriList.SetSigFalseAction(1211 + i, () =>
{ {
@@ -445,7 +455,14 @@ namespace PepperDash.Essentials.UIDrivers.VC
DirectoryList = new SmartObjectDynamicList(TriList.SmartObjects[UISmartObjectJoin.VCDirectoryList], DirectoryList = new SmartObjectDynamicList(TriList.SmartObjects[UISmartObjectJoin.VCDirectoryList],
true, 1300); true, 1300);
codec.DirectoryResultReturned += new EventHandler<DirectoryEventArgs>(dir_DirectoryResultReturned); codec.DirectoryResultReturned += new EventHandler<DirectoryEventArgs>(dir_DirectoryResultReturned);
CurrentDirectoryResult = codec.DirectoryRoot;
if (codec.PhonebookSyncState.InitialSyncComplete)
SetCurrentDirectoryToRoot();
else
{
codec.PhonebookSyncState.InitialSyncCompleted += new EventHandler<EventArgs>(PhonebookSyncState_InitialSyncCompleted);
}
// If there is something here now, show it otherwise wait for the event // If there is something here now, show it otherwise wait for the event
if (CurrentDirectoryResult != null && codec.DirectoryRoot.DirectoryResults.Count > 0) if (CurrentDirectoryResult != null && codec.DirectoryRoot.DirectoryResults.Count > 0)
@@ -456,6 +473,37 @@ namespace PepperDash.Essentials.UIDrivers.VC
} }
} }
/// <summary>
/// Sets the current directory resutls to the DirectorRoot and updates Back Button visibiltiy
/// </summary>
void SetCurrentDirectoryToRoot()
{
LastFolderRequestedParentFolderId = string.Empty;
CurrentDirectoryResult = (Codec as IHasDirectory).DirectoryRoot;
DirectoryBackButtonVisibleFeedback.FireUpdate();
RefreshDirectory();
}
/// <summary>
/// Setup the Directory list when notified that the initial phonebook sync is completed
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void PhonebookSyncState_InitialSyncCompleted(object sender, EventArgs e)
{
var codec = Codec as IHasDirectory;
SetCurrentDirectoryToRoot();
if (CurrentDirectoryResult != null && codec.DirectoryRoot.DirectoryResults.Count > 0)
{
RefreshDirectory();
}
}
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@@ -464,9 +512,38 @@ namespace PepperDash.Essentials.UIDrivers.VC
void dir_DirectoryResultReturned(object sender, DirectoryEventArgs e) void dir_DirectoryResultReturned(object sender, DirectoryEventArgs e)
{ {
CurrentDirectoryResult = e.Directory; CurrentDirectoryResult = e.Directory;
DirectoryBackButtonVisibleFeedback.FireUpdate();
RefreshDirectory(); RefreshDirectory();
} }
/// <summary>
/// Helper method to retrieve directory folder contents and store last requested folder id
/// </summary>
/// <param name="folderId"></param>
void GetDirectoryFolderContents(DirectoryFolder folder)
{
LastFolderRequestedParentFolderId = folder.ParentFolderId;
(Codec as IHasDirectory).GetDirectoryFolderContents(folder.FolderId);
}
/// <summary>
/// Request the parent folder contents or sets back to the root if no parent folder
/// </summary>
void GetDirectoryParentFolderContents()
{
var codec = Codec as IHasDirectory;
if (!string.IsNullOrEmpty(LastFolderRequestedParentFolderId))
codec.GetDirectoryFolderContents(LastFolderRequestedParentFolderId);
else
{
SetCurrentDirectoryToRoot();
}
}
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@@ -484,9 +561,11 @@ namespace PepperDash.Essentials.UIDrivers.VC
} }
i++; i++;
DirectoryList.SetItemMainText(i, r.Name);
if(r is DirectoryContact) if(r is DirectoryContact)
{ {
DirectoryList.SetItemMainText(i, r.Name);
var dc = r as DirectoryContact; var dc = r as DirectoryContact;
// if more than one contact method, pop up modal to choose // if more than one contact method, pop up modal to choose
// otherwiese dial 0 entry // otherwiese dial 0 entry
@@ -499,15 +578,18 @@ namespace PepperDash.Essentials.UIDrivers.VC
} }
} }
else else // is DirectoryFolder
{ {
DirectoryList.SetItemMainText(i, string.Format("[+] {0}", r.Name));
var df = r as DirectoryFolder;
DirectoryList.SetItemButtonAction(i, b => DirectoryList.SetItemButtonAction(i, b =>
{ {
if (!b) if (!b)
{ {
var id = (r as DirectoryFolder).FolderId; GetDirectoryFolderContents(df);
(Codec as IHasDirectory).GetDirectoryFolderContents(id); // will later call event handler after folder contents retrieved
// will later call event handler
} }
}); });
} }