Class S125AtonLuaDataProvider
Implements the S-100 Part 9A Lua host API over S-125 aids to navigation projected onto the S-101 model (S125AtonPortrayalProjection), so the bundled S-101 Portrayal Catalogue's AtoN rules can portray them.
public sealed class S125AtonLuaDataProvider : ILuaDataProvider
- Inheritance
-
S125AtonLuaDataProvider
- Implements
- Inherited Members
Remarks
Feature ids: GML gml:id strings are mapped to sequential
numeric ids for the Lua side and mapped back in HostPortrayalEmit,
so emitted instructions reference the S-125 feature's gml:id.
Spatial records: GML features embed their geometry, whereas the
S-101 rules inspect shared spatial records — a light's flare direction and
the vertical offset of its description both depend on the other features
associated with the same point (S-101 LightFlareAndDescription,
GetColocatedTextCount). Point features at the same position are
therefore given one shared synthetic point record, reproducing S-101's
structure / equipment co-location. Curves and surfaces get per-feature
synthetic curve, composite-curve and surface records.
Attribute and type information comes from the S-101 Feature Catalogue, since the rules being run are S-101 rules.
Constructors
S125AtonLuaDataProvider(S125Dataset, FeatureCatalogue, Action<string>?)
Initialises the provider over the portrayable features of an S-125 dataset.
public S125AtonLuaDataProvider(S125Dataset dataset, FeatureCatalogue s101FeatureCatalogue, Action<string>? trace = null)
Parameters
datasetS125DatasetThe S-125 dataset.
s101FeatureCatalogueFeatureCatalogueThe S-101 feature catalogue the rules are written against.
traceAction<string>Optional sink for Lua
Debug.Traceoutput; defaults to Trace.
S125AtonLuaDataProvider(IReadOnlyList<S125ProjectedAton>, FeatureCatalogue, Action<string>?)
Initialises the provider over already-projected aids.
public S125AtonLuaDataProvider(IReadOnlyList<S125ProjectedAton> aids, FeatureCatalogue s101FeatureCatalogue, Action<string>? trace = null)
Parameters
aidsIReadOnlyList<S125ProjectedAton>The projected aids (see Project(S125Dataset, FeatureCatalogue)).
s101FeatureCatalogueFeatureCatalogueThe S-101 feature catalogue the rules are written against.
traceAction<string>Optional sink for Lua
Debug.Traceoutput.
Properties
EmittedInstructions
Drawing instructions emitted during portrayal execution.
public IReadOnlyList<EmittedInstruction> EmittedInstructions { get; }
Property Value
FeatureCount
The number of S-125 features handed to the S-101 rules.
public int FeatureCount { 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 feature-type code (e.g.
DEPCNT), or null when it cannot be resolved.
Used for per-feature-type telemetry.
public string? GetFeatureTypeCode(string featureRef)
Parameters
featureRefstring
Returns
Remarks
Accepts either the gml:id carried by emitted instructions or the
numeric id used inside the Lua engine; returns the S-101 feature type
the feature is portrayed as.
RegisterHostFunctions(ILuaContext)
Registers all Host* functions (and any debug table) on the given
Lua context.
public void RegisterHostFunctions(ILuaContext lua)
Parameters
luaILuaContext