개정판 2e69e97c
DEV ISSUE #000 : 처리
Change-Id: I0c2cc1b57e0c00b77591100c7c3b0dbba556ce5f
DTI_PID/SPPIDConverter/AutoModeling.cs | ||
---|---|---|
86 | 86 |
/// </summary> |
87 | 87 |
public void Run() |
88 | 88 |
{ |
89 |
//string drawingNumber = document.DrawingNumber;
|
|
90 |
//string drawingName = document.DrawingName;
|
|
89 |
string drawingNumber = document.DrawingNumber; |
|
90 |
string drawingName = document.DrawingName; |
|
91 | 91 |
try |
92 | 92 |
{ |
93 | 93 |
nominalDiameterTable = Project_DB.SelectProjectNominalDiameter(); |
94 | 94 |
_placement = new Placement(); |
95 | 95 |
dataSource = _placement.PIDDataSource; |
96 | 96 |
|
97 |
//if (CreateDocument(ref drawingNumber, ref drawingName) && DocumentCoordinateCorrection()) |
|
98 |
if (DocumentCoordinateCorrection()) |
|
97 |
if (CreateDocument(ref drawingNumber, ref drawingName) && DocumentCoordinateCorrection()) |
|
99 | 98 |
{ |
100 | 99 |
Log.Write("Start Modeling"); |
101 | 100 |
SplashScreenManager.ShowForm(typeof(SPPIDSplashScreen), true, true); |
... | ... | |
161 | 160 |
} |
162 | 161 |
finally |
163 | 162 |
{ |
164 |
//Project_DB.InsertDrawingInfoAndOPCInfo(document.PATH, drawingNumber, drawingName, document);
|
|
163 |
Project_DB.InsertDrawingInfoAndOPCInfo(document.PATH, drawingNumber, drawingName, document); |
|
165 | 164 |
//Project_DB.InsertLineNumberInfo(document.PATH, drawingNumber, drawingName, document); |
166 | 165 |
|
167 | 166 |
if (SplashScreenManager.Default != null && SplashScreenManager.Default.IsSplashFormVisible) |
... | ... | |
179 | 178 |
application = null; |
180 | 179 |
if (radApp.ActiveDocument != null) |
181 | 180 |
{ |
182 |
//if (closeDocument && newDrawing != null)
|
|
183 |
//{
|
|
184 |
// newDrawing.Save();
|
|
185 |
// newDrawing.CloseDrawing(true);
|
|
186 |
// ReleaseCOMObjects(newDrawing);
|
|
187 |
// newDrawing = null;
|
|
188 |
//}
|
|
189 |
//else if (newDrawing == null)
|
|
190 |
//{
|
|
191 |
// Log.Write("error document");
|
|
192 |
//}
|
|
181 |
if (closeDocument && newDrawing != null) |
|
182 |
{ |
|
183 |
newDrawing.Save(); |
|
184 |
newDrawing.CloseDrawing(true); |
|
185 |
ReleaseCOMObjects(newDrawing); |
|
186 |
newDrawing = null; |
|
187 |
} |
|
188 |
else if (newDrawing == null) |
|
189 |
{ |
|
190 |
Log.Write("error document"); |
|
191 |
} |
|
193 | 192 |
} |
194 | 193 |
|
195 | 194 |
ReleaseCOMObjects(dataSource); |
... | ... | |
1010 | 1009 |
Log.Write(ex.Message); |
1011 | 1010 |
Log.Write(ex.StackTrace); |
1012 | 1011 |
} |
1013 |
|
|
1012 |
|
|
1014 | 1013 |
} |
1015 | 1014 |
|
1016 | 1015 |
foreach (var item in document.LINENUMBERS) |
... | ... | |
1159 | 1158 |
smartFrame.ChangeSource(Ingr.RAD2D.OLEInsertionTypeConstant.igOLELinked, setting.BorderFilePath, true); |
1160 | 1159 |
smartFrame.Update(); |
1161 | 1160 |
} |
1162 |
|
|
1161 |
|
|
1163 | 1162 |
} |
1164 | 1163 |
} |
1165 | 1164 |
} |
... | ... | |
1618 | 1617 |
double y2 = 0; |
1619 | 1618 |
symbol2d.Range(out x1, out y1, out x2, out y2); |
1620 | 1619 |
range = new double[] { x1, y1, x2, y2 }; |
1621 |
|
|
1620 |
|
|
1622 | 1621 |
for (int i = 1; i < 30; i++) |
1623 | 1622 |
{ |
1624 | 1623 |
double connX = 0; |
... | ... | |
1758 | 1757 |
} |
1759 | 1758 |
} |
1760 | 1759 |
} |
1761 |
|
|
1760 |
|
|
1762 | 1761 |
} |
1763 | 1762 |
} |
1764 | 1763 |
|
... | ... | |
2392 | 2391 |
} |
2393 | 2392 |
else |
2394 | 2393 |
{ |
2395 |
placeRunInputs.AddPoint( x, y);
|
|
2394 |
placeRunInputs.AddPoint(x, y); |
|
2396 | 2395 |
ChangeLineSPPIDCoordinateByConnector(groupLine, targetLine, x, y, false); |
2397 | 2396 |
} |
2398 | 2397 |
} |
... | ... | |
3150 | 3149 |
} |
3151 | 3150 |
else |
3152 | 3151 |
symbolPath = changeSymbolPath; |
3153 |
|
|
3152 |
|
|
3154 | 3153 |
#endregion |
3155 | 3154 |
|
3156 | 3155 |
LMConnector newConnector = null; |
... | ... | |
3229 | 3228 |
downStreamObj != null) |
3230 | 3229 |
{ |
3231 | 3230 |
LMConnector targetLMConnector = FindBreakLineTarget(upStreamObj, downStreamObj); |
3232 |
if (upStreamObj.GetType() == typeof(Symbol) && downStreamObj.GetType() == typeof(Symbol) &&
|
|
3233 |
targetLMConnector != null &&
|
|
3231 |
if (upStreamObj.GetType() == typeof(Symbol) && downStreamObj.GetType() == typeof(Symbol) && |
|
3232 |
targetLMConnector != null && |
|
3234 | 3233 |
!IsModelingEndBreak(upStreamObj as Symbol, downStreamObj as Symbol)) |
3235 | 3234 |
targetLMConnector = ReModelingZeroLengthLMConnectorForSegment(targetLMConnector); |
3236 | 3235 |
|
... | ... | |
3497 | 3496 |
else if (targetLine.CONNECTORS[1].CONNECTEDITEM == connLine.UID && targetLine.SPPID.START_Y > targetLine.SPPID.END_Y) |
3498 | 3497 |
location = location | SegmentLocation.Up; |
3499 | 3498 |
} |
3500 |
|
|
3499 |
|
|
3501 | 3500 |
} |
3502 | 3501 |
} |
3503 | 3502 |
else |
... | ... | |
3807 | 3806 |
|
3808 | 3807 |
foreach (var connector in connectors) |
3809 | 3808 |
ReleaseCOMObjects(connector); |
3810 |
|
|
3809 |
|
|
3811 | 3810 |
return result; |
3812 | 3811 |
|
3813 | 3812 |
|
... | ... | |
4318 | 4317 |
{ |
4319 | 4318 |
foreach (LMRepresentation rep in modelItem.Representations) |
4320 | 4319 |
{ |
4321 |
if (rep.Attributes["RepresentationType"].get_Value() == "Connector" &&
|
|
4320 |
if (rep.Attributes["RepresentationType"].get_Value() == "Connector" && |
|
4322 | 4321 |
rep.Attributes["ItemStatus"].get_Value() == "Active") |
4323 | 4322 |
{ |
4324 | 4323 |
LMConnector connector = dataSource.GetConnector(rep.Id); |
... | ... | |
4665 | 4664 |
else if (mapping.SPPIDATTRIBUTENAME.Equals("NominalDiameter") && !string.IsNullOrEmpty(attribute.VALUE) && _LMAAttribute != null) |
4666 | 4665 |
{ |
4667 | 4666 |
DataRow[] rows = nominalDiameterTable.Select(string.Format("MetricStr = '{0}' OR InchStr = '{0}'", attribute.VALUE)); |
4668 |
|
|
4667 |
|
|
4669 | 4668 |
if (rows.Length.Equals(1)) |
4670 | 4669 |
{ |
4671 | 4670 |
if (_ETCSetting.UnitSetting != null && _ETCSetting.UnitSetting.Equals("Metric")) |
... | ... | |
5444 | 5443 |
} |
5445 | 5444 |
} |
5446 | 5445 |
} |
5447 |
|
|
5446 |
|
|
5448 | 5447 |
|
5449 | 5448 |
if (needRemodeling) |
5450 | 5449 |
{ |
... | ... | |
5546 | 5545 |
right.Add(loopText); |
5547 | 5546 |
// Text 왼쪽 |
5548 | 5547 |
else |
5549 |
left.Add(loopText);
|
|
5548 |
left.Add(loopText); |
|
5550 | 5549 |
} |
5551 | 5550 |
else |
5552 | 5551 |
{ |
... | ... | |
5558 | 5557 |
up.Add(loopText); |
5559 | 5558 |
} |
5560 | 5559 |
} |
5561 |
|
|
5560 |
|
|
5562 | 5561 |
#endregion |
5563 | 5562 |
|
5564 | 5563 |
foreach (var texts in sortTexts) |
5565 | 5564 |
{ |
5566 |
if (texts.Count == 0 )
|
|
5565 |
if (texts.Count == 0) |
|
5567 | 5566 |
continue; |
5568 |
|
|
5567 |
|
|
5569 | 5568 |
#region 첫번째 Text로 기준 맞춤 |
5570 | 5569 |
for (int i = 0; i < texts.Count; i++) |
5571 | 5570 |
{ |
... | ... | |
6075 | 6074 |
int CompareConnItem(Line a, Line b) |
6076 | 6075 |
{ |
6077 | 6076 |
List<Connector> connectorsA = a.CONNECTORS |
6078 |
.Where(conn => conn.ConnectedObject != null &&
|
|
6079 |
(conn.ConnectedObject.GetType() == typeof(Symbol) ||
|
|
6077 |
.Where(conn => conn.ConnectedObject != null && |
|
6078 |
(conn.ConnectedObject.GetType() == typeof(Symbol) || |
|
6080 | 6079 |
(conn.ConnectedObject.GetType() == typeof(Line) && !SPPIDUtil.IsBranchLine((Line)conn.ConnectedObject, a)))) |
6081 | 6080 |
.ToList(); |
6082 | 6081 |
|
내보내기 Unified diff