领胜LDS 键盘AOI检测项目
xcd
2020-07-10 d437e53b2eea04f88217d719abc8d34ba5b25c2c
src/Bro.UI.Config/MenuForms/FrmConfig.cs
@@ -1,6 +1,10 @@
using Bro.Common.Interface;
using Bro.UI.Model.Winform;
using System;
using Microsoft.VisualBasic;
using System.Windows.Forms;
using Bro.Common.PubSub;
using static Bro.Common.Helper.EnumHelper;
namespace Bro.UI.Config.MenuForms
{
@@ -46,5 +50,24 @@
            Process.SaveProcessConfig(propGrid.SelectedObject as IProcessConfig);
            LogAsync(DateTime.Now, "配置保存完成");
        }
        private void buttonCreateConfig_Click(object sender, EventArgs e)
        {
            ProductionCodeEditForm productionCodeEditForm = new ProductionCodeEditForm();
            if (productionCodeEditForm.ShowDialog(this) == DialogResult.OK)
            {
                string pCode = productionCodeEditForm.PCode;
                productionCodeEditForm.Dispose();
                if (string.IsNullOrWhiteSpace(pCode))
                {
                    MessageBox.Show("请输入产品编码!");
                    return;
                }
                Process.CreateNewConfig(propGrid.SelectedObject as IProcessConfig, pCode);
                MessageBox.Show("创建新配置完成");
                PubSubCenter.GetInstance().Publish(PubSubCenterMessageType.UpdateProductionCodes.ToString(), null, null);
            }
        }
    }
}