123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using MECF.Framework.Common.DataCenter;
- using OpenSEMI.ClientBase.Handlers;
- using OpenSEMI.ClientBase;
- using ACC = Aitex.Core.Common;
- namespace VirgoUI.Client.Models.Sys
- {
- public class WaferStatusImp
- {
- public WaferStatusImp(IQueryDataService dataService)
- {
- DataService = dataService;
- }
- public List<WaferInfo> GetWaferStatus(string moduleID)
- {
- List<WaferInfo> result = new List<WaferInfo>();
- string param = moduleID + ".ModuleWaferList";
- ACC.WaferInfo[] wafers = QueryDataClient.Instance.Service.GetData(param) as ACC.WaferInfo[];
- if (wafers != null)
- {
- for (int i = 0; i < wafers.Length; i++)
- {
- result.Add(WaferInfoConverter(wafers[i], moduleID, i));
- }
- }
- return result;
- }
- private WaferInfo WaferInfoConverter(ACC.WaferInfo awafer, string modid, int slotid)
- {
- WaferInfo wafer = new WaferInfo();
- wafer.ModuleID = modid;
- wafer.SlotID = slotid;
- wafer.SlotIndex = slotid + 1;
- wafer.WaferID = awafer.WaferID;
- wafer.SourceName = awafer.WaferOrigin;
- wafer.WaferStatus = WaferStatusConverter(awafer);
- return wafer;
- }
- //0: trans?
- //1:goden
- //2:blue
- //3:cyan
- //4:green
- //5:error
- private int WaferStatusConverter(ACC.WaferInfo awafer)
- {
- if (awafer.Status == ACC.WaferStatus.Empty)
- return 0;
- if (awafer.Status == ACC.WaferStatus.Normal)
- {
- switch (awafer.ProcessState)
- {
- case ACC.EnumWaferProcessStatus.InProcess: return 3;
- case ACC.EnumWaferProcessStatus.Completed: return 4;
- case ACC.EnumWaferProcessStatus.Failed: return 5;
- case ACC.EnumWaferProcessStatus.Idle: return awafer.ProcessJob == null ? 1 : 2;
- }
- }
- if (awafer.Status == ACC.WaferStatus.Dummy)
- {
- return 1;
- }
- return 5;
- }
- private IQueryDataService DataService;
- }
- }
|