천호석
2023-05-15 0de38c0ebeb49d545ae1d2267f2b932392bd583c
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
using padDLL;
using SA_LTT;
using SA_LTT.Info.WaferInfo;
using SA_LTT.Module;
using SA_LTT_UI.Screen;
using System;
using System.Drawing;
using System.Windows.Forms;
using static SA_LTT.Info.WaferInfo.WaferInfoManager;
 
namespace SA_LTT_UI.Viewer
{
    public partial class ChamberViewer : Form
    {
        MainFrame _mainFrame;
        ChamberStatus _chamberStatus = new ChamberStatus();
 
        protected override CreateParams CreateParams
        {
            get
            {
                CreateParams MyCp = base.CreateParams;
                MyCp.ExStyle |= 0x02000000;
 
                return MyCp;
            }
        }
 
        public ChamberViewer(MainFrame mainFrame)
        {
            InitializeComponent();
            _mainFrame = mainFrame;
 
            elementHost1.Child = _chamberStatus;
            
            timer.Start();
        }
        
        private void timer_Tick(object sender, System.EventArgs e)
        {
            _chamberStatus.SetChamberGate(_mainFrame.equipment.chamber.IsGateOpen);
            _chamberStatus.SetChamberWaferExist(_mainFrame.equipment.chamber.WaferInfo);
            _chamberStatus.SetChamberWaferNum(_mainFrame.equipment.chamber.WaferInfo.SourceNumber);
 
            lb_ChamberWaferExist.BackColor = _mainFrame.equipment.chamber.WaferInfo.IsStatus == WaferInfo.WaferStatus.Exist ? System.Drawing.Color.Lime : System.Drawing.Color.Red;
 
            tb_Status.Text = _mainFrame.equipment.chamber.WaferInfo.IsStatus.ToString();
            tb_CarrierID.Text = _mainFrame.equipment.chamber.WaferInfo.CarrierID;
            tb_LotID.Text = _mainFrame.equipment.chamber.WaferInfo.LotID;
            tb_SourceNum.Text = _mainFrame.equipment.chamber.WaferInfo.SourceNumber.ToString();
            tb_IsFlip.Text = _mainFrame.equipment.chamber.WaferInfo.IsFlip ? "Flip" : "NonFlip";
            tb_RecipeName.Text = _mainFrame.equipment.chamber.WaferInfo.RecipeName;
 
            tb_ChamberVacuumPressure.Text = _mainFrame.equipment.chamber.ChamberVacuumPressure.ToString();
            tb_N2PTPPressure.Text = _mainFrame.equipment.chamber.N2PTPressure.ToString();
            tb_MainCDAFlow.Text = _mainFrame.equipment.chamber.MainCDAFlow.ToString();
 
            tb_MFCFlow.Text = _mainFrame.equipment.chamber.MFCFlow.ToString();
 
            lb_LiftPinUp.BackColor = _mainFrame.equipment.chamber.IsLiftPinUp ? System.Drawing.Color.Lime : System.Drawing.Color.Red;
            lb_VacuumOn.BackColor = _mainFrame.equipment.chamber.IsChuckVacuumSensorOn ? System.Drawing.Color.Lime : System.Drawing.Color.Red;
            lb_GateOpen.BackColor = _mainFrame.equipment.chamber.IsGateOpen ? System.Drawing.Color.Lime : System.Drawing.Color.Red;
 
            btn_VacuumOn.BackColor = _mainFrame.equipment.chamber.IsChuckVacuumOn ? System.Drawing.Color.Lime : System.Drawing.Color.Red;
            btn_VacuumOff.BackColor = !_mainFrame.equipment.chamber.IsChuckVacuumOn ? System.Drawing.Color.Lime : System.Drawing.Color.Red;
 
            btn_LiftPinUp.BackColor = _mainFrame.equipment.chamber.IsLiftPinUp ? System.Drawing.Color.Lime : System.Drawing.Color.Red;
            btn_LiftPinDown.BackColor = !_mainFrame.equipment.chamber.IsLiftPinUp ? System.Drawing.Color.Lime : System.Drawing.Color.Red;
 
            btn_GateOpen.BackColor = _mainFrame.equipment.chamber.IsGateOpen ? System.Drawing.Color.Lime : System.Drawing.Color.Red;
            btn_GateClose.BackColor = !_mainFrame.equipment.chamber.IsGateOpen ? System.Drawing.Color.Lime : System.Drawing.Color.Red;
            
            btn_N2ChamberValveOpen.BackColor = _mainFrame.equipment.chamber.IsN2ChamberValveOn ? System.Drawing.Color.Lime : System.Drawing.Color.Red;
            btn_N2ChamberValveClose.BackColor = !_mainFrame.equipment.chamber.IsN2ChamberValveOn ? System.Drawing.Color.Lime : System.Drawing.Color.Red;
 
            btn_N2MFCValveOpen.BackColor = _mainFrame.equipment.chamber.IsN2MFCValveOn ? System.Drawing.Color.Lime : System.Drawing.Color.Red;
            btn_N2MFCValveClose.BackColor = !_mainFrame.equipment.chamber.IsN2MFCValveOn ? System.Drawing.Color.Lime : System.Drawing.Color.Red;
 
            btn_ByPassValveOpen.BackColor = _mainFrame.equipment.chamber.IsByPassValveOn ? System.Drawing.Color.Lime : System.Drawing.Color.Red;
            btn_ByPassValveClose.BackColor = !_mainFrame.equipment.chamber.IsByPassValveOn ? System.Drawing.Color.Lime : System.Drawing.Color.Red;
 
            btn_AirBlowOpen.BackColor = _mainFrame.equipment.chamber.IsAirBlowOn ? System.Drawing.Color.Lime : System.Drawing.Color.Red;
            btn_AirBlowClose.BackColor = !_mainFrame.equipment.chamber.IsAirBlowOn ? System.Drawing.Color.Lime : System.Drawing.Color.Red;
 
            tb_MFCSetPoint.Text = _mainFrame.equipment.chamber.MFCSetPoint.ToString();
 
            MotorInfo();
        }
 
