mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-08-31 19:08:29 +00:00
feat: update IHasDestinationList to IHasDestinations and enhance logging for source resolution
This commit is contained in:
parent
6e01173f3b
commit
165e8c6d34
1 changed files with 22 additions and 9 deletions
|
|
@ -231,7 +231,7 @@ namespace PepperDash.Essentials.Core.Routing
|
||||||
return roomDefaultDisplay.DefaultDisplay.Key == destination.Key;
|
return roomDefaultDisplay.DefaultDisplay.Key == destination.Key;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (r is IHasDestinationList roomDestinationList)
|
if (r is IHasDestinations roomDestinationList)
|
||||||
{
|
{
|
||||||
return roomDestinationList.Destinations.Any(d =>
|
return roomDestinationList.Destinations.Any(d =>
|
||||||
d.Value.Key == destination.Key
|
d.Value.Key == destination.Key
|
||||||
|
|
@ -281,14 +281,27 @@ namespace PepperDash.Essentials.Core.Routing
|
||||||
|
|
||||||
// Debug.LogMessage(Serilog.Events.LogEventLevel.Verbose, "Found sourceList for room {room}", this, room.Key);
|
// Debug.LogMessage(Serilog.Events.LogEventLevel.Verbose, "Found sourceList for room {room}", this, room.Key);
|
||||||
|
|
||||||
|
if (sourceTieLine.SourcePort?.ParentDevice == null)
|
||||||
|
{
|
||||||
|
Debug.LogMessage(
|
||||||
|
Serilog.Events.LogEventLevel.Debug,
|
||||||
|
"********SourcePort or ParentDevice is null for tieLine. Unable to find source for destination {destination}.",
|
||||||
|
this,
|
||||||
|
destination.Key
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var sourceListItem = sourceList.FirstOrDefault(sli =>
|
var sourceListItem = sourceList.FirstOrDefault(sli =>
|
||||||
{
|
{
|
||||||
//// Debug.LogMessage(Serilog.Events.LogEventLevel.Verbose,
|
if (sli.Value == null) return false;
|
||||||
// "SourceListItem {sourceListItem}:{sourceKey} tieLine sourceport device key {sourcePortDeviceKey}",
|
|
||||||
// this,
|
Debug.LogMessage(Serilog.Events.LogEventLevel.Verbose,
|
||||||
// sli.Key,
|
"********SourceListItem {sourceListItem}:{sourceKey} tieLine sourceport device key {sourcePortDeviceKey}",
|
||||||
// sli.Value.SourceKey,
|
this,
|
||||||
// sourceTieLine.SourcePort.ParentDevice.Key);
|
sli.Key,
|
||||||
|
sli.Value.SourceKey,
|
||||||
|
sourceTieLine.SourcePort.ParentDevice.Key);
|
||||||
|
|
||||||
return sli.Value.SourceKey.Equals(
|
return sli.Value.SourceKey.Equals(
|
||||||
sourceTieLine.SourcePort.ParentDevice.Key,
|
sourceTieLine.SourcePort.ParentDevice.Key,
|
||||||
|
|
@ -306,7 +319,7 @@ namespace PepperDash.Essentials.Core.Routing
|
||||||
"No source found for device {key}. Creating transient source for {destination}",
|
"No source found for device {key}. Creating transient source for {destination}",
|
||||||
this,
|
this,
|
||||||
sourceTieLine.SourcePort.ParentDevice.Key,
|
sourceTieLine.SourcePort.ParentDevice.Key,
|
||||||
destination
|
destination.Key
|
||||||
);
|
);
|
||||||
|
|
||||||
var tempSourceListItem = new SourceListItem
|
var tempSourceListItem = new SourceListItem
|
||||||
|
|
@ -320,7 +333,7 @@ namespace PepperDash.Essentials.Core.Routing
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Debug.LogMessage(Serilog.Events.LogEventLevel.Verbose, "Got Source {@source} with key {sourceKey}", this, source, sourceKey);
|
Debug.LogMessage(Serilog.Events.LogEventLevel.Verbose, "Got Source {@source} with key {sourceKey}", this, source, sourceKey);
|
||||||
|
|
||||||
destination.CurrentSourceInfoKey = sourceKey;
|
destination.CurrentSourceInfoKey = sourceKey;
|
||||||
destination.CurrentSourceInfo = source;
|
destination.CurrentSourceInfo = source;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue