Compare commits

..

8 Commits

Author SHA1 Message Date
Andrew Welker
db4f540710 Merge pull request #1394 from PepperDash/temp
merge temp into dev
2026-03-03 13:39:46 -05:00
Neil Dorin
ce8b08e312 Merge pull request #1371 from PepperDash/temp-to-dev 2025-12-23 12:14:03 -05:00
Andrew Welker
13e833b797 Merge pull request #1366 from PepperDash/main
Main -> Development
2025-12-09 15:48:09 -05:00
Andrew Welker
2be078da18 Merge pull request #1360 from PepperDash/temp-to-dev
Temp to dev
2025-11-25 13:42:11 -05:00
Neil Dorin
7330ae2e30 Merge pull request #1330 from PepperDash/temp-to-dev 2025-10-10 10:32:48 -04:00
Andrew Welker
a57dddba5e Merge pull request #1341 from PepperDash/main
Update temp-to-dev branch
2025-10-10 10:31:28 -04:00
Neil Dorin
0bfec16622 Merge pull request #1328 from PepperDash/temp-to-dev
Temp to dev
2025-09-08 11:29:40 -06:00
Andrew Welker
94e7b8210f Merge pull request #1323 from PepperDash/temp-to-dev
Temp to dev
2025-08-26 10:19:59 -04:00
4 changed files with 37 additions and 96 deletions

View File

@@ -30,17 +30,6 @@ 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>
@@ -69,7 +58,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, dc.Name)
base(dc.Key)
{
JoinMaps = new Dictionary<string, JoinMapBaseAdvanced>();

View File

@@ -1,16 +0,0 @@
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

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