        private double[] m_dOldPos = new double[(int)PmacAxis.enMax];
        private double[] m_dOldSpeed = new double[(int)PmacAxis.enMax];
        private bool[,] m_bOldStatus = new bool[(int)PmacAxis.enMax, 6];
 
        private void MotorInfo()
        {
            try
            {
                Label[] lblPos = { lblPos1, lblPos2, lblPos3 };
                Label[] lblVel = { lblVel1, lblVel2, lblVel3 };
                Label[] lblServo = { lblServo1, lblServo2, lblServo3 };
                Label[] lblPLimit = { lblPLimit1, lblPLimit2, lblPLimit3 };
                Label[] lblNLimit = { lblNLimit1, lblNLimit2, lblNLimit3 };
                Label[] lblInPos = { lblInPos1, lblInPos2, lblInPos3 };
 
                int nCnt = 0;
 
                for (int i = 0; i < (int)PmacAxis.enMax; i++)
                {
                    nCnt = 0;
                    //Pos
                    if (m_dOldPos[i] != _mainFrame.equipment.powerPmac.GetAxisActualPos((PmacAxis)i))
                    {
                        m_dOldPos[i] = _mainFrame.equipment.powerPmac.GetAxisActualPos((PmacAxis)i);
 
                        lblPos[i].Text = m_dOldPos[i].ToString();
                    }
                    //Vel
                    if (m_dOldSpeed[i] != _mainFrame.equipment.powerPmac.GetAxisActualSpeed((PmacAxis)i))
                    {
                        m_dOldSpeed[i] = _mainFrame.equipment.powerPmac.GetAxisActualSpeed((PmacAxis)i);
 
                        lblVel[i].Text = m_dOldSpeed[i].ToString();
                    }
                    //Servo
                    if (m_bOldStatus[i, nCnt] != _mainFrame.equipment.powerPmac.GetAxisStatus((PmacAxis)i, AxisStatus.ServoOn))
                    {
                        m_bOldStatus[i, nCnt] = _mainFrame.equipment.powerPmac.GetAxisStatus((PmacAxis)i, AxisStatus.ServoOn);
 
                        if (m_bOldStatus[i, nCnt])
                            lblServo[i].BackColor = Color.Green;
                        else
                            lblServo[i].BackColor = Color.Transparent;
                    }
                    nCnt++;
                    //PLIMIT
                    if (m_bOldStatus[i, nCnt] != _mainFrame.equipment.powerPmac.GetAxisStatus((PmacAxis)i, AxisStatus.PLimit_HW))
                    {
                        m_bOldStatus[i, nCnt] = _mainFrame.equipment.powerPmac.GetAxisStatus((PmacAxis)i, AxisStatus.PLimit_HW);
 
                        if (m_bOldStatus[i, nCnt])
                            lblPLimit[i].BackColor = Color.Red;
                        else
                            lblPLimit[i].BackColor = Color.Transparent;
                    }
                    nCnt++;
                    //NLIMIT
                    if (m_bOldStatus[i, nCnt] != _mainFrame.equipment.powerPmac.GetAxisStatus((PmacAxis)i, AxisStatus.NLimit_HW))
                    {
                        m_bOldStatus[i, nCnt] = _mainFrame.equipment.powerPmac.GetAxisStatus((PmacAxis)i, AxisStatus.NLimit_HW);
 
                        if (m_bOldStatus[i, nCnt])
                            lblNLimit[i].BackColor = Color.Red;
                        else
                            lblNLimit[i].BackColor = Color.Transparent;
                    }
                    nCnt++;
                    nCnt++;
                    //INPOS
                    if (m_bOldStatus[i, nCnt] != _mainFrame.equipment.powerPmac.GetAxisStatus((PmacAxis)i, AxisStatus.InPos))
                    {
                        m_bOldStatus[i, nCnt] = _mainFrame.equipment.powerPmac.GetAxisStatus((PmacAxis)i, AxisStatus.InPos);
 
                        if (m_bOldStatus[i, nCnt])
                            lblInPos[i].BackColor = Color.Green;
                        else
                            lblInPos[i].BackColor = Color.Transparent;
                    }
                }
 
            }
            catch (Exception ex)
            {
                EquipmentLogManager.Instance.WriteExceptionLog(ex.StackTrace + "\r\n" + ex.Message);
            }
        }
        
