Pārlūkot izejas kodu

1. Add interlocks (Safety to LP1/2, Enable to operate LP1/2)
2. Optimize some codes
3. Add FlipperDisable configItem

niuyx 3 dienas atpakaļ
vecāks
revīzija
3e163da74b

+ 3 - 0
Framework/Common/Device/Common/DeviceManagerBase.cs

@@ -137,6 +137,9 @@ namespace Aitex.Core.RT.Device
                     if (string.IsNullOrEmpty(typeName))
                         typeName = "Aitex.Core.RT.Device.Unit." + className;
 
+                    string isEnabled = nodeDevices.GetAttribute("IsEnabled");
+                    if (isEnabled == "False" || isEnabled == "false") continue;
+
                     Assembly assembly = Assembly.Load(assName);
                     Type deviceType = assembly.GetType(typeName);
 

+ 1 - 1
Framework/SimulatorCore/FFUs/Ffu.cs

@@ -66,7 +66,7 @@ namespace MECF.Framework.Simulator.Core.FFUs
         private byte GetSpeedValue()
         {
             Random random = new Random();
-            return (byte)(_speed + random.Next(0, 3) - 2);
+            return (byte)(_speed + random.Next(0, 2) - 1);
             //return (byte)_speed;
         }
 

+ 2 - 2
Jet/Jet_001_2P_Jet/EfemRT/Config/2LPJet006/DeviceDefine.xml

@@ -34,8 +34,8 @@
 	<RobotIsSingleArm>false</RobotIsSingleArm>
 
 	<!--Buffer 设置项-->
-	<BufferQuantity>1</BufferQuantity>
-	<BufferSlot>8</BufferSlot>
+	<BufferQuantity>0</BufferQuantity>
+	<BufferSlot>0</BufferSlot>
 	<MultiWaferSize>false</MultiWaferSize>
 
 	<!--Is Maintenance-->

+ 29 - 37
Jet/Jet_001_2P_Jet/EfemRT/Config/2LPJet006/DeviceModel.xml

@@ -9,20 +9,20 @@
 	</IoSignalTowers>
 
 	<IoSensors>
-		<IoSensor module="System" id="SensorGratingSensorIN1" di="DI_SafeGratingSensorIN1" textOutTrigValue="true" warningText=""/>
-		<IoSensor module="System" id="SensorFFUalarm" di="DI_FFUAlarm" textOutTrigValue="true" warningText=""/>
-		<IoSensor module="System" id="SensorCDAPressureSW" di="DI_CDAPressureSW" textOutTrigValue="true" warningText=""/>
-		<IoSensor module="System" id="SensorVACPressureSW" di="DI_VACPressureSW" textOutTrigValue="true" warningText=""/>
-		<IoSensor module="System" id="SensorIONCDAPressureSW" di="DI_IONCDAPressureSW" textOutTrigValue="true" warningText=""/>
-		<IoSensor module="System" id="SensorIONAlarmSIGNAL" di="DI_IONAlarmSignal" textOutTrigValue="true" warningText=""/>
-		<IoSensor module="System" id="SensorEFEMSideDoorClosed" di="DI_EFEMSideDoorOpened" textOutTrigValue="true" warningText=""/>
-		<IoSensor module="System" id="SensorPMASystemInterlock" di="DI_PMASystemInterlock" textOutTrigValue="true" warningText=""/>
-		<IoSensor module="System" id="SensorPMBSystemInterlock" di="DI_PMBSystemInterlock" textOutTrigValue="true" warningText=""/>
-		<IoSensor module="System" id="SensorPAorFLPDoorClosed" di="DI_PA/FLPDoorClosed" textOutTrigValue="true" warningText=""/>
+		<IoSensor module="System" id="SensorGratingSensorIN1" di="DI_SafeGratingSensorIN1" textOutTrigValue="false" infoText="" warningText="" alarmText="Safe Grating Sensor IN1 Alarm"/>
+		<IoSensor module="System" id="SensorFFUalarm" di="DI_FFUAlarm" textOutTrigValue="false" infoText="" warningText="" alarmText="FFU Alarm"/>
+		<IoSensor module="System" id="SensorCDAPressureSW" di="DI_CDAPressureSW" textOutTrigValue="false" infoText="" warningText="" alarmText="CDA Pressure SW Alarm"/>
+		<IoSensor module="System" id="SensorVACPressureSW" di="DI_VACPressureSW" textOutTrigValue="false" infoText="" warningText="" alarmText="VAC Pressure SW Alarm"/>
+		<IoSensor module="System" id="SensorIONCDAPressureSW" di="DI_IONCDAPressureSW" textOutTrigValue="false" infoText="" warningText="" alarmText=""/>
+		<IoSensor module="System" id="SensorIONAlarmSIGNAL" di="DI_IONAlarmSignal" textOutTrigValue="false" infoText="" warningText="" alarmText=""/>
+		<IoSensor module="System" id="SensorEFEMSideDoorClosed" di="DI_EFEMSideDoorOpened" textOutTrigValue="true"/>
+		<IoSensor module="System" id="SensorPMASystemInterlock" di="DI_PMASystemInterlock" textOutTrigValue="false" infoText="" warningText="" alarmText="PMA System Interlock Alarm"/>
+		<IoSensor module="System" id="SensorPMBSystemInterlock" di="DI_PMBSystemInterlock" textOutTrigValue="false" infoText="" warningText="" alarmText="PMB System Interlock Alarm"/>
+		<IoSensor module="System" id="SensorPAorFLPDoorClosed" di="DI_PA/FLPDoorClosed" textOutTrigValue="false" infoText="" warningText="PA/FLP Door Closed Warning" alarmText=""/>
 		<IoSensor module="System" id="SensorMaintenanceMode" di="DI_RunMode" textOutTrigValue="true" warningText=""/>
 		<IoSensor module="System" id="SensorEFEMPowerON" di="DI_EFEMPowerON" textOutTrigValue="true" warningText=""/>
 		<IoSensor module="System" id="SensorPAEnableToRobot" di="DI_PreAlignerEnableToRobot" textOutTrigValue="true" warningText=""/>
-		<IoSensor module="System" id="SensorRobotEMStoEFEM" di="DI_RobotEMSToEFEM" textOutTrigValue="true" warningText=""/>
+		<IoSensor module="System" id="SensorRobotEMStoEFEM" di="DI_RobotEMSToEFEM" textOutTrigValue="false" infoText="" warningText="" alarmText="Robot EMS To EFEM Alarm"/>
 		<IoSensor module="System" id="SensorRobotTeachingModeToEFEM" di="DI_RobotTeachingModeToEFEM" textOutTrigValue="true" warningText=""/>		
 		
 		<IoSensor module="System" id="SensorRBNotExtendPMA" di="DI_RBNotExtendToPMA" textOutTrigValue="true" warningText=""/>
@@ -30,7 +30,7 @@
 		<IoSensor module="System" id="SensorRBNotExtendSIMF1" di="DI_RBNotExtendToLP1" textOutTrigValue="true" warningText=""/>
 		<IoSensor module="System" id="SensorRBNotExtendSIMF2" di="DI_RBNotExtendToLP2" textOutTrigValue="true" warningText=""/>
 		<IoSensor module="System" id="SensorRBNotExtendPreAligner" di="DI_RBNotExtendPreAligner" textOutTrigValue="true" warningText=""/>
-		<IoSensor module="System" id="SensorRBNotExtendFlipper" di="DI_RBNotExtendFlipper" textOutTrigValue="true" warningText=""/><!--***-->
+		<IoSensor module="System" id="SensorRBNotExtendFlipper" di="DI_RBNotExtendFlipper" textOutTrigValue="true" warningText=""/>
 
 		<IoSensor module="System" id="SensorLP1OperationStatus" di="DI_LP1OperationStatus" textOutTrigValue="true" warningText=""/>
 		<IoSensor module="System" id="SensorLP1FoupOpen" di="DI_LP1FoupOpen" textOutTrigValue="true" warningText=""/>
@@ -43,19 +43,11 @@
 		<IoSensor module="System" id="SensorLP2FoupPlacement" di="DI_LP2FoupPlacement" textOutTrigValue="true" warningText=""/>
 		<IoSensor module="System" id="SensorLP2Ready" di="DI_LP2Ready" textOutTrigValue="true" warningText=""/>
 		<IoSensor module="System" id="SensorLP2Presence" di="DI_LP2Presence" textOutTrigValue="true" warningText=""/>
+		
+		
 	</IoSensors>
 
