sangwq 2 år sedan
förälder
incheckning
44ec74603f

+ 3 - 0
Venus/Framework/Common/CommonData/SorterDefines/TransferInfo.cs

@@ -33,6 +33,9 @@ namespace Aitex.Sorter.Common
 
         [EnumMember]
         Both = 2,
+
+        [EnumMember]
+        None = 3,
     }
 
 

+ 5 - 0
Venus/Framework/Common/Device/ModuleName.cs

@@ -255,6 +255,11 @@ namespace MECF.Framework.Common.Equipment
                    || unit == ModuleName.LLC
                    || unit == ModuleName.LLD;
         }
+
+        public static bool IsTM(ModuleName unit)
+        {
+            return unit == ModuleName.TM;
+        }
         public static string GetAbbr(ModuleName module)
         {
             switch (module)

+ 3 - 0
Venus/Venus_Core/EventDefine.cs

@@ -24,6 +24,9 @@ namespace Aitex.Core.RT.Log{
 		EV_FSM_NOTIFY = 23,
 		WARN_FSM_WARN = 24,
 		ERR_FSM_FAILED = 25,
+		EV_ROUTER = 26,
+		WARN_ROUTER = 27,
+		ERR_ROUTER = 28,
 		INFO_DEVICE_IO_HEATER = 1000,
 		WARN_DEVICE_IO_HEATER = 1001,
 		ERR_DEVICE_IO_HEATER = 1002,

+ 347 - 320
Venus/Venus_RT/Config/LogDefine.json

@@ -207,337 +207,364 @@
     "Note": "FSM Failed"
   },
   {
-    "Id": 1000,
+    "Id": 26,
     "Level": "Info",
-    "LogEnum": "INFO_DEVICE_IO_HEATER",
-    "GlobalDescription_zh": "IO Heater Log: {0}",
-    "GlobalDescription_en": "IO Heater Log: {0}",
-    "Module": "PM",
-    "Note": "IO Heater Info"
-  },
-  {
-    "Id": 1001,
-    "Level": "Warning",
-    "LogEnum": "WARN_DEVICE_IO_HEATER",
-    "GlobalDescription_zh": "IO Heater warning: {0}",
-    "GlobalDescription_en": "IO Heater warning: {0}",
-    "Module": "PM",
-    "Note": "IO Heater Warning"
-  },
-  {
-    "Id": 1002,
-    "Level": "Error",
-    "LogEnum": "ERR_DEVICE_IO_HEATER",
-    "GlobalDescription_zh": "IO Heater alarm: {0}",
-    "GlobalDescription_en": "IO Heater alarm: {0}",
-    "Module": "PM",
-    "Note": "IO Heater Alarm"
-  },
-  {
-    "Id": 1003,
-    "Level": "Error",
-    "LogEnum": "ERR_DRY_PUMP",
-    "GlobalDescription_zh": "Dry Pump alarm: {0}",
-    "GlobalDescription_en": "Dry Pump alarm: {0}",
-    "Module": "PM",
-    "Note": "Dry Pump Alarm"
-  },
-  {
-    "Id": 1004,
-    "Level": "Error",
-    "LogEnum": "ERR_PENDULUM_VALVE",
-    "GlobalDescription_zh": "Pendulum Valve alarm: {0}",
-    "GlobalDescription_en": "Pendulum Valve alarm: {0}",
-    "Module": "PM",
-    "Note": "Pendulum Valve Alarm"
-  },
-  {
-    "Id": 1005,
-    "Level": "Error",
-    "LogEnum": "ERR_ESC_HV",
-    "GlobalDescription_zh": "ESC HV alarm: {0}",
-    "GlobalDescription_en": "ESC HV alarm: {0}",
-    "Module": "PM",
-    "Note": "ESC HV Alarm"
-  },
-  {
-    "Id": 1006,
-    "Level": "Error",
-    "LogEnum": "ERR_TURBO_PUMP",
-    "GlobalDescription_zh": "Turbo Pump alarm: {0}",
-    "GlobalDescription_en": "Turbo Pump alarm: {0}",
-    "Module": "PM",
-    "Note": "Turbo Pump Alarm"
-  },
-  {
-    "Id": 1007,
-    "Level": "Error",
-    "LogEnum": "ERR_RF",
-    "GlobalDescription_zh": "RF error: {0}",
-    "GlobalDescription_en": "RF error: {0}",
-    "Module": "PM",
-    "Note": "RF Alarm"
-  },
-  {
-    "Id": 1008,
-    "Level": "Info",
-    "LogEnum": "INFO_DEVICE_CHILLER",
-    "GlobalDescription_zh": "Chiller: {0}",
-    "GlobalDescription_en": "Chiller: {0}",
-    "Module": "PM",
-    "Note": "Chiller Info"
-  },
-  {
-    "Id": 1009,
-    "Level": "Warning",
-    "LogEnum": "WARN_DEVICE_CHILLER",
-    "GlobalDescription_zh": "Chiller warning: {0}",
-    "GlobalDescription_en": "Chiller warning: {0}",
-    "Module": "PM",
-    "Note": "Chiller Warning"
-  },
-  {
-    "Id": 1010,
-    "Level": "Error",
-    "LogEnum": "ERR_DEVICE_CHILLER",
-    "GlobalDescription_zh": "Chiller alarm: {0}",
-    "GlobalDescription_en": "Chiller alarm: {0}",
-    "Module": "PM",
-    "Note": "Chiller Alarm"
-  },
-  {
-    "Id": 1011,
-    "Level": "Warning",
-    "LogEnum": "WARN_RF",
-    "GlobalDescription_zh": "RF warning: {0}",
-    "GlobalDescription_en": "RF warning: {0}",
-    "Module": "PM",
-    "Note": "RF warning"
-  },
-  {
-    "Id": 1012,
-    "Level": "Error",
-    "LogEnum": "ERR_ENDPOINT",
-    "GlobalDescription_zh": "EndPoint alarm: {0}",
-    "GlobalDescription_en": "EndPoint alarm: {0}",
-    "Module": "PM",
-    "Note": "EndPoint Alarm"
-  },
-  {
-    "Id": 1013,
-    "Level": "Info",
-    "LogEnum": "INFO_ENDPOINT",
-    "GlobalDescription_zh": "EndPoint log: {0}",
-    "GlobalDescription_en": "EndPoint log: {0}",
-    "Module": "PM",
-    "Note": "EndPoint log"
-  },
-  {
-    "Id": 1014,
-    "Level": "Warning",
-    "LogEnum": "WARN_ENDPOINT",
-    "GlobalDescription_zh": "EndPoint warning: {0}",
-    "GlobalDescription_en": "EndPoint warning: {0}",
-    "Module": "PM",
-    "Note": "EndPoint warning"
-  },
-  {
-    "Id": 1015,
-    "Level": "Error",
-    "LogEnum": "ERR_BACKSIDE_HE",
-    "GlobalDescription_zh": "BacksideHelium alarm: {0}",
-    "GlobalDescription_en": "BacksideHelium alarm: {0}",
-    "Module": "PM",
-    "Note": "BacksideHelium Alarm"
-  },
-  {
-    "Id": 1016,
-    "Level": "Info",
-    "LogEnum": "INFO_BACKSIDE_HE",
-    "GlobalDescription_zh": "BacksideHelium log: {0}",
-    "GlobalDescription_en": "BacksideHelium log: {0}",
-    "Module": "PM",
-    "Note": "BacksideHelium log"
-  },
-  {
-    "Id": 1017,
-    "Level": "Warning",
-    "LogEnum": "WARN_BACKSIDE_HE",
-    "GlobalDescription_zh": "BacksideHelium warning: {0}",
-    "GlobalDescription_en": "BacksideHelium warning: {0}",
-    "Module": "PM",
-    "Note": "BacksideHelium warning"
-  },
-  {
-    "Id": 1018,
-    "Level": "Error",
-    "LogEnum": "ERR_PROCESS",
-    "GlobalDescription_zh": "Process alarm: {0}",
-    "GlobalDescription_en": "Process alarm: {0}",
-    "Module": "PM",
-    "Note": "Process Alarm"
-  },
-  {
-    "Id": 1019,
-    "Level": "Info",
-    "LogEnum": "INFO_PROCESS",
-    "GlobalDescription_zh": "Process log: {0}",
-    "GlobalDescription_en": "Process log: {0}",
-    "Module": "PM",
-    "Note": "Process log"
-  },
-  {
-    "Id": 1020,
-    "Level": "Warning",
-    "LogEnum": "WARN_PROCESS",
-    "GlobalDescription_zh": "Process warning: {0}",
-    "GlobalDescription_en": "Process warning: {0}",
-    "Module": "PM",
-    "Note": "Process warning"
-  },
-  {
-    "Id": 1021,
-    "Level": "Error",
-    "LogEnum": "ERR_IoGasValve",
-    "GlobalDescription_zh": "{0}",
-    "GlobalDescription_en": "{0}",
-    "Module": "PM",
-    "Note": "IoGasValve Error"
-  },
-  {
-    "Id": 1022,
-    "Level": "Warning",
-    "LogEnum": "WARN_State",
-    "GlobalDescription_zh": "{0}",
-    "GlobalDescription_en": "{0}",
-    "Module": "PM",
-    "Note": "State warning"
-  },
-  {
-    "Id": 1023,
-    "Level": "Error",
-    "LogEnum": "ERR_PM",
-    "GlobalDescription_zh": "{0}",
-    "GlobalDescription_en": "{0}",
-    "Module": "PM",
-    "Note": "PM Alarm"
-  },
-  {
-    "Id": 1024,
-    "Level": "Info",
-    "LogEnum": "INFO_PM",
-    "GlobalDescription_zh": "{0}",
-    "GlobalDescription_en": "{0}",
-    "Module": "PM",
-    "Note": "PM INFO"
-  },
-  {
-    "Id": 1025,
-    "Level": "Warning",
-    "LogEnum": "WARN_PM",
-    "GlobalDescription_zh": "{0}",
-    "GlobalDescription_en": "{0}",
-    "Module": "PM",
-    "Note": "PM warning"
-  },
-
-  {
-    "Id": 1026,
-    "Level": "Info",
-    "LogEnum": "INFO_Sensor",
-    "GlobalDescription_zh": "{0}",
-    "GlobalDescription_en": "{0}",
-    "Module": "PM",
-    "Note": "Sensor log"
-  },
-  {
-    "Id": 1027,
-    "Level": "Warning",
-    "LogEnum": "WARN_Sensor",
-    "GlobalDescription_zh": "{0}",
-    "GlobalDescription_en": "{0}",
-    "Module": "PM",
-    "Note": "Sensor warning"
-  },
-  {
-    "Id": 1028,
-    "Level": "Error",
-    "LogEnum": "ERR_Sensor",
-    "GlobalDescription_zh": "{0}",
-    "GlobalDescription_en": "{0}",
-    "Module": "PM",
-    "Note": "Sensor Error"
-  },
-  {
-    "Id": 2000,
-    "Level": "Error",
-    "LogEnum": "ERR_TM",
-    "GlobalDescription_zh": "{0}",
-    "GlobalDescription_en": "{0}",
-    "Module": "TM",
-    "Note": "TM Alarm"
-  },
-  {
-    "Id": 2001,
-    "Level": "Info",
-    "LogEnum": "INFO_TM",
-    "GlobalDescription_zh": "{0}",
-    "GlobalDescription_en": "{0}",
-    "Module": "TM",
-    "Note": "TM INFO"
-  },
-  {
-    "Id": 2002,
-    "Level": "Warning",
-    "LogEnum": "WARN_TM",
-    "GlobalDescription_zh": "{0}",
-    "GlobalDescription_en": "{0}",
-    "Module": "TM",
-    "Note": "TM warning"
-  },
-  {
-    "Id": 2100,
-    "Level": "Error",
-    "LogEnum": "ERR_TM_ROBOT",
-    "GlobalDescription_zh": "TM Robot receive an error:{0}",
-    "GlobalDescription_en": "TM Robot receive an error:{0}",
-    "Module": "TM",
-    "Note": "TM Alarm"
-  },
-  {
-    "Id": 2101,
-    "Level": "Info",
-    "LogEnum": "INFO_TM_ROBOT",
-    "GlobalDescription_zh": "{0}",
-    "GlobalDescription_en": "{0}",
-    "Module": "TM",
-    "Note": "TM Info"
-  },
-  {
-    "Id": 4000,
-    "Level": "Info",
-    "LogEnum": "EV_EFEM_COMMON_INFO",
+    "LogEnum": "EV_ROUTER",
     "GlobalDescription_zh": "{0}。",
     "GlobalDescription_en": "{0}.",
-    "Module": "EFEM",
-    "Note": "EFEM Notify"
+    "Module": "System",
+    "Note": "Router Notify"
   },
   {
-    "Id": 4001,
+    "Id": 27,
     "Level": "Warning",
-    "LogEnum": "WARN_EFEM_COMMON_WARN",
+    "LogEnum": "WARN_ROUTER",
     "GlobalDescription_zh": "{0}。",
     "GlobalDescription_en": "{0}.",
-    "Module": "EFEM",
-    "Note": "EFEM Warning"
+    "Module": "System",
+    "Note": "Router Warning"
   },
   {
-    "Id": 4002,
+    "Id": 28,
     "Level": "Error",
-    "LogEnum": "ERR_EFEM_COMMON_FAILED",
+    "LogEnum": "ERR_ROUTER",
     "GlobalDescription_zh": "{0}。",
     "GlobalDescription_en": "{0}.",
-    "Module": "EFEM",
-    "Note": "EFEM Failed"
-  }
+    "Module": "System",
+    "Note": "Router Failed"
+  },
+    {
+      "Id": 1000,
+      "Level": "Info",
+      "LogEnum": "INFO_DEVICE_IO_HEATER",
+      "GlobalDescription_zh": "IO Heater Log: {0}",
+      "GlobalDescription_en": "IO Heater Log: {0}",
+      "Module": "PM",
+      "Note": "IO Heater Info"
+    },
+    {
+      "Id": 1001,
+      "Level": "Warning",
+      "LogEnum": "WARN_DEVICE_IO_HEATER",
+      "GlobalDescription_zh": "IO Heater warning: {0}",
+      "GlobalDescription_en": "IO Heater warning: {0}",
+      "Module": "PM",
+      "Note": "IO Heater Warning"
+    },
+    {
+      "Id": 1002,
+      "Level": "Error",
+      "LogEnum": "ERR_DEVICE_IO_HEATER",
+      "GlobalDescription_zh": "IO Heater alarm: {0}",
+      "GlobalDescription_en": "IO Heater alarm: {0}",
+      "Module": "PM",
+      "Note": "IO Heater Alarm"
+    },
+    {
+      "Id": 1003,
+      "Level": "Error",
+      "LogEnum": "ERR_DRY_PUMP",
+      "GlobalDescription_zh": "Dry Pump alarm: {0}",
+      "GlobalDescription_en": "Dry Pump alarm: {0}",
+      "Module": "PM",
+      "Note": "Dry Pump Alarm"
+    },
+    {
+      "Id": 1004,
+      "Level": "Error",
+      "LogEnum": "ERR_PENDULUM_VALVE",
+      "GlobalDescription_zh": "Pendulum Valve alarm: {0}",
+      "GlobalDescription_en": "Pendulum Valve alarm: {0}",
+      "Module": "PM",
+      "Note": "Pendulum Valve Alarm"
+    },
+    {
+      "Id": 1005,
+      "Level": "Error",
+      "LogEnum": "ERR_ESC_HV",
+      "GlobalDescription_zh": "ESC HV alarm: {0}",
+      "GlobalDescription_en": "ESC HV alarm: {0}",
+      "Module": "PM",
+      "Note": "ESC HV Alarm"
+    },
+    {
+      "Id": 1006,
+      "Level": "Error",
+      "LogEnum": "ERR_TURBO_PUMP",
+      "GlobalDescription_zh": "Turbo Pump alarm: {0}",
+      "GlobalDescription_en": "Turbo Pump alarm: {0}",
+      "Module": "PM",
+      "Note": "Turbo Pump Alarm"
+    },
+    {
+      "Id": 1007,
+      "Level": "Error",
+      "LogEnum": "ERR_RF",
+      "GlobalDescription_zh": "RF error: {0}",
+      "GlobalDescription_en": "RF error: {0}",
+      "Module": "PM",
+      "Note": "RF Alarm"
+    },
+    {
+      "Id": 1008,
+      "Level": "Info",
+      "LogEnum": "INFO_DEVICE_CHILLER",
+      "GlobalDescription_zh": "Chiller: {0}",
+      "GlobalDescription_en": "Chiller: {0}",
+      "Module": "PM",
+      "Note": "Chiller Info"
+    },
+    {
+      "Id": 1009,
+      "Level": "Warning",
+      "LogEnum": "WARN_DEVICE_CHILLER",
+      "GlobalDescription_zh": "Chiller warning: {0}",
+      "GlobalDescription_en": "Chiller warning: {0}",
+      "Module": "PM",
+      "Note": "Chiller Warning"
+    },
+    {
+      "Id": 1010,
+      "Level": "Error",
+      "LogEnum": "ERR_DEVICE_CHILLER",
+      "GlobalDescription_zh": "Chiller alarm: {0}",
+      "GlobalDescription_en": "Chiller alarm: {0}",
+      "Module": "PM",
+      "Note": "Chiller Alarm"
+    },
+    {
+      "Id": 1011,
+      "Level": "Warning",
+      "LogEnum": "WARN_RF",
+      "GlobalDescription_zh": "RF warning: {0}",
+      "GlobalDescription_en": "RF warning: {0}",
+      "Module": "PM",
+      "Note": "RF warning"
+    },
+    {
+      "Id": 1012,
+      "Level": "Error",
+      "LogEnum": "ERR_ENDPOINT",
+      "GlobalDescription_zh": "EndPoint alarm: {0}",
+      "GlobalDescription_en": "EndPoint alarm: {0}",
+      "Module": "PM",
+      "Note": "EndPoint Alarm"
+    },
+    {
+      "Id": 1013,
+      "Level": "Info",
+      "LogEnum": "INFO_ENDPOINT",
+      "GlobalDescription_zh": "EndPoint log: {0}",
+      "GlobalDescription_en": "EndPoint log: {0}",
+      "Module": "PM",
+      "Note": "EndPoint log"
+    },
+    {
+      "Id": 1014,
+      "Level": "Warning",
+      "LogEnum": "WARN_ENDPOINT",
+      "GlobalDescription_zh": "EndPoint warning: {0}",
+      "GlobalDescription_en": "EndPoint warning: {0}",
+      "Module": "PM",
+      "Note": "EndPoint warning"
+    },
+    {
+      "Id": 1015,
+      "Level": "Error",
+      "LogEnum": "ERR_BACKSIDE_HE",
+      "GlobalDescription_zh": "BacksideHelium alarm: {0}",
+      "GlobalDescription_en": "BacksideHelium alarm: {0}",
+      "Module": "PM",
+      "Note": "BacksideHelium Alarm"
+    },
+    {
+      "Id": 1016,
+      "Level": "Info",
+      "LogEnum": "INFO_BACKSIDE_HE",
+      "GlobalDescription_zh": "BacksideHelium log: {0}",
+      "GlobalDescription_en": "BacksideHelium log: {0}",
+      "Module": "PM",
+      "Note": "BacksideHelium log"
+    },
+    {
+      "Id": 1017,
+      "Level": "Warning",
+      "LogEnum": "WARN_BACKSIDE_HE",
+      "GlobalDescription_zh": "BacksideHelium warning: {0}",
+      "GlobalDescription_en": "BacksideHelium warning: {0}",
+      "Module": "PM",
+      "Note": "BacksideHelium warning"
+    },
+    {
+      "Id": 1018,
+      "Level": "Error",
+      "LogEnum": "ERR_PROCESS",
+      "GlobalDescription_zh": "Process alarm: {0}",
+      "GlobalDescription_en": "Process alarm: {0}",
+      "Module": "PM",
+      "Note": "Process Alarm"
+    },
+    {
+      "Id": 1019,
+      "Level": "Info",
+      "LogEnum": "INFO_PROCESS",
+      "GlobalDescription_zh": "Process log: {0}",
+      "GlobalDescription_en": "Process log: {0}",
+      "Module": "PM",
+      "Note": "Process log"
+    },
+    {
+      "Id": 1020,
+      "Level": "Warning",
+      "LogEnum": "WARN_PROCESS",
+      "GlobalDescription_zh": "Process warning: {0}",
+      "GlobalDescription_en": "Process warning: {0}",
+      "Module": "PM",
+      "Note": "Process warning"
+    },
+    {
+      "Id": 1021,
+      "Level": "Error",
+      "LogEnum": "ERR_IoGasValve",
+      "GlobalDescription_zh": "{0}",
+      "GlobalDescription_en": "{0}",
+      "Module": "PM",
+      "Note": "IoGasValve Error"
+    },
+    {
+      "Id": 1022,
+      "Level": "Warning",
+      "LogEnum": "WARN_State",
+      "GlobalDescription_zh": "{0}",
+      "GlobalDescription_en": "{0}",
+      "Module": "PM",
+      "Note": "State warning"
+    },
+    {
+      "Id": 1023,
+      "Level": "Error",
+      "LogEnum": "ERR_PM",
+      "GlobalDescription_zh": "{0}",
+      "GlobalDescription_en": "{0}",
+      "Module": "PM",
+      "Note": "PM Alarm"
+    },
+    {
+      "Id": 1024,
+      "Level": "Info",
+      "LogEnum": "INFO_PM",
+      "GlobalDescription_zh": "{0}",
+      "GlobalDescription_en": "{0}",
+      "Module": "PM",
+      "Note": "PM INFO"
+    },
+    {
+      "Id": 1025,
+      "Level": "Warning",
+      "LogEnum": "WARN_PM",
+      "GlobalDescription_zh": "{0}",
+      "GlobalDescription_en": "{0}",
+      "Module": "PM",
+      "Note": "PM warning"
+    },
+
+    {
+      "Id": 1026,
+      "Level": "Info",
+      "LogEnum": "INFO_Sensor",
+      "GlobalDescription_zh": "{0}",
+      "GlobalDescription_en": "{0}",
+      "Module": "PM",
+      "Note": "Sensor log"
+    },
+    {
+      "Id": 1027,
+      "Level": "Warning",
+      "LogEnum": "WARN_Sensor",
+      "GlobalDescription_zh": "{0}",
+      "GlobalDescription_en": "{0}",
+      "Module": "PM",
+      "Note": "Sensor warning"
+    },
+    {
+      "Id": 1028,
+      "Level": "Error",
+      "LogEnum": "ERR_Sensor",
+      "GlobalDescription_zh": "{0}",
+      "GlobalDescription_en": "{0}",
+      "Module": "PM",
+      "Note": "Sensor Error"
+    },
+    {
+      "Id": 2000,
+      "Level": "Error",
+      "LogEnum": "ERR_TM",
+      "GlobalDescription_zh": "{0}",
+      "GlobalDescription_en": "{0}",
+      "Module": "TM",
+      "Note": "TM Alarm"
+    },
+    {
+      "Id": 2001,
+      "Level": "Info",
+      "LogEnum": "INFO_TM",
+      "GlobalDescription_zh": "{0}",
+      "GlobalDescription_en": "{0}",
+      "Module": "TM",
+      "Note": "TM INFO"
+    },
+    {
+      "Id": 2002,
+      "Level": "Warning",
+      "LogEnum": "WARN_TM",
+      "GlobalDescription_zh": "{0}",
+      "GlobalDescription_en": "{0}",
+      "Module": "TM",
+      "Note": "TM warning"
+    },
+    {
+      "Id": 2100,
+      "Level": "Error",
+      "LogEnum": "ERR_TM_ROBOT",
+      "GlobalDescription_zh": "TM Robot receive an error:{0}",
+      "GlobalDescription_en": "TM Robot receive an error:{0}",
+      "Module": "TM",
+      "Note": "TM Alarm"
+    },
+    {
+      "Id": 2101,
+      "Level": "Info",
+      "LogEnum": "INFO_TM_ROBOT",
+      "GlobalDescription_zh": "{0}",
+      "GlobalDescription_en": "{0}",
+      "Module": "TM",
+      "Note": "TM Info"
+    },
+    {
+      "Id": 4000,
+      "Level": "Info",
+      "LogEnum": "EV_EFEM_COMMON_INFO",
+      "GlobalDescription_zh": "{0}。",
+      "GlobalDescription_en": "{0}.",
+      "Module": "EFEM",
+      "Note": "EFEM Notify"
+    },
+    {
+      "Id": 4001,
+      "Level": "Warning",
+      "LogEnum": "WARN_EFEM_COMMON_WARN",
+      "GlobalDescription_zh": "{0}。",
+      "GlobalDescription_en": "{0}.",
+      "Module": "EFEM",
+      "Note": "EFEM Warning"
+    },
+    {
+      "Id": 4002,
+      "Level": "Error",
+      "LogEnum": "ERR_EFEM_COMMON_FAILED",
+      "GlobalDescription_zh": "{0}。",
+      "GlobalDescription_en": "{0}.",
+      "Module": "EFEM",
+      "Note": "EFEM Failed"
+    }
 ]

