개정판 898e39fe
dev issue #507 : fix line number modeling
Change-Id: Iaf3cfe3496defe97abe665dda147220dca90d707
DTI_PID/SPPIDConverter/AutoModeling.cs | ||
---|---|---|
4252 | 4252 |
LMConnector connectedLMConnector = FindTargetLMConnectorForLabel(connectorVertices, x, y); |
4253 | 4253 |
if (connectedLMConnector != null) |
4254 | 4254 |
{ |
4255 |
|
|
4256 |
if (connectedLMConnector.ConnectItem1SymbolObject != null && |
|
4257 |
connectedLMConnector.ConnectItem1SymbolObject.get_RepresentationType() == "OPC") |
|
4258 |
{ |
|
4259 |
|
|
4260 |
} |
|
4261 |
if (connectedLMConnector.ConnectItem2SymbolObject != null && |
|
4262 |
connectedLMConnector.ConnectItem2SymbolObject.get_RepresentationType() == "OPC") |
|
4263 |
{ |
|
4264 |
|
|
4265 |
} |
|
4266 |
|
|
4267 | 4255 |
Array points = new double[] { 0, x, y }; |
4268 | 4256 |
lineNumber.SPPID.SPPID_X = x; |
4269 | 4257 |
lineNumber.SPPID.SPPID_Y = y; |
... | ... | |
4293 | 4281 |
if (removeLabel != null) |
4294 | 4282 |
{ |
4295 | 4283 |
GridSetting gridSetting = GridSetting.GetInstance(); |
4284 |
LMConnector connector = dataSource.GetConnector(removeLabel.RepresentationID); |
|
4285 |
// |
|
4296 | 4286 |
double[] labelRange = null; |
4297 | 4287 |
GetSPPIDSymbolRange(removeLabel, ref labelRange); |
4298 |
LMConnector connector = dataSource.GetConnector(removeLabel.RepresentationID); |
|
4299 | 4288 |
List<double[]> vertices = GetConnectorVertices(connector); |
4300 | 4289 |
|
4301 | 4290 |
double[] resultStart = null; |
... | ... | |
4388 | 4377 |
} |
4389 | 4378 |
} |
4390 | 4379 |
|
4391 |
if (offsetY != 0 && offsetY != 0)
|
|
4380 |
if (offsetY != 0 || offsetY != 0)
|
|
4392 | 4381 |
{ |
4382 |
if (connector.ConnectItem1SymbolObject != null && |
|
4383 |
connector.ConnectItem1SymbolObject.get_RepresentationType() == "OPC") |
|
4384 |
{ |
|
4385 |
Ingr.RAD2D.Symbol2d symbol = radApp.ActiveDocument.ActiveSheet.DrawingObjects[connector.ConnectItem1SymbolObject.get_GraphicOID().ToString()]; |
|
4386 |
|
|
4387 |
double x1, y1, x2, y2, originX, originY; |
|
4388 |
symbol.Range(out x1, out y1, out x2, out y2); |
|
4389 |
symbol.GetOrigin(out originX, out originY); |
|
4390 |
if (originX < lineNumber.SPPID.SPPID_X) |
|
4391 |
lineNumber.SPPID.SPPID_X = originX + gridSetting.Length * 35; |
|
4392 |
else |
|
4393 |
lineNumber.SPPID.SPPID_X = originX - gridSetting.Length * 35; |
|
4394 |
} |
|
4395 |
else if (connector.ConnectItem2SymbolObject != null && |
|
4396 |
connector.ConnectItem2SymbolObject.get_RepresentationType() == "OPC") |
|
4397 |
{ |
|
4398 |
Ingr.RAD2D.Symbol2d symbol = radApp.ActiveDocument.ActiveSheet.DrawingObjects[connector.ConnectItem2SymbolObject.get_GraphicOID().ToString()]; |
|
4399 |
|
|
4400 |
double x1, y1, x2, y2, originX, originY; |
|
4401 |
symbol.Range(out x1, out y1, out x2, out y2); |
|
4402 |
symbol.GetOrigin(out originX, out originY); |
|
4403 |
if (originX < lineNumber.SPPID.SPPID_X) |
|
4404 |
lineNumber.SPPID.SPPID_X = originX + gridSetting.Length * 35; |
|
4405 |
else |
|
4406 |
lineNumber.SPPID.SPPID_X = originX - gridSetting.Length * 35; |
|
4407 |
} |
|
4408 |
|
|
4393 | 4409 |
_placement.PIDRemovePlacement(removeLabel.AsLMRepresentation()); |
4394 | 4410 |
Array points = new double[] { 0, lineNumber.SPPID.SPPID_X, lineNumber.SPPID.SPPID_Y }; |
4395 | 4411 |
LMLabelPersist _LmLabelPresist = _placement.PIDPlaceLabel(lineNumber.SPPID.MAPPINGNAME, ref points, Rotation: lineNumber.ANGLE, LabeledItem: connector.AsLMRepresentation(), IsLeaderVisible: false); |
내보내기 Unified diff