-	<IoTriggers>			
-		<IoTrigger id="TrigFlipperTurnOverMotor0or180"  display="" schematicId="" unit="" doTrigger="DO_FlipperTurnOverMotor0/180"/>			
-		<IoTrigger id="TrigFlipperTurnOverStepMotionStart"  display="" schematicId="" unit="" doTrigger="DO_FlipperTurnOverStepMotionStart"/>			
-		<IoTrigger id="TrigFlipperTurnOverJOGP"  display="" schematicId="" unit="" doTrigger="DO_FlipperTurnOverJOGP"/>			
-		<IoTrigger id="TrigFlipperTurnOverJOGN"  display="" schematicId="" unit="" doTrigger="DO_FlipperTurnOverJOGN"/>			
-		<IoTrigger id="TrigFlipperTurnOverSetOrigin"  display="" schematicId="" unit="" doTrigger="DO_FlipperTurnOverSetOrigin"/>			
-		<IoTrigger id="TrigFlipperTurnOverALMRST"  display="" schematicId="" unit="" doTrigger="DO_FlipperTurnOverALM-RST"/>			
-		<IoTrigger id="TrigFlipperClampMotorCloseorOpen"  display="" schematicId="" unit="" doTrigger="DO_FlipperClampMotorClose/Open"/>			
-		<IoTrigger id="TrigFlipperClampStepMotionSTART"  display="" schematicId="" unit="" doTrigger="DO_FlipperClampStepMotionSTART"/>			
-		<IoTrigger id="TrigFlipperClampJOGP"  display="" schematicId="" unit="" doTrigger="DO_FlipperClampJOGP"/>			
-		<IoTrigger id="TrigFlipperClampJOGN"  display="" schematicId="" unit="" doTrigger="DO_FlipperClampJOGN"/>			
+	<IoTriggers>						
 		<IoTrigger id="TrigIonizerInterrupt"  display="" schematicId="" unit="" doTrigger="DO_IonizerInterrupt"/>	
 		<IoTrigger id="TrigPauseResumetoRobot"  display="" schematicId="" unit="" doTrigger="DO_Pause/ResumetoRobot"/>
 		<IoTrigger id="TrigSafetytoSMIF1"  display="" schematicId="" unit="" doTrigger="DO_RobotSafetyToLP1"/>
@@ -64,29 +56,29 @@
 		<IoTrigger id="TrigEnableToOperateLP2"  display="" schematicId="" unit="" doTrigger="DO_EnableToOperateLP2"/>
 	</IoTriggers>
 
-	<JetFlippers classType="EfemRT.Devices.Flipper.JetFlipper">
+	<JetFlippers  assembly="EfemRT" classType="EFEM.RT.Devices.Flipper.JetFlipper" IsEnabled = "False">
 		<JetFlipper module="System" id ="TurnOverStation" display="TurnOverStation" schematicId=""
 					diFlipperTurnOverOriginSensor="DI_FlipperTurnOverOriginSensor"
 					diFlipperTurnOverHorizontalSensor="DI_FlipperTurnOverHorizontalSensor"
 					diFlipperTurnOverMotorPosCompleted="DI_FlipperTurnOverMotorPosCompleted"
 					diFlipperTurnOverMotorAlarm="DI_FlipperTurnOverMotorAlarm"
-					diFlipperEnableToRobot="DI_FlipperEnableToRobot"
+					diFlipperEnableToRobot="DI_FlipperSafetyToRobot"
 					diFlipperClampClosedSensor="DI_FlipperClampClosedSensor"
 					diFlipperClampOpenedSensor="DI_FlipperClampOpenedSensor"
 					diFlipperClampMotorPosCompleted="DI_FlipperClampMotorPosCompleted"
 					diFlipperClampMotorAlarm="DI_FlipperClampMotorAlarm"
-					doFlipperTurnOverMotorModeSW="DO_FlipperTurnOverMotorModeSW"
-					doFlipperClampMotorModeSW="DO_FlipperClampMotorModeSW"
-					doFlipperTurnOverStartStop="DO_FlipperTurnOverStartStop/HOME"
-					doFlipperClampSTARTSTOP="DO_FlipperClampSTART-STOP/HOME"
-					doFlipperTurnOverSEL0="DO_FlipperTurnOverSEL0/JOGP"
-					doFlipperTurnOverSEL1="DO_FlipperTurnOverSEL1/JOGN"
-					doFlipperTurnOverSEL2="DO_FlipperTurnOverSEL2/JOG0"
-					doFlipperClampSEL0="DO_FlipperClampSEL0/JOGP"
-					doFlipperClampSEL1="DO_FlipperClampSEL1/JOGN"
-					doFlipperClampSEL2="DO_FlipperClampSEL2/JOG0"
-					doFlipperClampPGMRES="DO_FlipperClampPGMRES/ALM-RST"
-					doFlipperTurnOverPgmres="DO_FlipperTurnOverPgmres/ALM-RST"
+					doFlipperTurnOverMotorModeSW="DO_FlipperTurnOverMotor0/180"
+					doFlipperClampMotorModeSW="DO_FlipperClampMotorClose/Open"
+					doFlipperTurnOverStartStop="DO_FlipperTurnOverStepMotionStart"
+					doFlipperClampSTARTSTOP="DO_FlipperClampStepMotionStart"
+					doFlipperTurnOverSEL0="DO_FlipperTurnOverJOGP"
+					doFlipperTurnOverSEL1="DO_FlipperTurnOverJOGN"
+					doFlipperTurnOverSEL2="DO_FlipperTurnOverSetOrigin"
+					doFlipperClampSEL0="DO_FlipperClampJOGP"
+					doFlipperClampSEL1="DO_FlipperClampJOGN"
+					doFlipperClampSEL2="DO_FlipperClampSetOrigin"
+					doFlipperClampPGMRES="DO_FlipperClampALM-RST"
+					doFlipperTurnOverPgmres="DO_FlipperTurnOverALM-RST"
     />
 	</JetFlippers>
 

+ 2 - 2
Jet/Jet_001_2P_Jet/EfemRT/Config/2LPJet006/_ioDefineCard1.xml

@@ -11,7 +11,7 @@
 		<DI_ITEM Index="23" BufferOffset="23" Addr="DI-23" Name="DI_FlipperClampOpenedSensor" Description="FLIPPER CLAMP OPENED SENSOR"/>
 		<DI_ITEM Index="24" BufferOffset="24" Addr="DI-24" Name="DI_FlipperClampMotorPosCompleted" Description="FLIPPER CLAMP MOTOR   POS COMPLETED"/>
 		<DI_ITEM Index="26" BufferOffset="26" Addr="DI-26" Name="DI_FlipperClampMotorAlarm" Description="FLIPPER CLAMP MOTOR  ALARM"/>
-		<DI_ITEM Index="28" BufferOffset="28" Addr="DI-28" Name="DI_FlipperWaterInPosition" Description="FLIPPER WATER IN POSITION"/> <!--add-->		
+		<DI_ITEM Index="28" BufferOffset="28" Addr="DI-28" Name="DI_FlipperWaterInPosition" Description="FLIPPER WATER IN POSITION"/> 
 		<DI_ITEM Index="30" BufferOffset="30" Addr="DI-30" Name="DI_FFUAlarm" Description="FFU ALARM"/>
 		<DI_ITEM Index="31" BufferOffset="31" Addr="DI-31" Name="DI_CDAPressureSW" Description="CDA Pressure SW"/>
 		<DI_ITEM Index="32" BufferOffset="32" Addr="DI-32" Name="DI_VACPressureSW" Description="VAC Pressure SW"/>
@@ -57,7 +57,7 @@
 		<DO_ITEM Index="20" BufferOffset="20" Addr="DO-20" Name="DO_FlipperTurnOverSetOrigin" Description="FLP TURNOVER SET ORIGIN"/>
 		<DO_ITEM Index="21" BufferOffset="21" Addr="DO-21" Name="DO_FlipperTurnOverALM-RST" Description="FLP TURNOVER ALM-RST"/>
 		<DO_ITEM Index="24" BufferOffset="24" Addr="DO-24" Name="DO_FlipperClampMotorClose/Open" Description="FLP CLAMP MOTOR CLOSE OR OPEN"/>
-		<DO_ITEM Index="25" BufferOffset="25" Addr="DO-25" Name="DO_FlipperClampStepMotionSTART" Description="FLP CLAMP STEP MOTION START"/>
+		<DO_ITEM Index="25" BufferOffset="25" Addr="DO-25" Name="DO_FlipperClampStepMotionStart" Description="FLP CLAMP STEP MOTION START"/>
 		<DO_ITEM Index="26" BufferOffset="26" Addr="DO-26" Name="DO_FlipperClampJOGP" Description="FLP CLAMP JOGP"/>
 		<DO_ITEM Index="27" BufferOffset="27" Addr="DO-27" Name="DO_FlipperClampJOGN" Description="FLP CLAMP JOGN"/>
 		<DO_ITEM Index="28" BufferOffset="28" Addr="DO-28" Name="DO_FlipperClampSetOrigin" Description="FLP CLAMP SET ORIGIN"/>

+ 2 - 2
Jet/Jet_001_2P_Jet/EfemRT/Config/Efem.sccfg

@@ -3,7 +3,7 @@
 	<configs name="System">
 		<config default="001" name="EFEMNUM" description="DeviceType" max="0" min="0" paramter="" tag="" unit="" type="String" />
 		<config default="2LPJet" name="DeviceType" description="DeviceType" max="0" min="0" paramter="" tag="" unit="" type="String" />
