mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-13 19:54:59 +00:00
Compare commits
3 Commits
feature/Ge
...
1.5.2-alph
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98cc4505fa | ||
|
|
1d3d27eb55 | ||
|
|
5dc92b86a6 |
6
.github/workflows/docker.yml
vendored
6
.github/workflows/docker.yml
vendored
@@ -52,6 +52,12 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
Write-Output ${{ env.VERSION }}
|
Write-Output ${{ env.VERSION }}
|
||||||
./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }}
|
./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }}
|
||||||
|
# Login to Docker
|
||||||
|
- name: Login to Docker
|
||||||
|
uses: azure/docker-login@v1
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.dockerhub_user }}
|
||||||
|
password: ${{ secrets.dockerhub_password }}
|
||||||
# Build the solutions in the docker image
|
# Build the solutions in the docker image
|
||||||
- name: Build Solution
|
- name: Build Solution
|
||||||
shell: powershell
|
shell: powershell
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
using Crestron.SimplSharpPro.UI;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
|
||||||
@@ -30,6 +31,18 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
protected CrestronGenericBaseDevice(string key, string name, GenericBase hardware)
|
protected CrestronGenericBaseDevice(string key, string name, GenericBase hardware)
|
||||||
: base(key, name)
|
: base(key, name)
|
||||||
|
{
|
||||||
|
SetHardwareAndRegisterEvents(hardware);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Added to support creating RMC and DM TX hardware during pre-activation
|
||||||
|
protected CrestronGenericBaseDevice(string key, string name) : base(key, name)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//Added to support creating RMC and DM TX hardware during pre-activation
|
||||||
|
protected void SetHardwareAndRegisterEvents(GenericBase hardware)
|
||||||
{
|
{
|
||||||
Feedbacks = new FeedbackCollection<Feedback>();
|
Feedbacks = new FeedbackCollection<Feedback>();
|
||||||
|
|
||||||
@@ -135,8 +148,13 @@ namespace PepperDash.Essentials.Core
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Added to support creating RMC and DM TX hardware during pre-activation
|
||||||
|
protected CrestronGenericBridgeableBaseDevice(string key, string name):base(key, name)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public abstract void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge);
|
public abstract void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
using Crestron.SimplSharpPro;
|
using System;
|
||||||
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.DM;
|
using Crestron.SimplSharpPro.DM;
|
||||||
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
||||||
|
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
using PepperDash.Essentials.DM.Config;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
@@ -15,7 +17,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
public class DmRmc100SController : DmRmcControllerBase, IRoutingInputsOutputs,
|
public class DmRmc100SController : DmRmcControllerBase, IRoutingInputsOutputs,
|
||||||
IIROutputPorts, IComPorts, ICec
|
IIROutputPorts, IComPorts, ICec
|
||||||
{
|
{
|
||||||
private readonly DmRmc100S _rmc;
|
private DmRmc100S _rmc;
|
||||||
|
|
||||||
public RoutingInputPort DmIn { get; private set; }
|
public RoutingInputPort DmIn { get; private set; }
|
||||||
public RoutingOutputPort HdmiOut { get; private set; }
|
public RoutingOutputPort HdmiOut { get; private set; }
|
||||||
@@ -32,13 +34,63 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
_rmc = rmc;
|
_rmc = rmc;
|
||||||
|
|
||||||
|
InitializeRouting();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defers creation of the actual hardware until the Preactivation phase
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key">Device Key</param>
|
||||||
|
/// <param name="name">Device Name</param>
|
||||||
|
/// <param name="props">Config from file</param>
|
||||||
|
/// <param name="preActivationFunc">Function to run to get the DM Chassis</param>
|
||||||
|
public DmRmc100SController(string key, string name, DmRmcPropertiesConfig props, Func<string, string, IDmSwitch> preActivationFunc ):base(key, name)
|
||||||
|
{
|
||||||
|
AddPreActivationAction(() =>
|
||||||
|
{
|
||||||
|
var dmSwitch = preActivationFunc(Key, props.ParentDeviceKey);
|
||||||
|
|
||||||
|
var chassis = dmSwitch.Chassis;
|
||||||
|
|
||||||
|
var dmOut = DmRmcHelper.AddRmcAndGetDmOutput(Key, props.ParentOutputNumber, dmSwitch);
|
||||||
|
|
||||||
|
if (chassis is DmMd8x8Cpu3 || chassis is DmMd16x16Cpu3 ||
|
||||||
|
chassis is DmMd32x32Cpu3 || chassis is DmMd8x8Cpu3rps ||
|
||||||
|
chassis is DmMd16x16Cpu3rps || chassis is DmMd32x32Cpu3rps ||
|
||||||
|
chassis is DmMd128x128 || chassis is DmMd64x64)
|
||||||
|
{
|
||||||
|
|
||||||
|
_rmc = new DmRmc100S(dmOut);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_rmc = new DmRmc100S(props.Control.IpIdInt, dmOut);
|
||||||
|
}
|
||||||
|
|
||||||
|
SetBaseClassRmcs();
|
||||||
|
|
||||||
|
InitializeRouting();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetBaseClassRmcs()
|
||||||
|
{
|
||||||
|
//Set Rmc in DmRmcControllerBase Class
|
||||||
|
SetRmc(_rmc);
|
||||||
|
|
||||||
|
//Set Rmc In CrestronGenericBaseDevice
|
||||||
|
SetHardwareAndRegisterEvents(_rmc);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitializeRouting()
|
||||||
|
{
|
||||||
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.DmCat, 0, this);
|
eRoutingPortConnectionType.DmCat, 0, this);
|
||||||
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.Hdmi, null, this) {Port = _rmc};
|
eRoutingPortConnectionType.Hdmi, null, this) { Port = _rmc };
|
||||||
|
|
||||||
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
|
InputPorts = new RoutingPortCollection<RoutingInputPort> { DmIn };
|
||||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut};
|
OutputPorts = new RoutingPortCollection<RoutingOutputPort> { HdmiOut };
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
[Description("Wrapper class for all DM-RMC variants")]
|
[Description("Wrapper class for all DM-RMC variants")]
|
||||||
public abstract class DmRmcControllerBase : CrestronGenericBridgeableBaseDevice
|
public abstract class DmRmcControllerBase : CrestronGenericBridgeableBaseDevice
|
||||||
{
|
{
|
||||||
private readonly EndpointReceiverBase _rmc; //kept here just in case. Only property or method on this class that's not device-specific is the DMOutput that it's attached to.
|
private EndpointReceiverBase _rmc; //kept here just in case. Only property or method on this class that's not device-specific is the DMOutput that it's attached to.
|
||||||
|
|
||||||
public StringFeedback VideoOutputResolutionFeedback { get; protected set; }
|
public StringFeedback VideoOutputResolutionFeedback { get; protected set; }
|
||||||
public StringFeedback EdidManufacturerFeedback { get; protected set; }
|
public StringFeedback EdidManufacturerFeedback { get; protected set; }
|
||||||
@@ -26,7 +26,17 @@ namespace PepperDash.Essentials.DM
|
|||||||
protected DmRmcControllerBase(string key, string name, EndpointReceiverBase device)
|
protected DmRmcControllerBase(string key, string name, EndpointReceiverBase device)
|
||||||
: base(key, name, device)
|
: base(key, name, device)
|
||||||
{
|
{
|
||||||
_rmc = device;
|
SetRmc(device);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected DmRmcControllerBase(string key, string name):base(key, name)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void SetRmc(EndpointReceiverBase rmc)
|
||||||
|
{
|
||||||
|
_rmc = rmc;
|
||||||
// if wired to a chassis, skip registration step in base class
|
// if wired to a chassis, skip registration step in base class
|
||||||
PreventRegistration = _rmc.DMOutput != null;
|
PreventRegistration = _rmc.DMOutput != null;
|
||||||
|
|
||||||
@@ -82,6 +92,16 @@ namespace PepperDash.Essentials.DM
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected DmHdBaseTControllerBase(string key, string name, HDBaseTBase rmc)
|
protected DmHdBaseTControllerBase(string key, string name, HDBaseTBase rmc)
|
||||||
: base(key, name, rmc)
|
: base(key, name, rmc)
|
||||||
|
{
|
||||||
|
SetRmc(rmc);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected DmHdBaseTControllerBase(string key, string name) : base(key, name)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void SetRmc(HDBaseTBase rmc)
|
||||||
{
|
{
|
||||||
Rmc = rmc;
|
Rmc = rmc;
|
||||||
}
|
}
|
||||||
@@ -90,9 +110,11 @@ namespace PepperDash.Essentials.DM
|
|||||||
public class DmRmcHelper
|
public class DmRmcHelper
|
||||||
{
|
{
|
||||||
private static readonly Dictionary<string, Func<string, string, uint, CrestronGenericBaseDevice>> ProcessorFactoryDict;
|
private static readonly Dictionary<string, Func<string, string, uint, CrestronGenericBaseDevice>> ProcessorFactoryDict;
|
||||||
private static readonly Dictionary<string, Func<string, string, DMOutput, CrestronGenericBaseDevice>> ChassisCpu3Dict;
|
|
||||||
|
|
||||||
private static readonly Dictionary<string, Func<string, string, uint, DMOutput, CrestronGenericBaseDevice>>
|
private static readonly
|
||||||
|
Dictionary
|
||||||
|
<string,
|
||||||
|
Func<string, string, DmRmcPropertiesConfig, Func<string, string, IDmSwitch>, CrestronGenericBaseDevice>>
|
||||||
ChassisDict;
|
ChassisDict;
|
||||||
|
|
||||||
static DmRmcHelper()
|
static DmRmcHelper()
|
||||||
@@ -127,10 +149,10 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
ChassisCpu3Dict = new Dictionary<string, Func<string, string, DMOutput, CrestronGenericBaseDevice>>
|
/*ChassisCpu3Dict = new Dictionary<string, Func<string, string, DMOutput, CrestronGenericBaseDevice>>
|
||||||
{
|
{
|
||||||
{"dmrmc100c", (k, n, d) => new DmRmcX100CController(k, n, new DmRmc100C(d))},
|
{"dmrmc100c", (k, n, d) => new DmRmcX100CController(k, n, new DmRmc100C(d))},
|
||||||
{"dmrmc100s", (k, n, d) => new DmRmc100SController(k, n, new DmRmc100S(d))},
|
{"dmrmc100s", (k, n, d) => new DmRmc100SController(k, n, d)},
|
||||||
{"dmrmc4k100c", (k, n, d) => new DmRmcX100CController(k, n, new DmRmc4k100C(d))},
|
{"dmrmc4k100c", (k, n, d) => new DmRmcX100CController(k, n, new DmRmc4k100C(d))},
|
||||||
{"dmrmc4kz100c", (k, n, d) => new DmRmc4kZ100CController(k, n, new DmRmc4kz100C(d))},
|
{"dmrmc4kz100c", (k, n, d) => new DmRmc4kZ100CController(k, n, new DmRmc4kz100C(d))},
|
||||||
{"dmrmc150s", (k, n, d) => new DmRmc150SController(k, n, new DmRmc150S(d))},
|
{"dmrmc150s", (k, n, d) => new DmRmc150SController(k, n, new DmRmc150S(d))},
|
||||||
@@ -157,39 +179,47 @@ namespace PepperDash.Essentials.DM
|
|||||||
},
|
},
|
||||||
{"hdbasetrx", (k,n,d) => new HDBaseTRxController(k,n, new HDRx3CB(d))},
|
{"hdbasetrx", (k,n,d) => new HDBaseTRxController(k,n, new HDRx3CB(d))},
|
||||||
{"dmrmc4k100c1g", (k,n,d) => new DmRmc4k100C1GController(k,n, new DmRmc4K100C1G(d))}
|
{"dmrmc4k100c1g", (k,n,d) => new DmRmc4k100C1GController(k,n, new DmRmc4K100C1G(d))}
|
||||||
|
};*/
|
||||||
|
|
||||||
|
ChassisDict = new Dictionary
|
||||||
|
<string,
|
||||||
|
Func<string, string, DmRmcPropertiesConfig, Func<string, string, IDmSwitch>, CrestronGenericBaseDevice>
|
||||||
|
>
|
||||||
|
{
|
||||||
|
{"dmrmc100s", (k, n, p, f) => new DmRmc100SController(k, n, p, f)}
|
||||||
};
|
};
|
||||||
|
|
||||||
ChassisDict = new Dictionary<string, Func<string, string, uint, DMOutput, CrestronGenericBaseDevice>>
|
/*ChassisDict = new Dictionary<string, Func<string, string, uint, DMOutput, CrestronGenericBaseDevice>>
|
||||||
{
|
{
|
||||||
{"dmrmc100c", (k, n, i, d) => new DmRmcX100CController(k, n, new DmRmc100C(i,d))},
|
{"dmrmc100c", (k, n, i, d) => new DmRmcX100CController(k, n, new DmRmc100C(i, d))},
|
||||||
{"dmrmc100s", (k, n,i, d) => new DmRmc100SController(k, n, new DmRmc100S(i,d))},
|
{"dmrmc100s", (k, n, i, d) => new DmRmc100SController(k, n, i, d)},
|
||||||
{"dmrmc4k100c", (k, n,i, d) => new DmRmcX100CController(k, n, new DmRmc4k100C(i,d))},
|
{"dmrmc4k100c", (k, n, i, d) => new DmRmcX100CController(k, n, new DmRmc4k100C(i, d))},
|
||||||
{"dmrmc4kz100c", (k, n,i, d) => new DmRmc4kZ100CController(k, n, new DmRmc4kz100C(i,d))},
|
{"dmrmc4kz100c", (k, n, i, d) => new DmRmc4kZ100CController(k, n, new DmRmc4kz100C(i, d))},
|
||||||
{"dmrmc150s", (k, n,i, d) => new DmRmc150SController(k, n, new DmRmc150S(i,d))},
|
{"dmrmc150s", (k, n, i, d) => new DmRmc150SController(k, n, new DmRmc150S(i, d))},
|
||||||
{"dmrmc200c", (k, n,i, d) => new DmRmc200CController(k, n, new DmRmc200C(i,d))},
|
{"dmrmc200c", (k, n, i, d) => new DmRmc200CController(k, n, new DmRmc200C(i, d))},
|
||||||
{"dmrmc200s", (k, n,i, d) => new DmRmc200SController(k, n, new DmRmc200S(i,d))},
|
{"dmrmc200s", (k, n, i, d) => new DmRmc200SController(k, n, new DmRmc200S(i, d))},
|
||||||
{"dmrmc200s2", (k, n,i, d) => new DmRmc200S2Controller(k, n, new DmRmc200S2(i,d))},
|
{"dmrmc200s2", (k, n, i, d) => new DmRmc200S2Controller(k, n, new DmRmc200S2(i, d))},
|
||||||
{"dmrmcscalerc", (k, n,i, d) => new DmRmcScalerCController(k, n, new DmRmcScalerC(i,d))},
|
{"dmrmcscalerc", (k, n, i, d) => new DmRmcScalerCController(k, n, new DmRmcScalerC(i, d))},
|
||||||
{"dmrmcscalers", (k, n,i, d) => new DmRmcScalerSController(k, n, new DmRmcScalerS(i,d))},
|
{"dmrmcscalers", (k, n, i, d) => new DmRmcScalerSController(k, n, new DmRmcScalerS(i, d))},
|
||||||
{
|
{
|
||||||
"dmrmcscalers2",
|
"dmrmcscalers2",
|
||||||
(k, n,i, d) => new DmRmcScalerS2Controller(k, n, new DmRmcScalerS2(d))
|
(k, n, i, d) => new DmRmcScalerS2Controller(k, n, new DmRmcScalerS2(d))
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"dmrmc4kscalerc",
|
"dmrmc4kscalerc",
|
||||||
(k, n,i, d) => new DmRmc4kScalerCController(k, n, new DmRmc4kScalerC(d))
|
(k, n, i, d) => new DmRmc4kScalerCController(k, n, new DmRmc4kScalerC(d))
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"dmrmc4kscalercdsp",
|
"dmrmc4kscalercdsp",
|
||||||
(k, n,i, d) => new DmRmc4kScalerCDspController(k, n, new DmRmc4kScalerCDsp(d))
|
(k, n, i, d) => new DmRmc4kScalerCDspController(k, n, new DmRmc4kScalerCDsp(d))
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"dmrmc4kzscalerc",
|
"dmrmc4kzscalerc",
|
||||||
(k, n,i, d) => new DmRmc4kZScalerCController(k, n, new DmRmc4kzScalerC(d))
|
(k, n, i, d) => new DmRmc4kZScalerCController(k, n, new DmRmc4kzScalerC(d))
|
||||||
},
|
},
|
||||||
{"hdbasetrx", (k,n,i,d) => new HDBaseTRxController(k,n, new HDRx3CB(d))},
|
{"hdbasetrx", (k, n, i, d) => new HDBaseTRxController(k, n, new HDRx3CB(d))},
|
||||||
{"dmrmc4k100c1g", (k,n,i,d) => new DmRmc4k100C1GController(k,n, new DmRmc4K100C1G(d))}
|
{"dmrmc4k100c1g", (k, n, i, d) => new DmRmc4k100C1GController(k, n, new DmRmc4K100C1G(d))}
|
||||||
};
|
};*/
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A factory method for various DmRmcControllers
|
/// A factory method for various DmRmcControllers
|
||||||
@@ -207,74 +237,20 @@ namespace PepperDash.Essentials.DM
|
|||||||
var pKey = props.ParentDeviceKey.ToLower();
|
var pKey = props.ParentDeviceKey.ToLower();
|
||||||
|
|
||||||
// Non-DM-chassis endpoints
|
// Non-DM-chassis endpoints
|
||||||
return pKey == "processor" ? GetDmRmcControllerForProcessor(key, name, typeName, ipid) : GetDmRmcControllerForChassis(key, name, typeName, props, pKey, ipid);
|
return pKey == "processor" ? GetDmRmcControllerForProcessor(key, name, typeName, ipid) : GetDmRmcControllerForChassis(key, name, typeName, props);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static CrestronGenericBaseDevice GetDmRmcControllerForChassis(string key, string name, string typeName,
|
private static CrestronGenericBaseDevice GetDmRmcControllerForChassis(string key, string name, string typeName,
|
||||||
DmRmcPropertiesConfig props, string pKey, uint ipid)
|
DmRmcPropertiesConfig props)
|
||||||
{
|
{
|
||||||
var parentDev = DeviceManager.GetDeviceForKey(pKey);
|
Func<string, string, DmRmcPropertiesConfig, Func<string, string, IDmSwitch>, CrestronGenericBaseDevice> handler;
|
||||||
if (!(parentDev is IDmSwitch))
|
|
||||||
{
|
|
||||||
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a DM Chassis.",
|
|
||||||
key, pKey);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
var chassis = (parentDev as IDmSwitch).Chassis;
|
|
||||||
var num = props.ParentOutputNumber;
|
|
||||||
|
|
||||||
if (num <= 0 || num > chassis.NumberOfOutputs)
|
|
||||||
{
|
|
||||||
Debug.Console(0, "Cannot create DM device '{0}'. Output number '{1}' is out of range",
|
|
||||||
key, num);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
var controller = parentDev as IDmSwitch;
|
|
||||||
controller.RxDictionary.Add(num, key);
|
|
||||||
// Catch constructor failures, mainly dues to IPID
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// Must use different constructor for CPU3 chassis types. No IPID
|
|
||||||
if (chassis is DmMd8x8Cpu3 || chassis is DmMd16x16Cpu3 ||
|
|
||||||
chassis is DmMd32x32Cpu3 || chassis is DmMd8x8Cpu3rps ||
|
|
||||||
chassis is DmMd16x16Cpu3rps || chassis is DmMd32x32Cpu3rps ||
|
|
||||||
chassis is DmMd128x128 || chassis is DmMd64x64)
|
|
||||||
{
|
|
||||||
return GetDmRmcControllerForCpu3Chassis(key, name, typeName, chassis, num, parentDev);
|
|
||||||
}
|
|
||||||
|
|
||||||
return GetDmRmcControllerForCpu2Chassis(key, name, typeName, ipid, chassis, num, parentDev);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Debug.Console(0, "[{0}] WARNING: Cannot create DM-RMC device: {1}", key, e.Message);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static CrestronGenericBaseDevice GetDmRmcControllerForCpu2Chassis(string key, string name, string typeName,
|
|
||||||
uint ipid, Switch chassis, uint num, IKeyed parentDev)
|
|
||||||
{
|
|
||||||
Func<string, string, uint, DMOutput, CrestronGenericBaseDevice> handler;
|
|
||||||
if (ChassisDict.TryGetValue(typeName.ToLower(), out handler))
|
if (ChassisDict.TryGetValue(typeName.ToLower(), out handler))
|
||||||
{
|
{
|
||||||
return handler(key, name, ipid, chassis.Outputs[num]);
|
return handler(key, name, props, GetDmSwitch);
|
||||||
}
|
|
||||||
Debug.Console(0, "Cannot create DM-RMC of type '{0}' with parent device {1}", typeName, parentDev.Key);
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static CrestronGenericBaseDevice GetDmRmcControllerForCpu3Chassis(string key, string name, string typeName,
|
Debug.Console(0, "Cannot create DM-RMC of type '{0}' with parent device {1}", typeName, props.ParentDeviceKey);
|
||||||
Switch chassis, uint num, IKeyed parentDev)
|
|
||||||
{
|
|
||||||
Func<string, string, DMOutput, CrestronGenericBaseDevice> cpu3Handler;
|
|
||||||
if (ChassisCpu3Dict.TryGetValue(typeName.ToLower(), out cpu3Handler))
|
|
||||||
{
|
|
||||||
return cpu3Handler(key, name, chassis.Outputs[num]);
|
|
||||||
}
|
|
||||||
Debug.Console(0, "Cannot create DM-RMC of type '{0}' with parent device {1}", typeName, parentDev.Key);
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -298,6 +274,34 @@ namespace PepperDash.Essentials.DM
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IDmSwitch GetDmSwitch(string key, string pKey)
|
||||||
|
{
|
||||||
|
var parentDev = DeviceManager.GetDeviceForKey(pKey) as IDmSwitch;
|
||||||
|
|
||||||
|
if (parentDev != null)
|
||||||
|
{
|
||||||
|
return parentDev;
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a DM Chassis.",
|
||||||
|
key, pKey);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DMOutput AddRmcAndGetDmOutput(string key, uint output, IDmSwitch dmSwitch)
|
||||||
|
{
|
||||||
|
var chassis = dmSwitch.Chassis;
|
||||||
|
|
||||||
|
if (output <= 0 || output > chassis.NumberOfOutputs)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "Cannot add DM device '{0}' to switch '{2}'. Output number '{1}' is out of range",
|
||||||
|
key, output, dmSwitch);
|
||||||
|
}
|
||||||
|
dmSwitch.RxDictionary.Add(output, key);
|
||||||
|
|
||||||
|
return dmSwitch.Chassis.Outputs[output];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DmRmcControllerFactory : EssentialsDeviceFactory<DmRmcControllerBase>
|
public class DmRmcControllerFactory : EssentialsDeviceFactory<DmRmcControllerBase>
|
||||||
|
|||||||
Reference in New Issue
Block a user