using SHARP_CLAS_UI.WPFControl; using System; using System.Drawing; using System.Threading; using System.Windows.Forms; namespace SHARP_CLAS_UI.Screen { public partial class Form_Main : Form { #region Field Form_Frame _Parent; Equipment _equip; Main_UserControl UserControl; private delegate void UI_Update_Delegate(); private Thread UI_Update_Th; private Thread Data_Update_Th; public int LoaderOutTrayCount; public int LD_Tray_In_Count; public int ULD_Tray_Empty_Count; public int ULD_Tray_Ok_Count; public int ULD_Tray_Ng_Count; bool update_check; #endregion #region Construct public Form_Main(Form_Frame _Parent) { InitializeComponent(); this._Parent = _Parent; this._equip = _Parent._equip; UserControl = new Main_UserControl(_Parent); el_Main_Animation.Child = UserControl; Init_Tact_Time_UI(); ThreadInit(); } #endregion #region Form Function private void Form_Main_FormClosing(object sender, FormClosingEventArgs e) { } private void btn_Start_Click(object sender, EventArgs e) { Form_MessageBox_Ok_No Start = new Form_MessageBox_Ok_No("Start", "Start ?"); if (DialogResult.OK == Start.ShowDialog()) { if(_equip.CleaningMode) { MessageBox.Show("Cleaning working..."); return; } Button data = (Button)sender; _Parent.WriteButtonLog($"{this.Name},{data.Name}"); if (_Parent._equip.Set_Equipment_Mode(En_Equipment_Mode.Auto)) _equip.Set_Equipment_Status_Code(En_Equipment_Status_Code.R1); } } private void btn_Pause_Click(object sender, EventArgs e) { if (_Parent._equip.process.ablation.Is_Power_Measure) { MessageBox.Show("Power Measuring ..."); return; } Button data = (Button)sender; _Parent.WriteButtonLog($"{this.Name},{data.Name}"); _Parent._equip.Set_Equipment_Mode(En_Equipment_Mode.Pause); _equip.Set_Equipment_Status_Code(En_Equipment_Status_Code.W4); } private void btn_Stop_Click(object sender, EventArgs e) { Form_MessageBox_Ok_No Stop = new Form_MessageBox_Ok_No("Stop", "Stop ?"); if (DialogResult.OK == Stop.ShowDialog()) { if (_equip.CleaningMode) { MessageBox.Show("Cleaning working..."); return; } if (_Parent._equip.Set_Equipment_Mode(En_Equipment_Mode.Stop)) { _Parent.sm.Set_Value(Process_Memory_Address.LD_Tray_In_Count, 0); _Parent.sm.Set_Value(Process_Memory_Address.LD_Tray_Empty_Count, 0); _Parent.sm.Set_Value(Process_Memory_Address.ULD_Tray_Empty_Count, 0); _Parent.sm.Set_Value(Process_Memory_Address.ULD_Tray_Ok_Count, 0); _Parent.sm.Set_Value(Process_Memory_Address.ULD_Tray_Ng_Count, 0); foreach (Panel_Info_Names info_name in Enum.GetValues(typeof(Panel_Info_Names))) { Panel_Info info = new Panel_Info(); Panel_Info_Manager.Instance.Set_Panel_Info(info_name, info); } _equip.Set_Equipment_Status_Code(En_Equipment_Status_Code.P1); } } } private void btn_Home_Click(object sender, EventArgs e) { Form_MessageBox_Ok_No home = new Form_MessageBox_Ok_No("Home", "Home ?"); if (DialogResult.OK == home.ShowDialog()) { if (_equip.CleaningMode) { MessageBox.Show("Cleaning working..."); return; } Button data = (Button)sender; _Parent.WriteButtonLog($"{this.Name},{data.Name}"); _Parent._equip.Set_Equipment_Mode(En_Equipment_Mode.Home); _equip.Set_Equipment_Status_Code(En_Equipment_Status_Code.S1); } } private void btn_Tray_Unloading_Click(object sender, EventArgs e) { Form_MessageBox_Ok_No home = new Form_MessageBox_Ok_No("Unloading", "Unloading ?"); if (DialogResult.OK == home.ShowDialog()) { if (_Parent._equip.equip_mode == En_Equipment_Mode.Stop) { Button data = (Button)sender; _Parent.WriteButtonLog($"{this.Name},{data.Name}"); if (_Parent._equip.loader.LiftIn.Unload()) { } if (_Parent._equip.loader.LiftOut.Unload()) { } if (_Parent._equip.unloader.LiftOk.Tray_Out()) { } if (_Parent._equip.unloader.LiftNg.Tray_Out()) { } if (_Parent._equip.unloader.LiftIn.Unload()) { } } } } private void btn_Key_Switch_Click(object sender, EventArgs e) { if (_Parent._equip.Door_Opened) { Interlock_Manager.Add_Interlock_Msg("Key switch can't change.", "Door is opened"); return; } Button data = (Button)sender; _Parent.WriteButtonLog($"{this.Name},{data.Name}"); _Parent._equip.Board_Control.IO_manager.Set_Output(OutputData.Safety_Mode_SW_Unlock, !_Parent.sm.Get_Bit(Output_Memory_Address.Safety_Mode_SW_Unlock)); } private void btn_Door_Open_Click(object sender, EventArgs e) { if (!_Parent._equip.Auto_Mode && _Parent._equip.Teach_Mode) { Button data = (Button)sender; if (_Parent._equip.Door_Opened) { _Parent._equip.Set_All_Door_Open(false); _Parent.WriteButtonLog($"{this.Name},Door Close"); } else { _Parent._equip.Set_All_Door_Open(true); _Parent.WriteButtonLog($"{this.Name},Door Open"); } } else { Interlock_Manager.Add_Interlock_Msg("Door can't open.", "You can't open door in Auto mode."); } } private void btn_ULD_Ng_Tray_Click(object sender, EventArgs e) { Button data = (Button)sender; if (_Parent.sm.Get_Bit(Input_Memory_Address.ULD_Ng_Out_Shuttle_Fwd_Sensor)) { _Parent._equip.unloader.LiftNg.Shuttle.Backward(); _Parent.WriteButtonLog($"{this.Name},Shuttle Backward"); } else { if (_Parent.sm.Get_Bit(Input_Memory_Address.ULD_Ng_Out_Shuttle_Bwd_Sensor) && _Parent.sm.Get_Bit(Input_Memory_Address.ULD_Ng_Port_Tray_Detect_Sensor)) { Interlock_Manager.Add_Interlock_Msg("NG Port Tray Is Exist!", "Tray Remove Please."); } else { _Parent._equip.unloader.LiftNg.Shuttle.Forward(); _Parent.WriteButtonLog($"{this.Name},Shuttle Forward"); } } } private void btn_Uld_OK_Unload_Click(object sender, EventArgs e) { Form_MessageBox_Ok_No ok = new Form_MessageBox_Ok_No("Unload OK Port", "OK Port Unload ?"); if (ok.ShowDialog() == DialogResult.OK) { _Parent._equip.unloader.LiftOk.Unload_tray_set(); Button data = (Button)sender; _Parent.WriteButtonLog($"{this.Name},{data.Name}"); } } private void btn_Uld_NG_Unload_Click(object sender, EventArgs e) { Form_MessageBox_Ok_No ng = new Form_MessageBox_Ok_No("Unload NG Port", "NG Port Unload ?"); if (ng.ShowDialog() == DialogResult.OK) { _Parent._equip.unloader.LiftNg.Unload_tray_set(); Button data = (Button)sender; _Parent.WriteButtonLog($"{this.Name},{data.Name}"); } } #endregion #region Function public void Set_Language() { try { lb_Tray_Info_Recipe.Text = "■" + resLanguage.Tray_Info_Recipe; lb_Ld_Reverse.Text = resLanguage.LD_Reverse; lb_Uld_Reverse.Text = resLanguage.ULD_Reverse; lb_LD_In_Count.Text = resLanguage.LD_In_Count; lb_LD_In_Cur_Count.Text = resLanguage.LD_In_Current_Count; lb_LD_Empty_Count.Text = resLanguage.LD_Empty_Coount; lb_LD_Empty_Cur_Count.Text = resLanguage.LD_Empty_Current_Count; lb_ULD_OK_Count.Text = resLanguage.ULD_OK_Count; lb_ULD_OK_Cur_Count.Text = resLanguage.ULD_OK_Current_Count; lb_ULD_NG_Count.Text = resLanguage.ULD_NG_Count; lb_ULD_NG_Cur_Count.Text = resLanguage.ULD_NG_Current_Count; lb_ULD_Empty_Count.Text = resLanguage.ULD_Empty_Count; lb_ULD_Empty_Cur_Count.Text = resLanguage.ULD_Empty_Current_Count; btn_Home.Text = resLanguage.Home; btn_Start.Text = resLanguage.Start; btn_Pause.Text = resLanguage.Pause; btn_Stop.Text = resLanguage.Stop; btn_Tray_Unloading.Text = resLanguage.Tray_Unloading; //btn_Uld_NG_Unload.Text = resLanguage. //btn_Uld_Ok_Unload.Text = resLanguage. lb_Equip_Mode.Text = resLanguage.Equip_Mode; btn_Door_Open.Text = resLanguage.Door_Open; btn_Key_Switch.Text = resLanguage.Key_Switch; btn_Cleaning_Position.Text = resLanguage.Cleaning_Position; } catch(Exception ex) { } } private void Init_Tact_Time_UI() { //Load Handler 1 uc_LD_Handler_1.SetTitle("Loader"); uc_LD_Handler_1.SetWork("LD Handler 1"); uc_LD_Handler_1.Init_Data(_equip, Panel_Info_Names.LD_Handler_1_1, Panel_Info_Names.LD_Handler_1_2); uc_LD_Handler_1.Init_Table_1_IO_Data(OutputData.LD_Cell_Handler_1_1_Vaccum_On_Sol_Valve, OutputData.LD_Cell_Handler_1_1_Blow_On_Sol_Valve, InputData.LD_Cell_Handler_1_1_Vaccum_On_Check); uc_LD_Handler_1.Init_Table_1_Scrap_Start(_equip.loader.Handler1.Picker_1_Scrap); uc_LD_Handler_1.Init_Table_2_IO_Data(OutputData.LD_Cell_Handler_1_2_Vaccum_On_Sol_Valve, OutputData.LD_Cell_Handler_1_2_Blow_On_Sol_Valve, InputData.LD_Cell_Handler_1_2_Vaccum_On_Check); uc_LD_Handler_1.Init_Table_2_Scrap_Start(_equip.loader.Handler1.Picker_2_Scrap); //Film Judge uc_Film_Judge.SetTitle("Loader"); uc_Film_Judge.SetWork("Film Judge"); //LD Reverse Stage uc_LD_Reverse_Stage.SetTitle("Before"); uc_LD_Reverse_Stage.SetWork("Reverse Stage"); uc_LD_Reverse_Stage.Init_Data(_equip, Panel_Info_Names.LD_Reverse_Stage_1, Panel_Info_Names.LD_Reverse_Stage_2); uc_LD_Reverse_Stage.Init_Table_1_IO_Data(OutputData.LD_Cell_Reverse_1_Vaccum_On_Sol_Valve, OutputData.LD_Cell_Reverse_1_Blow_On_Sol_Valve, InputData.LD_Cell_Reverse_1_Vaccum_On_Check); uc_LD_Reverse_Stage.Init_Table_1_Scrap_Start(_equip.before.ReverseStage.Picker_1_Scrap); uc_LD_Reverse_Stage.Init_Table_2_IO_Data(OutputData.LD_Cell_Reverse_2_Vaccum_On_Sol_Valve, OutputData.LD_Cell_Reverse_2_Blow_On_Sol_Valve, InputData.LD_Cell_Reverse_2_Vaccum_On_Check); uc_LD_Reverse_Stage.Init_Table_2_Scrap_Start(_equip.before.ReverseStage.Picker_2_Scrap); //Pre Align Stage uc_Pre_Align_Stage.SetTitle("Before"); uc_Pre_Align_Stage.SetWork("Pre Align Stage"); uc_Pre_Align_Stage.Init_Data(_equip, Panel_Info_Names.Pre_Align_Stage_1, Panel_Info_Names.Pre_Align_Stage_2); uc_Pre_Align_Stage.Init_Table_1_IO_Data(OutputData.Pre_Align_Stage_1_Vaccum_On_Sol_Valve, OutputData.Pre_Align_Stage_1_Blow_On_Sol_Valve, InputData.Pre_Align_Stage_1_Vaccum_On_Check); uc_Pre_Align_Stage.Init_Table_1_Scrap_Start(_equip.before.PreAlignStage.Stage_1_Scrap); uc_Pre_Align_Stage.Init_Table_2_IO_Data(OutputData.Pre_Align_Stage_2_Vaccum_On_Sol_Valve, OutputData.Pre_Align_Stage_2_Blow_On_Sol_Valve, InputData.Pre_Align_Stage_2_Vaccum_On_Check); uc_Pre_Align_Stage.Init_Table_2_Scrap_Start(_equip.before.PreAlignStage.Stage_2_Scrap); //Load Handler 2 uc_LD_Handler_2.SetTitle("Before"); uc_LD_Handler_2.SetWork("LD Handler 2"); uc_LD_Handler_2.Init_Data(_equip, Panel_Info_Names.LD_Handler_2_1, Panel_Info_Names.LD_Handler_2_2); uc_LD_Handler_2.Init_Table_1_IO_Data(OutputData.LD_Cell_Handler_2_1_Vaccum_On_Sol_Valve, OutputData.LD_Cell_Handler_2_1_Blow_On_Sol_Valve, InputData.LD_Cell_Handler_2_1_Vaccum_On_Check); uc_LD_Handler_2.Init_Table_1_Scrap_Start(_equip.before.Handler2.Picker_1_Scrap); uc_LD_Handler_2.Init_Table_2_IO_Data(OutputData.LD_Cell_Handler_2_2_Vaccum_On_Sol_Valve, OutputData.LD_Cell_Handler_2_2_Blow_On_Sol_Valve, InputData.LD_Cell_Handler_2_2_Vaccum_On_Check); uc_LD_Handler_2.Init_Table_2_Scrap_Start(_equip.before.Handler2.Picker_2_Scrap); //Ablation Stage 1 uc_Ablation_Stage_1.SetTitle("Process 1"); uc_Ablation_Stage_1.SetWork("Ablation Stage1"); uc_Ablation_Stage_1.Init_Data(_equip, Panel_Info_Names.Ablation_1_1, Panel_Info_Names.Ablation_1_2); uc_Ablation_Stage_1.Init_Table_1_IO_Data(OutputData.Ablation_Stage_1_1_Vaccum_On_Sol_Valve, OutputData.Ablation_Stage_1_1_Blow_On_Sol_Valve, InputData.Ablation_Stage_1_1_Vaccum_On_Check); uc_Ablation_Stage_1.Init_Table_1_Scrap_Start(_equip.process.ablation_stage_1.Stage_1_Scrap); uc_Ablation_Stage_1.Init_Table_2_IO_Data(OutputData.Ablation_Stage_2_1_Vaccum_On_Sol_Valve, OutputData.Ablation_Stage_2_1_Blow_On_Sol_Valve, InputData.Ablation_Stage_2_1_Vaccum_On_Check); uc_Ablation_Stage_1.Init_Table_2_Scrap_Start(_equip.process.ablation_stage_1.Stage_2_Scrap); //Ablation Stage 2 uc_Ablation_Stage_2.SetTitle("Process 2"); uc_Ablation_Stage_2.SetWork("Ablation Stage2"); uc_Ablation_Stage_2.Init_Data(_equip, Panel_Info_Names.Ablation_2_1, Panel_Info_Names.Ablation_2_2); uc_Ablation_Stage_2.Init_Table_1_IO_Data(OutputData.Ablation_Stage_3_1_Vaccum_On_Sol_Valve, OutputData.Ablation_Stage_3_1_Blow_On_Sol_Valve, InputData.Ablation_Stage_3_1_Vaccum_On_Check); uc_Ablation_Stage_2.Init_Table_1_Scrap_Start(_equip.process.ablation_stage_2.Picker_1_Scrap); uc_Ablation_Stage_2.Init_Table_2_IO_Data(OutputData.Ablation_Stage_4_1_Vaccum_On_Sol_Valve, OutputData.Ablation_Stage_4_1_Blow_On_Sol_Valve, InputData.Ablation_Stage_4_1_Vaccum_On_Check); uc_Ablation_Stage_2.Init_Table_2_Scrap_Start(_equip.process.ablation_stage_2.Picker_2_Scrap); //Ablation uc_Ablation.SetTitle("Process"); uc_Ablation.SetWork("Ablation"); //Plasma uc_Plasma.SetTitle("Process"); uc_Plasma.SetWork("Plasma"); //ULD Handler 2 uc_ULD_Handler_2.SetTitle("After"); uc_ULD_Handler_2.SetWork("ULD Handler 2"); uc_ULD_Handler_2.Init_Data(_equip, Panel_Info_Names.ULD_Handler_2_1, Panel_Info_Names.ULD_Handler_2_2); uc_ULD_Handler_2.Init_Table_1_IO_Data(OutputData.ULD_Cell_Handler_2_1_Vaccum_On_Sol_Valve, OutputData.ULD_Cell_Handler_2_1_Blow_On_Sol_Valve, InputData.ULD_Cell_Handler_2_1_Vaccum_On_Check); uc_ULD_Handler_2.Init_Table_1_Scrap_Start(_equip.after.Handler2.Picker_1_Scrap); uc_ULD_Handler_2.Init_Table_2_IO_Data(OutputData.ULD_Cell_Handler_2_2_Vaccum_On_Sol_Valve, OutputData.ULD_Cell_Handler_2_2_Blow_On_Sol_Valve, InputData.ULD_Cell_Handler_2_2_Vaccum_On_Check); uc_ULD_Handler_2.Init_Table_2_Scrap_Start(_equip.after.Handler2.Picker_2_Scrap); //AOI Stage uc_AOI_Stage.SetTitle("After"); uc_AOI_Stage.SetWork("AOI Stage"); uc_AOI_Stage.Init_Data(_equip, Panel_Info_Names.AOI_Stage_1, Panel_Info_Names.AOI_Stage_2); uc_AOI_Stage.Init_Table_1_IO_Data(OutputData.AOI_Stage_1_Vaccum_On_Sol_Valve, OutputData.AOI_Stage_1_Blow_On_Sol_Valve, InputData.AOI_Stage_1_Vaccum_On_Check); uc_AOI_Stage.Init_Table_1_Scrap_Start(_equip.after.AoiStage.Stage_1_Scrap); uc_AOI_Stage.Init_Table_2_IO_Data(OutputData.AOI_Stage_2_Vaccum_On_Sol_Valve, OutputData.AOI_Stage_2_Blow_On_Sol_Valve, InputData.AOI_Stage_2_Vaccum_On_Check); uc_AOI_Stage.Init_Table_2_Scrap_Start(_equip.after.AoiStage.Stage_2_Scrap); //ULD Reverse Stage uc_ULD_Reverse_Stage.SetTitle("After"); uc_ULD_Reverse_Stage.SetWork("Reverse Stage"); uc_ULD_Reverse_Stage.Init_Data(_equip, Panel_Info_Names.ULD_Reverse_Stage_1, Panel_Info_Names.ULD_Reverse_Stage_2); uc_ULD_Reverse_Stage.Init_Table_1_IO_Data(OutputData.ULD_Cell_Reverse_1_Vaccum_On_Sol_Valve, OutputData.ULD_Cell_Reverse_1_Blow_On_Sol_Valve, InputData.ULD_Cell_Reverse_1_Vaccum_On_Check); uc_ULD_Reverse_Stage.Init_Table_1_Scrap_Start(_equip.after.ReverseStage.Picker_1_Scrap); uc_ULD_Reverse_Stage.Init_Table_2_IO_Data(OutputData.ULD_Cell_Reverse_2_Vaccum_On_Sol_Valve, OutputData.ULD_Cell_Reverse_2_Blow_On_Sol_Valve, InputData.ULD_Cell_Reverse_2_Vaccum_On_Check); uc_ULD_Reverse_Stage.Init_Table_2_Scrap_Start(_equip.after.ReverseStage.Picker_2_Scrap); //ULD Handler 1 uc_ULD_Handler_1.SetTitle("Unloader"); uc_ULD_Handler_1.SetWork("ULD Handler 1"); uc_ULD_Handler_1.Init_Data(_equip, Panel_Info_Names.ULD_Handler_1_1, Panel_Info_Names.ULD_Handler_1_2); uc_ULD_Handler_1.Init_Table_1_IO_Data(OutputData.ULD_Cell_Handler_1_1_Vaccum_On_Sol_Valve, OutputData.ULD_Cell_Handler_1_1_Blow_On_Sol_Valve, InputData.ULD_Cell_Handler_1_1_Vaccum_On_Check); uc_ULD_Handler_1.Init_Table_1_Scrap_Start(_equip.unloader.Handler1.Picker_1_Scrap); uc_ULD_Handler_1.Init_Table_2_IO_Data(OutputData.ULD_Cell_Handler_1_2_Vaccum_On_Sol_Valve, OutputData.ULD_Cell_Handler_1_2_Blow_On_Sol_Valve, InputData.ULD_Cell_Handler_1_2_Vaccum_On_Check); uc_ULD_Handler_1.Init_Table_2_Scrap_Start(_equip.unloader.Handler1.Picker_2_Scrap); } private void ThreadInit() { Data_Update_Th = new Thread(Data_Update_Th_Set); UI_Update_Th = new Thread(UI_Update_Th_Set); Data_Update_Th.Start(); UI_Update_Th.Start(); } private void Data_Update_Th_Set() { while (!IsDisposed) { DateTime dt = DateTime.Now; Thread.Sleep(10); Get_Data_Process_Memory(); TimeSpan ts = (DateTime.Now - dt); } } private void Get_Data_Process_Memory() { try { object value; if (_Parent.sm.Get_Value(Process_Memory_Address.LD_Tray_Empty_Count, out value)) LoaderOutTrayCount = int.Parse($"{value}"); if (_Parent.sm.Get_Value(Process_Memory_Address.LD_Tray_In_Count, out value)) LD_Tray_In_Count = int.Parse($"{value}"); if (_Parent.sm.Get_Value(Process_Memory_Address.ULD_Tray_Empty_Count, out value)) ULD_Tray_Empty_Count = int.Parse($"{value}"); if (_Parent.sm.Get_Value(Process_Memory_Address.ULD_Tray_Ok_Count, out value)) ULD_Tray_Ok_Count = int.Parse($"{value}"); if (_Parent.sm.Get_Value(Process_Memory_Address.ULD_Tray_Ng_Count, out value)) ULD_Tray_Ng_Count = int.Parse($"{value}"); } catch (Exception) { } } private void UI_Update_Th_Set() { while (!this.IsDisposed) { Thread.Sleep(50); if (!update_check) { update_check = true; UI_Update(); } } } private void UI_Update() { if (InvokeRequired) { BeginInvoke(new UI_Update_Delegate(UI_Update)); return; } else { try { btn_Home.BackColor = _equip.Is_Home_Complete ? Color.Lime : Color.Green; if (_Parent.sm.Get_Bit(Input_Memory_Address.ULD_Ng_Out_Shuttle_Fwd_Sensor)) { btn_ULD_Ng_Tray.BackColor = Color.Lime; btn_ULD_Ng_Tray.Text = resLanguage.ULD_NG_Tray_Fwd; } else { btn_ULD_Ng_Tray.BackColor = Color.Green; btn_ULD_Ng_Tray.Text = resLanguage.ULD_NG_Tray_Bwd; } User_Control_Update(); Update_Recipe_UI(); UpdateTactTimeUI(); if (_Parent._equip.equip_mode == En_Equipment_Mode.Stop) btn_Tray_Unloading.Enabled = true; else btn_Tray_Unloading.Enabled = false; lb_Cur_ok_ng_count.Text = $"{_equip.panel_count_info.Day_ULD_OK_Count + _equip.panel_count_info.Day_ULD_NG_Count }"; lb_Cur_ok_count.Text = $"{_equip.panel_count_info.Day_ULD_OK_Count}"; lb_Cur_ng_count.Text = $"{_equip.panel_count_info.Day_ULD_NG_Count }"; lb_Minute_ok_ng_count.Text = $"{_equip.panel_count_info.Minute_ULD_OK_Count + _equip.panel_count_info.Minute_ULD_NG_Count }"; } catch (Exception ex) { } finally { update_check = false; } } } private void UpdateTactTimeUI() { //Load Handler 1 uc_LD_Handler_1.SetTact(_equip.loader.Handler1.Tact_Move.Seconds); //Film Judge uc_Film_Judge.SetTact(_equip.loader.Handler1.Tact_Film_Judge.Seconds); //LD Reverse Stage uc_LD_Reverse_Stage.SetTact(_equip.before.ReverseStage.Tact_Move.Seconds); //Pre Align Stage uc_Pre_Align_Stage.SetTact(_equip.loader.Handler1.Tact_Pre_Align.Seconds); //Load Handler 2 uc_LD_Handler_2.SetTact(_equip.before.Handler2.Tact_Move.Seconds); //Ablation Stage 1 uc_Ablation_Stage_1.SetTact(_equip.process.ablation_stage_1.Tact_Move.Seconds); //Ablation Stage 2 uc_Ablation_Stage_2.SetTact(_equip.process.ablation_stage_2.Tact_Move.Seconds); //Ablation uc_Ablation.SetTact(_equip.process.ablation.Tact_Move.Seconds); //Plasma uc_Plasma.SetTact(_equip.process.plasma.Tact_Move.Seconds); //ULD Handler 2 uc_ULD_Handler_2.SetTact(_equip.after.Handler2.Tact_Move.Seconds); //AOI Stage uc_AOI_Stage.SetTact(_equip.unloader.Handler1.Tact_AOI.Seconds); //ULD Reverse Stage uc_ULD_Reverse_Stage.SetTact(_equip.after.ReverseStage.Tact_Move.Seconds); //ULD Handler 1 uc_ULD_Handler_1.SetTact(_equip.unloader.Handler1.Tact_Move.Seconds); label10.Text = $"{_equip.loader.TactTime.Seconds:f3}"; label9.Text = $"{_equip.process.TactTime1.Seconds:f3}"; label8.Text = $"{_equip.process.TactTime2.Seconds:f3}"; label7.Text = $"{_equip.unloader.TactTime.Seconds:f3}"; } private void User_Control_Update() { if (!UserControl.Get_Dispatcher_Access()) return; var sm = _Parent.sm; UserControl.Set_LD_Tray_X_Position(_Parent._equip.Board_Control.Motors[MotorAxis.LD_Tray_TR_X].Position); UserControl.Set_LD_Handler_1_X_Position(_Parent._equip.Board_Control.Motors[MotorAxis.LD_Handler_1_X].Position); UserControl.Set_LD_Handler_1_Y_Position(_Parent._equip.Board_Control.Motors[MotorAxis.LD_Handler_1_Y].Position); UserControl.Set_LD_Handler_2_X_Position(_Parent._equip.Board_Control.Motors[MotorAxis.LD_Handler_2_X].Position); UserControl.Set_LD_Handler_2_Y_Position(_Parent._equip.Board_Control.Motors[MotorAxis.LD_Handler_2_Y].Position); UserControl.Set_Ablation_Stage_1_Y_Position(_Parent._equip.Board_Control.Motors[MotorAxis.Ablation_Y_1].Position); UserControl.Set_Ablation_Stage_2_Y_Position(_Parent._equip.Board_Control.Motors[MotorAxis.Ablation_Y_2].Position); UserControl.Set_Fine_Align_Position(_Parent._equip.Board_Control.Motors[MotorAxis.Fine_Align_X].Position); UserControl.Set_Ablation_Position(_Parent._equip.Board_Control.Motors[MotorAxis.Ablation_X].Position); UserControl.Set_Plasma_Position(_Parent._equip.Board_Control.Motors[MotorAxis.Plasma_X].Position); UserControl.Set_ULD_Handler_2_X_Position(_Parent._equip.Board_Control.Motors[MotorAxis.ULD_Handler_2_X].Position); UserControl.Set_ULD_Handler_2_Y_Position(_Parent._equip.Board_Control.Motors[MotorAxis.ULD_Handler_2_Y].Position); UserControl.Set_ULD_Handler_1_X_Position(_Parent._equip.Board_Control.Motors[MotorAxis.ULD_Handler_1_X].Position); UserControl.Set_ULD_Handler_1_Y_Position(_Parent._equip.Board_Control.Motors[MotorAxis.ULD_Handler_1_Y].Position); UserControl.Set_ULD_Tray_X_Position(_Parent._equip.Board_Control.Motors[MotorAxis.ULD_Tray_TR_X].Position); UserControl.Set_Door_1_Open(sm.Get_Bit(Input_Memory_Address.Safety_Door_Open_1)); UserControl.Set_Door_2_Open(sm.Get_Bit(Input_Memory_Address.Safety_Door_Open_2)); UserControl.Set_Door_3_Open(sm.Get_Bit(Input_Memory_Address.Safety_Door_Open_3)); UserControl.Set_Door_4_Open(sm.Get_Bit(Input_Memory_Address.Safety_Door_Open_4)); UserControl.Set_Door_5_Open(sm.Get_Bit(Input_Memory_Address.Safety_Door_Open_5)); UserControl.Set_Door_6_Open(sm.Get_Bit(Input_Memory_Address.Safety_Door_Open_6)); UserControl.Set_Door_7_Open(sm.Get_Bit(Input_Memory_Address.Safety_Door_Open_7)); UserControl.Set_Door_8_Open(sm.Get_Bit(Input_Memory_Address.Safety_Door_Open_8)); UserControl.Set_Door_9_Open(sm.Get_Bit(Input_Memory_Address.Safety_Door_Open_9)); UserControl.Set_Door_10_Open(sm.Get_Bit(Input_Memory_Address.Safety_Door_Open_10)); UserControl.Set_UPS_Door_Open(sm.Get_Bit(Input_Memory_Address.CP_BOX_UPS_PART_Door_Open)); UserControl.Set_GPS_Door_Open(sm.Get_Bit(Input_Memory_Address.CP_BOX_GPS_PART_Door_Open)); UserControl.Set_Auto_Mode(!sm.Get_Bit(Input_Memory_Address.Safety_Mode_SW_Teach)); UserControl.Set_LD_Tray_TR_Vacuum(sm.Get_Bit(Input_Memory_Address.LD_Tray_Transfer_Vaccum_On_Check), sm.Get_Bit(Output_Memory_Address.LD_Tray_Transfer_Vaccum_On_Sol_Valve) && sm.Get_Bit(Input_Memory_Address.LD_Tray_Transfer_Vaccum_On_Check) == false); UserControl.Set_LD_Handler_1_Vacuum(sm.Get_Bit(Input_Memory_Address.LD_Cell_Handler_1_1_Vaccum_On_Check), sm.Get_Bit(Input_Memory_Address.LD_Cell_Handler_1_2_Vaccum_On_Check), sm.Get_Bit(Output_Memory_Address.LD_Cell_Handler_1_1_Vaccum_On_Sol_Valve) && sm.Get_Bit(Input_Memory_Address.LD_Cell_Handler_1_1_Vaccum_On_Check) == false, sm.Get_Bit(Output_Memory_Address.LD_Cell_Handler_1_2_Vaccum_On_Sol_Valve) && sm.Get_Bit(Input_Memory_Address.LD_Cell_Handler_1_2_Vaccum_On_Check) == false); UserControl.Set_Pre_Align_Vacuum(sm.Get_Bit(Input_Memory_Address.Pre_Align_Stage_1_Vaccum_On_Check), sm.Get_Bit(Input_Memory_Address.Pre_Align_Stage_2_Vaccum_On_Check), sm.Get_Bit(Output_Memory_Address.Pre_Align_Stage_1_Vaccum_On_Sol_Valve) && sm.Get_Bit(Input_Memory_Address.Pre_Align_Stage_1_Vaccum_On_Check) == false, sm.Get_Bit(Output_Memory_Address.Pre_Align_Stage_2_Vaccum_On_Sol_Valve) && sm.Get_Bit(Input_Memory_Address.Pre_Align_Stage_2_Vaccum_On_Check) == false); UserControl.Set_LD_Reverse_Vacuum(sm.Get_Bit(Input_Memory_Address.LD_Cell_Reverse_1_Vaccum_On_Check), sm.Get_Bit(Input_Memory_Address.LD_Cell_Reverse_2_Vaccum_On_Check), sm.Get_Bit(Output_Memory_Address.LD_Cell_Reverse_1_Vaccum_On_Sol_Valve) && sm.Get_Bit(Input_Memory_Address.LD_Cell_Reverse_1_Vaccum_On_Check) == false, sm.Get_Bit(Output_Memory_Address.LD_Cell_Reverse_2_Vaccum_On_Sol_Valve) && sm.Get_Bit(Input_Memory_Address.LD_Cell_Reverse_2_Vaccum_On_Check) == false); UserControl.Set_LD_Handler_2_Vacuum(sm.Get_Bit(Input_Memory_Address.LD_Cell_Handler_2_1_Vaccum_On_Check), sm.Get_Bit(Input_Memory_Address.LD_Cell_Handler_2_2_Vaccum_On_Check), sm.Get_Bit(Output_Memory_Address.LD_Cell_Handler_2_1_Vaccum_On_Sol_Valve) && sm.Get_Bit(Input_Memory_Address.LD_Cell_Handler_2_1_Vaccum_On_Check) == false, sm.Get_Bit(Output_Memory_Address.LD_Cell_Handler_2_2_Vaccum_On_Sol_Valve) && sm.Get_Bit(Input_Memory_Address.LD_Cell_Handler_2_2_Vaccum_On_Check) == false); UserControl.Set_Ablation_Stage_1_Vacuum(sm.Get_Bit(Input_Memory_Address.Ablation_Stage_1_1_Vaccum_On_Check) && sm.Get_Bit(Input_Memory_Address.Ablation_Stage_1_2_Vaccum_On_Check), sm.Get_Bit(Input_Memory_Address.Ablation_Stage_2_1_Vaccum_On_Check) && sm.Get_Bit(Input_Memory_Address.Ablation_Stage_2_2_Vaccum_On_Check) , (sm.Get_Bit(Output_Memory_Address.Ablation_Stage_1_1_Vaccum_On_Sol_Valve) || sm.Get_Bit(Output_Memory_Address.Ablation_Stage_1_2_Vaccum_On_Sol_Valve)) && (sm.Get_Bit(Input_Memory_Address.Ablation_Stage_1_1_Vaccum_On_Check) == false|| sm.Get_Bit(Input_Memory_Address.Ablation_Stage_1_2_Vaccum_On_Check) == false), (sm.Get_Bit(Output_Memory_Address.Ablation_Stage_2_1_Vaccum_On_Sol_Valve) || sm.Get_Bit(Output_Memory_Address.Ablation_Stage_2_2_Vaccum_On_Sol_Valve)) && (sm.Get_Bit(Input_Memory_Address.Ablation_Stage_2_1_Vaccum_On_Check) == false || sm.Get_Bit(Input_Memory_Address.Ablation_Stage_2_2_Vaccum_On_Check) == false)); UserControl.Set_Ablation_Stage_2_Vacuum(sm.Get_Bit(Input_Memory_Address.Ablation_Stage_3_1_Vaccum_On_Check) && sm.Get_Bit(Input_Memory_Address.Ablation_Stage_3_2_Vaccum_On_Check), sm.Get_Bit(Input_Memory_Address.Ablation_Stage_4_1_Vaccum_On_Check) && sm.Get_Bit(Input_Memory_Address.Ablation_Stage_4_2_Vaccum_On_Check) , (sm.Get_Bit(Output_Memory_Address.Ablation_Stage_3_1_Vaccum_On_Sol_Valve) || sm.Get_Bit(Output_Memory_Address.Ablation_Stage_3_2_Vaccum_On_Sol_Valve)) && (sm.Get_Bit(Input_Memory_Address.Ablation_Stage_3_1_Vaccum_On_Check) == false || sm.Get_Bit(Input_Memory_Address.Ablation_Stage_3_2_Vaccum_On_Check) == false), (sm.Get_Bit(Output_Memory_Address.Ablation_Stage_4_1_Vaccum_On_Sol_Valve) || sm.Get_Bit(Output_Memory_Address.Ablation_Stage_4_2_Vaccum_On_Sol_Valve)) && (sm.Get_Bit(Input_Memory_Address.Ablation_Stage_4_1_Vaccum_On_Check) == false || sm.Get_Bit(Input_Memory_Address.Ablation_Stage_4_2_Vaccum_On_Check) == false)); UserControl.Set_AOI_Vacuum(sm.Get_Bit(Input_Memory_Address.AOI_Stage_1_Vaccum_On_Check), sm.Get_Bit(Input_Memory_Address.AOI_Stage_2_Vaccum_On_Check), sm.Get_Bit(Output_Memory_Address.AOI_Stage_1_Vaccum_On_Sol_Valve) && sm.Get_Bit(Input_Memory_Address.AOI_Stage_1_Vaccum_On_Check) == false, sm.Get_Bit(Output_Memory_Address.AOI_Stage_2_Vaccum_On_Sol_Valve) && sm.Get_Bit(Input_Memory_Address.AOI_Stage_2_Vaccum_On_Check) == false); UserControl.Set_ULD_Reverse_Vacuum(sm.Get_Bit(Input_Memory_Address.ULD_Cell_Reverse_1_Vaccum_On_Check), sm.Get_Bit(Input_Memory_Address.ULD_Cell_Reverse_2_Vaccum_On_Check), sm.Get_Bit(Output_Memory_Address.ULD_Cell_Reverse_1_Vaccum_On_Sol_Valve) && sm.Get_Bit(Input_Memory_Address.ULD_Cell_Reverse_1_Vaccum_On_Check) == false, sm.Get_Bit(Output_Memory_Address.ULD_Cell_Reverse_2_Vaccum_On_Sol_Valve) && sm.Get_Bit(Input_Memory_Address.ULD_Cell_Reverse_2_Vaccum_On_Check) == false); UserControl.Set_ULD_Handler_2_Vacuum(sm.Get_Bit(Input_Memory_Address.ULD_Cell_Handler_2_1_Vaccum_On_Check), sm.Get_Bit(Input_Memory_Address.ULD_Cell_Handler_2_2_Vaccum_On_Check), sm.Get_Bit(Output_Memory_Address.ULD_Cell_Handler_2_1_Vaccum_On_Sol_Valve) && sm.Get_Bit(Input_Memory_Address.ULD_Cell_Handler_2_1_Vaccum_On_Check) == false, sm.Get_Bit(Output_Memory_Address.ULD_Cell_Handler_2_2_Vaccum_On_Sol_Valve) && sm.Get_Bit(Input_Memory_Address.ULD_Cell_Handler_2_2_Vaccum_On_Check) == false); UserControl.Set_ULD_Handler_1_Vacuum(sm.Get_Bit(Input_Memory_Address.ULD_Cell_Handler_1_1_Vaccum_On_Check), sm.Get_Bit(Input_Memory_Address.ULD_Cell_Handler_1_2_Vaccum_On_Check), sm.Get_Bit(Output_Memory_Address.ULD_Cell_Handler_1_1_Vaccum_On_Sol_Valve) && sm.Get_Bit(Input_Memory_Address.ULD_Cell_Handler_1_1_Vaccum_On_Check) == false, sm.Get_Bit(Output_Memory_Address.ULD_Cell_Handler_1_2_Vaccum_On_Sol_Valve) && sm.Get_Bit(Input_Memory_Address.ULD_Cell_Handler_1_2_Vaccum_On_Check) == false); UserControl.Set_ULD_Tray_TR_Vacuum(sm.Get_Bit(Input_Memory_Address.ULD_Tray_Transfer_Vaccum_On_Check), sm.Get_Bit(Output_Memory_Address.ULD_Tray_Transfer_Vaccum_On_Sol_Valve) && sm.Get_Bit(Input_Memory_Address.ULD_Tray_Transfer_Vaccum_On_Check) == false); UserControl.Set_Laser_On(sm.Get_Bit(Input_Memory_Address.Laser_Active)); UserControl.Set_Plasma_On(sm.Get_Bit(Output_Memory_Address.Plasma_Remote_On_Relay)); UserControl.Set_LD_Tray_Empty_Tray_Empty(_Parent._equip.LoaderOutTrayCount > 0 ? false : true); UserControl.Set_LD_Tray_In_Tray_Empty(_Parent._equip.LoaderInTrayCount > 0 ? false : true); UserControl.Set_ULD_Tray_Empty_Tray_Empty(_Parent._equip.UnloaderInTrayCount > 0 ? false : true); UserControl.Set_ULD_Tray_Ng_Tray_Empty(_Parent._equip.UnloaderNgTrayCount > 0 ? false : true); UserControl.Set_ULD_Tray_Ok_Tray_Empty(_Parent._equip.UnloaderOkTrayCount > 0 ? false : true); } private void Update_Recipe_UI() { tb_LD_Tray_In_Tray_Cur_Count.Text = LD_Tray_In_Count.ToString(); tb_LD_Tray_Empty_Tray_Cur_Count.Text = LoaderOutTrayCount.ToString(); tb_ULD_Tray_Ok_Tray_Cur_Count.Text = ULD_Tray_Ok_Count.ToString(); tb_ULD_Tray_Ng_Tray_Cur_Count.Text = ULD_Tray_Ng_Count.ToString(); tb_ULD_Tray_Empty_Tray_Cur_Count.Text = ULD_Tray_Empty_Count.ToString(); btn_LD_Stop.BackColor = _Parent._equip.LD_Stop ? Color.Lime : Color.Green; btn_Key_Switch.BackColor = _Parent.sm.Get_Bit(Output_Memory_Address.Safety_Mode_SW_Unlock) ? Color.Lime : Color.Green; btn_Door_Open.BackColor = _Parent._equip.Door_Opened ? Color.Red : Color.Lime; btn_Door_Open.Enabled = _equip.Teach_Mode ? true : false; if (_Parent._equip.Cur_Main_Recipe != null && _Parent._equip.Cur_Main_Recipe.tray_info != null) { lb_Ld_Reverse.BackColor = _Parent._equip.Cur_Main_Recipe.tray_info.Ld_Reverse ? Color.Lime : Color.Green; lb_Uld_Reverse.BackColor = _Parent._equip.Cur_Main_Recipe.tray_info.Uld_Reverse ? Color.Lime : Color.Green; tb_LD_Tray_In_Tray_Count.Text = _Parent._equip.Cur_Main_Recipe.tray_info.LD_Tray_In_Tray_Count.ToString(); tb_LD_Tray_Empty_Tray_Count.Text = _Parent._equip.Cur_Main_Recipe.tray_info.LD_Tray_Empty_Tray_Count.ToString(); tb_ULD_Tray_Ok_Tray_Count.Text = _Parent._equip.Cur_Main_Recipe.tray_info.ULD_Tray_Ok_Tray_Count.ToString(); tb_ULD_Tray_Ng_Tray_Count.Text = _Parent._equip.Cur_Main_Recipe.tray_info.ULD_Tray_Ng_Tray_Count.ToString(); tb_ULD_Tray_Empty_Tray_Count.Text = _Parent._equip.Cur_Main_Recipe.tray_info.ULD_Tray_Empty_Tray_Count.ToString(); } tb_Equip_Mode.Text = _Parent._equip.equip_mode.ToString(); } #endregion private void btn_Auto_Power_View_Click(object sender, EventArgs e) { try { _equip.process.ablation.Auto_Power_View_Show(); } catch(Exception) { } } private void btn_Cleaning_Position_Click(object sender, EventArgs e) { Form_MessageBox_Ok_No Stop = new Form_MessageBox_Ok_No(_equip.CleaningMode ? "Stay Position" : "Clearning Position", _equip.CleaningMode ? "Stay Position Move ?" : "Clearning Position Move ?"); if (DialogResult.OK == Stop.ShowDialog()) { } else { return; } if (_equip.User.Level != En_User_Level.Master && _equip.Door_Opened) { MessageBox.Show("Door is opened"); return; } if (_equip.CleaningMode) { _equip.Set_Cleaning_Position(false); Button data = (Button)sender; _Parent.WriteButtonLog($"{this.Name},{data.Name} stay position"); btn_Cleaning_Position.BackColor = Color.White; } else { if (!_equip.Is_Home_Complete || _equip.equip_mode != En_Equipment_Mode.Pause || !_equip.Is_Clean_Position_Eanble() || _equip.Cur_Main_Recipe == null) { if (!_equip.Is_Home_Complete) { MessageBox.Show("Home is not completed..."); } if (_equip.equip_mode != En_Equipment_Mode.Pause) { MessageBox.Show("Equipment mode is not PAUSE..."); } if(_equip.Cur_Main_Recipe == null) { MessageBox.Show("Equipment Recipe is not selected..."); } if (!_equip.Is_Clean_Position_Eanble()) { MessageBox.Show("Equipment has tray or panel ..."); } return; } Button data = (Button)sender; _Parent.WriteButtonLog($"{this.Name},{data.Name} cleaning position"); _equip.Set_Cleaning_Position(true); btn_Cleaning_Position.BackColor = Color.Lime; } } private void btn_LD_Empty_Unload_Click(object sender, EventArgs e) { Form_MessageBox_Ok_No ng = new Form_MessageBox_Ok_No("LD Empty Port Unload", "LD Empty Port Unload ?"); if (ng.ShowDialog() == DialogResult.OK) { if(_equip.loader.LiftOut.Unload()) { } else { Button data = (Button)sender; _Parent.WriteButtonLog($"{this.Name},{data.Name}"); MessageBox.Show("LD Tray Empty Sequence is Running..."); } } } private void btn_LD_Stop_Click(object sender, EventArgs e) { Button data = (Button)sender; _equip.LD_Stop = !_equip.LD_Stop; _Parent.WriteButtonLog($"{this.Name},{data.Name} {_equip.LD_Stop}"); } } }