d23004
2023-05-24 39c293f35b62a539d069eda4e519282228fcfdf9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
using SA_LTT;
using SA_LTT.Info.RecipeInfo;
using SA_LTT_UI.Screen;
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 ProcessRecipeInfoViewer : Form
    {
        MainFrame _mainFrame;
 
        WaferProcessPointView _waferProcessPointView = new WaferProcessPointView();
 
        public ProcessRecipeInfoViewer(MainFrame mainFrame)
        {
            InitializeComponent();
            _mainFrame = mainFrame;
 
            el_CurrentWaferProcess.Child = _waferProcessPointView;
 
            _mainFrame.equipment.AddRecipeExcutedEvent(Sequence_RecipeExcuted);
            _mainFrame.equipment.AddProcessInfoExcutedEvent(Sequence_ProcessInfoExcuted);
        }
 
        private void Sequence_RecipeExcuted(Recipe recipe)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new RecipeExcuteEvent(Sequence_RecipeExcuted), recipe);
            }
            else
            {
                _waferProcessPointView.ClearProcessArea();
                _waferProcessPointView.Radius = recipe.Radius;
                _waferProcessPointView.PrimaryFlat = recipe.DistanceFromCenterToPrimaryFlat;
 
                tb_RecipeName.Text = recipe.Name;
                tb_RecipeRadius.Text = recipe.Radius.ToString();
                tb_RecipeDistancePrimaryFlat.Text = recipe.DistanceFromCenterToPrimaryFlat.ToString();
                tb_RecipeEdgeRound.Text = recipe.EdgeRound.ToString();
 
                tb_RecipeBeamWidth.Text = recipe.BeamWidth.ToString();
                tb_RecipeBeamHeight.Text = recipe.BeamHeight.ToString();
 
                foreach (ProcessInfo processInfo in recipe.ProcessInfoList)
                {
                    processInfo.SetProcessData();
 
                    _waferProcessPointView.AddProcessArea(processInfo.ProcessStartY, processInfo.ProcessEndY, processInfo.ProcessList.ToArray());
                }
            }
        }
 
        private void Sequence_ProcessInfoExcuted(ProcessInfo processInfo, int processInfoIndex)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new ProcessInfoExcuteEvent(Sequence_ProcessInfoExcuted), processInfo, processInfoIndex);
            }
            else
            {
                tb_RecipeWidthOverlap.Text = processInfo.BeamWidthOverlap.ToString();
                tb_RecipeHeightOverlap.Text = processInfo.BeamHeightOverlap.ToString();
                tb_RecipeEnergy.Text = processInfo.Energy.ToString();
 
                _waferProcessPointView.HighlightProcessAreas(processInfoIndex);
            }
        }
 
        private void ProcessRecipeInfoViewer_FormClosing(object sender, FormClosingEventArgs e)
        {
            e.Cancel = true;
            this.Hide();
        }
    }
}