Commit ca74e6c5 LN

新离线编程

1 个父辈 7df8a2a9
...@@ -149,6 +149,9 @@ namespace TSA_V.Common ...@@ -149,6 +149,9 @@ namespace TSA_V.Common
[MyConfigComment("点位切换音效文件")] [MyConfigComment("点位切换音效文件")]
public static MyConfig<string> Set_PointChangeSound = @"\sound\pointC.wav"; public static MyConfig<string> Set_PointChangeSound = @"\sound\pointC.wav";
[MyConfigComment("最后一次校准信息,保存后作为新板子的基准")]
public static MyConfig<string> Data_LastCalibrateInfo ="";
public static void ChangeConfig() public static void ChangeConfig()
{ {
try try
...@@ -280,5 +283,6 @@ namespace TSA_V.Common ...@@ -280,5 +283,6 @@ namespace TSA_V.Common
} }
} }
} }
} }
...@@ -35,6 +35,19 @@ namespace TSA_V.Common ...@@ -35,6 +35,19 @@ namespace TSA_V.Common
} }
return value; return value;
} }
public static double GetDoubleValue(NumericUpDown num)
{
double value = 0;
try
{
value =(double)num.Value;
}
catch (Exception ex)
{
value = 0;
}
return value;
}
public static int GetIntValue(TextBox txt) public static int GetIntValue(TextBox txt)
{ {
int value = 0; int value = 0;
......
...@@ -87,10 +87,10 @@ namespace TSA_V.DeviceLibrary ...@@ -87,10 +87,10 @@ namespace TSA_V.DeviceLibrary
/// </summary> /// </summary>
public int LineWidth { get; set; } public int LineWidth { get; set; }
public double BaseX = 0; //public double BaseX = 0;
public double BaseY = 0; //public double BaseY = 0;
public double BaseImageX = 0; //public double BaseImageX = 0;
public double BaseImageY = 0; //public double BaseImageY = 0;
public string AOIProName = ""; public string AOIProName = "";
...@@ -196,6 +196,25 @@ namespace TSA_V.DeviceLibrary ...@@ -196,6 +196,25 @@ namespace TSA_V.DeviceLibrary
return true; return true;
} }
public List<SMTPointInfo> getCalPoint()
{
SMTPointInfo lefup = new SMTPointInfo();
lefup.PositionX = 0;
lefup.PositionY = 0;
lefup.NodePositionX = calInfo.leftUpPoint.X;
lefup.NodePositionY = calInfo.leftUpPoint.Y;
SMTPointInfo right = new SMTPointInfo();
right.PositionX = boardWidth;
right.PositionY = boardLength;
right.NodePositionX = calInfo.rightBottomPoint.X;
right.NodePositionY = calInfo.rightBottomPoint.Y;
List<SMTPointInfo> checkOKList = new List<SMTPointInfo>() { lefup, right };
return checkOKList;
}
public CalibrateBean calInfo = null; public CalibrateBean calInfo = null;
} }
...@@ -246,6 +265,7 @@ namespace TSA_V.DeviceLibrary ...@@ -246,6 +265,7 @@ namespace TSA_V.DeviceLibrary
this.PenWidth = penWidth; this.PenWidth = penWidth;
this.ShowText = showText; this.ShowText = showText;
this.PolaritiesType = PolaritiesType; this.PolaritiesType = PolaritiesType;
this.imgP=new DrawPointInfo(pointSizex, pointSizeY,penWidth);
//if (String.IsNullOrEmpty(this.ShowText)) //if (String.IsNullOrEmpty(this.ShowText))
//{ //{
// this.ShowText = name; // this.ShowText = name;
...@@ -339,6 +359,7 @@ namespace TSA_V.DeviceLibrary ...@@ -339,6 +359,7 @@ namespace TSA_V.DeviceLibrary
/// </summary> /// </summary>
public bool CheckOK = false; public bool CheckOK = false;
public long pUTime = 0;
public string ToCSVStr() public string ToCSVStr()
{ {
string spilt = ","; string spilt = ",";
...@@ -355,18 +376,39 @@ namespace TSA_V.DeviceLibrary ...@@ -355,18 +376,39 @@ namespace TSA_V.DeviceLibrary
return text; return text;
} }
/// <summary> public void UpdateImgP(ProjectorPInfo p)
/// 点类型,1=点,2=+,3=|,3=-,4=方形,5=圆圈 {
/// </summary> PositionX = p.PX;
public int PointType = 1; PositionY = p.PY;
PointType = p.PType;
PointSizeX = p.SizeX;
PointSizeY=p.SizeY;
PenWidth = p.PenWidth;
this.ShowText = p.ShowText;
this.PolaritiesType = p.PolaritiesType;
}
public ProjectorPInfo GetShowPInfo(float imageXiShu=1)
{
ProjectorPInfo p = new ProjectorPInfo(PositionX*imageXiShu, PositionY * imageXiShu, PointType, PolaritiesType, (int)(PointSizeX * imageXiShu), (int)(PointSizeY * imageXiShu), (int)(PenWidth * imageXiShu), ShowText);
return p;
}
/// <summary> /// <summary>
/// 点大小 /// 点大小
/// </summary> /// </summary>
public int PointSizeX = 1; public int PointSizeX = 1;
public int PointSizeY = 1; public int PointSizeY = 1;
public int PenWidth = 2; public int PenWidth = 2;
/// <summary>
/// 图片上的点的信息
/// </summary>
public DrawPointInfo imgP = null;
/// <summary>
/// 点类型,1=点,2=+,3=|,3=-,4=方形,5=圆圈
/// </summary>
public int PointType = 1;
public string ShowText = ""; public string ShowText = "";
/// <summary> /// <summary>
/// 是否禁用,默认0 /// 是否禁用,默认0
...@@ -389,4 +431,26 @@ namespace TSA_V.DeviceLibrary ...@@ -389,4 +431,26 @@ namespace TSA_V.DeviceLibrary
public ComponetInfo componet; public ComponetInfo componet;
} }
public class DrawPointInfo
{
public DrawPointInfo()
{
}
public DrawPointInfo(int sizeX, int sizeY, int pWidth )
{
SizeX = sizeX;
SizeY = sizeY;
PWidth = pWidth;
this.uTime = DateTime.Now.Ticks;
}
public int SizeX = 5;
public int SizeY = 5;
public int PWidth = 1;
/// <summary>
/// 最后一次更新时间
/// </summary>
public long uTime;
}
} }
...@@ -8,7 +8,7 @@ namespace TSA_V.DeviceLibrary ...@@ -8,7 +8,7 @@ namespace TSA_V.DeviceLibrary
{ {
public class ProjectorPInfo public class ProjectorPInfo
{ {
public ProjectorPInfo(int x, int y, int type=1,int polaritiesType=0, int sizeX=4, int sizeY=4,int lineWidth=2,string showText="",int color=-1) public ProjectorPInfo(double x, double y, int type=1,int polaritiesType=0, int sizeX=4, int sizeY=4,int lineWidth=2,string showText="",int color=-1)
{ {
this.PX = x; this.PX = x;
this.PY = y; this.PY = y;
...@@ -20,8 +20,8 @@ namespace TSA_V.DeviceLibrary ...@@ -20,8 +20,8 @@ namespace TSA_V.DeviceLibrary
this.showColor = color; this.showColor = color;
this.PolaritiesType= polaritiesType; this.PolaritiesType= polaritiesType;
} }
public int PX = 2; public double PX = 2;
public int PY = 2; public double PY = 2;
public int PType = 1; public int PType = 1;
public int SizeX = 4; public int SizeX = 4;
......
...@@ -95,6 +95,12 @@ namespace TSA_V.DeviceLibrary ...@@ -95,6 +95,12 @@ namespace TSA_V.DeviceLibrary
sm.PointType =5; sm.PointType =5;
} }
if (sm.imgP == null)
{
sm.imgP=new DrawPointInfo(sm.PointSizeX, sm.PointSizeY,sm.PenWidth);
needSave = true;
}
} }
if (board.boardId > MaxId) if (board.boardId > MaxId)
{ {
...@@ -547,5 +553,6 @@ namespace TSA_V.DeviceLibrary ...@@ -547,5 +553,6 @@ namespace TSA_V.DeviceLibrary
} }
} }
} }
using System;
using System.CodeDom;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TSA_V.Common;
namespace TSA_V.DeviceLibrary
{
public class XYConvertManager
{
private static List<ConBaseInfo> conList = null;
public static List<ConBaseInfo> ConList
{
get
{
if (conList == null)
{
try
{
conList = JsonHelper.DeserializeJsonToObject<List<ConBaseInfo>>(Setting_NInit.Data_LastCalibrateInfo);
}
catch (Exception ex)
{
LogUtil.error("转换lastCalibrateBean出错:" + ex.ToString());
}
}
return conList;
}
set
{
conList = value;
Setting_NInit.Data_LastCalibrateInfo = JsonHelper.SerializeObject(conList);
}
}
public static void SaveData(BoardInfo board)
{
List<ConBaseInfo> data = new List<ConBaseInfo>() {
new ConBaseInfo(new Point(0,0),board.calInfo.leftUpPoint),
new ConBaseInfo(new Point(board.boardWidth,board.boardLength),board.calInfo.rightBottomPoint),
};
}
private SMTPointInfo CalPointNodePosition(SMTPointInfo smtPoint, List<SMTPointInfo> checkOKList)
{
try
{
if (smtPoint.CheckOK)
{
//校准点不再自动计算
return smtPoint;
}
double oldX = smtPoint.NodePositionX;
double oldY = smtPoint.NodePositionY;
//SMTPointInfo APoint = GetPoint(smtPoint, checkOKList);
//SMTPointInfo BPoint = GetPoint(APoint, checkOKList);
SMTPointInfo APoint = checkOKList[0];
SMTPointInfo BPoint = checkOKList[1];
//计算坐标
if (Math.Abs(smtPoint.PositionX - APoint.PositionX) < 0.01)
{
smtPoint.NodePositionX = APoint.NodePositionX;
}
else
{
smtPoint.NodePositionX = APoint.NodePositionX + (BPoint.NodePositionX - APoint.NodePositionX) * (smtPoint.PositionX - APoint.PositionX) / (BPoint.PositionX - APoint.PositionX);
if (double.IsNaN(smtPoint.NodePositionX) || double.IsInfinity(smtPoint.NodePositionX))
{
smtPoint.NodePositionX = APoint.NodePositionX;
}
}
if (Math.Abs(smtPoint.PositionY - APoint.PositionY) < 0.01)
{
smtPoint.NodePositionY = APoint.NodePositionY;
}
else
{
smtPoint.NodePositionY = APoint.NodePositionY + (BPoint.NodePositionY - APoint.NodePositionY) * (smtPoint.PositionY - APoint.PositionY) / (BPoint.PositionY - APoint.PositionY);
if (double.IsNaN(smtPoint.NodePositionY) || double.IsInfinity(smtPoint.NodePositionY))
{
smtPoint.NodePositionY = APoint.NodePositionY;
}
}
if (smtPoint.NodePositionX <= 0)
{
smtPoint.NodePositionX = 1;
}
else if (smtPoint.NodePositionX > FrmProjectorScreen.instance.BoundsWidth)
{
smtPoint.NodePositionX = FrmProjectorScreen.instance.BoundsWidth;
}
if (smtPoint.NodePositionY <= 0)
{
smtPoint.NodePositionY = 1;
}
else if (smtPoint.NodePositionY > FrmProjectorScreen.instance.BoundsHeight)
{
smtPoint.NodePositionY = FrmProjectorScreen.instance.BoundsHeight;
}
if (smtPoint.PointSizeX < 1 || smtPoint.PointSizeX > 255)
{
smtPoint.PointSizeX = Setting_NInit.Device_DefaultPointSize;
}
if (smtPoint.PointSizeY < 1 || smtPoint.PointSizeY > 255)
{
smtPoint.PointSizeY = Setting_NInit.Device_DefaultPointSize;
}
double xXishu = (BPoint.NodePositionX - APoint.NodePositionX) / (BPoint.PositionX - APoint.PositionX);
double yXishu = (BPoint.NodePositionY - APoint.NodePositionY) / (BPoint.PositionY - APoint.PositionY);
//计算点大小
if (smtPoint.imgP.uTime > smtPoint.pUTime)
{
smtPoint.PointSizeX = (int)((BPoint.NodePositionX - APoint.NodePositionX) * smtPoint.imgP.SizeX / (BPoint.PositionX - APoint.PositionX));
smtPoint.PointSizeY = (int)((BPoint.NodePositionY - APoint.NodePositionY) * smtPoint.imgP.SizeY / (BPoint.PositionY - APoint.PositionY));
smtPoint.PenWidth = (int)((BPoint.NodePositionX - APoint.NodePositionX) * smtPoint.imgP.PWidth / (BPoint.PositionX - APoint.PositionX));
}
//smtPoint.PointSize = 4;
//smtPoint.NodePositionX = BPoint.NodePositionX - (BPoint.NodePositionX - APoint.NodePositionX) * (BPoint.PositionX - smtPoint.PositionX) / (BPoint.PositionX - APoint.PositionX);
//smtPoint.NodePositionY = BPoint.NodePositionY - (BPoint.NodePositionY - APoint.NodePositionY) * (BPoint.PositionY - smtPoint.PositionY) / (BPoint.PositionY - APoint.PositionY);
LogUtil.info($" 【{smtPoint.PN}】图片坐标【{smtPoint.PositionX},{smtPoint.PositionY}】旧坐标【{oldX},{oldY}】新坐标【{smtPoint.NodePositionX},{smtPoint.NodePositionY}】" +
$"点尺寸({smtPoint.PointSizeX},{smtPoint.PointSizeY}),画笔宽{smtPoint.PenWidth}");
return smtPoint;
}
catch (Exception ex)
{
LogUtil.error(" 【" + smtPoint.PN + "】图片坐标【" + smtPoint.PositionX + "," + smtPoint.PositionY + "】校准坐标出错:" + ex.ToString());
}
return smtPoint;
}
private SMTPointInfo GetPoint(SMTPointInfo smtPoint, List<SMTPointInfo> checkOKList)
{
SMTPointInfo p = null;
double maxPingFang = 0;
foreach (SMTPointInfo sm in checkOKList)
{
if (sm.pointNum.Equals(smtPoint.pointNum))
{
continue;
}
double xjuli = sm.PositionX - smtPoint.PositionX;
double yjuli = sm.PositionY - smtPoint.PositionY;
double cping = xjuli * xjuli + yjuli * yjuli;
if (cping > maxPingFang)
{
p = sm;
maxPingFang = cping;
continue;
}
}
if (p != null)
{
return p;
}
return null;
}
}
public class ConBaseInfo
{
public ConBaseInfo()
{
}
public ConBaseInfo(Point point1,Point point2)
{
this.IPoint = point1;
this.Point = point2;
}
/// <summary>
/// 板子实际坐标
/// </summary>
public Point IPoint = new Point();
/// <summary>
/// 投影对应坐标
/// </summary>
public Point Point = new Point();
}
}
...@@ -761,19 +761,23 @@ namespace TSA_V ...@@ -761,19 +761,23 @@ namespace TSA_V
string bomName = cmbList.Text; string bomName = cmbList.Text;
List<ComponetInfo> list = CSVBomManager.GetComList(bomName); List<ComponetInfo> list = CSVBomManager.GetComList(bomName);
foreach (ComponetInfo obj in comList) foreach (ComponetInfo obj in comList)
{ {
foreach (ComponetInfo currObj in list) foreach (ComponetInfo currObj in list)
{ {
if (currObj.IsSameCom(obj.PN,obj.PositionNum,obj.TagNo)) if (currObj.PN.Equals(obj.PN)&&currObj.TagNo.Equals(obj.TagNo)&&currObj.PositionNum.Equals(obj.PositionNum))
{ {
ComponetUploadInfo upload = new ComponetUploadInfo(); //如果数量不同才修改
upload.Id = currObj.Id; //if (currObj.ComCount != obj.ComCount)
upload.PN = currObj.PN; {
upload.TagNo=currObj.TagNo; ComponetUploadInfo upload = new ComponetUploadInfo();
upload.ComCount = currObj.ComCount; upload.Id = currObj.Id;
upload.NewCount = obj.ComCount; upload.PN = currObj.PN;
upload.PositionNum = currObj.PositionNum; upload.TagNo = currObj.TagNo;
uploadList.Add(upload); upload.ComCount = currObj.ComCount;
upload.NewCount = obj.ComCount;
upload.PositionNum = currObj.PositionNum;
uploadList.Add(upload);
}
break; break;
} }
} }
...@@ -784,7 +788,7 @@ namespace TSA_V ...@@ -784,7 +788,7 @@ namespace TSA_V
} }
FrmListViewer<ComponetUploadInfo> frmListViewer = new FrmListViewer<ComponetUploadInfo>(uploadList, 1); FrmComCountView frmListViewer = new FrmComCountView (uploadList );
List<ComponetInfo> newList = new List<ComponetInfo>(); List<ComponetInfo> newList = new List<ComponetInfo>();
DialogResult showRes = frmListViewer.ShowDialog(); DialogResult showRes = frmListViewer.ShowDialog();
if (showRes.Equals(DialogResult.OK)) if (showRes.Equals(DialogResult.OK))
...@@ -795,7 +799,7 @@ namespace TSA_V ...@@ -795,7 +799,7 @@ namespace TSA_V
{ {
foreach (ComponetUploadInfo upload in uploadList) foreach (ComponetUploadInfo upload in uploadList)
{ {
if (currObj.IsSameCom(upload.PN, upload.PositionNum, upload.TagNo)) if (currObj.PN.Equals(upload.PN) && currObj.TagNo.Equals(upload.TagNo) && currObj.PositionNum.Equals(upload.PositionNum))
{ {
LogUtil.info($"修改元器件库{bomName} PN:{currObj.ComCount} TagNo:{currObj.TagNo} 的数量:{currObj.ComCount}->{upload.NewCount}"); LogUtil.info($"修改元器件库{bomName} PN:{currObj.ComCount} TagNo:{currObj.TagNo} 的数量:{currObj.ComCount}->{upload.NewCount}");
currObj.ComCount = upload.NewCount; currObj.ComCount = upload.NewCount;
......
...@@ -2699,4 +2699,18 @@ ...@@ -2699,4 +2699,18 @@
<data name = "FrmDeviceConfig_chbWorkT_Text" xml:space = "preserve"> <value> Turn on the work sound </value> </data> <data name = "FrmDeviceConfig_chbWorkT_Text" xml:space = "preserve"> <value> Turn on the work sound </value> </data>
<data name = "FrmDeviceConfig_chbAlarmT_Text" xml:space = "preserve"> <value> Turn on the alarm sound </value> </data> <data name = "FrmDeviceConfig_chbAlarmT_Text" xml:space = "preserve"> <value> Turn on the alarm sound </value> </data>
<data name = "FrmDeviceConfig_chbDisBottomCylinder_Text" xml:space = "preserve"> <value> Disable bottom cylinder </value> </data> <data name = "FrmDeviceConfig_chbDisBottomCylinder_Text" xml:space = "preserve"> <value> Disable bottom cylinder </value> </data>
<data name = "FrmAddBoard_chbShowText_Text" xml:space = "preserve"> <value> Set bit number to projected text </value> </data>
<data name = "FrmAddBoard_groupBox4_Text" xml:space = "preserve"> <value> Point Default Settings </value> </data>
<data name = "FrmAddBoard_label10_Text" xml:space = "preserve"> <value> Landscape size→: </value> </data>
<data name = "FrmAddBoard_rdbData_Text" xml:space = "preserve"> <value> Data Sheet Upload </value> </data>
<data name = "FrmBoardInfo_linkDis_Text" xml:space = "preserve"> <value> Batch Disable </value> </data>
<data name = "FrmBoardInfo_linkEnable_Text" xml:space = "preserve"> <value> Batch Enable </value> </data>
<data name = "EnableOk" xml:space = "preserve"> <value> Enable Success </value> </data>
<data name = "DisableOk" xml:space = "preserve"> <value> Disabled Success </value> </data>
<data name = "FrmPointInfo_btnColorChange_Text" xml:space = "preserve"> <value> Color </value> </data>
<data name = "FrmPointInfo_rdbPro_Text" xml:space = "preserve"> <value> projected coordinate/pixels </value> </data>
<data name = "FrmPointInfo_rdbImg_Text" xml:space = "preserve"> <value> actual coordinates/mm </value> </data>
<data name = "SureDeleteSel" xml:space = "preserve"> <value> OK to delete the selected data? </value> </data>
<data name = "FrmBomViewer_linkDelete_Text" xml:space = "preserve"> <value> Batch Delete </value> </data>
<data name = "Column_ISUpdate" xml:space = "preserve"> <value> modified </value> </data>
</root> </root>
\ No newline at end of file \ No newline at end of file
...@@ -2683,4 +2683,18 @@ ...@@ -2683,4 +2683,18 @@
<data name = "FrmDeviceConfig_chbWorkT_Text" xml:space = "preserve"> <value> 开启工作音效 </value> </data> <data name = "FrmDeviceConfig_chbWorkT_Text" xml:space = "preserve"> <value> 开启工作音效 </value> </data>
<data name = "FrmDeviceConfig_chbAlarmT_Text" xml:space = "preserve"> <value> 开启报警音效 </value> </data> <data name = "FrmDeviceConfig_chbAlarmT_Text" xml:space = "preserve"> <value> 开启报警音效 </value> </data>
<data name = "FrmDeviceConfig_chbDisBottomCylinder_Text" xml:space = "preserve"> <value> 禁用底部气缸 </value> </data> <data name = "FrmDeviceConfig_chbDisBottomCylinder_Text" xml:space = "preserve"> <value> 禁用底部气缸 </value> </data>
<data name = "FrmAddBoard_chbShowText_Text" xml:space = "preserve"> <value> 默认设置位号为投影文字 </value> </data>
<data name = "FrmAddBoard_groupBox4_Text" xml:space = "preserve"> <value> 点位默认设置 </value> </data>
<data name = "FrmAddBoard_label10_Text" xml:space = "preserve"> <value> 横向大小→: </value> </data>
<data name = "FrmAddBoard_rdbData_Text" xml:space = "preserve"> <value> 数据表上传 </value> </data>
<data name = "FrmBoardInfo_linkDis_Text" xml:space = "preserve"> <value> 批量禁用 </value> </data>
<data name = "FrmBoardInfo_linkEnable_Text" xml:space = "preserve"> <value> 批量启用 </value> </data>
<data name = "EnableOk" xml:space = "preserve"> <value> 启用成功 </value> </data>
<data name = "DisableOk" xml:space = "preserve"> <value> 禁用成功 </value> </data>
<data name = "FrmPointInfo_btnColorChange_Text" xml:space = "preserve"> <value> 颜色 </value> </data>
<data name = "FrmPointInfo_rdbPro_Text" xml:space = "preserve"> <value> 投影坐标/pixels </value> </data>
<data name = "FrmPointInfo_rdbImg_Text" xml:space = "preserve"> <value> 实际坐标/mm </value> </data>
<data name = "SureDeleteSel" xml:space = "preserve"> <value> 确定删除选中的数据? </value> </data>
<data name = "FrmBomViewer_linkDelete_Text" xml:space = "preserve"> <value> 批量删除 </value> </data>
<data name = "Column_ISUpdate" xml:space = "preserve"> <value> 是否修改 </value> </data>
</root> </root>
\ No newline at end of file \ No newline at end of file
...@@ -2698,4 +2698,19 @@ ...@@ -2698,4 +2698,19 @@
<data name = "FrmDeviceConfig_chbWorkT_Text" xml:space = "preserve"> <value> 开启工作音效 </value> </data> <data name = "FrmDeviceConfig_chbWorkT_Text" xml:space = "preserve"> <value> 开启工作音效 </value> </data>
<data name = "FrmDeviceConfig_chbAlarmT_Text" xml:space = "preserve"> <value> 开启报警音效 </value> </data> <data name = "FrmDeviceConfig_chbAlarmT_Text" xml:space = "preserve"> <value> 开启报警音效 </value> </data>
<data name = "FrmDeviceConfig_chbDisBottomCylinder_Text" xml:space = "preserve"> <value> 禁用底部气缸 </value> </data> <data name = "FrmDeviceConfig_chbDisBottomCylinder_Text" xml:space = "preserve"> <value> 禁用底部气缸 </value> </data>
<data name = "FrmAddBoard_chbShowText_Text" xml:space = "preserve"> <value> 默认设置位号为投影文字 </value> </data>
<data name = "FrmAddBoard_groupBox4_Text" xml:space = "preserve"> <value> 点位默认设置 </value> </data>
<data name = "FrmAddBoard_label10_Text" xml:space = "preserve"> <value> 横向大小→: </value> </data>
<data name = "FrmAddBoard_rdbData_Text" xml:space = "preserve"> <value> 数据表上传 </value> </data>
<data name = "FrmBoardInfo_linkDis_Text" xml:space = "preserve"> <value> 批量禁用 </value> </data>
<data name = "FrmBoardInfo_linkEnable_Text" xml:space = "preserve"> <value> 批量启用 </value> </data>
<data name = "EnableOk" xml:space = "preserve"> <value> 启用成功 </value> </data>
<data name = "DisableOk" xml:space = "preserve"> <value> 禁用成功 </value> </data>
<data name = "FrmPointInfo_btnColorChange_Text" xml:space = "preserve"> <value> 颜色 </value> </data>
<data name = "FrmPointInfo_rdbPro_Text" xml:space = "preserve"> <value> 投影坐标/pixels </value> </data>
<data name = "FrmPointInfo_rdbImg_Text" xml:space = "preserve"> <value> 实际坐标/mm </value> </data>
<data name = "SureDeleteSel" xml:space = "preserve"> <value> 确定删除选中的数据? </value> </data>
<data name = "FrmBomViewer_linkDelete_Text" xml:space = "preserve"> <value> 批量删除 </value> </data>
<data name = "Column_ISUpdate" xml:space = "preserve"> <value> 是否修改 </value> </data>
</root> </root>
\ No newline at end of file \ No newline at end of file
...@@ -188,6 +188,12 @@ ...@@ -188,6 +188,12 @@
<Compile Include="frmBoard\FrmBomUpload.Designer.cs"> <Compile Include="frmBoard\FrmBomUpload.Designer.cs">
<DependentUpon>FrmBomUpload.cs</DependentUpon> <DependentUpon>FrmBomUpload.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="frmBoard\FrmComCountView.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmBoard\FrmComCountView.Designer.cs">
<DependentUpon>FrmComCountView.cs</DependentUpon>
</Compile>
<Compile Include="frmBoard\FrmCalibrate.cs"> <Compile Include="frmBoard\FrmCalibrate.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
...@@ -216,6 +222,7 @@ ...@@ -216,6 +222,7 @@
<Compile Include="deviceDebug\FrmUpdatePwd.Designer.cs"> <Compile Include="deviceDebug\FrmUpdatePwd.Designer.cs">
<DependentUpon>FrmUpdatePwd.cs</DependentUpon> <DependentUpon>FrmUpdatePwd.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="manager\DrawPointManager.cs" />
<Compile Include="manager\FormManager.cs" /> <Compile Include="manager\FormManager.cs" />
<Compile Include="frmBoard\FrmAddBoard.cs"> <Compile Include="frmBoard\FrmAddBoard.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
...@@ -290,6 +297,7 @@ ...@@ -290,6 +297,7 @@
<DependentUpon>FrmBoardPutCom.cs</DependentUpon> <DependentUpon>FrmBoardPutCom.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="manager\MouseManager.cs" /> <Compile Include="manager\MouseManager.cs" />
<Compile Include="manager\XYConvertManager.cs" />
<Compile Include="messageBox\MessageBoxMidle.cs" /> <Compile Include="messageBox\MessageBoxMidle.cs" />
<Compile Include="projector\FrmViewScreen.cs"> <Compile Include="projector\FrmViewScreen.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
...@@ -445,6 +453,9 @@ ...@@ -445,6 +453,9 @@
<EmbeddedResource Include="frmBoard\FrmBomUpload.resx"> <EmbeddedResource Include="frmBoard\FrmBomUpload.resx">
<DependentUpon>FrmBomUpload.cs</DependentUpon> <DependentUpon>FrmBomUpload.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="frmBoard\FrmComCountView.resx">
<DependentUpon>FrmComCountView.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmBoard\FrmCalibrate.resx"> <EmbeddedResource Include="frmBoard\FrmCalibrate.resx">
<DependentUpon>FrmCalibrate.cs</DependentUpon> <DependentUpon>FrmCalibrate.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
...@@ -783,7 +794,9 @@ ...@@ -783,7 +794,9 @@
</Content> </Content>
<Content Include="记录.txt" /> <Content Include="记录.txt" />
</ItemGroup> </ItemGroup>
<ItemGroup /> <ItemGroup>
<Folder Include="frmBoard\back\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup> <PropertyGroup>
......
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
this.label9 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label();
this.txtCsvFileName = new System.Windows.Forms.TextBox(); this.txtCsvFileName = new System.Windows.Forms.TextBox();
this.groupBoxSelCom = new System.Windows.Forms.GroupBox(); this.groupBoxSelCom = new System.Windows.Forms.GroupBox();
this.rdbData = new System.Windows.Forms.RadioButton();
this.linkDataViewer = new System.Windows.Forms.LinkLabel(); this.linkDataViewer = new System.Windows.Forms.LinkLabel();
this.linkBomUpload = new System.Windows.Forms.LinkLabel(); this.linkBomUpload = new System.Windows.Forms.LinkLabel();
this.likSelCsvFile = new System.Windows.Forms.LinkLabel(); this.likSelCsvFile = new System.Windows.Forms.LinkLabel();
...@@ -69,8 +70,22 @@ ...@@ -69,8 +70,22 @@
this.groupBox_new = new System.Windows.Forms.GroupBox(); this.groupBox_new = new System.Windows.Forms.GroupBox();
this.linkLabel3 = new System.Windows.Forms.LinkLabel(); this.linkLabel3 = new System.Windows.Forms.LinkLabel();
this.linkLabel2 = new System.Windows.Forms.LinkLabel(); this.linkLabel2 = new System.Windows.Forms.LinkLabel();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.numSizeY = new System.Windows.Forms.NumericUpDown();
this.numSizeX = new System.Windows.Forms.NumericUpDown();
this.numPenWidth = new System.Windows.Forms.NumericUpDown();
this.lblLineWidth = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.cmbType = new System.Windows.Forms.ComboBox();
this.lbltype = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.chbShowText = new System.Windows.Forms.CheckBox();
this.groupBoxSelCom.SuspendLayout(); this.groupBoxSelCom.SuspendLayout();
this.groupBox_new.SuspendLayout(); this.groupBox_new.SuspendLayout();
this.groupBox4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numSizeY)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numSizeX)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numPenWidth)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// timer1 // timer1
...@@ -99,9 +114,10 @@ ...@@ -99,9 +114,10 @@
// //
// btnCancel // btnCancel
// //
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCancel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnCancel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCancel.Location = new System.Drawing.Point(420, 677); this.btnCancel.Location = new System.Drawing.Point(420, 575);
this.btnCancel.Name = "btnCancel"; this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(120, 45); this.btnCancel.Size = new System.Drawing.Size(120, 45);
this.btnCancel.TabIndex = 285; this.btnCancel.TabIndex = 285;
...@@ -111,9 +127,10 @@ ...@@ -111,9 +127,10 @@
// //
// btnStart // btnStart
// //
this.btnStart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnStart.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnStart.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnStart.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnStart.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnStart.Location = new System.Drawing.Point(291, 677); this.btnStart.Location = new System.Drawing.Point(291, 575);
this.btnStart.Name = "btnStart"; this.btnStart.Name = "btnStart";
this.btnStart.Size = new System.Drawing.Size(120, 45); this.btnStart.Size = new System.Drawing.Size(120, 45);
this.btnStart.TabIndex = 284; this.btnStart.TabIndex = 284;
...@@ -123,9 +140,10 @@ ...@@ -123,9 +140,10 @@
// //
// btnSave // btnSave
// //
this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSave.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnSave.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSave.Location = new System.Drawing.Point(162, 677); this.btnSave.Location = new System.Drawing.Point(162, 575);
this.btnSave.Name = "btnSave"; this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(120, 45); this.btnSave.Size = new System.Drawing.Size(120, 45);
this.btnSave.TabIndex = 283; this.btnSave.TabIndex = 283;
...@@ -240,7 +258,7 @@ ...@@ -240,7 +258,7 @@
this.cmbBomList.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbBomList.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbBomList.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.cmbBomList.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.cmbBomList.FormattingEnabled = true; this.cmbBomList.FormattingEnabled = true;
this.cmbBomList.Location = new System.Drawing.Point(9, 204); this.cmbBomList.Location = new System.Drawing.Point(11, 179);
this.cmbBomList.Name = "cmbBomList"; this.cmbBomList.Name = "cmbBomList";
this.cmbBomList.Size = new System.Drawing.Size(256, 28); this.cmbBomList.Size = new System.Drawing.Size(256, 28);
this.cmbBomList.TabIndex = 71; this.cmbBomList.TabIndex = 71;
...@@ -295,7 +313,7 @@ ...@@ -295,7 +313,7 @@
this.chbSort.Checked = true; this.chbSort.Checked = true;
this.chbSort.CheckState = System.Windows.Forms.CheckState.Checked; this.chbSort.CheckState = System.Windows.Forms.CheckState.Checked;
this.chbSort.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.chbSort.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbSort.Location = new System.Drawing.Point(181, 644); this.chbSort.Location = new System.Drawing.Point(96, 539);
this.chbSort.Name = "chbSort"; this.chbSort.Name = "chbSort";
this.chbSort.Size = new System.Drawing.Size(75, 21); this.chbSort.Size = new System.Drawing.Size(75, 21);
this.chbSort.TabIndex = 291; this.chbSort.TabIndex = 291;
...@@ -334,7 +352,7 @@ ...@@ -334,7 +352,7 @@
// txtCsvFileName // txtCsvFileName
// //
this.txtCsvFileName.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.txtCsvFileName.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtCsvFileName.Location = new System.Drawing.Point(6, 56); this.txtCsvFileName.Location = new System.Drawing.Point(8, 53);
this.txtCsvFileName.MaxLength = 20; this.txtCsvFileName.MaxLength = 20;
this.txtCsvFileName.Multiline = true; this.txtCsvFileName.Multiline = true;
this.txtCsvFileName.Name = "txtCsvFileName"; this.txtCsvFileName.Name = "txtCsvFileName";
...@@ -343,6 +361,7 @@ ...@@ -343,6 +361,7 @@
// //
// groupBoxSelCom // groupBoxSelCom
// //
this.groupBoxSelCom.Controls.Add(this.rdbData);
this.groupBoxSelCom.Controls.Add(this.linkDataViewer); this.groupBoxSelCom.Controls.Add(this.linkDataViewer);
this.groupBoxSelCom.Controls.Add(this.linkBomUpload); this.groupBoxSelCom.Controls.Add(this.linkBomUpload);
this.groupBoxSelCom.Controls.Add(this.likSelCsvFile); this.groupBoxSelCom.Controls.Add(this.likSelCsvFile);
...@@ -359,10 +378,22 @@ ...@@ -359,10 +378,22 @@
this.groupBoxSelCom.TabStop = false; this.groupBoxSelCom.TabStop = false;
this.groupBoxSelCom.Text = "请选择元器件库"; this.groupBoxSelCom.Text = "请选择元器件库";
// //
// rdbData
//
this.rdbData.AutoSize = true;
this.rdbData.Location = new System.Drawing.Point(11, 221);
this.rdbData.Name = "rdbData";
this.rdbData.Size = new System.Drawing.Size(86, 21);
this.rdbData.TabIndex = 306;
this.rdbData.TabStop = true;
this.rdbData.Text = "数据表上传";
this.rdbData.UseVisualStyleBackColor = true;
this.rdbData.CheckedChanged += new System.EventHandler(this.rdbData_CheckedChanged);
//
// linkDataViewer // linkDataViewer
// //
this.linkDataViewer.AutoSize = true; this.linkDataViewer.AutoSize = true;
this.linkDataViewer.Location = new System.Drawing.Point(148, 28); this.linkDataViewer.Location = new System.Drawing.Point(8, 294);
this.linkDataViewer.Name = "linkDataViewer"; this.linkDataViewer.Name = "linkDataViewer";
this.linkDataViewer.Size = new System.Drawing.Size(56, 17); this.linkDataViewer.Size = new System.Drawing.Size(56, 17);
this.linkDataViewer.TabIndex = 305; this.linkDataViewer.TabIndex = 305;
...@@ -373,19 +404,18 @@ ...@@ -373,19 +404,18 @@
// linkBomUpload // linkBomUpload
// //
this.linkBomUpload.AutoSize = true; this.linkBomUpload.AutoSize = true;
this.linkBomUpload.Location = new System.Drawing.Point(148, 122); this.linkBomUpload.Location = new System.Drawing.Point(27, 253);
this.linkBomUpload.Name = "linkBomUpload"; this.linkBomUpload.Name = "linkBomUpload";
this.linkBomUpload.Size = new System.Drawing.Size(68, 17); this.linkBomUpload.Size = new System.Drawing.Size(68, 17);
this.linkBomUpload.TabIndex = 302; this.linkBomUpload.TabIndex = 302;
this.linkBomUpload.TabStop = true; this.linkBomUpload.TabStop = true;
this.linkBomUpload.Text = "数据表上传"; this.linkBomUpload.Text = "数据表上传";
this.linkBomUpload.Visible = false;
this.linkBomUpload.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkBomUpload_LinkClicked); this.linkBomUpload.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkBomUpload_LinkClicked);
// //
// likSelCsvFile // likSelCsvFile
// //
this.likSelCsvFile.AutoSize = true; this.likSelCsvFile.AutoSize = true;
this.likSelCsvFile.Location = new System.Drawing.Point(27, 122); this.likSelCsvFile.Location = new System.Drawing.Point(29, 119);
this.likSelCsvFile.Name = "likSelCsvFile"; this.likSelCsvFile.Name = "likSelCsvFile";
this.likSelCsvFile.Size = new System.Drawing.Size(56, 17); this.likSelCsvFile.Size = new System.Drawing.Size(56, 17);
this.likSelCsvFile.TabIndex = 301; this.likSelCsvFile.TabIndex = 301;
...@@ -396,7 +426,7 @@ ...@@ -396,7 +426,7 @@
// likDownFile // likDownFile
// //
this.likDownFile.AutoSize = true; this.likDownFile.AutoSize = true;
this.likDownFile.Location = new System.Drawing.Point(27, 146); this.likDownFile.Location = new System.Drawing.Point(123, 119);
this.likDownFile.Name = "likDownFile"; this.likDownFile.Name = "likDownFile";
this.likDownFile.Size = new System.Drawing.Size(56, 17); this.likDownFile.Size = new System.Drawing.Size(56, 17);
this.likDownFile.TabIndex = 300; this.likDownFile.TabIndex = 300;
...@@ -408,7 +438,7 @@ ...@@ -408,7 +438,7 @@
// //
this.rdbUpload.AutoSize = true; this.rdbUpload.AutoSize = true;
this.rdbUpload.Checked = true; this.rdbUpload.Checked = true;
this.rdbUpload.Location = new System.Drawing.Point(9, 26); this.rdbUpload.Location = new System.Drawing.Point(11, 24);
this.rdbUpload.Name = "rdbUpload"; this.rdbUpload.Name = "rdbUpload";
this.rdbUpload.RightToLeft = System.Windows.Forms.RightToLeft.No; this.rdbUpload.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.rdbUpload.Size = new System.Drawing.Size(98, 21); this.rdbUpload.Size = new System.Drawing.Size(98, 21);
...@@ -421,7 +451,7 @@ ...@@ -421,7 +451,7 @@
// rdbSelCom // rdbSelCom
// //
this.rdbSelCom.AutoSize = true; this.rdbSelCom.AutoSize = true;
this.rdbSelCom.Location = new System.Drawing.Point(7, 177); this.rdbSelCom.Location = new System.Drawing.Point(9, 150);
this.rdbSelCom.Name = "rdbSelCom"; this.rdbSelCom.Name = "rdbSelCom";
this.rdbSelCom.Size = new System.Drawing.Size(98, 21); this.rdbSelCom.Size = new System.Drawing.Size(98, 21);
this.rdbSelCom.TabIndex = 298; this.rdbSelCom.TabIndex = 298;
...@@ -447,7 +477,7 @@ ...@@ -447,7 +477,7 @@
this.xyMoveControl1.Cursor = System.Windows.Forms.Cursors.Default; this.xyMoveControl1.Cursor = System.Windows.Forms.Cursors.Default;
this.xyMoveControl1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.xyMoveControl1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.xyMoveControl1.GroupName = "坐标"; this.xyMoveControl1.GroupName = "坐标";
this.xyMoveControl1.Location = new System.Drawing.Point(16, 325); this.xyMoveControl1.Location = new System.Drawing.Point(661, 12);
this.xyMoveControl1.Name = "xyMoveControl1"; this.xyMoveControl1.Name = "xyMoveControl1";
this.xyMoveControl1.PenWidth = 2; this.xyMoveControl1.PenWidth = 2;
this.xyMoveControl1.PointSizeX = 5; this.xyMoveControl1.PointSizeX = 5;
...@@ -512,10 +542,160 @@ ...@@ -512,10 +542,160 @@
this.linkLabel2.Text = "选择Gerber文件"; this.linkLabel2.Text = "选择Gerber文件";
this.linkLabel2.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel2_LinkClicked); this.linkLabel2.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel2_LinkClicked);
// //
// groupBox4
//
this.groupBox4.Controls.Add(this.numSizeY);
this.groupBox4.Controls.Add(this.numSizeX);
this.groupBox4.Controls.Add(this.numPenWidth);
this.groupBox4.Controls.Add(this.lblLineWidth);
this.groupBox4.Controls.Add(this.label7);
this.groupBox4.Controls.Add(this.cmbType);
this.groupBox4.Controls.Add(this.lbltype);
this.groupBox4.Controls.Add(this.label10);
this.groupBox4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox4.Location = new System.Drawing.Point(21, 329);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(642, 168);
this.groupBox4.TabIndex = 304;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "点位默认设置";
//
// numSizeY
//
this.numSizeY.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.numSizeY.Location = new System.Drawing.Point(226, 96);
this.numSizeY.Maximum = new decimal(new int[] {
200,
0,
0,
0});
this.numSizeY.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numSizeY.Name = "numSizeY";
this.numSizeY.Size = new System.Drawing.Size(120, 26);
this.numSizeY.TabIndex = 328;
this.numSizeY.Value = new decimal(new int[] {
6,
0,
0,
0});
//
// numSizeX
//
this.numSizeX.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.numSizeX.Location = new System.Drawing.Point(226, 61);
this.numSizeX.Maximum = new decimal(new int[] {
200,
0,
0,
0});
this.numSizeX.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numSizeX.Name = "numSizeX";
this.numSizeX.Size = new System.Drawing.Size(120, 26);
this.numSizeX.TabIndex = 327;
this.numSizeX.Value = new decimal(new int[] {
6,
0,
0,
0});
//
// numPenWidth
//
this.numPenWidth.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.numPenWidth.Location = new System.Drawing.Point(226, 131);
this.numPenWidth.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numPenWidth.Name = "numPenWidth";
this.numPenWidth.Size = new System.Drawing.Size(120, 26);
this.numPenWidth.TabIndex = 326;
this.numPenWidth.Value = new decimal(new int[] {
1,
0,
0,
0});
//
// lblLineWidth
//
this.lblLineWidth.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblLineWidth.Location = new System.Drawing.Point(60, 135);
this.lblLineWidth.Name = "lblLineWidth";
this.lblLineWidth.Size = new System.Drawing.Size(160, 17);
this.lblLineWidth.TabIndex = 325;
this.lblLineWidth.Text = "画笔宽度:";
this.lblLineWidth.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label7
//
this.label7.Location = new System.Drawing.Point(60, 99);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(160, 17);
this.label7.TabIndex = 306;
this.label7.Text = "纵向大小↓:";
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// cmbType
//
this.cmbType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbType.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.cmbType.FormattingEnabled = true;
this.cmbType.Items.AddRange(new object[] {
"1=●",
"2=✚",
"3=┃",
"4=━━",
"5=□",
"6=○"});
this.cmbType.Location = new System.Drawing.Point(226, 24);
this.cmbType.Name = "cmbType";
this.cmbType.Size = new System.Drawing.Size(119, 28);
this.cmbType.TabIndex = 305;
//
// lbltype
//
this.lbltype.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbltype.Location = new System.Drawing.Point(60, 27);
this.lbltype.Name = "lbltype";
this.lbltype.Size = new System.Drawing.Size(160, 17);
this.lbltype.TabIndex = 304;
this.lbltype.Text = "点形状:";
this.lbltype.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label10
//
this.label10.Location = new System.Drawing.Point(60, 63);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(160, 17);
this.label10.TabIndex = 282;
this.label10.Text = "横向大小→:";
this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// chbShowText
//
this.chbShowText.AutoSize = true;
this.chbShowText.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbShowText.Location = new System.Drawing.Point(96, 503);
this.chbShowText.Name = "chbShowText";
this.chbShowText.Size = new System.Drawing.Size(159, 21);
this.chbShowText.TabIndex = 305;
this.chbShowText.Text = "默认设置位号为投影文字";
this.chbShowText.UseVisualStyleBackColor = true;
//
// FrmAddBoard // FrmAddBoard
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(688, 740); this.ClientSize = new System.Drawing.Size(688, 638);
this.Controls.Add(this.chbShowText);
this.Controls.Add(this.groupBox4);
this.Controls.Add(this.groupBox_new); this.Controls.Add(this.groupBox_new);
this.Controls.Add(this.groupBoxSelCom); this.Controls.Add(this.groupBoxSelCom);
this.Controls.Add(this.chbSort); this.Controls.Add(this.chbSort);
...@@ -532,6 +712,10 @@ ...@@ -532,6 +712,10 @@
this.groupBoxSelCom.PerformLayout(); this.groupBoxSelCom.PerformLayout();
this.groupBox_new.ResumeLayout(false); this.groupBox_new.ResumeLayout(false);
this.groupBox_new.PerformLayout(); this.groupBox_new.PerformLayout();
this.groupBox4.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.numSizeY)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numSizeX)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numPenWidth)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
...@@ -579,5 +763,16 @@ ...@@ -579,5 +763,16 @@
private System.Windows.Forms.LinkLabel linkLabel3; private System.Windows.Forms.LinkLabel linkLabel3;
private System.Windows.Forms.LinkLabel linkBomUpload; private System.Windows.Forms.LinkLabel linkBomUpload;
private System.Windows.Forms.LinkLabel linkDataViewer; private System.Windows.Forms.LinkLabel linkDataViewer;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.NumericUpDown numSizeY;
private System.Windows.Forms.NumericUpDown numSizeX;
private System.Windows.Forms.NumericUpDown numPenWidth;
private System.Windows.Forms.Label lblLineWidth;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.ComboBox cmbType;
private System.Windows.Forms.Label lbltype;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.CheckBox chbShowText;
private System.Windows.Forms.RadioButton rdbData;
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -172,11 +172,19 @@ namespace TSA_V ...@@ -172,11 +172,19 @@ namespace TSA_V
int xFangxiang = 1; int xFangxiang = 1;
int yFangxiang = -1; int yFangxiang = -1;
int pointSizeX = xyMoveControl1.PointSizeX; //int pointSizeX = xyMoveControl1.PointSizeX;
int pointSizeY = xyMoveControl1.PointSizeY; //int pointSizeY = xyMoveControl1.PointSizeY;
int pointType = xyMoveControl1.PointType; //int pointType = xyMoveControl1.PointType;
int penWidth = xyMoveControl1.PenWidth; //int penWidth = xyMoveControl1.PenWidth;
int PolaritiesType = xyMoveControl1.PolaritiesType; //int PolaritiesType = xyMoveControl1.PolaritiesType;
int pointSizeX =(int) numSizeX.Value;
int pointSizeY = (int)numSizeY.Value;
int pointType = cmbType.SelectedIndex;
int penWidth =(int) numPenWidth.Value;
int PolaritiesType = 0;
bool hasTest = chbShowText.Checked;
foreach (ComponetInfo com in comList) foreach (ComponetInfo com in comList)
{ {
double x =com.PositionX+ pianYiX; double x =com.PositionX+ pianYiX;
...@@ -197,7 +205,12 @@ namespace TSA_V ...@@ -197,7 +205,12 @@ namespace TSA_V
y = board.boardLength - y; y = board.boardLength - y;
x = board.boardWidth - x; x = board.boardWidth - x;
} }
SMTPointInfo point = new SMTPointInfo(i, com.TagNo, com.PN, x, y, com.PositionNum,com.Text, pointType,pointSizeX,pointSizeY,penWidth, PolaritiesType); string showText = com.Text;
if (hasTest && showText == "")
{
showText = com.TagNo;
}
SMTPointInfo point = new SMTPointInfo(i, com.TagNo, com.PN, x, y, com.PositionNum, showText, pointType,pointSizeX,pointSizeY,penWidth, PolaritiesType);
y = board.boardLength - y; y = board.boardLength - y;
...@@ -290,11 +303,16 @@ namespace TSA_V ...@@ -290,11 +303,16 @@ namespace TSA_V
} }
private void FrmAddBoard_Load(object sender, EventArgs e) private void FrmAddBoard_Load(object sender, EventArgs e)
{ {
label7.Text = ResourceCulture.GetString("FrmPointInfo_lblSizeWidth_Text", "纵向大小↓: ");
label10.Text = ResourceCulture.GetString("FrmPointInfo_lblSizeLength_Text", "横向大小→:");
lbltype.Text = ResourceCulture.GetString("FrmPointInfo_lbltype_Text", "坐标点形状:");
lblLineWidth.Text = ResourceCulture.GetString("FrmPointInfo_lblLineWidth_Text", "画笔宽度:");
this.timer1.Enabled = true; this.timer1.Enabled = true;
LoadComList(); LoadComList();
LanguageProcess(); LanguageProcess();
xyMoveControl1.Visible = false;
//xyMoveControl1.XValue = ConfigAppSettings.GetDoubleValue(Setting_Init.BOARD_ORIGIN_X); //xyMoveControl1.XValue = ConfigAppSettings.GetDoubleValue(Setting_Init.BOARD_ORIGIN_X);
//xyMoveControl1.YValue = ConfigAppSettings.GetDoubleValue(Setting_Init.BOARD_ORIGIN_Y); //xyMoveControl1.YValue = ConfigAppSettings.GetDoubleValue(Setting_Init.BOARD_ORIGIN_Y);
this.cmbOrgType.Items.Clear(); this.cmbOrgType.Items.Clear();
...@@ -319,10 +337,10 @@ namespace TSA_V ...@@ -319,10 +337,10 @@ namespace TSA_V
xyMoveControl1.ShowPointEvent += XyMoveControl1_ShowPointEvent; xyMoveControl1.ShowPointEvent += XyMoveControl1_ShowPointEvent;
xyMoveControl1.XValue = TSAVBean.X_Max/2; xyMoveControl1.XValue = TSAVBean.X_Max/2;
xyMoveControl1.YValue = TSAVBean.Y_Max/2; xyMoveControl1.YValue = TSAVBean.Y_Max/2;
ProjectorControl.MaxX =(int) TSAVBean.X_Max; xyMoveControl1.MaxX =(int) TSAVBean.X_Max;
ProjectorControl.MaxY = (int)TSAVBean.Y_Max; xyMoveControl1.MaxY = (int)TSAVBean.Y_Max;
xyMoveControl1.ShowText = ""; xyMoveControl1.ShowText = "";
cmbType.SelectedIndex= 0;
rdbUpload.Checked = true; rdbUpload.Checked = true;
ComChange( ); ComChange( );
...@@ -359,37 +377,14 @@ namespace TSA_V ...@@ -359,37 +377,14 @@ namespace TSA_V
} }
private void ComChange( ) private void ComChange( )
{ {
if (rdbUpload.Checked) txtCsvFileName.Visible = rdbUpload.Checked;
{ likDownFile.Visible = rdbUpload.Checked;
txtCsvFileName.Visible = true; likSelCsvFile.Visible = rdbUpload.Checked;
likDownFile.Visible = true; cmbBomList.Visible = rdbSelCom.Checked;
likSelCsvFile.Visible = true; linkBomUpload.Visible = rdbData.Checked;
cmbBomList.Visible = false; linkDataViewer.Visible = uploadPointList.Count > 0;
linkBomUpload.Visible = true;
linkDataViewer.Visible = uploadPointList.Count > 0;
}
else if (rdbSelCom.Checked)
{
txtCsvFileName.Visible = false;
likDownFile.Visible = false;
likSelCsvFile.Visible = false;
cmbBomList.Visible = true;
linkBomUpload.Visible = false;
}
//else if (rbBom.Checked)
//{
// FrmBomUpload frm = new FrmBomUpload();
// DialogResult resut = frm.ShowDialog();
// if (resut.Equals(DialogResult.OK))
// {
// List<ComponetInfo> dataList = frm.componetInfos;
// if (ProcessComData(dataList))
// {
// uploadPointList = dataList;
// }
// }
//}
} }
private void rdbUpload_CheckedChanged(object sender, EventArgs e) private void rdbUpload_CheckedChanged(object sender, EventArgs e)
{ {
...@@ -480,7 +475,8 @@ namespace TSA_V ...@@ -480,7 +475,8 @@ namespace TSA_V
linkDataViewer.Visible = false; linkDataViewer.Visible = false;
} }
else else
{ {
this.uploadPointList = frmViewer.dataList;
this.txtCsvFileName.Text = fileName; this.txtCsvFileName.Text = fileName;
linkDataViewer.Visible = true; linkDataViewer.Visible = true;
} }
...@@ -641,17 +637,6 @@ namespace TSA_V ...@@ -641,17 +637,6 @@ namespace TSA_V
List<ComponetInfo> dataList = frm.componetInfos; List<ComponetInfo> dataList = frm.componetInfos;
if (ProcessComData(dataList)) if (ProcessComData(dataList))
{ {
//FrmListViewer frmViewer = new FrmListViewer(dataList);
//DialogResult sureresult = frmViewer.ShowDialog();
//if (sureresult.Equals(DialogResult.Cancel))
//{
// uploadPointList = new List<ComponetInfo>();
// txtCsvFileName.Text = "";
// linkDataViewer.Visible = false;
//}
//else
//{
string bomName = "bomUpdate_" + DateTime.Now.ToString("yyyyMMddHHmm"); string bomName = "bomUpdate_" + DateTime.Now.ToString("yyyyMMddHHmm");
string path= Path.GetPathRoot(Application.StartupPath)+@"bomFile\"+bomName+".csv"; string path= Path.GetPathRoot(Application.StartupPath)+@"bomFile\"+bomName+".csv";
...@@ -662,7 +647,6 @@ namespace TSA_V ...@@ -662,7 +647,6 @@ namespace TSA_V
txtCsvFileName.Text = path; txtCsvFileName.Text = path;
linkDataViewer.Visible = true; linkDataViewer.Visible = true;
} }
//}
} }
} }
} }
...@@ -679,7 +663,16 @@ namespace TSA_V ...@@ -679,7 +663,16 @@ namespace TSA_V
txtCsvFileName.Text = ""; txtCsvFileName.Text = "";
linkDataViewer.Visible = false; linkDataViewer.Visible = false;
} }
else
{
this.uploadPointList = frmViewer.dataList;
}
} }
} }
private void rdbData_CheckedChanged(object sender, EventArgs e)
{
ComChange();
}
} }
} }
...@@ -52,6 +52,8 @@ ...@@ -52,6 +52,8 @@
this.dataGridViewImageColumn1 = new System.Windows.Forms.DataGridViewImageColumn(); this.dataGridViewImageColumn1 = new System.Windows.Forms.DataGridViewImageColumn();
this.dataGridViewImageColumn2 = new System.Windows.Forms.DataGridViewImageColumn(); this.dataGridViewImageColumn2 = new System.Windows.Forms.DataGridViewImageColumn();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.linkDis = new System.Windows.Forms.LinkLabel();
this.linkEnable = new System.Windows.Forms.LinkLabel();
this.btnCalibrate = new System.Windows.Forms.Button(); this.btnCalibrate = new System.Windows.Forms.Button();
this.btnColorChange = new System.Windows.Forms.Button(); this.btnColorChange = new System.Windows.Forms.Button();
this.btnOpenFile = new System.Windows.Forms.Button(); this.btnOpenFile = new System.Windows.Forms.Button();
...@@ -273,7 +275,12 @@ ...@@ -273,7 +275,12 @@
// //
// panel1 // panel1
// //
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel1.AutoScroll = true; this.panel1.AutoScroll = true;
this.panel1.Controls.Add(this.linkDis);
this.panel1.Controls.Add(this.linkEnable);
this.panel1.Controls.Add(this.btnCalibrate); this.panel1.Controls.Add(this.btnCalibrate);
this.panel1.Controls.Add(this.btnColorChange); this.panel1.Controls.Add(this.btnColorChange);
this.panel1.Controls.Add(this.btnOpenFile); this.panel1.Controls.Add(this.btnOpenFile);
...@@ -289,18 +296,41 @@ ...@@ -289,18 +296,41 @@
this.panel1.Controls.Add(this.button1); this.panel1.Controls.Add(this.button1);
this.panel1.Controls.Add(this.btnSave); this.panel1.Controls.Add(this.btnSave);
this.panel1.Controls.Add(this.panel2); this.panel1.Controls.Add(this.panel2);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1"; this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1344, 701); this.panel1.Size = new System.Drawing.Size(1344, 701);
this.panel1.TabIndex = 0; this.panel1.TabIndex = 0;
// //
// linkDis
//
this.linkDis.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.linkDis.AutoSize = true;
this.linkDis.Location = new System.Drawing.Point(118, 644);
this.linkDis.Name = "linkDis";
this.linkDis.Size = new System.Drawing.Size(53, 12);
this.linkDis.TabIndex = 296;
this.linkDis.TabStop = true;
this.linkDis.Text = "批量禁用";
this.linkDis.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkDis_LinkClicked);
//
// linkEnable
//
this.linkEnable.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.linkEnable.AutoSize = true;
this.linkEnable.Location = new System.Drawing.Point(6, 644);
this.linkEnable.Name = "linkEnable";
this.linkEnable.Size = new System.Drawing.Size(53, 12);
this.linkEnable.TabIndex = 295;
this.linkEnable.TabStop = true;
this.linkEnable.Text = "批量启用";
this.linkEnable.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkEnable_LinkClicked);
//
// btnCalibrate // btnCalibrate
// //
this.btnCalibrate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.btnCalibrate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnCalibrate.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnCalibrate.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCalibrate.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnCalibrate.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCalibrate.Location = new System.Drawing.Point(6, 639); this.btnCalibrate.Location = new System.Drawing.Point(230, 639);
this.btnCalibrate.Name = "btnCalibrate"; this.btnCalibrate.Name = "btnCalibrate";
this.btnCalibrate.Size = new System.Drawing.Size(120, 45); this.btnCalibrate.Size = new System.Drawing.Size(120, 45);
this.btnCalibrate.TabIndex = 294; this.btnCalibrate.TabIndex = 294;
...@@ -340,7 +370,7 @@ ...@@ -340,7 +370,7 @@
this.btnCheck.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.btnCheck.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnCheck.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnCheck.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCheck.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnCheck.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCheck.Location = new System.Drawing.Point(6, 639); this.btnCheck.Location = new System.Drawing.Point(230, 639);
this.btnCheck.Name = "btnCheck"; this.btnCheck.Name = "btnCheck";
this.btnCheck.Size = new System.Drawing.Size(120, 45); this.btnCheck.Size = new System.Drawing.Size(120, 45);
this.btnCheck.TabIndex = 291; this.btnCheck.TabIndex = 291;
...@@ -605,7 +635,6 @@ ...@@ -605,7 +635,6 @@
this.Column_Down}); this.Column_Down});
this.dgvList.ContextMenuStrip = this.contextMenuStrip2; this.dgvList.ContextMenuStrip = this.contextMenuStrip2;
this.dgvList.Location = new System.Drawing.Point(2, 20); this.dgvList.Location = new System.Drawing.Point(2, 20);
this.dgvList.MultiSelect = false;
this.dgvList.Name = "dgvList"; this.dgvList.Name = "dgvList";
this.dgvList.RowHeadersWidth = 30; this.dgvList.RowHeadersWidth = 30;
this.dgvList.RowTemplate.Height = 23; this.dgvList.RowTemplate.Height = 23;
...@@ -1180,5 +1209,7 @@ ...@@ -1180,5 +1209,7 @@
private System.Windows.Forms.DataGridViewLinkColumn Column_Del; private System.Windows.Forms.DataGridViewLinkColumn Column_Del;
private System.Windows.Forms.DataGridViewLinkColumn Column_Up; private System.Windows.Forms.DataGridViewLinkColumn Column_Up;
private System.Windows.Forms.DataGridViewLinkColumn Column_Down; private System.Windows.Forms.DataGridViewLinkColumn Column_Down;
private System.Windows.Forms.LinkLabel linkDis;
private System.Windows.Forms.LinkLabel linkEnable;
} }
} }
\ No newline at end of file \ No newline at end of file
 
