Commit 57f23ad0 LN

1

1 个父辈 f1b1963e
...@@ -476,7 +476,7 @@ namespace TSA_V.LoadCSVLibrary ...@@ -476,7 +476,7 @@ namespace TSA_V.LoadCSVLibrary
/// 减去此电路板使用的元器件数量 /// 减去此电路板使用的元器件数量
/// </summary> /// </summary>
/// <param name="currBoard"></param> /// <param name="currBoard"></param>
public static bool DelUseCount(DeviceLibrary.BoardInfo currBoard,int maxIndex) public static bool DelUseCount(DeviceLibrary.BoardInfo currBoard, List<ComponetInfo> useComponets)
{ {
try try
{ {
...@@ -486,46 +486,47 @@ namespace TSA_V.LoadCSVLibrary ...@@ -486,46 +486,47 @@ namespace TSA_V.LoadCSVLibrary
{ {
return false; return false;
} }
Dictionary<string, int> useCount = new Dictionary<string, int>(); //Dictionary<string, int> useCount = new Dictionary<string, int>();
int index = 0; //int index = 0;
List<SMTPointInfo> list = currBoard.GetSmtList(); //List<SMTPointInfo> list = currBoard.GetSmtList();
foreach (SMTPointInfo smt in list) //foreach (SMTPointInfo smt in list)
{ //{
if (index > maxIndex) // if (index > maxIndex)
{ // {
break; // break;
} // }
ComponetInfo com = CSVBomManager.GetCom(BoardManager.CurrBoard.bomName, smt); // ComponetInfo com = CSVBomManager.GetCom(BoardManager.CurrBoard.bomName, smt);
if (useCount.ContainsKey(com.PN)) // if (useCount.ContainsKey(com.PN))
{ // {
useCount[com.PN]++; // useCount[com.PN]++;
} // }
else // else
{ // {
useCount.Add(com.PN, 1); // useCount.Add(com.PN, 1);
} // }
index++; // index++;
} //}
List<ComponetInfo> newList = new List<ComponetInfo>(); List<ComponetInfo> newList = new List<ComponetInfo>();
foreach (ComponetInfo obj in comList) foreach (ComponetInfo obj in comList)
{ {
if (useCount.ContainsKey(obj.PN)) List<ComponetInfo> list = (from m in useComponets where m.Id.Equals(obj.Id) select m).ToList();
if (list.Count > 0)
{ {
obj.ComCount = obj.ComCount - useCount[obj.PN]; obj.ComCount = obj.ComCount - list.Count;
if (obj.ComCount < 0) if (obj.ComCount < 0)
{ {
obj.ComCount = 0; obj.ComCount = 0;
} }
} }
newList.Add(obj); newList.Add(obj);
} }
if (allComMap.ContainsKey(bomName)) if (allComMap.ContainsKey(bomName))
{ {
allComMap[bomName] = newList; allComMap[bomName] = newList;
} }
CSVBomManager.SaveBomToFile(bomName, newList); CSVBomManager.SaveBomToFile(bomName, newList);
}catch(Exception ex) }
catch (Exception ex)
{ {
} }
......
...@@ -33,28 +33,22 @@ namespace TSA_V.DeviceLibrary ...@@ -33,28 +33,22 @@ namespace TSA_V.DeviceLibrary
public List<WaitResultInfo> waitList = new List<WaitResultInfo>(); public List<WaitResultInfo> waitList = new List<WaitResultInfo>();
public DateTime endWorkTime = DateTime.Now; public DateTime endWorkTime = DateTime.Now;
public DateTime LastSetpTime = DateTime.Now; public DateTime LastSetpTime = DateTime.Now;
public uint PreNodeId = 0; public uint PreNodeId = 0;
//public List<SMTPointInfo> needSoldSmtList = new List<SMTPointInfo>();
//public List<SMTPointInfo> needCheckSmtList = new List<SMTPointInfo>();
public List<SMTPointInfo> needWorkSmtList = new List<SMTPointInfo>(); public List<SMTPointInfo> needWorkSmtList = new List<SMTPointInfo>();
//开始工作后共工作了几块电路板 //开始工作后共工作了几块电路板
public int BoardCount = 0; public int BoardCount = 0;
public DateTime beginWorkTime = DateTime.Now; public DateTime beginWorkTime = DateTime.Now;
public bool IsShowAOI = false; public bool IsShowAOI = false;
//public bool IsShowSoldering = false; private List<ComponetInfo> useComponets = new List<ComponetInfo>();
public void StartWork(BoardInfo boardInfo) public void StartWork(BoardInfo boardInfo)
{ {
//StatusClient.instance.SendNew(Color.Green, "扫码成功:" + BoardManager.CurrBoard.boardCode); //StatusClient.instance.SendNew(Color.Green, "扫码成功:" + BoardManager.CurrBoard.boardCode);
beginWorkTime = DateTime.Now; beginWorkTime = DateTime.Now;
//开始工作 //开始工作
LogUtil.info("开始程序【" + boardInfo.boardName + "】的插件"); LogUtil.info("开始程序【" + boardInfo.boardName + "】的插件");
// StatusClient.instance.SendNew(Color.Green, "开始组装【" + boardInfo.boardName + "】" ); currBoard = boardInfo;
currBoard = boardInfo;
//needSoldSmtList = (from m in currBoard.smtList where m.NeedSoldering.Equals(true) select m).ToList<SMTPointInfo>();
//needCheckSmtList = (from m in currBoard.smtList where m.NeedCheck.Equals(true) select m).ToList<SMTPointInfo>();
needWorkSmtList = currBoard.GetSmtList(); needWorkSmtList = currBoard.GetSmtList();
currIndex = -1; currIndex = -1;
//IsShowSoldering = false;
IsShowAOI = false; IsShowAOI = false;
currPoint = null; currPoint = null;
IsWorking = true; IsWorking = true;
...@@ -93,7 +87,8 @@ namespace TSA_V.DeviceLibrary ...@@ -93,7 +87,8 @@ namespace TSA_V.DeviceLibrary
if (currIndex > 0 && currBoard != null) if (currIndex > 0 && currBoard != null)
{ {
//如果是下一个并且当前是最后一个,其实是切换了新程序,需要减去刚刚的数量 //如果是下一个并且当前是最后一个,其实是切换了新程序,需要减去刚刚的数量
CSVBomManager.DelUseCount(currBoard, currIndex); CSVBomManager.DelUseCount(currBoard, useComponets);
useComponets = new List<ComponetInfo>();
} }
DeviceStatus deviceStatus = MesUtil.GetCurrStatus(); DeviceStatus deviceStatus = MesUtil.GetCurrStatus();
if (MesUtil.CodeISOk) if (MesUtil.CodeISOk)
...@@ -210,6 +205,7 @@ namespace TSA_V.DeviceLibrary ...@@ -210,6 +205,7 @@ namespace TSA_V.DeviceLibrary
if (com != null) if (com != null)
{ {
position = CSVPositionReader<TSAVPosition>.GetPositonByNum(com.PositionNum); position = CSVPositionReader<TSAVPosition>.GetPositonByNum(com.PositionNum);
useComponets.Add(com);
} }
else else
{ {
...@@ -234,7 +230,8 @@ namespace TSA_V.DeviceLibrary ...@@ -234,7 +230,8 @@ namespace TSA_V.DeviceLibrary
if (isNext && (currIndex == 0)) if (isNext && (currIndex == 0))
{ {
BoardCount++; BoardCount++;
CSVBomManager.DelUseCount(currBoard, GetSmtList().Count); CSVBomManager.DelUseCount(currBoard, useComponets);
useComponets = new List<ComponetInfo>();
} }
} }
//焊接工作 //焊接工作
......
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
<!--AOI程序文件夹--> <!--AOI程序文件夹-->
<add key="AOIFileConfig" value="\config\AOIConfig\" /> <add key="AOIFileConfig" value="\config\AOIConfig\" />
<!--是否启动AOI--> <!--是否启动AOI-->
<add key="IsNeedAOI" value="0" /> <add key="IsNeedAOI" value="1" />
<add key="DefaultPointSize" value="5" /> <add key="DefaultPointSize" value="5" />
<add key="DefaultPointType" value="1" /> <add key="DefaultPointType" value="1" />
<add key="Config_Pwd" value="123456" /> <add key="Config_Pwd" value="123456" />
......
...@@ -51,7 +51,7 @@ namespace TSA_V ...@@ -51,7 +51,7 @@ namespace TSA_V
} }
if (!(BoardManager.getBoardByName(board.boardName) == null)) if (!(BoardManager.getBoardByName(board.boardName) == null))
{ {
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.PNameExist, "程序名【" + board.boardName + "】已存在,请重新输入!")); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.PNameExist, "程序名【{0}】已存在,请重新输入!", board.boardName));
txtBoardName.Focus(); txtBoardName.Focus();
return false ; return false ;
} }
......
...@@ -149,7 +149,7 @@ namespace TSA_V ...@@ -149,7 +149,7 @@ namespace TSA_V
} }
else else
{ {
con.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); con.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
} }
} }
// con.Refresh(); // con.Refresh();
...@@ -184,7 +184,7 @@ namespace TSA_V ...@@ -184,7 +184,7 @@ namespace TSA_V
} }
else else
{ {
con.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); con.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
} }
} }
// con.Refresh(); // con.Refresh();
......
...@@ -303,6 +303,7 @@ namespace TSA_V ...@@ -303,6 +303,7 @@ namespace TSA_V
point.Notes = row.Cells[this.Column_Notes.Name].Value.ToString(); point.Notes = row.Cells[this.Column_Notes.Name].Value.ToString();
point.PositionNum = row.Cells[this.Column_Position.Name].Value.ToString(); point.PositionNum = row.Cells[this.Column_Position.Name].Value.ToString();
point.ComCount = Convert.ToInt32(row.Cells[this.Column_Count.Name].Value.ToString()); point.ComCount = Convert.ToInt32(row.Cells[this.Column_Count.Name].Value.ToString());
point.Id = Convert.ToInt32(row.Cells[this.Column_ID.Name].Value.ToString());
} }
catch (Exception ex) catch (Exception ex)
...@@ -366,7 +367,7 @@ namespace TSA_V ...@@ -366,7 +367,7 @@ namespace TSA_V
this.cmbPositionNumList.SelectedIndex = selPosIndex; this.cmbPositionNumList.SelectedIndex = selPosIndex;
} }
groupInfo.Text = ResourceCulture.GetString( ResourceCulture.ComInfo, "元器件【{ 0}】的基本信息",obj.TagNo+" -"+obj.PN); groupInfo.Text = ResourceCulture.GetString( ResourceCulture.ComInfo, "元器件【{ 0}】的基本信息",obj.TagNo+" "+obj.PN);
} }
private void DeleteCom(int rowIndex) private void DeleteCom(int rowIndex)
{ {
...@@ -383,7 +384,7 @@ namespace TSA_V ...@@ -383,7 +384,7 @@ namespace TSA_V
if (MessageBox.Show( if (MessageBox.Show(
ResourceCulture.GetString(ResourceCulture.SureDelCom, "确认要删除元器件【{0}】吗?", obj.TagNo + "-" + obj.PN), ResourceCulture.GetString(ResourceCulture.SureDelCom, "确认要删除元器件【{0}】吗?", obj.TagNo + " " + obj.PN),
ResourceCulture.GetString(ResourceCulture.MsgTitle, "提示"), ResourceCulture.GetString(ResourceCulture.MsgTitle, "提示"),
MessageBoxButtons.OKCancel, MessageBoxButtons.OKCancel,
...@@ -401,7 +402,7 @@ namespace TSA_V ...@@ -401,7 +402,7 @@ namespace TSA_V
} }
//this.dgvList.Rows.RemoveAt(rowIndex); //this.dgvList.Rows.RemoveAt(rowIndex);
UpdateGridList(newlist); UpdateGridList(newlist);
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.DelComOk, "元器件【{0}】删除成功!", obj.TagNo + "-" + obj.PN) MessageBox.Show(ResourceCulture.GetString(ResourceCulture.DelComOk, "元器件【{0}】删除成功!", obj.TagNo + " " + obj.PN)
, ResourceCulture.GetString(ResourceCulture.MsgTitle, "提示")); , ResourceCulture.GetString(ResourceCulture.MsgTitle, "提示"));
} }
} }
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
this.btnPre = new System.Windows.Forms.Button(); this.btnPre = new System.Windows.Forms.Button();
this.btnSaveAndNext = new System.Windows.Forms.Button(); this.btnSaveAndNext = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.cmbPnList = new System.Windows.Forms.ComboBox();
this.lblNotes = new System.Windows.Forms.Label(); this.lblNotes = new System.Windows.Forms.Label();
this.chbCheck = new System.Windows.Forms.CheckBox(); this.chbCheck = new System.Windows.Forms.CheckBox();
this.txtWeldTemp = new System.Windows.Forms.TextBox(); this.txtWeldTemp = new System.Windows.Forms.TextBox();
...@@ -53,7 +54,6 @@ ...@@ -53,7 +54,6 @@
this.btnCancel = new System.Windows.Forms.Button(); this.btnCancel = new System.Windows.Forms.Button();
this.btnSave = new System.Windows.Forms.Button(); this.btnSave = new System.Windows.Forms.Button();
this.xyMoveControl1 = new UserFromControl.ProjectorControl(); this.xyMoveControl1 = new UserFromControl.ProjectorControl();
this.cmbPnList = new System.Windows.Forms.ComboBox();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
// //
this.btnPre.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnPre.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnPre.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnPre.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnPre.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnPre.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnPre.Location = new System.Drawing.Point(46, 563); this.btnPre.Location = new System.Drawing.Point(46, 563);
this.btnPre.Name = "btnPre"; this.btnPre.Name = "btnPre";
this.btnPre.Size = new System.Drawing.Size(120, 45); this.btnPre.Size = new System.Drawing.Size(120, 45);
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
// //
this.btnSaveAndNext.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnSaveAndNext.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnSaveAndNext.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnSaveAndNext.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSaveAndNext.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnSaveAndNext.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSaveAndNext.Location = new System.Drawing.Point(300, 563); this.btnSaveAndNext.Location = new System.Drawing.Point(300, 563);
this.btnSaveAndNext.Name = "btnSaveAndNext"; this.btnSaveAndNext.Name = "btnSaveAndNext";
this.btnSaveAndNext.Size = new System.Drawing.Size(120, 45); this.btnSaveAndNext.Size = new System.Drawing.Size(120, 45);
...@@ -115,6 +115,16 @@ ...@@ -115,6 +115,16 @@
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
this.groupBox1.Text = "组装信息"; this.groupBox1.Text = "组装信息";
// //
// cmbPnList
//
this.cmbPnList.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbPnList.FormattingEnabled = true;
this.cmbPnList.Location = new System.Drawing.Point(135, 62);
this.cmbPnList.Name = "cmbPnList";
this.cmbPnList.Size = new System.Drawing.Size(219, 25);
this.cmbPnList.TabIndex = 86;
this.cmbPnList.SelectedIndexChanged += new System.EventHandler(this.cmbPnList_SelectedIndexChanged);
//
// lblNotes // lblNotes
// //
this.lblNotes.Location = new System.Drawing.Point(6, 179); this.lblNotes.Location = new System.Drawing.Point(6, 179);
...@@ -275,7 +285,7 @@ ...@@ -275,7 +285,7 @@
// //
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
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("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCancel.Location = new System.Drawing.Point(427, 563); this.btnCancel.Location = new System.Drawing.Point(427, 563);
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);
...@@ -288,7 +298,7 @@ ...@@ -288,7 +298,7 @@
// //
this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSave.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnSave.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSave.Location = new System.Drawing.Point(173, 563); this.btnSave.Location = new System.Drawing.Point(173, 563);
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);
...@@ -314,16 +324,6 @@ ...@@ -314,16 +324,6 @@
this.xyMoveControl1.XValue = 1D; this.xyMoveControl1.XValue = 1D;
this.xyMoveControl1.YValue = 1D; this.xyMoveControl1.YValue = 1D;
// //
// cmbPnList
//
this.cmbPnList.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbPnList.FormattingEnabled = true;
this.cmbPnList.Location = new System.Drawing.Point(135, 62);
this.cmbPnList.Name = "cmbPnList";
this.cmbPnList.Size = new System.Drawing.Size(219, 25);
this.cmbPnList.TabIndex = 86;
this.cmbPnList.SelectedIndexChanged += new System.EventHandler(this.cmbPnList_SelectedIndexChanged);
//
// FrmPointInfo // FrmPointInfo
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!