프로젝트

일반

사용자정보

개정판 d9fc7084

IDd9fc7084cf50080ffe775801f054893d939563ab
상위 783f8357
하위 5aec8987

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

dev issue #507 : fix bug

Change-Id: I523b18358150e09d0af16db174fe7dab3402afa1

차이점 보기:

DTI_PID/SPPIDConverter/AutoModeling.cs
88 88
                    Log.Write("Start Modeling");
89 89
                    SplashScreenManager.ShowForm(typeof(SPPIDSplashScreen), true, true);
90 90
                    SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetParent, (IntPtr)radApp.HWnd);
91
                    SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllStepCount, 21);
91
                    SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllStepCount, 20);
92 92
                    SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetDocumentName, DocumentLabelText);
93 93

  
94 94
                    // Equipment Modeling
......
99 99
                    RunLineModeling();
100 100
                    // Clear Attribute
101 101
                    RunClearNominalDiameter();
102
                    // Clear Attribute
103
                    RunClearValueInconsistancy();
102
                    //// Clear Attribute
103
                    //RunClearValueInconsistancy();
104 104
                    // EndBreak Modeling
105 105
                    RunEndBreakModeling();
106 106
                    // SpecBreak Modeling
......
539 539
            SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "PipeRun Join - 1");
540 540
            foreach (var line in document.LINES)
541 541
            {
542
                if (!SPPIDUtil.IsSegmentLine(document, line))
542
                foreach (var connector in line.CONNECTORS)
543 543
                {
544
                    foreach (var connector in line.CONNECTORS)
544
                    if (connector.ConnectedObject != null &&
545
                        connector.ConnectedObject.GetType() == typeof(Line) &&
546
                        !SPPIDUtil.IsBranchLine(line, connector.ConnectedObject as Line))
545 547
                    {
546
                        if (connector.ConnectedObject != null &&
547
                            connector.ConnectedObject.GetType() == typeof(Line) &&
548
                            !SPPIDUtil.IsBranchLine(line, connector.ConnectedObject as Line))
548
                        Line connLine = connector.ConnectedObject as Line;
549
                        if (line.SPPID.ModelItemId != connLine.SPPID.ModelItemId &&
550
                            !string.IsNullOrEmpty(line.SPPID.ModelItemId) &&
551
                            !string.IsNullOrEmpty(connLine.SPPID.ModelItemId) &&
552
                            !SPPIDUtil.IsSegment(document, line, connLine))
549 553
                        {
550
                            Line connLine = connector.ConnectedObject as Line;
551
                            if (line.SPPID.ModelItemId != connLine.SPPID.ModelItemId && !string.IsNullOrEmpty(line.SPPID.ModelItemId) && !string.IsNullOrEmpty(connLine.SPPID.ModelItemId))
552
                            {
553
                                string survivorId = string.Empty;
554
                                JoinRun(connLine.SPPID.ModelItemId, line.SPPID.ModelItemId, ref survivorId);
555
                            }
556
                                
554
                            string survivorId = string.Empty;
555
                            JoinRun(connLine.SPPID.ModelItemId, line.SPPID.ModelItemId, ref survivorId);
557 556
                        }
557

  
558 558
                    }
559 559
                }
560 560
                SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.UpProgress, null);