        private void ChamberViewer_FormClosing(object sender, FormClosingEventArgs e)
        {
            e.Cancel = true;
            this.Hide();
        }
 
        private void btn_VacuumOn_Click(object sender, System.EventArgs e)
        {
            var ioPad = new DigitalIoPad();
            ioPad.Setup(PadItem.NoYes, "Chamber vacuum on");
            ioPad.ShowDialog();
 
            if (ioPad.DialogResult == DialogResult.OK)
            {
                EquipmentLogManager.Instance.WriteButtonLog($"ChamberViewer : Vacuum On");
                _mainFrame.equipment.chamber.ChuckVacuumOn();
            }
        }
 
        private void btn_VacuumOff_Click(object sender, System.EventArgs e)
        {
            var ioPad = new DigitalIoPad();
            ioPad.Setup(PadItem.NoYes, "Chamber vacuum off");
            ioPad.ShowDialog();
 
            if (ioPad.DialogResult == DialogResult.OK)
            {
                EquipmentLogManager.Instance.WriteButtonLog($"ChamberViewer : Vacuum Off");
                _mainFrame.equipment.chamber.ChuckVacuumOff();
            }
        }
 
        private void btn_LiftPinUp_Click(object sender, System.EventArgs e)
        {
            var ioPad = new DigitalIoPad();
            ioPad.Setup(PadItem.NoYes, "Lift pin up");
            ioPad.ShowDialog();
 
            if (ioPad.DialogResult == DialogResult.OK)
            {
                EquipmentLogManager.Instance.WriteButtonLog($"ChamberViewer : LiftPin Up");
                _mainFrame.equipment.chamber.LiftPinUp();
            }
        }
 
        private void btn_LiftPinDown_Click(object sender, System.EventArgs e)
        {
            var ioPad = new DigitalIoPad();
            ioPad.Setup(PadItem.NoYes, "Lift pin down");
            ioPad.ShowDialog();
 
            if (ioPad.DialogResult == DialogResult.OK)
            {
                EquipmentLogManager.Instance.WriteButtonLog($"ChamberViewer : LiftPin Down");
                _mainFrame.equipment.chamber.LiftPinDown();
            }
        }
 
