custom fusion joinmap working. updates to hotfix PD.Core build

This commit is contained in:
Neil Dorin
2021-01-21 16:46:21 -07:00
parent 52494ca13e
commit 9d354fb0ed
7 changed files with 255 additions and 230 deletions

View File

@@ -438,12 +438,17 @@ namespace PepperDash.Essentials
// default to no join map key // default to no join map key
string fusionJoinMapKey = string.Empty; string fusionJoinMapKey = string.Empty;
var fusionConfig = room.Config.Properties["fusion"].ToObject<EssentialsRoomFusionConfig>(); if (room.Config.Properties["fusion"] != null)
if (fusionConfig != null)
{ {
fusionIpId = fusionConfig.IpIdInt; Debug.Console(2, "Custom Fusion config found. Using custom values");
fusionJoinMapKey = fusionConfig.JoinMapKey;
var fusionConfig = room.Config.Properties["fusion"].ToObject<EssentialsRoomFusionConfig>();
if (fusionConfig != null)
{
fusionIpId = fusionConfig.IpIdInt;
fusionJoinMapKey = fusionConfig.JoinMapKey;
}
} }
if (room is EssentialsHuddleSpaceRoom) if (room is EssentialsHuddleSpaceRoom)

View File

@@ -55,25 +55,25 @@ namespace PepperDash.Essentials.Fusion
// Map FusionRoom Attributes: // Map FusionRoom Attributes:
// Codec volume // Codec volume
var codecVolume = FusionRoom.CreateOffsetUshortSig(JoinMap.VolumeFader1.JoinNumber, JoinMap.VolumeFader1.Metadata.Description, eSigIoMask.InputOutputSig); var codecVolume = FusionRoom.CreateOffsetUshortSig(JoinMap.VolumeFader1.JoinNumber, JoinMap.VolumeFader1.AttributeName, eSigIoMask.InputOutputSig);
codecVolume.OutputSig.UserObject = new Action<ushort>(b => (codec as IBasicVolumeWithFeedback).SetVolume(b)); codecVolume.OutputSig.UserObject = new Action<ushort>(b => (codec as IBasicVolumeWithFeedback).SetVolume(b));
(codec as IBasicVolumeWithFeedback).VolumeLevelFeedback.LinkInputSig(codecVolume.InputSig); (codec as IBasicVolumeWithFeedback).VolumeLevelFeedback.LinkInputSig(codecVolume.InputSig);
// In Call Status // In Call Status
CodecIsInCall = FusionRoom.CreateOffsetBoolSig(JoinMap.VcCodecInCall.JoinNumber, JoinMap.VcCodecInCall.Metadata.Description, eSigIoMask.InputSigOnly); CodecIsInCall = FusionRoom.CreateOffsetBoolSig(JoinMap.VcCodecInCall.JoinNumber, JoinMap.VcCodecInCall.AttributeName, eSigIoMask.InputSigOnly);
codec.CallStatusChange += new EventHandler<PepperDash.Essentials.Devices.Common.Codec.CodecCallStatusItemChangeEventArgs>(codec_CallStatusChange); codec.CallStatusChange += new EventHandler<PepperDash.Essentials.Devices.Common.Codec.CodecCallStatusItemChangeEventArgs>(codec_CallStatusChange);
// Online status // Online status
if (codec is ICommunicationMonitor) if (codec is ICommunicationMonitor)
{ {
var c = codec as ICommunicationMonitor; var c = codec as ICommunicationMonitor;
var codecOnline = FusionRoom.CreateOffsetBoolSig(JoinMap.VcCodecOnline.JoinNumber, JoinMap.VcCodecOnline.Metadata.Description, eSigIoMask.InputSigOnly); var codecOnline = FusionRoom.CreateOffsetBoolSig(JoinMap.VcCodecOnline.JoinNumber, JoinMap.VcCodecOnline.AttributeName, eSigIoMask.InputSigOnly);
codecOnline.InputSig.BoolValue = c.CommunicationMonitor.Status == MonitorStatus.IsOk; codecOnline.InputSig.BoolValue = c.CommunicationMonitor.Status == MonitorStatus.IsOk;
c.CommunicationMonitor.StatusChange += (o, a) => c.CommunicationMonitor.StatusChange += (o, a) =>
{ {
codecOnline.InputSig.BoolValue = a.Status == MonitorStatus.IsOk; codecOnline.InputSig.BoolValue = a.Status == MonitorStatus.IsOk;
}; };
Debug.Console(0, this, "Linking '{0}' communication monitor to Fusion '{1}'", codec.Key, JoinMap.VcCodecOnline.Metadata.Description); Debug.Console(0, this, "Linking '{0}' communication monitor to Fusion '{1}'", codec.Key, JoinMap.VcCodecOnline.AttributeName);
} }
// Codec IP Address // Codec IP Address
@@ -101,10 +101,10 @@ namespace PepperDash.Essentials.Fusion
if (codecHasIpInfo) if (codecHasIpInfo)
{ {
codecIpAddressSig = FusionRoom.CreateOffsetStringSig(JoinMap.VcCodecIpAddress.JoinNumber, JoinMap.VcCodecIpAddress.Metadata.Description, eSigIoMask.InputSigOnly); codecIpAddressSig = FusionRoom.CreateOffsetStringSig(JoinMap.VcCodecIpAddress.JoinNumber, JoinMap.VcCodecIpAddress.AttributeName, eSigIoMask.InputSigOnly);
codecIpAddressSig.InputSig.StringValue = codecIpAddress; codecIpAddressSig.InputSig.StringValue = codecIpAddress;
codecIpPortSig = FusionRoom.CreateOffsetStringSig(JoinMap.VcCodecIpPort.JoinNumber, JoinMap.VcCodecIpPort.Metadata.Description, eSigIoMask.InputSigOnly); codecIpPortSig = FusionRoom.CreateOffsetStringSig(JoinMap.VcCodecIpPort.JoinNumber, JoinMap.VcCodecIpPort.AttributeName, eSigIoMask.InputSigOnly);
codecIpPortSig.InputSig.StringValue = codecIpPort.ToString(); codecIpPortSig.InputSig.StringValue = codecIpPort.ToString();
} }
@@ -172,7 +172,7 @@ namespace PepperDash.Essentials.Fusion
Room.OnFeedback.LinkInputSig(FusionRoom.SystemPowerOn.InputSig); Room.OnFeedback.LinkInputSig(FusionRoom.SystemPowerOn.InputSig);
// Moved to // Moved to
CurrentRoomSourceNameSig = FusionRoom.CreateOffsetStringSig(JoinMap.Display1CurrentSourceName.JoinNumber, JoinMap.Display1CurrentSourceName.Metadata.Description, eSigIoMask.InputSigOnly); CurrentRoomSourceNameSig = FusionRoom.CreateOffsetStringSig(JoinMap.Display1CurrentSourceName.JoinNumber, JoinMap.Display1CurrentSourceName.AttributeName, eSigIoMask.InputSigOnly);
// Don't think we need to get current status of this as nothing should be alive yet. // Don't think we need to get current status of this as nothing should be alive yet.
(Room as EssentialsHuddleVtc1Room).CurrentSourceChange += Room_CurrentSourceInfoChange; (Room as EssentialsHuddleVtc1Room).CurrentSourceChange += Room_CurrentSourceInfoChange;
@@ -196,7 +196,7 @@ namespace PepperDash.Essentials.Fusion
uint i = 1; uint i = 1;
foreach (var kvp in setTopBoxes) foreach (var kvp in setTopBoxes)
{ {
TryAddRouteActionSigs(JoinMap.Display1DiscPlayerSourceStart.Metadata.Description + " " + i, JoinMap.Display1DiscPlayerSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice); TryAddRouteActionSigs(JoinMap.Display1DiscPlayerSourceStart.AttributeName + " " + i, JoinMap.Display1DiscPlayerSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
i++; i++;
if (i > JoinMap.Display1SetTopBoxSourceStart.JoinSpan) // We only have five spots if (i > JoinMap.Display1SetTopBoxSourceStart.JoinSpan) // We only have five spots
break; break;
@@ -206,7 +206,7 @@ namespace PepperDash.Essentials.Fusion
i = 1; i = 1;
foreach (var kvp in discPlayers) foreach (var kvp in discPlayers)
{ {
TryAddRouteActionSigs(JoinMap.Display1DiscPlayerSourceStart.Metadata.Description + " " + i, JoinMap.Display1DiscPlayerSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice); TryAddRouteActionSigs(JoinMap.Display1DiscPlayerSourceStart.AttributeName + " " + i, JoinMap.Display1DiscPlayerSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
i++; i++;
if (i > 5) // We only have five spots if (i > 5) // We only have five spots
break; break;
@@ -216,7 +216,7 @@ namespace PepperDash.Essentials.Fusion
i = 1; i = 1;
foreach (var kvp in laptops) foreach (var kvp in laptops)
{ {
TryAddRouteActionSigs(JoinMap.Display1LaptopSourceStart.Metadata.Description + " " + i, JoinMap.Display1LaptopSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice); TryAddRouteActionSigs(JoinMap.Display1LaptopSourceStart.AttributeName + " " + i, JoinMap.Display1LaptopSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
i++; i++;
if (i > JoinMap.Display1LaptopSourceStart.JoinSpan) // We only have ten spots??? if (i > JoinMap.Display1LaptopSourceStart.JoinSpan) // We only have ten spots???
break; break;

View File

@@ -29,7 +29,7 @@ namespace PepperDash.Essentials.Core.Config
public List<TieLineConfig> TieLines { get; set; } public List<TieLineConfig> TieLines { get; set; }
[JsonProperty("joinMaps")] [JsonProperty("joinMaps")]
public Dictionary<string, JToken> JoinMaps { get; set; } public Dictionary<string, JObject> JoinMaps { get; set; }
/// <summary> /// <summary>
/// Checks SourceLists for a given list and returns it if found. Otherwise, returns null /// Checks SourceLists for a given list and returns it if found. Otherwise, returns null

View File

@@ -1,195 +1,195 @@
using System; using System;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronIO; using Crestron.SimplSharp.CrestronIO;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Core.Config; using PepperDash.Core.Config;
namespace PepperDash.Essentials.Core.Config namespace PepperDash.Essentials.Core.Config
{ {
/// <summary> /// <summary>
/// Loads the ConfigObject from the file /// Loads the ConfigObject from the file
/// </summary> /// </summary>
public class ConfigReader public class ConfigReader
{ {
public const string LocalConfigPresent = public const string LocalConfigPresent =
@" @"
*************************************************** ***************************************************
************* Using Local config file ************* ************* Using Local config file *************
***************************************************"; ***************************************************";
public static EssentialsConfig ConfigObject { get; private set; } public static EssentialsConfig ConfigObject { get; private set; }
public static bool LoadConfig2() public static bool LoadConfig2()
{ {
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loading unmerged system/template portal configuration file."); Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loading unmerged system/template portal configuration file.");
try try
{ {
// Check for local config file first // Check for local config file first
var filePath = Global.FilePathPrefix + ConfigWriter.LocalConfigFolder + Global.DirectorySeparator + Global.ConfigFileName; var filePath = Global.FilePathPrefix + ConfigWriter.LocalConfigFolder + Global.DirectorySeparator + Global.ConfigFileName;
bool localConfigFound = false; bool localConfigFound = false;
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to load Local config file: '{0}'", filePath); Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to load Local config file: '{0}'", filePath);
// Check for local config directory first // Check for local config directory first
var configFiles = GetConfigFiles(filePath); var configFiles = GetConfigFiles(filePath);
if (configFiles != null) if (configFiles != null)
{ {
if (configFiles.Length > 1) if (configFiles.Length > 1)
{ {
Debug.Console(0, Debug.ErrorLogLevel.Error, Debug.Console(0, Debug.ErrorLogLevel.Error,
"****Error: Multiple Local Configuration files present. Please ensure only a single file exists and reset program.****"); "****Error: Multiple Local Configuration files present. Please ensure only a single file exists and reset program.****");
return false; return false;
} }
if(configFiles.Length == 1) if(configFiles.Length == 1)
{ {
localConfigFound = true; localConfigFound = true;
} }
} }
else else
{ {
Debug.Console(0, Debug.ErrorLogLevel.Notice, Debug.Console(0, Debug.ErrorLogLevel.Notice,
"Local Configuration file not present.", filePath); "Local Configuration file not present.", filePath);
} }
// Check for Portal Config // Check for Portal Config
if(!localConfigFound) if(!localConfigFound)
{ {
filePath = Global.FilePathPrefix + Global.ConfigFileName; filePath = Global.FilePathPrefix + Global.ConfigFileName;
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to load Portal config file: '{0}'", filePath); Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to load Portal config file: '{0}'", filePath);
configFiles = GetConfigFiles(filePath); configFiles = GetConfigFiles(filePath);
if (configFiles != null) if (configFiles != null)
{ {
Debug.Console(2, "{0} config files found matching pattern", configFiles.Length); Debug.Console(2, "{0} config files found matching pattern", configFiles.Length);
if (configFiles.Length > 1) if (configFiles.Length > 1)
{ {
Debug.Console(0, Debug.ErrorLogLevel.Error, Debug.Console(0, Debug.ErrorLogLevel.Error,
"****Error: Multiple Portal Configuration files present. Please ensure only a single file exists and reset program.****"); "****Error: Multiple Portal Configuration files present. Please ensure only a single file exists and reset program.****");
return false; return false;
} }
else if (configFiles.Length == 1) else if (configFiles.Length == 1)
{ {
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Found Portal config file: '{0}'", filePath); Debug.Console(0, Debug.ErrorLogLevel.Notice, "Found Portal config file: '{0}'", filePath);
} }
else else
{ {
Debug.Console(0, Debug.ErrorLogLevel.Notice, "No config file found."); Debug.Console(0, Debug.ErrorLogLevel.Notice, "No config file found.");
return false; return false;
} }
} }
else else
{ {
Debug.Console(0, Debug.ErrorLogLevel.Error, Debug.Console(0, Debug.ErrorLogLevel.Error,
"ERROR: Portal Configuration file not present. Please load file and reset program."); "ERROR: Portal Configuration file not present. Please load file and reset program.");
return false; return false;
} }
} }
// Get the actual file path // Get the actual file path
filePath = configFiles[0].FullName; filePath = configFiles[0].FullName;
// Generate debug statement if using a local file. // Generate debug statement if using a local file.
if (localConfigFound) if (localConfigFound)
{ {
GetLocalFileMessage(filePath); GetLocalFileMessage(filePath);
} }
// Read the file // Read the file
using (StreamReader fs = new StreamReader(filePath)) using (StreamReader fs = new StreamReader(filePath))
{ {
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loading config file: '{0}'", filePath); Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loading config file: '{0}'", filePath);
if (localConfigFound) if (localConfigFound)
{ {
ConfigObject = JObject.Parse(fs.ReadToEnd()).ToObject<EssentialsConfig>(); ConfigObject = JObject.Parse(fs.ReadToEnd()).ToObject<EssentialsConfig>();
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Successfully Loaded Local Config"); Debug.Console(0, Debug.ErrorLogLevel.Notice, "Successfully Loaded Local Config");
return true; return true;
} }
else else
{ {
var doubleObj = JObject.Parse(fs.ReadToEnd()); var doubleObj = JObject.Parse(fs.ReadToEnd());
ConfigObject = PortalConfigReader.MergeConfigs(doubleObj).ToObject<EssentialsConfig>(); ConfigObject = PortalConfigReader.MergeConfigs(doubleObj).ToObject<EssentialsConfig>();
// Extract SystemUrl and TemplateUrl into final config output // Extract SystemUrl and TemplateUrl into final config output
if (doubleObj["system_url"] != null) if (doubleObj["system_url"] != null)
{ {
ConfigObject.SystemUrl = doubleObj["system_url"].Value<string>(); ConfigObject.SystemUrl = doubleObj["system_url"].Value<string>();
} }
if (doubleObj["template_url"] != null) if (doubleObj["template_url"] != null)
{ {
ConfigObject.TemplateUrl = doubleObj["template_url"].Value<string>(); ConfigObject.TemplateUrl = doubleObj["template_url"].Value<string>();
} }
} }
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Successfully Loaded Merged Config"); Debug.Console(0, Debug.ErrorLogLevel.Notice, "Successfully Loaded Merged Config");
return true; return true;
} }
} }
catch (Exception e) catch (Exception e)
{ {
Debug.Console(0, Debug.ErrorLogLevel.Error, "ERROR: Config load failed: \r{0}", e); Debug.Console(0, Debug.ErrorLogLevel.Error, "ERROR: Config load failed: \r{0}", e);
return false; return false;
} }
} }
/// <summary> /// <summary>
/// Returns all the files from the directory specified. /// Returns all the files from the directory specified.
/// </summary> /// </summary>
/// <param name="filePath"></param> /// <param name="filePath"></param>
/// <returns></returns> /// <returns></returns>
public static FileInfo[] GetConfigFiles(string filePath) public static FileInfo[] GetConfigFiles(string filePath)
{ {
// Get the directory // Get the directory
var dir = Path.GetDirectoryName(filePath); var dir = Path.GetDirectoryName(filePath);
if (Directory.Exists(dir)) if (Directory.Exists(dir))
{ {
Debug.Console(1, "Searching in Directory '{0}'", dir); Debug.Console(1, "Searching in Directory '{0}'", dir);
// Get the directory info // Get the directory info
var dirInfo = new DirectoryInfo(dir); var dirInfo = new DirectoryInfo(dir);
// Get the file name // Get the file name
var fileName = Path.GetFileName(filePath); var fileName = Path.GetFileName(filePath);
Debug.Console(1, "For Config Files matching: '{0}'", fileName); Debug.Console(1, "For Config Files matching: '{0}'", fileName);
// Get the files that match from the directory // Get the files that match from the directory
return dirInfo.GetFiles(fileName); return dirInfo.GetFiles(fileName);
} }
else else
{ {
Debug.Console(0, Debug.ErrorLogLevel.Notice, Debug.Console(0, Debug.ErrorLogLevel.Notice,
"Directory not found: ", dir); "Directory not found: ", dir);
return null; return null;
} }
} }
/// <summary> /// <summary>
/// Returns the group for a given device key in config /// Returns the group for a given device key in config
/// </summary> /// </summary>
/// <param name="key"></param> /// <param name="key"></param>
/// <returns></returns> /// <returns></returns>
public static string GetGroupForDeviceKey(string key) public static string GetGroupForDeviceKey(string key)
{ {
var dev = ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(key, StringComparison.OrdinalIgnoreCase)); var dev = ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(key, StringComparison.OrdinalIgnoreCase));
return dev == null ? null : dev.Group; return dev == null ? null : dev.Group;
} }
private static void GetLocalFileMessage(string filePath) private static void GetLocalFileMessage(string filePath)
@@ -248,7 +248,7 @@ namespace PepperDash.Essentials.Core.Config
Debug.Console(2, Debug.ErrorLogLevel.Notice, "Found Local config file: '{0}'", filePath); Debug.Console(2, Debug.ErrorLogLevel.Notice, "Found Local config file: '{0}'", filePath);
Debug.Console(0, newDebugString.ToString()); Debug.Console(0, newDebugString.ToString());
} }
} }
} }

View File

@@ -98,7 +98,10 @@ namespace PepperDash.Essentials.Core.Fusion
if (!string.IsNullOrEmpty(joinMapKey)) if (!string.IsNullOrEmpty(joinMapKey))
{ {
var customJoins = JoinMapHelper.TryGetJoinMapAdvancedForDevice(joinMapKey); var customJoins = JoinMapHelper.TryGetJoinMapAdvancedForDevice(joinMapKey);
JoinMap.SetCustomJoinData(customJoins); if (customJoins != null)
{
JoinMap.SetCustomJoinData(customJoins);
}
} }
Room = room; Room = room;
@@ -339,7 +342,7 @@ namespace PepperDash.Essentials.Core.Fusion
Room.OnFeedback.LinkInputSig(FusionRoom.SystemPowerOn.InputSig); Room.OnFeedback.LinkInputSig(FusionRoom.SystemPowerOn.InputSig);
// Moved to // Moved to
CurrentRoomSourceNameSig = FusionRoom.CreateOffsetStringSig(JoinMap.Display1CurrentSourceName.JoinNumber, JoinMap.Display1CurrentSourceName.Metadata.Description, CurrentRoomSourceNameSig = FusionRoom.CreateOffsetStringSig(JoinMap.Display1CurrentSourceName.JoinNumber, JoinMap.Display1CurrentSourceName.AttributeName,
eSigIoMask.InputSigOnly); eSigIoMask.InputSigOnly);
// Don't think we need to get current status of this as nothing should be alive yet. // Don't think we need to get current status of this as nothing should be alive yet.
var hasCurrentSourceInfoChange = Room as IHasCurrentSourceInfoChange; var hasCurrentSourceInfoChange = Room as IHasCurrentSourceInfoChange;
@@ -389,24 +392,24 @@ namespace PepperDash.Essentials.Core.Fusion
var response = string.Empty; var response = string.Empty;
var systemReboot = FusionRoom.CreateOffsetBoolSig(JoinMap.ProcessorReboot.JoinNumber, JoinMap.ProcessorReboot.Metadata.Description, eSigIoMask.OutputSigOnly); var systemReboot = FusionRoom.CreateOffsetBoolSig(JoinMap.ProcessorReboot.JoinNumber, JoinMap.ProcessorReboot.AttributeName, eSigIoMask.OutputSigOnly);
systemReboot.OutputSig.SetSigFalseAction( systemReboot.OutputSig.SetSigFalseAction(
() => CrestronConsole.SendControlSystemCommand("reboot", ref response)); () => CrestronConsole.SendControlSystemCommand("reboot", ref response));
} }
protected void SetUpEthernetValues() protected void SetUpEthernetValues()
{ {
_ip1 = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorIp1.JoinNumber, JoinMap.ProcessorIp1.Metadata.Description, eSigIoMask.InputSigOnly); _ip1 = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorIp1.JoinNumber, JoinMap.ProcessorIp1.AttributeName, eSigIoMask.InputSigOnly);
_ip2 = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorIp2.JoinNumber, JoinMap.ProcessorIp2.Metadata.Description, eSigIoMask.InputSigOnly); _ip2 = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorIp2.JoinNumber, JoinMap.ProcessorIp2.AttributeName, eSigIoMask.InputSigOnly);
_gateway = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorGateway.JoinNumber, JoinMap.ProcessorGateway.Metadata.Description, eSigIoMask.InputSigOnly); _gateway = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorGateway.JoinNumber, JoinMap.ProcessorGateway.AttributeName, eSigIoMask.InputSigOnly);
_hostname = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorHostname.JoinNumber, JoinMap.ProcessorHostname.Metadata.Description, eSigIoMask.InputSigOnly); _hostname = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorHostname.JoinNumber, JoinMap.ProcessorHostname.AttributeName, eSigIoMask.InputSigOnly);
_domain = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorDomain.JoinNumber, JoinMap.ProcessorDomain.Metadata.Description, eSigIoMask.InputSigOnly); _domain = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorDomain.JoinNumber, JoinMap.ProcessorDomain.AttributeName, eSigIoMask.InputSigOnly);
_dns1 = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorDns1.JoinNumber, JoinMap.ProcessorDns1.Metadata.Description, eSigIoMask.InputSigOnly); _dns1 = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorDns1.JoinNumber, JoinMap.ProcessorDns1.AttributeName, eSigIoMask.InputSigOnly);
_dns2 = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorDns2.JoinNumber, JoinMap.ProcessorDns2.Metadata.Description, eSigIoMask.InputSigOnly); _dns2 = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorDns2.JoinNumber, JoinMap.ProcessorDns2.AttributeName, eSigIoMask.InputSigOnly);
_mac1 = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorMac1.JoinNumber, JoinMap.ProcessorMac1.Metadata.Description, eSigIoMask.InputSigOnly); _mac1 = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorMac1.JoinNumber, JoinMap.ProcessorMac1.AttributeName, eSigIoMask.InputSigOnly);
_mac2 = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorMac2.JoinNumber, JoinMap.ProcessorMac2.Metadata.Description, eSigIoMask.InputSigOnly); _mac2 = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorMac2.JoinNumber, JoinMap.ProcessorMac2.AttributeName, eSigIoMask.InputSigOnly);
_netMask1 = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorNetMask1.JoinNumber, JoinMap.ProcessorNetMask1.Metadata.Description, eSigIoMask.InputSigOnly); _netMask1 = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorNetMask1.JoinNumber, JoinMap.ProcessorNetMask1.AttributeName, eSigIoMask.InputSigOnly);
_netMask2 = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorNetMask2.JoinNumber, JoinMap.ProcessorNetMask2.Metadata.Description, eSigIoMask.InputSigOnly); _netMask2 = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorNetMask2.JoinNumber, JoinMap.ProcessorNetMask2.AttributeName, eSigIoMask.InputSigOnly);
} }
protected void GetProcessorEthernetValues() protected void GetProcessorEthernetValues()
@@ -459,7 +462,7 @@ namespace PepperDash.Essentials.Core.Fusion
protected void GetProcessorInfo() protected void GetProcessorInfo()
{ {
_firmware = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorFirmware.JoinNumber, JoinMap.ProcessorFirmware.Metadata.Description, eSigIoMask.InputSigOnly); _firmware = FusionRoom.CreateOffsetStringSig(JoinMap.ProcessorFirmware.JoinNumber, JoinMap.ProcessorFirmware.AttributeName, eSigIoMask.InputSigOnly);
if (CrestronEnvironment.DevicePlatform != eDevicePlatform.Server) if (CrestronEnvironment.DevicePlatform != eDevicePlatform.Server)
{ {
@@ -468,7 +471,7 @@ namespace PepperDash.Essentials.Core.Fusion
var join = JoinMap.ProgramNameStart.JoinNumber + i; var join = JoinMap.ProgramNameStart.JoinNumber + i;
var progNum = i + 1; var progNum = i + 1;
_program[i] = FusionRoom.CreateOffsetStringSig((uint) join, _program[i] = FusionRoom.CreateOffsetStringSig((uint) join,
string.Format("{0} {1}", JoinMap.ProgramNameStart.Metadata.Description, progNum), eSigIoMask.InputSigOnly); string.Format("{0} {1}", JoinMap.ProgramNameStart.AttributeName, progNum), eSigIoMask.InputSigOnly);
} }
} }
@@ -1046,7 +1049,7 @@ namespace PepperDash.Essentials.Core.Fusion
uint i = 1; uint i = 1;
foreach (var kvp in setTopBoxes) foreach (var kvp in setTopBoxes)
{ {
TryAddRouteActionSigs(JoinMap.Display1SetTopBoxSourceStart.Metadata.Description + " " + i, JoinMap.Display1SetTopBoxSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice); TryAddRouteActionSigs(JoinMap.Display1SetTopBoxSourceStart.AttributeName + " " + i, JoinMap.Display1SetTopBoxSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
i++; i++;
if (i > JoinMap.Display1SetTopBoxSourceStart.JoinSpan) // We only have five spots if (i > JoinMap.Display1SetTopBoxSourceStart.JoinSpan) // We only have five spots
{ {
@@ -1058,7 +1061,7 @@ namespace PepperDash.Essentials.Core.Fusion
i = 1; i = 1;
foreach (var kvp in discPlayers) foreach (var kvp in discPlayers)
{ {
TryAddRouteActionSigs(JoinMap.Display1DiscPlayerSourceStart.Metadata.Description + " " + i, JoinMap.Display1DiscPlayerSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice); TryAddRouteActionSigs(JoinMap.Display1DiscPlayerSourceStart.AttributeName + " " + i, JoinMap.Display1DiscPlayerSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
i++; i++;
if (i > JoinMap.Display1DiscPlayerSourceStart.JoinSpan) // We only have five spots if (i > JoinMap.Display1DiscPlayerSourceStart.JoinSpan) // We only have five spots
{ {
@@ -1070,7 +1073,7 @@ namespace PepperDash.Essentials.Core.Fusion
i = 1; i = 1;
foreach (var kvp in laptops) foreach (var kvp in laptops)
{ {
TryAddRouteActionSigs(JoinMap.Display1LaptopSourceStart.Metadata.Description + " " + i, JoinMap.Display1LaptopSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice); TryAddRouteActionSigs(JoinMap.Display1LaptopSourceStart.AttributeName + " " + i, JoinMap.Display1LaptopSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
i++; i++;
if (i > JoinMap.Display1LaptopSourceStart.JoinSpan) // We only have ten spots??? if (i > JoinMap.Display1LaptopSourceStart.JoinSpan) // We only have ten spots???
{ {
@@ -1199,7 +1202,7 @@ namespace PepperDash.Essentials.Core.Fusion
{ {
continue; continue;
} }
attrName = JoinMap.XpanelOnlineStart.Metadata.Description + " " + attrNum; attrName = JoinMap.XpanelOnlineStart.AttributeName + " " + attrNum;
attrNum += JoinMap.XpanelOnlineStart.JoinNumber; attrNum += JoinMap.XpanelOnlineStart.JoinNumber;
touchpanelNum++; touchpanelNum++;
@@ -1212,7 +1215,7 @@ namespace PepperDash.Essentials.Core.Fusion
{ {
continue; continue;
} }
attrName = JoinMap.TouchpanelOnlineStart.Metadata.Description + " " + attrNum; attrName = JoinMap.TouchpanelOnlineStart.AttributeName + " " + attrNum;
attrNum += JoinMap.TouchpanelOnlineStart.JoinNumber; attrNum += JoinMap.TouchpanelOnlineStart.JoinNumber;
xpanelNum++; xpanelNum++;
@@ -1227,7 +1230,7 @@ namespace PepperDash.Essentials.Core.Fusion
{ {
continue; continue;
} }
attrName = JoinMap.DisplayOnlineStart.Metadata.Description + " " + attrNum; attrName = JoinMap.DisplayOnlineStart.AttributeName + " " + attrNum;
attrNum += JoinMap.DisplayOnlineStart.JoinNumber; attrNum += JoinMap.DisplayOnlineStart.JoinNumber;
displayNum++; displayNum++;
@@ -1372,7 +1375,7 @@ namespace PepperDash.Essentials.Core.Fusion
return; return;
} }
// Display volume // Display volume
var defaultDisplayVolume = FusionRoom.CreateOffsetUshortSig(JoinMap.VolumeFader1.JoinNumber, JoinMap.VolumeFader1.Metadata.Description, var defaultDisplayVolume = FusionRoom.CreateOffsetUshortSig(JoinMap.VolumeFader1.JoinNumber, JoinMap.VolumeFader1.AttributeName,
eSigIoMask.InputOutputSig); eSigIoMask.InputOutputSig);
defaultDisplayVolume.OutputSig.UserObject = new Action<ushort>(b => defaultDisplayVolume.OutputSig.UserObject = new Action<ushort>(b =>
{ {

View File

@@ -45,16 +45,33 @@ namespace PepperDash.Essentials.Core
/// <returns></returns> /// <returns></returns>
public static Dictionary<string, JoinData> TryGetJoinMapAdvancedForDevice(string joinMapKey) public static Dictionary<string, JoinData> TryGetJoinMapAdvancedForDevice(string joinMapKey)
{ {
if (string.IsNullOrEmpty(joinMapKey)) try
{
if (string.IsNullOrEmpty(joinMapKey))
return null;
if (!ConfigReader.ConfigObject.JoinMaps.ContainsKey(joinMapKey))
{
Debug.Console(2, "No Join Map found in config with key: '{0}'", joinMapKey);
return null;
}
Debug.Console(2, "Attempting to load custom join map with key: {0}", joinMapKey);
var joinMapJToken = ConfigReader.ConfigObject.JoinMaps[joinMapKey];
if (joinMapJToken == null)
return null;
var joinMapData = joinMapJToken.ToObject<Dictionary<string, JoinData>>();
return joinMapData;
}
catch (Exception e)
{
Debug.Console(2, "Error getting join map for key: '{0}'. Error: {1}", joinMapKey, e);
return null; return null;
}
var joinMapJToken = ConfigReader.ConfigObject.JoinMaps[joinMapKey];
if (joinMapJToken == null) return null;
var joinMapData = joinMapJToken.ToObject<Dictionary<string, JoinData>>();
return joinMapData;
} }
} }
@@ -266,7 +283,7 @@ namespace PepperDash.Essentials.Core
@"Join Number: {0} | JoinSpan: '{1}' | Description: '{2}' | Type: '{3}' | Capabilities: '{4}'", @"Join Number: {0} | JoinSpan: '{1}' | Description: '{2}' | Type: '{3}' | Capabilities: '{4}'",
join.Value.JoinNumber, join.Value.JoinNumber,
join.Value.JoinSpan, join.Value.JoinSpan,
String.IsNullOrEmpty(join.Value.Metadata.Description) ? join.Value.Metadata.Label : join.Value.Metadata.Description, String.IsNullOrEmpty(join.Value.AttributeName) ? join.Value.Metadata.Label : join.Value.AttributeName,
join.Value.Metadata.JoinType.ToString(), join.Value.Metadata.JoinType.ToString(),
join.Value.Metadata.JoinCapabilities.ToString()); join.Value.Metadata.JoinCapabilities.ToString());
} }

View File

@@ -1,3 +1,3 @@
<packages> <packages>
<package id="PepperDashCore" version="1.0.44" targetFramework="net35" allowedVersions="[1.0,1.1)"/> <package id="PepperDashCore" version="1.0.45-hotfix-200" targetFramework="net35" allowedVersions="[1.0,1.1)"/>
</packages> </packages>