프로젝트

일반

사용자정보

개정판 5a9396ae

ID5a9396ae3560b806a28b9e5399a0556e3891f74a
상위 3b10b29d
하위 af725313

백흠경이(가) 5년 이상 전에 추가함

issue #366: SPPID 변환 - AutoModeling에 IDisposable 구현

Change-Id: Ie0ec49757b6dfdedce7b2f5f35d44e7e8ce7b8ed

차이점 보기:

DTI_PID/SPPIDConverter/AutoModeling.cs
24 24
using DevExpress.XtraSplashScreen;
25 25
namespace Converter.SPPID
26 26
{
27
    public class AutoModeling
27
    public class AutoModeling : IDisposable
28 28
    {
29 29
        Placement _placement;
30 30
        LMADataSource dataSource;
......
164 164
                GC.Collect();
165 165
            }
166 166
        }
167

  
167 168
        private void RunEquipmentModeling()
168 169
        {
169 170
            SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllProgress, document.Equipments.Count);
......
184 185
                }
185 186
            }
186 187
        }
188

  
187 189
        private void RunSymbolModeling()
188 190
        {
189 191
            SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllProgress, document.SYMBOLS.Count);
......
822 824
        /// <summary>
823 825
        /// 심볼을 실제로 Modeling 메서드
824 826
        /// </summary>
825
        /// <param name="symbol"></param>
826
        /// <param name="targetSymbol"></param>
827
        /// <param name="prevSymbol"></param>
827
        /// <param name="symbol">생성할 심볼</param>
828
        /// <param name="targetSymbol">연결되어 있는 심볼</param>
828 829
        private void SymbolModeling(Symbol symbol, Symbol targetSymbol)
829 830
        {
830 831
            // OWNERSYMBOL Attribute, 값을 가지고 있을 경우
......
856 857

  
857 858
            if (targetSymbol != null && !string.IsNullOrEmpty(targetSymbol.SPPID.RepresentationId))
858 859
            {
859
                LMSymbol _TargetItem = dataSource.GetSymbol(targetSymbol.SPPID.RepresentationId);
860
                LMSymbol _TargetItem = dataSource.GetSymbol(targetSymbol.SPPID.RepresentationId);   /// RepresentationId로 SPPID 심볼을 찾음
860 861
                Connector connector = SPPIDUtil.FindSymbolConnectorByUID(document, symbol.UID, targetSymbol);
861 862
                if (connector != null)
862 863
                    GetTargetSymbolConnectorPoint(connector, targetSymbol, ref x, ref y);
......
1390 1391
        /// <param name="symbol"></param>
1391 1392
        private void SymbolModelingBySymbol(Symbol symbol)
1392 1393
        {
1393
            SymbolModeling(symbol, null);
1394
            SymbolModeling(symbol, null);   /// 심볼을 생성한다
1394 1395
            List<object> endObjects = new List<object>();
1395 1396
            endObjects.Add(symbol);
1396 1397

  
1398
            /// 심볼에 연결되어 있는 항목들을 모델링한다
1397 1399
            foreach (var connector in symbol.CONNECTORS)
1398 1400
            {
1399 1401
                object connItem = SPPIDUtil.FindObjectByUID(document, connector.CONNECTEDITEM);
......
4114 4116
                }
4115 4117
            }
4116 4118
        }
4119

  
4120
        /// IDisposable 구현
4121
        ~AutoModeling()
4122
        {
4123
            this.Dispose(false);
4124
        }
4125

  
4126
        private bool disposed;
4127
        public void Dispose()
4128
        {
4129
            this.Dispose(true);
4130
            GC.SuppressFinalize(this);
4131
        }
4132

  
4133
        protected virtual void Dispose(bool disposing)
4134
        {
4135
            if (this.disposed) return;
4136
            if (disposing)
4137
            {
4138
                // IDisposable 인터페이스를 구현하는 멤버들을 여기서 정리합니다.
4139
            }
4140
            // .NET Framework에 의하여 관리되지 않는 외부 리소스들을 여기서 정리합니다.
4141
            this.disposed = true;
4142
        }
4117 4143
    }
4118 4144
}
DTI_PID/SPPIDConverter/ConverterDocking.cs
47 47
            }
48 48
        }
49 49

  
50
        /// <summary>
51
        /// 선택한 도면들을 읽어서 SPPID로 변환한다.
52
        /// </summary>
53
        /// <param name="sender"></param>
54
        /// <param name="e"></param>
50 55
        private void btnConverter_Click(object sender, EventArgs e)
51 56
        {
52 57
            ConverterForm converterForm = new ConverterForm();
......
65 70
                            WrapperApplication wApp = new WrapperApplication(application.Application);
66 71
                            Ingr.RAD2D.Application radApp = wApp.RADApplication;
67 72

  
68
                            AutoModeling modeling = new AutoModeling(document, application, radApp, converterForm.checkEditCloseDocument.Checked);
69
                            modeling.DocumentLabelText = string.Format("Drawing Name : {0} ({1}/{2})", document.DrawingName, i + 1, converterForm.Documents.Count);
70
                            modeling.Run();
71

  
73
                            using (AutoModeling modeling = new AutoModeling(document, application, radApp, converterForm.checkEditCloseDocument.Checked))
74
                            {
75
                                modeling.DocumentLabelText = string.Format("Drawing Name : {0} ({1}/{2})", document.DrawingName, i + 1, converterForm.Documents.Count);
76
                                modeling.Run();
77
                            }
72 78
                            ReleaseCOMObjects(application);
73 79
                        }
74 80
                    }
DTI_PID/SPPIDConverter/ConverterForm.cs
559 559
            }
560 560
        }
561 561

  
562
        /// <summary>
563
        /// 선택한 도면의 정보를 로딩한다
564
        /// </summary>
565
        /// <param name="sender"></param>
566
        /// <param name="e"></param>
562 567
        private void btnRun_Click(object sender, EventArgs e)
563 568
        {
564 569
            Project_Info _ProjectInfo = Project_Info.GetInstance();
......
575 580
                return;
576 581
            }
577 582
             
578
            _Documents.Clear();
583
            this._Documents.Clear();
579 584
            foreach (int rowHandle in gridViewConverter.GetSelectedRows())
580 585
            {
581 586
                string _FilePath = gridViewConverter.GetRowCellDisplayText(rowHandle, "colDrawingFilePath");
......
599 604
                document.SetSPPIDInfo();
600 605

  
601 606
                if (document.SetSPPIDMapping() && document.Enable)
602
                    _Documents.Add(document);
607
                    this._Documents.Add(document);
603 608
            }
604 609

  
605 610
            DialogResult = DialogResult.OK;
DTI_PID/SPPIDConverter/Util/SPPIDUtil.cs
617 617

  
618 618
            return result;
619 619
        }
620

  
620 621
        public static bool IsSegmentLine(Document document, Symbol symbol1, Symbol symbol2)
621 622
        {
622 623
            bool result = false;

내보내기 Unified diff

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