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/700.Unit/200.Process/Ablation.cs |  101 ++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 93 insertions(+), 8 deletions(-)

diff --git a/SHARP_CLAS_UI/500.Equipment/700.Unit/200.Process/Ablation.cs b/SHARP_CLAS_UI/500.Equipment/700.Unit/200.Process/Ablation.cs
index 4258669..497c45e 100644
--- a/SHARP_CLAS_UI/500.Equipment/700.Unit/200.Process/Ablation.cs
+++ b/SHARP_CLAS_UI/500.Equipment/700.Unit/200.Process/Ablation.cs
@@ -112,8 +112,24 @@
 
             pauseDisableList.Add(AblationSteps.S5220_SCANNER_MOVE_WAIT);
 
-            MotorX.Check_Jog_Interlock = Jog_Interlock;
-            MotorX.Check_Move_Interlock = Move_Interlock;
+            pauseDisableList.Add(AblationSteps.S5320_LASER_ON);
+            pauseDisableList.Add(AblationSteps.S5330_LASER_ON_CHECK);
+            pauseDisableList.Add(AblationSteps.S5340_POWER_MEASUREMENT_START);
+            pauseDisableList.Add(AblationSteps.S5350_POWER_MEASUREMENT);
+            pauseDisableList.Add(AblationSteps.S5360_POWER_MEASUREMENT_END);
+            pauseDisableList.Add(AblationSteps.S5370_LASER_OFF);
+            pauseDisableList.Add(AblationSteps.S5380_LASER_OFF_CHECK);
+
+            pauseDisableList.Add(AblationSteps.S5420_LASER_ON);
+            pauseDisableList.Add(AblationSteps.S5430_LASER_ON_CHECK);
+            pauseDisableList.Add(AblationSteps.S5440_POWER_MEASUREMENT_START);
+            pauseDisableList.Add(AblationSteps.S5450_POWER_MEASUREMENT);
+            pauseDisableList.Add(AblationSteps.S5460_POWER_MEASUREMENT_END);
+            pauseDisableList.Add(AblationSteps.S5470_LASER_OFF);
+            pauseDisableList.Add(AblationSteps.S5480_LASER_OFF_CHECK);
+
+            MotorX.Check_Jog_Interlock = Jog_Interlock_MotorX;
+            MotorX.Check_Move_Interlock = Move_Interlock_MotorX;
             MotorZ.Check_Jog_Interlock = Jog_Interlock;
             MotorZ.Check_Move_Interlock = Move_Interlock;
 
@@ -124,6 +140,40 @@
         #endregion
 
         #region Function
+        private bool Move_Interlock_MotorX()
+        {
+            if (equipment.User.Level != En_User_Level.Master && equipment.Door_Opened)
+            {
+                return true;
+            }
+
+            double position = Get_Scanner_Z_A1_Stay_Position();
+
+            if (MotorZ.Is_Inposition(position, equipment.Setting.Inposition_Offset) == false)
+            {
+                return true;
+            }
+
+            return false;
+        }
+
+        private bool Jog_Interlock_MotorX(bool positive)
+        {
+            if (equipment.User.Level != En_User_Level.Master && equipment.Door_Opened)
+            {
+                return true;
+            }
+
+            double position = Get_Scanner_Z_A1_Stay_Position();
+
+            if (MotorZ.Is_Inposition(position, equipment.Setting.Inposition_Offset) == false)
+            {
+                return true;
+            }
+
+            return false;
+        }
+
         private bool Move_Interlock()
         {
             if (equipment.User.Level != En_User_Level.Master && equipment.Door_Opened)
@@ -196,6 +246,7 @@
                 if (on)
                 {
                     equipment.scanner.Set_Stop();
+                    equipment.scanner.Set_Laser_Off();
                 }
             }
         }
@@ -240,7 +291,7 @@
 
                 if (equipment.equip_mode == En_Equipment_Mode.Pause)
                 {
-                    if (pauseDisableList.Contains(Step) == false)
+                    if (pauseDisableList.Contains(Step) != false)
                     {
                         UnitMode = En_Equipment_Mode.Pause;
                         return;
@@ -1310,6 +1361,19 @@
 
         private void Seq_Power_Measure()
         {
+            //Laser 異쒖궗 �쐞移섏뿉�꽌 Power Meter�쐞移섍� �븘�땺 �븣 Laser off �썑 泥� Step�쑝濡� �씠�룞.
+            if((AblationSteps.S5320_LASER_ON <= Step && Step <= AblationSteps.S5360_POWER_MEASUREMENT_END) ||
+                (AblationSteps.S5420_LASER_ON <= Step && Step <= AblationSteps.S5460_POWER_MEASUREMENT_END))
+            {
+                if (equipment.process.ablation.Get_Is_Position_X_Power_Meter() == false || equipment.process.ablation.Get_Is_Position_Z_Power_Meter() == false)
+                {
+                    if (equipment.scanner.Set_Laser_Off())
+                    {
+                        Step = AblationSteps.S0000_WAIT;
+                    }
+                }
+            }
+
             switch (Step)
             {
                 case AblationSteps.S5000_AUTO_POWER_START:
@@ -1413,10 +1477,20 @@
                     }
                 case AblationSteps.S5320_LASER_ON:
                     {
-                        if (equipment.scanner.Set_Laser_On())
+                        if (equipment.process.ablation.MotorX.MotionComplete && equipment.process.ablation.MotorZ.MotionComplete)
                         {
-                            auto_power_view.Add_Info($"Laser On.");
-                            Step = AblationSteps.S5330_LASER_ON_CHECK;
+                            if (equipment.process.ablation.Get_Is_Position_X_Power_Meter() && equipment.process.ablation.Get_Is_Position_Z_Power_Meter())
+                            {
+                                if (equipment.scanner.Set_Laser_On())
+                                {
+                                    auto_power_view.Add_Info($"Laser On.");
+                                    Step = AblationSteps.S5330_LASER_ON_CHECK;
+                                }
+                            }
+                            else
+                            {
+                                Step = AblationSteps.S0000_WAIT;
+                            }
                         }
                         break;
                     }
@@ -1558,9 +1632,20 @@
                     }
                 case AblationSteps.S5420_LASER_ON:
                     {
-                        if (equipment.scanner.Set_Laser_On())
+                        if (equipment.process.ablation.MotorX.MotionComplete && equipment.process.ablation.MotorZ.MotionComplete)
                         {
-                            Step = AblationSteps.S5430_LASER_ON_CHECK;
+                            if (equipment.process.ablation.Get_Is_Position_X_Power_Meter() && equipment.process.ablation.Get_Is_Position_Z_Power_Meter())
+                            {
+                                if (equipment.scanner.Set_Laser_On())
+                                {
+                                    auto_power_view.Add_Info($"Laser On.");
+                                    Step = AblationSteps.S5430_LASER_ON_CHECK;
+                                }
+                            }
+                            else
+                            {
+                                Step = AblationSteps.S0000_WAIT;
+                            }
                         }
                         break;
                     }

--
Gitblit v1.9.3