From 2eb59634fdfb48cbd8a1e7ee09c2ccd193ccafec Mon Sep 17 00:00:00 2001
From: 천호석 <hosuk1418@naver.com>
Date: 월, 12 12월 2022 15:39:17 +0900
Subject: [PATCH] Laser head X축 구동 시 Laser head Z축 Home위치 확인 후 구동.

---
 SHARP_CLAS_UI/500.Equipment/Equipment.cs |   75 ++++++++++++++++++++++++++++++++++++-
 1 files changed, 72 insertions(+), 3 deletions(-)

diff --git a/SHARP_CLAS_UI/500.Equipment/Equipment.cs b/SHARP_CLAS_UI/500.Equipment/Equipment.cs
index d7af1b8..f4b8af3 100644
--- a/SHARP_CLAS_UI/500.Equipment/Equipment.cs
+++ b/SHARP_CLAS_UI/500.Equipment/Equipment.cs
@@ -564,7 +564,7 @@
         private User_Info _user;
         private SequenceTimer _modeChangeTime = new SequenceTimer();
 
-        private string _programVersion = "001.002.000";
+        private string _programVersion = "001.003.000";
         #endregion
 
         #region Construct
@@ -578,7 +578,7 @@
 
             power_meter = new Power_Meter(this, "COM3");
             power_meter.Open();
-
+            power_meter.HandShakingOn();
             Create_Exception_logger();
             Create_Panel_Info_logger();
             Create_Tact_Time_logger();
@@ -978,7 +978,12 @@
 
                 if (!Align_vision.isConnected) Alarm_Manager.Instance.Occurred(En_Alarm_List.AL_0510_ALIGN_VISION_DISCONNECT);
                 if (!Aoi_vision.isConnected) Alarm_Manager.Instance.Occurred(En_Alarm_List.AL_0511_AOI_VISION_DISCONNECT);
-                if (!power_meter.isOpen && !Alarm_Manager.Instance.Occured_List.Exists(X => X.Code == En_Alarm_List.AL_0930_POWER_METER_DISCONNECTED)) { Alarm_Manager.Instance.Occurred(En_Alarm_List.AL_0930_POWER_METER_DISCONNECTED); power_meter.Open(); }
+                if (!power_meter.isOpen && !Alarm_Manager.Instance.Occured_List.Exists(X => X.Code == En_Alarm_List.AL_0930_POWER_METER_DISCONNECTED))
+                {
+                    Alarm_Manager.Instance.Occurred(En_Alarm_List.AL_0930_POWER_METER_DISCONNECTED);
+                    power_meter.Open();
+                    power_meter.HandShakingOn();
+                }
 
                 if (equip_mode == En_Equipment_Mode.Auto && dt.Second % 10 == 0 && (loader.Panel_Exist && before.Panel_Exist && process.Panel_Exist && after.Panel_Exist && unloader.Panel_Exist) && !units.Exists(x => x.sequenceChangedTime.Minute < 10))
                 {
@@ -992,6 +997,64 @@
                     panel_count_info.CleaningCount = 0;
                     Panel_Count_Info_Manager.Instance.Save_Panel_Count_Info(panel_count_info);
                 }
+
+                if(equip_mode != En_Equipment_Mode.Auto) // Auto mode媛� �븘�땺 �븣 
+                {
+                    if(equip_mode == En_Equipment_Mode.Pause && units.Exists(x => x.UnitMode != equip_mode))
+                    {
+                        // Pause wait �긽�깭 �씪 �븣�뒗 interlock 諛쒖깮 X
+                    }
+                    else
+                    {
+                        
+                    }
+                }
+
+                // Laser On Interlock 
+                // Power meter �쐞移� or 媛�怨� �쐞移섍� �븘�땺 �븣 Laser on�떆 Laser off 吏꾪뻾 �썑 Interlock.
+                if (Cur_Main_Recipe != null && Cur_Main_Recipe.process_info != null && Cur_Main_Recipe.panel_type_info != null)
+                {
+                    double scannerA1Position = Cur_Main_Recipe.process_info.Scanner_X_A1 + Cur_Main_Recipe.panel_type_info.Scanner_Offset_X_A1;
+                    double scannerA2Position = Cur_Main_Recipe.process_info.Scanner_X_A2 + Cur_Main_Recipe.panel_type_info.Scanner_Offset_X_A2;
+                    double scannerB1Position = Cur_Main_Recipe.process_info.Scanner_X_B1 + Cur_Main_Recipe.panel_type_info.Scanner_Offset_X_B1;
+                    double scannerB2Position = Cur_Main_Recipe.process_info.Scanner_X_B2 + Cur_Main_Recipe.panel_type_info.Scanner_Offset_X_B2;
+
+                    object value;
+                    sm.Get_Value(Position_Parameter_Address.Scanner_X_Power_Meter_Position, out value);
+                    double scannerPosition = double.Parse($"{value}");
+
+                    bool isInPosition = false;
+
+                    isInPosition |= scannerA1Position - 10 <= scannerPosition && scannerPosition <= scannerA1Position + 10;
+                    isInPosition |= scannerA2Position - 10 <= scannerPosition && scannerPosition <= scannerA2Position + 10;
+                    isInPosition |= scannerB1Position - 10 <= scannerPosition && scannerPosition <= scannerB1Position + 10;
+                    isInPosition |= scannerB2Position - 10 <= scannerPosition && scannerPosition <= scannerB2Position + 10;
+                    isInPosition |= process.ablation.Get_Is_Position_X_Power_Meter() && process.ablation.Get_Is_Position_Z_Power_Meter();
+
+                    if(isInPosition == false)
+                    {
+                        if (sm.Get_Bit(Input_Memory_Address.Laser_Active))
+                        {
+                            scanner.Set_Laser_Off();
+                            Interlock_Manager.Add_Interlock_Msg("Laser can't on.", "Please move power meter position.");
+                        }
+                    }
+                }
+                else
+                {
+                    bool isInPosition = false;
+                    isInPosition |= process.ablation.Get_Is_Position_X_Power_Meter() && process.ablation.Get_Is_Position_Z_Power_Meter();
+
+                    if (isInPosition == false)
+                    {
+                        if (sm.Get_Bit(Input_Memory_Address.Laser_Active))
+                        {
+                            scanner.Set_Laser_Off();
+                            Interlock_Manager.Add_Interlock_Msg("Laser can't on.", "Please move power meter position.");
+                        }
+                    }
+                }
+                
             }
             catch(Exception e)
             {
@@ -1457,6 +1520,12 @@
                         return false;
                     }
                     
+                    if(Door_Opened)
+                    {
+                        Interlock_Manager.Add_Interlock_Msg("Can't Change auto mode.", "Please door close.");
+                        return false;
+                    }
+
                     if(!Is_Home_Complete)
                     {
                         Interlock_Manager.Add_Interlock_Msg("Can't Change auto mode.", "Please Set Home.");

--
Gitblit v1.9.3