Example #1
0
        public static void AddDataToComboBox(ComboBoxEdit control, IExperimentResultItem result, string tableName, string colName, bool addALL = true)
        {
            var dtable = result.LoadInput(tableName, null);

            var datas = Distinct(dtable, colName, "");

            foreach (string data in datas)
            {
                if (control.Properties.Items.Contains(data) == false)
                {
                    control.Properties.Items.Add(data);
                }
            }

            if (addALL)
            {
                control.Properties.Items.Insert(0, Consts.ALL);
            }

            if (control.Properties.Items.Count > 0)
            {
                control.SelectedIndex = 0;
            }

            control.Properties.TextEditStyle = TextEditStyles.DisableTextEditor;
        }
Example #2
0
        protected DataView GetPlanData()
        {
            var loadHistDt = _result.LoadOutput(EqpGanttChartData.LOAD_HIST_TABLE_NAME);

            string targetShopID = this.TargetShopID;

            string filter = string.Empty;

            if (targetShopID.Equals(Consts.ALL) == false)
            {
                string str = StringHelper.Equals(targetShopID, "ARRAY") ? "({0} = '{1}' OR {0} = 'CF')" : "({0} = '{1}')";
                filter = string.Format(str, EqpGanttChartData.LoadingHistory.Schema.SHOP_ID, targetShopID);
            }

            string eqpGrpFilter = string.Empty;

            if (this.SelectedEqpGroups.Count > 0)
            {
                foreach (string eqpGrpID in this.SelectedEqpGroups)
                {
                    eqpGrpFilter = eqpGrpFilter == string.Empty ?
                                   string.Format("{0} = '{1}'", EqpGanttChartData.LoadingHistory.Schema.EQP_GROUP_ID, eqpGrpID)
                        : eqpGrpFilter = eqpGrpFilter + string.Format(" OR {0} = '{1}'"
                                                                      , EqpGanttChartData.LoadingHistory.Schema.EQP_GROUP_ID, eqpGrpID);
                }
            }

            eqpGrpFilter = eqpGrpFilter == string.Empty ? eqpGrpFilter : filter + " AND (" + eqpGrpFilter + ")";
            DataTable dtEqp = _result.LoadInput(EqpGanttChartData.EQP_TABLE_NAME, eqpGrpFilter);

            string eqpFilter = string.Empty;

            if (dtEqp != null)
            {
                foreach (DataRow drow in dtEqp.Rows)
                {
                    string eqpID = drow.GetString("EQP_ID");
                    eqpFilter = eqpFilter == string.Empty ?
                                string.Format("{0} = '{1}'", EqpGanttChartData.LoadingHistory.Schema.EQP_ID, eqpID)
                        : eqpFilter = eqpFilter + string.Format(" OR {0} = '{1}'", EqpGanttChartData.LoadingHistory.Schema.EQP_ID, eqpID);
                }
            }

            if (string.IsNullOrEmpty(eqpFilter))
            {
                eqpFilter = string.Format("{0} = 'NULL'", EqpGanttChartData.LoadingHistory.Schema.EQP_ID);
            }

            filter = filter + " AND (" + eqpFilter + ")";

            string sorter = string.Format("{0},{1}", ColName.EqpID, ColName.TargetDate);

            DataView dv = new DataView(loadHistDt, filter, sorter, DataViewRowState.CurrentRows);

            return(dv);
        }
Example #3
0
        private void InitializeData()
        {
            //var modelContext = _result.GetCtx<ModelDataContext>();

            base.SetWaitDialogCaption(EqpArrProductAnalViewData.EQP_ARRANGE_DT);
            _dtEqpArrange = _result.LoadInput(EqpArrProductAnalViewData.EQP_ARRANGE_DT);

            base.SetWaitDialogCaption(EqpArrProductAnalViewData.STD_STEP_DT);
            _dtStdStep = _result.LoadInput(EqpArrProductAnalViewData.STD_STEP_DT);

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

            _prodTypeDic = new Dictionary <string, string>();
            foreach (var row in modelContext.Product)
            {
                if (_prodTypeDic.ContainsKey(row.SHOP_ID + row.PRODUCT_ID) == false)
                {
                    _prodTypeDic.Add(row.SHOP_ID + row.PRODUCT_ID /*+ row.PRODUCT_VERSION*/, row.PRODUCT_TYPE);
                }
            }
        }
