| | |
| | | valveSb.AppendLine(";ID Node1 Node2 Diameter Type Setting MinorLoss "); |
| | | network.Valves?.ForEach(x => |
| | | { |
| | | valveSb.AppendLine($"{x.Id}\t{x.StartNode.Id}\t{x.EndNode.Id}\t{x.Diameter:F4}\t{x.ValveType}\t{x.ValveSetting}\t{x.MinorLoss:F4}\t;\t");// + $"0"); |
| | | if (!string.IsNullOrEmpty(x.LinkStatus)) |
| | | if (x.Id == "694311") |
| | | { |
| | | |
| | | } |
| | | string settings; |
| | | if (x.LinkStatus == ValveStatus.None) |
| | | { |
| | | settings = x.ValveSetting; |
| | | } |
| | | 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}\t{x.ValveType}\t{settings}\t{x.MinorLoss:F4}\t;\t");// + $"0"); |
| | | if (!string.IsNullOrEmpty(x.LinkStatus) && x.LinkStatus != ValveStatus.None) |
| | | { |
| | | statusSb.AppendLine(x.Id + "\t" + x.LinkStatus); |
| | | } |
| | |
| | | { |
| | | 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); |
| | | } |
| | |
| | | else |
| | | statusString = $"\t{o.SpeedRatio}"; |
| | | } |
| | | statusSb.AppendLine(o.Id + statusString); |
| | | if (!string.IsNullOrEmpty(o.LinkStatus)) |
| | | { |
| | | statusSb.AppendLine(o.Id + statusString); |
| | | } |
| | | |
| | | }); |
| | | string pumpString = pumpSb.ToString(); |
| | | |
| | |
| | | float minorLoss; |
| | | if (float.TryParse(parts[6], out minorLoss)) |
| | | p.MinorLossCoeff = minorLoss; |
| | | p.LinkStatus = parts.Length > 7 ? (parts[7].ToUpper().Contains("CLOSE")? PipeStatus.Closed : PipeStatus.Open) : PipeStatus.Open; |
| | | |
| | | p.LinkStatus = parts.Length > 7 ? (parts[7].ToUpper().Contains("CLOSE") ? PipeStatus.Closed : PipeStatus.Open) : PipeStatus.Open; |
| | | |
| | | net.Pipes.Add(p); |
| | | } |
| | | break; |
| | |
| | | case "PUMPS": |
| | | { |
| | | InpPump pump = new InpPump(); |
| | | |
| | | |
| | | pump.Id = parts.ToString(0, null); |
| | | |
| | | // 取出Node1和Node2中的字母部分,例如“S201326593”被取出为“201326593” |
| | |
| | | J.Position = new Position2d(); |
| | | J.Position.X = coor.Position.X; |
| | | J.Position.Y = coor.Position.Y; |
| | | |
| | | |
| | | k1++; |
| | | } |
| | | #endregion |