public static void CreateCurrentProcessDirectory(string currentProcess, StandConfigType configType) { var defaultRoot = ConfigurationManager.AppSettings["standConfigRoot"].ToString(); //创建当前工艺文件夹 var burnProductType = defaultRoot + StandCommon.TurnStationConfigPath + currentProcess + "\\" + StandCommon.TurnStationFWName; var sensibilityProductType = defaultRoot + StandCommon.SensibilityStationConfigPath + currentProcess; var shellProductType = defaultRoot + StandCommon.ShellStationConfigPath + currentProcess; var airtageProductType = defaultRoot + StandCommon.AirtageStationConfigPath + currentProcess; var stentProductType = defaultRoot + StandCommon.StentStationConfigPath + currentProcess; var productTestProductType = defaultRoot + StandCommon.ProductFinishStationConfigPath + currentProcess; var productCheckProductType = defaultRoot + StandCommon.CheckProductStationConfigPath + currentProcess; if (configType == StandConfigType.burn) { CreateNewDirectory(burnProductType); } else if (configType == StandConfigType.sensibility) { CreateNewDirectory(sensibilityProductType); } else if (configType == StandConfigType.shell) { CreateNewDirectory(shellProductType); } else if (configType == StandConfigType.airtage) { CreateNewDirectory(airtageProductType); } else if (configType == StandConfigType.stent) { CreateNewDirectory(stentProductType); } else if (configType == StandConfigType.productTest) { CreateNewDirectory(productTestProductType); } else if (configType == StandConfigType.productCheck) { CreateNewDirectory(defaultRoot + StandCommon.CheckProductStationConfigPath + currentProcess); } }
public static bool InitDirectory(StandConfigType configType, bool IsCreateDirectory) { serviceClientTest = new MesServiceTest.MesServiceClient(); var globalConfigPath = AppDomain.CurrentDomain.BaseDirectory + CommConfig.DeafaultConfigRoot; if (!Directory.Exists(globalConfigPath)) { Directory.CreateDirectory(globalConfigPath); } //根据工站新建目录:每个工站下包含所有产品型号得子目录 var processList = serviceClientTest.SelectAllTProcess(); if (processList.Length < 1) { LogHelper.Log.Info("【InitStandConfig】未查询到所有产品"); } var defaultRoot = ConfigurationManager.AppSettings["standConfigRoot"].ToString(); QueryCurrentStandProductDirectory(defaultRoot); var currentProcess = serviceClientTest.SelectCurrentTProcess(); if (currentProcess == "" || currentProcess == "NULL") { MessageBox.Show("请先设置工艺流程!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } //创建当前工艺文件夹 var burnProductType = defaultRoot + StandCommon.TurnStationConfigPath + currentProcess + "\\" + StandCommon.TurnStationFWName; var sensibilityProductType = defaultRoot + StandCommon.SensibilityStationConfigPath + currentProcess; var shellProductType = defaultRoot + StandCommon.ShellStationConfigPath + currentProcess; var airtageProductType = defaultRoot + StandCommon.AirtageStationConfigPath + currentProcess; var stentProductType = defaultRoot + StandCommon.StentStationConfigPath + currentProcess; var productTestProductType = defaultRoot + StandCommon.ProductFinishStationConfigPath + currentProcess; var productCheckProductType = defaultRoot + StandCommon.CheckProductStationConfigPath + currentProcess; if (IsCreateDirectory) { if (configType == StandConfigType.burn) { CreateNewDirectory(burnProductType); } else if (configType == StandConfigType.sensibility) { CreateNewDirectory(sensibilityProductType); } else if (configType == StandConfigType.shell) { CreateNewDirectory(shellProductType); } else if (configType == StandConfigType.airtage) { CreateNewDirectory(airtageProductType); } else if (configType == StandConfigType.stent) { CreateNewDirectory(stentProductType); } else if (configType == StandConfigType.productTest) { CreateNewDirectory(productTestProductType); } else if (configType == StandConfigType.productCheck) { CreateNewDirectory(defaultRoot + StandCommon.CheckProductStationConfigPath + currentProcess); } } return(true); }