개정판 71ba1ca3
dev issue #000 : fix bug
Change-Id: I254e19b9c8f4ca7d618d9542c0190bb47fa87edc
DTI_PID/SPPIDConverter/AutoModeling_OPC.cs | ||
---|---|---|
32 | 32 |
dynamic application; |
33 | 33 |
Ingr.RAD2D.Application radApp; |
34 | 34 |
List<SPPID_Document> allDocuments; |
35 |
DataTable drawingTable; |
|
35 | 36 |
|
36 |
public AutoModeling_OPC(List<SPPID_Document> allDocuments, dynamic application, Ingr.RAD2D.Application radApp) |
|
37 |
public AutoModeling_OPC(List<SPPID_Document> allDocuments, dynamic application, Ingr.RAD2D.Application radApp, DataTable drawingTable)
|
|
37 | 38 |
{ |
38 | 39 |
this.application = application; |
39 | 40 |
this.radApp = radApp; |
40 | 41 |
this.allDocuments = allDocuments; |
42 |
this.drawingTable = drawingTable; |
|
41 | 43 |
} |
42 | 44 |
|
43 | 45 |
public void Run() |
... | ... | |
75 | 77 |
if (!result) |
76 | 78 |
{ |
77 | 79 |
// OPC Pair 찾아서 도면 오픈후 Pair 모델링 |
78 |
OpenDrawing("");
|
|
79 |
}
|
|
80 |
BaseModel.Attribute pathAttribute = opc.ATTRIBUTES.Find(x => x.ATTRIBUTE == "PATH");
|
|
81 |
BaseModel.Attribute linkOPCAttribute = opc.ATTRIBUTES.Find(x => x.ATTRIBUTE == "LinkOPC");
|
|
80 | 82 |
|
81 |
|
|
82 |
|
|
83 |
DataRow[] rows = drawingTable.Select(string.Format("PATH = '{0}'", pathAttribute.VALUE)); |
|
84 |
if (rows.Length == 1 && OpenDrawing(rows[0]["DRAWINGNAME"].ToString())) |
|
85 |
{ |
|
86 |
|
|
87 |
} |
|
88 |
} |
|
83 | 89 |
|
84 | 90 |
ReleaseCOMObjects(_LMOPC); |
85 | 91 |
ReleaseCOMObjects(pairOPC); |
... | ... | |
95 | 101 |
} |
96 | 102 |
} |
97 | 103 |
|
98 |
private void OpenDrawing(string drawingName)
|
|
104 |
private bool OpenDrawing(string drawingName)
|
|
99 | 105 |
{ |
100 |
dynamic doc = application.Drawings.OpenDrawing(drawingName); |
|
101 |
doc.Activate(); |
|
106 |
bool result = false; |
|
107 |
try |
|
108 |
{ |
|
109 |
|
|
110 |
|
|
111 |
//dynamic doc = application.Drawings.OpenDrawing(drawingName); |
|
112 |
//doc.Activate(); |
|
113 |
|
|
114 |
result = true; |
|
115 |
} |
|
116 |
catch (Exception ex) |
|
117 |
{ |
|
118 |
System.Windows.Forms.MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); |
|
119 |
} |
|
102 | 120 |
|
121 |
return result; |
|
103 | 122 |
} |
104 | 123 |
} |
105 | 124 |
} |
내보내기 Unified diff