mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-13 11:44:54 +00:00
Coded changes as per email
This commit is contained in:
@@ -1,58 +1,58 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharp.CrestronIO;
|
using Crestron.SimplSharp.CrestronIO;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Displays
|
namespace PepperDash.Essentials.Devices.Displays
|
||||||
{
|
{
|
||||||
public class DisplayDeviceFactory
|
public class DisplayDeviceFactory
|
||||||
{
|
{
|
||||||
public static IKeyed GetDevice(DeviceConfig dc)
|
public static IKeyed GetDevice(DeviceConfig dc)
|
||||||
{
|
{
|
||||||
var key = dc.Key;
|
var key = dc.Key;
|
||||||
var name = dc.Name;
|
var name = dc.Name;
|
||||||
var type = dc.Type;
|
var type = dc.Type;
|
||||||
var properties = dc.Properties;
|
var properties = dc.Properties;
|
||||||
|
|
||||||
var typeName = dc.Type.ToLower();
|
var typeName = dc.Type.ToLower();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (typeName == "necmpsx")
|
if (typeName == "necmpsx")
|
||||||
{
|
{
|
||||||
var comm = CommFactory.CreateCommForDevice(dc);
|
var comm = CommFactory.CreateCommForDevice(dc);
|
||||||
if (comm != null)
|
if (comm != null)
|
||||||
return new NecPSXMDisplay(dc.Key, dc.Name, comm);
|
return new NecPSXMDisplay(dc.Key, dc.Name, comm);
|
||||||
}
|
}
|
||||||
else if(typeName == "samsungmdc")
|
else if(typeName == "samsungmdc")
|
||||||
{
|
{
|
||||||
var comm = CommFactory.CreateCommForDevice(dc);
|
var comm = CommFactory.CreateCommForDevice(dc);
|
||||||
if (comm != null)
|
if (comm != null)
|
||||||
return new SamsungMDC(dc.Key, dc.Name, comm, dc.Properties["id"].Value<string>());
|
return new SamsungMDC(dc.Key, dc.Name, comm, dc.Properties["id"].Value<string>());
|
||||||
}
|
}
|
||||||
if (typeName == "avocorvtf")
|
if (typeName == "avocorvtf")
|
||||||
{
|
{
|
||||||
var comm = CommFactory.CreateCommForDevice(dc);
|
var comm = CommFactory.CreateCommForDevice(dc);
|
||||||
if (comm != null)
|
if (comm != null)
|
||||||
return new AvocorDisplay(dc.Key, dc.Name, comm, null);
|
return new AvocorDisplay(dc.Key, dc.Name, comm, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Debug.Console(0, "Displays factory: Exception creating device type {0}, key {1}: \nCONFIG JSON: {2} \nERROR: {3}\n\n",
|
Debug.Console(0, "Displays factory: Exception creating device type {0}, key {1}: \nCONFIG JSON: {2} \nERROR: {3}\n\n",
|
||||||
dc.Type, dc.Key, JsonConvert.SerializeObject(dc), e);
|
dc.Type, dc.Key, JsonConvert.SerializeObject(dc), e);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Displays
|
namespace PepperDash.Essentials.Devices.Displays
|
||||||
{
|
{
|
||||||
public interface IInputHdmi1 { void InputHdmi1(); }
|
public interface IInputHdmi1 { void InputHdmi1(); }
|
||||||
public interface IInputHdmi2 { void InputHdmi2(); }
|
public interface IInputHdmi2 { void InputHdmi2(); }
|
||||||
public interface IInputHdmi3 { void InputHdmi3(); }
|
public interface IInputHdmi3 { void InputHdmi3(); }
|
||||||
public interface IInputHdmi4 { void InputHdmi4(); }
|
public interface IInputHdmi4 { void InputHdmi4(); }
|
||||||
public interface IInputDisplayPort1 { void InputDisplayPort1(); }
|
public interface IInputDisplayPort1 { void InputDisplayPort1(); }
|
||||||
public interface IInputDisplayPort2 { void InputDisplayPort2(); }
|
public interface IInputDisplayPort2 { void InputDisplayPort2(); }
|
||||||
public interface IInputVga1 { void InputVga1(); }
|
public interface IInputVga1 { void InputVga1(); }
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -49,6 +49,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
|
|
||||||
public StringFeedback LocalLayoutFeedback { get; private set; }
|
public StringFeedback LocalLayoutFeedback { get; private set; }
|
||||||
|
|
||||||
|
public BoolFeedback LocalLayoutIsProminentFeedback { get; private set; }
|
||||||
|
|
||||||
|
public BoolFeedback FarEndIsSharingContentFeedback { get; private set; }
|
||||||
|
|
||||||
private CodecCommandWithLabel CurrentSelfviewPipPosition;
|
private CodecCommandWithLabel CurrentSelfviewPipPosition;
|
||||||
|
|
||||||
private CodecCommandWithLabel CurrentLocalLayout;
|
private CodecCommandWithLabel CurrentLocalLayout;
|
||||||
@@ -138,6 +142,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected Func<bool> FarEndIsSharingContentFeedbackFunc
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return () => CodecStatus.Status.Conference.Presentation.Mode.Value == "Receiving";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected override Func<bool> MuteFeedbackFunc
|
protected override Func<bool> MuteFeedbackFunc
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -194,6 +206,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected Func<bool> LocalLayoutIsProminentFeedbackFunc
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return () => CurrentLocalLayout.Label == "Prominent";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private string CliFeedbackRegistrationExpression;
|
private string CliFeedbackRegistrationExpression;
|
||||||
|
|
||||||
@@ -245,6 +265,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
SelfviewIsOnFeedback = new BoolFeedback(SelfViewIsOnFeedbackFunc);
|
SelfviewIsOnFeedback = new BoolFeedback(SelfViewIsOnFeedbackFunc);
|
||||||
SelfviewPipPositionFeedback = new StringFeedback(SelfviewPipPositionFeedbackFunc);
|
SelfviewPipPositionFeedback = new StringFeedback(SelfviewPipPositionFeedbackFunc);
|
||||||
LocalLayoutFeedback = new StringFeedback(LocalLayoutFeedbackFunc);
|
LocalLayoutFeedback = new StringFeedback(LocalLayoutFeedbackFunc);
|
||||||
|
LocalLayoutIsProminentFeedback = new BoolFeedback(LocalLayoutIsProminentFeedbackFunc);
|
||||||
|
|
||||||
PresentationViewMaximizedFeedback = new BoolFeedback(() => CurrentPresentationView == "Maximized");
|
PresentationViewMaximizedFeedback = new BoolFeedback(() => CurrentPresentationView == "Maximized");
|
||||||
|
|
||||||
@@ -304,6 +325,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
CodecStatus.Status.Video.Selfview.PIPPosition.ValueChangedAction = ComputeSelfviewPipStatus;
|
CodecStatus.Status.Video.Selfview.PIPPosition.ValueChangedAction = ComputeSelfviewPipStatus;
|
||||||
CodecStatus.Status.Video.Layout.LayoutFamily.Local.ValueChangedAction = ComputeLocalLayout;
|
CodecStatus.Status.Video.Layout.LayoutFamily.Local.ValueChangedAction = ComputeLocalLayout;
|
||||||
CodecStatus.Status.Conference.Presentation.Mode.ValueChangedAction = SharingContentIsOnFeedback.FireUpdate;
|
CodecStatus.Status.Conference.Presentation.Mode.ValueChangedAction = SharingContentIsOnFeedback.FireUpdate;
|
||||||
|
CodecStatus.Status.Conference.Presentation.Mode.ValueChangedAction = FarEndIsSharingContentFeedback.FireUpdate;
|
||||||
|
|
||||||
CodecOsdIn = new RoutingInputPort(RoutingPortNames.CodecOsd, eRoutingSignalType.AudioVideo,
|
CodecOsdIn = new RoutingInputPort(RoutingPortNames.CodecOsd, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.Hdmi, new Action(StopSharing), this);
|
eRoutingPortConnectionType.Hdmi, new Action(StopSharing), this);
|
||||||
@@ -1236,6 +1258,21 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Toggles between single/prominent layouts
|
||||||
|
/// </summary>
|
||||||
|
public void LocalLayoutToggleSingleProminent()
|
||||||
|
{
|
||||||
|
if (CurrentLocalLayout != null)
|
||||||
|
{
|
||||||
|
if (CurrentLocalLayout.Label != "Prominent")
|
||||||
|
LocalLayoutSet(LocalLayouts.FirstOrDefault(l => l.Label.Equals("Prominent")));
|
||||||
|
else
|
||||||
|
LocalLayoutSet(LocalLayouts.FirstOrDefault(l => l.Label.Equals("Single")));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -444,12 +444,21 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
|
|
||||||
public class Mode2 : ValueProperty
|
public class Mode2 : ValueProperty
|
||||||
{
|
{
|
||||||
|
string _Value;
|
||||||
|
|
||||||
public bool BoolValue { get; private set; }
|
public bool BoolValue { get; private set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public string Value
|
public string Value
|
||||||
{
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _Value;
|
||||||
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
_Value = value;
|
||||||
// If the incoming value is "Sending" it sets the BoolValue true, otherwise sets it false
|
// If the incoming value is "Sending" it sets the BoolValue true, otherwise sets it false
|
||||||
BoolValue = value == "Sending";
|
BoolValue = value == "Sending";
|
||||||
OnValueChanged();
|
OnValueChanged();
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
StringFeedback LocalLayoutFeedback { get; }
|
StringFeedback LocalLayoutFeedback { get; }
|
||||||
|
|
||||||
void LocalLayoutToggle();
|
void LocalLayoutToggle();
|
||||||
|
void LocalLayoutToggleSingleProminent();
|
||||||
void MinMaxLayoutToggle();
|
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.8.*")]
|
[assembly: AssemblyVersion("1.0.9.*")]
|
||||||
|
|
||||||
|
|||||||
@@ -79,6 +79,8 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
StringBuilder SearchStringBuilder = new StringBuilder();
|
StringBuilder SearchStringBuilder = new StringBuilder();
|
||||||
BoolFeedback SearchStringBackspaceVisibleFeedback;
|
BoolFeedback SearchStringBackspaceVisibleFeedback;
|
||||||
|
|
||||||
|
BoolFeedback LayoutButtonEnableFeedback;
|
||||||
|
|
||||||
ModalDialog IncomingCallModal;
|
ModalDialog IncomingCallModal;
|
||||||
|
|
||||||
eKeypadMode KeypadMode;
|
eKeypadMode KeypadMode;
|
||||||
@@ -748,7 +750,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
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.LocalLayoutToggleSingleProminent);
|
||||||
lc.LocalLayoutFeedback.LinkInputSig(TriList.StringInput[UIStringJoin.VCLayoutModeText]);
|
lc.LocalLayoutFeedback.LinkInputSig(TriList.StringInput[UIStringJoin.VCLayoutModeText]);
|
||||||
|
|
||||||
// attach to cisco special things to enable buttons
|
// attach to cisco special things to enable buttons
|
||||||
@@ -757,7 +759,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
{
|
{
|
||||||
// Cisco has min/max buttons that need special sauce
|
// Cisco has min/max buttons that need special sauce
|
||||||
cisco.SharingContentIsOnFeedback.OutputChange += CiscoSharingAndPresentation_OutputChanges;
|
cisco.SharingContentIsOnFeedback.OutputChange += CiscoSharingAndPresentation_OutputChanges;
|
||||||
cisco.PresentationViewMaximizedFeedback.OutputChange += CiscoSharingAndPresentation_OutputChanges;
|
//cisco.PresentationViewMaximizedFeedback.OutputChange += CiscoSharingAndPresentation_OutputChanges;
|
||||||
|
|
||||||
TriList.SetSigFalseAction(UIBoolJoin.VCMinMaxPress, cisco.MinMaxLayoutToggle);
|
TriList.SetSigFalseAction(UIBoolJoin.VCMinMaxPress, cisco.MinMaxLayoutToggle);
|
||||||
}
|
}
|
||||||
@@ -775,12 +777,13 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
var cisco = Codec as PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoSparkCodec;
|
var cisco = Codec as PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoSparkCodec;
|
||||||
if (cisco != null)
|
if (cisco != null)
|
||||||
{
|
{
|
||||||
var sharing = cisco.SharingContentIsOnFeedback.BoolValue;
|
var sharingNear = cisco.SharingContentIsOnFeedback.BoolValue;
|
||||||
var maximized = cisco.PresentationViewMaximizedFeedback.BoolValue;
|
|
||||||
|
var sharingFar = cisco.FarEndIsSharingContentFeedback.BoolValue;
|
||||||
//set feedback and enables
|
//set feedback and enables
|
||||||
TriList.BooleanInput[UIBoolJoin.VCMinMaxEnable].BoolValue = sharing;
|
TriList.BooleanInput[UIBoolJoin.VCMinMaxEnable].BoolValue = sharingNear;
|
||||||
TriList.BooleanInput[UIBoolJoin.VCLayoutToggleEnable].BoolValue = sharing && maximized;
|
TriList.BooleanInput[UIBoolJoin.VCLayoutToggleEnable].BoolValue = sharingNear && sharingFar;
|
||||||
TriList.BooleanInput[UIBoolJoin.VCMinMaxPress].BoolValue = maximized;
|
TriList.BooleanInput[UIBoolJoin.VCMinMaxPress].BoolValue = sharingNear;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user