Phase 3 PR 35 — IHistoryProvider gains ReadAtTime + ReadEvents; Proxy implements both #34
Reference in New Issue
Block a user
Delete Branch "phase-3-pr35-history-readtime-readevents"
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?
Rounds out the OPC UA Part 11 HistoryRead capability surface.
HistoryReadAtTime+HistoryReadEventsare the last two modes not covered by the existingReadRawAsync/ReadProcessedAsync. Consumes the PR-10 / PR-11 IPC contracts the Host already ships.Interface additions
Added to
Core.Abstractions.IHistoryProviderwith default interface implementations that throwNotSupportedException— existing impls (Galaxy / OPC UA Client) keep compiling, only drivers whose backend carries the capability override:ReadAtTimeAsync(string fullReference, IReadOnlyList<DateTime> timestampsUtc, …)— interpolated per-timestamp sample.ReadEventsAsync(string? sourceName, DateTime start, DateTime end, int maxEvents, …)— historian event rows.New domain types in
Core.Abstractions:HistoricalEvent— one historian row (EventId, SourceName, EventTimeUtc vs ReceivedTimeUtc, Message, Severity).HistoricalEventsResult— event list + continuation-point.Proxy implementation
GalaxyProxyDriver.ReadAtTimeAsyncconvertsDateTime[]→ Unix-ms, calls the existingMessageKind.HistoryReadAtTimeRequest. Trusts the Host's one-sample-per-timestamp contract (Host pads with bad-quality on missing timestamps — re-aligning on the Proxy would duplicate the Host's interpolation policy).GalaxyProxyDriver.ReadEventsAsynchitsHistoryReadEventsRequest;ToHistoricalEventmapsGalaxyHistoricalEvent(MessagePack, Unix-ms) →HistoricalEventwithDateTimeKind.Utctagged on both timestamps so downstream serializers don't apply local-time offsets.Tests
HistoricalEventMappingTests(3 new unit cases):SourceName/DisplayTextpreserve — system events without a source come out with null, callers can distinguish them from alarm events.DateTimeKind.Utc— regression guard against a future refactor using conversions that default toUnspecified.Driver.Galaxy.Proxy.Tests Unit: 17 / 0 (14 prior + 3 new). Full solution builds clean.
Scope exclusions (next PR)
DriverNodeManagerHistoryRead service-handler wiring — where the OPC UA Server routes HistoryReadAtTime / HistoryReadEvents service requests onto the capability methods. Mechanical compared to this PR; split for reviewability.HistorianDataSource→ back).docs/v2/lmx-followups.md#1 updated to reflect the split — capability surface complete, service-handler wiring + integration test remain.