/// <summary> /// Gets the name of the resulted property. /// </summary> /// <param name="propertyAggregationType">Property aggregation type.</param> /// <param name="samplingTypeName">Sampling type to which aggregation is applied.</param> /// <returns>Name of the property.</returns> public static string GetPropertyName(PropertyAggregationType propertyAggregationType, string samplingTypeName) { switch (propertyAggregationType) { case PropertyAggregationType.Average: return($"TAVG({samplingTypeName})"); case PropertyAggregationType.Sum: return($"TSUM({samplingTypeName})"); case PropertyAggregationType.Max: return($"TMAX({samplingTypeName})"); case PropertyAggregationType.Min: return($"TMIN({samplingTypeName})"); default: throw new ArgumentException($"Unexpected propertyAggregationType: {propertyAggregationType}.", nameof(propertyAggregationType)); } }
public PropertyDefinition(PropertyAggregationType propertyAggregationType, SamplingType samplingType) { this.PropertyAggregationType = propertyAggregationType; this.SamplingType = samplingType; this.PropertyName = GetPropertyName(this.PropertyAggregationType, this.SamplingType.Name); }