Shuxia Ning
2025-01-10 4d95d752823b1f5362c5d639001444b260b90395
WinFrmUI/Yw.WinFrmUI.Phart.Core/01-pump/02-edit/PumpChartExcelEditCtrl.cs
@@ -47,9 +47,10 @@
            List<Yw.Geometry.Point2d> def_qp_pt_list,
            Yw.Ahart.eFeatType feat_type_qh = Ahart.eFeatType.Cubic,
            Yw.Ahart.eFeatType feat_type_qe = Ahart.eFeatType.Cubic,
            Yw.Ahart.eFeatType feat_type_qp = Ahart.eFeatType.Cubic)
            Yw.Ahart.eFeatType feat_type_qp = Ahart.eFeatType.Cubic,
            Yw.Ahart.eCurveType curve_type = Ahart.eCurveType.QH)
        {
            _edit_curve_type = Ahart.eCurveType.QH;
            _edit_curve_type = curve_type;
            _feat_type_qh = feat_type_qh;
            _def_qh_pt_list = def_qh_pt_list?.Select(x => new Geometry.Point2d(x.X, x.Y)).ToList();
@@ -244,17 +245,56 @@
            if (_def_qh_pt_list == null || !_def_qh_pt_list.Any())
                return;
            List<Yw.Geometry.Point2d> def_pt_list = null;
            Yw.Ahart.eFeatType feat_type = Ahart.eFeatType.Cubic;
            switch (_edit_curve_type)
            {
                case Ahart.eCurveType.QH: def_pt_list = _def_qh_pt_list; break;
                case Ahart.eCurveType.QE: def_pt_list = _def_qe_pt_list; break;
                case Ahart.eCurveType.QP: def_pt_list = _def_qp_pt_list; break;
                case Ahart.eCurveType.QH: def_pt_list = _def_qh_pt_list; feat_type=_feat_type_qh; break;
                case Ahart.eCurveType.QE: def_pt_list = _def_qe_pt_list; feat_type = _feat_type_qe; break;
                case Ahart.eCurveType.QP: def_pt_list = _def_qp_pt_list; feat_type = _feat_type_qp; break;
            }
            var row = this.gridView1.GetCurrentViewModel(def_pt_list);
            if (row == null)
                return;
            if (def_pt_list.Count <= 4)
                return;
            var count = def_pt_list.Count - 1;
            switch (feat_type)
            {
                case Ahart.eFeatType.Cubic:
                    {
                        if (count < 4)
                        {
                            TipFormHelper.ShowInfo("点数少于4个点");
                            return;
                        }
                    }
                    break;
                case Ahart.eFeatType.Through:
                    {
                        if (count < 1)
                        {
                            TipFormHelper.ShowInfo("点数少于1个点");
                            return;
                        }
                    }
                    break;
                case Ahart.eFeatType.Quadratic:
                    {
                        if (count < 3)
                        {
                            TipFormHelper.ShowInfo("点数少于3个点");
                            return;
                        }
                    }
                    break;
                case Ahart.eFeatType.Quartic:
                    {
                        if (count < 5)
                        {
                            TipFormHelper.ShowInfo("点数少于5个点");
                            return;
                        }
                    }
                    break;
            }
            def_pt_list.Remove(row);
            this.bindingSource1.ResetBindings(false);
            SetChart(_def_qh_pt_list, _def_qe_pt_list, _def_qp_pt_list, _feat_type_qh, _feat_type_qe, _feat_type_qp, _edit_curve_type);