change - PLC 配置文件添加启用标识

pull/1/head
wenjy 10 months ago
parent b09b3c33a3
commit f1345b3d28

@ -29,5 +29,10 @@ namespace SlnMesnac.Config
/// PLC Key
/// </summary>
public string plcKey { get; set; }
/// <summary>
/// 是否启用
/// </summary>
public bool isFlage { get; set; }
}
}

@ -42,10 +42,13 @@ namespace SlnMesnac.Plc
if (_appConfig.plcConfig != null)
{
foreach (var item in _appConfig.plcConfig)
{
if (item.isFlage)
{
AddPlc(item.plcType, item.plcIp, item.plcPort, item.plcKey);
}
}
}
else
{
_logger.LogInformation("PLC配置信息为空");

@ -27,14 +27,16 @@
"plcType": "MelsecBinaryPlc",
"plcIp": "127.0.0.1",
"plcPort": 6000,
"plcKey": "mcs"
"plcKey": "mcs",
"isFlage": false
},
{
"configId": 2,
"plcType": "MelsecBinaryPlc",
"plcIp": "127.0.0.1",
"plcPort": 6000,
"plcKey": "cwss"
"plcKey": "cwss",
"isFlage": false
}
]
}

Loading…
Cancel
Save