领胜LDS 键盘AOI检测项目
xcd
2020-08-01 c44c1b442fde596c1d20c0ad82e4d308f71ec806
src/Bro.Process/ProcessControl.cs
@@ -348,10 +348,16 @@
            {
                if (config == null)
                    throw new ProcessException("保存的配置信息不能为空");
                ProductionCode = newProductionCode;
                string newConfigPath = Path.Combine(Path.GetDirectoryName(_configPath), $"Config_{newProductionCode}.json");
                if (File.Exists(newConfigPath))
                {
                    throw new ProcessException($"{newProductionCode}配置文件已经存在");
                }
                //生成config.json
                string newConfig = JsonConvert.SerializeObject(config, new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.All });
                using (StreamWriter writer = new StreamWriter(_configPath, false, System.Text.Encoding.UTF8))
                using (StreamWriter writer = new StreamWriter(newConfigPath, false, System.Text.Encoding.UTF8))
                {
                    writer.Write(newConfig);
                    writer.Flush();
@@ -359,7 +365,7 @@
                }
                //添加到Setting.json
                SettingHelper.AddNewProductionCode(ProductionCode);
                SettingHelper.AddNewProductionCode(newProductionCode);
            }
            catch (Exception ex)
            {