duheng
2024-12-22 7baac1dbfc0b1c677ef263ff037ac81c6d91f5fb
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
using Yw.WinFrmUI.Phart;
 
namespace HStation.WinFrmUI
{
    public partial class UniversalChartEditCtrl : DevExpress.XtraEditors.XtraUserControl
    {
        public UniversalChartEditCtrl()
        {
            InitializeComponent();
        }
 
 
        private Yw.Vmo.PhartDiagramExGraphListVmo _vmo;
        /// <summary>
        /// 绑定数据
        /// </summary>  
        public void SetBindingData(Yw.Vmo.PhartDiagramExGraphListVmo vmo)
        {
            _vmo = vmo;
            if (vmo == null)
            {
                return;
            }
            var (curve_type, feat_type, define_pt_list, line_pt_list) = vmo.GraphList[0].GetCurveInfo();
            this.universalChartExcelEditCtrl1.SetBindingData(curve_type, define_pt_list, feat_type);
        }
 
        /// <summary>
        /// 获取
        /// </summary> 
        public Yw.Vmo.PhartDiagramExGraphListVmo Get()
        {
            if (_vmo == null)
                return default;
            if (!this.universalChartExcelEditCtrl1.Get(out Yw.Ahart.eFeatType feat_type, out List<Yw.Geometry.Point2d> pt_list))
                return default;
 
            var curve_type = (Yw.Ahart.eCurveType)_vmo.GraphList[0].GraphType;
            _vmo.GraphList[0].GeometryParas = new HStation.Model.FeatCurveGeometryParasModel
            {
                DefinePoints = pt_list
            }.ToJson();
            _vmo.GraphList[0].GeometryInfo = pt_list.ToDbString(curve_type, feat_type);
 
            return _vmo;
        }
 
    }
}