Beispiel #1
0
        private string BuildBody(MultipleTimeSeries multi)
        {
            SlimTimeSeries refTS = multi.TimeSeries[0] as SlimTimeSeries;

            if (refTS == null)
            {
                return("");
            }

            StringBuilder result = new StringBuilder();

            // Assumes
            // * If the first time series has values, then all have values
            // * all time series are the same length
            int len = refTS.Values.Length;

            for (int i = 0; i < len; i++)
            {
                string line = refTS.DateForTimeStep(i) + ",";
                line += String.Join(",", multi.TimeSeries.OfType <SlimTimeSeries>().Select(ts => ts.Values[i]));
                result.AppendLine(line);
            }

            return(result.ToString());
        }
Beispiel #2
0
        public SimpleDataDetails(DataDetailsItem item, bool summary = true, bool slim = false)
        {
            TimeSeries = summary
                ? new TimeSeriesReponseMeta(item.Data.TimeSeries)
                : new SimpleTimeSeries(item.Data.TimeSeries);

            if (slim && !summary)
            {
                TimeSeries = new SlimTimeSeries(TimeSeries);
            }

            _originalTimeSeries = item.Data.TimeSeries;
            Name = (item.DataInformation == null)?item.Data.TimeSeries.name : item.DataInformation.Name;
        }