Cisco codec layout and min/max buttons for single display. v1.0.7

This commit is contained in:
Heath Volmer
2017-12-07 15:45:54 -07:00
parent c3d455a7c2
commit a61bfc4173
8 changed files with 82 additions and 31 deletions

View File

@@ -68,7 +68,7 @@ namespace PepperDash.Essentials.Core
// Count the enable lines to see what max items is
MaxDefinedItems = (ushort)SRL.BooleanInput
.Where(s => s.Name.Contains("Enable")).Count();
Debug.Console(0, "SRL {0} contains max {1} items", SRL.ID, MaxDefinedItems);
Debug.Console(2, "SRL {0} contains max {1} items", SRL.ID, MaxDefinedItems);
SRL.SigChange -= new SmartObjectSigChangeEventHandler(SRL_SigChange);
SRL.SigChange += new SmartObjectSigChangeEventHandler(SRL_SigChange);

View File

@@ -33,6 +33,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public StatusMonitorBase CommunicationMonitor { get; private set; }
public BoolFeedback PresentationViewMaximizedFeedback { get; private set; }
string CurrentPresentationView;
public BoolFeedback RoomIsOccupiedFeedback { get; private set; }
public IntFeedback PeopleCountFeedback { get; private set; }
@@ -68,7 +72,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
/// </summary>
public List<CodecCommandWithLabel> LocalLayouts = new List<CodecCommandWithLabel>()
{
new CodecCommandWithLabel("auto", "Auto"),
//new CodecCommandWithLabel("auto", "Auto"),
//new CiscoCodecLocalLayout("custom", "Custom"), // Left out for now
new CodecCommandWithLabel("equal","Equal"),
new CodecCommandWithLabel("overlay","Overlay"),
@@ -242,6 +246,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
SelfviewPipPositionFeedback = new StringFeedback(SelfviewPipPositionFeedbackFunc);
LocalLayoutFeedback = new StringFeedback(LocalLayoutFeedbackFunc);
PresentationViewMaximizedFeedback = new BoolFeedback(() => CurrentPresentationView == "Maximized");
Communication = comm;
if (props.CommunicationMonitorProperties != null)
@@ -1230,6 +1236,20 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
}
}
/// <summary>
///
/// </summary>
public void MinMaxLayoutToggle()
{
if (PresentationViewMaximizedFeedback.BoolValue)
CurrentPresentationView = "Minimized";
else
CurrentPresentationView = "Maximized";
SendText(string.Format("xCommand Video PresentationView Set View: {0}", CurrentPresentationView));
PresentationViewMaximizedFeedback.FireUpdate();
}
/// <summary>
/// Calculates the current selfview PIP position
/// </summary>

View File

@@ -16,5 +16,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
StringFeedback LocalLayoutFeedback { get; }
void LocalLayoutToggle();
void MinMaxLayoutToggle();
}
}

View File

