ningshuxia
5 天以前 71c12ff40d58c3dbdde6867396dd99224e57fc32
WinFrmUI/Yw.WinFrmUI.Hydro.Q3d.Core/MapView/Common/Dataset.cs
@@ -1,6 +1,7 @@
using MathNet.Numerics.LinearAlgebra.Double; // 引入 Math.NET Numerics 库进行多项式拟合
using MathNet.Numerics;
using MathNet.Numerics;
using MathNet.Numerics.LinearAlgebra;
using MathNet.Numerics.LinearAlgebra.Double; // 引入 Math.NET Numerics 库进行多项式拟合
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Drawing;
@@ -8,11 +9,11 @@
using System.Text;
using System.Threading.Tasks;
//using System.Windows.Forms.DataVisualization.Charting;
using Hydro.CommonBase;
using Hydro.CommonBase;
using Newtonsoft.Json;
using Yw.WinFrmUI.Q3d;
using Yw.WinFrmUI.Q3d;
using Yw.WinFrmUI.Q3d;
namespace Hydro.MapView
namespace Yw.WinFrmUI.Q3d
{
    [Serializable]
    public class Dataset
@@ -50,13 +51,13 @@
                {
                    case "流量扬程曲线":
                        return Color.Blue;
                        //break;
                    //break;
                    case "流量功率曲线":
                        return Color.Orange;
                        //break;
                    //break;
                    case "流量效率曲线":
                        return Color.Red;
                        //break;
                    //break;
                    default:
                        return Color.Blue;
                }
@@ -203,7 +204,8 @@
            if (range_X == null)
            {
                range_X = new DRange(double.MaxValue, double.MinValue);
                Data.ForEach(p => {
                Data.ForEach(p =>
                {
                    if (range_X.Min > p.X) range_X.Min = p.X;
                    if (range_X.Max < p.X) range_X.Max = p.X;
                });
@@ -282,9 +284,9 @@
                double b = coefficients[1]; // 一次项系数
                double c = coefficients[0] - y; // 常数项系数减去给定的 y 值
                var roots = MathSolver.Solve(a, b, c);
                if (roots == null)return ErrNum;
                if (roots == null) return ErrNum;
                else return roots.Max();
            }
@@ -311,7 +313,7 @@
            //}
            else
            {
                return Solve(y);
            }
        }