using AccAOI; using AccAOI;
using log4net; using log4net;
using NPOI.Util;
using OpenCvSharp.Flann; using OpenCvSharp.Flann;
using Org.BouncyCastle.Asn1.Tsp;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
...@@ -294,6 +296,7 @@ namespace TSA_V ...@@ -294,6 +296,7 @@ namespace TSA_V
view = new DataGridViewRow(); view = new DataGridViewRow();
view.CreateCells(dgvList); view.CreateCells(dgvList);
} }
view.Tag = point;
view.Cells[0].Value = point.pointNum.ToString(); view.Cells[0].Value = point.pointNum.ToString();
view.Cells[1].Value = point.TagNo.ToString(); view.Cells[1].Value = point.TagNo.ToString();
view.Cells[2].Value = point.PN; view.Cells[2].Value = point.PN;
...@@ -702,6 +705,13 @@ namespace TSA_V ...@@ -702,6 +705,13 @@ namespace TSA_V
{ {
return null; return null;
} }
try
{
point = (SMTPointInfo)row.Tag;
}catch(Exception ex)
{
LogUtil.error("获取行数据出错:" + ex.ToString());
}
point.PN = row.Cells[Column_Name.Name].Value.ToString(); point.PN = row.Cells[Column_Name.Name].Value.ToString();
point.pointNum = Convert.ToInt32(row.Cells[this.Column_pointNum.Name].Value.ToString()); point.pointNum = Convert.ToInt32(row.Cells[this.Column_pointNum.Name].Value.ToString());
point.TagNo = row.Cells[this.Column_PartNum.Name].Value.ToString(); point.TagNo = row.Cells[this.Column_PartNum.Name].Value.ToString();
...@@ -847,7 +857,7 @@ namespace TSA_V ...@@ -847,7 +857,7 @@ namespace TSA_V
{ {
setPointInfo(dgvList.Rows[currIndex - 1], smt); setPointInfo(dgvList.Rows[currIndex - 1], smt);
} }
dgvList.Rows[currIndex].Selected = true; // dgvList.Rows[currIndex].Selected = true;
} }
} }
catch (Exception ex) catch (Exception ex)
...@@ -875,6 +885,9 @@ namespace TSA_V ...@@ -875,6 +885,9 @@ namespace TSA_V
List<SMTPointInfo> allPoint = allPointInfo(); List<SMTPointInfo> allPoint = allPointInfo();
FrmPointInfo fwpi = new FrmPointInfo(updateBoardInfo, allPoint, rowIndex, NextProcess); FrmPointInfo fwpi = new FrmPointInfo(updateBoardInfo, allPoint, rowIndex, NextProcess);
fwpi.StartPosition = FormStartPosition.Manual;
fwpi.Location= new Point(this.Location.X,this.Location.Y);
fwpi.ShowPointEvent += Fwpi_ShowPointEvent;
fwpi.AoiProgramName = cmbAOIFile.Text; fwpi.AoiProgramName = cmbAOIFile.Text;
fwpi.PicImage = picBoard.Image; fwpi.PicImage = picBoard.Image;
DialogResult result = fwpi.ShowDialog(); DialogResult result = fwpi.ShowDialog();
...@@ -899,17 +912,16 @@ namespace TSA_V ...@@ -899,17 +912,16 @@ namespace TSA_V
loadPictureBoxSize(); loadPictureBoxSize();
} }
SetListCurrCell(index); SetListCurrCell(index);
} }
} }
private void AddNewPoint(double x, double y, double nodeX, double nodeY) private void AddNewPoint(double x, double y, double nodeX, double nodeY)
{ {
SMTPointInfo smtInfo = new SMTPointInfo(); SMTPointInfo smtInfo = new SMTPointInfo();
string name = "P" + (dgvList.Rows.Count + 1); string name = "P" + (dgvList.Rows.Count + 1);
FrmPointInfo fwpi = new FrmPointInfo(updateBoardInfo, name, x, y, nodeX, nodeY); FrmPointInfo fwpi = new FrmPointInfo(updateBoardInfo, name, x, y, nodeX, nodeY);
fwpi.ShowPointEvent += Fwpi_ShowPointEvent;
fwpi.AoiProgramName = cmbAOIFile.Text; fwpi.AoiProgramName = cmbAOIFile.Text;
fwpi.PicImage = picBoard.Image; fwpi.PicImage = picBoard.Image;
DialogResult result = fwpi.ShowDialog(); DialogResult result = fwpi.ShowDialog();
...@@ -1209,7 +1221,7 @@ namespace TSA_V ...@@ -1209,7 +1221,7 @@ namespace TSA_V
{ {
if (isFinishLoad) if (isFinishLoad)
{ {
if (dgvList.SelectedRows != null && dgvList.SelectedRows.Count > 0) if (dgvList.SelectedRows != null && dgvList.SelectedRows.Count ==1)
{ {
int rowIndex = dgvList.SelectedRows[0].Index; int rowIndex = dgvList.SelectedRows[0].Index;
string partNum = dgvList.Rows[rowIndex].Cells[this.Column_PartNum.Name].Value.ToString(); string partNum = dgvList.Rows[rowIndex].Cells[this.Column_PartNum.Name].Value.ToString();
...@@ -1580,5 +1592,109 @@ namespace TSA_V ...@@ -1580,5 +1592,109 @@ namespace TSA_V
dgvList.Rows[i].Cells[this.Column_disable.Name].Value = true; dgvList.Rows[i].Cells[this.Column_disable.Name].Value = true;
} }
} }
private void linkEnable_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
if (dgvList.SelectedRows != null && dgvList.SelectedRows.Count > 0)
{
int count = 0; isFinishLoad = false;
try
{
foreach (DataGridViewRow row in dgvList.SelectedRows)
{
SMTPointInfo point = getRowPointInfo(row);
point.Disable = false;
setPointInfo(row, point);
row.Selected = false;
count++;
}
}
catch (Exception ex)
{
LogUtil.error(ex.ToString());
}
finally
{
isFinishLoad = true;
}
if (count > 0)
{
MessageBox.Show(ResourceCulture.GetString("EnableOk", "启用成功"));
}
}
}
private void linkDis_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
if (dgvList.SelectedRows != null && dgvList.SelectedRows.Count > 0)
{
int count = 0;
isFinishLoad = false;
try
{
foreach (DataGridViewRow row in dgvList.SelectedRows)
{
SMTPointInfo point = getRowPointInfo(row);
point.Disable = true;
setPointInfo(row, point);
row.Selected = false;
count++;
}
}
catch (Exception ex)
{
LogUtil.error(ex.ToString());
}
finally
{
isFinishLoad = true;
}
if (count > 0)
{
MessageBox.Show(ResourceCulture.GetString("DisableOk", "禁用成功"));
}
}
}
private bool Fwpi_ShowPointEvent(SMTPointInfo smtInfo, Color color)
{
try
{
if (chbNormal.Checked)
{
chbNormal.Checked = false;
}
panBoard.AutoScrollPosition = new Point((int)(smtInfo.PositionX * display.imageXiShu - panBoard.Width / 2), (int)(smtInfo.PositionY * display.imageXiShu - panBoard.Height / 2));
// panBoard.AutoScrollPosition = new Point((int)picBoard.Width, (int)picBoard.Height);
if (isFinishLoad && this.txtBoardW.Text.Trim() != "" && this.txtBoardL.Text.Trim() != "")
{
//loadPictureBoxSize();
int width = 200;
int height = 200;
if (this.txtBoardL.Text.Trim() != "" && (this.txtBoardW.Text.Trim() != ""))
{
width = Convert.ToInt32(this.txtBoardL.Text.Trim());
height = Convert.ToInt32(this.txtBoardW.Text.Trim());
}
display.selectIndex = selectIndex;
display.SetImage(picBoard.Image);
display.ShowName = chbShowName.Checked;
display.ImageNormal = chbNormal.Checked;
display.DrawEditPoint(width, height, smtInfo, color);
imageXiShu = display.imageXiShu;
}
}
catch (Exception ex)
{
LogUtil.error("出错:" + ex.ToString());
}
return true;
}
} }
} }
...@@ -190,7 +190,11 @@ namespace TSA_V ...@@ -190,7 +190,11 @@ namespace TSA_V
{ {
this.Visible = true; this.Visible = true;
LoadCom(); LoadCom();
cmbBoardList_SelectedIndexChanged(null, null); if (cmbBoardList.Items.Count > 0)
{
cmbBoardList.SelectedIndex=cmbBoardList.Items.Count-1;
}
//cmbBoardList_SelectedIndexChanged(null, null);
preId = -1; preId = -1;
} }
} }
...@@ -204,6 +208,7 @@ namespace TSA_V ...@@ -204,6 +208,7 @@ namespace TSA_V
{ {
if (cmbBoardList.Text != "" && cmbBoardList.SelectedIndex >= 0) if (cmbBoardList.Text != "" && cmbBoardList.SelectedIndex >= 0)
{ {
int selectIndex=cmbBoardList.SelectedIndex;
BoardInfo board = (BoardInfo)cmbBoardList.SelectedItem; BoardInfo board = (BoardInfo)cmbBoardList.SelectedItem;
////如果是当前默认程序,不能删除 ////如果是当前默认程序,不能删除
//if (BoardManager.CurrBoard != null && board.boardId.Equals(BoardManager.CurrBoardId)) //if (BoardManager.CurrBoard != null && board.boardId.Equals(BoardManager.CurrBoardId))
...@@ -228,8 +233,17 @@ namespace TSA_V ...@@ -228,8 +233,17 @@ namespace TSA_V
this.txtWidth.Text = ""; this.txtWidth.Text = "";
this.picBoard.Image = null; this.picBoard.Image = null;
LoadCom(); LoadCom();
cmbBoardList_SelectedIndexChanged(null, null); int nexcount = selectIndex - 1;
if (nexcount < 0 &&cmbBoardList.Items.Count>0)
{
cmbBoardList.SelectedIndex = 0;
}
else
{
cmbBoardList.SelectedIndex = nexcount;
}
//cmbBoardList_SelectedIndexChanged(null, null);
preId = -1; preId = -1;
} }
} }
......
...@@ -356,6 +356,7 @@ namespace TSA_V.frmBoard ...@@ -356,6 +356,7 @@ namespace TSA_V.frmBoard
} }
else else
{ {
this.componetInfos = frmViewer.dataList;
this.DialogResult = DialogResult.OK; this.DialogResult = DialogResult.OK;
} }
} }
......
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.linkDelete = new System.Windows.Forms.LinkLabel();
this.btnCancel = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.dgvData = new System.Windows.Forms.DataGridView(); this.dgvData = new System.Windows.Forms.DataGridView();
this.Column_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
...@@ -40,12 +43,48 @@ ...@@ -40,12 +43,48 @@
this.Column_Notes = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column_Notes = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_CompontentDes = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column_CompontentDes = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_del = new System.Windows.Forms.DataGridViewLinkColumn(); this.Column_del = new System.Windows.Forms.DataGridViewLinkColumn();
this.btnOK = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvData)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dgvData)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// linkDelete
//
this.linkDelete.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.linkDelete.AutoSize = true;
this.linkDelete.Location = new System.Drawing.Point(13, 577);
this.linkDelete.Name = "linkDelete";
this.linkDelete.Size = new System.Drawing.Size(53, 12);
this.linkDelete.TabIndex = 286;
this.linkDelete.TabStop = true;
this.linkDelete.Text = "批量删除";
this.linkDelete.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkDelete_LinkClicked);
//
// btnCancel
//
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCancel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCancel.Location = new System.Drawing.Point(875, 577);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(120, 45);
this.btnCancel.TabIndex = 285;
this.btnCancel.Text = "取消";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnOK
//
this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOK.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOK.Location = new System.Drawing.Point(749, 577);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(120, 45);
this.btnOK.TabIndex = 284;
this.btnOK.Text = "确认";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// panel1 // panel1
// //
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
...@@ -76,13 +115,13 @@ ...@@ -76,13 +115,13 @@
this.Column_del}); this.Column_del});
this.dgvData.Dock = System.Windows.Forms.DockStyle.Fill; this.dgvData.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvData.Location = new System.Drawing.Point(0, 0); this.dgvData.Location = new System.Drawing.Point(0, 0);
this.dgvData.MultiSelect = false;
this.dgvData.Name = "dgvData"; this.dgvData.Name = "dgvData";
this.dgvData.RowTemplate.Height = 23; this.dgvData.RowTemplate.Height = 23;
this.dgvData.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.dgvData.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgvData.Size = new System.Drawing.Size(995, 562); this.dgvData.Size = new System.Drawing.Size(995, 562);
this.dgvData.TabIndex = 0; this.dgvData.TabIndex = 0;
this.dgvData.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvData_CellContentClick); this.dgvData.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvData_CellContentClick);
this.dgvData.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(this.dgvData_RowPostPaint);
// //
// Column_ID // Column_ID
// //
...@@ -137,37 +176,12 @@ ...@@ -137,37 +176,12 @@
this.Column_del.Name = "Column_del"; this.Column_del.Name = "Column_del";
this.Column_del.Text = "删除"; this.Column_del.Text = "删除";
// //
// btnOK
//
this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOK.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOK.Location = new System.Drawing.Point(749, 577);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(120, 45);
this.btnOK.TabIndex = 284;
this.btnOK.Text = "确认";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// btnCancel
//
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCancel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCancel.Location = new System.Drawing.Point(875, 577);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(120, 45);
this.btnCancel.TabIndex = 285;
this.btnCancel.Text = "取消";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// FrmBomViewer // FrmBomViewer
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1007, 634); this.ClientSize = new System.Drawing.Size(1007, 634);
this.Controls.Add(this.linkDelete);
this.Controls.Add(this.btnCancel); this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK); this.Controls.Add(this.btnOK);
this.Controls.Add(this.panel1); this.Controls.Add(this.panel1);
...@@ -180,6 +194,7 @@ ...@@ -180,6 +194,7 @@
this.panel1.ResumeLayout(false); this.panel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dgvData)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dgvData)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout();
} }
...@@ -199,5 +214,6 @@ ...@@ -199,5 +214,6 @@
private System.Windows.Forms.DataGridViewTextBoxColumn Column_Notes; private System.Windows.Forms.DataGridViewTextBoxColumn Column_Notes;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_CompontentDes; private System.Windows.Forms.DataGridViewTextBoxColumn Column_CompontentDes;
private System.Windows.Forms.DataGridViewLinkColumn Column_del; private System.Windows.Forms.DataGridViewLinkColumn Column_del;
private System.Windows.Forms.LinkLabel linkDelete;
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -192,5 +192,55 @@ namespace TSA_V ...@@ -192,5 +192,55 @@ namespace TSA_V
} }
} }
} }
private void linkDelete_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
if (dgvData.SelectedRows != null && dgvData.SelectedRows.Count > 0)
{
try
{
if (MessageBox.Show(ResourceCulture.GetString("SureDeleteSel", "确定删除选中的数据?"),
ResourceCulture.GetString(ResourceCulture.MsgTitle, "提示?"),
MessageBoxButtons.OKCancel,
MessageBoxIcon.Question) != DialogResult.OK)
{
return;
}
List<DataGridViewRow> rows = new List<DataGridViewRow>();
foreach (DataGridViewRow row in dgvData.SelectedRows)
{
rows.Add(row);
}
foreach(DataGridViewRow row in rows)
{
this.dgvData.Rows.Remove(row);
}
}
catch (Exception ex)
{
LogUtil.error(ex.ToString());
}
}
}
private void dgvData_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
{
// 表头宽度
SizeF strSizeF = e.Graphics.MeasureString((e.RowIndex + 1).ToString(), this.dgvData.RowHeadersDefaultCellStyle.Font);
if (strSizeF.Width + 20 > this.dgvData.RowHeadersWidth)
this.dgvData.RowHeadersWidth = 20 + (int)strSizeF.Width;
// 序号显示
SolidBrush b = new SolidBrush(dgvData.RowHeadersDefaultCellStyle.ForeColor);
e.Graphics.DrawString(
(e.RowIndex + 1).ToString(System.Globalization.CultureInfo.CurrentUICulture),
this.dgvData.DefaultCellStyle.Font,
b,
e.RowBounds.Location.X + 10,
e.RowBounds.Location.Y + 4);
}
} }
} }
...@@ -260,23 +260,15 @@ namespace TSA_V.frmBoard ...@@ -260,23 +260,15 @@ namespace TSA_V.frmBoard
{ {
List<SMTPointInfo> pointList = new List<SMTPointInfo>(currBoard.smtList); List<SMTPointInfo> pointList = new List<SMTPointInfo>(currBoard.smtList);
SMTPointInfo lefup = new SMTPointInfo(); List<SMTPointInfo> checkOKList = currBoard.getCalPoint();
lefup.PositionX = 0;
lefup.PositionY = 0;
lefup.NodePositionX = currBoard.calInfo.leftUpPoint.X;
lefup.NodePositionY = currBoard.calInfo.leftUpPoint.Y;
SMTPointInfo right = new SMTPointInfo();
right.PositionX = currBoard.boardWidth;
right.PositionY = currBoard.boardLength;
right.NodePositionX = currBoard.calInfo.rightBottomPoint.X;
right.NodePositionY = currBoard.calInfo.rightBottomPoint.Y;
LogUtil.info($" 【{ currBoard.boardName}】左上角(0,0)坐标【{lefup.NodePositionX},{ lefup.NodePositionY}】右下角({right.PositionX},{right.PositionY})【{right.NodePositionX},{right.NodePositionY}】"); LogUtil.info($" 【{currBoard.boardName}】左上角(0,0)坐标【{checkOKList[0].NodePositionX},{checkOKList[0].NodePositionY}】右下角" +
List<SMTPointInfo> checkOKList = new List<SMTPointInfo>() { lefup, right }; $"({checkOKList[1].PositionX},{checkOKList[1].PositionY})【{checkOKList[1].NodePositionX},{checkOKList[1].NodePositionY}】");
for (int i = 0; i < pointList.Count; i++) for (int i = 0; i < pointList.Count; i++)
{ {
pointList[i] = CalPointNodePosition(pointList[i], checkOKList); pointList[i] =XYConvertManager.CalPointNodePosition(pointList[i], checkOKList);
} }
currBoard.smtList = pointList; currBoard.smtList = pointList;
BoardManager.Update(currBoard); BoardManager.Update(currBoard);
...@@ -285,6 +277,10 @@ namespace TSA_V.frmBoard ...@@ -285,6 +277,10 @@ namespace TSA_V.frmBoard
this.Cursor = Cursors.Default; this.Cursor = Cursors.Default;
//重新加载 //重新加载
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.TrainOK, "坐标校准完成!")); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.TrainOK, "坐标校准完成!"));
//记录校准信息
XYConvertManager.SaveData(currBoard);
DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
this.Close(); this.Close();
} }
...@@ -294,116 +290,6 @@ namespace TSA_V.frmBoard ...@@ -294,116 +290,6 @@ namespace TSA_V.frmBoard
} }
} }
private SMTPointInfo CalPointNodePosition(SMTPointInfo smtPoint, List<SMTPointInfo> checkOKList)
{
try
{
if (smtPoint.CheckOK)
{
//校准点不再自动计算
return smtPoint;
}
double oldX = smtPoint.NodePositionX;
double oldY = smtPoint.NodePositionY;
//SMTPointInfo APoint = GetPoint(smtPoint, checkOKList);
//SMTPointInfo BPoint = GetPoint(APoint, checkOKList);
SMTPointInfo APoint = checkOKList[0];
SMTPointInfo BPoint = checkOKList[1];
//计算坐标
if (Math.Abs(smtPoint.PositionX - APoint.PositionX) < 0.01)
{
smtPoint.NodePositionX = APoint.NodePositionX;
}
else
{
smtPoint.NodePositionX = APoint.NodePositionX + (BPoint.NodePositionX - APoint.NodePositionX) * (smtPoint.PositionX - APoint.PositionX) / (BPoint.PositionX - APoint.PositionX);
if (double.IsNaN(smtPoint.NodePositionX) || double.IsInfinity(smtPoint.NodePositionX))
{
smtPoint.NodePositionX = APoint.NodePositionX;
}
}
if (Math.Abs(smtPoint.PositionY - APoint.PositionY) < 0.01)
{
smtPoint.NodePositionY = APoint.NodePositionY;
}
else
{
smtPoint.NodePositionY = APoint.NodePositionY + (BPoint.NodePositionY - APoint.NodePositionY) * (smtPoint.PositionY - APoint.PositionY) / (BPoint.PositionY - APoint.PositionY);
if (double.IsNaN(smtPoint.NodePositionY) || double.IsInfinity(smtPoint.NodePositionY))
{
smtPoint.NodePositionY = APoint.NodePositionY;
}
}
if (smtPoint.NodePositionX <= 0)
{
smtPoint.NodePositionX = 1;
}
else if (smtPoint.NodePositionX > FrmProjectorScreen.instance.BoundsWidth)
{
smtPoint.NodePositionX = FrmProjectorScreen.instance.BoundsWidth;
}
if (smtPoint.NodePositionY <= 0)
{
smtPoint.NodePositionY = 1;
}
else if (smtPoint.NodePositionY > FrmProjectorScreen.instance.BoundsHeight)
{
smtPoint.NodePositionY = FrmProjectorScreen.instance.BoundsHeight;
}
if (smtPoint.PointSizeX < 1 || smtPoint.PointSizeX > 255)
{
smtPoint.PointSizeX = Setting_NInit.Device_DefaultPointSize;
}
if (smtPoint.PointSizeY < 1 || smtPoint.PointSizeY > 255)
{
smtPoint.PointSizeY = Setting_NInit.Device_DefaultPointSize;
}
//smtPoint.PointSize = 4;
//smtPoint.NodePositionX = BPoint.NodePositionX - (BPoint.NodePositionX - APoint.NodePositionX) * (BPoint.PositionX - smtPoint.PositionX) / (BPoint.PositionX - APoint.PositionX);
//smtPoint.NodePositionY = BPoint.NodePositionY - (BPoint.NodePositionY - APoint.NodePositionY) * (BPoint.PositionY - smtPoint.PositionY) / (BPoint.PositionY - APoint.PositionY);
LogUtil.info(" 【" + smtPoint.PN + "】图片坐标【" + smtPoint.PositionX + "," + smtPoint.PositionY + "】旧坐标【" + oldX + "," + oldY + "】新坐标【" + smtPoint.NodePositionX + "," + smtPoint.NodePositionY + "】");
return smtPoint;
}
catch (Exception ex)
{
LogUtil.error(" 【" + smtPoint.PN + "】图片坐标【" + smtPoint.PositionX + "," + smtPoint.PositionY + "】校准坐标出错:" + ex.ToString());
}
return smtPoint;
}
private SMTPointInfo GetPoint(SMTPointInfo smtPoint, List<SMTPointInfo> checkOKList)
{
SMTPointInfo p = null;
double maxPingFang = 0;
foreach (SMTPointInfo sm in checkOKList)
{
if (sm.pointNum.Equals(smtPoint.pointNum))
{
continue;
}
double xjuli = sm.PositionX - smtPoint.PositionX;
double yjuli = sm.PositionY - smtPoint.PositionY;
double cping = xjuli * xjuli + yjuli * yjuli;
if (cping > maxPingFang)
{
p = sm;
maxPingFang = cping;
continue;
}
}
if (p != null)
{
return p;
}
return null;
}
private void btnExit_Click(object sender, EventArgs e) private void btnExit_Click(object sender, EventArgs e)
{ {
......
namespace TSA_V
{
partial class FrmComCountView
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.btnCancel = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.dgvData = new System.Windows.Forms.DataGridView();
this.Column_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_TagNo = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_PN = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_PositionNum = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_ComCount = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_nCount = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_ISUpdate = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvData)).BeginInit();
this.SuspendLayout();
//
// btnCancel
//
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCancel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCancel.Location = new System.Drawing.Point(875, 577);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(120, 45);
this.btnCancel.TabIndex = 285;
this.btnCancel.Text = "取消";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnOK
//
this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOK.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOK.Location = new System.Drawing.Point(749, 577);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(120, 45);
this.btnOK.TabIndex = 284;
this.btnOK.Text = "确认";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// panel1
//
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.panel1.Controls.Add(this.dgvData);
this.panel1.Location = new System.Drawing.Point(5, 5);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(995, 562);
this.panel1.TabIndex = 0;
//
// dgvData
//
this.dgvData.AllowUserToAddRows = false;
this.dgvData.AllowUserToDeleteRows = false;
this.dgvData.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvData.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Column_ID,
this.Column_TagNo,
this.Column_PN,
this.Column_PositionNum,
this.Column_ComCount,
this.Column_nCount,
this.Column_ISUpdate});
this.dgvData.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvData.Location = new System.Drawing.Point(0, 0);
this.dgvData.Name = "dgvData";
this.dgvData.RowTemplate.Height = 23;
this.dgvData.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgvData.Size = new System.Drawing.Size(995, 562);
this.dgvData.TabIndex = 0;
this.dgvData.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvData_CellEndEdit);
this.dgvData.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(this.dgvData_RowPostPaint);
//
// Column_ID
//
this.Column_ID.DataPropertyName = "Id";
this.Column_ID.HeaderText = "ID";
this.Column_ID.Name = "Column_ID";
this.Column_ID.ReadOnly = true;
this.Column_ID.Visible = false;
//
// Column_TagNo
//
this.Column_TagNo.HeaderText = "位号";
this.Column_TagNo.Name = "Column_TagNo";
this.Column_TagNo.ReadOnly = true;
this.Column_TagNo.Width = 200;
//
// Column_PN
//
this.Column_PN.HeaderText = "物料编码";
this.Column_PN.Name = "Column_PN";
this.Column_PN.ReadOnly = true;
this.Column_PN.Width = 200;
//
// Column_PositionNum
//
this.Column_PositionNum.HeaderText = "料盘位置";
this.Column_PositionNum.Name = "Column_PositionNum";
this.Column_PositionNum.ReadOnly = true;
this.Column_PositionNum.Width = 120;
//
// Column_ComCount
//
this.Column_ComCount.HeaderText = "原始数量";
this.Column_ComCount.Name = "Column_ComCount";
this.Column_ComCount.ReadOnly = true;
//
// Column_nCount
//
this.Column_nCount.HeaderText = "新数量";
this.Column_nCount.Name = "Column_nCount";
//
// Column_ISUpdate
//
this.Column_ISUpdate.HeaderText = "是否修改";
this.Column_ISUpdate.Name = "Column_ISUpdate";
this.Column_ISUpdate.ReadOnly = true;
//
// FrmComCountView
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1007, 634);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK);
this.Controls.Add(this.panel1);
this.MaximizeBox = true;
this.MinimizeBox = true;
this.Name = "FrmComCountView";
this.Text = "数据预览";
this.TopMost = true;
this.Load += new System.EventHandler(this.FrmImageViewer_Load);
this.panel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dgvData)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.DataGridView dgvData;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_TagNo;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_PN;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_PositionNum;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_ComCount;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_nCount;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_ISUpdate;
}
}
\ No newline at end of file \ No newline at end of file
using log4net.Repository.Hierarchy;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using TSA_V.Common;
using TSA_V.DeviceLibrary;
using TSA_V.LoadCSVLibrary;
namespace TSA_V
{
public partial class FrmComCountView : FrmBase
{
public List<ComponetUploadInfo> dataList = new List<ComponetUploadInfo>();
public FrmComCountView(List<ComponetUploadInfo> dataList )
{
InitializeComponent();
this.dataList = dataList;
}
private void FrmImageViewer_Load(object sender, EventArgs e)
{
LoadData();
this.WindowState = FormWindowState.Maximized;
}
private void addData (ComponetUploadInfo obj)
{
DataGridViewRow row = new DataGridViewRow();
row.CreateCells(dgvData);
row.Cells[0].Value = obj.Id;
row.Cells[Column_TagNo.Index].Value = obj.TagNo;
row.Cells[Column_PN.Index].Value = obj.PN;
row.Cells[Column_PositionNum.Index].Value = obj.PositionNum;
row.Cells[Column_ComCount.Index].Value = obj.ComCount;
row.Cells[Column_nCount.Index].Value = obj.NewCount;
if (obj.NewCount != obj.ComCount)
{
row.DefaultCellStyle.BackColor = Color.LightBlue;
row.Cells[Column_ISUpdate.Index].Value = "√";
}
else
{
row.DefaultCellStyle.BackColor = Color.White;
row.Cells[Column_ISUpdate.Index].Value = "";
}
dgvData.Rows.Add(row);
}
private void LoadData()
{
//dgvData.DataSource = dataList;
dgvData.Columns[0].Visible = false;
dgvData.Columns[Column_TagNo.Index].HeaderText = ResourceCulture.GetString(ResourceCulture.Col_Num, "位号");
dgvData.Columns[Column_PN.Index].HeaderText = ResourceCulture.GetString(ResourceCulture.Col_Name, "物料编码");
dgvData.Columns[Column_PositionNum.Index].HeaderText = ResourceCulture.GetString(ResourceCulture.Col_Position, "料盘位置");
dgvData.Columns[Column_ComCount.Index].HeaderText = ResourceCulture.GetString(ResourceCulture.Col_Count, "数量");
dgvData.Columns[Column_nCount.Index].HeaderText = ResourceCulture.GetString("Col_Count_N", "修改后数量");
dgvData.Columns[Column_ISUpdate.Index].HeaderText = ResourceCulture.GetString("Column_ISUpdate", "是否修改");
dgvData.AllowUserToDeleteRows = false;
dgvData.AllowUserToOrderColumns = false;
Column_TagNo.ReadOnly = true;
Column_PN.ReadOnly = true;
Column_PositionNum.ReadOnly = true;
Column_ComCount.ReadOnly = true;
Column_nCount.ReadOnly = false;
foreach (ComponetUploadInfo obj in dataList)
{
addData(obj);
}
this.Text = ResourceCulture.GetString("FrmListViewer_Text", "数据预览");
btnCancel.Text = ResourceCulture.GetString("FrmListViewer_btnCancel_Text", "取消");
btnOK.Text = ResourceCulture.GetString("FrmListViewer_btnOK_Text", "确定");
}
private void GetList()
{
List<ComponetUploadInfo> pointList = new List<ComponetUploadInfo>();
foreach (DataGridViewRow row in dgvData.Rows)
{
if (row != null)
{
ComponetUploadInfo point = getRowPointInfo(row);
if (point != null)
{
pointList.Add(point);
}
}
}
this.dataList = new List<ComponetUploadInfo>(pointList);
}
private ComponetUploadInfo getRowPointInfo(DataGridViewRow row)
{
ComponetUploadInfo point = new ComponetUploadInfo();
try
{
if (row.Cells[Column_TagNo.Name].Value == null)
{
return null;
}
point.Id = Convert.ToInt32( row.Cells[Column_ID.Name].Value.ToString());
point.PN = row.Cells[this.Column_PN.Name].Value.ToString();
point.TagNo = row.Cells[this.Column_TagNo.Name].Value.ToString();
point.PositionNum = row.Cells[this.Column_PositionNum.Name].Value.ToString();
point.ComCount = row.Cells[this.Column_ComCount.Name].Value.ToString();
point.NewCount = row.Cells[this.Column_nCount.Name].Value.ToString();
}
catch (Exception ex)
{
LogUtil.error( "保存数据出错:" + ex.ToString());
return null;
}
return point;
}
private void btnOK_Click(object sender, EventArgs e)
{
GetList();
this.DialogResult = DialogResult.OK;
this.Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
if(dataList.Count <= 0)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
DialogResult resul = MessageBox.Show(ResourceCulture.GetString("SureCancelData","确认取消数据上传?"), "", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (resul == DialogResult.Yes)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
}
private void dgvData_CellEndEdit(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex >= 0)
{
ComponetUploadInfo com = getRowPointInfo(dgvData.Rows[e.RowIndex]);
if(com.NewCount.Equals(com.ComCount))
{
dgvData.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.White;
dgvData.Rows[e.RowIndex].Cells[Column_ISUpdate.Index].Value = "";
}
else
{
dgvData.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.LightBlue;
dgvData.Rows[e.RowIndex].Cells[Column_ISUpdate.Index].Value = "√";
}
}
}
private void dgvData_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
{
// 表头宽度
SizeF strSizeF = e.Graphics.MeasureString((e.RowIndex + 1).ToString(), this.dgvData.RowHeadersDefaultCellStyle.Font);
if (strSizeF.Width + 20 > this.dgvData.RowHeadersWidth)
this.dgvData.RowHeadersWidth = 20 + (int)strSizeF.Width;
// 序号显示
SolidBrush b = new SolidBrush(dgvData.RowHeadersDefaultCellStyle.ForeColor);
e.Graphics.DrawString(
(e.RowIndex + 1).ToString(System.Globalization.CultureInfo.CurrentUICulture),
this.dgvData.DefaultCellStyle.Font,
b,
e.RowBounds.Location.X + 10,
e.RowBounds.Location.Y + 4);
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="Column_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_TagNo.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_PN.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_PositionNum.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_ComCount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_nCount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_ISUpdate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>
\ No newline at end of file \ No newline at end of file
...@@ -36,25 +36,30 @@ ...@@ -36,25 +36,30 @@
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.cmbPnList = new System.Windows.Forms.ComboBox(); this.cmbPnList = new System.Windows.Forms.ComboBox();
this.lblNotes = new System.Windows.Forms.Label(); this.lblNotes = new System.Windows.Forms.Label();
this.chbCheck = new System.Windows.Forms.CheckBox();
this.txtWeldTemp = new System.Windows.Forms.TextBox(); this.txtWeldTemp = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label();
this.txtWeldTime = new System.Windows.Forms.TextBox(); this.txtWeldTime = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label();
this.chbNeedCheck = new System.Windows.Forms.CheckBox(); this.chbNeedCheck = new System.Windows.Forms.CheckBox();
this.label3 = new System.Windows.Forms.Label();
this.txtTagNo = new System.Windows.Forms.TextBox(); this.txtTagNo = new System.Windows.Forms.TextBox();
this.chbNeedSoldering = new System.Windows.Forms.CheckBox(); this.chbNeedSoldering = new System.Windows.Forms.CheckBox();
this.txtY = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.txtPn = new System.Windows.Forms.TextBox(); this.txtPn = new System.Windows.Forms.TextBox();
this.txtX = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.btnCancel = new System.Windows.Forms.Button(); this.btnCancel = new System.Windows.Forms.Button();
this.btnSave = new System.Windows.Forms.Button(); this.btnSave = new System.Windows.Forms.Button();
this.xyMoveControl1 = new UserFromControl.ProjectorControl(); this.projectorControl = new UserFromControl.ProjectorControl();
this.btnColorChange = new System.Windows.Forms.Button();
this.actControl = new UserFromControl.ProjectorControl();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.panPro = new System.Windows.Forms.Panel();
this.panImg = new System.Windows.Forms.Panel();
this.rdbPro = new System.Windows.Forms.RadioButton();
this.rdbImg = new System.Windows.Forms.RadioButton();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.panPro.SuspendLayout();
this.panImg.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// timer1 // timer1
...@@ -64,10 +69,10 @@ ...@@ -64,10 +69,10 @@
// //
// btnPre // btnPre
// //
this.btnPre.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnPre.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnPre.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnPre.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnPre.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnPre.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnPre.Location = new System.Drawing.Point(46, 563); this.btnPre.Location = new System.Drawing.Point(64, 644);
this.btnPre.Name = "btnPre"; this.btnPre.Name = "btnPre";
this.btnPre.Size = new System.Drawing.Size(120, 45); this.btnPre.Size = new System.Drawing.Size(120, 45);
this.btnPre.TabIndex = 62; this.btnPre.TabIndex = 62;
...@@ -77,10 +82,10 @@ ...@@ -77,10 +82,10 @@
// //
// btnSaveAndNext // btnSaveAndNext
// //
this.btnSaveAndNext.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnSaveAndNext.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnSaveAndNext.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnSaveAndNext.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSaveAndNext.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnSaveAndNext.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSaveAndNext.Location = new System.Drawing.Point(300, 563); this.btnSaveAndNext.Location = new System.Drawing.Point(318, 644);
this.btnSaveAndNext.Name = "btnSaveAndNext"; this.btnSaveAndNext.Name = "btnSaveAndNext";
this.btnSaveAndNext.Size = new System.Drawing.Size(120, 45); this.btnSaveAndNext.Size = new System.Drawing.Size(120, 45);
this.btnSaveAndNext.TabIndex = 61; this.btnSaveAndNext.TabIndex = 61;
...@@ -92,25 +97,20 @@ ...@@ -92,25 +97,20 @@
// //
this.groupBox1.Controls.Add(this.cmbPnList); this.groupBox1.Controls.Add(this.cmbPnList);
this.groupBox1.Controls.Add(this.lblNotes); this.groupBox1.Controls.Add(this.lblNotes);
this.groupBox1.Controls.Add(this.chbCheck);
this.groupBox1.Controls.Add(this.txtWeldTemp); this.groupBox1.Controls.Add(this.txtWeldTemp);
this.groupBox1.Controls.Add(this.label6); this.groupBox1.Controls.Add(this.label6);
this.groupBox1.Controls.Add(this.txtWeldTime); this.groupBox1.Controls.Add(this.txtWeldTime);
this.groupBox1.Controls.Add(this.label7); this.groupBox1.Controls.Add(this.label7);
this.groupBox1.Controls.Add(this.chbNeedCheck); this.groupBox1.Controls.Add(this.chbNeedCheck);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.txtTagNo); this.groupBox1.Controls.Add(this.txtTagNo);
this.groupBox1.Controls.Add(this.chbNeedSoldering); this.groupBox1.Controls.Add(this.chbNeedSoldering);
this.groupBox1.Controls.Add(this.txtY);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.label2); this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.txtPn); this.groupBox1.Controls.Add(this.txtPn);
this.groupBox1.Controls.Add(this.txtX);
this.groupBox1.Controls.Add(this.label1); this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox1.Location = new System.Drawing.Point(44, 9); this.groupBox1.Location = new System.Drawing.Point(25, 9);
this.groupBox1.Name = "groupBox1"; this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(503, 226); this.groupBox1.Size = new System.Drawing.Size(570, 149);
this.groupBox1.TabIndex = 59; this.groupBox1.TabIndex = 59;
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
this.groupBox1.Text = "组装信息"; this.groupBox1.Text = "组装信息";
...@@ -127,27 +127,16 @@ ...@@ -127,27 +127,16 @@
// //
// lblNotes // lblNotes
// //
this.lblNotes.Location = new System.Drawing.Point(6, 179); this.lblNotes.Location = new System.Drawing.Point(35, 100);
this.lblNotes.Name = "lblNotes"; this.lblNotes.Name = "lblNotes";
this.lblNotes.Size = new System.Drawing.Size(491, 36); this.lblNotes.Size = new System.Drawing.Size(491, 36);
this.lblNotes.TabIndex = 85; this.lblNotes.TabIndex = 85;
this.lblNotes.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblNotes.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// chbCheck
//
this.chbCheck.AutoSize = true;
this.chbCheck.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbCheck.Location = new System.Drawing.Point(135, 141);
this.chbCheck.Name = "chbCheck";
this.chbCheck.Size = new System.Drawing.Size(168, 24);
this.chbCheck.TabIndex = 84;
this.chbCheck.Text = "设置为红外坐标校准点";
this.chbCheck.UseVisualStyleBackColor = true;
//
// txtWeldTemp // txtWeldTemp
// //
this.txtWeldTemp.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.txtWeldTemp.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtWeldTemp.Location = new System.Drawing.Point(211, 139); this.txtWeldTemp.Location = new System.Drawing.Point(234, 127);
this.txtWeldTemp.MaxLength = 8; this.txtWeldTemp.MaxLength = 8;
this.txtWeldTemp.Name = "txtWeldTemp"; this.txtWeldTemp.Name = "txtWeldTemp";
this.txtWeldTemp.Size = new System.Drawing.Size(90, 26); this.txtWeldTemp.Size = new System.Drawing.Size(90, 26);
...@@ -176,7 +165,7 @@ ...@@ -176,7 +165,7 @@
// //
// label7 // label7
// //
this.label7.Location = new System.Drawing.Point(43, 140); this.label7.Location = new System.Drawing.Point(66, 128);
this.label7.Name = "label7"; this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(162, 22); this.label7.Size = new System.Drawing.Size(162, 22);
this.label7.TabIndex = 80; this.label7.TabIndex = 80;
...@@ -195,16 +184,6 @@ ...@@ -195,16 +184,6 @@
this.chbNeedCheck.UseVisualStyleBackColor = true; this.chbNeedCheck.UseVisualStyleBackColor = true;
this.chbNeedCheck.Visible = false; this.chbNeedCheck.Visible = false;
// //
// label3
//
this.label3.Enabled = false;
this.label3.Location = new System.Drawing.Point(59, 100);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(74, 22);
this.label3.TabIndex = 74;
this.label3.Text = "X:";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtTagNo // txtTagNo
// //
this.txtTagNo.Enabled = false; this.txtTagNo.Enabled = false;
...@@ -218,7 +197,7 @@ ...@@ -218,7 +197,7 @@
// chbNeedSoldering // chbNeedSoldering
// //
this.chbNeedSoldering.AutoSize = true; this.chbNeedSoldering.AutoSize = true;
this.chbNeedSoldering.Location = new System.Drawing.Point(315, 144); this.chbNeedSoldering.Location = new System.Drawing.Point(338, 132);
this.chbNeedSoldering.Name = "chbNeedSoldering"; this.chbNeedSoldering.Name = "chbNeedSoldering";
this.chbNeedSoldering.Size = new System.Drawing.Size(75, 21); this.chbNeedSoldering.Size = new System.Drawing.Size(75, 21);
this.chbNeedSoldering.TabIndex = 78; this.chbNeedSoldering.TabIndex = 78;
...@@ -226,25 +205,6 @@ ...@@ -226,25 +205,6 @@
this.chbNeedSoldering.UseVisualStyleBackColor = true; this.chbNeedSoldering.UseVisualStyleBackColor = true;
this.chbNeedSoldering.Visible = false; this.chbNeedSoldering.Visible = false;
// //
// txtY
//
this.txtY.Enabled = false;
this.txtY.Location = new System.Drawing.Point(282, 100);
this.txtY.MaxLength = 20;
this.txtY.Name = "txtY";
this.txtY.Size = new System.Drawing.Size(89, 23);
this.txtY.TabIndex = 77;
//
// label4
//
this.label4.Enabled = false;
this.label4.Location = new System.Drawing.Point(230, 100);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(48, 22);
this.label4.TabIndex = 76;
this.label4.Text = "Y:";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label2 // label2
// //
this.label2.Location = new System.Drawing.Point(6, 26); this.label2.Location = new System.Drawing.Point(6, 26);
...@@ -263,15 +223,6 @@ ...@@ -263,15 +223,6 @@
this.txtPn.Size = new System.Drawing.Size(219, 26); this.txtPn.Size = new System.Drawing.Size(219, 26);
this.txtPn.TabIndex = 33; this.txtPn.TabIndex = 33;
// //
// txtX
//
this.txtX.Enabled = false;
this.txtX.Location = new System.Drawing.Point(135, 100);
this.txtX.MaxLength = 20;
this.txtX.Name = "txtX";
this.txtX.Size = new System.Drawing.Size(89, 23);
this.txtX.TabIndex = 75;
//
// label1 // label1
// //
this.label1.Location = new System.Drawing.Point(6, 64); this.label1.Location = new System.Drawing.Point(6, 64);
...@@ -283,10 +234,10 @@ ...@@ -283,10 +234,10 @@
// //
// btnCancel // btnCancel
// //
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCancel.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnCancel.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCancel.Location = new System.Drawing.Point(427, 563); this.btnCancel.Location = new System.Drawing.Point(445, 644);
this.btnCancel.Name = "btnCancel"; this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(120, 45); this.btnCancel.Size = new System.Drawing.Size(120, 45);
this.btnCancel.TabIndex = 58; this.btnCancel.TabIndex = 58;
...@@ -296,10 +247,10 @@ ...@@ -296,10 +247,10 @@
// //
// btnSave // btnSave
// //
this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSave.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnSave.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSave.Location = new System.Drawing.Point(173, 563); this.btnSave.Location = new System.Drawing.Point(191, 644);
this.btnSave.Name = "btnSave"; this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(120, 45); this.btnSave.Size = new System.Drawing.Size(120, 45);
this.btnSave.TabIndex = 57; this.btnSave.TabIndex = 57;
...@@ -307,38 +258,128 @@ ...@@ -307,38 +258,128 @@
this.btnSave.UseVisualStyleBackColor = true; this.btnSave.UseVisualStyleBackColor = true;
this.btnSave.Click += new System.EventHandler(this.btnSave_Click); this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
// //
// xyMoveControl1 // projectorControl
// //
this.xyMoveControl1.BackColor = System.Drawing.Color.White; this.projectorControl.BackColor = System.Drawing.Color.White;
this.xyMoveControl1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.projectorControl.Cursor = System.Windows.Forms.Cursors.Default;
this.xyMoveControl1.GroupName = "坐标"; this.projectorControl.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.xyMoveControl1.Location = new System.Drawing.Point(41, 241); this.projectorControl.GroupName = "坐标";
this.xyMoveControl1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.projectorControl.Location = new System.Drawing.Point(21, 4);
this.xyMoveControl1.Name = "xyMoveControl1"; this.projectorControl.Margin = new System.Windows.Forms.Padding(4);
this.xyMoveControl1.PenWidth = 2; this.projectorControl.Name = "projectorControl";
this.xyMoveControl1.PointSizeX = 4; this.projectorControl.PenWidth = 2;
this.xyMoveControl1.PointSizeY = 1; this.projectorControl.PointSizeX = 4;
this.xyMoveControl1.PointType = 1; this.projectorControl.PointSizeY = 1;
this.xyMoveControl1.PolaritiesType = 0; this.projectorControl.PointType = 1;
this.xyMoveControl1.ShowText = ""; this.projectorControl.PolaritiesType = 0;
this.xyMoveControl1.Size = new System.Drawing.Size(506, 315); this.projectorControl.ShowText = "";
this.xyMoveControl1.TabIndex = 63; this.projectorControl.Size = new System.Drawing.Size(506, 315);
this.xyMoveControl1.XValue = 1D; this.projectorControl.TabIndex = 63;
this.xyMoveControl1.YValue = 1D; this.projectorControl.XValue = 1D;
this.projectorControl.YValue = 1D;
//
// btnColorChange
//
this.btnColorChange.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnColorChange.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnColorChange.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnColorChange.Location = new System.Drawing.Point(397, 316);
this.btnColorChange.Name = "btnColorChange";
this.btnColorChange.Size = new System.Drawing.Size(120, 45);
this.btnColorChange.TabIndex = 294;
this.btnColorChange.Text = "颜色";
this.btnColorChange.UseVisualStyleBackColor = true;
this.btnColorChange.Click += new System.EventHandler(this.btnColorChange_Click);
//
// actControl
//
this.actControl.BackColor = System.Drawing.Color.White;
this.actControl.Cursor = System.Windows.Forms.Cursors.Default;
this.actControl.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.actControl.GroupName = "坐标";
this.actControl.Location = new System.Drawing.Point(13, 4);
this.actControl.Margin = new System.Windows.Forms.Padding(4);
this.actControl.Name = "actControl";
this.actControl.PenWidth = 2;
this.actControl.PointSizeX = 4;
this.actControl.PointSizeY = 1;
this.actControl.PointType = 1;
this.actControl.PolaritiesType = 0;
this.actControl.ShowText = "";
this.actControl.Size = new System.Drawing.Size(506, 315);
this.actControl.TabIndex = 64;
this.actControl.XValue = 1D;
this.actControl.YValue = 1D;
//
// groupBox2
//
this.groupBox2.Controls.Add(this.panPro);
this.groupBox2.Controls.Add(this.panImg);
this.groupBox2.Controls.Add(this.rdbPro);
this.groupBox2.Controls.Add(this.rdbImg);
this.groupBox2.Location = new System.Drawing.Point(25, 175);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(570, 452);
this.groupBox2.TabIndex = 88;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "点位设置";
//
// panPro
//
this.panPro.Controls.Add(this.projectorControl);
this.panPro.Location = new System.Drawing.Point(9, 61);
this.panPro.Name = "panPro";
this.panPro.Size = new System.Drawing.Size(531, 364);
this.panPro.TabIndex = 89;
this.panPro.Visible = false;
//
// panImg
//
this.panImg.Controls.Add(this.btnColorChange);
this.panImg.Controls.Add(this.actControl);
this.panImg.Location = new System.Drawing.Point(9, 64);
this.panImg.Name = "panImg";
this.panImg.Size = new System.Drawing.Size(531, 364);
this.panImg.TabIndex = 89;
//
// rdbPro
//
this.rdbPro.AutoSize = true;
this.rdbPro.Location = new System.Drawing.Point(267, 28);
this.rdbPro.Name = "rdbPro";
this.rdbPro.Size = new System.Drawing.Size(113, 16);
this.rdbPro.TabIndex = 1;
this.rdbPro.Text = "投影坐标/pixels";
this.rdbPro.UseVisualStyleBackColor = true;
this.rdbPro.CheckedChanged += new System.EventHandler(this.rdbPro_CheckedChanged);
//
// rdbImg
//
this.rdbImg.AutoSize = true;
this.rdbImg.Checked = true;
this.rdbImg.Location = new System.Drawing.Point(30, 28);
this.rdbImg.Name = "rdbImg";
this.rdbImg.Size = new System.Drawing.Size(89, 16);
this.rdbImg.TabIndex = 0;
this.rdbImg.TabStop = true;
this.rdbImg.Text = "实际坐标/mm";
this.rdbImg.TextAlign = System.Drawing.ContentAlignment.TopLeft;
this.rdbImg.UseVisualStyleBackColor = true;
this.rdbImg.CheckedChanged += new System.EventHandler(this.rdbImg_CheckedChanged);
// //
// FrmPointInfo // FrmPointInfo
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(599, 642); this.ClientSize = new System.Drawing.Size(620, 708);
this.Controls.Add(this.xyMoveControl1); this.Controls.Add(this.groupBox2);
this.Controls.Add(this.btnPre); this.Controls.Add(this.btnPre);
this.Controls.Add(this.btnSaveAndNext); this.Controls.Add(this.btnSaveAndNext);
this.Controls.Add(this.groupBox1); this.Controls.Add(this.groupBox1);
this.Controls.Add(this.btnCancel); this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnSave); this.Controls.Add(this.btnSave);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "FrmPointInfo"; this.Name = "FrmPointInfo";
this.Text = "组装信息"; this.Text = "组装信息";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmPointInfo_FormClosing); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmPointInfo_FormClosing);
...@@ -346,6 +387,10 @@ ...@@ -346,6 +387,10 @@
this.Shown += new System.EventHandler(this.FrmPointInfo_Shown); this.Shown += new System.EventHandler(this.FrmPointInfo_Shown);
this.groupBox1.ResumeLayout(false); this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout(); this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.panPro.ResumeLayout(false);
this.panImg.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
...@@ -358,10 +403,6 @@ ...@@ -358,10 +403,6 @@
private System.Windows.Forms.TextBox txtPn; private System.Windows.Forms.TextBox txtPn;
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtY;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtX;
private System.Windows.Forms.Timer timer1; private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.TextBox txtTagNo; private System.Windows.Forms.TextBox txtTagNo;
private System.Windows.Forms.Button btnSaveAndNext; private System.Windows.Forms.Button btnSaveAndNext;
...@@ -372,9 +413,15 @@ ...@@ -372,9 +413,15 @@
private System.Windows.Forms.TextBox txtWeldTime; private System.Windows.Forms.TextBox txtWeldTime;
private System.Windows.Forms.Label label7; private System.Windows.Forms.Label label7;
private System.Windows.Forms.Button btnPre; private System.Windows.Forms.Button btnPre;
private UserFromControl.ProjectorControl xyMoveControl1; private UserFromControl.ProjectorControl projectorControl;
private System.Windows.Forms.CheckBox chbCheck;
private System.Windows.Forms.Label lblNotes; private System.Windows.Forms.Label lblNotes;
private System.Windows.Forms.ComboBox cmbPnList; private System.Windows.Forms.ComboBox cmbPnList;
private UserFromControl.ProjectorControl actControl;
private System.Windows.Forms.Button btnColorChange;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.RadioButton rdbPro;
private System.Windows.Forms.RadioButton rdbImg;
private System.Windows.Forms.Panel panImg;
private System.Windows.Forms.Panel panPro;
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -14,11 +14,14 @@ using PUSICANLibrary; ...@@ -14,11 +14,14 @@ using PUSICANLibrary;
using TSA_V.LoadCSVLibrary; using TSA_V.LoadCSVLibrary;
using AccAOI; using AccAOI;
using UserFromControl; using UserFromControl;
using NPOI.Util;
namespace TSA_V namespace TSA_V
{ {
public partial class FrmPointInfo : FrmBase public partial class FrmPointInfo : FrmBase
{ {
private bool LoadOk = false;
private static Color lastColor = Color.Black;
public delegate void NextDel(int index, SMTPointInfo smt=null); public delegate void NextDel(int index, SMTPointInfo smt=null);
public event NextDel NextEvent; public event NextDel NextEvent;
internal bool updateOK = false; internal bool updateOK = false;
...@@ -29,6 +32,16 @@ namespace TSA_V ...@@ -29,6 +32,16 @@ namespace TSA_V
internal bool isNewPoint = false; internal bool isNewPoint = false;
//private bool OfflineMode = Setting_NInit.Device_AutoGuoBan;
public delegate bool ShowPointDelegate(SMTPointInfo p,Color color);
public event ShowPointDelegate ShowPointEvent;
public FrmPointInfo()
{
InitializeComponent();
}
public FrmPointInfo(BoardInfo board, string name, double x, double y, double nodex, double nodey) public FrmPointInfo(BoardInfo board, string name, double x, double y, double nodex, double nodey)
{ {
InitializeComponent(); InitializeComponent();
...@@ -38,20 +51,36 @@ namespace TSA_V ...@@ -38,20 +51,36 @@ namespace TSA_V
this.Text = "新增组装信息"; this.Text = "新增组装信息";
this.txtTagNo.Text = name; this.txtTagNo.Text = name;
updateFrom(true); updateFrom(true);
xyMoveControl1.ShowPointEvent += XyMoveControl1_ShowPointEvent; LoadControl(x, y, nodex, nodey);
xyMoveControl1.XValue = nodex; }
xyMoveControl1.YValue = nodey;
ProjectorControl.MaxX = (int)TSAVBean.X_Max; private void LoadControl(double x, double y, double nodex, double nodey)
ProjectorControl.MaxY = (int)TSAVBean.Y_Max; {
this.txtX.Text = x.ToString(); projectorControl.ShowPointEvent += projectorControl_ShowPointEvent;
this.txtY.Text = y.ToString(); projectorControl.XValue = x;
projectorControl.YValue = y;
projectorControl.ShowColor = boardInfo.PointColor;
projectorControl.loadTypeList(ResourceCulture.GetPTypes(), ResourceCulture.GetDirTypes(), ResourceCulture.GetXYControlMap());
projectorControl.MaxX = (int)TSAVBean.X_Max;
projectorControl.MaxY = (int)TSAVBean.Y_Max;
actControl.ConType = 1;
actControl.loadTypeList(ResourceCulture.GetPTypes(), ResourceCulture.GetDirTypes(), ResourceCulture.GetXYControlMap());
actControl.XValue = nodex;
actControl.YValue = nodey;
actControl.ShowColor = boardInfo.PointColor;
actControl.ShowPointEvent += ActControl_ShowPointEvent;
if (boardInfo != null)
{
actControl.MaxX = boardInfo.boardWidth;
actControl.MaxY = boardInfo.boardLength;
}
actControl.ConType = 1;
}
xyMoveControl1.loadTypeList(ResourceCulture.GetPTypes(), ResourceCulture.GetDirTypes(), ResourceCulture.GetXYControlMap());
xyMoveControl1.ShowColor = boardInfo.PointColor;
}
private void updateFrom(bool isNew) private void updateFrom(bool isNew)
{ {
this.txtPn.Enabled = false; this.txtPn.Enabled = false;
...@@ -77,14 +106,28 @@ namespace TSA_V ...@@ -77,14 +106,28 @@ namespace TSA_V
} }
} }
private bool XyMoveControl1_ShowPointEvent(ProjectorPInfo p) private bool projectorControl_ShowPointEvent(ProjectorPInfo p)
{ {
FrmProjectorScreen.instance.ClearPoint(); FrmProjectorScreen.instance.ClearPoint();
FrmProjectorScreen.instance.ShowPoint(p); FrmProjectorScreen.instance.ShowPoint(p);
return true;
}
private bool ActControl_ShowPointEvent(ProjectorPInfo p)
{
if (!LoadOk)
{
return false ;
}
smtPointInfo.UpdateImgP(p);
Task.Factory.StartNew(delegate ()
{
this.ShowPointEvent?.Invoke(smtPointInfo,btnColorChange.BackColor);
});
return true; return true;
} }
private List<TSAVPosition> allPosition = new List<TSAVPosition>(CSVPositionReader<TSAVPosition>.allPositionMap.Values); //private List<TSAVPosition> allPosition = new List<TSAVPosition>(CSVPositionReader<TSAVPosition>.allPositionMap.Values);
private void loadPositionList() private void loadPositionList()
{ {
...@@ -104,16 +147,13 @@ namespace TSA_V ...@@ -104,16 +147,13 @@ namespace TSA_V
if (list.Count <= 0 || (currIndex < 0) || (currIndex >= list.Count)) if (list.Count <= 0 || (currIndex < 0) || (currIndex >= list.Count))
{ {
return; return;
} }
xyMoveControl1.ShowPointEvent += XyMoveControl1_ShowPointEvent;
ProjectorControl.MaxX = (int)TSAVBean.X_Max;
ProjectorControl.MaxY = (int)TSAVBean.Y_Max;
this.PointList = list; this.PointList = list;
this.CurrIndex = currIndex; this.CurrIndex = currIndex;
ShowPoint(null); this.smtPointInfo = PointList[CurrIndex];
xyMoveControl1.ShowColor = boardInfo.PointColor; LoadControl(smtPointInfo.PositionX, smtPointInfo.PositionY, smtPointInfo.NodePositionX, smtPointInfo.NodePositionY);
ShowPoint(null);
xyMoveControl1.loadTypeList(ResourceCulture.GetPTypes(), ResourceCulture.GetDirTypes(), ResourceCulture.GetXYControlMap());
} }
private void ShowPoint(SMTPointInfo prePoint) private void ShowPoint(SMTPointInfo prePoint)
...@@ -121,56 +161,78 @@ namespace TSA_V ...@@ -121,56 +161,78 @@ namespace TSA_V
updateFrom(false); updateFrom(false);
btnSave.Visible = true; btnSave.Visible = true;
this.smtPointInfo = PointList[CurrIndex]; this.smtPointInfo = PointList[CurrIndex];
if (smtPointInfo.CheckOK)
{
rdbPro.Checked = true;
}
else
{
//if (Setting_NInit.Device_AutoGuoBan)
//{
// rdbImg.Checked = true;
//}
//else
//{
// rdbPro.Checked = true;
//}
rdbImg.Checked = true;
}
this.Text = "修改组装信息【" + smtPointInfo.PN + "】 "; this.Text = "修改组装信息【" + smtPointInfo.PN + "】 ";
loadPositionList(); loadPositionList();
this.txtPn.Text = smtPointInfo.PN; this.txtPn.Text = smtPointInfo.PN;
//this.txtRobotX.Text = smpPointInfo.NodePositionX.ToString(); projectorControl.XValue = smtPointInfo.NodePositionX;
//txtRobotY.Text = smpPointInfo.NodePositionY.ToString(); projectorControl.YValue = smtPointInfo.NodePositionY;
xyMoveControl1.XValue = smtPointInfo.NodePositionX; projectorControl.ShowText = smtPointInfo.ShowText;
xyMoveControl1.YValue = smtPointInfo.NodePositionY;
xyMoveControl1.PointType = smtPointInfo.PointType; projectorControl.SetPointType(smtPointInfo.PointType, smtPointInfo.PointSizeX, smtPointInfo.PointSizeY, smtPointInfo.PenWidth, smtPointInfo.PolaritiesType);
xyMoveControl1.PolaritiesType= smtPointInfo.PolaritiesType; if (this.smtPointInfo.IsEdit == false)
xyMoveControl1.PointSizeX = smtPointInfo.PointSizeX;
xyMoveControl1.PointSizeY = smtPointInfo.PointSizeY;
xyMoveControl1.PenWidth = smtPointInfo.PenWidth;
xyMoveControl1.ShowText = smtPointInfo.ShowText;
if(this.smtPointInfo.IsEdit==false)
{ {
if (prePoint != null && prePoint.IsEdit) if (prePoint != null && prePoint.IsEdit)
{ {
xyMoveControl1.PointType = prePoint.PointType; projectorControl.SetPointType(prePoint.PointType, prePoint.PointSizeX, prePoint.PointSizeY, prePoint.PenWidth, prePoint.PolaritiesType);
xyMoveControl1.PointSizeX = prePoint.PointSizeX;
xyMoveControl1.PointSizeY = prePoint.PointSizeY;
xyMoveControl1.PenWidth = prePoint.PenWidth;
xyMoveControl1.PolaritiesType = prePoint.PolaritiesType;
} }
} }
xyMoveControl1.ShowCurrPoint();
if (boardInfo != null) projectorControl.ShowCurrPoint();
actControl.XValue = smtPointInfo.PositionX;
actControl.YValue = smtPointInfo.PositionY;
actControl.ShowText = smtPointInfo.ShowText;
actControl.SetPointType(smtPointInfo.PointType, smtPointInfo .imgP.SizeY, smtPointInfo.imgP.SizeY, smtPointInfo.imgP.PWidth, smtPointInfo.PolaritiesType);
if (this.smtPointInfo.IsEdit == false)
{ {
xyMoveControl1.ShowColor = boardInfo.PointColor; if (prePoint != null && prePoint.IsEdit)
{
actControl.SetPointType(prePoint.PointType, prePoint.imgP.SizeY, prePoint.imgP.SizeY, prePoint.imgP.PWidth, prePoint.PolaritiesType);
}
} }
xyMoveControl1.ShowCurrPoint(); actControl.ShowCurrPoint();
this.txtX.Text = smtPointInfo.PositionX.ToString();
this.txtY.Text = smtPointInfo.PositionY.ToString();
//this.txtImgX.Text = smtPointInfo.PositionX.ToString();
//this.txtImgY.Text = smtPointInfo.PositionY.ToString();
//this.txtPX.Text = smtPointInfo.NodePositionX.ToString();
//this.txtPY.Text = smtPointInfo.NodePositionY.ToString();
this.txtTagNo.Text = smtPointInfo.TagNo; this.txtTagNo.Text = smtPointInfo.TagNo;
this.chbNeedCheck.Checked = smtPointInfo.NeedCheck; this.chbNeedCheck.Checked = smtPointInfo.NeedCheck;
this.chbNeedSoldering.Checked = smtPointInfo.NeedSoldering; this.chbNeedSoldering.Checked = smtPointInfo.NeedSoldering;
this.txtWeldTemp.Text = smtPointInfo.WeldTemp.ToString(); this.txtWeldTemp.Text = smtPointInfo.WeldTemp.ToString();
this.txtWeldTime.Text = smtPointInfo.WeldTime.ToString(); this.txtWeldTime.Text = smtPointInfo.WeldTime.ToString();
chbCheck.Checked = smtPointInfo.CheckOK; //chbCheck.Checked = smtPointInfo.CheckOK;
lblNotes.Text = ""; lblNotes.Text = "";
if (boardInfo != null) if (boardInfo != null)
{ {
ComponetInfo com = CSVBomManager.GetCom(boardInfo.bomName, smtPointInfo); ComponetInfo com = CSVBomManager.GetCom(boardInfo.bomName, smtPointInfo);
if (com != null) if (com != null)
{ {
lblNotes.Text = com.Notes; lblNotes.Text = com.Notes;
} }
} }
if (CurrIndex < PointList.Count - 1) if (CurrIndex < PointList.Count - 1)
{ {
...@@ -241,21 +303,48 @@ namespace TSA_V ...@@ -241,21 +303,48 @@ namespace TSA_V
smtPointInfo.PN = pn; smtPointInfo.PN = pn;
smtPointInfo.TagNo = tagNo; smtPointInfo.TagNo = tagNo;
smtPointInfo.PositionX = FormUtil.getDoubleValue(txtX); //smtPointInfo.PositionX = FormUtil.getDoubleValue(txtImgX);
smtPointInfo.PositionY = FormUtil.getDoubleValue(txtY); //smtPointInfo.PositionY = FormUtil.getDoubleValue(txtImgY);
smtPointInfo.NodePositionX = xyMoveControl1.XValue; if (rdbImg.Checked)
smtPointInfo.NodePositionY = xyMoveControl1.YValue; {
smtPointInfo.PointType = xyMoveControl1.PointType; smtPointInfo.PositionX = actControl.XValue;
smtPointInfo.PointSizeX = xyMoveControl1.PointSizeX; smtPointInfo.PositionY = actControl.YValue;
smtPointInfo.PointSizeY = xyMoveControl1.PointSizeY;
smtPointInfo.PenWidth = xyMoveControl1.PenWidth; smtPointInfo.PointType = actControl.PointType;
smtPointInfo.ShowText = xyMoveControl1.ShowText; smtPointInfo.ShowText = actControl.ShowText;
smtPointInfo.PolaritiesType= xyMoveControl1.PolaritiesType; smtPointInfo.imgP = new DrawPointInfo(actControl.PointSizeX, actControl.PointSizeY, actControl.PenWidth);
smtPointInfo.PolaritiesType = actControl.PolaritiesType;
smtPointInfo.CheckOK = false ;
if (boardInfo != null && boardInfo.calInfo != null && boardInfo.calInfo.CurrStep >= 3)
{
List<SMTPointInfo> checkOKList = boardInfo.getCalPoint();
smtPointInfo = XYConvertManager.CalPointNodePosition(smtPointInfo, checkOKList);
}
else
{
smtPointInfo.NodePositionX = projectorControl.XValue;
smtPointInfo.NodePositionY = projectorControl.YValue;
}
}
else
{
smtPointInfo.NodePositionX = projectorControl.XValue;
smtPointInfo.NodePositionY = projectorControl.YValue;
smtPointInfo.PointType = projectorControl.PointType;
smtPointInfo.PointSizeX = projectorControl.PointSizeX;
smtPointInfo.PointSizeY = projectorControl.PointSizeY;
smtPointInfo.PenWidth = projectorControl.PenWidth;
smtPointInfo.ShowText = projectorControl.ShowText;
smtPointInfo.PolaritiesType = projectorControl.PolaritiesType;
smtPointInfo.pUTime = DateTime.Now.Ticks;
smtPointInfo.CheckOK = true;
}
smtPointInfo.NeedSoldering = chbNeedSoldering.Checked; smtPointInfo.NeedSoldering = chbNeedSoldering.Checked;
smtPointInfo.NeedCheck = chbNeedCheck.Checked; smtPointInfo.NeedCheck = chbNeedCheck.Checked;
smtPointInfo.WeldTime = FormUtil.getDoubleValue(txtWeldTime); smtPointInfo.WeldTime = FormUtil.getDoubleValue(txtWeldTime);
smtPointInfo.WeldTemp = FormUtil.GetIntValue(txtWeldTemp); smtPointInfo.WeldTemp = FormUtil.GetIntValue(txtWeldTemp);
smtPointInfo.CheckOK = chbCheck.Checked;
if (smtPointInfo.NeedSoldering && smtPointInfo.WeldTemp <= 0) if (smtPointInfo.NeedSoldering && smtPointInfo.WeldTemp <= 0)
{ {
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.WriteRightTemp, "请输入正确的焊接温度!")); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.WriteRightTemp, "请输入正确的焊接温度!"));
...@@ -302,18 +391,27 @@ namespace TSA_V ...@@ -302,18 +391,27 @@ namespace TSA_V
{ {
this.Close(); this.Close();
} }
private void FrmPointInfo_Load(object sender, EventArgs e) private void FrmPointInfo_Load(object sender, EventArgs e)
{ {
LanguageProcess(); LanguageProcess();
btnColorChange.BackColor = lastColor;
timer1.Enabled = true; timer1.Enabled = true;
LoadOk = true;
if (panImg.Visible)
{
actControl.ShowCurrPoint();
}
else
{
projectorControl.ShowCurrPoint();
}
} }
private void timer1_Tick(object sender, EventArgs e) private void timer1_Tick(object sender, EventArgs e)
{ {
xyMoveControl1.UpdateStatus(); projectorControl.UpdateStatus();
actControl.UpdateStatus();
} }
private void FrmPointInfo_FormClosing(object sender, FormClosingEventArgs e) private void FrmPointInfo_FormClosing(object sender, FormClosingEventArgs e)
...@@ -373,5 +471,40 @@ namespace TSA_V ...@@ -373,5 +471,40 @@ namespace TSA_V
txtPn.Text = cmbPnList.Text; txtPn.Text = cmbPnList.Text;
} }
} }
private void btnColorChange_Click(object sender, EventArgs e)
{
ColorDialog colorDia = new ColorDialog();
if (colorDia.ShowDialog() == DialogResult.OK)
{
//获取所选择的颜色
Color colorChoosed = colorDia.Color;
//int v = colorChoosed.ToArgb();
//int v2 = Color.FromArgb(v).ToArgb();
//MessageBox.Show("v=" + v + ",v2=" + v2);
//改变panel的背景色
lastColor = colorChoosed;
btnColorChange.BackColor = colorChoosed;
actControl.ShowCurrPoint();
}
}
private void PanChange()
{
panImg.Visible = rdbImg.Checked;
panPro.Visible=rdbPro.Checked;
}
private void rdbImg_CheckedChanged(object sender, EventArgs e)
{
PanChange();
}
private void rdbPro_CheckedChanged(object sender, EventArgs e)
{
PanChange();
}
} }
} }
namespace TSA_V
{
partial class FrmPointInfo
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmPointInfo));
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.btnPre = new System.Windows.Forms.Button();
this.btnSaveAndNext = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.cmbPnList = new System.Windows.Forms.ComboBox();
this.lblNotes = new System.Windows.Forms.Label();
this.chbCheck = new System.Windows.Forms.CheckBox();
this.txtWeldTemp = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.txtWeldTime = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.chbNeedCheck = new System.Windows.Forms.CheckBox();
this.label3 = new System.Windows.Forms.Label();
this.txtTagNo = new System.Windows.Forms.TextBox();
this.chbNeedSoldering = new System.Windows.Forms.CheckBox();
this.txtY = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.txtPn = new System.Windows.Forms.TextBox();
this.txtX = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.btnCancel = new System.Windows.Forms.Button();
this.btnSave = new System.Windows.Forms.Button();
this.xyMoveControl1 = new UserFromControl.ProjectorControl();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// timer1
//
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// btnPre
//
this.btnPre.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnPre.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnPre.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnPre.Location = new System.Drawing.Point(46, 563);
this.btnPre.Name = "btnPre";
this.btnPre.Size = new System.Drawing.Size(120, 45);
this.btnPre.TabIndex = 62;
this.btnPre.Text = "上一个";
this.btnPre.UseVisualStyleBackColor = true;
this.btnPre.Click += new System.EventHandler(this.btnPre_Click);
//
// btnSaveAndNext
//
this.btnSaveAndNext.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnSaveAndNext.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSaveAndNext.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSaveAndNext.Location = new System.Drawing.Point(300, 563);
this.btnSaveAndNext.Name = "btnSaveAndNext";
this.btnSaveAndNext.Size = new System.Drawing.Size(120, 45);
this.btnSaveAndNext.TabIndex = 61;
this.btnSaveAndNext.Text = "保存并继续";
this.btnSaveAndNext.UseVisualStyleBackColor = true;
this.btnSaveAndNext.Click += new System.EventHandler(this.btnSaveAndNext_Click);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.cmbPnList);
this.groupBox1.Controls.Add(this.lblNotes);
this.groupBox1.Controls.Add(this.chbCheck);
this.groupBox1.Controls.Add(this.txtWeldTemp);
this.groupBox1.Controls.Add(this.label6);
this.groupBox1.Controls.Add(this.txtWeldTime);
this.groupBox1.Controls.Add(this.label7);
this.groupBox1.Controls.Add(this.chbNeedCheck);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.txtTagNo);
this.groupBox1.Controls.Add(this.chbNeedSoldering);
this.groupBox1.Controls.Add(this.txtY);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.txtPn);
this.groupBox1.Controls.Add(this.txtX);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox1.Location = new System.Drawing.Point(44, 9);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(503, 226);
this.groupBox1.TabIndex = 59;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "组装信息";
//
// cmbPnList
//
this.cmbPnList.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbPnList.FormattingEnabled = true;
this.cmbPnList.Location = new System.Drawing.Point(135, 62);
this.cmbPnList.Name = "cmbPnList";
this.cmbPnList.Size = new System.Drawing.Size(219, 25);
this.cmbPnList.TabIndex = 86;
this.cmbPnList.SelectedIndexChanged += new System.EventHandler(this.cmbPnList_SelectedIndexChanged);
//
// lblNotes
//
this.lblNotes.Location = new System.Drawing.Point(6, 179);
this.lblNotes.Name = "lblNotes";
this.lblNotes.Size = new System.Drawing.Size(491, 36);
this.lblNotes.TabIndex = 85;
this.lblNotes.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// chbCheck
//
this.chbCheck.AutoSize = true;
this.chbCheck.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbCheck.Location = new System.Drawing.Point(135, 141);
this.chbCheck.Name = "chbCheck";
this.chbCheck.Size = new System.Drawing.Size(168, 24);
this.chbCheck.TabIndex = 84;
this.chbCheck.Text = "设置为红外坐标校准点";
this.chbCheck.UseVisualStyleBackColor = true;
//
// txtWeldTemp
//
this.txtWeldTemp.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtWeldTemp.Location = new System.Drawing.Point(211, 139);
this.txtWeldTemp.MaxLength = 8;
this.txtWeldTemp.Name = "txtWeldTemp";
this.txtWeldTemp.Size = new System.Drawing.Size(90, 26);
this.txtWeldTemp.TabIndex = 83;
this.txtWeldTemp.Visible = false;
//
// label6
//
this.label6.Location = new System.Drawing.Point(17, 177);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(162, 22);
this.label6.TabIndex = 82;
this.label6.Text = "焊接时间:";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label6.Visible = false;
//
// txtWeldTime
//
this.txtWeldTime.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtWeldTime.Location = new System.Drawing.Point(185, 177);
this.txtWeldTime.MaxLength = 8;
this.txtWeldTime.Name = "txtWeldTime";
this.txtWeldTime.Size = new System.Drawing.Size(90, 26);
this.txtWeldTime.TabIndex = 81;
this.txtWeldTime.Visible = false;
//
// label7
//
this.label7.Location = new System.Drawing.Point(43, 140);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(162, 22);
this.label7.TabIndex = 80;
this.label7.Text = "焊接温度:";
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label7.Visible = false;
//
// chbNeedCheck
//
this.chbNeedCheck.AutoSize = true;
this.chbNeedCheck.Location = new System.Drawing.Point(289, 177);
this.chbNeedCheck.Name = "chbNeedCheck";
this.chbNeedCheck.Size = new System.Drawing.Size(75, 21);
this.chbNeedCheck.TabIndex = 79;
this.chbNeedCheck.Text = "需要检测";
this.chbNeedCheck.UseVisualStyleBackColor = true;
this.chbNeedCheck.Visible = false;
//
// label3
//
this.label3.Enabled = false;
this.label3.Location = new System.Drawing.Point(59, 100);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(74, 22);
this.label3.TabIndex = 74;
this.label3.Text = "X:";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtTagNo
//
this.txtTagNo.Enabled = false;
this.txtTagNo.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtTagNo.Location = new System.Drawing.Point(135, 24);
this.txtTagNo.MaxLength = 30;
this.txtTagNo.Name = "txtTagNo";
this.txtTagNo.Size = new System.Drawing.Size(219, 26);
this.txtTagNo.TabIndex = 64;
//
// chbNeedSoldering
//
this.chbNeedSoldering.AutoSize = true;
this.chbNeedSoldering.Location = new System.Drawing.Point(315, 144);
this.chbNeedSoldering.Name = "chbNeedSoldering";
this.chbNeedSoldering.Size = new System.Drawing.Size(75, 21);
this.chbNeedSoldering.TabIndex = 78;
this.chbNeedSoldering.Text = "需要焊接";
this.chbNeedSoldering.UseVisualStyleBackColor = true;
this.chbNeedSoldering.Visible = false;
//
// txtY
//
this.txtY.Enabled = false;
this.txtY.Location = new System.Drawing.Point(282, 100);
this.txtY.MaxLength = 20;
this.txtY.Name = "txtY";
this.txtY.Size = new System.Drawing.Size(89, 23);
this.txtY.TabIndex = 77;
//
// label4
//
this.label4.Enabled = false;
this.label4.Location = new System.Drawing.Point(230, 100);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(48, 22);
this.label4.TabIndex = 76;
this.label4.Text = "Y:";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label2
//
this.label2.Location = new System.Drawing.Point(6, 26);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(128, 22);
this.label2.TabIndex = 60;
this.label2.Text = "位号:";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtPn
//
this.txtPn.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtPn.Location = new System.Drawing.Point(135, 62);
this.txtPn.MaxLength = 30;
this.txtPn.Name = "txtPn";
this.txtPn.Size = new System.Drawing.Size(219, 26);
this.txtPn.TabIndex = 33;
//
// txtX
//
this.txtX.Enabled = false;
this.txtX.Location = new System.Drawing.Point(135, 100);
this.txtX.MaxLength = 20;
this.txtX.Name = "txtX";
this.txtX.Size = new System.Drawing.Size(89, 23);
this.txtX.TabIndex = 75;
//
// label1
//
this.label1.Location = new System.Drawing.Point(6, 64);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(128, 22);
this.label1.TabIndex = 32;
this.label1.Text = "物料编码:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// btnCancel
//
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCancel.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCancel.Location = new System.Drawing.Point(427, 563);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(120, 45);
this.btnCancel.TabIndex = 58;
this.btnCancel.Text = "取消";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnSave
//
this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSave.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSave.Location = new System.Drawing.Point(173, 563);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(120, 45);
this.btnSave.TabIndex = 57;
this.btnSave.Text = "保存";
this.btnSave.UseVisualStyleBackColor = true;
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// xyMoveControl1
//
this.xyMoveControl1.BackColor = System.Drawing.Color.White;
this.xyMoveControl1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.xyMoveControl1.GroupName = "坐标";
this.xyMoveControl1.Location = new System.Drawing.Point(41, 241);
this.xyMoveControl1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.xyMoveControl1.Name = "xyMoveControl1";
this.xyMoveControl1.PenWidth = 2;
this.xyMoveControl1.PointSizeX = 4;
this.xyMoveControl1.PointSizeY = 1;
this.xyMoveControl1.PointType = 1;
this.xyMoveControl1.PolaritiesType = 0;
this.xyMoveControl1.ShowText = "";
this.xyMoveControl1.Size = new System.Drawing.Size(506, 315);
this.xyMoveControl1.TabIndex = 63;
this.xyMoveControl1.XValue = 1D;
this.xyMoveControl1.YValue = 1D;
//
// FrmPointInfo
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(599, 642);
this.Controls.Add(this.xyMoveControl1);
this.Controls.Add(this.btnPre);
this.Controls.Add(this.btnSaveAndNext);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnSave);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.Name = "FrmPointInfo";
this.Text = "组装信息";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmPointInfo_FormClosing);
this.Load += new System.EventHandler(this.FrmPointInfo_Load);
this.Shown += new System.EventHandler(this.FrmPointInfo_Shown);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button btnSave;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox txtPn;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtY;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtX;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.TextBox txtTagNo;
private System.Windows.Forms.Button btnSaveAndNext;
private System.Windows.Forms.CheckBox chbNeedCheck;
private System.Windows.Forms.CheckBox chbNeedSoldering;
private System.Windows.Forms.TextBox txtWeldTemp;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox txtWeldTime;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Button btnPre;
private UserFromControl.ProjectorControl xyMoveControl1;
private System.Windows.Forms.CheckBox chbCheck;
private System.Windows.Forms.Label lblNotes;
private System.Windows.Forms.ComboBox cmbPnList;
}
}
\ No newline at end of file \ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MetroFramework.Forms;
using TSA_V.DeviceLibrary;
using TSA_V.Common;
using PUSICANLibrary;
using TSA_V.LoadCSVLibrary;
using AccAOI;
using UserFromControl;
namespace TSA_V
{
public partial class FrmPointInfo : FrmBase
{
public delegate void NextDel(int index, SMTPointInfo smt=null);
public event NextDel NextEvent;
internal bool updateOK = false;
internal SMTPointInfo smtPointInfo = new SMTPointInfo();
internal BoardInfo boardInfo = null;
internal string AoiProgramName = "";
internal Image PicImage = null;
internal bool isNewPoint = false;
public delegate bool ShowPointDelegate(SMTPointInfo p);
public event ShowPointDelegate ShowPointEvent;
public FrmPointInfo(BoardInfo board, string name, double x, double y, double nodex, double nodey)
{
InitializeComponent();
loadPositionList();
this.boardInfo = board;
isNewPoint = true;
this.Text = "新增组装信息";
this.txtTagNo.Text = name;
updateFrom(true);
xyMoveControl1.ShowPointEvent += XyMoveControl1_ShowPointEvent;
xyMoveControl1.XValue = nodex;
xyMoveControl1.YValue = nodey;
ProjectorControl.MaxX = (int)TSAVBean.X_Max;
ProjectorControl.MaxY = (int)TSAVBean.Y_Max;
this.txtX.Text = x.ToString();
this.txtY.Text = y.ToString();
xyMoveControl1.loadTypeList(ResourceCulture.GetPTypes(), ResourceCulture.GetDirTypes(), ResourceCulture.GetXYControlMap());
xyMoveControl1.ShowColor = boardInfo.PointColor;
}
private void updateFrom(bool isNew)
{
this.txtPn.Enabled = false;
this.txtTagNo.Enabled = isNew;
btnSaveAndNext.Visible = !isNew;
this.txtPn.Visible = !isNew;
cmbPnList.Visible = isNew;
this.txtPn.Text = "";
if (isNew)
{
List<string> pnList = new List<string>();
List<ComponetInfo> list = CSVBomManager.GetComList(this.boardInfo.bomName);
foreach (ComponetInfo obj in list)
{
if (!pnList.Contains(obj.PN))
{
pnList.Add(obj.PN);
}
}
cmbPnList.Items.Clear();
cmbPnList.DataSource = pnList;
}
}
private bool XyMoveControl1_ShowPointEvent(ProjectorPInfo p)
{
FrmProjectorScreen.instance.ClearPoint();
FrmProjectorScreen.instance.ShowPoint(p);
smtPointInfo.UpdateImgP(p);
this.ShowPointEvent?.Invoke(smtPointInfo);
return true;
}
private List<TSAVPosition> allPosition = new List<TSAVPosition>(CSVPositionReader<TSAVPosition>.allPositionMap.Values);
private void loadPositionList()
{
//cmbPositionNumList.DataSource = null;
//cmbPositionNumList.DataSource = allPosition;
//cmbPositionNumList.DisplayMember = "PositionNum";
//cmbPositionNumList.ValueMember = "PositionNum";
}
public List<SMTPointInfo> PointList = new List<SMTPointInfo>();
public int CurrIndex = -1;
public FrmPointInfo( BoardInfo board, List<SMTPointInfo> list, int currIndex,NextDel fun=null)
{
this.boardInfo = board;
this.NextEvent += fun;
InitializeComponent();
if (list.Count <= 0 || (currIndex < 0) || (currIndex >= list.Count))
{
return;
}
xyMoveControl1.ShowPointEvent += XyMoveControl1_ShowPointEvent;
ProjectorControl.MaxX = (int)TSAVBean.X_Max;
ProjectorControl.MaxY = (int)TSAVBean.Y_Max;
this.PointList = list;
this.CurrIndex = currIndex;
ShowPoint(null);
xyMoveControl1.ShowColor = boardInfo.PointColor;
xyMoveControl1.loadTypeList(ResourceCulture.GetPTypes(), ResourceCulture.GetDirTypes(), ResourceCulture.GetXYControlMap());
}
private void ShowPoint(SMTPointInfo prePoint)
{
updateFrom(false);
btnSave.Visible = true;
this.smtPointInfo = PointList[CurrIndex];
this.Text = "修改组装信息【" + smtPointInfo.PN + "】 ";
loadPositionList();
this.txtPn.Text = smtPointInfo.PN;
//this.txtRobotX.Text = smpPointInfo.NodePositionX.ToString();
//txtRobotY.Text = smpPointInfo.NodePositionY.ToString();
xyMoveControl1.XValue = smtPointInfo.NodePositionX;
xyMoveControl1.YValue = smtPointInfo.NodePositionY;
xyMoveControl1.PointType = smtPointInfo.PointType;
xyMoveControl1.PolaritiesType= smtPointInfo.PolaritiesType;
xyMoveControl1.PointSizeX = smtPointInfo.PointSizeX;
xyMoveControl1.PointSizeY = smtPointInfo.PointSizeY;
xyMoveControl1.PenWidth = smtPointInfo.PenWidth;
xyMoveControl1.ShowText = smtPointInfo.ShowText;
if(this.smtPointInfo.IsEdit==false)
{
if (prePoint != null && prePoint.IsEdit)
{
xyMoveControl1.PointType = prePoint.PointType;
xyMoveControl1.PointSizeX = prePoint.PointSizeX;
xyMoveControl1.PointSizeY = prePoint.PointSizeY;
xyMoveControl1.PenWidth = prePoint.PenWidth;
xyMoveControl1.PolaritiesType = prePoint.PolaritiesType;
}
}
xyMoveControl1.ShowCurrPoint();
if (boardInfo != null)
{
xyMoveControl1.ShowColor = boardInfo.PointColor;
}
xyMoveControl1.ShowCurrPoint();
this.txtX.Text = smtPointInfo.PositionX.ToString();
this.txtY.Text = smtPointInfo.PositionY.ToString();
this.txtTagNo.Text = smtPointInfo.TagNo;
this.chbNeedCheck.Checked = smtPointInfo.NeedCheck;
this.chbNeedSoldering.Checked = smtPointInfo.NeedSoldering;
this.txtWeldTemp.Text = smtPointInfo.WeldTemp.ToString();
this.txtWeldTime.Text = smtPointInfo.WeldTime.ToString();
chbCheck.Checked = smtPointInfo.CheckOK;
lblNotes.Text = "";
if (boardInfo != null)
{
ComponetInfo com = CSVBomManager.GetCom(boardInfo.bomName, smtPointInfo);
if (com != null)
{
lblNotes.Text = com.Notes;
}
}
if (CurrIndex < PointList.Count - 1)
{
btnSaveAndNext.Enabled = true;
}
else
{
btnSaveAndNext.Enabled = false;
}
if (CurrIndex > 0)
{
btnPre.Enabled = true;
}
else
{
btnPre.Enabled = false;
}
}
private void btnSave_Click(object sender, EventArgs e)
{
if (saveInfo())
{
closeForm();
}
}
private void btnCancel_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
private bool saveInfo()
{
if (isNewPoint)
{
smtPointInfo = new SMTPointInfo();
smtPointInfo.pointNum = boardInfo.GetNextPNum();
}
string pn = FormUtil.getValue(txtPn);
if (pn.Equals(""))
{
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.WriteName, "请输入物料编码!"));
txtPn.Focus();
return false;
}
string tagNo = FormUtil.getValue(txtTagNo);
if (isNewPoint)
{
if (tagNo.Equals(""))
{
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.WritePartNumber, "请输入位号!"));
txtTagNo.Focus();
return false;
}
List<SMTPointInfo> pos = (from m in boardInfo.smtList where m.pointNum != smtPointInfo.pointNum && m.TagNo.Equals(tagNo) select m).ToList();
if (pos.Count > 0)
{
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.WritePartNumber, "请输入位号!"));
txtTagNo.Text = smtPointInfo.TagNo;
txtTagNo.Focus();
return false;
}
}
smtPointInfo.PN = pn;
smtPointInfo.TagNo = tagNo;
smtPointInfo.PositionX = FormUtil.getDoubleValue(txtX);
smtPointInfo.PositionY = FormUtil.getDoubleValue(txtY);
smtPointInfo.NodePositionX = xyMoveControl1.XValue;
smtPointInfo.NodePositionY = xyMoveControl1.YValue;
smtPointInfo.PointType = xyMoveControl1.PointType;
smtPointInfo.PointSizeX = xyMoveControl1.PointSizeX;
smtPointInfo.PointSizeY = xyMoveControl1.PointSizeY;
smtPointInfo.PenWidth = xyMoveControl1.PenWidth;
smtPointInfo.ShowText = xyMoveControl1.ShowText;
smtPointInfo.PolaritiesType= xyMoveControl1.PolaritiesType;
smtPointInfo.NeedSoldering = chbNeedSoldering.Checked;
smtPointInfo.NeedCheck = chbNeedCheck.Checked;
smtPointInfo.WeldTime = FormUtil.getDoubleValue(txtWeldTime);
smtPointInfo.WeldTemp = FormUtil.GetIntValue(txtWeldTemp);
smtPointInfo.CheckOK = chbCheck.Checked;
if (smtPointInfo.NeedSoldering && smtPointInfo.WeldTemp <= 0)
{
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.WriteRightTemp, "请输入正确的焊接温度!"));
return false;
} if (smtPointInfo.NeedSoldering && smtPointInfo.WeldTime <= 0)
{
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.WriteRightTime,"请输入正确的焊接时间!"));
return false;
}
if (isNewPoint)
{
ComponetInfo com = CSVBomManager.GetCom(boardInfo.bomName, smtPointInfo);
if (com != null)
{
smtPointInfo.PositionNum = com.PositionNum;
}
boardInfo.smtList.Add(smtPointInfo);
this.DialogResult = DialogResult.OK;
closeForm();
return true;
}
else
{
//设置为已保存
smtPointInfo.IsEdit = true;
if (String.IsNullOrEmpty(smtPointInfo.PositionNum))
{
ComponetInfo com = CSVBomManager.GetCom(boardInfo.bomName, smtPointInfo);
if (com != null)
{
smtPointInfo.PositionNum = com.PositionNum;
}
}
if (this.PointList.Count > 0 && CurrIndex >= 0)
{
PointList[CurrIndex] = smtPointInfo;
}
updateOK = true;
return true;
}
}
private void closeForm()
{
this.Close();
}
private void FrmPointInfo_Load(object sender, EventArgs e)
{
LanguageProcess();
timer1.Enabled = true;
}
private void timer1_Tick(object sender, EventArgs e)
{
xyMoveControl1.UpdateStatus();
}
private void FrmPointInfo_FormClosing(object sender, FormClosingEventArgs e)
{
timer1.Enabled = false;
}
private void FrmPointInfo_Shown(object sender, EventArgs e)
{
SetSkin(this);
}
public TSAVBean CSVPositionReader { get; set; }
private void btnSaveAndNext_Click(object sender, EventArgs e)
{
if (saveInfo())
{
SMTPointInfo prePoint = PointList[CurrIndex];
CurrIndex++;
if (PointList.Count > CurrIndex)
{
ShowPoint(prePoint);
NextEvent?.Invoke(CurrIndex,prePoint);
}
}
}
private void btnPre_Click(object sender, EventArgs e)
{
CurrIndex--;
if (CurrIndex < 0)
{
CurrIndex = 0;
}
if (PointList.Count > CurrIndex)
{
ShowPoint(null);
NextEvent?.Invoke(CurrIndex);
}
}
private void btnConfigAOI_Click(object sender, EventArgs e)
{
AccAOI.AOIResourceCulture.SetCurrentCulture(ResourceCulture.CurrLanguage);
string path = Application.StartupPath + ConfigAppSettings.GetValue(Setting_Init.AOIFileConfig);
FrmAoiSetting frm = new FrmAoiSetting(path+AoiProgramName, PicImage,path);
frm.ShowDialog();
}
private void cmbPnList_SelectedIndexChanged(object sender, EventArgs e)
{
if (cmbPnList.SelectedIndex >= 0)
{
txtPn.Text = cmbPnList.Text;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAIAEBAAAAEAIABoBAAAJgAAACAgAAABACAAKBEAAI4EAAAoAAAAEAAAACAAAAABACAAAAAAAAAE
AAAAAAAAAAAAAAAAAAAAAAAAik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+WYi//lWAs/6N0SP+MUhn/jFIa/7SP
av+fb0D/v55//5BZI/+2kW7/m2g4/7+ggf+KTxb/ik8W/4pPFv+KTxb/rINb/9S+qf+TXin/ya6U/7iU
cf/Ep4v/ya6U/+bZzf/ezr7/lV8s/+PVx/+thFv/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/6yCWf+sgln/rIJZ/6yCWf+sgln/n29B/4tQF/+KTxb/ik8W/4pPFv+KTxb/ik8W/5tp
Of+2kW7/q4FZ/+jd0f/ezb3/3s29/97Nvf/ezb3/3s29/9C5ov+PVyD/ik8W/4pPFv+KTxb/ik8W/5BZ
I//l2c3/rYRc/820nP+0j2v/ik8W/4pPFv/ezb3/3s29/97Nvf/cyrr/kVol/4pPFv+KTxb/ik8W/4pP
Fv+TXSj/5djL/5diL//DpYj/qn5V/45VHv+ximX/1cGt/6FyRP+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/6Z5Tv/fz8D/18Ov/5FaJf+oe1H/ya+U/7GKZP/ZxrP/z7eg/8+3oP+RWSP/ik8W/4pP
Fv+KTxb/ik8W/4pPF/+NVBz/jlQd/45UHf+OViD//v79/6+IYf+RWST/18Ow/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+PVh//xKaJ/8uymP/Lspj/y7CX/7iUcf/BoYP/y7GY/6yCWf+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pQF/+LUBf/i1AX/4pQF/+KTxb/ik8W/4tQF/+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAIAAAAEAAAAABACAAAAAAAAAQAAAAAAAAAAAAAAAA
AAAAAAAAik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/j1cg/5poN/+ZZjT/oHBB/6+HYP+idEb/m2k4/6p/Vf+PVyH/i1EY/6R2Sf+baTj/j1cg/5Zh
Lv+jdUn/jlYf/6BwQv+ZZTT/k1wo/55tP/+hckT/qHxS/5VfK/+RWiT/pHdM/4xTG/+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+aZzb/v5+A/+HTxP/OtZ3/pnlO/5NdKf/LsZj/oXJE/6p/Vv+OVR3/soxn/97N
vv+aZzb/sIhi/8mulP/VwKz/tI9q/7iWc/+mek7/0rum/7eTcP+0jmr/yK2T/72be//r4dj/klsm/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/5pnNv/g0cL/v5+B/861nf/RuqT/tI9q/8OmiP+wiWL/qH1T/49W
IP/Uvqn/vJl5/6h9Uv/Co4X/pnpP/9vKuP+hckX/yK2S/7KLZf/QuKL/u5h3/7mWdP/HqpD/0rul/9C4
of+SWyb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/jFIb/5ZhLv+PVh//lF0p/5ReKv+PVyH/k10o/5Nc
KP+NVBz/i1AX/5ReKv+TXCf/kVkj/5VfLP+OVR3/lmEu/49WIP+VYC3/klol/5NdKf+TXCf/lV8s/5BZ
I/+RWiT/lF0p/4tRGP+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+MUhr/jFIb/4xSG/+MUhv/jFIb/4xS
G/+MUhv/jFIb/4xSG/+MUhv/jFIb/4tRGf+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+LUBf/pnlO/8+3oP/Su6X/0rul/9K7
pf/Su6X/0rul/9K7pf/Su6X/0rul/9K7pf/Su6X/waGD/5BYIv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/jlQd/5ZhLv+MUhv/ik8W/7OMZ//18e3/////////
///////////////////////////////////////////////////j1Mf/lF4p/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/kVok/8Okh//28e3///////Xx7P/h0cL//v7+/+rg
1f+pf1X/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4tRGf/FqIv//v39/9/Pv/+7mXj/3cu7//79
/P/u5t7/m2g4/4pQF/+KTxb/ik8W/4tRGf+4lHH/3Mq5/9zLuv/cy7r/3Mu6/9zLuv/cy7r/yKyR/5FZ
I/+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/lWAt/+bazv/07un/kFgi/4pP
Fv+VYCz/5trO//fz7/+RWSP/ik8W/4pPFv+KTxb/jVQc/8+3oP/18ez/9fHs//Xx7P/18ez/9fHs//Xx
7P/h0cL/lmAt/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+XYzH/6d/U/+TX
yv+KTxb/ik8W/41UHP/cy7r/+PTx/5hjMf+KTxb/ik8W/4xSGv+meU7/vJp6/72cfP+idEb/mGQy/5hk
Mv+YZDL/mGQy/5ReKf+KUBf/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/5Ja
Jf/h0cP/+/j2/6V3S/+KTxb/oHFE//Lr5f/v6OH/jFMb/4pPFv+PViD/0bul//r49f/9+/r//Pr4/+fb
0P+aZzX/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/7KLZv/38+//9/Pv/+PVx//49PH/8+3n/6uAV/+KTxb/ik8W/7SPav/7+fj/3s69/7qX
df/Mspn/+PTw/9rHtf+dbDz/nWw8/51sPP+XYzH/i1AY/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/jFIa/6V3TP/QuKL/3s6+/9C4of+ld0v/ik8W/4pPFv+KTxb/2ca0//Do
4f+SWyX/ik8W/4pPF//Otp7//fz7/+/o4P/v6OD/7+jg/9vKuP+VXyv/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/kFch/76d
ff/9/fv/59vP/4tRGf+KTxb/ik8W/8Ghg////v7/2MWy/9bArP/WwKz/waKE/49XIP+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/5NdKP+aZzb/mmc2/5pnNv+aZzb/mmc2/6Bw
Qv/Xw7D//fz7//Tu6f/8+/r/wqSH/51sPf+thF3/7ube/+vh2P+LURn/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+VYC3/5NbJ//v59//7+ff/+/n3//v5
9//7+ff/+/r4///+/v/QuaL/mmg3/+fc0P/+/f3/+/n3//37+v/59vP/rIJZ/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/5FZI//Epor/1cCr/9XA
q//VwKv/1cCr/9XAq//Vv6r/uJRx/4xSG/+KTxb/l2Mw/8Smiv/Uv6r/zrae/6d6T/+LUBj/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pPFv+KTxb/ik8W/4pP
Fv+KTxb/ik8W/4pPFv+KTxb/ik8W/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
</value>
</data>
</root>
\ No newline at end of file \ No newline at end of file
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TSA_V.DeviceLibrary;
namespace TSA_V
{
public class DrawPointManager
{
public static void DrawPoint(Graphics g, ProjectorPInfo p,Color color)
{
if (p.SizeX < 2)
{
p.SizeX = 2;
}
if (p.SizeY < 2)
{
p.SizeY = 2;
}
int lineLength = 2;
int x =(int) p.PX;
int y =(int)p.PY;
Pen pen = new Pen(color, p.PenWidth);
System.Drawing.SolidBrush myBrush = new System.Drawing.SolidBrush(color);
//点类型,1 = 点,2 = +,3 =|,4 = -,5 = 方形,6 = 圆圈
if (p.PType.Equals(2))
{
g.DrawLine(pen, new Point(x - p.SizeX, y), new Point(x + p.SizeX, y));
g.DrawLine(pen, new Point(x, y - p.SizeY), new Point(x, y + p.SizeY));
}
else if (p.PType.Equals(3))
{
g.DrawLine(pen, new Point(x, y - p.SizeY), new Point(x, y + p.SizeY));
}
else if (p.PType.Equals(4))
{
g.DrawLine(pen, new Point(x - p.SizeX, y), new Point(x + p.SizeX, y));
}
else if (p.PType.Equals(5))
{
g.DrawRectangle(pen, x - p.SizeX / 2, y - p.SizeY / 2, p.SizeX, p.SizeY);
}
else if (p.PType.Equals(6))
{
g.DrawEllipse(pen, x - p.SizeX / 2, y - p.SizeY / 2, p.SizeX, p.SizeY);
}
else if (p.PType > 6)
{
g.DrawEllipse(pen, x - p.SizeX / 2, y - p.SizeY / 2, p.SizeX, p.SizeY);
}
else
{
g.FillEllipse(myBrush, new Rectangle(x - p.SizeX / 2, y - p.SizeY / 2, p.SizeX, p.SizeY));//画实心椭圆
}
if (p.PolaritiesType.Equals(0))
{
}
else if (p.PolaritiesType.Equals(1))
{
//p.SizeX = 12;
//p.SizeY = 36;
int plusSize = p.SizeX / 2;
int pX = x;
int pY = y - p.SizeY / 2 - lineLength - plusSize;
g.DrawLine(pen, new Point(pX - plusSize, pY), new Point(pX + plusSize, pY));
g.DrawLine(pen, new Point(pX, pY - plusSize), new Point(pX, pY + plusSize));
}
else if (p.PolaritiesType.Equals(2))
{
//p.SizeX = 12;
//p.SizeY = 36;
int plusSize = p.SizeX / 2;
int pX = x;
int pY = y + p.SizeY / 2 + lineLength + plusSize;
g.DrawLine(pen, new Point(pX - plusSize, pY), new Point(pX + plusSize, pY));
g.DrawLine(pen, new Point(pX, pY - plusSize), new Point(pX, pY + plusSize));
}
else if (p.PolaritiesType.Equals(3))
{
//p.SizeX = 12;
//p.SizeY = 36;
int plusSize = p.SizeY / 2;
int pX = x - p.SizeX / 2 - lineLength - plusSize;
int pY = y;
g.DrawLine(pen, new Point(pX - plusSize, pY), new Point(pX + plusSize, pY));
g.DrawLine(pen, new Point(pX, pY - plusSize), new Point(pX, pY + plusSize));
}
else if (p.PolaritiesType.Equals(4))
{
//p.SizeX = 12;
//p.SizeY = 36;
int plusSize = p.SizeY / 2;
int pX = x + p.SizeX / 2 + lineLength + plusSize;
int pY = y;
g.DrawLine(pen, new Point(pX - plusSize, pY), new Point(pX + plusSize, pY));
g.DrawLine(pen, new Point(pX, pY - plusSize), new Point(pX, pY + plusSize));
}
else if (p.PolaritiesType.Equals(5))
{
//p.SizeX = 12;
//p.SizeY = 36;
int plusSize = p.SizeX / 2;
int pX = x - 6;
int pY = y - p.SizeY / 2 - lineLength - plusSize;
g.DrawLine(pen, new Point(pX - plusSize, pY), new Point(pX + plusSize, pY));
g.DrawLine(pen, new Point(pX, pY - plusSize), new Point(pX, pY + plusSize));
}
else if (p.PolaritiesType.Equals(6))
{
//p.SizeX = 12;
//p.SizeY = 36;
int plusSize = p.SizeX / 2;
int pX = x + 6;
int pY = y - p.SizeY / 2 - lineLength - plusSize;
g.DrawLine(pen, new Point(pX - plusSize, pY), new Point(pX + plusSize, pY));
g.DrawLine(pen, new Point(pX, pY - plusSize), new Point(pX, pY + plusSize));
}
else if (p.PolaritiesType.Equals(6))
{
//p.SizeX = 12;
//p.SizeY = 36;
int plusSize = p.SizeX / 2;
int pX = x + 6;
int pY = y - p.SizeY / 2 - lineLength - plusSize;
g.DrawLine(pen, new Point(pX - plusSize, pY), new Point(pX + plusSize, pY));
g.DrawLine(pen, new Point(pX, pY - plusSize), new Point(pX, pY + plusSize));
}
else if (p.PolaritiesType.Equals(7))
{
//p.SizeX = 12;
//p.SizeY = 36;
int plusSize = p.SizeX / 2;
int pX = x - 6;
int pY = y + p.SizeY / 2 + lineLength + plusSize;
g.DrawLine(pen, new Point(pX - plusSize, pY), new Point(pX + plusSize, pY));
g.DrawLine(pen, new Point(pX, pY - plusSize), new Point(pX, pY + plusSize));
}
else if (p.PolaritiesType.Equals(8))
{
//p.SizeX = 12;
//p.SizeY = 36;
int plusSize = p.SizeX / 2;
int pX = x + 6;
int pY = y + p.SizeY / 2 + lineLength + plusSize;
g.DrawLine(pen, new Point(pX - plusSize, pY), new Point(pX + plusSize, pY));
g.DrawLine(pen, new Point(pX, pY - plusSize), new Point(pX, pY + plusSize));
}
}
}
}
using System;
using System.CodeDom;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TSA_V.Common;
using TSA_V.DeviceLibrary;
namespace TSA_V
{
public class XYConvertManager
{
private static List<ConBaseInfo> conList = null;
public static List<ConBaseInfo> ConList
{
get
{
if (conList == null)
{
try
{
conList = JsonHelper.DeserializeJsonToObject<List<ConBaseInfo>>(Setting_NInit.Data_LastCalibrateInfo);
}
catch (Exception ex)
{
LogUtil.error("转换lastCalibrateBean出错:" + ex.ToString());
}
}
return conList;
}
set
{
conList = value;
Setting_NInit.Data_LastCalibrateInfo = JsonHelper.SerializeObject(conList);
}
}
public static void SaveData(BoardInfo board)
{
List<ConBaseInfo> data = new List<ConBaseInfo>() {
new ConBaseInfo(new Point(0,0),board.calInfo.leftUpPoint),
new ConBaseInfo(new Point(board.boardWidth,board.boardLength),board.calInfo.rightBottomPoint),
};
}
public static SMTPointInfo CalPointNodePosition(SMTPointInfo smtPoint, List<SMTPointInfo> checkOKList)
{
try
{
if (smtPoint.CheckOK)
{
//校准点不再自动计算
return smtPoint;
}
double oldX = smtPoint.NodePositionX;
double oldY = smtPoint.NodePositionY;
//SMTPointInfo APoint = GetPoint(smtPoint, checkOKList);
//SMTPointInfo BPoint = GetPoint(APoint, checkOKList);
SMTPointInfo APoint = checkOKList[0];
SMTPointInfo BPoint = checkOKList[1];
//计算坐标
if (Math.Abs(smtPoint.PositionX - APoint.PositionX) < 0.01)
{
smtPoint.NodePositionX = APoint.NodePositionX;
}
else
{
smtPoint.NodePositionX = APoint.NodePositionX + (BPoint.NodePositionX - APoint.NodePositionX) * (smtPoint.PositionX - APoint.PositionX) / (BPoint.PositionX - APoint.PositionX);
if (double.IsNaN(smtPoint.NodePositionX) || double.IsInfinity(smtPoint.NodePositionX))
{
smtPoint.NodePositionX = APoint.NodePositionX;
}
}
if (Math.Abs(smtPoint.PositionY - APoint.PositionY) < 0.01)
{
smtPoint.NodePositionY = APoint.NodePositionY;
}
else
{
smtPoint.NodePositionY = APoint.NodePositionY + (BPoint.NodePositionY - APoint.NodePositionY) * (smtPoint.PositionY - APoint.PositionY) / (BPoint.PositionY - APoint.PositionY);
if (double.IsNaN(smtPoint.NodePositionY) || double.IsInfinity(smtPoint.NodePositionY))
{
smtPoint.NodePositionY = APoint.NodePositionY;
}
}
if (smtPoint.NodePositionX <= 0)
{
smtPoint.NodePositionX = 1;
}
else if (smtPoint.NodePositionX > FrmProjectorScreen.instance.BoundsWidth)
{
smtPoint.NodePositionX = FrmProjectorScreen.instance.BoundsWidth;
}
if (smtPoint.NodePositionY <= 0)
{
smtPoint.NodePositionY = 1;
}
else if (smtPoint.NodePositionY > FrmProjectorScreen.instance.BoundsHeight)
{
smtPoint.NodePositionY = FrmProjectorScreen.instance.BoundsHeight;
}
if (smtPoint.PointSizeX < 1 || smtPoint.PointSizeX > 255)
{
smtPoint.PointSizeX = Setting_NInit.Device_DefaultPointSize;
}
if (smtPoint.PointSizeY < 1 || smtPoint.PointSizeY > 255)
{
smtPoint.PointSizeY = Setting_NInit.Device_DefaultPointSize;
}
double xXishu = (BPoint.NodePositionX - APoint.NodePositionX) / (BPoint.PositionX - APoint.PositionX);
double yXishu = (BPoint.NodePositionY - APoint.NodePositionY) / (BPoint.PositionY - APoint.PositionY);
//计算点大小
if (smtPoint.imgP.uTime > smtPoint.pUTime)
{
smtPoint.PointSizeX = (int)((BPoint.NodePositionX - APoint.NodePositionX) * smtPoint.imgP.SizeX / (BPoint.PositionX - APoint.PositionX));
smtPoint.PointSizeY = (int)((BPoint.NodePositionY - APoint.NodePositionY) * smtPoint.imgP.SizeY / (BPoint.PositionY - APoint.PositionY));
smtPoint.PenWidth = (int)((BPoint.NodePositionX - APoint.NodePositionX) * smtPoint.imgP.PWidth / (BPoint.PositionX - APoint.PositionX));
}
//smtPoint.PointSize = 4;
//smtPoint.NodePositionX = BPoint.NodePositionX - (BPoint.NodePositionX - APoint.NodePositionX) * (BPoint.PositionX - smtPoint.PositionX) / (BPoint.PositionX - APoint.PositionX);
//smtPoint.NodePositionY = BPoint.NodePositionY - (BPoint.NodePositionY - APoint.NodePositionY) * (BPoint.PositionY - smtPoint.PositionY) / (BPoint.PositionY - APoint.PositionY);
LogUtil.info($" 【{smtPoint.PN}】图片坐标【{smtPoint.PositionX},{smtPoint.PositionY}】旧坐标【{oldX},{oldY}】新坐标【{smtPoint.NodePositionX},{smtPoint.NodePositionY}】" +
$"点尺寸({smtPoint.PointSizeX},{smtPoint.PointSizeY}),画笔宽{smtPoint.PenWidth}");
return smtPoint;
}
catch (Exception ex)
{
LogUtil.error(" 【" + smtPoint.PN + "】图片坐标【" + smtPoint.PositionX + "," + smtPoint.PositionY + "】校准坐标出错:" + ex.ToString());
}
return smtPoint;
}
private SMTPointInfo GetPoint(SMTPointInfo smtPoint, List<SMTPointInfo> checkOKList)
{
SMTPointInfo p = null;
double maxPingFang = 0;
foreach (SMTPointInfo sm in checkOKList)
{
if (sm.pointNum.Equals(smtPoint.pointNum))
{
continue;
}
double xjuli = sm.PositionX - smtPoint.PositionX;
double yjuli = sm.PositionY - smtPoint.PositionY;
double cping = xjuli * xjuli + yjuli * yjuli;
if (cping > maxPingFang)
{
p = sm;
maxPingFang = cping;
continue;
}
}
if (p != null)
{
return p;
}
return null;
}
}
public class ConBaseInfo
{
public ConBaseInfo()
{
}
public ConBaseInfo(Point point1,Point point2)
{
this.IPoint = point1;
this.Point = point2;
}
/// <summary>
/// 板子实际坐标
/// </summary>
public Point IPoint = new Point();
/// <summary>
/// 投影对应坐标
/// </summary>
public Point Point = new Point();
}
}
...@@ -78,8 +78,8 @@ namespace TSA_V ...@@ -78,8 +78,8 @@ namespace TSA_V
TSAVBean.Y_Max = BoundsHeight; TSAVBean.Y_Max = BoundsHeight;
TSAVBean.X_Min = 1; TSAVBean.X_Min = 1;
TSAVBean.Y_Min = 1; TSAVBean.Y_Min = 1;
ProjectorControl.MaxX = (int)TSAVBean.X_Max; //ProjectorControl.MaxX = (int)TSAVBean.X_Max;
ProjectorControl.MaxY = (int)TSAVBean.Y_Max; //ProjectorControl.MaxY = (int)TSAVBean.Y_Max;
ISShow = true; ISShow = true;
this.Location = new Point(screen.Bounds.Left, screen.Bounds.Top); this.Location = new Point(screen.Bounds.Left, screen.Bounds.Top);
...@@ -489,7 +489,7 @@ namespace TSA_V ...@@ -489,7 +489,7 @@ namespace TSA_V
} }
Graphics g = panel1.CreateGraphics(); Graphics g = panel1.CreateGraphics();
Color pColor = Color.FromArgb(p.showColor); Color pColor = Color.FromArgb(p.showColor);
DrawPoint(pColor, g, p.PX, p.PY, p.PType,p.PolaritiesType, p.SizeX, p.SizeY, p.PenWidth, p.ShowText); DrawPoint(pColor, g, (int)p.PX, (int)p.PY, p.PType,p.PolaritiesType, p.SizeX, p.SizeY, p.PenWidth, p.ShowText);
g.Dispose(); g.Dispose();
} }
public void ShowPoint(bool showName,int rgbColor, params SMTPointInfo[] points) public void ShowPoint(bool showName,int rgbColor, params SMTPointInfo[] points)
......
...@@ -77,23 +77,7 @@ namespace TSA_V ...@@ -77,23 +77,7 @@ namespace TSA_V
picBoard.Height = picBoard.Image.Height; picBoard.Height = picBoard.Image.Height;
} }
else else
{ {
//int xishu = 100;
//picBoard.Width = width * xishu;
//picBoard.Height = height * xishu;
//if (picBoard.Width > panBoard.Width)
//{
// picBoard.Height = height * xishu * panBoard.Width / (width * xishu);
// picBoard.Width = panBoard.Width;
//}
//if (picBoard.Height > (panBoard.Height - 10))
//{
// picBoard.Width = width * xishu * (panBoard.Height - 10) / (height * xishu);
// picBoard.Height = (panBoard.Height - 10);
//}
//picBoard.Width = (int)(picBoard.Width * CurrBeiLu);
//picBoard.Height = (int)(picBoard.Height * CurrBeiLu);
SetPicSize(); SetPicSize();
} }
...@@ -225,6 +209,55 @@ namespace TSA_V ...@@ -225,6 +209,55 @@ namespace TSA_V
{ {
LogUtil.error("画图出错:" + ex.ToString()); LogUtil.error("画图出错:" + ex.ToString());
} }
}
public void DrawEditPoint(int width, int height, SMTPointInfo point,Color color)
{
//this.PointList = pointList;
Width = width;
Height = height;
CurrBeiLu = 1;
//picBoard.SizeMode = PictureBoxSizeMode.AutoSize;
//if (pointList == null)
//{
// return;
//}
if (!ImageNormal)
{
picBoard.Width = picBoard.Image.Width;
picBoard.Height = picBoard.Image.Height;
}
else
{
SetPicSize();
}
//显示点
picBoard.Refresh();
//panBoard.Refresh();
imageXiShu = (float)picBoard.Width / (float)width;
Graphics grfx = picBoard.CreateGraphics();
//float preX = 0;
//float preY = 0;
int index = 0;
Brush brushes = Brushes.HotPink;
ProjectorPInfo p = point.GetShowPInfo(imageXiShu);
DrawPointManager.DrawPoint(grfx, p, color);
//写字
if (index.Equals(selectIndex) || ShowName)
{
grfx.DrawString(point.GetDisplayStr(), new Font("Arial ", 9, FontStyle.Bold), brushes, p.SizeX - p.PenWidth / 2 + 2, p.SizeY + p.PenWidth / 2 + 2);
}
index++;
grfx.SmoothingMode = SmoothingMode.HighQuality;
grfx.Dispose();
} }
} }
} }
......
20240304 增加 20240401
新分支,修改离线编程。
20240304 增加
<add key ="Device_AutoGuoBan" value ="1 "/> <add key ="Device_AutoGuoBan" value ="1 "/>
默认进入过板模式。 默认进入过板模式。
......
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
this.group.Controls.Add(this.lbltype); this.group.Controls.Add(this.lbltype);
this.group.Location = new System.Drawing.Point(5, 3); this.group.Location = new System.Drawing.Point(5, 3);
this.group.Name = "group"; this.group.Name = "group";
this.group.Size = new System.Drawing.Size(532, 300); this.group.Size = new System.Drawing.Size(527, 300);
this.group.TabIndex = 61; this.group.TabIndex = 61;
this.group.TabStop = false; this.group.TabStop = false;
this.group.Text = "投影位置"; this.group.Text = "投影位置";
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
" 6=右上方", " 6=右上方",
" 7=左下方", " 7=左下方",
" 8=右下方"}); " 8=右下方"});
this.cmbpolarities.Location = new System.Drawing.Point(124, 140); this.cmbpolarities.Location = new System.Drawing.Point(147, 140);
this.cmbpolarities.Name = "cmbpolarities"; this.cmbpolarities.Name = "cmbpolarities";
this.cmbpolarities.Size = new System.Drawing.Size(134, 28); this.cmbpolarities.Size = new System.Drawing.Size(134, 28);
this.cmbpolarities.TabIndex = 330; this.cmbpolarities.TabIndex = 330;
...@@ -122,9 +122,9 @@ ...@@ -122,9 +122,9 @@
// lblPolarities // lblPolarities
// //
this.lblPolarities.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblPolarities.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblPolarities.Location = new System.Drawing.Point(11, 146); this.lblPolarities.Location = new System.Drawing.Point(4, 146);
this.lblPolarities.Name = "lblPolarities"; this.lblPolarities.Name = "lblPolarities";
this.lblPolarities.Size = new System.Drawing.Size(107, 17); this.lblPolarities.Size = new System.Drawing.Size(142, 17);
this.lblPolarities.TabIndex = 329; this.lblPolarities.TabIndex = 329;
this.lblPolarities.Text = "极性:"; this.lblPolarities.Text = "极性:";
this.lblPolarities.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.lblPolarities.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
// panImg // panImg
// //
this.panImg.ForeColor = System.Drawing.Color.White; this.panImg.ForeColor = System.Drawing.Color.White;
this.panImg.Location = new System.Drawing.Point(310, 16); this.panImg.Location = new System.Drawing.Point(319, 16);
this.panImg.Name = "panImg"; this.panImg.Name = "panImg";
this.panImg.Size = new System.Drawing.Size(153, 84); this.panImg.Size = new System.Drawing.Size(153, 84);
this.panImg.TabIndex = 328; this.panImg.TabIndex = 328;
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
this.lblName.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblName.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblName.Location = new System.Drawing.Point(11, 22); this.lblName.Location = new System.Drawing.Point(11, 22);
this.lblName.Name = "lblName"; this.lblName.Name = "lblName";
this.lblName.Size = new System.Drawing.Size(107, 17); this.lblName.Size = new System.Drawing.Size(132, 17);
this.lblName.TabIndex = 327; this.lblName.TabIndex = 327;
this.lblName.Text = "投影文字:"; this.lblName.Text = "投影文字:";
this.lblName.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.lblName.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
// txtname // txtname
// //
this.txtname.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.txtname.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtname.Location = new System.Drawing.Point(124, 18); this.txtname.Location = new System.Drawing.Point(147, 18);
this.txtname.Name = "txtname"; this.txtname.Name = "txtname";
this.txtname.Size = new System.Drawing.Size(134, 26); this.txtname.Size = new System.Drawing.Size(134, 26);
this.txtname.TabIndex = 326; this.txtname.TabIndex = 326;
...@@ -158,7 +158,7 @@ ...@@ -158,7 +158,7 @@
// numSizeY // numSizeY
// //
this.numSizeY.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.numSizeY.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.numSizeY.Location = new System.Drawing.Point(124, 202); this.numSizeY.Location = new System.Drawing.Point(147, 202);
this.numSizeY.Maximum = new decimal(new int[] { this.numSizeY.Maximum = new decimal(new int[] {
255, 255,
0, 0,
...@@ -181,7 +181,7 @@ ...@@ -181,7 +181,7 @@
// numSizeX // numSizeX
// //
this.numSizeX.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.numSizeX.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.numSizeX.Location = new System.Drawing.Point(124, 172); this.numSizeX.Location = new System.Drawing.Point(147, 172);
this.numSizeX.Maximum = new decimal(new int[] { this.numSizeX.Maximum = new decimal(new int[] {
255, 255,
0, 0,
...@@ -204,7 +204,7 @@ ...@@ -204,7 +204,7 @@
// numY // numY
// //
this.numY.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.numY.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.numY.Location = new System.Drawing.Point(124, 78); this.numY.Location = new System.Drawing.Point(147, 78);
this.numY.Maximum = new decimal(new int[] { this.numY.Maximum = new decimal(new int[] {
4000, 4000,
0, 0,
...@@ -227,7 +227,7 @@ ...@@ -227,7 +227,7 @@
// numX // numX
// //
this.numX.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.numX.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.numX.Location = new System.Drawing.Point(124, 48); this.numX.Location = new System.Drawing.Point(147, 48);
this.numX.Maximum = new decimal(new int[] { this.numX.Maximum = new decimal(new int[] {
4000, 4000,
0, 0,
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
// numPenWidth // numPenWidth
// //
this.numPenWidth.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.numPenWidth.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.numPenWidth.Location = new System.Drawing.Point(124, 232); this.numPenWidth.Location = new System.Drawing.Point(147, 232);
this.numPenWidth.Maximum = new decimal(new int[] { this.numPenWidth.Maximum = new decimal(new int[] {
255, 255,
0, 0,
...@@ -275,7 +275,7 @@ ...@@ -275,7 +275,7 @@
this.lblLineWidth.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblLineWidth.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblLineWidth.Location = new System.Drawing.Point(11, 239); this.lblLineWidth.Location = new System.Drawing.Point(11, 239);
this.lblLineWidth.Name = "lblLineWidth"; this.lblLineWidth.Name = "lblLineWidth";
this.lblLineWidth.Size = new System.Drawing.Size(107, 17); this.lblLineWidth.Size = new System.Drawing.Size(132, 17);
this.lblLineWidth.TabIndex = 318; this.lblLineWidth.TabIndex = 318;
this.lblLineWidth.Text = "画笔宽度:"; this.lblLineWidth.Text = "画笔宽度:";
this.lblLineWidth.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.lblLineWidth.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
...@@ -285,7 +285,7 @@ ...@@ -285,7 +285,7 @@
this.lblSizeWidth.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblSizeWidth.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblSizeWidth.Location = new System.Drawing.Point(11, 208); this.lblSizeWidth.Location = new System.Drawing.Point(11, 208);
this.lblSizeWidth.Name = "lblSizeWidth"; this.lblSizeWidth.Name = "lblSizeWidth";
this.lblSizeWidth.Size = new System.Drawing.Size(107, 17); this.lblSizeWidth.Size = new System.Drawing.Size(132, 17);
this.lblSizeWidth.TabIndex = 296; this.lblSizeWidth.TabIndex = 296;
this.lblSizeWidth.Text = "纵向大小↓:"; this.lblSizeWidth.Text = "纵向大小↓:";
this.lblSizeWidth.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.lblSizeWidth.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
...@@ -295,7 +295,7 @@ ...@@ -295,7 +295,7 @@
this.lblSizeLength.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblSizeLength.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblSizeLength.Location = new System.Drawing.Point(11, 177); this.lblSizeLength.Location = new System.Drawing.Point(11, 177);
this.lblSizeLength.Name = "lblSizeLength"; this.lblSizeLength.Name = "lblSizeLength";
this.lblSizeLength.Size = new System.Drawing.Size(107, 17); this.lblSizeLength.Size = new System.Drawing.Size(132, 17);
this.lblSizeLength.TabIndex = 317; this.lblSizeLength.TabIndex = 317;
this.lblSizeLength.Text = "横向大小→:"; this.lblSizeLength.Text = "横向大小→:";
this.lblSizeLength.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.lblSizeLength.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
...@@ -313,7 +313,7 @@ ...@@ -313,7 +313,7 @@
"20", "20",
"50", "50",
"100"}); "100"});
this.cmbStep.Location = new System.Drawing.Point(124, 262); this.cmbStep.Location = new System.Drawing.Point(147, 262);
this.cmbStep.Name = "cmbStep"; this.cmbStep.Name = "cmbStep";
this.cmbStep.Size = new System.Drawing.Size(134, 28); this.cmbStep.Size = new System.Drawing.Size(134, 28);
this.cmbStep.TabIndex = 315; this.cmbStep.TabIndex = 315;
...@@ -323,7 +323,7 @@ ...@@ -323,7 +323,7 @@
this.lblStepValue.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblStepValue.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblStepValue.Location = new System.Drawing.Point(11, 270); this.lblStepValue.Location = new System.Drawing.Point(11, 270);
this.lblStepValue.Name = "lblStepValue"; this.lblStepValue.Name = "lblStepValue";
this.lblStepValue.Size = new System.Drawing.Size(107, 17); this.lblStepValue.Size = new System.Drawing.Size(132, 17);
this.lblStepValue.TabIndex = 314; this.lblStepValue.TabIndex = 314;
this.lblStepValue.Text = "步进值:"; this.lblStepValue.Text = "步进值:";
this.lblStepValue.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.lblStepValue.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
...@@ -332,7 +332,7 @@ ...@@ -332,7 +332,7 @@
// //
this.btnDown.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnDown.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnDown.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnDown.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnDown.Location = new System.Drawing.Point(348, 239); this.btnDown.Location = new System.Drawing.Point(357, 239);
this.btnDown.Name = "btnDown"; this.btnDown.Name = "btnDown";
this.btnDown.Size = new System.Drawing.Size(80, 36); this.btnDown.Size = new System.Drawing.Size(80, 36);
this.btnDown.TabIndex = 309; this.btnDown.TabIndex = 309;
...@@ -344,7 +344,7 @@ ...@@ -344,7 +344,7 @@
// //
this.btnUp.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnUp.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnUp.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnUp.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnUp.Location = new System.Drawing.Point(348, 160); this.btnUp.Location = new System.Drawing.Point(357, 160);
this.btnUp.Name = "btnUp"; this.btnUp.Name = "btnUp";
this.btnUp.Size = new System.Drawing.Size(80, 36); this.btnUp.Size = new System.Drawing.Size(80, 36);
this.btnUp.TabIndex = 308; this.btnUp.TabIndex = 308;
...@@ -356,7 +356,7 @@ ...@@ -356,7 +356,7 @@
// //
this.btnLeft.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnLeft.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnLeft.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnLeft.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnLeft.Location = new System.Drawing.Point(312, 199); this.btnLeft.Location = new System.Drawing.Point(321, 199);
this.btnLeft.Name = "btnLeft"; this.btnLeft.Name = "btnLeft";
this.btnLeft.Size = new System.Drawing.Size(72, 36); this.btnLeft.Size = new System.Drawing.Size(72, 36);
this.btnLeft.TabIndex = 307; this.btnLeft.TabIndex = 307;
...@@ -368,7 +368,7 @@ ...@@ -368,7 +368,7 @@
// //
this.btnRight.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnRight.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnRight.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnRight.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnRight.Location = new System.Drawing.Point(388, 199); this.btnRight.Location = new System.Drawing.Point(397, 199);
this.btnRight.Name = "btnRight"; this.btnRight.Name = "btnRight";
this.btnRight.Size = new System.Drawing.Size(72, 36); this.btnRight.Size = new System.Drawing.Size(72, 36);
this.btnRight.TabIndex = 306; this.btnRight.TabIndex = 306;
...@@ -388,7 +388,7 @@ ...@@ -388,7 +388,7 @@
"4=━━", "4=━━",
"5=□", "5=□",
"6=○"}); "6=○"});
this.cmbType.Location = new System.Drawing.Point(124, 108); this.cmbType.Location = new System.Drawing.Point(147, 108);
this.cmbType.Name = "cmbType"; this.cmbType.Name = "cmbType";
this.cmbType.Size = new System.Drawing.Size(134, 28); this.cmbType.Size = new System.Drawing.Size(134, 28);
this.cmbType.TabIndex = 303; this.cmbType.TabIndex = 303;
...@@ -399,7 +399,7 @@ ...@@ -399,7 +399,7 @@
this.lbly.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lbly.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbly.Location = new System.Drawing.Point(11, 84); this.lbly.Location = new System.Drawing.Point(11, 84);
this.lbly.Name = "lbly"; this.lbly.Name = "lbly";
this.lbly.Size = new System.Drawing.Size(107, 17); this.lbly.Size = new System.Drawing.Size(132, 17);
this.lbly.TabIndex = 302; this.lbly.TabIndex = 302;
this.lbly.Text = "Y轴坐标:"; this.lbly.Text = "Y轴坐标:";
this.lbly.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.lbly.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
...@@ -409,7 +409,7 @@ ...@@ -409,7 +409,7 @@
this.lblx.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblx.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblx.Location = new System.Drawing.Point(11, 53); this.lblx.Location = new System.Drawing.Point(11, 53);
this.lblx.Name = "lblx"; this.lblx.Name = "lblx";
this.lblx.Size = new System.Drawing.Size(107, 17); this.lblx.Size = new System.Drawing.Size(132, 17);
this.lblx.TabIndex = 301; this.lblx.TabIndex = 301;
this.lblx.Text = "X轴坐标:"; this.lblx.Text = "X轴坐标:";
this.lblx.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.lblx.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
...@@ -418,7 +418,7 @@ ...@@ -418,7 +418,7 @@
// //
this.btnShowPoint.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnShowPoint.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnShowPoint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnShowPoint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnShowPoint.Location = new System.Drawing.Point(338, 110); this.btnShowPoint.Location = new System.Drawing.Point(347, 110);
this.btnShowPoint.Name = "btnShowPoint"; this.btnShowPoint.Name = "btnShowPoint";
this.btnShowPoint.Size = new System.Drawing.Size(100, 37); this.btnShowPoint.Size = new System.Drawing.Size(100, 37);
this.btnShowPoint.TabIndex = 293; this.btnShowPoint.TabIndex = 293;
...@@ -431,7 +431,7 @@ ...@@ -431,7 +431,7 @@
this.lbltype.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lbltype.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbltype.Location = new System.Drawing.Point(11, 115); this.lbltype.Location = new System.Drawing.Point(11, 115);
this.lbltype.Name = "lbltype"; this.lbltype.Name = "lbltype";
this.lbltype.Size = new System.Drawing.Size(107, 17); this.lbltype.Size = new System.Drawing.Size(132, 17);
this.lbltype.TabIndex = 294; this.lbltype.TabIndex = 294;
this.lbltype.Text = "点形状:"; this.lbltype.Text = "点形状:";
this.lbltype.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.lbltype.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
...@@ -444,8 +444,8 @@ ...@@ -444,8 +444,8 @@
this.Controls.Add(this.group); this.Controls.Add(this.group);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Name = "ProjectorControl"; this.Name = "ProjectorControl";
this.Size = new System.Drawing.Size(544, 310); this.Size = new System.Drawing.Size(539, 310);
this.Load += new System.EventHandler(this.GalvanometerControl_Load); this.Load += new System.EventHandler(this.ProjectorControl_Load);
this.group.ResumeLayout(false); this.group.ResumeLayout(false);
this.group.PerformLayout(); this.group.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numSizeY)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numSizeY)).EndInit();
......
...@@ -14,14 +14,25 @@ namespace UserFromControl ...@@ -14,14 +14,25 @@ namespace UserFromControl
{ {
public partial class ProjectorControl : UserControl public partial class ProjectorControl : UserControl
{ {
public static int MaxX = 1920; public static Dictionary<int,int> LastStepIndexMap=null;
public static int MaxY = 1280; public int ConType = 0;//坐标类型,0=投影,1=mm/离线编程
public int MaxX = 1920;
public int MaxY = 1280;
public double X_ChangeValue = 1;
public double Y_ChangeValue = 1;
public delegate bool ShowPointDelegate(ProjectorPInfo p); public delegate bool ShowPointDelegate(ProjectorPInfo p);
public event ShowPointDelegate ShowPointEvent; public event ShowPointDelegate ShowPointEvent;
public ProjectorControl() public ProjectorControl()
{ {
InitializeComponent(); InitializeComponent();
cmbStep.SelectedIndex = TSAVBean.LastStepIndex; if (LastStepIndexMap == null)
{
LastStepIndexMap = new Dictionary<int, int>();
LastStepIndexMap.Add(0, 1);
LastStepIndexMap.Add(1, 0);
}
cmbStep.SelectedIndex = LastStepIndexMap[ConType];
if (cmbType.SelectedIndex < 0) if (cmbType.SelectedIndex < 0)
{ {
cmbType.SelectedIndex = 0; cmbType.SelectedIndex = 0;
...@@ -88,8 +99,8 @@ namespace UserFromControl ...@@ -88,8 +99,8 @@ namespace UserFromControl
} }
public ProjectorPInfo GetPInfo() public ProjectorPInfo GetPInfo()
{ {
int px = FormUtil.GetIntValue(numX); double px = (double)(numX.Value);
int py = FormUtil.GetIntValue(numY); double py = (double)(numY.Value);
int pointType = cmbType.SelectedIndex + 1; int pointType = cmbType.SelectedIndex + 1;
int sizeX = FormUtil.GetIntValue(numSizeX); int sizeX = FormUtil.GetIntValue(numSizeX);
int sizeY = FormUtil.GetIntValue(numSizeY); int sizeY = FormUtil.GetIntValue(numSizeY);
...@@ -99,12 +110,12 @@ namespace UserFromControl ...@@ -99,12 +110,12 @@ namespace UserFromControl
////如果亮度和大小超过范围,直接用默认值 ////如果亮度和大小超过范围,直接用默认值
//if (sizeX < 1 || sizeX > 255) //if (sizeX < 1 || sizeX > 255)
//{ //{
// sizeX = TSAVBean.DefaultPSize; // sizeX = DefaultPSize;
// numSizeX.Text = sizeX.ToString(); // numSizeX.Text = sizeX.ToString();
//} //}
//if (sizeY < 1 || sizeY > 255) //if (sizeY < 1 || sizeY > 255)
//{ //{
// sizeY = TSAVBean.DefaultPSize; // sizeY = DefaultPSize;
// numSizeY.Text = sizeY.ToString(); // numSizeY.Text = sizeY.ToString();
//} //}
ProjectorPInfo p = new ProjectorPInfo(px, py, pointType,ptype, sizeX, sizeY, penWidth,name, ShowColor); ProjectorPInfo p = new ProjectorPInfo(px, py, pointType,ptype, sizeX, sizeY, penWidth,name, ShowColor);
...@@ -112,20 +123,18 @@ namespace UserFromControl ...@@ -112,20 +123,18 @@ namespace UserFromControl
} }
public void ShowCurrPoint() public void ShowCurrPoint()
{ {
this.Cursor = Cursors.WaitCursor; this.Cursor = Cursors.WaitCursor;
ShowPointEvent?.Invoke(GetPInfo()); ShowPointEvent?.Invoke(GetPInfo());
this.Cursor = Cursors.Default; this.Cursor = Cursors.Default;
} }
private void btnUp_Click(object sender, EventArgs e) private void btnUp_Click(object sender, EventArgs e)
{ {
int stepValue = (int)(GetStepValue() * TSAVBean.Y_ChangeValue); double stepValue = (double)(GetStepValue() * Y_ChangeValue);
int targetValue = FormUtil.GetIntValue(numY) - stepValue; double targetValue = (double)(numY.Value) - stepValue;
if (targetValue >= 0 ) if (targetValue >=(double) numY.Minimum )
{ {
numY.Text = targetValue.ToString(); numY.Value =(decimal) targetValue ;
ShowCurrPoint(); ShowCurrPoint();
} }
else else
...@@ -137,11 +146,11 @@ namespace UserFromControl ...@@ -137,11 +146,11 @@ namespace UserFromControl
private void btnLeft_Click(object sender, EventArgs e) private void btnLeft_Click(object sender, EventArgs e)
{ {
int stepValue = (int)(GetStepValue() * TSAVBean.X_ChangeValue); double stepValue = (double)(GetStepValue() * X_ChangeValue);
int targetValue = FormUtil.GetIntValue(numX) - stepValue; double targetValue = (double)(numX.Value) - stepValue;
if (targetValue >= 0 ) if (targetValue >=(double) numX.Minimum )
{ {
numX.Text = targetValue.ToString(); numX.Value = (decimal)targetValue;
ShowCurrPoint(); ShowCurrPoint();
} }
else else
...@@ -153,12 +162,12 @@ namespace UserFromControl ...@@ -153,12 +162,12 @@ namespace UserFromControl
private void btnRight_Click(object sender, EventArgs e) private void btnRight_Click(object sender, EventArgs e)
{ {
int stepValue = (int)(GetStepValue() * TSAVBean.X_ChangeValue); double stepValue = (double)(GetStepValue() * X_ChangeValue);
int targetValue = FormUtil.GetIntValue(numX) + stepValue; double targetValue =(double)numX.Value+ stepValue;
if ( targetValue <= MaxX) if ( targetValue <=(double)numX.Maximum)
{ {
numX.Text = targetValue .ToString(); numX.Value = (decimal)targetValue;
ShowCurrPoint(); ShowCurrPoint();
} }
else else
...@@ -169,12 +178,12 @@ namespace UserFromControl ...@@ -169,12 +178,12 @@ namespace UserFromControl
} }
private void btnDown_Click(object sender, EventArgs e) private void btnDown_Click(object sender, EventArgs e)
{ {
int stepValue = (int)(GetStepValue() * TSAVBean.Y_ChangeValue); double stepValue = (double)(GetStepValue() * Y_ChangeValue);
int targetValue = FormUtil.GetIntValue(numY) + stepValue; double targetValue = (double)(numY.Value) + stepValue;
if ( targetValue <= MaxY) if ( targetValue <= (double)numY.Maximum)
{ {
numY.Text = targetValue .ToString(); numY.Value = (decimal)targetValue;
ShowCurrPoint(); ShowCurrPoint();
} }
else else
...@@ -193,45 +202,7 @@ namespace UserFromControl ...@@ -193,45 +202,7 @@ namespace UserFromControl
} }
if (!(cmbType.SelectedIndex + 1).Equals(lastType)) if (!(cmbType.SelectedIndex + 1).Equals(lastType))
{ {
lastType = cmbType.SelectedIndex + 1; lastType = cmbType.SelectedIndex + 1;
//if (lastType >= 9 && lastType <= 10)
//{
// if (numSizeX.Value <= 6)
// {
// numSizeX.Value = 6;
// }
// if (numSizeX.Value == numSizeY.Value * 2)
// {
// }
// else if (numSizeY.Value * 2 > numSizeX.Value && numSizeX.Value < 15)
// {
// numSizeX.Value = numSizeY.Value * 2;
// }
// else
// {
// numSizeY.Value = numSizeX.Value / 2;
// }
//}
//else if( (lastType >= 7 && lastType <= 8)|| (lastType >= 11 && lastType <= 14))
//{
// if (numSizeX.Value <= 3)
// {
// numSizeX.Value = 3;
// }
// if(numSizeY.Value== numSizeX.Value * 2)
// {
// }
// else if (numSizeX.Value * 2 > numSizeY.Value &&numSizeY.Value<15)
// {
// numSizeY.Value = numSizeX.Value * 2;
// }
// else
// {
// numSizeX.Value = numSizeY.Value / 2;
// }
//}
DrawPoint(lastType,lastPolaritiesType); DrawPoint(lastType,lastPolaritiesType);
ShowCurrPoint(); ShowCurrPoint();
...@@ -243,11 +214,11 @@ namespace UserFromControl ...@@ -243,11 +214,11 @@ namespace UserFromControl
{ {
set set
{ {
numX.Text = ((int)value).ToString(); numX.Text = (value).ToString();
} }
get get
{ {
return FormUtil.GetIntValue(numX); return (double)numX.Value;
} }
} }
...@@ -255,11 +226,11 @@ namespace UserFromControl ...@@ -255,11 +226,11 @@ namespace UserFromControl
{ {
set set
{ {
numY.Text = ((int)value).ToString(); numY.Text = (value).ToString();
} }
get get
{ {
return FormUtil.GetIntValue(numY); return (double)numY.Value;
} }
} }
public int PointType public int PointType
...@@ -361,8 +332,8 @@ namespace UserFromControl ...@@ -361,8 +332,8 @@ namespace UserFromControl
private double GetStepValue() private double GetStepValue()
{ {
int index = cmbStep.SelectedIndex; int index = cmbStep.SelectedIndex;
TSAVBean.LastStepIndex = index; LastStepIndexMap[ConType]= index;
if (vallue.Count > index) if (vallue.Count > index)
{ {
return vallue[index]; return vallue[index];
...@@ -370,12 +341,41 @@ namespace UserFromControl ...@@ -370,12 +341,41 @@ namespace UserFromControl
return 10; return 10;
} }
private List<string> typeList = new List<string>(); private List<string> typeList = new List<string>();
private void GalvanometerControl_Load(object sender, EventArgs e) private void ProjectorControl_Load(object sender, EventArgs e)
{ {
if (cmbType.SelectedIndex < 0) if (cmbType.SelectedIndex < 0)
{ {
cmbType.SelectedIndex = 0; cmbType.SelectedIndex = 0;
} }
numSizeX.Maximum = MaxX / 2;
numSizeY.Maximum = MaxY / 2;
cmbStep.SelectedIndex = LastStepIndexMap[ConType];
//重新设置步进值
if (ConType == 1)
{
this.cmbStep.Items.Clear();
this.cmbStep.Items.AddRange(new object[] {
"0.1",
"0.2",
"0.5",
"1",
"2",
"5",
"10",
"20",
"50",
"100"});
numX.DecimalPlaces = 3;
numY.DecimalPlaces = 3;
vallue = new List<double>() { 0.1, 0.2, 0.51, 2, 5, 10, 20, 50, 100 };
}
else
{
numX.DecimalPlaces = 0;
numY.DecimalPlaces = 0;
}
cmbStep.SelectedIndex = LastStepIndexMap[ConType];
} }
private void DrawPoint(int type,int polaritiesType , int x=0, int y=0, int sizeX = 2, int sizeY = 2 ,int lineLength=2 ) private void DrawPoint(int type,int polaritiesType , int x=0, int y=0, int sizeX = 2, int sizeY = 2 ,int lineLength=2 )
{ {
...@@ -633,7 +633,8 @@ namespace UserFromControl ...@@ -633,7 +633,8 @@ namespace UserFromControl
} }
private void group_Paint(object sender, PaintEventArgs e) private void group_Paint(object sender, PaintEventArgs e)
{ {
return;
DrawPoint(lastType, lastPolaritiesType); DrawPoint(lastType, lastPolaritiesType);
ShowCurrPoint(); ShowCurrPoint();
} }
...@@ -648,5 +649,14 @@ namespace UserFromControl ...@@ -648,5 +649,14 @@ namespace UserFromControl
ShowCurrPoint(); ShowCurrPoint();
} }
} }
public void SetPointType(int pointType, int pointSizeX, int pointSizeY, int penWidth, int polaritiesType)
{
this.PointType = pointType;
this.PointSizeX = pointSizeX;
this.PointSizeY = pointSizeY;
this.PenWidth = penWidth;
this.PolaritiesType = polaritiesType;
}
} }
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!