private void AddPointInPoints(string numTableString, TimeAndFileSize newStr, ArrayList _tableForm) { //Polyline3.Points.Clear(); double maxY = newStr.SizeMegabyte; foreach (var item in _tableForm) { double tekY = ((FileChangeChecker.TimeAndFileSize)(item)).SizeMegabyte; if (tekY > maxY) { maxY = tekY; } } int newCountPoints = _tableForm.Count; double widthField = ((System.Windows.FrameworkElement)(Canvas3)).Width; double stepX; if (newCountPoints == 1) { stepX = widthField; } else { stepX = widthField / (newCountPoints - 1); } double heightField = ((System.Windows.FrameworkElement)(Canvas3)).Height; double koeffizientY; if (maxY == 0) { koeffizientY = 1; } else { koeffizientY = heightField / maxY; } //gg HarmonicSeries wave = new HarmonicSeries(); WpfApplication1.MyVisual class_Polyline = new MyVisual(); //class_Polyline.VisualXSnappingGuidelines.Add(stepX); //class_Polyline.Test(); Polyline polyline1 = new Polyline(); //polyline1.v Polyline3.Points.Clear(); for (int i = 0; i <= newCountPoints - 1; ++i) { double x = i * stepX; double y = -1 * koeffizientY * ((FileChangeChecker.TimeAndFileSize)(_tableForm[i])).SizeMegabyte; //Polyline3.GuidelineSet = true; Polyline3.Points.Add(new Point(x, y)); } }
public void AddLineToChart(int numTable, TimeAndFileSize newStr) { String numTableString = numTable.ToString(); Dispatcher.BeginInvoke(new ThreadStart(delegate { //график string _mHour = newStr.Date.Hour.ToString(); if (_mHour.Length == 1) { _mHour = "0" + _mHour; } string _mMinute = newStr.Date.Minute.ToString(); if (_mMinute.Length == 1) { _mMinute = "0" + _mMinute; } string _xCategory = _mHour + ":" + _mMinute; int numChart = 0; int _otherNumTable = 0; if ((numTable % 2) == 0) { numChart = 0; _otherNumTable = 1; } else { numChart = 1; _otherNumTable = 0; } int numRadChart = numTable / 2; string _elementName = "RadChart" + numRadChart.ToString(); RadChart _elementRadChart = FindElementRadChart(this.GridTable.Children, _elementName); DataSeries lineSeries = _elementRadChart.DefaultView.ChartArea.DataSeries[numChart]; AddPointInChart(lineSeries, _xCategory, newStr.SizeMegabyte, true); //другая линия lineSeries = _elementRadChart.DefaultView.ChartArea.DataSeries[_otherNumTable]; AddPointInChart(lineSeries, _xCategory, 0, false); //- })); }
public void AddRowToTable(int numTable, TimeAndFileSize newStr) { String numTableString = numTable.ToString(); Dispatcher.BeginInvoke(new ThreadStart(delegate { string _elementName = "DockPanel" + numTableString; DockPanel _elementDockPanel = FindElementDockPanel(this.GridTable.Children, _elementName); _elementName = "TableExchange" + numTableString; ListView _elementTable = FindElementListView(_elementDockPanel.Children, _elementName); ArrayList _tableForm = (ArrayList)_elementTable.Resources["teams"]; ((ArrayList)_tableForm).Add(newStr); _elementTable.Items.Refresh(); if (numTable == 0) { AddPointInPoints(numTableString, newStr, _tableForm); } })); }
public void AddRowToTable(int numTable, TimeAndFileSize newStr) { String numTableString = numTable.ToString(); Dispatcher.BeginInvoke(new ThreadStart(delegate { //добавление в таблицы string _elementName = "DockPanel" + numTableString; DockPanel _elementDockPanel = FindElementDockPanel(this.GridTable.Children, _elementName); _elementName = "TableExchange" + numTableString; ListView _elementTable = FindElementListView(_elementDockPanel.Children,_elementName); ArrayList _tableForm = (ArrayList)_elementTable.Resources["teams"]; ((ArrayList)_tableForm).Add(newStr); _elementTable.Items.Refresh(); //- //график string _xCategory = newStr.Date.Hour.ToString() + ":" + newStr.Date.Minute.ToString(); DataSeries lineSeries = RadChart0.DefaultView.ChartArea.DataSeries[numTable]; AddPointInChart(lineSeries, _xCategory, newStr.SizeMegabyte, true); //другая линия int _otherNumTable = 0; if (numTable==0) {_otherNumTable = 1;} else {_otherNumTable = 0;} lineSeries = RadChart0.DefaultView.ChartArea.DataSeries[_otherNumTable]; AddPointInChart(lineSeries, _xCategory,0,false); //- if (numTable==0) { AddPointInPoints(numTableString, newStr, _tableForm); } })); }