Commit ec36f8f8 LN

bom导入可支持一个元器件多个库位

1 个父辈 2512d66f
......@@ -297,94 +297,6 @@ namespace TSA_V.LoadCSVLibrary
index++;
}
#region 旧代码
//Dictionary<string, string> pnposlist = new Dictionary<string, string>();
//HashSet<string> usedposlist = new HashSet<string>();
//List<ComponetInfo> componetlist = new List<ComponetInfo>();
//int Id = 1;
//foreach (var com in comList)
//{
// if (string.IsNullOrWhiteSpace(com.PositionNum))
// continue;
// string[] strarr = GetPositionNum(com.PositionNum);
// string[] intarr = com.ComCount.Split(';');
// if (strarr.Length != +intarr.Length)
// {
// MessageBox.Show($"{com.PN}的数量分组{intarr.Length}和位置分组{strarr.Length},不统一!");
// return new List<ComponetInfo>();
// }
// else if (intarr.Length == 1 && strarr.Length == 1)
// {
// com.Id = Id;
// componetlist.Add(com);
// Id++;
// continue;
// }
// int j = 0;
// foreach (var item in strarr)
// {
// ComponetInfo componet = new ComponetInfo();
// string tagno = com.TagNo;
// int comid = Id + 1;
// if (j != 0)
// {
// tagno = "";
// comid = 0;
// }
// componet.Id = comid;
// componet.TagNo = tagno;
// componet.PositionX = com.PositionX;
// componet.PositionNum = item;
// componet.PN = com.PN;
// componet.Text = com.Text;
// componet.ComCount = intarr[j];
// componet.ComponentDes = com.ComponentDes;
// componet.Notes = com.Notes;
// componetlist.Add(componet);
// if (!string.IsNullOrEmpty(com.PositionNum))
// {
// usedposlist.Add(com.PositionNum);
// pnposlist[com.PN] = com.PositionNum;
// }
// j++;
// Id++;
// }
// //if (!string.IsNullOrEmpty(com.PositionNum))
// //{
// // usedposlist.Add(com.PositionNum);
// // pnposlist[com.PN] = com.PositionNum;
// //}
//}
//List<ComponetInfo> componedate = componetlist.Where(m => !m.PositionNum.Contains(";")).ToList();
//foreach (var com in componedate)
//{
// if (string.IsNullOrWhiteSpace(com.PositionNum) && !string.IsNullOrWhiteSpace(com.PN))
// {
// if (pnposlist.ContainsKey(com.PN))
// com.PositionNum = pnposlist[com.PN];
// else
// {
// foreach (var p in CSVPositionReader<TSAVPosition>.allPositionMap)
// {
// if (usedposlist.Contains(p.Value.PositionNum))
// continue;
// com.PositionNum = p.Value.PositionNum;
// pnposlist[com.PN] = com.PositionNum;
// usedposlist.Add(com.PositionNum);
// break;
// }
// }
// }
// //if (String.IsNullOrEmpty(com.PositionNum) || String.IsNullOrEmpty(com.PN))
// //{
// // LOGGER.Error("读取csv,数据不完整,跳过数据,line=" + com.TagNo);
// // continue;
// //}
//}
#endregion
return CreateCompone(comList);
}
......
......@@ -391,6 +391,18 @@ namespace TSA_V.DeviceLibrary
}
return null;
}
public static List<BoardInfo> getBoardByBomName(string bomName)
{
List<BoardInfo> list = new List<BoardInfo>();
foreach (BoardInfo board in boardList)
{
if (board.boardName.Equals(bomName))
{
list.Add(board);
}
}
return list;
}
/// <summary>
/// 修正前备份
/// </summary>
......
......@@ -356,7 +356,7 @@ namespace TSA_V.frmBoard
}
else
{
this.componetInfos = frmViewer.dataList;
this.componetInfos =CSVBomManager.CreateCompone( frmViewer.dataList);
this.DialogResult = DialogResult.OK;
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!