示例#1
0
        private void SetAreaControl()
        {
            _selectedEqpGrpInAreaList = null;
            _eqpGrpsInAreaDic         = new Dictionary <string, List <string> >();
            _areaByEqpGrpDic          = new Dictionary <string, string>();

            var modelContext = this._result.GetCtx <ModelDataContext>();

            this._eqpInfoDT = Globals.GetConsInfo(modelContext);

            //string filter = string.Format("{0} = 'AREA_INFO'", EqpGanttChartData.Const.Schema.CATEGORY);

            //DataRow[] drs = this._eqpInfoDT.Select(filter);

            if (this._eqpInfoDT != null)
            {
                List <string> eqpGrpsAllInAreaList = new List <string>();

                foreach (DataRow row in _eqpInfoDT.Rows)
                {
                    SimInputData.Const configConst = new SimInputData.Const(row);

                    if (this.areaChkBoxEdit.Properties.Items.Contains(configConst.Code) == false)
                    {
                        this.areaChkBoxEdit.Properties.Items.Add(configConst.Code);
                    }

                    string[] eqpGrps = configConst.Description.Split('@');
                    foreach (string eqpGrp in eqpGrps)
                    {
                        if (eqpGrpsAllInAreaList.Contains(eqpGrp) == false)
                        {
                            eqpGrpsAllInAreaList.Add(eqpGrp);
                        }

                        List <string> eqpGrpList;
                        if (_eqpGrpsInAreaDic.TryGetValue(configConst.Code, out eqpGrpList) == false)
                        {
                            _eqpGrpsInAreaDic.Add(configConst.Code, eqpGrpList = new List <string>());
                        }

                        if (eqpGrpList.Contains(eqpGrp) == false)
                        {
                            eqpGrpList.Add(eqpGrp);
                        }

                        if (_areaByEqpGrpDic.ContainsKey(eqpGrp) == false)
                        {
                            _areaByEqpGrpDic.Add(eqpGrp, configConst.Code);
                        }
                    }
                }


                //string areaAdd = this.areaChkBoxEdit.Properties.Items.Count > 0 ? "OTHERS" : Consts.ALL;

                //if (this.areaChkBoxEdit.Properties.Items.Contains(areaAdd) == false)
                //    this.areaChkBoxEdit.Properties.Items.Add(areaAdd);

                //var eqpGrpInEqpList = modelContext.Eqp.Select(x => x.EQP_GROUP_ID).Distinct();
                //foreach (var eqpGrp in eqpGrpInEqpList)
                //{
                //    if (eqpGrpsAllInAreaList.Contains(eqpGrp) == false)
                //    {
                //        List<string> eqpGrpList;
                //        if (_eqpGrpsInAreaDic.TryGetValue(areaAdd, out eqpGrpList) == false)
                //            _eqpGrpsInAreaDic.Add(areaAdd, eqpGrpList = new List<string>());

                //        if (eqpGrpList.Contains(eqpGrp) == false)
                //            eqpGrpList.Add(eqpGrp);

                //        if (_areaByEqpGrpDic.ContainsKey(eqpGrp) == false)
                //            _areaByEqpGrpDic.Add(eqpGrp, areaAdd);
                //    }
                //}

                if (this.areaChkBoxEdit.Properties.Items.Count > 0)
                {
                    this.areaChkBoxEdit.CheckAll();
                }
            }
        }
