lixiaojun
2024-12-09 725f20b576bdd40d57d9a1e806ce3f6f39181a84
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
using HStation.WinFrmUI.PhartRelation;
 
namespace HStation.WinFrmUI.Xhs
{
    public partial class TankChartShowDlg : DevExpress.XtraEditors.XtraForm
    {
        public TankChartShowDlg()
        {
            InitializeComponent();
            this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon;
        }
 
        public async void SetBingingData(long MainID)
        {
            var curveList = await new BLL.AssetsTankCoefficient().GetByMainID(MainID);
            if (curveList != null && curveList.Count > 0)
            {
                InitChart(curveList.First().VolCurve);
            }
        }
 
        /*  //初始化图表数据
          public void InitChart(Vmo.XhsTankMainPhartMappingExtensions dto)
          {
              if (dto == null)
              {
                  return;
              }
              var diagram = dto.Diagram;
              if (diagram == null)
              {
                  return;
              }
              var graph_list = diagram.GraphList;
              if (graph_list == null || !graph_list.Any())
              {
                  return;
              }
 
              var graph_ql = graph_list.Find(x => x.GraphType == HStation.PhartRelation.eGraphType.TankQL);
              var graph_ol = graph_list.Find(x => x.GraphType == HStation.PhartRelation.eGraphType.TankOL);
              if (graph_ql == null && graph_ol == null)
              {
                  return;
              }
 
              List<Yw.Geometry.Point2d> points_ql = null;
              if (graph_ql != null)
                  points_ql = PhartPerformCurveHelper.GetFeatPointList(graph_ql.GraphType, graph_ql.GeometryInfo, 12, null);
 
              List<Yw.Geometry.Point2d> points_ol = null;
              if (graph_ol != null)
                  points_ol = PhartPerformCurveHelper.GetFeatPointList(graph_ol.GraphType, graph_ol.GeometryInfo, 12, null);
              Yw.Geometry.CubicSpline2d cubic_spline = null;
              if (points_ql != null)
              {
                  cubic_spline = new Yw.Geometry.CubicSpline2d(points_ql);
              }
              if (points_ol != null)
              {
                  cubic_spline = new Yw.Geometry.CubicSpline2d(points_ol);
              }
              var disp_paras = diagram.DispParas;
              var is_calc_disp_paras = string.IsNullOrWhiteSpace(disp_paras);
              this.xtrPerform2dchart1.SetBindingData(cubic_spline.ToDbString(), disp_paras, is_calc_disp_paras);
              if (graph_ol != null)
              {
                  this.xtrPerform2dchart1.SetAxisTitle("阀门开度", "损失系数");
              }
              else
              {
                  this.xtrPerform2dchart1.SetAxisTitle("流量(m³/h)", "水损/m");
              }
          }*/
 
        //初始化图表数据
        public void InitChart(string curveStr)
        {
            this.xtrPerform2dchart1.SetBindingData(curveStr, null);
 
            this.xtrPerform2dchart1.SetAxisTitle("流量m³/h", "容积m³");
        }
    }
}