Exemple #1
0
        private List <StdStep> GetStdStepList(string areaID)
        {
            var modelContext = _result.GetCtx <ModelDataContext>();
            var stdStep      = modelContext.StdStep;

            List <StdStep> list = new List <StdStep>();

            var finds = stdStep.Where(t => t.AREA_ID == areaID).OrderBy(t => t.STEP_SEQ);

            if (finds == null || finds.Count() == 0)
            {
                return(list);
            }

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

            foreach (var item in finds)
            {
                string key = item.SHOP_ID + item.STEP_ID;
                if (keyList.Contains(key))
                {
                    continue;
                }

                keyList.Add(key);

                list.Add(item);
            }

            return(list);
        }
Exemple #2
0
        private void SetAreaIDComboBox()
        {
            this.shopIdComboBox.Items.Clear();

            SortedSet <string> list = new SortedSet <string>();

            var stepMove = _result.GetCtx <ResultDataContext>().StepMove;

            foreach (StepMove item in stepMove)
            {
                if (list.Contains(item.AREA_ID))
                {
                    continue;
                }

                list.Add(item.AREA_ID);
            }

            foreach (string areaID in list.Reverse())
            {
                if (this.areaComboBox.Items.Contains(areaID))
                {
                    continue;
                }

                this.areaComboBox.Items.Add(areaID);
            }

            if (this.areaComboBox.Items.Count > 0)
            {
                this.areaComboBox.SelectedIndex = 0;
            }
        }
Exemple #3
0
        //private void GetProductRouteDic()
        //{
        //    _prodRouteLogDic = new Dictionary<string, List<string>>();

        //    var prodRouteLog = _resultCtx.ProductRouteLog.Where(x => x.AREA_ID == this.TargetAreaID).OrderBy(x => x.PRODUCT_ID);

        //    foreach (var item in prodRouteLog)
        //    {
        //        string key = CommonHelper.CreateKey(item.AREA_ID, item.PRODUCT_ID);
        //        List<string> stepList;
        //        if (_prodRouteLogDic.TryGetValue(key, out stepList) == false)
        //            _prodRouteLogDic.Add(key, stepList = new List<string>());

        //        if (stepList.Contains(item.STEP_ID) == false)
        //            stepList.Add(item.STEP_ID);
        //    }
        //}

        private void GetStdStepList(string areaID)
        {
            _stdStepList = new List <StdStep>();
            _matchSteps  = new Dictionary <string, List <string> >();

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

            var finds       = table.Where(t => t.AREA_ID == areaID).OrderBy(t => t.STEP_SEQ);
            var stdStepList = _stdStepList = finds.ToList();

            foreach (var stdStep in stdStepList)
            {
                string dspEqpGroupID = stdStep.DSP_EQP_GROUP_ID;
                if (string.IsNullOrEmpty(dspEqpGroupID))
                {
                    continue;
                }

                List <string> list;
                if (_matchSteps.TryGetValue(dspEqpGroupID, out list) == false)
                {
                    _matchSteps.Add(dspEqpGroupID, list = new List <string>());
                }

                string stepID = stdStep.STEP_ID;
                if (list.Contains(stepID))
                {
                    continue;
                }

                list.Add(stepID);
            }
        }