Example #4
0
        private void SetControl()
        {
            #region Product Group

            _prodGroupDict = new Dictionary <string, List <string> >();

            DataTable prodTable = _result.LoadInput(JobChangePlanData.PRODUCT_DATA_TABLE);

            foreach (DataRow pRow in prodTable.Rows)
            {
                JobChangePlanData.Product prod = new JobChangePlanData.Product(pRow);

                if (prod.ProductGroup == "BARE")
                {
                    continue;
                }

                List <string> prodList;
                if (_prodGroupDict.TryGetValue(prod.ProductGroup, out prodList) == false)
                {
                    prodList = new List <string>();
                    _prodGroupDict.Add(prod.ProductGroup, prodList);
                }

                if (!prodList.Contains(prod.ProductID))
                {
                    prodList.Add(prod.ProductID);
                }
            }

            foreach (string prodGrp in _prodGroupDict.Keys)
            {
                this.prodGrpCombo.Items.Add(prodGrp);
            }
            this.prodGrpCombo.SelectedIndex = 0;

            UpdateProductList();

            #endregion
        }
Example #5
0
        public static EntityTable <T> GetEntityTable <T>(this IExperimentResultItem result, string key, string filter = "") where T : IEntityObject
        {
            IEnumerable <T> item;

            try
            {
                item = result.LoadOutput <T>(key, filter);
            }
            catch
            {
                item = result.LoadInput <T>(key, filter);
                return(item.ToEntityTable());
            }

            return(item.ToEntityTable());
        }
Example #6
0
        private void SetProductCombo()
        {
            this.productCombo.Properties.Items.Clear();

            DataTable productTable = _result.LoadInput(TargetPlanCompareData.DATA_TABLE_0);

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

            foreach (DataRow prow in productTable.Rows)
            {
                TargetPlanCompareData.Product prod = new TargetPlanCompareData.Product(prow);

                if (this.TargetShopID != "ALL")
                {
                    if (StringHelper.Equals(this.TargetShopID, prod.ShopID) == false)
                    {
                        continue;
                    }
                }

                if (!products.Contains(prod.ProductID))
                {
                    products.Add(prod.ProductID);
                }

                string key = prod.ShopID + prod.ProductID;
                if (!_productDict.Keys.Contains(key))
                {
                    _productDict.Add(key, prod.ProductID);
                }
            }

            products.Sort();

            foreach (string product in products)
            {
                this.productCombo.Properties.Items.Add(product);
            }

            if (this.productCombo.Properties.Items.Count > 0)
            {
                foreach (CheckedListBoxItem item in productCombo.Properties.Items)
                {
                    item.CheckState = CheckState.Checked;
                }
            }
        }
Example #7
0
        internal void LoadEqp(IExperimentResultItem result)
        {
            this.Table = result.LoadInput(EqpGanttChartData.EQP_TABLE_NAME);

            var dt = this.Table;

            if (dt != null)
            {
                foreach (DataRow srow in dt.Rows)
                {
                    Eqp eqp = new Eqp(srow);
                    this.AddEqps(eqp);
                }
            }

            SetDspEqpGroupSeq(result);
        }
Example #8
0
        private void InitializeData()
        {
            var item = (IMenuDocItem)this.Document.ProjectItem;

            _result = (IExperimentResultItem)item.Arguments[0];

            Globals.InitFactoryTime(_result.Model);

            //base.SetWaitDialogCaption(DataConsts.In_StdStep);
            //_dtStdStep = _result.LoadInput(DataConsts.In_StdStep);

            base.SetWaitDialogCaption(EuData.DATA_TABLE_1);
            _dtEquipment = _result.LoadInput(EuData.DATA_TABLE_1);

            base.SetWaitDialogCaption(EuData.DATA_TABLE_2);
            _dtLoadStat = _result.LoadOutput(EuData.DATA_TABLE_2);
        }
Example #9
0
        private void LoadBaseData()
        {
            _dtEqpPlan = _result.LoadOutput(LotGanttChartData.EQP_PLAN_TABLE_NAME);

            _productKindDict = new Dictionary <string, string>();

            DataTable dt = _result.LoadInput(EqpGanttChartData.PRODUCT_TABLE_NAME);

            foreach (DataRow row in dt.Rows)
            {
                LotGanttChartData.Product prod = new LotGanttChartData.Product(row);

                string key = prod.LineID + prod.ProductID;
                if (!_productKindDict.Keys.Contains(key))
                {
                    _productKindDict.Add(key, prod.ProductKind);
                }
            }
        }