@@ -4,5 +4,5 @@
[assembly: AssemblyCompany("PepperDash Technology Corp")]
[assembly: AssemblyProduct("PepperDashEssentials")]
[assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2017")]
[assembly: AssemblyVersion("1.0.6.*")]
[assembly: AssemblyVersion("1.0.7.*")]

View File

@@ -22,7 +22,7 @@ namespace PepperDash.Essentials
CotijaConfig Config;
//HttpClient Client;
HttpClient Client;
Dictionary<string, Object> ActionDictionary = new Dictionary<string, Object>(StringComparer.InvariantCultureIgnoreCase);
@@ -139,7 +139,7 @@ namespace PepperDash.Essentials
/// <param name="url">URL of the server, including the port number, if not 80. Format: "serverUrlOrIp:port"</param>
void RegisterSystemToServer()
{
try
try
{
string filePath = string.Format(@"\NVRAM\Program{0}\configurationFile.json", Global.ControlSystem.ProgramNumber);
string postBody = null;
@@ -169,9 +169,10 @@ namespace PepperDash.Essentials
}
else
{
var client = new HttpClient();
client.Verbose = true;
client.KeepAlive = true;
//if(Client == null)
Client = new HttpClient();
Client.Verbose = true;
Client.KeepAlive = true;
SystemUuid = Essentials.ConfigReader.ConfigObject.SystemUuid;
@@ -184,7 +185,7 @@ namespace PepperDash.Essentials
request.Header.SetHeaderValue("Content-Type", "application/json");
request.ContentString = postBody;
client.DispatchAsync(request, PostConnectionCallback);
Client.DispatchAsync(request, PostConnectionCallback);
}
}
@@ -204,15 +205,14 @@ namespace PepperDash.Essentials
{
try
{
var client = new HttpClient();
HttpClientRequest request = new HttpClientRequest();
client.Verbose = true;
client.KeepAlive = true;
if(Client == null)
Client = new HttpClient();
Client.Verbose = true;
Client.KeepAlive = true;
string url = string.Format("http://{0}/api/system/{1}/status", Config.ServerUrl, SystemUuid);
HttpClientRequest request = new HttpClientRequest();
request.Url.Parse(url);
request.RequestType = RequestType.Post;
request.Header.SetHeaderValue("Content-Type", "application/json");
@@ -225,7 +225,7 @@ namespace PepperDash.Essentials
Debug.Console(1, this, "Posting to '{0}':\n{1}", url, request.ContentString);
try
{
client.DispatchAsync(request, (r, err) => { if (r != null) { Debug.Console(1, this, "Status Response Code: {0}", r.Code); } });
Client.DispatchAsync(request, (r, err) => { if (r != null) { Debug.Console(1, this, "Status Response Code: {0}", r.Code); } });
}
catch (Exception e)
{
@@ -276,10 +276,11 @@ namespace PepperDash.Essentials
ServerReconnectTimer = null;
}
if (SseClient == null)
{
#warning The SSE Client from a previous session might need to be killed...
//if (SseClient == null)
//{
ConnectSseClient(null);
}
//}
}
else
{
@@ -301,16 +302,13 @@ namespace PepperDash.Essentials
/// <param name="o"></param>
void HeartbeatExpiredTimerCallback(object o)
{
if (ServerHeartbeatCheckTimer != null)
Debug.Console(1, this, "Heartbeat Timer Expired.");
if (ServerHeartbeatCheckTimer != null)
{
Debug.Console(1, this, "Heartbeat Timer Expired.");
ServerHeartbeatCheckTimer.Stop();
ServerHeartbeatCheckTimer = null;
}
StartReconnectTimer();
StartReconnectTimer();
}
/// <summary>
@@ -378,7 +376,11 @@ namespace PepperDash.Essentials
SseClient.Connect();
}
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void LineGathered_LineReceived(object sender, GenericCommMethodReceiveTextArgs e)
{
//Debug.Console(1, this, "Received from Server: '{0}'", e.Text);

View File

@@ -107,7 +107,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
SetupDirectoryList();
SetupRecentCallsList();
SetupFavorites();
SetupSelfViewControls();
SetupLayoutControls();
codec.CallStatusChange += new EventHandler<CodecCallStatusItemChangeEventArgs>(Codec_CallStatusChange);
@@ -736,23 +736,51 @@ namespace PepperDash.Essentials.UIDrivers.VC
/// <summary>
///
/// </summary>
void SetupSelfViewControls()
void SetupLayoutControls()
{
TriList.SetSigFalseAction(UIBoolJoin.VCStagingSelfViewLayoutPress, this.ShowSelfViewLayout);
var svc = Codec as IHasCodecSelfview;
if (svc != null)
{
TriList.SetSigFalseAction(UIBoolJoin.VCSelfViewTogglePress, svc.SelfviewModeToggle);
svc.SelfviewIsOnFeedback.LinkInputSig(TriList.BooleanInput[UIBoolJoin.VCSelfViewTogglePress]);
//TriList.SetSigFalseAction(UIBoolJoin.VCSelfViewPipTogglePress, () => { });
}
var lc = Codec as IHasCodecLayouts;
if (lc != null)
{
TriList.SetSigFalseAction(UIBoolJoin.VCLayoutTogglePress, lc.LocalLayoutToggle);
lc.LocalLayoutFeedback.LinkInputSig(TriList.StringInput[UIStringJoin.VCLayoutModeText]);
// attach to cisco special things to enable buttons
var cisco = Codec as PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoSparkCodec;
if (cisco != null)
{
// Cisco has min/max buttons that need special sauce
cisco.SharingContentIsOnFeedback.OutputChange += CiscoSharingAndPresentation_OutputChanges;
cisco.PresentationViewMaximizedFeedback.OutputChange += CiscoSharingAndPresentation_OutputChanges;
TriList.SetSigFalseAction(UIBoolJoin.VCMinMaxPress, cisco.MinMaxLayoutToggle);
}
}
}
/// <summary>
/// This should only be linked by cisco classes (spark initially)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void CiscoSharingAndPresentation_OutputChanges(object sender, EventArgs e)
{
var cisco = Codec as PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoSparkCodec;
if (cisco != null)
{
var sharing = cisco.SharingContentIsOnFeedback.BoolValue;
var maximized = cisco.PresentationViewMaximizedFeedback.BoolValue;
//set feedback and enables
TriList.BooleanInput[UIBoolJoin.VCMinMaxEnable].BoolValue = sharing;
TriList.BooleanInput[UIBoolJoin.VCLayoutToggleEnable].BoolValue = sharing && maximized;
TriList.BooleanInput[UIBoolJoin.VCMinMaxPress].BoolValue = maximized;
}
}