Fixed Stop Sharing button visible feedback on call list

This commit is contained in:
Neil Dorin
2017-10-22 12:39:57 -06:00
parent 3e39210cc0
commit 3897a41dd1
8 changed files with 152 additions and 95 deletions

View File

@@ -82,7 +82,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
private CiscoCodecConfiguration.RootObject CodecConfiguration;
private CiscoCodecStatus.RootObject CodecStatus;
private CiscoCodecStatus.RootObject CodecStatus = new CiscoCodecStatus.RootObject();
public CodecCallHistory CallHistory { get; private set; }
@@ -133,7 +133,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
protected override Func<bool> SharingContentIsOnFeedbackFunc
{
get
{
{
return () => CodecStatus.Status.Conference.Presentation.Mode.BoolValue;
}
}
@@ -272,12 +272,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
PortGather.IncludeDelimiter = true;
PortGather.LineReceived += this.Port_LineReceived;
//CodecObtp = new CiscoOneButtonToPush();
//PhoneBook = new Corporate_Phone_Book();
CodecConfiguration = new CiscoCodecConfiguration.RootObject();
CodecStatus = new CiscoCodecStatus.RootObject();
//CodecStatus = new CiscoCodecStatus.RootObject();
CodecInfo = new CiscoCodecInfo(CodecStatus, CodecConfiguration);
@@ -304,6 +300,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
CodecStatus.Status.Video.Selfview.Mode.ValueChangedAction = SelfviewIsOnFeedback.FireUpdate;
CodecStatus.Status.Video.Selfview.PIPPosition.ValueChangedAction = ComputeSelfviewPipStatus;
CodecStatus.Status.Video.Layout.LayoutFamily.Local.ValueChangedAction = ComputeLocalLayout;
CodecStatus.Status.Conference.Presentation.Mode.ValueChangedAction = SharingContentIsOnFeedback.FireUpdate;
CodecOsdIn = new RoutingInputPort(RoutingPortNames.CodecOsd, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, new Action(StopSharing), this);
@@ -998,6 +995,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
SelectPresentationSource(2);
}
/// <summary>
/// Starts presentation sharing
/// </summary>
public override void StartSharing()
{
string sendingMode = string.Empty;
@@ -1010,9 +1010,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
SendText(string.Format("xCommand Presentation Start PresentationSource: {0} SendingMode: {1}", PresentationSource, sendingMode));
}
/// <summary>
/// Stops sharing the current presentation
/// </summary>
public override void StopSharing()
{
SendText(string.Format("xCommand Presentation Stop PresentationSource: {0}", PresentationSource));
SendText("xCommand Presentation Stop");
}
public override void PrivacyModeOn()

View File