        private void btn_GateOpen_Click(object sender, System.EventArgs e)
        {
            var ioPad = new DigitalIoPad();
            ioPad.Setup(PadItem.NoYes, "Chamber gate open");
            ioPad.ShowDialog();
 
            if (ioPad.DialogResult == DialogResult.OK)
            {
                EquipmentLogManager.Instance.WriteButtonLog($"ChamberViewer : Gate Open");
                _mainFrame.equipment.chamber.GateOpen();
            }
        }
 
        private void btn_GateClose_Click(object sender, System.EventArgs e)
        {
            var ioPad = new DigitalIoPad();
            ioPad.Setup(PadItem.NoYes, "Chamber gate close");
            ioPad.ShowDialog();
 
            if (ioPad.DialogResult == DialogResult.OK)
            {
                EquipmentLogManager.Instance.WriteButtonLog($"ChamberViewer : Gate Close");
                _mainFrame.equipment.chamber.GateClose();
            }
        }
 
        private void btn_N2ChamberValveOpen_Click(object sender, System.EventArgs e)
        {
            var ioPad = new DigitalIoPad();
            ioPad.Setup(PadItem.NoYes, "N2 Chamber Valve Open");
            ioPad.ShowDialog();
 
            if (ioPad.DialogResult == DialogResult.OK)
            {
                EquipmentLogManager.Instance.WriteButtonLog($"ChamberViewer : N2 Chamber Vale Open");
                _mainFrame.equipment.chamber.N2ChamberValveOn();
            }
        }
        private void btn_N2ChamberValveClose_Click(object sender, System.EventArgs e)
        {
            var ioPad = new DigitalIoPad();
            ioPad.Setup(PadItem.NoYes, "N2 Chamber Valve Close");
            ioPad.ShowDialog();
 
            if (ioPad.DialogResult == DialogResult.OK)
            {
                EquipmentLogManager.Instance.WriteButtonLog($"ChamberViewer : N2 Chamber Vale Close");
                _mainFrame.equipment.chamber.N2ChamberValveOff();
            }
        }
 
        private void btn_N2MFCValveOpen_Click(object sender, System.EventArgs e)
        {
            var ioPad = new DigitalIoPad();
            ioPad.Setup(PadItem.NoYes, "N2 MFC Valve Open");
 
            if (ioPad.ShowDialog() == DialogResult.OK)
            {
                EquipmentLogManager.Instance.WriteButtonLog($"ChamberViewer : N2 MFC Vale Open");
                _mainFrame.equipment.chamber.N2MFCValveOn();
            }
        }
 
        private void btn_N2MFCValveClose_Click(object sender, System.EventArgs e)
        {
            var ioPad = new DigitalIoPad();
            ioPad.Setup(PadItem.NoYes, "N2 MFC Valve Close");
 
            if (ioPad.ShowDialog() == DialogResult.OK)
            {
                EquipmentLogManager.Instance.WriteButtonLog($"ChamberViewer : N2 MFC Vale Close");
                _mainFrame.equipment.chamber.N2MFCValveOff();
            }
        }
        
        private void btn_ByPassValveOpen_Click(object sender, System.EventArgs e)
        {
            var ioPad = new DigitalIoPad();
            ioPad.Setup(PadItem.NoYes, "ByPass Valve Open");
 
            if (ioPad.ShowDialog() == DialogResult.OK)
            {
                EquipmentLogManager.Instance.WriteButtonLog($"ChamberViewer : By pass valve Open");
                _mainFrame.equipment.chamber.ByPassValveOn();
            }
        }
 
        private void btn_ByPassValveClose_Click(object sender, System.EventArgs e)
        {
            var ioPad = new DigitalIoPad();
            ioPad.Setup(PadItem.NoYes, "ByPass Valve Close");
 
            if (ioPad.ShowDialog() == DialogResult.OK)
            {
                EquipmentLogManager.Instance.WriteButtonLog($"ChamberViewer : By pass valve Close");
                _mainFrame.equipment.chamber.ByPassValveOff();
            }
        }
 
        private void btn_AirBlowOpen_Click(object sender, System.EventArgs e)
        {
            var ioPad = new DigitalIoPad();
            ioPad.Setup(PadItem.NoYes, "Air Blow Open");
 
            if (ioPad.ShowDialog() == DialogResult.OK)
            {
                EquipmentLogManager.Instance.WriteButtonLog($"ChamberViewer : Air Blow Open");
                _mainFrame.equipment.chamber.AirBlowOn();
            }
        }
 
