From 34fe00834737d35eedfeb41361c4d85ab0e0f10b Mon Sep 17 00:00:00 2001
From: yangyin <1850366751@qq.com>
Date: 星期五, 25 十月 2024 17:02:06 +0800
Subject: [PATCH] 增加蜗壳参数导出功能、修改部分界面代码

---
 WinFrmUI/DPumpHydr.WinFrmUI.Volute/断面设计/ViewModel/SectionBaseInfo.cs |  203 +++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 196 insertions(+), 7 deletions(-)

diff --git "a/WinFrmUI/DPumpHydr.WinFrmUI.Volute/\346\226\255\351\235\242\350\256\276\350\256\241/ViewModel/SectionBaseInfo.cs" "b/WinFrmUI/DPumpHydr.WinFrmUI.Volute/\346\226\255\351\235\242\350\256\276\350\256\241/ViewModel/SectionBaseInfo.cs"
index ad1674f..30bd0dd 100644
--- "a/WinFrmUI/DPumpHydr.WinFrmUI.Volute/\346\226\255\351\235\242\350\256\276\350\256\241/ViewModel/SectionBaseInfo.cs"
+++ "b/WinFrmUI/DPumpHydr.WinFrmUI.Volute/\346\226\255\351\235\242\350\256\276\350\256\241/ViewModel/SectionBaseInfo.cs"
@@ -3,6 +3,7 @@
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using static System.Runtime.InteropServices.JavaScript.JSType;
 
 namespace DPumpHydr.WinFrmUI.Volute.ViewModel
 {
@@ -24,12 +25,17 @@
         public int StartSectionNumber { get; set; }
 
         public List<double> GaMa1 { get; set; }
-        public List<double> GaMa2
-        {
-            get; set;
-        }
+        public List<double> GaMa2{ get; set;}
         public List<double> Area { get; set; }
 
+        //鏂潰淇℃伅
+        public List<int> Index { get; set; }//鏂潰搴忓彿  绗�8鏂潰灏辨槸8 绗竴鏂潰灏辨槸1
+        public List<double> H { get; set; }//楂樺害
+        public double R_out { get; set; }//澶栧洿鐨勫崐寰� 
+        public List<double> R_Left { get; set; }//瑙掑害1杈瑰搴旂殑鍦嗚鍗婂緞 UG涓璕1
+        public List<double> R_Right { get; set; }//瑙掑害2杈瑰搴旂殑鍦嗚鍗婂緞 UG涓璕2
+        public double BaseWidth { get; set; }//搴曢儴瀹藉害 灏辨槸B3
+        public double BaseCircleRadius { get; set; }//搴曢儴鍦嗗崐寰� 灏辨槸D3/2
 
         /// <summary>
         /// 璁$畻骞冲潎娴侀��
@@ -42,10 +48,16 @@
             var g = 9.81;
             this.V3 = Math.Round(geom_info.K3 * Math.Sqrt(2 * g * hdr_info.Q), 2);
         }
