Compare commits

...

23 Commits

Author SHA1 Message Date
Neil Dorin
377cf23bca Merge pull request #274 from PepperDash/release/1.5.6
Release V1.5.6
2020-06-23 14:14:35 -06:00
Andrew Welker
6f16bc3427 Merge branch 'main' into release/1.5.6 2020-06-23 13:56:34 -06:00
Andrew Welker
35ec5e903e Merge pull request #271 from PepperDash/bugfix/eisc-ibridge-fixes
Update bridging to eliminate null references & allow backwards compatibility
2020-06-19 16:25:11 -06:00
Andrew Welker
f98292a4aa add null check to all internal device LinkToApi methods
This allows for backwards compatability with EiscApi bridges.
2020-06-19 15:48:34 -06:00
Andrew Welker
6b6604b7a9 update bridges and interfaces 2020-06-19 15:48:33 -06:00
Andrew Welker
55eb110373 Merge branch 'release/1.5.6' of https://github.com/PepperDash/Essentials into release/1.5.6 2020-06-19 15:48:08 -06:00
Andrew Welker
42418fedb8 Merge pull request #266 from PepperDash/feature/PRO3-card-support
Add 3-series Card Support
2020-06-19 15:31:56 -06:00
Andrew Welker
407fc2e948 Merge pull request #263 from PepperDash/feature/update-PdCore
Update PepperDash Core submodule after branch rename
2020-06-18 18:58:55 -06:00
Andrew Welker
49177da820 add config snippets for external card cages 2020-06-18 18:53:30 -06:00
Andrew Welker
a1809dccb4 add internal card cage support 2020-06-18 18:53:30 -06:00
Andrew Welker
7d97bc118e fix debug message 2020-06-18 18:53:30 -06:00
Andrew Welker
48bc41a69e update key and name for cards 2020-06-18 18:53:30 -06:00
Andrew Welker
e4a8e89135 add Cenci33 controller 2020-06-18 18:53:30 -06:00
Andrew Welker
1bd6825258 create classes for all supported cards 2020-06-18 18:53:30 -06:00
Andrew Welker
e5099e9a2a started support for 3-Series cards 2020-06-18 18:53:30 -06:00
Neil Dorin
ccdaa12f20 Merge pull request #268 from PepperDash/feature/update-dm-join-map
Add in/out AV names to join map
2020-06-18 18:01:23 -06:00
Andrew Welker
60d387c792 add in/out AV names to join map 2020-06-18 16:16:24 -06:00
Andrew Welker
d9b4ca815e Merge pull request #265 from PepperDash/hotfix/add-latest-release-link
Adds latest release link
2020-06-17 22:54:44 -06:00
Neil Dorin
37686044d4 Adds latest release link 2020-06-17 22:15:01 -06:00
Andrew Welker
ef50098460 update PD Core submodule commit 2020-06-17 19:35:35 -06:00
Andrew Welker
f2eff3fdb4 Merge pull request #260 from PepperDash/feature/update-workflows-for-name-change
Update workflows for name change
2020-06-17 12:34:31 -06:00
Andrew Welker
2749fdc2e9 update workflows for name change 2020-06-17 12:10:12 -06:00
Andrew Welker
b689a54936 Merge pull request #253 from PepperDash/hotfix/eiscApiAdvanced-backwards-compatibility
Add backwards compatability with `IBridge` to `EiscApiAdvanced`
2020-06-12 13:43:05 -06:00
44 changed files with 844 additions and 88 deletions

View File

