public HangingPointLoadCompose(int i, int j, float[,] xLoad, float[,] yLoad, float[,] zLoad, string grp, string linkXY, string linkZ,
                                       HangingPointSettingParas hpSetting, TowerTemplate template, List <StruCalsDicGroup> dicGrps, string pos = null)
        {
            iIndex = i;
            jIndex = j;

            xLineLoad = xLoad;
            yLineLoad = yLoad;
            zLineLoad = zLoad;

            xyLink = linkXY;
            zLink  = linkZ;

            if (pos == null)
            {
                isTensionTower = false;
            }
            else
            {
                isTensionTower = true;
                position       = pos;
            }

            group = grp;

            hpPointsParas = hpSetting;
            towerTemplate = template;

            wireType = towerTemplate.Wires[i];
            wd       = towerTemplate.WorkConditionCombos[j];

            dicGroupOptions = dicGrps;
        }
Example #2
0
        public HangingPointLoadComposeBase(int i, int j, string orient, float[,] xLoad, float[,] yLoad, float[,] zLoad, string group, string link,
                                           List <HangingPointParas> pointsParas, HangingPointSettingParas raios, TowerTemplate template, List <StruCalsDicGroup> dicGrps)
        {
            iIndex      = i;
            jIndex      = j;
            orientation = orient;

            xLineLoad = xLoad;
            yLineLoad = yLoad;
            zLineLoad = zLoad;

            if (orient == "X")
            {
                lineLoad = xLoad;
            }
            else if (orient == "Y")
            {
                lineLoad = yLoad;
            }
            else
            {
                lineLoad = zLoad;
            }

            ratioParas    = raios;
            towerTemplate = template;

            wireType = towerTemplate.Wires[i];
            wd       = towerTemplate.WorkConditionCombos[j];

            StruCalsDicGroup dicGroup = new StruCalsDicGroup();

            if (link.Contains("常规"))
            {
                pointParas = pointsParas.Where(item => item.WireType == wireType).First();

                string vStr = pointParas.StringType.Contains("V") ? "V串" : pointParas.StringType;
                dicGroup = dicGrps.Where(item => item.Group == group && item.FixedType == vStr && item.Link == link).First();
            }
            else if (link.Contains("转向"))
            {
                pointParas = pointsParas.Where(item => item.WireType == wireType).First();
                dicGroup   = dicGrps.Where(item => item.Group == group && item.Link == link).First();
            }
            else
            {
                string wCC   = template.WorkConditionCombos[jIndex].WorkConditionCode;
                string array = wCC.Substring(wCC.Length - 1);

                pointParas = pointsParas.Where(item => item.WireType == wireType && item.Array != null && item.Array.Contains(array)).First();
                dicGroup   = dicGrps.Where(item => item.Group == group && item.Link == link).First();
            }

            option         = dicGroup.Options.Where(item => item.Num == pointParas.PointNum).First();
            dicComposeInfo = option.ComposrInfos.Where(item => item.Orientation == orientation).First().PointCompose;
        }
        protected void DecodeWorkCondition(string line, out WorkConditionCombo combo)
        {
            combo = new WorkConditionCombo()
            {
                WireIndexCodes = new List <int>()
            };

            string[] aWords = Regex.Split(line.Trim(), "\\s+");

            int iIndex = 3;

            combo.Index             = Convert.ToInt32(aWords[0]);
            combo.IsCalculate       = Convert.ToBoolean(aWords[1].ToString());
            combo.WorkConditionCode = aWords[2];

            if (Type == TowerTypeEnum.LineTower)
            {
                combo.WindDirectionCode = Convert.ToInt32(aWords[iIndex]);

                //在直线塔中用不着以下两个字段,主要是为了在编译模板中,
                //塔型转换后保存时占位
                combo.TensionAngleCode = "None";
                combo.VertialLoadCode  = "None";
            }
            else if (Type == TowerTypeEnum.LineCornerTower)
            {
                combo.TensionAngleCode = aWords[iIndex];
                iIndex++;
                combo.WindDirectionCode = Convert.ToInt32(aWords[iIndex]);

                //赋值理由同上
                combo.VertialLoadCode = "None";
            }
            else
            {
                combo.TensionAngleCode = aWords[iIndex];
                iIndex++;
                combo.VertialLoadCode = aWords[iIndex];
                iIndex++;
                combo.WindDirectionCode = Convert.ToInt32(aWords[iIndex]);
            }

            for (int i = 1; i <= WireNum; i++)
            {
                combo.WireIndexCodes.Add(Convert.ToInt32(aWords[iIndex + i]));
            }

            iIndex++;
            combo.WorkCode = Convert.ToInt32(aWords[iIndex + WireNum]);
            iIndex++;
            combo.WorkComment = aWords[iIndex + WireNum].ToString();
        }
        public static void ConvertSpecToWorkCondition(TowerTemplate template, List <WorkConditionComboSpec> workConditionSpecs, bool isCalculation = false)
        {
            List <WorkConditionCombo> workConditions = new List <WorkConditionCombo>();

            WorkConditionComboSpec item;

            //foreach (var item in workConditionSpecs)
            for (int index = 0; index < workConditionSpecs.Count; index++)
            {
                item = workConditionSpecs[index];
                WorkConditionCombo wcc = new WorkConditionCombo();

                wcc.Index             = item.Index;
                wcc.IsCalculate       = item.IsCalculate;
                wcc.WorkConditionCode = isCalculation? template.WorkConditionCombos[index].WorkConditionCode: item.WorkConditionCode;
                if (item.TensionAngleCode != null)
                {
                    wcc.TensionAngleCode = isCalculation ? template.WorkConditionCombos[index].TensionAngleCode : item.TensionAngleCode;
                }
                if (item.VertialLoadCode != null)
                {
                    wcc.VertialLoadCode = isCalculation ? template.WorkConditionCombos[index].VertialLoadCode : item.VertialLoadCode;
                }
                wcc.WindDirectionCode = item.WindDirectionCode;
                wcc.WorkCode          = item.WorkCode;

                //int wireIndexCodesNum = template.WorkConditionCombos[0].WireIndexCodes.Count;
                int wireIndexCodesNum = template.Wires.Count;
                wcc.WireIndexCodes = new List <int>();

                for (int i = 1; i <= wireIndexCodesNum; i++)
                {
                    Type         itemType = item.GetType();
                    PropertyInfo itemPro  = itemType.GetProperty("Wire" + i.ToString(), BindingFlags.GetProperty | BindingFlags.Instance | BindingFlags.Public);
                    if (itemPro != null)
                    {
                        wcc.WireIndexCodes.Add(isCalculation ? template.WorkConditionCombos[index].WireIndexCodes[i - 1]:Convert.ToInt32(itemPro.GetValue(item, null)));
                    }
                }

                wcc.WorkComment = item.WorkComment;

                workConditions.Add(wcc);
            }

            template.WorkConditionCombos = workConditions;
        }
        protected void EncodeWorkCondition(out string comboStr, WorkConditionCombo combo)
        {
            comboStr = "";

            //添加序号
            comboStr += combo.Index.ToString().PadRight(8);

            //添加是否计算
            comboStr += combo.IsCalculate.ToString().PadRight(10);

            //添加工况代号
            comboStr += combo.WorkConditionCode.PadRight(8);

            if (Type == TowerTypeEnum.LineTower)
            {
                comboStr += combo.WindDirectionCode.ToString().PadRight(8);
            }
            else if (Type == TowerTypeEnum.LineCornerTower)
            {
                comboStr += combo.TensionAngleCode.PadRight(8);
                comboStr += combo.WindDirectionCode.ToString().PadRight(8);
            }
            else
            {
                comboStr += combo.TensionAngleCode.PadRight(8);
                comboStr += combo.VertialLoadCode.PadRight(8);
                comboStr += combo.WindDirectionCode.ToString().PadRight(8);
            }

            foreach (var wireCode in combo.WireIndexCodes)
            {
                comboStr += wireCode.ToString().PadLeft(8);
            }

            //添加工况码
            comboStr += combo.WorkCode.ToString().PadLeft(8);
            //添加注释
            comboStr += "   " + combo.WorkComment;
        }
        /// <summary>
        /// 针对吊装工况
        /// 工况代码"L", "La", "Lb", "Lc", "Ld", "Le", "Lf", "Lg", "Lh"
        /// </summary>
        /// <param name="i"></param>
        /// <param name="j"></param>
        protected void DistributeInLift(int i, int j)
        {
            float x1, y1, y2, z1, z2, z3, z4;
            float zg, fhn;
            float zjiao;

            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)
                {
                    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];
                }
                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];
                }

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

                GenerateLineLoadString(j, strX, strY, strZ);
            }
            else if (Math.Abs(zhs) > 100)
            {
                // 包含检修提线和吊装
                if (zhs > 1000)
                {
                    fhn   = Math.Abs(zhs) / 1000;
                    zhsAM = Math.Abs(zhs) % 1000;

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

                    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];
                    zg = LineParas.HoistingCoef;
                }
                else if (zhs < -1000)
                {
                    fhn   = Math.Abs(zhs) / 1000;
                    zhsAM = Math.Abs(zhs) % 1000;

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

                    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];
                    zg = LineParas.HoistingCoef;
                }
                else if (zhs > 100 && zhs < 1000)
                {
                    fhn   = Math.Abs(zhs) / 100;
                    zhsAM = Math.Abs(zhs) % 100;

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

                    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];
                    zg = 1.0f;
                }
                else
                {
                    fhn   = Math.Abs(zhs) / 100;
                    zhsAM = Math.Abs(zhs) % 100;

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

                    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 = TensionMin[j, zhs];
                    y2 = TensionMax[j, zhs];
                    z1 = GMax[j, zhs];
                    z2 = GMax[j, 1];
                    z3 = GMin[j, zhs];
                    z4 = GMin[j, 1];
                    zg = 1.0f;
                }

                XX[i, j - 1] = ((FormulaLineLineCornerTower)formula).ZZLX(angle, x1, y1, y2, zjiao, out string strX);
                YY[i, j - 1] = ((FormulaLineLineCornerTower)formula).ZZLY(angle, x1, y1, y2, zjiao, out string strY);
                ZZ[i, j - 1] = ((FormulaLineLineCornerTower)formula).ZZLZ2(z1, zg, fh, fhn, out string strZ);

                GenerateLineLoadString(j, strX, strY, 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>
        /// 针对脱冰跳跃工况
        /// 工况代码"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>
        /// 针对覆冰-最低温、不均匀冰、断线、验算冰工况
        /// 工况代码"I1", "I2", "U1", "U2", "B1", "B2", "Y1", "Y2"
        /// </summary>
        /// <param name="i"></param>
        /// <param name="j"></param>
        protected void DistributeInIce(int i, int j)
        {
            float x1, y1, y2, z1, z2, z3, z4;
            float rg, zg, zg1, fhn, Vloadx;
            float zjiao;

            WorkConditionCombo wd = Template.WorkConditionCombos[i];

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

            int zhsM = (Math.Abs(zhs)) % 1000;

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

                y1 = TensionMax[j, zhsM];
                y2 = TensionMin[j, zhsM];
                z1 = GMax[j, zhsM];
                z2 = GMax[j, 1];
                z3 = GMin[j, zhsM];
                z4 = GMin[j, 1];
            }
            else if (zhs < 0)
            {
                if (wd.TensionAngleCode == "D")
                {
                    x1    = Wind[j, zhsM];
                    zjiao = LineParas.AngleMax;
                }
                //else if( wd.TensionAngleCode == "X" )
                else
                {
                    x1    = Windx[j, zhsM];
                    zjiao = LineParas.AngleMin;
                }
                y1 = TensionMin[j, zhsM];
                y2 = TensionMax[j, zhsM];
                z1 = GMax[j, zhsM];
                z2 = GMax[j, 1];
                z3 = GMin[j, zhsM];
                z4 = GMin[j, 1];
            }
            else
            {
                x1    = 0;
                y1    = 0;
                y2    = 0;
                z1    = 0;
                z2    = 0;
                z3    = 0;
                z4    = 0;
                zjiao = 0;
            }

            if (zhsM > workConditionNum)
            {
                x1 = 9999;
                y1 = 9999;
                y2 = 9999;
                z1 = 9999;
                z2 = 9999;
                z3 = 9999;
                z4 = 9999;
                throw new Exception("第 " + i + " 工况,第 " + j + " 线条组合参数错误,只能为-" + -workConditionNum + "~" + workConditionNum + "之间 " + "0 + 16 " + "错误:1-219");
            }

            if (workConditionCode == "I1")
            {
                rg     = Paras.RGBad;
                zg     = z1;
                zg1    = z2;
                fhn    = Paras.VcFNormal;
                Vloadx = Paras.RQ;
            }
            else if (workConditionCode == "I2")
            {
                rg     = Paras.RGGood;
                zg     = z3;
                zg1    = z4;
                fhn    = Paras.VcFNormal;
                Vloadx = Paras.RQ;
            }
            else if (workConditionCode == "U1")
            {
                rg     = Paras.RGBad;
                zg     = z1;
                zg1    = z2;
                fhn    = Paras.VcFUnevenIce;
                Vloadx = Paras.RQ;
            }
            else if (workConditionCode == "U2")
            {
                rg     = Paras.RGGood;
                zg     = z3;
                zg1    = z4;
                fhn    = Paras.VcFUnevenIce;
                Vloadx = Paras.RQ;
            }
            else if (workConditionCode == "B1")
            {
                rg     = Paras.RGBad;
                zg     = z1;
                zg1    = z2;
                fhn    = Paras.VcFBroken;
                Vloadx = Paras.RQ;
            }
            else if (workConditionCode == "B2")
            {
                rg     = Paras.RGGood;
                zg     = z3;
                zg1    = z4;
                fhn    = Paras.VcFBroken;
                Vloadx = Paras.RQ;
            }
            else if (workConditionCode == "Y1")
            {
                rg     = Paras.RGCheck01;
                zg     = z1;
                zg1    = z2;
                fhn    = Paras.VcFCheck;
                Vloadx = Paras.RA;
            }
            else
            {
                rg     = Paras.RGCheck02;
                zg     = z3;
                zg1    = z4;
                fhn    = Paras.VcFCheck;
                Vloadx = Paras.RA;
            }

            XX[i, j - 1] = ((FormulaLineLineCornerTower)formula).ZZIYX(angle, x1, y1, y2, zjiao, fhn, Vloadx, out string strX);
            YY[i, j - 1] = ((FormulaLineLineCornerTower)formula).ZZIYY(angle, x1, y1, y2, zjiao, fhn, Vloadx, out string strY);
            ZZ[i, j - 1] = ((FormulaLineLineCornerTower)formula).ZZIYZ(zg1, zg, rg, fhn, Vloadx, out string strZ);

            GenerateLineLoadString(j, strX, strY, strZ);
        }
        /// <summary>
        /// 针对大风和低温的工况
        /// 工况代码"N1", "N2", "D1", "D2"
        /// </summary>
        /// <param name="i"></param>
        /// <param name="j"></param>
        protected void DistributeInWindAndLowTemperature(int i, int j)
        {
            float x1, y1, y2, z1, z2;
            float rg, zg, Vcb;
            float zjiao;

            WorkConditionCombo wd = Template.WorkConditionCombos[i];

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

            if (zhs <= workConditionNum && 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 = GMin[j, zhs];
            }
            else if (zhs < 0 && zhs >= -workConditionNum)
            {
                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 = TensionMin[j, Math.Abs(zhs)];
                y2 = TensionMax[j, Math.Abs(zhs)];
                z1 = GMax[j, Math.Abs(zhs)];
                z2 = GMin[j, Math.Abs(zhs)];
            }
            else if (zhs == 0)
            {
                x1    = 0;
                y1    = 0;
                y2    = 0;
                z1    = 0;
                z2    = 0;
                zjiao = 0;
            }
            else
            {
                x1 = 9999;
                y1 = 9999;
                y2 = 9999;
                z1 = 9999;
                z2 = 9999;
                throw new Exception("第 " + i + " 工况,第 " + j + " 线条组合参数错误,只能为-" + -workConditionNum + "~" + workConditionNum + "之间 " + "0 + 16 " + "错误:1-218");
            }

            if (workConditionCode == "N1" || workConditionCode == "D1")
            {
                rg = Paras.RGBad;
                zg = z1;
            }
            //else if (workConditionCode == "N2" || workConditionCode == "D2")
            else
            {
                rg = Paras.RGGood;
                zg = z2;
            }

            if (workConditionCode == "N1" || workConditionCode == "N1")
            {
                Vcb = Paras.VcFNormal;
            }
            //else if (workConditionCode == "D2" || workConditionCode == "D2")
            else
            {
                Vcb = Paras.VcFCold;
            }

            //与直线塔有所差别,需要考虑角度力的影响,张力按角度在X向有所分离,在Y向存在荷载,下同
            XX[i, j - 1] = ((FormulaLineLineCornerTower)formula).ZZNX(angle, x1, y1, y2, zjiao, Vcb, out string strX);
            YY[i, j - 1] = ((FormulaLineLineCornerTower)formula).ZZNY(angle, x1, y1, y2, zjiao, Vcb, out string strY);
            ZZ[i, j - 1] = ((FormulaLineLineCornerTower)formula).ZZNZ(zg, rg, Vcb, out string strZ);

            GenerateLineLoadString(j, strX, strY, strZ);
        }
        /// <summary>
        /// 针对过滑车工况,只考虑最大垂荷
        /// 工况代码"G", "Ga", "Gb", "Gc", "Gd", "Ge", "Gf", "Gg", "Gh", "GLa", "GLb", "GLc", "GLd", "GLe", "GLf", "GLg", "GLh"
        /// </summary>
        /// <param name="i"></param>
        /// <param name="j"></param>
        protected void DistributeInHuache(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-213");
                }

                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)
            {
                //过滑车 >10000 表示转向过滑车
                if (zhs > 0)
                {
                    y1 = LineParas.PulleyTensionDif;
                }
                else
                {
                    y1 = -LineParas.PulleyTensionDif;
                }

                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-214");
                }

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

                //j从1开始计数,但是XX YY ZZ 从0开始
                XX[i, j - 1] = ((FormulaLineTower)formula).GLX(angle, x1, out string strX);
                YY[i, j - 1] = ((FormulaLineTower)formula).GLY(angle, x1, y1, out string strY);
                ZZ[i, j - 1] = ((FormulaLineTower)formula).GLZ(z1, z2, fh, fhn, 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;

                GenerateLineLoadString(j, "0.00", "0.00", "0.00");
            }
        }
        /// <summary>
        /// 针对OPGW锚线工况
        /// 工况代码"MO", "MOa", "MOb", "MOc", "MOd", "MOe", "MOf", "MOg", "MOh"
        /// </summary>
        /// <param name="i"></param>
        /// <param name="j"></param>
        protected void DistributeInOPGWAnchor(int i, int j)
        {
            float x1, y1, y2, z1, z2;
            float fhn;
            float deta1;

            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;

            //OPGW锚线特殊工况,其表达式与常规锚线有所不同,需区分
            if (zhs < 1000 && zhs > 0)
            {
                x1 = Wind[j, zhs];
                y1 = TensionMax[j, zhs];
                y2 = TensionMin[j, zhs];
                z1 = GMax[j, zhs];
                z2 = GMin[j, zhs];

                //j从1开始计数,但是XX YY ZZ 从0开始
                //刚老师意见,无论开断与否,OPGW已架相均应该有荷载,与常规不符
                XX[i, j - 1] = ((FormulaLineTower)formula).MO2X(angle, x1, out string strX);
                YY[i, j - 1] = ((FormulaLineTower)formula).MO2Y(angle, x1, y1, y2, out string strY);
                ZZ[i, j - 1] = ((FormulaLineTower)formula).MO2Z(z1, out string strZ);

                GenerateLineLoadString(j, strX, strY, strZ);
            }
            else if (zhs > 1000)
            {
                fhn   = zhs / 1000;
                zhsAM = zhs % 1000;

                x1 = Wind[j, zhsAM];
                y1 = TensionMax[j, zhsAM];
                y2 = TensionMin[j, zhsAM];
                z1 = GMax[j, zhsAM];
                z2 = GMin[j, zhsAM];

                //左地线
                if (y1 > 0)
                {
                    //gongjian 200728  修复错误,将负载全部复制给XX
                    //j从1开始计数,但是XX YY ZZ 从0开始
                    deta1        = LineParas.DrawingCoef;
                    XX[i, j - 1] = ((FormulaLineTower)formula).MO1X(angle, x1, out string strX);
                    YY[i, j - 1] = ((FormulaLineTower)formula).MO1Y(angle, x1, y1, deta1, y2, out string strY);
                    ZZ[i, j - 1] = ((FormulaLineTower)formula).MO1Z(z1, y1, deta1, fh, fhn, out string strZ);

                    GenerateLineLoadString(j, strX, strY, strZ);
                }
                else
                {
                    deta1 = 1;

                    //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");
                }
            }
            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>
        /// 针对吊装工况
        /// 工况代码"L", "La", "Lb", "Lc", "Ld", "Le", "Lf", "Lg", "Lh"
        /// </summary>
        /// <param name="i"></param>
        /// <param name="j"></param>
        protected void DistributeInLift(int i, int j)
        {
            float x1, y1, y2, z1, z2;
            int   fuhao;
            float zg, fhn;

            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 (zhs > 100 || zhs < -100)
            {
                // 包含检修提线和吊装
                if (zhs > 100 && zhs < 1000)
                {
                    fuhao = 1;
                    //此处为吊装荷载系数,检修提线时取1.0
                    zg    = 1;
                    fhn   = Math.Abs(zhs) / 100;
                    zhsAM = Math.Abs(zhs) % 100;
                }
                else if (zhs > -1000 && zhs < -100)
                {
                    fuhao = -1;
                    //此处为吊装荷载系数,检修提线时取1.0
                    zg    = 1;
                    fhn   = Math.Abs(zhs) / 100;
                    zhsAM = Math.Abs(zhs) % 100;
                }
                else if (zhs < -1000)
                {
                    fuhao = -1;
                    //此处为吊装荷载系数
                    zg    = LineParas.HoistingCoef;
                    fhn   = Math.Abs(zhs) / 1000;
                    zhsAM = Math.Abs(zhs) % 1000;
                }
                else
                {
                    fuhao = 1;
                    //此处为吊装荷载系数
                    zg    = LineParas.HoistingCoef;
                    fhn   = Math.Abs(zhs) / 1000;
                    zhsAM = Math.Abs(zhs) % 1000;
                }

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

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

                if (fuhao == 1)
                {
                    y1 = TensionMax[j, zhsAM];
                    y2 = TensionMin[j, zhsAM];
                }
                else
                {
                    y1 = TensionMin[j, zhsAM];
                    y2 = TensionMax[j, zhsAM];
                }

                //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).ZXLZ2(z1, zg, fh, fhn, out string strZ);

                GenerateLineLoadString(j, strX, strY, 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>
        /// 针对脱冰跳跃工况
        /// 工况代码"T"
        /// </summary>
        /// <param name="i"></param>
        /// <param name="j"></param>
        protected void DistributeInJump(int i, int j)
        {
            float x1, y1, y2, z1, z2;
            int   fuhao;

            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)
                {
                    fuhao = 1;
                    y1    = TensionMax[j, Math.Abs(zhs)];
                    y2    = TensionMin[j, Math.Abs(zhs)];
                }
                else
                {
                    fuhao = -1;
                    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 = GMax[j, 1];

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

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

                //脱冰跳跃相

                if (zhs > 0)
                {
                    fuhao = 1;
                    y1    = TensionMax[j, zhsAM];
                    y2    = TensionMin[j, zhsAM];
                }
                else
                {
                    fuhao = -1;
                    y1    = TensionMin[j, zhsAM];
                    y2    = TensionMax[j, zhsAM];
                }

                if (zhsAM > workConditionNum || fuhao > 1)
                {
                    throw new Exception("第 " + i + " 工况,第 " + j + " 线条组合参数错误,只能为-" + -workConditionNum + "~" + workConditionNum + "之间 " + "0 + 16 " + "错误:1-209");
                }

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

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

                GenerateLineLoadString(j, strX, strY, 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>
        /// 针对大风和低温的工况
        /// 工况代码"N1", "N2", "D1", "D2"
        /// </summary>
        /// <param name="i"></param>
        /// <param name="j"></param>
        protected void DistributeInWindAndLowTemperature(int i, int j)
        {
            float x1, y1, y2, z1, z2;
            float rg, zg, Vcb;

            WorkConditionCombo wd = Template.WorkConditionCombos[i];

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

            if (zhs <= workConditionNum && zhs > 0)
            {
                x1 = Wind[j, zhs];
                y1 = TensionMax[j, zhs];
                y2 = TensionMin[j, zhs];
                z1 = GMax[j, zhs];
                z2 = GMin[j, zhs];
            }
            else if (zhs < 0 && zhs >= -workConditionNum)
            {
                x1 = Wind[j, Math.Abs(zhs)];
                y1 = TensionMin[j, Math.Abs(zhs)];
                y2 = TensionMax[j, Math.Abs(zhs)];
                z1 = GMax[j, Math.Abs(zhs)];
                z2 = GMin[j, Math.Abs(zhs)];
            }
            else if (zhs == 0)
            {
                x1 = 0;
                y1 = 0;
                y2 = 0;
                z1 = 0;
                z2 = 0;
            }
            else
            {
                x1 = 9999;
                y1 = 9999;
                y2 = 9999;
                z1 = 9999;
                z2 = 9999;
                throw new Exception("第 " + i + " 工况,第 " + j + " 线条组合参数错误,只能为-" + -workConditionNum + "~" + workConditionNum + "之间 " + "0 + 16 " + "错误:1-207");
            }

            if (workConditionCode == "N1")
            {
                rg  = Paras.RGBad;
                zg  = z1;
                Vcb = Paras.VcFNormal;
            }
            else if (workConditionCode == "N2")
            {
                rg  = Paras.RGGood;
                zg  = z2;
                Vcb = Paras.VcFNormal;
            }
            else if (workConditionCode == "D1")
            {
                rg  = Paras.RGBad;
                zg  = z1;
                Vcb = Paras.VcFCold;
            }
            else
            {
                rg  = Paras.RGGood;
                zg  = z2;
                Vcb = Paras.VcFCold;
            }

            XX[i, j - 1] = ((FormulaLineTower)formula).ZXNX(angle, x1, Vcb, out string strX);
            YY[i, j - 1] = ((FormulaLineTower)formula).ZXNY(angle, x1, y1, y2, Vcb, out string strY);
            ZZ[i, j - 1] = ((FormulaLineTower)formula).ZXNZ(zg, rg, Vcb, out string strZ);

            GenerateLineLoadString(j, strX, strY, strZ);
        }
        /// <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;
            float fhn, zjiao;

            WorkConditionCombo wd = Template.WorkConditionCombos[i];

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

            if (Math.Abs(zhs) <= workConditionNum && Math.Abs(zhs) > 0)
            {
                //已安装
                if (zhs <= workConditionNum && 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];
                }
                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];
                }

                //已安装,无附加荷载
                XX[i, j - 1] = ((FormulaLineLineCornerTower)formula).ZZLX(angle, x1, y1, y2, zjiao, out string strX);
                YY[i, j - 1] = ((FormulaLineLineCornerTower)formula).ZZLY(angle, x1, y1, y2, zjiao, out string strY);
                ZZ[i, j - 1] = ((FormulaLineLineCornerTower)formula).ZZLZ1(z1, out string strZ);

                GenerateLineLoadString(j, strX, strY, strZ);
            }
            else if (Math.Abs(zhs) > 1000)
            {
                //过滑车相
                if (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-228");
                    }

                    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 (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-229");
                    }
                    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];
                }
                else
                {
                    zjiao = 0;
                    x1    = 0;
                    y1    = 0;
                    y2    = 0;
                    z1    = 0;
                    fhn   = 0;
                }

                XX[i, j - 1] = ((FormulaLineLineCornerTower)formula).ZZLX(angle, x1, y1, y2, zjiao, out string strX);
                YY[i, j - 1] = ((FormulaLineLineCornerTower)formula).ZZLY(angle, x1, y1, y2, zjiao, out string strY);
                ZZ[i, j - 1] = ((FormulaLineLineCornerTower)formula).ZZCZ(z1, LineParas.HoistingCoef, fhn, fh, 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;

                GenerateLineLoadString(j, "0.00", "0.00", "0.00");
            }
        }
        /// <summary>
        /// 针对锚线工况
        /// 工况代码"M", "Ma", "Mb", "Mc", "Md", "Me", "Mf", "Mg", "Mh"
        /// </summary>
        /// <param name="i"></param>
        /// <param name="j"></param>
        protected void DistributeInAnchor(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) < 1000 && Math.Abs(zhs) > 0)
            {
                //已锚相
                if (zhs > 0)
                {
                    fuhao = 1;
                }
                else
                {
                    //不应出现
                    fuhao = -1;
                }

                fhn = Math.Abs(zhs) / 100;
                if (fhn < 1)
                {
                    fhn = 1;
                }

                zhsAM = Math.Abs(zhs) % 100;

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

                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 (zhs > 0)
                {
                    fuhao = 1;
                }
                else
                {
                    fuhao = -1;
                }

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

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

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

                //'正锚相
                if (fuhao > 0)
                {
                    y1 = TensionMax[j, zhsAM];
                    y2 = TensionMin[j, zhsAM];

                    if (j <= earthWireNum && y1 >= LineParas.AnchorTension)
                    {
                        //地线有开段时
                        if (y1 > 0)
                        {
                            deta1 = y1 * LineParas.DrawingCoef;
                        }
                        else
                        {
                            deta1 = y1;
                        }
                        deta2 = 90;
                        deta3 = 0;
                    }
                    else
                    {
                        //地线不开段和导线
                        deta1 = LineParas.AnchorTension;
                        deta2 = Paras.AnchorAngle;
                        deta3 = Paras.AnchorAngle;
                    }
                }
                else
                {
                    //此种情况不应出现
                    //反向张力情况,锚线张力反向
                    y1 = -TensionMax[j, zhsAM];
                    y2 = -TensionMin[j, zhsAM];

                    if (j <= earthWireNum && Math.Abs(y1) >= Math.Abs(LineParas.AnchorTension))
                    {
                        //地线有开段时
                        if (y1 < 0)
                        {
                            deta1 = y1 * LineParas.DrawingCoef;
                        }
                        else
                        {
                            deta1 = y1;
                        }

                        deta2 = 90;
                        deta3 = 0;
                    }
                    else
                    {
                        //地线不开段和导线
                        deta1 = -LineParas.AnchorTension;
                        deta2 = Paras.AnchorAngle;
                        deta3 = Paras.AnchorAngle;
                    }
                }

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

                GenerateLineLoadString(j, strX, strY, 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");
            }
        }
