개정판 a0e3dca4
dev issue #706 : Line modeling 수정 / ValidationCheck 추가 / 우선순위 Modeling 적용 / 에러 메시지 추가
Change-Id: I382716081a63a8fa2ac2b983ac7194c0c4b57ce7
DTI_PID/SPPIDConverter/BaseModel/Document.cs | ||
---|---|---|
60 | 60 |
public List<TrimLine> TRIMLINES { get => _TRIMLINES; set => _TRIMLINES = value; } |
61 | 61 |
public string PATH { get; set; } |
62 | 62 |
|
63 |
StringBuilder validationStringBuilder = new StringBuilder(); |
|
64 |
|
|
63 | 65 |
public Document(string xmlPath) |
64 | 66 |
{ |
67 |
validationStringBuilder.AppendLine("Document Path : " + xmlPath); |
|
68 |
validationStringBuilder.AppendLine(""); |
|
65 | 69 |
try |
66 | 70 |
{ |
67 | 71 |
if (xmlPath != null) |
... | ... | |
71 | 75 |
DWGNAME = xml.Element("DWGNAME").Value; |
72 | 76 |
SIZE = xml.Element("SIZE").Value; |
73 | 77 |
|
78 |
validationStringBuilder.AppendLine("Drawing Name : " + DWGNAME); |
|
79 |
validationStringBuilder.AppendLine(""); |
|
80 |
|
|
74 | 81 |
SetText(xml.Element("TEXTINFOS")); |
75 | 82 |
SetNote(xml.Element("NOTES")); |
76 | 83 |
SetSymbol(xml.Element("SYMBOLS")); |
... | ... | |
79 | 86 |
SetTrimLine(xml.Element("TRIMLINENOS")); |
80 | 87 |
|
81 | 88 |
SetAllConnectors(); |
82 |
|
|
89 |
ValidationCheck(); |
|
83 | 90 |
_Enable = true; |
84 | 91 |
} |
85 | 92 |
} |
... | ... | |
530 | 537 |
foreach (var connector in item.CONNECTORS) |
531 | 538 |
connector.ConnectedObject = SPPIDUtil.FindObjectByUID(this, connector.CONNECTEDITEM); |
532 | 539 |
} |
540 |
|
|
541 |
|
|
542 |
|
|
543 |
public void ValidationCheck() |
|
544 |
{ |
|
545 |
|
|
546 |
|
|
547 |
#region Connection Check |
|
548 |
foreach (var item in _SYMBOLS) |
|
549 |
{ |
|
550 |
foreach (var connector in item.CONNECTORS) |
|
551 |
{ |
|
552 |
if (connector.ConnectedObject != null && connector.ConnectedObject.GetType() == typeof(Line)) |
|
553 |
{ |
|
554 |
Line line = connector.ConnectedObject as Line; |
|
555 |
if (line.CONNECTORS.Find(x => x.ConnectedObject == item) == null) |
|
556 |
{ |
|
557 |
validationStringBuilder.AppendLine("Check connection!"); |
|
558 |
validationStringBuilder.AppendLine("Symbol UID : " + item.UID); |
|
559 |
validationStringBuilder.AppendLine("Line UID : " + line.UID); |
|
560 |
throw new Exception(validationStringBuilder.ToString()); |
|
561 |
} |
|
562 |
} |
|
563 |
|
|
564 |
if (connector.SCENECONNECTPOINT == connector.CONNECTPOINT) |
|
565 |
{ |
|
566 |
validationStringBuilder.AppendLine("Check Symbol SceneConnectPoint!"); |
|
567 |
validationStringBuilder.AppendLine("Symbol UID : " + item.UID); |
|
568 |
throw new Exception(validationStringBuilder.ToString()); |
|
569 |
} |
|
570 |
} |
|
571 |
} |
|
572 |
|
|
573 |
foreach (var item in _LINES) |
|
574 |
{ |
|
575 |
foreach (var connector in item.CONNECTORS) |
|
576 |
{ |
|
577 |
if (connector.ConnectedObject != null && connector.ConnectedObject.GetType() == typeof(Symbol)) |
|
578 |
{ |
|
579 |
Symbol symbol = connector.ConnectedObject as Symbol; |
|
580 |
if (symbol.CONNECTORS.Find(x => x.ConnectedObject == item) == null) |
|
581 |
{ |
|
582 |
validationStringBuilder.AppendLine("Check connection!"); |
|
583 |
validationStringBuilder.AppendLine("Symbol UID : " + symbol.UID); |
|
584 |
validationStringBuilder.AppendLine("Line UID : " + item.UID); |
|
585 |
throw new Exception(validationStringBuilder.ToString()); |
|
586 |
} |
|
587 |
} |
|
588 |
} |
|
589 |
} |
|
590 |
#endregion |
|
591 |
|
|
592 |
#region Symbol Size Check |
|
593 |
foreach (var item in _SYMBOLS) |
|
594 |
{ |
|
595 |
if (item.SIZE == "0,0") |
|
596 |
{ |
|
597 |
validationStringBuilder.AppendLine("Check symbol size!"); |
|
598 |
validationStringBuilder.AppendLine("Symbol UID : " + item.UID); |
|
599 |
throw new Exception(validationStringBuilder.ToString()); |
|
600 |
} |
|
601 |
} |
|
602 |
#endregion |
|
603 |
} |
|
533 | 604 |
} |
534 | 605 |
} |
내보내기 Unified diff