Table of Contents

Class DefaultModelLibrary<TAutomationConfig, TModelStateBase, TModelStateBasePoco>

Namespace
Cognite.Simulator.Utils
Assembly
Cognite.Simulator.Utils.dll

Default implementation of a model library for a simulator

public class DefaultModelLibrary<TAutomationConfig, TModelStateBase, TModelStateBasePoco> : ModelLibraryBase<TAutomationConfig, TModelStateBase, TModelStateBasePoco, ModelParsingInfo>, IModelProvider<TAutomationConfig, TModelStateBase> where TAutomationConfig : AutomationConfig, new() where TModelStateBase : ModelStateBase, new() where TModelStateBasePoco : ModelStateBasePoco

Type Parameters

TAutomationConfig

Type of the automation configuration

TModelStateBase

Type of the model state

TModelStateBasePoco

Type of the model state POCO

Inheritance
ModelLibraryBase<TAutomationConfig, TModelStateBase, TModelStateBasePoco, ModelParsingInfo>
DefaultModelLibrary<TAutomationConfig, TModelStateBase, TModelStateBasePoco>
Implements
IModelProvider<TAutomationConfig, TModelStateBase>
Inherited Members

Constructors

DefaultModelLibrary(DefaultConfig<TAutomationConfig>, CogniteDestination, ILogger<DefaultModelLibrary<TAutomationConfig, TModelStateBase, TModelStateBasePoco>>, ISimulatorClient<TModelStateBase, SimulatorRoutineRevision>, FileStorageClient, IExtractionStateStore)

Creates an instance of the model library

public DefaultModelLibrary(DefaultConfig<TAutomationConfig> config, CogniteDestination cdf, ILogger<DefaultModelLibrary<TAutomationConfig, TModelStateBase, TModelStateBasePoco>> logger, ISimulatorClient<TModelStateBase, SimulatorRoutineRevision> simulatorClient, FileStorageClient client, IExtractionStateStore store = null)

Parameters

config DefaultConfig<TAutomationConfig>
cdf CogniteDestination
logger ILogger<DefaultModelLibrary<TAutomationConfig, TModelStateBase, TModelStateBasePoco>>
simulatorClient ISimulatorClient<TModelStateBase, SimulatorRoutineRevision>
client FileStorageClient
store IExtractionStateStore

Methods

ExtractModelInformation(TModelStateBase, CancellationToken)

This method should open the model versions in the simulator, extract the required information and ingest it to CDF.

protected override Task ExtractModelInformation(TModelStateBase state, CancellationToken token)

Parameters

state TModelStateBase
token CancellationToken

Cancellation token

Returns

Task

StateFromModelRevision(SimulatorModelRevision)

Creates a state object of type T from a CDF Simulator model revision passed as parameter

protected override TModelStateBase StateFromModelRevision(SimulatorModelRevision modelRevision)

Parameters

modelRevision SimulatorModelRevision

CDF Simulator model revision

Returns

TModelStateBase

File state object