+ 4 - 0
Venus/Venus_RT/Devices/TM/ITransferRobot.cs

@@ -1,12 +1,15 @@
 using Aitex.Sorter.Common;
 using MECF.Framework.Common.Equipment;
 using Venus_Core;
+using MECF.Framework.Common.CommonData;
+
 
 namespace Venus_RT.Devices
 {
     public interface ITransferRobot
     {
         RState Status { get;}
+        RobotMoveInfo TMRobotMoveInfo { get; }
         bool IsHomed { get; }
         bool Home();
         bool Halt();
@@ -19,5 +22,6 @@ namespace Venus_RT.Devices
         bool PlaceRetract(ModuleName chamber, int slot, Hand hand);
         bool Pick(ModuleName station, int slot, Hand hand);
         bool Place(ModuleName station, int slot, Hand hand);
+        void SetRobotMovingInfo(RobotAction action, Hand hand, ModuleName target);
     }
 }

+ 20 - 0
Venus/Venus_RT/Devices/TM/SIASUNRobot.cs

@@ -10,6 +10,7 @@ using MECF.Framework.Common.SubstrateTrackings;
 using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robot;
 using Aitex.Core.RT.Log;
 using System.Text.RegularExpressions;
+using MECF.Framework.Common.CommonData;
 
 namespace Venus_RT.Devices
 {
@@ -36,10 +37,13 @@ namespace Venus_RT.Devices
         public RState Status { get { return _status; } }
         public bool IsHomed { get { return _IsHomed; } }
 
+        public RobotMoveInfo TMRobotMoveInfo { get { return _robotMoveInfo; } }
+
         private readonly AsyncSocket _socket;
         private OPStep _currentOP = OPStep.Idle;
         private Dictionary<ModuleName, int> _StationNumbers = new Dictionary<ModuleName, int>();
         private readonly int _checkLoadStation = 1;
+        private RobotMoveInfo _robotMoveInfo = new RobotMoveInfo();
 
         private string Hand2Arm(Hand hand) => hand == Hand.Blade1 ? "A" : "B";
 
@@ -113,6 +117,7 @@ namespace Venus_RT.Devices
 
             _currentOP = OPStep.PickExtend;
             _status = RState.Running;
+            SetRobotMovingInfo(RobotAction.Extending, hand, chamber);
             return _SendCommand($"PICK {_StationNumbers[chamber]} SLOT {slot} ARM {Hand2Arm(hand)} ENRT\r");
         }
         public bool PickRetract(ModuleName chamber, int slot, Hand hand)
