Phase 2 PR 5 — Wonderware Historian SDK port into Driver.Galaxy.Host #4
Reference in New Issue
Block a user
Delete Branch "phase-2-pr5-historian"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Phase 2 PR 5 — port the Wonderware Historian SDK into
Driver.Galaxy.Host/Backend/Historian/, wiringMxAccessGalaxyBackend.HistoryReadAsyncend-to-end and closing the last Phase 2 Task B.1.h follow-up that was still returning a placeholder error.Key decisions:
Opc.Ua.DataValueon the hot historian path, which would have required draggingOPCFoundation.NetStandard.Opc.Ua.Serverinto net48 x86 Galaxy.Host and leaking OPC types across the IPC boundary. Instead, PR 5 introducesHistorianSample+HistorianAggregateSamplePOCOs that carry the raw MX quality byte through the pipe unchanged; the Proxy side does the OPC translation via the existingQualityMapperalready used for live reads. Decision #13'sGalaxyDataValuecontract survives intact — no Shared wire break vs PR 4.HistorianPluginLoader+AssemblyResolve+Assembly.LoadFrom. That indirection existed solely because the plugin was staged inHost/bin/Debug/net48/Historian/at deploy time. Since Driver.Galaxy.Host is already Galaxy-specific, the plugin boundary is pure overhead here — the port lives directly underBackend/Historian/and Galaxy.Host.csproj carries the SDK refs + native DLL staging inline.HistorianClusterEndpointPickeris the thread-safe pure-logic picker ported unchanged (injected clock, per-node cooldown, case-insensitive de-dup).ConnectToAnyHealthyNodeiterates healthy candidates, clones config per attempt, marks healthy-on-success / failed-on-exception, and throws with the last exception chained when all nodes exhaust.ReadRawAsyncis wired through IPC now (HistoryReadRequestwas already in Shared.Contracts).ReadAggregateAsync/ReadAtTimeAsync/ReadEventsAsync/GetHealthSnapshotare ported-but-not-yet-IPC-exposed — they stay internal to Galaxy.Host until PR 6+ surfaces them via new contract message kinds.Changes
src/.../Backend/Historian/Backend/MxAccessGalaxyBackend.csHistoryReadAsyncnow delegates toIHistorianDataSource.ReadRawAsync+ maps samples toGalaxyDataValue; gainsIDisposableto close historian connections at shutdownProgram.csBuildHistorianIfEnabled()readsOTOPCUA_HISTORIAN_*env vars, returns null when disabled so the backend surfaces a cleanHistorian disablederrorDriver.Galaxy.Host.csprojaahClientManaged+aahClientCommon; stagesaahClient.dll+Historian.CBE.dll+Historian.DPAPI.dll+ArchestrA.CloudHistorian.Contract.dllalongside the host exe;InternalsVisibleTo("...Host.Tests")added so the endpoint picker stays testabletests/.../Host.Tests/HistorianClusterEndpointPickerTests.csServerName, cooldown enters/expires, MarkHealthy clears, all-in-cooldown empty list, Snapshot reports state, case-insensitive de-duptests/.../Host.Tests/HistorianWiringTests.csHistorianSample(42.5, Good, ts)toGalaxyDataValue{StatusCode=0u, source ts matches, MessagePack bytes non-null}Test plan
dotnet build src/ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Host/— 0 errorsdotnet build ZB.MOM.WW.OtOpcUa.slnx— 0 errors, 202 pre-existing warningsdotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Host.Tests/ --filter "Category=Unit"— 24/24 pass (9 new + 15 pre-existing)dotnet test ZB.MOM.WW.OtOpcUa.slnx— expect full solution pass count consistent with PR 4 baselineOTOPCUA_HISTORIAN_ENABLED=true OTOPCUA_HISTORIAN_SERVER=<hostname>and fire a HistoryRead from the Client CLI — should return live historical samples instead of the PR 4 placeholder errorFollow-ups / deferred
IHistoryProvider.ReadProcessedAsyncwiring.AlarmExtension→OnAlarmEvent) fromMxAccessGalaxyBackend. Shares the IPCConnectionSinkpath that PR 4 built forOnDataChange.GalaxyRuntimeProbeManager→OnHostStatusChanged. Same pattern.Historian.Aveva+Historian.Aveva.Testsprojects (the two remaining archived-but-still-building v1 surfaces) can be removed alongside the rest of the v1 stack.🤖 Generated with Claude Code
Closing � the PR5 historian commit (
6df1a79) was already an ancestor of v2 when PR #3 merged (it sat on the pr4-findings branch). No additional work required; the Historian port is live on v2.Pull request closed