-		<config default="true" name="IsSimulatorMode" description="IsSimulatorMode" max="0" min="0" paramter="" tag="" unit="" type="Bool" />
+		<config default="true" name="IsSimulatorMode" description="IsSimulatorMode" max="0" min="0" paramter="" tag="" unit="" type="Bool" />		
 		<config default="false" name="ConfigDO32AsBuzzer" description="ConfigDO32AsBuzzer" max="0" min="0" paramter="" tag="" unit="" type="Bool" />
 		<config default="false" name="ShowWaferID" description="ShowWaferID" max="0" min="0" paramter="" tag="" unit="" type="Bool" />
 		<config default="0" name="TotalWaferCount" description="TotalWaferCount" max="0" min="0" paramter="" tag="" unit="" type="Integer" />
@@ -65,6 +65,7 @@
 		<config default="false" name="Aligner2Disable" description="Aligner2不能使用" max="" min="" paramter="" tag="" unit="" type="Bool" />
 		<config default="false" name="PMADisable" description="PMA不能使用" max="" min="" paramter="" tag="" unit="" type="Bool" />
 		<config default="false" name="PMBDisable" description="PMB不能使用" max="" min="" paramter="" tag="" unit="" type="Bool" />
+		<config default="false" name="FlipperDisable" description="Flipper不能使用" max="" min="" paramter="" tag="" unit="" type="Bool" />
 		<config default="false" name="StopIonizerWorkingEnable" description="停止离子器使能" max="" min="" paramter="" tag="" unit="" type="Bool" />
 		<config default="true" name="LPRobotActionIntervene" description="LP和机械手动作干涉" max="" min="" paramter="" tag="" unit="" type="Bool" />
 		<config default="false" name="IsSlotShowOpposite" description="LP槽号显示" max="" min="" paramter="" tag="" unit="" type="Bool" />
@@ -86,7 +87,6 @@
 		<configs name="LP1">
 			<config default="COM1" name="PortName" description="LP COM串口地址" max="0" min="0" paramter="" tag="" unit="" type="String" />
 			<config default="120" name="TimeLimitAction" description="Time limit for on action" max="99999" min="0" paramter="" tag="" unit="" type="Integer" />
-			<config default="COM1" name="PortName" description="LP COM串口地址" max="0" min="0" paramter="" tag="" unit="" type="String" />
 			<config default="LOT:" name="CarrierIDStartString" description="CarrierIDStartString" max="0" min="0" paramter="" tag="" unit="" type="String" />
 			<config default="QTY:" name="CarrierIDEndString" description="CarrierIDEndString" max="0" min="0" paramter="" tag="" unit="" type="String" />
 			<config default="false" name="AutoDetectCarrierType" description=" " max="0" min="0" paramter="" tag="" unit="" type="Bool" />

+ 69 - 60
Jet/Jet_001_2P_Jet/EfemRT/Devices/DeviceManager.cs

@@ -1,23 +1,15 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Text.RegularExpressions;
-using System.Xml;
-using Aitex.Common.Util;
-using Aitex.Core.Backend;
+using Aitex.Common.Util;
 using Aitex.Core.RT.DataCenter;
 using Aitex.Core.RT.Device;
 using Aitex.Core.RT.Device.Unit;
 using Aitex.Core.RT.Event;
-using Aitex.Core.RT.IOCore;
 using Aitex.Core.RT.Log;
 using Aitex.Core.RT.OperationCenter;
 using Aitex.Core.RT.SCCore;
 using Aitex.Core.Util;
- 
 using Aitex.Sorter.Common;
 using EFEM.RT.Devices.Aligner;
+using EFEM.RT.Devices.Flipper;
 using EFEM.RT.Devices.LoadPorts.Fortrend;
 using EFEM.RT.Devices.LoadPorts.JetOpenCst;
 using EFEM.RT.Devices.LoadPorts.SmartTagReader;
@@ -29,22 +21,18 @@ using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.BufferStations;
 using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.CarrierIdReaders.CarrierIDReaderBase;
 using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.CarrierIdReaders.OmronBarcode;
 using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.CarrierIdReaders.OmronRFID;
-using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.CarrierIdReaders.OmronV640;
 using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.FFUs.AAF;
-using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts;
-using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts.HirataII;
 
 //using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts.Fortrend;
 using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts.LoadPortBase;
-using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts.SMIF;
-using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts.TDK;
-using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.OcrReaders;
-using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robot;
-using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.JEL;
 using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.RobotBase;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.RegularExpressions;
+using System.Xml;
 
 //using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.Rorze;
-using SorterCommon;
 
 namespace EFEM.RT.Devices
 {
@@ -63,8 +51,10 @@ namespace EFEM.RT.Devices
         private static readonly int LoadLockQuantity = DeviceDefineManager.Instance.GetValue<int>("LoadLockQuantity") ?? 0;
         private static readonly int BufferQuantity = DeviceDefineManager.Instance.GetValue<int>("BufferQuantity") ?? 0;
         private static readonly int LoadLockSlot = DeviceDefineManager.Instance.GetValue<int>("LoadLockSlot") ?? 0;
+
         //private static readonly int BufferSlot = DeviceDefineManager.Instance.GetValue<int>("BufferSlot") ?? 0;
         private static readonly bool LoadLockDoorControlByStation = DeviceDefineManager.Instance.GetValue<bool>("LLDoorControlByStation") ?? false;
+
         //private static readonly bool DmcCardUsed = DeviceDefineManager.Instance.GetValue<bool>("DmcCardInstalled") ?? false;
         private static readonly bool DisableSignalTower = DeviceDefineManager.Instance.GetValue<bool>("DisableSignalTower") ?? false;
 
@@ -77,11 +67,13 @@ namespace EFEM.RT.Devices
         private static readonly bool PMBIsDisable = SC.ContainsItem("System.PMBDisable") ? SC.GetValue<bool>("System.PMBDisable") : true;
         private static readonly bool CoolingBuffer1IsDisable = SC.ContainsItem("System.CoolingBuffer1Disable") ? SC.GetValue<bool>("System.CoolingBuffer1Disable") : true;
         private static readonly bool CoolingBuffer2IsDisable = SC.ContainsItem("System.CoolingBuffer2Disable") ? SC.GetValue<bool>("System.CoolingBuffer2Disable") : true;
+        private static readonly bool FlipperIsDisable = SC.ContainsItem("System.FlipperDisable") ? SC.GetValue<bool>("System.FlipperDisable") : true;
         private static readonly bool LoadPort1IsDisable = SC.ContainsItem("LoadPort.LP1.Disable") ? SC.GetValue<bool>("LoadPort.LP1.Disable") : true;
         private static readonly bool LoadPort2IsDisable = SC.ContainsItem("LoadPort.LP2.Disable") ? SC.GetValue<bool>("LoadPort.LP2.Disable") : true;
 
         private static readonly string RobotType = SC.ContainsItem("Robot.RobotType") ? SC.GetStringValue("Robot.RobotType") : "None";
         public string[] CarrierIdReader => _carrierIdReader.Take(LoadPortQuantity).ToArray();
+
         private readonly string[] _carrierIdReader =
         {
             "CarrierIdReader",
@@ -97,6 +89,7 @@ namespace EFEM.RT.Devices
         };
 
         public string[] CarrierRfidReader => _carrierRfidReader.Take(LoadPortQuantity).ToArray();
+
         private readonly string[] _carrierRfidReader =
         {
             "RFID",
@@ -110,7 +103,9 @@ namespace EFEM.RT.Devices
             "RFID",
             "RFID"
         };
+
         public string[] BarcodeIdReaderName => _barcodeIdReaderName.Take(LoadPortQuantity).ToArray();
+
         private readonly string[] _barcodeIdReaderName = new[]
             {
                 "BarcodeReaderA",
@@ -124,9 +119,10 @@ namespace EFEM.RT.Devices
                 "BarcodeReaderI",
                 "BarcodeReaderJ",
                 "BarcodeReaderK",
-
             };
+
         public string[] BufferNames => _bufferNames.Take(BufferQuantity).ToArray();
+
         private readonly string[] _bufferNames =
         {
             DeviceName.Buffer1,
@@ -135,7 +131,9 @@ namespace EFEM.RT.Devices
             DeviceName.Buffer4,
             DeviceName.Buffer5
         };
+
         public IEnumerable<ModuleName> LpNames => _lpNames.Take(LoadPortQuantity);
+
         private readonly ModuleName[] _lpNames =
         {
             ModuleName.LP1, ModuleName.LP2, ModuleName.LP3, ModuleName.LP4, ModuleName.LP5, ModuleName.LP6,
@@ -143,6 +141,7 @@ namespace EFEM.RT.Devices
         };
 
         private string[] CarrierIdReaderPortScName => _carrierIdReaderPortScName.Take(LoadPortQuantity).ToArray();
+
         private readonly string[] _carrierIdReaderPortScName =
         {
             SorterCommon.ScPathName.LoadPort_LoadPort1CarrierIdReaderPortName,
@@ -184,7 +183,7 @@ namespace EFEM.RT.Devices
             EFEMSC.ScPathName.LoadPort_LoadPort9CarrierIdReaderPage,
             EFEMSC.ScPathName.LoadPort_LoadPort10CarrierIdReaderPage
         };
-            
+
         private readonly string[] _rfidNames =
         {
             DeviceName.RFIDReaderA,
@@ -197,9 +196,10 @@ namespace EFEM.RT.Devices
             DeviceName.RFIDReaderH,
             DeviceName.RFIDReaderI,
             DeviceName.RFIDReaderJ
-
         };
+
         public string[] LpPortNameSc => _lpPortNameSc.Take(LoadPortQuantity).ToArray();
+
         private readonly string[] _lpPortNameSc =
         {
             EFEMSC.ScPathName.LoadPort_LoadPort1PortName,
@@ -215,6 +215,7 @@ namespace EFEM.RT.Devices
         };
 
         public string[] LLNames => _llNames.Take(LoadLockQuantity).ToArray();
+
         private readonly string[] _llNames =
         {
             DeviceName.LL1,
@@ -226,9 +227,11 @@ namespace EFEM.RT.Devices
             DeviceName.LL7,
             DeviceName.LL8
         };
+
         private char[] rfidInstallment;
         private char[] carrierIdInstallment;
         private char[] e84Support;
+
         public bool IsAnyLPIdle()
         {
             return LpNames.Any(moduleName => DEVICE.GetDevice<LoadPortBaseDevice>(moduleName.ToString()).IsIdle);
@@ -244,6 +247,7 @@ namespace EFEM.RT.Devices
             var lp = LpNames.Select(lpName => DEVICE.GetDevice<LoadPortBaseDevice>(lpName.ToString())).ToList();
             return lp.ToArray();
         }
+
         public CIDReaderBaseDevice GetGeneralBarcodeReader(string lp)
         {
             string pattern = "[1-9]\\d*";
@@ -256,6 +260,7 @@ namespace EFEM.RT.Devices
             //var index = Array.IndexOf(LpNames.ToArray(), lp);
             //return DEVICE.GetDevice<GeneralBarcodeReader>(lp + "." + _barcodeIdReaderName[index]);
         }
+
         private OmronBarcodeReader GetBarcodeReader(string lp)
         {
             var index = Array.IndexOf(LpNames.ToArray(), lp);
@@ -313,7 +318,7 @@ namespace EFEM.RT.Devices
                 DeviceModel.SensorRBNotExtendSIMF1,
                 DeviceModel.SensorRBNotExtendSIMF2,
             };
-            IoSensor[] GirdSensor=
+            IoSensor[] GirdSensor =
             {
                 DeviceModel.SensorRBNotExtendSIMF1,
                 DeviceModel.SensorRBNotExtendSIMF2,
@@ -340,10 +345,9 @@ namespace EFEM.RT.Devices
                   DeviceModel.SensorCstDoorClosed,
                   DeviceModel.SensorRBNotExtendSIMF1,
                   DeviceModel.SensorRobotRemotetoEFEM,
-
               },
             };