        private void btn_AirBlowClose_Click(object sender, System.EventArgs e)
        {
            var ioPad = new DigitalIoPad();
            ioPad.Setup(PadItem.NoYes, "Air Blow Close");
 
            if (ioPad.ShowDialog() == DialogResult.OK)
            {
                EquipmentLogManager.Instance.WriteButtonLog($"ChamberViewer : Air Blow Close");
                _mainFrame.equipment.chamber.AirBlowOff();
            }
        }
 
        private void tb_MFCSetPoint_Click(object sender, System.EventArgs e)
        {
            var nPad = new NumericPad();
            nPad.Setup("0", "10");  //범위 변경해야 함
 
            if (nPad.ShowDialog() == DialogResult.OK)
            {
                double value = 0;
                if (double.TryParse(nPad.GetValue(), out value))
                {
                    EquipmentLogManager.Instance.WriteButtonLog($"ChamberViewer : MFC set {value}");
                    _mainFrame.equipment.chamber.SetMFCFlow(value);
                }
            }
        }
 
        private void btn_JogXPlus_MouseDown(object sender, MouseEventArgs e)
        {
            double velocity = (double)nud_JogSpeed.Value;
            EquipmentLogManager.Instance.WriteButtonLog($"ChamberViewer : Positive Jog X speed {velocity}");
            _mainFrame.equipment.powerPmac.MoveJog(PmacAxis.X_Axis, velocity, MotionDirection.Plus);
        }
 
        private void btn_JogXPlus_MouseUp(object sender, MouseEventArgs e)
        {
            EquipmentLogManager.Instance.WriteButtonLog($"ChamberViewer : Stop Jog X");
            _mainFrame.equipment.powerPmac.MoveStop(PmacAxis.X_Axis);
        }
 
        private void btn_JogXMinus_MouseDown(object sender, MouseEventArgs e)
        {
            double velocity = (double)nud_JogSpeed.Value;
            EquipmentLogManager.Instance.WriteButtonLog($"ChamberViewer : Negative Jog X speed {velocity}");
            _mainFrame.equipment.powerPmac.MoveJog(PmacAxis.X_Axis, velocity, MotionDirection.Minus);
        }
 
        private void btn_JogXMinus_MouseUp(object sender, MouseEventArgs e)
        {
            EquipmentLogManager.Instance.WriteButtonLog($"ChamberViewer : Stop Jog X");
            _mainFrame.equipment.powerPmac.MoveStop(PmacAxis.X_Axis);
        }
 
        private void btn_JogYPlus_MouseDown(object sender, MouseEventArgs e)
        {
            double velocity = (double)nud_JogSpeed.Value;
            EquipmentLogManager.Instance.WriteButtonLog($"ChamberViewer : Positive Jog Y speed {velocity}");
            _mainFrame.equipment.powerPmac.MoveJog(PmacAxis.Y_Axis, velocity, MotionDirection.Plus);
        }
 
        private void btn_JogYPlus_MouseUp(object sender, MouseEventArgs e)
        {
            EquipmentLogManager.Instance.WriteButtonLog($"ChamberViewer : Stop Jog Y");
            _mainFrame.equipment.powerPmac.MoveStop(PmacAxis.Y_Axis);
        }
 
        private void btn_JogYMinus_MouseDown(object sender, MouseEventArgs e)
        {
            double velocity = (double)nud_JogSpeed.Value;
            EquipmentLogManager.Instance.WriteButtonLog($"ChamberViewer : Negative Jog Y speed {velocity}");
            _mainFrame.equipment.powerPmac.MoveJog(PmacAxis.Y_Axis, velocity, MotionDirection.Minus);
        }
 
        private void btn_JogYMinus_MouseUp(object sender, MouseEventArgs e)
        {
            EquipmentLogManager.Instance.WriteButtonLog($"ChamberViewer : Stop Jog Y");
            _mainFrame.equipment.powerPmac.MoveStop(PmacAxis.Y_Axis);
        }
 
