예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
 public void Add(Res1DData res1DData) => Add(res1DData.Keys, res1DData.Values);