Example #17
0
        public void GenerateLoadFile(string path, List <StruCalsPointLoad> pointLoads)
        {
            List <string> processString = new List <string>();

            StruCalsLib libParas = GlobalInfo.GetInstance().GetStruCalsLibParas();

            if (libParas == null)
            {
                return;
            }

            if (libParas.IceCoverParas == null || libParas.IceCoverParas.Count == 0)
            {
                return;
            }

            #region 保存工况
            int wccNumTemp = 0;
            for (int i = 0; i < Template.WorkConditionCombos.Count; i++)
            {
                //gongjian 200728 没有选择的工况在load文件也不用计算
                if (!Template.WorkConditionCombos[i].IsCalculate)
                {
                    continue;
                }

                wccNumTemp++;

                WorkConditionCombo wcCombo = Template.WorkConditionCombos[i];

                float wcWind = WorkConditionWind[wcCombo.WorkCode - 1];

                float wdIceThickness = WorkConditionIceThickness[wcCombo.WorkCode - 1];

                float windLoad = 1, gravityLoad = 1;

                //对于冰厚,首先寻找和工况中指定冰厚一样,没有的情况下向下取最大的值
                if (libParas.IceCoverParas.Where(item => item.IceThickness == wdIceThickness).Count() > 0)
                {
                    windLoad    = libParas.IceCoverParas.Where(item => item.IceThickness == wdIceThickness).First().TowerWindLoadAmplifyCoef;
                    gravityLoad = libParas.IceCoverParas.Where(item => item.IceThickness == wdIceThickness).First().TowerGravityLoadAmplifyCoef;
                }
                else
                {
                    for (int j = libParas.IceCoverParas.Count - 1; j >= 0; j--)
                    {
                        if (wdIceThickness - libParas.IceCoverParas[j].IceThickness > 0)
                        {
                            windLoad    = libParas.IceCoverParas[j].TowerWindLoadAmplifyCoef;
                            gravityLoad = libParas.IceCoverParas[j].TowerGravityLoadAmplifyCoef;
                            break;
                        }
                    }
                }

                float installCoef = 1, otherCoef = 1.1f;
                if (libParas.WireExtraLoadParas.Where(item => item.Voltage == Paras.Voltage).Count() > 0)
                {
                    installCoef = libParas.WireExtraLoadParas.Where(item => item.Voltage == Paras.Voltage).First().InstallImportanceCoef;
                    otherCoef   = libParas.WireExtraLoadParas.Where(item => item.Voltage == Paras.Voltage).First().OtherImportanceCoef;
                }

                float comboCoef, importanceCoef;
                if (wcCombo.WorkConditionCode.StartsWith("N"))
                {
                    comboCoef      = Paras.VcFNormal * windLoad;
                    importanceCoef = otherCoef;
                }
                else if (wcCombo.WorkConditionCode.StartsWith("D"))
                {
                    comboCoef      = Paras.VcFCold * windLoad;
                    importanceCoef = otherCoef;
                }
                else if (wcCombo.WorkConditionCode.StartsWith("I"))
                {
                    comboCoef      = (Paras.SelectedStandard == "GB50545-2010" ? Paras.VcFNormal : Paras.VcFIce) * windLoad;
                    importanceCoef = otherCoef;
                }
                else if (wcCombo.WorkConditionCode.StartsWith("L") || wcCombo.WorkConditionCode.StartsWith("G") || wcCombo.WorkConditionCode.StartsWith("M") ||
                         wcCombo.WorkConditionCode.StartsWith("C") || wcCombo.WorkConditionCode.StartsWith("J"))
                {
                    comboCoef      = Paras.VcFInstall * windLoad;
                    importanceCoef = installCoef;
                }
                else if (wcCombo.WorkConditionCode.StartsWith("B"))
                {
                    comboCoef      = Paras.VcFBroken * windLoad;
                    importanceCoef = otherCoef;
                }
                else if (wcCombo.WorkConditionCode.StartsWith("U"))
                {
                    comboCoef      = Paras.VcFUnevenIce * windLoad;
                    importanceCoef = otherCoef;
                }
                else if (wcCombo.WorkConditionCode.StartsWith("T") || wcCombo.WorkConditionCode.StartsWith("Y"))
                {
                    comboCoef      = Paras.VcFCheck * windLoad;
                    importanceCoef = installCoef;
                }
                else
                {
                    //不应该走到此分支
                    comboCoef      = 1 * windLoad;
                    importanceCoef = 1;
                    throw new Exception("生成Load文件出错:1;工况代号" + wcCombo.WorkConditionCode);
                }

                float windAngle = wcCombo.WindDirectionCode;
                //gongjian 200728  修改风向角小于0,将负号挪到组合系统
                if (windAngle < 0)
                {
                    windAngle = Math.Abs(windAngle);
                    comboCoef = -1 * comboCoef;
                }

                float temperature = WorkConditionTemperate[wcCombo.WorkCode - 1];

                string str = wcWind.ToString("0.000").PadLeft(8) + comboCoef.ToString("0.000").PadLeft(8) + windAngle.ToString("0.000").PadLeft(8)
                             + importanceCoef.ToString("0.000").PadLeft(8) + gravityLoad.ToString("0.000").PadLeft(8) + temperature.ToString("0.00").PadLeft(8)
                             + "   " + wccNumTemp.ToString() + "-" + wcCombo.WorkComment;

                processString.Add(str);
            }

            #endregion

            #region 保存挂点荷载
            List <int> points = pointLoads.Select(p => p.Name).Distinct().ToList();

            points.Sort();

            foreach (var point in points)
            {
                int wdNumTmep = 0;
                for (int j = 0; j < Template.WorkConditionCombos.Count; j++)
                {
                    //gongjian 200728  没有选择的工况在load文件也不用计算
                    if (!Template.WorkConditionCombos[j].IsCalculate)
                    {
                        continue;
                    }

                    wdNumTmep++;

                    string str   = (wdNumTmep == 1) ? point.ToString().PadLeft(9) : (" ").PadLeft(9);
                    float  xLoad = pointLoads.Where(p => p.Name == point && p.WorkConditionId == j && p.Orientation == "X").Sum(p => p.Load);
                    float  yLoad = pointLoads.Where(p => p.Name == point && p.WorkConditionId == j && p.Orientation == "Y").Sum(p => p.Load);
                    float  zLoad = pointLoads.Where(p => p.Name == point && p.WorkConditionId == j && p.Orientation == "Z").Sum(p => p.Load);

                    str += xLoad.ToString("0.00").PadLeft(14) + yLoad.ToString("0.00").PadLeft(9) + zLoad.ToString("0.00").PadLeft(9);
                    processString.Add(str);
                }
            }
            #endregion

            FileUtils.TextSaveByLine(path, processString);
        }