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

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

parent d8fb684b
No preview for this file type
...@@ -213,17 +213,14 @@ namespace Autogen_WS ...@@ -213,17 +213,14 @@ namespace Autogen_WS
return false; return false;
} }
string plc_addr; string plc_addr = sheet.Cells[iRow, i_plcAddr].GetValue<string>();
try if (string.IsNullOrEmpty(plc_addr))//没有填写地址,这个寄存器不需要
{ goto _next;
plc_addr = sheet.Cells[iRow, i_plcAddr].Value.ToString();
} plc_addr = plc_addr.Trim();
catch if (string.IsNullOrEmpty(plc_addr))
{ goto _next;
//空的
ErrorMsgbox?.Invoke("没有PLC地址 描述=" + ii.propDescription);
return false;
}
if (!analysisAddr.Resolve(plc_addr, out ii.plcIndex, out ii.regType, out ii.mbAddr)) if (!analysisAddr.Resolve(plc_addr, out ii.plcIndex, out ii.regType, out ii.mbAddr))
{ {
...@@ -266,7 +263,7 @@ namespace Autogen_WS ...@@ -266,7 +263,7 @@ namespace Autogen_WS
} }
_next:
iRow++; iRow++;
Progress += 1; Progress += 1;
if (Progress >= 100) 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