chenn
2025-04-19 96095f8ac4b464540cd2c0bd7308916a137c5041
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using HydrEngineCSharp;
 
namespace DPumpHydr.OpenFwUI.Volute
{
    public partial class ctrlSectionBundleInfo: UserControl
    {
        public ctrlSectionBundleInfo()
        {
            InitializeComponent();
            BuildIcon();
            crownLabelVIII.DoubleClick += (ss, ee) =>
            {
                HightLightSectCurve(8);
            };
            crownLabelVII.DoubleClick += (ss, ee) =>
            {
                HightLightSectCurve(7);
            };
            crownLabelVI.DoubleClick += (ss, ee) =>
            {
                HightLightSectCurve(6);
            };
            crownLabelV.DoubleClick += (ss, ee) =>
            {
                HightLightSectCurve(5);
            };
            crownLabelIV.DoubleClick += (ss, ee) =>
            {
                HightLightSectCurve(4);
            };
            crownLabelIII.DoubleClick += (ss, ee) =>
            {
                HightLightSectCurve(3);
            };
            crownLabelII.DoubleClick += (ss, ee) =>
            {
                HightLightSectCurve(2);
            };
            crownLabelI.DoubleClick += (ss, ee) =>
            {
                HightLightSectCurve(1);
            };
 
            
            //_isxml = true;
            //ShowPage(_hdrBaseInfo, _geomBaseInfo, DPumpHydr.OpenFwUI.Volute.eWizardStepDiretion.前进 , true);
        }
        DPumpHydr.OpenFwUI.Volute.SectionBundleInfo _sectionBundleInfo = null;
        DPumpHydr.OpenFwUI.Volute.HdrBaseInfo _hdrBaseInfo = null;
        DPumpHydr.OpenFwUI.Volute.GeomBaseInfo _geomBaseInfo = null;
        public void SetBindingData(DPumpHydr.OpenFwUI.Volute.SectionBundleInfo sectionBundle_info)
        {
            _sectionBundleInfo = sectionBundle_info;
        }
 