@@ -122,6 +127,7 @@ namespace Venus_RT.Devices
 
             _currentOP = OPStep.PickRetract;
             _status = RState.Running;
+            SetRobotMovingInfo(RobotAction.Retracting, hand, chamber);
             return _SendCommand($"PICK {_StationNumbers[chamber]} SLOT {slot} ARM {Hand2Arm(hand)} STRT\r");
         }
         public bool PlaceExtend(ModuleName chamber, int slot, Hand hand)
@@ -131,6 +137,7 @@ namespace Venus_RT.Devices
 
             _currentOP = OPStep.PlaceExtent;
             _status = RState.Running;
+            SetRobotMovingInfo(RobotAction.Extending, hand, chamber);
             return _SendCommand($"PLACE {_StationNumbers[chamber]} SLOT {slot} ARM {Hand2Arm(hand)} ENRT\r");
         }
         public bool PlaceRetract(ModuleName chamber, int slot, Hand hand)
@@ -140,6 +147,7 @@ namespace Venus_RT.Devices
 
             _currentOP = OPStep.PlaceExtent;
             _status = RState.Running;
+            SetRobotMovingInfo(RobotAction.Retracting, hand, chamber);
             return _SendCommand($"PLACE {_StationNumbers[chamber]} SLOT {slot} ARM {Hand2Arm(hand)} STRT\r");
         }
         public bool Pick(ModuleName station, int slot, Hand hand)
