mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-07 00:35:07 +00:00
set up program to load Cisco Codec from config, not just manually
This commit is contained in:
@@ -17,10 +17,10 @@ namespace PepperDash.Essentials.Devices.Common.DSP
|
||||
|
||||
// Verbose on subscriptions?
|
||||
|
||||
// Example subscription feedback responses
|
||||
// ! "publishToken":"name" "value":-77.0
|
||||
// ! "myLevelName" -77
|
||||
|
||||
|
||||
public class BiampTesiraForteDsp : DspBase
|
||||
{
|
||||
public IBasicCommunication Communication { get; private set; }
|
||||
|
||||
@@ -10,7 +10,8 @@ using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
|
||||
using PepperDash.Essentials.Devices.Common.DSP;
|
||||
using PepperDash.Essentials.Devices.Common.DSP;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||
|
||||
using PepperDash.Essentials.Devices.Common;
|
||||
|
||||
@@ -104,25 +105,32 @@ namespace PepperDash.Essentials.Devices.Common
|
||||
{
|
||||
return new PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
.MockVC(key, name);
|
||||
}
|
||||
|
||||
else if (groupName == "settopbox") //(typeName == "irstbbase")
|
||||
{
|
||||
var irCont = IRPortHelper.GetIrOutputPortController(dc);
|
||||
var config = dc.Properties.ToObject<SetTopBoxPropertiesConfig>();
|
||||
var stb = new IRSetTopBoxBase(key, name, irCont, config);
|
||||
|
||||
//stb.HasDvr = properties.Value<bool>("hasDvr");
|
||||
var listName = properties.Value<string>("presetsList");
|
||||
if (listName != null)
|
||||
stb.LoadPresets(listName);
|
||||
return stb;
|
||||
}
|
||||
|
||||
else if (typeName == "roku")
|
||||
{
|
||||
var irCont = IRPortHelper.GetIrOutputPortController(dc);
|
||||
return new Roku2(key, name, irCont);
|
||||
}
|
||||
|
||||
else if (typeName == "ciscocodec")
|
||||
{
|
||||
var comm = CommFactory.CreateCommForDevice(dc);
|
||||
var props = JsonConvert.DeserializeObject<Codec.CiscoCodecPropertiesConfig>(properties.ToString());
|
||||
return new PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoCodec(key, name, comm, props);
|
||||
}
|
||||
|
||||
else if (groupName == "settopbox") //(typeName == "irstbbase")
|
||||
{
|
||||
var irCont = IRPortHelper.GetIrOutputPortController(dc);
|
||||
var config = dc.Properties.ToObject<SetTopBoxPropertiesConfig>();
|
||||
var stb = new IRSetTopBoxBase(key, name, irCont, config);
|
||||
|
||||
//stb.HasDvr = properties.Value<bool>("hasDvr");
|
||||
var listName = properties.Value<string>("presetsList");
|
||||
if (listName != null)
|
||||
stb.LoadPresets(listName);
|
||||
return stb;
|
||||
}
|
||||
|
||||
else if (typeName == "roku")
|
||||
{
|
||||
var irCont = IRPortHelper.GetIrOutputPortController(dc);
|
||||
return new Roku2(key, name, irCont);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -149,7 +149,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
|
||||
int PresentationSource;
|
||||
|
||||
string PhoneBookMode;
|
||||
string PhonebookMode = "Local"; // Default to Local
|
||||
|
||||
int PhonebookResultsLimit = 255; // Could be set later by config.
|
||||
|
||||
// Constructor for IBasicCommunication
|
||||
public CiscoCodec(string key, string name, IBasicCommunication comm, CiscoCodecPropertiesConfig props )
|
||||
@@ -173,7 +175,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
|
||||
DeviceManager.AddDevice(CommunicationMonitor);
|
||||
|
||||
PhoneBookMode = props.PhonebookMode;
|
||||
PhonebookMode = props.PhonebookMode;
|
||||
|
||||
SyncState = new CodecSyncState(key + "--sync");
|
||||
|
||||
@@ -218,7 +220,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
//SendText("xCommand Bookings List Days: 1 DayOffset: 0");
|
||||
|
||||
// Get Phonebook (determine local/corporate from config, and set results limit)
|
||||
//SendText("xCommand Phonebook Search PhonebookType: {0} ContactType: Folder Limit: {0}", PhonebookType, PhonebookResultsLimit);
|
||||
SendText(string.Format("xCommand Phonebook Search PhonebookType: {0} ContactType: Folder Limit: {1}", PhonebookMode, PhonebookResultsLimit));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -237,6 +239,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
socket.ConnectionChange += new EventHandler<GenericSocketStatusChageEventArgs>(socket_ConnectionChange);
|
||||
}
|
||||
|
||||
CommunicationMonitor.Start();
|
||||
|
||||
InputPorts.Add(new RoutingInputPort(RoutingPortNames.HdmiIn1, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, new Action(SelectPresentationSource1), this));
|
||||
InputPorts.Add(new RoutingInputPort(RoutingPortNames.HdmiIn2, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, new Action(SelectPresentationSource2), this));
|
||||
|
||||
@@ -503,7 +507,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Evaluates an event received from the codec
|
||||
/// </summary>
|
||||
@@ -534,8 +537,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
(selector as Action)();
|
||||
}
|
||||
|
||||
//protected Func<bool> InCallFeedbackFunc { get { return () => false; } }
|
||||
|
||||
protected override Func<bool> IncomingCallFeedbackFunc { get { return () => false; } }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -5,7 +5,10 @@ using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
{
|
||||
{
|
||||
/// <summary>
|
||||
/// This class exists to capture serialized data sent back by a Cisco codec in JSON output mode
|
||||
/// </summary>
|
||||
public class CiscoCodecConfiguration
|
||||
{
|
||||
public class DefaultVolume
|
||||
|
||||
@@ -5,7 +5,10 @@ using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
{
|
||||
{
|
||||
/// <summary>
|
||||
/// This class exists to capture serialized data sent back by a Cisco codec in JSON output mode
|
||||
/// </summary>
|
||||
public class CiscoCodecEvents
|
||||
{
|
||||
public class CauseValue
|
||||
|
||||
@@ -7,6 +7,9 @@ using Crestron.SimplSharp.CrestronXml.Serialization;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
{
|
||||
/// <summary>
|
||||
/// This class exists to capture serialized data sent back by a Cisco codec in JSON output mode
|
||||
/// </summary>
|
||||
public class CiscoCodecStatus
|
||||
{
|
||||
// Helper Classes for Proerties
|
||||
@@ -1634,7 +1637,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
public string Value { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class FacilityServiceId
|
||||
{
|
||||
public string Value { get; set; }
|
||||
|
||||
@@ -29,8 +29,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 =>
|
||||
@@ -40,7 +40,7 @@ namespace PepperDash.Essentials
|
||||
},
|
||||
"listtielines", "Prints out all tie lines", ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
GoWithLoad();
|
||||
//GoWithLoad();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -128,6 +128,7 @@ namespace PepperDash.Essentials
|
||||
}
|
||||
|
||||
// CODEC TESTING
|
||||
/*
|
||||
try
|
||||
{
|
||||
GenericSshClient TestCodecClient = new GenericSshClient("TestCodec-1--SshClient", "10.11.50.135", 22, "crestron", "2H3Zu&OvgXp6");
|
||||
@@ -149,6 +150,7 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
Debug.Console(0, "Error in something Neil is working on ;) \r{0}", e);
|
||||
}
|
||||
*/
|
||||
// CODEC TESTING
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user