Class DefaultModelLibrary<TAutomationConfig, TModelStateBase, TModelStateBasePoco>
Default implementation of a model library for a simulator
public class DefaultModelLibrary<TAutomationConfig, TModelStateBase, TModelStateBasePoco> : ModelLibraryBase<TAutomationConfig, TModelStateBase, TModelStateBasePoco, ModelParsingInfo>, IModelProvider<TAutomationConfig, TModelStateBase>, IDisposable where TAutomationConfig : AutomationConfig, new() where TModelStateBase : ModelStateBase, new() where TModelStateBasePoco : ModelStateBasePoco
Type Parameters
TAutomationConfigType of the automation configuration
TModelStateBaseType of the model state
TModelStateBasePocoType 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>, SimulatorCreate, 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, SimulatorCreate simulatorDefinition, FileStorageClient client, IExtractionStateStore store = null)
Parameters
configDefaultConfig<TAutomationConfig>cdfCogniteDestinationloggerILogger<DefaultModelLibrary<TAutomationConfig, TModelStateBase, TModelStateBasePoco>>simulatorClientISimulatorClient<TModelStateBase, SimulatorRoutineRevision>simulatorDefinitionSimulatorCreateclientFileStorageClientstoreIExtractionStateStore
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
stateTModelStateBaseModel file states
tokenCancellationTokenCancellation token
Returns
StateFromModelRevision(SimulatorModelRevision)
Creates a state object of type TModelStateBase from a
CDF Simulator model revision passed as parameter
protected override TModelStateBase StateFromModelRevision(SimulatorModelRevision modelRevision)
Parameters
modelRevisionSimulatorModelRevisionCDF Simulator model revision
Returns
- TModelStateBase
File state object