@@ -149,6 +157,7 @@ namespace Venus_RT.Devices
 
             _currentOP = OPStep.Pick;
             _status = RState.Running;
+            SetRobotMovingInfo(RobotAction.Picking, hand, station);
             return _SendCommand($"PICK {_StationNumbers[station]} SLOT {slot} ARM {Hand2Arm(hand)}\r");
         }
         public bool Place(ModuleName station, int slot, Hand hand)
@@ -158,6 +167,7 @@ namespace Venus_RT.Devices
 
             _currentOP = OPStep.Place;
             _status = RState.Running;
+            SetRobotMovingInfo(RobotAction.Placing, hand, station);
             return _SendCommand($"PLACE {_StationNumbers[station]} SLOT {slot} ARM {Hand2Arm(hand)}\r");
         }
 
@@ -221,6 +231,9 @@ namespace Venus_RT.Devices
                         }
                         else
                             ReportWrongMsg(RevMsg);
+
+                        if (_currentOP != OPStep.PickExtend && _currentOP != OPStep.PlaceExtent)
+                            SetRobotMovingInfo(RobotAction.None, Hand.Both, ModuleName.TM);
                     }
                     break;
                 case OPStep.Home:
@@ -582,5 +595,12 @@ namespace Venus_RT.Devices
                 LOG.Write(eEvent.ERR_TM_ROBOT, ModuleName.TM, $"Try Parse the receive error code faild:{errCode}");
             }
         }
+
+        public void SetRobotMovingInfo(RobotAction action, Hand hand, ModuleName target)
+        {
+            _robotMoveInfo.Action = action;
+            _robotMoveInfo.ArmTarget = hand == Hand.Blade1 ? RobotArm.ArmA : (hand == Hand.Both ? RobotArm.Both : RobotArm.ArmB);
+            _robotMoveInfo.BladeTarget = $"{_robotMoveInfo.ArmTarget}.{target}";
+        }
     }
 }

+ 12 - 0
Venus/Venus_RT/Modules/AutoCycle.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Venus_RT.Modules
+{
+    class AutoCycle
+    {
+    }
+}

+ 0 - 1
Venus/Venus_RT/Modules/LLs/LLEntity.cs

@@ -380,7 +380,6 @@ namespace Venus_RT.Modules
             return ret == RState.End;
         }
 
-
         private void _debugRoutine()
         {
             int flag = 0;

+ 16 - 0
Venus/Venus_RT/Modules/RouteManager.cs

@@ -209,5 +209,21 @@ namespace Venus_RT.Modules
 
             return null;
         }
+
+        public LLEntity GetLL(ModuleName mod)
+        {
+            if(ModuleHelper.IsInstalled(mod))
+            {
+                switch(mod)
+                {
+                    case ModuleName.LLA:
+                        return LLA;
+                    case ModuleName.LLB:
+                        return LLB;
+                }
+            }
+
+            return null;
+        }
     }
 }

+ 45 - 0
Venus/Venus_RT/Modules/Schedulers/SchedulerLoadLock.cs

