Compare commits

..

12 Commits

Author SHA1 Message Date
Neil Dorin
69a7276248 fix: remove unnecessary semicolon and format logging message in RoutingFeedbackManager 2026-03-12 22:21:16 -06:00
Neil Dorin
3762fc120a feat: enhance logging in RoutingFeedbackManager for better debugging 2026-03-12 21:36:21 -06:00
Neil Dorin
165e8c6d34 feat: update IHasDestinationList to IHasDestinations and enhance logging for source resolution 2026-03-12 21:32:20 -06:00
Neil Dorin
6e01173f3b feat: rename IHasDestinationList to IHasDestinations for consistency 2026-03-12 16:19:29 -06:00
Neil Dorin
4810c2d590 feat: restructure IHasDestinationList and IHasSourceList interfaces for clarity 2026-03-12 15:29:26 -06:00
Neil Dorin
7cc1d3fa6a feat: change interface visibility to public for IHasDestinationList and IHasSourceList 2026-03-12 15:25:31 -06:00
Neil Dorin
af913b9498 feat: add IHasDestinationList and IHasSourceList interfaces for room management 2026-03-12 15:12:27 -06:00
Neil Dorin
5a07e837ee feat: implement constructor for BridgeApi with key and name parameters 2026-03-12 14:27:21 -06:00
Andrew Welker
b64f63ac6b Merge pull request #1389 from PepperDash/copilot/fix-crestrononvif-dll-error
fix(hotfix): skip CrestronOnvif.dll during assembly scanning at startup
2026-03-03 12:38:34 -05:00
Nick Genovese
b21be608f0 Update src/PepperDash.Essentials.Core/Factory/DeviceFactory.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-01 14:38:07 -05:00
copilot-swe-agent[bot]
6ab3ed9911 fix(hotfix): skip CrestronOnvif.dll when scanning assemblies at startup
Co-authored-by: ngenovese11 <23391587+ngenovese11@users.noreply.github.com>
2026-03-01 19:27:22 +00:00
copilot-swe-agent[bot]
a9fdf30880 Initial plan 2026-03-01 19:23:14 +00:00
5 changed files with 103 additions and 35 deletions

View File