@@ -109,6 +109,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
public Number Number { get; set; }
public Device Device { get; set; }
public CallType CallType { get; set; }
public ContactMethod()
{
ContactMethodId = new ContactMethodId();
Number = new Number();
Device = new Device();
CallType = new CallType();
}
}
public class Contact
@@ -119,6 +127,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
public FolderId2 FolderId { get; set; }
public Title Title { get; set; }
public List<ContactMethod> ContactMethod { get; set; }
public Contact()
{
Name = new Name2();
ContactId = new ContactId();
FolderId = new FolderId2();
Title = new Title();
ContactMethod = new List<ContactMethod>();
}
}
public class PhonebookSearchResult
@@ -209,12 +226,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
{
var contact = new DirectoryContact();
if (c.FolderId == null)
if (string.IsNullOrEmpty(c.FolderId.Value))
{
contact.Name = c.Name.Value;
contact.ContactId = c.ContactId.Value;
if(c.Title != null)
if(!string.IsNullOrEmpty(c.Title.Value))
contact.Title = c.Title.Value;
if (Debug.Level > 0)
@@ -225,10 +242,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
var tempContactMethod = new PepperDash.Essentials.Devices.Common.Codec.ContactMethod();
if (m.CallType != null)
eContactMethodCallType callType = eContactMethodCallType.Unknown;
if (!string.IsNullOrEmpty(m.CallType.Value))
{
eContactMethodCallType callType = eContactMethodCallType.Unknown;
if (m.CallType != null)
if (!string.IsNullOrEmpty(m.CallType.Value))
{
if (m.CallType.Value.ToLower() == "audio")
callType = eContactMethodCallType.Audio;
@@ -239,9 +256,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
}
}
if (m.Device != null)
eContactMethodDevice device = eContactMethodDevice.Unknown;
if (!string.IsNullOrEmpty(m.Device.Value))
{
eContactMethodDevice device = eContactMethodDevice.Unknown;
if (m.Device.Value.ToLower() == "mobile")
device = eContactMethodDevice.Mobile;
@@ -288,81 +305,90 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
var contacts = new List<Codec.DirectoryItem>();
if (result.Folder.Count > 0)
try
{
foreach (Folder f in result.Folder)
if (result.Folder.Count > 0)
{
var folder = new DirectoryFolder();
folder.Name = f.Name.Value;
folder.FolderId = f.FolderId.Value;
if (f.ParentFolderId != null)
foreach (Folder f in result.Folder)
{
//
folder.ParentFolderId = f.ParentFolderId.Value;
}
var folder = new DirectoryFolder();
folders.Add(folder);
}
folder.Name = f.Name.Value;
folder.FolderId = f.FolderId.Value;
folders.OrderBy(f => f.Name);
directory.AddFoldersToDirectory(folders);
}
if (result.Contact.Count > 0)
{
foreach (Contact c in result.Contact)
{
var contact = new DirectoryContact();
contact.Name = c.Name.Value;
contact.ContactId = c.ContactId.Value;
if (c.Title != null)
contact.Title = c.Title.Value;
if(c.FolderId != null)
{
contact.FolderId = c.FolderId.Value;
}
foreach (ContactMethod m in c.ContactMethod)
{
eContactMethodCallType callType = eContactMethodCallType.Unknown;
if(m.CallType != null)
if (f.ParentFolderId != null)
{
if(m.CallType.Value.ToLower() == "audio")
callType = eContactMethodCallType.Audio;
else if (m.CallType.Value.ToLower() == "video")
callType = eContactMethodCallType.Video;
folder.ParentFolderId = f.ParentFolderId.Value;
}
eContactMethodDevice device = eContactMethodDevice.Unknown;
if (m.Device.Value.ToLower() == "mobile")
device = eContactMethodDevice.Mobile;
else if (m.Device.Value.ToLower() == "telephone")
device = eContactMethodDevice.Telephone;
else if (m.Device.Value.ToLower() == "video")
device = eContactMethodDevice.Video;
else if (m.Device.Value.ToLower() == "other")
device = eContactMethodDevice.Other;
contact.ContactMethods.Add(new PepperDash.Essentials.Devices.Common.Codec.ContactMethod()
{
Number = m.Number.Value,
ContactMethodId = m.ContactMethodId.Value,
CallType = callType,
Device = device
});
folders.Add(folder);
}
contacts.Add(contact);
folders.OrderBy(f => f.Name);
directory.AddFoldersToDirectory(folders);
}
contacts.OrderBy(c => c.Name);
if (result.Contact.Count > 0)
{
foreach (Contact c in result.Contact)
{
var contact = new DirectoryContact();
directory.AddContactsToDirectory(contacts);
contact.Name = c.Name.Value;
contact.ContactId = c.ContactId.Value;
if (!string.IsNullOrEmpty(c.Title.Value))
contact.Title = c.Title.Value;
if (c.FolderId != null)
{
contact.FolderId = c.FolderId.Value;
}
foreach (ContactMethod m in c.ContactMethod)
{
eContactMethodCallType callType = eContactMethodCallType.Unknown;
if (!string.IsNullOrEmpty(m.CallType.Value))
{
if (m.CallType.Value.ToLower() == "audio")
callType = eContactMethodCallType.Audio;
else if (m.CallType.Value.ToLower() == "video")
callType = eContactMethodCallType.Video;
}
eContactMethodDevice device = eContactMethodDevice.Unknown;
if (!string.IsNullOrEmpty(m.Device.Value))
{
if (m.Device.Value.ToLower() == "mobile")
device = eContactMethodDevice.Mobile;
else if (m.Device.Value.ToLower() == "telephone")
device = eContactMethodDevice.Telephone;
else if (m.Device.Value.ToLower() == "video")
device = eContactMethodDevice.Video;
else if (m.Device.Value.ToLower() == "other")
device = eContactMethodDevice.Other;
}
contact.ContactMethods.Add(new PepperDash.Essentials.Devices.Common.Codec.ContactMethod()
{
Number = m.Number.Value,
ContactMethodId = m.ContactMethodId.Value,
CallType = callType,
Device = device
});
}
contacts.Add(contact);
}
contacts.OrderBy(c => c.Name);
directory.AddContactsToDirectory(contacts);
}
}
catch (Exception e)
{
Debug.Console(1, "Error converting Cisco Phonebook results to generic: {0}", e);
}
return directory;

View File

@@ -5,6 +5,8 @@ using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronXml.Serialization;
using PepperDash.Core;
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
{
/// <summary>
@@ -395,15 +397,34 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public RequestFloorAvailability RequestFloorAvailability { get; set; }
}
public class Source2
{
public string Value { get; set; }
}
public class SendingMode
{
public string Value { get; set; }
}
public class LocalInstance
{
public string id { get; set; }
public SendingMode SendingMode {get; set;}
public Source2 Source { get; set; }
}
public class Presentation
{
public CallId2 CallId { get; set; }
public Mode2 Mode { get; set; }
public Whiteboard Whiteboard { get; set; }
public List<LocalInstance> LocalInstance { get; set; }
public Presentation()
{
Mode = new Mode2();
LocalInstance = new List<LocalInstance>();
}
}

View File

@@ -187,6 +187,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
public override void StartSharing()
{
_SharingIsOn = true;
SharingContentIsOnFeedback.FireUpdate();
}
/// <summary>
@@ -201,7 +202,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
public override void StandbyActivate()
{
_StandbyIsOn = true;
SharingContentIsOnFeedback.FireUpdate();
}
public override void StandbyDeactivate()

View File

@@ -30,8 +30,8 @@ namespace PepperDash.Essentials
/// </summary>
public override void InitializeSystem()
{
CrestronConsole.AddNewConsoleCommand(s => GoWithLoad(), "go", "Reloads configuration file",
ConsoleAccessLevelEnum.AccessOperator);
//CrestronConsole.AddNewConsoleCommand(s => GoWithLoad(), "go", "Reloads configuration file",
// ConsoleAccessLevelEnum.AccessOperator);
//CrestronConsole.AddNewConsoleCommand(s => TearDown(), "ungo", "Unloads configuration file",
// ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(s =>
@@ -41,7 +41,7 @@ namespace PepperDash.Essentials
},
"listtielines", "Prints out all tie lines", ConsoleAccessLevelEnum.AccessOperator);
//GoWithLoad();
GoWithLoad();
}
/// <summary>

View File

@@ -44,7 +44,7 @@ namespace PepperDash.Essentials
/// <summary>
/// 1005
/// </summary>
public const uint CallSharedSourceInfoEnable = 1005;
public const uint CallSharedSourceInfoVisible = 1005;
/// <summary>
/// 1006
/// </summary>
@@ -487,6 +487,10 @@ namespace PepperDash.Essentials
/// </summary>
public const uint HeaderCallStatusRightPositionVisible = 15025;
/// <summary>
/// 15027
/// </summary>
public const uint HeaderCallStatusLabelPress = 15027;
/// <summary>
/// 15028 The gear button in header
/// </summary>
public const uint FIXFIX_HeaderGearButtonPress_FIXFIX = 15028;

View File

@@ -1076,6 +1076,9 @@ namespace PepperDash.Essentials
TriList.SetSigFalseAction(i, () => { });
}
TriList.SetSigFalseAction(UIBoolJoin.HeaderCallStatusLabelPress, ShowActiveCallsList);
// Set Call Status Subpage Position
if (nextJoin == 3951)