@@ -0,0 +1,45 @@
+using System.Diagnostics;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Aitex.Core.RT.Fsm;
+using Aitex.Core.Util;
+using Aitex.Core.RT.SCCore;
+using Aitex.Sorter.Common;
+using MECF.Framework.Common.Equipment;
+using MECF.Framework.Common.Schedulers;
+using MECF.Framework.Common.SubstrateTrackings;
+using Venus_RT.Scheduler;
+
+namespace Venus_RT.Modules.Schedulers
+{
+    class SchedulerLoadLock : SchedulerModule
+    {
+        public override bool IsAvailable
+        {
+            get { return _entity.IsIdle && /*_entity.IsOnline && */CheckTaskDone(); }
+        }
+        public override bool IsOnline
+        {
+            get { return _entity.IsOnline; }
+
+        }
+        public override bool IsError
+        {
+            get { return _entity.IsError; }
+
+        }
+
+        private LLEntity _entity = null;
+        public SchedulerLoadLock(ModuleName module) : base(module.ToString())
+        {
+            _entity = Singleton<RouteManager>.Instance.GetLL(module);
+        }
+
+        private bool CheckTaskDone()
+        {
+            return true;
+        }
+    }
+}

+ 1 - 9
Venus/Venus_RT/Modules/Schedulers/SchedulerPM.cs

@@ -97,15 +97,7 @@ namespace Venus_RT.Scheduler
 
         public SchedulerPM(ModuleName chamber) : base(chamber.ToString())
         {
-            switch (chamber)
-            {
-                case ModuleName.PMA:
-                    _entity = Singleton<RouteManager>.Instance.PMA;
-                    break;
-                case ModuleName.PMB:
-                    _entity = Singleton<RouteManager>.Instance.PMB;
-                    break;
-            }
+            _entity = Singleton<RouteManager>.Instance.GetPM(chamber);
 
             _pm = DEVICE.GetDevice<JetPM>(Module.ToString());
 

+ 247 - 0
Venus/Venus_RT/Modules/Schedulers/SchedulerTMRobot.cs

@@ -0,0 +1,247 @@
+using System.Diagnostics;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Aitex.Core.RT.Fsm;
+using Aitex.Core.RT.Log;
+using Aitex.Core.Util;
+using Aitex.Core.RT.SCCore;
+using Aitex.Sorter.Common;
+using MECF.Framework.Common.Equipment;
+using MECF.Framework.Common.Schedulers;
+using MECF.Framework.Common.SubstrateTrackings;
+using Venus_RT.Scheduler;
+
+namespace Venus_RT.Modules.Schedulers
+{
+    class SchedulerItem
+    {
+        public TMEntity.MSG MoveType { get;  set; }
+        public ModuleName target { get;  set; }
+
+        public Queue<MoveItem> moveList { get;  set; }
+
+    }
+    class SchedulerTMRobot : SchedulerModule
+    {
+        public override bool IsAvailable
+        {
+            get { return _entity.IsIdle && /*_entity.IsOnline && */RunSchedulers(); }
+        }
+        public override bool IsOnline
+        {
+            get { return _entity.IsOnline; }
+
+        }
+        public override bool IsError
+        {
+            get { return _entity.IsError; }
+
+        }
+
+        private TMEntity _entity = null;
+        private int _entityTaskToken = (int)FSM_MSG.NONE;
+        private Queue<SchedulerItem> _schedulerList = new Queue<SchedulerItem>();
+        private SchedulerItem _currentScheduler = null;
+        public SchedulerTMRobot() : base(ModuleName.TM.ToString())
+        {
+            _entity = Singleton<RouteManager>.Instance.TM;
+
+        }
+
+        private bool CheckTaskDone()
+        {
+            bool ret = false;
+            switch (_entityTaskToken)
+            {
+                case (int)TMEntity.MSG.Pick:
+                case (int)TMEntity.MSG.PMPick:
+                    ret = WaferManager.Instance.CheckHasWafer(_currentScheduler.moveList.Peek().DestinationModule, _currentScheduler.moveList.Peek().DestinationSlot) &&
+                        WaferManager.Instance.CheckNoWafer(_currentScheduler.moveList.Peek().SourceModule, _currentScheduler.moveList.Peek().SourceSlot);
+                    break;
+                case (int)TMEntity.MSG.Place:
+                case (int)TMEntity.MSG.PMPlace:
+                    ret = WaferManager.Instance.CheckHasWafer(_currentScheduler.moveList.Peek().DestinationModule, _currentScheduler.moveList.Peek().DestinationSlot) &&
+                        WaferManager.Instance.CheckNoWafer(_currentScheduler.moveList.Peek().SourceModule, _currentScheduler.moveList.Peek().SourceSlot);
+                    break;
+                case (int)TMEntity.MSG.Swap:
+                    ret = WaferManager.Instance.CheckHasWafer(_currentScheduler.moveList.Peek().DestinationModule, _currentScheduler.moveList.Peek().DestinationSlot) &&
+                        WaferManager.Instance.CheckHasWafer(_currentScheduler.moveList.Last().DestinationModule, _currentScheduler.moveList.Last().DestinationSlot);
+                    break;
+                case (int)TMEntity.MSG.PMSwap:
+                    ret = WaferManager.Instance.CheckHasWafer(_currentScheduler.moveList.Peek().DestinationModule, _currentScheduler.moveList.Peek().DestinationSlot) &&
+                        WaferManager.Instance.CheckHasWafer(_currentScheduler.moveList.Peek().SourceModule, _currentScheduler.moveList.Peek().SourceSlot);
+                    break;
+                case (int)FSM_MSG.NONE:
+                    ret = true;
+                    break;
+            }
+
+            if(ret && _entityTaskToken != (int)FSM_MSG.NONE)
+            {
+                _entityTaskToken = (int)FSM_MSG.NONE;
+                LOG.Write(eEvent.EV_ROUTER, ModuleName.TM, $"Scheduler, { _currentScheduler.target} Task done: { _currentScheduler.MoveType}");
+            }
+
+            return ret;
+        }
+
+        private bool PostMoveItems(MoveItem[] items)
+        {
+            void PackSwapCmds(MoveItem[] swapItems, TMEntity.MSG swapType, int swapIndex)
+            {
+                SchedulerItem swap = new SchedulerItem();
+                swap.MoveType = swapType;
+                swap.target = swapItems[0].DestinationModule;
+                swap.moveList = new Queue<MoveItem>();
+
+                for (int i = 0; i < swapIndex; i++)
+                {
+                    if(!ModuleHelper.IsTM(swapItems[i].SourceModule))
+                    {
+                        SchedulerItem item = new SchedulerItem();
+                        item.MoveType = ModuleHelper.IsLoadLock(swapItems[i].SourceModule) ? TMEntity.MSG.Pick : TMEntity.MSG.PMPick;
+                        item.target = swapItems[0].SourceModule;
+                        item.moveList = new Queue<MoveItem>();
+                        item.moveList.Enqueue(new MoveItem(swapItems[0].SourceModule, swapItems[0].SourceSlot, ModuleName.TM, i, (Hand)i));
+                        _schedulerList.Enqueue(item);
+
+                        swap.moveList.Enqueue(new MoveItem(ModuleName.TM, i, swapItems[i].DestinationModule, swapItems[i].DestinationSlot, (Hand)i));
+                    }
+                }
+
+                for (int j = swapIndex; j < swapItems.Length; j++)
+                {
+                    swap.moveList.Enqueue(new MoveItem(swapItems[j].SourceModule, swapItems[j].SourceSlot, ModuleName.TM, j - swapIndex, (Hand)(j - swapIndex)));
+                }
+                _schedulerList.Enqueue(swap);
+
+                for (int j = swapIndex; j < swapItems.Length; j++)
+                {
+                    if (!ModuleHelper.IsTM(swapItems[j].DestinationModule))
+                    {
+                        SchedulerItem item = new SchedulerItem();
+                        item.MoveType = ModuleHelper.IsLoadLock(swapItems[j].SourceModule) ?  TMEntity.MSG.Place : TMEntity.MSG.PMPlace;
+                        item.target = swapItems[j].DestinationModule;
+                        item.moveList = new Queue<MoveItem>();
+                        item.moveList.Enqueue(new MoveItem(ModuleName.TM, j - swapIndex, swapItems[j].DestinationModule, swapItems[j].DestinationSlot, (Hand)(j - swapIndex)));
+                        _schedulerList.Enqueue(item);
+                    }
+                }
+            }
+
+            if(WaferManager.Instance.CheckNoWafer(ModuleName.TM, 0) && WaferManager.Instance.CheckNoWafer(ModuleName.TM, 1))
+            {
+                if (items.Length == 4)
+                {
+                    if (ModuleHelper.IsLoadLock(items[0].DestinationModule) &&
+                        items[0].DestinationModule == items[1].DestinationModule &&
+                        items[0].DestinationModule == items[2].SourceModule &&
+                        items[0].DestinationModule == items[3].SourceModule)
+                    {
+                        PackSwapCmds(items,  TMEntity.MSG.Swap, 2);
+                    }
+                }
+                else if (items.Length == 3)
+                {
+                    if (ModuleHelper.IsLoadLock(items[0].DestinationModule) &&
+                        items[0].DestinationModule == items[1].DestinationModule &&
+                        items[0].DestinationModule == items[2].SourceModule)
+                    {
+                        PackSwapCmds(items, TMEntity.MSG.Swap, 2);
+                    }
+                    else if (ModuleHelper.IsLoadLock(items[0].DestinationModule) &&
+                        items[0].DestinationModule == items[1].SourceModule &&
+                        items[0].DestinationModule == items[2].SourceModule)
+                    {
+                        PackSwapCmds(items, TMEntity.MSG.Swap, 1);
+                    }
+                }
+                else if (items.Length == 2)
+                {
+                    if (ModuleHelper.IsLoadLock(items[0].DestinationModule) &&
+                        items[0].DestinationModule == items[1].DestinationModule)
+                    {
+                        PackSwapCmds(items, TMEntity.MSG.Swap, 2);
+                    }
+                    else if (ModuleHelper.IsLoadLock(items[0].SourceModule) &&
+                        items[0].SourceModule == items[1].SourceModule)
+                    {
+                        PackSwapCmds(items, TMEntity.MSG.Swap, 0);
+                    }
+                    else if (ModuleHelper.IsPm(items[0].SourceModule) &&
+                        items[0].SourceModule == items[1].DestinationModule)
+                    {
+                        PackSwapCmds(items,  TMEntity.MSG.PMSwap, 1);
+                    }
+                }
+            }
+
+
+            Hand freeHand = SelectFreeHand();
+            if(freeHand == Hand.None)
+            {
+                LOG.Write(eEvent.WARN_ROUTER, ModuleName.TM, "No Free Arm to transfer wafer");
+                return false;
+            }
+            if(_schedulerList.Count == 0)
+            {
+                foreach(var moveItem in items)
+                {
+                    if(!ModuleHelper.IsTM(moveItem.SourceModule))
+                    {
+                        SchedulerItem item = new SchedulerItem();
+                        item.MoveType = ModuleHelper.IsLoadLock(moveItem.SourceModule) ?  TMEntity.MSG.Pick : TMEntity.MSG.PMPick;
+                        item.target = moveItem.SourceModule;
+                        item.moveList = new Queue<MoveItem>();
+                        item.moveList.Enqueue(new MoveItem(moveItem.SourceModule, moveItem.SourceSlot, ModuleName.TM, (int)freeHand, freeHand));
+                        _schedulerList.Enqueue(item);
+                    }
+
+                    if (!ModuleHelper.IsTM(moveItem.DestinationModule))
+                    {
+                        SchedulerItem item = new SchedulerItem();
+                        item.MoveType = ModuleHelper.IsLoadLock(moveItem.DestinationModule) ? TMEntity.MSG.Place : TMEntity.MSG.PMPlace;
+                        item.target = moveItem.DestinationModule;
+                        item.moveList = new Queue<MoveItem>();
+                        item.moveList.Enqueue(new MoveItem(ModuleName.TM, (int)freeHand, moveItem.DestinationModule, moveItem.DestinationSlot,  freeHand));
+                        _schedulerList.Enqueue(item);
+                    }
+                }
+            }
+
+            return true;
+        }
+
+        Hand SelectFreeHand()
+        {
+            if (WaferManager.Instance.CheckNoWafer(ModuleName.TM, 0))
+                return Hand.Blade1;
+
+            if (WaferManager.Instance.CheckNoWafer(ModuleName.TM, 1))
+                return Hand.Blade2;
+
+            return Hand.None;
+        }
+
+        bool RunSchedulers()
+        {
+            if(_entity.IsIdle && CheckTaskDone())
+            {
+                if (_schedulerList.Count == 0)
+                    return true;
+
+                _currentScheduler = _schedulerList.Dequeue();
+                if(_entity.CheckToPostMessage((int)_currentScheduler.MoveType, _currentScheduler.moveList.ToArray()))
+                {
+                    _entityTaskToken = (int)_currentScheduler.MoveType;
+                }
+                else
+                    _entityTaskToken = (int)FSM_MSG.NONE;
+            }
+
+            return false;
+        }
+    }
+}

+ 1 - 0
Venus/Venus_RT/Modules/TM/MFPMPickRoutine.cs

@@ -119,6 +119,7 @@ namespace Venus_RT.Modules.TM
             }
             else if (_robot.Status == RState.End)
             {
+                WaferManager.Instance.WaferMoved(_targetModule, _targetSlot, ModuleName.TM, (int)_hand);
                 return true;
             }
             else

