|
@@ -7,6 +7,7 @@ using System.Windows;
|
|
|
using System.Windows.Threading;
|
|
|
using Aitex.Core.RT.Log;
|
|
|
using Aitex.Core.Util;
|
|
|
+using DocumentFormat.OpenXml.Drawing.Charts;
|
|
|
using MECF.Framework.Common.DataCenter;
|
|
|
using MECF.Framework.Common.OperationCenter;
|
|
|
using RTDefine = Aitex.Core.Common;
|
|
@@ -39,68 +40,78 @@ namespace MECF.Framework.UI.Client.ClientBase
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- var changeModule = QueryDataClient.Instance.Service.GetData("System.ChangeWafers");
|
|
|
- if (changeModule is Dictionary<string, bool> module && module?.Count > 0)
|
|
|
+ Dictionary<string, object> data = new Dictionary<string, object>();
|
|
|
+ var enableUpdateWafersNotify = (bool)QueryDataClient.Instance.Service.GetConfig("System.EnableUpdateWafersNotify");
|
|
|
+ if (enableUpdateWafersNotify)
|
|
|
{
|
|
|
- var changedModule = module.Where(r => r.Value);
|
|
|
- if (!changedModule.Any()) return true;
|
|
|
- InvokeClient.Instance.Service.DoOperation("System.UpdateWafersNotify", changeModule);
|
|
|
- Dictionary<string, object> data = QueryDataClient.Instance.Service.PollData(changedModule.Select(r => $"{r.Key}.ModuleWaferList"));
|
|
|
+ var changeModule = QueryDataClient.Instance.Service.GetData("System.ChangeWafers");
|
|
|
+ if (changeModule is Dictionary<string, bool> module && module?.Count > 0)
|
|
|
+ {
|
|
|
+ var changedModule = module.Where(r => r.Value);
|
|
|
+ if (!changedModule.Any()) return true;
|
|
|
+ InvokeClient.Instance.Service.DoOperation("System.UpdateWafersNotify", changeModule);
|
|
|
+ data = QueryDataClient.Instance.Service.PollData(changedModule.Select(r => $"{r.Key}.ModuleWaferList"));
|
|
|
|
|
|
- if (data != null && Application.Current != null)
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ data = QueryDataClient.Instance.Service.PollData(_lstWaferDataName);
|
|
|
+ }
|
|
|
+ if (data != null && Application.Current != null)
|
|
|
+ {
|
|
|
+ Application.Current.Dispatcher.Invoke(new Action(() =>
|
|
|
{
|
|
|
- Application.Current.Dispatcher.Invoke(new Action(() =>
|
|
|
+ foreach (var waferData in data)
|
|
|
{
|
|
|
- foreach (var waferData in data)
|
|
|
- {
|
|
|
- if (!_mapWaferDataModule.ContainsKey(waferData.Key))
|
|
|
- continue;
|
|
|
+ if (!_mapWaferDataModule.ContainsKey(waferData.Key))
|
|
|
+ continue;
|
|
|
|
|
|
- RTDefine.WaferInfo[] wafers = waferData.Value as RTDefine.WaferInfo[];
|
|
|
- if (wafers == null)
|
|
|
- continue;
|
|
|
+ RTDefine.WaferInfo[] wafers = waferData.Value as RTDefine.WaferInfo[];
|
|
|
+ if (wafers == null)
|
|
|
+ continue;
|
|
|
|
|
|
- ModuleInfo info = _mapWaferDataModule[waferData.Key];
|
|
|
- if (info.WaferManager.Wafers.Count == 0)
|
|
|
+ ModuleInfo info = _mapWaferDataModule[waferData.Key];
|
|
|
+ if (info.WaferManager.Wafers.Count == 0)
|
|
|
+ {
|
|
|
+ for (int i = 0; i < wafers.Length; i++)
|
|
|
{
|
|
|
- for (int i = 0; i < wafers.Length; i++)
|
|
|
- {
|
|
|
- info.WaferManager.Wafers.Add(WaferInfoConverter(wafers[i], info.WaferModuleID, i));
|
|
|
- }
|
|
|
+ info.WaferManager.Wafers.Add(WaferInfoConverter(wafers[i], info.WaferModuleID, i));
|
|
|
+ }
|
|
|
|
|
|
- if (info.IsWaferReverseDisplay)
|
|
|
- {
|
|
|
- info.WaferManager.Wafers = new ObservableCollection<WaferInfo>(info.WaferManager.Wafers.Reverse());
|
|
|
- }
|
|
|
- continue;
|
|
|
+ if (info.IsWaferReverseDisplay)
|
|
|
+ {
|
|
|
+ info.WaferManager.Wafers = new ObservableCollection<WaferInfo>(info.WaferManager.Wafers.Reverse());
|
|
|
}
|
|
|
+ continue;
|
|
|
+ }
|
|
|
|
|
|
- if (wafers.Length == info.WaferManager.Wafers.Count)
|
|
|
+ if (wafers.Length == info.WaferManager.Wafers.Count)
|
|
|
+ {
|
|
|
+ int index;
|
|
|
+ for (int i = 0; i < wafers.Length; i++)
|
|
|
{
|
|
|
- int index;
|
|
|
- for (int i = 0; i < wafers.Length; i++)
|
|
|
- {
|
|
|
- if (info.IsWaferReverseDisplay)
|
|
|
- index = wafers.Length - i - 1;
|
|
|
- else
|
|
|
- index = i;
|
|
|
-
|
|
|
- var convertedWafer = WaferInfoConverter(wafers[index], info.WaferModuleID, index);
|
|
|
- info.WaferManager.Wafers[i].WaferStatus = convertedWafer.WaferStatus;
|
|
|
- info.WaferManager.Wafers[i].WaferID = convertedWafer.WaferID;
|
|
|
- info.WaferManager.Wafers[i].SourceName = convertedWafer.SourceName;
|
|
|
- info.WaferManager.Wafers[i].WaferType = convertedWafer.WaferType;
|
|
|
- info.WaferManager.Wafers[i].UseCount = convertedWafer.UseCount;
|
|
|
- info.WaferManager.Wafers[i].UseTime = convertedWafer.UseTime;
|
|
|
- info.WaferManager.Wafers[i].UseThick = convertedWafer.UseThick;
|
|
|
- info.WaferManager.Wafers[i].Thick = convertedWafer.Thick;
|
|
|
- info.WaferManager.Wafers[i].LotId = convertedWafer.LotId;
|
|
|
- info.WaferManager.Wafers[i].ProcessJobID = convertedWafer.ProcessJobID;
|
|
|
- }
|
|
|
+ if (info.IsWaferReverseDisplay)
|
|
|
+ index = wafers.Length - i - 1;
|
|
|
+ else
|
|
|
+ index = i;
|
|
|
+
|
|
|
+ var convertedWafer = WaferInfoConverter(wafers[index], info.WaferModuleID, index);
|
|
|
+ info.WaferManager.Wafers[i].WaferStatus = convertedWafer.WaferStatus;
|
|
|
+ info.WaferManager.Wafers[i].WaferID = convertedWafer.WaferID;
|
|
|
+ info.WaferManager.Wafers[i].SourceName = convertedWafer.SourceName;
|
|
|
+ info.WaferManager.Wafers[i].WaferType = convertedWafer.WaferType;
|
|
|
+ info.WaferManager.Wafers[i].UseCount = convertedWafer.UseCount;
|
|
|
+ info.WaferManager.Wafers[i].UseTime = convertedWafer.UseTime;
|
|
|
+ info.WaferManager.Wafers[i].UseThick = convertedWafer.UseThick;
|
|
|
+ info.WaferManager.Wafers[i].Thick = convertedWafer.Thick;
|
|
|
+ info.WaferManager.Wafers[i].LotId = convertedWafer.LotId;
|
|
|
+ info.WaferManager.Wafers[i].ProcessJobID = convertedWafer.ProcessJobID;
|
|
|
}
|
|
|
}
|
|
|
- }));
|
|
|
- }
|
|
|
+ }
|
|
|
+ }));
|
|
|
}
|
|
|
}
|
|
|
catch (Exception ex)
|