-           
+
             var barcodeIdReaderName = new[]
             {
                 "BarcodeReaderA",
@@ -357,7 +361,6 @@ namespace EFEM.RT.Devices
                 "BarcodeReaderI",
                 "BarcodeReaderJ",
                 "BarcodeReaderK",
-
             };
             IoTrigger[][] LPTriggerArry =
             {
@@ -380,6 +383,7 @@ namespace EFEM.RT.Devices
                     robot = new RorzeRobot751(ModuleName.System.ToString(), DeviceName.Robot, "Robot", null, null);
                     AddCustomDevice(robot, "Robot", robot.GetType());
                     break;
+
                 default:
                     robot = new RorzeRobot751(ModuleName.System.ToString(), DeviceName.Robot, "Robot", null, null);
                     AddCustomDevice(robot, "Robot", robot.GetType());
@@ -388,8 +392,8 @@ namespace EFEM.RT.Devices
             //LoadPort Device Initialize
             for (int i = 0; i < LoadPortMaxQuantity; i++)
             {
-                if(!SC.ContainsItem($"LoadPort.LP{i + 1}.Disable")) continue;
-                if(!SC.GetValue<bool>($"LoadPort.LP{i + 1}.Disable"))
+                if (!SC.ContainsItem($"LoadPort.LP{i + 1}.Disable")) continue;
+                if (!SC.GetValue<bool>($"LoadPort.LP{i + 1}.Disable"))
                 {
                     if (SC.GetValue<int>($"LoadPort.LP{i + 1}.CstType") == 0)
                     {
@@ -431,12 +435,13 @@ namespace EFEM.RT.Devices
                 switch (SC.GetValue<int>("Aligner.AlignerType"))
                 {
                     case 1://Aligner with Pin
-                        
+
                         break;
+
                     default://Aligner without Pin
                         AddCustomDevice(new MechanicalAligner(ModuleName.System, ModuleName.Aligner1, 1), "Aligner1", typeof(MechanicalAligner));
                         break;
-                }                    
+                }
             }
             if (!Aligner2IsDisable)
             {
@@ -445,20 +450,12 @@ namespace EFEM.RT.Devices
                     case 1://Aligner with Pin
                         //AddCustomDevice(new RorzePreAligner(ModuleName.System.ToString(), "Aligner2", "Aligner2", "", ""), "Aligner2", typeof(PreAligner));
                         break;
+
                     default://Aligner without Pin
                         AddCustomDevice(new MechanicalAligner(ModuleName.System, ModuleName.Aligner2, 1), "Aligner2", typeof(MechanicalAligner));
                         break;
                 }
-                Singleton<WaferManager>.Instance.SubscribeLocation(ModuleName.Aligner2, 1);    
-            }
-            //FFU Device Initialize
-            if (DeviceDefineManager.Instance.GetValue<bool>("FfuMemoBusControl") ?? false)
-            { 
-                var comPort = SC.GetStringValue("System.FFUComPortName");
-                var ffu1 = new Ffu("","FFU1", "01", comPort);
-                AddCustomDevice(ffu1, "FFU", typeof(Ffu));
-                var ffu2 = new Ffu("","FFU2", "02", comPort);
-                AddCustomDevice(ffu2, "FFU", typeof(Ffu));
+                Singleton<WaferManager>.Instance.SubscribeLocation(ModuleName.Aligner2, 1);
             }
             //PM Device Initialize
             if (!PMAIsDisable)
@@ -489,7 +486,16 @@ namespace EFEM.RT.Devices
                 BufferStation buffer = new Buffer("System", _bufferNames[1], Buffer2SlotCount, llDoorOpen[1]);//Normal Buffer
                 AddCustomDevice(buffer, "BufferStation", buffer.GetType());
             }
-
+            //Flipper Device Initialize
+            if (FlipperIsDisable)
+            {
+                //JetFlipper jetFlipper = new JetFlipper(ModuleName.System.ToString(), "Flipper", "Flipper", null, null);
+                //AddCustomDevice(jetFlipper, "Flipper", typeof(JetFlipper));
+            }
+            //SignalTower Initialize
+            if (!DisableSignalTower)
+            {
+            }
             //SignalTower Initialize
             if (DisableSignalTower)
             {
@@ -501,16 +507,23 @@ namespace EFEM.RT.Devices
             foreach (var nodeModelChild in DeviceModelNodes.ChildNodes)
             {
                 XmlElement nodeDevices = nodeModelChild as XmlElement;
- 
             }
-
-            var SorterFFU = new FfuAAF("FFU", "FFU", "System",1);
+            //FFU Initialize(in use)
+            var SorterFFU = new FfuAAF("FFU", "FFU", "System", 1);
             SorterFFU.Initialize();
-
+            //FFU12 Device Initialize
+            if (DeviceDefineManager.Instance.GetValue<bool>("FfuMemoBusControl") ?? false)
+            {
+                var comPort = SC.GetStringValue("System.FFUComPortName");
+                var ffu1 = new Ffu("", "FFU1", "01", comPort);
+                AddCustomDevice(ffu1, "FFU", typeof(Ffu));
+                var ffu2 = new Ffu("", "FFU2", "02", comPort);
+                AddCustomDevice(ffu2, "FFU", typeof(Ffu));
+            }
 
             OP.Subscribe(OperationName.ResetDevice, InvokeResetDevice);
             OP.Subscribe(OperationName.DeviceOperation, InvokeDeviceOperation);
-            
+
             OP.Subscribe(OperationName.SetManualScanCode, InvokeSetManualScanCode);
             OP.Subscribe(OperationName.Scan, InvokeScan);
             OP.Subscribe(OperationName.Write, InvokeWrite);
@@ -522,18 +535,18 @@ namespace EFEM.RT.Devices
             robot.OnSlotMapRead += Robot_OnSlotMapRead;
 
             return true;
-        }        
+        }
 
         private bool InvokeWrite(string arg1, object[] args)
         {
-            if (!(GetRfidReader(args[0].ToString()).Write(args[1].ToString(),out string reason)))
+            if (!(GetRfidReader(args[0].ToString()).Write(args[1].ToString(), out string reason)))
             {
-                EV.PostWarningLog(args[0].ToString(),$"fail to write RFID, {reason}");
+                EV.PostWarningLog(args[0].ToString(), $"fail to write RFID, {reason}");
                 return false;
             }
             return true;
         }