        private void MoveTeachPosition(PmacAxis axis, EnTeachData teachData)
        {
            double dPos = _mainFrame.equipment.powerPmac.m_AxisAllList[(int)axis].TeachList[(int)teachData].Position;
            double dSpeed = _mainFrame.equipment.powerPmac.m_AxisAllList[(int)axis].TeachList[(int)teachData].Speed;
            double dAcc = _mainFrame.equipment.powerPmac.m_AxisAllList[(int)axis].TeachList[(int)teachData].Accel;
            
            _mainFrame.equipment.powerPmac.MoveAbs(axis, dPos, dSpeed, dAcc);
        }
 
        private void btn_LoadPosition_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Load Position으로 이동 하시겠습니까?", "확인", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                EquipmentLogManager.Instance.WriteButtonLog($"ChamberViewer : Move Load Position");
                MoveTeachPosition(PmacAxis.Y_Axis, EnTeachData.LoadPosY);
                MoveTeachPosition(PmacAxis.X_Axis, EnTeachData.LoadPosX);
                MoveTeachPosition(PmacAxis.T_Axis, EnTeachData.LoadPosT);
            }
        }
 
        private void btn_PowerMeterPosition_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Powermeter Position으로 이동 하시겠습니까?", "확인", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                if (_mainFrame.equipment.chamber.IsCenterPosition)
                {
                    _mainFrame.equipment.chamber.MovePowerMeterPosition();
                    EquipmentLogManager.Instance.WriteButtonLog($"ChamberViewer : Move PowerMeter Position");
                }
                else
                {
                    MessageBoxPad mbp = new MessageBoxPad("Center 위치에서 이동 할 수 있습니다.");
                    mbp.Show();
                }
            }
        }
 
        private void btn_CenterPosition_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Center Position으로 이동 하시겠습니까?", "확인", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                EquipmentLogManager.Instance.WriteButtonLog($"ChamberViewer : Move Center Position");
 
                _mainFrame.equipment.chamber.MoveCenterPosition();
            }
        }
 
        private void btn_BeamProfilePosition_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("BeamProfile Position으로 이동 하시겠습니까?", "확인", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                if (_mainFrame.equipment.chamber.IsCenterPosition)
                {
                    _mainFrame.equipment.chamber.MoveBeamProfilePosition();
                    EquipmentLogManager.Instance.WriteButtonLog($"ChamberViewer : Move BeamProfile Position");
                }
                else
                {
                    MessageBoxPad mbp = new MessageBoxPad("Center 위치에서 이동 할 수 있습니다.");
                    mbp.Show();
                }
            }
        }
 
        private void btn_ManualRun_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Manual 가공을 진행 하시겠습니까?", "확인", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                if (_mainFrame.equipment.EquipmentMode == EquipmentMode.Teach || _mainFrame.equipment.EquipmentStatus == EquipmentStatus.Fault || _mainFrame.equipment.ProcessStatus != ProcessStatus.Idle)
                {
                    if (_mainFrame.equipment.EquipmentMode == EquipmentMode.Teach)
                    {
                        MessageBoxPad mbp = new MessageBoxPad("Equipment Mode가 Teach 입니다.");
                        mbp.Show();
                    }
 
                    if (_mainFrame.equipment.EquipmentStatus == EquipmentStatus.Fault)
                    {
                        MessageBoxPad mbp = new MessageBoxPad("Equipment 상태가 Fault 입니다.");
                        mbp.Show();
                    }
 
                    if (_mainFrame.equipment.ProcessStatus != ProcessStatus.Idle)
                    {
                        MessageBoxPad mbp = new MessageBoxPad("Process 상태가 Idle이 아닙니다.");
                        mbp.Show();
                    }
 
                    return;
                }
 
                if (_mainFrame.equipment.ManualProcessStart())
                {
                    EquipmentLogManager.Instance.WriteButtonLog($"{this.Name} : {((Control)sender).Text}");
 
                }
            }
        }
 
        private void btn_AlignPosition_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Align Position으로 이동 하시겠습니까?", "확인", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                if (_mainFrame.equipment.chamber.IsCenterPosition)
                {
                    _mainFrame.equipment.chamber.MoveAlignPosition();
                    EquipmentLogManager.Instance.WriteButtonLog($"ChamberViewer : Move Align Position");
                }
                else
                {
                    MessageBoxPad mbp = new MessageBoxPad("Center 위치에서 이동 할 수 있습니다.");
                    mbp.Show();
                }
            }
        }
    }
}