Commit 32f60895 LN

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

1 个父辈 cb69a316
......@@ -74,6 +74,31 @@ namespace TSA_V.DeviceLibrary
/// 多PCB模式-列间距(mm)
/// </summary>
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();
......@@ -221,21 +246,29 @@ namespace TSA_V.DeviceLibrary
public List<SMTPointInfo> getCalPoint()
{
try
{
SMTPointInfo lefup = new SMTPointInfo();
lefup.PositionX = 0;
lefup.PositionY = 0;
lefup.NodePositionX = calInfo.leftUpPoint.X;
lefup.NodePositionY = calInfo.leftUpPoint.Y;
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 };
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;
return checkOKList;
}
catch (Exception ex)
{
LogUtil.error(boardName + "获取校准点列表出错:" + ex.ToString());
}
return new List<SMTPointInfo>();
}
public CalibrateBean calInfo = null;
......
......@@ -580,5 +580,6 @@ namespace TSA_V.DeviceLibrary
}
}
}
......@@ -353,16 +353,16 @@ namespace TSA_V.DeviceLibrary
}
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 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);
// 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
if (TSAVBean.IsValidPosition(currPoint.NodePositionX, currPoint.NodePositionY))
{
LogUtil.info(" 程序【" + currBoard.boardName + "】插件【" + currPoint.TagNo + "_" + currPoint.PN + "】,X轴【" + currPoint.NodePositionX + "】,Y轴【" + currPoint.NodePositionY + "】显示投影光标");
List<ProjectorPInfo> projectorPInfos = XYConvertManager.GetCopyProjectPointCR(currBoard, currPoint);
TSAVBean.ShowPoint(projectorPInfos.ToArray());
//List<ProjectorPInfo> projectorPInfos = XYConvertManager.GetCopyProjectPointCR(currBoard, currPoint);
//TSAVBean.ShowPoint(projectorPInfos.ToArray());
//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(currBoard, currPoint);
waitList.Add(WaitResultInfo.WaitTime(1000));
}
else
......
......@@ -150,8 +150,9 @@ namespace TSA_V
}
SetListCurrCell(index);
FrmProjectorScreen.instance.ClearPoint();
FrmProjectorScreen.instance.ShowPoint(false, updateBoardInfo.PointColor, pointList.ToArray( ));
//FrmProjectorScreen.instance.ClearPoint();
//FrmProjectorScreen.instance.ShowPoint(false, updateBoardInfo.PointColor, pointList.ToArray( ));
FrmProjectorScreen.instance.ShowAreaAndPoint(updateBoardInfo, false, pointList.ToArray());
this.Cursor = Cursors.Default;
//重新加载
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.TrainOK, "坐标校准完成!"));
......
......@@ -377,10 +377,11 @@ namespace TSA_V
HandClientManager.StartClient();
}
private bool TSAVBean_ShowPointEvent(params ProjectorPInfo[] p)
private bool TSAVBean_ShowPointEvent(BoardInfo board, params SMTPointInfo[] p)
{
FrmProjectorScreen.instance.ClearPoint();
FrmProjectorScreen.instance.ShowPoint(p);
//FrmProjectorScreen.instance.ShowPoint(p);
FrmProjectorScreen.instance.WorkingShowPoint(board,true,p);
return true;
}
......
......@@ -2829,5 +2829,13 @@
<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_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>
\ No newline at end of file
......@@ -2806,5 +2806,13 @@
<data name = "FrmMPcbConfig_label11_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_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>
\ No newline at end of file
......@@ -3051,4 +3051,12 @@
<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_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>
\ No newline at end of file
......@@ -179,6 +179,12 @@
<Compile Include="frmBoard\FrmMPcbConfig.Designer.cs">
<DependentUpon>FrmMPcbConfig.cs</DependentUpon>
</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">
<SubType>Form</SubType>
</Compile>
......@@ -469,6 +475,9 @@
<EmbeddedResource Include="frmBoard\FrmNImageViewer.resx">
<DependentUpon>FrmNImageViewer.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmBoard\FrmPCbOffsetConfig.resx">
<DependentUpon>FrmPCbOffsetConfig.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmCom\FrmAddCom.resx">
<DependentUpon>FrmAddCom.cs</DependentUpon>
</EmbeddedResource>
......
......@@ -284,7 +284,7 @@ namespace TSA_V
dgvList.Rows.Add(setPointInfo(null, point));
}
}
chbMPoint.Checked = updateBoardInfo.mPointsProjection;
}
private DataGridViewRow setPointInfo(DataGridViewRow view, SMTPointInfo point)
......@@ -565,7 +565,8 @@ namespace TSA_V
board.boardWidth = FormUtil.GetIntValue(txtBoardL);
board.LineWidth = FormUtil.GetIntValue(txtLineWidth);
board.PointColor = btnColorChange.BackColor.ToArgb();
board.boardCode = FormUtil.getValue(txtCode);
board.boardCode = FormUtil.getValue(txtCode);
board.mPointsProjection = chbMPoint.Checked;
board.orgType = orgType;
if (cmbAOIFile.SelectedIndex == 0)
board.AOIProName = "";
......@@ -1560,8 +1561,10 @@ namespace TSA_V
if (updateBoardInfo.PointColor != btnColorChange.BackColor.ToArgb())
{
updateBoardInfo.PointColor = btnColorChange.BackColor.ToArgb();
FrmProjectorScreen.instance.ClearPoint();
FrmProjectorScreen.instance.ShowPoint(false, updateBoardInfo.PointColor, allPointInfo().ToArray());
//FrmProjectorScreen.instance.ClearPoint();
//FrmProjectorScreen.instance.ShowPoint(false, updateBoardInfo.PointColor, allPointInfo().ToArray());
FrmProjectorScreen.instance.ShowAreaAndPoint(updateBoardInfo, false, allPointInfo().ToArray());
BoardManager.Update(updateBoardInfo);
}
}
......@@ -1601,8 +1604,10 @@ namespace TSA_V
}
SetListCurrCell(index);
FrmProjectorScreen.instance.ClearPoint();
FrmProjectorScreen.instance.ShowPoint(false, updateBoardInfo.PointColor, updateBoardInfo.smtList.ToArray());
//FrmProjectorScreen.instance.ClearPoint();
//FrmProjectorScreen.instance.ShowPoint(false, updateBoardInfo.PointColor, updateBoardInfo.smtList.ToArray());
FrmProjectorScreen.instance.ShowAreaAndPoint(updateBoardInfo, false, updateBoardInfo.smtList.ToArray());
this.Cursor = Cursors.Default;
//重新加载
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.TrainOK, "坐标校准完成!"));
......
......@@ -129,7 +129,9 @@ namespace TSA_V
LoadPoint(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
currBoard.calInfo.CurrStep = 3;
currBoard.smtList = pointList;
BoardManager.Update(currBoard);
FrmProjectorScreen.instance.ClearPoint();
FrmProjectorScreen.instance.ShowPoint(false, currBoard.PointColor, pointList.ToArray());
//FrmProjectorScreen.instance.ClearPoint();
//FrmProjectorScreen.instance.ShowPoint(false, currBoard.PointColor, pointList.ToArray());
FrmProjectorScreen.instance.ShowAreaAndPoint(currBoard, false, pointList.ToArray());
this.Cursor = Cursors.Default;
//重新加载
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.TrainOK, "坐标校准完成!"));
......
......@@ -36,6 +36,8 @@
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.btnTest = new System.Windows.Forms.Button();
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.label3 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
......@@ -47,16 +49,11 @@
this.label7 = new System.Windows.Forms.Label();
this.btnClose = 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.groupBox1.SuspendLayout();
this.tableLayoutPanel1.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.numRow)).BeginInit();
this.SuspendLayout();
//
// dataGridViewImageColumn1
......@@ -105,7 +102,6 @@
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.Controls.Add(this.numericUpDown1, 0, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 17);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
......@@ -114,6 +110,7 @@
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.TabIndex = 0;
this.tableLayoutPanel1.Tag = "SKIPUIPRO";
//
// btnTest
//
......@@ -142,21 +139,65 @@
this.groupCopy.Controls.Add(this.label11);
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.Location = new System.Drawing.Point(12, 21);
this.groupCopy.Location = new System.Drawing.Point(12, 12);
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.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
//
this.label1.AutoSize = true;
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.Size = new System.Drawing.Size(191, 17);
this.label1.Size = new System.Drawing.Size(815, 17);
this.label1.TabIndex = 304;
this.label1.Text = "*多PCB模式时,PCB必须均匀放置";
this.label1.Text = "点击下方PCB块可设置其相对PCB1的偏移(单位:mm)。未设置则按上方行/列间距均匀排布";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label3
//
......@@ -264,57 +305,6 @@
this.btnSave.UseVisualStyleBackColor = true;
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
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
......@@ -324,15 +314,13 @@
this.Name = "FrmMPcbConfig";
this.Text = "多PCB模式配置";
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.groupBox1.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
this.groupCopy.ResumeLayout(false);
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.numRow)).EndInit();
this.ResumeLayout(false);
}
......@@ -356,7 +344,6 @@
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.NumericUpDown numericUpDown1;
private System.Windows.Forms.NumericUpDown numCol;
private System.Windows.Forms.NumericUpDown numRow;
}
......
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
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
<?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
using log4net.Filter;
using log4net.Filter;
using System;
using System.CodeDom;
using System.Collections.Generic;
......@@ -232,8 +232,22 @@ namespace TSA_V
{
SMTPointInfo newPoint = new SMTPointInfo(point);
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.TagNo = point.TagNo + "-" + index;
newPoint.PointSizeX = point.PointSizeX;
......
......@@ -113,15 +113,15 @@ namespace TSA_V
LogUtil.info("切换到新板子:" + board.boardName+",保存当前工作的程序名称");
Setting_NInit.Work_ProcedureName= board.boardName;
BoardInfo showBoard = chbSoftMode.Checked ? board : null;
if (showBoard != null)
{
FrmProjectorScreen.instance.ShowBoardPoint(showBoard, false, board.PointColor, board.GetSmtList().ToArray());
}
else
{
FrmProjectorScreen.instance.ClearPoint();
FrmProjectorScreen.instance.ShowPoint(XYConvertManager.GetCopyProjectPointCR(board).ToArray());
}
//if (showBoard != null)
//{
FrmProjectorScreen.instance.ShowAreaAndPoint(board, false, board.GetSmtList().ToArray());
//}
//else
//{
// FrmProjectorScreen.instance.ClearPoint();
// FrmProjectorScreen.instance.ShowPoint(XYConvertManager.GetCopyProjectPointCR(board).ToArray());
//}
}
}
}
......
......@@ -543,7 +543,7 @@ namespace TSA_V
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();
LogUtil.info(Name + " Shown end ");
......@@ -947,16 +947,15 @@ namespace TSA_V
}
LogUtil.debug($"投影点位:{smtPoint.PN}-{smtPoint.TagNo}-{smtPoint.PositionNum}");
if (Setting_NInit.Device_SoftMode)
{
FrmProjectorScreen.instance.ShowBoardPoint(BoardManager.CurrBoard, true, BoardManager.CurrBoard.PointColor, smtPoint);
}
else
{
List<SMTPointInfo> sMTPointInfos = XYConvertManager.GetCopyPointCR(BoardManager.CurrBoard, smtPoint);
FrmProjectorScreen.instance.ShowPoint(true, BoardManager.CurrBoard.PointColor, sMTPointInfos.ToArray());
}
//if (Setting_NInit.Device_SoftMode)
//{
FrmProjectorScreen.instance.WorkingShowPoint(BoardManager.CurrBoard, true, smtPoint);
//}
//else
//{
// List<SMTPointInfo> sMTPointInfos = XYConvertManager.GetCopyPointCR(BoardManager.CurrBoard, smtPoint);
// FrmProjectorScreen.instance.ShowPoint(true, BoardManager.CurrBoard.PointColor, sMTPointInfos.ToArray());
//}
int leftCount = workSmtList.Count - 1 - preIndex;
if (preIndex.Equals(0))
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!