TheTechIdea OilGas - Developer guide User guide →

TheTechIdea.OilGas.Wellbore.Setup

11 public types. Summaries come from the XML documentation of the compiled assembly.

TheTechIdea.OilGas.Wellbore.Setup

TypeSummary
CompositeDataSourceFactoryclassAsks several data source factories in turn; the first that knows a kind opens it.
CountryChoiceclassA country preset the setup can start from.
DataSourcePluginsclassData source plugins: a vendor's database adapters (public IDataSourceFactory types with a parameterless constructor) found in the DLLs of a folder - so the setup app and other hosts gain the vendor's kinds without being rebuilt.
IMappingSuggesterinterfaceA further source of suggestions (e.g. a language model) - its proposals are ranked with the built-in ones and never applied unconfirmed.
MappingCandidateclassA candidate mapping target: the text matched against, and the value written when accepted.
MappingSuggestionclassA proposed mapping for an unresolved value of the coverage report - never applied until accepted.
SetupSessionclassA company's environment being set up - the engine of the setup app, without UI. Starts from a country preset (or an existing environment file), and writes every change to the company folder at once: settings, data sources, code values, the company stratigraphy, component symbols, mnemonic and unit aliases, tool-model files and verification cases. Tests data sources, runs coverage, verifies, reports the state of each step of the data manager's guide, and writes the hand-over configuration.
SetupStepclassA step of the setup with its state and what to do next.
SetupStepStateenumState of a setup step.
SimilarityMatcherstatic classDeterministic similarity between an unresolved value and a candidate: normalised equality, prefix, containment, edit distance.
SourceTestResultclassWhat loading a data source gave: the well, counts, warnings - or why it failed.

CompositeDataSourceFactory class

Asks several data source factories in turn; the first that knows a kind opens it.

Inherits / implements: IDataSourceFactory

MemberSummary
CompositeDataSourceFactory(IEnumerable<IDataSourceFactory> factories)Creates a composite of factories.
IReadOnlyList<IDataSourceFactory> Factories { get; }The factories, asked in order.
ITabularSource Open(string name, DataSourceDefinition definition, string resolvedPath)The source of the first factory that knows the kind, or null.

CountryChoice class

A country preset the setup can start from.

MemberSummary
CountryChoice(string code, string name)Creates a choice.
string Code { get; }ISO country code of the preset (country:&lt;code&gt;).
string Name { get; }Country name.
string ToString()The name, for lists.

DataSourcePlugins class

Data source plugins: a vendor's database adapters (public IDataSourceFactory types with a parameterless constructor) found in the DLLs of a folder - so the setup app and other hosts gain the vendor's kinds without being rebuilt.

MemberSummary
List<IDataSourceFactory> Factories { get; }The factories found.
List<string> Problems { get; }Files or types that could not be used, and why.
static DataSourcePlugins FromAssemblies(IEnumerable<Assembly> assemblies)The plugins in the given assemblies.
static DataSourcePlugins FromFolder(string folder)The plugins in folder (*.dll); a missing folder gives none.
void Register(WellboreServices services)Registers the plugins in services (nothing when none were found).

IMappingSuggester interface

A further source of suggestions (e.g. a language model) - its proposals are ranked with the built-in ones and never applied unconfirmed.

MemberSummary
string Name { get; }Name shown with its suggestions.
IEnumerable<(string, double)> Suggest(CoverageItem item, IReadOnlyList<MappingCandidate> candidates)Proposals for one unresolved value among the candidates (target, score 0..1).

MappingCandidate class

A candidate mapping target: the text matched against, and the value written when accepted.

MemberSummary
MappingCandidate(string label, string target)Creates a candidate.
string Label { get; }Text the unresolved value is compared with.
string Target { get; }Value written when accepted.

MappingSuggestion class

A proposed mapping for an unresolved value of the coverage report - never applied until accepted.