@@ -1,4 +1,4 @@
$latestVersions = $(git tag --merged origin/master)
$latestVersions = $(git tag --merged origin/main)
$latestVersion = [version]"0.0.0"
Foreach ($version in $latestVersions) {
Write-Host $version
@@ -18,7 +18,7 @@ $newVersion = [version]$latestVersion
$phase = ""
$newVersionString = ""
switch -regex ($Env:GITHUB_REF) {
'^refs\/heads\/master*.' {
'^refs\/heads\/main*.' {
$newVersionString = "{0}.{1}.{2}" -f $newVersion.Major, $newVersion.Minor, $newVersion.Build
}
'^refs\/heads\/feature\/*.' {

View File

@@ -18,8 +18,8 @@ env:
VERSION: 0.0.0-buildtype-buildnumber
# Defaults to debug for build type
BUILD_TYPE: Debug
# Defaults to master as the release branch. Change as necessary
RELEASE_BRANCH: master
# Defaults to main as the release branch. Change as necessary
RELEASE_BRANCH: main
jobs:
Build_Project:
runs-on: windows-latest
@@ -189,11 +189,11 @@ jobs:
run: git push --tags origin
- name: Check Directory
run: Get-ChildItem ./
# This step only runs if the branch is master or release/ runs and pushes the build to the public build repo
# This step only runs if the branch is main or release/ runs and pushes the build to the public build repo
Public_Push_Output:
needs: Build_Project
runs-on: windows-latest
if: contains(github.ref, 'master') || contains(github.ref, '/release/')
if: contains(github.ref, 'main') || contains(github.ref, '/release/')
steps:
# Checkout the repo
- name: check Github ref

View File

@@ -1,11 +1,11 @@
name: Master Build using Docker
name: main Build using Docker
on:
release:
types:
- created
branches:
- master
- main
env:
# solution path doesn't need slashes unless there it is multiple folders deep
# solution name does not include extension. .sln is assumed
@@ -15,8 +15,8 @@ env:
VERSION: 0.0.0-buildtype-buildnumber
# Defaults to debug for build type
BUILD_TYPE: Release
# Defaults to master as the release branch. Change as necessary
RELEASE_BRANCH: master
# Defaults to main as the release branch. Change as necessary
RELEASE_BRANCH: main
jobs:
Build_Project:
runs-on: windows-latest
@@ -114,8 +114,8 @@ jobs:
Remove-Item -Path ./Version/version.txt
Remove-Item -Path ./Version
# Checkout/Create the branch
- name: Checkout Master branch
run: git checkout master
- name: Checkout main branch
run: git checkout main
# Download the build output into the repo
- name: Download Build output
uses: actions/download-artifact@v1
@@ -151,13 +151,13 @@ jobs:
# Push the commit
- name: Push to Builds Repo
shell: powershell
run: git push -u origin master --force
run: git push -u origin main --force
# Push the tags
- name: Push tags
run: git push --tags origin
- name: Check Directory
run: Get-ChildItem ./
# This step only runs if the branch is master or release/ runs and pushes the build to the public build repo
# This step only runs if the branch is main or release/ runs and pushes the build to the public build repo
Public_Push_Output:
needs: Build_Project
runs-on: windows-latest
@@ -186,9 +186,9 @@ jobs:
Write-Output "::set-env name=VERSION::$version"
Remove-Item -Path ./Version/version.txt
Remove-Item -Path ./Version
# Checkout master branch
# Checkout main branch
- name: Create new branch
run: git checkout master
run: git checkout main
# Download the build output into the repo
- name: Download Build output
uses: actions/download-artifact@v1
@@ -224,7 +224,7 @@ jobs:
# Push the commit
- name: Push to Builds Repo
shell: powershell
run: git push -u origin master --force
run: git push -u origin main --force
# Push the tags
- name: Push tags
run: git push --tags origin

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using Crestron.SimplSharp.Reflection;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.EthernetCommunication;
using PepperDash.Core;
@@ -39,19 +40,31 @@ namespace PepperDash.Essentials.Bridges
if (device == null) continue;
Debug.Console(1, this, "Linking Device: '{0}'", device.Key);
if (device is IBridge) // Check for this first to allow bridges in plugins to override existing bridges that apply to the same type.
if (typeof(IBridge).IsAssignableFrom(device.GetType().GetCType())) // Check for this first to allow bridges in plugins to override existing bridges that apply to the same type.
{
Debug.Console(2, this, "'{0}' is IBridge", device.Key);
var dev = device as IBridge;
if (dev == null)
{
Debug.Console(0, this, Debug.ErrorLogLevel.Error, "Cast to IBridge failed for {0}");
continue;
}
dev.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
}
if (!(device is IBridgeAdvanced)) continue;
if (!typeof(IBridgeAdvanced).IsAssignableFrom(device.GetType().GetCType())) continue;
Debug.Console(2, this, "'{0}' is IBridgeAdvanced", device.Key);
var advDev = device as IBridgeAdvanced;
if (advDev == null)
{
Debug.Console(0, this, Debug.ErrorLogLevel.Error, "Cast to IBridgeAdvanced failed for {0}");
continue;
}
try
{
advDev.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, null);
@@ -61,7 +74,6 @@ namespace PepperDash.Essentials.Bridges
Debug.ConsoleWithLog(0, this,
"Please update the bridge config to use EiscBridgeAdvanced with this device: {0}", device.Key);
}
}
Debug.Console(1, this, "Devices Linked.");

View File

@@ -1,4 +1,5 @@
using System;
using Crestron.SimplSharpPro.DeviceSupport;
namespace PepperDash.Essentials.Bridges
{
@@ -6,7 +7,8 @@ namespace PepperDash.Essentials.Bridges
/// 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
public interface IBridge
{
void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey);
}
}

View File

@@ -1,6 +1,8 @@
# PepperDash Essentials Framework (c) 2020
## [Latest Release](https://github.com/PepperDash/Essentials/releases/latest)
## License
Provided under MIT license

View File

@@ -7,7 +7,6 @@ using Crestron.SimplSharpPro.EthernetCommunication;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
//using PepperDash.Essentials.Devices.Common.Cameras;
@@ -111,28 +110,17 @@ namespace PepperDash.Essentials.Core.Bridges
Debug.Console(1, this, "Linking Device: '{0}'", device.Key);
if (typeof (IBridge).IsAssignableFrom(device.GetType().GetCType()))
if (!typeof (IBridgeAdvanced).IsAssignableFrom(device.GetType().GetCType()))
{
var basicBridge = device as IBridge;
if (basicBridge != null)
{
Debug.Console(0, this, Debug.ErrorLogLevel.Notice,
"Linking EiscApiAdvanced {0} to device {1} using obsolete join map. Please update the device's join map.",
Key, device.Key);
basicBridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
}
Debug.Console(0, this, Debug.ErrorLogLevel.Notice,
"{0} is not compatible with this bridge type. Please use 'eiscapi' instead, or updae the device.",
device.Key);
continue;
}
if (!typeof (IBridgeAdvanced).IsAssignableFrom(device.GetType().GetCType()))
{
continue;
}
var bridge = device as IBridgeAdvanced;
if (bridge != null) bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
}
});
}
@@ -303,7 +291,7 @@ namespace PepperDash.Essentials.Core.Bridges
{
public EiscApiAdvancedFactory()
{
TypeNames = new List<string>() { "eiscapiadv", "eiscapiadvanced" };
TypeNames = new List<string> { "eiscapiadv", "eiscapiadvanced" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)

View File

@@ -1,19 +1,12 @@
using System;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
using Crestron.SimplSharpPro.DeviceSupport;
namespace PepperDash.Essentials.Core.Bridges
{
/// <summary>
/// Defines a device that uses JoinMapBaseAdvanced for its join map
/// </summary>
public interface IBridgeAdvanced:IKeyed
public interface IBridgeAdvanced
{
void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge);
}
public interface IBridge:IKeyed
{
void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey);
}
}