-        
+
         private bool InvokeWriteRfid(string arg1, object[] arg2)
         {
             if (!GetRfidReader(arg2[0].ToString()).Write(arg2[1].ToString(), out var reason))
@@ -554,17 +567,16 @@ namespace EFEM.RT.Devices
             }
             return true;
         }
-        
 
         private bool InvokeScan(string arg1, object[] args)
         {
-            if (SC.GetValue<bool>($"LoadPort.{args[0].ToString()}.ExternalSmartTagReader") && SC.GetValue<int>($"LoadPort.{args[0].ToString()}.CstType")==0)
+            if (SC.GetValue<bool>($"LoadPort.{args[0].ToString()}.ExternalSmartTagReader") && SC.GetValue<int>($"LoadPort.{args[0].ToString()}.CstType") == 0)
             {
                 var lp = DEVICE.GetDevice<LoadPortBaseDevice>(args[0].ToString());
                 return lp.ReadCarrierID();//lp.ReadCarrierID(
             }
             else
-            { 
+            {
                 var lp = DEVICE.GetDevice<LoadPortBaseDevice>(args[0].ToString());
                 return lp.ReadCarrierIDByIndex(new object[] { 0 });//lp.ReadCarrierID();
             }
@@ -573,7 +585,7 @@ namespace EFEM.RT.Devices
         private bool InvokeSetManualScanCode(string arg1, object[] args)
         {
             var lp = DEVICE.GetDevice<LoadPortBaseDevice>(args[0].ToString());
-             lp.OnCarrierIdRead(args[1].ToString());
+            lp.OnCarrierIdRead(args[1].ToString());
             return true;
         }
 
@@ -603,10 +615,10 @@ namespace EFEM.RT.Devices
             var func = "";
             try
             {
-                name = (string) args[0];
-                func = (string) args[1];
+                name = (string)args[0];
+                func = (string)args[1];
 
-                if ((bool) DATA.Poll(ModuleName.System.ToString(), ParamName.IsMaintenanceMode))
+                if ((bool)DATA.Poll(ModuleName.System.ToString(), ParamName.IsMaintenanceMode))
                 {
                     EV.PostMessage("System", EventEnum.DefaultWarning,
                         string.Format("System in maintenance, can not execute {0}{1}", name, func));
@@ -633,7 +645,6 @@ namespace EFEM.RT.Devices
                 {
                     DeviceCmd(name, func, param);
                 }
-                
             }
             catch (Exception ex)
             {
@@ -643,7 +654,6 @@ namespace EFEM.RT.Devices
                 return false;
             }
 
-
             return true;
         }
 
@@ -658,6 +668,5 @@ namespace EFEM.RT.Devices
         {
             DEVICE.Do(string.Format("{0}.{1}", name, cmd), 0, true, args);
         }
- 
     }
 }

+ 202 - 169
Jet/Jet_001_2P_Jet/EfemRT/Devices/EquipmentMonitor.cs

@@ -1,19 +1,18 @@
-using Aitex.Core.RT.DataCenter;
-using Aitex.Core.RT.Device;
+using Aitex.Core.RT.Device;
 using Aitex.Core.RT.Event;
 using Aitex.Core.RT.Log;
+using Aitex.Core.RT.Routine;
 using Aitex.Core.RT.SCCore;
 using Aitex.Core.Util;
 using EFEM.RT.Modules;
 
 using MECF.Framework.Common.Equipment;
-using MECF.Framework.Common.SubstrateTrackings;
 using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts.LoadPortBase;
 
 namespace EFEM.RT.Devices
 {
     public class EquipmentMonitor : BaseDevice, IDevice
-    {   
+    {
         private readonly RD_TRIG _trigMaintenance = new RD_TRIG();
         private readonly RD_TRIG _airForRobotTrig = new RD_TRIG();
         private readonly RD_TRIG _airForLoadPortTrig = new RD_TRIG();
@@ -41,7 +40,10 @@ namespace EFEM.RT.Devices
 
         private readonly bool _MaintenanceMode = DeviceDefineManager.Instance.GetValue<bool>("MaintenanceSignal") ?? false;
         private readonly bool _EfemDoorOpen = DeviceDefineManager.Instance.GetValue<bool>("EfemDoorOpenSignal") ?? false;
-       
+
+        private static readonly bool LoadPort1IsDisable = SC.ContainsItem("LoadPort.LP1.Disable") ? SC.GetValue<bool>("LoadPort.LP1.Disable") : true;
+        private static readonly bool LoadPort2IsDisable = SC.ContainsItem("LoadPort.LP2.Disable") ? SC.GetValue<bool>("LoadPort.LP2.Disable") : true;
+
         private readonly RD_TRIG _trigWaterLeakNormalTOPM = new RD_TRIG();
         private readonly RD_TRIG _trigCDAPressureOKTOPM = new RD_TRIG();
 
@@ -54,14 +56,16 @@ namespace EFEM.RT.Devices
         private uint data2;
 
         private int _fFUSettingKnob;
-        private readonly int[] _speedTable = new[] { 0,200,300,400,500,550,600,650,700,750,800 };
+        private readonly int[] _speedTable = new[] { 0, 200, 300, 400, 500, 550, 600, 650, 700, 750, 800 };
+
         public int IONCDAPressureSWHandler
         {
-            get 
+            get
             {
                 return SC.GetValue<int>("System.IONCDAPressureSWHandler");
             }
         }
+
         public int IONAlarmSIGNALHandler
         {
             get
@@ -69,6 +73,7 @@ namespace EFEM.RT.Devices
                 return SC.GetValue<int>("System.IONAlarmSIGNALHandler");
             }
         }
+
         public int WaterFlowSWHandler
         {
             get
@@ -76,6 +81,7 @@ namespace EFEM.RT.Devices
                 return SC.GetValue<int>("System.WaterFlowSWHandler");
             }
         }
+
         public RD_TRIG TrigMaintenance
         {
             get
@@ -124,7 +130,6 @@ namespace EFEM.RT.Devices
             }
         }
 
-
         public RD_TRIG SensorFlowWarning
         {
             get
@@ -132,6 +137,7 @@ namespace EFEM.RT.Devices
                 return _flowWarningTrig;
             }
         }
+
         public RD_TRIG LeakWarningTrig
         {
             get
@@ -140,7 +146,6 @@ namespace EFEM.RT.Devices
             }
         }
 
-
         public R_TRIG SignalTowerTrig
         {
             get
@@ -148,12 +153,14 @@ namespace EFEM.RT.Devices
                 return signalTowerTrig;
             }
         }
+
         public enum HandlerState
         {
             ByPass,
             ON,
             OFF
         }
+
         public EquipmentMonitor() :
             base("System", "EquipmentMonitor", "EquipmentMonitor", "EquipmentMonitor")
         {
@@ -165,81 +172,64 @@ namespace EFEM.RT.Devices
             //{
             //    DeviceModel.TrigLEDLight.SetTrigger(true, out _);
             //}
- 
-                Subscriptions();
+
+            Subscriptions();
             return true;
         }
 
         private bool _StopIonizerWork;
