Table of Contents

Class ModelStateBase

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

This base class represents the state of a model file TODO: See if we can remove FileState completely and move all the variables into this class Jira: https://cognitedata.atlassian.net/browse/POFSP-558

public abstract class ModelStateBase : FileState, IExtractionState
Inheritance
ModelStateBase
Implements
IExtractionState
Derived
Inherited Members

Constructors

ModelStateBase()

Creates a new model file state with the provided id

public ModelStateBase()

Properties

CanRead

Indicates if the simulator can read the model file and its data

public bool CanRead { get; set; }

Property Value

bool

IsExtracted

Indicates if information has been extracted from the model file

public abstract bool IsExtracted { get; }

Property Value

bool

Model

Model data associated with this state

public SimulatorModelInfo Model { get; }

Property Value

SimulatorModelInfo

ParsingInfo

Information about model parsing

public ModelParsingInfo ParsingInfo { get; set; }

Property Value

ModelParsingInfo

Methods

Init(FileStatePoco)

Initialize this model state using a data object from the state store

public override void Init(FileStatePoco poco)

Parameters

poco FileStatePoco

Data object

ShouldProcess()

If true, the local file will be opened and parsed by the connector. By default, this happens only once per model revision. Can be overridden, when re-parsing on every download is preferred.

public virtual bool ShouldProcess()

Returns

bool

SyncProperties<TSource, TTarget>(TSource, TTarget)

Copies matching properties from the source object to the target object. Only properties with the same name and type are copied.

public static TTarget SyncProperties<TSource, TTarget>(TSource source, TTarget target) where TSource : class where TTarget : class

Parameters

source TSource
target TTarget

Returns

TTarget

Type Parameters

TSource
TTarget