using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml; using Aitex.Core.Common; using Aitex.Core.RT.DataCenter; using Aitex.Core.RT.Log; using Aitex.Core.RT.SCCore; using Aitex.Core.Util; using MECF.Framework.Common.CommonData; using MECF.Framework.Common.DBCore; using MECF.Framework.Common.Equipment; using MECF.Framework.Common.Jobs; using MECF.Framework.Common.SubstrateTrackings; namespace JetVirgoPM.PMs.RecipeExecutors { public interface IRecipeDBCallback { void RecipeStart(string module, int slot, string guid, string recipeName); void RecipeComplete(string guid); void RecipeStepStart(string recipeGuid, int stepNumber, string stepName, float stepTime); void RecipeStepEnd(string recipeGuid, int stepNumber, List data); void RecipeFailed(string guid); } class RecipeDBCallback : IRecipeDBCallback { public void RecipeStart(string module, int slot, string guid, string recipeName) { string waferId = "",slotID="",lotID=""; WaferInfo waferInfo = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), slot); if (!waferInfo.IsEmpty) { waferId = waferInfo.InnerId.ToString(); slotID = waferInfo.OriginSlot.ToString(); lotID = waferInfo.ProcessJob == null || string.IsNullOrEmpty(waferInfo.ProcessJob.ControlJobName) ? "" : waferInfo.ProcessJob.ControlJobName; } ProcessDataRecorder.Start(guid, recipeName, waferId, $"{module}{slot+1}",lotID,slotID); } public void RecipeUpdateStatus(string guid, string status, float recipeSettingTime) { ProcessDataRecorder.UpdateStatus(guid, status); ProcessDataRecorder.UpdateRecipeSettingTime(guid, recipeSettingTime); } public void RecipeComplete(string guid) { ProcessDataRecorder.End(guid, "Succeed"); } public void RecipeStepStart(string recipeGuid, int stepNumber, string stepName, float stepTime) { ProcessDataRecorder.StepStart(recipeGuid, stepNumber + 1, stepName, stepTime); } public void RecipeStepEnd(string recipeGuid, int stepNumber, List fdc) { ProcessDataRecorder.StepEnd(recipeGuid, stepNumber + 1, fdc); } public void RecipeFailed(string guid) { ProcessDataRecorder.End(guid, "Failed"); } } }