Просмотр исходного кода

1 add robotcycle plating cell Module
2 add robot pause/resume

chenzk 20 часов назад
Родитель
Сommit
dcd0d75f4c

+ 6 - 0
PunkHPX8_MainPages/ViewModels/EfemViewModel.cs

@@ -271,6 +271,11 @@ namespace PunkHPX8_MainPages.ViewModels
             get { return m_BladeAWafer; }
             set { SetProperty(ref m_BladeAWafer, value); }
         }
+        public WaferInfo BladeBWafer
+        {
+            get { return m_BladeBWafer; }
+            set { SetProperty(ref m_BladeBWafer, value); }
+        }
         public WaferInfo Aligner1Wafer
         {
             get { return m_Aligner1Wafer; }
@@ -1014,6 +1019,7 @@ namespace PunkHPX8_MainPages.ViewModels
             if (ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers.Count != 0)
             {
                 BladeAWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[0];
+                BladeBWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[1];
             }
             if (ModuleManager.ModuleInfos["Aligner1"].WaferManager.Wafers.Count != 0)
             {

+ 1 - 0
PunkHPX8_MainPages/Views/EfemView.xaml

@@ -109,6 +109,7 @@
                                 RobotATAction="{Binding Robot1TAction}" 
                                 RobotAXAction="{Binding Robot1XAction}"
                                 RobotAWaferInfo="{Binding BladeAWafer}" 
+                                RobotBWaferInfo="{Binding BladeBWafer}" 
                                 CurrentRobotPosition="{Binding CurrentRobotPosition}"
                                 Aligner1Wafer="{Binding Aligner1Wafer}" 
                                 VPW1Wafer="{Binding VPW1Wafer}"

+ 6 - 6
PunkHPX8_RT/Config/System.sccfg

@@ -126,32 +126,32 @@
 			<config default="7" name="Cassete150Station" nameView="Cassete150Station" description="Wafer 150 Cassete station number" max="120" min="0" paramter="" tag="" unit="s" type="Integer" visible="false"/>
 			<config default="7" name="Cassete100Station" nameView="Cassete100Station" description="Wafer 100 Cassete station number" max="120" min="0" paramter="" tag="" unit="s" type="Integer" visible="false"/>
 		</configs>
-		<configs name="VPW1" nameView="VPW1" visible="false">
+		<configs name="VPW1" nameView="VPW1">
 			<config default="67" name="Cassete200Station" nameView="Cassete200Station" description="Wafer 200 Cassete station number" max="120" min="0" paramter="" tag="" unit="s" type="Integer" visible="false"/>
 			<config default="68" name="Cassete150Station" nameView="Cassete150Station" description="Wafer 150 Cassete station number" max="120" min="0" paramter="" tag="" unit="s" type="Integer" visible="false"/>
 			<config default="69" name="Cassete100Station" nameView="Cassete100Station" description="Wafer 100 Cassete station number" max="120" min="0" paramter="" tag="" unit="s" type="Integer" visible="false"/>
 		</configs>
-		<configs name="VPW2" nameView="VPW2" visible="false">
+		<configs name="VPW2" nameView="VPW2">
 			<config default="70" name="Cassete200Station" nameView="Cassete200Station" description="Wafer 200 Cassete station number" max="120" min="0" paramter="" tag="" unit="s" type="Integer" visible="false"/>
 			<config default="71" name="Cassete150Station" nameView="Cassete150Station" description="Wafer 150 Cassete station number" max="120" min="0" paramter="" tag="" unit="s" type="Integer" visible="false"/>
 			<config default="72" name="Cassete100Station" nameView="Cassete100Station" description="Wafer 100 Cassete station number" max="120" min="0" paramter="" tag="" unit="s" type="Integer" visible="false"/>
 		</configs>
-		<configs name="PlatingCell1" nameView="PlatingCell1" visible="false">
+		<configs name="PlatingCell1" nameView="PlatingCell1" >
 			<config default="73" name="Cassete200Station" nameView="Cassete200Station" description="Wafer 200 Cassete station number" max="120" min="0" paramter="" tag="" unit="s" type="Integer" visible="false"/>
 			<config default="74" name="Cassete150Station" nameView="Cassete150Station" description="Wafer 150 Cassete station number" max="120" min="0" paramter="" tag="" unit="s" type="Integer" visible="false"/>
 			<config default="75" name="Cassete100Station" nameView="Cassete100Station" description="Wafer 100 Cassete station number" max="120" min="0" paramter="" tag="" unit="s" type="Integer" visible="false"/>
 		</configs>
-		<configs name="PlatingCell2" nameView="PlatingCell2" visible="false">
+		<configs name="PlatingCell2" nameView="PlatingCell2">
 			<config default="76" name="Cassete200Station" nameView="Cassete200Station" description="Wafer 200 Cassete station number" max="120" min="0" paramter="" tag="" unit="s" type="Integer" visible="false"/>
 			<config default="77" name="Cassete150Station" nameView="Cassete150Station" description="Wafer 150 Cassete station number" max="120" min="0" paramter="" tag="" unit="s" type="Integer" visible="false"/>
 			<config default="78" name="Cassete100Station" nameView="Cassete100Station" description="Wafer 100 Cassete station number" max="120" min="0" paramter="" tag="" unit="s" type="Integer" visible="false"/>
 		</configs>
-		<configs name="PlatingCell3" nameView="PlatingCell3" visible="false">
+		<configs name="PlatingCell3" nameView="PlatingCell3">
 			<config default="79" name="Cassete200Station" nameView="Cassete200Station" description="Wafer 200 Cassete station number" max="120" min="0" paramter="" tag="" unit="s" type="Integer" visible="false"/>
 			<config default="80" name="Cassete150Station" nameView="Cassete150Station" description="Wafer 150 Cassete station number" max="120" min="0" paramter="" tag="" unit="s" type="Integer" visible="false"/>
 			<config default="81" name="Cassete100Station" nameView="Cassete100Station" description="Wafer 100 Cassete station number" max="120" min="0" paramter="" tag="" unit="s" type="Integer" visible="false"/>
 		</configs>
-		<configs name="PlatingCell4" nameView="PlatingCell4" visible="false">
+		<configs name="PlatingCell4" nameView="PlatingCell4">
 			<config default="82" name="Cassete200Station" nameView="Cassete200Station" description="Wafer 200 Cassete station number" max="120" min="0" paramter="" tag="" unit="s" type="Integer" visible="false"/>
 			<config default="83" name="Cassete150Station" nameView="Cassete150Station" description="Wafer 150 Cassete station number" max="120" min="0" paramter="" tag="" unit="s" type="Integer" visible="false"/>
 			<config default="84" name="Cassete100Station" nameView="Cassete100Station" description="Wafer 100 Cassete station number" max="120" min="0" paramter="" tag="" unit="s" type="Integer" visible="false"/>

+ 4 - 3
PunkHPX8_RT/Devices/EFEM/EfemBase.cs

@@ -87,9 +87,10 @@ namespace PunkHPX8_RT.Devices.EFEM
         public virtual bool LiftIsUp { get; }
         public virtual bool LiftIsDown { get; }
 
-        public virtual bool IsResumeRDYReceived {  get; set;}
-        public virtual bool IsPauseRDYReceived {  get; set;}
-        public virtual bool IsActionRDYReceived {  get; set;}
+        public virtual bool IsResumeRDYReceived { get; }
+        public virtual bool IsPauseRDYReceived { get; }
+        public virtual bool IsActionRDYReceived { get; }
+        public virtual bool IsInPauseStatus { get; }
 
         public abstract bool HomeAll();
         public abstract bool Home(ModuleName mod);

+ 39 - 36
PunkHPX8_RT/Devices/EFEM/SunWayRobot.cs

@@ -96,9 +96,14 @@ namespace PunkHPX8_RT.Devices.EFEM
 
         private string _address = "";
 
-        public override bool IsResumeRDYReceived { get; set; }
-        public override bool IsPauseRDYReceived { get; set; }
-        public override bool IsActionRDYReceived { get; set; }
+        private bool _isResumeRDYReceived = false;
+        private bool _isPauseRDYReceived = false;
+        private bool _isActionRDYReceived = false;
+        private bool _isInPauseStatus = false;
+        public override bool IsResumeRDYReceived { get { return _isResumeRDYReceived; } }
+        public override bool IsPauseRDYReceived { get { return _isPauseRDYReceived; } }
+        public override bool IsActionRDYReceived { get { return _isActionRDYReceived; } }
+        public override bool IsInPauseStatus { get { return _isInPauseStatus; } }
 
         public SunWayRobot()
         {
@@ -330,30 +335,28 @@ namespace PunkHPX8_RT.Devices.EFEM
                 LOG.WriteLog(eEvent.ERROR_EFEM_COMMUNICATION, Module.ToString(), $"Socket is not Conntected");
                 return false;
             }
-            _currentMessage = new EfemMessage()
-            {
-                Operation = EfemOperation.Pause,
-                Module = ModuleName.EfemRobot
-            };
-            _status = RState.Running;
             string cmd = "PAUSE\r";
-            return WriteCommand(cmd);
+            bool result = WriteCommand(cmd);
+            if (result)
+            {
+                _isInPauseStatus = true; //进入pause状态
+            }
+            else
+            {
+                _isInPauseStatus = false;
+                LOG.WriteLog(eEvent.ERROR_EFEM_COMMUNICATION, Module.ToString(), $"Send pause message error");
+            }
+            return result;
         }
         public override bool Resume()
         {
-            IsActionRDYReceived = false; //把收到resume信号后执行resume动作成功的变量置false 
+            _isActionRDYReceived = false; //把收到resume信号后执行resume动作成功的变量置false 
             //判断socket是否链接
             if (!_socket.IsConnected)
             {
                 LOG.WriteLog(eEvent.ERROR_EFEM_COMMUNICATION, Module.ToString(), $"Socket is not Conntected");
                 return false;
             }
-            _currentMessage = new EfemMessage()
-            {
-                Operation = EfemOperation.Resume,
-                Module = ModuleName.EfemRobot
-            };
-            _status = RState.Running;
             string cmd = "RESUME\r";
             return WriteCommand(cmd);
         }
@@ -426,11 +429,11 @@ namespace PunkHPX8_RT.Devices.EFEM
                 return false;
             }
             int stationNumber= _moduleStationNumberDictionary[strModuleWaferSize]; 
