| | |
| | | { |
| | | InitializeComponent(); |
| | | |
| | | _sharp_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.æªç¥; |
| | | _link_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowLinkStyle.æ²çº¿; |
| | | |
| | | |
| | | _parasControlCenter = new SetOutflowParasCtrl1() { Name = "SetOutflowParasCtrlCenter" }; |
| | | _parasControlCenter.OnRefreshShape += (para) => |
| | | { |
| | |
| | | }; |
| | | _parasControlCurve.Dock = DockStyle.Top; |
| | | |
| | | _parasControlArcCenter = new SetOutflowParaArcCtrl() { Name = "SetOutflowParaArcCtrlCenter" }; |
| | | _parasControlArcCenter.OnRefreshShape += (para) => |
| | | { |
| | | if (OnRefreshShape2D != null) |
| | | return OnRefreshShape2D(para); |
| | | else |
| | | return false; |
| | | }; |
| | | _parasControlArcCenter.Dock = DockStyle.Top; |
| | | |
| | | _parasControlArcSide = new SetOutflowParaArcCtrl() { Name = "SetOutflowParaArcCtrlSide" }; |
| | | _parasControlArcCenter.OnRefreshShape += (para) => |
| | | { |
| | | if (OnRefreshShape2D != null) |
| | | return OnRefreshShape2D(para); |
| | | else |
| | | return false; |
| | | }; |
| | | _parasControlArcSide.Dock = DockStyle.Top; |
| | | |
| | | |
| | | this.ctrlSection910Posi1.OnMoveSectPosi += (sect_index, posi) => |
| | |
| | | |
| | | |
| | | //æ§ä»¶ |
| | | //æ²çº¿é¾æ¥æ§ä»¶ |
| | | SetOutflowParasCtrl1 _parasControlCenter = null; |
| | | SetOutflowParasCtrl2 _parasControlLine = null; |
| | | SetOutflowParasCtrl1 _parasControlCurve = null; |
| | | //åå¼§è¿æ¥æ§ä»¶ |
| | | SetOutflowParaArcCtrl _parasControlArcCenter = null; |
| | | SetOutflowParaArcCtrl _parasControlArcSide = null; |
| | | |
| | | DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle _sharp_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.æªç¥; |
| | | DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowLinkStyle _link_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowLinkStyle.æ²çº¿; |
| | | public DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle CurrentOutflowShapeStyle |
| | | { |
| | | get |
| | |
| | | } |
| | | private void InitialOutflowStyle() |
| | | { |
| | | if (_parasControlCenter == null) |
| | | return; |
| | | |
| | | tabPage1.Controls.Clear(); |
| | | |
| | | if (_link_type == eOutflowLinkStyle.ç´çº¿åå¼§ && _sharp_type != eOutflowShapeStyle.ä¾§é¢åºå£_ç´çº¿è¿æ¥) |
| | | { |
| | | if (_sharp_type == eOutflowShapeStyle.ä¸å¿åºå£) |
| | | { |
| | | metroTileåºå£å¾ç.BackgroundImage = GlobalResource.BuildImage("Central-exit.png", 878, 238); |
| | | _parasControlArcCenter.SetA_state(false); |
| | | tabPage1.Controls.Add(_parasControlArcCenter); |
| | | return; |
| | | } |
| | | if (_sharp_type == eOutflowShapeStyle.ä¾§é¢åºå£_æ²çº¿è¿æ¥) |
| | | { |
| | | metroTileåºå£å¾ç.BackgroundImage = GlobalResource.BuildImage("Central-exit.png", 878, 238); |
| | | _parasControlArcSide.SetA_state(true); |
| | | tabPage1.Controls.Add(_parasControlArcSide); |
| | | return; |
| | | } |
| | | } |
| | | switch (_sharp_type) |
| | | { |
| | | case DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.ä¸å¿åºå£: |
| | |
| | | throw new ArgumentException("Invalid control type"); |
| | | } |
| | | } |
| | | |
| | | |
| | | ViewModel.HdrBaseInfo _hdrBaseInfo = null; |
| | | ViewModel.GeomBaseInfo _geomBaseInfo = null; |
| | | ViewModel.SectionBundleInfo _sectionBundleInfo = null; |
| | | public void InitialParas( |
| | | public int InitialParas( |
| | | ViewModel.HdrBaseInfo hdrBaseInfo, |
| | | ViewModel.GeomBaseInfo geomBaseInfo, |
| | | ViewModel.SectionBundleInfo sectionBundleInfo) |
| | | { |
| | | if (IsSameBaseParas(hdrBaseInfo, geomBaseInfo, sectionBundleInfo)) |
| | | {//夿æ¯å¦ä¿®æ¹äº |
| | | return 0;//0表示没æåå |
| | | } |
| | | this._hdrBaseInfo = hdrBaseInfo; |
| | | this._geomBaseInfo = geomBaseInfo; |
| | | this._sectionBundleInfo = sectionBundleInfo; |
| | | |
| | | //åºå£ç´å¾æ åå |
| | | double outer_dia = 4.5 * Math.Pow(hdrBaseInfo.Q / 3600 / hdrBaseInfo.n, 1 / 3.0) * 1000; |
| | | |
| | | //侧颿²çº¿ |
| | | var outflowParas3 = new OutflowParas(); |
| | | outflowParas3.Offset = ((int)((geomBaseInfo.D3 / 2 + sectionBundleInfo.H[8]) * 1.6 / 3 / 5) + 1) * 5; |
| | | outflowParas3.H1 = 5; |
| | | outflowParas3.H2 = 5; |
| | | outflowParas3.Dia = GetStdDia(outer_dia); |
| | | double height3 =5 * (int)(((geomBaseInfo.D3 / 2 + sectionBundleInfo.H[8] / 2) * 1.5 + outflowParas3.Dia / 2) / 5 + 1); |
| | | double height3 = 5 * (int)(((geomBaseInfo.D3 / 2 + sectionBundleInfo.H[8] / 2) * 1.5 + outflowParas3.Dia / 2) / 5 + 1); |
| | | outflowParas3.Heigh = height3; |
| | | outflowParas3.Septalradius = 2; |
| | | _parasControlCurve.InitialParas(hdrBaseInfo, geomBaseInfo, sectionBundleInfo); |
| | | _parasControlCurve.IsInvokeRefreshShapeAble = false; |
| | | _parasControlCurve.SetBindingData(outflowParas3); |
| | | _parasControlCurve.IsInvokeRefreshShapeAble = true; |
| | | |
| | | //ä¸å¿åºå£ |
| | | var outflowParas1 = new OutflowParas(); |
| | | outflowParas1.Offset = 0; |
| | | outflowParas1.H1 = 5; |
| | |
| | | _parasControlCenter.IsInvokeRefreshShapeAble = false; |
| | | _parasControlCenter.SetBindingData(outflowParas1); |
| | | _parasControlCenter.IsInvokeRefreshShapeAble = true; |
| | | |
| | | |
| | | |
| | | //ä¾§é¢ç´çº¿ |
| | | var outflowParas2 = new OutflowParas(); |
| | | outflowParas2.Offset = (int)((geomBaseInfo.D3 + sectionBundleInfo.H[8]) / 2 + 0.5); |
| | | outflowParas2.H1 = 5; |
| | | outflowParas2.H2 = 5; |
| | | outflowParas2.Dia = GetStdDia(outer_dia); |
| | | double height2 = 5 * (int)(((outflowParas2.Dia - Math.Sqrt(4 * sectionBundleInfo.Area[8] / Math.PI)) / (2 * Math.Tan(4 * Math.PI / 180))) / 5 + 0.5); |
| | | if(height2 < geomBaseInfo.D3/ 2) |
| | | { |
| | | height2 = geomBaseInfo.D3 * 0.75; |
| | | } |
| | | outflowParas2.Heigh = height2; |
| | | outflowParas2.Septalradius = 3; |
| | | _parasControlLine.InitialParas(hdrBaseInfo, geomBaseInfo, sectionBundleInfo); |
| | |
| | | _parasControlLine.SetBindingData(outflowParas2); |
| | | _parasControlLine.IsInvokeRefreshShapeAble = true; |
| | | |
| | | //åå¼§ä¸å¿ |
| | | var outflowParas4 = new OutflowParas(); |
| | | outflowParas4.Offset = 0; |
| | | outflowParas4.H1 = 5; |
| | | outflowParas4.H2 = 5; |
| | | outflowParas4.Dia = GetStdDia(outer_dia); |
| | | double height4 = 5 * (int)((((geomBaseInfo.D3 / 2 + sectionBundleInfo.H[8] / 2) * 1.4141 + outflowParas4.Dia / 2) / 5) + 1); |
| | | outflowParas4.Heigh = height4; |
| | | outflowParas4.Septalradius = 3; |
| | | outflowParas4.R1 = (int)((outflowParas4.Dia * 11 / 10 / 10) + 1) * 10; |
| | | outflowParas4.R2 = (int)(outflowParas4.Dia * 3 / 4 / 10) * 10; |
| | | _parasControlArcCenter.InitialParas(hdrBaseInfo, geomBaseInfo, sectionBundleInfo); |
| | | _parasControlArcCenter.IsInvokeRefreshShapeAble = false; |
| | | _parasControlArcCenter.SetBindingData(outflowParas4); |
| | | _parasControlArcCenter.IsInvokeRefreshShapeAble = true; |
| | | |
| | | //åå¼§ä¾§é¢ |
| | | var outflowParas5 = new OutflowParas(); |
| | | outflowParas5.Offset = ((int)((geomBaseInfo.D3 / 2 + sectionBundleInfo.H[8]) * 1.6 / 3 / 5) + 1) * 5; |
| | | outflowParas5.H1 = 5; |
| | | outflowParas5.H2 = 5; |
| | | outflowParas5.Dia = GetStdDia(outer_dia); |
| | | double height5 = 5 * (int)(((geomBaseInfo.D3 / 2 + sectionBundleInfo.H[8] / 2) * 1.5 + outflowParas3.Dia / 2) / 5 + 1); |
| | | outflowParas5.Heigh = height5; |
| | | outflowParas5.Septalradius = 3; |
| | | outflowParas5.R1 = (int)(((geomBaseInfo.D3 / 2 + sectionBundleInfo.H[8]) * 2.0 / 10) + 1) * 10; ; |
| | | outflowParas5.R2 = outflowParas5.CalR2(hdrBaseInfo, geomBaseInfo, sectionBundleInfo); |
| | | _parasControlArcSide.InitialParas(hdrBaseInfo, geomBaseInfo, sectionBundleInfo); |
| | | _parasControlArcSide.IsInvokeRefreshShapeAble = false; |
| | | _parasControlArcSide.SetBindingData(outflowParas5); |
| | | _parasControlArcSide.IsInvokeRefreshShapeAble = true; |
| | | |
| | | _sharp_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.ä¸å¿åºå£; |
| | | comboBoxType.SelectedIndex = 0; |
| | | if (_sharp_type == eOutflowShapeStyle.æªç¥) |
| | | { |
| | | _sharp_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.ä¸å¿åºå£; |
| | | comboBoxType.SelectedIndex = 0; |
| | | } |
| | | else |
| | | { |
| | | InitialOutflowStyle(); |
| | | |
| | | RefreshModel(); |
| | | } |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | private bool IsSameBaseParas( |
| | | ViewModel.HdrBaseInfo hdrBaseInfo, |
| | | ViewModel.GeomBaseInfo geomBaseInfo, |
| | | ViewModel.SectionBundleInfo sectionBundleInfo) |
| | | { |
| | | if (this._hdrBaseInfo == null) |
| | | return false; |
| | | if (this._geomBaseInfo == null) |
| | | return false; |
| | | if (this._sectionBundleInfo == null) |
| | | return false; |
| | | if (!this._hdrBaseInfo.IsSame(hdrBaseInfo)) |
| | | return false; |
| | | if (!this._geomBaseInfo.IsSame(geomBaseInfo)) |
| | | return false; |
| | | if (!this._sectionBundleInfo.IsSame(sectionBundleInfo)) |
| | | return false; |
| | | |
| | | this._hdrBaseInfo = hdrBaseInfo; |
| | | this._geomBaseInfo = geomBaseInfo; |
| | | this._sectionBundleInfo = sectionBundleInfo; |
| | | |
| | | return true; |
| | | } |
| | | private static double GetStdDia(double mm) |
| | | { |
| | | //var iFlangeCodeList = new int[] {10,15,20,25,32, |
| | |
| | | // 1100,1200,1300,1400,1500,1600,1800,2000,2200,2400,2600,2800,3000, |
| | | // 3200,3400,3600,3800,4000,5000,100000}; |
| | | var stdDia = mm; |
| | | if (mm > 0 && mm < 7) stdDia = 6; |
| | | if (mm > 0 && mm < 7) stdDia = 6; |
| | | if (mm >= 7 && mm < 9) stdDia = 8; |
| | | if (mm >= 9 && mm < 11) stdDia = 10; |
| | | if (mm >= 11 && mm < 17.5) stdDia = 15; |
| | |
| | | { |
| | | error = ""; |
| | | ViewModel.OutflowParas _outflowParas = null; |
| | | switch (_sharp_type) |
| | | if (_link_type == eOutflowLinkStyle.ç´çº¿åå¼§ && _sharp_type != eOutflowShapeStyle.ä¾§é¢åºå£_ç´çº¿è¿æ¥) |
| | | { |
| | | case DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.ä¸å¿åºå£: |
| | | _outflowParas = _parasControlCenter.GetBindingData(out error); |
| | | break; |
| | | case DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.ä¾§é¢åºå£_æ²çº¿è¿æ¥: |
| | | _outflowParas = _parasControlCurve.GetBindingData(out error); |
| | | break; |
| | | case DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.ä¾§é¢åºå£_ç´çº¿è¿æ¥: |
| | | _outflowParas = _parasControlLine.GetBindingData(out error); |
| | | break; |
| | | default: |
| | | return null; |
| | | if (_sharp_type == eOutflowShapeStyle.ä¸å¿åºå£) |
| | | { |
| | | if (_parasControlArcCenter == null) |
| | | return null; |
| | | _outflowParas = _parasControlArcCenter.GetBindingData(out error); |
| | | } |
| | | if (_sharp_type == eOutflowShapeStyle.ä¾§é¢åºå£_æ²çº¿è¿æ¥) |
| | | { |
| | | if (_parasControlArcSide == null) |
| | | return null; |
| | | _outflowParas = _parasControlArcSide.GetBindingData(out error); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | switch (_sharp_type) |
| | | { |
| | | case DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.ä¸å¿åºå£: |
| | | if (_parasControlCenter == null) |
| | | return null; |
| | | _outflowParas = _parasControlCenter.GetBindingData(out error); |
| | | break; |
| | | case DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.ä¾§é¢åºå£_æ²çº¿è¿æ¥: |
| | | _outflowParas = _parasControlCurve.GetBindingData(out error); |
| | | break; |
| | | case DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.ä¾§é¢åºå£_ç´çº¿è¿æ¥: |
| | | _outflowParas = _parasControlLine.GetBindingData(out error); |
| | | break; |
| | | default: |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | if (_outflowParas == null) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | _outflowParas.ShapeStyle = _sharp_type; |
| | | _outflowParas.LinkStyle = _link_type; |
| | | |
| | | return _outflowParas; |
| | | } |
| | |
| | | { |
| | | if (paras == null) |
| | | return; |
| | | if(_sectionBundleInfo == null) |
| | | if (_sectionBundleInfo == null) |
| | | { |
| | | throw new Exception("æªåå§åctrlSetOutflowParasæ§ä»¶"); |
| | | } |
| | | this._sharp_type = paras.ShapeStyle; |
| | | this._link_type = paras.LinkStyle; |
| | | var paras1 = new ViewModel.OutflowParas(paras); |
| | | var paras2 = new ViewModel.OutflowParas(paras); |
| | | var paras3 = new ViewModel.OutflowParas(paras); |
| | | var paras4 = new ViewModel.OutflowParas(paras); |
| | | var paras5 = new ViewModel.OutflowParas(paras); |
| | | _parasControlCenter.SetBindingData(paras1); |
| | | if (paras2.ShapeStyle == DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.ä¸å¿åºå£) |
| | | { |
| | | paras2.Offset = (int)((_geomBaseInfo.D3 + _sectionBundleInfo.H[8]) / 2 + 0.5); |
| | | } |
| | | else if(paras3.ShapeStyle == eOutflowShapeStyle.ä¾§é¢åºå£_æ²çº¿è¿æ¥) |
| | | else if (paras3.ShapeStyle == eOutflowShapeStyle.ä¾§é¢åºå£_æ²çº¿è¿æ¥) |
| | | { |
| | | paras3.Offset = (int)(((_geomBaseInfo.D3 / 2 + _sectionBundleInfo.H[8]) * 1.6 / 3 / 5) + 1) * 5; |
| | | } |
| | | |
| | | _parasControlLine.SetBindingData(paras2); |
| | | _parasControlCurve.SetBindingData(paras3); |
| | | _parasControlArcCenter.SetBindingData(paras4); |
| | | _parasControlArcSide.SetBindingData(paras5); |
| | | |
| | | if (_sharp_type == DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.ä¸å¿åºå£) |
| | | { |
| | |
| | | { |
| | | comboBoxType.SelectedIndex = 2; |
| | | } |
| | | |
| | | if(_link_type == eOutflowLinkStyle.ç´çº¿åå¼§) |
| | | { |
| | | checkBoxåå¼§è¿æ¥.Checked = true; |
| | | } |
| | | else |
| | | { |
| | | checkBoxåå¼§è¿æ¥.Checked = false; |
| | | } |
| | | InitialOutflowStyle(); |
| | | } |
| | | |
| | |
| | | var resp = OnRefreshShape3D(GetBindingData(out error)); |
| | | if (resp != null) |
| | | { |
| | | if (_sharp_type == eOutflowShapeStyle.ä¾§é¢åºå£_ç´çº¿è¿æ¥) |
| | | if (_link_type == eOutflowLinkStyle.ç´çº¿åå¼§ && _sharp_type != eOutflowShapeStyle.ä¾§é¢åºå£_ç´çº¿è¿æ¥) |
| | | { |
| | | _parasControlLine.SetBindingData(resp); |
| | | } |
| | | else if (_sharp_type == eOutflowShapeStyle.ä¾§é¢åºå£_æ²çº¿è¿æ¥) |
| | | { |
| | | _parasControlCurve.SetBindingData(resp); |
| | | if (_sharp_type == eOutflowShapeStyle.ä¸å¿åºå£) |
| | | { |
| | | _parasControlArcCenter.SetBindingData(resp); |
| | | } |
| | | else if (_sharp_type == eOutflowShapeStyle.ä¾§é¢åºå£_æ²çº¿è¿æ¥) |
| | | { |
| | | _parasControlArcSide.SetBindingData(resp); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | _parasControlCenter.SetBindingData(resp); |
| | | if (_sharp_type == eOutflowShapeStyle.ä¾§é¢åºå£_ç´çº¿è¿æ¥) |
| | | { |
| | | _parasControlLine.SetBindingData(resp); |
| | | } |
| | | else if (_sharp_type == eOutflowShapeStyle.ä¾§é¢åºå£_æ²çº¿è¿æ¥) |
| | | { |
| | | _parasControlCurve.SetBindingData(resp); |
| | | } |
| | | else |
| | | { |
| | | _parasControlCenter.SetBindingData(resp); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | if (comboBoxType.SelectedIndex == 0) |
| | | { |
| | | _sharp_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.ä¸å¿åºå£; |
| | | checkBoxåå¼§è¿æ¥.Enabled = true; |
| | | checkBoxåå¼§è¿æ¥.Visible = true; |
| | | if (checkBoxåå¼§è¿æ¥.Checked) |
| | | { |
| | | _link_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowLinkStyle.ç´çº¿åå¼§; |
| | | } |
| | | else |
| | | { |
| | | _link_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowLinkStyle.æ²çº¿; |
| | | } |
| | | } |
| | | else if (comboBoxType.SelectedIndex == 1) |
| | | { |
| | | _sharp_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.ä¾§é¢åºå£_æ²çº¿è¿æ¥; |
| | | } |
| | | checkBoxåå¼§è¿æ¥.Enabled = false; |
| | | checkBoxåå¼§è¿æ¥.Visible = false; |
| | | _link_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowLinkStyle.æ²çº¿; |
| | | if (checkBoxåå¼§è¿æ¥.Checked) |
| | | { |
| | | _link_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowLinkStyle.ç´çº¿åå¼§; |
| | | } |
| | | else |
| | | { |
| | | _link_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowLinkStyle.æ²çº¿; |
| | | } |
| | | } |
| | | else if (comboBoxType.SelectedIndex == 2) |
| | | { |
| | | _sharp_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.ä¾§é¢åºå£_ç´çº¿è¿æ¥; |
| | | checkBoxåå¼§è¿æ¥.Enabled = false; |
| | | checkBoxåå¼§è¿æ¥.Visible = false; |
| | | _link_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowLinkStyle.æ²çº¿; |
| | | } |
| | | |
| | | InitialOutflowStyle(); |
| | |
| | | { |
| | | NextStep(); |
| | | } |
| | | |
| | | private void checkBoxåå¼§è¿æ¥_CheckedChanged(object sender, EventArgs e) |
| | | { |
| | | if (!checkBoxåå¼§è¿æ¥.Checked) |
| | | { |
| | | _link_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowLinkStyle.æ²çº¿; |
| | | } |
| | | else |
| | | { |
| | | _link_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowLinkStyle.ç´çº¿åå¼§; |
| | | } |
| | | |
| | | InitialOutflowStyle(); |
| | | |
| | | RefreshModel(); |
| | | } |
| | | } |
| | | } |