feat: HistorianGateway as the OtOpcUa historian backend (read/write/alarms + continuous historization); retire Wonderware #423

Merged
dohertj2 merged 40 commits from feat/historian-gateway-backend into master 2026-06-27 11:09:04 -04:00
2 changed files with 14 additions and 5 deletions
Showing only changes of commit 1a6eb7efe6 - Show all commits
@@ -104,17 +104,17 @@ public static class ServiceCollectionExtensions
/// <summary>
/// Config-gated server-side HistoryRead backend. When the <c>ServerHistorian</c> section has
/// <c>Enabled=true</c>, registers the <paramref name="dataSourceFactory"/>-supplied
/// <see cref="IHistorianDataSource"/> (the read-only Wonderware client) overriding the
/// <see cref="NullHistorianDataSource"/> default from <see cref="AddOtOpcUaRuntime"/>. Otherwise
/// <see cref="IHistorianDataSource"/> (the read-only HistorianGateway-backed data source) overriding
/// the <see cref="NullHistorianDataSource"/> default from <see cref="AddOtOpcUaRuntime"/>. Otherwise
/// a no-op (the Null default stays and the node manager's HistoryRead returns
/// <c>GoodNoData</c>-empty). The data source is injected so the Wonderware client can be supplied
/// by the Host, which is the only project that references it.
/// <c>GoodNoData</c>-empty). The data source is injected so the gateway-backed client can be supplied
/// by the Host, which is the only project that references the driver.
/// </summary>
/// <param name="services">The service collection to register with.</param>
/// <param name="configuration">The configuration carrying the <c>ServerHistorian</c> section.</param>
/// <param name="dataSourceFactory">
/// Factory the Host supplies to build the concrete read <see cref="IHistorianDataSource"/>
/// (the Wonderware client) from the bound options + the resolving provider.
/// (the gateway-backed data source) from the bound options + the resolving provider.
/// </param>
/// <returns>The same <paramref name="services"/> instance for chaining.</returns>
public static IServiceCollection AddServerHistorian(
@@ -31,4 +31,13 @@ public sealed class ServerHistorianOptionsTests
[Fact]
public void Valid_config_is_clean()
=> Assert.Empty(new ServerHistorianOptions { Enabled = true, Endpoint = "https://h:5222", ApiKey = "histgw_x_y" }.Validate());
[Fact]
public void Enabled_with_nonpositive_MaxTieClusterOverfetch_warns()
{
var w = new ServerHistorianOptions
{ Enabled = true, Endpoint = "https://h:5222", ApiKey = "histgw_x_y", MaxTieClusterOverfetch = 0 }
.Validate();
Assert.Contains(w, m => m.Contains("MaxTieClusterOverfetch"));
}
}