Class S101LuaDataProvider
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
datasetS101DatasetThe S-101 dataset.
featureCatalogueFeatureCatalogueThe S-101 feature catalogue.
depthShiftS101DepthShiftThe water level to add to depth values, or null for charted depths.
traceAction<string>Optional trace sink.
S101LuaDataProvider(S101Dataset, FeatureCatalogue, Action<string>?)
Initialises the provider.
public S101LuaDataProvider(S101Dataset dataset, FeatureCatalogue featureCatalogue, Action<string>? trace = null)
Parameters
datasetS101DatasetThe S-101 dataset to portray.
featureCatalogueFeatureCatalogueThe S-101 feature catalogue (ISO 19110).
traceAction<string>Optional sink for host/Lua diagnostic trace output (the S-100 Part 9A
Debug.Trace/HostDebuggerEntry"trace" channel, plus host type-binding diagnostics). Whennull, 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 theOBSTRN07rule selecting Default symbology when a feature legitimately carries neithervalueOfSoundingnordefaultClearanceDepth) from polluting console output.
Properties
EmittedInstructions
Drawing instructions emitted during portrayal execution.
public IReadOnlyList<EmittedInstruction> EmittedInstructions { get; }
Property Value
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
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
featureRefstring
Returns
- string
The human-readable FC code on success, or null when
featureRefcannot 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
luaILuaContext