| | |
| | | using DevExpress.XtraEditors; |
| | | using Yw.Ahart; |
| | | |
| | | namespace Yw.WinFrmUI.Phart |
| | | { |
| | |
| | | public PumpChartPointImportCtrl() |
| | | { |
| | | InitializeComponent(); |
| | | |
| | | this.repTxtk0.AllowNullInput = DevExpress.Utils.DefaultBoolean.True; |
| | | this.repTxtFlow.AllowNullInput = DevExpress.Utils.DefaultBoolean.True; |
| | | |
| | | this.repTxtk0.AllowNullInput = DevExpress.Utils.DefaultBoolean.True; |
| | | this.repTxtFlow.AllowNullInput = DevExpress.Utils.DefaultBoolean.True; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | private List<Yw.Geometry.Point2d> _def_qh_pt_list = null; |
| | | private List<Yw.Geometry.Point2d> _def_qe_pt_list = null; |
| | |
| | | private Ahart.eFeatType _feat_type_qh = Ahart.eFeatType.Cubic; |
| | | private Ahart.eFeatType _feat_type_qe = Ahart.eFeatType.Cubic; |
| | | private Ahart.eFeatType _feat_type_qp = Ahart.eFeatType.Cubic; |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | this.barTxtEff.EditValue = eff; |
| | | this.barTxtNPSH.EditValue = npsh_r; |
| | | } |
| | | |
| | | |
| | | //计算转速比 |
| | | private void CalcNs() |
| | | { |
| | |
| | | var head = Convert.ToDouble(this.barTxtHead.EditValue); |
| | | var n = Convert.ToDouble(this.barTxtN.EditValue); |
| | | var stage_number = Convert.ToInt32(this.barSpinLevel.EditValue); |
| | | |
| | | |
| | | if (this.barCekIsSxp.Checked) |
| | | flow /= 2; |
| | | var ns = Yw.Pump.CalculationHelper.CalcuNs(flow, head / stage_number, n); |
| | |
| | | else if (power < 10) |
| | | digits = 2; |
| | | else if (power < 100) |
| | | digits = 1; |
| | | digits = 1; |
| | | power = Math.Round(power, digits); |
| | | this.barTxtPower.EditValue = power; |
| | | } |
| | |
| | | var y2 = qe_pt_list[index2].Y; |
| | | var x = qre * flow; |
| | | |
| | | |
| | | |
| | | var max_powert_E = Yw.Geometry.LineHelper.GetLineInsert(x1, x2, y1, y2, x); |
| | | qe_pt_list.Add(new Yw.Geometry.Point2d(qre * flow, max_powert_E)); |
| | | |
| | |
| | | |
| | | if (!bol) |
| | | { |
| | | this.pumpViewChart1.ClearBindingData(); |
| | | this.pumpViewChart1.Clear(); |
| | | } |
| | | else |
| | | { |
| | | var vm = new PumpCurveViewModel(); |
| | | vm.CurveQH = _def_qh_pt_list; |
| | | vm.CurveQE = _def_qe_pt_list; |
| | | vm.CurveQP = _def_qp_pt_list; |
| | | this.pumpViewChart1.SetBindingData(vm); |
| | | var list = new List<Yw.WinFrmUI.Phart.PumpViewChartViewModel>(); |
| | | list.Add(GetViewModel(_def_qh_pt_list, Yw.Ahart.eCurveType.QH)); |
| | | if (_def_qe_pt_list != null && _def_qe_pt_list.Any()) |
| | | list.Add(GetViewModel(_def_qe_pt_list, Yw.Ahart.eCurveType.QE)); |
| | | if (_def_qp_pt_list != null && _def_qp_pt_list.Any()) |
| | | list.Add(GetViewModel(_def_qp_pt_list, Yw.Ahart.eCurveType.QP)); |
| | | this.pumpViewChart1.SetBindingData(list); |
| | | } |
| | | } |
| | | |
| | | private Yw.WinFrmUI.Phart.PumpViewChartViewModel GetViewModel(List<Yw.Geometry.Point2d> pt_list,Yw.Ahart.eCurveType curve_type) |
| | | { |
| | | var last_pt = pt_list.Last(); |
| | | var vm = new Yw.WinFrmUI.Phart.PumpViewChartViewModel(); |
| | | vm.Id = Guid.NewGuid().ToString(); |
| | | vm.Hz = 50; |
| | | vm.N = Convert.ToDouble(this.barTxtN.EditValue); |
| | | vm.CurveType = curve_type; |
| | | vm.FeatType = eFeatType.Cubic; |
| | | vm.DefPointList = pt_list; |
| | | vm.FitPointList = pt_list; |
| | | vm.GraphParas = ""; |
| | | return vm; |
| | | } |
| | | |
| | | |
| | |
| | | def_qh_pt_list = _def_qh_pt_list; |
| | | def_qe_pt_list = _def_qe_pt_list; |
| | | def_qp_pt_list = _def_qp_pt_list; |
| | | feat_type_qh = _feat_type_qh; |
| | | feat_type_qh = _feat_type_qh; |
| | | feat_type_qe = _feat_type_qe; |
| | | feat_type_qp = _feat_type_qp; |
| | | if (def_qh_pt_list == null || !def_qh_pt_list.Any()) |