개정판 dec9ecfd
dev issue #000 : fix bug
Change-Id: I612b0446c7362fe264cf4316dc80475c1cf949c2
DTI_PID/SPPIDConverter/AutoModeling.cs | ||
---|---|---|
87 | 87 |
Log.Write("Start Modeling"); |
88 | 88 |
SplashScreenManager.ShowForm(typeof(SPPIDSplashScreen), true, true); |
89 | 89 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetParent, (IntPtr)radApp.HWnd); |
90 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllStepCount, 16);
|
|
90 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllStepCount, 17);
|
|
91 | 91 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetDocumentName, DocumentLabelText); |
92 | 92 |
|
93 | 93 |
// Equipment Modeling |
... | ... | |
108 | 108 |
RunJoinRunForSameConnector(); |
109 | 109 |
// Join Run |
110 | 110 |
RunJoinRun(); |
111 |
// Replace Original Line Item |
|
112 |
RunReplaceLine(); |
|
111 | 113 |
// Check FlowDirection |
112 | 114 |
RunFlowDirection(); |
113 | 115 |
// Note Modeling |
... | ... | |
263 | 265 |
int branchCount = NewBranchLines.Count; |
264 | 266 |
while (NewBranchLines.Count > 0) |
265 | 267 |
{ |
266 |
Line item = NewBranchLines[0]; |
|
267 | 268 |
try |
268 | 269 |
{ |
269 | 270 |
SortBranchLines(); |
271 |
Line item = NewBranchLines[0]; |
|
270 | 272 |
if (EnableBranchModeling(item)) |
271 | 273 |
{ |
272 | 274 |
NewLineModeling(item, true); |
... | ... | |
278 | 280 |
catch (Exception ex) |
279 | 281 |
{ |
280 | 282 |
Log.Write("Error in NewLineModeling"); |
281 |
Log.Write("UID : " + item.UID);
|
|
283 |
Log.Write("UID : " + NewBranchLines[0].UID);
|
|
282 | 284 |
Log.Write(ex.Message); |
283 | 285 |
Log.Write(ex.StackTrace); |
284 | 286 |
break; |
... | ... | |
479 | 481 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.UpProgress, null); |
480 | 482 |
} |
481 | 483 |
} |
484 |
private void RunReplaceLine() |
|
485 |
{ |
|
486 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllProgress, document.LINES.Count); |
|
487 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Replace Original Line"); |
|
488 |
List<string> endModelId = new List<string>(); |
|
489 |
foreach (var line in document.LINES) |
|
490 |
{ |
|
491 |
continue; |
|
492 |
if (!string.IsNullOrEmpty(line.SPPID.ModelItemId) && !endModelId.Contains(line.SPPID.ModelItemId)) |
|
493 |
{ |
|
494 |
ReplaceLine(line); |
|
495 |
endModelId.Add(line.SPPID.ModelItemId); |
|
496 |
} |
|
497 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.UpProgress, null); |
|
498 |
} |
|
499 |
} |
|
482 | 500 |
private void RunFlowDirection() |
483 | 501 |
{ |
484 | 502 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllProgress, |
... | ... | |
1566 | 1584 |
|
1567 | 1585 |
ReleaseCOMObjects(_LMSymbol); |
1568 | 1586 |
} |
1569 |
|
|
1587 |
double index = 0; |
|
1570 | 1588 |
private void NewLineModeling(Line line, bool isBranchModeling = false) |
1571 | 1589 |
{ |
1572 | 1590 |
if (!string.IsNullOrEmpty(line.SPPID.ModelItemId) || (NewBranchLines.Contains(line) && !isBranchModeling)) |
... | ... | |
1593 | 1611 |
PlaceRunInputs placeRunInputs = new PlaceRunInputs(); |
1594 | 1612 |
foreach (var connector in groupLine.CONNECTORS) |
1595 | 1613 |
{ |
1596 |
|
|
1597 | 1614 |
double x = 0; |
1598 | 1615 |
double y = 0; |
1599 | 1616 |
GetTargetLineConnectorPoint(connector, groupLine, ref x, ref y); |
... | ... | |
1643 | 1660 |
{ |
1644 | 1661 |
if (groupLine.CONNECTORS.IndexOf(connector) == 0) |
1645 | 1662 |
{ |
1663 |
index += 0.01; |
|
1646 | 1664 |
if (groupLine.SlopeType == SlopeType.HORIZONTAL) |
1647 |
placeRunInputs.AddPoint(x, -y - 0.1);
|
|
1665 |
placeRunInputs.AddPoint(x, -0.1 - index);
|
|
1648 | 1666 |
else if (groupLine.SlopeType == SlopeType.VERTICAL) |
1649 |
placeRunInputs.AddPoint(-x - 0.1, y);
|
|
1667 |
placeRunInputs.AddPoint(-0.1 - index, y);
|
|
1650 | 1668 |
else |
1651 | 1669 |
{ |
1652 | 1670 |
if (SPPIDUtil.CalcAngle(groupLine.SPPID.START_X, groupLine.SPPID.START_Y, groupLine.SPPID.END_X, groupLine.SPPID.END_Y) < 45) |
1653 |
placeRunInputs.AddPoint(x, -y - 0.1);
|
|
1671 |
placeRunInputs.AddPoint(x, -0.1 - index);
|
|
1654 | 1672 |
else |
1655 |
placeRunInputs.AddPoint(-x - 0.1, y);
|
|
1673 |
placeRunInputs.AddPoint(-0.1 - index, y);
|
|
1656 | 1674 |
} |
1657 | 1675 |
} |
1658 | 1676 |
|
... | ... | |
1660 | 1678 |
|
1661 | 1679 |
if (groupLine.CONNECTORS.IndexOf(connector) == 1) |
1662 | 1680 |
{ |
1681 |
index += 0.01; |
|
1663 | 1682 |
if (groupLine.SlopeType == SlopeType.HORIZONTAL) |
1664 |
placeRunInputs.AddPoint(x, -y - 0.1);
|
|
1683 |
placeRunInputs.AddPoint(x, -0.1 - index);
|
|
1665 | 1684 |
else if (groupLine.SlopeType == SlopeType.VERTICAL) |
1666 |
placeRunInputs.AddPoint(-x - 0.1, y);
|
|
1685 |
placeRunInputs.AddPoint(-0.1 - index, y);
|
|
1667 | 1686 |
else |
1668 | 1687 |
{ |
1669 | 1688 |
if (SPPIDUtil.CalcAngle(groupLine.SPPID.START_X, groupLine.SPPID.START_Y, groupLine.SPPID.END_X, groupLine.SPPID.END_Y) < 45) |
1670 |
placeRunInputs.AddPoint(x, -y - 0.1);
|
|
1689 |
placeRunInputs.AddPoint(x, -0.1 - index);
|
|
1671 | 1690 |
else |
1672 |
placeRunInputs.AddPoint(-x - 0.1, y);
|
|
1691 |
placeRunInputs.AddPoint(-0.1 - index, y);
|
|
1673 | 1692 |
} |
1674 | 1693 |
} |
1675 | 1694 |
} |
... | ... | |
1695 | 1714 |
|
1696 | 1715 |
ReleaseCOMObjects(_lMConnector); |
1697 | 1716 |
} |
1717 |
else if (!isBranchModeling) |
|
1718 |
{ |
|
1719 |
Log.Write("Main Line Modeling : " + groupLine.UID); |
|
1720 |
} |
|
1698 | 1721 |
|
1699 | 1722 |
List<object> removeLines = groupLine.CONNECTORS.FindAll(x => |
1700 | 1723 |
x.ConnectedObject != null && |
... | ... | |
3595 | 3618 |
} |
3596 | 3619 |
} |
3597 | 3620 |
|
3621 |
private void ReplaceLine(Line line) |
|
3622 |
{ |
|
3623 |
LMModelItem modelItem = dataSource.GetModelItem(line.SPPID.ModelItemId); |
|
3624 |
|
|
3625 |
|
|
3626 |
|
|
3627 |
ReleaseCOMObjects(modelItem); |
|
3628 |
} |
|
3629 |
|
|
3598 | 3630 |
/// <summary> |
3599 | 3631 |
/// Label의 좌표를 구하는 메서드(ID2 기준의 좌표 -> SPPID 좌표) |
3600 | 3632 |
/// </summary> |
DTI_PID/SPPIDConverter/ConverterDocking.cs | ||
---|---|---|
224 | 224 |
|
225 | 225 |
|
226 | 226 |
LMModelItem modelItem = dataSource.GetModelItem(modelItemId); |
227 |
LMPipeRun run = dataSource.GetPipeRun(modelItem.Id); |
|
228 |
dynamic dd = run.get_Name(); |
|
229 |
LMAAttribute att = run.Attributes["FileName"]; |
|
230 |
//foreach (LMRepresentation rep in modelItem.Representations) |
|
231 |
//{ |
|
232 |
// if (!DBNull.Value.Equals(rep.get_FileName())) |
|
233 |
// { |
|
234 |
// rep.set_FileName(@"\Instrumentation\Signal Line\Connect to Process.sym"); |
|
235 |
// } |
|
236 |
//} |
|
227 | 237 |
|
228 |
List<string> endModelItemIDs = new List<string>(); |
|
229 |
|
|
230 |
string dd = string.Empty; |
|
231 |
JoinRunBySameType(modelItemId, ref dd); |
|
232 | 238 |
|
233 | 239 |
} |
234 | 240 |
private void JoinRun(string modelId, string mainModelId, ref string survivorId) |
내보내기 Unified diff