-            string strFlip = flip == Flip.Down ? " Flip" : "";
+            string strFlip = flip == Flip.Down ? " FLIP" : "";
             string cmd = $"PICK {stationNumber} SLOT {slot+1} ARM {_armString[hand]}{strFlip}\r";
             if(ModuleHelper.IsAligner(station)||ModuleHelper.IsSRD(station)||ModuleHelper.IsVPWCell(station) || ModuleHelper.IsPlatingCell(station))
             {
-                cmd = $"PICK {stationNumber} SLOT 1 ARM {_armString[hand]}\r";
+                cmd = $"PICK {stationNumber} SLOT 1 ARM {_armString[hand]}{strFlip}\r";
             }
             _currentMessage = new EfemMessage()
             {
@@ -482,11 +485,11 @@ namespace PunkHPX8_RT.Devices.EFEM
             };
             _status = RState.Running;
             int stationNumber = _moduleStationNumberDictionary[strModuleWaferSize];
-            string strFlip = flip == Flip.Down ? " Flip" : "";
+            string strFlip = flip == Flip.Down ? " FLIP" : "";
             string cmd = $"PLACE {stationNumber} SLOT {slot+1} ARM {_armString[hand]}{strFlip}\r";
             if (ModuleHelper.IsSRD(station) || ModuleHelper.IsVPWCell(station) || ModuleHelper.IsPlatingCell(station))
             {
-                cmd = $"PLACE {stationNumber} SLOT 1 ARM {_armString[hand]}\r";
+                cmd = $"PLACE {stationNumber} SLOT 1 ARM {_armString[hand]}{strFlip}\r";
             }
             if (ModuleHelper.IsAligner(station))
             {
@@ -980,12 +983,12 @@ namespace PunkHPX8_RT.Devices.EFEM
                 SetRobotMovingInfo(RobotAction.None, Hand.Both, ModuleName.EFEM);
                 return;
             }