        bool _isxml = false;
        /// <summary>
        /// 显示界面
        /// </summary>
        /// <param name="base_info">基本参数</param>
        /// <param name="geom_info">基圆参数</param>
        /// <param name="step_direction">前进/后退</param>
        /// <param name="isRefreshModel">是否需要覆盖断面参数</param>
        public void ShowPage(
            DPumpHydr.OpenFwUI.Volute.HdrBaseInfo base_info,
            DPumpHydr.OpenFwUI.Volute.GeomBaseInfo geom_info,
            DPumpHydr.OpenFwUI.Volute.eWizardStepDiretion step_direction, bool isRefreshModel = false)
        {
            _isxml = isRefreshModel;
            if (step_direction == DPumpHydr.OpenFwUI.Volute.eWizardStepDiretion.后退)
            {
                return;
            }
            if (_hdrBaseInfo == null && _geomBaseInfo == null)
            {
                _hdrBaseInfo = base_info;
                _geomBaseInfo = geom_info;
            }
            if (!isRefreshModel)
            {
                return;
            }
            if (_sectionBundleInfo == null)
            {
                this._hdrBaseInfo = base_info;
                this._geomBaseInfo = geom_info;
                _sectionBundleInfo = new DPumpHydr.OpenFwUI.Volute.SectionBundleInfo();
 
                _sectionBundleInfo.BaseWidth = _geomBaseInfo.B3;
                _sectionBundleInfo.BaseCircleRadius = _geomBaseInfo.D3 / 2;
 
                _sectionBundleInfo.ResetAllParas(_hdrBaseInfo, _geomBaseInfo);
            }
            else
            {
                if (Math.Abs(_sectionBundleInfo.BaseWidth - _geomBaseInfo.B3) < 1 &&
                    Math.Abs(_sectionBundleInfo.BaseCircleRadius - _geomBaseInfo.D3 / 2) < 1)
                {
 
                    _sectionBundleInfo.BaseWidth = _geomBaseInfo.B3;
                    _sectionBundleInfo.BaseCircleRadius = _geomBaseInfo.D3 / 2;
                    if (_hdrBaseInfo.n != base_info.n || _hdrBaseInfo.Q != base_info.Q || _hdrBaseInfo.H != base_info.H || _hdrBaseInfo.IsSXB != base_info.IsSXB)
                    {
                        this._hdrBaseInfo = base_info;
                        this._geomBaseInfo = geom_info;
                        _sectionBundleInfo.InitialK3(this._hdrBaseInfo, this._geomBaseInfo);
                        RefreshAllSectPara(_sectionBundleInfo);
                        _sectionBundleInfo.RecalculateArea(this._hdrBaseInfo, this._geomBaseInfo);
 
                        RefrehSectBundlePara();
 
 
                        if (OnRefreshShape != null)
                        {
                            DPumpHydr.OpenFwUI.Volute.SectionBundleInfo paras = GetBindingData(out string error);
                            if (paras == null)
                                return;
                            //textBox割舌角度
                            OnRefreshShape.Invoke(paras);
                        }
                        //RefreshShape(_sectionBundleInfo);
                    }
                    else
                    {
                        this._hdrBaseInfo = base_info;
                        this._geomBaseInfo = geom_info;
                        RefreshShape(_sectionBundleInfo);
                    }
 
                    return;
                }
            }
 
            RefreshAllSectPara(_sectionBundleInfo);
 
            RefreshShape(_sectionBundleInfo);
        }
        private void pictureBoxRefreshK3_Click(object sender, EventArgs e)
        {
            _sectionBundleInfo.InitialK3(this._hdrBaseInfo, this._geomBaseInfo);
 
            RefreshAllSectPara(_sectionBundleInfo);
        }
        //
        public void RefreshAllSectPara(DPumpHydr.OpenFwUI.Volute.SectionBundleInfo paras)
        {
            this._sectionBundleInfo = paras;
 
            this.textBox速度系数.Text = _sectionBundleInfo.K3.ToString();
            this.textBox平均流速.Text = _sectionBundleInfo.V3.ToString();
 
 
            RefrehSectBundlePara();
            if (_sectionBundleInfo.ShapeType == eSectionShapeType.对称)
            {
                radioButton对称.Checked = true;
                radioButton不对称.Checked = false;
                radioButton矩形.Checked = false;
            }
            if (_sectionBundleInfo.ShapeType == eSectionShapeType.不对称)
            {
                radioButton对称.Checked = false;
                radioButton不对称.Checked = true;
                radioButton矩形.Checked = false;
            }
            if (_sectionBundleInfo.ShapeType == eSectionShapeType.矩形)
            {
                radioButton对称.Checked = false;
                radioButton不对称.Checked = false;
                radioButton矩形.Checked = true;
            }
        }
        //改面积
        public void RefreshSingleSectArea(int sectIndex, double area)
        {
            if (this._sectionBundleInfo == null)
                return;
            this._sectionBundleInfo.Area[sectIndex] = area;
            this._sectionBundleInfo.CalcHeightByArea(_geomBaseInfo, sectIndex);
 
            RefrehSectBundlePara();
 
            if (OnRefreshShape == null)
                return;
            OnRefreshShape.Invoke(_sectionBundleInfo);
        }
 
 
 
