Table of Contents

Class S131LuaDataProvider

Namespace
EncDotNet.S100.Datasets.S131
Assembly
EncDotNet.S100.Datasets.S131.dll

Implements the S-100 Part 9A Lua Host API functions by bridging an S131Dataset (GML-encoded) and FeatureCatalogue to an ILuaContext.

public sealed class S131LuaDataProvider : ILuaDataProvider
Inheritance
S131LuaDataProvider
Implements
Inherited Members

Remarks

S-131 is the first product in this codebase that combines GML data encoding (S-100 Part 10b) with Lua portrayal (S-100 Part 9A). The host API surface is identical to S-101 (S101LuaDataProvider), but the underlying data source is a parsed GML document rather than ISO 8211 records.

ID mapping: GML uses string gml:id identifiers; the Lua API expects double feature IDs. This provider assigns sequential integer IDs starting at 1 to features and 100_001 to information types, maintaining a bidirectional index.

Spatial records: S-101 features reference separate spatial records (RCNM 110/120/130). S-131 GML features embed geometry directly. This provider synthesizes spatial association structures from the feature's own geometry so the Lua shims can construct proper Spatial objects.

Constructors

S131LuaDataProvider(S131Dataset, FeatureCatalogue)

Initialises a new S131LuaDataProvider for the given dataset and feature catalogue.

public S131LuaDataProvider(S131Dataset dataset, FeatureCatalogue featureCatalogue)

Parameters

dataset S131Dataset
featureCatalogue FeatureCatalogue

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 to its S-131 feature-type code (e.g. Berth, MooringBuoy). Accepts either the synthetic numeric id used inside the Lua engine or the GML gml:id string that HostPortrayalEmit substitutes into the emitted instructions.

public string? GetFeatureTypeCode(string featureRef)

Parameters

featureRef string

Returns

string

The FC code on success, or null when featureRef cannot be resolved.

RegisterHostFunctions(ILuaContext)

Registers all Host* functions and the Debug table on the given Lua context. The registered functions implement the S-100 Part 9A host interface that the S-131 Lua portrayal rules call.

public void RegisterHostFunctions(ILuaContext lua)

Parameters

lua ILuaContext