public sub_line(DestinationAlgorithms _dest_alg, horizontal_line _horiz_line, double startY, int from_id, int to_id) { this._dest_alg = _dest_alg; this._horiz_line = _horiz_line; this.from_id = from_id; this.to_id = to_id; SubLineHorizontal = new Line(); SubLineHorizontal.Stroke = Brushes.Blue; SubLineHorizontal.StrokeThickness = 0.2; ((Line)SubLineHorizontal).X1 = 50; ((Line)SubLineHorizontal).Y1 = startY; ((Line)SubLineHorizontal).X2 = 9950; ((Line)SubLineHorizontal).Y2 = startY; posY = startY; if (_horiz_line.SubLinesHorizontal == null) _horiz_line.SubLinesHorizontal = new List<sub_line>(); _horiz_line.SubLinesHorizontal.Add(this); label_horizontal = new Label(); label_horizontal.HorizontalContentAlignment = HorizontalAlignment.Center; label_horizontal.HorizontalContentAlignment = HorizontalAlignment.Center; label_horizontal.FontSize = 8; label_horizontal.Content = from_id + "-" + to_id; label_horizontal.Width = 30; _dest_alg.GantCanvas.Children.Add(SubLineHorizontal); _dest_alg.GantCanvas.Children.Add(label_horizontal); Canvas.SetZIndex(SubLineHorizontal, 0); Canvas.SetZIndex(label_horizontal, 2); Canvas.SetLeft(label_horizontal, 25); Canvas.SetTop(label_horizontal, startY - 12); }
public Window1(graph_view _grView, graph_viewCS _grViewCS, DestinationAlgorithms _destin_alg, double propuskChannels, double proizvodProcessors, bool isDuplex, int countLinks, Canvas canvas) { InitializeComponent(); this.proizvodProcessors = proizvodProcessors; this.propuskChannels = propuskChannels; this.isDuplex = isDuplex; this.countLinks = countLinks; this.canvas = canvas; this._grView = _grView; this._grViewCS = _grViewCS; this._destin_alg = _destin_alg; }
public horizontal_line(DestinationAlgorithms _dest_alg, double startY, int count, int id, List <int> to_id) { this._dest_alg = _dest_alg; this.startY = startY; this.id = id; this.to_id = to_id; this.sub_interval_horizontal = (_dest_alg.interval_horizontal - 20) / (count); endX = 50; LineHorizontal = new Line(); LineHorizontal.Stroke = Brushes.Blue; LineHorizontal.StrokeThickness = 1; ((Line)LineHorizontal).X1 = 50; ((Line)LineHorizontal).Y1 = startY; ((Line)LineHorizontal).X2 = 9950; ((Line)LineHorizontal).Y2 = startY; _dest_alg.LinesHorizontal.Add(this); label_horizontal = new Label(); label_horizontal.HorizontalContentAlignment = HorizontalAlignment.Center; label_horizontal.HorizontalContentAlignment = HorizontalAlignment.Center; label_horizontal.FontSize = 12; label_horizontal.Content = id.ToString(); label_horizontal.Width = 30; label_horizontal.FontWeight = FontWeights.Bold; _dest_alg.GantCanvas.Children.Add(LineHorizontal); _dest_alg.GantCanvas.Children.Add(label_horizontal); Canvas.SetZIndex(LineHorizontal, 0); Canvas.SetZIndex(label_horizontal, 2); Canvas.SetLeft(label_horizontal, 25); Canvas.SetTop(label_horizontal, startY - 15); if (sub_interval_horizontal >= 20) { startY -= sub_interval_horizontal; } else { startY -= 20; } for (int i = 0; i < to_id.Count; i++) { sub_line horiz_line = new sub_line(_dest_alg, this, startY, id, to_id[i]); startY -= sub_interval_horizontal; } }
public horizontal_line(DestinationAlgorithms _dest_alg, double startY, int count, int id, List<int> to_id) { this._dest_alg = _dest_alg; this.startY = startY; this.id = id; this.to_id = to_id; this.sub_interval_horizontal = (_dest_alg.interval_horizontal-20) / (count); endX = 50; LineHorizontal = new Line(); LineHorizontal.Stroke = Brushes.Blue; LineHorizontal.StrokeThickness = 1; ((Line)LineHorizontal).X1 = 50; ((Line)LineHorizontal).Y1 = startY; ((Line)LineHorizontal).X2 = 9950; ((Line)LineHorizontal).Y2 = startY; _dest_alg.LinesHorizontal.Add(this); label_horizontal = new Label(); label_horizontal.HorizontalContentAlignment = HorizontalAlignment.Center; label_horizontal.HorizontalContentAlignment = HorizontalAlignment.Center; label_horizontal.FontSize = 12; label_horizontal.Content = id.ToString(); label_horizontal.Width = 30; label_horizontal.FontWeight = FontWeights.Bold; _dest_alg.GantCanvas.Children.Add(LineHorizontal); _dest_alg.GantCanvas.Children.Add(label_horizontal); Canvas.SetZIndex(LineHorizontal, 0); Canvas.SetZIndex(label_horizontal, 2); Canvas.SetLeft(label_horizontal, 25); Canvas.SetTop(label_horizontal, startY - 15); if (sub_interval_horizontal >= 20) startY -= sub_interval_horizontal; else startY -= 20; for (int i = 0; i < to_id.Count; i++) { sub_line horiz_line = new sub_line(_dest_alg, this, startY, id, to_id[i]); startY -= sub_interval_horizontal; } }
public work_view(DestinationAlgorithms _dest_alg, string top_id, double top_weight, double from_x, double from_y, int proc_id) { this._dest_alg = _dest_alg; Rectangle = new Rectangle(); Rectangle.Fill = Brushes.White; Rectangle.Stroke = Brushes.Black; Rectangle.StrokeThickness = 2; rect_height = ((Rectangle)Rectangle).Height = 20; rect_width = ((Rectangle)Rectangle).Width = top_weight; end_x = from_x + rect_width; end_y = from_y + rect_height; this.proc_id = proc_id; _dest_alg.LinesHorizontal.Find(x => x.id.Equals(proc_id)).endX = end_x; _dest_alg.WorkList.Add(this); label1 = new Label(); label1.Width = top_weight; label1.VerticalContentAlignment = VerticalAlignment.Center; label1.HorizontalContentAlignment = HorizontalAlignment.Center; label1.FontSize = 12; label1.FontWeight = FontWeights.Bold; label1.Content = top_id; rect_id = int.Parse(top_id); _dest_alg.GantCanvas.Children.Add(label1); _dest_alg.GantCanvas.Children.Add(Rectangle); Canvas.SetZIndex(Rectangle, 0); Canvas.SetZIndex(label1, 2); position = new Point(from_x, from_y); Canvas.SetLeft(Rectangle, from_x); Canvas.SetTop(Rectangle, from_y); Canvas.SetLeft(label1, from_x); Canvas.SetTop(label1, from_y - 4); }
public sub_line(DestinationAlgorithms _dest_alg, horizontal_line _horiz_line, double startY, int from_id, int to_id) { this._dest_alg = _dest_alg; this._horiz_line = _horiz_line; this.from_id = from_id; this.to_id = to_id; SubLineHorizontal = new Line(); SubLineHorizontal.Stroke = Brushes.Blue; SubLineHorizontal.StrokeThickness = 0.2; ((Line)SubLineHorizontal).X1 = 50; ((Line)SubLineHorizontal).Y1 = startY; ((Line)SubLineHorizontal).X2 = 9950; ((Line)SubLineHorizontal).Y2 = startY; posY = startY; if (_horiz_line.SubLinesHorizontal == null) { _horiz_line.SubLinesHorizontal = new List <sub_line>(); } _horiz_line.SubLinesHorizontal.Add(this); label_horizontal = new Label(); label_horizontal.HorizontalContentAlignment = HorizontalAlignment.Center; label_horizontal.HorizontalContentAlignment = HorizontalAlignment.Center; label_horizontal.FontSize = 8; label_horizontal.Content = from_id + "-" + to_id; label_horizontal.Width = 30; _dest_alg.GantCanvas.Children.Add(SubLineHorizontal); _dest_alg.GantCanvas.Children.Add(label_horizontal); Canvas.SetZIndex(SubLineHorizontal, 0); Canvas.SetZIndex(label_horizontal, 2); Canvas.SetLeft(label_horizontal, 25); Canvas.SetTop(label_horizontal, startY - 12); }
public sub_work_view(DestinationAlgorithms _dest_alg, int from_id, int to_id, double top_weight, double from_x, double from_y, int sub_work_id) { this._dest_alg = _dest_alg; Rectangle = new Rectangle(); Rectangle.Fill = Brushes.White; Rectangle.Stroke = Brushes.Black; Rectangle.StrokeThickness = 1; rect_height = ((Rectangle)Rectangle).Height = 10; rect_width = ((Rectangle)Rectangle).Width = top_weight; this.to_id = to_id; start_x = from_x; end_x = from_x + rect_width; end_y = from_y + rect_height; this.sub_work_id = sub_work_id; // this.sub_line_id = sub_line_id; _dest_alg.SubWorkList.Add(this); _dest_alg.SubWorkTestList.Add(this); label1 = new Label(); // label1.Width = top_weight; label1.VerticalContentAlignment = VerticalAlignment.Center; label1.HorizontalContentAlignment = HorizontalAlignment.Center; label1.FontSize = 10; label1.Content = lbl = from_id + "-" + to_id; _dest_alg.GantCanvas.Children.Add(label1); _dest_alg.GantCanvas.Children.Add(Rectangle); Canvas.SetZIndex(Rectangle, 0); Canvas.SetZIndex(label1, 2); Canvas.SetLeft(Rectangle, from_x); Canvas.SetTop(Rectangle, from_y); Canvas.SetLeft(label1, from_x-2); Canvas.SetTop(label1, from_y-8); }
public sub_work_view(DestinationAlgorithms _dest_alg, int from_id, int to_id, double top_weight, double from_x, double from_y, int sub_work_id) { this._dest_alg = _dest_alg; Rectangle = new Rectangle(); Rectangle.Fill = Brushes.White; Rectangle.Stroke = Brushes.Black; Rectangle.StrokeThickness = 1; rect_height = ((Rectangle)Rectangle).Height = 10; rect_width = ((Rectangle)Rectangle).Width = top_weight; this.to_id = to_id; start_x = from_x; end_x = from_x + rect_width; end_y = from_y + rect_height; this.sub_work_id = sub_work_id; // this.sub_line_id = sub_line_id; _dest_alg.SubWorkList.Add(this); _dest_alg.SubWorkTestList.Add(this); label1 = new Label(); // label1.Width = top_weight; label1.VerticalContentAlignment = VerticalAlignment.Center; label1.HorizontalContentAlignment = HorizontalAlignment.Center; label1.FontSize = 10; label1.Content = lbl = from_id + "-" + to_id; _dest_alg.GantCanvas.Children.Add(label1); _dest_alg.GantCanvas.Children.Add(Rectangle); Canvas.SetZIndex(Rectangle, 0); Canvas.SetZIndex(label1, 2); Canvas.SetLeft(Rectangle, from_x); Canvas.SetTop(Rectangle, from_y); Canvas.SetLeft(label1, from_x - 2); Canvas.SetTop(label1, from_y - 8); }
private void Button_Click_Gant(object sender, EventArgs e) { int algorithm = -1, destination_algorithm = -1; if (radBtnAlg2.IsChecked == true) algorithm = 2; else if (radBtnAlg3.IsChecked == true) algorithm = 3; else if (radBtnAlg12.IsChecked == true) algorithm = 12; if (radBtnDestAlg4.IsChecked == true) destination_algorithm = 4; else if (radBtnDestAlg5.IsChecked == true) destination_algorithm = 5; else if (radBtnDestAlg6.IsChecked == true) destination_algorithm = 6; bool isDuplex = true; if (radBtnDuplex.IsChecked == false) isDuplex = false; int countLinks = int.Parse(txtBoxLinks.Text); double proizvodProcessors = double.Parse(txtBoxProcessors.Text); double propuskChannels = double.Parse(txtBoxChannels.Text); _destin_alg = new DestinationAlgorithms(canvasGant, _grView, _grViewCS, propuskChannels, proizvodProcessors, isDuplex, countLinks); if (algorithm != -1 && destination_algorithm != -1) _destin_alg.test(algorithm, destination_algorithm, true); else MessageBox.Show("Для побудови діаграми Ганта необхідно обрати алгоритми"); }
private void Button_Click_1(object sender, RoutedEventArgs e) { Dictionary<double, List<double>> dict_Kp = new Dictionary<double, List<double>>(); Dictionary<double, List<double>> dict_Ke = new Dictionary<double, List<double>>(); Dictionary<double, List<double>> dict_Keap = new Dictionary<double, List<double>>(); Dictionary<double, List<double>> dict_Time = new Dictionary<double, List<double>>(); int int_minCountTops = int.Parse(minCountTops.Text); int int_maxCountTops = int.Parse(maxCountTops.Text); int int_stepCountTops = int.Parse(stepCountTops.Text); int int_minConnected = Convert.ToInt32(double.Parse(minConnected.Text) * 100); int int_maxConnected = Convert.ToInt32(double.Parse(maxConnected.Text) * 100); int int_stepConnected = Convert.ToInt32(double.Parse(stepConnected.Text) * 100); int int_minWeightTops = int.Parse(minWeightTops.Text); int int_maxWeightTops = int.Parse(maxWeightTops.Text); int int_countGraphs = int.Parse(countGraphs.Text); int k = 0; string str = ""; for (int i = int_minConnected; i <= int_maxConnected; i += int_stepConnected) { double coherence = Convert.ToDouble(i) / 100; dict_Kp[coherence] = new List<double>(); dict_Ke[coherence] = new List<double>(); dict_Keap[coherence] = new List<double>(); dict_Time[coherence] = new List<double>(); k = 0; for (int j = int_minCountTops; k < int_countGraphs; j += int_stepCountTops, k++) { _grView.ClearAll(); if (j > int_maxCountTops) j = int_minCountTops; _grView.GenerateGraph(j, int_minWeightTops, int_maxWeightTops, coherence); _destin_alg = new DestinationAlgorithms(canvas, _grView, _grViewCS, propuskChannels, proizvodProcessors, isDuplex, countLinks); // str += "Зв'язність " + coherence + "\n" +_destin_alg.test(2, 4, false); str += "Зв'язність " + coherence + "\n" + _destin_alg.test(2, 4, false); dict_Kp[coherence].Add(_destin_alg.Kp); dict_Ke[coherence].Add(_destin_alg.Ke); dict_Time[coherence].Add(_destin_alg.Time); dict_Keap[coherence].Add(_destin_alg.Keap); _destin_alg = new DestinationAlgorithms(canvas, _grView, _grViewCS, propuskChannels, proizvodProcessors, isDuplex, countLinks); str += "Зв'язність " + coherence + "\n" + _destin_alg.test(2, 5, false); dict_Kp[coherence].Add(_destin_alg.Kp); dict_Ke[coherence].Add(_destin_alg.Ke); dict_Time[coherence].Add(_destin_alg.Time); dict_Keap[coherence].Add(_destin_alg.Keap); _destin_alg = new DestinationAlgorithms(canvas, _grView, _grViewCS, propuskChannels, proizvodProcessors, isDuplex, countLinks); str += "Зв'язність " + coherence + "\n" + _destin_alg.test(2, 6, false); dict_Kp[coherence].Add(_destin_alg.Kp); dict_Ke[coherence].Add(_destin_alg.Ke); dict_Time[coherence].Add(_destin_alg.Time); dict_Keap[coherence].Add(_destin_alg.Keap); _destin_alg = new DestinationAlgorithms(canvas, _grView, _grViewCS, propuskChannels, proizvodProcessors, isDuplex, countLinks); str += "Зв'язність " + coherence + "\n" + _destin_alg.test(3, 4, false); dict_Kp[coherence].Add(_destin_alg.Kp); dict_Ke[coherence].Add(_destin_alg.Ke); dict_Time[coherence].Add(_destin_alg.Time); dict_Keap[coherence].Add(_destin_alg.Keap); _destin_alg = new DestinationAlgorithms(canvas, _grView, _grViewCS, propuskChannels, proizvodProcessors, isDuplex, countLinks); str += "Зв'язність " + coherence + "\n" + _destin_alg.test(3, 5, false); dict_Kp[coherence].Add(_destin_alg.Kp); dict_Ke[coherence].Add(_destin_alg.Ke); dict_Time[coherence].Add(_destin_alg.Time); dict_Keap[coherence].Add(_destin_alg.Keap); _destin_alg = new DestinationAlgorithms(canvas, _grView, _grViewCS, propuskChannels, proizvodProcessors, isDuplex, countLinks); str += "Зв'язність " + coherence + "\n" + _destin_alg.test(3, 6, false); dict_Kp[coherence].Add(_destin_alg.Kp); dict_Ke[coherence].Add(_destin_alg.Ke); dict_Time[coherence].Add(_destin_alg.Time); dict_Keap[coherence].Add(_destin_alg.Keap); _destin_alg = new DestinationAlgorithms(canvas, _grView, _grViewCS, propuskChannels, proizvodProcessors, isDuplex, countLinks); str += "Зв'язність " + coherence + "\n" + _destin_alg.test(12, 4, false); dict_Kp[coherence].Add(_destin_alg.Kp); dict_Ke[coherence].Add(_destin_alg.Ke); dict_Time[coherence].Add(_destin_alg.Time); dict_Keap[coherence].Add(_destin_alg.Keap); _destin_alg = new DestinationAlgorithms(canvas, _grView, _grViewCS, propuskChannels, proizvodProcessors, isDuplex, countLinks); str += "Зв'язність " + coherence + "\n" + _destin_alg.test(12, 5, false); dict_Kp[coherence].Add(_destin_alg.Kp); dict_Ke[coherence].Add(_destin_alg.Ke); dict_Time[coherence].Add(_destin_alg.Time); dict_Keap[coherence].Add(_destin_alg.Keap); _destin_alg = new DestinationAlgorithms(canvas, _grView, _grViewCS, propuskChannels, proizvodProcessors, isDuplex, countLinks); str += "Зв'язність " + coherence + "\n" + _destin_alg.test(12, 6, false); dict_Kp[coherence].Add(_destin_alg.Kp); dict_Ke[coherence].Add(_destin_alg.Ke); dict_Time[coherence].Add(_destin_alg.Time); dict_Keap[coherence].Add(_destin_alg.Keap); } } FileStream fs = new FileStream("test.txt", FileMode.Create); StreamWriter w = new StreamWriter(fs, Encoding.UTF8); w.WriteLine(str); w.Flush(); w.Close(); fs.Close(); SaveWord(dict_Kp, dict_Ke, dict_Keap, dict_Time); MessageBox.Show("Результати записані"); this.Close(); }
private void Button_Click_2(object sender, RoutedEventArgs e) { Dictionary<double, List<double>> dict_KpDuplex = new Dictionary<double, List<double>>(); // Dictionary<int, List<double>> dict_KpLink = new Dictionary<int, List<double>>(); Dictionary<double, List<double>> dict_TimeDuplex = new Dictionary<double, List<double>>(); // Dictionary<int, List<double>> dict_TimeLink = new Dictionary<int, List<double>>(); int int_minCountTops = int.Parse(minCountTops.Text); int int_maxCountTops = int.Parse(maxCountTops.Text); int int_stepCountTops = int.Parse(stepCountTops.Text); int int_minConnected = Convert.ToInt32(double.Parse(minConnected.Text) * 100); int int_maxConnected = Convert.ToInt32(double.Parse(maxConnected.Text) * 100); int int_stepConnected = Convert.ToInt32(double.Parse(stepConnected.Text) * 100); int int_minWeightTops = int.Parse(minWeightTops.Text); int int_maxWeightTops = int.Parse(maxWeightTops.Text); int int_countGraphs = int.Parse(countGraphs.Text); int int_minCountLinks = int.Parse(minCountLinks.Text); int int_maxCountLinks = int.Parse(maxCountLinks.Text); Dictionary<double, Dictionary<int, List<double>>> dict_Kp = new Dictionary<double, Dictionary<int, List<double>>>(); Dictionary<double, Dictionary<int, List<double>>> dict_Time = new Dictionary<double, Dictionary<int, List<double>>>(); int k = 0; string str = ""; for (int i = int_minConnected; i <= int_maxConnected; i += int_stepConnected) { double coherence = Convert.ToDouble(i) / 100; dict_KpDuplex[coherence] = new List<double>(); dict_TimeDuplex[coherence] = new List<double>(); k = 0; for (int j = int_minCountTops; k < int_countGraphs; j += int_stepCountTops, k++) { _grView.ClearAll(); if (j > int_maxCountTops) j = int_minCountTops; _grView.GenerateGraph(j, int_minWeightTops, int_maxWeightTops, coherence); _destin_alg = new DestinationAlgorithms(canvas, _grView, _grViewCS, propuskChannels, proizvodProcessors, true, countLinks); str += "Д Зв'язність " + coherence + "\n" + _destin_alg.test(2, 5, false); dict_KpDuplex[coherence].Add(_destin_alg.Kp); dict_TimeDuplex[coherence].Add(_destin_alg.Time); _destin_alg = new DestinationAlgorithms(canvas, _grView, _grViewCS, propuskChannels, proizvodProcessors, false, countLinks); str += "Н Зв'язність " + coherence + "\n" + _destin_alg.test(2, 5, false); dict_KpDuplex[coherence].Add(_destin_alg.Kp); dict_TimeDuplex[coherence].Add(_destin_alg.Time); _destin_alg = new DestinationAlgorithms(canvas, _grView, _grViewCS, propuskChannels, proizvodProcessors, true, countLinks); str += "Д Зв'язність " + coherence + "\n" + _destin_alg.test(2, 6, false); dict_KpDuplex[coherence].Add(_destin_alg.Kp); dict_TimeDuplex[coherence].Add(_destin_alg.Time); _destin_alg = new DestinationAlgorithms(canvas, _grView, _grViewCS, propuskChannels, proizvodProcessors, false, countLinks); str += "Н Зв'язність " + coherence + "\n" + _destin_alg.test(2, 6, false); dict_KpDuplex[coherence].Add(_destin_alg.Kp); dict_TimeDuplex[coherence].Add(_destin_alg.Time); } } /* string str2 = ""; int l = 0; for (int i = int_minConnected; i <= int_maxConnected; i += int_stepConnected) { double coherence = Convert.ToDouble(i) / 100; dict_Kp[coherence] = new Dictionary<int, List<double>>(); dict_Time[coherence] = new Dictionary<int, List<double>>(); k = 0; Dictionary<int, List<double>> dict_newKp = new Dictionary<int, List<double>>(); Dictionary<int, List<double>> dict_newTime = new Dictionary<int, List<double>>(); for (l = int_minCountLinks; l <= int_maxCountLinks; l++) { dict_newKp[l] = new List<double>(); dict_newTime[l] = new List<double>(); } for (int j = int_minCountTops; k < int_countGraphs; j += int_stepCountTops, k++) { _grView.ClearAll(); if (j > int_maxCountTops) j = int_minCountTops; _grView.GenerateGraph(j, int_minWeightTops, int_maxWeightTops, coherence); for (l = int_minCountLinks; l <= int_maxCountLinks; l++) { _destin_alg = new DestinationAlgorithms(canvas, _grView, _grViewCS, propuskChannels, proizvodProcessors, true, l); str2 += "Зв'язність " + coherence + "\tlinks " + l + "\n" + _destin_alg.test(2, 5, false); dict_newKp[l].Add(_destin_alg.Kp); dict_newTime[l].Add(_destin_alg.Time); _destin_alg = new DestinationAlgorithms(canvas, _grView, _grViewCS, propuskChannels, proizvodProcessors, true, l); str2 += "Зв'язність " + coherence + "\tlinks " + l + "\n" + _destin_alg.test(2, 6, false); dict_newKp[l].Add(_destin_alg.Kp); dict_newTime[l].Add(_destin_alg.Time); } } // MessageBox.Show(""); dict_Kp[coherence] = dict_newKp; dict_Time[coherence] = dict_newTime; } */ FileStream fs = new FileStream("test.txt", FileMode.Create); StreamWriter w = new StreamWriter(fs, Encoding.UTF8); w.WriteLine(str); w.Flush(); w.Close(); fs.Close(); /* fs = new FileStream("test2.txt", FileMode.Create); w = new StreamWriter(fs, Encoding.UTF8); w.WriteLine(str2); w.Flush(); w.Close(); fs.Close(); */ SaveWord(dict_KpDuplex, dict_TimeDuplex, dict_Kp, dict_Time); MessageBox.Show("Результати записані"); }
private void Button_Click_Gant(object sender, EventArgs e) { int algorithm = -1, destination_algorithm = -1; if (radBtnAlg2.IsChecked == true) algorithm = 2; else if (radBtnAlg3.IsChecked == true) algorithm = 3; else if (radBtnAlg12.IsChecked == true) algorithm = 12; if (radBtnDestAlg4.IsChecked == true) destination_algorithm = 4; else if (radBtnDestAlg5.IsChecked == true) destination_algorithm = 5; else if (radBtnDestAlg6.IsChecked == true) destination_algorithm = 6; _destin_alg = new DestinationAlgorithms(canvasGant, _grView, _grViewCS); if (algorithm != -1 && destination_algorithm != -1) _destin_alg.test(algorithm, destination_algorithm, true); else MessageBox.Show("Для побудови діаграми Ганта необхідно обрати алгоритми"); }