108 |
108 |
// SpecBreak Modeling
|
109 |
109 |
RunSpecBreakModeling();
|
110 |
110 |
|
111 |
|
// Join
|
|
111 |
// Join SameConnector
|
112 |
112 |
RunJoinRunForSameConnector();
|
113 |
113 |
|
|
114 |
// Check FlowDirection
|
|
115 |
|
|
116 |
|
114 |
117 |
//// LineNumber Modeling
|
115 |
118 |
//RunLineNumberModeling();
|
116 |
119 |
|
... | ... | |
386 |
389 |
}
|
387 |
390 |
private void RunClearInconsistancy()
|
388 |
391 |
{
|
389 |
|
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllProgress, document.SYMBOLS.Count + document.LINES.Count);
|
|
392 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllProgress, 1);
|
390 |
393 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Clear Attribute");
|
391 |
394 |
SetSystemEditingCommand(false);
|
392 |
395 |
|
... | ... | |
405 |
408 |
LMRelationships relationships = new LMRelationships();
|
406 |
409 |
relationships.Collect(dataSource, Filter: filter);
|
407 |
410 |
|
|
411 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllProgress, relationships.Count);
|
408 |
412 |
foreach (LMRelationship relationship in relationships)
|
409 |
413 |
{
|
410 |
414 |
foreach (LMInconsistency inconsistency in relationship.Inconsistencies)
|
... | ... | |
420 |
424 |
if (attrName.Contains("PipingPoint"))
|
421 |
425 |
{
|
422 |
426 |
string originalAttr = attrName.Split(new char[] { '.' })[1];
|
423 |
|
int index = 1;
|
424 |
|
while (modelItem1.Attributes["PipingPoint" + index + "." + originalAttr] != null)
|
|
427 |
int index = Convert.ToInt32(relationship.get_Item1Location());
|
|
428 |
LMAAttribute attribute1 = modelItem1.Attributes["PipingPoint" + index + "." + originalAttr];
|
|
429 |
if (attribute1 != null && !DBNull.Value.Equals(attribute1.get_Value()))
|
425 |
430 |
{
|
426 |
|
LMAAttribute attribute1 = modelItem1.Attributes["PipingPoint" + index + "." + originalAttr];
|
427 |
|
if (attribute1 != null && !DBNull.Value.Equals(attribute1.get_Value()))
|
428 |
|
{
|
429 |
|
loop = true;
|
430 |
|
attribute1.set_Value(DBNull.Value);
|
431 |
|
}
|
432 |
|
index++;
|
|
431 |
loop = true;
|
|
432 |
attribute1.set_Value(DBNull.Value);
|
433 |
433 |
}
|
434 |
434 |
}
|
435 |
435 |
else
|
... | ... | |
449 |
449 |
if (attrName.Contains("PipingPoint"))
|
450 |
450 |
{
|
451 |
451 |
string originalAttr = attrName.Split(new char[] { '.' })[1];
|
452 |
|
int index = 1;
|
453 |
|
while (modelItem2.Attributes["PipingPoint" + index + "." + originalAttr] != null)
|
|
452 |
int index = Convert.ToInt32(relationship.get_Item2Location());
|
|
453 |
LMAAttribute attribute2 = modelItem2.Attributes["PipingPoint" + index + "." + originalAttr];
|
|
454 |
if (attribute2 != null && !DBNull.Value.Equals(attribute2.get_Value()))
|
454 |
455 |
{
|
455 |
|
LMAAttribute attribute2 = modelItem2.Attributes["PipingPoint" + index + "." + originalAttr];
|
456 |
|
if (attribute2 != null && !DBNull.Value.Equals(attribute2.get_Value()))
|
457 |
|
{
|
458 |
|
attribute2.set_Value(DBNull.Value);
|
459 |
|
loop = true;
|
460 |
|
}
|
461 |
|
index++;
|
|
456 |
attribute2.set_Value(DBNull.Value);
|
|
457 |
loop = true;
|
462 |
458 |
}
|
463 |
459 |
}
|
464 |
460 |
else
|
... | ... | |
480 |
476 |
}
|
481 |
477 |
}
|
482 |
478 |
relationship.Commit();
|
|
479 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.UpProgress, null);
|
483 |
480 |
}
|
484 |
481 |
ReleaseCOMObjects(filter);
|
485 |
482 |
ReleaseCOMObjects(criterion);
|
486 |
483 |
ReleaseCOMObjects(relationships);
|
487 |
484 |
}
|
488 |
485 |
|
489 |
|
|
490 |
|
|
|
486 |
#region 예전 방식
|
491 |
487 |
//List<string> endClearModelItemID = new List<string>();
|
492 |
488 |
//for (int i = 0; i < document.LINES.Count; i++)
|
493 |
489 |
//{
|
... | ... | |
579 |
575 |
// }
|
580 |
576 |
// SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.UpProgress, null);
|
581 |
577 |
//}
|
|
578 |
#endregion
|
582 |
579 |
SetSystemEditingCommand(true);
|
583 |
580 |
}
|
584 |
581 |
private void RunEndBreakModeling()
|
... | ... | |
590 |
587 |
{
|
591 |
588 |
EndBreakModeling(item);
|
592 |
589 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.UpProgress, null);
|
593 |
|
if (string.IsNullOrEmpty(item.SPPID.ModelItemID))
|
|
590 |
if (string.IsNullOrEmpty(item.SPPID.RepresentationId))
|
594 |
591 |
Log.Write("Fail modeling endbreak UID : " + item.UID);
|
595 |
592 |
}
|
596 |
593 |
catch (Exception ex)
|
... | ... | |
610 |
607 |
{
|
611 |
608 |
SpecBreakModeling(item);
|
612 |
609 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.UpProgress, null);
|
613 |
|
if (string.IsNullOrEmpty(item.SPPID.ModelItemID))
|
|
610 |
if (string.IsNullOrEmpty(item.SPPID.RepresentationId))
|
614 |
611 |
Log.Write("Fail modeling specbreak UID : " + item.UID);
|
615 |
612 |
}
|
616 |
613 |
catch (Exception ex)
|
... | ... | |
623 |
620 |
}
|
624 |
621 |
private void RunJoinRunForSameConnector()
|
625 |
622 |
{
|
|
623 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllProgress, document.LINES.Count);
|
626 |
624 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "PipeRun Join");
|
627 |
625 |
foreach (var line in document.LINES)
|
628 |
626 |
{
|
... | ... | |
632 |
630 |
{
|
633 |
631 |
if (connector.ConnectedObject != null &&
|
634 |
632 |
connector.ConnectedObject.GetType() == typeof(Line) &&
|
635 |
|
!SPPIDUtil.IsBranchLine(line, connector.ConnectedObject as Line) &&
|
636 |
|
!SPPIDUtil.IsSegmentLine(document, connector.ConnectedObject as Line))
|
|
633 |
!SPPIDUtil.IsBranchLine(line, connector.ConnectedObject as Line))
|
637 |
634 |
{
|
638 |
635 |
Line connLine = connector.ConnectedObject as Line;
|
639 |
636 |
if (line.SPPID.ModelItemId != connLine.SPPID.ModelItemId)
|
... | ... | |
641 |
638 |
}
|
642 |
639 |
}
|
643 |
640 |
}
|
|
641 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.UpProgress, null);
|
|
642 |
}
|
|
643 |
}
|
|
644 |
private void RunFlowDirection()
|
|
645 |
{
|
|
646 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllProgress, document.LINES.Count);
|
|
647 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Check Flow Direction");
|
|
648 |
foreach (var line in document.LINES)
|
|
649 |
{
|
|
650 |
|
|
651 |
|
|
652 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.UpProgress, null);
|
644 |
653 |
}
|
645 |
654 |
}
|
646 |
655 |
|
... | ... | |
2091 |
2100 |
if (_LmLabelPersist != null)
|
2092 |
2101 |
{
|
2093 |
2102 |
endBreak.SPPID.RepresentationId = _LmLabelPersist.AsLMRepresentation().Id;
|
2094 |
|
endBreak.SPPID.ModelItemID = _LmLabelPersist.ModelItemID;
|
|
2103 |
if (_LmLabelPersist.ModelItemObject != null)
|
|
2104 |
endBreak.SPPID.ModelItemID = _LmLabelPersist.ModelItemID;
|
2095 |
2105 |
endBreak.SPPID.GraphicOID = _LmLabelPersist.get_GraphicOID();
|
2096 |
2106 |
ReleaseCOMObjects(_LmLabelPersist);
|
2097 |
2107 |
}
|
... | ... | |
2209 |
2219 |
if (_LmLabelPersist != null)
|
2210 |
2220 |
{
|
2211 |
2221 |
specBreak.SPPID.RepresentationId = _LmLabelPersist.AsLMRepresentation().Id;
|
2212 |
|
specBreak.SPPID.ModelItemID = _LmLabelPersist.ModelItemID;
|
|
2222 |
if (_LmLabelPersist.ModelItemObject != null)
|
|
2223 |
specBreak.SPPID.ModelItemID = _LmLabelPersist.ModelItemID;
|
2213 |
2224 |
specBreak.SPPID.GraphicOID = _LmLabelPersist.get_GraphicOID();
|
2214 |
2225 |
ReleaseCOMObjects(_LmLabelPersist);
|
2215 |
2226 |
}
|