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(); } } } } }