        public DPumpHydr.OpenFwUI.Volute.SectionBundleInfo GetBindingData(out string error)
        {
            if (!Verify(out error))
            {
                return null;
            }
            error = null;
            if (_sectionBundleInfo == null)
            {
                _sectionBundleInfo = new DPumpHydr.OpenFwUI.Volute.SectionBundleInfo();
            }
 
            if (radioButton对称.Checked)
            {
                _sectionBundleInfo.ShapeType = eSectionShapeType.对称;
            }
            if (radioButton不对称.Checked)
            {
                _sectionBundleInfo.ShapeType = eSectionShapeType.不对称;
            }
            if (radioButton矩形.Checked)
            {
                _sectionBundleInfo.ShapeType = eSectionShapeType.矩形;
            }
 
            _sectionBundleInfo.V3 = Convert.ToDouble(this.textBox速度系数.Text);
            for (var argument = 1; argument <= 8; argument++)
            {//TextBox断面H18
                var controlname_y1 = $"skyTextBox断面y1{argument}";
                var controlname_r1 = $"skyTextBox断面r1{argument}";
                var controlname断面面积 = $"skyTextBox断面面积{argument}";
                var controlnameh = $"skyTextBox断面H1{argument}";
                TextBox controlY1 = this.Controls.Find(controlname_y1, true).FirstOrDefault() as TextBox;
                TextBox controlR1 = this.Controls.Find(controlname_r1, true).FirstOrDefault() as TextBox;
                TextBox control断面面积 = this.Controls.Find(controlname断面面积, true).FirstOrDefault() as TextBox;
                TextBox controlH = this.Controls.Find(controlnameh, true).FirstOrDefault() as TextBox;
                if (controlY1 != null)
                {
                    _sectionBundleInfo.GaMa_Left[argument] = Convert.ToDouble(controlY1.Text);
                    _sectionBundleInfo.GaMa_Right[argument] = _sectionBundleInfo.GaMa_Left[argument];
                }
 
                if (controlR1 != null)
                {
                    _sectionBundleInfo.R_Left[argument] = Convert.ToDouble(controlR1.Text);
                    _sectionBundleInfo.R_Right[argument] = _sectionBundleInfo.R_Left[argument];
                }
 
                if (control断面面积 != null)
                    _sectionBundleInfo.Area[argument] = Convert.ToDouble(control断面面积.Text);
 
                if (controlH != null)
                    _sectionBundleInfo.H[argument] = Convert.ToDouble(controlH.Text);
            }
 
 
            return _sectionBundleInfo;
        }
        public bool Verify(out string error)
        {
            error = "";
            bool isOk = true;
            double v3 = 0;
            if (string.IsNullOrEmpty(textBox速度系数.Text) || !double.TryParse(textBox速度系数.Text, out v3) || v3 <= 0.1)
            {
                error = "请输入必填项!";
                isOk = false;
            }
            if (string.IsNullOrEmpty(skyTextBox断面y18.Text) || (!radioButton矩形.Checked && double.Parse(skyTextBox断面y18.Text) == 0) || double.Parse(skyTextBox断面y18.Text) < 0)
            {
                error = "请输入必填项!";
                isOk = false;
 
            }
            if (string.IsNullOrEmpty(skyTextBox断面r18.Text) || (!radioButton矩形.Checked && double.Parse(skyTextBox断面r18.Text) == 0) || double.Parse(skyTextBox断面r18.Text) < 0)
            {
                error = "请输入必填项!";
                isOk = false;
            }
            return isOk;
        }
 
 
 
        private void BuildIcon()
        {
            //断面形状图片
            pictureBox梯形.BackgroundImage = GlobalResource.BuildImage("duichentixing.png", 88, 76);
            pictureBox不对称梯形.BackgroundImage = GlobalResource.BuildImage("buduichentixing.png", 88, 76);
            pictureBox矩形.BackgroundImage = GlobalResource.BuildImage("juxing.png", 88, 76);
        }
 
        private void metroTile断面形状1_Click(object sender, EventArgs e)
        {
            radioButton对称.Checked = true;
            radioButton不对称.Checked = false;
            radioButton矩形.Checked = false;
        }
 
        private void metroTile断面形状2_Click(object sender, EventArgs e)
        {
            radioButton对称.Checked = false;
            radioButton不对称.Checked = true;
            radioButton矩形.Checked = false;
        }
 
        private void metroTile断面形状3_Click(object sender, EventArgs e)
        {
            radioButton对称.Checked = false;
            radioButton不对称.Checked = false;
            radioButton矩形.Checked = true;
        }
 
 
 
 
 
