| | |
| | | |
| | | tabPage1.Controls.Clear(); |
| | | |
| | | if (_link_type == eOutflowLinkStyle.ç´çº¿åå¼§ && _sharp_type != eOutflowShapeStyle.ä¾§é¢åºå£_ç´çº¿è¿æ¥) |
| | | { |
| | | if (_link_type == eOutflowLinkStyle.ç´çº¿åå¼§ && _sharp_type != eOutflowShapeStyle.ä¾§é¢å¯¹é½åºå£) |
| | | { |
| | | if (_sharp_type == eOutflowShapeStyle.ä¸å¿åºå£) |
| | | { |
| | | metroTileåºå£å¾ç.BackgroundImage = GlobalResource.BuildImage("Central-exit.png", 878, 238); |
| | |
| | | } |
| | | switch (_sharp_type) |
| | | { |
| | | case DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.ä¸å¿åºå£: |
| | | case DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.ä¸å¿åºå£: |
| | | metroTileåºå£å¾ç.BackgroundImage = GlobalResource.BuildImage("Central-exit.png", 878, 238); |
| | | _parasControlCenter.SetA_state(false); |
| | | tabPage1.Controls.Add(_parasControlCenter); |
| | |
| | | _parasControlCurve.SetA_state(true); |
| | | tabPage1.Controls.Add(_parasControlCurve); |
| | | return; |
| | | case DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.ä¾§é¢åºå£_ç´çº¿è¿æ¥: |
| | | case DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.ä¾§é¢å¯¹é½åºå£: |
| | | metroTileåºå£å¾ç.BackgroundImage = GlobalResource.BuildImage("Side-exit-straight-line.png", 878, 238); |
| | | tabPage1.Controls.Add(_parasControlLine); |
| | | return; |
| | |
| | | ViewModel.HdrBaseInfo hdrBaseInfo, |
| | | ViewModel.GeomBaseInfo geomBaseInfo, |
| | | ViewModel.SectionBundleInfo sectionBundleInfo, |
| | | ViewModel.OutflowParas outflowParas) |
| | | ViewModel.OutflowParas outflowParas) |
| | | { |
| | | if (IsSameBaseParas(hdrBaseInfo, geomBaseInfo, sectionBundleInfo)) |
| | | {//夿æ¯å¦ä¿®æ¹äº |
| | | if (_isxml) |
| | | { |
| | | _isxml = false; |
| | | } |
| | | return 0;//0表示没æåå |
| | | } |
| | | this._hdrBaseInfo = hdrBaseInfo; |
| | | this._geomBaseInfo = geomBaseInfo; |
| | | this._sectionBundleInfo = sectionBundleInfo; |
| | | |
| | | if(outflowParas != null) |
| | | if (outflowParas != null) |
| | | { |
| | | _sharp_type = outflowParas.ShapeStyle; |
| | | _link_type = outflowParas.LinkStyle; |
| | |
| | | // |
| | | InitialCtrlDefaultParas(hdrBaseInfo, geomBaseInfo, sectionBundleInfo, outflowParas); |
| | | |
| | | |
| | | if(_link_type == eOutflowLinkStyle.æ²çº¿) |
| | | |
| | | if (_link_type == eOutflowLinkStyle.æ²çº¿) |
| | | { |
| | | checkBoxåå¼§è¿æ¥.Checked = false; |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | if(_link_type == eOutflowLinkStyle.ç´çº¿åå¼§ ) |
| | | { |
| | | comboBoxType.Items.Clear(); |
| | | comboBoxType.Items.AddRange(new string[] { "ä¸å¿åºå£", "ä¾§é¢åºå£" }); |
| | | checkBoxåå¼§è¿æ¥.Checked = true; |
| | | checkBoxæ²çº¿.Checked = false; |
| | | }else if(_link_type == eOutflowLinkStyle.æ²çº¿) |
| | | { |
| | | comboBoxType.Items.Clear(); |
| | | comboBoxType.Items.AddRange(new string[] { "ä¸å¿åºå£", "ä¾§é¢åºå£", "ä¾§é¢å¯¹é½åºå£" }); |
| | | checkBoxåå¼§è¿æ¥.Checked = false; |
| | | checkBoxæ²çº¿.Checked = true; |
| | | } |
| | | comboBoxType.SelectedIndex = (int)_sharp_type; |
| | | InitialOutflowStyle(); |
| | | RefreshModel(); |
| | | |
| | | |
| | | } |
| | | if (_isxml) |
| | | { |
| | |
| | | double outer_dia = 4.5 * Math.Pow(hdrBaseInfo.Q / 3600 / hdrBaseInfo.n, 1 / 3.0) * 1000; |
| | | //侧颿²çº¿ |
| | | OutflowParas outflowParas侧颿²çº¿ = null; |
| | | if(outflowParas != null && outflowParas.ShapeStyle == eOutflowShapeStyle.ä¾§é¢åºå£) |
| | | if (outflowParas != null && outflowParas.ShapeStyle == eOutflowShapeStyle.ä¾§é¢åºå£) |
| | | { |
| | | outflowParas侧颿²çº¿ = outflowParas; |
| | | } |
| | |
| | | _parasControlCenter.IsInvokeRefreshShapeAble = true; |
| | | |
| | | //ä¾§é¢ç´çº¿ |
| | | OutflowParas outflowParasä¾§é¢ç´çº¿ = null; |
| | | if (outflowParas != null && outflowParas.ShapeStyle == eOutflowShapeStyle.ä¾§é¢åºå£_ç´çº¿è¿æ¥ && outflowParas.LinkStyle == eOutflowLinkStyle.æ²çº¿) |
| | | OutflowParas outflowParasä¾§é¢å¯¹é½ = null; |
| | | if (outflowParas != null && outflowParas.ShapeStyle == eOutflowShapeStyle.ä¾§é¢å¯¹é½åºå£ ) |
| | | { |
| | | outflowParasä¾§é¢ç´çº¿ = outflowParas; |
| | | outflowParasä¾§é¢å¯¹é½ = outflowParas; |
| | | } |
| | | else |
| | | { |
| | | outflowParasä¾§é¢ç´çº¿ = new OutflowParas(); |
| | | outflowParasä¾§é¢ç´çº¿.Offset = (int)((geomBaseInfo.D3 + sectionBundleInfo.H[8]) / 2 + 0.5); |
| | | outflowParasä¾§é¢ç´çº¿.H1 = 5; |
| | | outflowParasä¾§é¢ç´çº¿.H2 = 5; |
| | | outflowParasä¾§é¢ç´çº¿.Dia = GetStdDia(outer_dia); |
| | | double height2 = 5 * (int)(((outflowParasä¾§é¢ç´çº¿.Dia - Math.Sqrt(4 * sectionBundleInfo.Area[8] / Math.PI)) / (2 * Math.Tan(4 * Math.PI / 180))) / 5 + 0.5); |
| | | outflowParasä¾§é¢å¯¹é½ = new OutflowParas(); |
| | | outflowParasä¾§é¢å¯¹é½.Offset = (int)((geomBaseInfo.D3 + sectionBundleInfo.H[8]) / 2 + 0.5); |
| | | outflowParasä¾§é¢å¯¹é½.H1 = 5; |
| | | outflowParasä¾§é¢å¯¹é½.H2 = 5; |
| | | outflowParasä¾§é¢å¯¹é½.Dia = GetStdDia(outer_dia); |
| | | double height2 = 5 * (int)(((outflowParasä¾§é¢å¯¹é½.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; |
| | | } |
| | | outflowParasä¾§é¢ç´çº¿.Heigh = height2; |
| | | outflowParasä¾§é¢ç´çº¿.Septalradius = 3; |
| | | outflowParasä¾§é¢å¯¹é½.Heigh = height2; |
| | | outflowParasä¾§é¢å¯¹é½.Septalradius = 3; |
| | | } |
| | | _parasControlLine.InitialParas(hdrBaseInfo, geomBaseInfo, sectionBundleInfo); |
| | | _parasControlLine.IsInvokeRefreshShapeAble = false; |
| | | _parasControlLine.SetBindingData(outflowParasä¾§é¢ç´çº¿); |
| | | _parasControlLine.SetBindingData(outflowParasä¾§é¢å¯¹é½); |
| | | _parasControlLine.IsInvokeRefreshShapeAble = true; |
| | | |
| | | //åå¼§ä¸å¿ |
| | |
| | | { |
| | | error = ""; |
| | | ViewModel.OutflowParas _outflowParas = null; |
| | | if (_link_type == eOutflowLinkStyle.ç´çº¿åå¼§ && _sharp_type != eOutflowShapeStyle.ä¾§é¢åºå£_ç´çº¿è¿æ¥) |
| | | if (_link_type == eOutflowLinkStyle.ç´çº¿åå¼§ && _sharp_type != eOutflowShapeStyle.ä¾§é¢å¯¹é½åºå£) |
| | | { |
| | | if (_sharp_type == eOutflowShapeStyle.ä¸å¿åºå£) |
| | | { |
| | |
| | | case DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.ä¾§é¢åºå£: |
| | | _outflowParas = _parasControlCurve.GetBindingData(out error); |
| | | break; |
| | | case DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.ä¾§é¢åºå£_ç´çº¿è¿æ¥: |
| | | case DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.ä¾§é¢å¯¹é½åºå£: |
| | | _outflowParas = _parasControlLine.GetBindingData(out error); |
| | | break; |
| | | default: |
| | |
| | | { |
| | | comboBoxType.SelectedIndex = 1; |
| | | } |
| | | else if (_sharp_type == DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.ä¾§é¢åºå£_ç´çº¿è¿æ¥) |
| | | else if (_sharp_type == DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.ä¾§é¢å¯¹é½åºå£) |
| | | { |
| | | comboBoxType.SelectedIndex = 2; |
| | | } |
| | | if(_link_type == eOutflowLinkStyle.ç´çº¿åå¼§) |
| | | if (_link_type == eOutflowLinkStyle.ç´çº¿åå¼§) |
| | | { |
| | | checkBoxåå¼§è¿æ¥.Checked = true; |
| | | } |
| | |
| | | private void RefreshModel() |
| | | { |
| | | string error; |
| | | if(OnRefreshShape3D == null) |
| | | if (OnRefreshShape3D == null) |
| | | { |
| | | return; |
| | | } |
| | | var resp = OnRefreshShape3D(GetBindingData(out error)); |
| | | if (resp != null) |
| | | { |
| | | if (_link_type == eOutflowLinkStyle.ç´çº¿åå¼§ && _sharp_type != eOutflowShapeStyle.ä¾§é¢åºå£_ç´çº¿è¿æ¥) |
| | | if (_link_type == eOutflowLinkStyle.ç´çº¿åå¼§ && _sharp_type != eOutflowShapeStyle.ä¾§é¢å¯¹é½åºå£) |
| | | { |
| | | if (_sharp_type == eOutflowShapeStyle.ä¸å¿åºå£) |
| | | { |
| | |
| | | { |
| | | _parasControlArcSide.SetBindingData(resp); |
| | | } |
| | | |
| | | |
| | | } |
| | | else |
| | | { |
| | | if (_sharp_type == eOutflowShapeStyle.ä¾§é¢åºå£_ç´çº¿è¿æ¥) |
| | | if (_sharp_type == eOutflowShapeStyle.ä¾§é¢å¯¹é½åºå£) |
| | | { |
| | | _parasControlLine.SetBindingData(resp); |
| | | } |
| | |
| | | |
| | | private void comboBoxType_SelectedIndexChanged(object sender, EventArgs e) |
| | | { |
| | | if (comboBoxType.SelectedIndex == 0) |
| | | if (comboBoxType.SelectedItem.ToString() == "ä¸å¿åºå£") |
| | | { |
| | | _sharp_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.ä¸å¿åºå£; |
| | | checkBoxåå¼§è¿æ¥.Enabled = true; |
| | | checkBoxåå¼§è¿æ¥.Visible = true; |
| | | //checkBoxåå¼§è¿æ¥.Enabled = true; |
| | | //checkBoxåå¼§è¿æ¥.Visible = true; |
| | | if (checkBoxåå¼§è¿æ¥.Checked) |
| | | { |
| | | _link_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowLinkStyle.ç´çº¿åå¼§; |
| | |
| | | _link_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowLinkStyle.æ²çº¿; |
| | | } |
| | | } |
| | | else if (comboBoxType.SelectedIndex == 1) |
| | | else if (comboBoxType.SelectedItem.ToString() == "ä¾§é¢åºå£") |
| | | { |
| | | _sharp_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.ä¾§é¢åºå£; |
| | | checkBoxåå¼§è¿æ¥.Enabled = true; |
| | | checkBoxåå¼§è¿æ¥.Visible = true; |
| | | //checkBoxåå¼§è¿æ¥.Enabled = true; |
| | | //checkBoxåå¼§è¿æ¥.Visible = true; |
| | | _link_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowLinkStyle.æ²çº¿; |
| | | if (checkBoxåå¼§è¿æ¥.Checked) |
| | | { |
| | |
| | | _link_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowLinkStyle.æ²çº¿; |
| | | } |
| | | } |
| | | else if (comboBoxType.SelectedIndex == 2) |
| | | else if (comboBoxType.SelectedItem.ToString() == "ä¾§é¢å¯¹é½åºå£") |
| | | { |
| | | _sharp_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.ä¾§é¢åºå£_ç´çº¿è¿æ¥; |
| | | checkBoxåå¼§è¿æ¥.Enabled = false; |
| | | checkBoxåå¼§è¿æ¥.Visible = false; |
| | | _sharp_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowShapeStyle.ä¾§é¢å¯¹é½åºå£; |
| | | //checkBoxåå¼§è¿æ¥.Enabled = false; |
| | | //checkBoxåå¼§è¿æ¥.Visible = false; |
| | | _link_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowLinkStyle.æ²çº¿; |
| | | } |
| | | if (_isxml) |
| | |
| | | } |
| | | InitialOutflowStyle(); |
| | | |
| | | RefreshModel(); |
| | | RefreshModel(); |
| | | } |
| | | |
| | | private void btnNextStep_Click(object sender, EventArgs e) |
| | |
| | | { |
| | | if (!checkBoxåå¼§è¿æ¥.Checked) |
| | | { |
| | | checkBoxæ²çº¿.Checked = true; |
| | | _link_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowLinkStyle.æ²çº¿; |
| | | comboBoxType.Items.Clear(); |
| | | comboBoxType.Items.AddRange(new string[] { "ä¸å¿åºå£", "ä¾§é¢åºå£", "ä¾§é¢å¯¹é½åºå£" }); |
| | | |
| | | } |
| | | else |
| | | { |
| | | checkBoxæ²çº¿.Checked = false; |
| | | _link_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowLinkStyle.ç´çº¿åå¼§; |
| | | comboBoxType.Items.Clear(); |
| | | comboBoxType.Items.AddRange(new string[] { "ä¸å¿åºå£", "ä¾§é¢åºå£" }); |
| | | if (comboBoxType.Text == "ä¾§é¢å¯¹é½åºå£") |
| | | { |
| | | comboBoxType.SelectedIndex = 0; |
| | | InitialOutflowStyle(); |
| | | return; |
| | | } |
| | | } |
| | | if (_isxml) |
| | | { |
| | |
| | | |
| | | RefreshModel(); |
| | | } |
| | | |
| | | private void checkBoxæ²çº¿_CheckedChanged(object sender, EventArgs e) |
| | | { |
| | | if (!checkBoxæ²çº¿.Checked) |
| | | { |
| | | checkBoxåå¼§è¿æ¥.Checked = true; |
| | | _link_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowLinkStyle.ç´çº¿åå¼§; |
| | | } |
| | | else |
| | | { |
| | | checkBoxåå¼§è¿æ¥.Checked = false; |
| | | _link_type = DPumpHydr.WinFrmUI.Volute.ViewModel.eOutflowLinkStyle.æ²çº¿; |
| | | } |
| | | } |
| | | } |
| | | } |