feat(drivers): TCP-connect IDriverProbe for all 9 driver types
Cheap-and-fast probe: open TCP socket to the configured endpoint, close immediately. Surfaces SocketError on failure, latency on success, "timed out" on caller cancel. Sufficient for the AdminUI Test Connect "can we reach the host?" question. Richer protocol- level probes (OPC UA session open, FOCAS handshake, gRPC ping) are a documented follow-up. Each probe registered as AddSingleton<IDriverProbe, X> in DriverFactoryBootstrap so they flow through DI into AdminOperationsActor. Historian.Wonderware returns a clean "TCP probe not applicable" result because it communicates over a Windows named pipe, not TCP. Also adds OpcUaClient + Historian.Wonderware.Client project references to Host.csproj (both were missing from the driver ItemGroup).
This commit is contained in:
@@ -5,6 +5,17 @@ using ZB.MOM.WW.OtOpcUa.Core.Hosting;
|
||||
|
||||
namespace ZB.MOM.WW.OtOpcUa.Host.Drivers;
|
||||
|
||||
// Probe type aliases — keep the using list concise.
|
||||
using ModbusProbe = Driver.Modbus.ModbusDriverProbe;
|
||||
using AbCipProbe = Driver.AbCip.AbCipDriverProbe;
|
||||
using AbLegacyProbe = Driver.AbLegacy.AbLegacyDriverProbe;
|
||||
using S7Probe = Driver.S7.S7DriverProbe;
|
||||
using TwinCATProbe = Driver.TwinCAT.TwinCATDriverProbe;
|
||||
using FocasProbe = Driver.FOCAS.FocasDriverProbe;
|
||||
using OpcUaProbe = Driver.OpcUaClient.OpcUaClientDriverProbe;
|
||||
using GalaxyProbe = Driver.Galaxy.GalaxyDriverProbe;
|
||||
using HistorianProbe = Driver.Historian.Wonderware.Client.WonderwareHistorianDriverProbe;
|
||||
|
||||
/// <summary>
|
||||
/// Wires every cross-platform driver assembly's <c>Register(registry, loggerFactory)</c>
|
||||
/// extension into a single <see cref="DriverFactoryRegistry"/> singleton and binds the
|
||||
@@ -34,6 +45,18 @@ public static class DriverFactoryBootstrap
|
||||
});
|
||||
services.AddSingleton<IDriverFactory>(sp =>
|
||||
new DriverFactoryRegistryAdapter(sp.GetRequiredService<DriverFactoryRegistry>()));
|
||||
|
||||
// One IDriverProbe per driver type — wired into AdminOperationsActor via DI enumeration.
|
||||
services.AddSingleton<IDriverProbe, ModbusProbe>();
|
||||
services.AddSingleton<IDriverProbe, AbCipProbe>();
|
||||
services.AddSingleton<IDriverProbe, AbLegacyProbe>();
|
||||
services.AddSingleton<IDriverProbe, S7Probe>();
|
||||
services.AddSingleton<IDriverProbe, TwinCATProbe>();
|
||||
services.AddSingleton<IDriverProbe, FocasProbe>();
|
||||
services.AddSingleton<IDriverProbe, OpcUaProbe>();
|
||||
services.AddSingleton<IDriverProbe, GalaxyProbe>();
|
||||
services.AddSingleton<IDriverProbe, HistorianProbe>();
|
||||
|
||||
return services;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,9 @@
|
||||
<ProjectReference Include="..\..\Drivers\ZB.MOM.WW.OtOpcUa.Driver.AbLegacy\ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.csproj"/>
|
||||
<ProjectReference Include="..\..\Drivers\ZB.MOM.WW.OtOpcUa.Driver.FOCAS\ZB.MOM.WW.OtOpcUa.Driver.FOCAS.csproj"/>
|
||||
<ProjectReference Include="..\..\Drivers\ZB.MOM.WW.OtOpcUa.Driver.Galaxy\ZB.MOM.WW.OtOpcUa.Driver.Galaxy.csproj"/>
|
||||
<ProjectReference Include="..\..\Drivers\ZB.MOM.WW.OtOpcUa.Driver.Historian.Wonderware.Client\ZB.MOM.WW.OtOpcUa.Driver.Historian.Wonderware.Client.csproj"/>
|
||||
<ProjectReference Include="..\..\Drivers\ZB.MOM.WW.OtOpcUa.Driver.Modbus\ZB.MOM.WW.OtOpcUa.Driver.Modbus.csproj"/>
|
||||
<ProjectReference Include="..\..\Drivers\ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient\ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.csproj"/>
|
||||
<ProjectReference Include="..\..\Drivers\ZB.MOM.WW.OtOpcUa.Driver.S7\ZB.MOM.WW.OtOpcUa.Driver.S7.csproj"/>
|
||||
<ProjectReference Include="..\..\Drivers\ZB.MOM.WW.OtOpcUa.Driver.TwinCAT\ZB.MOM.WW.OtOpcUa.Driver.TwinCAT.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user