示例#2
0
        private void InitializeControl()
        {
            var modelContext = this._result.GetCtx <ModelDataContext>();

            // ShopID ComboBox
            ComboHelper.AddDataToComboBox(this.shopIdComboBoxEdit, _result,
                                          SimInputData.InputName.StdStep, SimInputData.StdStepSchema.SHOP_ID, false);

            if (this.shopIdComboBoxEdit.Properties.Items.Contains("ARRAY"))
            {
                this.shopIdComboBoxEdit.SelectedIndex = this.shopIdComboBoxEdit.Properties.Items.IndexOf("ARRAY");
            }

            // Area CheckComboBox
            _eqpGrpsInAreaDic = new Dictionary <string, List <string> >();

            string    filter  = string.Format("{0} = '{1}'", SimInputData.ConstSchema.CATEGORY, "AREA_INFO");
            DataTable dtConst = _result.LoadInput(SimInputData.InputName.Const, filter);

            if (dtConst != null)
            {
                List <string> eqpGrpsAllInAreaList = new List <string>();

                foreach (DataRow drow in dtConst.Rows)
                {
                    SimInputData.Const configConst = new SimInputData.Const(drow);

                    if (this.areaChkBoxEdit.Properties.Items.Contains(configConst.Code) == false)
                    {
                        this.areaChkBoxEdit.Properties.Items.Add(configConst.Code);
                    }

                    string[] eqpGrps = configConst.Description.Split('@');
                    foreach (string eqpGrp in eqpGrps)
                    {
                        if (eqpGrpsAllInAreaList.Contains(eqpGrp) == false)
                        {
                            eqpGrpsAllInAreaList.Add(eqpGrp);
                        }

                        List <string> eqpGrpList;
                        if (_eqpGrpsInAreaDic.TryGetValue(configConst.Code, out eqpGrpList) == false)
                        {
                            _eqpGrpsInAreaDic.Add(configConst.Code, eqpGrpList = new List <string>());
                        }

                        if (eqpGrpList.Contains(eqpGrp) == false)
                        {
                            eqpGrpList.Add(eqpGrp);
                        }
                    }
                }

                if (this.areaChkBoxEdit.Properties.Items.Contains("OTHERS") == false)
                {
                    this.areaChkBoxEdit.Properties.Items.Add("OTHERS");
                }

                var eqpGrpInEqpList = modelContext.Eqp.Select(x => x.DSP_EQP_GROUP_ID).Distinct();
                foreach (var eqpGrp in eqpGrpInEqpList)
                {
                    if (eqpGrpsAllInAreaList.Contains(eqpGrp) == false)
                    {
                        List <string> eqpGrpList;
                        if (_eqpGrpsInAreaDic.TryGetValue("OTHERS", out eqpGrpList) == false)
                        {
                            _eqpGrpsInAreaDic.Add("OTHERS", eqpGrpList = new List <string>());
                        }

                        if (eqpGrpList.Contains(eqpGrp) == false)
                        {
                            eqpGrpList.Add(eqpGrp);
                        }
                    }
                }
            }

            if (this.areaChkBoxEdit.Properties.Items.Count > 0)
            {
                this.areaChkBoxEdit.CheckAll();
            }

            _eqpGrpInEqpDic     = new Dictionary <string, string>();
            _eqpListbyEqpGrpDic = new Dictionary <string, List <string> >();

            foreach (var row in modelContext.Eqp)
            {
                if (_eqpGrpInEqpDic.ContainsKey(row.SHOP_ID + row.EQP_ID) == false)
                {
                    _eqpGrpInEqpDic.Add(row.SHOP_ID + row.EQP_ID, row.DSP_EQP_GROUP_ID);
                }

                List <string> eqpList;
                if (_eqpListbyEqpGrpDic.TryGetValue(row.SHOP_ID + row.DSP_EQP_GROUP_ID, out eqpList) == false)
                {
                    _eqpListbyEqpGrpDic.Add(row.SHOP_ID + row.DSP_EQP_GROUP_ID, eqpList = new List <string>());
                }

                if (eqpList.Contains(row.EQP_ID) == false)
                {
                    eqpList.Add(row.EQP_ID);
                }
            }

            // EqpGroup CheckComboBox
            SetEqpGroupCheckBox();

            //DateEdit Controls
            this.fromDateEdit.DateTime = ShopCalendar.SplitDate(_planStartTime);
            ComboHelper.ShiftName(this.shiftComboBoxEdit, _planStartTime);

            dayShiftSpinEdit.Value = 1; // _result.GetPlanPeriod(1);
        }
