개정판 37c2875e
Modify the order and method of drawing brunch lines
Change-Id: I6d9e8c785ef75d7f9fa34b989e25c334bc2e170a
DTI_PID/SPPIDConverter/AutoModeling.cs | ||
---|---|---|
94 | 94 |
string drawingName = document.DrawingName; |
95 | 95 |
try |
96 | 96 |
{ |
97 |
radApp.Interactive = false; |
|
98 |
|
|
97 | 99 |
nominalDiameterTable = Project_DB.SelectProjectNominalDiameter(); |
98 | 100 |
_placement = new Placement(); |
99 | 101 |
dataSource = _placement.PIDDataSource; |
100 |
|
|
102 |
|
|
101 | 103 |
if (CreateDocument(ref drawingNumber, ref drawingName) && DocumentCoordinateCorrection()) |
102 | 104 |
{ |
103 | 105 |
Log.Write("Start Modeling"); |
... | ... | |
176 | 178 |
RunETC(); |
177 | 179 |
// input bulk attribute |
178 | 180 |
RunBulkAttribute(); |
179 |
// Graphic Modeling
|
|
181 |
// import Auxiliary Graphics
|
|
180 | 182 |
RunGraphicModeling(); |
181 | 183 |
// Update PipeRun Properties |
182 | 184 |
RunUpdatePipeRunProperties(); |
... | ... | |
196 | 198 |
} |
197 | 199 |
finally |
198 | 200 |
{ |
201 |
radApp.Interactive = true; |
|
202 |
|
|
199 | 203 |
Project_DB.InsertDrawingInfoAndOPCInfo(document.PATH, drawingNumber, drawingName, document); |
200 | 204 |
//Project_DB.InsertLineNumberInfo(document.PATH, drawingNumber, drawingName, document); |
201 | 205 |
|
... | ... | |
291 | 295 |
{ |
292 | 296 |
try |
293 | 297 |
{ |
294 |
if (document.VentDrainSymbol.Contains(item)) |
|
298 |
if (document.VentDrainSymbol.Contains(item) || !string.IsNullOrWhiteSpace(item.SPPID.RepresentationId))
|
|
295 | 299 |
continue; |
296 | 300 |
SymbolModelingBySymbol(item); |
297 | 301 |
} |
... | ... | |
316 | 320 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Line Modeling - 1"); |
317 | 321 |
|
318 | 322 |
SetPriorityLine(step1_Line); |
319 |
foreach (var item in step1_Line)
|
|
323 |
while (step1_Line.Count > 0)
|
|
320 | 324 |
{ |
321 | 325 |
try |
322 | 326 |
{ |
323 |
if (document.VentDrainLine.Contains(item)) |
|
324 |
continue; |
|
325 |
NewLineModeling(item); |
|
326 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.UpProgress, null); |
|
327 |
Line item = step1_Line[0]; |
|
328 |
if (!string.IsNullOrEmpty(item.SPPID.ModelItemId) || BranchLines.Contains(item) || document.VentDrainLine.Contains(item)) |
|
329 |
{ |
|
330 |
step1_Line.Remove(item); |
|
331 |
} |
|
332 |
else |
|
333 |
{ |
|
334 |
NewLineModeling(item); |
|
335 |
step1_Line.Remove(item); |
|
336 |
if (string.IsNullOrEmpty(item.SPPID.ModelItemId)) |
|
337 |
{ |
|
338 |
step1_Line.Add(item); |
|
339 |
} |
|
340 |
} |
|
341 |
if (!step1_Line.Contains(item)) |
|
342 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.UpProgress, null); |
|
327 | 343 |
} |
328 | 344 |
catch (Exception ex) |
329 | 345 |
{ |
330 | 346 |
Log.Write("Error in NewLineModeling"); |
331 |
Log.Write("UID : " + item.UID);
|
|
347 |
Log.Write("UID : " + step1_Line[0].UID);
|
|
332 | 348 |
Log.Write(ex.Message); |
333 | 349 |
Log.Write(ex.StackTrace); |
350 |
step1_Line.Remove(step1_Line[0]); |
|
334 | 351 |
} |
335 | 352 |
} |
336 | 353 |
|
337 | 354 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllProgress, BranchLines.Count); |
338 | 355 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Line Modeling - 2"); |
339 | 356 |
int branchCount = BranchLines.Count; |
357 |
SortBranchLines(); |
|
340 | 358 |
while (BranchLines.Count > 0) |
341 | 359 |
{ |
342 | 360 |
try |
343 |
{ |
|
344 |
SortBranchLines(); |
|
361 |
{ |
|
345 | 362 |
Line item = BranchLines[0]; |
346 |
NewLineModeling(item, true); |
|
347 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.UpProgress, null); |
|
363 |
if (!string.IsNullOrEmpty(item.SPPID.ModelItemId) || document.VentDrainLine.Contains(item)) |
|
364 |
{ |
|
365 |
BranchLines.Remove(item); |
|
366 |
} |
|
367 |
else |
|
368 |
{ |
|
369 |
NewLineModeling(item, true); |
|
370 |
BranchLines.Remove(item); |
|
371 |
if (string.IsNullOrEmpty(item.SPPID.ModelItemId)) |
|
372 |
{ |
|
373 |
BranchLines.Add(item); |
|
374 |
} |
|
375 |
} |
|
376 |
if (!BranchLines.Contains(item)) |
|
377 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.UpProgress, null); |
|
348 | 378 |
} |
349 | 379 |
catch (Exception ex) |
350 | 380 |
{ |
... | ... | |
358 | 388 |
|
359 | 389 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllProgress, stepLast_Line.Count); |
360 | 390 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Line Modeling - 3"); |
361 |
foreach (var item in stepLast_Line)
|
|
391 |
while (stepLast_Line.Count > 0)
|
|
362 | 392 |
{ |
363 | 393 |
try |
364 | 394 |
{ |
365 |
if (document.VentDrainLine.Contains(item)) |
|
366 |
continue; |
|
367 |
NewLineModeling(item); |
|
368 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.UpProgress, null); |
|
395 |
Line item = stepLast_Line[0]; |
|
396 |
if (!string.IsNullOrEmpty(item.SPPID.ModelItemId) || BranchLines.Contains(item) || document.VentDrainLine.Contains(item)) |
|
397 |
{ |
|
398 |
stepLast_Line.Remove(item); |
|
399 |
} |
|
400 |
else |
|
401 |
{ |
|
402 |
NewLineModeling(item); |
|
403 |
stepLast_Line.Remove(item); |
|
404 |
if (string.IsNullOrEmpty(item.SPPID.ModelItemId)) |
|
405 |
{ |
|
406 |
stepLast_Line.Add(item); |
|
407 |
} |
|
408 |
} |
|
409 |
if (!stepLast_Line.Contains(item)) |
|
410 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.UpProgress, null); |
|
369 | 411 |
} |
370 | 412 |
catch (Exception ex) |
371 | 413 |
{ |
372 | 414 |
Log.Write("Error in NewLineModeling"); |
373 |
Log.Write("UID : " + item.UID);
|
|
415 |
Log.Write("UID : " + stepLast_Line[0].UID);
|
|
374 | 416 |
Log.Write(ex.Message); |
375 | 417 |
Log.Write(ex.StackTrace); |
418 |
stepLast_Line.Remove(stepLast_Line[0]); |
|
376 | 419 |
} |
377 | 420 |
} |
378 | 421 |
} |
... | ... | |
1100 | 1143 |
} |
1101 | 1144 |
private void RunGraphicModeling() |
1102 | 1145 |
{ |
1103 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllProgress, document.SYMBOLS.Count);
|
|
1146 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllProgress, document.Graphics.Count);
|
|
1104 | 1147 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Graphic Modeling"); |
1105 | 1148 |
foreach (var item in document.Graphics) |
1106 | 1149 |
{ |
... | ... | |
1196 | 1239 |
throw ex; |
1197 | 1240 |
} |
1198 | 1241 |
} |
1199 |
|
|
1242 |
|
|
1200 | 1243 |
if (newDrawing != null) |
1201 | 1244 |
{ |
1202 | 1245 |
document.SPPID_DrawingNumber = drawingNumber; |
... | ... | |
1495 | 1538 |
if (!string.IsNullOrWhiteSpace(item.SPPID.RepresentationId)) continue; |
1496 | 1539 |
|
1497 | 1540 |
if (xDrawnCount == 1) |
1498 |
{
|
|
1541 |
{ |
|
1499 | 1542 |
item.SPPID.ORIGINAL_X = symbol.SPPID.SPPID_X; |
1500 | 1543 |
item.SPPID.ORIGINAL_Y = item.SPPID.ORIGINAL_Y + yGap; |
1501 | 1544 |
} |
... | ... | |
2542 | 2585 |
|
2543 | 2586 |
List<Line> group = new List<Line>(); |
2544 | 2587 |
GetConnectedLineGroup(line, group); |
2545 |
LineCoordinateCorrection(group); |
|
2588 |
if (!BranchLines.Contains(line)) |
|
2589 |
LineCoordinateCorrection(group); |
|
2546 | 2590 |
|
2547 |
foreach (var groupLine in group)
|
|
2591 |
for (int i = 0; i < group.Count; i++)
|
|
2548 | 2592 |
{ |
2549 |
if (!isBranchModeling && SPPIDUtil.IsBranchLine(groupLine)) |
|
2593 |
var currentLine = group[i]; |
|
2594 |
|
|
2595 |
if (!isBranchModeling && SPPIDUtil.IsBranchLine(currentLine)) |
|
2550 | 2596 |
{ |
2551 |
BranchLines.Add(groupLine); |
|
2552 |
continue; |
|
2597 |
for (int j = i; j < group.Count; j++) |
|
2598 |
{ |
|
2599 |
var brachLine = group[j]; |
|
2600 |
if (!BranchLines.Contains(brachLine)) |
|
2601 |
BranchLines.Add(brachLine); |
|
2602 |
} |
|
2603 |
break; |
|
2604 |
} |
|
2605 |
if (currentLine.CONNECTORS[0].ConnectedObject != null |
|
2606 |
&& currentLine.CONNECTORS[0].ConnectedObject.GetType() == typeof(Line) |
|
2607 |
&& string.IsNullOrEmpty(((Line)currentLine.CONNECTORS[0].ConnectedObject).SPPID.ModelItemId)) |
|
2608 |
{ |
|
2609 |
break; |
|
2553 | 2610 |
} |
2554 | 2611 |
|
2555 | 2612 |
bool diagonal = false; |
2556 |
if (groupLine.SlopeType != SlopeType.HORIZONTAL && groupLine.SlopeType != SlopeType.VERTICAL)
|
|
2613 |
if (currentLine.SlopeType != SlopeType.HORIZONTAL && currentLine.SlopeType != SlopeType.VERTICAL)
|
|
2557 | 2614 |
diagonal = true; |
2558 |
_LMAItem _LMAItem = _placement.PIDCreateItem(groupLine.SPPID.MAPPINGNAME);
|
|
2615 |
_LMAItem _LMAItem = _placement.PIDCreateItem(currentLine.SPPID.MAPPINGNAME);
|
|
2559 | 2616 |
LMSymbol _LMSymbolStart = null; |
2560 | 2617 |
LMSymbol _LMSymbolEnd = null; |
2561 | 2618 |
PlaceRunInputs placeRunInputs = new PlaceRunInputs(); |
2562 |
foreach (var connector in groupLine.CONNECTORS)
|
|
2619 |
foreach (var connector in currentLine.CONNECTORS)
|
|
2563 | 2620 |
{ |
2564 | 2621 |
double x = 0; |
2565 | 2622 |
double y = 0; |
2566 |
GetTargetLineConnectorPoint(connector, groupLine, ref x, ref y);
|
|
2623 |
GetTargetLineConnectorPoint(connector, currentLine, ref x, ref y);
|
|
2567 | 2624 |
if (connector.ConnectedObject == null) |
2568 | 2625 |
placeRunInputs.AddPoint(x, y); |
2569 | 2626 |
else if (connector.ConnectedObject.GetType() == typeof(Symbol)) |
2570 | 2627 |
{ |
2571 | 2628 |
Symbol targetSymbol = connector.ConnectedObject as Symbol; |
2572 |
GetTargetSymbolConnectorPoint(targetSymbol.CONNECTORS.Find(z => z.ConnectedObject == groupLine), targetSymbol, ref x, ref y);
|
|
2573 |
if (groupLine.CONNECTORS.IndexOf(connector) == 0)
|
|
2629 |
GetTargetSymbolConnectorPoint(targetSymbol.CONNECTORS.Find(z => z.ConnectedObject == currentLine), targetSymbol, ref x, ref y);
|
|
2630 |
if (currentLine.CONNECTORS.IndexOf(connector) == 0)
|
|
2574 | 2631 |
{ |
2575 |
_LMSymbolStart = GetTargetSymbol(targetSymbol, groupLine);
|
|
2632 |
_LMSymbolStart = GetTargetSymbol(targetSymbol, currentLine);
|
|
2576 | 2633 |
if (_LMSymbolStart != null) |
2577 | 2634 |
placeRunInputs.AddSymbolTarget(_LMSymbolStart, x, y, diagonal); |
2578 | 2635 |
else |
... | ... | |
2580 | 2637 |
} |
2581 | 2638 |
else |
2582 | 2639 |
{ |
2583 |
_LMSymbolEnd = GetTargetSymbol(targetSymbol, groupLine);
|
|
2640 |
_LMSymbolEnd = GetTargetSymbol(targetSymbol, currentLine);
|
|
2584 | 2641 |
if (_LMSymbolEnd != null) |
2585 | 2642 |
placeRunInputs.AddSymbolTarget(_LMSymbolEnd, x, y, diagonal); |
2586 | 2643 |
else |
... | ... | |
2592 | 2649 |
Line targetLine = connector.ConnectedObject as Line; |
2593 | 2650 |
if (!string.IsNullOrEmpty(targetLine.SPPID.ModelItemId)) |
2594 | 2651 |
{ |
2595 |
LMConnector targetConnector = FindTargetLMConnectorForBranch(line, targetLine, ref x, ref y);
|
|
2652 |
LMConnector targetConnector = FindTargetLMConnectorForBranch(currentLine, targetLine, ref x, ref y);
|
|
2596 | 2653 |
if (targetConnector != null) |
2597 | 2654 |
{ |
2598 | 2655 |
if (targetLine.SlopeType != SlopeType.HORIZONTAL && targetLine.SlopeType != SlopeType.VERTICAL) |
2599 |
diagonal = true; |
|
2600 |
placeRunInputs.AddConnectorTarget(targetConnector, x, y, diagonal); |
|
2601 |
ChangeLineSPPIDCoordinateByConnector(groupLine, targetLine, x, y, false); |
|
2656 |
placeRunInputs.AddConnectorTarget(targetConnector, x, y, true); |
|
2657 |
else |
|
2658 |
placeRunInputs.AddConnectorTarget(targetConnector, x, y, diagonal); |
|
2659 |
ChangeLineSPPIDCoordinateByConnector(currentLine, targetLine, x, y, false); |
|
2602 | 2660 |
} |
2603 | 2661 |
else |
2604 | 2662 |
{ |
2605 | 2663 |
placeRunInputs.AddPoint(x, y); |
2606 |
ChangeLineSPPIDCoordinateByConnector(groupLine, targetLine, x, y, false);
|
|
2664 |
ChangeLineSPPIDCoordinateByConnector(currentLine, targetLine, x, y, false);
|
|
2607 | 2665 |
} |
2608 | 2666 |
} |
2609 | 2667 |
else |
2610 | 2668 |
{ |
2611 |
if (groupLine.CONNECTORS.IndexOf(connector) == 0)
|
|
2669 |
if (currentLine.CONNECTORS.IndexOf(connector) == 0)
|
|
2612 | 2670 |
{ |
2613 | 2671 |
index += 0.01; |
2614 |
if (groupLine.SlopeType == SlopeType.HORIZONTAL)
|
|
2672 |
if (currentLine.SlopeType == SlopeType.HORIZONTAL)
|
|
2615 | 2673 |
placeRunInputs.AddPoint(x, -0.1 - index); |
2616 |
else if (groupLine.SlopeType == SlopeType.VERTICAL)
|
|
2674 |
else if (currentLine.SlopeType == SlopeType.VERTICAL)
|
|
2617 | 2675 |
placeRunInputs.AddPoint(-0.1 - index, y); |
2618 | 2676 |
else |
2619 | 2677 |
{ |
2620 |
Line nextLine = groupLine.CONNECTORS[0].ConnectedObject as Line;
|
|
2678 |
Line nextLine = currentLine.CONNECTORS[0].ConnectedObject as Line;
|
|
2621 | 2679 |
if (SPPIDUtil.CalcAngle(nextLine.SPPID.START_X, nextLine.SPPID.START_Y, nextLine.SPPID.END_X, nextLine.SPPID.END_Y) < 45) |
2622 | 2680 |
placeRunInputs.AddPoint(-0.1 - index, y); |
2623 | 2681 |
else |
... | ... | |
2627 | 2685 |
|
2628 | 2686 |
placeRunInputs.AddPoint(x, y); |
2629 | 2687 |
|
2630 |
if (groupLine.CONNECTORS.IndexOf(connector) == 1)
|
|
2688 |
if (currentLine.CONNECTORS.IndexOf(connector) == 1)
|
|
2631 | 2689 |
{ |
2632 | 2690 |
index += 0.01; |
2633 |
if (groupLine.SlopeType == SlopeType.HORIZONTAL)
|
|
2691 |
if (currentLine.SlopeType == SlopeType.HORIZONTAL)
|
|
2634 | 2692 |
placeRunInputs.AddPoint(x, -0.1 - index); |
2635 |
else if (groupLine.SlopeType == SlopeType.VERTICAL)
|
|
2693 |
else if (currentLine.SlopeType == SlopeType.VERTICAL)
|
|
2636 | 2694 |
placeRunInputs.AddPoint(-0.1 - index, y); |
2637 | 2695 |
else |
2638 | 2696 |
{ |
2639 |
Line nextLine = groupLine.CONNECTORS[1].ConnectedObject as Line;
|
|
2697 |
Line nextLine = currentLine.CONNECTORS[1].ConnectedObject as Line;
|
|
2640 | 2698 |
if (SPPIDUtil.CalcAngle(nextLine.SPPID.START_X, nextLine.SPPID.START_Y, nextLine.SPPID.END_X, nextLine.SPPID.END_Y) < 45) |
2641 | 2699 |
placeRunInputs.AddPoint(-0.1 - index, y); |
2642 | 2700 |
else |
... | ... | |
2653 | 2711 |
if (_lMConnector != null) |
2654 | 2712 |
{ |
2655 | 2713 |
_lMConnector.Commit(); |
2656 |
groupLine.SPPID.ModelItemId = _lMConnector.ModelItemID;
|
|
2714 |
currentLine.SPPID.ModelItemId = _lMConnector.ModelItemID;
|
|
2657 | 2715 |
|
2658 | 2716 |
bool bRemodelingStart = false; |
2659 | 2717 |
if (_LMSymbolStart != null) |
2660 |
NeedReModeling(groupLine, _LMSymbolStart, ref bRemodelingStart);
|
|
2718 |
NeedReModeling(currentLine, _LMSymbolStart, ref bRemodelingStart);
|
|
2661 | 2719 |
bool bRemodelingEnd = false; |
2662 | 2720 |
if (_LMSymbolEnd != null) |
2663 |
NeedReModeling(groupLine, _LMSymbolEnd, ref bRemodelingEnd);
|
|
2721 |
NeedReModeling(currentLine, _LMSymbolEnd, ref bRemodelingEnd);
|
|
2664 | 2722 |
|
2665 | 2723 |
if (bRemodelingStart || bRemodelingEnd) |
2666 |
ReModelingLine(groupLine, _lMConnector, _LMSymbolStart, _LMSymbolEnd, bRemodelingStart, bRemodelingEnd);
|
|
2724 |
ReModelingLine(currentLine, _lMConnector, _LMSymbolStart, _LMSymbolEnd, bRemodelingStart, bRemodelingEnd);
|
|
2667 | 2725 |
|
2668 |
FlowMarkModeling(groupLine);
|
|
2726 |
FlowMarkModeling(currentLine);
|
|
2669 | 2727 |
|
2670 | 2728 |
ReleaseCOMObjects(_lMConnector); |
2671 | 2729 |
|
2672 |
LMModelItem modelItem = dataSource.GetModelItem(groupLine.SPPID.ModelItemId);
|
|
2730 |
LMModelItem modelItem = dataSource.GetModelItem(currentLine.SPPID.ModelItemId);
|
|
2673 | 2731 |
if (modelItem != null) |
2674 | 2732 |
{ |
2675 | 2733 |
LMAAttribute attribute = modelItem.Attributes["FlowDirection"]; |
... | ... | |
2682 | 2740 |
} |
2683 | 2741 |
else if (!isBranchModeling) |
2684 | 2742 |
{ |
2685 |
Log.Write("Main Line Modeling : " + groupLine.UID);
|
|
2743 |
Log.Write("Main Line Modeling : " + currentLine.UID);
|
|
2686 | 2744 |
} |
2687 | 2745 |
|
2688 |
List<object> removeLines = groupLine.CONNECTORS.FindAll(x =>
|
|
2746 |
List<object> removeLines = currentLine.CONNECTORS.FindAll(x =>
|
|
2689 | 2747 |
x.ConnectedObject != null && |
2690 | 2748 |
x.ConnectedObject.GetType() == typeof(Line) && |
2691 | 2749 |
!string.IsNullOrEmpty(((Line)x.ConnectedObject).SPPID.ModelItemId)) |
... | ... | |
2703 | 2761 |
_LMSymbolStart = null; |
2704 | 2762 |
ReleaseCOMObjects(_LMSymbolEnd); |
2705 | 2763 |
_LMSymbolEnd = null; |
2706 |
|
|
2707 |
if (isBranchModeling && BranchLines.Contains(groupLine)) |
|
2708 |
BranchLines.Remove(groupLine); |
|
2709 | 2764 |
} |
2710 | 2765 |
} |
2711 | 2766 |
|
... | ... | |
2837 | 2892 |
{ |
2838 | 2893 |
if (!group.Contains(line)) |
2839 | 2894 |
group.Add(line); |
2895 |
|
|
2840 | 2896 |
foreach (var connector in line.CONNECTORS) |
2841 | 2897 |
{ |
2842 | 2898 |
if (connector.ConnectedObject != null && |
... | ... | |
2845 | 2901 |
string.IsNullOrEmpty(((Line)connector.ConnectedObject).SPPID.ModelItemId)) |
2846 | 2902 |
{ |
2847 | 2903 |
Line connLine = connector.ConnectedObject as Line; |
2848 |
if (!SPPIDUtil.IsBranchLine(connLine, line)) |
|
2904 |
if (line.CONNECTORS.IndexOf(connector) == 0 |
|
2905 |
&& (!SPPIDUtil.IsBranchLine(connLine, line))) |
|
2849 | 2906 |
{ |
2850 |
if (line.CONNECTORS.IndexOf(connector) == 0) |
|
2851 |
group.Insert(0, connLine); |
|
2852 |
else |
|
2853 |
group.Add(connLine); |
|
2907 |
|
|
2908 |
group.Insert(group.IndexOf(line), connLine); |
|
2909 |
GetConnectedLineGroup(connLine, group); |
|
2910 |
} |
|
2911 |
else if (line.CONNECTORS.IndexOf(connector) == 1 && !SPPIDUtil.IsBranchLine(connLine, line)) |
|
2912 |
{ |
|
2913 |
group.Add(connLine); |
|
2854 | 2914 |
GetConnectedLineGroup(connLine, group); |
2855 | 2915 |
} |
2856 | 2916 |
} |
... | ... | |
2893 | 2953 |
LineCoordinateCorrectionByConnItem(checkLine, lastSymbolConnector.ConnectedObject); |
2894 | 2954 |
for (int i = group.Count - 2; i >= 0; i--) |
2895 | 2955 |
{ |
2896 |
Line line = group[i + 1]; |
|
2897 |
Line prevLine = group[i]; |
|
2898 |
|
|
2899 |
// 같으면 보정 |
|
2900 |
if (line.SlopeType == prevLine.SlopeType) |
|
2901 |
LineCoordinateCorrectionByConnItem(prevLine, line); |
|
2902 |
else |
|
2903 |
{ |
|
2904 |
if (line.SlopeType == SlopeType.HORIZONTAL) |
|
2905 |
{ |
|
2906 |
double prevX = 0; |
|
2907 |
double prevY = 0; |
|
2908 |
GetTargetLineConnectorPoint(prevLine.CONNECTORS.Find(z => z.ConnectedObject == line), prevLine, ref prevX, ref prevY); |
|
2909 |
ChangeLineSPPIDCoordinateByConnectorOnlyX(line, prevLine, prevX); |
|
2910 |
|
|
2911 |
double x = 0; |
|
2912 |
double y = 0; |
|
2913 |
GetTargetLineConnectorPoint(line.CONNECTORS.Find(z => z.ConnectedObject == prevLine), line, ref x, ref y); |
|
2914 |
ChangeLineSPPIDCoordinateByConnectorOnlyY(prevLine, line, y); |
|
2915 |
} |
|
2916 |
else if (line.SlopeType == SlopeType.VERTICAL) |
|
2917 |
{ |
|
2918 |
double prevX = 0; |
|
2919 |
double prevY = 0; |
|
2920 |
GetTargetLineConnectorPoint(prevLine.CONNECTORS.Find(z => z.ConnectedObject == line), prevLine, ref prevX, ref prevY); |
|
2921 |
ChangeLineSPPIDCoordinateByConnectorOnlyY(line, prevLine, prevY); |
|
2922 |
|
|
2923 |
double x = 0; |
|
2924 |
double y = 0; |
|
2925 |
GetTargetLineConnectorPoint(line.CONNECTORS.Find(z => z.ConnectedObject == prevLine), line, ref x, ref y); |
|
2926 |
ChangeLineSPPIDCoordinateByConnectorOnlyX(prevLine, line, x); |
|
2927 |
} |
|
2928 |
break; |
|
2929 |
} |
|
2956 |
Line refLine = group[i + 1]; |
|
2957 |
Line changeline = group[i]; |
|
2958 |
LineCoordinateCorrectionByConnItem(changeline, refLine); |
|
2930 | 2959 |
} |
2931 | 2960 |
} |
2932 | 2961 |
} |
... | ... | |
2955 | 2984 |
|
2956 | 2985 |
private void ChangeLineSPPIDCoordinateByConnector(Line line, object connItem, double x, double y, bool changeOtherCoordinate = true) |
2957 | 2986 |
{ |
2987 |
if (line.UID == "52391a93-957c-49d1-87a1-d037e91d386c") |
|
2988 |
line.UID = line.UID; |
|
2989 |
|
|
2958 | 2990 |
bool isReverseX = line.SPPID.END_X - line.SPPID.START_X < 0; |
2959 | 2991 |
bool isReverseY = line.SPPID.END_Y - line.SPPID.START_Y < 0; |
2992 |
double minLength = GridSetting.GetInstance().Length * 0.5; |
|
2993 |
double minLengthX = minLength * (!isReverseX ? 1 : -1); |
|
2994 |
double minLengthY = minLength * (!isReverseY ? 1 : -1); |
|
2960 | 2995 |
|
2961 | 2996 |
Connector connector = line.CONNECTORS.Find(z => z.ConnectedObject == connItem); |
2962 | 2997 |
int index = line.CONNECTORS.IndexOf(connector); |
2963 | 2998 |
if (index == 0) |
2964 |
{
|
|
2999 |
{ |
|
2965 | 3000 |
line.SPPID.START_X = x; |
2966 | 3001 |
line.SPPID.START_Y = y; |
2967 | 3002 |
if (line.SlopeType == SlopeType.HORIZONTAL && changeOtherCoordinate) |
2968 | 3003 |
{ |
2969 | 3004 |
line.SPPID.END_Y = y; |
2970 |
// START_X가 END_X 값을 벗어날 경우 END_X 값 보정 |
|
2971 |
if ((line.SPPID.END_X - line.SPPID.START_X) * (!isReverseX ? 1 : -1) <= 0) |
|
3005 |
if (line.CONNECTORS[1].ConnectedObject != null) |
|
2972 | 3006 |
{ |
2973 |
line.SPPID.END_X = line.SPPID.START_X + (GridSetting.GetInstance().Length * (!isReverseX ? 1 : -1)); |
|
3007 |
if (line.CONNECTORS[1].ConnectedObject.GetType() == typeof(Line)) |
|
3008 |
{ |
|
3009 |
// START_X가 END_X 값을 벗어날 경우 END_X 값 보정 |
|
3010 |
if ((line.SPPID.END_X - line.SPPID.START_X) * (!isReverseX ? 1 : -1) <= minLength) |
|
3011 |
{ |
|
3012 |
line.SPPID.END_X = line.SPPID.START_X + minLengthX; |
|
3013 |
} |
|
3014 |
} |
|
3015 |
else if (line.CONNECTORS[1].ConnectedObject.GetType() == typeof(Symbol)) |
|
3016 |
{ |
|
3017 |
double x1 = 0; |
|
3018 |
double y1 = 0; |
|
3019 |
GetTargetSymbolConnectorPoint(line.CONNECTORS[1], (Symbol)line.CONNECTORS[1].ConnectedObject, ref x1, ref y1); |
|
3020 |
line.SPPID.END_X = x1; |
|
3021 |
line.SPPID.END_Y = y1; |
|
3022 |
} |
|
2974 | 3023 |
} |
2975 | 3024 |
} |
2976 | 3025 |
else if (line.SlopeType == SlopeType.VERTICAL && changeOtherCoordinate) |
2977 | 3026 |
{ |
2978 | 3027 |
line.SPPID.END_X = x; |
2979 |
// START_Y가 END_Y 값을 벗어날 경우 END_Y 값 보정 |
|
2980 |
if ((line.SPPID.END_Y - line.SPPID.START_Y) * (!isReverseY ? 1 : -1) <= 0) |
|
3028 |
if (line.CONNECTORS[1].ConnectedObject != null) |
|
2981 | 3029 |
{ |
2982 |
line.SPPID.END_Y = line.SPPID.START_Y + (GridSetting.GetInstance().Length * (!isReverseY ? 1 : -1)); |
|
3030 |
if (line.CONNECTORS[1].ConnectedObject.GetType() == typeof(Line)) |
|
3031 |
{ |
|
3032 |
// START_Y가 END_Y 값을 벗어날 경우 END_Y 값 보정 |
|
3033 |
if ((line.SPPID.END_Y - line.SPPID.START_Y) * (!isReverseY ? 1 : -1) <= minLength) |
|
3034 |
{ |
|
3035 |
line.SPPID.END_Y = line.SPPID.START_Y + minLengthY; |
|
3036 |
} |
|
3037 |
} |
|
3038 |
else if (line.CONNECTORS[1].ConnectedObject.GetType() == typeof(Symbol)) |
|
3039 |
{ |
|
3040 |
double x1 = 0; |
|
3041 |
double y1 = 0; |
|
3042 |
GetTargetSymbolConnectorPoint(line.CONNECTORS[1], (Symbol)line.CONNECTORS[1].ConnectedObject, ref x1, ref y1); |
|
3043 |
line.SPPID.END_X = x1; |
|
3044 |
line.SPPID.END_Y = y1; |
|
3045 |
} |
|
2983 | 3046 |
} |
2984 | 3047 |
} |
2985 | 3048 |
} |
... | ... | |
2990 | 3053 |
if (line.SlopeType == SlopeType.HORIZONTAL && changeOtherCoordinate) |
2991 | 3054 |
{ |
2992 | 3055 |
line.SPPID.START_Y = y; |
2993 |
// END_X가 START_X 값을 벗어날 경우 START_X 값 보정 |
|
2994 |
if ((line.SPPID.END_X - line.SPPID.START_X) * (isReverseX ? 1 : -1) <= 0) |
|
3056 |
if (line.CONNECTORS[0].ConnectedObject != null) |
|
2995 | 3057 |
{ |
2996 |
line.SPPID.START_X = line.SPPID.END_X - (GridSetting.GetInstance().Length * (!isReverseX ? 1 : -1)); |
|
3058 |
if (line.CONNECTORS[0].ConnectedObject.GetType() == typeof(Line)) |
|
3059 |
{ |
|
3060 |
// END_X가 START_X 값을 벗어날 경우 START_X 값 보정 |
|
3061 |
if ((line.SPPID.END_X - line.SPPID.START_X) * (!isReverseX ? 1 : -1) <= minLength) |
|
3062 |
{ |
|
3063 |
line.SPPID.START_X = line.SPPID.END_X - minLengthX; |
|
3064 |
} |
|
3065 |
} |
|
3066 |
else if (line.CONNECTORS[0].ConnectedObject.GetType() == typeof(Symbol)) |
|
3067 |
{ |
|
3068 |
double x1 = 0; |
|
3069 |
double y1 = 0; |
|
3070 |
GetTargetSymbolConnectorPoint(line.CONNECTORS[0], (Symbol)line.CONNECTORS[0].ConnectedObject, ref x1, ref y1); |
|
3071 |
line.SPPID.END_X = x1; |
|
3072 |
line.SPPID.END_Y = y1; |
|
3073 |
} |
|
2997 | 3074 |
} |
2998 | 3075 |
} |
2999 | 3076 |
else if (line.SlopeType == SlopeType.VERTICAL && changeOtherCoordinate) |
3000 | 3077 |
{ |
3001 | 3078 |
line.SPPID.START_X = x; |
3002 |
// END_Y가 START_Y 값을 벗어날 경우 START_Y 값 보정 |
|
3003 |
if ((line.SPPID.END_Y - line.SPPID.START_Y) * (isReverseY ? 1 : -1) <= 0) |
|
3079 |
if (line.CONNECTORS[0].ConnectedObject != null) |
|
3004 | 3080 |
{ |
3005 |
line.SPPID.START_Y = line.SPPID.END_Y - (GridSetting.GetInstance().Length * (!isReverseY ? 1 : -1)); |
|
3081 |
if (line.CONNECTORS[0].ConnectedObject.GetType() == typeof(Line)) |
|
3082 |
{ |
|
3083 |
// END_Y가 START_Y 값을 벗어날 경우 START_Y 값 보정 |
|
3084 |
if ((line.SPPID.END_Y - line.SPPID.START_Y) * (!isReverseY ? 1 : -1) <= minLength) |
|
3085 |
{ |
|
3086 |
line.SPPID.START_Y = line.SPPID.END_Y - minLengthY; |
|
3087 |
} |
|
3088 |
} |
|
3089 |
else if (line.CONNECTORS[0].ConnectedObject.GetType() == typeof(Symbol)) |
|
3090 |
{ |
|
3091 |
double x1 = 0; |
|
3092 |
double y1 = 0; |
|
3093 |
GetTargetSymbolConnectorPoint(line.CONNECTORS[0], (Symbol)line.CONNECTORS[0].ConnectedObject, ref x1, ref y1); |
|
3094 |
line.SPPID.END_X = x1; |
|
3095 |
line.SPPID.END_Y = y1; |
|
3096 |
} |
|
3006 | 3097 |
} |
3007 | 3098 |
} |
3008 | 3099 |
} |
... | ... | |
3341 | 3432 |
{ |
3342 | 3433 |
_LmLabelPersist = _placement.PIDPlaceLabel(endBreak.SPPID.MAPPINGNAME, ref array, null, null, LabeledItem: targetLMConnector.AsLMRepresentation(), IsLeaderVisible: leaderLine); |
3343 | 3434 |
} |
3344 |
|
|
3435 |
|
|
3345 | 3436 |
if (_LmLabelPersist != null) |
3346 | 3437 |
{ |
3347 | 3438 |
_LmLabelPersist.Commit(); |
... | ... | |
4344 | 4435 |
Log.Write(ex.Message + "\r\n" + ex.StackTrace); |
4345 | 4436 |
} |
4346 | 4437 |
} |
4347 |
|
|
4348 | 4438 |
private bool IsModelingEndBreak(Symbol symbol1, Symbol symbol2) |
4349 | 4439 |
{ |
4350 | 4440 |
bool result = false; |
... | ... | |
4658 | 4748 |
return targetConnector; |
4659 | 4749 |
} |
4660 | 4750 |
|
4661 |
private LMConnector FindTargetLMConnectorForBranch(Line line, Line targetLine, ref double x, ref double y)
|
|
4751 |
private LMConnector FindTargetLMConnectorForBranch(Line currentLine, Line targetLine, ref double x, ref double y)
|
|
4662 | 4752 |
{ |
4663 | 4753 |
Dictionary<LMConnector, List<double[]>> vertices = GetPipeRunVertices(targetLine.SPPID.ModelItemId); |
4664 | 4754 |
if (vertices.Count == 0) |
... | ... | |
4706 | 4796 |
|
4707 | 4797 |
SlopeType slope = SPPIDUtil.CalcSlope(minLineX, minLineY, maxLineX, maxLineY); |
4708 | 4798 |
|
4709 |
double[] crossingPoint = SPPIDUtil.CalcLineCrossingPoint(line.SPPID.START_X, line.SPPID.START_Y, line.SPPID.END_X, line.SPPID.END_Y, point1[0], point1[1], point2[0], point2[1]);
|
|
4799 |
double[] crossingPoint = SPPIDUtil.CalcLineCrossingPoint(currentLine.SPPID.START_X, currentLine.SPPID.START_Y, currentLine.SPPID.END_X, currentLine.SPPID.END_Y, point1[0], point1[1], point2[0], point2[1]);
|
|
4710 | 4800 |
if (crossingPoint != null) |
4711 | 4801 |
{ |
4712 | 4802 |
double distance = SPPIDUtil.CalcPointToPointdDistance(crossingPoint[0], crossingPoint[1], x, y); |
... | ... | |
4746 | 4836 |
if (item.Key != null && item.Key != targetConnector) |
4747 | 4837 |
ReleaseCOMObjects(item.Key); |
4748 | 4838 |
|
4749 |
if (SPPIDUtil.IsBranchLine(line, targetLine))
|
|
4839 |
if (SPPIDUtil.IsBranchLine(currentLine, targetLine))
|
|
4750 | 4840 |
{ |
4751 | 4841 |
double tempResultX = resultPoint[0]; |
4752 | 4842 |
double tempResultY = resultPoint[1]; |
4753 | 4843 |
SPPIDUtil.ConvertGridPoint(ref tempResultX, ref tempResultY); |
4754 | 4844 |
|
4755 | 4845 |
GridSetting gridSetting = GridSetting.GetInstance(); |
4756 |
|
|
4757 | 4846 |
for (int i = 0; i < targetVertices.Count; i++) |
4758 | 4847 |
{ |
4759 | 4848 |
double[] point = targetVertices[i]; |
... | ... | |
4835 | 4924 |
} |
4836 | 4925 |
} |
4837 | 4926 |
} |
4838 |
else if (i == targetVertices.Count - 1) |
|
4927 |
else if (i == targetVertices.Count - 1 && targetVertices.Count != 2)
|
|
4839 | 4928 |
{ |
4840 | 4929 |
LMSymbol connSymbol = targetConnector.ConnectItem2SymbolObject; |
4841 | 4930 |
bool containZeroLength = false; |
... | ... | |
5414 | 5503 |
AttributeMapping mapping = document.AttributeMappings.Find(x => x.UID == item.UID); |
5415 | 5504 |
if (mapping == null) |
5416 | 5505 |
continue; |
5417 |
|
|
5506 |
|
|
5418 | 5507 |
LMAAttribute _LMAAttribute = _LMModelItem.Attributes[mapping.SPPIDATTRIBUTENAME]; |
5419 | 5508 |
if (mapping.SPPIDATTRIBUTENAME == "OperFluidCode" && !string.IsNullOrEmpty(item.VALUE)) |
5420 | 5509 |
{ |
... | ... | |
6649 | 6738 |
|
6650 | 6739 |
int SortLinePriority(Line a, Line b) |
6651 | 6740 |
{ |
6652 |
// Branch 없는것부터 |
|
6653 |
int branchRetval = CompareBranchLine(a, b); |
|
6654 |
if (branchRetval != 0) |
|
6741 |
int childRetval = CompareChild(a, b); |
|
6742 |
if (childRetval != 0) |
|
6655 | 6743 |
{ |
6656 |
return branchRetval;
|
|
6744 |
return childRetval;
|
|
6657 | 6745 |
} |
6658 | 6746 |
else |
6659 |
{ |
|
6660 |
// Symbol 연결 갯수
|
|
6661 |
int connSymbolRetval = CompareConnSymbol(a, b);
|
|
6662 |
if (connSymbolRetval != 0)
|
|
6747 |
{
|
|
6748 |
// Branch 없는것부터
|
|
6749 |
int branchRetval = CompareBranchLine(a, b);
|
|
6750 |
if (branchRetval != 0)
|
|
6663 | 6751 |
{ |
6664 |
return connSymbolRetval;
|
|
6752 |
return branchRetval;
|
|
6665 | 6753 |
} |
6666 | 6754 |
else |
6667 | 6755 |
{ |
... | ... | |
6673 | 6761 |
} |
6674 | 6762 |
else |
6675 | 6763 |
{ |
6676 |
// ConnectedItem이 없는것
|
|
6677 |
int noneConnRetval = CompareNoneConn(a, b);
|
|
6678 |
if (noneConnRetval != 0)
|
|
6764 |
// line 길이
|
|
6765 |
int lengthRetval = CompareLength(a, b);
|
|
6766 |
if (lengthRetval != 0)
|
|
6679 | 6767 |
{ |
6680 |
return noneConnRetval;
|
|
6768 |
return lengthRetval;
|
|
6681 | 6769 |
} |
6682 | 6770 |
else |
6683 | 6771 |
{ |
6772 |
// Symbol 연결 갯수 |
|
6773 |
int connSymbolRetval = CompareConnSymbol(a, b); |
|
6774 |
if (connSymbolRetval != 0) |
|
6775 |
{ |
|
6776 |
return connSymbolRetval; |
|
6777 |
} |
|
6778 |
else |
|
6779 |
{ |
|
6780 |
// ConnectedItem이 없는것 |
|
6781 |
int noneConnRetval = CompareNoneConn(a, b); |
|
6782 |
if (noneConnRetval != 0) |
|
6783 |
{ |
|
6784 |
return noneConnRetval; |
|
6785 |
} |
|
6786 |
else |
|
6787 |
{ |
|
6684 | 6788 |
|
6789 |
} |
|
6790 |
} |
|
6685 | 6791 |
} |
6686 | 6792 |
} |
6687 | 6793 |
} |
... | ... | |
6690 | 6796 |
return 0; |
6691 | 6797 |
} |
6692 | 6798 |
|
6693 |
int CompareNotSegmentLine(Line a, Line b)
|
|
6799 |
int CompareChild(Line a, Line b)
|
|
6694 | 6800 |
{ |
6695 |
List<Connector> connectorsA = a.CONNECTORS |
|
6696 |
.Where(conn => conn.ConnectedObject != null && conn.ConnectedObject.GetType() == typeof(Symbol)) |
|
6697 |
.ToList(); |
|
6698 |
|
|
6699 |
List<Connector> connectorsB = b.CONNECTORS |
|
6700 |
.Where(conn => conn.ConnectedObject != null && conn.ConnectedObject.GetType() == typeof(Symbol)) |
|
6701 |
.ToList(); |
|
6801 |
int countA = a.CONNECTORS.Count(x => x.ConnectedObject != null && x.ConnectedObject.GetType() == typeof(Line) && x.ConnectedObject == b); |
|
6802 |
int countB = a.CONNECTORS.Count(x => x.ConnectedObject != null && x.ConnectedObject.GetType() == typeof(Line) && x.ConnectedObject == a); |
|
6702 | 6803 |
|
6703 |
// 오름차순
|
|
6704 |
return connectorsB.Count.CompareTo(connectorsA.Count);
|
|
6804 |
// 내림차순
|
|
6805 |
return countA.CompareTo(countB);
|
|
6705 | 6806 |
} |
6706 | 6807 |
|
6707 | 6808 |
int CompareConnSymbol(Line a, Line b) |
... | ... | |
6714 | 6815 |
.Where(conn => conn.ConnectedObject != null && conn.ConnectedObject.GetType() == typeof(Symbol)) |
6715 | 6816 |
.ToList(); |
6716 | 6817 |
|
6818 |
// 내림차순 |
|
6819 |
return connectorsA.Count.CompareTo(connectorsB.Count); |
|
6820 |
} |
|
6821 |
|
|
6822 |
int CompareLength(Line a, Line b) |
|
6823 |
{ |
|
6824 |
double lengthA = Math.Abs(a.SPPID.START_X - a.SPPID.END_X) + Math.Abs(a.SPPID.START_Y - a.SPPID.END_Y); |
|
6825 |
double lengthB = Math.Abs(b.SPPID.START_X - b.SPPID.END_X) + Math.Abs(b.SPPID.START_Y - b.SPPID.END_Y); |
|
6826 |
|
|
6717 | 6827 |
// 오름차순 |
6718 |
return connectorsB.Count.CompareTo(connectorsA.Count);
|
|
6828 |
return lengthB.CompareTo(lengthA);
|
|
6719 | 6829 |
} |
6720 | 6830 |
|
6721 | 6831 |
int CompareConnItem(Line a, Line b) |
... | ... | |
6732 | 6842 |
(conn.ConnectedObject.GetType() == typeof(Line) && !SPPIDUtil.IsBranchLine((Line)conn.ConnectedObject, b)))) |
6733 | 6843 |
.ToList(); |
6734 | 6844 |
|
6735 |
// 오름차순
|
|
6736 |
return connectorsB.Count.CompareTo(connectorsA.Count);
|
|
6845 |
// 내림차순
|
|
6846 |
return connectorsA.Count.CompareTo(connectorsB.Count);
|
|
6737 | 6847 |
} |
6738 | 6848 |
|
6739 | 6849 |
int CompareBranchLine(Line a, Line b) |
... | ... | |
6759 | 6869 |
.Where(conn => conn.ConnectedObject == null) |
6760 | 6870 |
.ToList(); |
6761 | 6871 |
|
6762 |
// 오름차순
|
|
6763 |
return connectorsB.Count.CompareTo(connectorsA.Count);
|
|
6872 |
// 내림차순
|
|
6873 |
return connectorsA.Count.CompareTo(connectorsB.Count);
|
|
6764 | 6874 |
} |
6765 | 6875 |
} |
6766 | 6876 |
|
... | ... | |
6822 | 6932 |
private void SortBranchLines() |
6823 | 6933 |
{ |
6824 | 6934 |
BranchLines.Sort(SortBranchLine); |
6935 |
|
|
6825 | 6936 |
int SortBranchLine(Line a, Line b) |
6826 | 6937 |
{ |
6827 |
int countA = a.CONNECTORS.FindAll(x => x.ConnectedObject != null && |
|
6828 |
x.ConnectedObject.GetType() == typeof(Line) && |
|
6829 |
SPPIDUtil.IsBranchLine(x.ConnectedObject as Line, a) && |
|
6830 |
string.IsNullOrEmpty(((Line)x.ConnectedObject).SPPID.ModelItemId)).Count; |
|
6938 |
int childRetval = CompareChild(a, b); |
|
6939 |
if (childRetval != 0) |
|
6940 |
{ |
|
6941 |
return childRetval; |
|
6942 |
} |
|
6943 |
else |
|
6944 |
{ |
|
6945 |
int branchRetval = CompareChildBranch(a, b); |
|
6946 |
if (branchRetval != 0) |
|
6947 |
{ |
|
6948 |
return branchRetval; |
|
6949 |
} |
|
6950 |
else |
|
6951 |
{ |
|
6952 |
// line 길이 |
|
6953 |
int lengthRetval = CompareLength(a, b); |
|
6954 |
if (lengthRetval != 0) |
|
6955 |
{ |
|
6956 |
return lengthRetval; |
|
6957 |
} |
|
6958 |
} |
|
6959 |
} |
|
6960 |
return 0; |
|
6961 |
} |
|
6962 |
|
|
6963 |
int CompareLength(Line a, Line b) |
|
6964 |
{ |
|
6965 |
double lengthA = Math.Abs(a.SPPID.START_X - a.SPPID.END_X) + Math.Abs(a.SPPID.START_Y - a.SPPID.END_Y); |
|
6966 |
double lengthB = Math.Abs(b.SPPID.START_X - b.SPPID.END_X) + Math.Abs(b.SPPID.START_Y - b.SPPID.END_Y); |
|
6831 | 6967 |
|
6832 |
int countB = b.CONNECTORS.FindAll(x => x.ConnectedObject != null && |
|
6833 |
x.ConnectedObject.GetType() == typeof(Line) && |
|
6834 |
SPPIDUtil.IsBranchLine(x.ConnectedObject as Line, b) && |
|
6835 |
string.IsNullOrEmpty(((Line)x.ConnectedObject).SPPID.ModelItemId)).Count; |
|
6968 |
// 오름차순 |
|
6969 |
return lengthB.CompareTo(lengthA); |
|
6970 |
} |
|
6971 |
|
|
6972 |
int CompareChildBranch(Line a, Line b) |
|
6973 |
{ |
|
6974 |
int countA = document.LINES.Count(c => c.CONNECTORS.Any(n => n.ConnectedObject != null && |
|
6975 |
n.ConnectedObject.GetType() == typeof(Line) && n.ConnectedObject == a)); |
|
6976 |
|
|
6977 |
int countB = document.LINES.Count(c => c.CONNECTORS.Any(n => n.ConnectedObject != null && |
|
6978 |
n.ConnectedObject.GetType() == typeof(Line) && n.ConnectedObject == b)); |
|
6979 |
|
|
6980 |
// 오름차순 |
|
6981 |
return countB.CompareTo(countA); |
|
6982 |
} |
|
6983 |
|
|
6984 |
int CompareChild(Line a, Line b) |
|
6985 |
{ |
|
6986 |
int countA = a.CONNECTORS.Count(x => x.ConnectedObject != null && x.ConnectedObject.GetType() == typeof(Line) && x.ConnectedObject == b); |
|
6987 |
int countB = a.CONNECTORS.Count(x => x.ConnectedObject != null && x.ConnectedObject.GetType() == typeof(Line) && x.ConnectedObject == a); |
|
6836 | 6988 |
|
6837 | 6989 |
// 내림차순 |
6838 | 6990 |
return countA.CompareTo(countB); |
6839 | 6991 |
} |
6840 | 6992 |
} |
6841 | 6993 |
|
6842 |
|
|
6843 |
|
|
6844 | 6994 |
private string GetSPPIDFileName(LMModelItem modelItem) |
6845 | 6995 |
{ |
6846 | 6996 |
string symbolPath = null; |
DTI_PID/SPPIDConverter/SPPIDConverter.csproj | ||
---|---|---|
443 | 443 |
<None Include="Resources\logo_color.png" /> |
444 | 444 |
</ItemGroup> |
445 | 445 |
<ItemGroup> |
446 |
<None Include="Resources\lic.txt" /> |
|
447 |
</ItemGroup> |
|
448 |
<ItemGroup> |
|
449 | 446 |
<None Include="Resources\productquickcomparisons.svg" /> |
450 | 447 |
</ItemGroup> |
451 | 448 |
<ItemGroup> |
내보내기 Unified diff