Example #1
0
 //Constructor
 /// <summary>
 /// Creates an initialized instance
 /// </summary>
 /// <param name="availableFieldNames">Collection of names of all available input fields</param>
 /// <param name="settings">Configuration</param>
 public DiffTransformer(List <string> availableFieldNames, DiffTransformerSettings settings)
 {
     _settings = (DiffTransformerSettings)settings.DeepClone();
     _fieldIdx = availableFieldNames.IndexOf(_settings.InputFieldName);
     if (_fieldIdx == -1)
     {
         throw new InvalidOperationException($"Input field name {_settings.InputFieldName} not found among given available fields.");
     }
     _lastValues = new SimpleQueue <double>(_settings.Interval);
     return;
 }
Example #2
0
 /// <summary>
 /// The deep copy constructor.
 /// </summary>
 /// <param name="source">The source instance.</param>
 public DiffTransformerSettings(DiffTransformerSettings source)
     : this(source.InputFieldName, source.PastInterval)
 {
     return;
 }