Browse Source

add Cassette arrive, leave, map with all empty or full in VCE's Simulator && Change the logic of control SlitDoor in PM && Change SE Pick Place Swap DoublePick for PM & VCE && fix some bug in View for Venus VCE && DE UI Design.

zhouhr 1 year ago
parent
commit
d425906355
29 changed files with 643 additions and 355 deletions
  1. 1 1
      Venus/Venus_MainPages/ViewModels/DETMOperationViewModel.cs
  2. 13 3
      Venus/Venus_MainPages/ViewModels/OverVenusDEViewModel.cs
  3. 1 0
      Venus/Venus_MainPages/ViewModels/TopViewModel.cs
  4. 3 1
      Venus/Venus_MainPages/ViewModels/VenusDeOperationOverViewModel.cs
  5. 3 3
      Venus/Venus_MainPages/Views/TopView.xaml
  6. 284 19
      Venus/Venus_MainPages/Views/VenusDeOperationOverView.xaml
  7. 0 1
      Venus/Venus_RT/Config/PM/VenusDE/VenusDEDeviceModel.xml
  8. 2 2
      Venus/Venus_RT/Config/System_VenusSE.sccfg
  9. 15 59
      Venus/Venus_RT/Devices/JetVenusDEPM.cs
  10. 9 26
      Venus/Venus_RT/Devices/JetVenusSEPM.cs
  11. 25 9
      Venus/Venus_RT/Devices/TM/HongHuVR.cs
  12. 2 0
      Venus/Venus_RT/Devices/VCE/HongHuVce.cs
  13. 0 13
      Venus/Venus_RT/Modules/PMs/PMEntity.cs
  14. 18 72
      Venus/Venus_RT/Modules/TM/VenusEntity/SEMFPMPickRoutine.cs
  15. 13 1
      Venus/Venus_RT/Modules/TM/VenusEntity/SEMFPMPlaceRoutine.cs
  16. 22 38
      Venus/Venus_RT/Modules/TM/VenusEntity/SEMFPMSwapRoutine.cs
  17. 17 24
      Venus/Venus_RT/Modules/TM/VenusEntity/SEMFPickRoutine.cs
  18. 19 26
      Venus/Venus_RT/Modules/TM/VenusEntity/SEMFPlaceRoutine.cs
  19. 22 40
      Venus/Venus_RT/Modules/TM/VenusEntity/SEMFSwapRoutine.cs
  20. 4 4
      Venus/Venus_RT/Modules/TM/VenusEntity/SETMEntity.cs
  21. 39 0
      Venus/Venus_RT/Modules/VCE/VceEntity.cs
  22. 1 1
      Venus/Venus_Simulator/Config/UILayout.xml
  23. 16 1
      Venus/Venus_Simulator/Devices/VceSimulator.cs
  24. 1 0
      Venus/Venus_Simulator/Views/SimuSMCChillerGridPMAView.xaml.cs
  25. 2 0
      Venus/Venus_Simulator/Views/SimuSMCChillerPMCView.xaml.cs
  26. 54 1
      Venus/Venus_Simulator/Views/Simu_VCE2View.xaml
  27. 1 1
      Venus/Venus_Simulator/Views/Simu_VCE2View.xaml.cs
  28. 17 5
      Venus/Venus_Simulator/Views/Simu_VCEView.xaml
  29. 39 4
      Venus/Venus_Simulator/Views/Simu_VCEView.xaml.cs

+ 1 - 1
Venus/Venus_MainPages/ViewModels/DETMOperationViewModel.cs

@@ -132,7 +132,7 @@ namespace Venus_MainPages.ViewModels
                     }
                 }
 
-                if ((m_TMCurrentState == "LeakChecking") && value == "Idle")
+                if ((m_TMCurrentState == "Leakchecking") && value == "Idle")
                 {
                     var AllLeakCheckDa = QueryDataClient.Instance.Service.GetPMLeakCheckResult("DETM");
                     if (AllLeakCheckDa != null)

+ 13 - 3
Venus/Venus_MainPages/ViewModels/OverVenusDEViewModel.cs

@@ -1251,6 +1251,8 @@ namespace Venus_MainPages.ViewModels
         {
             m_RtDataKeys = new List<string>();
 
+            
+
             m_IsATM = true;
 
             ModuleName = "PMA";
@@ -1867,13 +1869,16 @@ namespace Venus_MainPages.ViewModels
                 ESCHePressure = float.Parse(RtDataValues[$"{ModuleName}.ESCHePressure"].ToString());
 
                 ChillerTemperature = float.Parse(RtDataValues[$"{ModuleName}.Chiller.Temp"].ToString());
-                WallChillerTemperature = float.Parse(RtDataValues[$"{ModuleName}.WallChiller.Temp"].ToString());
                 HVTemperature = float.Parse(RtDataValues[$"{ModuleName}.{VenusDevice.ESCHV}.Temp"].ToString());
 
+                if ((bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.WallChiller.EnableChiller"))
+                {
+                    WallChillerTemperature = float.Parse(RtDataValues[$"{ModuleName}.WallChiller.Temp"].ToString());
+                    WallChillerIsOn = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.WallChiller.IsOn");
+                }
 
 
                 ChillerIsOn = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.Chiller.IsOn");
-                WallChillerIsOn = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.WallChiller.IsOn");
                 BiasRFFanInterlock = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.SourceRFFanInterlock");
                 IsWLK = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.IsWLK");
                 IsWaterFlowOk = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.IsWaterFlowOk");
@@ -1949,7 +1954,6 @@ namespace Venus_MainPages.ViewModels
             m_RtDataKeys.Add($"{ModuleName}.MfcGas12");
             m_RtDataKeys.Add($"{ModuleName}.MfcHe");
             m_RtDataKeys.Add($"{ModuleName}.MfcN2");
-            m_RtDataKeys.Add($"{ModuleName}.WallChiller.Temp");
 
             m_RtDataKeys.Add($"{ModuleName}.ForelinePressure");
             m_RtDataKeys.Add($"{ModuleName}.ChamberPressure");
@@ -2073,6 +2077,12 @@ namespace Venus_MainPages.ViewModels
 
             m_RtDataKeys.Add($"{ModuleName}.HasWafer");
             m_RtDataKeys.Add($"{ModuleName}.CurrentRecipeResult");
+
+            if ((bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.WallChiller.EnableChiller"))
+            {
+                m_RtDataKeys.Add($"{ModuleName}.WallChiller.Temp");
+                m_RtDataKeys.Add($"{ModuleName}.WallChiller.IsOn");
+            }
         }
         #endregion
     }

+ 1 - 0
Venus/Venus_MainPages/ViewModels/TopViewModel.cs

@@ -421,6 +421,7 @@ namespace Venus_MainPages.ViewModels
             m_RtDataKeys.Add("DETM.IsOnline");
             m_RtDataKeys.Add("VCEA.IsOnline");
             m_RtDataKeys.Add("VCEB.IsOnline");
+            m_RtDataKeys.Add("VCE1.IsOnline");
             m_RtDataKeys.Add("LLA.FsmState");
             m_RtDataKeys.Add("LLA.IsOnline");
             m_RtDataKeys.Add("LLA.IsInclude");

+ 3 - 1
Venus/Venus_MainPages/ViewModels/VenusDeOperationOverViewModel.cs

@@ -665,7 +665,9 @@ namespace Venus_MainPages.ViewModels
             m_RtDataKeys.Add($"DETM.PMBSlitDoorClosed");
             m_RtDataKeys.Add($"DETM.PMCSlitDoorClosed");
             m_RtDataKeys.Add($"DETM.PMDSlitDoorClosed");
-            m_RtDataKeys.Add($"DETM.VCEPressure.Value");
+            m_RtDataKeys.Add($"DETM.TMPressure.Value");
+            m_RtDataKeys.Add($"DETM.VCEAPressure.Value");
+            m_RtDataKeys.Add($"DETM.VCEBPressure.Value");
             m_RtDataKeys.Add($"VCEA.VCEOutDoorClosed");
             m_RtDataKeys.Add($"VCEA.CassetteArrive");
             m_RtDataKeys.Add($"VCEB.VCEOutDoorClosed");

File diff suppressed because it is too large
+ 3 - 3
Venus/Venus_MainPages/Views/TopView.xaml


File diff suppressed because it is too large
+ 284 - 19
Venus/Venus_MainPages/Views/VenusDeOperationOverView.xaml


+ 0 - 1
Venus/Venus_RT/Config/PM/VenusDE/VenusDEDeviceModel.xml

@@ -201,7 +201,6 @@
 			   infoText="" warningText="N2 Pressure Alarm" alarmText="" />
 		<IoSensor id="GeneratorInterlock" display="RFG hardware interlock"  schematicId="" unit="" di="DI_RF_HV_Interlock_OK" isLowAsNormal="" textOutTrigValue="false" infoText="Generator interlock" warningText="" alarmText="" />
 		<!--<IoSensor id="SensorSourceRFFan" display="Bias RF Water Flow Switch"  schematicId="" unit="" di="DI_BIAS_RF_Water_Flow_Switch" isLowAsNormal="" textOutTrigValue="true" infoText="Bias RF Water Flow" warningText="" alarmText="Bias RF Water Flow Error" />-->
-		<IoSensor id="SensorLinerDoorClosed" display="Liner Door Closed"  schematicId="" unit="" di="DI_Liner_Door_Close_Position" isLowAsNormal="" textOutTrigValue="false" infoText="" warningText="" alarmText="" />
 		<IoSensor id="TurboPumpInterlock" display="Turbo Pump Interlock"  schematicId="" unit="" di="DI_Turbo_Pump_Interlock" isLowAsNormal="" textOutTrigValue="false" infoText="" warningText="" alarmText="" />
 		<IoSensor id="GasBoxDoorSW" display="Gas Box Door SW"  schematicId="" unit="" di="DI_Gas_Box_Door_Switch" isLowAsNormal="" textOutTrigValue="false" infoText="" warningText="" alarmText="" />
 		<IoSensor id="GasBoxPressureSW" display="Gas Box Pressure SW"  schematicId="" unit="" di="DI_Gas_Box_Pressure_Switch" isLowAsNormal="" textOutTrigValue="false" infoText="" warningText="" alarmText="Gas Box Pressure Alarm" />

+ 2 - 2
Venus/Venus_RT/Config/System_VenusSE.sccfg

@@ -380,8 +380,8 @@
 		<config default="7" name="PMEStationNumber" nameView="PME Station Number" description="PME Station Number" max="99" min="0" paramter="" tag="" unit="" type="Integer" />
 		<config default="8" name="PMFStationNumber" nameView="PMF Station Number" description="PMF Station Number" max="99" min="0" paramter="" tag="" unit="" type="Integer" />
 		<config default="5" name="VCE1StationNumber" nameView="VCE1 Station Number" description="VCE1 Station Number" max="99" min="0" paramter="" tag="" unit="" type="Integer" />
-		<config default="5" name="VCEAStationNumber" nameView="VCE1 Station Number" description="VCE1 Station Number" max="99" min="0" paramter="" tag="" unit="" type="Integer" />
-		<config default="5" name="VCEBStationNumber" nameView="VCE1 Station Number" description="VCE1 Station Number" max="99" min="0" paramter="" tag="" unit="" type="Integer" />
+		<config default="5" name="VCEAStationNumber" nameView="VCEA Station Number" description="VCE1 Station Number" max="99" min="0" paramter="" tag="" unit="" type="Integer" />
+		<config default="5" name="VCEBStationNumber" nameView="VCEB Station Number" description="VCE1 Station Number" max="99" min="0" paramter="" tag="" unit="" type="Integer" />
 		<config default="1" name="VPAStationNumber" nameView="VPA Station Number" description="VPA Station Number" max="99" min="0" paramter="" tag="" unit="" type="Integer" />
 		<config default="1" name="CheckStationNumber" nameView="CheckLoad Station Number" description="CheckLoad Station Number" max="99" min="0" paramter="" tag="" unit="" type="Integer" />
 		<config default="760000" name="ATMTargetPressure" nameView="TM ATM Target Pressure" description="TM ATM Target Pressure" max="760000" min="0" paramter="" tag="" unit="mTorr" type="Double" />

+ 15 - 59
Venus/Venus_RT/Devices/JetVenusDEPM.cs

@@ -96,7 +96,6 @@ namespace Venus_RT.Devices
         private readonly IoSensor _TurboPumpInterlock;
         private readonly IoSensor _GasBoxDoor;
         private readonly IoSensor _GasBoxPressure;
-        private readonly IoSensor _PM_LinerDoor_Closed;
         private readonly PumpBase _MainPump;
         private readonly ESC5HighVoltage _ESCHV;
         private readonly AdixenTurboPump _TurboPump;
@@ -159,7 +158,6 @@ namespace Venus_RT.Devices
             _PVB2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVB2}");
             _PVC1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVC1}");
             _PVC2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVC2}");
-            _PM_LinerDoor_Closed = DEVICE.GetDevice<IoSensor>($"{Module}.SensorLinerDoorClosed");
             _N2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveN2}");
             _Mfc1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc1}");
             _Mfc2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc2}");
@@ -412,6 +410,8 @@ namespace Venus_RT.Devices
                             return Singleton<RouteManager>.Instance.seTM.IsPMBSlitDoorClosed;
                         case ModuleName.PMC:
                             return Singleton<RouteManager>.Instance.seTM.IsPMCSlitDoorClosed;
+                        case ModuleName.PMD:
+                            return Singleton<RouteManager>.Instance.seTM.IsPMDSlitDoorClosed;
                         default:
                             return false;
                     }
@@ -421,7 +421,7 @@ namespace Venus_RT.Devices
 
             }
         }
-        public override bool IsLinerDoorClosed => !_linerDoor.ONFeedback;
+        public override bool IsLinerDoorClosed => _linerDoor.State == CylinderState.Close;
         public override bool IsPumpRunning => _MainPump.IsRunning;
 
         public override bool IsISOOpen => _TurboPumpPumpingValve.Status;
@@ -504,7 +504,7 @@ namespace Venus_RT.Devices
 
         public override bool TurboPumpInterlock => _TurboPumpInterlock.Value;
 
-        public override bool LinerDoorClosed => _PM_LinerDoor_Closed.Value;
+        public override bool LinerDoorClosed => _linerDoor.State == CylinderState.Close;
 
         public override float PendulumPressure => _pendulumValve.Pressure;
 
@@ -521,11 +521,13 @@ namespace Venus_RT.Devices
                 switch (Module)
                 {
                     case ModuleName.PMA:
-                        return Singleton<RouteManager>.Instance.seTM.IsPMASlitDoorClosed && Singleton<RouteManager>.Instance.PMA.IsSlitDoorClose;
+                        return Singleton<RouteManager>.Instance.seTM.IsPMASlitDoorClosed;
                     case ModuleName.PMB:
-                        return Singleton<RouteManager>.Instance.seTM.IsPMBSlitDoorClosed && Singleton<RouteManager>.Instance.PMB.IsSlitDoorClose;
+                        return Singleton<RouteManager>.Instance.seTM.IsPMBSlitDoorClosed;
                     case ModuleName.PMC:
-                        return Singleton<RouteManager>.Instance.seTM.IsPMCSlitDoorClosed && Singleton<RouteManager>.Instance.PMC.IsSlitDoorClose;
+                        return Singleton<RouteManager>.Instance.seTM.IsPMCSlitDoorClosed;
+                    case ModuleName.PMD:
+                        return Singleton<RouteManager>.Instance.seTM.IsPMDSlitDoorClosed;
                     default:
                         return true;
                 }
@@ -874,7 +876,7 @@ namespace Venus_RT.Devices
         }
         public override bool CheckLinerDoorOpen()
         {
-            return !IsLinerDoorClosed;
+            return _linerDoor.State == CylinderState.Close;
         }
 
         public override bool CheckLinerDoorClose()
@@ -1257,36 +1259,11 @@ namespace Venus_RT.Devices
         public override bool SetSlitDoor(bool open, out string reason)
         {
             reason = string.Empty;
-            OP.DoOperation($"{Singleton<RouteManager>.Instance.seTM.Module}.SetSlitDoor", Module, open);
+            //OP.DoOperation($"{Singleton<RouteManager>.Instance.seTM.Module}.SetSlitDoor", Module, open);
             return true;
         }
         public override bool SetLinerDoor(bool open, out string reason)
         {
-            //if (open)
-            //{
-            //    if (RouteManager.IsATMMode)
-            //    {
-            //        if (!IsATM)
-            //        {
-            //            reason = $"{Module} is not ATM, can not open liner door";
-            //            LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
-            //            return false;
-            //        }
-            //    }
-            //    //else
-            //    //{
-
-            //    //    double maxPressureDifference = SC.GetValue<double>("System.PMTMMaxPressureDifference");
-            //    //    if (Math.Abs(TMPressure - ChamberPressure) > maxPressureDifference)
-            //    //    {
-            //    //        reason = $"{Module} and TM pressure difference exceeds the max limit {maxPressureDifference}, TMPressure:{TMPressure}, {Module}Pressure:{ChamberPressure}";
-            //    //        LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
-            //    //        return false;
-            //    //    }
-            //    //}
-
-            //}
-
             return _linerDoor.SetCylinder(open, out reason);
         }
 
@@ -1348,12 +1325,6 @@ namespace Venus_RT.Devices
                 return false;
 
             }
-
-            if (!SetSlitDoor(true, out reason))
-            {
-                LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
-                return false;
-            }
             //
             if (!SetLiftPin(MovementPosition.Down, out reason))
             {
@@ -1369,11 +1340,6 @@ namespace Venus_RT.Devices
                 LOG.Write(eEvent.ERR_PM, Module, $"Set Liner Door Open failed:{reason}");
                 return false;
             }
-            if (!SetSlitDoor(true, out reason))
-            {
-                LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
-                return false;
-            }
             if (!SetLiftPin(MovementPosition.Up, out reason))
             {
                 LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Up failed:{reason}");
@@ -1383,11 +1349,11 @@ namespace Venus_RT.Devices
         }
         public override bool PreparePlaceIsOK()
         {
-            return CheckSlitDoorOpen() && LiftPinIsDown && CheckLinerDoorOpen();
+            return LiftPinIsDown && CheckLinerDoorOpen();
         }
         public override bool PreparePickIsOK()
         {
-            return CheckSlitDoorOpen() && LiftPinIsUp && CheckLinerDoorOpen();
+            return LiftPinIsUp && CheckLinerDoorOpen();
         }
         public override bool EndPlace()
         {
@@ -1403,11 +1369,6 @@ namespace Venus_RT.Devices
                 return false;
             }
 
-            if (!SetSlitDoor(false, out reason))
-            {
-                LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
-                return false;
-            }
             return true;
         }
 
@@ -1418,11 +1379,6 @@ namespace Venus_RT.Devices
                 LOG.Write(eEvent.ERR_PM, Module, $"Set Liner Door Close failed:{reason}");
                 return false;
             }
-            if (!SetSlitDoor(false, out reason))
-            {
-                LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
-                return false;
-            }
             return true;
         }
         private void ALARM_Notify()
@@ -1442,11 +1398,11 @@ namespace Venus_RT.Devices
         }
         public override bool EndPlaceIsOK()
         {
-            return CheckSlitDoorClose() && LiftPinIsDown;
+            return CheckSlitDoorClose() && LiftPinIsDown && CheckLinerDoorClose();
         }
         public override bool EndPickIsOK()
         {
-            return CheckSlitDoorClose();
+            return CheckSlitDoorClose() && CheckLinerDoorClose();
         }
 
         #endregion

+ 9 - 26
Venus/Venus_RT/Devices/JetVenusSEPM.cs

@@ -401,6 +401,8 @@ namespace Venus_RT.Devices
                             return Singleton<RouteManager>.Instance.seTM.IsPMBSlitDoorClosed;
                         case ModuleName.PMC:
                             return Singleton<RouteManager>.Instance.seTM.IsPMCSlitDoorClosed;
+                        case ModuleName.PMD:
+                            return Singleton<RouteManager>.Instance.seTM.IsPMDSlitDoorClosed;
                         default:
                             return false;
                     }
@@ -519,6 +521,8 @@ namespace Venus_RT.Devices
                         return Singleton<RouteManager>.Instance.seTM.IsPMBSlitDoorClosed;
                     case ModuleName.PMC:
                         return Singleton<RouteManager>.Instance.seTM.IsPMCSlitDoorClosed;
+                    case ModuleName.PMD:
+                        return Singleton<RouteManager>.Instance.seTM.IsPMDSlitDoorClosed;
                     default:
                         return true;
                 }
@@ -1178,7 +1182,7 @@ namespace Venus_RT.Devices
         {
             reason = string.Empty;
             // 泓浒TM将提供开关门的interlock
-            OP.DoOperation($"{Singleton<RouteManager>.Instance.seTM.Module}.SetSlitDoor", Module, open);
+            //OP.DoOperation($"{Singleton<RouteManager>.Instance.seTM.Module}.SetSlitDoor", Module, open);
             return true;
         }
 
@@ -1226,12 +1230,7 @@ namespace Venus_RT.Devices
 
         public override bool PreparePlace()
         {
-            if (!SetSlitDoor(true, out string reason))
-            {
-                LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
-                return false;
-            }
-            if (!SetLiftPin(MovementPosition.Down, out reason))
+            if (!SetLiftPin(MovementPosition.Down, out string reason))
             {
                 LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin down failed:{reason}");
                 return false;
@@ -1240,12 +1239,7 @@ namespace Venus_RT.Devices
         }
         public override bool PreparePick()
         {
-            if (!SetSlitDoor(true, out string reason))
-            {
-                LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Open failed:{reason}");
-                return false;
-            }
-            if (!SetLiftPin(MovementPosition.Up, out reason))
+            if (!SetLiftPin(MovementPosition.Up, out string reason))
             {
                 LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Up failed:{reason}");
                 return false;
@@ -1254,11 +1248,11 @@ namespace Venus_RT.Devices
         }
         public override bool PreparePlaceIsOK()
         {
-            return CheckSlitDoorOpen() && LiftPinIsDown;
+            return LiftPinIsDown;
         }
         public override bool PreparePickIsOK()
         {
-            return CheckSlitDoorOpen() && LiftPinIsUp;
+            return LiftPinIsUp;
         }
         public override bool EndPlace()
         {
@@ -1268,22 +1262,11 @@ namespace Venus_RT.Devices
                 return false;
             }
 
-            if (!SetSlitDoor(false, out reason))
-            {
-                LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
-                return false;
-            }
-
             return true;
         }
 
         public override bool EndPick()
         {
-            if (!SetSlitDoor(false, out string reason))
-            {
-                LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
-                return false;
-            }
             return true;
         }
         public override bool EndPlaceIsOK()

+ 25 - 9
Venus/Venus_RT/Devices/TM/HongHuVR.cs

@@ -77,28 +77,44 @@ namespace Venus_RT.Devices.VCE
             {"309"  , "不支持的指令,检查指令" },
             {"350"  , "解析器错误,堆栈溢出,检查指令" },
             {"402"  , "槽位参数异常,检查指令中的对应参数" },
-            {"407"  , "T轴参数异常,检查指令中的对应参数" },
-            {"408"  , "R轴参数异常,检查指令中的对应参数" },
-            {"409"  , "Z轴参数异常,检查指令中的对应参数" },
-            {"416"  , "站点未初始化,检查指令中的对应参数" },
-            {"417"  , "offset 值过大,检查指令中的对应参数" },
-            {"418"  , "AWC 功能检测到误差过大,检查晶圆是否过偏或检查 AWC 传感器标定参数" },
-            {"550"  , "站参数超出范围,检查站点配置参数" },
+            {"403"  , "Slot编号错误,指令的参数中指定的 Slot 编号超过了有效范围" },
+            {"407"  , "旋转轴超过限位,检查指令中的对应参数" },
+            {"408"  , "伸展轴超过限位,检查指令中的对应参数" },
+            {"409"  , "升降轴超过限位,检查指令中的对应参数" },
+            {"416"  , "无法执行 CheckLoad 操作,检查指令中的对应参数" },
+            {"417"  , "Offset 参数参数超限,检查指令中指定的 offset 值是否在允许范围内" },
+            {"418"  , "AWC 功能检测到误差过大,检查晶圆是否过偏或检查AWC传感器标定参数" },
+            {"420"  , "副臂没有在HOME位置,请检查副臂的位置,可以使用HOME ALL使得所有关节姿态回到HOME位置" },
+            {"451"  , "取片后 AWC校验异常,机械臂取片后缩回时,检测到晶圆偏心过大,或者 AWC 校验失败" },
+            {"550"  , "Station参数超出范围,检查站点配置参数" },
             {"551"  , "ARM 不在站点,检查当前手臂实际位置与逻辑位置" },
             {"560"  , "机械臂处于 HALT 状态,拒绝接受新的指令" },
             {"561"  , "当前机械臂状态机与指令不匹配,当前状态机不满足执行该指令的条件" },
             {"600"  , "PAligner通讯异常,检查与 PA 的通讯电缆,上电情况等" },
             {"603"  , "收到急停指令" },
             {"608"  , "机械臂急停中" },
-            {"700"  , "当前手臂有晶圆,检查指令动作要求的晶圆状态,与手臂内部存储的晶圆状态是否匹配" },
+            {"610"  , "手持示教器急停按钮按下" },
+            {"692"  , "检测左 PAN 上有片,与逻辑状态不匹配" },
+            {"693"  , "检测右 PAN 上有片,与逻辑状态不匹配" },
+            {"694"  , "检测左 PAN 上无片,与逻辑状态不匹配" },
+            {"695"  , "检测右 PAN 上有片,与逻辑状态不匹配" },
+            {"700"  , "当前手臂有晶圆 ,检查指令动作要求的晶圆状态,与手臂内部存储的晶圆状态是否匹配" },
             {"701" , "当前手臂无晶圆,检查指令动作要求的晶圆状态,与手臂内部存储的晶圆状态是否匹配"},
             {"711" , "站点互锁错误,检查站点的“允许机械臂进入信号”是否就绪"},
             {"721" , "取片失败,检查手臂晶圆状态,或者晶圆检测传感器状态"},
             {"722" , "放片失败,检查手臂晶圆状态,或者晶圆检测传感器状态"},
+            {"771" , "取片时 AWC 传感器检测失败,检查 AWC 传感器状态,或者 AWC 配置相关是否正确"},
             {"791" , "查询 AWC 数据失败,未曾执行过 AWC 相关功能的操作"},
+            {"792" , "AWC 传感器检测失败,检查AWC传感器状态,或者AWC配置相关是否正确"},
             {"799" , "放片失败,检查手臂晶圆状态,或者晶圆检测传感器状态"},
-            {"803" , "机械臂上电失败 HOME ALL 指令,或者其他上电操作,驱动器未能正常响应上电"},
+            {"802" , "伺服报错,伺服提示异常,目前暂时无法读取伺服错误。开机盖可以读到伺服信息。一般整机断电重启。"},
+            {"803" , "机械臂上电失败,HOME ALL 指令,或者其他上电操作,驱动器未能正常响应上电"},
+            {"805" , "第1个伺服收敛异常,伺服没有在规定时间内运动到位置,或者停稳。"},
+            {"806" , "第2个伺服收敛异常,伺服没有在规定时间内运动到位置,或者停稳。"},
+            {"807" , "第3个伺服收敛异常,伺服没有在规定时间内运动到位置,或者停稳。"},
+            {"808" , "第4个伺服收敛异常,伺服没有在规定时间内运动到位置,或者停稳。"},
             {"1100" , "无法安全回 HOME 操作,检查机械臂是否在安全 HOME 半径内,常见于双臂机械臂,双臂同时伸出超过安全位"},
+            {"1805" , "当前处于示教器模式,检查示教器档位,一般此时处于 Teach 档位"},
             {"13004" , "PA报错,检查 PA 运行状态,PA 扫片结果等"},
         };
         private BlockingCollection<RobotAnimationData> blockingCollection = new BlockingCollection<RobotAnimationData>();

+ 2 - 0
Venus/Venus_RT/Devices/VCE/HongHuVce.cs

@@ -299,6 +299,7 @@ namespace Venus_RT.Devices.VCE
                         else
                         {
                             _LPMs[0].HasCassette = false;
+                            WaferManager.Instance.DeleteWafer(_LPMs[0].Module, 0, 25);
                             return false;
                         }
                     case ModuleName.VCEB:
@@ -310,6 +311,7 @@ namespace Venus_RT.Devices.VCE
                         else
                         {
                             _LPMs[0].HasCassette = false;
+                            WaferManager.Instance.DeleteWafer(_LPMs[0].Module, 0, 25);
                             return false;
                         }
                     default:

+ 0 - 13
Venus/Venus_RT/Modules/PMs/PMEntity.cs

@@ -1543,19 +1543,6 @@ namespace Venus_RT.Modules.PMs
 
         private bool FnStartFinishPlace(object[] param)
         {
-            //if (!_chamber.SetLiftPin(MovementPosition.Down, out string reason))
-            //{
-            //    LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Down failed:{reason}");
-            //    return false;
-            //}
-
-            //if (!_chamber.SetSlitDoor(false, out reason))
-            //{
-            //    LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
-            //    return false;
-            //}
-
-            //return true;
             return _chamber.EndPlace();
         }
         private bool FnAortPlace(object[] param)

+ 18 - 72
Venus/Venus_RT/Modules/TM/VenusEntity/SEMFPMPickRoutine.cs

@@ -30,7 +30,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
         private enum PickStep
         {
             WaitPMReady,
-            WaitforControlPressure,
+            OpenMFSlitDoor,
             PMPrepare,
             ArmExtend,
             QueryAWC,
@@ -42,7 +42,6 @@ namespace Venus_RT.Modules.TM.VenusEntity
             SavePickeData,
             NotifyDone,
             CloseSlitDoor,
-            CloseLinerDoor,
             EndDelay
         }
 
@@ -55,15 +54,13 @@ namespace Venus_RT.Modules.TM.VenusEntity
         private PMEntity _pmModule;
         private int _ExtendTimeout = 120 * 1000;
         private int _RetractTimeout = 120 * 1000;
-        private JetPMBase _chamber;
-        private bool NeedControlPressure;
         private int _controlPressureSetPoint = 90;
-        private int _controlFlowSetPoint = 10;   
+        private int _controlFlowSetPoint = 10;
         //private DateTime _starttime;
         private bool _queryAwc;
         private bool havelinerdoor;
 
-        public SEMFPMPickRoutine(TMBase honghutm, ITransferRobot robot,ModuleName module) : base(module)
+        public SEMFPMPickRoutine(TMBase honghutm, ITransferRobot robot, ModuleName module) : base(module)
         {
             _tm = honghutm;
             _robot = robot;
@@ -83,15 +80,6 @@ namespace Venus_RT.Modules.TM.VenusEntity
             _targetSlot = pickItem.Peek().SourceSlot;
             _hand = pickItem.Peek().RobotHand;
 
-            _chamber = DEVICE.GetDevice<JetPMBase>(_targetModule.ToString());//(JetChamber)SC.GetValue<int>($"{_targetModule}.ChamberType");
-            if ( _chamber.ChamberType== JetChamber.VenusDE) 
-            {
-                havelinerdoor = true;
-            }
-            else
-            {
-                havelinerdoor = false;
-            }
             if (ModuleHelper.IsPm(_targetModule) && ModuleHelper.IsInstalled(_targetModule))
             {
                 _pmModule = Singleton<RouteManager>.Instance.GetPM(_targetModule);
@@ -119,14 +107,6 @@ namespace Venus_RT.Modules.TM.VenusEntity
             _ExtendTimeout = SC.GetValue<int>($"{Module}.ExtendTimeout") * 1000;
             _RetractTimeout = SC.GetValue<int>($"{Module}.RetractTimeout") * 1000;
             _pickdelay = SC.GetValue<int>($"{_targetModule}.PickDelayTime");
-            if (Singleton<RouteManager>.Instance.GetPM(_targetModule).IsOnline)
-            {
-                NeedControlPressure = true;
-            }
-            else
-            {
-                NeedControlPressure = false;
-            }
             Reset();
             return Runner.Start(Module, $"Pick from {_targetModule}");
         }
@@ -134,8 +114,8 @@ namespace Venus_RT.Modules.TM.VenusEntity
         public RState Monitor()
         {
             Runner.Wait(PickStep.WaitPMReady, () => _pmModule.IsIdle, _delay_60s)
-                        .RunIf(PickStep.WaitforControlPressure, NeedControlPressure, StartControlPressure, IsPressureReady, _delay_60s)
-                        .Run(PickStep.PMPrepare, ModulePrepare, IsModulePrepareReady,_delay_60s)
+                        .Run(PickStep.OpenMFSlitDoor, OpenSlitDoor, CheckSlitDoorOpen)
+                        .Run(PickStep.PMPrepare, ModulePrepare, IsModulePrepareReady, _delay_60s)
                         .Delay(PickStep.PickDelay, _pickdelay)
                         .Run(PickStep.ArmExtend, ArmExtend, WaitRobotExtendDone, _ExtendTimeout)
                         .Run(PickStep.QueryAWC, QueryAWC, WaitRobotQueryDone, _delay_1s)
@@ -143,25 +123,34 @@ namespace Venus_RT.Modules.TM.VenusEntity
                         .Delay(PickStep.PickDelay1, _pickdelay)
                         .Run(PickStep.ArmRetract, ArmRetract, WaitRobotRetractDone, _RetractTimeout)
                         .Run(PickStep.SavePickeData, RecordAWCData, NullFun)
+                        .Run(PickStep.CloseSlitDoor, PMDoorClose, WaitPMDoorClose)
                         .Run(PickStep.NotifyDone, NotifyPMDone, _delay_50ms)
                         .Delay(PickStep.PickDelay2, _delay_50ms)
-                        .Run(PickStep.CloseSlitDoor, PMDoorClose, WaitPMDoorClose)
-                        .RunIf(PickStep.CloseLinerDoor, havelinerdoor, PMLinerDoorClose, WaitPMLinerDoorClose)
                         .End(PickStep.EndDelay, NullFun, _delay_50ms);
 
 
             return Runner.Status;
         }
+
+        private bool OpenSlitDoor()
+        {
+            return _tm.TurnSlitDoor(_targetModule,true);
+        }
+
+        private bool CheckSlitDoorOpen()
+        {
+            return _tm.CheckSlitValveOpen(_targetModule);
+        }
+
         private bool ModulePrepare()
         {
             _pmModule.PostMsg(PMEntity.MSG.PreparePick);
-            //_tm.TurnSlitDoor(_targetModule, true);
             return true;
         }
 
         private bool IsModulePrepareReady()
         {
-            return _pmModule.Status == PMEntity.PMStatus.Ready_For_Pick && _pmModule.IsSlitDoorOpen;
+            return _pmModule.Status == PMEntity.PMStatus.Ready_For_Pick;
         }
 
         private bool ArmExtend()
@@ -196,31 +185,6 @@ namespace Venus_RT.Modules.TM.VenusEntity
                 return true;
             }
         }
-        private bool IsPressureReady()
-        {
-            double ControlPressure = SC.GetValue<int>($"{_targetModule}.ControlPressureSetPoint");
-            //double PMPressure = Singleton<RouteManager>.Instance.GetPM(_targetModule).ChamberPressure;
-            double PMPressure = (double)DATA.Poll($"{_targetModule}.ChamberPressure");
-            double range = SC.GetValue<int>($"{_targetModule}.ControlPressureOffset");
-            if ((PMPressure >= (ControlPressure - range)) && (PMPressure <= (ControlPressure + range)))
-            {
-
-                //LOG.Write(eEvent.WARN_DEFAULT_WARN, _targetModule, "current pmpressure"+PMPressure);
-                //LOG.Write(eEvent.WARN_DEFAULT_WARN, _targetModule, "DATA current pmpressure"+DATA.Poll($"{_targetModule}.ChamberPressure"));
-                //string reason = $"{Module} and TM pressure difference exceeds the max limit {maxPressureDifference}, TMPressure:{TMPressure}, {Module}Pressure:{PMPressure}";
-                //LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
-                return true;
-            }
-            else return false;
-        }
-        private bool StartControlPressure()
-        {
-            _chamber = DEVICE.GetDevice<JetPMBase>(_targetModule.ToString());
-            _controlPressureSetPoint = SC.GetValue<int>($"{_targetModule}.ControlPressureSetPoint");
-            _controlFlowSetPoint = SC.GetValue<int>($"{_targetModule}.ControlPressureN2FlowSetPoint");
-            _chamber.StartControlPressure(_controlPressureSetPoint, _controlFlowSetPoint);
-            return true;
-        }
         private bool QueryAWC()
         {
             if (!_queryAwc)
@@ -300,11 +264,6 @@ namespace Venus_RT.Modules.TM.VenusEntity
             return _tm.TurnSlitDoor(_targetModule, false);
         }
 
-        private bool PMLinerDoorClose()
-        {
-            LOG.Write(eEvent.WARN_TM, Module, $"PMPick Close Liner Door Again");
-            return _chamber.SetLinerDoor(false, out _);
-        }
         private bool WaitPMDoorClose()
         {
             if (_tm.CheckSlitValveClose(_targetModule))
@@ -319,19 +278,6 @@ namespace Venus_RT.Modules.TM.VenusEntity
             }
         }
 
-        private bool WaitPMLinerDoorClose()
-        {
-            if (_chamber.CheckLinerDoorClose())
-            {
-                LOG.Write(eEvent.WARN_TM, Module, $"PMPick Check LinerDoor Close");
-                return true;
-            }
-            else
-            {
-                LOG.Write(eEvent.WARN_TM, Module, $"PMPick Check not Close LinerDoor");
-                return false;
-            }
-        }
         public void Abort()
         {
             _robot.Halt();

+ 13 - 1
Venus/Venus_RT/Modules/TM/VenusEntity/SEMFPMPlaceRoutine.cs

@@ -27,6 +27,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
         private enum PlaceStep
         {
             WaitPMReady,
+            OpenMFSlitDoor,
             PMPrepare,
             ArmExtend,
             QueryAWC,
@@ -114,6 +115,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
         public RState Monitor()
         {
             Runner.Wait(PlaceStep.WaitPMReady, () => _pmModule.IsIdle, _delay_60s)
+                .Run(PlaceStep.OpenMFSlitDoor, OpenSlitDoor, CheckSlitDoorOpen)
                 .Run(PlaceStep.PMPrepare, ModulePrepare, IsModulePrepareReady, _delay_60s)
                 .Delay(PlaceStep.PlaceDelay, _placeDelayTime)
                 .Run(PlaceStep.ArmExtend, ArmExtend, WaitRobotExtendDone, _ExtendTimeout)
@@ -122,13 +124,23 @@ namespace Venus_RT.Modules.TM.VenusEntity
                 .Delay(PlaceStep.PlaceDelay1, _placeDelayTime)
                 .Run(PlaceStep.ArmRetract, ArmRetract, WaitRobotRetractDone, _RetractTimeout)
                 .Run(PlaceStep.SavePlaceData, RecordAWCData, NullFun)
+                .Run(PlaceStep.CloseDoor, PMDoorClose, WaitPMDoorClose)
                 .Run(PlaceStep.NotifyDone, NotifyPMDone, _delay_50ms)
                 .Delay(PlaceStep.PlaceDelay2, _delay_50ms)
-                .Run(PlaceStep.CloseDoor, PMDoorClose, WaitPMDoorClose)
                 .End(PlaceStep.EndDelay, NullFun, _delay_50ms);
 
             return Runner.Status;
         }
+
+        private bool OpenSlitDoor()
+        {
+            return _TM.TurnSlitDoor(_targetModule, true);
+        }
+
+        private bool CheckSlitDoorOpen()
+        {
+            return _TM.CheckSlitValveOpen(_targetModule);
+        }
         private bool ModulePrepare()
         {
             _pmModule.PostMsg(PMEntity.MSG.PreparePlace);

+ 22 - 38
Venus/Venus_RT/Modules/TM/VenusEntity/SEMFPMSwapRoutine.cs

@@ -27,6 +27,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
         private enum SwapStep
         {
             WaitPMReady,
+            OpenMFSlitDoor,
             WaitforControlPressure,
             PreRotation,
             PickPrepare,
@@ -40,6 +41,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
             PlaceDelay,
             PlaceRetract,
             NotifyDone,
+            CloseMFSlitDoor,
             EndDone,
             EndDelay
         }
@@ -126,53 +128,35 @@ namespace Venus_RT.Modules.TM.VenusEntity
 
         public RState Monitor()
         {
-            Runner.Wait(SwapStep.WaitPMReady, () => _pmModule.IsIdle, _delay_60s)
-                 .RunIf(SwapStep.WaitforControlPressure, NeedControlPressure, StartControlPressure, IsPressureReady, _delay_60s)
-                //.RunIf(SwapStep.PreRotation, _JetTM.PreRotateModules.ContainsKey(_targetModule), RotateArm, WaitRotateDone)
-                .Run(SwapStep.PickPrepare, PickPrepare, IsModuleReadyForPick)
-                .Run(SwapStep.PickExtend, PickExtend, WaitRobotExtendDone)
-                .Run(SwapStep.DropDownWafer, NotifyPMPickWafer, WaitPMWaferDropDown)
-                .Delay(SwapStep.PickDelay, _pickDelayTime)
-                .Run(SwapStep.PickRetract, PickRetract, WaitRobotRetractDone)
-                .Run(SwapStep.PlacePrepare, PlacePrepare, IsModuleReadyForPlace)
-                .Run(SwapStep.PlaceExtend, PlaceExtend, WaitRobotExtendDone)
-                .Run(SwapStep.LiftUpWafer, NotifyLiftUpWafer, WaitPMWaferLiftUp)
-                .Delay(SwapStep.PlaceDelay, _placeDelayTime)
-                .Run(SwapStep.PlaceRetract, PlaceRetract, WaitRobotRetractDone)
-                .Run(SwapStep.NotifyDone, NotifyPMDone, _delay_50ms)
-                .Delay(SwapStep.PlaceDelay, _delay_50ms)
-                .Run(SwapStep.EndDone, CheckDoorClose, WaitPMDoorClose, 5000)
-                .End(SwapStep.EndDelay, NullFun, _delay_50ms);
+            Runner.Wait(SwapStep.WaitPMReady,       () => _pmModule.IsIdle,     _delay_60s)
+                .Run(SwapStep.OpenMFSlitDoor,       OpenSlitDoor,               CheckSlitDoorOpen)
+                .Run(SwapStep.PickPrepare,          PickPrepare,                IsModuleReadyForPick)
+                .Run(SwapStep.PickExtend,           PickExtend,                 WaitRobotExtendDone)
+                .Run(SwapStep.DropDownWafer,        NotifyPMPickWafer,          WaitPMWaferDropDown)
+                .Delay(SwapStep.PickDelay,          _pickDelayTime)
+                .Run(SwapStep.PickRetract,          PickRetract,                WaitRobotRetractDone)
+                .Run(SwapStep.PlacePrepare,         PlacePrepare,               IsModuleReadyForPlace)
+                .Run(SwapStep.PlaceExtend,          PlaceExtend,                WaitRobotExtendDone)
+                .Run(SwapStep.LiftUpWafer,          NotifyLiftUpWafer,          WaitPMWaferLiftUp)
+                .Delay(SwapStep.PlaceDelay,         _placeDelayTime)
+                .Run(SwapStep.PlaceRetract,         PlaceRetract,               WaitRobotRetractDone)
+                .Run(SwapStep.CloseMFSlitDoor,      CheckDoorClose,             WaitPMDoorClose,            5000)
+                .Run(SwapStep.NotifyDone,           NotifyPMDone,               _delay_50ms)
+                .Delay(SwapStep.EndDelay,           _delay_50ms)
+                .End(SwapStep.EndDone,              NullFun,                    _delay_50ms);
 
 
             return Runner.Status;
         }
 
-        private bool StartControlPressure()
+        private bool OpenSlitDoor()
         {
-            _chamber = DEVICE.GetDevice<JetPMBase>(_targetModule.ToString());
-            _controlPressureSetPoint = SC.GetValue<int>($"{_targetModule}.ControlPressureSetPoint");
-            _controlFlowSetPoint = SC.GetValue<int>($"{_targetModule}.ControlPressureN2FlowSetPoint");
-            _chamber.StartControlPressure(_controlPressureSetPoint, _controlFlowSetPoint);
-            return true;
+            return _TM.TurnSlitDoor(_targetModule, true);
         }
 
-        private bool IsPressureReady()
+        private bool CheckSlitDoorOpen()
         {
-            double ControlPressure = SC.GetValue<int>($"{_targetModule}.ControlPressureSetPoint");
-            //double PMPressure = Singleton<RouteManager>.Instance.GetPM(_targetModule).ChamberPressure;
-            double PMPressure = (double)DATA.Poll($"{_targetModule}.ChamberPressure");
-            double range = SC.GetValue<int>($"{_targetModule}.ControlPressureOffset");
-            if ((PMPressure >= (ControlPressure - range)) && (PMPressure <= (ControlPressure + range)))
-            {
-
-                //LOG.Write(eEvent.WARN_DEFAULT_WARN, _targetModule, "current pmpressure" + PMPressure);
-                //LOG.Write(eEvent.WARN_DEFAULT_WARN, _targetModule, "DATA current pmpressure" + DATA.Poll($"{_targetModule}.ChamberPressure"));
-                //string reason = $"{Module} and TM pressure difference exceeds the max limit {maxPressureDifference}, TMPressure:{TMPressure}, {Module}Pressure:{PMPressure}";
-                //LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
-                return true;
-            }
-            else return false;
+            return _TM.CheckSlitValveOpen(_targetModule);
         }
 
         private bool PickPrepare()

+ 17 - 24
Venus/Venus_RT/Modules/TM/VenusEntity/SEMFPickRoutine.cs

@@ -71,9 +71,18 @@ namespace Venus_RT.Modules.TM.VenusEntity
             _hand = pickItem.Peek().RobotHand;
 
             //如果目标是Vce 否则是vpa
-            if (ModuleHelper.IsVCE(_targetModule) && ModuleHelper.IsInstalled(_targetModule))
+            if (ModuleHelper.IsLoadPort(_targetModule) && ModuleHelper.IsInstalled(_targetModule))
             {
-                _vceModule = Singleton<RouteManager>.Instance.GetVCE(_targetModule);
+                if (ModuleHelper.IsVCE(VCE2LP.QueryLP2VCE(_targetModule)))
+                {
+                    _vceModule = Singleton<RouteManager>.Instance.GetVCE(VCE2LP.QueryLP2VCE(_targetModule));
+                }
+                else
+                {
+                    LOG.Write(eEvent.ERR_TM, Module, $"Invalid target module : {_targetModule} ,which cannot find VCE2LP");
+                    return RState.Failed;
+                }
+
                 //如果vce有错误 报错
                 if (_vceModule.IsError)
                 {
@@ -160,7 +169,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
         {
             Runner.Wait(PickStep.seWaitModuleReady,         CheckModuleReady,       _delay_60s)
                   .Run(PickStep.sePrepareModule,            PrepareModule,          CheckModuleReady)
-                  .RunIf(PickStep.seDoorOpen,               ModuleHelper.IsVCE(_targetModule), VCEDoorOpen, CheckVCEDoorOpen)
+                  .RunIf(PickStep.seDoorOpen,               ModuleHelper.IsLoadPort(_targetModule), VCEDoorOpen, CheckVCEDoorOpen)
                   .RunIf(PickStep.sePAQuery,                _targetModule == ModuleName.VPA,              QueryOffset,        VPAIsIdle,  _pickingTimeout)
                   .Run (PickStep.sePicking,                 Picking,                WaitPickDone,       _pickingTimeout)
                   .End (PickStep.seNotifyDone,              NullFun,                500);
@@ -169,7 +178,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
 
         private bool PrepareModule()
         {
-            switch (_targetModule)
+            switch (VCE2LP.QueryLP2VCE(_targetModule))
             {
                 case ModuleName.VCE1:
                 case ModuleName.VCEA:
@@ -190,22 +199,6 @@ namespace Venus_RT.Modules.TM.VenusEntity
             }
             else if (_robot.Status == RState.End)
             {
-                if (ModuleHelper.IsVCE(_targetModule))
-                {
-                    switch (_targetModule)
-                    {
-                        case ModuleName.VCE1:
-                            WaferManager.Instance.WaferMoved(ModuleName.LP1, _targetSlot, ModuleName.TMRobot, (int)_hand);
-                            break;
-                        case ModuleName.VCEA:
-                            WaferManager.Instance.WaferMoved(ModuleName.LP1, _targetSlot, ModuleName.TMRobot, (int)_hand);
-                            break;
-                        case ModuleName.VCEB:
-                            WaferManager.Instance.WaferMoved(ModuleName.LP2, _targetSlot, ModuleName.TMRobot, (int)_hand);
-                            break;
-                    }
-                }
-                else
                     WaferManager.Instance.WaferMoved(_targetModule, _targetSlot, ModuleName.TMRobot, (int)_hand);
                 return true;
             }
@@ -218,12 +211,12 @@ namespace Venus_RT.Modules.TM.VenusEntity
 
         private bool VCEDoorOpen()
         {
-            return _tm.TurnSlitDoor(_targetModule, true);
+            return _tm.TurnSlitDoor(VCE2LP.QueryLP2VCE(_targetModule), true);
         }
 
         private bool CheckVCEDoorOpen()
         {
-            return _tm.CheckSlitValveOpen(_targetModule);
+            return _tm.CheckSlitValveOpen(VCE2LP.QueryLP2VCE(_targetModule));
         }
         private bool CheckIsPA() => _targetModule == ModuleName.VPA;
 
@@ -276,7 +269,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
                 return _robot.PickWithOffset(_targetModule, 0, _hand, RT[1], RT[0]);
             }
             else
-                return _robot.Pick(_targetModule, 0, _hand);
+                return _robot.Pick(VCE2LP.QueryLP2VCE(_targetModule), 0, _hand);
         }
 
         private int[] calculateRT(int OriginR,int OriginS)
@@ -322,7 +315,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
 
         private bool CheckModuleReady()
         {
-            switch (_targetModule)
+            switch (VCE2LP.QueryLP2VCE(_targetModule))
             {
                 case ModuleName.VCE1:
                 case ModuleName.VCEA:

+ 19 - 26
Venus/Venus_RT/Modules/TM/VenusEntity/SEMFPlaceRoutine.cs

@@ -65,9 +65,19 @@ namespace Venus_RT.Modules.TM.VenusEntity
             _hand = placeItem.Peek().RobotHand;
 
             //如果目标是Vce 获取vce
-            if (ModuleHelper.IsVCE(_targetModule) && ModuleHelper.IsInstalled(_targetModule))
+            if (ModuleHelper.IsLoadPort(_targetModule) && ModuleHelper.IsInstalled(_targetModule))
             {
-                _vceModule = Singleton<RouteManager>.Instance.GetVCE(_targetModule);
+
+                if (ModuleHelper.IsVCE(VCE2LP.QueryLP2VCE(_targetModule)))
+                {
+                    _vceModule = Singleton<RouteManager>.Instance.GetVCE(VCE2LP.QueryLP2VCE(_targetModule));
+                }
+                else
+                {
+                    LOG.Write(eEvent.ERR_TM, Module, $"Invalid target module : {_targetModule} ,which cannot find VCE2LP");
+                    return RState.Failed;
+                }
+
                 //如果vce有错误 报错
                 if (_vceModule.IsError)
                 {
@@ -154,7 +164,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
         {
             Runner.Wait(PlaceStep.seWaitModuleReady,        CheckModuleReady,       _delay_60s)
                 .Run(PlaceStep.sePrepareModule,             PrepareModule,          CheckModuleReady)
-                .RunIf(PlaceStep.seDoorOpen, ModuleHelper.IsVCE(_targetModule), VCEDoorOpen, CheckVCEDoorOpen)
+                .RunIf(PlaceStep.seDoorOpen, ModuleHelper.IsLoadPort(_targetModule), VCEDoorOpen, CheckVCEDoorOpen)
                 .Run(PlaceStep.sePlacing,                   Placing,                WaitPlaceDone,       _placingTimeout)
                 .End(PlaceStep.seNotifyDone,                NullFun,                500);
 
@@ -163,7 +173,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
 
         private bool PrepareModule()
         {
-            switch (_targetModule)
+            switch (VCE2LP.QueryLP2VCE(_targetModule))
             {
                 case ModuleName.VCE1:
                 case ModuleName.VCEA:
@@ -185,26 +195,9 @@ namespace Venus_RT.Modules.TM.VenusEntity
             }
             else if (_robot.Status == RState.End)
             {
-                if (ModuleHelper.IsVCE(_targetModule))
-                {
-                    switch (_targetModule)
-                    {
-                        case ModuleName.VCE1:
-                            WaferManager.Instance.WaferMoved(ModuleName.TMRobot, (int)_hand, ModuleName.LP1, _targetSlot);
-                            break;
-                        case ModuleName.VCEA:
-                            WaferManager.Instance.WaferMoved(ModuleName.TMRobot, (int)_hand, ModuleName.LP1, _targetSlot);
-                            break;
-                        case ModuleName.VCEB:
-                            WaferManager.Instance.WaferMoved(ModuleName.TMRobot, (int)_hand, ModuleName.LP2, _targetSlot);
-                            break;
-                    }
-                }
-                else
-                    WaferManager.Instance.WaferMoved(ModuleName.TMRobot, (int)_hand, _targetModule, _targetSlot);
+                WaferManager.Instance.WaferMoved(ModuleName.TMRobot, (int)_hand, _targetModule, _targetSlot);
                 return true;
             }
-            // timeout failed
             else
             {
                 Runner.Stop($"TM Robot Placing failed, {_robot.Status}");
@@ -213,22 +206,22 @@ namespace Venus_RT.Modules.TM.VenusEntity
         }
         private bool VCEDoorOpen()
         {
-            return _tm.TurnSlitDoor(_targetModule, true);
+            return _tm.TurnSlitDoor(VCE2LP.QueryLP2VCE(_targetModule), true);
         }
 
         private bool CheckVCEDoorOpen()
         {
-            return _tm.CheckSlitValveOpen(_targetModule);
+            return _tm.CheckSlitValveOpen(VCE2LP.QueryLP2VCE(_targetModule));
         }
 
         private bool Placing()
         {
-            return _robot.Place(_targetModule, 0, _hand);
+            return _robot.Place(VCE2LP.QueryLP2VCE(_targetModule), 0, _hand);
         }
 
         private bool CheckModuleReady()
         {
-            switch (_targetModule)
+            switch (VCE2LP.QueryLP2VCE(_targetModule))
             {
                 case ModuleName.VCE1:
                 case ModuleName.VCEA:

+ 22 - 40
Venus/Venus_RT/Modules/TM/VenusEntity/SEMFSwapRoutine.cs

@@ -66,23 +66,12 @@ namespace Venus_RT.Modules.TM.VenusEntity
                 _actionList.Enqueue(new MoveItem(item.SourceModule, item.SourceSlot, item.DestinationModule, item.DestinationSlot, item.RobotHand));
             }
             var firtItem = _actionList.Peek();
-            if (ModuleHelper.IsVCE(firtItem.SourceModule))
+            if (ModuleHelper.IsLoadPort(firtItem.SourceModule))
             {
-
-                //if (_TM.VCESlitDoorClosed)
-                //{
-                //    LOG.Write(eEvent.ERR_TM, Module, $"VCE is not open, cannot do it.");
-                //    return RState.Failed;
-                //}
                 _targetModule = firtItem.SourceModule;
             }
-            else if (ModuleHelper.IsVCE(firtItem.DestinationModule))
+            else if (ModuleHelper.IsLoadPort(firtItem.DestinationModule))
             {
-                //if (_TM.VCESlitDoorClosed)
-                //{
-                //    LOG.Write(eEvent.ERR_TM, Module, $"VCE is not open, cannot do it.");
-                //    return RState.Failed;
-                //}
                 _targetModule = firtItem.DestinationModule;
             }
             else
@@ -91,7 +80,16 @@ namespace Venus_RT.Modules.TM.VenusEntity
                 return RState.Failed;
             }
 
-            _vceModule = Singleton<RouteManager>.Instance.GetVCE(_targetModule);
+            if (ModuleHelper.IsVCE(VCE2LP.QueryLP2VCE(_targetModule)))
+            {
+                _vceModule = Singleton<RouteManager>.Instance.GetVCE(VCE2LP.QueryLP2VCE(_targetModule));
+            }
+            else
+            {
+                LOG.Write(eEvent.ERR_TM, Module, $"Invalid target module : {_targetModule} ,which cannot find VCE2LP");
+                return RState.Failed;
+            }
+
             if (_vceModule == null)
             {
                 LOG.Write(eEvent.ERR_TM, Module, $"Invalid vce: {_targetModule}, maybe not installed");
@@ -107,7 +105,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
         public RState Monitor()
         {
             Runner.Wait(SwapStep.WaitModuleReady,               () => _vceModule.IsIdle,            _delay_60s)
-                .RunIf(SwapStep.SEDoorOpen,                     ModuleHelper.IsVCE(_targetModule), VCEDoorOpen, CheckVCEDoorOpen)
+                .RunIf(SwapStep.SEDoorOpen,                     ModuleHelper.IsLoadPort(_targetModule), VCEDoorOpen, CheckVCEDoorOpen)
                 .LoopStart(SwapStep.VCEGoto,                    loopName(),                         _actionList.Count,      VCEGoto,         VCEGoReady)
                 .LoopEnd(SwapStep.MoveWafer,                    MoveWafer,                          WaitWaferMoved)
                 .End(SwapStep.NotifyDone,                       NullFun,                            _delay_50ms);
@@ -117,11 +115,11 @@ namespace Venus_RT.Modules.TM.VenusEntity
 
         private bool VCEDoorOpen()
         {
-            return _TM.TurnSlitDoor(_targetModule, true);
+            return _TM.TurnSlitDoor(VCE2LP.QueryLP2VCE(_targetModule), true);
         }
         private bool CheckVCEDoorOpen()
         {
-            return _TM.CheckSlitValveOpen(_targetModule);
+            return _TM.CheckSlitValveOpen(VCE2LP.QueryLP2VCE(_targetModule));
         }
         private string loopName()
         {
@@ -131,11 +129,11 @@ namespace Venus_RT.Modules.TM.VenusEntity
         private bool VCEGoto()
         {
             _currentAction = _actionList.Peek();
-            if (ModuleHelper.IsVCE(_currentAction.SourceModule) && ModuleHelper.IsTMRobot(_currentAction.DestinationModule))
+            if (ModuleHelper.IsVCE(VCE2LP.QueryLP2VCE(_currentAction.SourceModule)) && ModuleHelper.IsTMRobot(_currentAction.DestinationModule))
             {
                 return _vceModule.CheckToPostMessage((int)VceMSG.Goto, _currentAction.SourceSlot);
             }
-            else if (ModuleHelper.IsTMRobot(_currentAction.SourceModule) && ModuleHelper.IsVCE(_currentAction.DestinationModule))
+            else if (ModuleHelper.IsTMRobot(_currentAction.SourceModule) && ModuleHelper.IsVCE(VCE2LP.QueryLP2VCE(_currentAction.DestinationModule)))
             {
                 return _vceModule.CheckToPostMessage((int)VceMSG.Goto, _currentAction.DestinationSlot);
             }
@@ -149,11 +147,11 @@ namespace Venus_RT.Modules.TM.VenusEntity
         private bool VCEGoReady()
         {
             _currentAction = _actionList.Peek();
-            if (ModuleHelper.IsVCE(_currentAction.SourceModule) && ModuleHelper.IsTMRobot(_currentAction.DestinationModule))
+            if (ModuleHelper.IsVCE(VCE2LP.QueryLP2VCE(_currentAction.SourceModule)) && ModuleHelper.IsTMRobot(_currentAction.DestinationModule))
             {
                 return _vceModule.IsIdle && _vceModule.CurrentSlot == _currentAction.SourceSlot;
             }
-            if (ModuleHelper.IsTMRobot(_currentAction.SourceModule) && ModuleHelper.IsVCE(_currentAction.DestinationModule))
+            if (ModuleHelper.IsTMRobot(_currentAction.SourceModule) && ModuleHelper.IsVCE(VCE2LP.QueryLP2VCE(_currentAction.DestinationModule)))
             {
                 return _vceModule.IsIdle && _vceModule.CurrentSlot == _currentAction.DestinationSlot;
             }
@@ -187,11 +185,11 @@ namespace Venus_RT.Modules.TM.VenusEntity
             var wafer = WaferManager.Instance.GetWafer(_currentAction.SourceModule, _currentAction.SourceSlot);
             LOG.Write(eEvent.INFO_TM_ROBOT, ModuleName.TMRobot, $"{wafer.WaferOrigin} will be move from {_currentAction.SourceModule} {_currentAction.SourceSlot + 1}  to {_currentAction.DestinationModule} {_currentAction.DestinationSlot + 1}");
 
-            if (ModuleHelper.IsVCE(_currentAction.SourceModule) && ModuleHelper.IsTMRobot(_currentAction.DestinationModule))
+            if (ModuleHelper.IsVCE(VCE2LP.QueryLP2VCE(_currentAction.SourceModule)) && ModuleHelper.IsTMRobot(_currentAction.DestinationModule))
             {
                 return _robot.Pick(_currentAction.SourceModule, _currentAction.SourceSlot, (Hand)_currentAction.DestinationSlot);
             }
-            else if (ModuleHelper.IsTMRobot(_currentAction.SourceModule) && ModuleHelper.IsVCE(_currentAction.DestinationModule))
+            else if (ModuleHelper.IsTMRobot(_currentAction.SourceModule) && ModuleHelper.IsVCE(VCE2LP.QueryLP2VCE(_currentAction.DestinationModule)))
             {
                 return _robot.Place(_currentAction.DestinationModule, _currentAction.DestinationSlot, (Hand)_currentAction.SourceSlot);
             }
@@ -210,23 +208,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
             }
             else if (_robot.Status == RState.End)
             {
-                if (ModuleHelper.IsVCE(_targetModule))
-                {
-                    switch (_currentAction.SourceModule)
-                    {
-                        case ModuleName.VCE1:
-                            WaferManager.Instance.WaferMoved(ModuleName.LP1, _currentAction.SourceSlot, _currentAction.DestinationModule, _currentAction.DestinationSlot);
-                            break;
-                        case ModuleName.VCEA:
-                            WaferManager.Instance.WaferMoved(ModuleName.LP1, _currentAction.SourceSlot, _currentAction.DestinationModule, _currentAction.DestinationSlot);
-                            break;
-                        case ModuleName.VCEB:
-                            WaferManager.Instance.WaferMoved(ModuleName.LP2, _currentAction.SourceSlot, _currentAction.DestinationModule, _currentAction.DestinationSlot);
-                            break;
-                    }
-                }
-                else
-                    WaferManager.Instance.WaferMoved(_currentAction.SourceModule, _currentAction.SourceSlot, _currentAction.DestinationModule, _currentAction.DestinationSlot);
+                WaferManager.Instance.WaferMoved(_currentAction.SourceModule, _currentAction.SourceSlot, _currentAction.DestinationModule, _currentAction.DestinationSlot);
                 return true;
             }
             else

+ 4 - 4
Venus/Venus_RT/Modules/TM/VenusEntity/SETMEntity.cs

@@ -38,7 +38,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
             Pumping,
             Venting,
             Purging,
-            LeakChecking,
+            Leakchecking,
             Picking,
             Placing,
             Swaping,
@@ -364,9 +364,9 @@ namespace Venus_RT.Modules.TM.VenusEntity
             Transition(STATE.Retracting,        MSG.Abort,          FnAbortRetract,     STATE.Idle);
 
             //leakcheck
-            Transition(STATE.Idle,              MSG.LeakCheck,      FnStartLeakCheck,   STATE.LeakChecking);
-            Transition(STATE.LeakChecking,      FSM_MSG.TIMER,      FnLeakCheckTimeout, STATE.Idle);
-            Transition(STATE.LeakChecking,      MSG.Abort,          FnAbortLeakCheck,   STATE.Idle);
+            Transition(STATE.Idle,              MSG.LeakCheck,      FnStartLeakCheck,   STATE.Leakchecking);
+            Transition(STATE.Leakchecking,      FSM_MSG.TIMER,      FnLeakCheckTimeout, STATE.Idle);
+            Transition(STATE.Leakchecking,      MSG.Abort,          FnAbortLeakCheck,   STATE.Idle);
 
 
             //Control Pressure

+ 39 - 0
Venus/Venus_RT/Modules/VCE/VceEntity.cs

@@ -58,6 +58,45 @@ namespace Venus_RT.Modules.VCE
     }
     #endregion
 
+    public static class VCE2LP
+    {
+        public static Dictionary<ModuleName, ModuleName> dVce2LP = new Dictionary<ModuleName, ModuleName>()
+        {
+            {ModuleName.VCEA,ModuleName.LP1},
+            {ModuleName.VCEB,ModuleName.LP2},
+        };
+
+        public static Dictionary<ModuleName, ModuleName> sVce2LP = new Dictionary<ModuleName, ModuleName>()
+        {
+            //{ModuleName.VCE1,ModuleName.LP1},
+        };
+
+
+        public static Dictionary<ModuleName, ModuleName> LP2Vce = new Dictionary<ModuleName, ModuleName>();
+
+        public static ModuleName QueryLP2VCE(ModuleName lpname)
+        {
+            switch (Singleton<RouteManager>.Instance.seTM.Module)
+            {
+                case ModuleName.SETM:
+                    if (sVce2LP.ContainsValue(lpname))
+                    {
+                        return sVce2LP.FirstOrDefault(vce => vce.Value == lpname).Key;
+                    }
+                    else
+                        return ModuleName.System;
+                case ModuleName.DETM:
+                    if (sVce2LP.ContainsValue(lpname))
+                    {
+                        return dVce2LP.FirstOrDefault(vce => vce.Value == lpname).Key;
+                    }
+                    else
+                        return ModuleName.System;
+                default:
+                    return 0;
+            }
+        }
+    }
     public class VceEntity : Entity, IEntity, IModuleEntity
     {
         private ModuleName _modulename;

+ 1 - 1
Venus/Venus_Simulator/Config/UILayout.xml

@@ -6,7 +6,7 @@
 
 	  <SubView Id="Efem" Name="EFEM" ViewClass="Venus_Simulator.Views.Simu_EfemView" Assembly="Venus_Simulator" />
 
-	  <SubView Id="VCE" Name="HongHuVCE" ViewClass="Venus_Simulator.Views.Simu_VCEView" Assembly="Venus_Simulator"/>
+	  <SubView Id="VCEA" Name="HongHuVCE" ViewClass="Venus_Simulator.Views.Simu_VCEView" Assembly="Venus_Simulator"/>
 	  <SubView Id="VCEB" Name="HongHuVCEB" ViewClass="Venus_Simulator.Views.Simu_VCE2View" Assembly="Venus_Simulator"/>
 	  <SubView Id="HongHUVPA" Name="HongHuVPA" ViewClass="Venus_Simulator.Views.HongHuVPA" Assembly="Venus_Simulator"/>
     

+ 16 - 1
Venus/Venus_Simulator/Devices/VceSimulator.cs

@@ -18,6 +18,21 @@ namespace Venus_Simulator.Devices
         private Regex _read_rule = new Regex(@"\d\d,R,.*");
         private Regex _set_rule = new Regex(@"\d\d,S,.*");
         private Regex _curing_rule = new Regex(@"\d\d,P,.*");
+
+        private string mapresult = "XXXXXXXXXX,XXXXXXXXXX,XXXXX?????,??????????";
+
+        /// <summary>
+        /// 用以模拟扫片结果
+        /// </summary>
+        /// <param name="isempty"></param>
+        public void Wafermap(bool isempty)
+        {
+            if(isempty)
+                mapresult = "0000000000,0000000000,00000?????,??????????";
+            else
+                mapresult = "XXXXXXXXXX,XXXXXXXXXX,XXXXX?????,??????????";
+        }
+
         public VceSimulator(string port) : base(port, -1, EOF, MSG_DELIMITER)
         {
 
@@ -51,7 +66,7 @@ namespace Venus_Simulator.Devices
                         OnWriteMessage("_RDY" + EOF);
                         return;
                     case "00,R,MI,S":
-                        OnWriteMessage("00,X,MI,XXXXXXXXXX,XXXXXXXXXX,XXXXX?????,??????????" + EOF);
+                        OnWriteMessage("00,X,MI,"+ mapresult + EOF);
                         //OnWriteMessage("00,X,MI,0000000000,0000000000,XXXXX?????,??????????" + EOF);
                         Thread.Sleep(2000);
                         OnWriteMessage("_RDY" + EOF);

+ 1 - 0
Venus/Venus_Simulator/Views/SimuSMCChillerGridPMAView.xaml.cs

@@ -26,6 +26,7 @@ namespace Venus_Simulator.Views
         public MockSMCChillerGridViewModelPMA() : base("SkyPumpPMASimulator")
         {
             Init(new SMCChillerMock("COM53"));
+            Init(new SMCChillerMock("COM87"));
         }
     }
 }

+ 2 - 0
Venus/Venus_Simulator/Views/SimuSMCChillerPMCView.xaml.cs

@@ -27,5 +27,7 @@ namespace Venus_Simulator.Views
         {
             Init(new SMCChillerMock("COM85"));
         }
+
+             
     }
 }

+ 54 - 1
Venus/Venus_Simulator/Views/Simu_VCE2View.xaml

@@ -3,10 +3,63 @@
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:commons="clr-namespace:MECF.Framework.Simulator.Core.Commons;assembly=MECF.Framework.Simulator.Core"
              xmlns:local="clr-namespace:Venus_Simulator.Views"
              mc:Ignorable="d" 
              d:DesignHeight="450" d:DesignWidth="800">
     <Grid>
-            
+        <Grid.RowDefinitions>
+            <RowDefinition Height="100"></RowDefinition>
+            <RowDefinition Height="50"></RowDefinition>
+            <RowDefinition Height="50"></RowDefinition>
+            <RowDefinition Height="*"></RowDefinition>
+        </Grid.RowDefinitions>
+        <commons:SerialPortTitleView Grid.Row="0"></commons:SerialPortTitleView>
+        <Grid>
+
+        </Grid>
+        <Grid  Grid.Row="1" Height="350" Width="900">
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="auto"></ColumnDefinition>
+                <ColumnDefinition Width="auto"></ColumnDefinition>
+                <ColumnDefinition Width="auto"></ColumnDefinition>
+                <ColumnDefinition Width="auto"></ColumnDefinition>
+                <ColumnDefinition Width="auto"></ColumnDefinition>
+                <ColumnDefinition Width="auto"></ColumnDefinition>
+                <ColumnDefinition Width="auto"></ColumnDefinition>
+            </Grid.ColumnDefinitions>
+            <Button Command="{Binding CassArrive}">Cass Arrive</Button>
+            <Button Command="{Binding CassLeave}" Grid.Column="1">Cass Leave</Button>
+            <Button Command="{Binding AllExist}" Grid.Column="4">Set ALL X</Button>
+            <Button Command="{Binding AllEmpty}" Grid.Column="5">Set ALL 0</Button>
+        </Grid>
+        <StackPanel Grid.Row="2" Orientation="Horizontal" Width="1200">
+            <Button Content="Clear Log" Width="100" Height="35"   Command="{Binding ClearLogCommand}"></Button>
+        </StackPanel>
+        <DataGrid Grid.Row="3" FontSize="16" AutoGenerateColumns="False" CanUserAddRows="False" CanUserResizeRows="False" CanUserSortColumns="False" ItemsSource="{Binding TransactionLogItems}"
+                  ScrollViewer.CanContentScroll="True"
+                  ScrollViewer.VerticalScrollBarVisibility="Auto"
+                  ScrollViewer.HorizontalScrollBarVisibility="Auto"
+                  Width="1200" Height="Auto" VerticalAlignment="Top">
+            <DataGrid.Columns>
+                <DataGridTextColumn Header="Time" Width="200" IsReadOnly="True" Binding="{Binding OccurTime, UpdateSourceTrigger=PropertyChanged}" />
+                <DataGridTextColumn Header="Incoming" Width="500" IsReadOnly="True"  Binding="{Binding Incoming, UpdateSourceTrigger=PropertyChanged}">
+                    <DataGridTextColumn.ElementStyle>
+                        <Style TargetType="TextBlock">
+                            <Setter Property="TextWrapping" Value="Wrap" />
+                            <Setter Property="Height" Value="auto" />
+                        </Style>
+                    </DataGridTextColumn.ElementStyle>
+                </DataGridTextColumn>
+                <DataGridTextColumn Header="Outgoing" Width="500" IsReadOnly="True"  Binding="{Binding Outgoing, UpdateSourceTrigger=PropertyChanged}">
+                    <DataGridTextColumn.ElementStyle>
+                        <Style TargetType="TextBlock">
+                            <Setter Property="TextWrapping" Value="Wrap" />
+                            <Setter Property="Height" Value="auto" />
+                        </Style>
+                    </DataGridTextColumn.ElementStyle>
+                </DataGridTextColumn>
+            </DataGrid.Columns>
+        </DataGrid>
     </Grid>
 </UserControl>

+ 1 - 1
Venus/Venus_Simulator/Views/Simu_VCE2View.xaml.cs

@@ -23,7 +23,7 @@ namespace Venus_Simulator.Views
         public Simu_VCE2View()
         {
             InitializeComponent();
-            DataContext = new VceViewModel("COM163");
+            DataContext = new VceViewModel("COM163", "VCEB");
         }
 
 

+ 17 - 5
Venus/Venus_Simulator/Views/Simu_VCEView.xaml

@@ -10,16 +10,28 @@
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Height="100"></RowDefinition>
-            <RowDefinition Height="0"></RowDefinition>
+            <RowDefinition Height="50"></RowDefinition>
             <RowDefinition Height="50"></RowDefinition>
             <RowDefinition Height="*"></RowDefinition>
         </Grid.RowDefinitions>
         <commons:SerialPortTitleView Grid.Row="0"></commons:SerialPortTitleView>
+        <Grid>
+            
+        </Grid>
         <Grid  Grid.Row="1" Height="350" Width="900">
-            <Grid.RowDefinitions>
-                <RowDefinition Height="300"></RowDefinition>
-                <RowDefinition Height="50"></RowDefinition>
-            </Grid.RowDefinitions>
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="auto"></ColumnDefinition>
+                <ColumnDefinition Width="auto"></ColumnDefinition>
+                <ColumnDefinition Width="auto"></ColumnDefinition>
+                <ColumnDefinition Width="auto"></ColumnDefinition>
+                <ColumnDefinition Width="auto"></ColumnDefinition>
+                <ColumnDefinition Width="auto"></ColumnDefinition>
+                <ColumnDefinition Width="auto"></ColumnDefinition>
+            </Grid.ColumnDefinitions>
+            <Button Command="{Binding CassArrive}">Cass Arrive</Button>
+            <Button Command="{Binding CassLeave}" Grid.Column="1">Cass Leave</Button>
+            <Button Command="{Binding AllExist}" Grid.Column="4">Set ALL X</Button>
+            <Button Command="{Binding AllEmpty}" Grid.Column="5">Set ALL 0</Button>
         </Grid>
         <StackPanel Grid.Row="2" Orientation="Horizontal" Width="1200">
             <Button Content="Clear Log" Width="100" Height="35"   Command="{Binding ClearLogCommand}"></Button>

+ 39 - 4
Venus/Venus_Simulator/Views/Simu_VCEView.xaml.cs

@@ -1,4 +1,6 @@
-using MECF.Framework.Simulator.Core.Commons;
+using Aitex.Core.RT.IOCore;
+using Aitex.Core.UI.MVVM;
+using MECF.Framework.Simulator.Core.Commons;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -25,20 +27,53 @@ namespace Venus_Simulator.Views
         public Simu_VCEView()
         {
             InitializeComponent();
-            DataContext = new VceViewModel("COM161");
+            DataContext = new VceViewModel("COM161","VCEA");
         }
     }
 
     class VceViewModel : SerialPortDeviceViewModel
     {
+
+        public ICommand CassArrive { get; set; }
+        public ICommand CassLeave { get; set; }
+        public ICommand AllExist { get; set; }
+        public ICommand AllEmpty { get; set; }
+
+
         public string Title
         {
             get { return "VCE simulator"; }
         }
 
-        public VceViewModel(string port) : base("VCE")
+
+        private VceSimulator _vce;
+        private string chamber;
+        public VceViewModel(string port,string _chamber) : base(_chamber)
+        {
+            chamber = _chamber;
+            Init(_vce = new VceSimulator(port));
+            CassArrive = new DelegateCommand<string>(cassArrive);
+            CassLeave  = new DelegateCommand<string>(cassLeave);
+            AllExist   = new DelegateCommand<string>(allExist);
+            AllEmpty   = new DelegateCommand<string>(allEmpty);
+        }
+
+
+        private void cassArrive(string obj)
+        {
+            IO.DI[$"DETM.DI_{chamber}_Cassette_Present"].Value = true;
+        }
+        private void cassLeave(string obj)
+        {
+            IO.DI[$"DETM.DI_{chamber.ToString()}_Cassette_Present"].Value = false;
+        }
+        private void allExist(string obj)
+        {
+            _vce.Wafermap(false);
+        }
+        private void allEmpty(string obj)
         {
-            Init(new VceSimulator(port));
+            _vce.Wafermap(true);
         }
     }
 }