using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using SA_LTT.Info.RecipeInfo; using SA_LTT_UI.Viewer; using SA_LTT; namespace SA_LTT_UI.Screen { public partial class ScreenRecipe : UserControl { private MainFrame _mainFrame; private Recipe currentRecipe; private FoupRecipe currentFoupRecipe; private WaferProcessPointView _waferProcessPointView; protected override CreateParams CreateParams { get { CreateParams MyCp = base.CreateParams; MyCp.ExStyle |= 0x02000000; return MyCp; } } public ScreenRecipe(MainFrame mainFrame) { InitializeComponent(); _mainFrame = mainFrame; _waferProcessPointView = new WaferProcessPointView(); el_CurrentWaferProcess.Child = _waferProcessPointView; _waferProcessPointView.PointClicked += _waferProcessPointView_PointClicked; ; RefreshRecipes(); RefreshFoupRecipes(); } private void _waferProcessPointView_PointClicked(System.Windows.Point clickedPoint, double width, double height) { if (InvokeRequired) { BeginInvoke(new WaferProcessPointView.PointClickedEvent(_waferProcessPointView_PointClicked), clickedPoint); } else { tb_StartX.Text = $"{clickedPoint.X}"; tb_StartY.Text = $"{clickedPoint.Y}"; tb_Width.Text = $"{width}"; tb_Height.Text = $"{height}"; } } private void Recipe_Leaves(object sender, EventArgs e) { SetSettingData(sender); } private void Recipe_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == '\r') { SetSettingData(sender); } } public void SetSettingData(object sender) { if (currentRecipe == null) { RefreshRecipeData(); return; } Control control = (Control)sender; float floatValue; switch (control.Name) { case "tb_BeamWidth": { float.TryParse(control.Text, out floatValue); if(floatValue < 0.1) { floatValue = 0.1f; } if (currentRecipe.BeamWidth != floatValue) { currentRecipe.ProcessInfoList.Clear(); } currentRecipe.BeamWidth = floatValue; control.Text = $"{floatValue}"; break; } case "tb_BeamHeight": { float.TryParse(control.Text, out floatValue); if (floatValue < 0.1) { floatValue = 0.1f; } if(currentRecipe.BeamHeight != floatValue) { currentRecipe.ProcessInfoList.Clear(); } currentRecipe.BeamHeight = floatValue; control.Text = $"{floatValue}"; break; } } RefreshRecipeData(); } public void RefreshRecipeData() { if (currentRecipe == null) { tb_Name.Text = ""; tb_Radius.Text = ""; tb_DistancePrimaryFlat.Text = ""; tb_EdgeRound.Text = ""; tb_BeamWidth.Text = ""; tb_BeamHeight.Text = ""; lv_ProcessList.Items.Clear(); tb_StartX.Text = ""; tb_StartY.Text = ""; tb_Width.Text = ""; tb_Height.Text = ""; tb_HeightOverlap.Text = ""; tb_WidthOverlap.Text = ""; tb_AttenuaotrStep.Text = ""; _waferProcessPointView.ClearProcessArea(); _waferProcessPointView.Radius = 75; _waferProcessPointView.PrimaryFlat = 70; btn_Save.BackColor = Color.Gainsboro; } else { tb_Name.Text = currentRecipe.Name; tb_Radius.Text = $"{currentRecipe.Radius}"; tb_DistancePrimaryFlat.Text = $"{currentRecipe.DistanceFromCenterToPrimaryFlat}"; tb_EdgeRound.Text = $"{currentRecipe.EdgeRound}"; tb_BeamWidth.Text = $"{currentRecipe.BeamWidth}"; tb_BeamHeight.Text = $"{currentRecipe.BeamHeight}"; lv_ProcessList.Items.Clear(); tb_StartX.Text = ""; tb_StartY.Text = ""; tb_Width.Text = ""; tb_Height.Text = ""; tb_HeightOverlap.Text = ""; tb_WidthOverlap.Text = ""; tb_AttenuaotrStep.Text = ""; _waferProcessPointView.ClearProcessArea(); _waferProcessPointView.Radius = currentRecipe.Radius; _waferProcessPointView.PrimaryFlat = currentRecipe.DistanceFromCenterToPrimaryFlat; foreach (ProcessInfo processInfo in currentRecipe.ProcessInfoList) { ListViewItem lvi = new ListViewItem($"{processInfo.StartX}"); lvi.SubItems.Add($"{processInfo.StartY}"); lvi.SubItems.Add($"{processInfo.Width}"); lvi.SubItems.Add($"{processInfo.Height}"); lvi.SubItems.Add($"{processInfo.BeamHeightOverlap}"); lvi.SubItems.Add($"{processInfo.BeamWidthOverlap}"); lvi.SubItems.Add($"{processInfo.Energy}"); processInfo.SetProcessData(); _waferProcessPointView.AddProcessArea(processInfo.ProcessStartY, processInfo.ProcessEndY, processInfo.ProcessList.ToArray()); lv_ProcessList.Items.Add(lvi); } Recipe originalRecipe = _mainFrame.equipment.recipeManager.GetRecipe(currentRecipe.Name); if (Recipe.IsEquals(currentRecipe, originalRecipe)) { tb_BeamWidth.BackColor = Color.White; tb_BeamHeight.BackColor = Color.White; btn_Save.BackColor = Color.Gainsboro; } else { tb_BeamWidth.BackColor = currentRecipe.BeamWidth != originalRecipe.BeamWidth ? Color.Red : Color.White; tb_BeamHeight.BackColor = currentRecipe.BeamHeight != originalRecipe.BeamHeight ? Color.Red : Color.White; btn_Save.BackColor = Color.Red; } } } public void RefreshRecipes() { _mainFrame.equipment.recipeManager.RefreshRecipes(); lv_RecipeList.Items.Clear(); Recipe[] recipes = _mainFrame.equipment.recipeManager.GetRecipeList(); foreach(Recipe recipe in recipes) { lv_RecipeList.Items.Add(recipe.Name); } currentRecipe = null; RefreshRecipeData(); } public void RefreshFoupRecipes() { _mainFrame.equipment.foupRecipeManager.RefreshRecipes(); lv_FoupRecipe.Items.Clear(); FoupRecipe[] recipes = _mainFrame.equipment.foupRecipeManager.GetRecipeList(); foreach (FoupRecipe recipe in recipes) { lv_FoupRecipe.Items.Add(recipe.Name); } } public void RefreshFoupRecipeData() { lv_Recipes.Items.Clear(); if(currentFoupRecipe != null) { FoupRecipe originalRecipe = _mainFrame.equipment.foupRecipeManager.GetRecipe(currentFoupRecipe.Name); for (int i = 24; i >= 0; i--) { ListViewItem lvi = new ListViewItem($"{i + 1}"); if(currentFoupRecipe.RecipeNames[i] != originalRecipe.RecipeNames[i]) { lvi.BackColor = Color.Red; } if (currentFoupRecipe.RecipeNames[i] == null) { lvi.SubItems.Add("Empty"); } else { lvi.SubItems.Add(currentFoupRecipe.RecipeNames[i]); } lv_Recipes.Items.Add(lvi); } } } private void btn_Refresh_Click(object sender, EventArgs e) { RefreshRecipes(); } private void btn_Create_Click(object sender, EventArgs e) { RecipeCreateViewer recipeCreateViewer = new RecipeCreateViewer(); if(recipeCreateViewer.ShowDialog() == DialogResult.OK) { Recipe recipe = new Recipe(); recipe.Name = recipeCreateViewer.RecipeName; recipe.Radius = recipeCreateViewer.Radius; recipe.DistanceFromCenterToPrimaryFlat = recipeCreateViewer.DistancePrimaryFlat; recipe.EdgeRound = recipeCreateViewer.EdgeRound; if (_mainFrame.equipment.recipeManager.ExistsRecipe(recipe.Name) == false) { EquipmentLogManager.Instance.WriteButtonLog($"ScreenRecipe : Create Recipe {recipe.Name}"); _mainFrame.equipment.recipeManager.SaveOrCreate(recipe); RefreshRecipes(); } else { Viewer.MessageBoxPad mbPad = new Viewer.MessageBoxPad("같은 이름의 Recipe가 있습니다."); mbPad.Show(); } } } private void btn_Delete_Click(object sender, EventArgs e) { if(currentRecipe == null) { Viewer.MessageBoxPad mbPad = new Viewer.MessageBoxPad("선택된 Recipe가 없습니다."); mbPad.Show(); return; } string strMsg = $"\"{currentRecipe.Name}\" 레시피를 제거 하시겠습니까?"; if (MessageBox.Show(strMsg, "확인", MessageBoxButtons.YesNo) == DialogResult.Yes) { EquipmentLogManager.Instance.WriteButtonLog($"ScreenRecipe : Delete Recipe {currentRecipe.Name}"); _mainFrame.equipment.recipeManager.Delete(currentRecipe.Name); currentRecipe = null; RefreshRecipes(); } } private void btn_Save_Click(object sender, EventArgs e) { if (currentRecipe == null) { Viewer.MessageBoxPad mbPad = new Viewer.MessageBoxPad("선택된 Recipe가 없습니다."); mbPad.Show(); return; } string strMsg = $"\"{currentRecipe.Name}\" 레시피를 저장 하시겠습니까 ?"; if (MessageBox.Show(strMsg, "확인", MessageBoxButtons.YesNo) == DialogResult.Yes) { EquipmentLogManager.Instance.WriteButtonLog($"ScreenRecipe : Save Recipe {currentRecipe.Name}"); _mainFrame.equipment.recipeManager.SaveOrCreate(currentRecipe); RefreshRecipeData(); } } private void btn_Cancel_Click(object sender, EventArgs e) { if (currentRecipe == null) { Viewer.MessageBoxPad mbPad = new Viewer.MessageBoxPad("선택된 Recipe가 없습니다."); mbPad.Show(); return; } string strMsg = $"취소 하시겠습니까 ?"; if (MessageBox.Show(strMsg, "확인", MessageBoxButtons.YesNo) == DialogResult.Yes) { EquipmentLogManager.Instance.WriteButtonLog($"ScreenRecipe : Cancel Recipe {currentRecipe.Name}"); currentRecipe = _mainFrame.equipment.recipeManager.GetRecipe(currentRecipe.Name); RefreshRecipeData(); } } private void btn_Copy_Click(object sender, EventArgs e) { if (currentRecipe == null) { Viewer.MessageBoxPad mbPad = new Viewer.MessageBoxPad("선택된 Recipe가 없습니다."); mbPad.Show(); return; } RecipeCreateViewer recipeCreateViewer = new RecipeCreateViewer(); recipeCreateViewer.SetCopyVersion(currentRecipe.Radius, currentRecipe.DistanceFromCenterToPrimaryFlat, currentRecipe.EdgeRound); if (recipeCreateViewer.ShowDialog() == DialogResult.OK) { Recipe recipe = _mainFrame.equipment.recipeManager.GetRecipe(currentRecipe.Name); recipe.EdgeRound = recipeCreateViewer.EdgeRound; recipe.Name = recipeCreateViewer.RecipeName; if (_mainFrame.equipment.recipeManager.ExistsRecipe(recipe.Name) == false) { EquipmentLogManager.Instance.WriteButtonLog($"ScreenRecipe : Copy Recipe {currentRecipe} -> {recipe.Name}"); _mainFrame.equipment.recipeManager.SaveOrCreate(recipe); RefreshRecipes(); } else { Viewer.MessageBoxPad mbPad = new Viewer.MessageBoxPad("같은 이름의 Recipe가 있습니다."); mbPad.Show(); } } } private void lv_RecipeList_Click(object sender, EventArgs e) { if (lv_RecipeList.SelectedItems.Count == 0) return; string recipeName = lv_RecipeList.SelectedItems[0].Text; currentRecipe = _mainFrame.equipment.recipeManager.GetRecipe(recipeName); //레시피 정보 Refresh 값. RefreshRecipeData(); } private void lv_ProcessList_Click(object sender, EventArgs e) { if (lv_ProcessList.SelectedItems.Count == 0) return; int selectedIndex = lv_ProcessList.SelectedItems[0].Index; ProcessInfo processInfo = currentRecipe.ProcessInfoList[selectedIndex]; tb_StartX.Text = $"{processInfo.StartX}"; tb_StartY.Text = $"{processInfo.StartY}"; tb_Width.Text = $"{processInfo.Width}"; tb_Height.Text = $"{processInfo.Height}"; tb_HeightOverlap.Text = $"{processInfo.BeamHeightOverlap}"; tb_WidthOverlap.Text = $"{processInfo.BeamWidthOverlap}"; tb_AttenuaotrStep.Text = $"{processInfo.Energy}"; _waferProcessPointView.SetClickedLocationPosition(processInfo.StartX, processInfo.StartY, processInfo.Width, processInfo.Height); _waferProcessPointView.HighlightClear(); for (int i = 0; i < lv_ProcessList.SelectedItems.Count; i++) { _waferProcessPointView.HighlightProcessAreas(lv_ProcessList.SelectedItems[i].Index); } //_waferProcessPointView.HighlightProcessAreas(selectedIndex); } private void btn_ProcessDataClear_Click(object sender, EventArgs e) { if (currentRecipe == null) { Viewer.MessageBoxPad mbPad = new Viewer.MessageBoxPad("선택된 Recipe가 없습니다."); mbPad.Show(); return; } string strMsg = $"Process Data를 제거 하시겠습니까?"; if (MessageBox.Show(strMsg, "확인", MessageBoxButtons.YesNo) != DialogResult.Yes) { return; } EquipmentLogManager.Instance.WriteButtonLog($"ScreenRecipe : Process Data Clear"); currentRecipe.ProcessInfoList.Clear(); _waferProcessPointView.ClearProcessArea(); RefreshRecipeData(); } private void btn_FullShot_Click(object sender, EventArgs e) { if(currentRecipe == null) { Viewer.MessageBoxPad mbPad = new Viewer.MessageBoxPad("선택된 Recipe가 없습니다."); mbPad.Show(); return; } float scanRange = 0; float beamWidthOverlap = 0; float beamHeightOverlap = 0; float overlapOffset = 0; double energy = 0; double doubleValue; float floatValue; float.TryParse(tb_FullShotBeamHeightOverlap.Text, out floatValue); beamHeightOverlap = floatValue; float.TryParse(tb_FullShotBeamWidthOverlap.Text, out floatValue); beamWidthOverlap = floatValue; double.TryParse(tb_FullShotAttenuator.Text, out doubleValue); energy = doubleValue; float.TryParse(tb_FullShotScanRange.Text, out floatValue); scanRange = floatValue; float.TryParse(tb_FullShotOverlapOffset.Text, out floatValue); overlapOffset = floatValue; //인터락. if (currentRecipe.BeamWidth - beamWidthOverlap <= 0) { MessageBox.Show("BeamWidth - BeamWidthOverlap은 0보다 커야 합니다.", "확인", MessageBoxButtons.OK); return; } if (currentRecipe.BeamHeight - beamHeightOverlap <= 0) { MessageBox.Show("BeamHeight - BeamHeightOverlap은 0보다 커야 합니다.", "확인", MessageBoxButtons.OK); return; } if (scanRange <= 0) { MessageBox.Show("Scan Range는 1 보다 커야 합니다.", "확인", MessageBoxButtons.OK); return; } float beamheightdistance = currentRecipe.BeamHeight - beamHeightOverlap; float remainderBeamHeight = scanRange % beamheightdistance; //나머지 구하기 if (remainderBeamHeight != 0) { int beamCount = (int)(scanRange / beamheightdistance); if (remainderBeamHeight > beamheightdistance / 2) // BeamHeight의 반보다 작거나 같으면 올림. { scanRange = (beamCount + 1) * beamheightdistance; } else { scanRange = beamCount * beamheightdistance; } } scanRange = float.Parse($"{scanRange:F4}"); currentRecipe.ProcessInfoList.Clear(); for (double i = currentRecipe.Radius; i > -currentRecipe.Radius; i -= (scanRange - overlapOffset - beamHeightOverlap)) { ProcessInfo processInfo = new ProcessInfo(); processInfo.SetRecipeData(currentRecipe.Clone()); processInfo.StartX = -currentRecipe.Radius; processInfo.StartY = float.Parse($"{i:F4}"); processInfo.Width = currentRecipe.Radius * 2; processInfo.Height = scanRange; processInfo.BeamHeightOverlap = beamHeightOverlap; processInfo.BeamWidthOverlap = beamWidthOverlap; processInfo.Energy = energy; processInfo.SetProcessData(); if (processInfo.IsProcessEnable) { currentRecipe.AddProcessInfo(processInfo.Clone()); } } EquipmentLogManager.Instance.WriteButtonLog($"ScreenRecipe : Full shot"); RefreshRecipeData(); } private void btn_AddProcessInfo_Click(object sender, EventArgs e) { if (currentRecipe == null) { Viewer.MessageBoxPad mbPad = new Viewer.MessageBoxPad("선택된 Recipe가 없습니다."); mbPad.Show(); return; } ProcessInfo processInfo = new ProcessInfo(); int intValue; float floatValue; double doubleValue; processInfo.SetRecipeData(currentRecipe.Clone()); float.TryParse(tb_StartX.Text, out floatValue); processInfo.StartX = floatValue; float.TryParse(tb_StartY.Text, out floatValue); processInfo.StartY = floatValue; float.TryParse(tb_Width.Text, out floatValue); processInfo.Width = floatValue; float.TryParse(tb_Height.Text, out floatValue); processInfo.Height = floatValue; float.TryParse(tb_HeightOverlap.Text, out floatValue); processInfo.BeamHeightOverlap = floatValue; float.TryParse(tb_WidthOverlap.Text, out floatValue); processInfo.BeamWidthOverlap = floatValue; double.TryParse(tb_AttenuaotrStep.Text, out doubleValue); processInfo.Energy = doubleValue; //==================== Beam 크기에 따른 가공 높이 설정. ====================== //double remainderBeamHeight = processInfo.Height % currentRecipe.BeamHeight; //if (remainderBeamHeight != 0) //{ // if (remainderBeamHeight <= currentRecipe.BeamHeight - processInfo.BeamHeightOverlap / 2) // BeamHeight의 반보다 작거나 같으면 올림. // { // processInfo.Height = currentRecipe.BeamHeight * Math.Ceiling(processInfo.Height / currentRecipe.BeamHeight); // } // else // { // processInfo.Height = currentRecipe.BeamHeight * Math.Floor(processInfo.Height / currentRecipe.BeamHeight); // } //} //============================================================================= //인터락. if (processInfo.Width <= 0 || processInfo.Height <= 0) { MessageBox.Show("Width, Height값을 확인해 주세요.", "확인", MessageBoxButtons.OK); return; } if (processInfo.Energy < 0) { MessageBox.Show("Energy 값을 확인해 주세요.", "확인", MessageBoxButtons.OK); return; } if (processInfo.BeamWidth - processInfo.BeamWidthOverlap <= 0) { MessageBox.Show("BeamWidth - BeamWidthOverlap은 0보다 커야 합니다..", "확인", MessageBoxButtons.OK); return; } if (processInfo.BeamHeight - processInfo.BeamHeightOverlap <= 0) { MessageBox.Show("BeamHeight - BeamHeightOverlap은 0보다 커야 합니다..", "확인", MessageBoxButtons.OK); return; } processInfo.SetProcessData(); if (processInfo.IsProcessEnable == false) { MessageBox.Show("가공 불가능한 Process 입니다.", "확인", MessageBoxButtons.OK); return; } EquipmentLogManager.Instance.WriteButtonLog($"ScreenRecipe : Add process data {currentRecipe}"); currentRecipe.AddProcessInfo(processInfo.Clone()); RefreshRecipeData(); } private void btn_ProcessDataDelete_Click(object sender, EventArgs e) { if (currentRecipe == null) { Viewer.MessageBoxPad mbPad = new Viewer.MessageBoxPad("선택된 Recipe가 없습니다."); mbPad.Show(); return; } if (lv_ProcessList.SelectedItems.Count == 0) { return; } string strMsg = $"Process Data를 제거 하시겠습니까?"; if (MessageBox.Show(strMsg, "확인", MessageBoxButtons.YesNo) != DialogResult.Yes) { return; } List deleteList = new List(); List deleteProcessList = new List(); for(int i = 0; i < lv_ProcessList.SelectedItems.Count; i++) { deleteList.Add(currentRecipe.ProcessInfoList[lv_ProcessList.SelectedItems[i].Index]); deleteProcessList.Add(_waferProcessPointView.ProcessAreas[i]); } for(int i = 0; i < deleteList.Count; i++) { _waferProcessPointView.DeleteProcessArea(deleteProcessList[i]); currentRecipe.ProcessInfoList.Remove(deleteList[i]); } EquipmentLogManager.Instance.WriteButtonLog($"ScreenRecipe : Process Data Delete"); RefreshRecipeData(); } private void btn_CreateFoupRecipe_Click(object sender, EventArgs e) { FoupRecipeCreateViewer recipeCreateViewer = new FoupRecipeCreateViewer(); if (recipeCreateViewer.ShowDialog() == DialogResult.OK) { FoupRecipe recipe = new FoupRecipe(); recipe.Name = recipeCreateViewer.RecipeName; if (_mainFrame.equipment.foupRecipeManager.ExistsRecipe(recipe.Name) == false) { _mainFrame.equipment.foupRecipeManager.SaveOrCreate(recipe); EquipmentLogManager.Instance.WriteButtonLog($"ScreenRecipe : Foup Recipe Create Foup Recipe {recipe.Name}"); RefreshFoupRecipes(); } else { Viewer.MessageBoxPad mbPad = new Viewer.MessageBoxPad("같은 이름의 FoupRecipe가 있습니다."); mbPad.Show(); } } } private void btn_CancelFoupRecipe_Click(object sender, EventArgs e) { if (currentFoupRecipe == null) { Viewer.MessageBoxPad mbPad = new Viewer.MessageBoxPad("선택된 Recipe가 없습니다."); mbPad.Show(); return; } string strMsg = $"취소 하시겠습니까 ?"; if (MessageBox.Show(strMsg, "확인", MessageBoxButtons.YesNo) == DialogResult.Yes) { EquipmentLogManager.Instance.WriteButtonLog($"ScreenRecipe : Foup Recipe Cancel Foup Recipe {currentFoupRecipe.Name}"); currentFoupRecipe = _mainFrame.equipment.foupRecipeManager.GetRecipe(currentFoupRecipe.Name); RefreshFoupRecipeData(); } } private void btn_DeleteFoupRecipe_Click(object sender, EventArgs e) { if (currentFoupRecipe == null) { Viewer.MessageBoxPad mbPad = new Viewer.MessageBoxPad("선택된 Recipe가 없습니다."); mbPad.Show(); return; } string strMsg = $"\"{currentFoupRecipe.Name}\" 레시피를 제거 하시겠습니까?"; if (MessageBox.Show(strMsg, "확인", MessageBoxButtons.YesNo) == DialogResult.Yes) { EquipmentLogManager.Instance.WriteButtonLog($"ScreenRecipe : Foup Recipe Delete Foup Recipe {currentFoupRecipe.Name}"); _mainFrame.equipment.foupRecipeManager.Delete(currentFoupRecipe.Name); currentFoupRecipe = null; RefreshFoupRecipes(); } } private void btn_SaveFoupRecipe_Click(object sender, EventArgs e) { if (currentFoupRecipe == null) { Viewer.MessageBoxPad mbPad = new Viewer.MessageBoxPad("선택된 Recipe가 없습니다."); mbPad.Show(); return; } string strMsg = $"\"{currentFoupRecipe.Name}\" 레시피를 저장 하시겠습니까 ?"; if (MessageBox.Show(strMsg, "확인", MessageBoxButtons.YesNo) == DialogResult.Yes) { EquipmentLogManager.Instance.WriteButtonLog($"ScreenRecipe : Foup Recipe Save Foup Recipe {currentFoupRecipe.Name}"); _mainFrame.equipment.foupRecipeManager.SaveOrCreate(currentFoupRecipe); RefreshFoupRecipeData(); } } private void lv_FoupRecipe_Click(object sender, EventArgs e) { if (lv_FoupRecipe.SelectedItems.Count == 0) return; string recipeName = lv_FoupRecipe.SelectedItems[0].Text; currentFoupRecipe = _mainFrame.equipment.foupRecipeManager.GetRecipe(recipeName); //레시피 정보 Refresh 값. RefreshFoupRecipeData(); } private void lv_Recipes_DoubleClick(object sender, EventArgs e) { if (currentFoupRecipe == null) { string strMsg = $"선택된 Recipe가 없습니다."; if (MessageBox.Show(strMsg, "확인", MessageBoxButtons.YesNo) == DialogResult.Yes) { } return; } if(lv_Recipes.SelectedItems.Count != 0) { currentFoupRecipe.RecipeNames[currentFoupRecipe.RecipeNames.Length - lv_Recipes.SelectedItems[0].Index - 1] = null; } RefreshFoupRecipeData(); } private void btn_AddFoupRecipe_Click(object sender, EventArgs e) { if (currentRecipe == null || currentFoupRecipe == null) { Viewer.MessageBoxPad mbPad = new Viewer.MessageBoxPad("선택된 Recipe가 없습니다."); mbPad.Show(); return; } if(lv_Recipes.CheckedItems.Count != 0) { for (int i = 0; i < lv_Recipes.CheckedItems.Count; i++) { currentFoupRecipe.RecipeNames[24 - lv_Recipes.CheckedItems[i].Index] = currentRecipe.Name; } EquipmentLogManager.Instance.WriteButtonLog($"ScreenRecipe : Foup Recipe Add Foup Recipe {currentFoupRecipe.Name}, Recipe {currentRecipe.Name}"); RefreshFoupRecipeData(); } } private void btn_FoupRecipeClear_Click(object sender, EventArgs e) { if (currentFoupRecipe == null) { Viewer.MessageBoxPad mbPad = new Viewer.MessageBoxPad("선택된 Recipe가 없습니다."); mbPad.Show(); return; } for (int i = 0; i < 25; i++) { currentFoupRecipe.RecipeNames[i] = null; } EquipmentLogManager.Instance.WriteButtonLog($"ScreenRecipe : Foup Recipe Clear Foup Recipe {currentFoupRecipe.Name}"); RefreshFoupRecipeData(); } private void SetProcessLocationPosition() { double startX; double startY; double width; double height; if (double.TryParse(tb_StartX.Text, out startX)) { startX = double.Parse($"{startX:F3}"); } tb_StartX.Text = $"{startX}"; if (double.TryParse(tb_StartY.Text, out startY)) { startY = double.Parse($"{startY:F3}"); } tb_StartY.Text = $"{startY}"; if (double.TryParse(tb_Width.Text, out width)) { width = double.Parse($"{width:F3}"); } if(width < 0) { width = 0; } tb_Width.Text = $"{width}"; if (double.TryParse(tb_Height.Text, out height)) { height = double.Parse($"{height:F3}"); } if (height < 0) { height = 0; } tb_Height.Text = $"{height}"; if (width < 1) { width = 1; } if (height < 1) { height = 1; } _waferProcessPointView.SetClickedLocationPosition(startX, startY, width, height); } private void tb_ProcessData_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData == Keys.Enter) { SetProcessLocationPosition(); } } private void tb_ProcessData_Leave(object sender, EventArgs e) { SetProcessLocationPosition(); } } }