Example #10
0
        private void InitializeData()
        {
            _dtStepMove = _result.LoadOutput(SimResultData.OutputName.StepMove);

            //_dtStepMoveAct = _result.LoadInput(SimInputData.InputName.StepMoveAct);

            _eqpGrpDic = new Dictionary <string, string>();

            DataTable dtEqp = _result.LoadInput(SimInputData.InputName.Eqp);

            foreach (DataRow dRow in dtEqp.Rows)
            {
                SimInputData.Eqp eqp = new SimInputData.Eqp(dRow);

                if (_eqpGrpDic.ContainsKey(eqp.ShopID + eqp.EqpID) == false)
                {
                    _eqpGrpDic.Add(eqp.ShopID + eqp.EqpID, eqp.EqpGroupID);
                }
            }
        }
Example #11
0
        private void SetData()
        {
            #region Target Shift Range 생성
            // TARGET SHIFT List 생성
            _targetShiftList = new List <string>();


            DateTime startTime     = _result.StartTime;
            int      shiftEndCount = Convert.ToInt32(this.endCountPicker.Value);

            startTime = this.startDatePicker.DateTime;

            for (int i = 0; i < shiftEndCount; i++)
            {
                string shift = startTime.AddHours(i * ShopCalendar.ShiftHours).ToString("yyyy-MM-dd HH");
                _targetShiftList.Add(shift);
            }

            _targetShiftList.Sort();

            _targetShiftList.Insert(0, BalanceTableViewData.INITIAL_SHIFT);

            #endregion

            #region InnerBom

            _resultDict     = new Dictionary <string, CellInfo>();
            _bomDict        = new Dictionary <string, string>();
            _bomReverseDict = new Dictionary <string, string>();

            string    filter        = string.Format("STEP_ID = '{0}' OR STEP_ID = '{1}'", BalanceTableViewData.NEXT_STEP, BalanceTableViewData.CELL_STEP);
            DataTable innerBomTable = _result.LoadInput(BalanceTableViewData.INNER_BOM_DATA_TABLE, filter);

            foreach (DataRow iRow in innerBomTable.Rows)
            {
                BalanceTableViewData.InnerBom bom = new BalanceTableViewData.InnerBom(iRow);

                if (bom.StepID == BalanceTableViewData.NEXT_STEP)
                {
                    CellInfo cinfo;
                    if (_resultDict.TryGetValue(bom.ToProductID, out cinfo) == false)
                    {
                        cinfo = new CellInfo(bom.ToProductID);
                        _resultDict.Add(bom.ToProductID, cinfo);
                    }

                    if (bom.FromProductID.StartsWith("C"))
                    {
                        cinfo.CFProductID = bom.FromProductID;
                    }
                    else if (bom.FromProductID.StartsWith("T"))
                    {
                        cinfo.TFProductID = bom.FromProductID;
                    }
                    else
                    {
                        continue;
                    }

                    if (cinfo.QtyDict == null)
                    {
                        cinfo.InitDict(_targetShiftList);
                    }
                }
                if (!_bomDict.Keys.Contains(bom.FromProductID))
                {
                    _bomDict.Add(bom.FromProductID, bom.ToProductID);
                }
            }

            #endregion

            #region Demand

            DataTable demandTable = _result.LoadInput(BalanceTableViewData.DEMAND_DATA_TABLE);

            _demandList = new List <string>();

            foreach (DataRow dRow in demandTable.Rows)
            {
                BalanceTableViewData.Demand demand = new BalanceTableViewData.Demand(dRow);

                if (_demandList.Contains(demand.ProductID) == false)
                {
                    _demandList.Add(demand.ProductID);
                }
            }

            #endregion

            _categories = new List <string>();
            _categories.Add(CellInfo.TFT_DONE);
            _categories.Add(CellInfo.TFT_WIP);
            _categories.Add(CellInfo.CF_DONE);
            _categories.Add(CellInfo.CF_WIP);
            _categories.Add(CellInfo.CELL_IN_TARGET);
            _categories.Add(CellInfo.CELL_IN_PLAN);
            _categories.Add(CellInfo.CELL_IN_BALANCE);
            _categories.Add(CellInfo.CELL_OUT_TARGET);
            _categories.Add(CellInfo.CELL_OUT_PLAN);
            _categories.Add(CellInfo.CELL_OUT_BALANCE);
        }
Example #12
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);
        }