LmaxForm.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. namespace OTSExtremum
  11. {
  12. public partial class LmaxForm : Form
  13. {
  14. List<double[]> parameters { get; set; }
  15. public LmaxForm(List<double[]> come)
  16. {
  17. parameters = come;
  18. InitializeComponent();
  19. }
  20. private void LmaxForm_Load(object sender, EventArgs e)
  21. {
  22. for (int i = 0; i < 11; i++)
  23. {
  24. int add_rowindex = dtgrid.Rows.Add();
  25. dtgrid.Rows[add_rowindex].Cells[0].Value = parameters[0][i];
  26. dtgrid.Rows[add_rowindex].Cells[1].Value = parameters[1][i];
  27. dtgrid.Rows[add_rowindex].Cells[2].Value = Math.Round(parameters[2][i],3);
  28. dtgrid.Rows[add_rowindex].Cells[3].Value = Math.Round(parameters[3][i],2);
  29. }
  30. //画data
  31. for (int i = 0; i < parameters[0].Length; i++)
  32. {
  33. chart1.Series[0].Points.AddXY(Math.Round(parameters[3][i], 2), Math.Round(parameters[2][i], 3));
  34. }
  35. }
  36. }
  37. }