public bool ValueLess(IBaseMean mean) { var rmean = (IReadMean)mean; var dt = DataType.Add(mean.DataType); switch (dt) { case DataType.Real: case DataType.Weighted: return(Real < rmean.Real); case DataType.String: return(String.CompareTo(rmean.String) < 0); case DataType.Integer: return(Integer < rmean.Integer); case DataType.Boolean: return(!Boolean && rmean.Boolean); case DataType.Time: return(Date < rmean.Date); } return(false); }
public bool ValueEquals(IBaseMean mean) { var rmean = (IReadMean)mean; var dt = DataType.Add(mean.DataType); switch (dt) { case DataType.Real: case DataType.Weighted: return(Real == rmean.Real); case DataType.String: return(String == rmean.String); case DataType.Integer: return(Integer == rmean.Integer); case DataType.Boolean: return(Boolean == rmean.Boolean); case DataType.Time: return(Date == rmean.Date); } return(false); }
public void AddValue(object value) { Count++; if (Value == null && value != null) { Value = value; } else { switch (Aggregate) { case EAggregate.Sum: case EAggregate.Average: Value = DataType.Add(SourceColumn.DataType, Value ?? 0, value); break; case EAggregate.Min: var compare = DataType.Compare(SourceColumn.DataType, value, Value); if (compare == DataType.ECompareResult.Less) { Value = value; } break; case EAggregate.Max: var compare1 = DataType.Compare(SourceColumn.DataType, value, Value); if (compare1 == DataType.ECompareResult.Greater) { Value = value; } break; } } }
//Формирует тип данных к которому сводятся оба типа, useParam - использовать при сравнении ParentParam public CalcType Add(CalcType type, bool useParam = false) { CalcType ct; if (LessOrEquals(type)) { ct = type.Clone(); } else if (type.LessOrEquals(this)) { ct = Clone(); } else if (ClassType == ClassType.Single && type.ClassType == ClassType.Single && IndexType == type.IndexType) { var dt = DataType.Add(type.DataType); if (dt == DataType.Error) { return(new CalcType(ClassType.Error)); } return(new CalcType(dt, IndexType)); } else { ct = new CalcType(ClassType.Max); } ct.ParentParams = !useParam ? null : type.ParentParams; ct.ArrayParentParams = !useParam ? null : type.ArrayParentParams; if (ClassType != ClassType.Undef) { ct.Text = null; ct.Signal = null; ct.InputSignals.Clear(); } return(ct); }
private void SetDefault() { DataType.Add(new JObject( new JProperty("list", "mainoutputlist"), new JProperty("data", "maindata"), new JProperty("tag", "Hlavní") )); DataType.Add(new JObject( new JProperty("list", "secondaryoutputlist"), new JProperty("data", "secondarydata"), new JProperty("tag", "Vedlejší") )); }