lixiaojun
2025-04-09 0f99680aff09e91f521b5909aab42811c1c3e6f1
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
namespace HStation.WinFrmUI
{
    public partial class ValveChartViewCtrl : DevExpress.XtraEditors.XtraUserControl
    {
        public ValveChartViewCtrl()
        {
            InitializeComponent();
            this.bar2.OptionsBar.AllowQuickCustomization = false;
        }
 
        /// <summary>
        /// 绑定数据
        /// </summary>
        public void SetBindingData(Yw.Vmo.PhartDiagramExGraphListVmo vmo)
        {
            if (vmo == null || vmo.GraphList == null || !vmo.GraphList.Any())
            {
                this.valveViewChart1.Clear();
                return;
            }
 
            var vm_list = new List<Yw.WinFrmUI.Phart.ValveViewChartViewModel>();
 
            for (int i = 0; i < vmo.GraphList.Count; i++)
            {
                var graph = vmo.GraphList[i];
                var curve_info = graph.GetCurveInfo();
                var vm = new Yw.WinFrmUI.Phart.ValveViewChartViewModel();
                vm.Id = graph.ID.ToString();
                vm.Name = graph.Name;
                vm.Color = Yw.WinFrmUI.PhartColorHelper.Get(i);
                vm.CurveType = curve_info.curve_type;
                vm.FeatType = curve_info.feat_type;
                vm.FitPointList = curve_info.line_pt_list;
                vm.DefPointList = curve_info.define_pt_list;
                vm_list.Add(vm);
            }
 
            vm_list[0].IsSelect = true;
 
            this.valveViewChart1.SetBindingData(vm_list);
        }
 
        /// <summary>
        /// 清空绑定数据
        /// </summary>
        public void ClearBindingData()
        {
            this.valveViewChart1.Clear();
        }
 
        //查询线
        private void barCekLineVisible_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            this.valveViewChart1.LineVisible = this.barCekLineVisible.Checked;
        }
 
        /// <summary>
        /// 获取
        /// </summary>
        public Yw.Vmo.PhartDiagramExGraphListVmo Get()
        {
            return new();
        }
    }
}