View File

@@ -89,6 +89,43 @@ namespace PepperDash.Essentials.Core.Bridges
public JoinDataComplete OutputNames = new JoinDataComplete(new JoinData() { JoinNumber = 301, JoinSpan = 32 },
new JoinMetadata() { Label = "DM Chassis Output Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("InputVideoNames")] public JoinDataComplete InputVideoNames =
new JoinDataComplete(new JoinData {JoinNumber = 501, JoinSpan = 200},
new JoinMetadata
{
Description = "Video Input Name",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("InputAudioNames")]
public JoinDataComplete InputAudioNames =
new JoinDataComplete(new JoinData { JoinNumber = 701, JoinSpan = 200 },
new JoinMetadata
{
Description = "Video Input Name",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("OutputVideoNames")]
public JoinDataComplete OutputVideoNames =
new JoinDataComplete(new JoinData { JoinNumber = 901, JoinSpan = 200 },
new JoinMetadata
{
Description = "Video Input Name",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("OutputAudioNames")]
public JoinDataComplete OutputAudioNames =
new JoinDataComplete(new JoinData { JoinNumber = 1101, JoinSpan = 200 },
new JoinMetadata
{
Description = "Video Input Name",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("OutputCurrentVideoInputNames")]
public JoinDataComplete OutputCurrentVideoInputNames = new JoinDataComplete(new JoinData() { JoinNumber = 2001, JoinSpan = 32 },
new JoinMetadata() { Label = "DM Chassis Video Output Currently Routed Video Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });

View File

@@ -76,7 +76,14 @@ namespace PepperDash.Essentials.Core
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<IBasicCommunicationJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
if (bridge != null)
{
bridge.AddJoinMap(Key, joinMap);
}
else
{
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
}
if (CommPort == null)
{

View File

@@ -55,7 +55,14 @@ namespace PepperDash.Essentials.Core.CrestronIO
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<C2nRthsControllerJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
if (bridge != null)
{
bridge.AddJoinMap(Key, joinMap);
}
else
{
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
}
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));

View File

@@ -0,0 +1,24 @@
using System;
using Crestron.SimplSharpProInternal;
namespace PepperDash.Essentials.Core.CrestronIO.Cards
{
public class C3CardControllerBase:CrestronGenericBaseDevice
{
private readonly C3Card _card;
public C3CardControllerBase(string key, string name, C3Card hardware) : base(key, name, hardware)
{
_card = hardware;
}
#region Overrides of Object
public override string ToString()
{
return String.Format("{0} {1}", Key, _card.ToString());
}
#endregion
}
}

View File

@@ -0,0 +1,29 @@
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.ThreeSeriesCards;
namespace PepperDash.Essentials.Core.CrestronIO.Cards
{
public class C3Com3Controller:C3CardControllerBase, IComPorts
{
private readonly C3com3 _card;
public C3Com3Controller(string key, string name, C3com3 hardware) : base(key, name, hardware)
{
_card = hardware;
}
#region Implementation of IComPorts
public CrestronCollection<ComPort> ComPorts
{
get { return _card.ComPorts; }
}
public int NumberOfComPorts
{
get { return _card.NumberOfComPorts; }
}
#endregion
}
}

View File

@@ -0,0 +1,29 @@
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.ThreeSeriesCards;
namespace PepperDash.Essentials.Core.CrestronIO.Cards
{
public class C3Io16Controller:C3CardControllerBase,IIOPorts
{
private readonly C3io16 _card;
public C3Io16Controller(string key, string name, C3io16 hardware) : base(key, name, hardware)
{
_card = hardware;
}
#region Implementation of IIOPorts
public CrestronCollection<Versiport> VersiPorts
{
get { return _card.VersiPorts; }
}
public int NumberOfVersiPorts
{
get { return _card.NumberOfVersiPorts; }
}
#endregion
}
}

View File

@@ -0,0 +1,29 @@
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.ThreeSeriesCards;
namespace PepperDash.Essentials.Core.CrestronIO.Cards
{
public class C3Ir8Controller:C3CardControllerBase, IIROutputPorts
{
private readonly C3ir8 _card;
public C3Ir8Controller(string key, string name, C3ir8 hardware) : base(key, name, hardware)
{
_card = hardware;
}
#region Implementation of IIROutputPorts
public CrestronCollection<IROutputPort> IROutputPorts
{
get { return _card.IROutputPorts; }
}
public int NumberOfIROutputPorts
{
get { return _card.NumberOfIROutputPorts; }
}
#endregion
}
}

View File

@@ -0,0 +1,29 @@
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.ThreeSeriesCards;
namespace PepperDash.Essentials.Core.CrestronIO.Cards
{
public class C3Ry16Controller:C3CardControllerBase, IRelayPorts
{
private readonly C3ry16 _card;
public C3Ry16Controller(string key, string name, C3ry16 hardware) : base(key, name, hardware)
{
_card = hardware;
}
#region Implementation of IRelayPorts
public CrestronCollection<Relay> RelayPorts
{
get { return _card.RelayPorts; }
}
public int NumberOfRelayPorts
{
get { return _card.NumberOfRelayPorts; }
}
#endregion
}
}

View File

@@ -0,0 +1,29 @@
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.ThreeSeriesCards;
namespace PepperDash.Essentials.Core.CrestronIO.Cards
{
public class C3Ry8Controller:C3CardControllerBase, IRelayPorts
{
private readonly C3ry8 _card;
public C3Ry8Controller(string key, string name, C3ry8 hardware) : base(key, name, hardware)
{
_card = hardware;
}
#region Implementation of IRelayPorts
public CrestronCollection<Relay> RelayPorts
{
get { return _card.RelayPorts; }
}
public int NumberOfRelayPorts
{
get { return _card.NumberOfRelayPorts; }
}
#endregion
}
}

View File

@@ -0,0 +1,116 @@
using System;
using System.Collections.Generic;
using Crestron.SimplSharpPro.ThreeSeriesCards;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core.CrestronIO.Cards
{
[ConfigSnippet("\"properties\":{\"card\":\"c3com3\"}")]
public class CenCi31Controller : CrestronGenericBaseDevice
{
private const string CardKeyTemplate = "{0}-card";
private const string CardNameTemplate = "{0}:{1}:{2}";
private const uint CardSlot = 1;
private readonly CenCi31 _cardCage;
private readonly CenCi31Configuration _config;
private readonly Dictionary<string, Func<CenCi31, uint, C3CardControllerBase>> _cardDict;
public CenCi31Controller(string key, string name, CenCi31Configuration config, CenCi31 hardware) : base(key, name, hardware)
{
_cardCage = hardware;
_config = config;
_cardDict = new Dictionary<string, Func<CenCi31, uint, C3CardControllerBase>>
{
{
"c3com3",
(c, s) =>
new C3Com3Controller(String.Format(CardKeyTemplate, key),
String.Format(CardNameTemplate, key, s, "C3Com3"), new C3com3(_cardCage))
},
{
"c3io16",
(c, s) =>
new C3Io16Controller(String.Format(CardKeyTemplate, key),
String.Format(CardNameTemplate, key, s,"C3Io16"), new C3io16(_cardCage))
},
{
"c3ir8",
(c, s) =>
new C3Ir8Controller(String.Format(CardKeyTemplate, key),
String.Format(CardNameTemplate, key, s, "C3Ir8"), new C3ir8(_cardCage))
},
{
"c3ry16",
(c, s) =>
new C3Ry16Controller(String.Format(CardKeyTemplate, key),
String.Format(CardNameTemplate, key, s, "C3Ry16"), new C3ry16(_cardCage))
},
{
"c3ry8",
(c, s) =>
new C3Ry8Controller(String.Format(CardKeyTemplate, key),
String.Format(CardNameTemplate, key, s, "C3Ry8"), new C3ry8(_cardCage))
},
};
GetCards();
}
private void GetCards()
{
Func<CenCi31, uint, C3CardControllerBase> cardBuilder;
if (String.IsNullOrEmpty(_config.Card))
{
Debug.Console(0, this, "No card specified");
return;
}
if (!_cardDict.TryGetValue(_config.Card.ToLower(), out cardBuilder))
{
Debug.Console(0, "Unable to find factory for 3-Series card type {0}.", _config.Card);
return;
}
var device = cardBuilder(_cardCage, CardSlot);
DeviceManager.AddDevice(device);
}
}
public class CenCi31Configuration
{
[JsonProperty("card")]
public string Card { get; set; }
}
public class CenCi31ControllerFactory : EssentialsDeviceFactory<CenCi31Controller>
{
public CenCi31ControllerFactory()
{
TypeNames = new List<string> {"cenci31"};
}
#region Overrides of EssentialsDeviceFactory<CenCi31Controller>
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory attempting to build new CEN-CI-1");
var controlProperties = CommFactory.GetControlPropertiesConfig(dc);
var ipId = controlProperties.IpIdInt;
var cardCage = new CenCi31(ipId, Global.ControlSystem);
var config = dc.Properties.ToObject<CenCi31Configuration>();
return new CenCi31Controller(dc.Key, dc.Name, config, cardCage);
}
#endregion
}
}

View File

@@ -0,0 +1,131 @@
using System;
using System.Collections.Generic;
using Crestron.SimplSharpPro.ThreeSeriesCards;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core.CrestronIO.Cards
{
[ConfigSnippet("\"properties\":{\"cards\":{\"1\":\"c3com3\",\"2\":\"c3ry16\",\"3\":\"c3ry8\"}}")]
public class CenCi33Controller : CrestronGenericBaseDevice
{
private const string CardKeyTemplate = "{0}-card{1}";
private const string CardNameTemplate = "{0}:{1}:{2}";
private const uint CardSlots = 3;
private readonly CenCi33 _cardCage;
private readonly CenCi33Configuration _config;
private readonly Dictionary<string, Func<CenCi33, uint, C3CardControllerBase>> _cardDict;
public CenCi33Controller(string key, string name, CenCi33Configuration config, CenCi33 hardware) : base(key, name, hardware)
{
_cardCage = hardware;
_config = config;
_cardDict = new Dictionary<string, Func<CenCi33, uint, C3CardControllerBase>>
{
{
"c3com3",
(c, s) =>
new C3Com3Controller(String.Format(CardKeyTemplate, key, s),
String.Format(CardNameTemplate, key, s, "C3Com3"), new C3com3(s,_cardCage))
},
{
"c3io16",
(c, s) =>
new C3Io16Controller(String.Format(CardKeyTemplate, key, s),
String.Format(CardNameTemplate, key, s, "C3Io16"), new C3io16(s,_cardCage))
},
{
"c3ir8",
(c, s) =>
new C3Ir8Controller(String.Format(CardKeyTemplate, key, s),
String.Format(CardNameTemplate, key, s, "C3Ir8"), new C3ir8(s,_cardCage))
},
{
"c3ry16",
(c, s) =>
new C3Ry16Controller(String.Format(CardKeyTemplate, key, s),
String.Format(CardNameTemplate, key, s, "C3Ry16"), new C3ry16(s,_cardCage))
},
{
"c3ry8",
(c, s) =>
new C3Ry8Controller(String.Format(CardKeyTemplate, key, s),
String.Format(CardNameTemplate, key, s, "C3Ry8"), new C3ry8(s,_cardCage))
},
};
GetCards();
}
private void GetCards()
{
if (_config.Cards == null)
{
Debug.Console(0, this, "No card configuration for this device found");
return;
}
for (uint i = 1; i <= CardSlots; i++)
{
string cardType;
if (!_config.Cards.TryGetValue(i, out cardType))
{
Debug.Console(1, this, "No card found for slot {0}", i);
continue;
}
if (String.IsNullOrEmpty(cardType))
{
Debug.Console(0, this, "No card specified for slot {0}", i);
return;
}
Func<CenCi33, uint, C3CardControllerBase> cardBuilder;
if (!_cardDict.TryGetValue(cardType.ToLower(), out cardBuilder))
{
Debug.Console(0, "Unable to find factory for 3-Series card type {0}.", cardType);
return;
}
var device = cardBuilder(_cardCage, i);
DeviceManager.AddDevice(device);
}
}
}
public class CenCi33Configuration
{
[JsonProperty("cards")]
public Dictionary<uint, string> Cards { get; set; }
}
public class CenCi33ControllerFactory : EssentialsDeviceFactory<CenCi33Controller>
{
public CenCi33ControllerFactory()
{
TypeNames = new List<string> {"cenci33"};
}
#region Overrides of EssentialsDeviceFactory<CenCi33Controller>
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory attempting to build new CEN-CI-3");
var controlProperties = CommFactory.GetControlPropertiesConfig(dc);
var ipId = controlProperties.IpIdInt;
var cardCage = new CenCi33(ipId, Global.ControlSystem);
var config = dc.Properties.ToObject<CenCi33Configuration>();
return new CenCi33Controller(dc.Key, dc.Name, config, cardCage);
}
#endregion
}
}

View File

@@ -0,0 +1,141 @@
using System;
using System.Collections.Generic;
using Crestron.SimplSharpPro.ThreeSeriesCards;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core.CrestronIO.Cards
{
[ConfigSnippet("\"properties\":{\"cards\":{\"1\":\"c3com3\",\"2\":\"c3ry16\",\"3\":\"c3ry8\"}}")]
public class InternalCardCageController : EssentialsDevice
{
private const string CardKeyTemplate = "{0}-card{1}";
private const string CardNameTemplate = "{0}:{1}:{2}";
private const uint CardSlots = 3;
private readonly InternalCardCageConfiguration _config;
private readonly Dictionary<string, Func<uint, C3CardControllerBase>> _cardDict;
public InternalCardCageController(string key, string name, InternalCardCageConfiguration config) : base(key, name)
{
_config = config;
_cardDict = new Dictionary<string, Func<uint, C3CardControllerBase>>
{
{
"c3com3",
(s) =>
new C3Com3Controller(String.Format(CardKeyTemplate, key, s),
String.Format(CardNameTemplate, key, s, "C3Com3"), new C3com3(s,Global.ControlSystem))
},
{
"c3io16",
(s) =>
new C3Io16Controller(String.Format(CardKeyTemplate, key, s),
String.Format(CardNameTemplate, key, s, "C3Io16"), new C3io16(s,Global.ControlSystem))
},
{
"c3ir8",
(s) =>
new C3Ir8Controller(String.Format(CardKeyTemplate, key, s),
String.Format(CardNameTemplate, key, s, "C3Ir8"), new C3ir8(s,Global.ControlSystem))
},
{
"c3ry16",
(s) =>
new C3Ry16Controller(String.Format(CardKeyTemplate, key, s),
String.Format(CardNameTemplate, key, s, "C3Ry16"), new C3ry16(s,Global.ControlSystem))
},
{
"c3ry8",
(s) =>
new C3Ry8Controller(String.Format(CardKeyTemplate, key, s),
String.Format(CardNameTemplate, key, s, "C3Ry8"), new C3ry8(s,Global.ControlSystem))
},
};
GetCards();
}
private void GetCards()
{
if (_config.Cards == null)
{
Debug.Console(0, this, "No card configuration for this device found");
return;
}
for (uint i = 1; i <= CardSlots; i++)
{
string cardType;
if (!_config.Cards.TryGetValue(i, out cardType))
{
Debug.Console(1, this, "No card found for slot {0}", i);
continue;
}
if (String.IsNullOrEmpty(cardType))
{
Debug.Console(0, this, "No card specified for slot {0}", i);
return;
}
Func<uint, C3CardControllerBase> cardBuilder;
if (!_cardDict.TryGetValue(cardType.ToLower(), out cardBuilder))
{
Debug.Console(0, "Unable to find factory for 3-Series card type {0}.", cardType);
return;
}
try
{
var device = cardBuilder(i);
DeviceManager.AddDevice(device);
}
catch (InvalidOperationException ex)
{
Debug.Console(0, this, Debug.ErrorLogLevel.Error,
"Unable to add card {0} to internal card cage.\r\nError Message: {1}\r\nStack Trace: {2}",
cardType, ex.Message, ex.StackTrace);
}
}
}
}
public class InternalCardCageConfiguration
{
[JsonProperty("cards")]
public Dictionary<uint, string> Cards { get; set; }
}
public class InternalCardCageControllerFactory : EssentialsDeviceFactory<InternalCardCageController>
{
public InternalCardCageControllerFactory()
{
TypeNames = new List<string> {"internalcardcage"};
}
#region Overrides of EssentialsDeviceFactory<InternalCardCageController>
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory attempting to build new Internal Card Cage Controller");
if (!Global.ControlSystem.SupportsThreeSeriesPlugInCards)
{
Debug.Console(0, Debug.ErrorLogLevel.Warning, "Current control system does NOT support 3-Series cards. Everything is NOT awesome.");
return null;
}
var config = dc.Properties.ToObject<InternalCardCageConfiguration>();
return new InternalCardCageController(dc.Key, dc.Name, config);
}
#endregion
}
}

View File

@@ -108,7 +108,14 @@ namespace PepperDash.Essentials.Core.CrestronIO
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<IDigitalInputJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
if (bridge != null)
{
bridge.AddJoinMap(Key, joinMap);
}
else
{
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
}
try
{

View File

@@ -148,7 +148,14 @@ namespace PepperDash.Essentials.Core.CrestronIO
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<GenericRelayControllerJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
if (bridge != null)
{
bridge.AddJoinMap(Key, joinMap);
}
else
{
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
}
if (RelayOutput == null)
{

View File

@@ -118,7 +118,14 @@ namespace PepperDash.Essentials.Core.CrestronIO
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<StatusSignControllerJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
if (bridge != null)
{
bridge.AddJoinMap(Key, joinMap);
}
else
{
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
}
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));

View File

@@ -128,9 +128,16 @@ namespace PepperDash.Essentials.Core
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<DisplayControllerJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
if (bridge != null)
{
bridge.AddJoinMap(Key, joinMap);
}
else
{
Debug.Console(0,this,"Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
}
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
Debug.Console(0, "Linking to Display: {0}", displayDevice.Name);
trilist.StringInput[joinMap.Name.JoinNumber].StringValue = displayDevice.Name;

View File

@@ -103,7 +103,7 @@ namespace PepperDash.Essentials.Core
// Check for types that have been added by plugin dlls.
if (FactoryMethods.ContainsKey(typeName))
{
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loading '{0}' from plugin", dc.Type);
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loading '{0}' from Essentials Core", dc.Type);
return FactoryMethods[typeName].FactoryMethod(dc);
}

View File

@@ -80,7 +80,14 @@ namespace PepperDash.Essentials.Core.Lighting
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<GenericLightingJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
if (bridge != null)
{
bridge.AddJoinMap(Key, joinMap);
}
else
{
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
}
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));

View File

@@ -209,7 +209,14 @@ namespace PepperDash.Essentials.Core.Monitoring
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<SystemMonitorJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
if (bridge != null)
{
bridge.AddJoinMap(Key, joinMap);
}
else
{
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
}
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
Debug.Console(2, this, "Linking API starting at join: {0}", joinStart);

View File

@@ -74,6 +74,10 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Remotes.dll</HintPath>
</Reference>
<Reference Include="Crestron.SimplSharpPro.ThreeSeriesCards, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.ThreeSeriesCards.dll</HintPath>
</Reference>
<Reference Include="Crestron.SimplSharpPro.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
@@ -156,6 +160,17 @@
<Compile Include="Config\Essentials\EssentialsConfig.cs" />
<Compile Include="Config\SourceDevicePropertiesConfigBase.cs" />
<Compile Include="Crestron IO\C2nRts\C2nRthsController.cs" />
<Compile Include="Crestron IO\Cards\C3CardControllerBase.cs" />
<Compile Include="Crestron IO\Cards\C3Com3Controller.cs" />
<Compile Include="Crestron IO\Cards\C3Io16Controller.cs" />
<Compile Include="Crestron IO\Cards\C3Ir8Controller.cs" />
<Compile Include="Crestron IO\Cards\C3Ry16Controller.cs" />
<Compile Include="Crestron IO\Cards\C3Ry8Controller.cs" />
<Compile Include="Crestron IO\Cards\CenCi31Controller.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Crestron IO\Cards\CenCi33Controller.cs" />
<Compile Include="Crestron IO\Cards\InternalCardCageController.cs" />
<Compile Include="Crestron IO\Inputs\CenIoDigIn104Controller.cs" />
<Compile Include="Crestron IO\Inputs\GenericDigitalInputDevice.cs" />
<Compile Include="Crestron IO\Inputs\GenericVersiportInputDevice.cs" />

View File

@@ -158,7 +158,14 @@ namespace PepperDash.Essentials.Core
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<Hrxxx0WirelessRemoteControllerJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
if (bridge != null)
{
bridge.AddJoinMap(Key, joinMap);
}
else
{
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
}
//List<string> ExcludedKeys = new List<string>();
foreach (var feedback in Feedbacks)

View File

@@ -114,7 +114,14 @@ namespace PepperDash.Essentials.DM.AirMedia
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<AirMediaControllerJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
if (bridge != null)
{
bridge.AddJoinMap(Key, joinMap);
}
else
{
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
}
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
Debug.Console(0, "Linking to Airmedia: {0}", Name);

View File

@@ -590,7 +590,14 @@ namespace PepperDash.Essentials.DM {
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<DmBladeChassisControllerJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
if (bridge != null)
{
bridge.AddJoinMap(Key, joinMap);
}
else
{
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
}
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));

View File

@@ -1112,7 +1112,14 @@ namespace PepperDash.Essentials.DM
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<DmChassisControllerJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
if (bridge != null)
{
bridge.AddJoinMap(Key, joinMap);
}
else
{
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
}
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));

