Architecture
TheTechIdea.OilGas.Wellbore.Data canonical model, units, environment + contracts (pure .NET)
^ ^
| TheTechIdea.OilGas.Wellbore.Loaders LAS, WITSML, tabular (mapping profiles) (pure .NET)
|
TheTechIdea.OilGas.Wellbore shared drawing layer (SkiaSharp)
^ ^
TheTechIdea.OilGas.WellLogs TheTechIdea.OilGas.WellSchematic (families)
Families never reference each other; a host composes them (for example ExtraTracks = WellLogTracks.FromModel).
Loaders produce canonical data only; presentation (curve grouping, styles, symbols) lives in the families.
One depth axis
A WellboreDocument holds a DepthAxis (unit, range, true or compressed scale), markers (tops and fluid contacts), an
optional WellDepthReference (datum elevation and survey: MD, TVD, TVDSS through minimum curvature) and an ordered list of
WellTracks. Every depth-indexed track maps depth to screen through the same DepthMapper, so all tracks agree to the pixel.
Tracks that are not depth-indexed (tables, leak-path diagrams, the well-path view) opt out with IsDepthIndexed = false.
Tracks and persistence
Each track type has a stable type key ([WellTrackType("...")]) and saves its own payload; documents are versioned JSON
with migrations. Unknown track types load as UnknownTrack and round-trip untouched, so documents from newer versions or
other plug-ins are never damaged.
Drawing and performance
WellboreRenderer lays out tracks and draws them; WellboreView (a host-independent ViewSurface) caches the static scene as a picture and redraws only
the cursor overlay while the pointer moves. The cache key includes the document revision (Touch()), the view window and
the theme. Curves are culled to the visible window and decimated to at most a few points per pixel; schematic layouts and
parsed symbol paths are cached.
Configuration flow
WellboreServices bundles the WellboreEnvironment and the contracts (ICodeVocabulary, IStratigraphicLexicon,
ISymbolResolver, ICurveClassifier, ILabelProvider). It is ambient (WellboreServices.Current, AsyncLocal scopes) and can
also be passed explicitly. Resolution order everywhere: explicit argument, then data-source mapping, then environment
files, then built-in defaults. Thresholds used in calculations are read when the calculation runs; object defaults are
read when the object is created and stay ordinary properties you may change.
Validation
Every layer validates what it owns: the document (survey, datums, tops), each track (WellTrack.Validate), schematics,
barriers and annuli. WellboreValidator.Validate(document) and WellboreView.Validate() collect everything with stable
codes (see Validation codes).
Threading
Documents and canvases belong to one thread at a time (usually the UI thread). Models, loaders and analyses have no shared mutable state apart from the ambient services, which are per async flow when scoped - safe for concurrent server requests.