duheng
2025-03-28 b266e82b9a377fa35a766f7a3a2f5aa95f3c9125
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
namespace HStation.WinFrmUI
{
    public partial class PumpChartEditCtrl : DevExpress.XtraEditors.XtraUserControl
    {
        public PumpChartEditCtrl()
        {
            InitializeComponent();
        }
 
        private Yw.Vmo.PhartDiagramExGraphListVmo _vmo;
        private Yw.Vmo.PhartGraphVmo _vmo_qh;
        private Yw.Vmo.PhartGraphVmo _vmo_qe;
        private Yw.Vmo.PhartGraphVmo _vmo_qp;
 
        /// <summary>
        /// 绑定数据
        /// </summary>  
        public void SetBindingData(Yw.Vmo.PhartDiagramExGraphListVmo vmo, double nr)
        {
            _vmo = vmo;
            var vm = vmo.GetDefaultVmo();
            _vmo_qh = vm.QH;
            _vmo_qe = vm.QE;
            _vmo_qp = vm.QP;
            var qh = vm.QH.GetCurveInfo();
            var qe = vm.QE.GetCurveInfo();
            var qp = vm.QP.GetCurveInfo();
            this.pumpChartExcelEditCtrl1.SetBindingData
                (
                qh.define_pt_list,
                qe.define_pt_list,
                qp.define_pt_list,
                qh.feat_type,
                qe.feat_type,
                qp.feat_type
                );
        }
 
 
 
 
 
        /// <summary>
        /// 获取
        /// </summary> 
        public Yw.Vmo.PhartDiagramExGraphListVmo Get()
        {
            if (_vmo == null)
                return default;
            if (!this.pumpChartExcelEditCtrl1.Get
                        (
                          out List<Yw.Geometry.Point2d> def_qh_pt_list,
                          out List<Yw.Geometry.Point2d> def_qe_pt_list,
                          out List<Yw.Geometry.Point2d> def_qp_pt_list,
                          out Yw.Ahart.eFeatType feat_type_qh,
                          out Yw.Ahart.eFeatType feat_type_qe,
                          out Yw.Ahart.eFeatType feat_type_qp
                          )
                        )
            {
                return default;
            }
 
            var qh_valid = def_qh_pt_list != null && def_qh_pt_list.Any();
            var qe_valid = def_qe_pt_list != null && def_qe_pt_list.Any();
            var qp_valid = def_qp_pt_list != null && def_qp_pt_list.Any();
 
            if (qh_valid)
            {
                if (_vmo_qh != null)
                {
                    var vmo = _vmo.GraphList.Find(x => x.ID == _vmo_qh.ID);
                    vmo.GeometryParas = new Yw.WinFrmUI.Phart.CurveGeometryParasViewModel
                    {
                        DefinePoints = def_qh_pt_list
                    }.ToJson(); ;
                    vmo.GeometryInfo = PhartGraphHelper.ToDbString(Yw.Ahart.eCurveType.QH, feat_type_qh, def_qh_pt_list);
                }
            }
 
            if (qe_valid)
            {
                if (_vmo_qe != null)
                {
                    var vmo = _vmo.GraphList.Find(x => x.ID == _vmo_qe.ID);
                    vmo.GeometryParas = new Yw.WinFrmUI.Phart.CurveGeometryParasViewModel
                    {
                        DefinePoints = def_qe_pt_list
                    }.ToJson();
                    vmo.GeometryInfo = PhartGraphHelper.ToDbString(Yw.Ahart.eCurveType.QE, feat_type_qe, def_qe_pt_list);
                }
            }
 
            if (qp_valid)
            {
                if (_vmo_qp != null)
                {
                    var vmo = _vmo.GraphList.Find(x => x.ID == _vmo_qp.ID);
                    vmo.GeometryParas = new Yw.WinFrmUI.Phart.CurveGeometryParasViewModel
                    {
                        DefinePoints = def_qp_pt_list
                    }.ToJson();
                    vmo.GeometryInfo = PhartGraphHelper.ToDbString(Yw.Ahart.eCurveType.QP, feat_type_qp, def_qp_pt_list);
                }
            }
            return _vmo;
        }
 
 
    }
}