개정판 3ebe4712
dev issue #507 : fix InputEndBreakAttribute
Change-Id: Iaf9224102a10cfbee73137dba2325b1aa8e03b6e
DTI_PID/SPPIDConverter/AutoModeling.cs | ||
---|---|---|
4473 | 4473 |
if (modelItemIDs.Count == 1) |
4474 | 4474 |
{ |
4475 | 4475 |
LMModelItem modelItem = dataSource.GetModelItem(modelItemIDs[0]); |
4476 |
object value = modelItem.Attributes["TagSequenceNo"].get_Value(); |
|
4477 |
ZeroLengthModelItem.Attributes["TagSequenceNo"].set_Value(value); |
|
4478 |
ZeroLengthModelItem.Commit(); |
|
4476 |
LMConnector onlyOne = GetLMConnectorOnlyOne(modelItem.Id); |
|
4477 |
if (onlyOne != null && Convert.ToBoolean(onlyOne.get_IsZeroLength())) |
|
4478 |
{ |
|
4479 |
bool result = false; |
|
4480 |
foreach (LMLabelPersist loop in onlyOne.LabelPersists) |
|
4481 |
{ |
|
4482 |
if (document.EndBreaks.Find(x => x.SPPID.RepresentationId == loop.RepresentationID) != null) |
|
4483 |
result = true; |
|
4484 |
ReleaseCOMObjects(loop); |
|
4485 |
} |
|
4486 |
|
|
4487 |
if (result) |
|
4488 |
{ |
|
4489 |
object value = modelItem.Attributes["TagSequenceNo"].get_Value(); |
|
4490 |
ZeroLengthModelItem.Attributes["TagSequenceNo"].set_Value(value); |
|
4491 |
ZeroLengthModelItem.Commit(); |
|
4492 |
} |
|
4493 |
else |
|
4494 |
{ |
|
4495 |
List<string> loopModelItems = new List<string>(); |
|
4496 |
if (onlyOne.ConnectItem1SymbolObject.get_RepresentationType() == "Branch") |
|
4497 |
{ |
|
4498 |
LMSymbol _symbol = onlyOne.ConnectItem1SymbolObject; |
|
4499 |
foreach (LMConnector loop in _symbol.Connect1Connectors) |
|
4500 |
{ |
|
4501 |
if (loop.get_ItemStatus() == "Active" && loop.ModelItemID != onlyOne.ModelItemID) |
|
4502 |
loopModelItems.Add(loop.ModelItemID); |
|
4503 |
ReleaseCOMObjects(loop); |
|
4504 |
} |
|
4505 |
ReleaseCOMObjects(_symbol); |
|
4506 |
_symbol = null; |
|
4507 |
} |
|
4508 |
else if (onlyOne.ConnectItem2SymbolObject.get_RepresentationType() == "Branch") |
|
4509 |
{ |
|
4510 |
LMSymbol _symbol = onlyOne.ConnectItem1SymbolObject; |
|
4511 |
foreach (LMConnector loop in _symbol.Connect1Connectors) |
|
4512 |
{ |
|
4513 |
if (loop.get_ItemStatus() == "Active" && loop.ModelItemID != onlyOne.ModelItemID) |
|
4514 |
loopModelItems.Add(loop.ModelItemID); |
|
4515 |
ReleaseCOMObjects(loop); |
|
4516 |
} |
|
4517 |
ReleaseCOMObjects(_symbol); |
|
4518 |
_symbol = null; |
|
4519 |
} |
|
4520 |
|
|
4521 |
loopModelItems = loopModelItems.Distinct().ToList(); |
|
4522 |
if (loopModelItems.Count == 1) |
|
4523 |
{ |
|
4524 |
LMModelItem loopModelItem = dataSource.GetModelItem(loopModelItems[0]); |
|
4525 |
object value = loopModelItem.Attributes["TagSequenceNo"].get_Value(); |
|
4526 |
ZeroLengthModelItem.Attributes["TagSequenceNo"].set_Value(value); |
|
4527 |
ZeroLengthModelItem.Commit(); |
|
4528 |
|
|
4529 |
ReleaseCOMObjects(loopModelItem); |
|
4530 |
loopModelItem = null; |
|
4531 |
} |
|
4532 |
} |
|
4533 |
} |
|
4534 |
else |
|
4535 |
{ |
|
4536 |
object value = modelItem.Attributes["TagSequenceNo"].get_Value(); |
|
4537 |
ZeroLengthModelItem.Attributes["TagSequenceNo"].set_Value(value); |
|
4538 |
ZeroLengthModelItem.Commit(); |
|
4539 |
} |
|
4479 | 4540 |
ReleaseCOMObjects(modelItem); |
4480 | 4541 |
modelItem = null; |
4542 |
ReleaseCOMObjects(onlyOne); |
|
4543 |
onlyOne = null; |
|
4481 | 4544 |
} |
4482 | 4545 |
} |
4483 | 4546 |
ReleaseCOMObjects(connector); |
내보내기 Unified diff