Exemple #4
0
        private void SetControl()
        {
            this.EqpIdBox.Text          = "";
            this.ShowReworkStep.Checked = false;

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

            // ShopID ComboBox
            this.shopIdComboBox.Items.Clear();

            if (this.shopIdComboBox.Items.Count > 0)
            {
                this.shopIdComboBox.SelectedIndex = 0;
            }

            var shopIDs = (from a in modelContext.EqpArrange
                           select new { SHOP_ID = a.SHOP_ID })
                          .Distinct().OrderBy(x => x.SHOP_ID);

            foreach (var item in shopIDs)
            {
                this.shopIdComboBox.Items.Add(item.SHOP_ID.ToString());
            }

            if (this.shopIdComboBox.Items.Count > 0)
            {
                this.shopIdComboBox.SelectedIndex = 0;
            }

            this._eqpInfoDT = Globals.GetConsInfo(modelContext);

            // AREA CheckedBox
            //var areaInfo = modelContext.Const.Where(x => x.CATEGORY == "AREA_INFO")
            //    .Select(x => x.CODE);



            //areaInfo.ToList().ForEach(x => this.checkedComboBoxEdit1.Properties.Items.Add(x));

            //if (checkedComboBoxEdit1.Properties.Items.Count > 0
            //    && this.checkedComboBoxEdit1.Properties.Items.Contains("OTHERS") == false)
            //    this.checkedComboBoxEdit1.Properties.Items.Add("OTHERS");

            if (this._eqpInfoDT != null)
            {
                foreach (DataRow drow in this._eqpInfoDT.Rows)
                {
                    EqpGanttChartData.Const configConst = new EqpGanttChartData.Const(drow);

                    this.checkedComboBoxEdit1.Properties.Items.Add(configConst.Code);
                }

                //if (areaCheckdBox.Properties.Items.Contains("OTHERS") == false)
                //    areaCheckdBox.Properties.Items.Add("OTHERS");
            }
        }
Exemple #5
0
        protected override void LoadDocument()
        {
            if (_result == null)
            {
                var item = (IMenuDocItem)this.Document.ProjectItem;
                _result = (IExperimentResultItem)item.Arguments[0];
            }

            _application = (IVsApplication)GetService(typeof(IVsApplication));
            _resultCtx   = _result.GetCtx <ResultDataContext>();

            Globals.InitFactoryTime(_result.Model);

            SetControl();
        }
Exemple #6
0
        internal void SetDspEqpGroupSeq(IExperimentResultItem result)
        {
            var modelContext = result.GetCtx <ModelDataContext>();
            var table        = modelContext.StdStep;

            if (table == null || table.Count() == 0)
            {
                return;
            }

            foreach (var eqp in this.EqpAll.Values)
            {
                string dspEqpGroup = eqp.DspEqpGroup;
                if (string.IsNullOrEmpty(dspEqpGroup))
                {
                    continue;
                }

                string areaID = GetAreaID(eqp.ShopID);

                var finds = table.Where(t => t.AREA_ID == areaID && t.DSP_EQP_GROUP_ID == dspEqpGroup).OrderBy(t => t.STEP_SEQ);
                var find  = finds.FirstOrDefault();

                if (find == null)
                {
                    continue;
                }

                eqp.DspEqpGroupSeq = find.STEP_SEQ;

                string key = CommonHelper.CreateKey(areaID, eqp.EqpGroup);
                this.DspGroupSeqs[key] = find.STEP_SEQ;
            }
        }
Exemple #7
0
        //private DateTime MergeStateTime(DateTime dt, string time)
        //{
        //    dt = dt.Date + DateUtility.DbToTimeSpan(time);
        //    return ShopCalendar.AdjustSectionDateTime(dt);
        //}

        protected void FillLotMovePlan(string selectedShopId, string lotPattern, DateTime fromTime, DateTime toTime)
        {
            var resultContext = _result.GetCtx <ResultDataContext>();

            IEnumerable <CSOT.Lcd.Scheduling.Outputs.EqpPlan> resultList;

            if (selectedShopId == "ALL")
            {
                resultList = resultContext.EqpPlan;
            }
            else
            {
                resultList = resultContext.EqpPlan.Where(x => x.SHOP_ID == selectedShopId);
            }

            if (string.IsNullOrEmpty(lotPattern) == false)
            {
                resultList = resultList.Where(x => StringHelper.Like(x.LOT_ID, lotPattern) == true);
            }

            resultList = resultList.Where(x => fromTime <= x.START_TIME & x.START_TIME < toTime);

            foreach (var it in resultList)
            {
                //var endTime = it.END_TIME;
                //if (endTime == default(DateTime))
                //    endTime = toTime;

                DateTime startTime = it.START_TIME != null ? (DateTime)it.START_TIME : DateTime.MinValue;
                DateTime endTime   = it.END_TIME != null ? (DateTime)it.END_TIME : DateTime.MinValue;

                this.AddItem(it.LOT_ID, it.PROCESS_ID, it.STEP_ID, it.PRODUCT_ID, startTime, endTime, (int)it.UNIT_QTY, EqpState.NONE, toTime);
            }
        }
        private void Initialize()
        {
            if (_result == null)
            {
                var item = (IMenuDocItem)this.Document.ProjectItem;
                _result = (IExperimentResultItem)item.Arguments[0];
            }

            if (_result == null)
            {
                return;
            }

            _modelContext = this._result.GetCtx <ModelDataContext>();
            _resultCtx    = _result.GetCtx <ResultDataContext>();

            _stdStepInfos = new Dictionary <string, StdStep>();

            _datas         = new Dictionary <string, ResultData>();
            _eaInfos       = new Dictionary <string, List <EAItem> >();
            _maMatchInfos  = new Dictionary <string, List <MAItem> >();
            _eaMatchInfos  = new Dictionary <string, List <EAItem> >();
            _eamMatchInfos = new Dictionary <string, List <EAItem> >();

            ImportData_StdStep();
            ImportData();

            //this.gridView1.OptionsBehavior.Editable = false;
        }
