Commit 4c2a03d7 authored by 潘栩锋's avatar 潘栩锋 🚴

优化 辅助代码生成 单例对象的 寄存器地址没写,也不会提示出错

parent d8fb684b
No preview for this file type
......@@ -213,17 +213,14 @@ namespace Autogen_WS
return false;
}
string plc_addr;
try
{
plc_addr = sheet.Cells[iRow, i_plcAddr].Value.ToString();
}
catch
{
//空的
ErrorMsgbox?.Invoke("没有PLC地址 描述=" + ii.propDescription);
return false;
}
string plc_addr = sheet.Cells[iRow, i_plcAddr].GetValue<string>();
if (string.IsNullOrEmpty(plc_addr))//没有填写地址,这个寄存器不需要
goto _next;
plc_addr = plc_addr.Trim();
if (string.IsNullOrEmpty(plc_addr))
goto _next;
if (!analysisAddr.Resolve(plc_addr, out ii.plcIndex, out ii.regType, out ii.mbAddr))
{
......@@ -266,7 +263,7 @@ namespace Autogen_WS
}
_next:
iRow++;
Progress += 1;
if (Progress >= 100)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment