/// <summary>
        /// 查询所有工站下的目录
        /// </summary>
        public static void QueryCurrentStandProductDirectory(string defaultRoot)
        {
            if (defaultRoot == "")
            {
                defaultRoot = ConfigurationManager.AppSettings["standConfigRoot"].ToString();
            }
            if (serviceClientTest == null)
            {
                serviceClientTest = new MesServiceTest.MesServiceClient();
            }
            var processList       = serviceClientTest.SelectAllTProcess();
            var burnStandPath     = defaultRoot + StandCommon.TurnStationConfigPath;
            var sensibilityStand  = defaultRoot + StandCommon.SensibilityStationConfigPath;
            var shellStand        = defaultRoot + StandCommon.ShellStationConfigPath;
            var airtageStand      = defaultRoot + StandCommon.AirtageStationConfigPath;
            var stentStand        = defaultRoot + StandCommon.StentStationConfigPath;
            var productTestStand  = defaultRoot + StandCommon.ProductFinishStationConfigPath;
            var productCheckStand = defaultRoot + StandCommon.CheckProductStationConfigPath;

            DeleteNotExistProductPath(processList, burnStandPath);
            DeleteNotExistProductPath(processList, sensibilityStand);
            DeleteNotExistProductPath(processList, shellStand);
            DeleteNotExistProductPath(processList, airtageStand);
            DeleteNotExistProductPath(processList, stentStand);
            DeleteNotExistProductPath(processList, productTestStand);
            DeleteNotExistProductPath(processList, productCheckStand);
        }
Ejemplo n.º 2
0
        private void InitCurrentProcessItem()
        {
            this.cb_curprocess.Items.Clear();
            var processList = serviceClientTest.SelectAllTProcess();

            foreach (var process in processList)
            {
                this.cb_curprocess.Items.Add(process);
            }
            this.currentSelectProcess        = serviceClientTest.SelectCurrentTProcess();
            this.cb_curprocess.SelectedIndex = this.cb_curprocess.Items.IndexOf(this.currentSelectProcess);
        }
        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);
        }