Read path scaffold + the byte→uint quality mapping table that the parity
matrix (PR 5.x) pins. PR 4.4 supplies the production GW-backed reader; this
PR ships the abstraction and the supporting infrastructure so 4.4 just
plugs the implementation in.
Files:
- Runtime/StatusCodeMap.cs — explicit OPC DA quality byte → OPC UA
StatusCode uint mapping. Extends the legacy Galaxy.Host
HistorianQualityMapper with named constants (Good / GoodLocalOverride,
Uncertain + 4 substatuses, Bad + 7 substatuses, BadInternalError) and an
MxStatusProxy → uint helper that honors success flag → detail byte →
detected_by transport-error fallback. Unknown bytes fall back to category
bucket with a once-per-session diagnostic log so field captures can
extend the table.
- Runtime/MxValueDecoder.cs — gateway MxValue → boxed CLR value for the
seven Galaxy data types (Boolean, Int32, Int64, Float32, Float64, String,
DateTime) plus their array variants. Honors MxValue.IsNull and
RawValue passthrough.
- Runtime/IGalaxyDataReader.cs — driver-side seam for one-shot reads. PR
4.4 ships the production wrapper around MxGatewaySession.SubscribeBulk +
StreamEvents + UnsubscribeBulk; this PR exposes the contract so
GalaxyDriver.ReadAsync wires through it.
- Runtime/GalaxyMxSession.cs — wrapper around MxGatewaySession that owns
the Register handle. ConnectAsync opens session + Register; AttachForTests
lets tests bypass real gw construction. PR 4.3/4.4/4.5 add write,
subscribe, and reconnect surfaces.
GalaxyDriver:
- Implements IReadable. ReadAsync routes through the injected
IGalaxyDataReader (test seam) when present; production path throws
NotSupportedException pointing at PR 4.4 — protects deployments running
this PR from silent wrong reads while signaling that the legacy-host
backend (Galaxy:Backend=legacy-host) handles reads in the meantime.
- Internal ctor extended with optional dataReader parameter (default null,
preserves PR 4.0/4.1 callers).
Tests: 42 new — exhaustive byte→uint table for StatusCodeMap (15 known
codes + category-bucket fallback for unknowns + MxStatusProxy precedence
rules + OPC UA top-byte invariants), every MxValue oneof case for the
decoder (bool/int32/int64/float/double/string/timestamp/3 array variants/
raw bytes/null), GalaxyDriver IReadable wiring (route-through, empty-
request, no-reader-throws, post-dispose-throws, status-code preservation).
62 Galaxy tests total pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Browse path online. GalaxyDriver now implements ITagDiscovery against the
gateway's GalaxyRepositoryClient (PR 0.1's mxaccessgw browse RPC) and feeds
the address-space builder one folder per gobject + one variable per dynamic
attribute, with alarm-bearing attributes carrying all five sub-attribute refs
the server-level AlarmConditionService (PR 2.2) needs.
Files:
- Browse/IGalaxyHierarchySource.cs — driver-side seam between the discoverer
and the gateway. Test fakes return canned hierarchies so the discoverer's
translation logic is exercised without a real gRPC channel.
- Browse/GatewayGalaxyHierarchySource.cs — production wrapper around
GalaxyRepositoryClient.DiscoverHierarchyAsync (paged internally).
- Browse/GalaxyDiscoverer.cs — translates GalaxyObject → IAddressSpaceBuilder
calls. Browse name = contained_name (falls back to tag_name); full
reference = attr.full_tag_reference when set, else tag_name + "." +
attribute_name. Skips objects/attributes with empty identity.
- Browse/DataTypeMap.cs — mx_data_type → DriverDataType (port from legacy
GalaxyProxyDriver.MapDataType, same fallback to String for unknown codes).
- Browse/SecurityMap.cs — security_classification → SecurityClassification
(port from legacy GalaxyProxyDriver.MapSecurity).
- Browse/AlarmRefBuilder.cs — populates the five sub-attribute refs by
Galaxy convention (.InAlarm/.Priority/.DescAttrName/.Acked/.AckMsg). The
same convention the legacy GalaxyAlarmTracker hard-coded; concentrated
here so PR 2.2's service receives complete AlarmConditionInfo rows.
GalaxyDriver:
- Added internal ctor accepting IGalaxyHierarchySource? for test injection.
Default lazily builds GatewayGalaxyHierarchySource around a
GalaxyRepositoryClient constructed from options on first DiscoverAsync.
- Owned GalaxyRepositoryClient disposed in Dispose.
- ApiKey resolution is currently a passthrough of ApiKeySecretRef — PR 4.W
(or follow-up) wires DPAPI-backed secret resolution.
csproj: path-based ProjectReference to mxaccessgw (the user is shipping
that repo on a parallel track; both repos sit side-by-side on the dev box).
Tests project also references MxGateway.Contracts directly to construct
GalaxyObject / GalaxyAttribute fixtures.
Tests: 10 new in Browse/GalaxyDiscovererTests.cs covering folder-per-object,
variable-per-attribute, full-ref defaulting + gw-supplied override, browse-
name fallback, every metadata field propagation, alarm sub-attribute ref
population, non-alarm rows skip MarkAsAlarmCondition, empty-identity skips,
empty-attribute-name skips, end-to-end through GalaxyDriver.DiscoverAsync.
20 total Galaxy tests pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
New in-process .NET 10 driver project at
src/ZB.MOM.WW.OtOpcUa.Driver.Galaxy/. The Tier-A replacement for
Driver.Galaxy.Host + Driver.Galaxy.Proxy. PR 4.0 ships only the IDriver
shape + factory + options; capability bodies (browse, read, write,
subscribe, deploy-watch, host probes) land in PRs 4.1–4.7.
Files:
- Driver.Galaxy.csproj — net10 x64, AnyCPU+x64 platforms, references
Core.Abstractions + Core. No MxGatewayClient ProjectReference yet — that
comes in PR 4.2 once the gw NuGet package is wired (the user is
shipping mxaccessgw on a parallel track).
- Config/GalaxyDriverOptions.cs — nested record hierarchy
(Gateway/MxAccess/Repository/Reconnect) mirroring the JSON shape spelled
out in lmx_mxgw_impl.md PR 4.0 acceptance section.
- GalaxyDriver.cs — minimal IDriver impl. Initialize/Shutdown toggle
DriverHealth between Healthy/Unknown; Reinitialize bumps the timestamp;
GetMemoryFootprint=0 (PR 4.4 wires SubscriptionRegistry size);
FlushOptionalCachesAsync no-op. Logs intent on lifecycle calls so
partial deployments are diagnosable.
- GalaxyDriverFactoryExtensions.cs — JSON parser, default fill-ins,
validation throw on missing required fields. Driver type name
"GalaxyMxGateway" intentionally distinct from legacy "Galaxy" so both
factories coexist during parity testing (Phase 5). PR 4.W's
Galaxy:Backend switch picks one or the other.
Tests:
- 10 tests in Driver.Galaxy.Tests covering minimal-config defaults, full
override path, three required-field error cases, factory registration
via DriverFactoryRegistry.TryGet, lifecycle health transitions
(Init → Shutdown → Reinit), Dispose idempotency, and post-disposal
ObjectDisposedException.
slnx: registers the new Driver.Galaxy + Driver.Galaxy.Tests projects.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>