chenn
2025-04-11 c74c5c27380a2967971e22336d05b635d691e483
WinFrmUI/DPumpHydr.WinFrmUI.Volute/³öË®Éè¼Æ/ctrlSetOutflowParas.cs
@@ -120,8 +120,8 @@
            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);
@@ -139,7 +139,7 @@
            }
            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);
@@ -149,7 +149,7 @@
                    _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;
@@ -165,17 +165,21 @@
            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;
@@ -183,8 +187,8 @@
            //
            InitialCtrlDefaultParas(hdrBaseInfo, geomBaseInfo, sectionBundleInfo, outflowParas);
            if(_link_type == eOutflowLinkStyle.曲线)
            if (_link_type == eOutflowLinkStyle.曲线)
            {
                checkBox圆弧连接.Checked = false;
            }
@@ -200,10 +204,23 @@
            }
            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)
            {
@@ -222,7 +239,7 @@
            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;
            }
@@ -264,29 +281,29 @@
            _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;
            //圆弧中心
@@ -440,7 +457,7 @@
        {
            error = "";
            ViewModel.OutflowParas _outflowParas = null;
            if (_link_type == eOutflowLinkStyle.直线圆弧 && _sharp_type != eOutflowShapeStyle.侧面出口_直线连接)
            if (_link_type == eOutflowLinkStyle.直线圆弧 && _sharp_type != eOutflowShapeStyle.侧面对齐出口)
            {
                if (_sharp_type == eOutflowShapeStyle.中心出口)
                {
@@ -467,7 +484,7 @@
                    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:
@@ -524,11 +541,11 @@
            {
                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;
            }
@@ -580,14 +597,14 @@
        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.中心出口)
                    {
@@ -597,11 +614,11 @@
                    {
                        _parasControlArcSide.SetBindingData(resp);
                    }
                }
                else
                {
                    if (_sharp_type == eOutflowShapeStyle.侧面出口_直线连接)
                    if (_sharp_type == eOutflowShapeStyle.侧面对齐出口)
                    {
                        _parasControlLine.SetBindingData(resp);
                    }
@@ -628,11 +645,11 @@
        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.直线圆弧;
@@ -642,11 +659,11 @@
                    _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)
                {
@@ -657,11 +674,11 @@
                    _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)
@@ -671,7 +688,7 @@
            }
            InitialOutflowStyle();
                RefreshModel();
            RefreshModel();
        }
        private void btnNextStep_Click(object sender, EventArgs e)
@@ -683,11 +700,24 @@
        {
            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)
            {
@@ -699,5 +729,19 @@
            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.曲线;
            }
        }
    }
}