Class DefaultConnector<TAutomationConfig, TModelState, TModelStateBasePoco>
Default implementation of a model library for a simulator
public class DefaultConnector<TAutomationConfig, TModelState, TModelStateBasePoco> : ConnectorBase<DefaultConfig<TAutomationConfig>> where TAutomationConfig : AutomationConfig, new() where TModelState : ModelStateBase, new() where TModelStateBasePoco : ModelStateBasePoco
Type Parameters
TAutomationConfig
Type of the automation configuration
TModelState
Type of the model state
TModelStateBasePoco
Type of the model state POCO
- Inheritance
-
ConnectorBase<DefaultConfig<TAutomationConfig>>DefaultConnector<TAutomationConfig, TModelState, TModelStateBasePoco>
- Inherited Members
Constructors
DefaultConnector(CogniteDestination, DefaultConfig<TAutomationConfig>, DefaultModelLibrary<TAutomationConfig, TModelState, TModelStateBasePoco>, DefaultRoutineLibrary<TAutomationConfig>, DefaultSimulationRunner<TAutomationConfig, TModelState, TModelStateBasePoco>, DefaultSimulationScheduler<TAutomationConfig>, ExtractionPipeline, SimulatorCreate, ILogger<DefaultConnector<TAutomationConfig, TModelState, TModelStateBasePoco>>, RemoteConfigManager<DefaultConfig<TAutomationConfig>>, ISimulatorClient<TModelState, SimulatorRoutineRevision>, ScopedRemoteApiSink)
Creates an instance of the default connector
public DefaultConnector(CogniteDestination cdf, DefaultConfig<TAutomationConfig> config, DefaultModelLibrary<TAutomationConfig, TModelState, TModelStateBasePoco> modelLibrary, DefaultRoutineLibrary<TAutomationConfig> routineLibrary, DefaultSimulationRunner<TAutomationConfig, TModelState, TModelStateBasePoco> runner, DefaultSimulationScheduler<TAutomationConfig> scheduler, ExtractionPipeline pipeline, SimulatorCreate simulatorDefinition, ILogger<DefaultConnector<TAutomationConfig, TModelState, TModelStateBasePoco>> logger, RemoteConfigManager<DefaultConfig<TAutomationConfig>> remoteConfigManager, ISimulatorClient<TModelState, SimulatorRoutineRevision> simulatorClient, ScopedRemoteApiSink sink)
Parameters
cdf
CogniteDestinationconfig
DefaultConfig<TAutomationConfig>modelLibrary
DefaultModelLibrary<TAutomationConfig, TModelState, TModelStateBasePoco>routineLibrary
DefaultRoutineLibrary<TAutomationConfig>runner
DefaultSimulationRunner<TAutomationConfig, TModelState, TModelStateBasePoco>scheduler
DefaultSimulationScheduler<TAutomationConfig>pipeline
ExtractionPipelinesimulatorDefinition
SimulatorCreatelogger
ILogger<DefaultConnector<TAutomationConfig, TModelState, TModelStateBasePoco>>remoteConfigManager
RemoteConfigManager<DefaultConfig<TAutomationConfig>>simulatorClient
ISimulatorClient<TModelState, SimulatorRoutineRevision>sink
ScopedRemoteApiSink
Methods
GetConnectorVersion(CancellationToken)
Returns the connector version. This is reported periodically to CDF
public override string GetConnectorVersion(CancellationToken token)
Parameters
token
CancellationToken
Returns
- string
Connector version
GetSimulatorVersion(string, CancellationToken)
Returns the version of the given simulator. The connector reads the version and report it back to CDF
public override string GetSimulatorVersion(string simulator, CancellationToken token)
Parameters
simulator
stringName of the simulator
token
CancellationTokenCancellation token
Returns
- string
Version
Init(CancellationToken)
Initialize the connector. Should include any initialization tasks to be performed before the connector loop. This should include a call to InitRemoteSimulatorIntegration
public override Task Init(CancellationToken token)
Parameters
token
CancellationTokenCancellation token
Returns
Run(CancellationToken)
Run the main loop of the connector
public override Task Run(CancellationToken token)
Parameters
token
CancellationToken