-            else if (msg.StartsWith("ACTION_RDY"))
+            else if (msg.StartsWith("ACTION _RDY"))
             {
                 _status = RState.End;
-                IsResumeRDYReceived = false;
-                IsPauseRDYReceived = false;
-                IsActionRDYReceived = true;
+                _isResumeRDYReceived = false;
+                _isPauseRDYReceived = false;
+                _isActionRDYReceived = true;
             }
             else if (msg.StartsWith("_RDY"))
             {
@@ -1008,18 +1011,18 @@ namespace PunkHPX8_RT.Devices.EFEM
                         break;
                 }
             }
-            else if (msg.Contains("PAUSE_RDY") || msg.Contains("RESUME_RDY"))
+            else if (msg.Contains("PAUSE _RDY"))
             {
-                switch (_currentMessage.Operation)
-                {
-                    case EfemOperation.Pause:
-                        //SetRobotMovingInfo(RobotAction.None, Hand.Both, ModuleName.EfemRobot);
-                        IsPauseRDYReceived = true;
-                        break;
-                    case EfemOperation.Resume:
-                        IsResumeRDYReceived = true;
-                        break;
-                }
+                _isPauseRDYReceived = true;
+                _isResumeRDYReceived = false; //收到pause把收到resume的信号置false
+                LOG.WriteLog(eEvent.INFO_TM_ROBOT, Module.ToString(), $"PAUSE_RDY was received, robot pause status is true");
+            }
+            else if (msg.Contains("RESUME _RDY"))
+            {
+                _isResumeRDYReceived = true;
+                _isPauseRDYReceived = false;  //收到Resume把收到pause的信号置false
+                _isInPauseStatus = false; //取消pause状态
+                LOG.WriteLog(eEvent.INFO_TM_ROBOT, Module.ToString(), $"RESUME _RDY was received, robot pause status is false");
             }
             else
             {

+ 4 - 0
PunkHPX8_RT/Modules/EFEM/EfemPickRoutine.cs

@@ -233,6 +233,10 @@ namespace PunkHPX8_RT.Modules.EFEM
 
         private bool WaitModuleReady()
         {
+            if (_efem.IsInPauseStatus)
+            {
+                return false;
+            }
             return _efem.Status == RState.End;
         }
 

+ 4 - 0
PunkHPX8_RT/Modules/EFEM/EfemPlaceRoutine.cs

@@ -229,6 +229,10 @@ namespace PunkHPX8_RT.Modules.EFEM
 
         private bool WaitModuleReady()
         {
+            if (_efem.IsInPauseStatus)
+            {
+                return false;
+            }
             return _efem.Status == RState.End;
         }
 

+ 4 - 0
PunkHPX8_RT/Modules/EFEM/EfemRobotMapRoutine.cs

@@ -96,6 +96,10 @@ namespace PunkHPX8_RT.Modules.EFEM
 
         private bool WaitModuleReady()
         {
+            if (_efem.IsInPauseStatus)
+            {
+                return false;
+            }
             return _efem.Status == RState.End;
         }
 

+ 10 - 6
PunkHPX8_Simulator/Devices/SunWayEfemSimulator.cs

@@ -233,16 +233,17 @@ namespace PunkHPX8_Simulator.Devices
             else if (str.StartsWith("PAUSE"))
             {
                 Pause();
-                ack = "PAUSE_RDY";
+                ack = "PAUSE _RDY";
                 OnWriteMessage(ack);
             }
             else if(str.StartsWith("RESUME"))
             {
-                Resume();
-                ack = "RESUME_RDY";
+           
+                ack = "RESUME _RDY";
                 OnWriteMessage(ack);
                 _ = Task.Run(DelayAnswerResume); // 启动后台任务
-                
+                Resume();
+
 
             }
             else //默认回复
@@ -302,8 +303,11 @@ namespace PunkHPX8_Simulator.Devices
 
         private void DelayAnswerResume()
         {
-            Thread.Sleep((ushort)3000);
-            OnWriteMessage("ACTION_RDY");
+            Thread.Sleep((ushort)2200);
+            if (_pendingAcks.Count > 0)
+            {
+                OnWriteMessage("ACTION _RDY");
+            }
         }
         private void UpdateLocked(string lpNumber,bool locked)
         {

+ 8 - 1
PunkHPX8_Themes/UserControls/EFEM.xaml

@@ -412,7 +412,14 @@
 
                     <customControls:GuangChuanRobotControl  OriginT="T_Origin"  Canvas.Left="-30" Canvas.Top="-180"   Width="540" Height="810"     RobotTAction="{Binding ElementName=efem,Path=RobotATAction}"  RobotXAction="{Binding ElementName=efem,Path=RobotAXAction}" RobotWafer="{Binding ElementName=efem,Path=RobotAWaferInfo}"/>
                 </Canvas>
-
+                <Canvas Width="500" Height="500" Canvas.Left="180" Canvas.Top="50"  RenderTransformOrigin="1 1">
+                    <Canvas.RenderTransform>
+                        <TransformGroup>
+                            <TranslateTransform  x:Name="robotBRotateAct"/>
+                        </TransformGroup>
+                    </Canvas.RenderTransform>
+                    <customControls:GuangChuanRobotControl  OriginT="T_Origin"  Canvas.Left="-30" Canvas.Top="260"   Width="540" Height="810"       RobotWafer="{Binding ElementName=efem,Path=RobotBWaferInfo}"/>
+                </Canvas>
                 <!--Aligner-->
                 <Viewbox Stretch="Uniform" Width="370" Height="370" Canvas.Left="810"  Canvas.Top="680" HorizontalAlignment="Center" VerticalAlignment="Top">
                     <Canvas UseLayoutRounding="False"  Width="93.693" Height="112.5" HorizontalAlignment="Center" VerticalAlignment="Top">

+ 10 - 0
PunkHPX8_Themes/UserControls/EFEM.xaml.cs

@@ -226,5 +226,15 @@ namespace PunkHPX8_Themes.UserControls
         {            
             VisualStateManager.GoToElementState(control, robotPosition.ToString(), true);
         }
+
+        
+        public static readonly DependencyProperty RobotBWaferInfoProperty = DependencyProperty.Register(
+   "RobotBWaferInfo", typeof(WaferInfo), typeof(EFEM));
+        public WaferInfo RobotBWaferInfo
+        {
+            get { return (WaferInfo)this.GetValue(RobotBWaferInfoProperty); }
+            set { this.SetValue(RobotBWaferInfoProperty, value); }
+        }
+   
     }
 }