cloudflight
2024-12-25 e14609d8a7bad0aaabb412edd4a8f09f4812c1ab
修复阀门导出inp格式问题
已修改1个文件
25 ■■■■ 文件已修改
Hydro/Yw.EPAnet.Calcu.Core/04-Inp/InpInteropHelper.cs 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Hydro/Yw.EPAnet.Calcu.Core/04-Inp/InpInteropHelper.cs
@@ -143,7 +143,7 @@
                string statusString = x.LinkStatus == PipeStatus.Closed ? "CLOSED" : "";
                double minorLoss = x.MinorLossCoeff + x.EndMinorLossCoeff + x.StartMinorLossCoeff;
                pipeSb.AppendLine($"{x.Id}\t{x.StartNode.Id}\t{x.EndNode.Id}\t{x.Length}\t{x.Diameter}\t{x.Roughness}\t{minorLoss}\t{statusString}\t;\t");// + $"{p.Level}");
                if (x.LinkStatus != PipeStatus.Open)
                if (x.LinkStatus != PipeStatus.Open )
                {
                    statusSb.AppendLine(x.Id + "\t" + statusString);
                }
@@ -166,7 +166,7 @@
                }
                if (string.IsNullOrEmpty(settings)) settings = "Undefined";
                valveSb.AppendLine($"{x.Id}\t{x.StartNode.Id}\t{x.EndNode.Id}\t{x.Diameter:F4}\t{x.ValveType}\t{settings}\t{x.MinorLoss:F4}\t;\t");// + $"0");
                if (!string.IsNullOrEmpty(x.LinkStatus))
                if (!string.IsNullOrEmpty(x.LinkStatus) && x.LinkStatus != ValveStatus.None)
                {
                    statusSb.AppendLine(x.Id + "\t" + x.LinkStatus);
                }
@@ -182,8 +182,19 @@
                {
                    type = "Compressor";
                }
                valveSb.AppendLine($"{x.Id}\t{x.StartNode.Id}\t{x.EndNode.Id}\t{x.Diameter:F4}\tGPV\t{x.CurveQL}\t{x.MinorLoss:F4}\t;\t{type}");// + $"0");
                if (!string.IsNullOrEmpty(x.LinkStatus))
                string settings;
                if (x.LinkStatus == ValveStatus.None)
                {
                    settings = x.CurveQL;
                }
                else
                {
                    settings = "Undefined";
                }
                if (string.IsNullOrEmpty(settings)) settings = "Undefined";
                valveSb.AppendLine($"{x.Id}\t{x.StartNode.Id}\t{x.EndNode.Id}\t{x.Diameter:F4}\tGPV\t{settings}\t{x.MinorLoss:F4}\t;\t{type}");// + $"0");
                if (!string.IsNullOrEmpty(x.LinkStatus) &&  x.LinkStatus != ValveStatus.None)
                {
                    statusSb.AppendLine(x.Id + "\t" + x.LinkStatus);
                }
@@ -208,7 +219,11 @@
                    else
                        statusString = $"\t{o.SpeedRatio}";
                }
                statusSb.AppendLine(o.Id + statusString);
                if (!string.IsNullOrEmpty(o.LinkStatus) )
                {
                    statusSb.AppendLine(o.Id + statusString);
                }
            });
            string pumpString = pumpSb.ToString();