mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-27 11:24:55 +00:00
Merge pull request #116 from PepperDash/feature/changes-to-IBridgeAdvanced
Feature/changes to i bridge advanced
This commit is contained in:
12
PepperDashEssentials/Bridges/IBridge.cs
Normal file
12
PepperDashEssentials/Bridges/IBridge.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a device that uses the legacy JoinMapBase for its join map
|
||||
/// </summary>
|
||||
[Obsolete("IBridgeAdvanced should be used going forward with JoinMapBaseAdvanced")]
|
||||
public interface IBridge: Core.Bridges.IBridge
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -125,6 +125,7 @@
|
||||
<Compile Include="AppServer\SIMPLJoinMaps\MobileControlSIMPLRoomJoinMap.cs" />
|
||||
<Compile Include="Audio\EssentialsVolumeLevelConfig.cs" />
|
||||
<Compile Include="Bridges\BridgeFactory.cs" />
|
||||
<Compile Include="Bridges\IBridge.cs" />
|
||||
<Compile Include="Factory\DeviceFactory.cs" />
|
||||
<Compile Include="Devices\Amplifier.cs" />
|
||||
<Compile Include="ControlSystem.cs" />
|
||||
|
||||
@@ -109,31 +109,37 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
if (device == null) continue;
|
||||
|
||||
Debug.Console(1, this, "Linking Device: '{0}'", device.Key);
|
||||
|
||||
if (device.GetType().GetCType().IsAssignableFrom(typeof (IBridge)))
|
||||
if (device is IBridge) // Check for this first to allow bridges in plugins to override existing bridges that apply to the same type.
|
||||
{
|
||||
var bridge = device as IBridge;
|
||||
|
||||
if (bridge != null) bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
continue;
|
||||
Debug.Console(2, this, "'{0}' is IBridge", device.Key);
|
||||
(device as IBridge).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
}
|
||||
|
||||
if (device.GetType().GetCType().IsAssignableFrom(typeof (IBridgeAdvanced)))
|
||||
else if (device is IBridgeAdvanced)
|
||||
{
|
||||
var bridge = device as IBridgeAdvanced;
|
||||
if (bridge != null) bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
|
||||
Debug.Console(2, this, "'{0}' is IBridgeAdvanced", device.Key);
|
||||
(device as IBridgeAdvanced).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
|
||||
}
|
||||
|
||||
//if (device is IBridge) // Check for this first to allow bridges in plugins to override existing bridges that apply to the same type.
|
||||
//if (device.GetType().GetCType().IsAssignableFrom(typeof (IBridge)))
|
||||
//{
|
||||
// (device as IBridge).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
// var bridge = device as IBridge;
|
||||
|
||||
// if (bridge == null)
|
||||
// continue;
|
||||
// Debug.Console(2, this, "Linking device {0} as IBridge");
|
||||
// bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
// continue;
|
||||
//}
|
||||
//else if (device is IBridgeAdvanced)
|
||||
//{
|
||||
// Debug.Console(2, this, "'{0}' is IBridgeAdvanced", device.Key);
|
||||
// (device as IBridgeAdvanced).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
|
||||
//}
|
||||
|
||||
//if (!device.GetType().GetCType().IsAssignableFrom(typeof (IBridgeAdvanced))) continue;
|
||||
|
||||
//var bridgeAdvanced = device as IBridgeAdvanced;
|
||||
|
||||
//if (bridgeAdvanced == null) continue;
|
||||
//Debug.Console(2, this, "Linking device {0} as IBridgeAdvanced");
|
||||
//bridgeAdvanced.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
|
||||
}
|
||||
Debug.Console(1, this, "Devices Linked.");
|
||||
//
|
||||
//else if (device is PepperDash.Essentials.Core.Monitoring.SystemMonitorController)
|
||||
//{
|
||||
// (device as PepperDash.Essentials.Core.Monitoring.SystemMonitorController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
@@ -234,9 +240,9 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
// (device as C2nRthsController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
// continue;
|
||||
//}
|
||||
}
|
||||
//}
|
||||
|
||||
Debug.Console(1, this, "Devices Linked.");
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,14 @@ using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a device that uses JoinMapBaseAdvanced for its join map
|
||||
/// </summary>
|
||||
public interface IBridgeAdvanced
|
||||
{
|
||||
void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApi bridge);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines a device that uses the legacy JoinMapBase for its join map
|
||||
/// </summary>
|
||||
@@ -11,12 +19,4 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines a device that uses JoinMapBaseAdvanced for its join map
|
||||
/// </summary>
|
||||
public interface IBridgeAdvanced
|
||||
{
|
||||
void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApi bridge);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user