| | |
| | | using DevExpress.CodeParser; |
| | | using HStation.WinFrmUI.PhartRelation; |
| | | using System; |
| | | using HStation.WinFrmUI.PhartRelation; |
| | | using Yw.WinFrmUI.Phart; |
| | | |
| | | namespace HStation.WinFrmUI |
| | | { |
| | | public partial class PumpFullInfoCtrl : DevExpress.XtraEditors.XtraUserControl |
| | | public partial class PumpFullInfoCtrl : DocumentPage |
| | | { |
| | | #region 构造函数和加载函数 |
| | | |
| | |
| | | this.navBarControlPara.GroupExpanded += new DevExpress.XtraNavBar.NavBarGroupEventHandler(this.NavBarControlPara_GroupExpanded); |
| | | this.navBarControlPara.GroupCollapsed += new DevExpress.XtraNavBar.NavBarGroupEventHandler(this.NavBarControlPara_GroupCollapsed); |
| | | this.navBarControlPara.ClientSizeChanged += new System.EventHandler(this.NavBarControlPara_ClientSizeChanged); |
| | | this.PageTitle.Caption = "水泵信息"; |
| | | this.PageTitle.HeaderSvgImage = this.svgImageCollection1[0]; |
| | | } |
| | | |
| | | 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)) |
| | | { |
| | | Init(pump_mian_id); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | private async void Init(long pump_main_id) |
| | | { |
| | |
| | | return; |
| | | } |
| | | var phart = phart_list.OrderBy(x => x.Importance).First(); |
| | | |
| | | |
| | | var diagram = phart.Diagram; |
| | | if (diagram == null) |
| | |
| | | var cubic_spline_qh = new Yw.Geometry.CubicSpline2d(points_qh); |
| | | var cubic_spline_qe = new Yw.Geometry.CubicSpline2d(points_qe); |
| | | var cubic_spline_qp = new Yw.Geometry.CubicSpline2d(points_qp); |
| | | |
| | | |
| | | var design_pt = new Yw.Geometry.Point2d(); |
| | | design_pt.X = Math.Round(cubic_spline_qh.MaxX / 2); |
| | | design_pt.Y = Math.Round(cubic_spline_qh.GetPointY(design_pt.X), 1); |
| | | |
| | | |
| | | var disp_paras = diagram.DispParas; |
| | | var is_calc_disp_paras = string.IsNullOrWhiteSpace(disp_paras); |
| | |
| | | vm_vs.CurrentHz = 50; |
| | | vm_vs.Qh = cubic_spline_qh; |
| | | vm_vs.Qe = cubic_spline_qe; |
| | | vm_vs.Qp = cubic_spline_qp; |
| | | vm_vs.Qp = cubic_spline_qp; |
| | | |
| | | var vm_vs_info = new Yw.WinFrmUI.Phart.PumpVariableSpeedInfoViewModel(vm_vs); |
| | | vm_vs_info.Color = Color.Black; |
| | | vm_vs_info.IsDefault = true; |
| | | this.pumpVariableSpeedInfoCtrl1.SetBindingData(vm_vs_info, design_pt); |
| | | this.pumpVariableSpeedChart1.Add(vm_vs_info, design_pt); |
| | | |
| | | |
| | | var vm_sp = new Yw.WinFrmUI.Phart.PumpSerialParallelViewModel(); |
| | | vm_sp.Id = phart.ID.ToString(); |
| | |
| | | this.pumpSingleSerialParallelInfoCtrl1.SetBindingData(vm_sp_info, design_pt); |
| | | this.pumpSerialParallelChart1.Add(vm_sp_info, design_pt); |
| | | } |
| | | |
| | | |
| | | |
| | | private void OnFrmLoad(object sender, EventArgs e) |
| | | { |
| | |
| | | if (vm == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | private void InitChart() |
| | |
| | | this.pumpPerformInfoCtrl1.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 变速曲线 |
| | | |
| | | #region 串并联曲线 |
| | | |
| | |
| | | }; |
| | | this.pumpSingleSerialParallelInfoCtrl1.ResetEvent += (type, count) => |
| | | { |
| | | if (count<1) |
| | | if (count < 1) |
| | | { |
| | | return; |
| | | } |
| | |
| | | var list = this.pumpSingleSerialParallelInfoCtrl1.GetList(); |
| | | var first = list.First(); |
| | | var new_list = new List<Yw.WinFrmUI.Phart.PumpSerialParallelInfoViewModel>(); |
| | | for (int i = 0; i <count; i++) |
| | | for (int i = 0; i < count; i++) |
| | | { |
| | | var vm = new Yw.WinFrmUI.Phart.PumpSerialParallelInfoViewModel(first); |
| | | vm.Id = Guid.NewGuid().ToString(); |
| | |
| | | vm.CurrentSpeed = vm.RatedSpeed; |
| | | vm.CurrentHz = 50; |
| | | vm.Calc(); |
| | | new_list.Add(vm); |
| | | new_list.Add(vm); |
| | | } |
| | | var design_pt = this.pumpSingleSerialParallelInfoCtrl1.GetDesignPoint(); |
| | | this.pumpSingleSerialParallelInfoCtrl1.SetBindingData(new_list,design_pt); |
| | | this.pumpSingleSerialParallelInfoCtrl1.SetBindingData(new_list, design_pt); |
| | | this.pumpSerialParallelChart1.Add(new_list, design_pt); |
| | | SetSerialParallel(new_list, design_pt, is_parallel); |
| | | SetSerialParallel(new_list, design_pt, is_parallel); |
| | | }; |
| | | |
| | | this.pumpSerialParallelChart1.OnCalcQueryPoint += (id, pt) => |
| | |
| | | { |
| | | return "无数据!"; |
| | | } |
| | | if (list.Count<2) |
| | | if (list.Count < 2) |
| | | { |
| | | return "数据过少!"; |
| | | } |
| | |
| | | return vm_sp; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #endregion 串并联曲线 |
| | | } |
| | | |
| | | #region Color |
| | |
| | | return Color.FromArgb(r, g, b); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion Color |
| | | |
| | | #region 走马灯提示 |
| | | |
| | |
| | | } |
| | | |
| | | #endregion 走马灯提示 |
| | | |
| | | |
| | | |
| | | public void CloseFrm() |
| | | { |
| | |
| | | } |
| | | |
| | | #endregion 右侧面板宽度 |
| | | |
| | | private void xtraTabControlRight_Click(object sender, EventArgs e) |
| | | { |
| | | |
| | | } |
| | | } |
| | | } |