+        /// <summary>
+        /// 璁$畻闈㈢Н
+        /// </summary>
+        /// <param name="hdr_info"></param>
+        /// <param name="geom_info"></param>
+        /// <param name="v3"></param>
         public void CalcArea(HdrBaseInfo hdr_info, GeomBaseInfo geom_info, double v3)
         {
             this.V3 = v3;
-            var area8 = hdr_info.Q * 1000000 / (3600 * v3);
+            var area8 = Math.Round(hdr_info.Q * 1000000 / (3600 * v3), 1);
             int i = 0;
             if (this.Area == null)
             {
@@ -64,12 +76,12 @@
             if (geom_info.IsQieYuJiYuan)
             {//闅旇垖鍒囦簬鍩哄渾
                 for (i = StartSectionNumber; i < 8; i++)
-                    Area[i] = area8 * (45 * i - geom_info.FAI0) / (360 - geom_info.FAI0);
+                    Area[i] = Math.Round(area8 * (45 * i - geom_info.FAI0) / (360 - geom_info.FAI0), 1);
             }
             else
             {//閲囩敤姝e父鍒囬潰
                 for (i = StartSectionNumber; i < 8; i++)
-                    Area[i] = area8 * 45 * i / 360;
+                    Area[i] = Math.Round(area8 * 45 * i / 360, 1);
             }
 
             if (StartSectionNumber == 2)
@@ -176,7 +188,184 @@
 
             return null;
         }
+        /// <summary>
+        /// 鍒濆鍖�1-8鏂潰鍙傛暟
+        /// </summary>
+        public void InitialAllParameters(HdrBaseInfo BaseInfo , GeomBaseInfo geom_info )
+        {
+            this.Index = new List<int>(10);
+            this.H = new List<double>(10);
+            this.R_Left = new List<double>(10);
+            this.R_Right = new List<double>(10);
+            bool isFirst = true;
+            for (int i = 0; i < 10; i++)
+            {
+                this.Index.Add(0);
+                this.Index[i] = i;
+                this.H.Add(0);
+                this.R_Left.Add(0);
+                this.R_Right.Add(0);
+                if(i == 0 )
+                {
+                    continue;
+                }
+                CalcHeightByArea(geom_info, Index[i]);
+            }
+            for (int i = 8; i > 0; i--)
+            {
+                CalculateR(BaseInfo, geom_info, Index[i], isFirst);
+                if (isFirst)
+                {
+                    isFirst = false;
+                }
+            }
 
+        }
+        /// <summary>
+        /// 鏍规嵁闈㈢Н璁$畻楂樺害
+        /// </summary>
+        public void CalcHeightByArea(GeomBaseInfo geom_info, int index)
+        {
+            double a = (Math.Tan(this.GaMa1[index] * Math.PI / 180) + Math.Tan(this.GaMa2[index] * Math.PI / 180)) / 2;
+            double b = geom_info.B3;
+
+            double c = (90 + this.GaMa2[index]) / 360 * Math.PI * this.R_Left[index] * this.R_Left[index] + (90 + this.GaMa1[index]) / 360 * Math.PI * this.R_Right[index] * this.R_Right[index]
+                - this.R_Left[index] * this.R_Left[index] * Math.Tan((45 + this.GaMa2[index] / 2) * Math.PI / 180) - this.R_Right[index] * this.R_Right[index] * Math.Tan((45 + this.GaMa1[index] / 2) * Math.PI / 180) - this.Area[index];
+            double delta = b * b - 4 * a * c;
+            if (delta < 0)
+            {
+                this.H[index] = -1;
+                return;
+            }
+            if (this.ShapeType == eSectionShapeType.鐭╁舰)//鐭╁舰
+            {
+                this.H[index] = Math.Round((-c / b), 1) ;
+                return ;
+            }
+            else
+            {
+                if (delta < 0)
+                {
+                    this.H[index] = -1;
+                    return;
+                }
+                this.H[index] = Math.Round((-b + Math.Sqrt(delta)) / (2 * a), 1);
+                return ;
+            }
+        }
+        /// <summary>
+        /// 鏂潰鍙傛暟璁$畻
+        /// </summary>
+        private double DecreaseR = 0.5;
+        public bool CalculateR(HdrBaseInfo BaseInfo ,GeomBaseInfo geom_info, int index, bool isFirst)
+        {
+            this.BaseWidth = geom_info.B3;
+            this.BaseCircleRadius = geom_info.D3 / 2;
+            if (!isFirst)
+            {
+                this.R_Left[index] = this.R_Left[index+1] - DecreaseR;
+                this.R_Right[index] = this.R_Right[index+1] - DecreaseR;
+
+                if (this.R_Left[index] > (this.H[index] + 1))
+                    this.R_Left[index] = Math.Round(this.H[index] * 0.85 - 1, 0);
+                if (this.R_Right[index] > (this.H[index] + 1))
+                    this.R_Right[index] = Math.Round(this.H[index] * 0.85 - 1, 0);
+
+                if (this.R_Left[index] < 2)
+                    this.R_Left[index] = 2;
+                if (this.R_Right[index] < 2)
+                    this.R_Right[index] = 2;
+            }
+            else//鏄涓�娆¤绠�
+            {
+
+                //璧嬪�硷細R1 R2 R3 R4 
+                if (this.ShapeType == eSectionShapeType.瀵圭О) //type锛�0锛氬绉版褰�
+                    this.R_Left[index] = Math.Round(geom_info.B3 * 0.55 + 0.5 - 4, 0);
+                else if (this.ShapeType == eSectionShapeType.涓嶅绉�)//type锛�1锛氫笉瀵圭О姊舰
+                    this.R_Left[index] = Math.Round(geom_info.B3 * 0.55 + 0.5 - 4, 0);
+                else if (this.ShapeType == eSectionShapeType.鐭╁舰)//type锛�2锛氱煩褰�
+                    this.R_Left[index] = Math.Round(geom_info.B3 * 0.4 + 0.5 - 2, 0);
+
+
+                if (BaseInfo.IsSXB)
+                    this.R_Left[index] = Math.Round(this.R_Left[index] / 2, 0);
+                //if (DesignMode == YSSnxOpen::DesignMode::AssPawuQnshQw1)
+                //{
+                //    R_Left = int(R_Left * 0.7);
+                //}
+                double m_R3 = 0;
+                double t = 0;
+                if (geom_info.B3 <= 35)
+                    m_R3 = 5;
+                else if (geom_info.B3 <= 60 && geom_info.B3 > 35)
+                {
+                    t = Math.Round(geom_info.B3 * 0.6, 0) - Math.Round(geom_info.B3 * 0.6 / 10.0, 0) * 10;
+                    if (t <= 2)
+                        m_R3 = Math.Round(geom_info.B3 * 0.6 / 10.0, 0) * 10;
+                    else if (t > 2 && t <= 7)
+                        m_R3 = Math.Round(geom_info.B3 * 0.6 / 10.0, 0) * 10 + 5;
+                    else if (t > 7)
+                        m_R3 = Math.Round(geom_info.B3 * 0.6 / 10.0, 0) * 10 + 10;
+                }
+                else if (geom_info.B3 > 60 && geom_info.B3 <= 90)
+                {
+                    t = Math.Round(geom_info.B3 * 0.9, 0) - Math.Round(geom_info.B3 * 0.9 / 10.0, 0) * 10;
+                    if (t <= 2)
+                        m_R3 = Math.Round(geom_info.B3 * 0.9 / 10.0, 0) * 10;
+                    else if (t > 2 && t <= 7)
+                        m_R3 = Math.Round(geom_info.B3 * 0.9 / 10.0, 0) * 10 + 5;
+                    else if (t > 7)
+                        m_R3 = Math.Round(geom_info.B3 * 0.9 / 10.0, 0) * 10 + 10;
+                }
+                else if (geom_info.B3 > 90)
+                {
+                    t = Math.Round(geom_info.B3 * 0.3, 0) - Math.Round(geom_info.B3 * 0.3 / 10.0, 0) * 10;
+                    if (t <= 2)
+                        m_R3 = Math.Round(geom_info.B3 * 0.3 / 10.0, 0) * 10;
+                    else if (t > 2 && t <= 7)
+                        m_R3 = Math.Round(geom_info.B3 * 0.3 / 10.0, 0) * 10 + 5;
+                    else if (t > 7)
+                        m_R3 = Math.Round(geom_info.B3 * 0.3 / 10.0, 0) * 10 + 10;
+                }
+
+                this.R_Right[index] = this.R_Left[index];
+                R_out = 1000.0;
+
+                //鎴潰R1 鍜� R4鐨勫噺灏戣搴� DecreaseR
+                if (geom_info.B3 < 15)
+                {
+                    DecreaseR = 0.5;
+                }
+                else if (geom_info.B3 >= 15 && geom_info.B3 < 25)
+                {
+                    DecreaseR = 1;
+                }
+                else if (geom_info.B3 >= 25 && geom_info.B3 < 45)
+                {
+                    DecreaseR = 1.5;
+                }
+                else if (geom_info.B3 >= 45)
+                {
+                    DecreaseR = 2;
+                }
+
+                if (BaseInfo.IsSXB)
+                    DecreaseR = 1;
+            }
+
+            return true;
+        }
+
+        public void EditSingleShape(SectionShapePara sectionShapePara,int index)
+        {
+            this.GaMa1[index] = sectionShapePara.Gama_Left;
+            this.GaMa2[index] = sectionShapePara.Gama_Right;
+            this.H[index] = sectionShapePara.H;
+            this.R_out = sectionShapePara.R_out;
+            this.R_Left[index] = sectionShapePara.R_Left;
+            this.R_Right[index] = sectionShapePara.R_Right;
+        }
 
     }
 }

--
Gitblit v1.9.3