mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 20:54:55 +00:00
adjust factory and constructor for EiscApiAdvanced
Keep SystemMonitor from getting instantiated if we're on a VC-4 instance
This commit is contained in:
@@ -327,7 +327,11 @@ namespace PepperDash.Essentials
|
|||||||
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor"));
|
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor"));
|
||||||
|
|
||||||
// Add global System Monitor device
|
// Add global System Monitor device
|
||||||
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Monitoring.SystemMonitorController("systemMonitor"));
|
if (CrestronEnvironment.DevicePlatform == eDevicePlatform.Appliance)
|
||||||
|
{
|
||||||
|
DeviceManager.AddDevice(
|
||||||
|
new PepperDash.Essentials.Core.Monitoring.SystemMonitorController("systemMonitor"));
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var devConf in ConfigReader.ConfigObject.Devices)
|
foreach (var devConf in ConfigReader.ConfigObject.Devices)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Crestron.SimplSharp.Reflection;
|
using Crestron.SimplSharp.Reflection;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
@@ -82,9 +83,9 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
|
|
||||||
protected Dictionary<string, JoinMapBaseAdvanced> JoinMaps { get; private set; }
|
protected Dictionary<string, JoinMapBaseAdvanced> JoinMaps { get; private set; }
|
||||||
|
|
||||||
public ThreeSeriesTcpIpEthernetIntersystemCommunications Eisc { get; private set; }
|
public BasicTriList Eisc { get; private set; }
|
||||||
|
|
||||||
public EiscApiAdvanced(DeviceConfig dc) :
|
public EiscApiAdvanced(DeviceConfig dc, BasicTriList eisc) :
|
||||||
base(dc.Key)
|
base(dc.Key)
|
||||||
{
|
{
|
||||||
JoinMaps = new Dictionary<string, JoinMapBaseAdvanced>();
|
JoinMaps = new Dictionary<string, JoinMapBaseAdvanced>();
|
||||||
@@ -92,7 +93,7 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
PropertiesConfig = dc.Properties.ToObject<EiscApiPropertiesConfig>();
|
PropertiesConfig = dc.Properties.ToObject<EiscApiPropertiesConfig>();
|
||||||
//PropertiesConfig = JsonConvert.DeserializeObject<EiscApiPropertiesConfig>(dc.Properties.ToString());
|
//PropertiesConfig = JsonConvert.DeserializeObject<EiscApiPropertiesConfig>(dc.Properties.ToString());
|
||||||
|
|
||||||
Eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(PropertiesConfig.Control.IpIdInt, PropertiesConfig.Control.TcpSshProperties.Address, Global.ControlSystem);
|
Eisc = eisc;
|
||||||
|
|
||||||
Eisc.SigChange += Eisc_SigChange;
|
Eisc.SigChange += Eisc_SigChange;
|
||||||
|
|
||||||
@@ -160,7 +161,7 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Prints all the join maps on this bridge
|
/// Prints all the join maps on this bridge
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void PrintJoinMaps()
|
public virtual void PrintJoinMaps()
|
||||||
{
|
{
|
||||||
Debug.Console(0, this, "Join Maps for EISC IPID: {0}", Eisc.ID.ToString("X"));
|
Debug.Console(0, this, "Join Maps for EISC IPID: {0}", Eisc.ID.ToString("X"));
|
||||||
|
|
||||||
@@ -255,7 +256,7 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="currentDevice"></param>
|
/// <param name="currentDevice"></param>
|
||||||
/// <param name="args"></param>
|
/// <param name="args"></param>
|
||||||
void Eisc_SigChange(object currentDevice, SigEventArgs args)
|
protected void Eisc_SigChange(object currentDevice, SigEventArgs args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -307,15 +308,34 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
{
|
{
|
||||||
public EiscApiAdvancedFactory()
|
public EiscApiAdvancedFactory()
|
||||||
{
|
{
|
||||||
TypeNames = new List<string> { "eiscapiadv", "eiscapiadvanced" };
|
TypeNames = new List<string> { "eiscapiadv", "eiscapiadvanced", "vceiscapiadv", "vceiscapiadvanced" };
|
||||||
}
|
}
|
||||||
|
|
||||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
{
|
{
|
||||||
Debug.Console(1, "Factory Attempting to create new EiscApiAdvanced Device");
|
Debug.Console(1, "Factory Attempting to create new EiscApiAdvanced Device");
|
||||||
|
|
||||||
return new EiscApiAdvanced(dc);
|
var controlProperties = dc.Properties["control"].ToObject<ControlPropertiesConfig>();
|
||||||
|
|
||||||
|
switch (dc.Type)
|
||||||
|
{
|
||||||
|
case "eiscapiadv":
|
||||||
|
case "eiscapiadvanced":
|
||||||
|
{
|
||||||
|
var eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(controlProperties.IpIdInt,
|
||||||
|
controlProperties.TcpSshProperties.Address, Global.ControlSystem);
|
||||||
|
return new EiscApiAdvanced(dc, eisc);
|
||||||
|
}
|
||||||
|
case "vceiscapiadv":
|
||||||
|
case "vceiscapiadvanced":
|
||||||
|
{
|
||||||
|
var eisc = new VirtualControlEISCClient(controlProperties.IpIdInt, controlProperties.RoomId,
|
||||||
|
Global.ControlSystem);
|
||||||
|
return new EiscApiAdvanced(dc, eisc);
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
namespace PepperDash.Essentials.Core.Bridges
|
|
||||||
{
|
|
||||||
public class VirtualControlEiscApiAdvanced
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -158,7 +158,6 @@
|
|||||||
<Compile Include="Bridges\JoinMaps\SetTopBoxControllerJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\SetTopBoxControllerJoinMap.cs" />
|
||||||
<Compile Include="Bridges\JoinMaps\StatusSignControllerJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\StatusSignControllerJoinMap.cs" />
|
||||||
<Compile Include="Bridges\JoinMaps\SystemMonitorJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\SystemMonitorJoinMap.cs" />
|
||||||
<Compile Include="Bridges\VirtualControlEiscApiAdvanced.cs" />
|
|
||||||
<Compile Include="Comm and IR\CecPortController.cs" />
|
<Compile Include="Comm and IR\CecPortController.cs" />
|
||||||
<Compile Include="Comm and IR\CommFactory.cs" />
|
<Compile Include="Comm and IR\CommFactory.cs" />
|
||||||
<Compile Include="Comm and IR\CommunicationExtras.cs" />
|
<Compile Include="Comm and IR\CommunicationExtras.cs" />
|
||||||
|
|||||||
Reference in New Issue
Block a user