개정판 7a01d2c1
dev issue #000 : edit logic
DTI_PID/SPPIDConverter_AutoModeling/MainControl2.cs | ||
---|---|---|
386 | 386 |
{ |
387 | 387 |
try |
388 | 388 |
{ |
389 |
|
|
390 |
|
|
391 | 389 |
string sStatus = gridViewConverter.GetRowCellDisplayText(rowHandle, "colStatus"); |
392 | 390 |
|
393 | 391 |
if (sStatus == _Ready && !ProgressForm.stop) |
... | ... | |
409 | 407 |
Thread.Sleep(100); |
410 | 408 |
// |
411 | 409 |
|
410 |
|
|
411 |
|
|
412 | 412 |
Document document = dicDocument[gridViewConverter.GetRowCellDisplayText(rowHandle, "colUID")]; |
413 | 413 |
autoModelingThread = new Thread(Func => |
414 | 414 |
{ |
DTI_PID/SPPIDConverter_AutoModeling/Model/SPPID/Document.cs | ||
---|---|---|
73 | 73 |
doc.SetText(xml.Element("TEXTINFOS")); |
74 | 74 |
doc.SetTrimLine(xml.Element("TRIMLINENOS")); |
75 | 75 |
doc.SetNote(xml.Element("NOTES")); |
76 |
doc.SetLineAttributeToSymbol(xml.Element("LINENOS")); |
|
76 | 77 |
|
77 | 78 |
doc.SetGrouping(); |
78 | 79 |
|
... | ... | |
308 | 309 |
Log.WriteLine(ex); |
309 | 310 |
} |
310 | 311 |
} |
312 |
|
|
313 |
private void SetLineAttributeToSymbol(XElement node) |
|
314 |
{ |
|
315 |
try |
|
316 |
{ |
|
317 |
foreach (XElement lineNoElement in node.Elements("LINE_NO")) |
|
318 |
{ |
|
319 |
try |
|
320 |
{ |
|
321 |
string LineNoUID = lineNoElement.Element("UID").Value; |
|
322 |
LineNumber lineNumber = SPPIDUtill.FindObjectByUID(this, LineNoUID) as LineNumber; |
|
323 |
if (lineNumber != null) |
|
324 |
{ |
|
325 |
foreach (XElement runElement in lineNoElement.Elements("RUN")) |
|
326 |
{ |
|
327 |
foreach (XElement lineElement in runElement.Elements("LINE")) |
|
328 |
{ |
|
329 |
Line line = SPPIDUtill.FindObjectByUID(this, lineElement.Element("UID").Value) as Line; |
|
330 |
if (line != null) |
|
331 |
line.ATTRIBUTES = lineNumber.ATTRIBUTES; |
|
332 |
} |
|
333 |
foreach (XElement symbolElement in runElement.Elements("SYMBOL")) |
|
334 |
{ |
|
335 |
Symbol symbol = SPPIDUtill.FindObjectByUID(this, symbolElement.Element("UID").Value) as Symbol; |
|
336 |
if (symbol != null) |
|
337 |
{ |
|
338 |
foreach (ItemAttribute attribute in lineNumber.ATTRIBUTES) |
|
339 |
{ |
|
340 |
ItemAttribute findAttribute = symbol.ATTRIBUTES.Find(x => x.Attribute == attribute.Attribute); |
|
341 |
if (findAttribute == null) |
|
342 |
symbol.ATTRIBUTES.Add(attribute); |
|
343 |
} |
|
344 |
} |
|
345 |
} |
|
346 |
} |
|
347 |
} |
|
348 |
} |
|
349 |
catch (Exception ex) |
|
350 |
{ |
|
351 |
Log.WriteLine(ex); |
|
352 |
} |
|
353 |
} |
|
354 |
} |
|
355 |
catch (Exception ex) |
|
356 |
{ |
|
357 |
Log.WriteLine(ex); |
|
358 |
} |
|
359 |
} |
|
311 | 360 |
#endregion |
312 | 361 |
|
313 | 362 |
#region Connector, Association, Attribute |
... | ... | |
367 | 416 |
AttrAt = item.Attribute("AttrAt").Value, |
368 | 417 |
VALUE = item.Value, |
369 | 418 |
}; |
419 |
if (string.IsNullOrEmpty(attribute.VALUE) || attribute.VALUE == "None") |
|
420 |
attribute.VALUE = string.Empty; |
|
370 | 421 |
attribute.SPPIDMAPPINGNAME = SPPIDUtill.GetSPPIDAttributeMappingName(attribute.Attribute, AttributeMapping); |
371 | 422 |
attributes.Add(attribute); |
372 | 423 |
} |
DTI_PID/SPPIDConverter_AutoModeling/Model/SPPID/Line.cs | ||
---|---|---|
73 | 73 |
|
74 | 74 |
public override void SetAttribute(Document document) |
75 | 75 |
{ |
76 |
throw new NotImplementedException(); |
|
76 |
try |
|
77 |
{ |
|
78 |
Placement _placement = new Placement(); |
|
79 |
if (SPPID_ITEM_OBJECT != null) |
|
80 |
{ |
|
81 |
foreach (ItemAttribute attribute in ATTRIBUTES) |
|
82 |
{ |
|
83 |
if (string.IsNullOrEmpty(attribute.VALUE)) |
|
84 |
continue; |
|
85 |
|
|
86 |
LMPipeRun _LMPipeRun = _placement.PIDDataSource.GetPipeRun(SPPID_ITEM_OBJECT.ToString()); |
|
87 |
if (_LMPipeRun != null) |
|
88 |
{ |
|
89 |
string sppidAttribute = SPPIDUtill.GetSPPIDAttributeMappingName(attribute.Attribute, document.AttributeMapping); |
|
90 |
if (!string.IsNullOrEmpty(sppidAttribute)) |
|
91 |
{ |
|
92 |
LMAAttribute _LMAAttribute = _LMPipeRun.Attributes[sppidAttribute]; |
|
93 |
if (_LMAAttribute != null) |
|
94 |
{ |
|
95 |
_LMAAttribute.set_Value(attribute.VALUE); |
|
96 |
_LMPipeRun.Commit(); |
|
97 |
} |
|
98 |
} |
|
99 |
} |
|
100 |
} |
|
101 |
} |
|
102 |
} |
|
103 |
catch (Exception ex) |
|
104 |
{ |
|
105 |
|
|
106 |
} |
|
77 | 107 |
} |
78 | 108 |
|
79 | 109 |
public static void SetAttribute(Line line, string attrName, string value) |
DTI_PID/SPPIDConverter_AutoModeling/Modeling/AutoModeling.cs | ||
---|---|---|
85 | 85 |
ProgressForm.SetProgressStatusMax(); |
86 | 86 |
ProgressForm.IncreaseProgressAll(); |
87 | 87 |
System.Threading.Thread.Sleep(100); |
88 |
// End |
|
88 | 89 |
|
89 | 90 |
// SprecBreak Modeling |
90 | 91 |
ProgressForm.UpdateStatus("Spec Break Modeling"); |
... | ... | |
112 | 113 |
ProgressForm.SetProgressStatusMax(); |
113 | 114 |
ProgressForm.IncreaseProgressAll(); |
114 | 115 |
System.Threading.Thread.Sleep(100); |
115 |
|
|
116 |
// End |
|
116 | 117 |
|
117 | 118 |
// Text Modeling |
118 | 119 |
ProgressForm.UpdateStatus("Text Modeling"); |
... | ... | |
134 | 135 |
ProgressForm.SetProgressStatusMax(); |
135 | 136 |
ProgressForm.IncreaseProgressAll(); |
136 | 137 |
System.Threading.Thread.Sleep(100); |
138 |
// End |
|
139 |
|
|
140 |
//// Line Number Attribute Modeling |
|
141 |
//ProgressForm.UpdateStatus("Input Line Number Attribute"); |
|
142 |
//ProgressForm.SetProgressStatusValue(0); |
|
143 |
//ProgressForm.SetProgressStatusMax(document.LINENUMBERS.Count); |
|
144 |
//foreach (LineNumber lineNumber in document.LINENUMBERS) |
|
145 |
//{ |
|
146 |
// lineNumber.SetAttribute(document); |
|
147 |
|
|
148 |
// ProgressForm.IncreaseProgressStatus(); |
|
149 |
//} |
|
150 |
//ProgressForm.SetProgressStatusMax(); |
|
151 |
//ProgressForm.IncreaseProgressAll(); |
|
152 |
//System.Threading.Thread.Sleep(100); |
|
153 |
//// End |
|
154 |
|
|
155 |
// Line Number Attribute Modeling |
|
156 |
ProgressForm.UpdateStatus("Input Line Number Attribute"); |
|
157 |
ProgressForm.SetProgressStatusValue(0); |
|
158 |
ProgressForm.SetProgressStatusMax(document.LINES.Count); |
|
159 |
foreach (Line line in document.LINES) |
|
160 |
{ |
|
161 |
line.SetAttribute(document); |
|
137 | 162 |
|
163 |
ProgressForm.IncreaseProgressStatus(); |
|
164 |
} |
|
165 |
ProgressForm.SetProgressStatusMax(); |
|
166 |
ProgressForm.IncreaseProgressAll(); |
|
167 |
System.Threading.Thread.Sleep(100); |
|
168 |
// End |
|
138 | 169 |
|
139 | 170 |
// attribute |
140 | 171 |
ProgressForm.UpdateStatus("Input Symbol Attribute"); |
... | ... | |
152 | 183 |
ProgressForm.SetProgressStatusMax(); |
153 | 184 |
ProgressForm.IncreaseProgressAll(); |
154 | 185 |
System.Threading.Thread.Sleep(100); |
186 |
// End |
|
155 | 187 |
|
156 |
// Line Number Attribute Modeling |
|
157 |
ProgressForm.UpdateStatus("Input Line Number Attribute"); |
|
158 |
ProgressForm.SetProgressStatusValue(0); |
|
159 |
ProgressForm.SetProgressStatusMax(document.LINENUMBERS.Count); |
|
160 |
foreach (LineNumber lineNumber in document.LINENUMBERS) |
|
161 |
{ |
|
162 |
lineNumber.SetAttribute(document); |
|
163 |
|
|
164 |
ProgressForm.IncreaseProgressStatus(); |
|
165 |
} |
|
166 |
ProgressForm.SetProgressStatusMax(); |
|
167 |
ProgressForm.IncreaseProgressAll(); |
|
168 |
System.Threading.Thread.Sleep(100); |
|
169 | 188 |
CloseOPCForm.Stop(); |
170 |
|
|
171 | 189 |
// |
172 | 190 |
//Log.WriteLine(new ListBoxItem(string.Format("Time : {0}", ts), Color.Black), logListBox); |
173 | 191 |
} |
DTI_PID/SPPIDConverter_DialogBarWrapper/SPPIDConverterDialogBarWrapper.cs | ||
---|---|---|
162 | 162 |
control.Parent.Dock = DockStyle.Fill; |
163 | 163 |
control.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top; |
164 | 164 |
control.Parent.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top; |
165 |
|
|
166 |
//control.Anchor = AnchorStyles. |
|
167 | 165 |
} |
168 | 166 |
} |
169 | 167 |
catch (Exception ex) |
내보내기 Unified diff