Commit 92e3c8f2 LN

元器件库增加元器件时可直接加入程序。

1 个父辈 194ad35b
...@@ -190,5 +190,5 @@ namespace TSA_V.Common ...@@ -190,5 +190,5 @@ namespace TSA_V.Common
/// 投影屏幕索引,默认1 /// 投影屏幕索引,默认1
/// </summary> /// </summary>
public static string ProjectorScreen_Index = "ProjectorScreen_Index"; public static string ProjectorScreen_Index = "ProjectorScreen_Index";
} }
} }
...@@ -94,6 +94,8 @@ namespace TSA_V.Common ...@@ -94,6 +94,8 @@ namespace TSA_V.Common
public static MyConfig<bool> Device_SoftMode = false; public static MyConfig<bool> Device_SoftMode = false;
[MyConfigComment("是否启用手势监控")] [MyConfigComment("是否启用手势监控")]
public static MyConfig<bool> Device_HandsVideo= false; public static MyConfig<bool> Device_HandsVideo= false;
[MyConfigComment("是否启用元器件计数功能")]
public static MyConfig<bool> Device_UsePNCount = true;
[MyConfigComment("手势服务器端口")] [MyConfigComment("手势服务器端口")]
public static MyConfig<int> Hand_ServerPort = 8765; public static MyConfig<int> Hand_ServerPort = 8765;
[MyConfigComment("手势范围设置:x,y,w,h")] [MyConfigComment("手势范围设置:x,y,w,h")]
......
...@@ -737,32 +737,17 @@ namespace TSA_V.LoadCSVLibrary ...@@ -737,32 +737,17 @@ namespace TSA_V.LoadCSVLibrary
{ {
try try
{ {
//如果禁用数量功能,不更改
if (!Setting_NInit.Device_UsePNCount)
{
return true ;
}
string bomName = currBoard.bomName; string bomName = currBoard.bomName;
List<ComponetInfo> comList = CSVBomManager.GetComList(bomName); List<ComponetInfo> comList = CSVBomManager.GetComList(bomName);
if (comList == null) if (comList == null)
{ {
return false; return false;
} }
//Dictionary<string, int> useCount = new Dictionary<string, int>();
//int index = 0;
//List<SMTPointInfo> list = currBoard.GetSmtList();
//foreach (SMTPointInfo smt in list)
//{
// if (index > maxIndex)
// {
// break;
// }
// ComponetInfo com = CSVBomManager.GetCom(BoardManager.CurrBoard.bomName, smt);
// if (useCount.ContainsKey(com.PN))
// {
// useCount[com.PN]++;
// }
// else
// {
// useCount.Add(com.PN, 1);
// }
// index++;
//}
List<ComponetInfo> newList = new List<ComponetInfo>(); List<ComponetInfo> newList = new List<ComponetInfo>();
foreach (ComponetInfo obj in comList) foreach (ComponetInfo obj in comList)
{ {
......
...@@ -12,6 +12,7 @@ using System.Windows.Forms; ...@@ -12,6 +12,7 @@ using System.Windows.Forms;
using System.IO; using System.IO;
using TSA_V.LoadCSVLibrary; using TSA_V.LoadCSVLibrary;
using TSA_V.DeviceLibrary.manager; using TSA_V.DeviceLibrary.manager;
using NPOI.SS.Formula.Functions;
namespace TSA_V namespace TSA_V
{ {
...@@ -131,7 +132,30 @@ namespace TSA_V ...@@ -131,7 +132,30 @@ namespace TSA_V
{ {
if (IsNew) if (IsNew)
{ {
AddCom(); ComponetInfo addObj = AddCom();
if (addObj != null)
{
//查找引用的程序
List<BoardInfo> boardInfos = BoardManager.getBoardByBomName(cmbList.Text);
if (boardInfos.Count > 0)
{
FrmSureAddCom frm = new FrmSureAddCom(boardInfos);
DialogResult result = frm.ShowDialog();
if (result.Equals(DialogResult.OK) && frm.SelBoardList.Count > 0)
{
List<BoardInfo> selBoards = frm.SelBoardList;
foreach (BoardInfo board in selBoards)
{
SMTPointInfo point = new SMTPointInfo(board.smtList.Count + 1, addObj.TagNo, addObj.PN, board.boardWidth / 2, board.boardLength / 2, addObj.PositionNum, "", 1, 6, 6, 2, 0);
LogUtil.info($"为程序{board.bomName}增加新点位:{addObj.TagNo + "_" + addObj.PN}");
board.smtList.Add(point);
BoardManager.Update(board);
}
}
}
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.ComSaveOk, "元器件【{0}】保存成功!", addObj.TagNo + "-" + addObj.PN));
}
} }
else else
{ {
...@@ -213,7 +237,7 @@ namespace TSA_V ...@@ -213,7 +237,7 @@ namespace TSA_V
} }
} }
private void AddCom() private ComponetInfo AddCom()
{ {
ComponetInfo obj = new ComponetInfo(); ComponetInfo obj = new ComponetInfo();
...@@ -221,7 +245,7 @@ namespace TSA_V ...@@ -221,7 +245,7 @@ namespace TSA_V
{ {
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.SelectCPosition, "请选择元器件位置!")); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.SelectCPosition, "请选择元器件位置!"));
cmbPositionNumList.Focus(); cmbPositionNumList.Focus();
return; return null;
} }
TSAVPosition position = (TSAVPosition)cmbPositionNumList.SelectedItem; TSAVPosition position = (TSAVPosition)cmbPositionNumList.SelectedItem;
obj.TagNo = FormUtil.getValue(txtPartNum); obj.TagNo = FormUtil.getValue(txtPartNum);
...@@ -243,7 +267,7 @@ namespace TSA_V ...@@ -243,7 +267,7 @@ namespace TSA_V
{ {
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.PartNAExist, "元器件编号[{0}]已存在", obj.TagNo)); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.PartNAExist, "元器件编号[{0}]已存在", obj.TagNo));
txtPartNum.Focus(); txtPartNum.Focus();
return; return null;
} }
//objs = (from m in allList where m.PN.Equals(obj.PN) && m.PositionNum.Equals(m.PositionNum) select m).ToList(); //objs = (from m in allList where m.PN.Equals(obj.PN) && m.PositionNum.Equals(m.PositionNum) select m).ToList();
//if (objs.Count > 0) //if (objs.Count > 0)
...@@ -256,14 +280,14 @@ namespace TSA_V ...@@ -256,14 +280,14 @@ namespace TSA_V
{ {
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.WriteComName, "请输入元器件名称!")); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.WriteComName, "请输入元器件名称!"));
txtName.Focus(); txtName.Focus();
return; return null;
} }
if (obj.GetCount() <= 0) if (obj.GetCount() <= 0)
{ {
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.WriteComNum, "请输入元器件数量!")); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.WriteComNum, "请输入元器件数量!"));
txtCount.Focus(); txtCount.Focus();
return; return null;
} }
if (String.IsNullOrEmpty(obj.TagNo)) if (String.IsNullOrEmpty(obj.TagNo))
{ {
...@@ -280,7 +304,7 @@ namespace TSA_V ...@@ -280,7 +304,7 @@ namespace TSA_V
if (list == null) if (list == null)
{ {
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.SaveError, "保存失败!")); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.SaveError, "保存失败!"));
return; return null;
} }
//ComponentManager.Update(obj); //ComponentManager.Update(obj);
//dgvList.Rows.Add(SetRowInfo(null, obj)); //dgvList.Rows.Add(SetRowInfo(null, obj));
...@@ -290,6 +314,7 @@ namespace TSA_V ...@@ -290,6 +314,7 @@ namespace TSA_V
btnNewCom.Visible = true; btnNewCom.Visible = true;
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.ComSaveOk, "元器件【{0}】保存成功!", obj.TagNo + "-" + obj.PN)); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.ComSaveOk, "元器件【{0}】保存成功!", obj.TagNo + "-" + obj.PN));
groupInfo.Text = ResourceCulture.GetString(ResourceCulture.ComInfo, "元器件【{0}】的基本信息", obj.TagNo + "-" + obj.PN); groupInfo.Text = ResourceCulture.GetString(ResourceCulture.ComInfo, "元器件【{0}】的基本信息", obj.TagNo + "-" + obj.PN);
return obj;
} }
private void btnDel_Click(object sender, EventArgs e) private void btnDel_Click(object sender, EventArgs e)
......
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
this.cmbTestProName = new System.Windows.Forms.ComboBox(); this.cmbTestProName = new System.Windows.Forms.ComboBox();
this.txtCode = new System.Windows.Forms.TextBox(); this.txtCode = new System.Windows.Forms.TextBox();
this.lblCode = new System.Windows.Forms.Label(); this.lblCode = new System.Windows.Forms.Label();
this.cheDisCount = new System.Windows.Forms.CheckBox();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.groupBox4.SuspendLayout(); this.groupBox4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numSizeY)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numSizeY)).BeginInit();
...@@ -74,6 +75,7 @@ ...@@ -74,6 +75,7 @@
// //
// groupBox1 // groupBox1
// //
this.groupBox1.Controls.Add(this.cheDisCount);
this.groupBox1.Controls.Add(this.chbMouse); this.groupBox1.Controls.Add(this.chbMouse);
this.groupBox1.Controls.Add(this.chbWorkT); this.groupBox1.Controls.Add(this.chbWorkT);
this.groupBox1.Controls.Add(this.chbAlarmT); this.groupBox1.Controls.Add(this.chbAlarmT);
...@@ -84,7 +86,7 @@ ...@@ -84,7 +86,7 @@
this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox1.Location = new System.Drawing.Point(27, 5); this.groupBox1.Location = new System.Drawing.Point(27, 5);
this.groupBox1.Name = "groupBox1"; this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(541, 190); this.groupBox1.Size = new System.Drawing.Size(541, 211);
this.groupBox1.TabIndex = 284; this.groupBox1.TabIndex = 284;
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
this.groupBox1.Text = "其他参数"; this.groupBox1.Text = "其他参数";
...@@ -92,7 +94,7 @@ ...@@ -92,7 +94,7 @@
// chbMouse // chbMouse
// //
this.chbMouse.AutoSize = true; this.chbMouse.AutoSize = true;
this.chbMouse.Location = new System.Drawing.Point(51, 153); this.chbMouse.Location = new System.Drawing.Point(51, 149);
this.chbMouse.Name = "chbMouse"; this.chbMouse.Name = "chbMouse";
this.chbMouse.Size = new System.Drawing.Size(123, 21); this.chbMouse.Size = new System.Drawing.Size(123, 21);
this.chbMouse.TabIndex = 293; this.chbMouse.TabIndex = 293;
...@@ -102,7 +104,7 @@ ...@@ -102,7 +104,7 @@
// chbWorkT // chbWorkT
// //
this.chbWorkT.AutoSize = true; this.chbWorkT.AutoSize = true;
this.chbWorkT.Location = new System.Drawing.Point(51, 122); this.chbWorkT.Location = new System.Drawing.Point(51, 118);
this.chbWorkT.Name = "chbWorkT"; this.chbWorkT.Name = "chbWorkT";
this.chbWorkT.Size = new System.Drawing.Size(99, 21); this.chbWorkT.Size = new System.Drawing.Size(99, 21);
this.chbWorkT.TabIndex = 292; this.chbWorkT.TabIndex = 292;
...@@ -112,7 +114,7 @@ ...@@ -112,7 +114,7 @@
// chbAlarmT // chbAlarmT
// //
this.chbAlarmT.AutoSize = true; this.chbAlarmT.AutoSize = true;
this.chbAlarmT.Location = new System.Drawing.Point(51, 91); this.chbAlarmT.Location = new System.Drawing.Point(51, 87);
this.chbAlarmT.Name = "chbAlarmT"; this.chbAlarmT.Name = "chbAlarmT";
this.chbAlarmT.Size = new System.Drawing.Size(99, 21); this.chbAlarmT.Size = new System.Drawing.Size(99, 21);
this.chbAlarmT.TabIndex = 291; this.chbAlarmT.TabIndex = 291;
...@@ -123,7 +125,7 @@ ...@@ -123,7 +125,7 @@
// //
this.lblconfigdetial.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.lblconfigdetial.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.lblconfigdetial.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblconfigdetial.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblconfigdetial.Location = new System.Drawing.Point(443, 161); this.lblconfigdetial.Location = new System.Drawing.Point(443, 182);
this.lblconfigdetial.Name = "lblconfigdetial"; this.lblconfigdetial.Name = "lblconfigdetial";
this.lblconfigdetial.Size = new System.Drawing.Size(91, 23); this.lblconfigdetial.Size = new System.Drawing.Size(91, 23);
this.lblconfigdetial.TabIndex = 290; this.lblconfigdetial.TabIndex = 290;
...@@ -144,7 +146,7 @@ ...@@ -144,7 +146,7 @@
// chbDisBottomCylinder // chbDisBottomCylinder
// //
this.chbDisBottomCylinder.AutoSize = true; this.chbDisBottomCylinder.AutoSize = true;
this.chbDisBottomCylinder.Location = new System.Drawing.Point(51, 60); this.chbDisBottomCylinder.Location = new System.Drawing.Point(51, 56);
this.chbDisBottomCylinder.Name = "chbDisBottomCylinder"; this.chbDisBottomCylinder.Name = "chbDisBottomCylinder";
this.chbDisBottomCylinder.Size = new System.Drawing.Size(99, 21); this.chbDisBottomCylinder.Size = new System.Drawing.Size(99, 21);
this.chbDisBottomCylinder.TabIndex = 20; this.chbDisBottomCylinder.TabIndex = 20;
...@@ -154,7 +156,7 @@ ...@@ -154,7 +156,7 @@
// chbISDebug // chbISDebug
// //
this.chbISDebug.AutoSize = true; this.chbISDebug.AutoSize = true;
this.chbISDebug.Location = new System.Drawing.Point(51, 29); this.chbISDebug.Location = new System.Drawing.Point(51, 25);
this.chbISDebug.Name = "chbISDebug"; this.chbISDebug.Name = "chbISDebug";
this.chbISDebug.Size = new System.Drawing.Size(183, 21); this.chbISDebug.Size = new System.Drawing.Size(183, 21);
this.chbISDebug.TabIndex = 19; this.chbISDebug.TabIndex = 19;
...@@ -175,7 +177,7 @@ ...@@ -175,7 +177,7 @@
this.groupBox4.Controls.Add(this.label3); this.groupBox4.Controls.Add(this.label3);
this.groupBox4.Controls.Add(this.cmbBoardList); this.groupBox4.Controls.Add(this.cmbBoardList);
this.groupBox4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.groupBox4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox4.Location = new System.Drawing.Point(27, 211); this.groupBox4.Location = new System.Drawing.Point(27, 222);
this.groupBox4.Name = "groupBox4"; this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(541, 214); this.groupBox4.Size = new System.Drawing.Size(541, 214);
this.groupBox4.TabIndex = 284; this.groupBox4.TabIndex = 284;
...@@ -337,7 +339,7 @@ ...@@ -337,7 +339,7 @@
// //
this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCancel.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnCancel.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCancel.Location = new System.Drawing.Point(312, 608); this.btnCancel.Location = new System.Drawing.Point(312, 619);
this.btnCancel.Name = "btnCancel"; this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(120, 45); this.btnCancel.Size = new System.Drawing.Size(120, 45);
this.btnCancel.TabIndex = 279; this.btnCancel.TabIndex = 279;
...@@ -349,7 +351,7 @@ ...@@ -349,7 +351,7 @@
// //
this.btnOk.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnOk.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOk.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnOk.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOk.Location = new System.Drawing.Point(161, 608); this.btnOk.Location = new System.Drawing.Point(161, 619);
this.btnOk.Name = "btnOk"; this.btnOk.Name = "btnOk";
this.btnOk.Size = new System.Drawing.Size(120, 45); this.btnOk.Size = new System.Drawing.Size(120, 45);
this.btnOk.TabIndex = 278; this.btnOk.TabIndex = 278;
...@@ -364,7 +366,7 @@ ...@@ -364,7 +366,7 @@
this.gbKNDSetting.Controls.Add(this.txtKNDIP); this.gbKNDSetting.Controls.Add(this.txtKNDIP);
this.gbKNDSetting.Controls.Add(this.lblKNDIP); this.gbKNDSetting.Controls.Add(this.lblKNDIP);
this.gbKNDSetting.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.gbKNDSetting.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.gbKNDSetting.Location = new System.Drawing.Point(27, 211); this.gbKNDSetting.Location = new System.Drawing.Point(27, 222);
this.gbKNDSetting.Name = "gbKNDSetting"; this.gbKNDSetting.Name = "gbKNDSetting";
this.gbKNDSetting.Size = new System.Drawing.Size(267, 140); this.gbKNDSetting.Size = new System.Drawing.Size(267, 140);
this.gbKNDSetting.TabIndex = 285; this.gbKNDSetting.TabIndex = 285;
...@@ -418,7 +420,7 @@ ...@@ -418,7 +420,7 @@
this.groupBox3.Controls.Add(this.txtCode); this.groupBox3.Controls.Add(this.txtCode);
this.groupBox3.Controls.Add(this.lblCode); this.groupBox3.Controls.Add(this.lblCode);
this.groupBox3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.groupBox3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox3.Location = new System.Drawing.Point(27, 430); this.groupBox3.Location = new System.Drawing.Point(27, 441);
this.groupBox3.Name = "groupBox3"; this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(541, 160); this.groupBox3.Size = new System.Drawing.Size(541, 160);
this.groupBox3.TabIndex = 286; this.groupBox3.TabIndex = 286;
...@@ -500,6 +502,16 @@ ...@@ -500,6 +502,16 @@
this.lblCode.Text = "条码:"; this.lblCode.Text = "条码:";
this.lblCode.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.lblCode.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
// //
// cheDisCount
//
this.cheDisCount.AutoSize = true;
this.cheDisCount.Location = new System.Drawing.Point(51, 180);
this.cheDisCount.Name = "cheDisCount";
this.cheDisCount.Size = new System.Drawing.Size(111, 21);
this.cheDisCount.TabIndex = 294;
this.cheDisCount.Text = "开启元器件计数";
this.cheDisCount.UseVisualStyleBackColor = true;
//
// FrmDeviceConfig // FrmDeviceConfig
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
...@@ -565,5 +577,6 @@ ...@@ -565,5 +577,6 @@
private System.Windows.Forms.CheckBox chbWorkT; private System.Windows.Forms.CheckBox chbWorkT;
private System.Windows.Forms.CheckBox chbAlarmT; private System.Windows.Forms.CheckBox chbAlarmT;
private System.Windows.Forms.CheckBox chbMouse; private System.Windows.Forms.CheckBox chbMouse;
private System.Windows.Forms.CheckBox cheDisCount;
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -67,6 +67,7 @@ namespace TSA_V ...@@ -67,6 +67,7 @@ namespace TSA_V
chbAlarmT.Checked = Setting_NInit.Set_AlarmSound; chbAlarmT.Checked = Setting_NInit.Set_AlarmSound;
chbMouse.Checked = Setting_NInit.Set_CursorProcess; chbMouse.Checked = Setting_NInit.Set_CursorProcess;
chbWorkT.Checked = Setting_NInit.Set_TipSound; chbWorkT.Checked = Setting_NInit.Set_TipSound;
cheDisCount.Checked = Setting_NInit.Device_UsePNCount;
} }
public void LoadCom() public void LoadCom()
{ {
...@@ -130,7 +131,10 @@ namespace TSA_V ...@@ -130,7 +131,10 @@ namespace TSA_V
Setting_NInit.Set_AlarmSound = chbAlarmT.Checked; Setting_NInit.Set_AlarmSound = chbAlarmT.Checked;
Setting_NInit.Set_TipSound = chbWorkT.Checked; Setting_NInit.Set_TipSound = chbWorkT.Checked;
Setting_NInit.Set_CursorProcess = chbMouse.Checked; Setting_NInit.Set_CursorProcess = chbMouse.Checked;
LogUtil.info($"保存配置成功: 调试{ isDebug },禁用底部气缸{disBottom},禁用侧挡气缸{disSide},地址{server} ,报警提示{Setting_NInit.Set_AlarmSound.Val},工作音效{Setting_NInit.Set_TipSound.Val},鼠标限制{Setting_NInit.Set_CursorProcess.Val}"); Setting_NInit.Device_UsePNCount=cheDisCount.Checked;
LogUtil.info($"保存配置成功: 调试{ isDebug },禁用底部气缸{disBottom},禁用侧挡气缸{disSide},地址{server} ," +
$"报警提示{Setting_NInit.Set_AlarmSound.Val},工作音效{Setting_NInit.Set_TipSound.Val},鼠标限制{Setting_NInit.Set_CursorProcess.Val}, " +
$"启用元器件计数:{Setting_NInit.Device_UsePNCount}");
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.SaveOk, "保存成功")); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.SaveOk, "保存成功"));
} }
......
...@@ -2778,4 +2778,14 @@ ...@@ -2778,4 +2778,14 @@
<data name="Type100" xml:space="preserve"> <data name="Type100" xml:space="preserve">
<value>Polarity_Custom</value> <value>Polarity_Custom</value>
</data> </data>
<data name = "FrmDeviceConfig_cheDisCount_Text" xml:space = "preserve"> <value> Enable Component Counting </value> </data>
<data name = "boardName" xml:space = "preserve"> <value> Program Name </value> </data>
<data name = "bomName" xml:space = "preserve"> <value> BOM Name </value> </data>
<data name = "poingtNum" xml:space = "preserve"> <value> Assembly Quantity </value> </data>
<data name = "NeedAdd" xml:space = "preserve"> <value> Need to Add </value> </data>
<data name = "FrmSureAddCom_Text" xml:space = "preserve"> <value> Add New Component </value> </data>
<data name = "FrmSureAddCom_label1_Text" xml:space = "preserve"> <value> New Component Added to the Following Program </value> </data>
<data name = "FrmSureAddCom_焊点列表_Text" xml:space = "preserve"> <value> List </value> </data>
<data name = "FrmSureAddCom_btnClose_Text" xml:space = "preserve"> <value> Cancel Addition </value> </data>
<data name = "FrmSureAddCom_btnSave_Text" xml:space = "preserve"> <value> Confirm Addition </value> </data>
</root> </root>
\ No newline at end of file \ No newline at end of file
...@@ -2756,4 +2756,14 @@ ...@@ -2756,4 +2756,14 @@
<data name="Type100" xml:space="preserve"> <data name="Type100" xml:space="preserve">
<value>极性_自定义</value> <value>极性_自定义</value>
</data> </data>
<data name = "FrmDeviceConfig_cheDisCount_Text" xml:space = "preserve"> <value> 开启元器件计数 </value> </data>
<data name = "boardName" xml:space = "preserve"> <value> 程序名称 </value> </data>
<data name = "bomName" xml:space = "preserve"> <value> Bom名称 </value> </data>
<data name = "poingtNum" xml:space = "preserve"> <value> 组装数量 </value> </data>
<data name = "NeedAdd" xml:space = "preserve"> <value> 需要添加 </value> </data>
<data name = "FrmSureAddCom_Text" xml:space = "preserve"> <value> 新增元器件 </value> </data>
<data name = "FrmSureAddCom_label1_Text" xml:space = "preserve"> <value> 新元器件添加到以下程序 </value> </data>
<data name = "FrmSureAddCom_焊点列表_Text" xml:space = "preserve"> <value> 列表 </value> </data>
<data name = "FrmSureAddCom_btnClose_Text" xml:space = "preserve"> <value> 放弃添加 </value> </data>
<data name = "FrmSureAddCom_btnSave_Text" xml:space = "preserve"> <value> 确认添加 </value> </data>
</root> </root>
\ No newline at end of file \ No newline at end of file
...@@ -2999,5 +2999,15 @@ ...@@ -2999,5 +2999,15 @@
</data> </data>
<data name="Type100" xml:space="preserve"> <data name="Type100" xml:space="preserve">
<value>极性_自定义</value> <value>极性_自定义</value>
</data> </data>
<data name = "FrmDeviceConfig_cheDisCount_Text" xml:space = "preserve"> <value> 开启元器件计数 </value> </data>
<data name = "boardName" xml:space = "preserve"> <value> 程序名称 </value> </data>
<data name = "bomName" xml:space = "preserve"> <value> Bom名称 </value> </data>
<data name = "poingtNum" xml:space = "preserve"> <value> 组装数量 </value> </data>
<data name = "NeedAdd" xml:space = "preserve"> <value> 需要添加 </value> </data>
<data name = "FrmSureAddCom_Text" xml:space = "preserve"> <value> 新增元器件 </value> </data>
<data name = "FrmSureAddCom_label1_Text" xml:space = "preserve"> <value> 新元器件添加到以下程序 </value> </data>
<data name = "FrmSureAddCom_焊点列表_Text" xml:space = "preserve"> <value> 列表 </value> </data>
<data name = "FrmSureAddCom_btnClose_Text" xml:space = "preserve"> <value> 放弃添加 </value> </data>
<data name = "FrmSureAddCom_btnSave_Text" xml:space = "preserve"> <value> 确认添加 </value> </data>
</root> </root>
\ No newline at end of file \ No newline at end of file
...@@ -127,7 +127,7 @@ namespace TSA_V ...@@ -127,7 +127,7 @@ namespace TSA_V
foreach (string key in defaultMap.Keys) foreach (string key in defaultMap.Keys)
{ {
string value = defaultMap[key]; string value = defaultMap[key];
builder.Append($"<data name = {key} xml:space = \"preserve\"> <value> { value} </value> </data> \r\n"); builder.Append($"<data name = \"{key}\" xml:space = \"preserve\"> <value> { value} </value> </data> \r\n");
//LogUtil.info(" 缺少文字配置[" + key + "] 默认值[" + value + "]"); //LogUtil.info(" 缺少文字配置[" + key + "] 默认值[" + value + "]");
} }
builder.Append("结束打印缺少的文字配置"); builder.Append("结束打印缺少的文字配置");
......
...@@ -209,6 +209,12 @@ ...@@ -209,6 +209,12 @@
<Compile Include="frmBoard\FrmListViewer.Designer.cs"> <Compile Include="frmBoard\FrmListViewer.Designer.cs">
<DependentUpon>FrmListViewer.cs</DependentUpon> <DependentUpon>FrmListViewer.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="frmCom\FrmSureAddCom.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmCom\FrmSureAddCom.Designer.cs">
<DependentUpon>FrmSureAddCom.cs</DependentUpon>
</Compile>
<Compile Include="hands\HandClientManager.cs" /> <Compile Include="hands\HandClientManager.cs" />
<Compile Include="manager\AOIManager.cs" /> <Compile Include="manager\AOIManager.cs" />
<Compile Include="DataCalculate.cs"> <Compile Include="DataCalculate.cs">
...@@ -462,6 +468,7 @@ ...@@ -462,6 +468,7 @@
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="frmBoard\FrmBoardList.resx"> <EmbeddedResource Include="frmBoard\FrmBoardList.resx">
<DependentUpon>FrmBoardList.cs</DependentUpon> <DependentUpon>FrmBoardList.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="frmBoard\FrmBomUpload.resx"> <EmbeddedResource Include="frmBoard\FrmBomUpload.resx">
<DependentUpon>FrmBomUpload.cs</DependentUpon> <DependentUpon>FrmBomUpload.cs</DependentUpon>
...@@ -478,6 +485,10 @@ ...@@ -478,6 +485,10 @@
<EmbeddedResource Include="frmBoard\FrmListViewer.resx"> <EmbeddedResource Include="frmBoard\FrmListViewer.resx">
<DependentUpon>FrmListViewer.cs</DependentUpon> <DependentUpon>FrmListViewer.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="frmCom\FrmSureAddCom.resx">
<DependentUpon>FrmSureAddCom.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="FrmHistory.resx"> <EmbeddedResource Include="FrmHistory.resx">
<DependentUpon>FrmHistory.cs</DependentUpon> <DependentUpon>FrmHistory.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
......