Exemple #9
0
        protected override void LoadDocument()
        {
            if (_result == null)
            {
                var item = (IMenuDocItem)this.Document.ProjectItem;
                _result = (IExperimentResultItem)item.Arguments[0];
            }

            _resultCtx = _result.GetCtx <ResultDataContext>();

            InitControl();

            InitializeData();

            this.BindEvents();

            _isEndLoadDocument = true;
        }
Exemple #10
0
        private void Initialize()
        {
            var item = (IMenuDocItem)this.Document.ProjectItem;

            _result    = (IExperimentResultItem)item.Arguments[0];
            _resultCtx = _result.GetCtx <ResultDataContext>();

            this.ProdColors = new Dictionary <string, Color>();

            SetControl();
        }
Exemple #11
0
        private void Initialize()
        {
            if (_result == null)
            {
                var item = (IMenuDocItem)this.Document.ProjectItem;
                _result = (IExperimentResultItem)item.Arguments[0];
            }

            if (_result == null)
            {
                return;
            }

            _resultCtx    = _result.GetCtx <ResultDataContext>();
            _modelContext = _result.GetCtx <ModelDataContext>();

            _datas         = new List <ResultData>();
            _eaInfos       = new Dictionary <string, List <EAItem> >();
            _eaMatchInfos  = new Dictionary <string, List <EAItem> >();
            _mhInfos       = new Dictionary <string, List <MaskHistory> >();
            _eamMatchInfos = new Dictionary <string, List <EAItem> >();

            SetControl();
        }
Exemple #12
0
        protected override void LoadDocument()
        {
            var item = (IMenuDocItem)this.Document.ProjectItem;

            _result      = (IExperimentResultItem)item.Arguments[0];
            _application = (IVsApplication)GetService(typeof(IVsApplication));
            _resultCtx   = _result.GetCtx <ResultDataContext>();

            Globals.InitFactoryTime(_result.Model);

            this.EqpMgr.LoadEqp(_result);


            SetValidEqpIDList();

            PrepareData_StdStep();
            PrepareDispatchingData();

            SetControl();
        }
Exemple #13
0
        private void PrepareData_StdStep()
        {
            if (this.StdSteps == null)
            {
                this.StdSteps = new Dictionary <string, EqpGanttChartData.StdStep>();
            }

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

            foreach (var item in modelContext.StdStep)
            {
                EqpGanttChartData.StdStep info = new EqpGanttChartData.StdStep(item.SHOP_ID,
                                                                               item.STEP_ID,
                                                                               item.LAYER_ID,
                                                                               item.STEP_SEQ);
                string key = info.GetKey();

                if (this.StdSteps.ContainsKey(key) == false)
                {
                    this.StdSteps[key] = info;
                }
            }
        }