示例#3
0
        public StepMovePopUp(
            Dictionary <string, SmcvData.StepInfo> stepInfoDic,
            Dictionary <string, SmcvData.WipDetail> wipCurStepDic, Dictionary <string, SmcvData.WipDetail> wipMainStepDic,
            List <string> maindatoryStepList,
            bool isTimeConditionDay, bool isSelectedInputWip,
            DevExpress.XtraEditors.ComboBoxEdit paramShopIdComboBox,
            System.Windows.Forms.Label dayShiftLabel, DevExpress.XtraEditors.DateEdit paramFromDateEdit,
            IExperimentResultItem result,
            DevExpress.XtraEditors.SpinEdit paramDayShiftSpinEdit)
        {
            InitializeComponent();

            _stepInfoDic        = stepInfoDic;
            _maindatoryStepList = maindatoryStepList;
            _wipCurStepDic      = wipCurStepDic;
            _wipMainStepDic     = wipMainStepDic;

            _result = result;

            this.fromTimeEdit.DateTime = paramFromDateEdit.DateTime;
            this.fromTimeEdit.Properties.VistaDisplayMode = DevExpress.Utils.DefaultBoolean.True;
            this.fromTimeEdit.Properties.VistaEditTime    = DevExpress.Utils.DefaultBoolean.True;

            this.hourRadioButton.Checked  = isTimeConditionDay;
            this.shiftRadioButton.Checked = isTimeConditionDay ? false : true;
            this.hourShiftRangeLabel.Text = dayShiftLabel.Text;

            this.wipCondInputBtn.Checked   = isSelectedInputWip;
            this.wipCondSimTimeBtn.Checked = isSelectedInputWip ? false : true;

            foreach (string shopID in paramShopIdComboBox.Properties.Items)
            {
                this.shopIdComboBoxEdit.Properties.Items.Add(shopID);
            }
            this.shopIdComboBoxEdit.SelectedIndex = paramShopIdComboBox.SelectedIndex;

            this.hourShiftSpinEdit.Value = paramDayShiftSpinEdit.Value;

            this.mainOnlyCheckBox.Checked = true;

            var modelContext = this._result.GetCtx <ModelDataContext>();

            //this.GetConsInfo();
            this._eqpInfoDT = Globals.GetConsInfo(modelContext);

            _selectedEqpGrpInAreaList = null;
            _eqpGrpsInAreaDic         = new Dictionary <string, List <string> >();

            //string filter = string.Format("{0} = '{1}'", SimInputData.ConstSchema.CATEGORY, "AREA_INFO");
            //DataRow[] drs = this._eqpInfoDT.Select(filter);

            //DataTable dtConst = _result.LoadInput(SimInputData.InputName.Const, filter);

            List <string> eqpGrpsAllInAreaList = new List <string>();

            foreach (DataRow drow in _eqpInfoDT.Rows)
            {
                SimInputData.Const configConst = new SimInputData.Const(drow);

                if (this.areaChkBoxEdit.Properties.Items.Contains(configConst.Code) == false)
                {
                    this.areaChkBoxEdit.Properties.Items.Add(configConst.Code);
                }

                string[] eqpGrps = configConst.Description.Split('@');
                foreach (string eqpGrp in eqpGrps)
                {
                    if (eqpGrpsAllInAreaList.Contains(eqpGrp) == false)
                    {
                        eqpGrpsAllInAreaList.Add(eqpGrp);
                    }

                    List <string> eqpGrpList;
                    if (_eqpGrpsInAreaDic.TryGetValue(configConst.Code, out eqpGrpList) == false)
                    {
                        _eqpGrpsInAreaDic.Add(configConst.Code, eqpGrpList = new List <string>());
                    }

                    if (eqpGrpList.Contains(eqpGrp) == false)
                    {
                        eqpGrpList.Add(eqpGrp);
                    }
                }
            }

            if (this.areaChkBoxEdit.Properties.Items.Contains("OTHERS") == false)
            {
                this.areaChkBoxEdit.Properties.Items.Add("OTHERS");
            }

            var eqpGrpInEqpList = modelContext.Eqp.Select(x => x.EQP_GROUP_ID).Distinct();

            foreach (var eqpGrp in eqpGrpInEqpList)
            {
                if (eqpGrpsAllInAreaList.Contains(eqpGrp) == false)
                {
                    List <string> eqpGrpList;
                    if (_eqpGrpsInAreaDic.TryGetValue("OTHERS", out eqpGrpList) == false)
                    {
                        _eqpGrpsInAreaDic.Add("OTHERS", eqpGrpList = new List <string>());
                    }

                    if (eqpGrpList.Contains(eqpGrp) == false)
                    {
                        eqpGrpList.Add(eqpGrp);
                    }
                }
            }


            if (this.areaChkBoxEdit.Properties.Items.Count > 0)
            {
                this.areaChkBoxEdit.CheckAll();
            }

            InitializeData();

            Query();
        }