+
         public bool StopIonizerWork
         {
             get
-            {  
-                if(SC.ContainsItem("System.StopIonizerWorkingEnable"))
-                   return SC.GetValue<bool>("System.StopIonizerWorkingEnable");
+            {
+                if (SC.ContainsItem("System.StopIonizerWorkingEnable"))
+                    return SC.GetValue<bool>("System.StopIonizerWorkingEnable");
                 return false;
             }
             set
-            { 
-                _StopIonizerWork = value; 
+            {
+                _StopIonizerWork = value;
             }
         }
 
         private readonly R_TRIG _trigStopIonizerAtFirst = new R_TRIG();
+
         public void Monitor()
         {
-            if (!_noMaintenanceSignal && !_noNoDoorOpenSignal)
-            {
-                _trigMaintenance.CLK = (_MaintenanceMode ? DeviceModel.SensorMaintenanceMode.Value : !DeviceModel.SensorMaintenanceMode.Value)
-                                           || (_EfemDoorOpen ? DeviceModel.SensorEFEMSideDoorClosed.Value : !DeviceModel.SensorEFEMSideDoorClosed.Value)
-                                           /*|| DeviceModel.SensorTeachingPendantInUse.Value*/;
-            }
-
             if (_flowWarningTrig.T) EV.PostMessage("System", EventEnum.DefaultAlarm, "Flow Warning");
             if (_leakWarningTrig.R) EV.PostMessage("System", EventEnum.DefaultAlarm, "Leak Warning");
-
             if (_airForRobotTrig.R) EV.PostMessage("System", EventEnum.DefaultAlarm, "Air supply for Robot pressure error");
             if (_airForLoadPortTrig.R) EV.PostMessage("System", EventEnum.DefaultAlarm, "Air supply for Load Port pressure error");
             if (_vacuumErrorTrig.R) EV.PostMessage("System", EventEnum.DefaultAlarm, "Vacuum supply for system pressure error");
+            if (_airForRobotTrig.R || _airForLoadPortTrig.R || _vacuumErrorTrig.R)
+                Singleton<RouteManager>.Instance.PostMsg(RouteManager.MSG.ERROR);
             //if (_ffu1ErrorTrig.R) EV.PostMessage("System", EventEnum.DefaultAlarm, "FFU1 error");
             //if (_ffu2ErrorTrig.R) EV.PostMessage("System", EventEnum.DefaultAlarm, "FFU1 error");
-            if(_airForRobotTrig.R || _airForLoadPortTrig.R || _vacuumErrorTrig.R)
-                Singleton<RouteManager>.Instance.PostMsg(RouteManager.MSG.ERROR);
-            
-            if (_trigMaintenance.R) Singleton<RouteManager>.Instance.PostMsg(RouteManager.MSG.SetMaintenanceMode);
+            //_fFUSettingKnob = SC.ContainsItem("System.FFUSpeedSet") ? SC.GetValue<int>("System.FFUSpeedSet") : 3;
+            //DeviceModel.TrigRobotAndPreAlignerHold.SetTrigger(!_trigMaintenance.M, out _);
+            //_trigRobotWafer.CLK = DeviceModel.SensorRobotFork1WaferOn.Value;
 
-            if (_trigMaintenance.T) Singleton<RouteManager>.Instance.PostMsg(RouteManager.MSG.SetManualMode);
+            #region Seperate Monitor for EFEM Num
 
-            if (SC.GetStringValue("System.EFEMNUM") == "005")
-            {
-                _trigWaterLeakNormalTOPM.CLK = DeviceModel.SensorEFEMPowerON.Value && DeviceModel.SensorWaterLeakSW.Value;
-                if (_trigWaterLeakNormalTOPM.R)
-                {
-                    DeviceModel.TrigWaterLeakOkToPM.SetTrigger(true, out _);
-                }
-                if (_trigWaterLeakNormalTOPM.T)
-                {
-                    DeviceModel.TrigWaterLeakOkToPM.SetTrigger(false, out _);
-                }
+            string efemNum = SC.GetStringValue("System.EFEMNUM") ?? "";
+            MonitorByEfemNum(efemNum);
 
-                _trigCDAPressureOKTOPM.CLK = DeviceModel.SensorEFEMPowerON.Value && DeviceModel.SensorCDAPressureSW.Value;
-                if (_trigCDAPressureOKTOPM.R)
-                {
-                    DeviceModel.TrigCDAPressureOkToPM.SetTrigger(true, out _);
-                }
-                if (_trigCDAPressureOKTOPM.T)
-                {
-                    DeviceModel.TrigCDAPressureOkToPM.SetTrigger(false, out _);
-                }
-            }
+            #endregion Seperate Monitor for EFEM Num
 
-            _fFUSettingKnob = SC.ContainsItem("System.FFUSpeedSet") ? SC.GetValue<int>("System.FFUSpeedSet") : 3;
+            #region Common Monitor
 
-            //DeviceModel.TrigRobotAndPreAlignerHold.SetTrigger(!_trigMaintenance.M, out _);
-            //_trigRobotWafer.CLK = DeviceModel.SensorRobotFork1WaferOn.Value;
- 
-            _trigStopIonizerAtFirst.CLK = true;
+            //Maintance Mode监控
+            if (!_noMaintenanceSignal && !_noNoDoorOpenSignal)
+            {
+                _trigMaintenance.CLK = (_MaintenanceMode ? DeviceModel.SensorMaintenanceMode.Value : !DeviceModel.SensorMaintenanceMode.Value)
+                                           || (_EfemDoorOpen ? DeviceModel.SensorEFEMSideDoorClosed.Value : !DeviceModel.SensorEFEMSideDoorClosed.Value)
+                                           /*|| DeviceModel.SensorTeachingPendantInUse.Value*/;
+            }
+            if (_trigMaintenance.R) Singleton<RouteManager>.Instance.PostMsg(RouteManager.MSG.SetMaintenanceMode);
+            if (_trigMaintenance.T) Singleton<RouteManager>.Instance.PostMsg(RouteManager.MSG.SetManualMode);
 
+            _trigStopIonizerAtFirst.CLK = true;
             if (_trigStopIonizerAtFirst.Q)
             {
                 //if (DeviceModel.TrigIonizerInterrupt!=null&& SC.ContainsItem("System.StopIonizerWorkingEnable"))
@@ -247,7 +237,7 @@ namespace EFEM.RT.Devices
                 //    if (DeviceModel.TrigIonizerInterrupt.Value != SC.GetValue<bool>("System.StopIonizerWorkingEnable"))
                 //        SC.SetItemValue("System.StopIonizerWorkingEnable", DeviceModel.TrigIonizerInterrupt.Value);
                 //}
-                if (SC.GetValue<int>("LoadPort.LP1.CstType")==1)
+                if (SC.GetValue<int>("LoadPort.LP1.CstType") == 1)
                 {
                     if (DeviceModel.SensorCstDoorClosed.Value && !DEVICE.GetDevice<LoadPortBaseDevice>(ModuleName.LP1.ToString()).IsWaferProtrude)
                     {
@@ -256,7 +246,7 @@ namespace EFEM.RT.Devices
                 }
             }
 
-
+            //IonizerInterrupt 监控
             if (DeviceModel.TrigIonizerInterrupt != null && !DeviceModel.TrigIonizerInterrupt.Value)
             {
                 //_trigIONAlarmSIGNAL.CLK = DeviceModel.SensorIONAlarmSIGNAL == null ? false : !DeviceModel.SensorIONAlarmSIGNAL.Value;
@@ -275,6 +265,7 @@ namespace EFEM.RT.Devices
                             }
                         }
                         break;
+
                     case (int)HandlerState.OFF:
                         {
                             _trigIONAlarmSIGNALON.CLK = !DeviceModel.SensorIONAlarmSIGNAL.Value;
@@ -285,20 +276,16 @@ namespace EFEM.RT.Devices
                         }
                         break;
                 }
-              
             }
-            //else
-            //    _trigIONAlarmSIGNAL.RST = true;
-
             if (DeviceModel.TrigIonizerInterrupt != null && DeviceModel.TrigIonizerInterrupt.Value != StopIonizerWork)
-            {     
-                  DeviceModel.TrigIonizerInterrupt.SetTrigger(StopIonizerWork, out _);
+            {
+                DeviceModel.TrigIonizerInterrupt.SetTrigger(StopIonizerWork, out _);
             }
-                      
 
+            //Online Mode 监控
             if (Singleton<EfemEntity>.Instance.IsOnlineMode)
             {
-                if(_trigMaintenance.R || _trigMaintenance.T ||
+                if (_trigMaintenance.R || _trigMaintenance.T ||
                 _airForLoadPortTrig.R || _airForLoadPortTrig.T ||
                 _airForRobotTrig.R || _airForRobotTrig.T ||
                 _vacuumErrorTrig.R || _vacuumErrorTrig.T ||
@@ -313,6 +300,7 @@ namespace EFEM.RT.Devices
                 }
             }
 
+            //IONCDAPressureSW 监控
             if (DeviceModel.SensorIONCDAPressureSW != null)
             {
                 switch (IONCDAPressureSWHandler)
@@ -326,6 +314,7 @@ namespace EFEM.RT.Devices
                             }
                         }
                         break;
+
                     case (int)HandlerState.OFF:
                         {
                             _trigIONCDAPressureOFF.CLK = !DeviceModel.SensorIONCDAPressureSW.Value;
@@ -337,8 +326,9 @@ namespace EFEM.RT.Devices
                         break;
                 }
             }
-                
-            if(DeviceModel.SensorWaterFlowSW != null)
+
+            //WaterFlowSW 监控
+            if (DeviceModel.SensorWaterFlowSW != null)
             {
                 switch (WaterFlowSWHandler)
                 {
@@ -351,6 +341,7 @@ namespace EFEM.RT.Devices
                             }
                         }
                         break;
+
                     case (int)HandlerState.OFF:
                         {
                             _trigWaterFlowSWOFF.CLK = !DeviceModel.SensorWaterFlowSW.Value;
@@ -362,7 +353,8 @@ namespace EFEM.RT.Devices
                         break;
                 }
             }
