using DPumpHydr.WinFrmUI.Volute.ViewModel; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace DPumpHydr.DesktopDebug.MainWindow { public partial class SectionBundleInfoDebug : Form { public SectionBundleInfoDebug() { InitializeComponent(); } DPumpHydr.WinFrmUI.Volute.ctrlSectionBundleInfo ctrl = null; private void SectionBundleInfoDebug_Load(object sender, EventArgs e) { ctrl = new DPumpHydr.WinFrmUI.Volute.ctrlSectionBundleInfo(); ctrl.Name ="ctrlSectionBundleInfo"; ctrl.Dock = DockStyle.Fill; this.panel1.Controls.Add(ctrl); //基本参数类 DPumpHydr.WinFrmUI.Volute.ViewModel.HdrBaseInfo hdrBase = new DPumpHydr.WinFrmUI.Volute.ViewModel.HdrBaseInfo() { ShapeType = 0, Q = 148, H = 90, n = 2900, D2 = 278, B2 = 15, IsSXB = false, }; //计算转速比 hdrBase.CalcNs(); //基圆参数 DPumpHydr.WinFrmUI.Volute.ViewModel.GeomBaseInfo geomBase = new DPumpHydr.WinFrmUI.Volute.ViewModel.GeomBaseInfo() { D3 = 295, B3 = 30, FAI0 = 32 }; #region 根据基本参数、基圆参数 对1-8断面参数进行初始化 或者 传入更新后的基本参数、基圆参数对断面参数进行更新 //根据基本参数、基圆参数传到控件中对断面参数进行计算并展示 //如果是从基本参数前进到该控件 那么会根据所提供的基本参数和基圆参数去进行初始化计算/更新 ////如果是从出口或者加厚后退到该控件 那么控件不会进行任何操作 //如果需要覆盖断面参数 true ////如果不需要覆盖断面参数 false ctrl.ShowPage(hdrBase, geomBase, DPumpHydr.ViewModel.eWizardStepDiretion.前进, true); #endregion } private void button1_Click(object sender, EventArgs e) { //1-8断面参数类 DPumpHydr.WinFrmUI.Volute.ViewModel.SectionBundleInfo sectionBundle = new WinFrmUI.Volute.ViewModel.SectionBundleInfo(); string error = ""; sectionBundle = ctrl.GetBindingData(out error); if (!string.IsNullOrEmpty(error)) { MessageBox.Show(error); } else { MessageBox.Show("成功获取参数\r\n速度系数:"+sectionBundle.K3 +"\r\n平均流速:" + sectionBundle.V3+ "\r\n断面类型:"+sectionBundle.ShapeType.ToString()+ "\r\n外围的半径 :" + sectionBundle.R_out+ "\r\n断面1:" +" 高度:" +sectionBundle.H[1]+" 左圆角半径:" +sectionBundle.R_Left[1]+" 右圆角半径:" +sectionBundle.R_Right[1]+" 面积:" +sectionBundle.Area[1]+" 左gama:" +sectionBundle.GaMa_Left[1]+" 右gama:" +sectionBundle.GaMa_Right[1]+ "\r\n断面2:" +" 高度:" +sectionBundle.H[2]+" 左圆角半径:" +sectionBundle.R_Left[2]+" 右圆角半径:" +sectionBundle.R_Right[2]+" 面积:" +sectionBundle.Area[2]+" 左gama:" +sectionBundle.GaMa_Left[2]+" 右gama:" +sectionBundle.GaMa_Right[2]+ "\r\n断面3:" +" 高度:" +sectionBundle.H[3]+" 左圆角半径:" +sectionBundle.R_Left[3]+" 右圆角半径:" +sectionBundle.R_Right[3]+" 面积:" +sectionBundle.Area[3]+" 左gama:" +sectionBundle.GaMa_Left[3]+" 右gama:" +sectionBundle.GaMa_Right[3]+ "\r\n断面4:" +" 高度:" +sectionBundle.H[4]+" 左圆角半径:" +sectionBundle.R_Left[4]+" 右圆角半径:" +sectionBundle.R_Right[4]+" 面积:" +sectionBundle.Area[4]+" 左gama:" +sectionBundle.GaMa_Left[4]+" 右gama:" +sectionBundle.GaMa_Right[4]+ "\r\n断面5:" +" 高度:" +sectionBundle.H[5]+" 左圆角半径:" +sectionBundle.R_Left[5]+" 右圆角半径:" +sectionBundle.R_Right[5]+" 面积:" +sectionBundle.Area[5]+" 左gama:" +sectionBundle.GaMa_Left[5]+" 右gama:" +sectionBundle.GaMa_Right[5]+ "\r\n断面6:" +" 高度:" +sectionBundle.H[6]+" 左圆角半径:" +sectionBundle.R_Left[6]+" 右圆角半径:" +sectionBundle.R_Right[6]+" 面积:" +sectionBundle.Area[6]+" 左gama:" +sectionBundle.GaMa_Left[6]+" 右gama:" +sectionBundle.GaMa_Right[6]+ "\r\n断面7:" +" 高度:" +sectionBundle.H[7]+" 左圆角半径:" +sectionBundle.R_Left[7]+" 右圆角半径:" +sectionBundle.R_Right[7]+" 面积:" +sectionBundle.Area[7]+" 左gama:" +sectionBundle.GaMa_Left[7]+" 右gama:" +sectionBundle.GaMa_Right[7]+ "\r\n断面8:" +" 高度:" +sectionBundle.H[8]+" 左圆角半径:" +sectionBundle.R_Left[8]+" 右圆角半径:" +sectionBundle.R_Right[8]+" 面积:" +sectionBundle.Area[8]+" 左gama:" +sectionBundle.GaMa_Left[8]+" 右gama:" +sectionBundle.GaMa_Right[8] ); } } } }