MemberSummary
string Area { get; set; }Coverage area: codes, units, mnemonics or lexicon.
string By { get; set; }Who suggested it ("similarity" or a suggester's name).
string MatchedOn { get; set; }The candidate text it matched (the target's name or spelling).
double Score { get; set; }Score 0..1.
string Target { get; set; }What it would map to (a code, unit symbol, mnemonic or lexicon unit id).
string Value { get; set; }The unresolved value as found in the data.
string Where { get; set; }Where the value occurs (entity.field).
string ToString()"where 'value' -&gt; target (score, by)".

SetupSession class

A company's environment being set up - the engine of the setup app, without UI. Starts from a country preset (or an existing environment file), and writes every change to the company folder at once: settings, data sources, code values, the company stratigraphy, component symbols, mnemonic and unit aliases, tool-model files and verification cases. Tests data sources, runs coverage, verifies, reports the state of each step of the data manager's guide, and writes the hand-over configuration.

MemberSummary
IReadOnlyList<string> CanonicalMnemonics { get; }The canonical mnemonics of the curve families (for mnemonic aliases).
JsonStratigraphicLexicon CompanyLexicon { get; }The company stratigraphy (company.lexicon.json; empty until a unit is added).
Action<WellboreServices> ConfigureServices { get; set; }Applied to the services every time they are rebuilt - where the host application registers its own parts, for example its database data source kinds (services.Set&lt;IDataSourceFactory&gt;(...)).
static IReadOnlyList<CountryChoice> Countries { get; }The country presets to start from.
string Country { get; }The country preset the environment extends, or null.
IReadOnlyDictionary<string, DataSourceDefinition> DataSources { get; }The data sources in effect.
JsonObject Document { get; }The environment as written (only what the company sets; the rest comes from the country preset and defaults).
string EnvironmentFile { get; }The environment file being set up.
string Folder { get; }The company folder (environment file and the files the session maintains).
WellboreServices Services { get; }The services of the environment as it stands (rebuilt after every change).
IReadOnlyList<(string, string)> Symbols { get; }The schematic symbols to choose from (id and name).
IReadOnlyList<string> UnitSymbols { get; }The known unit symbols.
const string LexiconFile = "company.lexicon.json"File name of the company stratigraphy the session maintains.
const string SymbolsFile = "component-symbols.json"File name of the component-symbol map the session maintains.
event EventHandler ChangedRaised after every change written to the company folder.
void Accept(string source, MappingSuggestion s)Accepts a suggestion: writes it exactly as the matching manual mapping would.
string AddToolModelFile(string path)Copies a contractor's ISCWSA error-model file into the company folder and registers it; returns the model name.
void AddTubular(string kind, string value)Adds a company grade or connection to the tubular catalogue (kind: grade or connection).
void AddUnitAlias(string unitId, string alias)Adds a spelling (as found in the data) to a unit of the company stratigraphy, or creates the unit.
IReadOnlyList<MappingCandidate> CandidatesFor(CoverageItem item)Candidate mapping targets for a coverage item (codes, units, mnemonics, lexicon); empty for other areas.
IReadOnlyList<string> CanonicalValues(string entity, string field)The canonical values a code of entity.field can map to (string kinds, statuses, component types, contact types, lithologies).
ReferenceCase CaptureCase(string source)Records what a source loads now as a verification case (well name, counts, the warnings it has now as the most allowed); replaces the source's earlier captured case.
static IReadOnlyList<StratigraphicUnit> ChartUnits(string rank = null)The units of the standard chart (ICS) at a rank (null: all), for choosing parents.
CoverageReport Coverage(string name)The coverage of a source (cached until the next change), with the lithology library and symbols in effect.
static SetupSession Create(string folder, string countryCode, string companyName = null)Starts a company folder from a country preset (environment.json extending it).
JsonNode Effective(string path)The value in effect (company file, country preset or default) of a setting, as JSON.
JsonNode Get(string path)A setting as written in the company file ("locale.culture", "display.chronostratigraphyRank" ...), or null.
ConfigurationSaveReport Handover(string folder)Writes the whole configuration (environment and every file it uses) to a hand-over folder.
int ImportWorksheet(string worksheetJson)Takes the filled-in codes of a coverage worksheet (wellbore-config coverage --worksheet) into the sources; empty entries are skipped. Returns how many codes were taken.
void MapCode(string source, string entity, string field, string sourceCode, string canonical)Maps a source code to a canonical value (dataSources.&lt;source&gt;.codes.&lt;entity&gt;.&lt;field&gt;).
static SetupSession Open(string environmentFile)Opens an existing environment file.
WellboreDocument Preview(string source)The well of a source as the views show it (composite schematic view), for previews.
string RelativePath(string path)A path relative to the company folder when it lies inside it (what a data source should store).
void RemoveDataSource(string name)Removes a data source.
void RemoveUnit(string unitId)Removes a unit of the company stratigraphy.
void Set(string path, JsonNode value)Sets a setting in the company file; null removes it (back to the preset / default).
void SetComponentSymbol(string componentType, string symbolId)Shows a component type with a symbol (component-symbols.json, registered in resources.componentSymbolsFile).
void SetDataSource(string name, DataSourceDefinition definition)Adds or replaces a data source (paths are best relative to the company folder).
void SetMnemonicAlias(string alias, string canonical)Another name (vendor, language) of a canonical mnemonic.
void SetUnit(StratigraphicUnit unit)Adds or replaces a unit of the company stratigraphy (registering the file in resources.lexiconFiles).
void SetUnitAlias(string spelling, string unitSymbol)Another spelling of a known unit.
IReadOnlyList<SetupStep> Steps()The steps of the data manager's guide with their state (tests every source and runs coverage and verification).
IReadOnlyList<MappingSuggestion> Suggestions(string source, IMappingSuggester suggester = null, int perValue = 3)Ranked mapping suggestions for every unresolved value of a source's coverage report - similarity over the candidates, plus an optional further suggester; nothing is applied until MappingSuggestion).
SourceTestResult TestSource(string name, string wellId = null)Loads one well from a source (the first, or wellId) and says what came out.
IReadOnlyList<string> Validate()Configuration problems: environment validation and the warnings from loading its files.
IReadOnlyList<ReferenceCaseResult> Verify()Runs every verification case (data sources, dips, the other reference cases).

SetupStep class

A step of the setup with its state and what to do next.

MemberSummary
SetupStep(string id, string title, SetupStepState state, string detail)Creates a step.
string Detail { get; }What is done or what to do next.
string Id { get; }Step key (country, sources, codes, equipment, stratigraphy, lithology, logs, units, tubulars, surveys, verification).
SetupStepState State { get; }State.
string Title { get; }Step title.

SetupStepState enum

State of a setup step.

MemberSummary
NotStartedNothing to judge yet (for example no data source).
NeedsAttentionSomething to resolve - the detail says what.
DoneComplete.

SimilarityMatcher static class

Deterministic similarity between an unresolved value and a candidate: normalised equality, prefix, containment, edit distance.

MemberSummary
static string Normalise(string s)Upper case, letters, digits and '/' (any script): '/' means "per" in a unit and is kept (us/ft is not usft, the US survey foot), other separators are not.
static List<(MappingCandidate, double)> Rank(string value, IEnumerable<MappingCandidate> candidates, int max = 3, double minimum = 0.5)The best candidates for a value (distinct targets, best first, at least minimum).
static double Score(string value, string candidate)Similarity 0..1.

SourceTestResult class

What loading a data source gave: the well, counts, warnings - or why it failed.

MemberSummary
Dictionary<string, int> Counts { get; }Counts of what loaded (strings, components, tops, surveyStations, logSets, curves).
string Error { get; set; }Why it did not load.
bool Loaded { get; }True when a well loaded.
WellModel Model { get; set; }The well loaded.
string Source { get; set; }The data source.
List<string> Warnings { get; }Load warnings.