Exemple #1
0
 protected void GenerateLineLoadString(int j, string xLoadStr, string yLoadStr, string zLoadStr, string oritationStr = null)
 {
     if (oritationStr == null)
     {
         ProcessString.Add(Template.Wires[j - 1] + " Fx= " + xLoadStr);
         ProcessString.Add(Template.Wires[j - 1] + " Fy= " + yLoadStr);
         ProcessString.Add(Template.Wires[j - 1] + " Fz= " + zLoadStr);
     }
     else
     {
         ProcessString.Add(Template.Wires[j - 1] + oritationStr + " Fx= " + xLoadStr);
         ProcessString.Add(Template.Wires[j - 1] + oritationStr + " Fy= " + yLoadStr);
         ProcessString.Add(Template.Wires[j - 1] + oritationStr + " Fz= " + zLoadStr);
     }
 }
Exemple #2
0
        /// <summary>
        /// 计算转向挂点
        /// </summary>
        /// <param name="i"></param>
        /// <param name="j"></param>
        protected void CalsTurningPointsLoad(int i, int j)
        {
            float angf = HPSettingParas.TurningPoints.Where(item => item.WireType == Template.Wires[j - 1]).First().Angle;

            //XXT[i, j - 1] = (float)(-ZZ[i, j - 1] * Math.Sin(angf * Math.PI / 180));
            //YYT[i, j - 1] = YY[i, j - 1];
            //ZZT[i, j - 1] = (float)(ZZ[i, j - 1] + ZZ[i, j - 1] * Math.Cos(angf * Math.PI / 180));

            //ProcessString.Add(Template.Wires[j - 1] + "转向处 Fx= " + ZZ[i, j - 1].ToString("0.00") + " x sin(" + angf + ") = " + XXT[i, j - 1].ToString("0.00"));
            //ProcessString.Add(Template.Wires[j - 1] + "转向处 Fy= " + YY[i, j - 1].ToString("0.00"));
            //ProcessString.Add(Template.Wires[j - 1] + "转向处 Fz= " + ZZ[i, j - 1].ToString("0.00") + " + " + ZZ[i, j - 1].ToString("0.00") + " x cos(" + angf + ") = " + ZZ[i, j - 1].ToString("0.00"));

            XXT[i, j - 1] = formula.TPTuringX(ZZ[i, j - 1], angf, out string strTX);
            YYT[i, j - 1] = formula.TPTuringY(YY[i, j - 1], out string strTY);
            ZZT[i, j - 1] = formula.TPTuringZ(ZZ[i, j - 1], angf, out string strTZ);

            ProcessString.Add(Template.Wires[j - 1] + "转向处 Fx= " + strTX);
            ProcessString.Add(Template.Wires[j - 1] + "转向处 Fy= " + strTY);
            ProcessString.Add(Template.Wires[j - 1] + "转向处 Fz= " + strTZ);

            //float fzz = XX[i, j - 1];
            //float fzz1 = ZZ[i, j - 1];
            //XX[i, j - 1] = XX[i, j - 1] + ZZ[i, j - 1] * (float)Math.Sin(angf * Math.PI / 180);
            //YY[i, j - 1] = YY[i, j - 1];
            //ZZ[i, j - 1] = ZZ[i, j - 1] - ZZ[i, j - 1] * (float)Math.Cos(angf * Math.PI / 180);

            //ProcessString.Add(Template.Wires[j - 1] + "导线处 Fx= " + fzz.ToString("0.00") + " + " + fzz1.ToString("0.00") + " x sin(" + angf + ") = " + XX[i, j - 1].ToString("0.00"));
            //ProcessString.Add(Template.Wires[j - 1] + "导线处 Fy= " + YY[i, j - 1].ToString("0.00"));
            //ProcessString.Add(Template.Wires[j - 1] + "导线处 Fz= " + fzz1.ToString("0.00") + " - " + fzz1.ToString("0.00") + " x cos(" + angf + ") = " + ZZ[i, j - 1].ToString("0.00"));


            XX[i, j - 1] = formula.TPWireX(XX[i, j - 1], ZZ[i, j - 1], angf, out string strWX);
            YY[i, j - 1] = formula.TPWireY(YY[i, j - 1], out string strWY);
            ZZ[i, j - 1] = formula.TPWireZ(ZZ[i, j - 1], angf, out string strWZ);

            ProcessString.Add(Template.Wires[j - 1] + "导线处 Fx= " + strWX);
            ProcessString.Add(Template.Wires[j - 1] + "导线处 Fy= " + strWY);
            ProcessString.Add(Template.Wires[j - 1] + "导线处 Fz= " + strWZ);
        }
        public override void CalculateLoadDistribute(string path)
        {
            int calNums = Template.WorkConditionCombos.Count;

            XX = new float[calNums, Template.Wires.Count];
            YY = new float[calNums, Template.Wires.Count];
            ZZ = new float[calNums, Template.Wires.Count];

            XXT = new float[calNums, Template.Wires.Count];
            YYT = new float[calNums, Template.Wires.Count];
            ZZT = new float[calNums, Template.Wires.Count];

            int i = -1, j = 1;
            int count = 0;

            ProcessString.Add(Template.Name + " " + DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"));

            foreach (var wd in Template.WorkConditionCombos)
            {
                i++;
                if (!wd.IsCalculate)
                {
                    continue;
                }

                count++;
                ProcessString.Add("");
                ProcessString.Add("No." + count.ToString() + " " + wd.WorkComment);

                j = 1;
                foreach (int wic in wd.WireIndexCodes)
                {
                    LineParas = LineParasArr[j - 1];
                    formula.SetStrLineParas(LineParas);

                    int zhs = wic;

                    switch (wd.WorkConditionCode)
                    {
                    case "N1":
                    case "N2":
                    case "D1":
                    case "D2":
                        DistributeInWindAndLowTemperature(i, j);
                        break;

                    case "I1":
                    case "I2":
                    case "U1":
                    case "U2":
                    case "B1":
                    case "B2":
                    case "Y1":
                    case "Y2":
                        DistributeInIce(i, j);
                        break;

                    case "T":
                        DistributeInJump(i, j);
                        break;

                    case "L":
                    case "La":
                    case "Lb":
                    case "Lc":
                    case "Ld":
                    case "Le":
                    case "Lf":
                    case "Lg":
                    case "Lh":
                        DistributeInLift(i, j);
                        break;

                    case "G":
                    case "Ga":
                    case "Gb":
                    case "Gc":
                    case "Gd":
                    case "Ge":
                    case "Gf":
                    case "Gg":
                    case "Gh":
                    case "GLa":
                    case "GLb":
                    case "GLc":
                    case "GLd":
                    case "GLe":
                    case "GLf":
                    case "GLg":
                    case "GLh":
                        DistributeInHuache(i, j);
                        break;

                    case "C":
                    case "Ca":
                    case "Cb":
                    case "Cc":
                    case "Cd":
                    case "Ce":
                    case "Cf":
                    case "Cg":
                    case "Ch":
                    case "CLa":
                    case "CLb":
                    case "CLc":
                    case "CLd":
                    case "CLe":
                    case "CLf":
                    case "CLg":
                    case "CLh":
                        DistributeInTixian(i, j);
                        break;

                    default:
                        throw new Exception("直线塔工况代号超出范围" + "0 + 16" + "错误:1-230");
                        //break;
                    }
                    j++;
                }
            }

            FileUtils.TextSaveByLine(path, ProcessString);
        }
        /// <summary>
        /// 针对脱冰跳跃工况
        /// 工况代码"T"
        /// </summary>
        /// <param name="i"></param>
        /// <param name="j"></param>
        protected void DistributeInJump(int i, int j)
        {
            float x1, y1, y2, z1, z2, z3, z4;
            float zjiao;

            WorkConditionCombo wd = Template.WorkConditionCombos[i];

            int    zhs = wd.WireIndexCodes[j - 1], zhsAM;
            int    angle             = wd.WindDirectionCode;
            string workConditionCode = wd.WorkConditionCode;

            if (Math.Abs(zhs) <= workConditionNum && Math.Abs(zhs) > 0)
            {
                //正常覆冰相
                if (zhs > 0)
                {
                    if (wd.TensionAngleCode == "D")
                    {
                        x1    = Wind[j, zhs];
                        zjiao = LineParas.AngleMax;
                    }
                    //else if( wd.TensionAngleCode == "X" )
                    else
                    {
                        x1    = Windx[j, zhs];
                        zjiao = LineParas.AngleMin;
                    }
                    y1 = TensionMax[j, zhs];
                    y2 = TensionMin[j, zhs];
                    z1 = GMax[j, zhs];
                    z2 = GMax[j, 1];
                    z3 = GMin[j, zhs];
                    z4 = GMin[j, 1];
                }
                else
                {
                    if (wd.TensionAngleCode == "D")
                    {
                        x1    = Wind[j, Math.Abs(zhs)];
                        zjiao = LineParas.AngleMax;
                    }
                    //else if( wd.TensionAngleCode == "X" )
                    else
                    {
                        x1    = Windx[j, Math.Abs(zhs)];
                        zjiao = LineParas.AngleMin;
                    }
                    y1 = TensionMin[j, Math.Abs(zhs)];
                    y2 = TensionMax[j, Math.Abs(zhs)];
                    z1 = GMax[j, Math.Abs(zhs)];
                    z2 = GMax[j, 1];
                    z3 = GMin[j, Math.Abs(zhs)];
                    z4 = GMin[j, 1];
                }


                //j从1开始计数,但是XX YY ZZ 从0开始
                XX[i, j - 1] = ((FormulaLineLineCornerTower)formula).ZZTX(angle, x1, y1, y2, zjiao, out string strX);
                YY[i, j - 1] = ((FormulaLineLineCornerTower)formula).ZZTY(angle, x1, y1, y2, zjiao, out string strY);
                ZZ[i, j - 1] = ((FormulaLineLineCornerTower)formula).ZZTZ2(z2, z1, out string strZ);

                GenerateLineLoadString(j, strX, strY, strZ);
            }
            else if (Math.Abs(zhs) > 1000)
            {
                zhsAM = Math.Abs(zhs) % 1000;

                //脱冰跳跃相

                if (zhs > 1000)
                {
                    if (zhsAM > workConditionNum)
                    {
                        throw new Exception("第 " + i + " 工况,第 " + j + " 线条组合参数错误" + "0 + 16 " + "错误:1-220");
                    }

                    if (wd.TensionAngleCode == "D")
                    {
                        x1    = Wind[j, zhsAM];
                        zjiao = LineParas.AngleMax;
                    }
                    //else if( wd.TensionAngleCode == "X" )
                    else
                    {
                        x1    = Windx[j, zhsAM];
                        zjiao = LineParas.AngleMin;
                    }
                    y1 = TensionMax[j, zhsAM];
                    y2 = TensionMin[j, zhsAM];
                    z1 = GMax[j, zhsAM];
                    z2 = GMax[j, 1];
                    z3 = GMin[j, zhsAM];
                    z4 = GMin[j, 1];
                }
                else
                {
                    if (zhsAM > workConditionNum)
                    {
                        throw new Exception("第 " + i + " 工况,第 " + j + " 线条组合参数错误" + "0 + 16 " + "错误:1-221");
                    }

                    if (wd.TensionAngleCode == "D")
                    {
                        x1    = Wind[j, zhsAM];
                        zjiao = LineParas.AngleMax;
                    }
                    //else if( wd.TensionAngleCode == "X" )
                    else
                    {
                        x1    = Windx[j, zhsAM];
                        zjiao = LineParas.AngleMin;
                    }

                    y1 = TensionMin[j, zhsAM];
                    y2 = TensionMax[j, zhsAM];
                    z1 = GMax[j, zhsAM];
                    z2 = GMax[j, 1];
                    z3 = GMin[j, zhsAM];
                    z4 = GMin[j, 1];
                }

                XX[i, j - 1] = ((FormulaLineLineCornerTower)formula).ZZTX(angle, x1, y1, y2, zjiao, out string strX);
                YY[i, j - 1] = ((FormulaLineLineCornerTower)formula).ZZTY(angle, x1, y1, y2, zjiao, out string strY);
                ZZ[i, j - 1] = ((FormulaLineLineCornerTower)formula).ZZTZ1(z4, z3, out string strZ);

                ProcessString.Add(Template.Wires[j - 1] + " Fx= " + strX);
                ProcessString.Add(Template.Wires[j - 1] + " Fy= " + strY);
                ProcessString.Add(Template.Wires[j - 1] + " Fz= " + strZ);
            }
            else if (zhs == 0)
            {
                //j从1开始计数,但是XX YY ZZ 从0开始
                XX[i, j - 1] = 0;
                YY[i, j - 1] = 0;
                ZZ[i, j - 1] = 0;

                GenerateLineLoadString(j, "0.00", "0.00", "0.00");
            }
        }
        /// <summary>
        /// 针对施工提线工况,只考虑最大垂荷,多用于直流输电塔
        /// 工况代码"C", "Ca", "Cb", "Cc", "Cd", "Ce", "Cf", "Cg", "Ch", "CLa", "CLb", "CLc", "CLd", "CLe", "CLf", "CLg", "CLh"
        /// </summary>
        /// <param name="i"></param>
        /// <param name="j"></param>
        protected void DistributeInTixian(int i, int j)
        {
            float x1, y1, y2, z1, z2;
            int   fuhao;
            float fhn;
            float deta1, deta2, deta3;

            WorkConditionCombo wd = Template.WorkConditionCombos[i];

            int    zhs = wd.WireIndexCodes[j - 1], zhsAM;
            int    angle             = wd.WindDirectionCode;
            string workConditionCode = wd.WorkConditionCode;
            float  fh = LineParas.WireExtraLoad / Paras.LoadRatio;

            if (Math.Abs(zhs) < workConditionNum && Math.Abs(zhs) > 0)
            {
                //已安装
                if (zhs <= workConditionNum && zhs > 0)
                {
                    y1 = TensionMax[j, Math.Abs(zhs)];
                    y2 = TensionMin[j, Math.Abs(zhs)];
                }
                else
                {
                    y1 = TensionMin[j, Math.Abs(zhs)];
                    y2 = TensionMax[j, Math.Abs(zhs)];
                }

                x1 = Wind[j, Math.Abs(zhs)];
                z1 = GMax[j, Math.Abs(zhs)];
                z2 = GMin[j, Math.Abs(zhs)];

                //j从1开始计数,但是XX YY ZZ 从0开始
                XX[i, j - 1] = ((FormulaLineTower)formula).ZXLX(angle, x1, out string strX);
                YY[i, j - 1] = ((FormulaLineTower)formula).ZXLY(angle, x1, y1, y2, out string strY);
                ZZ[i, j - 1] = ((FormulaLineTower)formula).ZXLZ1(z1, out string strZ);

                GenerateLineLoadString(j, strX, strY, strZ);
            }
            else if (Math.Abs(zhs) > 100 && Math.Abs(zhs) < 1000)
            {
                //已锚相
                if (zhs > 0)
                {
                    fuhao = 1;
                }
                else
                {
                    fuhao = -1;
                }

                fhn   = Math.Abs(zhs) / 100;
                zhsAM = Math.Abs(zhs) % 100;

                if (zhsAM > workConditionNum)
                {
                    throw new Exception("第 " + i + " 工况,第 " + j + " 线条组合参数错误" + "0 + 16 " + "错误:1-215");
                }

                y1 = TensionMax[j, zhsAM];
                y2 = TensionMin[j, zhsAM];

                if (j <= earthWireNum && y1 >= LineParas.AnchorTension)
                {
                    //地线有开段时
                    deta1 = y1;
                    deta2 = 90;
                    deta3 = 0;
                }
                else
                {
                    //地线不开段和导线
                    deta1 = LineParas.AnchorTension;
                    deta2 = Paras.AnchorAngle;
                    deta3 = Paras.AnchorAngle;
                }

                x1 = Wind[j, zhsAM];
                z1 = GMax[j, zhsAM];
                z2 = GMin[j, zhsAM];

                //j从1开始计数,但是XX YY ZZ 从0开始
                XX[i, j - 1] = ((FormulaLineTower)formula).ZXMX2(angle, x1, out string strX);
                YY[i, j - 1] = ((FormulaLineTower)formula).ZXMY2(angle, x1, deta1 * fuhao, deta2, out string strY);
                ZZ[i, j - 1] = ((FormulaLineTower)formula).ZXMZ2(z1, fh, fhn, deta1, deta3, out string strZ);

                GenerateLineLoadString(j, strX, strY, strZ);
            }
            else if (Math.Abs(zhs) > 1000)
            {
                //施工提线相
                if (Math.Abs(zhs) < 10000)
                {
                    fhn = Math.Abs(zhs) / 1000;
                }
                else
                {
                    fhn = (Math.Abs(zhs) - 10000) / 1000;
                }

                zhsAM = Math.Abs(zhs) % 1000;

                if (zhsAM > workConditionNum)
                {
                    throw new Exception("第 " + i + " 工况,第 " + j + " 线条组合参数错误" + "0 + 16 " + "错误:1-216");
                }

                x1 = Wind[j, zhsAM];
                z1 = GMax[j, zhsAM];
                z2 = GMin[j, zhsAM];

                //j从1开始计数,但是XX YY ZZ 从0开始
                XX[i, j - 1] = ((FormulaLineTower)formula).ZXCX(angle, x1, out string strX);
                YY[i, j - 1] = ((FormulaLineTower)formula).ZXCY(angle, x1, LineParas.HoistingCoef, z1, out string strY);
                ZZ[i, j - 1] = ((FormulaLineTower)formula).ZXCZ(fh, fhn, LineParas.HoistingCoef, z1, out string strZ);

                GenerateLineLoadString(j, strX, strY, strZ);

                //工况代号大于10000,并且选择了转向挂点
                if (Math.Abs(zhs) > 10000 && HPSettingParas.IsTuringPointSeleced == true)
                {
                    CalsTurningPointsLoad(i, j);
                }
            }
            else if (zhs == 0)
            {
                //j从1开始计数,但是XX YY ZZ 从0开始
                XX[i, j - 1] = 0;
                YY[i, j - 1] = 0;
                ZZ[i, j - 1] = 0;

                ProcessString.Add(Template.Wires[j - 1] + " Fx= " + "0.00");
                ProcessString.Add(Template.Wires[j - 1] + " Fy= " + "0.00");
                ProcessString.Add(Template.Wires[j - 1] + " Fz= " + "0.00");
            }
        }