Class S101AlertPortrayal
Runs an S-101 cell's portrayal rules for chosen features and reports the
alerts each raises (AlertReference), at the context parameters a
route check gives: the S-101 NavHazard, ProhAre and
SafetyContour alerts depend on the safety contour.
public sealed class S101AlertPortrayal : IDisposable
- Inheritance
-
S101AlertPortrayal
- Implements
- Inherited Members
Remarks
One Lua state is kept per set of mariner settings and each feature is portrayed once, so a route check that asks leg by leg pays the rules' set-up once. Thread-safe.
Constructors
S101AlertPortrayal(ILuaEngine, S101Dataset, S101PortrayalCatalogue, FeatureCatalogue)
Creates the alert portrayal for a cell.
public S101AlertPortrayal(ILuaEngine luaEngine, S101Dataset dataset, S101PortrayalCatalogue catalogue, FeatureCatalogue featureCatalogue)
Parameters
luaEngineILuaEngineThe Lua engine.
datasetS101DatasetThe cell.
catalogueS101PortrayalCatalogueThe S-101 (or S-401) portrayal catalogue.
featureCatalogueFeatureCatalogueThe matching feature catalogue.
S101AlertPortrayal(ILuaEngine, S101Dataset, Func<CancellationToken, Task<(S101PortrayalCatalogue Portrayal, FeatureCatalogue Features)>>)
Creates the alert portrayal for a cell whose catalogues are loaded on first use, for hosts that read cells without portraying them.
public S101AlertPortrayal(ILuaEngine luaEngine, S101Dataset dataset, Func<CancellationToken, Task<(S101PortrayalCatalogue Portrayal, FeatureCatalogue Features)>> catalogues)
Parameters
luaEngineILuaEngineThe Lua engine.
datasetS101DatasetThe cell.
cataloguesFunc<CancellationToken, Task<(S101PortrayalCatalogue Portrayal, FeatureCatalogue Features)>>Loads the portrayal and feature catalogues.
Methods
AlertsAsync(IReadOnlyCollection<string>, MarinerSettings?, CancellationToken)
The alerts the features raise at the mariner settings.
public Task<IReadOnlyDictionary<string, IReadOnlyList<FeatureAlert>>> AlertsAsync(IReadOnlyCollection<string> featureIds, MarinerSettings? mariner, CancellationToken cancellationToken = default)
Parameters
featureIdsIReadOnlyCollection<string>The features' record ids, as strings.
marinerMarinerSettingsThe settings the rules see. A route check sets the safety contour and safety depth; the rest keep their defaults. null keeps the settings of the last call (else the defaults), for alerts that don't depend on them, such as
ProhAre.cancellationTokenCancellationTokenCancels the portrayal.
Returns
- Task<IReadOnlyDictionary<string, IReadOnlyList<FeatureAlert>>>
Each feature's alerts, distinct and in emission order; empty for a feature that raises none.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()