개정판 f4880c6a
dev issue #000 : Line Number ConnLIne 적용으로 제일 가까운 Connector에 Label 생성
Change-Id: I935bb062697fba65c796f2174b23fa8af54657a5
DTI_PID/BaseModel/Model/Document.cs | ||
---|---|---|
217 | 217 |
WIDTH = item.Element("WIDTH").Value, |
218 | 218 |
HEIGHT = item.Element("HEIGHT").Value, |
219 | 219 |
ANGLE = Convert.ToDouble(item.Element("ANGLE").Value), |
220 |
AREA = item.Element("AREA").Value |
|
220 |
AREA = item.Element("AREA").Value, |
|
221 |
CONNLINE = item.Element("CONNLINE").Value |
|
221 | 222 |
}; |
222 | 223 |
SetLineNumberRuns(item, lineNumber.RUNS); |
223 | 224 |
SetProperties(item.Element("PROPERTIES"), lineNumber.PROPERTIES); |
DTI_PID/BaseModel/Model/LineNumber.cs | ||
---|---|---|
15 | 15 |
private string _HEIGHT; |
16 | 16 |
private double _ANGLE; |
17 | 17 |
private string _AREA; |
18 |
private string _CONNLINE; |
|
18 | 19 |
private List<LineRun> _RUNS = new List<LineRun>(); |
19 | 20 |
private List<Property> _PROPERTIES = new List<Property>(); |
20 | 21 |
private List<Attribute> _ATTRIBUTES = new List<Attribute>(); |
... | ... | |
47 | 48 |
public List<Property> PROPERTIES { get => _PROPERTIES; set => _PROPERTIES = value; } |
48 | 49 |
public List<Attribute> ATTRIBUTES { get => _ATTRIBUTES; set => _ATTRIBUTES = value; } |
49 | 50 |
public SPPIDSymbolInfo SPPID { get => _SPPID; set => _SPPID = value; } |
51 |
public string CONNLINE { get => _CONNLINE; set => _CONNLINE = value; } |
|
50 | 52 |
} |
51 | 53 |
} |
DTI_PID/SPPIDConverter/AutoModeling.cs | ||
---|---|---|
987 | 987 |
|
988 | 988 |
private void LineNumberModeling(LineNumber lineNumber) |
989 | 989 |
{ |
990 |
Line line = null; |
|
991 |
foreach (var lineRun in lineNumber.RUNS) |
|
992 |
{ |
|
993 |
foreach (var item in lineRun.RUNITEMS) |
|
994 |
{ |
|
995 |
line = item as Line; |
|
996 |
if (line != null && !string.IsNullOrEmpty(line.SPPID.ModelItemId)) |
|
997 |
break; |
|
998 |
else |
|
999 |
line = null; |
|
1000 |
} |
|
1001 |
if (line != null) |
|
1002 |
break; |
|
1003 |
} |
|
1004 |
|
|
1005 |
if (line != null && !string.IsNullOrEmpty(line.SPPID.ModelItemId)) |
|
990 |
Line line = SPPIDUtil.FindObjectByUID(document, lineNumber.CONNLINE) as Line; |
|
991 |
Dictionary<LMConnector, List<double[]>> connectorVertices = GetPipeRunVertices(line.SPPID.ModelItemId); |
|
992 |
LMConnector connectedLMConnector = FindTargetLMConnectorByPoint(connectorVertices, lineNumber.SPPID.ORIGINAL_X, lineNumber.SPPID.ORIGINAL_Y); |
|
993 |
if (connectedLMConnector != null) |
|
1006 | 994 |
{ |
1007 | 995 |
Array points = new double[] { 0, lineNumber.SPPID.ORIGINAL_X, lineNumber.SPPID.ORIGINAL_Y }; |
1008 |
LMPipeRun _pipeRun = dataSource.GetPipeRun(line.SPPID.ModelItemId); |
|
1009 |
if (_pipeRun != null) |
|
1010 |
{ |
|
1011 |
foreach (LMRepresentation rep in _pipeRun.Representations) |
|
1012 |
{ |
|
1013 |
if (rep.get_RepresentationType() == "Connector" && rep.get_ItemStatus() == "Active") |
|
1014 |
{ |
|
1015 |
LMConnector _LmConnector = dataSource.GetConnector(rep.Id); |
|
1016 |
LMLabelPersist _LmLabelPresist = _placement.PIDPlaceLabel(lineNumber.SPPID.MAPPINGNAME, ref points, Rotation: lineNumber.ANGLE, LabeledItem: _LmConnector.AsLMRepresentation(), IsLeaderVisible: false); |
|
1017 |
_LmLabelPresist.Commit(); |
|
996 |
LMLabelPersist _LmLabelPresist = _placement.PIDPlaceLabel(lineNumber.SPPID.MAPPINGNAME, ref points, Rotation: lineNumber.ANGLE, LabeledItem: connectedLMConnector.AsLMRepresentation(), IsLeaderVisible: false); |
|
997 |
_LmLabelPresist.Commit(); |
|
1018 | 998 |
|
1019 |
if (_LmConnector != null) |
|
1020 |
ReleaseCOMObjects(_LmConnector); |
|
1021 |
if (_LmLabelPresist != null) |
|
1022 |
{ |
|
1023 |
lineNumber.SPPID.RepresentationId = _LmLabelPresist.AsLMRepresentation().Id; |
|
1024 |
ReleaseCOMObjects(_LmConnector); |
|
1025 |
} |
|
1026 |
|
|
1027 |
break; |
|
1028 |
} |
|
1029 |
} |
|
1030 |
|
|
1031 |
ReleaseCOMObjects(_pipeRun); |
|
999 |
foreach (var item in connectorVertices) |
|
1000 |
ReleaseCOMObjects(item.Key); |
|
1001 |
if (_LmLabelPresist != null) |
|
1002 |
{ |
|
1003 |
lineNumber.SPPID.RepresentationId = _LmLabelPresist.AsLMRepresentation().Id; |
|
1004 |
ReleaseCOMObjects(_LmLabelPresist); |
|
1032 | 1005 |
} |
1033 | 1006 |
} |
1034 | 1007 |
} |
DTI_PID/SPPIDConverter/ConverterForm.cs | ||
---|---|---|
545 | 545 |
#if DEBUG |
546 | 546 |
this.Visible = false; |
547 | 547 |
|
548 |
SPPID_Document document = new SPPID_Document(@"Z:\HanKyouHo\temp\Isocynates\Temp\11111.xml"); |
|
548 |
//SPPID_Document document = new SPPID_Document(@"Z:\HanKyouHo\temp\Isocynates\Temp\11111.xml");
|
|
549 | 549 |
//SPPID_Document document = new SPPID_Document(@"Z:\HanKyouHo\temp\Isocynates\Temp\zIsocynates-325_Page75.xml"); |
550 |
//SPPID_Document document = new SPPID_Document(@"Z:\HanKyouHo\temp\Isocynates\Temp\Isocynates-325_Page49.xml");
|
|
550 |
SPPID_Document document = new SPPID_Document(@"Z:\HanKyouHo\temp\Isocynates\Temp\Isocynates-325_Page49.xml"); |
|
551 | 551 |
document.SymbolMappings = symbolMappings; |
552 | 552 |
document.ChildSymbolMappings = childSymbolMappings; |
553 | 553 |
document.LineMappings = lineMappings; |
내보내기 Unified diff