View File

@@ -111,7 +111,14 @@ namespace PepperDash.Essentials.DM
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<DmpsAudioOutputControllerJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
if (bridge != null)
{
bridge.AddJoinMap(Key, joinMap);
}
else
{
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
}
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));

View File

@@ -163,7 +163,14 @@ namespace PepperDash.Essentials.DM
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<DmpsRoutingControllerJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
if (bridge != null)
{
bridge.AddJoinMap(Key, joinMap);
}
else
{
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
}
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));

View File

@@ -262,7 +262,14 @@ namespace PepperDash.Essentials.DM.Chassis
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<HdMdNxM4kEControllerJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
if (bridge != null)
{
bridge.AddJoinMap(Key, joinMap);
}
else
{
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
}
IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
DeviceNameFeedback[this.Name].LinkInputSig(trilist.StringInput[joinMap.Name.JoinNumber]);

View File

@@ -230,7 +230,14 @@ namespace PepperDash.Essentials.DM
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<HdMdxxxCEControllerJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
if (bridge != null)
{
bridge.AddJoinMap(Key, joinMap);
}
else
{
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
}
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));

View File

@@ -42,7 +42,14 @@ namespace PepperDash.Essentials.DM
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<DmRmcControllerJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
if (bridge != null)
{
bridge.AddJoinMap(Key, joinMap);
}
else
{
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
}
Debug.Console(1, rmc, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));

