| | |
| | | ViewModel.SectionBundleInfo _sectionBundleInfo = null; |
| | | ViewModel.HdrBaseInfo _hdrBaseInfo = null; |
| | | ViewModel.GeomBaseInfo _geomBaseInfo = null; |
| | | public void SetBindingData(ViewModel.SectionBundleInfo sectionBundle_info) |
| | | { |
| | | _sectionBundleInfo= sectionBundle_info; |
| | | } |
| | | |
| | | |
| | | public void ShowPage( |
| | |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if(_hdrBaseInfo == null && _geomBaseInfo == null) |
| | | { |
| | | _hdrBaseInfo = base_info; |
| | | _geomBaseInfo = geom_info; |
| | | } |
| | | if (isRefreshModel == false) |
| | | { |
| | | return; |
| | | } |
| | | if (_sectionBundleInfo == null) |
| | | { |
| | | this._hdrBaseInfo = base_info; |
| | |
| | | else |
| | | { |
| | | if (Math.Abs(_sectionBundleInfo.BaseWidth - _geomBaseInfo.B3) < 1 && |
| | | Math.Abs(_sectionBundleInfo.BaseCircleRadius - _geomBaseInfo.D3 / 2) < 1) |
| | | Math.Abs(_sectionBundleInfo.BaseCircleRadius - _geomBaseInfo.D3 / 2) < 1 ) |
| | | { |
| | | |
| | | _sectionBundleInfo.BaseWidth = _geomBaseInfo.B3; |
| | |
| | | |
| | | RefreshAllSectPara(_sectionBundleInfo); |
| | | |
| | | if (isRefreshModel == false) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | |
| | | RefreshShape(_sectionBundleInfo); |
| | | } |
| | |
| | | this.textBoxK3.Text = _sectionBundleInfo.K3.ToString(); |
| | | this.textBoxV3.Text = _sectionBundleInfo.V3.ToString(); |
| | | |
| | | |
| | | RefrehSectBundlePara(); |
| | | if (_sectionBundleInfo.ShapeType == eSectionShapeType.对称) |
| | | { |
| | | RBtnæé¢å¯¹ç§°æ¢¯å½¢.Checked = true; |
| | |
| | | RBtnä¸å¯¹ç§°æ¢¯å½¢.Checked = false; |
| | | RBtnç©å½¢.Checked = true; |
| | | } |
| | | |
| | | RefrehSectBundlePara(); |
| | | } |
| | | //æ¹é¢ç§¯ |
| | | public void RefreshSingleSectArea(int sectIndex, double area) |
| | |
| | | |
| | | _sectionBundleInfo.V3 = Convert.ToDouble(this.textBoxV3.Text); |
| | | for (var argument = 1; argument <= 8; argument++) |
| | | { |
| | | {//skyTextBoxæé¢H18 |
| | | var controlname_y1 = $"skyTextBoxæé¢y1{argument}"; |
| | | var controlname_r1 = $"skyTextBoxæé¢r1{argument}"; |
| | | var controlnameæé¢é¢ç§¯ = $"skyTextBoxæé¢é¢ç§¯{argument}"; |
| | | var controlnameh = $"skyTextBoxæé¢H1{argument}"; |
| | | SkyTextBox controlY1 = this.Controls.Find(controlname_y1, true).FirstOrDefault() as SkyTextBox; |
| | | SkyTextBox controlR1 = this.Controls.Find(controlname_r1, true).FirstOrDefault() as SkyTextBox; |
| | | SkyTextBox controlæé¢é¢ç§¯ = this.Controls.Find(controlnameæé¢é¢ç§¯, true).FirstOrDefault() as SkyTextBox; |
| | | SkyTextBox controlH = this.Controls.Find(controlnameh, true).FirstOrDefault() as SkyTextBox; |
| | | if (controlY1 != null) |
| | | { |
| | | _sectionBundleInfo.GaMa_Left[argument] = Convert.ToDouble(controlY1.Text); |
| | |
| | | |
| | | if (controlæé¢é¢ç§¯ != null) |
| | | _sectionBundleInfo.Area[argument] = Convert.ToDouble(controlæé¢é¢ç§¯.Text); |
| | | if (controlH != null) |
| | | _sectionBundleInfo.H[argument] = Convert.ToDouble(controlH.Text); |
| | | } |
| | | |
| | | |
| | |
| | | SkyTextBox controlr1 = this.Controls.Find($"skyTextBoxæé¢r1{index}", true).FirstOrDefault() as SkyTextBox; |
| | | SkyTextBox controlGaMa1 = this.Controls.Find($"skyTextBoxæé¢y1{index}", true).FirstOrDefault() as SkyTextBox; |
| | | SkyTextBox controlh1 = this.Controls.Find($"skyTextBoxæé¢H1{index}", true).FirstOrDefault() as SkyTextBox; |
| | | //ç®åè¿ä¸ªåªæ£æµå¯¹ç§°ç b3-2(r1-(tan(Gama1)*(h-r1))) //è¥ä¸å¯¹ç§° b3-ï¼r1-(tan(Gama1)*(h-r1))ï¼-ï¼r2-(tan(Gama2)*(h-r2))ï¼ |
| | | var x = Math.Tan(Convert.ToDouble(controlGaMa1.Text) * Math.PI / 180) * Convert.ToDouble(controlh1.Text) |
| | | - (Math.Tan(Convert.ToDouble(controlGaMa1.Text) * Math.PI / 180) * Math.Tan(Convert.ToDouble(controlGaMa1.Text) / 2 * Math.PI / 180) * Convert.ToDouble(controlr1.Text)) |
| | | - (Math.Tan(Convert.ToDouble(controlGaMa1.Text) * Math.PI / 180) * Convert.ToDouble(controlr1.Text)) - Convert.ToDouble(controlr1.Text); |
| | | var c = _sectionBundleInfo.R_out / 1000; |
| | | var TopWidth = _sectionBundleInfo.BaseWidth + (2 * x); |
| | | var Slash = (Convert.ToDouble(controlh1.Text) - Convert.ToDouble(controlr1.Text) - (Math.Sin(Convert.ToDouble(controlGaMa1.Text) * Math.PI / 180) * Convert.ToDouble(controlr1.Text))) / Math.Cos(Convert.ToDouble(controlGaMa1.Text) * Math.PI / 180); |
| | | if ((!RBtnç©å½¢.Checked && (TopWidth < c || Slash < c)) || Convert.ToDouble(controlr1.Text) == 0) |
| | | if (RBtnç©å½¢.Checked) |
| | | { |
| | | controlr1.BackColor = Color.OrangeRed; |
| | | MessageBox.Show("rä¸åçï¼è¯·éæ°è¾å
¥"); |
| | | if (Convert.ToDouble(controlh1.Text) - Convert.ToDouble(controlr1.Text) < 1|| _sectionBundleInfo.BaseWidth- (Convert.ToDouble(controlr1.Text)*2) < 1) |
| | | { |
| | | controlr1.BackColor = Color.OrangeRed; |
| | | MessageBox.Show("rä¸åçï¼è¯·éæ°è¾å
¥"); |
| | | } |
| | | else |
| | | { |
| | | controlr1.BackColor = Color.White; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | controlr1.BackColor = Color.White; |
| | | //ç®åè¿ä¸ªåªæ£æµå¯¹ç§°ç //è¥ä¸å¯¹ç§°æ´æ¢åå¾è§åº¦çåæ°éæ°è®¡ç®å¦ä¸è¾¹x |
| | | var x = Math.Tan(Convert.ToDouble(controlGaMa1.Text) * Math.PI / 180) * Convert.ToDouble(controlh1.Text) |
| | | - (Math.Tan(Convert.ToDouble(controlGaMa1.Text) * Math.PI / 180) * Math.Tan(Convert.ToDouble(controlGaMa1.Text) / 2 * Math.PI / 180) * Convert.ToDouble(controlr1.Text)) |
| | | - (Math.Tan(Convert.ToDouble(controlGaMa1.Text) * Math.PI / 180) * Convert.ToDouble(controlr1.Text)) - Convert.ToDouble(controlr1.Text); |
| | | var c = _sectionBundleInfo.R_out / 1000; |
| | | var TopWidth = _sectionBundleInfo.BaseWidth + (2 * x); |
| | | var Slash = (Convert.ToDouble(controlh1.Text) - Convert.ToDouble(controlr1.Text) - (Math.Sin(Convert.ToDouble(controlGaMa1.Text) * Math.PI / 180) * Convert.ToDouble(controlr1.Text))) / Math.Cos(Convert.ToDouble(controlGaMa1.Text) * Math.PI / 180); |
| | | if ((!RBtnç©å½¢.Checked && (TopWidth < c || Slash < c)) || Convert.ToDouble(controlr1.Text) == 0) |
| | | { |
| | | controlr1.BackColor = Color.OrangeRed; |
| | | MessageBox.Show("rä¸åçï¼è¯·éæ°è¾å
¥"); |
| | | } |
| | | else |
| | | { |
| | | controlr1.BackColor = Color.White; |
| | | } |
| | | } |
| | | |
| | | |
| | | return isreasonable; |
| | | } |