/// <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 MESMainForm_Load(object sender, EventArgs e)
 {
     //this.pictureBox1.BackgroundImageLayout = ImageLayout.Stretch;
     serviceClient     = new MesService.MesServiceClient();
     serviceClientTest = new MesServiceTest.MesServiceClient();
     TestCommunication();
     IsFirstState      = false;
     IsCompleted       = true;
     this.DialogResult = DialogResult.OK;
 }
        async private void InitConfig()
        {
            serviceClient     = new MesService.MesServiceClient();
            serviceClientTest = new MesServiceTest.MesServiceClient();

            this.rbtn_material_stock.CheckState = CheckState.Checked;
            this.cb_materialState.Items.Add("关闭");
            this.cb_materialState.SelectedIndex = 0;
            this.cb_materialState.ForeColor     = Color.Red;
            this.radDateTimePicker1.Text        = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

            var currentProcess = await serviceClientTest.SelectCurrentTProcessAsync();

            string[] array = await serviceClientTest.SelectStationListAsync(currentProcess);

            if (array.Length > 0)
            {
                cb_station.Items.Clear();
                foreach (var station in array)
                {
                    cb_station.Items.Add(station);
                }
            }
            DataTable dt = (await serviceClient.SelectMaterialAsync("", MesService.MaterialStockState.PUT_IN_STOCK_AND_STATEMENT)).Tables[0];

            if (dt.Rows.Count < 1)
            {
                return;
            }
            this.cb_materialCode.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                this.cb_materialCode.Items.Add(dt.Rows[i][0].ToString());
            }
            this.cb_materialCode.AutoCompleteSource = AutoCompleteSource.ListItems;
            this.cb_materialCode.AutoCompleteMode   = AutoCompleteMode.SuggestAppend;

            //productTypeNo
            var productTypeNoList = await serviceClientTest.SelectAllTProcessAsync();

            this.cb_typeNo.MultiColumnComboBoxElement.Columns.Add("typeNo");
            foreach (var typeNo in productTypeNoList)
            {
                this.cb_typeNo.EditorControl.Rows.Add(typeNo);
            }
            this.cb_typeNo.EditorControl.ShowColumnHeaders = false;
            this.cb_typeNo.BestFitColumns();
            this.cb_typeNo.Text = "";

            this.cb_stationName.MultiColumnComboBoxElement.Columns.Add("stationName");
        }
Ejemplo n.º 4
0
 private void Init()
 {
     this.status_username.Text         = MESMainForm.currentUser;
     this.cb_curprocess.DropDownStyle  = ComboBoxStyle.DropDownList;
     this.cb_processItem.DropDownStyle = ComboBoxStyle.DropDownList;
     serviceClient     = new MesService.MesServiceClient();
     serviceClientTest = new MesServiceTest.MesServiceClient();
     stationListTemp   = new List <string>();
     DataGridViewCommon.SetRadGridViewProperty(this.radGridView1, true);
     this.radGridView1.AllowRowHeaderContextMenu = false;
     DataSource();
     RefreshCurrentProcess();
     this.cb_processItem.Text = serviceClientTest.SelectCurrentTProcess();
 }
        public static void CreateCurrentProcessDirectory(string currentProcess)
        {
            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;

            MesServiceTest.MesServiceClient mesServiceClient = new MesServiceTest.MesServiceClient();
            var stationList = mesServiceClient.SelectStationList(currentProcess);

            foreach (var station in stationList)
            {
                if (station == GetStationName(StandCommon.TurnStationIniName))
                {
                    CreateNewDirectory(burnProductType);
                }
                else if (station == GetStationName(StandCommon.SensibilityStationIniName))
                {
                    CreateNewDirectory(sensibilityProductType);
                }
                else if (station == GetStationName(StandCommon.ShellStationIniName))
                {
                    CreateNewDirectory(shellProductType);
                }
                else if (station == GetStationName(StandCommon.AirtageStationIniName))
                {
                    CreateNewDirectory(airtageProductType);
                }
                else if (station == GetStationName(StandCommon.StentStationIniName))
                {
                    CreateNewDirectory(stentProductType);
                }
                else if (station == GetStationName(StandCommon.ProductFinishStationIniName))
                {
                    CreateNewDirectory(productTestProductType);
                }
                else if (station == GetStationName(StandCommon.CheckProductStationIniName))
                {
                    CreateNewDirectory(defaultRoot + StandCommon.CheckProductStationConfigPath + currentProcess);
                }
            }
        }
Ejemplo n.º 6
0
        private void Init()
        {
            serviceClient           = new MesService.MesServiceClient();
            serviceClientTest       = new MesServiceTest.MesServiceClient();
            modifyTypeNoTemp        = new List <string>();
            modifyProductTypeNoList = new List <BasicConfig>();
            materialCodeTemp        = new List <BasicConfig>();
            DataGridViewCommon.SetRadGridViewProperty(this.radGridView1, true);
            this.radGridView1.AllowRowHeaderContextMenu = false;
            var bMaterialCode = int.TryParse(ConfigurationManager.AppSettings["materialLength"].ToString(), out materialCodeLength);

            int.TryParse(ConfigurationManager.AppSettings["IsAutoAdd"].ToString(), out IsAutoAdd);
            this.menu_exportCondition.Items.Add(GridViewExport.ExportFormat.EXCEL.ToString());
            this.menu_exportCondition.Items.Add(GridViewExport.ExportFormat.HTML.ToString());
            this.menu_exportCondition.Items.Add(GridViewExport.ExportFormat.PDF.ToString());
            this.menu_exportCondition.Items.Add(GridViewExport.ExportFormat.CSV.ToString());
            this.menu_exportCondition.Text = GridViewExport.ExportFormat.EXCEL.ToString();
            DataSource();
            RefreshData();
            if (!bMaterialCode)
            {
                MessageBox.Show("配置参数格式错误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
        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);
        }