-            
+
+            //SignalTower监控
             if (signalTowerTrig.Q)
             {
                 data2 = Singleton<EfemEntity>.Instance.GetSigStatData2(ModuleName.System);
@@ -371,102 +363,7 @@ namespace EFEM.RT.Devices
                     Singleton<EfemEntity>.Instance.SendSigStatEvent(ModuleName.System);
             }
 
-            //DO_RobotSafetyToLP1触发逻辑
-            //if (DeviceModel.SensorLP1OperationStatus != null && DeviceModel.SensorLP1FoupOpen != null && DeviceModel.SensorLP1FoupPlacement != null && DeviceModel.SensorLP1Presence != null 
-            //    && DeviceModel.SensorLP1Ready != null && DeviceModel.SensorRobotEMStoEFEM != null && DeviceModel.SensorGratingSensorIN1 != null && DeviceModel.TrigSafetytoSMIF1 != null)
-            //{
-            //    if (DeviceModel.SensorLP1OperationStatus.Value && DeviceModel.SensorLP1FoupOpen.Value && DeviceModel.SensorLP1FoupPlacement.Value
-            //        && DeviceModel.SensorLP1Presence.Value && DeviceModel.SensorLP1Ready.Value
-            //        && DeviceModel.SensorRobotEMStoEFEM.Value && DeviceModel.SensorGratingSensorIN1.Value)
-            //    {
-            //        if (!DeviceModel.TrigSafetytoSMIF1.Value)
-            //        {
-            //            DeviceModel.TrigSafetytoSMIF1.SetTrigger(true, out _);
-            //            LOG.Write("Sensor LP1 related signal change,set DO_RobotSafetyToLP1 signal on.");
-            //        }
-                        
-            //    }
-            //    else
-            //    {
-            //        if (DeviceModel.TrigSafetytoSMIF1.Value)
-            //        {
-            //            DeviceModel.TrigSafetytoSMIF1.SetTrigger(false, out _);
-            //            LOG.Write("Sensor LP1 related signal change,set DO_RobotSafetyToLP1 signal off.");
-            //        }      
-            //    }
-            //}
-
-            //DO_RobotSafetyToLP2触发逻辑
-            //if (DeviceModel.SensorLP2OperationStatus != null && DeviceModel.SensorLP2FoupOpen != null && DeviceModel.SensorLP2FoupPlacement != null && DeviceModel.SensorLP2Presence != null 
-            //    && DeviceModel.SensorLP2Ready != null && DeviceModel.SensorRobotEMStoEFEM != null && DeviceModel.SensorGratingSensorIN1 != null && DeviceModel.TrigSafetytoSMIF2 != null)
-            //{
-            //    if (DeviceModel.SensorLP2OperationStatus.Value && DeviceModel.SensorLP2FoupOpen.Value && DeviceModel.SensorLP2FoupPlacement.Value
-            //        && DeviceModel.SensorLP2Presence.Value && DeviceModel.SensorLP2Ready.Value
-            //        && DeviceModel.SensorRobotEMStoEFEM.Value && DeviceModel.SensorGratingSensorIN1.Value)
-            //    {
-            //        if (!DeviceModel.TrigSafetytoSMIF2.Value)
-            //        {
-            //            DeviceModel.TrigSafetytoSMIF2.SetTrigger(true, out _);
-            //            LOG.Write("Sensor LP2 related signal change,set DO_RobotSafetyToLP2 signal on.");
-            //        }                   
-            //    }
-            //    else
-            //    {
-            //        if (DeviceModel.TrigSafetytoSMIF2.Value)
-            //        {
-            //            DeviceModel.TrigSafetytoSMIF2.SetTrigger(false, out _);
-            //            LOG.Write("Sensor LP2 related signal change,set DO_RobotSafetyToLP2 signal off.");
-            //        }
-                    
-            //    }
-            //}
-                
-            //DO_EnableToOperateLP1触发逻辑
-            if(DeviceModel.TrigEnableToOperateLP1 != null)
-            {
-                if (SC.ContainsItem("LoadPort.LP1.Disable") ? !SC.GetValue<bool>("LoadPort.LP1.Disable") : false
-                && Singleton<RouteManager>.Instance.IsRunning)
-                {
-                    if (!DeviceModel.TrigEnableToOperateLP1.Value)
-                    {
-                        DeviceModel.TrigEnableToOperateLP1.SetTrigger(true, out _);
-                        LOG.Write("Sensor LP1 related signal change,set DO_EnableToOperateLP1 signal on.");
-                    }
-                        
-                }
-                else
-                {
-                    if (DeviceModel.TrigEnableToOperateLP1.Value)
-                    {
-                        DeviceModel.TrigEnableToOperateLP1.SetTrigger(false, out _);
-                        LOG.Write("Sensor LP1 related signal change,set DO_EnableToOperateLP1 signal on.");
-                    }
-                        
-                }
-            }
-
-            //DO_EnableToOperateLP2触发逻辑
-            if (DeviceModel.TrigEnableToOperateLP2 != null)
-            {
-                if (SC.ContainsItem("LoadPort.LP2.Disable") ? !SC.GetValue<bool>("LoadPort.LP2.Disable") : false
-                && Singleton<RouteManager>.Instance.IsRunning)
-                {
-                    if (!DeviceModel.TrigEnableToOperateLP2.Value)
-                    {
-                        DeviceModel.TrigEnableToOperateLP2.SetTrigger(true, out _);
-                        LOG.Write("Sensor LP2 related signal change,set DO_EnableToOperateLP2 signal on.");
-                    }                    
-                }
-                else
-                {
-                    if (DeviceModel.TrigEnableToOperateLP2.Value)
-                    {
-                        DeviceModel.TrigEnableToOperateLP2.SetTrigger(false, out _);
-                        LOG.Write("Sensor LP2 related signal change,set DO_EnableToOperateLP2 signal on.");
-                    }                       
-                }
-            }
-                
+            #endregion Common Monitor
         }
 
         public void Terminate()
@@ -486,17 +383,153 @@ namespace EFEM.RT.Devices
             _trigIONAlarmSIGNALON.RST = true;
             _trigIONAlarmSIGNALOFF.RST = true;
         }
- 
-        
+
         private void Subscriptions()
         {
- 
-
             //DATA.Subscribe("Robot.WaferSize", () =>
             //    {
             //        return WaferManager.Instance.GetWaferSize(ModuleName.Robot, 0).ToString();
             //    });
         }
- 
+
+        /// <summary>
+        /// 不同型号的EFEM监控
+        /// </summary>
+        private void MonitorByEfemNum(string efemNum)
+        {
+            if (efemNum.Equals("005"))
+            {
+                _trigWaterLeakNormalTOPM.CLK = DeviceModel.SensorEFEMPowerON.Value && DeviceModel.SensorWaterLeakSW.Value;
+                if (_trigWaterLeakNormalTOPM.R)
+                {
+                    DeviceModel.TrigWaterLeakOkToPM.SetTrigger(true, out _);
+                }
+                if (_trigWaterLeakNormalTOPM.T)
+                {
+                    DeviceModel.TrigWaterLeakOkToPM.SetTrigger(false, out _);
+                }
+
+                _trigCDAPressureOKTOPM.CLK = DeviceModel.SensorEFEMPowerON.Value && DeviceModel.SensorCDAPressureSW.Value;
+                if (_trigCDAPressureOKTOPM.R)
+                {
+                    DeviceModel.TrigCDAPressureOkToPM.SetTrigger(true, out _);
+                }
+                if (_trigCDAPressureOKTOPM.T)
+                {
+                    DeviceModel.TrigCDAPressureOkToPM.SetTrigger(false, out _);
+                }
+            }
+            else if (efemNum.Equals("006"))
+            {
+                //DO_RobotSafetyToLP1触发逻辑
+                if (!LoadPort1IsDisable && DeviceModel.SensorLP1OperationStatus != null && DeviceModel.SensorLP1FoupOpen != null && DeviceModel.SensorLP1FoupPlacement != null && DeviceModel.SensorLP1Presence != null
+                    && DeviceModel.SensorLP1Ready != null && DeviceModel.SensorRobotEMStoEFEM != null && DeviceModel.SensorGratingSensorIN1 != null && DeviceModel.TrigSafetytoSMIF1 != null)
+                {
+                    if (DeviceModel.SensorLP1OperationStatus.Value && DeviceModel.SensorLP1FoupOpen.Value && DeviceModel.SensorLP1FoupPlacement.Value
+                        && DeviceModel.SensorLP1Presence.Value && DeviceModel.SensorLP1Ready.Value
+                        && DeviceModel.SensorRobotEMStoEFEM.Value && DeviceModel.SensorGratingSensorIN1.Value)
+                    {
+                        if (!DeviceModel.TrigSafetytoSMIF1.Value)
+                        {
+                            DeviceModel.TrigSafetytoSMIF1.SetTrigger(true, out _);
+                            LOG.Write("Sensor LP1 related signal change,set DO_RobotSafetyToLP1 signal on.");
+                        }
+                    }
+                    else
+                    {
+                        if (DeviceModel.TrigSafetytoSMIF1.Value)
+                        {
+                            DeviceModel.TrigSafetytoSMIF1.SetTrigger(false, out _);
+                            LOG.Write("Sensor LP1 related signal change,set DO_RobotSafetyToLP1 signal off.");
+                        }
+                    }
+                }
+
+                //DO_RobotSafetyToLP2触发逻辑
+                if (!LoadPort2IsDisable && DeviceModel.SensorLP2OperationStatus != null && DeviceModel.SensorLP2FoupOpen != null && DeviceModel.SensorLP2FoupPlacement != null && DeviceModel.SensorLP2Presence != null
+                    && DeviceModel.SensorLP2Ready != null && DeviceModel.SensorRobotEMStoEFEM != null && DeviceModel.SensorGratingSensorIN1 != null && DeviceModel.TrigSafetytoSMIF2 != null)
+                {
+                    if (DeviceModel.SensorLP2OperationStatus.Value && DeviceModel.SensorLP2FoupOpen.Value && DeviceModel.SensorLP2FoupPlacement.Value
+                        && DeviceModel.SensorLP2Presence.Value && DeviceModel.SensorLP2Ready.Value
+                        && DeviceModel.SensorRobotEMStoEFEM.Value && DeviceModel.SensorGratingSensorIN1.Value)
+                    {
+                        if (!DeviceModel.TrigSafetytoSMIF2.Value)
+                        {
+                            DeviceModel.TrigSafetytoSMIF2.SetTrigger(true, out _);
+                            LOG.Write("Sensor LP2 related signal change,set DO_RobotSafetyToLP2 signal on.");
+                        }
+                    }
+                    else
+                    {
+                        if (DeviceModel.TrigSafetytoSMIF2.Value)
+                        {
+                            DeviceModel.TrigSafetytoSMIF2.SetTrigger(false, out _);
+                            LOG.Write("Sensor LP2 related signal change,set DO_RobotSafetyToLP2 signal off.");
+                        }
+                    }
+                }
+
+                //DO_EnableToOperateLP1触发逻辑
+                if (!LoadPort1IsDisable && DeviceModel.TrigEnableToOperateLP1 != null)
+                {
+                    if ((SC.ContainsItem("LoadPort.LP1.Disable") ? !SC.GetValue<bool>("LoadPort.LP1.Disable") : false)
+                    && Singleton<RouteManager>.Instance.IsRunning)
+                    {
+                        if (!DeviceModel.TrigEnableToOperateLP1.Value)
+                        {
+                            DeviceModel.TrigEnableToOperateLP1.SetTrigger(true, out _);
+                            LOG.Write("Sensor LP1 related signal change,set DO_EnableToOperateLP1 signal on.");
+                        }
+                    }
+                    else
+                    {
+                        if (DeviceModel.TrigEnableToOperateLP1.Value)
+                        {
+                            DeviceModel.TrigEnableToOperateLP1.SetTrigger(false, out _);
+                            LOG.Write("Sensor LP1 related signal change,set DO_EnableToOperateLP1 signal on.");
+                        }
+                    }
+                }
+
+                //DO_EnableToOperateLP2触发逻辑
+                if (!LoadPort2IsDisable && DeviceModel.TrigEnableToOperateLP2 != null)
+                {
+                    if ((SC.ContainsItem("LoadPort.LP2.Disable") ? !SC.GetValue<bool>("LoadPort.LP2.Disable") : false)
+                    && Singleton<RouteManager>.Instance.IsRunning)
+                    {
+                        if (!DeviceModel.TrigEnableToOperateLP2.Value)
+                        {
+                            DeviceModel.TrigEnableToOperateLP2.SetTrigger(true, out _);
+                            LOG.Write("Sensor LP2 related signal change,set DO_EnableToOperateLP2 signal on.");
+                        }
+                    }
+                    else
+                    {
+                        if (DeviceModel.TrigEnableToOperateLP2.Value)
+                        {
+                            DeviceModel.TrigEnableToOperateLP2.SetTrigger(false, out _);
+                            LOG.Write("Sensor LP2 related signal change,set DO_EnableToOperateLP2 signal on.");
+                        }
+                    }
+                }
+                //Pause / Resume  to Robot触发逻辑(----------待完善----------)
+                //if (DeviceModel.SensorGratingSensorIN1 != null && DeviceModel.SensorRBNotExtendSIMF1 != null && DeviceModel.SensorRBNotExtendSIMF1 != null
+                //    && DeviceModel.SensorPAorFLPDoorClosed != null)
+                //{
+                //    if (true)
+                //    {
+                //        if (DeviceModel.TrigPauseResumetoRobot.Value)
+                //        {
+                //            DeviceModel.TrigPauseResumetoRobot.SetTrigger(false, out _);
+                //        }
+
+                //        if (!DeviceModel.TrigPauseResumetoRobot.Value)
+                //        {
+                //            DeviceModel.TrigPauseResumetoRobot.SetTrigger(true, out _);
+                //        }
+                //    }
+                //}
+            }
+        }
     }
 }

+ 6 - 0
Jet/Jet_001_2P_Jet/EfemRT/Devices/Flipper/JetFlipper.cs

@@ -219,6 +219,12 @@ namespace EFEM.RT.Devices.Flipper
                 }
                 //如果是错误
                 _trigError.CLK = State == FlipperState.Error;
+
+                //DO_SafetytoFLP触发(待添加)
+                if (_diIsHorizontal.Value && _diIsClampOpen.Value && _diEnableToRobot.Value)
+                {
+                    //+ Safety to FLP sw interlock逻辑
+                }
             }
             catch (Exception ex)
             {

+ 17 - 2
Jet/Jet_001_2P_Jet/EfemRT/Devices/LoadPorts/Hirata/HirataLoadPort.cs

@@ -193,11 +193,27 @@ namespace EfemRT.Devices.LoadPorts.Hirata
                     //    _lstBinsMsgs.RemoveFirst();
                     //}
                 }
+                if (!_isPlaced || !_isPresent)
+                {
+                    ConfirmRemoveCarrier();
+                }
             }
             return true;
 
         }
-        
+
+        protected override void ConfirmRemoveCarrier()
+        {
+            if (!WaferManager.Instance.CheckWaferEmpty(ModuleHelper.Converter(Name)))
+            {
+                WaferManager.Instance.DeleteWafer(ModuleHelper.Converter(Name), 0, 25);
+            }
+            
+            //if(CarrierManager.Instance.GetCarrier(Name)!= null)
+            //{
+            //    CarrierManager.Instance.DeleteCarrier(Name);
+            //}       
+        }
 
         private void HandleAsciiData(string ReceiveMsg)
         {
@@ -956,7 +972,6 @@ namespace EfemRT.Devices.LoadPorts.Hirata
             //    DeviceModel.TrigSafetytoSMIF1.SetTrigger(false, out _);
             //if (Name == "LP2")
             //    DeviceModel.TrigSafetytoSMIF2.SetTrigger(false, out _);
-            WaferManager.Instance.DeleteWafer((ModuleName)Enum.Parse(typeof(ModuleName), _lpname), 0, 25);
             return true;
         }
 

+ 2 - 4
Jet/Jet_001_2P_Jet/EfemRT/Servers/Check.cs

@@ -673,8 +673,7 @@ namespace EFEM.RT
             }
             else if ((args.StartsWith("LLLA") || args.StartsWith("LLA")))
             {
-                //if(BufferQuantity == 0 && LoadLockQuantity > 0)
-                if (LoadLockQuantity > 0)
+                if(BufferQuantity == 0 && LoadLockQuantity > 0)
                     target = ModuleName.LL1;
                 if(LoadLockQuantity==0 && BufferQuantity>0)
                     target = ModuleName.Buffer1;
@@ -692,8 +691,7 @@ namespace EFEM.RT
             }
             else if ((args.StartsWith("LLLB") || args.StartsWith("LLB")) )
             {
-                //if (BufferQuantity==0 && LoadLockQuantity > 1)
-                if (LoadLockQuantity > 1)
+                if (BufferQuantity==0 && LoadLockQuantity > 1)
                         target = ModuleName.LL2;
                 if (LoadLockQuantity == 0 && BufferQuantity > 1)
                     target = ModuleName.Buffer2;

+ 1 - 0
Jet/Jet_001_2P_Jet/EfemSimulator/SimulatorSystem.cs

@@ -55,6 +55,7 @@ namespace EfemSimulator.SimulatorIo
             IO.DI["DI_EFEMSideDoorClosed"].Value = true;
             IO.DI["DI_RunMode"].Value = false;
             IO.DI["DI_EFEMPowerON"].Value = true;
+            IO.DI["DI_PA/FLPDoorClosed"].Value = true;
 
             IO.DI["DI_PMASystemInterlock"].Value = true;
             IO.DI["DI_PMBSystemInterlock"].Value = true;