Commit 0ac16077 LN

修改:数量为0导入后无法补料

1 个父辈 36e5869a
...@@ -575,12 +575,20 @@ namespace TSA_V.LoadCSVLibrary ...@@ -575,12 +575,20 @@ namespace TSA_V.LoadCSVLibrary
foreach (string proName in propertyList) foreach (string proName in propertyList)
{ {
PropertyInfo prop = props.First(c => c.Name == proName);//获取同名属性 try
if (prop != null) {
{//如果属性存在 PropertyInfo prop = props.First(c => c.Name == proName);//获取同名属性
string value = prop.GetValue(position, null).ToString(); if (prop != null)
int index = propIndexMap[proName]; {//如果属性存在
array[index] = value; string value = prop.GetValue(position, null).ToString();
int index = propIndexMap[proName];
array[index] = value;
}
}
catch (Exception ex)
{
LogUtil.error(ex.ToString());
} }
} }
......
...@@ -42,7 +42,7 @@ namespace TSA_V.LoadCSVLibrary ...@@ -42,7 +42,7 @@ namespace TSA_V.LoadCSVLibrary
///数量 ///数量
/// </summary> /// </summary>
[CSVAttribute("Count", true, "数量", "Quantity")] [CSVAttribute("Count", true, "数量", "Quantity")]
public string ComCount { get; set; } public string ComCount { get; set; } = "0";
/// <summary> /// <summary>
///X坐标 ///X坐标
/// </summary> /// </summary>
......
...@@ -32,7 +32,7 @@ namespace TSA_V.DeviceLibrary ...@@ -32,7 +32,7 @@ namespace TSA_V.DeviceLibrary
int zhao = (int)(freespace / 1024); int zhao = (int)(freespace / 1024);
if (zhao < checkZhao) if (zhao < checkZhao)
{ {
LogUtil.error(volume + "盘剩余空间:" + zhao + "G, 不再保存识别图片"); LogUtil.error(volume + "盘剩余空间:" + zhao + "G, 不再保存图片");
return false; return false;
} }
} }
......
...@@ -70,15 +70,19 @@ namespace TSA_V ...@@ -70,15 +70,19 @@ namespace TSA_V
} }
currIndex = 0; currIndex = 0;
ShowCom(); ShowCom();
if (TSAVBean.Status <= TSAVStatus.Wait) //if (!Setting_NInit.App_IsDebug)
{ {
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.DeviceNotOk, "设备未连接,无法备料!")); if (TSAVBean.Status <= TSAVStatus.Wait)
return false; {
} MessageBox.Show(ResourceCulture.GetString(ResourceCulture.DeviceNotOk, "设备未连接,无法备料!"));
else if (TSAVBean.Status.Equals(TSAVStatus.Reset)) return false;
{ }
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.DeviceInReset, "设备正在重置中,请稍后再备料!")); else if (TSAVBean.Status.Equals(TSAVStatus.Reset))
return false; {
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.DeviceInReset, "设备正在重置中,请稍后再备料!"));
return false;
}
} }
return true; return true;
} }
......
...@@ -510,50 +510,58 @@ namespace TSA_V ...@@ -510,50 +510,58 @@ namespace TSA_V
private void btnReplenish_Click(object sender, EventArgs e) private void btnReplenish_Click(object sender, EventArgs e)
{ {
try
if (WorkModeUtil.OnlyGB)
{ {
string msg = ResourceControl.GetString("GuobanMode", "操作失败,当前为过板模式"); if (WorkModeUtil.OnlyGB)
MessageBoxMidle.Show(this, msg, ResourceCulture.GetString("提示"), MessageBoxButtons.OK, MessageBoxIcon.Error); {
return; string msg = ResourceControl.GetString("GuobanMode", "操作失败,当前为过板模式");
} MessageBoxMidle.Show(this, msg, ResourceCulture.GetString("提示"), MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
List<BoardInfo> listb = new List<BoardInfo>(BoardManager.boardList); List<BoardInfo> listb = new List<BoardInfo>(BoardManager.boardList);
var ls = listb.Select((point) => { return point.boardName; }).ToList(); var ls = listb.Select((point) => { return point.boardName; }).ToList();
FrmSelectPoint frma = new FrmSelectPoint(ResourceCulture.GetString("FrmBoardSelect_Text", "请选择程序"), ls, 0); FrmSelectPoint frma = new FrmSelectPoint(ResourceCulture.GetString("FrmBoardSelect_Text", "请选择程序"), ls, 0);
DialogResult result = frma.ShowDialog(); DialogResult result = frma.ShowDialog();
if (result.Equals(DialogResult.OK)) if (result.Equals(DialogResult.OK))
{
BoardInfo board = listb[frma.SelectIndex];
List<ComponetInfo> allList = CSVBomManager.GetComList(board.bomName);
List<SMTPointInfo> plist = (from m in board.smtList where m.Disable.Equals(false) select m).ToList();
List<ComponetInfo> list = new List<ComponetInfo>();
foreach (ComponetInfo p in allList)
{ {
List<SMTPointInfo> hasList = new List<SMTPointInfo>(); BoardInfo board = listb[frma.SelectIndex];
if (String.IsNullOrEmpty(p.TagNo)) List<ComponetInfo> allList = CSVBomManager.GetComList(board.bomName);
{ List<SMTPointInfo> plist = (from m in board.smtList where m.Disable.Equals(false) select m).ToList();
hasList = (from m in plist where m.PN.Equals(p.PN) select m).ToList(); List<ComponetInfo> list = new List<ComponetInfo>();
} foreach (ComponetInfo p in allList)
else
{ {
hasList = (from m in plist where m.TagNo.Equals(p.TagNo) select m).ToList(); List<SMTPointInfo> hasList = new List<SMTPointInfo>();
} if (String.IsNullOrEmpty(p.TagNo))
{
hasList = (from m in plist where m.PN.Equals(p.PN) select m).ToList();
}
else
{
hasList = (from m in plist where m.TagNo.Equals(p.TagNo) select m).ToList();
}
if (hasList.Count > 0) if (hasList.Count > 0)
{
list.Add(p);
}
}
list = (from m in list orderby m.PN ascending select m).ToList();
FrmBoardPutCom frm = new FrmBoardPutCom();
if (frm.SetOperateInfo(board, board.bomName, list))
{ {
list.Add(p); this.Visible = false;
frm.ShowDialog();
this.Visible = true;
} }
} }
list = (from m in list orderby m.PN ascending select m).ToList();
FrmBoardPutCom frm = new FrmBoardPutCom(); }
if (frm.SetOperateInfo(board, board.bomName, list)) catch (Exception ex)
{ {
this.Visible = false; LogUtil.error("btnReplenish_Click 出错:" + ex.ToString());
frm.ShowDialog(); MessageBox.Show(ex.ToString());
this.Visible = true;
}
} }
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!