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"); } // ProductID CheckComboBox this.prodIdCheckedComboBoxEdit.Properties.Items.Clear(); var prodIDs = (from a in modelContext.Product select new { PRODUCT_ID = a.PRODUCT_ID }) .Distinct().OrderBy(x => x.PRODUCT_ID); foreach (var item in prodIDs) { this.prodIdCheckedComboBoxEdit.Properties.Items.Add(item.PRODUCT_ID.ToString()); } this.prodIdCheckedComboBoxEdit.CheckAll(); //DateEdit Controls this.fromDateEdit.DateTime = ShopCalendar.SplitDate(_planStartTime); ComboHelper.ShiftName(this.shiftComboBoxEdit, _planStartTime); }
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"); } //DateEdit Controls this.fromDateEdit.DateTime = ShopCalendar.SplitDate(_planStartTime); ComboHelper.ShiftName(this.shiftComboBoxEdit, _planStartTime); //// Set ProdInTatDic //_prodIdsInTatDic = new Dictionary<string, List<string>>(); //var dtTat = modelContext.Tat.Where(x => x.PRODUCT_TYPE == "Production") // .Select(x => new { SHOP_ID = x.SHOP_ID, PROD_ID = x.PRODUCT_ID }).Distinct(); //foreach (var row in dtTat) //{ // List<string> prodInTatList; // if (_prodIdsInTatDic.TryGetValue(row.SHOP_ID, out prodInTatList) == false) // _prodIdsInTatDic.Add(row.SHOP_ID, prodInTatList = new List<string>()); // prodInTatList.Add(row.PROD_ID); //} // ProductIDs SetProdIdCheckBox(); }
private void InitializeControl() { _isEndLoadDocument = false; //DateEdit Controls this.fromDateEdit.DateTime = ShopCalendar.SplitDate(_planStartTime); ComboHelper.ShiftName(this.shiftComboBoxEdit, _planStartTime); this.daySpinEdit.Value = _result.GetPlanPeriod(); // ShopID ComboBox ComboHelper.AddDataToComboBox(this.shopIdComboBoxEdit, _result, SimInputData.InputName.StdStep, SimInputData.StdStepSchema.SHOP_ID, false); // ProductIDs SetProdIdCheckBox(); // Step TAT Unit this.stepTatUnitComboBox.Properties.Items.Add("Sec"); this.stepTatUnitComboBox.Properties.Items.Add("Min"); this.stepTatUnitComboBox.Properties.Items.Add("Hour"); this.stepTatUnitComboBox.Properties.Items.Add("Day"); this.stepTatUnitComboBox.SelectedIndex = 1; // Total TAT Unit this.totalTatUnitComboBox.Properties.Items.Add("Sec"); this.totalTatUnitComboBox.Properties.Items.Add("Min"); this.totalTatUnitComboBox.Properties.Items.Add("Hour"); this.totalTatUnitComboBox.Properties.Items.Add("Day"); this.totalTatUnitComboBox.SelectedIndex = 3; }
/// /// 개발 포인트 /// private void ParseRow(DataRow row) { this.AreaID = row.GetString(Schema.AREA_ID); this.ShopID = row.GetString(Schema.SHOP_ID); this.ProductID = row.GetString(Schema.PRODUCT_ID); this.StepID = row.GetString(Schema.STEP_ID); this.TargetDate = ShopCalendar.SplitDate(row.GetDateTime(Schema.TARGET_DATE)).ToString("yyyyMMdd"); this.CampareTargetDate = row.GetDateTime(Schema.TARGET_DATE); this.OutTargetQty = row.GetFloat(Schema.OUT_TARGET_QTY); this.StepType = row.GetString(Schema.STEP_TYPE); }
private void InitializeControl() { //// 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"); //DateEdit Controls this.fromDateEdit.DateTime = ShopCalendar.SplitDate(_planStartTime.AddDays(-2)); ComboHelper.ShiftName(this.shiftComboBoxEdit, _planStartTime); }
/// <summary> /// </summary> /// <param name="entity"/> /// <param name="now"/> /// <param name="target"/> /// <param name="factor"/> /// <param name="ctx"/> /// <returns/> public WeightValue STEP_TARGET_PRIORITY(Mozart.Simulation.Engine.ISimEntity entity, DateTime now, Mozart.Simulation.Engine.ActiveObject target, Mozart.SeePlan.DataModel.WeightFactor factor, Mozart.SeePlan.Simulation.IDispatchContext ctx) { if (factor.Factor == 0) { return(new WeightValue(0)); } FabLot lot = entity as FabLot; if (lot.LotID == "TH011797N01") { Console.WriteLine(); } if (lot.CurrentFabPlan.IsPegged == false) { return(new WeightValue(0)); } int precedeDay = (int)factor.Criteria[0]; int delayDay = (int)factor.Criteria[1]; double duration = precedeDay + delayDay; if (duration <= 0) { return(new WeightValue(0)); } DateTime targetdate = lot.CurrentFabPlan.MainTarget.DueDate; DateTime targetday = ShopCalendar.SplitDate(targetdate); DateTime nowday = ShopCalendar.SplitDate(now); TimeSpan gap = nowday - targetday; //shift zero point (zero point로 변경하여 로직 처리) double gapDays = gap.TotalDays + precedeDay; float score = 0f; if (gapDays >= 0) { double ratio = gapDays / duration; score = (float)Math.Max(ratio, 1f); } string desc = string.Format("[GAP:{0}]", Math.Round(gap.TotalDays, 2)); return(new WeightValue(score * factor.Factor, desc)); }
/// /// 개발 포인트 /// private void ParseRow(DataRow row) { this.ShopID = row.GetString(Schema.SHOP_ID); this.ProductID = row.GetString(Schema.PRODUCT_ID); this.BatchID = row.GetString(Schema.BATCH_ID); this.StepID = row.GetString(Schema.STEP_ID); this.LotID = row.GetString(Schema.LOT_ID); this.TargetDate = ShopCalendar.SplitDate(row.GetDateTime(Schema.TARGET_DATE)).ToString("yyyyMMdd"); this.OutTargetQty = row.GetFloat(Schema.OUT_TARGET_QTY); this.StartTime = row.GetDateTime(Schema.START_TIME); this.EndTime = row.GetDateTime(Schema.END_TIME); }
private DateTime GetPlanDate(DateTime t) { DateTime planDate = t; if (this.dayRadioBtn.Checked) { planDate = ShopCalendar.SplitDate(t); } else if (this.shiftRadioBtn.Checked) { planDate = ShopCalendar.ShiftStartTimeOfDayT(t); } return(planDate); }
/// /// 개발 포인트 /// private void ParseRow(DataRow row) { this.AreaID = row.GetString(Schema.AREA_ID); this.ShopID = row.GetString(Schema.SHOP_ID); this.ProductID = row.GetString(Schema.PRODUCT_ID); this.StepID = row.GetString(Schema.STEP_ID); this.StdStepSeq = row.GetInt32(Schema.STD_STEP_SEQ); this.OwnerType = row.GetString(Schema.OWNER_TYPE); //this.TargetDate = row.GetDateTime(Schema.TARGET_DATE).ToString("yyyyMMdd"); this.TargetDate = ShopCalendar.SplitDate(row.GetDateTime(Schema.TARGET_DATE)).ToString("yyyyMMdd"); this.CompareTargetDate = row.GetDateTime(Schema.TARGET_DATE); this.InQty = row.GetFloat(Schema.IN_QTY); this.OutQty = row.GetFloat(Schema.OUT_QTY); }
protected void InitControl() { layoutControlItem8.Text = LotGanttChartData.LOT_ID; fromShiftComboBox.Value = Globals.GetResultPlanPeriod(_result) * ShopCalendar.ShiftCount;//ShopCalendar.ShiftCount * 7; _planStartTime = _result.StartTime; dateEdit1.DateTime = ShopCalendar.SplitDate(_planStartTime); ComboHelper.AddDataToComboBox(shopIDcomboBox, _result, LotGanttChartData.LOT_TABLE_NAME, LotGanttChartData.Lot.Schema.SHOP_ID, false); if (this.shopIDcomboBox.Properties.Items.Contains("ARRAY")) { this.shopIDcomboBox.SelectedIndex = this.shopIDcomboBox.Properties.Items.IndexOf("ARRAY"); } else { this.shopIDcomboBox.SelectedIndex = 0; } var cellWidth = Extensions.GetLocalSetting(this.ServiceProvider, _pageID + "ganttCellWidth"); var cellHeight = Extensions.GetLocalSetting(this.ServiceProvider, _pageID + "ganttCellHeight"); cellWidth = cellWidth == null?this.CellWidthSize.ToString() : cellWidth; cellHeight = cellHeight == null?this.CellHeightSize.ToString() : cellHeight; if (!string.IsNullOrEmpty(cellWidth)) { this.ganttSizeControl1.CellWidth = Convert.ToInt32(cellWidth); } if (!string.IsNullOrEmpty(cellHeight)) { this.ganttSizeControl1.CellHeight = Convert.ToInt32(cellHeight); } ComboHelper.ShiftName(shiftNameComboBox, _planStartTime); //lindIDcomboBox.SelectedIndexChanged += new EventHandler(cbeLine_SelectedIndexChanged); }
private void InitializeControl() { var modelContext = this._result.GetCtx <ModelDataContext>(); // ShopID ComboBox this.shopIdComboBoxEdit.Properties.Items.Add("ARRAY"); //this.shopIdComboBoxEdit.Properties.Items.Add("CF"); //this.shopIdComboBoxEdit.Properties.Items.Add("CELL"); if (this.shopIdComboBoxEdit.Properties.Items.Contains("ARRAY")) { this.shopIdComboBoxEdit.SelectedIndex = this.shopIdComboBoxEdit.Properties.Items.IndexOf("ARRAY"); } // ProductID CheckComboBox this.prodIdCheckedComboBoxEdit.Properties.Items.Clear(); var prodIDs = (from a in modelContext.Product select new { PRODUCT_ID = a.PRODUCT_ID }) .Distinct().OrderBy(x => x.PRODUCT_ID); foreach (var item in prodIDs) { this.prodIdCheckedComboBoxEdit.Properties.Items.Add(item.PRODUCT_ID.ToString()); } this.prodIdCheckedComboBoxEdit.CheckAll(); //DateEdit Controls this.fromDateEdit.DateTime = ShopCalendar.SplitDate(_planStartTime); ComboHelper.ShiftName(this.shiftComboBoxEdit, _planStartTime); // InOut Check Control this.inOutChkBoxEdit.Properties.Items.Add("IN"); this.inOutChkBoxEdit.Properties.Items.Add("OUT"); this.inOutChkBoxEdit.CheckAll(); // InOut StepID Info Contols this.arrayInTxtEdit.EditValue = "1200"; var arrayInStepInfo = modelContext.StdStep.Where(x => x.SHOP_ID == "ARRAY" && x.STEP_SEQ > 0 && x.STEP_DESC.Trim() == "Dense Unpacker + DCLN").FirstOrDefault(); if (arrayInStepInfo != null) { this.arrayInTxtEdit.EditValue = arrayInStepInfo.STEP_ID; } this.arrayOutTxtEdit.EditValue = "9900"; var arrayOutStepInfo = modelContext.StdStep.Where(x => x.SHOP_ID == "ARRAY" && x.STEP_DESC == "Shipping").LastOrDefault(); if (arrayOutStepInfo != null) { this.arrayOutTxtEdit.EditValue = arrayOutStepInfo.STEP_ID; } //this.cfInTxtEdit.EditValue = "F100-00"; //var cfInStepInfo = modelContext.StdStep.Where(x => x.SHOP_ID == "CF" && x.STEP_DESC == "Unpacker").FirstOrDefault(); //if (cfInStepInfo != null) // this.cfInTxtEdit.EditValue = cfInStepInfo.STEP_ID; //this.cfOutTxtEdit.EditValue = "F110-00"; //var cfOutStepInfo = modelContext.StdStep.Where(x => x.SHOP_ID == "CF" && x.STEP_DESC == "Shipping").LastOrDefault(); //if (cfOutStepInfo != null) // this.cfOutTxtEdit.EditValue = cfOutStepInfo.STEP_ID; }
public static string WeekNoOfYear(DateTime date) { DateTime splitDate = ShopCalendar.SplitDate(date); return(Mozart.SeePlan.DateUtility.WeekNoOfYear(splitDate)); }
public static void WriteRelasePlan() { var dcnMst = ReleasePlanMaster.DcnMst; var bckList = dcnMst.Buckets; if (bckList == null || bckList.Count == 0) { return; } string versionNo = ModelContext.Current.VersionNo; foreach (var bck in bckList) { if (bck.HasAllocPlan() == false) { continue; } string factoryID = bck.FactoryID; string eqpGroupID = bck.EqpGroupID; string eqpID = bck.EqpID; int count = bck.Plans.Count; for (int i = 0; i < count; i++) { var plan = bck.Plans[i]; Outputs.ReleasePlan row = new ReleasePlan(); row.VERSION_NO = versionNo; row.FACTORY_ID = factoryID; row.EQP_GROUP_ID = eqpGroupID; row.EQP_ID = eqpID; var target = plan.Target; if (target != null) { row.STEP_ID = target.StepID; row.TARGET_DATE = target.TargetDate; row.TARGET_QTY = target.TargetQty; } row.SHOP_ID = plan.ShopID; row.PRODUCT_ID = plan.ProductID; DateTime planDate = ShopCalendar.SplitDate(plan.EqpStartTime); row.PLAN_DATE = LcdHelper.DbToString(planDate, false); row.START_TIME = plan.EqpStartTime; row.END_TIME = plan.EqpEndTime; row.UNIT_QTY = plan.AllocQty; if (target != null) { var inTarget = target.InTarget; if (inTarget != null) { row.DEMAND_ID = inTarget.DemandID; row.DEMAND_PLAN_DATE = inTarget.DueDate; } } row.ALLOC_EQP_SEQ = i + 1; row.ALLOC_SEQ = plan.AllocSeq; row.ALLOC_TIME = LcdHelper.DbToString(plan.AllocTime); var fixPlan = plan.FixPlan; if (fixPlan != null) { row.PLAN_STATE = fixPlan.PLAN_STATE; } else { row.PLAN_STATE = plan.EqpState; } OutputMart.Instance.ReleasePlan.Add(row); } //clear bck.ClearAllocPlan(); } }
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); }
public static int WeekNo(DateTime date) { DateTime baseDay = BaseDayOfWeek(ShopCalendar.SplitDate(date)); return(baseDay.Year * 100 + WeekOfYear(baseDay)); }
public static string SplitDateToString(DateTime dt) { //TODO : 확인 필요 return(DateToString(ShopCalendar.SplitDate(dt))); }
/// <summary> /// yyyyMM 형태의 년도+월을 반환합니다. 예)201601 /// </summary> /// <param name="dt"></param> /// <returns></returns> public static string GetMonthNo(DateTime dt) { return(ShopCalendar.SplitDate(dt).ToString("yyyyMM")); }