| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 | using System;using System.Text.RegularExpressions;using System.Threading;using System.Threading.Tasks;using Aitex.Core.UI.Control;using MECF.Framework.Simulator.Core.Driver;using Aitex.Core.Util;using Venus_Core;namespace Venus_Simulator.Devices{    class TMSimulatorServer : SocketDeviceSimulator    {        private readonly Regex _check_load  = new Regex(@"CHECK LOAD\s+(\d+)\s+ARM\s+(A|B)\s*");        private readonly Regex _move_arm    = new Regex(@"(PLACE|PICK)\s+(\d+)\s+SLOT\s+(\d+)\s+ARM\s+(A|B)\s+(\w{4})\s*");        private readonly Regex _move_wafer = new Regex(@"(PLACE|PICK)\s+(\d+)\s+SLOT\s+(\d+)\s+ARM\s+(A|B)\s*");        private PeriodicJob _HwThread;        public TMSimulatorServer() : base(1102, -1, "\r\n", ' ')        {            _HwThread = new PeriodicJob(500, OnSendEvent, "EfemHardware", true);        }        private bool OnSendEvent()        {                return true;        }        protected override void ProcessUnsplitMessage(string str)        {            if(str.Contains("HOME") || str.Contains("GOTO") || str.Contains("XFER"))            {                OnWriteMessage("_RDY");            }            if(_check_load.IsMatch(str))            {                Match result = _check_load.Match(str);                string station = result.Groups[1].Value;                string arm = result.Groups[2].Value;                OnWriteMessage(string.Format($"LOAD {arm} OFF"));            }            else if(_move_arm.IsMatch(str))            {                // @"(PLACE|PICK)\s+(\d+)\s+SLOT\s+(\d+)\s+ARM\s+(A|B)\s+(\w{4})\s+"                Match result = _move_arm.Match(str);                string operation = result.Groups[1].Value;                string station = result.Groups[2].Value;                string slot = result.Groups[3].Value;                string arm = result.Groups[4].Value;                string dir = result.Groups[5].Value;                Thread.Sleep(5000);                OnWriteMessage("_RDY");            }            else if(_move_wafer.IsMatch(str))            {                // @"(PLACE|PICK)\s+(\d+)\s+SLOT\s+(\d+)\s+ARM\s+(A|B)\s+"                Match result = _move_wafer.Match(str);                string operation = result.Groups[1].Value;                string station = result.Groups[2].Value;                string slot = result.Groups[3].Value;                string arm = result.Groups[4].Value;                Thread.Sleep(5000);                OnWriteMessage("_RDY");            }        }    }}
 |