View File

@@ -112,8 +112,6 @@ namespace PepperDash.Essentials.UIDrivers.VC
codec.CallStatusChange += new EventHandler<CodecCallStatusItemChangeEventArgs>(Codec_CallStatusChange);
codec.SharingSourceFeedback.OutputChange += new EventHandler<EventArgs>(SharingSourceFeedback_OutputChange);
// If the codec is ready, then get the values we want, otherwise wait
if (Codec.IsReady)
Codec_IsReady();
@@ -182,8 +180,9 @@ namespace PepperDash.Essentials.UIDrivers.VC
TriList.SetSigHeldAction(UIBoolJoin.VCDirectoryBackspacePress, 500,
StartSearchBackspaceRepeat, StopSearchBackspaceRepeat, SearchKeypadBackspacePress);
CallSharingInfoVisibleFeedback = new BoolFeedback(() => !string.IsNullOrEmpty(Codec.SharingSourceFeedback.StringValue));
CallSharingInfoVisibleFeedback.LinkInputSig(triList.BooleanInput[UIBoolJoin.CallSharedSourceInfoEnable]);
CallSharingInfoVisibleFeedback = new BoolFeedback(() => Codec.SharingContentIsOnFeedback.BoolValue);
codec.SharingContentIsOnFeedback.OutputChange += new EventHandler<EventArgs>(SharingContentIsOnFeedback_OutputChange);
CallSharingInfoVisibleFeedback.LinkInputSig(triList.BooleanInput[UIBoolJoin.CallSharedSourceInfoVisible]);
CallSharingInfoTextFeedback = new StringFeedback(() => GetCurrentSourceName(Codec.SharingSourceFeedback.StringValue));
CallSharingInfoTextFeedback.LinkInputSig(triList.StringInput[UIStringJoin.CallSharedSourceNameText]);
@@ -198,9 +197,14 @@ namespace PepperDash.Essentials.UIDrivers.VC
/// <returns></returns>
string GetCurrentSourceName(string key)
{
Debug.Console(1, "GetCurrentSource: Attempting to get device with key: {0}", key);
var device = DeviceManager.GetDeviceForKey(key);
return (device as SourceListItem).Name;
if (device != null)
return (device as SourceListItem).Name;
else
return "None";
}
/// <summary>
@@ -208,14 +212,10 @@ namespace PepperDash.Essentials.UIDrivers.VC
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void SharingSourceFeedback_OutputChange(object sender, EventArgs e)
void SharingContentIsOnFeedback_OutputChange(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty((sender as IHasContentSharing).SharingSourceFeedback.StringValue))
{
// Source is being shared
}
CallSharingInfoVisibleFeedback.FireUpdate();
CallSharingInfoTextFeedback.FireUpdate();
}
/// <summary>