123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading;
- using Aitex.Core.RT.Job;
- using Aitex.Platform;
- using Aitex.Core.Equipment.SusceptorDefine;
- using Aitex.Core.RT.DBCore;
- using Aitex.Triton160.Common;
- namespace Aitex.Triton160.RT.Routine.Process
- {
- /// <summary>
- /// 工艺运行记录类
- /// </summary>
- public class ProcessRecorder
- {
- public ProcessRecorder()
- {
- }
- public void BeginNewProcess(JobInfo job)
- {
- string sql = string.Format("INSERT INTO \"RecipeRunHistory\"(\"RecipeRunGuid\", \"UserDefinedId\", \"ProcessIn\", \"ProcessBeginTime\", \"Description\", \"RecipeName\", \"SusceptorStatus\" , \"SusceptorId\" )VALUES ('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}');",
- job.RecipeRunId,
- job.RecipeRunningName,
- job.ProcessModuleName,
- job.ProcessStartTime.ToString("yyyy/MM/dd HH:mm:ss.fff"),
- job.Description,
- job.RecipeBaseName,
- job.JobResult,
- job.LotId);
- DB.Insert(sql);
- }
- /// <summary>
- /// update process status
- /// </summary>
- /// <param name="recipeRunGuid"></param>
- /// <param name="newStatus"></param>
- public void UpdateProcessStatus(Guid recipeRunGuid, JobStatus newStatus)
- {
- string sql = string.Format("UPDATE \"RecipeRunHistory\" SET \"SusceptorStatus\"='{0}' WHERE \"RecipeRunGuid\"='{1}';",
- newStatus,
- recipeRunGuid);
- DB.Insert(sql);
- }
- /// <summary>
- /// update process recipe name
- /// </summary>
- /// <param name="susceptorId"></param>
- /// <param name="newRecipeName"></param>
- public void UpdateProcessRecipeName(Guid recipeRunGuid, string newRecipeName)
- {
- string sql = string.Format("UPDATE \"RecipeRunHistory\" SET \"UserDefinedId\"='{0}' WHERE \"RecipeRunGuid\"='{1}';",
- newRecipeName,
- recipeRunGuid);
- DB.Insert(sql);
- }
- /// <summary>
- /// update process status when process ended
- /// </summary>
- /// <param name="recipeRunGuid"></param>
- /// <param name="status"></param>
- public void EndRecipeProcess(Guid recipeRunGuid, SusceptorStatus status)
- {
- string sql = string.Format("UPDATE \"RecipeRunHistory\" SET \"ProcessEndTime\"='{0}', \"SusceptorStatus\"='{1}' WHERE \"RecipeRunGuid\"='{2}';",
- DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss.fff"),
- status,
- recipeRunGuid);
- DB.Insert(sql);
- }
- /// <summary>
- /// Add susceptor related records into database
- /// </summary>
- /// <param name="recipeRunGuid"></param>
- /// <param name="itemType"></param>
- /// <param name="itemData"></param>
- /// <param name="description"></param>
- public void AddRecord(Guid recipeRunGuid, CarrierDataType itemType, string itemData, string description)
- {
- string sql = string.Format("INSERT INTO \"SusceptorData\"(\"Time\", \"SusceptorId\", \"ItemType\", \"ItemData\", \"ItemRemark\") VALUES ('{0}','{1}','{2}','{3}','{4}');",
- DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss.fff"),
- recipeRunGuid,
- itemType,
- itemData,
- description);
- DB.Insert(sql);
- }
- }
- }
|