mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 12:44:58 +00:00
Cisco codec layout and min/max buttons for single display. v1.0.7
This commit is contained in:
@@ -68,7 +68,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
// Count the enable lines to see what max items is
|
// Count the enable lines to see what max items is
|
||||||
MaxDefinedItems = (ushort)SRL.BooleanInput
|
MaxDefinedItems = (ushort)SRL.BooleanInput
|
||||||
.Where(s => s.Name.Contains("Enable")).Count();
|
.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);
|
||||||
SRL.SigChange += new SmartObjectSigChangeEventHandler(SRL_SigChange);
|
SRL.SigChange += new SmartObjectSigChangeEventHandler(SRL_SigChange);
|
||||||
|
|||||||
@@ -33,6 +33,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
|
|
||||||
public StatusMonitorBase CommunicationMonitor { get; private set; }
|
public StatusMonitorBase CommunicationMonitor { get; private set; }
|
||||||
|
|
||||||
|
public BoolFeedback PresentationViewMaximizedFeedback { get; private set; }
|
||||||
|
|
||||||
|
string CurrentPresentationView;
|
||||||
|
|
||||||
public BoolFeedback RoomIsOccupiedFeedback { get; private set; }
|
public BoolFeedback RoomIsOccupiedFeedback { get; private set; }
|
||||||
|
|
||||||
public IntFeedback PeopleCountFeedback { get; private set; }
|
public IntFeedback PeopleCountFeedback { get; private set; }
|
||||||
@@ -68,7 +72,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public List<CodecCommandWithLabel> LocalLayouts = new List<CodecCommandWithLabel>()
|
public List<CodecCommandWithLabel> LocalLayouts = new List<CodecCommandWithLabel>()
|
||||||
{
|
{
|
||||||
new CodecCommandWithLabel("auto", "Auto"),
|
//new CodecCommandWithLabel("auto", "Auto"),
|
||||||
//new CiscoCodecLocalLayout("custom", "Custom"), // Left out for now
|
//new CiscoCodecLocalLayout("custom", "Custom"), // Left out for now
|
||||||
new CodecCommandWithLabel("equal","Equal"),
|
new CodecCommandWithLabel("equal","Equal"),
|
||||||
new CodecCommandWithLabel("overlay","Overlay"),
|
new CodecCommandWithLabel("overlay","Overlay"),
|
||||||
@@ -242,6 +246,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
SelfviewPipPositionFeedback = new StringFeedback(SelfviewPipPositionFeedbackFunc);
|
SelfviewPipPositionFeedback = new StringFeedback(SelfviewPipPositionFeedbackFunc);
|
||||||
LocalLayoutFeedback = new StringFeedback(LocalLayoutFeedbackFunc);
|
LocalLayoutFeedback = new StringFeedback(LocalLayoutFeedbackFunc);
|
||||||
|
|
||||||
|
PresentationViewMaximizedFeedback = new BoolFeedback(() => CurrentPresentationView == "Maximized");
|
||||||
|
|
||||||
Communication = comm;
|
Communication = comm;
|
||||||
|
|
||||||
if (props.CommunicationMonitorProperties != null)
|
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>
|
/// <summary>
|
||||||
/// Calculates the current selfview PIP position
|
/// Calculates the current selfview PIP position
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -16,5 +16,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
StringFeedback LocalLayoutFeedback { get; }
|
StringFeedback LocalLayoutFeedback { get; }
|
||||||
|
|
||||||
void LocalLayoutToggle();
|
void LocalLayoutToggle();
|
||||||
|
void MinMaxLayoutToggle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,5 +4,5 @@
|
|||||||
[assembly: AssemblyCompany("PepperDash Technology Corp")]
|
[assembly: AssemblyCompany("PepperDash Technology Corp")]
|
||||||
[assembly: AssemblyProduct("PepperDashEssentials")]
|
[assembly: AssemblyProduct("PepperDashEssentials")]
|
||||||
[assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2017")]
|
[assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2017")]
|
||||||
[assembly: AssemblyVersion("1.0.6.*")]
|
[assembly: AssemblyVersion("1.0.7.*")]
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
CotijaConfig Config;
|
CotijaConfig Config;
|
||||||
|
|
||||||
//HttpClient Client;
|
HttpClient Client;
|
||||||
|
|
||||||
Dictionary<string, Object> ActionDictionary = new Dictionary<string, Object>(StringComparer.InvariantCultureIgnoreCase);
|
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>
|
/// <param name="url">URL of the server, including the port number, if not 80. Format: "serverUrlOrIp:port"</param>
|
||||||
void RegisterSystemToServer()
|
void RegisterSystemToServer()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string filePath = string.Format(@"\NVRAM\Program{0}\configurationFile.json", Global.ControlSystem.ProgramNumber);
|
string filePath = string.Format(@"\NVRAM\Program{0}\configurationFile.json", Global.ControlSystem.ProgramNumber);
|
||||||
string postBody = null;
|
string postBody = null;
|
||||||
@@ -169,9 +169,10 @@ namespace PepperDash.Essentials
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var client = new HttpClient();
|
//if(Client == null)
|
||||||
client.Verbose = true;
|
Client = new HttpClient();
|
||||||
client.KeepAlive = true;
|
Client.Verbose = true;
|
||||||
|
Client.KeepAlive = true;
|
||||||
|
|
||||||
SystemUuid = Essentials.ConfigReader.ConfigObject.SystemUuid;
|
SystemUuid = Essentials.ConfigReader.ConfigObject.SystemUuid;
|
||||||
|
|
||||||
@@ -184,7 +185,7 @@ namespace PepperDash.Essentials
|
|||||||
request.Header.SetHeaderValue("Content-Type", "application/json");
|
request.Header.SetHeaderValue("Content-Type", "application/json");
|
||||||
request.ContentString = postBody;
|
request.ContentString = postBody;
|
||||||
|
|
||||||
client.DispatchAsync(request, PostConnectionCallback);
|
Client.DispatchAsync(request, PostConnectionCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -204,15 +205,14 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var client = new HttpClient();
|
if(Client == null)
|
||||||
|
Client = new HttpClient();
|
||||||
HttpClientRequest request = new HttpClientRequest();
|
Client.Verbose = true;
|
||||||
|
Client.KeepAlive = true;
|
||||||
client.Verbose = true;
|
|
||||||
client.KeepAlive = true;
|
|
||||||
|
|
||||||
string url = string.Format("http://{0}/api/system/{1}/status", Config.ServerUrl, SystemUuid);
|
string url = string.Format("http://{0}/api/system/{1}/status", Config.ServerUrl, SystemUuid);
|
||||||
|
|
||||||
|
HttpClientRequest request = new HttpClientRequest();
|
||||||
request.Url.Parse(url);
|
request.Url.Parse(url);
|
||||||
request.RequestType = RequestType.Post;
|
request.RequestType = RequestType.Post;
|
||||||
request.Header.SetHeaderValue("Content-Type", "application/json");
|
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);
|
Debug.Console(1, this, "Posting to '{0}':\n{1}", url, request.ContentString);
|
||||||
try
|
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)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -276,10 +276,11 @@ namespace PepperDash.Essentials
|
|||||||
ServerReconnectTimer = null;
|
ServerReconnectTimer = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SseClient == null)
|
#warning The SSE Client from a previous session might need to be killed...
|
||||||
{
|
//if (SseClient == null)
|
||||||
|
//{
|
||||||
ConnectSseClient(null);
|
ConnectSseClient(null);
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -301,16 +302,13 @@ namespace PepperDash.Essentials
|
|||||||
/// <param name="o"></param>
|
/// <param name="o"></param>
|
||||||
void HeartbeatExpiredTimerCallback(object o)
|
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.Stop();
|
||||||
|
|
||||||
ServerHeartbeatCheckTimer = null;
|
ServerHeartbeatCheckTimer = null;
|
||||||
}
|
}
|
||||||
|
StartReconnectTimer();
|
||||||
StartReconnectTimer();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -378,7 +376,11 @@ namespace PepperDash.Essentials
|
|||||||
SseClient.Connect();
|
SseClient.Connect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
void LineGathered_LineReceived(object sender, GenericCommMethodReceiveTextArgs e)
|
void LineGathered_LineReceived(object sender, GenericCommMethodReceiveTextArgs e)
|
||||||
{
|
{
|
||||||
//Debug.Console(1, this, "Received from Server: '{0}'", e.Text);
|
//Debug.Console(1, this, "Received from Server: '{0}'", e.Text);
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
SetupDirectoryList();
|
SetupDirectoryList();
|
||||||
SetupRecentCallsList();
|
SetupRecentCallsList();
|
||||||
SetupFavorites();
|
SetupFavorites();
|
||||||
SetupSelfViewControls();
|
SetupLayoutControls();
|
||||||
|
|
||||||
codec.CallStatusChange += new EventHandler<CodecCallStatusItemChangeEventArgs>(Codec_CallStatusChange);
|
codec.CallStatusChange += new EventHandler<CodecCallStatusItemChangeEventArgs>(Codec_CallStatusChange);
|
||||||
|
|
||||||
@@ -736,23 +736,51 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void SetupSelfViewControls()
|
void SetupLayoutControls()
|
||||||
{
|
{
|
||||||
|
|
||||||
TriList.SetSigFalseAction(UIBoolJoin.VCStagingSelfViewLayoutPress, this.ShowSelfViewLayout);
|
TriList.SetSigFalseAction(UIBoolJoin.VCStagingSelfViewLayoutPress, this.ShowSelfViewLayout);
|
||||||
var svc = Codec as IHasCodecSelfview;
|
var svc = Codec as IHasCodecSelfview;
|
||||||
if (svc != null)
|
if (svc != null)
|
||||||
{
|
{
|
||||||
TriList.SetSigFalseAction(UIBoolJoin.VCSelfViewTogglePress, svc.SelfviewModeToggle);
|
TriList.SetSigFalseAction(UIBoolJoin.VCSelfViewTogglePress, svc.SelfviewModeToggle);
|
||||||
svc.SelfviewIsOnFeedback.LinkInputSig(TriList.BooleanInput[UIBoolJoin.VCSelfViewTogglePress]);
|
svc.SelfviewIsOnFeedback.LinkInputSig(TriList.BooleanInput[UIBoolJoin.VCSelfViewTogglePress]);
|
||||||
|
|
||||||
//TriList.SetSigFalseAction(UIBoolJoin.VCSelfViewPipTogglePress, () => { });
|
|
||||||
}
|
}
|
||||||
var lc = Codec as IHasCodecLayouts;
|
var lc = Codec as IHasCodecLayouts;
|
||||||
if (lc != null)
|
if (lc != null)
|
||||||
{
|
{
|
||||||
TriList.SetSigFalseAction(UIBoolJoin.VCLayoutTogglePress, lc.LocalLayoutToggle);
|
TriList.SetSigFalseAction(UIBoolJoin.VCLayoutTogglePress, lc.LocalLayoutToggle);
|
||||||
lc.LocalLayoutFeedback.LinkInputSig(TriList.StringInput[UIStringJoin.VCLayoutModeText]);
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user