Commit 32f60895 LN

多PCB模式可调整间距。多点位投影功能。

1 个父辈 cb69a316
...@@ -74,6 +74,31 @@ namespace TSA_V.DeviceLibrary ...@@ -74,6 +74,31 @@ namespace TSA_V.DeviceLibrary
/// 多PCB模式-列间距(mm) /// 多PCB模式-列间距(mm)
/// </summary> /// </summary>
public int pcbColValue { get; set; } = 1; public int pcbColValue { get; set; } = 1;
/// <summary>
/// 多点位投射功能,=true所有点位同时显示。
/// </summary>
public bool mPointsProjection { get; set; } = false;
/// <summary>
/// 多pcb模式,每个PCB针对PCB1的偏移坐标。key=pcb索引号,value =偏移坐标
/// </summary>
public Dictionary<int, Point> mPCbOffsetMap = new Dictionary<int, Point>();
public Point GetPCBOffsetPoint(int pcbIndex)
{
if (mPCbOffsetMap.ContainsKey(pcbIndex))
{
return mPCbOffsetMap[pcbIndex];
}
else
{
return new Point(0, 0);
}
}
public void SetPCBOffset(int pcbIndex, Point value)
{
mPCbOffsetMap[pcbIndex] = value;
}
public int PointColor = Color.White.ToArgb(); public int PointColor = Color.White.ToArgb();
...@@ -221,7 +246,8 @@ namespace TSA_V.DeviceLibrary ...@@ -221,7 +246,8 @@ namespace TSA_V.DeviceLibrary
public List<SMTPointInfo> getCalPoint() public List<SMTPointInfo> getCalPoint()
{ {
try
{
SMTPointInfo lefup = new SMTPointInfo(); SMTPointInfo lefup = new SMTPointInfo();
lefup.PositionX = 0; lefup.PositionX = 0;
lefup.PositionY = 0; lefup.PositionY = 0;
...@@ -235,8 +261,15 @@ namespace TSA_V.DeviceLibrary ...@@ -235,8 +261,15 @@ namespace TSA_V.DeviceLibrary
right.NodePositionY = calInfo.rightBottomPoint.Y; right.NodePositionY = calInfo.rightBottomPoint.Y;
List<SMTPointInfo> checkOKList = new List<SMTPointInfo>() { lefup, right }; List<SMTPointInfo> checkOKList = new List<SMTPointInfo>() { lefup, right };
return checkOKList; return checkOKList;
} }
catch (Exception ex)
{
LogUtil.error(boardName + "获取校准点列表出错:" + ex.ToString());
}
return new List<SMTPointInfo>();
}
public CalibrateBean calInfo = null; public CalibrateBean calInfo = null;
......
...@@ -580,5 +580,6 @@ namespace TSA_V.DeviceLibrary ...@@ -580,5 +580,6 @@ namespace TSA_V.DeviceLibrary
} }
} }
} }
using System; using System;
using System.CodeDom; using System.CodeDom;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
...@@ -152,6 +152,73 @@ namespace TSA_V.DeviceLibrary ...@@ -152,6 +152,73 @@ namespace TSA_V.DeviceLibrary
} }
public static Point CalPCBAreaNodePosition(Point position, List<SMTPointInfo> checkOKList, int type)
{
Point nodePosition = new Point(0,0);
try
{
if (checkOKList.Count < 2)
{
return nodePosition;
}
SMTPointInfo APoint = checkOKList[0];
SMTPointInfo BPoint = checkOKList[1];
//计算坐标
if (Math.Abs(position.X - APoint.PositionX) < 0.01)
{
nodePosition.X =(int) APoint.NodePositionX;
}
else
{
nodePosition.X =(int)( APoint.NodePositionX + (BPoint.NodePositionX - APoint.NodePositionX) * (position.X - APoint.PositionX) / (BPoint.PositionX - APoint.PositionX));
if (double.IsNaN(nodePosition.X) || double.IsInfinity(nodePosition.X))
{
nodePosition.X =(int) APoint.NodePositionX;
}
}
if (Math.Abs(position.Y - APoint.PositionY) < 0.01)
{
nodePosition.Y = (int)APoint.NodePositionY;
}
else
{
nodePosition.Y =(int)( APoint.NodePositionY + (BPoint.NodePositionY - APoint.NodePositionY) * (position.Y - APoint.PositionY) / (BPoint.PositionY - APoint.PositionY));
if (double.IsNaN(nodePosition.Y) || double.IsInfinity(nodePosition.Y))
{
nodePosition.Y =(int) APoint.NodePositionY;
}
}
if (nodePosition.X <= 0)
{
nodePosition.X = 1;
}
else if (nodePosition.X > BoundsWidth)
{
nodePosition.X = BoundsWidth;
}
if (nodePosition.Y <= 0)
{
nodePosition.Y = 1;
}
else if (nodePosition.Y > BoundsHeight)
{
nodePosition.Y = BoundsHeight;
}
//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(" CalPointNodePosition 多PCB基准点计算错误【 图片坐标【" + position.X + "," + position.Y + "】校准坐标出错:" + ex.ToString());
}
return nodePosition;
}
private SMTPointInfo GetPoint(SMTPointInfo smtPoint, List<SMTPointInfo> checkOKList) private SMTPointInfo GetPoint(SMTPointInfo smtPoint, List<SMTPointInfo> checkOKList)
{ {
...@@ -193,6 +260,100 @@ namespace TSA_V.DeviceLibrary ...@@ -193,6 +260,100 @@ namespace TSA_V.DeviceLibrary
return projectorPInfoList; return projectorPInfoList;
} }
/// <summary>
/// 多板拷贝点
/// </summary>
/// <param name="board"></param>
/// <param name="sMTPoint"></param>
/// <param name="targetRow"></param>
/// <param name="targetCol"></param>
/// <param name="targetRowValue"></param>
/// <param name="targetColValue"></param>
/// <returns></returns>
public static List<List<Point>> GetCopyArea(BoardInfo board, int targetRow = 0, int targetCol = 0, int targetRowValue = 0, int targetColValue = 0)
{
List<List<Point>> result = new List<List<Point>>();
if (board == null || board.calInfo == null || board.calInfo.leftUpPoint == null || board.calInfo.rightBottomPoint == null)
{
return result;
}
try
{
result.Add(new List<Point>() { board.calInfo.leftUpPoint, board.calInfo.rightBottomPoint });
List<SMTPointInfo> checkOKList = board.getCalPoint();
if (board == null || checkOKList == null || checkOKList.Count < 2 || board.PCBCount == 1)
{
return result;
}
if (board.pcbRow <= 1 && board.pcbCol <= 1)
{
return result;
}
int pcbRow = targetRow > 0 ? targetRow : board.pcbRow;
int pcbCol = targetCol > 0 ? targetCol : board.pcbCol;
int pcbColValue = targetColValue > 0 ? targetColValue : board.pcbColValue;
int pcbRowValue = targetRowValue > 0 ? targetRowValue : board.pcbRowValue;
for (int currR = 1; currR <= pcbRow; currR++)
{
for (int currC = 1; currC <= pcbCol; currC++)
{
int index = (currR - 1) * pcbCol + currC;
if (index == 1) continue; // PCB1 为基准
// 默认按均匀间距计算
int dx = (currC - 1) * pcbColValue;
int dy = (currR - 1) * pcbRowValue;
// 若设置了某个PCB相对PCB1的偏移,则覆盖默认值
try
{
if (board.mPCbOffsetMap != null && board.mPCbOffsetMap.ContainsKey(index))
{
var pOffset = board.mPCbOffsetMap[index];
dx = pOffset.X;
dy = pOffset.Y;
}
}
catch { }
Point leftPoint = new Point(dx, dy);
Point rightPoint = new Point(dx + board.boardWidth, dy + board.boardLength);
if (checkOKList != null)
{
Point leftNodePoint = XYConvertManager.CalPCBAreaNodePosition(leftPoint, checkOKList, 1);
Point rightNodePoint = XYConvertManager.CalPCBAreaNodePosition(rightPoint, checkOKList, 2);
result.Add(new List<Point>() { leftNodePoint, rightNodePoint });
}
}
}
}
catch (Exception ex)
{
LogUtil.error("获取" + board.boardName + "拷贝点出错:" + ex.ToString());
}
finally
{
}
return result;
}
/// <summary>
/// 多板拷贝点
/// </summary>
/// <param name="board"></param>
/// <param name="sMTPoint"></param>
/// <param name="targetRow"></param>
/// <param name="targetCol"></param>
/// <param name="targetRowValue"></param>
/// <param name="targetColValue"></param>
/// <returns></returns>
public static List<SMTPointInfo> GetCopyPointCR(BoardInfo board, SMTPointInfo sMTPoint = null,int targetRow=0,int targetCol=0,int targetRowValue=0,int targetColValue=0) public static List<SMTPointInfo> GetCopyPointCR(BoardInfo board, SMTPointInfo sMTPoint = null,int targetRow=0,int targetCol=0,int targetRowValue=0,int targetColValue=0)
{ {
List<SMTPointInfo> pointList = new List<SMTPointInfo>(); List<SMTPointInfo> pointList = new List<SMTPointInfo>();
...@@ -205,7 +366,7 @@ namespace TSA_V.DeviceLibrary ...@@ -205,7 +366,7 @@ namespace TSA_V.DeviceLibrary
if (board != null) if (board != null)
{ {
basePoints = new List<SMTPointInfo>(board.smtList); basePoints = new List<SMTPointInfo>(board.GetSmtList());
} }
else else
{ {
...@@ -241,26 +402,11 @@ namespace TSA_V.DeviceLibrary ...@@ -241,26 +402,11 @@ namespace TSA_V.DeviceLibrary
{ {
return pointList; return pointList;
} }
int pcbRow = board.pcbRow; int pcbRow =targetRow>0?targetRow: board.pcbRow;
if (targetRow > 0) int pcbCol = targetCol > 0?targetCol: board.pcbCol;
{ int pcbColValue = targetColValue > 0?targetColValue: board.pcbColValue;
pcbRow = targetRow; int pcbRowValue = targetRowValue > 0 ? targetRowValue: board.pcbRowValue;
}
int pcbCol = board.pcbCol;
if(targetCol > 0)
{
pcbCol = targetCol;
}
int pcbColValue = board.pcbColValue;
if (targetRowValue > 0)
{
pcbColValue = targetRowValue;
}
int pcbRowValue = board.pcbRowValue;
if(targetColValue > 0)
{
pcbRowValue = targetColValue;
}
for (int currR = 1; currR <= pcbRow; currR++) for (int currR = 1; currR <= pcbRow; currR++)
{ {
for (int currC = 1; currC <= pcbCol; currC++) for (int currC = 1; currC <= pcbCol; currC++)
...@@ -272,8 +418,22 @@ namespace TSA_V.DeviceLibrary ...@@ -272,8 +418,22 @@ namespace TSA_V.DeviceLibrary
{ {
SMTPointInfo newPoint = new SMTPointInfo(point); SMTPointInfo newPoint = new SMTPointInfo(point);
newPoint.pointNum = baseCount + point.pointNum; newPoint.pointNum = baseCount + point.pointNum;
newPoint.PositionX = newPoint.PositionX + (currC - 1) * pcbColValue; // 默认按均匀间距计算
newPoint.PositionY = newPoint.PositionY + (currR - 1) * pcbRowValue; int dx = (currC - 1) * pcbColValue;
int dy = (currR - 1) * pcbRowValue;
// 若设置了某个PCB相对PCB1的偏移,则覆盖默认值
try
{
if (board.mPCbOffsetMap != null && board.mPCbOffsetMap.ContainsKey(index))
{
var pOffset = board.mPCbOffsetMap[index];
dx = pOffset.X;
dy = pOffset.Y;
}
}
catch { }
newPoint.PositionX = newPoint.PositionX + dx;
newPoint.PositionY = newPoint.PositionY + dy;
newPoint.Group = index; newPoint.Group = index;
newPoint.TagNo = point.TagNo + "-" + index; newPoint.TagNo = point.TagNo + "-" + index;
newPoint.PointSizeX = point.PointSizeX; newPoint.PointSizeX = point.PointSizeX;
......
...@@ -353,16 +353,16 @@ namespace TSA_V.DeviceLibrary ...@@ -353,16 +353,16 @@ namespace TSA_V.DeviceLibrary
} }
LogUtil.info(Name + "重置中 " + resetStep + ":InitNode 所有节点 "); LogUtil.info(Name + "重置中 " + resetStep + ":InitNode 所有节点 ");
} }
public delegate bool ShowPointDelegate(params ProjectorPInfo[] p); public delegate bool ShowPointDelegate(BoardInfo board,params SMTPointInfo[] point);
public static event ShowPointDelegate ShowPointEvent; public static event ShowPointDelegate ShowPointEvent;
//public static void ShowPoint(double x, double y, int type = 1,int polaritiesType=0,int angle, int sizex = 1, int sizey = 1, int penWidth = 2, string name = "",int color=-1) //public static void ShowPoint(double x, double y, int type = 1,int polaritiesType=0,int angle, int sizex = 1, int sizey = 1, int penWidth = 2, string name = "",int color=-1)
//{ //{
// ProjectorPInfo p = new ProjectorPInfo((int)x, (int)y, type, polaritiesType,angle, sizex, sizey, penWidth, name,color); // ProjectorPInfo p = new ProjectorPInfo((int)x, (int)y, type, polaritiesType,angle, sizex, sizey, penWidth, name,color);
// ShowPointEvent?.Invoke(p); // ShowPointEvent?.Invoke(p);
//} //}
public static void ShowPoint(params ProjectorPInfo[] p) public static void ShowPoint(BoardInfo board, params SMTPointInfo[] point)
{ {
ShowPointEvent?.Invoke(p); ShowPointEvent?.Invoke(board,point);
} }
......
...@@ -309,10 +309,11 @@ namespace TSA_V.DeviceLibrary ...@@ -309,10 +309,11 @@ namespace TSA_V.DeviceLibrary
if (TSAVBean.IsValidPosition(currPoint.NodePositionX, currPoint.NodePositionY)) if (TSAVBean.IsValidPosition(currPoint.NodePositionX, currPoint.NodePositionY))
{ {
LogUtil.info(" 程序【" + currBoard.boardName + "】插件【" + currPoint.TagNo + "_" + currPoint.PN + "】,X轴【" + currPoint.NodePositionX + "】,Y轴【" + currPoint.NodePositionY + "】显示投影光标"); LogUtil.info(" 程序【" + currBoard.boardName + "】插件【" + currPoint.TagNo + "_" + currPoint.PN + "】,X轴【" + currPoint.NodePositionX + "】,Y轴【" + currPoint.NodePositionY + "】显示投影光标");
List<ProjectorPInfo> projectorPInfos = XYConvertManager.GetCopyProjectPointCR(currBoard, currPoint); //List<ProjectorPInfo> projectorPInfos = XYConvertManager.GetCopyProjectPointCR(currBoard, currPoint);
TSAVBean.ShowPoint(projectorPInfos.ToArray()); //TSAVBean.ShowPoint(projectorPInfos.ToArray());
//TSAVBean.ShowPoint( currPoint.GetScreenShowPInfo()); //TSAVBean.ShowPoint( currPoint.GetScreenShowPInfo());
//TSAVBean.ShowPoint(currPoint.NodePositionX, currPoint.NodePositionY, currPoint.PointType,currPoint.PolaritiesType, currPoint.PointSizeX, currPoint.PointSizeY, currPoint.PenWidth, currPoint.ShowText, currBoard.PointColor); //TSAVBean.ShowPoint(currPoint.NodePositionX, currPoint.NodePositionY, currPoint.PointType,currPoint.PolaritiesType, currPoint.PointSizeX, currPoint.PointSizeY, currPoint.PenWidth, currPoint.ShowText, currBoard.PointColor);
TSAVBean.ShowPoint(currBoard, currPoint);
waitList.Add(WaitResultInfo.WaitTime(1000)); waitList.Add(WaitResultInfo.WaitTime(1000));
} }
else else
......
...@@ -150,8 +150,9 @@ namespace TSA_V ...@@ -150,8 +150,9 @@ namespace TSA_V
} }
SetListCurrCell(index); SetListCurrCell(index);
FrmProjectorScreen.instance.ClearPoint(); //FrmProjectorScreen.instance.ClearPoint();
FrmProjectorScreen.instance.ShowPoint(false, updateBoardInfo.PointColor, pointList.ToArray( )); //FrmProjectorScreen.instance.ShowPoint(false, updateBoardInfo.PointColor, pointList.ToArray( ));
FrmProjectorScreen.instance.ShowAreaAndPoint(updateBoardInfo, false, pointList.ToArray());
this.Cursor = Cursors.Default; this.Cursor = Cursors.Default;
//重新加载 //重新加载
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.TrainOK, "坐标校准完成!")); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.TrainOK, "坐标校准完成!"));
......
...@@ -377,10 +377,11 @@ namespace TSA_V ...@@ -377,10 +377,11 @@ namespace TSA_V
HandClientManager.StartClient(); HandClientManager.StartClient();
} }
private bool TSAVBean_ShowPointEvent(params ProjectorPInfo[] p) private bool TSAVBean_ShowPointEvent(BoardInfo board, params SMTPointInfo[] p)
{ {
FrmProjectorScreen.instance.ClearPoint(); FrmProjectorScreen.instance.ClearPoint();
FrmProjectorScreen.instance.ShowPoint(p); //FrmProjectorScreen.instance.ShowPoint(p);
FrmProjectorScreen.instance.WorkingShowPoint(board,true,p);
return true; return true;
} }
......
...@@ -2829,5 +2829,13 @@ ...@@ -2829,5 +2829,13 @@
<data name = "FrmMPcbConfig_label7_Text" xml:space = "preserve"> <value> Rows: </value> </data> <data name = "FrmMPcbConfig_label7_Text" xml:space = "preserve"> <value> Rows: </value> </data>
<data name = "FrmMPcbConfig_btnClose_Text" xml:space = "preserve"> <value> Back </value> </data> <data name = "FrmMPcbConfig_btnClose_Text" xml:space = "preserve"> <value> Back </value> </data>
<data name = "FrmMPcbConfig_btnSave_Text" xml:space = "preserve"> <value> Save </value> </data> <data name = "FrmMPcbConfig_btnSave_Text" xml:space = "preserve"> <value> Save </value> </data>
<data name = "FrmPCbOffsetConfig_Text" xml:space = "preserve"> <value>Set PCB{0} Relative Offset (mm)</value> </data>
<data name = "FrmPCbOffsetConfig_labelX_Text" xml:space = "preserve"> <value>X Offset (mm): </value> </data>
<data name = "FrmPCbOffsetConfig_labelY_Text" xml:space = "preserve"> <value>Y Offset (mm): </value> </data>
<data name = "FrmPCbOffsetConfig_btnOK_Text" xml:space = "preserve"> <value>OK</value> </data>
<data name = "FrmPCbOffsetConfig_btnCancel_Text" xml:space = "preserve"> <value>Cancel</value> </data>
<data name = "MPCBTips" xml:space = "preserve"> <value>Click the PCB block below to set its offset relative to PCB1 (Unit: mm). If not set, it will be arranged evenly according to the row/column spacing above.</value> </data>
<data name = "Pcb1Fixed" xml:space = "preserve"> <value>PCB1 is used as the reference, and its offset is fixed at (0,0)</value> </data>
<data name = "FrmBoardInfo_chbMPoint_Text" xml:space = "preserve"> <value>Multi-Points Projection </value> </data>
</root> </root>
\ No newline at end of file \ No newline at end of file
...@@ -2807,4 +2807,12 @@ ...@@ -2807,4 +2807,12 @@
<data name = "FrmMPcbConfig_label7_Text" xml:space = "preserve"> <value> 行: </value> </data> <data name = "FrmMPcbConfig_label7_Text" xml:space = "preserve"> <value> 行: </value> </data>
<data name = "FrmMPcbConfig_btnClose_Text" xml:space = "preserve"> <value> 返回 </value> </data> <data name = "FrmMPcbConfig_btnClose_Text" xml:space = "preserve"> <value> 返回 </value> </data>
<data name = "FrmMPcbConfig_btnSave_Text" xml:space = "preserve"> <value> 保存 </value> </data> <data name = "FrmMPcbConfig_btnSave_Text" xml:space = "preserve"> <value> 保存 </value> </data>
<data name = "FrmPCbOffsetConfig_Text" xml:space = "preserve"> <value> 设置 PCB{0} 相对偏移(mm)</value> </data>
<data name = "FrmPCbOffsetConfig_labelX_Text" xml:space = "preserve"> <value> X偏移(mm): </value> </data>
<data name = "FrmPCbOffsetConfig_labelY_Text" xml:space = "preserve"> <value> Y偏移(mm): </value> </data>
<data name = "FrmPCbOffsetConfig_btnOK_Text" xml:space = "preserve"> <value> 确定 </value> </data>
<data name = "FrmPCbOffsetConfig_btnCancel_Text" xml:space = "preserve"> <value> 取消 </value> </data>
<data name = "MPCBTips" xml:space = "preserve"> <value> 点击下方PCB块可设置其相对PCB1的偏移(单位:mm)。未设置则按上方行/列间距均匀排布 </value> </data>
<data name = "Pcb1Fixed" xml:space = "preserve"> <value> PCB1作为基准,偏移固定为(0,0) </value> </data>
<data name = "FrmBoardInfo_chbMPoint_Text" xml:space = "preserve"> <value> 多点位投影功能 </value> </data>
</root> </root>
\ No newline at end of file \ No newline at end of file
...@@ -3051,4 +3051,12 @@ ...@@ -3051,4 +3051,12 @@
<data name = "FrmMPcbConfig_label7_Text" xml:space = "preserve"> <value> 行: </value> </data> <data name = "FrmMPcbConfig_label7_Text" xml:space = "preserve"> <value> 行: </value> </data>
<data name = "FrmMPcbConfig_btnClose_Text" xml:space = "preserve"> <value> 返回 </value> </data> <data name = "FrmMPcbConfig_btnClose_Text" xml:space = "preserve"> <value> 返回 </value> </data>
<data name = "FrmMPcbConfig_btnSave_Text" xml:space = "preserve"> <value> 保存 </value> </data> <data name = "FrmMPcbConfig_btnSave_Text" xml:space = "preserve"> <value> 保存 </value> </data>
<data name = "FrmPCbOffsetConfig_Text" xml:space = "preserve"> <value> 设置 PCB{0} 相对偏移(mm)</value> </data>
<data name = "FrmPCbOffsetConfig_labelX_Text" xml:space = "preserve"> <value> X偏移(mm): </value> </data>
<data name = "FrmPCbOffsetConfig_labelY_Text" xml:space = "preserve"> <value> Y偏移(mm): </value> </data>
<data name = "FrmPCbOffsetConfig_btnOK_Text" xml:space = "preserve"> <value> 确定 </value> </data>
<data name = "FrmPCbOffsetConfig_btnCancel_Text" xml:space = "preserve"> <value> 取消 </value> </data>
<data name = "MPCBTips" xml:space = "preserve"> <value> 点击下方PCB块可设置其相对PCB1的偏移(单位:mm)。未设置则按上方行/列间距均匀排布 </value> </data>
<data name = "Pcb1Fixed" xml:space = "preserve"> <value> PCB1作为基准,偏移固定为(0,0) </value> </data>
<data name = "FrmBoardInfo_chbMPoint_Text" xml:space = "preserve"> <value> 多点位投影功能 </value> </data>
</root> </root>
\ No newline at end of file \ No newline at end of file
...@@ -179,6 +179,12 @@ ...@@ -179,6 +179,12 @@
<Compile Include="frmBoard\FrmMPcbConfig.Designer.cs"> <Compile Include="frmBoard\FrmMPcbConfig.Designer.cs">
<DependentUpon>FrmMPcbConfig.cs</DependentUpon> <DependentUpon>FrmMPcbConfig.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="frmBoard\FrmPCbOffsetConfig.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmBoard\FrmPCbOffsetConfig.Designer.cs">
<DependentUpon>FrmPCbOffsetConfig.cs</DependentUpon>
</Compile>
<Compile Include="frmBoard\FrmEditMPoint.cs"> <Compile Include="frmBoard\FrmEditMPoint.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
...@@ -469,6 +475,9 @@ ...@@ -469,6 +475,9 @@
<EmbeddedResource Include="frmBoard\FrmNImageViewer.resx"> <EmbeddedResource Include="frmBoard\FrmNImageViewer.resx">
<DependentUpon>FrmNImageViewer.cs</DependentUpon> <DependentUpon>FrmNImageViewer.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="frmBoard\FrmPCbOffsetConfig.resx">
<DependentUpon>FrmPCbOffsetConfig.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmCom\FrmAddCom.resx"> <EmbeddedResource Include="frmCom\FrmAddCom.resx">
<DependentUpon>FrmAddCom.cs</DependentUpon> <DependentUpon>FrmAddCom.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
......
...@@ -127,6 +127,7 @@ ...@@ -127,6 +127,7 @@
this.button1 = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button();
this.btnSave = new System.Windows.Forms.Button(); this.btnSave = new System.Windows.Forms.Button();
this.panel2 = new System.Windows.Forms.Panel(); this.panel2 = new System.Windows.Forms.Panel();
this.chbMPoint = new System.Windows.Forms.CheckBox();
this.contextMenuStrip1.SuspendLayout(); this.contextMenuStrip1.SuspendLayout();
this.contextMenuStrip2.SuspendLayout(); this.contextMenuStrip2.SuspendLayout();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
...@@ -311,13 +312,12 @@ ...@@ -311,13 +312,12 @@
this.btnMPCbMode.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.btnMPCbMode.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnMPCbMode.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnMPCbMode.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnMPCbMode.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnMPCbMode.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnMPCbMode.Location = new System.Drawing.Point(1336, 588); this.btnMPCbMode.Location = new System.Drawing.Point(1336, 571);
this.btnMPCbMode.Name = "btnMPCbMode"; this.btnMPCbMode.Name = "btnMPCbMode";
this.btnMPCbMode.Size = new System.Drawing.Size(120, 45); this.btnMPCbMode.Size = new System.Drawing.Size(120, 45);
this.btnMPCbMode.TabIndex = 287; this.btnMPCbMode.TabIndex = 287;
this.btnMPCbMode.Text = "多PCB模式"; this.btnMPCbMode.Text = "多PCB模式";
this.btnMPCbMode.UseVisualStyleBackColor = false; this.btnMPCbMode.UseVisualStyleBackColor = false;
this.btnMPCbMode.Visible = true;
this.btnMPCbMode.Click += new System.EventHandler(this.btnMPCbMode_Click); this.btnMPCbMode.Click += new System.EventHandler(this.btnMPCbMode_Click);
// //
// btnMEdit // btnMEdit
...@@ -325,7 +325,7 @@ ...@@ -325,7 +325,7 @@
this.btnMEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.btnMEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnMEdit.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnMEdit.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnMEdit.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnMEdit.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnMEdit.Location = new System.Drawing.Point(355, 588); this.btnMEdit.Location = new System.Drawing.Point(355, 571);
this.btnMEdit.Name = "btnMEdit"; this.btnMEdit.Name = "btnMEdit";
this.btnMEdit.Size = new System.Drawing.Size(120, 45); this.btnMEdit.Size = new System.Drawing.Size(120, 45);
this.btnMEdit.TabIndex = 297; this.btnMEdit.TabIndex = 297;
...@@ -338,7 +338,7 @@ ...@@ -338,7 +338,7 @@
this.linkDis.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.linkDis.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.linkDis.AutoSize = true; this.linkDis.AutoSize = true;
this.linkDis.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.linkDis.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.linkDis.Location = new System.Drawing.Point(118, 593); this.linkDis.Location = new System.Drawing.Point(118, 576);
this.linkDis.Name = "linkDis"; this.linkDis.Name = "linkDis";
this.linkDis.Size = new System.Drawing.Size(56, 17); this.linkDis.Size = new System.Drawing.Size(56, 17);
this.linkDis.TabIndex = 296; this.linkDis.TabIndex = 296;
...@@ -351,7 +351,7 @@ ...@@ -351,7 +351,7 @@
this.linkEnable.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.linkEnable.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.linkEnable.AutoSize = true; this.linkEnable.AutoSize = true;
this.linkEnable.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.linkEnable.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.linkEnable.Location = new System.Drawing.Point(6, 593); this.linkEnable.Location = new System.Drawing.Point(6, 576);
this.linkEnable.Name = "linkEnable"; this.linkEnable.Name = "linkEnable";
this.linkEnable.Size = new System.Drawing.Size(56, 17); this.linkEnable.Size = new System.Drawing.Size(56, 17);
this.linkEnable.TabIndex = 295; this.linkEnable.TabIndex = 295;
...@@ -364,7 +364,7 @@ ...@@ -364,7 +364,7 @@
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(230, 588); this.btnCalibrate.Location = new System.Drawing.Point(230, 571);
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;
...@@ -377,7 +377,7 @@ ...@@ -377,7 +377,7 @@
this.btnColorChange.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 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.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.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnColorChange.Location = new System.Drawing.Point(1086, 588); this.btnColorChange.Location = new System.Drawing.Point(1086, 571);
this.btnColorChange.Name = "btnColorChange"; this.btnColorChange.Name = "btnColorChange";
this.btnColorChange.Size = new System.Drawing.Size(120, 45); this.btnColorChange.Size = new System.Drawing.Size(120, 45);
this.btnColorChange.TabIndex = 293; this.btnColorChange.TabIndex = 293;
...@@ -391,7 +391,7 @@ ...@@ -391,7 +391,7 @@
this.btnOpenFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.btnOpenFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnOpenFile.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnOpenFile.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOpenFile.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnOpenFile.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOpenFile.Location = new System.Drawing.Point(1210, 588); this.btnOpenFile.Location = new System.Drawing.Point(1210, 571);
this.btnOpenFile.Name = "btnOpenFile"; this.btnOpenFile.Name = "btnOpenFile";
this.btnOpenFile.Size = new System.Drawing.Size(120, 45); this.btnOpenFile.Size = new System.Drawing.Size(120, 45);
this.btnOpenFile.TabIndex = 260; this.btnOpenFile.TabIndex = 260;
...@@ -404,7 +404,7 @@ ...@@ -404,7 +404,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(230, 588); this.btnCheck.Location = new System.Drawing.Point(230, 571);
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;
...@@ -417,6 +417,7 @@ ...@@ -417,6 +417,7 @@
// //
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.groupBox2.Controls.Add(this.chbMPoint);
this.groupBox2.Controls.Add(this.btnConfigAOI); this.groupBox2.Controls.Add(this.btnConfigAOI);
this.groupBox2.Controls.Add(this.label8); this.groupBox2.Controls.Add(this.label8);
this.groupBox2.Controls.Add(this.label122); this.groupBox2.Controls.Add(this.label122);
...@@ -434,7 +435,7 @@ ...@@ -434,7 +435,7 @@
this.groupBox2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.groupBox2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox2.Location = new System.Drawing.Point(634, 3); this.groupBox2.Location = new System.Drawing.Point(634, 3);
this.groupBox2.Name = "groupBox2"; this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(822, 99); this.groupBox2.Size = new System.Drawing.Size(829, 99);
this.groupBox2.TabIndex = 290; this.groupBox2.TabIndex = 290;
this.groupBox2.TabStop = false; this.groupBox2.TabStop = false;
this.groupBox2.Text = "图片信息"; this.groupBox2.Text = "图片信息";
...@@ -593,7 +594,7 @@ ...@@ -593,7 +594,7 @@
this.chbNormal.Checked = true; this.chbNormal.Checked = true;
this.chbNormal.CheckState = System.Windows.Forms.CheckState.Checked; this.chbNormal.CheckState = System.Windows.Forms.CheckState.Checked;
this.chbNormal.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.chbNormal.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbNormal.Location = new System.Drawing.Point(761, 593); this.chbNormal.Location = new System.Drawing.Point(761, 576);
this.chbNormal.Name = "chbNormal"; this.chbNormal.Name = "chbNormal";
this.chbNormal.Size = new System.Drawing.Size(87, 21); this.chbNormal.Size = new System.Drawing.Size(87, 21);
this.chbNormal.TabIndex = 281; this.chbNormal.TabIndex = 281;
...@@ -606,7 +607,7 @@ ...@@ -606,7 +607,7 @@
this.lblMousePosition.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.lblMousePosition.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.lblMousePosition.AutoSize = true; this.lblMousePosition.AutoSize = true;
this.lblMousePosition.Font = new System.Drawing.Font("微软雅黑", 7.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblMousePosition.Font = new System.Drawing.Font("微软雅黑", 7.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblMousePosition.Location = new System.Drawing.Point(823, 625); this.lblMousePosition.Location = new System.Drawing.Point(823, 608);
this.lblMousePosition.Name = "lblMousePosition"; this.lblMousePosition.Name = "lblMousePosition";
this.lblMousePosition.Size = new System.Drawing.Size(33, 16); this.lblMousePosition.Size = new System.Drawing.Size(33, 16);
this.lblMousePosition.TabIndex = 287; this.lblMousePosition.TabIndex = 287;
...@@ -619,7 +620,7 @@ ...@@ -619,7 +620,7 @@
this.chbShowName.Checked = true; this.chbShowName.Checked = true;
this.chbShowName.CheckState = System.Windows.Forms.CheckState.Checked; this.chbShowName.CheckState = System.Windows.Forms.CheckState.Checked;
this.chbShowName.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.chbShowName.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbShowName.Location = new System.Drawing.Point(902, 593); this.chbShowName.Location = new System.Drawing.Point(902, 576);
this.chbShowName.Name = "chbShowName"; this.chbShowName.Name = "chbShowName";
this.chbShowName.Size = new System.Drawing.Size(75, 21); this.chbShowName.Size = new System.Drawing.Size(75, 21);
this.chbShowName.TabIndex = 280; this.chbShowName.TabIndex = 280;
...@@ -635,7 +636,7 @@ ...@@ -635,7 +636,7 @@
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.焊点列表.Location = new System.Drawing.Point(4, 108); this.焊点列表.Location = new System.Drawing.Point(4, 108);
this.焊点列表.Name = "焊点列表"; this.焊点列表.Name = "焊点列表";
this.焊点列表.Size = new System.Drawing.Size(624, 474); this.焊点列表.Size = new System.Drawing.Size(624, 457);
this.焊点列表.TabIndex = 286; this.焊点列表.TabIndex = 286;
this.焊点列表.TabStop = false; this.焊点列表.TabStop = false;
this.焊点列表.Text = "组装信息(使用键盘上的上下键可更改选中行)"; this.焊点列表.Text = "组装信息(使用键盘上的上下键可更改选中行)";
...@@ -685,7 +686,7 @@ ...@@ -685,7 +686,7 @@
this.dgvList.RowHeadersWidth = 30; this.dgvList.RowHeadersWidth = 30;
this.dgvList.RowTemplate.Height = 23; this.dgvList.RowTemplate.Height = 23;
this.dgvList.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.dgvList.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgvList.Size = new System.Drawing.Size(616, 448); this.dgvList.Size = new System.Drawing.Size(616, 431);
this.dgvList.TabIndex = 31; this.dgvList.TabIndex = 31;
this.dgvList.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick); this.dgvList.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick);
this.dgvList.CellMouseDown += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dgvList_CellMouseDown); this.dgvList.CellMouseDown += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dgvList_CellMouseDown);
...@@ -968,7 +969,7 @@ ...@@ -968,7 +969,7 @@
this.panel3.Controls.Add(this.panBoard); this.panel3.Controls.Add(this.panBoard);
this.panel3.Location = new System.Drawing.Point(646, 123); this.panel3.Location = new System.Drawing.Point(646, 123);
this.panel3.Name = "panel3"; this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(812, 459); this.panel3.Size = new System.Drawing.Size(819, 442);
this.panel3.TabIndex = 277; this.panel3.TabIndex = 277;
// //
// panBoard // panBoard
...@@ -978,7 +979,7 @@ ...@@ -978,7 +979,7 @@
this.panBoard.Dock = System.Windows.Forms.DockStyle.Fill; this.panBoard.Dock = System.Windows.Forms.DockStyle.Fill;
this.panBoard.Location = new System.Drawing.Point(0, 0); this.panBoard.Location = new System.Drawing.Point(0, 0);
this.panBoard.Name = "panBoard"; this.panBoard.Name = "panBoard";
this.panBoard.Size = new System.Drawing.Size(812, 459); this.panBoard.Size = new System.Drawing.Size(819, 442);
this.panBoard.TabIndex = 261; this.panBoard.TabIndex = 261;
this.panBoard.Paint += new System.Windows.Forms.PaintEventHandler(this.panBoard_Paint); this.panBoard.Paint += new System.Windows.Forms.PaintEventHandler(this.panBoard_Paint);
// //
...@@ -1103,7 +1104,7 @@ ...@@ -1103,7 +1104,7 @@
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.button1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button1.Location = new System.Drawing.Point(605, 588); this.button1.Location = new System.Drawing.Point(605, 571);
this.button1.Name = "button1"; this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(120, 45); this.button1.Size = new System.Drawing.Size(120, 45);
this.button1.TabIndex = 41; this.button1.TabIndex = 41;
...@@ -1116,7 +1117,7 @@ ...@@ -1116,7 +1117,7 @@
this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 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(480, 588); this.btnSave.Location = new System.Drawing.Point(480, 571);
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 = 40; this.btnSave.TabIndex = 40;
...@@ -1134,9 +1135,21 @@ ...@@ -1134,9 +1135,21 @@
this.panel2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; this.panel2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.panel2.Location = new System.Drawing.Point(631, 106); this.panel2.Location = new System.Drawing.Point(631, 106);
this.panel2.Name = "panel2"; this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(827, 474); this.panel2.Size = new System.Drawing.Size(834, 457);
this.panel2.TabIndex = 292; this.panel2.TabIndex = 292;
// //
// chbMPoint
//
this.chbMPoint.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.chbMPoint.AutoSize = true;
this.chbMPoint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbMPoint.Location = new System.Drawing.Point(560, 23);
this.chbMPoint.Name = "chbMPoint";
this.chbMPoint.Size = new System.Drawing.Size(111, 21);
this.chbMPoint.TabIndex = 287;
this.chbMPoint.Text = "多点位投影功能";
this.chbMPoint.UseVisualStyleBackColor = true;
//
// FrmBoardInfo // FrmBoardInfo
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
...@@ -1266,5 +1279,6 @@ ...@@ -1266,5 +1279,6 @@
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.Button btnMPCbMode; private System.Windows.Forms.Button btnMPCbMode;
private System.Windows.Forms.CheckBox chbMPoint;
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -284,7 +284,7 @@ namespace TSA_V ...@@ -284,7 +284,7 @@ namespace TSA_V
dgvList.Rows.Add(setPointInfo(null, point)); dgvList.Rows.Add(setPointInfo(null, point));
} }
} }
chbMPoint.Checked = updateBoardInfo.mPointsProjection;
} }
private DataGridViewRow setPointInfo(DataGridViewRow view, SMTPointInfo point) private DataGridViewRow setPointInfo(DataGridViewRow view, SMTPointInfo point)
...@@ -566,6 +566,7 @@ namespace TSA_V ...@@ -566,6 +566,7 @@ namespace TSA_V
board.LineWidth = FormUtil.GetIntValue(txtLineWidth); board.LineWidth = FormUtil.GetIntValue(txtLineWidth);
board.PointColor = btnColorChange.BackColor.ToArgb(); board.PointColor = btnColorChange.BackColor.ToArgb();
board.boardCode = FormUtil.getValue(txtCode); board.boardCode = FormUtil.getValue(txtCode);
board.mPointsProjection = chbMPoint.Checked;
board.orgType = orgType; board.orgType = orgType;
if (cmbAOIFile.SelectedIndex == 0) if (cmbAOIFile.SelectedIndex == 0)
board.AOIProName = ""; board.AOIProName = "";
...@@ -1560,8 +1561,10 @@ namespace TSA_V ...@@ -1560,8 +1561,10 @@ namespace TSA_V
if (updateBoardInfo.PointColor != btnColorChange.BackColor.ToArgb()) if (updateBoardInfo.PointColor != btnColorChange.BackColor.ToArgb())
{ {
updateBoardInfo.PointColor = btnColorChange.BackColor.ToArgb(); updateBoardInfo.PointColor = btnColorChange.BackColor.ToArgb();
FrmProjectorScreen.instance.ClearPoint(); //FrmProjectorScreen.instance.ClearPoint();
FrmProjectorScreen.instance.ShowPoint(false, updateBoardInfo.PointColor, allPointInfo().ToArray()); //FrmProjectorScreen.instance.ShowPoint(false, updateBoardInfo.PointColor, allPointInfo().ToArray());
FrmProjectorScreen.instance.ShowAreaAndPoint(updateBoardInfo, false, allPointInfo().ToArray());
BoardManager.Update(updateBoardInfo); BoardManager.Update(updateBoardInfo);
} }
} }
...@@ -1601,8 +1604,10 @@ namespace TSA_V ...@@ -1601,8 +1604,10 @@ namespace TSA_V
} }
SetListCurrCell(index); SetListCurrCell(index);
FrmProjectorScreen.instance.ClearPoint(); //FrmProjectorScreen.instance.ClearPoint();
FrmProjectorScreen.instance.ShowPoint(false, updateBoardInfo.PointColor, updateBoardInfo.smtList.ToArray()); //FrmProjectorScreen.instance.ShowPoint(false, updateBoardInfo.PointColor, updateBoardInfo.smtList.ToArray());
FrmProjectorScreen.instance.ShowAreaAndPoint(updateBoardInfo, false, updateBoardInfo.smtList.ToArray());
this.Cursor = Cursors.Default; this.Cursor = Cursors.Default;
//重新加载 //重新加载
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.TrainOK, "坐标校准完成!")); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.TrainOK, "坐标校准完成!"));
......
...@@ -129,7 +129,9 @@ namespace TSA_V ...@@ -129,7 +129,9 @@ namespace TSA_V
LoadPoint(board); LoadPoint(board);
loadPictureBoxSize(board); loadPictureBoxSize(board);
FrmProjectorScreen.instance.ShowPoint(false,board.PointColor, board.smtList.ToArray()); //FrmProjectorScreen.instance.ShowPoint(false,board.PointColor, board.smtList.ToArray());
FrmProjectorScreen.instance.ShowAreaAndPoint(board, false, board.smtList.ToArray());
} }
} }
......
...@@ -273,8 +273,10 @@ namespace TSA_V.frmBoard ...@@ -273,8 +273,10 @@ namespace TSA_V.frmBoard
currBoard.calInfo.CurrStep = 3; currBoard.calInfo.CurrStep = 3;
currBoard.smtList = pointList; currBoard.smtList = pointList;
BoardManager.Update(currBoard); BoardManager.Update(currBoard);
FrmProjectorScreen.instance.ClearPoint(); //FrmProjectorScreen.instance.ClearPoint();
FrmProjectorScreen.instance.ShowPoint(false, currBoard.PointColor, pointList.ToArray()); //FrmProjectorScreen.instance.ShowPoint(false, currBoard.PointColor, pointList.ToArray());
FrmProjectorScreen.instance.ShowAreaAndPoint(currBoard, false, pointList.ToArray());
this.Cursor = Cursors.Default; this.Cursor = Cursors.Default;
//重新加载 //重新加载
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.TrainOK, "坐标校准完成!")); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.TrainOK, "坐标校准完成!"));
......
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.btnTest = new System.Windows.Forms.Button(); this.btnTest = new System.Windows.Forms.Button();
this.groupCopy = new System.Windows.Forms.GroupBox(); this.groupCopy = new System.Windows.Forms.GroupBox();
this.numCol = new System.Windows.Forms.NumericUpDown();
this.numRow = new System.Windows.Forms.NumericUpDown();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label();
...@@ -47,16 +49,11 @@ ...@@ -47,16 +49,11 @@
this.label7 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label();
this.btnClose = new System.Windows.Forms.Button(); this.btnClose = new System.Windows.Forms.Button();
this.btnSave = new System.Windows.Forms.Button(); this.btnSave = new System.Windows.Forms.Button();
this.numRow = new System.Windows.Forms.NumericUpDown();
this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
this.numCol = new System.Windows.Forms.NumericUpDown();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.groupCopy.SuspendLayout(); this.groupCopy.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numRow)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numCol)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numCol)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numRow)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// dataGridViewImageColumn1 // dataGridViewImageColumn1
...@@ -105,7 +102,6 @@ ...@@ -105,7 +102,6 @@
this.tableLayoutPanel1.ColumnCount = 1; this.tableLayoutPanel1.ColumnCount = 1;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.Controls.Add(this.numericUpDown1, 0, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 17); this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 17);
this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.Name = "tableLayoutPanel1";
...@@ -114,6 +110,7 @@ ...@@ -114,6 +110,7 @@
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(821, 314); this.tableLayoutPanel1.Size = new System.Drawing.Size(821, 314);
this.tableLayoutPanel1.TabIndex = 0; this.tableLayoutPanel1.TabIndex = 0;
this.tableLayoutPanel1.Tag = "SKIPUIPRO";
// //
// btnTest // btnTest
// //
...@@ -142,21 +139,65 @@ ...@@ -142,21 +139,65 @@
this.groupCopy.Controls.Add(this.label11); this.groupCopy.Controls.Add(this.label11);
this.groupCopy.Controls.Add(this.label7); this.groupCopy.Controls.Add(this.label7);
this.groupCopy.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.groupCopy.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupCopy.Location = new System.Drawing.Point(12, 21); this.groupCopy.Location = new System.Drawing.Point(12, 12);
this.groupCopy.Name = "groupCopy"; this.groupCopy.Name = "groupCopy";
this.groupCopy.Size = new System.Drawing.Size(827, 137); this.groupCopy.Size = new System.Drawing.Size(827, 149);
this.groupCopy.TabIndex = 292; this.groupCopy.TabIndex = 292;
this.groupCopy.TabStop = false; this.groupCopy.TabStop = false;
// //
// numCol
//
this.numCol.Location = new System.Drawing.Point(156, 60);
this.numCol.Maximum = new decimal(new int[] {
10,
0,
0,
0});
this.numCol.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numCol.Name = "numCol";
this.numCol.Size = new System.Drawing.Size(95, 23);
this.numCol.TabIndex = 306;
this.numCol.Value = new decimal(new int[] {
1,
0,
0,
0});
//
// numRow
//
this.numRow.Location = new System.Drawing.Point(156, 23);
this.numRow.Maximum = new decimal(new int[] {
10,
0,
0,
0});
this.numRow.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numRow.Name = "numRow";
this.numRow.Size = new System.Drawing.Size(95, 23);
this.numRow.TabIndex = 305;
this.numRow.Value = new decimal(new int[] {
1,
0,
0,
0});
//
// label1 // label1
// //
this.label1.AutoSize = true;
this.label1.ForeColor = System.Drawing.Color.Red; this.label1.ForeColor = System.Drawing.Color.Red;
this.label1.Location = new System.Drawing.Point(108, 103); this.label1.Location = new System.Drawing.Point(4, 119);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(191, 17); this.label1.Size = new System.Drawing.Size(815, 17);
this.label1.TabIndex = 304; this.label1.TabIndex = 304;
this.label1.Text = "*多PCB模式时,PCB必须均匀放置"; this.label1.Text = "点击下方PCB块可设置其相对PCB1的偏移(单位:mm)。未设置则按上方行/列间距均匀排布";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// label3 // label3
// //
...@@ -264,57 +305,6 @@ ...@@ -264,57 +305,6 @@
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);
// //
// numRow
//
this.numRow.Location = new System.Drawing.Point(156, 23);
this.numRow.Maximum = new decimal(new int[] {
10,
0,
0,
0});
this.numRow.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numRow.Name = "numRow";
this.numRow.Size = new System.Drawing.Size(95, 23);
this.numRow.TabIndex = 305;
this.numRow.Value = new decimal(new int[] {
1,
0,
0,
0});
//
// numericUpDown1
//
this.numericUpDown1.Location = new System.Drawing.Point(3, 3);
this.numericUpDown1.Name = "numericUpDown1";
this.numericUpDown1.Size = new System.Drawing.Size(120, 21);
this.numericUpDown1.TabIndex = 0;
//
// numCol
//
this.numCol.Location = new System.Drawing.Point(156, 60);
this.numCol.Maximum = new decimal(new int[] {
10,
0,
0,
0});
this.numCol.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numCol.Name = "numCol";
this.numCol.Size = new System.Drawing.Size(95, 23);
this.numCol.TabIndex = 306;
this.numCol.Value = new decimal(new int[] {
1,
0,
0,
0});
//
// FrmMPcbConfig // FrmMPcbConfig
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
...@@ -324,15 +314,13 @@ ...@@ -324,15 +314,13 @@
this.Name = "FrmMPcbConfig"; this.Name = "FrmMPcbConfig";
this.Text = "多PCB模式配置"; this.Text = "多PCB模式配置";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmBoardInfo_FormClosing); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmBoardInfo_FormClosing);
this.Load += new System.EventHandler(this.FrmBoardInfo_Load); this.Shown += new System.EventHandler(this.FrmBoardInfo_Shown);
this.panel1.ResumeLayout(false); this.panel1.ResumeLayout(false);
this.groupBox1.ResumeLayout(false); this.groupBox1.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
this.groupCopy.ResumeLayout(false); this.groupCopy.ResumeLayout(false);
this.groupCopy.PerformLayout(); this.groupCopy.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numRow)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numCol)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numCol)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numRow)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
} }
...@@ -356,7 +344,6 @@ ...@@ -356,7 +344,6 @@
private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label1;
private System.Windows.Forms.NumericUpDown numericUpDown1;
private System.Windows.Forms.NumericUpDown numCol; private System.Windows.Forms.NumericUpDown numCol;
private System.Windows.Forms.NumericUpDown numRow; private System.Windows.Forms.NumericUpDown numRow;
} }
......
 
