프로젝트

일반

사용자정보

개정판 02a45794

ID02a45794afdad2923d6e043ba34c631f205e16c2
상위 c52c1783
하위 83b5c192

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

dev issue #1176 : ValidationCheck 항목 추가

Change-Id: I4fbad8a6095302f1b94d7e6021df95de699ab934

차이점 보기:

DTI_PID/SPPIDConverter/BaseModel/Document.cs
637 637
                }
638 638
                else
639 639
                {
640

  
640 641
                    bool result = false;
641 642
                    if (obj1.GetType() == typeof(Symbol) && obj2.GetType() == typeof(Symbol))
642 643
                    {
......
676 677
                        validationStringBuilder.AppendLine();
677 678
                        validationResult = true;
678 679
                    }
680

  
681
                    // Rule
682
                    if (!result)
683
                    {
684
                        if (obj1.GetType() == typeof(Line) && obj2.GetType() == typeof(Line))
685
                        {
686
                            Line line1 = obj1 as Line;
687
                            Line line2 = obj2 as Line;
688

  
689
                            Connector connector1 = line1.CONNECTORS.Find(x => x.ConnectedObject == line2);
690
                            Connector connector2 = line2.CONNECTORS.Find(x => x.ConnectedObject == line1);
691
                            if (connector1 != null && connector2 != null)
692
                            {
693
                                int connectorIndex = line1.CONNECTORS.IndexOf(connector1);
694
                                if (connectorIndex != 0 && !SPPIDUtil.IsBranchLine(line1))
695
                                    result = true;
696
                                else if (connectorIndex == 0 && !SPPIDUtil.IsBranchLine(line1) && SPPIDUtil.IsBranchLine(line2))
697
                                    result = true;
698

  
699
                                if (result)
700
                                {
701
                                    validationStringBuilder.AppendLine("Check Segment Rule!");
702
                                    validationStringBuilder.AppendLine("UID : " + item.UID);
703
                                    validationStringBuilder.AppendLine();
704
                                    validationResult = true;
705
                                }
706
                            }
707
                        }
708
                    }
679 709
                }
680 710
            }
681 711

  
......
731 761
                        validationStringBuilder.AppendLine();
732 762
                        validationResult = true;
733 763
                    }
764

  
765
                    // Rule
766
                    if (!result) 
767
                    {
768
                        if (obj1.GetType() == typeof(Line) && obj2.GetType() == typeof(Line))
769
                        {
770
                            Line line1 = obj1 as Line;
771
                            Line line2 = obj2 as Line;
772

  
773
                            Connector connector1 = line1.CONNECTORS.Find(x => x.ConnectedObject == line2);
774
                            Connector connector2 = line2.CONNECTORS.Find(x => x.ConnectedObject == line1);
775
                            if (connector1 != null && connector2 != null)
776
                            {
777
                                int connectorIndex = line1.CONNECTORS.IndexOf(connector1);
778
                                if (connectorIndex != 0 && !SPPIDUtil.IsBranchLine(line1))
779
                                    result = true;
780
                                else if (connectorIndex == 0 && !SPPIDUtil.IsBranchLine(line1) && SPPIDUtil.IsBranchLine(line2))
781
                                    result = true;
782

  
783
                                if (result)
784
                                {
785
                                    validationStringBuilder.AppendLine("Check Segment Rule!");
786
                                    validationStringBuilder.AppendLine("UID : " + item.UID);
787
                                    validationStringBuilder.AppendLine();
788
                                    validationResult = true;
789
                                }
790
                            }
791
                        }
792
                    }
734 793
                }
735 794
            }
736 795

  
737 796
            #endregion
738 797

  
739 798
            #region Check Flow Direction
799
            List<string[]> flowDirectionCheck = new List<string[]>();
740 800
            foreach (var line in LINES)
741 801
            {
742 802
                foreach (var connector in line.CONNECTORS)
......
748 808
                        Line connLine = connector.ConnectedObject as Line;
749 809
                        int lineIndex1 = line.CONNECTORS.IndexOf(connector);
750 810
                        int lineIndex2 = connLine.CONNECTORS.IndexOf(connLine.CONNECTORS.Find(x => x.ConnectedObject == line));
751
                        if (lineIndex1 == lineIndex2 && !SPPIDUtil.IsSegmentLine(this, line, connLine))
811
                        if (lineIndex1 == lineIndex2 && flowDirectionCheck.Find(x => (x[0] == line.UID || x[1] == connLine.UID) || (x[1] == line.UID || x[0] == connLine.UID)) == null)
752 812
                        {
753 813
                            validationStringBuilder.AppendLine("Check line flow direction!");
754 814
                            validationStringBuilder.AppendLine("UID : " + line.UID);
755 815
                            validationStringBuilder.AppendLine("UID : " + connLine.UID);
756 816
                            validationStringBuilder.AppendLine();
757 817
                            validationResult = true;
818
                            flowDirectionCheck.Add(new string[] { line.UID, connLine.UID });
758 819
                        }
759 820
                    }
760 821
                }

내보내기 Unified diff

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