Table of Contents

Class S101LuaDataProvider

Namespace
EncDotNet.S100.Datasets.S101
Assembly
EncDotNet.S100.Datasets.S101.dll

Implements the S-100 Lua Host API functions by bridging an S101Dataset and FeatureCatalogue to an ILuaContext. This is the C# side of the S-100 Part 9A Lua Portrayal Model host interface.

public sealed class S101LuaDataProvider : ILuaDataProvider
Inheritance
S101LuaDataProvider
Implements
Inherited Members

Constructors

S101LuaDataProvider(S101Dataset, FeatureCatalogue, S101DepthShift?, Action<string>?)

Creates a provider that presents depths with a water level added (chart-wide water level adjustment).

public S101LuaDataProvider(S101Dataset dataset, FeatureCatalogue featureCatalogue, S101DepthShift? depthShift, Action<string>? trace = null)

Parameters

dataset S101Dataset

The S-101 dataset.

featureCatalogue FeatureCatalogue

The S-101 feature catalogue.

depthShift S101DepthShift

The water level to add to depth values, or null for charted depths.

trace Action<string>

Optional trace sink.

S101LuaDataProvider(S101Dataset, FeatureCatalogue, Action<string>?)

Initialises the provider.

public S101LuaDataProvider(S101Dataset dataset, FeatureCatalogue featureCatalogue, Action<string>? trace = null)

Parameters

dataset S101Dataset

The S-101 dataset to portray.

featureCatalogue FeatureCatalogue

The S-101 feature catalogue (ISO 19110).

trace Action<string>

Optional sink for host/Lua diagnostic trace output (the S-100 Part 9A Debug.Trace / HostDebuggerEntry "trace" channel, plus host type-binding diagnostics). When null, messages are routed to Trace, which is silent on standard output unless a listener is attached. This keeps expected, spec-compliant portrayal fallbacks (for example the OBSTRN07 rule selecting Default symbology when a feature legitimately carries neither valueOfSounding nor defaultClearanceDepth) from polluting console output.

Properties

EmittedInstructions

Drawing instructions emitted during portrayal execution.

public IReadOnlyList<EmittedInstruction> EmittedInstructions { get; }

Property Value

IReadOnlyList<EmittedInstruction>

PostLoadScripts

Product-specific Lua scripts that must run after main.lua loads and before context-parameter initialisation and PortrayalMain. These are the host-adapter shims (e.g. HostGetSpatial / HostFeatureGetSpatialAssociations wrappers) and compatibility patches. The list is executed in order.

public IReadOnlyList<string> PostLoadScripts { get; }

Property Value

IReadOnlyList<string>

Remarks

Owned by the provider because the shims bridge this provider's host functions into Lua objects; S-131's spatial shim differs from S-101's because its geometry is synthesised from GML.

Methods

GetFeatureTypeCode(string)

Resolves a Lua-side feature reference (the stringified record id passed to HostPortrayalEmit) to its S-101 feature-type code (e.g. DEPCNT, BCNCAR) using the dataset's record index and feature-type catalogue.

public string? GetFeatureTypeCode(string featureRef)

Parameters

featureRef string

Returns

string

The human-readable FC code on success, or null when featureRef cannot be parsed or the record is not present.

RegisterHostFunctions(ILuaContext)

Registers all Host* functions and the Debug table on the given Lua context.

public void RegisterHostFunctions(ILuaContext lua)

Parameters

lua ILuaContext