View File

@@ -206,6 +206,15 @@ namespace PepperDash.Essentials.DM
protected void LinkDmTxToApi(DmTxControllerBase tx, BasicTriList trilist, DmTxControllerJoinMap joinMap, EiscApiAdvanced bridge)
{
if (bridge != null)
{
bridge.AddJoinMap(Key, joinMap);
}
else
{
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
}
Debug.Console(1, tx, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
tx.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);

View File

@@ -83,8 +83,14 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
{
CameraControllerJoinMap joinMap = new CameraControllerJoinMap(joinStart);
// Adds the join map to the bridge
bridge.AddJoinMap(cameraDevice.Key, joinMap);
if (bridge != null)
{
bridge.AddJoinMap(Key, joinMap);
}
else
{
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
}
var customJoins = JoinMapHelper.TryGetJoinMapAdvancedForDevice(joinMapKey);

View File

@@ -447,7 +447,14 @@ namespace PepperDash.Essentials.Devices.Common.Occupancy
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<CenOdtOccupancySensorBaseJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
if (bridge != null)
{
bridge.AddJoinMap(Key, joinMap);
}
else
{
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
}
Debug.Console(1, occController, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));

View File

@@ -268,7 +268,14 @@ namespace PepperDash.Essentials.Devices.Common.Occupancy
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<GlsOccupancySensorBaseJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
if (bridge != null)
{
bridge.AddJoinMap(Key, joinMap);
}
else
{
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
}
Debug.Console(1, occController, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
@@ -379,25 +386,13 @@ namespace PepperDash.Essentials.Devices.Common.Occupancy
{
Debug.Console(1, "Factory Attempting to create new GlsOccupancySensorBaseController Device");
var typeName = dc.Type.ToLower();
var key = dc.Key;
var name = dc.Name;
var comm = CommFactory.GetControlPropertiesConfig(dc);
GlsOccupancySensorBase occSensor = null;
occSensor = new GlsOirCCn(comm.CresnetIdInt, Global.ControlSystem);
if (occSensor != null)
{
return new GlsOccupancySensorBaseController(key, name, occSensor);
}
else
{
Debug.Console(0, "ERROR: Unable to create Occupancy Sensor Device. Key: '{0}'", key);
return null;
}
GlsOccupancySensorBase occSensor = new GlsOirCCn(comm.CresnetIdInt, Global.ControlSystem);
return new GlsOccupancySensorBaseController(key, name, occSensor);
}
}

View File

@@ -380,7 +380,14 @@ namespace PepperDash.Essentials.Devices.Common
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<SetTopBoxControllerJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
if (bridge != null)
{
bridge.AddJoinMap(Key, joinMap);
}
else
{
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
}
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
Debug.Console(0, "Linking to Display: {0}", Name);

View File

@@ -153,7 +153,14 @@ namespace PepperDash.Essentials.Devices.Common
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<AppleTvJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
if (bridge != null)
{
bridge.AddJoinMap(Key, joinMap);
}
else
{
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
}
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
Debug.Console(0, "Linking to Bridge Type {0}", GetType().Name);