......
1064 1064
                {
1065 1065
                    symbol.SPPID.RepresentationId = _LMSymbol.AsLMRepresentation().Id;
1066 1066

  
1067
                    if (SPPIDUtil.IsSegmentLine(document, symbol, targetSymbol))
1067
                    if (SPPIDUtil.IsSegment(document, symbol, targetSymbol))
1068 1068
                    {
1069 1069
                        LMConnector reModelingConnector = FindBreakLineTarget(symbol, targetSymbol);
1070 1070
                        if (reModelingConnector != null)
DTI_PID/SPPIDConverter/ConverterDocking.cs
213 213
        #region TEST
214 214
        private void simpleButton1_Click(object sender, EventArgs e)
215 215
        {
216
            DependencyObject aa = application.ActiveSelectSet[0] as DependencyObject;
217
            double mx = 0;
218
            double my = 0;
219
            double x = 0;
220
            double y = 0;
221
            aa.Range(out mx, out my, out x, out y);
222

  
216
            foreach (RADObject item in application.ActiveDocument.ActiveSheet.DrawingObjects)
217
            {
218
                DependencyObject dependencyObject = item as DependencyObject;
219
                if (dependencyObject != null)
220
                {
221
                    foreach (var attributes in dependencyObject.AttributeSets)
222
                    {
223
                        foreach (var attribute in attributes)
224
                        {
225
                            if (!DBNull.Value.Equals(attribute.GetValue()) && attribute.GetValue() != null && attribute.GetValue().ToString() == "40E2CDE9781940089C37258D37FA3BCD")
226
                            {
227
                                application.ActiveSelectSet.Add(item);
228
                            }
229
                        }
230
                    }
231
                }
232
            }
223 233

  
224 234
            return;
225 235
            Thread outThread = new Thread(func2 =>
DTI_PID/SPPIDConverter/Util/SPPIDUtil.cs
577 577
            return bStart;
578 578
        }
579 579

  
580
        public static bool IsSegmentLine(Document document, Line line)
580
        public static bool IsSegment(Document document, Line line1, Line line2)
581 581
        {
582 582
            bool result = false;
583 583

  
584 584
            SpecBreak specBreak = document.SpecBreaks.Find(x =>
585
                x.DownStreamUID == line.UID || x.UpStreamUID == line.UID);
585
                (x.DownStreamUID == line1.UID && x.UpStreamUID == line2.UID) || 
586
                (x.DownStreamUID == line2.UID && x.UpStreamUID == line1.UID));
586 587

  
587 588
            EndBreak endBreak = document.EndBreaks.Find(x =>
588
            x.OWNER == line.UID || x.PROPERTIES.Find(y => y.ATTRIBUTE == "Connected Item").VALUE == line.UID);
589
            (x.OWNER == line1.UID && x.PROPERTIES.Find(y => y.ATTRIBUTE == "Connected Item").VALUE == line2.UID) ||
590
            (x.OWNER == line2.UID && x.PROPERTIES.Find(y => y.ATTRIBUTE == "Connected Item").VALUE == line1.UID));
589 591

  
590 592
            if (specBreak != null || endBreak != null)
591 593
                result = true;
......
593 595
            return result;
594 596
        }
595 597

  
596
        public static bool IsSegmentLineOnlyTarget(Document document, Line line)
597
        {
598
            bool result = false;
599

  
600
            SpecBreak specBreak = document.SpecBreaks.Find(x =>
601
                x.UpStreamUID == line.UID);
602

  
603
            EndBreak endBreak = document.EndBreaks.Find(x =>
604
            x.OWNER == line.UID);
605

  
606
            if (specBreak != null || endBreak != null)
607
                result = true;
608

  
609
            return result;
610
        }
611

  
612
        public static bool IsSegmentLine(Document document, Line line1, Line line2)
613
        {
614
            bool result = false;
615
            SpecBreak startSpecBreak = document.SpecBreaks.Find(x =>
616
            (x.DownStreamUID == line1.UID || x.UpStreamUID == line1.UID) &&
617
            (x.DownStreamUID == line2.UID || x.UpStreamUID == line2.UID));
618

  
619
            EndBreak startEndBreak = document.EndBreaks.Find(x =>
620
            (x.OWNER == line1.UID || x.PROPERTIES.Find(y => y.ATTRIBUTE == "Connected Item").VALUE == line1.UID) &&
621
            (x.OWNER == line2.UID || x.PROPERTIES.Find(y => y.ATTRIBUTE == "Connected Item").VALUE == line2.UID));
622

  
623
            if (startSpecBreak != null || startEndBreak != null)
624
                result = true;
625

  
626
            return result;
627
        }
628

  
629
        public static bool IsSegmentLine(Document document, Symbol symbol1, Symbol symbol2)
598
        public static bool IsSegment(Document document, Symbol symbol1, Symbol symbol2)
630 599
        {
631 600
            bool result = false;
632 601
            SpecBreak startSpecBreak = document.SpecBreaks.Find(x =>
633
            (x.DownStreamUID == symbol1.UID || x.UpStreamUID == symbol1.UID) &&
634
            (x.DownStreamUID == symbol2.UID || x.UpStreamUID == symbol2.UID));
602
            (x.DownStreamUID == symbol1.UID && x.UpStreamUID == symbol2.UID) ||
603
            (x.DownStreamUID == symbol2.UID && x.UpStreamUID == symbol1.UID));
635 604

  
636 605
            EndBreak startEndBreak = document.EndBreaks.Find(x =>
637
            (x.OWNER == symbol1.UID || x.PROPERTIES.Find(y => y.ATTRIBUTE == "Connected Item").VALUE == symbol1.UID) &&
638
            (x.OWNER == symbol2.UID || x.PROPERTIES.Find(y => y.ATTRIBUTE == "Connected Item").VALUE == symbol2.UID));
606
            (x.OWNER == symbol1.UID && x.PROPERTIES.Find(y => y.ATTRIBUTE == "Connected Item").VALUE == symbol2.UID) ||
607
            (x.OWNER == symbol2.UID && x.PROPERTIES.Find(y => y.ATTRIBUTE == "Connected Item").VALUE == symbol1.UID));
639 608

  
640 609
            if (startSpecBreak != null || startEndBreak != null)
641 610
                result = true;

내보내기 Unified diff

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