private void SetControl() { _log = new EqpGanttChartData.EqpDispatchLog(_row); var log = _log; this.Text = string.Format("Dispatching Information - {0}", log.DispatchingTime.DbToString()); StringBuilder sb = new StringBuilder(); string subEqpID = log.SubEqpID; if (string.IsNullOrEmpty(subEqpID) == false) { sb.AppendFormat("SUB_EQP_ID : {0}\r\n", subEqpID); } if (_eqpInfo != null) { sb.AppendLine(_eqpInfo.ToString()); } sb.AppendFormat("Initial Wip Count : {0}\r\n", log.InitWipCount); sb.AppendFormat("Filtered Wip Count : {0}\r\n", log.FilteredWipCount); //sb.AppendFormat("Dispatching Wip Count:\t{0}\r\n", log.dis); sb.AppendFormat("Selected Wip Count : {0}\r\n", log.SelectedWipCount); sb.AppendFormat("Last Run : {0}\r\n", log.LastWip); this.eqpInfoTextBox.Text = sb.ToString(); }
private void BindData_Filter(EqpGanttChartData.EqpDispatchLog log) { var dt = CreateSchema_FilteredWip(); string filteredWipLog = log.FilteredWipLog; Dictionary <string, List <int> > sumFilterWipDic = new Dictionary <string, List <int> >(); string[] blobs = filteredWipLog.Split('\t'); foreach (string blob in blobs) { string[] group = blob.Split(':'); if (group.Length < 2) { continue; } string reason = group[0]; string[] wips = group[1].Split(';'); foreach (string wip in wips) { DataRow frow = dt.NewRow(); string[] wipArr = wip.Split('/'); int wipCnt = wipArr.Length; string lotID = wipArr[0]; string productID = wipCnt >= 2 ? wipArr[1] : Consts.NULL_ID; string productVer = wipCnt >= 3 ? wipArr[2] : Consts.NULL_ID; string stepID = wipCnt >= 4 ? wipArr[3] : Consts.NULL_ID; int qty = wipCnt >= 5 ? Convert.ToInt32(wipArr[4]) : 0; string ownerType = wipCnt >= 6 ? wipArr[5] : Consts.NULL_ID; string ownerID = wipCnt >= 7 ? wipArr[6] : Consts.NULL_ID; frow[ColName.LOT_ID] = lotID; frow[ColName.PRODUCT_ID] = productID; frow[ColName.PROD_VER] = productVer; frow[ColName.STEP_ID] = stepID; frow[ColName.Qty] = qty; frow[ColName.OWNER_TYPE] = ownerType; frow[ColName.OWNER_ID] = ownerID; frow[ColName.REASON] = reason; dt.Rows.Add(frow); if (this.ShowOnlyTop_Filter) { string key = CommonHelper.CreateKey(productID, productVer, stepID, ownerType, ownerID); List <int> sumFilterWipList; if (sumFilterWipDic.TryGetValue(key, out sumFilterWipList) == false) { sumFilterWipDic[key] = sumFilterWipList = new List <int>(); } sumFilterWipList.Add(qty); } } } if (this.ShowOnlyTop_Filter) { dt = SummaryOnlyTop_Filter(sumFilterWipDic, dt); } BindGrid_Filter(dt); DesignGrid_Filter(); }
private void BindData_Dispatch(EqpGanttChartData.EqpDispatchLog log) { _lastWip = log.LastWip; _selectedWip = log.SelectedWip; Dictionary <string, List <float> > summaryDic = new Dictionary <string, List <float> >(); List <EqpGanttChartData.PresetInfo> matchedList = new List <EqpGanttChartData.PresetInfo>(); var presetList = _presetList.Where(x => x.PresetID == log.PresetID).ToList(); presetList.Sort(EqpGanttChartData.PresetInfo.Comparer.Default); _factorInfos = new Dictionary <string, EqpGanttChartData.PresetInfo>(); foreach (EqpGanttChartData.PresetInfo item in presetList) { matchedList.Add(item); _factorInfos[item.FactorID] = item; } string dispatchWipLog = log.DispatchWipLog; // DISPATCH_WIP_LOG string[] infoList = dispatchWipLog.Split(';'); var sample = infoList[0].Split('/'); bool showProductInfo = sample.Length - matchedList.Count > 1; DataTable dt = CreateSchema_Dispatch(matchedList, showProductInfo); foreach (string info in infoList) { string[] split = info.Split('/'); if (split.Count() <= 1) { continue; } DataRow row = dt.NewRow(); string prodID = split[1]; string prodVer = split[2]; string stepID = split[3]; string ownerType = split[5]; string ownerID = split[6]; string detail = split[7]; int index = 0; row[ColName.DISPATCHING_WIP] = split[0]; if (showProductInfo) { row[ColName.PRODUCT_ID] = prodID; row[ColName.PROD_VER] = prodVer; row[ColName.STEP_ID] = stepID; row[ColName.OWNER_TYPE] = ownerType; row[ColName.OWNER_ID] = ownerID; row[ColName.DETAIL] = detail; int qty; if (int.TryParse(split[4], out qty) == false) { qty = 0; } row[ColName.LOT_QTY] = qty; string key = CommonHelper.CreateKey(prodID, prodVer, stepID, ownerType, ownerID); List <float> summaryList; if (summaryDic.TryGetValue(key, out summaryList) == false) { summaryDic[key] = summaryList = new List <float>(); } summaryList.Add(qty); } int diffIndex = showProductInfo ? 8 : 1; float sum = 0.0f; for (int i = diffIndex; i < split.Length; i++) { var orgValue = split[i]; var arrVaules = orgValue.Split('@'); string sScore = arrVaules[0]; string desc = string.Empty; if (arrVaules.Length > 1) { desc = arrVaules[1]; } float score; if (float.TryParse(sScore, out score) == false) { score = 0; } if (matchedList.Count >= (i - diffIndex + 1)) { string factorID = matchedList[i - diffIndex].FactorID; row[factorID] = string.IsNullOrEmpty(desc) ? sScore : sScore + " " + desc; sum += score; index++; } } row[ColName.WEIGHTED_SUM] = string.Format("{0}", sum); dt.Rows.Add(row); } if (this.ShowOnlyTop_Dispatch) { dt = SummaryOnlyTop_Dispatch(summaryDic, dt); } dt = CreateResultDt(dt, _factorInfos); FillGrid(dt); BindData_Summary(summaryDic); DesignGrid_Dispatch(); }