コード例 #1
0
        private void ShowAllData()
        {
            var list = new List<ListItem>();
            ResultsTitle.Text = _data.Count + " Results";

            for (int i = 0; i < _data.Count; ++i)
            {
                TimeSeries ts = _data[i];
                //ts.Resample(ts.Values.Count > Settings.NUM_SAMPLES ? Settings.NUM_SAMPLES : ts.Values.Count);
                //ts.Resample(Settings.NUM_SAMPLES);
                ts.Normalize();

                var item = new ListItem(_data[i], i + 1, 0);
                list.Add(item);
            }

            ResultScroller.ScrollToVerticalOffset(0);
            ResultList.DataContext = list;
        }
コード例 #2
0
        private void UpdateResults(IList<KeyValuePair<TimeSeries, TimeSeriesComparison>> comparisons)
        {
            IOrderedEnumerable<KeyValuePair<TimeSeries, TimeSeriesComparison>> result = comparisons.OrderBy(x => x.Value);
            var list = new List<ListItem>();
            ResultsTitle.Text = comparisons.Count + " Results";

            for (int i = 0; i < result.Count(); ++i)
            {
                TimeSeriesComparison comp = result.ElementAt(i).Value;
                TimeSeries ts = result.ElementAt(i).Key;
                ts.Resample(Settings.NUM_SAMPLES);
                ts.Normalize();

                var item = new ListItem(ts, comp.IsPruned, comp.Start, comp.End,
                    i + 1, result.ElementAt(i).Value.Error, (ButtonShowIndex.Visibility == Visibility.Collapsed));
                list.Add(item);
            }

            ResultScroller.ScrollToVerticalOffset(0);
            ResultList.DataContext = list;
        }
コード例 #3
0
        private void OnStockListItemSelect(object sender, SelectionChangedEventArgs e)
        {
            ListItem prevSelected = _selectedItem;
            _selectedItem = (ListItem)((ListBox)sender).SelectedItem;
            LineGraph graph = LineGraph;

            if (_selectedItem == null)
            {
                _selectedItem = prevSelected;
                return;
            }

            if (_selectedItem.IsPruned)
            {
                graph.Update(_selectedItem.TimeSeriesData, _selectedItem.TimeSeriesData,
                    _selectedItem.HighlightStart,
                    _selectedItem.HighlightEnd);
            }
            else
            {
                graph.Update(_selectedItem.TimeSeriesData, _selectedItem.TimeSeriesData);
            }

            ShowTab(_tabs.ElementAt(2));
        }