| | |
| | | using DevExpress.XtraEditors; |
| | | using System.Data; |
| | | |
| | | |
| | | namespace Yw.WinFrmUI.Phart |
| | | { |
| | | public partial class UniversalEditCtrl : DevExpress.XtraEditors.XtraUserControl |
| | |
| | | InitializeComponent(); |
| | | |
| | | this.gridView1.SetNormalEditView(); |
| | | this.gridView1.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder; |
| | | this.gridView1.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder; |
| | | this.curveExpressEditChart.DefinePointChangedEvent += FeatCurvesDispCtrl1_OnDefinePointChanged; |
| | | } |
| | | |
| | | |
| | | private List<Yw.Geometry.Point2d> _pt_ql_list = null; |
| | | private List<Yw.Geometry.Point2d> _fitCurvePoints = null; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 初始化数据 |
| | | /// </summary> |
| | |
| | | this.bindingSource1.DataSource = _fitCurvePoints; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 初始化数据(目前没有定义点) |
| | | /// </summary> |
| | | /// </summary> |
| | | public void SetBindingData(Yw.Geometry.CubicSpline2d cubic_spline_ql) |
| | | { |
| | | if (cubic_spline_ql == null) |
| | |
| | | SetBindingData(pt_ql_list, pt_ql_list); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 初始化数据 |
| | | /// </summary> |
| | | /// </summary> |
| | | public void SetBindingData(List<Yw.Geometry.Point2d> pt_ql_list, |
| | | List<Yw.Geometry.Point2d> def_pt_ql_list) |
| | | { |
| | | |
| | | _fitCurvePoints = new List<Yw.Geometry.Point2d>(); |
| | | this.bindingSource1.DataSource = _fitCurvePoints; |
| | | |
| | |
| | | |
| | | if (pt_ql_list == null || pt_ql_list.Count < 4) |
| | | { |
| | | |
| | | return; |
| | | } |
| | | |
| | | _pt_ql_list = pt_ql_list; |
| | | |
| | | |
| | | this.cmbCurveType.Properties.Items.Clear(); |
| | | this.cmbCurveType.Properties.Items.Add("流量水损曲线"); |
| | |
| | | this.bindingSource1.ResetBindings(false); |
| | | } |
| | | |
| | | |
| | | |
| | | //单元格修改后触发 |
| | | private void gridView1_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 刷新数据 |
| | | /// </summary> |
| | |
| | | _fitCurvePoints.Add(new Yw.Geometry.Point2d(pt.X, pt.Y)); |
| | | |
| | | var list = _fitCurvePoints?.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList(); |
| | | this.curveExpressEditChart.UpdateCurve(list); |
| | | //this.curveExpressEditChart.UpdateCurve(list); |
| | | this.bindingSource1.ResetBindings(false); |
| | | } |
| | | |
| | |
| | | points.Add(new Yw.Geometry.Point2d(x, y)); |
| | | } |
| | | _pt_ql_list = points; |
| | | this.curveExpressEditChart.UpdateCurve(points); |
| | | // this.curveExpressEditChart.UpdateCurve(points); |
| | | } |
| | | |
| | | |
| | | //插入点 |
| | | private void InsertPoint() |
| | |
| | | ReloadCurvePoints(); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 设置曲线坐标 |
| | | /// </summary> |
| | |
| | | { |
| | | this.curveExpressEditChart.SetChartAxis(); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 获取点信息 |
| | |
| | | |
| | | return true; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | } |