| | |
| | | |
| | | namespace HStation.WinFrmUI |
| | | { |
| | | public partial class PumpFullInfoCtrl : DevExpress.XtraEditors.XtraUserControl |
| | | public partial class PumpFullInfoCtrl : DocumentPage |
| | | { |
| | | #region 构造函数和加载函数 |
| | | |
| | |
| | | } |
| | | |
| | | 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); |
| | |
| | | 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, |
| | |
| | | _qp = qp; |
| | | _work_pt = work_pt; |
| | | _rated_speed = rated_speed; |
| | | |
| | | |
| | | this.pumpPerformCompareChart1.SetBindingData(_qh, _qe, _qp); |
| | | if (work_pt != null) |
| | |
| | | |
| | | this.pumpVariableSpeedInfoCtrl1.SetBindingData(vm_vs, work_pt); |
| | | this.pumpVariableSpeedChart1.Add(vm_vs, work_pt); |
| | | |
| | | } |
| | | |
| | | private void SetChart() |
| | |
| | | |
| | | 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); |
| | |
| | | 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); |
| | | } |
| | | }; |
| | | |
| | |
| | | this.pumpPerformCompareInfoCtrl1.SetBindingData(vm_list); |
| | | }; |
| | | |
| | | #endregion |
| | | #endregion 曲线 |
| | | |
| | | #region 变速曲线 |
| | | |
| | |
| | | this.pumpVariableSpeedInfoCtrl1.SetQueryInfo(id, pt); |
| | | }; |
| | | |
| | | |
| | | void ResetSectPointGrid() |
| | | { |
| | | var vm_list = this.pumpVariableSpeedChart1.GetList(); |
| | |
| | | |
| | | void AddBySpeed() |
| | | { |
| | | |
| | | var list = this.pumpVariableSpeedInfoCtrl1.GetList(); |
| | | if (list == null || list.Count < 1) |
| | | { |
| | |
| | | return true; |
| | | }; |
| | | dlg.ShowDialog(); |
| | | |
| | | } |
| | | |
| | | void AddByHz() |
| | | { |
| | | |
| | | var list = this.pumpVariableSpeedInfoCtrl1.GetList(); |
| | | if (list == null || list.Count < 1) |
| | | { |
| | |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #endregion 变速曲线 |
| | | } |
| | | |
| | | |
| | | |
| | | private void OnFrmLoad(object sender, EventArgs e) |
| | | { |
| | |
| | | SetChart(); |
| | | } |
| | | |
| | | |
| | | |
| | | #region Color |
| | | |
| | | private List<Color> _color_array = new List<Color>() |
| | |
| | | return Color.FromArgb(r, g, b); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion Color |
| | | |
| | | #region 走马灯提示 |
| | | |
| | |
| | | |
| | | #endregion 走马灯提示 |
| | | |
| | | |
| | | |
| | | public void CloseFrm() |
| | | { |
| | | if (tRollTipText != null) |
| | |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void xtraTabCtrlMain_SelectedPageChanged(object sender, DevExpress.XtraTab.TabPageChangedEventArgs e) |
| | | { |
| | | { |
| | | // |
| | | if (e.Page == this._tabPage三维模型) |
| | | { |
| | |
| | | { |
| | | this.xtraTabControlRight.SelectedTabPage = this._tabPage多速度曲线参数; |
| | | } |
| | | |
| | | |
| | | if (e.Page == this._tabPage性能曲线图1) |
| | | { |
| | | this.xtraTabControlRight.SelectedTabPage = this.tabPage基本参数; |