| | |
| | | ViewModel.GeomBaseInfo _geomBaseInfo = null; |
| | | public void SetBindingData(ViewModel.SectionBundleInfo sectionBundle_info) |
| | | { |
| | | _sectionBundleInfo= sectionBundle_info; |
| | | _sectionBundleInfo = sectionBundle_info; |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | return; |
| | | } |
| | | if(_hdrBaseInfo == null && _geomBaseInfo == null) |
| | | if (_hdrBaseInfo == null && _geomBaseInfo == null) |
| | | { |
| | | _hdrBaseInfo = base_info; |
| | | _geomBaseInfo = geom_info; |
| | | } |
| | | if (isRefreshModel ) |
| | | if (isRefreshModel) |
| | | { |
| | | return; |
| | | } |
| | |
| | | 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); |
| | | |
| | | |
| | | |
| | | |
| | | RefreshShape(_sectionBundleInfo); |
| | | } |
| | |
| | | error = "请è¾å
¥å¿
填项ï¼"; |
| | | isOk = false; |
| | | } |
| | | if (string.IsNullOrEmpty(skyTextBoxæé¢y18.Text) || (!RBtnç©å½¢.Checked && double.Parse(skyTextBoxæé¢y18.Text) == 0)|| double.Parse(skyTextBoxæé¢y18.Text) < 0) |
| | | if (string.IsNullOrEmpty(skyTextBoxæé¢y18.Text) || (!RBtnç©å½¢.Checked && double.Parse(skyTextBoxæé¢y18.Text) == 0) || double.Parse(skyTextBoxæé¢y18.Text) < 0) |
| | | { |
| | | error = "请è¾å
¥å¿
填项ï¼"; |
| | | isOk = false; |
| | | |
| | | } |
| | | if (string.IsNullOrEmpty(skyTextBoxæé¢r18.Text) || (!RBtnç©å½¢.Checked && double.Parse(skyTextBoxæé¢r18.Text) == 0)|| double.Parse(skyTextBoxæé¢y18.Text) < 0) |
| | | if (string.IsNullOrEmpty(skyTextBoxæé¢r18.Text) || (!RBtnç©å½¢.Checked && double.Parse(skyTextBoxæé¢r18.Text) == 0) || double.Parse(skyTextBoxæé¢y18.Text) < 0) |
| | | { |
| | | error = "请è¾å
¥å¿
填项ï¼"; |
| | | isOk = false; |
| | |
| | | int index = Convert.ToInt32(lastChar); |
| | | if (!double.TryParse(skytextBox.Text, out double result) && !string.IsNullOrEmpty(skytextBox.Text)) |
| | | { |
| | | result = _sectionBundleInfo.GaMa_Left[index]; |
| | | skytextBox.Text = _sectionBundleInfo.GaMa_Left[index].ToString(); |
| | | }else if(result>45) |
| | | { |
| | | MessageBox.Show("请è¾å
¥å°äº45度çè§åº¦"); |
| | | skytextBox.Text = _sectionBundleInfo.GaMa_Left[index].ToString(); |
| | | } |
| | | else |
| | | { |
| | | var initialR = _sectionBundleInfo.CalInitialR(_hdrBaseInfo, _geomBaseInfo); |
| | | var height = _sectionBundleInfo.CalcHeight(_geomBaseInfo, index, result, initialR[index]); |
| | | var R = _sectionBundleInfo.CheckChamferR(height, index, result, initialR[index]); |
| | | SkyTextBox controlh1 = this.Controls.Find($"skyTextBoxæé¢H1{index}", true).FirstOrDefault() as SkyTextBox; |
| | | SkyTextBox controlr1 = this.Controls.Find($"skyTextBoxæé¢r1{index}", true).FirstOrDefault() as SkyTextBox; |
| | | controlh1.Text = height.ToString(); |
| | | controlr1.Text = R.ToString(); |
| | | } |
| | | } |
| | | } |
| | |
| | | SkyTextBox controlGaMa1 = this.Controls.Find($"skyTextBoxæé¢y1{index}", true).FirstOrDefault() as SkyTextBox; |
| | | SkyTextBox controlh1 = this.Controls.Find($"skyTextBoxæé¢H1{index}", true).FirstOrDefault() as SkyTextBox; |
| | | if (string.IsNullOrEmpty(controlr1.Text)) |
| | | return true ; |
| | | return true; |
| | | if (string.IsNullOrEmpty(controlGaMa1.Text)) |
| | | return true; |
| | | if (string.IsNullOrEmpty(controlh1.Text)) |
| | |
| | | |
| | | if (RBtnç©å½¢.Checked) |
| | | { |
| | | if (Convert.ToDouble(controlh1.Text) - Convert.ToDouble(controlr1.Text) < 1|| _sectionBundleInfo.BaseWidth- (Convert.ToDouble(controlr1.Text)*2) < 1) |
| | | 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ä¸åçï¼è¯·éæ°è¾å
¥"); |
| | |
| | | controlr1.BackColor = Color.White; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | return isreasonable; |
| | | } |
| | |
| | | if (controly1 != null) |
| | | controly1.Text = Math.Round(_sectionBundleInfo.GaMa_Left[sect_index], 1).ToString(); |
| | | if (controly2 != null) |
| | | controly2.Text = Math.Round( _sectionBundleInfo.R_Left[sect_index],1).ToString(); |
| | | controly2.Text = Math.Round(_sectionBundleInfo.R_Left[sect_index], 1).ToString(); |
| | | if (controlæé¢é¢ç§¯ != null) |
| | | controlæé¢é¢ç§¯.Text = Math.Round(_sectionBundleInfo.Area[sect_index], 1).ToString(); |
| | | if (controH1 != null) |
| | |
| | | SkyTextBox controly1 = this.Controls.Find(controlnameGama1, true).FirstOrDefault() as SkyTextBox; |
| | | controly1.Enabled = false; |
| | | } |
| | | return; |
| | | return; |
| | | } |
| | | //for (var sect_index = 1; sect_index <= 8; sect_index++) |
| | | //{ |
| | |
| | | RefreshShape(Rec_sectionBundleInfo); |
| | | } |
| | | } |
| | | |
| | | private void skyTextBoxæé¢H11_TextChanged(object sender, EventArgs e) |
| | | { |
| | | if (sender is SkyTextBox skytextBox) |
| | | { |
| | | string lastChar = skytextBox.Name[skytextBox.Name.Length - 1].ToString(); |
| | | int index = Convert.ToInt32(lastChar); |
| | | if (!double.TryParse(skytextBox.Text, out double resultH) && !string.IsNullOrEmpty(skytextBox.Text)) |
| | | { |
| | | resultH = _sectionBundleInfo.H[index]; |
| | | skytextBox.Text = _sectionBundleInfo.H[index].ToString(); |
| | | } |
| | | else |
| | | { |
| | | SkyTextBox controlGaMa1 = this.Controls.Find($"skyTextBoxæé¢y1{index}", true).FirstOrDefault() as SkyTextBox; |
| | | SkyTextBox controlr1 = this.Controls.Find($"skyTextBoxæé¢r1{index}", true).FirstOrDefault() as SkyTextBox; |
| | | if (!double.TryParse(controlGaMa1.Text, out double resultGame) && !string.IsNullOrEmpty(controlGaMa1.Text)) |
| | | { |
| | | resultH = _sectionBundleInfo.GaMa_Left[index]; |
| | | } |
| | | var R = _sectionBundleInfo.HCalR(_geomBaseInfo, index, resultGame, resultH); |
| | | R = _sectionBundleInfo.CheckChamferR(resultH, index, resultH, R); |
| | | skytextBox.Text = resultH.ToString(); |
| | | controlr1.Text = R.ToString(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |