개정판 f2baa6a3
dev issue #000 : Child Symbol에 Line이 붙을 시 처리
Change-Id: I067b755cf176172cde2fc97ae7244969e25b795f
DTI_PID/SPPIDConverter/AutoModeling.cs | ||
---|---|---|
166 | 166 |
lines.Add(line); |
167 | 167 |
else |
168 | 168 |
{ |
169 |
LineModeling(lines); |
|
170 |
lines.Clear(); |
|
169 |
if (lines.Count > 0) |
|
170 |
{ |
|
171 |
LineModeling(lines); |
|
172 |
lines.Clear(); |
|
173 |
} |
|
171 | 174 |
lines.Add(line); |
172 | 175 |
} |
173 | 176 |
} |
... | ... | |
388 | 391 |
object connItem = SPPIDUtil.FindObjectByUID(document, line.CONNECTORS[0].CONNECTEDITEM); |
389 | 392 |
if (connItem != null && connItem.GetType() == typeof(Symbol)) |
390 | 393 |
{ |
391 |
_LMSymbol1 = dataSource.GetSymbol(((Symbol)connItem).SPPID.RepresentationId);
|
|
394 |
_LMSymbol1 = GetTargetSymbol(connItem as Symbol, line);
|
|
392 | 395 |
if (_LMSymbol1 != null) |
393 | 396 |
placeRunInputs.AddSymbolTarget(_LMSymbol1, line.SPPID.START_X, line.SPPID.START_Y); |
394 | 397 |
else |
... | ... | |
421 | 424 |
|
422 | 425 |
if (connItem != null && connItem.GetType() == typeof(Symbol)) |
423 | 426 |
{ |
424 |
_LMSymbol2 = dataSource.GetSymbol(((Symbol)connItem).SPPID.RepresentationId);
|
|
427 |
_LMSymbol2 = GetTargetSymbol(connItem as Symbol, line);
|
|
425 | 428 |
if (_LMSymbol2 != null) |
426 | 429 |
placeRunInputs.AddSymbolTarget(_LMSymbol2, line.SPPID.END_X, line.SPPID.END_Y); |
427 | 430 |
else |
... | ... | |
480 | 483 |
ReleaseCOMObjects(_LMAItem); |
481 | 484 |
} |
482 | 485 |
|
486 |
private LMSymbol GetTargetSymbol(Symbol symbol, Line line) |
|
487 |
{ |
|
488 |
LMSymbol _LMSymbol = null; |
|
489 |
foreach (var connector in symbol.CONNECTORS) |
|
490 |
{ |
|
491 |
if (connector.CONNECTEDITEM == line.UID) |
|
492 |
{ |
|
493 |
if (connector.Index == 0) |
|
494 |
_LMSymbol = dataSource.GetSymbol(symbol.SPPID.RepresentationId); |
|
495 |
else |
|
496 |
{ |
|
497 |
ChildSymbol child = null; |
|
498 |
foreach (var childSymbol in symbol.ChildSymbols) |
|
499 |
{ |
|
500 |
if (childSymbol.Connectors.Contains(connector)) |
|
501 |
child = childSymbol; |
|
502 |
else |
|
503 |
child = GetChildSymbolByConnector(childSymbol, connector); |
|
504 |
|
|
505 |
if (child != null) |
|
506 |
break; |
|
507 |
} |
|
508 |
|
|
509 |
if (child != null) |
|
510 |
_LMSymbol = dataSource.GetSymbol(child.SPPID.RepresentationId); |
|
511 |
} |
|
512 |
|
|
513 |
break; |
|
514 |
} |
|
515 |
} |
|
516 |
|
|
517 |
return _LMSymbol; |
|
518 |
} |
|
519 |
|
|
520 |
private ChildSymbol GetChildSymbolByConnector(ChildSymbol item, Connector connector) |
|
521 |
{ |
|
522 |
foreach (var childSymbol in item.ChildSymbols) |
|
523 |
{ |
|
524 |
if (childSymbol.Connectors.Contains(connector)) |
|
525 |
return childSymbol; |
|
526 |
else |
|
527 |
return GetChildSymbolByConnector(childSymbol, connector); |
|
528 |
} |
|
529 |
|
|
530 |
return null; |
|
531 |
} |
|
532 |
|
|
483 | 533 |
private void BranchLineModeling(Tuple<string, Line, Line> branch) |
484 | 534 |
{ |
485 | 535 |
List<Line> lines = SPPIDUtil.FindLinesByModelId(document, branch.Item1); |
... | ... | |
757 | 807 |
} |
758 | 808 |
} |
759 | 809 |
|
760 |
private bool ExistConnItem(LMPipeRun _LMPipeRun, string ConnItem) |
|
761 |
{ |
|
762 |
foreach (LMRepresentation rep in _LMPipeRun.Representations) |
|
763 |
{ |
|
764 |
if (rep.Attributes["RepresentationType"].get_Value() == "Connector" && rep.Attributes["ItemStatus"].get_Value() == "Active") |
|
765 |
{ |
|
766 |
LMConnector _LMConnector = dataSource.GetConnector(rep.Id); |
|
767 |
if (_LMConnector.ConnectItem1SymbolID != null && !DBNull.Value.Equals(_LMConnector.ConnectItem1SymbolID) && _LMConnector.ConnectItem1SymbolID == ConnItem) |
|
768 |
{ |
|
769 |
ReleaseCOMObjects(_LMConnector); |
|
770 |
return true; |
|
771 |
} |
|
772 |
else if (_LMConnector.ConnectItem2SymbolID != null && !DBNull.Value.Equals(_LMConnector.ConnectItem2SymbolID) && _LMConnector.ConnectItem2SymbolID == ConnItem) |
|
773 |
{ |
|
774 |
ReleaseCOMObjects(_LMConnector); |
|
775 |
return true; |
|
776 |
} |
|
777 |
else |
|
778 |
{ |
|
779 |
ReleaseCOMObjects(_LMConnector); |
|
780 |
} |
|
781 |
} |
|
782 |
} |
|
783 |
|
|
784 |
return false; |
|
785 |
} |
|
786 |
|
|
787 | 810 |
private void JoinPipeRun(string fromModelItemId, string toModelItemId) |
788 | 811 |
{ |
789 | 812 |
LMPipeRun run1 = dataSource.GetPipeRun(toModelItemId); |
내보내기 Unified diff