개정판 30ba9ae0
dev issue #000 : fix Log && ValidationCheck
Change-Id: I1a2436b89fd7d74081a481a0ce8e2c9eb999a859
DTI_PID/SPPIDConverter/AutoModeling.cs | ||
---|---|---|
120 | 120 |
RunInputSpecBreakAttribute(); |
121 | 121 |
// Label Symbol Modeling |
122 | 122 |
RunLabelSymbolModeling(); |
123 |
|
|
124 | 123 |
|
124 |
// Result Logging |
|
125 |
document.CheckModelingResult(); |
|
126 |
|
|
127 |
|
|
125 | 128 |
//// LineRun Line Join |
126 | 129 |
//SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Join LineRuns"); |
127 | 130 |
//foreach (LineNumber lineNumber in document.LINENUMBERS) |
... | ... | |
672 | 675 |
Log.Write(ex.StackTrace); |
673 | 676 |
} |
674 | 677 |
} |
675 |
|
|
678 |
|
|
676 | 679 |
/// <summary> |
677 | 680 |
/// 도면 생성 메서드 |
678 | 681 |
/// </summary> |
... | ... | |
1205 | 1208 |
} |
1206 | 1209 |
} |
1207 | 1210 |
|
1211 |
symbol.SPPID.RepresentationId = _LMLabelPresist.AsLMRepresentation().Id; |
|
1208 | 1212 |
_LMLabelPresist.Commit(); |
1209 | 1213 |
ReleaseCOMObjects(_LMLabelPresist); |
1210 | 1214 |
} |
... | ... | |
3091 | 3095 |
/// <param name="item"></param> |
3092 | 3096 |
private void InputSymbolAttribute(object targetItem, List<BaseModel.Attribute> targetAttributes) |
3093 | 3097 |
{ |
3094 |
|
|
3095 | 3098 |
// Object 아이템이 Symbol일 경우 Equipment일 경우 |
3096 | 3099 |
string sRep = null; |
3097 | 3100 |
if (targetItem.GetType() == typeof(Symbol)) |
... | ... | |
3112 | 3115 |
{ |
3113 | 3116 |
LMAAttribute _Attribute = _Attributes[mapping.SPPIDATTRIBUTENAME]; |
3114 | 3117 |
if (_Attribute != null) |
3118 |
{ |
|
3119 |
object associItem = SPPIDUtil.FindObjectByUID(document, item.ASSOCITEM); |
|
3120 |
if (associItem != null) |
|
3121 |
{ |
|
3122 |
if (associItem.GetType() == typeof(Text)) |
|
3123 |
{ |
|
3124 |
Text text = associItem as Text; |
|
3125 |
text.SPPID.RepresentationId = "Attribute"; |
|
3126 |
} |
|
3127 |
else if (associItem.GetType() == typeof(Note)) |
|
3128 |
{ |
|
3129 |
Note note = associItem as Note; |
|
3130 |
note.SPPID.RepresentationId = "Attribute"; |
|
3131 |
} |
|
3132 |
} |
|
3115 | 3133 |
_Attribute.set_Value(item.VALUE); |
3134 |
} |
|
3135 |
|
|
3116 | 3136 |
} |
3117 | 3137 |
} |
3118 | 3138 |
_LMModelItem.Commit(); |
... | ... | |
3357 | 3377 |
LMLabelPersist _LMLabelPersist = _placement.PIDPlaceLabel(mapping.SPPIDSYMBOLNAME, ref array, Rotation: text.ANGLE, LabeledItem: _LMSymbol.AsLMRepresentation(), IsLeaderVisible: mapping.LeaderLine); |
3358 | 3378 |
if (_LMLabelPersist != null) |
3359 | 3379 |
{ |
3380 |
text.SPPID.RepresentationId = _LMLabelPersist.AsLMRepresentation().Id; |
|
3360 | 3381 |
_LMLabelPersist.Commit(); |
3361 | 3382 |
ReleaseCOMObjects(_LMLabelPersist); |
3362 | 3383 |
} |
... | ... | |
3388 | 3409 |
LMLabelPersist _LMLabelPersist = _placement.PIDPlaceLabel(mapping.SPPIDSYMBOLNAME, ref array, Rotation: text.ANGLE, LabeledItem: connectedLMConnector.AsLMRepresentation(), IsLeaderVisible: mapping.LeaderLine); |
3389 | 3410 |
if (_LMLabelPersist != null) |
3390 | 3411 |
{ |
3412 |
text.SPPID.RepresentationId = _LMLabelPersist.AsLMRepresentation().Id; |
|
3391 | 3413 |
_LMLabelPersist.Commit(); |
3392 | 3414 |
ReleaseCOMObjects(_LMLabelPersist); |
3393 | 3415 |
} |
... | ... | |
3407 | 3429 |
CalcLabelLocation(ref x, ref y, text.SPPID.ORIGINAL_X, text.SPPID.ORIGINAL_Y, text.SPPIDLabelLocation, _ETCSetting.TextLocation); |
3408 | 3430 |
|
3409 | 3431 |
_LMSymbol = _placement.PIDPlaceSymbol(text.SPPID.MAPPINGNAME, x, y, Rotation: angle); |
3410 |
_LMSymbol.Commit(); |
|
3411 |
_LMItemNote = _placement.PIDDataSource.GetItemNote(_LMSymbol.ModelItemID); |
|
3412 |
_LMItemNote.Commit(); |
|
3413 |
_LMAAttribute = _LMItemNote.Attributes["Note.Body"]; |
|
3414 |
_LMAAttribute.set_Value(text.VALUE); |
|
3415 |
_LMItemNote.Commit(); |
|
3416 |
|
|
3417 |
if (_LMAAttribute != null) |
|
3418 |
ReleaseCOMObjects(_LMAAttribute); |
|
3419 |
if (_LMItemNote != null) |
|
3420 |
ReleaseCOMObjects(_LMItemNote); |
|
3432 |
if (_LMSymbol != null) |
|
3433 |
{ |
|
3434 |
_LMSymbol.Commit(); |
|
3435 |
_LMItemNote = _placement.PIDDataSource.GetItemNote(_LMSymbol.ModelItemID); |
|
3436 |
if (_LMItemNote != null) |
|
3437 |
{ |
|
3438 |
_LMItemNote.Commit(); |
|
3439 |
_LMAAttribute = _LMItemNote.Attributes["Note.Body"]; |
|
3440 |
if (_LMAAttribute != null) |
|
3441 |
{ |
|
3442 |
_LMAAttribute.set_Value(text.VALUE); |
|
3443 |
text.SPPID.RepresentationId = _LMSymbol.AsLMRepresentation().Id; |
|
3444 |
_LMItemNote.Commit(); |
|
3445 |
|
|
3446 |
if (_LMAAttribute != null) |
|
3447 |
ReleaseCOMObjects(_LMAAttribute); |
|
3448 |
if (_LMItemNote != null) |
|
3449 |
ReleaseCOMObjects(_LMItemNote); |
|
3450 |
} |
|
3451 |
} |
|
3452 |
} |
|
3421 | 3453 |
} |
3422 | 3454 |
if (_LMSymbol != null) |
3423 | 3455 |
ReleaseCOMObjects(_LMSymbol); |
... | ... | |
3441 | 3473 |
CalcLabelLocation(ref x, ref y, note.SPPID.ORIGINAL_X, note.SPPID.ORIGINAL_Y, note.SPPIDLabelLocation, _ETCSetting.NoteLocation); |
3442 | 3474 |
|
3443 | 3475 |
_LMSymbol = _placement.PIDPlaceSymbol(note.SPPID.MAPPINGNAME, x, y); |
3444 |
_LMSymbol.Commit(); |
|
3445 |
_LMItemNote = _placement.PIDDataSource.GetItemNote(_LMSymbol.ModelItemID); |
|
3446 |
_LMItemNote.Commit(); |
|
3447 |
_LMAAttribute = _LMItemNote.Attributes["Note.Body"]; |
|
3448 |
_LMAAttribute.set_Value(note.VALUE); |
|
3449 |
_LMItemNote.Commit(); |
|
3476 |
if (_LMSymbol != null) |
|
3477 |
{ |
|
3478 |
_LMSymbol.Commit(); |
|
3479 |
_LMItemNote = _placement.PIDDataSource.GetItemNote(_LMSymbol.ModelItemID); |
|
3480 |
if (_LMItemNote != null) |
|
3481 |
{ |
|
3482 |
_LMItemNote.Commit(); |
|
3483 |
_LMAAttribute = _LMItemNote.Attributes["Note.Body"]; |
|
3484 |
if (_LMAAttribute != null) |
|
3485 |
{ |
|
3486 |
_LMAAttribute.set_Value(note.VALUE); |
|
3487 |
note.SPPID.RepresentationId = _LMSymbol.AsLMRepresentation().Id; |
|
3488 |
_LMItemNote.Commit(); |
|
3489 |
} |
|
3490 |
} |
|
3491 |
} |
|
3450 | 3492 |
} |
3451 | 3493 |
|
3452 | 3494 |
if (_LMAAttribute != null) |
DTI_PID/SPPIDConverter/BaseModel/Document.cs | ||
---|---|---|
742 | 742 |
} |
743 | 743 |
#endregion |
744 | 744 |
|
745 |
#region Association Check |
|
746 |
foreach (var item in TEXTINFOS) |
|
747 |
{ |
|
748 |
if (item.ASSOCIATION) |
|
749 |
{ |
|
750 |
object owner = SPPIDUtil.FindObjectByUID(this, item.OWNER); |
|
751 |
if (owner == null) |
|
752 |
{ |
|
753 |
validationStringBuilder.AppendLine("Check text owner!"); |
|
754 |
validationStringBuilder.AppendLine("Text UID : " + item.UID); |
|
755 |
foreach (var associationItem in SYMBOLS.FindAll(x => x.ATTRIBUTES.Find(y => y.ASSOCITEM == item.UID) != null)) |
|
756 |
validationStringBuilder.AppendLine("Association UID : " + associationItem.UID); |
|
757 |
|
|
758 |
validationStringBuilder.AppendLine(); |
|
759 |
validationResult = true; |
|
760 |
} |
|
761 |
} |
|
762 |
} |
|
763 |
#endregion |
|
764 |
|
|
745 | 765 |
if (validationResult) |
746 | 766 |
{ |
747 | 767 |
_Enable = false; |
DTI_PID/SPPIDConverter/SPPIDModel/SPPID_Document.cs | ||
---|---|---|
487 | 487 |
|
488 | 488 |
return true; |
489 | 489 |
} |
490 |
|
|
491 |
public void CheckModelingResult() |
|
492 |
{ |
|
493 |
StringBuilder sb = new StringBuilder(); |
|
494 |
sb.AppendLine("Modeling Result"); |
|
495 |
foreach (var item in Equipments) |
|
496 |
{ |
|
497 |
if (string.IsNullOrEmpty(item.SPPID.RepresentationId)) |
|
498 |
sb.AppendLine("Fail Equipment Modeling UID : " + item.UID); |
|
499 |
} |
|
500 |
foreach (var item in SYMBOLS) |
|
501 |
{ |
|
502 |
if (string.IsNullOrEmpty(item.SPPID.RepresentationId)) |
|
503 |
sb.AppendLine("Fail Symbol Modeling UID : " + item.UID); |
|
504 |
foreach (var child in item.ChildSymbols) |
|
505 |
{ |
|
506 |
if (string.IsNullOrEmpty(item.SPPID.RepresentationId)) |
|
507 |
{ |
|
508 |
sb.AppendLine("Fail Child Symbol Modeling UID : " + item.UID); |
|
509 |
sb.AppendLine("Fail Child Symbol Name : " + child.NAME); |
|
510 |
} |
|
511 |
loop(child, item, sb); |
|
512 |
} |
|
513 |
} |
|
514 |
foreach (var item in LINES) |
|
515 |
{ |
|
516 |
if (string.IsNullOrEmpty(item.SPPID.ModelItemId)) |
|
517 |
sb.AppendLine("Fail Line Modeling UID : " + item.UID); |
|
518 |
} |
|
519 |
foreach (var item in LINENUMBERS) |
|
520 |
{ |
|
521 |
if (string.IsNullOrEmpty(item.SPPID.RepresentationId)) |
|
522 |
sb.AppendLine("Fail Line Number Modeling UID : " + item.UID); |
|
523 |
} |
|
524 |
foreach (var item in NOTES) |
|
525 |
{ |
|
526 |
if (string.IsNullOrEmpty(item.SPPID.RepresentationId)) |
|
527 |
sb.AppendLine("Fail Note Text Modeling UID : " + item.UID); |
|
528 |
} |
|
529 |
foreach (var item in TEXTINFOS) |
|
530 |
{ |
|
531 |
if (string.IsNullOrEmpty(item.SPPID.RepresentationId)) |
|
532 |
sb.AppendLine("Fail Text Modeling UID : " + item.UID); |
|
533 |
} |
|
534 |
foreach (var item in EndBreaks) |
|
535 |
{ |
|
536 |
if (string.IsNullOrEmpty(item.SPPID.RepresentationId)) |
|
537 |
sb.AppendLine("Fail End Break Modeling UID : " + item.UID); |
|
538 |
} |
|
539 |
foreach (var item in SpecBreaks) |
|
540 |
{ |
|
541 |
if (string.IsNullOrEmpty(item.SPPID.RepresentationId)) |
|
542 |
sb.AppendLine("Fail SpecBreak Modeling UID : " + item.UID); |
|
543 |
} |
|
544 |
sb.AppendLine("End Modeling Result"); |
|
545 |
Log.Write(sb.ToString()); |
|
546 |
} |
|
547 |
|
|
548 |
private void loop(ChildSymbol childLoop, Symbol item, StringBuilder sb) |
|
549 |
{ |
|
550 |
foreach (var childLoopLoop in childLoop.ChildSymbols) |
|
551 |
{ |
|
552 |
if (string.IsNullOrEmpty(item.SPPID.RepresentationId)) |
|
553 |
{ |
|
554 |
sb.AppendLine("Fail Child Symbol Modeling UID : " + item.UID); |
|
555 |
sb.AppendLine("Fail Child Symbol Name : " + childLoopLoop.NAME); |
|
556 |
} |
|
557 |
loop(childLoop, item, sb); |
|
558 |
} |
|
559 |
} |
|
490 | 560 |
} |
491 | 561 |
} |
DTI_PID/SPPIDConverter/Util/SPPIDUtil.cs | ||
---|---|---|
313 | 313 |
if (item.UID == UID) |
314 | 314 |
return item; |
315 | 315 |
} |
316 |
|
|
317 |
foreach (SpecBreak item in document.SpecBreaks) |
|
318 |
{ |
|
319 |
if (item.UID == UID) |
|
320 |
return item; |
|
321 |
} |
|
322 |
|
|
323 |
foreach (EndBreak item in document.EndBreaks) |
|
324 |
{ |
|
325 |
if (item.UID == UID) |
|
326 |
return item; |
|
327 |
} |
|
316 | 328 |
} |
317 | 329 |
|
318 | 330 |
return null; |
내보내기 Unified diff