using SA_LTT;
|
using SA_LTT.Info.RecipeInfo;
|
using System;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
using System.Data;
|
using System.Drawing;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using System.Windows.Forms;
|
|
namespace SA_LTT_UI.Viewer
|
{
|
public partial class FoupRecipeSelectViewer : Form
|
{
|
MainFrame _mainFrame;
|
|
private FoupRecipe currentFoupRecipe;
|
|
public FoupRecipe CurrentFoupRecipe
|
{
|
get
|
{
|
return currentFoupRecipe;
|
}
|
|
set
|
{
|
currentFoupRecipe = value;
|
}
|
}
|
|
public FoupRecipeSelectViewer(MainFrame mainFrame)
|
{
|
InitializeComponent();
|
|
_mainFrame = mainFrame;
|
RefreshFoupRecipes();
|
}
|
|
public void RefreshFoupRecipes()
|
{
|
_mainFrame.equipment.foupRecipeManager.RefreshRecipes();
|
|
cbb_FoupRecipe.Items.Clear();
|
|
FoupRecipe[] recipes = _mainFrame.equipment.foupRecipeManager.GetRecipeList();
|
|
foreach (FoupRecipe recipe in recipes)
|
{
|
cbb_FoupRecipe.Items.Add(recipe.Name);
|
}
|
|
if(cbb_FoupRecipe.Items.Count > 0)
|
{
|
cbb_FoupRecipe.SelectedIndex = 0;
|
}
|
}
|
|
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 (originalRecipe.RecipeNames[i] == null)
|
{
|
lvi.SubItems.Add("Empty");
|
}
|
else
|
{
|
lvi.SubItems.Add(originalRecipe.RecipeNames[i]);
|
}
|
|
lv_Recipes.Items.Add(lvi);
|
}
|
}
|
}
|
|
private void cbb_FoupRecipe_SelectedIndexChanged(object sender, EventArgs e)
|
{
|
CurrentFoupRecipe = _mainFrame.equipment.foupRecipeManager.Recipes[cbb_FoupRecipe.Text];
|
RefreshFoupRecipeData();
|
}
|
|
private void btn_Ok_Click(object sender, EventArgs e)
|
{
|
this.DialogResult = DialogResult.OK;
|
EquipmentLogManager.Instance.WriteButtonLog($"{this.Name} : {((Control)sender).Text}");
|
this.Close();
|
}
|
|
private void btn_Cancel_Click(object sender, EventArgs e)
|
{
|
this.DialogResult = DialogResult.Cancel;
|
this.Close();
|
}
|
}
|
}
|