+ 1 - 0
Venus/Venus_RT/Modules/TM/MFPMPlaceRoutine.cs

@@ -119,6 +119,7 @@ namespace Venus_RT.Modules.TM
             }
             else if (_robot.Status == RState.End)
             {
+                WaferManager.Instance.WaferMoved(ModuleName.TM, (int)_hand, _targetModule, _targetSlot);
                 return true;
             }
             else

+ 14 - 2
Venus/Venus_RT/Modules/TM/MFPMSwapRoutine.cs

@@ -172,7 +172,13 @@ namespace Venus_RT.Modules.TM
 
         private bool WaitPMWaferDropDown()
         {
-            return _pmModule.Status == PMEntity.PMStatus.Exchange_Ready;
+            if (_pmModule.Status == PMEntity.PMStatus.Exchange_Ready)
+            {
+                WaferManager.Instance.WaferMoved(_targetModule, _targetSlot, ModuleName.TM, (int)_pickHand);
+                return true;
+            }
+
+            return false;
         }
 
         private bool WaitRobotRetractDone()
@@ -199,7 +205,13 @@ namespace Venus_RT.Modules.TM
         }
         private bool WaitPMWaferLiftUp()
         {
-            return _pmModule.Status == PMEntity.PMStatus.Exchange_Ready;
+            if(_pmModule.Status == PMEntity.PMStatus.Exchange_Ready)
+            {
+                WaferManager.Instance.WaferMoved(ModuleName.TM, (int)_placeHand, _targetModule, _targetSlot);
+                return true;
+            }
+
+            return false;
         }
 
         private bool NotifyPMDone()

+ 1 - 1
Venus/Venus_RT/Modules/TM/MFPickRoutine.cs

