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

master
wenjy 10 months ago
parent b09b3c33a3
commit f1345b3d28

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

@ -43,7 +43,10 @@ namespace SlnMesnac.Plc
{ {
foreach (var item in _appConfig.plcConfig) foreach (var item in _appConfig.plcConfig)
{ {
AddPlc(item.plcType, item.plcIp, item.plcPort, item.plcKey); if (item.isFlage)
{
AddPlc(item.plcType, item.plcIp, item.plcPort, item.plcKey);
}
} }
} }
else else

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

Loading…
Cancel
Save