@@ -30,6 +30,17 @@ namespace PepperDash.Essentials.Core.Bridges
{
}
/// <summary>
/// Constructor
/// </summary>
/// <param name="key"></param>
/// <param name="name"></param>
protected BridgeApi(string key, string name) :
base(key, name)
{
}
}
/// <summary>
@@ -58,7 +69,7 @@ namespace PepperDash.Essentials.Core.Bridges
/// <param name="dc">Device configuration</param>
/// <param name="eisc">EISC instance</param>
public EiscApiAdvanced(DeviceConfig dc, BasicTriList eisc) :
base(dc.Key)
base(dc.Key, dc.Name)
{
JoinMaps = new Dictionary<string, JoinMapBaseAdvanced>();

View File

@@ -36,8 +36,17 @@ namespace PepperDash.Essentials.Core
{
var programAssemblies = Directory.GetFiles(InitialParametersClass.ProgramDirectory.ToString(), "*.dll");
// Assemblies known to cause load errors that should be skipped
var assembliesToSkip = new[] { "CrestronOnvif.dll" };
foreach (var assembly in programAssemblies)
{
if (assembliesToSkip.Any(a => Path.GetFileName(assembly).Equals(a, StringComparison.OrdinalIgnoreCase)))
{
Debug.LogMessage(LogEventLevel.Verbose, "Skipping assembly: {assemblyName}", Path.GetFileName(assembly));
continue;
}
try
{
Assembly.LoadFrom(assembly);

View File

@@ -0,0 +1,16 @@
using System.Collections.Generic;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// Interface for rooms with a list of destinations
/// </summary>
public interface IHasDestinations
{
/// <summary>
/// Gets the dictionary of destinations.
/// </summary>
Dictionary<string, IRoutingSink> Destinations { get; }
}
}

View File

@@ -0,0 +1,15 @@
using System.Collections.Generic;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// Interface for rooms with a list of destinations
/// </summary>
public interface IHasSourceList
{
/// <summary>
/// Gets the list of sources.
/// </summary>
Dictionary<string, SourceListItem> SourceList { get; }
}
}

View File

@@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using PepperDash.Core;
using PepperDash.Core.Logging;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core.Routing
@@ -121,20 +123,16 @@ namespace PepperDash.Essentials.Core.Routing
RoutingInputPort inputPort
)
{
Debug.LogMessage(
Serilog.Events.LogEventLevel.Debug,
this.LogDebug(
"Updating destination {destination} with inputPort {inputPort}",
this,
destination?.Key,
inputPort?.Key
);
if (inputPort == null)
{
Debug.LogMessage(
Serilog.Events.LogEventLevel.Debug,
this.LogDebug(
"Destination {destination} has not reported an input port yet",
this,
destination.Key
);
return;
@@ -152,10 +150,8 @@ namespace PepperDash.Essentials.Core.Routing
if (firstTieLine == null)
{
Debug.LogMessage(
Serilog.Events.LogEventLevel.Debug,
this.LogDebug(
"No tieline found for inputPort {inputPort}. Clearing current source",
this,
inputPort
);
@@ -166,14 +162,14 @@ namespace PepperDash.Essentials.Core.Routing
};
destination.CurrentSourceInfo = tempSourceListItem;
;
destination.CurrentSourceInfoKey = "$transient";
return;
}
}
catch (Exception ex)
{
Debug.LogMessage(ex, "Error getting first tieline: {Exception}", this, ex);
this.LogException(ex, "Error getting first tieline: {Exception}", ex.Message);
return;
}
@@ -186,8 +182,7 @@ namespace PepperDash.Essentials.Core.Routing
if (sourceTieLine == null)
{
Debug.LogMessage(
Serilog.Events.LogEventLevel.Debug,
this.LogDebug(
"No route found to source for inputPort {inputPort}. Clearing current source",
this,
inputPort
@@ -206,7 +201,7 @@ namespace PepperDash.Essentials.Core.Routing
}
catch (Exception ex)
{
Debug.LogMessage(ex, "Error getting sourceTieLine: {Exception}", this, ex);
this.LogException(ex, "Error getting sourceTieLine: {Exception}", ex.Message);
return;
}
@@ -230,47 +225,71 @@ namespace PepperDash.Essentials.Core.Routing
return roomDefaultDisplay.DefaultDisplay.Key == destination.Key;
}
if (r is IHasDestinations roomDestinationList)
{
return roomDestinationList.Destinations.Any(d =>
d.Value.Key == destination.Key
);
}
var destList = ConfigReader.ConfigObject.GetDestinationListForKey(r.DestinationListKey);
return false;
}
);
if (room == null)
{
Debug.LogMessage(
Serilog.Events.LogEventLevel.Debug,
this.LogDebug(
"No room found for display {destination}",
this,
destination.Key
);
return;
}
// Debug.LogMessage(Serilog.Events.LogEventLevel.Verbose, "Found room {room} for destination {destination}", this, room.Key, destination.Key);
this.LogVerbose("Found room {room} for destination {destination}", room.Key, destination.Key);
var sourceList = ConfigReader.ConfigObject.GetSourceListForKey(room.SourceListKey);
Dictionary<string, SourceListItem> sourceList = null;
if (room is IHasSourceList roomWithSourceList)
{
sourceList = roomWithSourceList.SourceList;
}
else
{
sourceList = ConfigReader.ConfigObject.GetSourceListForKey(room.SourceListKey);
}
if (sourceList == null)
{
Debug.LogMessage(
Serilog.Events.LogEventLevel.Debug,
this.LogDebug(
"No source list found for source list key {key}. Unable to find source for tieLine {sourceTieLine}",
this,
room.SourceListKey,
sourceTieLine
);
return;
}
// Debug.LogMessage(Serilog.Events.LogEventLevel.Verbose, "Found sourceList for room {room}", this, room.Key);
this.LogVerbose("Found sourceList for room {room}", room.Key);
if (sourceTieLine.SourcePort?.ParentDevice == null)
{
this.LogDebug(
"********SourcePort or ParentDevice is null for tieLine. Unable to find source for destination {destination}.",
destination.Key
);
return;
}
var sourceListItem = sourceList.FirstOrDefault(sli =>
{
//// Debug.LogMessage(Serilog.Events.LogEventLevel.Verbose,
// "SourceListItem {sourceListItem}:{sourceKey} tieLine sourceport device key {sourcePortDeviceKey}",
// this,
// sli.Key,
// sli.Value.SourceKey,
// sourceTieLine.SourcePort.ParentDevice.Key);
if (sli.Value == null) return false;
this.LogVerbose(
"********SourceListItem {sourceListItem}:{sourceKey} tieLine sourceport device key {sourcePortDeviceKey}",
sli.Key,
sli.Value.SourceKey,
sourceTieLine.SourcePort.ParentDevice.Key);
return sli.Value.SourceKey.Equals(
sourceTieLine.SourcePort.ParentDevice.Key,
@@ -283,12 +302,10 @@ namespace PepperDash.Essentials.Core.Routing
if (source == null)
{
Debug.LogMessage(
Serilog.Events.LogEventLevel.Debug,
this.LogDebug(
"No source found for device {key}. Creating transient source for {destination}",
this,
sourceTieLine.SourcePort.ParentDevice.Key,
destination
destination.Key
);
var tempSourceListItem = new SourceListItem
@@ -302,7 +319,7 @@ namespace PepperDash.Essentials.Core.Routing
return;
}
//Debug.LogMessage(Serilog.Events.LogEventLevel.Verbose, "Got Source {@source} with key {sourceKey}", this, source, sourceKey);
this.LogVerbose("Got Source {@source} with key {sourceKey}", source, sourceKey);
destination.CurrentSourceInfoKey = sourceKey;
destination.CurrentSourceInfo = source;