| | |
| | | } |
| | | if (LoadAllPLCSettings(GlobalVar.allPlcSettingsPath)) |
| | | { |
| | | LogInfo("PLC通讯加载成功", LogInfoType.PASS); |
| | | LogInfo("PLC通讯配置加载成功", LogInfoType.PASS); |
| | | } |
| | | else |
| | | { |
| | | LogInfo("PLC通讯加载失败", LogInfoType.ERROR); |
| | | LogInfo("PLC通讯配置加载失败", LogInfoType.ERROR); |
| | | } |
| | | if (LoadAllMPlcDatas(GlobalVar.allMPlcDatasPath)) |
| | | { |
| | | LogInfo("运动控制配置加载成功", LogInfoType.PASS); |
| | | } |
| | | else |
| | | { |
| | | LogInfo("运动控制配置加载失败", LogInfoType.ERROR);//LoadAllMPlcDatas |
| | | } |
| | | //加载相机 |
| | | foreach (BaseCamera camera in GlobalVar.dicCameras.Values) |
| | |
| | | SaveSerialPorts(); |
| | | SaveAllBarcodeReaders(); |
| | | SaveAllPLCSettings(); |
| | | SaveAllMPlcDatas(); |
| | | } |
| | | |
| | | |
| | |
| | | return true; |
| | | } |
| | | |
| | | public bool SaveAllMPlcDatas() |
| | | { |
| | | try |
| | | { |
| | | ConfigManager<Dictionary<string, Dictionary<string, PlcConfig>>>.SaveConfig<Dictionary<string, Dictionary<string, PlcConfig>>>(GlobalVar.dicMPlcDatas, GlobalVar.allMPlcDatasPath); |
| | | return true; |
| | | } |
| | | catch { return false; } |
| | | } |
| | | |
| | | public bool LoadAllMPlcDatas(string allBarcodeReadersConnectionStringPath) |
| | | { |
| | | try |
| | | { |
| | | GlobalVar.dicMPlcDatas = ConfigManager<Dictionary<string, Dictionary<string, PlcConfig>>>.LoadConfig<Dictionary<string, Dictionary<string, PlcConfig>>>(allBarcodeReadersConnectionStringPath); |
| | | } |
| | | catch |
| | | { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | public bool SaveAllBarcodeReaders() |
| | | { |
| | | try |