@@ -52,7 +52,7 @@ namespace Venus_RT.Modules.TM
 
             if(ModuleHelper.IsLoadLock(_targetModule) && ModuleHelper.IsInstalled(_targetModule))
             {
-                _llModule = _targetModule == ModuleName.LLA ? Singleton<RouteManager>.Instance.LLA : Singleton<RouteManager>.Instance.LLB;
+                _llModule = Singleton<RouteManager>.Instance.GetLL(_targetModule);
             }
             else
             {

+ 1 - 1
Venus/Venus_RT/Modules/TM/MFPlaceRoutine.cs

@@ -53,7 +53,7 @@ namespace Venus_RT.Modules.TM
 
             if (ModuleHelper.IsLoadLock(_targetModule) && ModuleHelper.IsInstalled(_targetModule))
             {
-                _llModule = _targetModule == ModuleName.LLA ? Singleton<RouteManager>.Instance.LLA : Singleton<RouteManager>.Instance.LLB;
+                _llModule = Singleton<RouteManager>.Instance.GetLL(_targetModule);
             }
             else
             {

+ 56 - 52
Venus/Venus_RT/Modules/TM/MFSwapRoutine.cs

@@ -8,6 +8,10 @@ using MECF.Framework.Common.SubstrateTrackings;
 using Venus_Core;
 using Aitex.Core.RT.Log;
 using Aitex.Core.Util;
+using System;
+using System.Text;
+using System.Collections.Generic;
+using MECF.Framework.Common.Schedulers;
 
 namespace Venus_RT.Modules.TM
 {
@@ -18,8 +22,8 @@ namespace Venus_RT.Modules.TM
             WaitModuleReady,
             ModulePrepare,
             OpenSlitDoor,
-            Picking,
-            Placing,
+            MoveWafer,
+            WaitMaferMoved,
             CloseSlitDoor,
             NotifyDone,
         }
@@ -30,8 +34,10 @@ namespace Venus_RT.Modules.TM
         private int _swapTimeout = 120 * 1000;
         private ModuleName _targetModule;
         private LLEntity _llModule;
-        int _pickSlot, _placeSlot;
-        Hand _pickHand, _placeHand;
+
+
+        Queue<MoveItem> _actionList = new Queue<MoveItem>();
+        MoveItem _currentAction;
 
         public MFSwapRoutine(JetTM tm, ITransferRobot robot) : base(ModuleName.TM)
         {
@@ -48,43 +54,22 @@ namespace Venus_RT.Modules.TM
                 return RState.Failed;
             }
 
-            _targetModule = (ModuleName)objs[0];
-            _pickSlot = (int)objs[1];
-            _placeSlot = (int)objs[2];
-            _pickHand = (Hand)objs[3];
-            _placeHand = _pickHand == Hand.Blade1 ? Hand.Blade2 : Hand.Blade1;
-
-            if (ModuleHelper.IsLoadLock(_targetModule) && ModuleHelper.IsInstalled(_targetModule))
-            {
-                _llModule = _targetModule == ModuleName.LLA ? Singleton<RouteManager>.Instance.LLA : Singleton<RouteManager>.Instance.LLB;
-            }
+            _actionList = (Queue<MoveItem>)objs[0];
+            var firtItem = _actionList.Peek();
+            if (ModuleHelper.IsLoadLock(firtItem.SourceModule))
+                _targetModule = firtItem.SourceModule;
+            else if (ModuleHelper.IsLoadLock(firtItem.DestinationModule))
+                _targetModule = firtItem.DestinationModule;
             else
             {
-                LOG.Write(eEvent.ERR_TM, Module, $"Invalid target module : {_targetModule} for picking action");
-                return RState.Failed;
-            }
-
-            if (WaferManager.Instance.CheckHasWafer(ModuleName.TM, (int)_pickHand))
-            {
-                LOG.Write(eEvent.ERR_TM, Module, $"Cannot pick as TM Robot Arm: {_pickHand} already has a wafer");
-                return RState.Failed;
-            }
-
-            if (WaferManager.Instance.CheckNoWafer(_targetModule, _pickSlot))
-            {
-                LOG.Write(eEvent.ERR_TM, Module, $"Cannot pick as {_targetModule} Slot {_pickSlot} has no wafer");
-                return RState.Failed;
-            }
-
-            if (WaferManager.Instance.CheckNoWafer(ModuleName.TM, (int)_placeHand))
-            {
-                LOG.Write(eEvent.ERR_TM, Module, $"Cannot place as TM Robot Arm: {_placeHand} has no wafer");
+                LOG.Write(eEvent.ERR_TM, Module, $"Invalid move parameter: {firtItem.SourceModule},{firtItem.SourceSlot} => {firtItem.DestinationModule},{firtItem.DestinationSlot} ");
                 return RState.Failed;
             }
 
-            if (WaferManager.Instance.CheckHasWafer(_targetModule, _placeSlot))
+            _llModule = Singleton<RouteManager>.Instance.GetLL(_targetModule);
+            if(_llModule == null)
             {
-                LOG.Write(eEvent.ERR_TM, Module, $"Cannot place as {_targetModule} Slot {_placeSlot} already has a wafer");
+                LOG.Write(eEvent.ERR_TM, Module, $"Invalid Loadlock: {_targetModule}, maybe not installed");
                 return RState.Failed;
             }
 
@@ -99,8 +84,8 @@ namespace Venus_RT.Modules.TM
             Runner.Wait((int)SwapStep.WaitModuleReady,  () => _llModule.IsIdle,     _delay_60s)
                 .Run((int)SwapStep.ModulePrepare,       ModulePrepare,              IsModulePrepareReady)
                 .Run((int)SwapStep.OpenSlitDoor,        OpenSlitDoor,               IsSlitDoorOpen)
-                .Run((int)SwapStep.Picking,             Picking,                    WaitPickDone)
-                .Run((int)SwapStep.Placing,             Placing,                    WaitPlaceDone)
+                .LoopStart((int)SwapStep.MoveWafer,     loopName(),                 _actionList.Count,      MoveWafer)
+                .LoopEnd((int)SwapStep.WaitMaferMoved,  NullFun,                    WaitWaferMoved)
                 .Run((int)SwapStep.CloseSlitDoor,       CloseSlitDoor,              IsSlitDoorClosed)
                 .End((int)SwapStep.NotifyDone,          NotifyLLDone,               _delay_50ms);
 
@@ -113,6 +98,11 @@ namespace Venus_RT.Modules.TM
             return true;
         }
 
+        private string loopName()
+        {
+            return "LoadLock Swap" ;
+        }
+
         private bool IsModulePrepareReady()
         {
             return _llModule.Status == LLEntity.LLStatus.Ready_For_TM;
@@ -144,33 +134,46 @@ namespace Venus_RT.Modules.TM
                 return _JetTM.IsLLBSlitDoorClosed;
         }
 
-        private bool Picking()
+        private bool VerifyWaferExistence(MoveItem item)
         {
-            return _robot.Pick(_targetModule, _pickSlot, _pickHand);
+            if (WaferManager.Instance.CheckHasWafer(item.DestinationModule, item.DestinationSlot))
+            {
+                LOG.Write(eEvent.ERR_TM, Module, $"Cannot move wafer as desitination {_currentAction.DestinationModule},{_currentAction.DestinationSlot} already a wafer: ");
+                return false;
+            }
+
+            if (WaferManager.Instance.CheckNoWafer(_currentAction.SourceModule, _currentAction.SourceSlot))
+            {
+                LOG.Write(eEvent.ERR_TM, Module, $"Cannot move wafer as source {_currentAction.SourceModule}, {_currentAction.SourceSlot} has no wafer");
+                return false;
+            }
+
+            return true;
         }
 
-        private bool WaitPickDone()
+        private bool MoveWafer()
         {
-            if (_robot.Status == RState.Running)
-            {
+            _currentAction = _actionList.Dequeue();
+
+            if (!VerifyWaferExistence(_currentAction))
                 return false;
+
+            if(ModuleHelper.IsLoadLock(_currentAction.SourceModule) && ModuleHelper.IsTM(_currentAction.DestinationModule))
+            {
+                return _robot.Pick(_currentAction.SourceModule, _currentAction.SourceSlot, (Hand)_currentAction.DestinationSlot);
             }
-            else if (_robot.Status == RState.End)
+            else if(ModuleHelper.IsTM(_currentAction.SourceModule) && ModuleHelper.IsLoadLock(_currentAction.DestinationModule))
             {
-                return true;
+                return _robot.Place(_currentAction.DestinationModule, _currentAction.DestinationSlot, (Hand)_currentAction.SourceSlot);
             }
             else
             {
-                Runner.Stop($"TM Robot Picking failed, {_robot.Status}");
-                return true;
+                LOG.Write(eEvent.ERR_TM_ROBOT, ModuleName.TM, $"Invalid move parameter, source:{_currentAction.SourceModule},{_currentAction.SourceSlot}, destination: {_currentAction.DestinationModule}, {_currentAction.DestinationSlot}");
+                return false;
             }
         }
-        private bool Placing()
-        {
-            return _robot.Place(_targetModule, _placeSlot, _placeHand);
-        }
 
-        private bool WaitPlaceDone()
+        private bool WaitWaferMoved()
         {
             if (_robot.Status == RState.Running)
             {
@@ -178,11 +181,12 @@ namespace Venus_RT.Modules.TM
             }
             else if (_robot.Status == RState.End)
             {
+                WaferManager.Instance.WaferMoved(_currentAction.SourceModule, _currentAction.SourceSlot, _currentAction.DestinationModule, _currentAction.DestinationSlot);
                 return true;
             }
             else
             {
-                Runner.Stop($"TM Robot Place failed, {_robot.Status}");
+                Runner.Stop($"TM Robot moving wafer failed, {_robot.Status}");
                 return true;
             }
         }

+ 12 - 1
Venus/Venus_RT/Modules/TM/TMEntity.cs

@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Generic;
 using Aitex.Core.RT.Fsm;
 using Aitex.Core.RT.Log;
 using Aitex.Core.Util;
@@ -10,6 +11,7 @@ using Venus_RT.Devices;
 using Venus_RT.Modules.TM;
 using Aitex.Core.RT.DataCenter;
 using Aitex.Core.RT.OperationCenter;
+using MECF.Framework.Common.Schedulers;
 
 namespace Venus_RT.Modules
 {
@@ -53,6 +55,9 @@ namespace Venus_RT.Modules
             Pick, 
             Place,
             Swap,
+            DoublePick,
+            DoublePlace,
+            DoubleSwap,
             PMPick,
             PMPlace,
             PMSwap,
@@ -135,6 +140,7 @@ namespace Venus_RT.Modules
 
 
             DATA.Subscribe("TM.FsmState", () => (((PMState)fsm.State).ToString()));
+            DATA.Subscribe("TM.RobotMoveAction", () => _robot.TMRobotMoveInfo) ;
             return true;
         }
 
@@ -549,7 +555,12 @@ namespace Venus_RT.Modules
             }
             else if(flag == 6)
             {
-                PostMsg(MSG.Swap, ModuleName.LLA, 0, 2, 0);
+                Queue<MoveItem> items = new Queue<MoveItem>();
+                items.Enqueue(new MoveItem(ModuleName.TM, 0, ModuleName.LLA, 0, Hand.Blade1));
+                items.Enqueue(new MoveItem(ModuleName.TM, 1, ModuleName.LLA, 1, Hand.Blade2));
+                items.Enqueue(new MoveItem(ModuleName.LLA, 0, ModuleName.TM, 0, Hand.Blade1));
+                items.Enqueue(new MoveItem(ModuleName.LLA, 1, ModuleName.TM, 1, Hand.Blade2));
+                PostMsg(MSG.Swap,items);
             }
             else if(flag == 7)
             {

+ 131 - 0
Venus/Venus_RT/Modules/TMCycle.cs

@@ -0,0 +1,131 @@
+using Aitex.Core.RT.Routine;
+using Aitex.Core.RT.SCCore;
+using Aitex.Sorter.Common;
+using Venus_RT.Devices;
+using MECF.Framework.Common.Routine;
+using MECF.Framework.Common.Equipment;
+using MECF.Framework.Common.SubstrateTrackings;
+using Venus_Core;
+using Aitex.Core.RT.Log;
+using Aitex.Core.Util;
+using System.Collections.Generic;
+using System.Linq;
+using Venus_RT.Modules.Schedulers;
+using Venus_RT.Scheduler;
+using System;
+
+namespace Venus_RT.Modules
+{
+    class TMCycle : ModuleRoutineBase, IRoutine
+    {
+        enum TMCycleStep
+        {
+            Start,
+            ReturnBack,
+            Cycling,
+            End,
+        }
+
+        private bool IsModuleAvailable(ModuleName module) => dictSchedulers.Keys.Contains(module) && dictSchedulers[module].IsAvailable;
+
+        List<ModuleName> tmCycleRoutine = new List<ModuleName>() { ModuleName.LLA, ModuleName.PMA, ModuleName.PMB, ModuleName.LLB };
+        int cycleCount = 1;
+        ModuleName _sourceModule = ModuleName.LLA;
+        ModuleName _destinationModule = ModuleName.LLB;
+        SchedulerTMRobot _TMRobot = new SchedulerTMRobot();
+
+        Dictionary<ModuleName, SchedulerModule> dictSchedulers = new Dictionary<ModuleName, SchedulerModule>();
+        public TMCycle() : base(ModuleName.System)
+        {
+            Name = "TM Cycle";
+
+            void _initMoudle(ModuleName name, SchedulerModule sche)
+            {
+                if (ModuleHelper.IsInstalled(name))
+                {
+                    dictSchedulers[name] = sche;
+                }
+            }
+
+            _initMoudle(ModuleName.LLA, new SchedulerLoadLock(ModuleName.LLA));
+            _initMoudle(ModuleName.LLB, new SchedulerLoadLock(ModuleName.LLB));
+            _initMoudle(ModuleName.PMA, new SchedulerPM(ModuleName.PMA));
+            _initMoudle(ModuleName.PMB, new SchedulerPM(ModuleName.PMB));
+            _initMoudle(ModuleName.PMC, new SchedulerPM(ModuleName.PMC));
+            _initMoudle(ModuleName.PMD, new SchedulerPM(ModuleName.PMD));
+        }
+
+        public RState Start(params object[] objs)
+        {
+            if (objs.Length == 2)
+            {
+                var modules = ((string[])objs[0]).ToList();
+                if (modules.Count >= 2)
+                    tmCycleRoutine.Clear();
+
+                foreach(var mod in modules)
+                {
+                    try
+                    {
+                        ModuleName module = ModuleHelper.Converter(mod);
+                        tmCycleRoutine.Add(module);
+                    }
+                    catch(Exception _)
+                    {
+                        LOG.Write(eEvent.ERR_ROUTER, "TMCycle", $"Invalid module string: {mod}");
+                        return RState.Failed;
+                    }
+                }
+                cycleCount = (int)objs[1];
+            }
+
+            return Runner.Start(Module, Name);
+        }
+
+        public RState Monitor()
+        {
+            Runner.Run((int)TMCycleStep.Start,                      NullFun)
+                .LoopStart((int)TMCycleStep.ReturnBack, "Cycle",    cycleCount,     ReturnBack,     IsReturnDone)
+                .LoopEnd((int)TMCycleStep.Cycling,      Cycling,    IsCycleDone)
+                .End((int)TMCycleStep.End,              NullFun,    _delay_50ms);
+
+            return Runner.Status;
+        }
+
+        private bool ReturnBack()
+        {
+            if(_TMRobot.IsAvailable)
+            {
+                for(int i = 0; i < tmCycleRoutine.Count - 1; i++)
+                {
+                    if(IsModuleAvailable(tmCycleRoutine[i]) && IsModuleAvailable(tmCycleRoutine[i+1]))
+                    {
+
+                    }
+                }
+            }
+
+            return true;
+        }
+
+        private bool IsReturnDone()
+        {
+            return true;
+        }
+
+        private bool Cycling()
+        {
+            return true;
+        }
+
+        private bool IsCycleDone()
+        {
+            return true;
+        }
+
+        public void Abort()
+        {
+
+        }
+    }
+}

+ 4 - 0
Venus/Venus_RT/Venus_RT.csproj

@@ -164,6 +164,7 @@
   <ItemGroup>
     <Compile Include="Instances\RtInstance.cs" />
     <Compile Include="Instances\ToolLoader.cs" />
+    <Compile Include="Modules\AutoCycle.cs" />
     <Compile Include="Modules\EFEM\EfemEntity.cs" />
     <Compile Include="Modules\EntityTaskBase.cs" />
     <Compile Include="Modules\LLs\LLEntity.cs" />
@@ -206,10 +207,13 @@
     <Compile Include="Modules\Schedulers\SchedulerAligner.cs" />
     <Compile Include="Modules\Schedulers\SchedulerDBCallback.cs" />
     <Compile Include="Modules\Schedulers\SchedulerEfemRobot.cs" />
+    <Compile Include="Modules\Schedulers\SchedulerLoadLock.cs" />
     <Compile Include="Modules\Schedulers\SchedulerLoadPort.cs" />
     <Compile Include="Modules\Schedulers\SchedulerModule.cs" />
     <Compile Include="Modules\Schedulers\SchedulerPM.cs" />
+    <Compile Include="Modules\Schedulers\SchedulerTMRobot.cs" />
     <Compile Include="Modules\Schedulers\TransferModule.cs" />
+    <Compile Include="Modules\TMCycle.cs" />
     <Compile Include="Modules\TM\MFHomeRoutine.cs" />
     <Compile Include="Modules\TM\MFLeakCheckRoutine.cs" />
     <Compile Include="Modules\TM\MFPickRoutine.cs" />