using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Windows.Forms;
using TSA_V.DeviceLibrary;
namespace TSA_V
{
public partial class FrmSureAddCom : FrmBase
{
public List<BoardInfo> boardInfos = new List<BoardInfo>();
public List<BoardInfo> SelBoardList = new List<BoardInfo>();
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public FrmSureAddCom(List<BoardInfo> boardInfos)
{
InitializeComponent();
CheckForIllegalCrossThreadCalls = false;
LanguagePro();
this.boardInfos = boardInfos;
LoadBoardInfo();
}
private void LanguagePro()
{
this.dataGridViewImageColumn1.HeaderText = ResourceCulture.GetString(ResourceCulture.ItemText_Up, "上升");
this.dataGridViewImageColumn2.HeaderText = ResourceCulture.GetString(ResourceCulture.ItemText_Down, "下降");
this.Column_BoardName.HeaderText = ResourceCulture.GetString("boardName", "程序名称");
this.Column_bomName.HeaderText = ResourceCulture.GetString("bomName", "Bom名称");
this.Column_num.HeaderText = ResourceCulture.GetString("poingtNum", "组装数量");
this.Column_NeedAdd.HeaderText = ResourceCulture.GetString("NeedAdd", "需要添加");
}
private void FrmSureAddCom_Load(object sender, EventArgs e)
{
LanguageProcess();
LanguagePro();
}
private void LoadBoardInfo()
{
this.dgvList.Rows.Clear();
foreach (BoardInfo board in boardInfos)
{
if (board != null)
{
dgvList.Rows.Add(setBoard(null, board));
}
}
}
private DataGridViewRow setBoard(DataGridViewRow view, BoardInfo board)
{
if (view == null)
{
view = new DataGridViewRow();
view.CreateCells(dgvList);
}
view.Cells[Column_NeedAdd.Index].Value = true;
view.Cells[Column_bomName.Index].Value = board.bomName;
view.Cells[Column_BoardName.Index].Value = board.boardName;
view.Cells[Column_num.Index].Value = board.smtList.Count;
return view;
}
private bool isRun = false;
private bool IsProcess = false;
private void timer_Elapsed(object sender, EventArgs e)
{
if (IsProcess) { return; }
IsProcess = true;
IsProcess = false;
}
private void FrmBoardInfo_FormClosing(object sender, FormClosingEventArgs e)
{
}
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex != -1 && e.ColumnIndex >= 0)
{
}
}
private void btnSave_Click(object sender, EventArgs e)
{
SelBoardList = new List<BoardInfo>();
for (int i = 0; i < dgvList.Rows.Count; i++)
{
bool check = Convert.ToBoolean(dgvList.Rows[i].Cells[Column_NeedAdd.Index].Value);
if (check)
{
string boardName = Convert.ToString(dgvList.Rows[i].Cells[Column_BoardName.Index].Value);
var v = (from m in boardInfos where m.boardName == boardName select m).FirstOrDefault();
if (v != null)
{
SelBoardList.Add(v);
}
}
}
this.DialogResult = DialogResult.OK;
Close();
}
private void btnClose_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
Close();
}
}
}
<?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>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="dataGridViewImageColumn1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vAAADrwBlbxySQAAANJJREFUSEvtk1EKhSAQRV1AWPbbPtr/d/20g2wdBT7ugCI2qSO89/HowICOXk8J
KvcjVNr4Fq/IretKJUUkstY6pRQVxhKqRbGkRVYlOo7jJvGFtRqKon3fw6HTNLFj7CmRFcXXNY4j9fwc
GGPCvHSNj6JY0vd96McigLUaGSuKJfjqmFQEhmEoym6iZVnYP/FwIqC1Dms4I+WWwGPEZgQ5nkSg6zpa
4x40m9i2zV3XlbaJnOg8T8py8IkMOVEOceIVecSJ/xPN80wlRSxq5RU18wEin6KUsYhaUAAAAABJRU5E
rkJggg==
</value>
</data>
<data name="dataGridViewImageColumn2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vAAADrwBlbxySQAAAOBJREFUSEvtk00KhDAMRrsW8W/rPbz/Whd6A/UagmT4AhNCrNoMzMCADwqS+OW1
hQb6EcEWvsUjoq7reHlxi0IIvLy4E4/ojTvxn6JxHGnbNltmrkT7vtM0TbbMHBJ93/OgLMtsi7kSlWXJ
PcywHBLDMMiwPM9t+1RUVZX0MMNyTBDRsiwSwi41MVFd11JHNkZUBLSsKAqpW5E+yZkEnIqAlmHXQIua
pkmSgEsRmOdZhrVtG/3GP3fcisC6rjLULvRSSBIBfY2p16VJFgEt80iASwTwRmLv5A636FMe0ce8AOLD
ooiEexQfAAAAAElFTkSuQmCC
</value>
</data>
<metadata name="Column_NeedAdd.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_BoardName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_bomName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_num.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>82</value>
</metadata>
</root>
\ No newline at end of file \ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!