개정판 8701de36
dev issue #707 : Line Number 모델링
Change-Id: I365cac2f117678cdc9f8e193262794d99016ef9c
DTI_PID/SPPIDConverter/AutoModeling.cs | ||
---|---|---|
109 | 109 |
RunFlowDirection(); |
110 | 110 |
// Join Run |
111 | 111 |
RunJoinRun(); |
112 |
//Line Number Modeling |
|
113 |
RunLineNumberModeling(); |
|
112 | 114 |
// Note Modeling |
113 | 115 |
RunNoteModeling(); |
114 | 116 |
// Text Modeling |
... | ... | |
441 | 443 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.UpProgress, null); |
442 | 444 |
} |
443 | 445 |
} |
446 |
private void RunLineNumberModeling() |
|
447 |
{ |
|
448 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllProgress, document.LINENUMBERS.Count); |
|
449 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Line Number Modeling"); |
|
450 |
foreach (var item in document.LINENUMBERS) |
|
451 |
{ |
|
452 |
LMLabelPersist label = dataSource.GetLabelPersist(item.SPPID.RepresentationId); |
|
453 |
if (label == null || (label != null && label.get_ItemStatus() != "Active")) |
|
454 |
{ |
|
455 |
ReleaseCOMObjects(label); |
|
456 |
item.SPPID.RepresentationId = null; |
|
457 |
LineNumberModeling(item); |
|
458 |
} |
|
459 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.UpProgress, null); |
|
460 |
} |
|
461 |
} |
|
444 | 462 |
private void RunFlowDirection() |
445 | 463 |
{ |
446 | 464 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllProgress, |
... | ... | |
1655 | 1673 |
ReModelingLine(groupLine, _lMConnector, _LMSymbolStart, _LMSymbolEnd, bRemodelingStart, bRemodelingEnd); |
1656 | 1674 |
|
1657 | 1675 |
FlowMarkModeling(groupLine); |
1658 |
LineNumberModeling(groupLine); |
|
1676 |
LineNumberModelingOnlyOne(groupLine);
|
|
1659 | 1677 |
|
1660 | 1678 |
ReleaseCOMObjects(_lMConnector); |
1661 | 1679 |
} |
... | ... | |
3025 | 3043 |
/// Line Number Symbol을 실제로 Modeling하는 메서드 |
3026 | 3044 |
/// </summary> |
3027 | 3045 |
/// <param name="lineNumber"></param> |
3028 |
private void LineNumberModeling(Line line) |
|
3046 |
private void LineNumberModelingOnlyOne(Line line)
|
|
3029 | 3047 |
{ |
3030 | 3048 |
LineNumber lineNumber = document.LINENUMBERS.Find(x => x.CONNLINE == line.UID); |
3031 | 3049 |
if (lineNumber != null) |
... | ... | |
3049 | 3067 |
} |
3050 | 3068 |
} |
3051 | 3069 |
} |
3070 |
private void LineNumberModeling(LineNumber lineNumber) |
|
3071 |
{ |
|
3072 |
Line line = SPPIDUtil.FindObjectByUID(document, lineNumber.CONNLINE) as Line; |
|
3073 |
if (line != null) |
|
3074 |
{ |
|
3075 |
double x = 0; |
|
3076 |
double y = 0; |
|
3077 |
CalcLabelLocation(ref x, ref y, lineNumber.SPPID.ORIGINAL_X, lineNumber.SPPID.ORIGINAL_Y, lineNumber.SPPIDLabelLocation, _ETCSetting.LineNumberLocation); |
|
3078 |
|
|
3079 |
Dictionary<LMConnector, List<double[]>> connectorVertices = GetPipeRunVertices(line.SPPID.ModelItemId); |
|
3080 |
LMConnector connectedLMConnector = FindTargetLMConnectorForLabel(connectorVertices, x, y); |
|
3081 |
if (connectedLMConnector != null) |
|
3082 |
{ |
|
3083 |
Array points = new double[] { 0, x, y }; |
|
3084 |
LMLabelPersist _LmLabelPresist = _placement.PIDPlaceLabel(lineNumber.SPPID.MAPPINGNAME, ref points, Rotation: lineNumber.ANGLE, LabeledItem: connectedLMConnector.AsLMRepresentation(), IsLeaderVisible: false); |
|
3052 | 3085 |
|
3086 |
if (_LmLabelPresist != null) |
|
3087 |
{ |
|
3088 |
_LmLabelPresist.Commit(); |
|
3089 |
lineNumber.SPPID.RepresentationId = _LmLabelPresist.AsLMRepresentation().Id; |
|
3090 |
ReleaseCOMObjects(_LmLabelPresist); |
|
3091 |
} |
|
3092 |
} |
|
3093 |
|
|
3094 |
foreach (var item in connectorVertices) |
|
3095 |
ReleaseCOMObjects(item.Key); |
|
3096 |
} |
|
3097 |
} |
|
3053 | 3098 |
/// <summary> |
3054 | 3099 |
/// Flow Mark Modeling |
3055 | 3100 |
/// </summary> |
DTI_PID/SPPIDConverter/BaseModel/Document.cs | ||
---|---|---|
279 | 279 |
}; |
280 | 280 |
if (item.Element("CONNLINE") != null) |
281 | 281 |
lineNumber.CONNLINE = item.Element("CONNLINE").Value; |
282 |
else |
|
283 |
{ |
|
284 |
validationStringBuilder.AppendLine("Not exist CONNLINE!" + "\r\nLineNumber UID : " + lineNumber.CONNLINE); |
|
285 |
validationStringBuilder.AppendLine(); |
|
286 |
validationResult = true; |
|
287 |
} |
|
282 | 288 |
|
283 | 289 |
SetLineNumberRuns(item, lineNumber.RUNS); |
284 | 290 |
SetProperties(item.Element("PROPERTIES"), lineNumber.PROPERTIES); |
내보내기 Unified diff