private static float[] GetReach(string quantity, bool?atFromNode, IDataItem dataItem) { if (atFromNode.HasValue) { var elementIndex = (bool)atFromNode ? 0 : dataItem.NumberOfElements - 1; return(dataItem.CreateTimeSeriesData(elementIndex)); } else if (quantity.Contains("Volume")) // Sum all HD points ToDo: handle depending on quantity { float[] sum = dataItem.CreateTimeSeriesData(0); for (var i = 1; i < dataItem.NumberOfElements; i++) { sum = Res1DData.Sum(sum, dataItem.CreateTimeSeriesData(i)); } return(sum); } return(null); }
public Res1DData Get(IList <Res1DQuery> queries) { var results = new Res1DData(); foreach (var query in queries) { if (DoResample) { foreach (var data in query.GetData(this)) { results.Add(query + data.Key, Resample(query.Res1DFileKey, data.Value)); } } else { results.Add(query.GetData(this)); } } return(results); }
public void Add(Res1DData res1DData) => Add(res1DData.Keys, res1DData.Values);