yangyin
2025-03-23 977ef9de17c3b83727fa92fe8178ab6486425ada
WinFrmUI/DPumpHydr.WinFrmUI.Volute/¶ÏÃæÉè¼Æ/ctrlSectionBundleInfo.cs
@@ -463,7 +463,22 @@
                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();
                }
            }
        }
@@ -793,5 +808,32 @@
                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();
                }
            }
        }
    }
}