using log4net; using log4net;
using NPOI.Util;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
...@@ -26,6 +27,8 @@ namespace TSA_V ...@@ -26,6 +27,8 @@ namespace TSA_V
InitializeComponent(); InitializeComponent();
CheckForIllegalCrossThreadCalls = false; CheckForIllegalCrossThreadCalls = false;
LanguagePro(); LanguagePro();
// 确保打开对话框时立即加载并显示正确的网格文本
//try { LoadBoardInfo(); } catch {}
} }
public void LoadForm() public void LoadForm()
{ {
...@@ -38,7 +41,7 @@ namespace TSA_V ...@@ -38,7 +41,7 @@ namespace TSA_V
} }
private void FrmBoardInfo_Load(object sender, EventArgs e) private void FrmBoardInfo_Shown(object sender, EventArgs e)
{ {
LoadBoardInfo(); LoadBoardInfo();
} }
...@@ -50,17 +53,44 @@ namespace TSA_V ...@@ -50,17 +53,44 @@ namespace TSA_V
try try
{ {
// 使用已有配置填充界面 // 使用已有配置填充界面
numRow.Text = (currBoardInfo.pcbRow > 0 ? currBoardInfo.pcbRow : 1).ToString(); numRow.Value = (currBoardInfo.pcbRow > 0 ? currBoardInfo.pcbRow : 1);
numCol.Text = (currBoardInfo.pcbCol > 0 ? currBoardInfo.pcbCol : 1).ToString(); numCol.Value = (currBoardInfo.pcbCol > 0 ? currBoardInfo.pcbCol : 1);
txtRowS.Text = (currBoardInfo.pcbRowValue > 0 ? currBoardInfo.pcbRowValue : 1).ToString(); txtRowS.Text = (currBoardInfo.pcbRowValue > 0 ? currBoardInfo.pcbRowValue : 1).ToString();
txtColS.Text = (currBoardInfo.pcbColValue > 0 ? currBoardInfo.pcbColValue : 1).ToString(); txtColS.Text = (currBoardInfo.pcbColValue > 0 ? currBoardInfo.pcbColValue : 1).ToString();
// 更新提示文案:可单独设置相对偏移
try { label1.Text = ResourceControl.GetString("MPCBTips" ,"*点击下方PCB块可设置其相对PCB1的偏移(单位:mm)。未设置则按上方行/列间距均匀排布"); } catch { }
// 打开界面时,根据当前行列值模拟显示 // 打开界面时,根据当前行列值模拟显示
int rows =(int)numRow.Value; int rows =(int)numRow.Value;
int cols = (int)numCol.Value; int cols = (int)numCol.Value;
if (rows < 1) rows = 1; if (rows < 1) rows = 1;
if (cols < 1) cols = 1; if (cols < 1) cols = 1;
SimulatePcbGrid(rows, cols); //SimulatePcbGrid(rows, cols);
try
{
if (FrmProjectorScreen.instance != null)
{
//List<SMTPointInfo> pointList = XYConvertManager.GetCopyPointCR(currBoardInfo);
//FrmProjectorScreen.instance.ShowPoint(false, currBoardInfo.PointColor, pointList.ToArray());
FrmProjectorScreen.instance.ShowAreaAndPoint(currBoardInfo,false, currBoardInfo.GetSmtList().ToArray());
}
}
catch (Exception ex)
{
LogUtil.info("测试投影效果失败: " + ex.Message);
}
try
{
SimulatePcbGrid(rows, cols,currBoardInfo.pcbRowValue,currBoardInfo.pcbColValue);
}
catch (Exception ex)
{
LogUtil.info("模拟PCB布局失败: " + ex.Message);
}
} }
catch (Exception ex) catch (Exception ex)
{ {
...@@ -93,7 +123,7 @@ namespace TSA_V ...@@ -93,7 +123,7 @@ namespace TSA_V
{ {
if (currBoardInfo == null) if (currBoardInfo == null)
{ {
MessageBox.Show("板卡信息为空,无法保存。"); MessageBox.Show(ResourceControl.GetString("BoardNull", "板卡信息为空,无法测试。"));
return; return;
} }
...@@ -190,45 +220,20 @@ namespace TSA_V ...@@ -190,45 +220,20 @@ namespace TSA_V
// 安全获取校准点,若未校准则按原点位直接使用 // 安全获取校准点,若未校准则按原点位直接使用
List<SMTPointInfo> pointList = XYConvertManager.GetCopyPointCR(currBoardInfo,null,pcbRow, pcbCol, pcbRowValue, pcbColValue);
//List<SMTPointInfo> pointList = new List<SMTPointInfo>();
//pointList.AddRange(currBoardInfo.smtList);
//int baseCount = currBoardInfo.smtList.Count;
//string msg = "";
//for (int currR = 1; currR <= pcbRow; currR++)
//{
// for (int currC = 1; currC <= pcbCol; currC++)
// {
// int index = (currR - 1) * pcbCol + currC;
// if (index == 1) continue; // PCB1 为基准
// foreach (SMTPointInfo point in currBoardInfo.smtList)
// {
// SMTPointInfo newPoint = new SMTPointInfo(point);
// newPoint.pointNum = baseCount + point.pointNum;
// newPoint.PositionX = newPoint.PositionX + (currC - 1) * pcbColValue;
// newPoint.PositionY = newPoint.PositionY + (currR - 1) * pcbRowValue;
// newPoint.Group = index;
// newPoint.TagNo = point.TagNo + "-" + index;
// newPoint.PointSizeX = point.PointSizeX;
// newPoint.CheckOK = false;
// if (checkOKList != null)
// {
// try { newPoint = XYConvertManager.CalPointNodePosition(newPoint, checkOKList); } catch { }
// }
// msg += "\r\n" + point.pointName + "_" + point.PN + $",更改组={index} , X={newPoint.PositionX},Y={newPoint.PositionY},投影X={newPoint.NodePositionX},投影Y={newPoint.NodePositionY}";
// pointList.Add(newPoint);
// }
// }
//}
try try
{ {
if (FrmProjectorScreen.instance != null) if (FrmProjectorScreen.instance != null)
{ {
FrmProjectorScreen.instance.ShowPoint(false, currBoardInfo.PointColor, pointList.ToArray()); BoardInfo board = currBoardInfo.Copy();
board.pcbRow = pcbRow;
board.pcbCol = pcbCol;
board.pcbRowValue = pcbRowValue;
board.pcbColValue = pcbColValue;
FrmProjectorScreen.instance.ShowAreaAndPoint(board, true );
//List<SMTPointInfo> pointList = XYConvertManager.GetCopyPointCR(currBoardInfo, null, pcbRow, pcbCol, pcbRowValue, pcbColValue);
//FrmProjectorScreen.instance.ShowPoint(false, currBoardInfo.PointColor, pointList.ToArray());
} }
} }
catch(Exception ex) catch(Exception ex)
...@@ -238,7 +243,7 @@ namespace TSA_V ...@@ -238,7 +243,7 @@ namespace TSA_V
try try
{ {
SimulatePcbGrid(pcbRow, pcbCol); SimulatePcbGrid(pcbRow, pcbCol,pcbRowValue,pcbColValue);
} }
catch (Exception ex) catch (Exception ex)
{ {
...@@ -246,7 +251,7 @@ namespace TSA_V ...@@ -246,7 +251,7 @@ namespace TSA_V
} }
} }
private void SimulatePcbGrid(int rows, int cols) private void SimulatePcbGrid(int rows, int cols,int pcbRowValue,int pcbColValue)
{ {
if (tableLayoutPanel1 == null) return; if (tableLayoutPanel1 == null) return;
tableLayoutPanel1.SuspendLayout(); tableLayoutPanel1.SuspendLayout();
...@@ -275,33 +280,66 @@ namespace TSA_V ...@@ -275,33 +280,66 @@ namespace TSA_V
Color refBack = Color.FromArgb(255, 255, 230, 200); // 淡橙(基准) Color refBack = Color.FromArgb(255, 255, 230, 200); // 淡橙(基准)
Color refFore = Color.FromArgb(120, 60, 0); Color refFore = Color.FromArgb(120, 60, 0);
// 读取行/列间距,作为默认偏移计算依据
//int colGap = FormUtil.GetIntValue(txtColS);
//if (colGap <= 0) colGap = currBoardInfo != null && currBoardInfo.pcbColValue > 0 ? currBoardInfo.pcbColValue : 1;
//int rowGap = FormUtil.GetIntValue(txtRowS);
//if (rowGap <= 0) rowGap = currBoardInfo != null && currBoardInfo.pcbRowValue > 0 ? currBoardInfo.pcbRowValue : 1;
for (int r = 0; r < rows; r++) for (int r = 0; r < rows; r++)
{ {
for (int c = 0; c < cols; c++) for (int c = 0; c < cols; c++)
{ {
int index = r * cols + c + 1; int index = r * cols + c + 1;
Label lbl = new Label(); // 计算默认偏移(均匀排布)
lbl.Dock = DockStyle.Fill; int defDx = c * pcbColValue;
lbl.TextAlign = ContentAlignment.MiddleCenter; int defDy = r * pcbRowValue;
lbl.Margin = new Padding(6); // 如果有单独设置,则使用已设置的值
lbl.AutoSize = false; int showDx = defDx;
lbl.Font = new Font("微软雅黑", 12f, FontStyle.Bold); int showDy = defDy;
lbl.Text = "PCB" + index; try
{
if (currBoardInfo != null)
{
var p = currBoardInfo.GetPCBOffsetPoint(index);
if (index == 1)
{
showDx = 0; showDy = 0; // PCB1 固定为(0,0)
}
else if (p.X != 0 || p.Y != 0)
{
showDx = p.X; showDy = p.Y;
}
}
}
catch { }
Label lblPcbInfo = new Label();
lblPcbInfo.Dock = DockStyle.Fill;
lblPcbInfo.TextAlign = ContentAlignment.MiddleCenter;
lblPcbInfo.Margin = new Padding(6);
lblPcbInfo.AutoSize = false;
lblPcbInfo.Font = new Font("微软雅黑", 12f, FontStyle.Bold);
lblPcbInfo.Text = $"PCB{index}({showDx},{showDy})";
lblPcbInfo.Tag = index;
lblPcbInfo.Cursor = Cursors.Hand;
lblPcbInfo.Click += LabelPcb_Click;
if (index == 1) if (index == 1)
{ {
lbl.BackColor = refBack; lblPcbInfo.BackColor = refBack;
lbl.ForeColor = refFore; lblPcbInfo.ForeColor = refFore;
lbl.BorderStyle = BorderStyle.FixedSingle; lblPcbInfo.BorderStyle = BorderStyle.FixedSingle;
lblPcbInfo.Cursor = Cursors.No;
} }
else else
{ {
lbl.BackColor = baseBack; lblPcbInfo.BackColor = baseBack;
lbl.ForeColor = baseFore; lblPcbInfo.ForeColor = baseFore;
lbl.BorderStyle = BorderStyle.FixedSingle; lblPcbInfo.BorderStyle = BorderStyle.FixedSingle;
} }
tableLayoutPanel1.Controls.Add(lbl, c, r); tableLayoutPanel1.Controls.Add(lblPcbInfo, c, r);
} }
} }
} }
...@@ -310,6 +348,82 @@ namespace TSA_V ...@@ -310,6 +348,82 @@ namespace TSA_V
tableLayoutPanel1.ResumeLayout(); tableLayoutPanel1.ResumeLayout();
} }
} }
private void LabelPcb_Click(object sender, EventArgs e)
{
try
{
var lbl = sender as Label;
if (lbl == null) return;
int index = (int)lbl.Tag;
if (index == 1)
{
MessageBox.Show(ResourceControl.GetString("Pcb1Fixed", "PCB1作为基准,偏移固定为(0,0)。", ResourceCulture.GetString("MsgTitle", "提示"), MessageBoxButtons.OK, MessageBoxIcon.Information));
return;
}
// 计算当前默认偏移:若已有单独设置则用已设置值,否则按行列间距均匀排布
int rows = (int)numRow.Value;
int cols = (int)numCol.Value;
int colGap = FormUtil.GetIntValue(txtColS);
if (colGap <= 0) colGap = currBoardInfo != null && currBoardInfo.pcbColValue > 0 ? currBoardInfo.pcbColValue : 1;
int rowGap = FormUtil.GetIntValue(txtRowS);
if (rowGap <= 0) rowGap = currBoardInfo != null && currBoardInfo.pcbRowValue > 0 ? currBoardInfo.pcbRowValue : 1;
int r0 = (index - 1) / Math.Max(1, cols);
int c0 = (index - 1) % Math.Max(1, cols);
int defDx = c0 * colGap;
int defDy = r0 * rowGap;
int currDx = defDx;
int currDy = defDy;
try
{
var p = currBoardInfo.GetPCBOffsetPoint(index);
if (p.X != 0 || p.Y != 0)
{
currDx = p.X;
currDy = p.Y;
}
}
catch { }
using (var dlg = new TSA_V.frmBoard.FrmPCbOffsetConfig(index, currDx, currDy))
{
if (dlg.ShowDialog(this) == DialogResult.OK)
{
int x = dlg.OffsetX;
int y = dlg.OffsetY;
currBoardInfo.SetPCBOffset(index, new Point(x, y));
// 更新标签显示
lbl.Text = $"PCB{index}({x},{y})";
try
{
if (FrmProjectorScreen.instance != null)
{
//List<SMTPointInfo> pointList = XYConvertManager.GetCopyPointCR(currBoardInfo, null, rows, cols, rowGap, colGap);
//FrmProjectorScreen.instance.ShowPoint(false, currBoardInfo.PointColor, pointList.ToArray());
BoardInfo board = currBoardInfo.Copy() ;
board.pcbRow = rows;
board.pcbCol = cols;
board.pcbRowValue = rowGap;
board.pcbColValue = colGap;
FrmProjectorScreen.instance.ShowAreaAndPoint(board, true);
}
}
catch (Exception ex)
{
LogUtil.info("测试投影效果失败: " + ex.Message);
}
}
}
}
catch (Exception ex)
{
LogUtil.info("编辑PCB偏移失败:" + ex.Message);
}
}
} }
......
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace TSA_V.frmBoard
{
partial class FrmPCbOffsetConfig
{
private IContainer components = null;
private Label labelX;
private Label labelY;
private NumericUpDown numX;
private NumericUpDown numY;
private Button btnOK;
private Button btnCancel;
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.labelX = new System.Windows.Forms.Label();
this.labelY = new System.Windows.Forms.Label();
this.numX = new System.Windows.Forms.NumericUpDown();
this.numY = new System.Windows.Forms.NumericUpDown();
this.btnOK = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.numX)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numY)).BeginInit();
this.SuspendLayout();
//
// labelX
//
this.labelX.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.labelX.Location = new System.Drawing.Point(52, 29);
this.labelX.Name = "labelX";
this.labelX.Size = new System.Drawing.Size(100, 24);
this.labelX.TabIndex = 0;
this.labelX.Text = "X偏移(mm):";
this.labelX.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// labelY
//
this.labelY.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.labelY.Location = new System.Drawing.Point(52, 65);
this.labelY.Name = "labelY";
this.labelY.Size = new System.Drawing.Size(100, 24);
this.labelY.TabIndex = 2;
this.labelY.Text = "Y偏移(mm):";
this.labelY.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// numX
//
this.numX.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.numX.Location = new System.Drawing.Point(158, 27);
this.numX.Maximum = new decimal(new int[] {
100000,
0,
0,
0});
this.numX.Minimum = new decimal(new int[] {
100000,
0,
0,
-2147483648});
this.numX.Name = "numX";
this.numX.Size = new System.Drawing.Size(160, 23);
this.numX.TabIndex = 1;
//
// numY
//
this.numY.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.numY.Location = new System.Drawing.Point(158, 65);
this.numY.Maximum = new decimal(new int[] {
100000,
0,
0,
0});
this.numY.Minimum = new decimal(new int[] {
100000,
0,
0,
-2147483648});
this.numY.Name = "numY";
this.numY.Size = new System.Drawing.Size(160, 23);
this.numY.TabIndex = 3;
//
// btnOK
//
this.btnOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOK.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOK.Location = new System.Drawing.Point(55, 110);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(125, 39);
this.btnOK.TabIndex = 4;
this.btnOK.Text = "确定";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
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(186, 110);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(125, 39);
this.btnCancel.TabIndex = 5;
this.btnCancel.Text = "取消";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// FrmPCbOffsetConfig
//
this.AcceptButton = this.btnOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(371, 170);
this.Controls.Add(this.labelX);
this.Controls.Add(this.numX);
this.Controls.Add(this.labelY);
this.Controls.Add(this.numY);
this.Controls.Add(this.btnOK);
this.Controls.Add(this.btnCancel);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "FrmPCbOffsetConfig";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Load += new System.EventHandler(this.FrmPCbOffsetConfig_Load);
this.Shown += new System.EventHandler(this.FrmPCbOffsetConfig_Shown);
((System.ComponentModel.ISupportInitialize)(this.numX)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numY)).EndInit();
this.ResumeLayout(false);
}
}
}
\ No newline at end of file \ No newline at end of file
using System;
using System.Windows.Forms;
namespace TSA_V.frmBoard
{
public partial class FrmPCbOffsetConfig : FrmBase
{
public int OffsetX { get; private set; }
public int OffsetY { get; private set; }
private readonly int pcbIndex;
private readonly int defaultX;
private readonly int defaultY;
public FrmPCbOffsetConfig(int pcbIndex, int defaultX, int defaultY)
{
this.pcbIndex = pcbIndex;
this.defaultX = defaultX;
this.defaultY = defaultY;
InitializeComponent();
this.Text = ResourceControl.GetString("FrmPCbOffsetConfig_Text", "设置 PCB{0} 相对偏移(mm)", pcbIndex+"");
// 初始化控件默认值
try
{
numX.Value = defaultX;
numY.Value = defaultY;
}
catch { }
}
private void btnOK_Click(object sender, EventArgs e)
{
OffsetX = (int)numX.Value;
OffsetY = (int)numY.Value;
this.DialogResult = DialogResult.OK;
this.Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
private void FrmPCbOffsetConfig_Load(object sender, EventArgs e)
{
}
private void FrmPCbOffsetConfig_Shown(object sender, EventArgs e)
{
this.Text = ResourceControl.GetString("FrmPCbOffsetConfig_Text", "设置 PCB{0} 相对偏移(mm)", pcbIndex + "");
}
}
}
\ No newline at end of file \ No newline at end of file
<?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>
</root>
\ No newline at end of file \ No newline at end of file
using log4net.Filter; using log4net.Filter;
using System; using System;
using System.CodeDom; using System.CodeDom;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -232,8 +232,22 @@ namespace TSA_V ...@@ -232,8 +232,22 @@ namespace TSA_V
{ {
SMTPointInfo newPoint = new SMTPointInfo(point); SMTPointInfo newPoint = new SMTPointInfo(point);
newPoint.pointNum = baseCount + point.pointNum; newPoint.pointNum = baseCount + point.pointNum;
newPoint.PositionX = newPoint.PositionX + (currC - 1) * pcbColValue; // 默认按均匀间距计算
newPoint.PositionY = newPoint.PositionY + (currR - 1) * pcbRowValue; int dx = (currC - 1) * pcbColValue;
int dy = (currR - 1) * pcbRowValue;
// 若设置了某个PCB相对PCB1的偏移,则覆盖默认值
try
{
if (board.mPCbOffsetMap != null && board.mPCbOffsetMap.ContainsKey(index))
{
var pOffset = board.mPCbOffsetMap[index];
dx = pOffset.X;
dy = pOffset.Y;
}
}
catch { }
newPoint.PositionX = newPoint.PositionX + dx;
newPoint.PositionY = newPoint.PositionY + dy;
newPoint.Group = index; newPoint.Group = index;
newPoint.TagNo = point.TagNo + "-" + index; newPoint.TagNo = point.TagNo + "-" + index;
newPoint.PointSizeX = point.PointSizeX; newPoint.PointSizeX = point.PointSizeX;
......
...@@ -104,7 +104,7 @@ namespace TSA_V ...@@ -104,7 +104,7 @@ namespace TSA_V
panAoi.BackColor = Color.Black; panAoi.BackColor = Color.Black;
panAoi.Visible = false; panAoi.Visible = false;
} }
public void DrawArea() private void DrawArea()
{ {
if (!ISShow) if (!ISShow)
{ {
...@@ -151,64 +151,65 @@ namespace TSA_V ...@@ -151,64 +151,65 @@ namespace TSA_V
} }
grfx.Dispose(); grfx.Dispose();
} }
public void DrawLine() //public void DrawLine()
{ //{
if (!ISShow) // if (!ISShow)
{ // {
return; // return;
} // }
int startX = 0; // int startX = 0;
int startY = 0; // int startY = 0;
int Point_X_Length = 21; // int Point_X_Length = 21;
int Point_Y_Length = 21; // int Point_Y_Length = 21;
int lineWidth = (BoundsWidth - startX * 2) / (Point_X_Length - 1); // int lineWidth = (BoundsWidth - startX * 2) / (Point_X_Length - 1);
int lineHeight = (BoundsHeight - startY * 2) / (Point_Y_Length - 1); // int lineHeight = (BoundsHeight - startY * 2) / (Point_Y_Length - 1);
Graphics grfx = panel1.CreateGraphics(); // Graphics grfx = panel1.CreateGraphics();
Color color = Color.White; // Color color = Color.White;
grfx.SmoothingMode = SmoothingMode.HighQuality; // grfx.SmoothingMode = SmoothingMode.HighQuality;
//循环画线 // //循环画线
for (int i = 0; i <= Point_X_Length; i++) // for (int i = 0; i <= Point_X_Length; i++)
{ // {
float line = 0.2F; // float line = 0.2F;
float picLocationX = startX + lineWidth * i; // float picLocationX = startX + lineWidth * i;
if (i.Equals(Point_X_Length / 2)) // if (i.Equals(Point_X_Length / 2))
{ // {
line = 1; // line = 1;
} // }
else if (((i % 5).Equals(0)) && (i > 0) && (i < Point_X_Length)) // else if (((i % 5).Equals(0)) && (i > 0) && (i < Point_X_Length))
{ // {
line = 0.5F; // line = 0.5F;
} // }
grfx.DrawLine(new Pen(color, line), picLocationX, startY, picLocationX, BoundsHeight); // grfx.DrawLine(new Pen(color, line), picLocationX, startY, picLocationX, BoundsHeight);
} // }
for (int i = 0; i <= Point_Y_Length; i++) // for (int i = 0; i <= Point_Y_Length; i++)
{ // {
float line = 0.2F; // float line = 0.2F;
float picLocationY = startY + lineHeight * i; // float picLocationY = startY + lineHeight * i;
if (i.Equals(Point_Y_Length / 2)) // if (i.Equals(Point_Y_Length / 2))
{ // {
line = 1; // line = 1;
} // }
else if (((i % 5).Equals(0)) && (i > 0) && (i < Point_Y_Length)) // else if (((i % 5).Equals(0)) && (i > 0) && (i < Point_Y_Length))
{ // {
line = 0.5F; // line = 0.5F;
} // }
grfx.DrawLine(new Pen(color, line), startX, picLocationY, BoundsWidth, picLocationY); // grfx.DrawLine(new Pen(color, line), startX, picLocationY, BoundsWidth, picLocationY);
} // }
grfx.Dispose(); // grfx.Dispose();
} //}
private Color CurrColor = Color.White; //private Color CurrColor = Color.White;
public void ClearPoint() public void ClearPoint()
{ {
preMPointMode = false;
try try
{ {
if (!ISShow) if (!ISShow)
...@@ -389,7 +390,7 @@ namespace TSA_V ...@@ -389,7 +390,7 @@ namespace TSA_V
} }
} }
} }
public static int StrLength(string inputString) private static int StrLength(string inputString)
{ {
System.Text.ASCIIEncoding ascii = new System.Text.ASCIIEncoding(); System.Text.ASCIIEncoding ascii = new System.Text.ASCIIEncoding();
int tempLen = 0; int tempLen = 0;
...@@ -403,16 +404,17 @@ namespace TSA_V ...@@ -403,16 +404,17 @@ namespace TSA_V
} }
return tempLen; return tempLen;
} }
private Color getPointColor(int rgbColor = -1) //private Color getPointColor(int rgbColor = -1)
{ //{
if (rgbColor >= 0xffffff) // if (rgbColor >= 0xffffff)
{ // {
rgbColor = Color.White.ToArgb(); // rgbColor = Color.White.ToArgb();
} // }
return Color.FromArgb(rgbColor); // return Color.FromArgb(rgbColor);
} //}
public void ShowPoint(params DeviceLibrary.ProjectorPInfo[] pList ) public void ShowPoint(params DeviceLibrary.ProjectorPInfo[] pList )
{ {
preMPointMode = false;
if (!ISShow) if (!ISShow)
{ {
return; return;
...@@ -427,64 +429,105 @@ namespace TSA_V ...@@ -427,64 +429,105 @@ namespace TSA_V
} }
public void ShowPoint(bool showName,int rgbColor, params SMTPointInfo[] points) public void ShowPoint(bool showName,int rgbColor, params SMTPointInfo[] points)
{ {
preMPointMode = false;
if (!ISShow) if (!ISShow)
{ {
return; return;
} }
Color pColor = Color.FromArgb(rgbColor); Color pColor = Color.FromArgb(rgbColor);
List<SMTPointInfo> pointInfos=new List<SMTPointInfo>(points);
ClearPoint(); ClearPoint();
Graphics g = panel1.CreateGraphics(); Graphics g = panel1.CreateGraphics();
foreach (SMTPointInfo point in points) DrawPointList(g, pointInfos, pColor, showName);
{
int type = point.PointType;
int x = (int)point.NodePositionX;
int y = (int)point.NodePositionY;
int sizex = point.PointSizeX;
int sizey = point.PointSizeY;
DrawPoint(pColor, g, x, y, type, point.PolaritiesType,point.PolarityAngle, sizex, sizey, point.PenWidth, "");
if (showName) g.Dispose();
}
/// <summary>
/// 自动判断是否显示电路板区域,自动显示多PCB点位
/// </summary>
/// <param name="board"></param>
/// <param name="showName"></param>
/// <param name="rgbColor"></param>
/// <param name="points"></param>
public void ShowAreaAndPoint(BoardInfo board, bool showName, params SMTPointInfo[] points)
{ {
int size = (sizex + sizey) / 2; preMPointMode = false;
if (!CloseShowName) if (!ISShow)
{ {
if (point.CheckOK && (points.Length > 1)) return;
}
int rgbColor = board.PointColor;
Color pColor = Color.FromArgb(rgbColor);
//处理多PCB点位
List<SMTPointInfo> pointInfos = new List<SMTPointInfo>();
if (points.Length == 1)
{ {
g.DrawString(point.ShowText, new Font("Arial ", size, FontStyle.Regular), Brushes.Red, x - size / 2 + 5, y + size / 2 + 2); pointInfos = XYConvertManager.GetCopyPointCR(board, points[0]);
} }
else else
{ {
Brush brush = new SolidBrush(pColor); pointInfos = XYConvertManager.GetCopyPointCR(board);
g.DrawString(point.ShowText, new Font("Arial ", size, FontStyle.Regular), brush, x - size / 2 + 5, y + size / 2 + 2);
}
}
} }
ClearPoint();
Graphics g = panel1.CreateGraphics();
//如果当前是简洁模式,显示电路板区域
if (Setting_NInit.Device_SoftMode)
{
DrawBoardArea(g, board);
} }
DrawPointList(g, pointInfos, pColor, showName);
g.Dispose(); g.Dispose();
} }
private bool preMPointMode = false;
private string preBoardName = "";
private int prePointCount = 0;
/// <summary> /// <summary>
/// 预留电路板点位列表,自动显示多PCB点位 /// 工作状态显示点位
/// </summary> /// </summary>
/// <param name="board"></param> /// <param name="board"></param>
/// <param name="showName"></param> /// <param name="showName"></param>
/// <param name="rgbColor"></param>
/// <param name="points"></param> /// <param name="points"></param>
public void ShowBoardPoint(BoardInfo board, bool showName, int rgbColor, params SMTPointInfo[] points) public void WorkingShowPoint(BoardInfo board, bool showName, params SMTPointInfo[] points)
{ {
if (!ISShow) if (!ISShow)
{ {
return; return;
} }
int rgbColor = board.PointColor;
Color pColor = Color.FromArgb(rgbColor); Color pColor = Color.FromArgb(rgbColor);
ClearPoint();
Graphics g = panel1.CreateGraphics();
if (board != null && board.calInfo != null && board.calInfo.leftUpPoint != null && board.calInfo.rightBottomPoint != null)
{
DrawBoardArea(g, board.calInfo.leftUpPoint, board.calInfo.rightBottomPoint);
}
//处理多PCB点位 //处理多PCB点位
List<SMTPointInfo> pointInfos = new List<SMTPointInfo>(); List<SMTPointInfo> pointInfos = new List<SMTPointInfo>();
//如果是多点位模式
if (board.mPointsProjection)
{
pointInfos = XYConvertManager.GetCopyPointCR(board);
if (preMPointMode)
{
if (preBoardName.Equals(board.boardName) && prePointCount == pointInfos.Count)
{
//点位一样,不需要重画
return;
}
}
else
{
preMPointMode = true;
preBoardName = board.boardName;
prePointCount = pointInfos.Count;
}
}
else
{
preMPointMode = false;
if (points.Length == 1) if (points.Length == 1)
{ {
pointInfos = XYConvertManager.GetCopyPointCR(board, points[0]); pointInfos = XYConvertManager.GetCopyPointCR(board, points[0]);
...@@ -493,6 +536,28 @@ namespace TSA_V ...@@ -493,6 +536,28 @@ namespace TSA_V
{ {
pointInfos = XYConvertManager.GetCopyPointCR(board); pointInfos = XYConvertManager.GetCopyPointCR(board);
} }
}
ClearPoint();
Graphics g = panel1.CreateGraphics();
//如果当前是简洁模式,显示电路板区域
if (Setting_NInit.Device_SoftMode)
{
DrawBoardArea(g, board);
}
DrawPointList(g, pointInfos, pColor, showName);
g.Dispose();
if (board.mPointsProjection)
{
preMPointMode = true;
preBoardName = board.boardName;
prePointCount = pointInfos.Count;
}
}
private void DrawPointList(Graphics g, List<SMTPointInfo> pointInfos,Color pColor,bool showName)
{
foreach (SMTPointInfo point in pointInfos) foreach (SMTPointInfo point in pointInfos)
{ {
int type = point.PointType; int type = point.PointType;
...@@ -500,18 +565,18 @@ namespace TSA_V ...@@ -500,18 +565,18 @@ namespace TSA_V
int y = (int)point.NodePositionY; int y = (int)point.NodePositionY;
int sizex = point.PointSizeX; int sizex = point.PointSizeX;
int sizey = point.PointSizeY; int sizey = point.PointSizeY;
DrawPoint(pColor, g, x, y, type, point.PolaritiesType,point.PolarityAngle, sizex, sizey, point.PenWidth, ""); DrawPoint(pColor, g, x, y, type, point.PolaritiesType, point.PolarityAngle, sizex, sizey, point.PenWidth, "");
if (showName) if (showName)
{ {
int size = (sizex + sizey) / 2; int size = (sizex + sizey) / 2;
if (!CloseShowName) if (!CloseShowName)
{ {
if (point.CheckOK && (points.Length > 1)) //if (point.CheckOK && (points.Length > 1))
{ //{
g.DrawString(point.ShowText, new Font("Arial ", size, FontStyle.Regular), Brushes.Red, x - size / 2 + 5, y + size / 2 + 2); // g.DrawString(point.ShowText, new Font("Arial ", size, FontStyle.Regular), Brushes.Red, x - size / 2 + 5, y + size / 2 + 2);
} //}
else //else
{ {
Brush brush = new SolidBrush(pColor); Brush brush = new SolidBrush(pColor);
g.DrawString(point.ShowText, new Font("Arial ", size, FontStyle.Regular), brush, x - size / 2 + 5, y + size / 2 + 2); g.DrawString(point.ShowText, new Font("Arial ", size, FontStyle.Regular), brush, x - size / 2 + 5, y + size / 2 + 2);
...@@ -519,26 +584,52 @@ namespace TSA_V ...@@ -519,26 +584,52 @@ namespace TSA_V
} }
} }
} }
g.Dispose();
} }
private void DrawBoardArea(Graphics g, BoardInfo board)
public void DrawBoardArea(Graphics g,Point point1,Point point2)
{ {
if (!ISShow) if (!ISShow)
{ {
return; return;
} }
if (board != null && board.calInfo != null && board.calInfo.leftUpPoint != null && board.calInfo.rightBottomPoint != null)
{
Color boardColor = Color.LightGray;
List<List<Point>> mpcbAreas=XYConvertManager.GetCopyArea(board);
if(mpcbAreas.Count>0)
{
foreach(List<Point> area in mpcbAreas)
{
if (area.Count == 2)
{
Color boardColor = Color.LightGray;
Point point1 = area[0];
Point point2 = area[1];
int line = 1; int line = 1;
g.DrawRectangle(new Pen(boardColor,line),new Rectangle( point1.X,point1.Y,(point2.X-point1.X),(point2.Y-point1.Y))); g.DrawRectangle(new Pen(boardColor, line), new Rectangle(point1.X, point1.Y, (point2.X - point1.X), (point2.Y - point1.Y)));
}
}
}
else
{
Color boardColor = Color.LightGray;
Point point1 = board.calInfo.leftUpPoint;
Point point2 = board.calInfo.rightBottomPoint;
int line = 1;
g.DrawRectangle(new Pen(boardColor, line), new Rectangle(point1.X, point1.Y, (point2.X - point1.X), (point2.Y - point1.Y)));
}
//多pcb模式时,需要画多个区域
//g.DrawLine(new Pen(boardColor, line), point1.X, point1.Y, point2.X,point1.Y); //g.DrawLine(new Pen(boardColor, line), point1.X, point1.Y, point2.X,point1.Y);
//g.DrawLine(new Pen(boardColor, line), point1.X, point1.Y, point1.X, point2.Y); //g.DrawLine(new Pen(boardColor, line), point1.X, point1.Y, point1.X, point2.Y);
//g.DrawLine(new Pen(boardColor, line), point1.X, point2.Y, point2.X, point2.Y); //g.DrawLine(new Pen(boardColor, line), point1.X, point2.Y, point2.X, point2.Y);
//g.DrawLine(new Pen(boardColor, line), point2.X, point2.Y, point1.X, point2.Y); //g.DrawLine(new Pen(boardColor, line), point2.X, point2.Y, point1.X, point2.Y);
} }
}
private void timer1_Tick(object sender, EventArgs e) private void timer1_Tick(object sender, EventArgs e)
{ {
......
...@@ -113,15 +113,15 @@ namespace TSA_V ...@@ -113,15 +113,15 @@ namespace TSA_V
LogUtil.info("切换到新板子:" + board.boardName+",保存当前工作的程序名称"); LogUtil.info("切换到新板子:" + board.boardName+",保存当前工作的程序名称");
Setting_NInit.Work_ProcedureName= board.boardName; Setting_NInit.Work_ProcedureName= board.boardName;
BoardInfo showBoard = chbSoftMode.Checked ? board : null; BoardInfo showBoard = chbSoftMode.Checked ? board : null;
if (showBoard != null) //if (showBoard != null)
{ //{
FrmProjectorScreen.instance.ShowBoardPoint(showBoard, false, board.PointColor, board.GetSmtList().ToArray()); FrmProjectorScreen.instance.ShowAreaAndPoint(board, false, board.GetSmtList().ToArray());
} //}
else //else
{ //{
FrmProjectorScreen.instance.ClearPoint(); // FrmProjectorScreen.instance.ClearPoint();
FrmProjectorScreen.instance.ShowPoint(XYConvertManager.GetCopyProjectPointCR(board).ToArray()); // FrmProjectorScreen.instance.ShowPoint(XYConvertManager.GetCopyProjectPointCR(board).ToArray());
} //}
} }
} }
} }
......
...@@ -543,7 +543,7 @@ namespace TSA_V ...@@ -543,7 +543,7 @@ namespace TSA_V
if(Setting_NInit.Device_SoftMode) if(Setting_NInit.Device_SoftMode)
{ {
FrmProjectorScreen.instance.ShowBoardPoint(BoardManager.CurrBoard, true, BoardManager.CurrBoard.PointColor, board.GetSmtList().ToArray()); FrmProjectorScreen.instance.ShowAreaAndPoint(BoardManager.CurrBoard, true , board.GetSmtList().ToArray());
} }
timer.Start(); timer.Start();
LogUtil.info(Name + " Shown end "); LogUtil.info(Name + " Shown end ");
...@@ -947,16 +947,15 @@ namespace TSA_V ...@@ -947,16 +947,15 @@ namespace TSA_V
} }
LogUtil.debug($"投影点位:{smtPoint.PN}-{smtPoint.TagNo}-{smtPoint.PositionNum}"); LogUtil.debug($"投影点位:{smtPoint.PN}-{smtPoint.TagNo}-{smtPoint.PositionNum}");
if (Setting_NInit.Device_SoftMode) //if (Setting_NInit.Device_SoftMode)
{ //{
FrmProjectorScreen.instance.WorkingShowPoint(BoardManager.CurrBoard, true, smtPoint);
FrmProjectorScreen.instance.ShowBoardPoint(BoardManager.CurrBoard, true, BoardManager.CurrBoard.PointColor, smtPoint); //}
} //else
else //{
{ // List<SMTPointInfo> sMTPointInfos = XYConvertManager.GetCopyPointCR(BoardManager.CurrBoard, smtPoint);
List<SMTPointInfo> sMTPointInfos = XYConvertManager.GetCopyPointCR(BoardManager.CurrBoard, smtPoint); // FrmProjectorScreen.instance.ShowPoint(true, BoardManager.CurrBoard.PointColor, sMTPointInfos.ToArray());
FrmProjectorScreen.instance.ShowPoint(true, BoardManager.CurrBoard.PointColor, sMTPointInfos.ToArray()); //}
}
int leftCount = workSmtList.Count - 1 - preIndex; int leftCount = workSmtList.Count - 1 - preIndex;
if (preIndex.Equals(0)) if (preIndex.Equals(0))
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!