using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
|
using WW.Cad.Base;
|
using WW.Cad.Drawing;
|
using WW.Cad.Drawing.GDI;
|
using WW.Cad.IO;
|
using WW.Cad.Model;
|
using WW.Math;
|
using WW.Cad.Model.Entities;
|
using WW.Actions;
|
using WW.Cad.Model.Tables;
|
using WW.Cad.Model.Objects;
|
|
namespace TProduct.PumpGraph.Dxf
|
{
|
public partial class LxpFeatChart7
|
{
|
|
//标题栏
|
private void DrawFrameTtileText()
|
{
|
if (_dwgObjectDict == null)
|
return;
|
// 设备名称
|
if (_dwgObjectDict.ContainsKey("ItemName"))
|
{
|
Point3D pt1 = new Point3D(-3, 198, 0d);
|
|
DxfMText frame_label = new DxfMText(_dwgObjectDict["ItemName"], pt1, 5);//\P表示回车//.Insert(_productName.Length / 2, @"\P")
|
if (_frameTextFont != null)
|
frame_label.Style = _frameTextFont;
|
frame_label.AttachmentPoint = AttachmentPoint.MiddleLeft;
|
// frame_label.ReferenceRectangleHeight = 55;
|
frame_label.Color = _frameTextColor;
|
_dxfFileModel.Entities.Add(frame_label);
|
}
|
|
//设备位号
|
if (_dwgObjectDict.ContainsKey("ItemCode"))
|
{
|
Point3D pt1 = new Point3D(70 - 5, 198, 0d);
|
|
DxfMText frame_label = new DxfMText(_dwgObjectDict["ItemCode"], pt1, 5);//\P表示回车//.Insert(_productName.Length / 2, @"\P")
|
if (_frameTextFont != null)
|
frame_label.Style = _frameTextFont;
|
frame_label.AttachmentPoint = AttachmentPoint.MiddleLeft;
|
// frame_label.ReferenceRectangleHeight = 55;
|
frame_label.Color = _frameTextColor;
|
_dxfFileModel.Entities.Add(frame_label);
|
}
|
|
|
//流量
|
if (_dwgObjectDict.ContainsKey("DesignPointQ"))
|
{
|
Point3D pt1 = new Point3D(125, 198, 0d);
|
|
DxfMText frame_label = new DxfMText(string.Format("{0}m³/h", _dwgObjectDict["DesignPointQ"]), pt1, 5);//\P表示回车//.Insert(_productName.Length / 2, @"\P")
|
|
var font_gbenor = new DxfTextStyle("gbenor", "gbenor.shx");
|
//font_gbenor.FontStyle = System.Drawing.FontStyle.
|
font_gbenor.BigFontFilename = "bigfont.shx";
|
_dxfFileModel.TextStyles.Add(font_gbenor);
|
|
if (font_gbenor != null)
|
frame_label.Style = font_gbenor;
|
else if (_frameTextFont != null)
|
frame_label.Style = _frameTextFont;
|
frame_label.AttachmentPoint = AttachmentPoint.MiddleLeft;
|
// frame_label.ReferenceRectangleHeight = 55;
|
frame_label.Color = _frameTextColor;
|
_dxfFileModel.Entities.Add(frame_label);
|
}
|
|
|
|
//转速
|
if (_dwgObjectDict.ContainsKey("WorkSpeed"))
|
{
|
Point3D pt1 = new Point3D(70, 190, 0d);
|
|
DxfMText frame_label = new DxfMText(string.Format("{0}r/min", _dwgObjectDict["WorkSpeed"]), pt1, 5);//\P表示回车//.Insert(_productName.Length / 2, @"\P")
|
if (_frameTextFont != null)
|
frame_label.Style = _frameTextFont;
|
frame_label.AttachmentPoint = AttachmentPoint.MiddleLeft;
|
// frame_label.ReferenceRectangleHeight = 55;
|
frame_label.Color = _frameTextColor;
|
_dxfFileModel.Entities.Add(frame_label);
|
}
|
|
|
//扬程
|
if (_dwgObjectDict.ContainsKey("DesignPointH"))
|
{
|
Point3D pt1 = new Point3D(125, 190, 0d);
|
|
DxfMText frame_label = new DxfMText(string.Format("{0}m", _dwgObjectDict["DesignPointH"]), pt1, 5);//\P表示回车//.Insert(_productName.Length / 2, @"\P")
|
if (_frameTextFont != null)
|
frame_label.Style = _frameTextFont;
|
frame_label.AttachmentPoint = AttachmentPoint.MiddleLeft;
|
// frame_label.ReferenceRectangleHeight = 55;
|
frame_label.Color = _frameTextColor;
|
_dxfFileModel.Entities.Add(frame_label);
|
}
|
|
//输送介质
|
if (_dwgObjectDict.ContainsKey("JieZhiName"))
|
{
|
Point3D pt1 = new Point3D(-3, 182, 0d);
|
|
DxfMText frame_label = new DxfMText(_dwgObjectDict["JieZhiName"], pt1, 5);//\P表示回车//.Insert(_productName.Length / 2, @"\P")
|
if (_frameTextFont != null)
|
frame_label.Style = _frameTextFont;
|
frame_label.AttachmentPoint = AttachmentPoint.MiddleLeft;
|
// frame_label.ReferenceRectangleHeight = 55;
|
frame_label.Color = _frameTextColor;
|
_dxfFileModel.Entities.Add(frame_label);
|
}
|
|
|
//粘度
|
if (_dwgObjectDict.ContainsKey("JieZhiViscosity"))
|
{
|
Point3D pt1 = new Point3D(70, 182, 0d);
|
|
DxfMText frame_label = new DxfMText(string.Format("{0}cp", _dwgObjectDict["JieZhiViscosity"]), pt1, 5);//\P表示回车//.Insert(_productName.Length / 2, @"\P")
|
if (_frameTextFont != null)
|
frame_label.Style = _frameTextFont;
|
frame_label.AttachmentPoint = AttachmentPoint.MiddleLeft;
|
// frame_label.ReferenceRectangleHeight = 55;
|
frame_label.Color = _frameTextColor;
|
_dxfFileModel.Entities.Add(frame_label);
|
}
|
|
//比重
|
if (_dwgObjectDict.ContainsKey("JieZhiBiZhong"))
|
{
|
Point3D pt1 = new Point3D(125, 182, 0d);
|
|
DxfMText frame_label = new DxfMText(_dwgObjectDict["JieZhiBiZhong"], pt1, 5);//\P表示回车//.Insert(_productName.Length / 2, @"\P")
|
if (_frameTextFont != null)
|
frame_label.Style = _frameTextFont;
|
frame_label.AttachmentPoint = AttachmentPoint.MiddleLeft;
|
// frame_label.ReferenceRectangleHeight = 55;
|
frame_label.Color = _frameTextColor;
|
_dxfFileModel.Entities.Add(frame_label);
|
}
|
|
//型号
|
if (_dwgObjectDict.ContainsKey("ProductName"))
|
{//字典里面信息优先度更高
|
_productName = _dwgObjectDict["ProductName"].Replace("-2900", "").Replace("-1475", ""); ;
|
}
|
|
|
if (!string.IsNullOrEmpty(_productName))
|
{
|
Point3D pt1 = new Point3D(105 + 18, -62, 0d);
|
DxfMText axisLabel = new DxfMText(_productName, pt1, 5);//\P表示回车//.Insert(_productName.Length / 2, @"\P")
|
if (_frameTextFont != null)
|
axisLabel.Style = _frameTextFont;
|
axisLabel.AttachmentPoint = AttachmentPoint.MiddleCenter;
|
axisLabel.Color = _frameTextColor;
|
_dxfFileModel.Entities.Add(axisLabel);
|
|
|
|
Point3D pt2 = new Point3D(-3, 190, 0d);
|
DxfMText frame_label = new DxfMText(_productName, pt2, 5);//\P表示回车//.Insert(_productName.Length / 2, @"\P")
|
if (_frameTextFont != null)
|
frame_label.Style = _frameTextFont;
|
frame_label.AttachmentPoint = AttachmentPoint.MiddleLeft;
|
frame_label.Color = _frameTextColor;
|
_dxfFileModel.Entities.Add(frame_label);
|
}
|
|
if (!string.IsNullOrEmpty(this._kindName))
|
{
|
Point3D pt = new Point3D(58, -28, 0d);
|
DxfMText axisLabel = new DxfMText(this._kindName, pt, 5);//\P表示回车//.Insert(_productName.Length / 2, @"\P")
|
if (_frameTextFont != null)
|
axisLabel.Style = _frameTextFont;
|
axisLabel.AttachmentPoint = AttachmentPoint.MiddleLeft;
|
axisLabel.Color = _frameTextColor;
|
_dxfFileModel.Entities.Add(axisLabel);
|
}
|
else if (!string.IsNullOrEmpty(this._catalogName))
|
{
|
Point3D pt = new Point3D(78, -28, 0d);
|
DxfMText axisLabel = new DxfMText(_catalogName, pt, 5);//\P表示回车//.Insert(_productName.Length / 2, @"\P")
|
if (_frameTextFont != null)
|
axisLabel.Style = _frameTextFont;
|
axisLabel.AttachmentPoint = AttachmentPoint.MiddleCenter;
|
axisLabel.Color = _frameTextColor;
|
_dxfFileModel.Entities.Add(axisLabel);
|
}
|
}
|
|
|
|
}
|
}
|