duheng
2024-10-22 747eef02b5794d03b6da9992af5f610f23f243fa
WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-pump/PumpFullInfoCtrl.cs
@@ -4,7 +4,7 @@
namespace HStation.WinFrmUI
{
    public partial class PumpFullInfoCtrl : DevExpress.XtraEditors.XtraUserControl
    public partial class PumpFullInfoCtrl : DocumentPage
    {
        #region 构造函数和加载函数
@@ -18,22 +18,22 @@
        }
        private PumpMatchingViewModel _pump_mathing_vm = null;
        public void SetBindingData(PumpMatchingViewModel pumpMatchingViewModel)
        {
            _pump_mathing_vm = pumpMatchingViewModel;
            pumpPropViewCtrl1.SetBindingData(pumpMatchingViewModel.DbId);
            if (long.TryParse(_pump_mathing_vm.DbId,out long pump_mian_id))
            if (long.TryParse(_pump_mathing_vm.DbId, out long pump_mian_id))
            {
                InitData(pump_mian_id,null);
            }
                InitData(pump_mian_id, null);
            }
        }
        private Yw.Geometry.CubicSpline2d _qh, _qe, _qp;
        private Yw.Geometry.Point2d _work_pt;
        private double _rated_speed;
        private async void InitData(long pump_main_id, Yw.Geometry.Point2d work_pt)
        {
            var pump_main = await new BLL.AssetsPumpMain().GetByID(pump_main_id);
@@ -77,10 +77,11 @@
            var qh = new Yw.Geometry.CubicSpline2d(points_qh);
            var qe = new Yw.Geometry.CubicSpline2d(points_qe);
            var qp = new Yw.Geometry.CubicSpline2d(points_qp);
            InitChart(qh, qe, qp, work_pt, pump_main.RatedSpeed);
        }
        private void InitChart(
        public void InitChart(
            Yw.Geometry.CubicSpline2d qh,
            Yw.Geometry.CubicSpline2d qe,
            Yw.Geometry.CubicSpline2d qp,
@@ -92,7 +93,6 @@
            _qp = qp;
            _work_pt = work_pt;
            _rated_speed = rated_speed;
            this.pumpPerformCompareChart1.SetBindingData(_qh, _qe, _qp);
            if (work_pt != null)
@@ -118,7 +118,6 @@
            this.pumpVariableSpeedInfoCtrl1.SetBindingData(vm_vs, work_pt);
            this.pumpVariableSpeedChart1.Add(vm_vs, work_pt);
        }
        private void SetChart()
@@ -127,7 +126,7 @@
            this.pumpPerformCompareInfoCtrl1.SetDesignPointEvent += (q, h) =>
            {
                _work_pt = new Yw.Geometry.Point2d(q,h);
                _work_pt = new Yw.Geometry.Point2d(q, h);
                var calc_speed = PumpCalcHelper.GetSimuValue(_qh, _work_pt, _rated_speed);
                var calc_hz = calc_speed / _rated_speed * 50;
                calc_hz = Math.Round(calc_hz, 1);
@@ -147,9 +146,9 @@
                var qe_wk = PumpCalcHelper.CalculateSimilarQE(_qe, 50, hz);
                var qp_wk = PumpCalcHelper.CalculateSimilarQP(_qp, 50, hz);
                this.pumpPerformCompareChart1.SetWkData(qh_wk, qe_wk, qp_wk);
                if (_work_pt!=null)
                if (_work_pt != null)
                {
                    this.pumpPerformCompareChart1.CalcDesignPointByQ(_work_pt.X, _work_pt.Y);
                    this.pumpPerformCompareChart1.CalcDesignPointByQ(_work_pt.X, _work_pt.Y);
                }
            };
@@ -187,7 +186,7 @@
                this.pumpPerformCompareInfoCtrl1.SetBindingData(vm_list);
            };
            #endregion
            #endregion 曲线
            #region 变速曲线
@@ -232,7 +231,6 @@
                this.pumpVariableSpeedInfoCtrl1.SetQueryInfo(id, pt);
            };
            void ResetSectPointGrid()
            {
                var vm_list = this.pumpVariableSpeedChart1.GetList();
@@ -241,7 +239,6 @@
            void AddBySpeed()
            {
                var list = this.pumpVariableSpeedInfoCtrl1.GetList();
                if (list == null || list.Count < 1)
                {
@@ -273,12 +270,10 @@
                    return true;
                };
                dlg.ShowDialog();
            }
            void AddByHz()
            {
                var list = this.pumpVariableSpeedInfoCtrl1.GetList();
                if (list == null || list.Count < 1)
                {
@@ -348,12 +343,8 @@
                dlg.ShowDialog();
            }
            #endregion
            #endregion 变速曲线
        }
        private void OnFrmLoad(object sender, EventArgs e)
        {
@@ -391,8 +382,6 @@
            SetChart();
        }
        #region Color
        private List<Color> _color_array = new List<Color>()
@@ -420,7 +409,7 @@
            return Color.FromArgb(r, g, b);
        }
        #endregion
        #endregion Color
        #region 走马灯提示
@@ -504,8 +493,6 @@
        #endregion 走马灯提示
        public void CloseFrm()
        {
            if (tRollTipText != null)
@@ -573,7 +560,7 @@
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void xtraTabCtrlMain_SelectedPageChanged(object sender, DevExpress.XtraTab.TabPageChangedEventArgs e)
        {
        {
            //
            if (e.Page == this._tabPage三维模型)
            {
@@ -590,7 +577,7 @@
            {
                this.xtraTabControlRight.SelectedTabPage = this._tabPage多速度曲线参数;
            }
            if (e.Page == this._tabPage性能曲线图1)
            {
                this.xtraTabControlRight.SelectedTabPage = this.tabPage基本参数;