프로젝트

일반

사용자정보

개정판 91b703af

ID91b703af4a68857d23540df66fc405e963df3e59
상위 2e4ec534
하위 1c2b9969

gaqhf 이(가) 약 5년 전에 추가함

dev issue #366 : fix vent drain valve

Change-Id: I62453c23f6f15dffcc12d004455ec2c815f47570

차이점 보기:

DTI_PID/SPPIDConverter/BaseModel/Document.cs
1059 1059
        {
1060 1060
            foreach (var item in SYMBOLS)
1061 1061
            {
1062
                List<Symbol> group = new List<Symbol>();
1063
                SPPIDUtil.FindConnectedSymbolGroup(this, item, group);
1064
                List<Line> lines = new List<Line>();
1065
                foreach (var symbol in group)
1062
                if (item.TYPE == "Valves")
1066 1063
                {
1067
                    foreach (var connector in symbol.CONNECTORS)
1064
                    List<Symbol> group = new List<Symbol>();
1065
                    SPPIDUtil.FindConnectedSymbolGroup(this, item, group);
1066
                    List<Line> lines = new List<Line>();
1067
                    foreach (var symbol in group)
1068 1068
                    {
1069
                        if (connector.ConnectedObject != null && connector.ConnectedObject.GetType() == typeof(Line))
1069
                        foreach (var connector in symbol.CONNECTORS)
1070 1070
                        {
1071
                            Line line = connector.ConnectedObject as Line;
1072
                            if (!lines.Contains(line))
1073
                                lines.Add(line);
1074
                            
1071
                            if (connector.ConnectedObject != null && connector.ConnectedObject.GetType() == typeof(Line))
1072
                            {
1073
                                Line line = connector.ConnectedObject as Line;
1074
                                if (!lines.Contains(line))
1075
                                    lines.Add(line);
1076

  
1077
                            }
1075 1078
                        }
1076 1079
                    }
1077
                }
1078 1080

  
1079
                if (lines.Count == 1 && !SPPIDUtil.IsBranchedLine(this, lines[0]) && SPPIDUtil.IsBranchLine(lines[0]))
1080
                {
1081
                    Line line = lines[0];
1082
                    if (line.TYPE == "Secondary" || line.TYPE == "Primary")
1081
                    if (lines.Count == 1 && !SPPIDUtil.IsBranchedLine(this, lines[0]) && SPPIDUtil.IsBranchLine(lines[0]))
1083 1082
                    {
1084
                        double startX = 0;
1085
                        double startY = 0;
1086
                        double endX = 0;
1087
                        double endY = 0;
1088
                        SPPIDUtil.ConvertPointBystring(line.STARTPOINT, ref startX, ref startY);
1089
                        SPPIDUtil.ConvertPointBystring(line.ENDPOINT, ref endX, ref endY);
1090
                        SlopeType slopeType = SPPIDUtil.CalcSlope(startX, startY, endX, endY);
1091
                        if (slopeType == SlopeType.HORIZONTAL || slopeType == SlopeType.VERTICAL)
1083
                        Line line = lines[0];
1084
                        if (line.TYPE == "Secondary" || line.TYPE == "Primary")
1092 1085
                        {
1093
                            foreach (var symbol in group)
1086
                            double startX = 0;
1087
                            double startY = 0;
1088
                            double endX = 0;
1089
                            double endY = 0;
1090
                            SPPIDUtil.ConvertPointBystring(line.STARTPOINT, ref startX, ref startY);
1091
                            SPPIDUtil.ConvertPointBystring(line.ENDPOINT, ref endX, ref endY);
1092
                            SlopeType slopeType = SPPIDUtil.CalcSlope(startX, startY, endX, endY);
1093
                            if (slopeType == SlopeType.HORIZONTAL || slopeType == SlopeType.VERTICAL)
1094 1094
                            {
1095
                                if (!VentDrainSymbol.Contains(symbol))
1096
                                    VentDrainSymbol.Add(symbol);
1095
                                foreach (var symbol in group)
1096
                                {
1097
                                    if (!VentDrainSymbol.Contains(symbol))
1098
                                        VentDrainSymbol.Add(symbol);
1099
                                }
1100
                                if (!VentDrainLine.Contains(lines[0]))
1101
                                    VentDrainLine.Add(lines[0]);
1097 1102
                            }
1098
                            if (!VentDrainLine.Contains(lines[0]))
1099
                                VentDrainLine.Add(lines[0]);
1100 1103
                        }
1101 1104
                    }
1102 1105
                }

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)