领胜LDS 键盘AOI检测项目
xcd
2020-07-02 a332decd68d6d8bb5678d8ec95e6c65e0ccf9f33
src/Bro.Process/ProcessControl.cs
@@ -342,6 +342,31 @@
            }
        }
        public void CreateNewConfig(IProcessConfig config, string newProductionCode)
        {
            try
            {
                if (config == null)
                    throw new ProcessException("保存的配置信息不能为空");
                ProductionCode = newProductionCode;
                //生成config.json
                string newConfig = JsonConvert.SerializeObject(config, new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.All });
                using (StreamWriter writer = new StreamWriter(_configPath, false, System.Text.Encoding.UTF8))
                {
                    writer.Write(newConfig);
                    writer.Flush();
                    writer.Close();
                }
                //添加到Setting.json
                SettingHelper.AddNewProductionCode(ProductionCode);
            }
            catch (Exception ex)
            {
                throw new ProcessException(ex.Message, null);
            }
        }
        private void SaveBackupConfig()
        {
            string backPath = Path.GetDirectoryName(_configPath);