| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 | using System;using System.Collections.Generic;using Aitex.Core.RT.RecipeCenter;using FurnaceRT.Equipments.Schedulers;using MECF.Framework.Common.Equipment;using MECF.Framework.Common.SubstrateTrackings;using MECF.Framework.FA.Core.E40FA;using MECF.Framework.FA.Core.E94FA;using MECF.Framework.FA.Core.FAInterface;namespace FurnaceRT.Equipments.Systems{    public partial class EquipmentManager    {        private SchedulerDBCallback _dbCallback;        public void CreatePj(string processName)        {            _auto.CreatePj(processName);        }        public void StartPj()        {            _auto.StartPj();        }        public void EndPj(string endStatus = "Normal")        {            _auto.EndPj(endStatus);        }    }    public partial class EquipmentManager : IJobControlCallBack    {        private Dictionary<string, string> moduleJobIdDictionary = new Dictionary<string, string>();        public bool AssignProcessJob(ProcessMaterialName matrial, string recipe, ProcessRecipeMethod method, Dictionary<string, object> RecVariableList, string pjID)        {            string lp = CarrierManager.Instance.GetLocationByCarrierId(matrial.CarrierID);            string[] slotsequence = new string[25];            for (int i = 0; i < 25; i++)            {                if (matrial.SlotID.Contains(i + 1)) slotsequence[i] = recipe;                else slotsequence[i] = "";            }            Dictionary<string, object> para = new Dictionary<string, object>();            para.Add("JobId", pjID);            para.Add("LotId", pjID);            para.Add("Module", lp);            para.Add("SlotSequence", slotsequence);            para.Add("AutoStart", true);            return CheckToPostMessage((int)MSG.CreateJob, para);        }        public bool AssignControlJob(string cjID, string module, List<string> pjList)        {            return CheckToPostMessage((int)MSG.StartJob, pjList);        }        public bool RegisterEvent(bool isAlarm, string eventname, string eventcontext)        {            return true;        }        public bool PostEvent(bool isAlarm, string eventname, Dictionary<string, string> dvid, Dictionary<string, object> objdvid)        {            return true;        }        public bool ExcuteCommand(string command, object[] paras, out string reason)        {            int _port, _startslot, _endslot;            string _portId;            string _module = "";            string _jobId;            string[] _recipenames;            reason = "";            switch (command)            {                //case "PP-SELECT":                //    _portId = paras[0].ToString();                //    if (_portId == "1") _module = ModuleName.LP1.ToString();                //    else if (_portId == "2") _module = ModuleName.LP2.ToString();                //    else if (_portId == "3") _module = ModuleName.LP3.ToString();                //    else if (_portId == "4") _module = ModuleName.LP4.ToString();                //    string jobId = paras[1].ToString();                //    string[] slotsequence = (string[])paras[2];                //    for (int i = 0; i < slotsequence.Length; i++)                //    {                //        slotsequence[i] = slotsequence[i] == "*null*" ? "" : slotsequence[i];                //    }                //    Dictionary<string, object> para = new Dictionary<string, object>();                //    para.Add("JobId", jobId);                //    para.Add("Module", _module);                //    para.Add("SlotSequence", slotsequence);                //    para.Add("AutoStart", true);                //    if (Check((int)MSG.CreateJob, out reason) && _auto.CreateJob(para, out reason))                //    {                //        moduleJobIdDictionary[_module] = jobId;                //        return true;                //    }                //    return false;                case "START":                    _portId = paras[0].ToString();                    if (_portId == "1") _module = ModuleName.LP1.ToString();                    else if (_portId == "2") _module = ModuleName.LP2.ToString();                    else if (_portId == "3") _module = ModuleName.LP3.ToString();                    else if (_portId == "4") _module = ModuleName.LP4.ToString();                    return CheckToPostMessage((int)MSG.StartJob, new object[] { moduleJobIdDictionary[_module] });                case "STOP":                    _portId = paras[0].ToString();                    if (_portId == "1") _module = ModuleName.LP1.ToString();                    else if (_portId == "2") _module = ModuleName.LP2.ToString();                    else if (_portId == "3") _module = ModuleName.LP3.ToString();                    else if (_portId == "4") _module = ModuleName.LP4.ToString();                    return CheckToPostMessage((int)MSG.StopJob, new object[] { moduleJobIdDictionary[_module] });                case "ABORT":                case "ABORT_JOB":                    _portId = paras[0].ToString();                    if (_portId == "1") _module = ModuleName.LP1.ToString();                    else if (_portId == "2") _module = ModuleName.LP2.ToString();                    else if (_portId == "3") _module = ModuleName.LP3.ToString();                    else if (_portId == "4") _module = ModuleName.LP4.ToString();                    return CheckToPostMessage((int)MSG.AbortJob, new object[] { moduleJobIdDictionary[_module] });                case "PAUSE":                    _portId = paras[0].ToString();                    if (_portId == "1") _module = ModuleName.LP1.ToString();                    else if (_portId == "2") _module = ModuleName.LP2.ToString();                    else if (_portId == "3") _module = ModuleName.LP3.ToString();                    else if (_portId == "4") _module = ModuleName.LP4.ToString();                    return CheckToPostMessage((int)MSG.PauseJob, new object[] { moduleJobIdDictionary[_module] });                case "RESUME":                    _portId = paras[0].ToString();                    if (_portId == "1") _module = ModuleName.LP1.ToString();                    else if (_portId == "2") _module = ModuleName.LP2.ToString();                    else if (_portId == "3") _module = ModuleName.LP3.ToString();                    else if (_portId == "4") _module = ModuleName.LP4.ToString();                    return CheckToPostMessage((int)MSG.ResumeJob, new object[] { moduleJobIdDictionary[_module] });            }            return false;        }        public string[] GetRecipeList(string param)        {            if (param == "SEQUENCE")                return RecipeFileManager.Instance.GetSequenceNameList().ToArray();            if (param == "RECIPE")            {                List<string> result = new List<string>();                foreach (var recipeName in RecipeFileManager.Instance.GetRecipes("Track\\AD", true))                {                    result.Add("AD\\" + recipeName);                }                return result.ToArray();            }            return RecipeFileManager.Instance.GetSequenceNameList().ToArray();        }        public string GetRecipeBody(string param, string recipename)        {            if (param == "SEQUENCE")                return RecipeFileManager.Instance.GetSequence(recipename, false);            if (param == "RECIPE")            {                string chamberId = recipename.Split('\\')[0];                string recipe = recipename.Split('\\')[1];                return RecipeFileManager.Instance.LoadRecipe("Track\\" + chamberId, recipe, false);            }            return RecipeFileManager.Instance.GetSequence(recipename, false);        }    }}
 |