개정판 5a9396ae
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 |
} |
내보내기 Unified diff