        private void TextBox断面VIIIy1_TextChanged(object sender, EventArgs e)
        {
            if (!_isxml)
            {
                return;
            }
            if (sender is TextBox skytextBox)
            {
                string lastChar = skytextBox.Name[skytextBox.Name.Length - 1].ToString();
                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, _sectionBundleInfo.R_Left[index]);
                    var R = _sectionBundleInfo.CheckChamferR(height, index, result, _sectionBundleInfo.R_Left[index]);
                    TextBox controlh1 = this.Controls.Find($"skyTextBox断面H1{index}", true).FirstOrDefault() as TextBox;
                    TextBox controlr1 = this.Controls.Find($"skyTextBox断面r1{index}", true).FirstOrDefault() as TextBox;
                    controlh1.Text = height.ToString();
                    controlr1.Text = R.ToString();
                }
            }
        }
 
        private void TextBox断面VIIIy2_TextChanged(object sender, EventArgs e)
        {
            if (!_isxml || isInitialParameter)
            {
                return;
            }
            if (sender is TextBox skytextBox)
            {
                string lastChar = skytextBox.Name[skytextBox.Name.Length - 1].ToString();
 
                int index = Convert.ToInt32(lastChar);
                if (!double.TryParse(skytextBox.Text, out double result) && !string.IsNullOrEmpty(skytextBox.Text))
                {
                    skytextBox.Text = _sectionBundleInfo.GaMa_Right[index].ToString();
                }
                if (string.IsNullOrEmpty(skytextBox.Text) || Convert.ToDouble(skytextBox.Text) == 0)
                {
                    MessageBox.Show("r不合理!请重新输入");
                    return;
                }
                double v = 0;
                if (!double.TryParse(skytextBox.Text, out v))
                {
                    MessageBox.Show("请输入数字格式!");
                    return;
                }
                if (Convert.ToDouble(skytextBox.Text) != _sectionBundleInfo.R_Left[index])
                {
                    Judgment_R(index);
                }
                else
                {
                    skytextBox.BackColor = Color.White;
                }
            }
        }
 
        private bool Judgment_R(int index)
        {
            bool isreasonable = true;
            TextBox controlr1 = this.Controls.Find($"skyTextBox断面r1{index}", true).FirstOrDefault() as TextBox;
            TextBox controlGaMa1 = this.Controls.Find($"skyTextBox断面y1{index}", true).FirstOrDefault() as TextBox;
            TextBox controlh1 = this.Controls.Find($"skyTextBox断面H1{index}", true).FirstOrDefault() as TextBox;
            if (string.IsNullOrEmpty(controlr1.Text))
                return true;
            if (string.IsNullOrEmpty(controlGaMa1.Text))
                return true;
            if (string.IsNullOrEmpty(controlh1.Text))
                return true;
 
            if (radioButton矩形.Checked)
            {
                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
            {
                //目前这个只检测对称的 //若不对称更换半径角度等参数重新计算另一边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 ((!radioButton矩形.Checked && (TopWidth < c || Slash < c - 0.1))) // 
                {
                    controlr1.BackColor = Color.OrangeRed;
                    MessageBox.Show("r不合理!请重新输入");
                }
                else
                {
                    controlr1.BackColor = Color.White;
                }
            }
 
 
            return isreasonable;
        }
 
 
 
        private void mBtn计算断面面积_Click(object sender, EventArgs e)
        {
            double v3 = 0;
            if (string.IsNullOrEmpty(textBox速度系数.Text) || !double.TryParse(textBox速度系数.Text, out v3) || v3 <= 0.1)
            {
                MessageBox.Show("请先输入蜗室平均速度!");
                return;
            }
            if (_sectionBundleInfo == null)
            {
                _sectionBundleInfo = new DPumpHydr.OpenFwUI.Volute.SectionBundleInfo();
            }
            _sectionBundleInfo.V3 = v3;
            _sectionBundleInfo.RecalculateArea(this._hdrBaseInfo, this._geomBaseInfo);
 
            RefrehSectBundlePara();
 
 
            if (OnRefreshShape != null)
            {
                DPumpHydr.OpenFwUI.Volute.SectionBundleInfo paras = GetBindingData(out string error);
                if (paras == null)
                    return;
                //textBox割舌角度
                OnRefreshShape.Invoke(paras);
            }
 
        }
 
        private void textBox速度系数_TextChanged(object sender, EventArgs e)
        {
            double K3 = 0;
            if (string.IsNullOrEmpty(textBox速度系数.Text))
                return;
            if (!double.TryParse(textBox速度系数.Text, out K3))
                return;
            if (K3 < 0.1)
                return;
 
            var g = 9.81;
            this.textBox速度系数.Text = Math.Round(K3 * Math.Sqrt(2 * g * _hdrBaseInfo.H), 2).ToString();
        }
 
        public Func<DPumpHydr.OpenFwUI.Volute.SectionBundleInfo, List<int>> OnRefreshShape = null;
        private void mBtn更新模型_Click(object sender, EventArgs e)
        {
            DPumpHydr.OpenFwUI.Volute.SectionBundleInfo paras = GetBindingData(out string error);
            if (paras == null)
                return;
 
            RefreshShape(paras);
 
        }
 
        private void RefreshShape(DPumpHydr.OpenFwUI.Volute.SectionBundleInfo paras)
        {
            if (OnRefreshShape == null)
                return;
            var error_sects = OnRefreshShape.Invoke(paras);
 
            for (var sect_index = 1; sect_index <= 8; sect_index++)
            {
                var controlnameGama1 = $"skyTextBox断面y1{sect_index}";
                var controlnameRia1 = $"skyTextBox断面r1{sect_index}";
                var controlname断面面积 = $"skyTextBox断面面积{sect_index}";
                var controlnameHeight = $"skyTextBox断面H1{sect_index}";
 
                TextBox controly1 = this.Controls.Find(controlnameGama1, true).FirstOrDefault() as TextBox;
                TextBox controly2 = this.Controls.Find(controlnameRia1, true).FirstOrDefault() as TextBox;
                TextBox control断面面积 = this.Controls.Find(controlname断面面积, true).FirstOrDefault() as TextBox;
                TextBox controH1 = this.Controls.Find(controlnameHeight, true).FirstOrDefault() as TextBox;
 
 
                if (error_sects != null && error_sects.Contains(sect_index))
                {
                    controly1.BackColor = Color.OrangeRed;
                    controly2.BackColor = Color.OrangeRed;
                    control断面面积.BackColor = Color.OrangeRed;
                    controH1.BackColor = Color.OrangeRed;
                }
                else
                {
                    controly1.BackColor = Color.White;
                    controly2.BackColor = Color.White;
                    control断面面积.BackColor = Color.White;
                    controH1.BackColor = Color.White;
                }
            }
        }
        public Action<int> OnHightLightSectCurve = null;
        private void HightLightSectCurve(int sectIndex)
        {
            if (OnHightLightSectCurve != null)
                OnHightLightSectCurve.Invoke(sectIndex);
        }
 
        private void RefrehSectBundlePara()
        {
            for (var sect_index = 1; sect_index <= 8; sect_index++)
            {
                var controlnameGama1 = $"skyTextBox断面y1{sect_index}";
                var controlnameRia1 = $"skyTextBox断面r1{sect_index}";
                var controlname断面面积 = $"skyTextBox断面面积{sect_index}";
                var controlnameHeight = $"skyTextBox断面H1{sect_index}";
 
                TextBox controly1 = this.Controls.Find(controlnameGama1, true).FirstOrDefault() as TextBox;
                TextBox controly2 = this.Controls.Find(controlnameRia1, true).FirstOrDefault() as TextBox;
                TextBox control断面面积 = this.Controls.Find(controlname断面面积, true).FirstOrDefault() as TextBox;
                TextBox controH1 = this.Controls.Find(controlnameHeight, true).FirstOrDefault() as TextBox;
 
                controly1.Enabled = true;
                if (control断面面积 != null)
                    control断面面积.Text = Math.Round(_sectionBundleInfo.Area[sect_index], 1).ToString();
                if (controH1 != null)
                    controH1.Text = Math.Round(_sectionBundleInfo.H[sect_index], 1).ToString();
                if (controly2 != null)
                    controly2.Text = Math.Round(_sectionBundleInfo.R_Left[sect_index], 1).ToString();
                if (controly1 != null)
                    controly1.Text = Math.Round(_sectionBundleInfo.GaMa_Left[sect_index], 1).ToString();
            }
        }
 
 
        private void TextBox断面y11_Enter(object sender, EventArgs e)
        {
            if (sender is TextBox TextBox)
            {
                string lastChar = TextBox.Name[TextBox.Name.Length - 1].ToString();
                int index = Convert.ToInt32(lastChar);
                HightLightSectCurve(index);
            }
        }
 
 
        private bool isInitialParameter = false;
        private void radioButton矩形_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton矩形.Checked)
            {
                if (_sectionBundleInfo.GaMa_Left.All(x => x == 0))
                {
                    for (var sect_index = 1; sect_index <= 8; sect_index++)
                    {
                        var controlnameGama1 = $"skyTextBox断面y1{sect_index}";
                        TextBox controly1 = this.Controls.Find(controlnameGama1, true).FirstOrDefault() as TextBox;
                        controly1.Enabled = false;
                    }
                    return;
                }
                //for (var sect_index = 1; sect_index <= 8; sect_index++)
                //{
                //    var controlnameGama1 = $"TextBox断面y1{sect_index}";
                //    TextBox controly1 = this.Controls.Find(controlnameGama1, true).FirstOrDefault() as TextBox;
                //    controly1.Text = "0";
                //    controly1.Enabled = false;
                //}
                DPumpHydr.OpenFwUI.Volute.SectionBundleInfo Rec_sectionBundleInfo = _sectionBundleInfo.Copy();
                Rec_sectionBundleInfo.ShapeType = eSectionShapeType.矩形;
                Rec_sectionBundleInfo.ResetAllParas(_hdrBaseInfo, _geomBaseInfo);
                isInitialParameter = true;
                for (var sect_index = 1; sect_index <= 8; sect_index++)
                {
                    var controlnameGama1 = $"skyTextBox断面y1{sect_index}";
                    var controlnameRia1 = $"skyTextBox断面r1{sect_index}";
                    var controlname断面面积 = $"skyTextBox断面面积{sect_index}";
                    var controlnameHeight = $"skyTextBox断面H1{sect_index}";
 
                    TextBox controly1 = this.Controls.Find(controlnameGama1, true).FirstOrDefault() as TextBox;
                    TextBox controly2 = this.Controls.Find(controlnameRia1, true).FirstOrDefault() as TextBox;
                    TextBox control断面面积 = this.Controls.Find(controlname断面面积, true).FirstOrDefault() as TextBox;
                    TextBox controH1 = this.Controls.Find(controlnameHeight, true).FirstOrDefault() as TextBox;
                    controly1.Enabled = false;
                    if (controly1 != null)
                        controly1.Text = Rec_sectionBundleInfo.GaMa_Left[sect_index].ToString();
                    if (controly2 != null)
                        controly2.Text = Rec_sectionBundleInfo.R_Left[sect_index].ToString();
                    if (control断面面积 != null)
                        control断面面积.Text = Rec_sectionBundleInfo.Area[sect_index].ToString();
                    if (controH1 != null)
                        controH1.Text = Rec_sectionBundleInfo.H[sect_index].ToString();
                }
                RefreshShape(Rec_sectionBundleInfo);
                isInitialParameter = false;
            }
        }
 
        private void radioButton不对称_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton不对称.Checked)
            {
                RefrehSectBundlePara();
                RefreshShape(_sectionBundleInfo);
            }
        }
 
        private void radioButton对称_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton对称.Checked)
            {
                RefrehSectBundlePara();
                RefreshShape(_sectionBundleInfo);
            }
        }
 
    }
}