diff --git a/Adaptation/FileHandlers/Dummy/FileRead.cs b/Adaptation/FileHandlers/Dummy/FileRead.cs index 3b777eb..e87c842 100644 --- a/Adaptation/FileHandlers/Dummy/FileRead.cs +++ b/Adaptation/FileHandlers/Dummy/FileRead.cs @@ -97,9 +97,9 @@ public class FileRead : Shared.FileRead, IFileRead private void CallbackInProcessCleared(string sourceArchiveFile, string traceDummyFile, string targetFileLocation, string monARessource, string inProcessDirectory, long sequence, bool warning) { - const string site = "sjc"; + const string site = "els"; string stateName = string.Concat("Dummy_", _EventName); - const string monInURL = "http://moninhttp.sjc.infineon.com/input/text"; + const string monInURL = $"http://moninhttp.{site}.infineon.com/input/text"; MonIn monIn = MonIn.GetInstance(monInURL); try { diff --git a/Adaptation/FileHandlers/OpenInsight/FromIQS.cs b/Adaptation/FileHandlers/OpenInsight/FromIQS.cs index 5032d3c..8b0efa4 100644 --- a/Adaptation/FileHandlers/OpenInsight/FromIQS.cs +++ b/Adaptation/FileHandlers/OpenInsight/FromIQS.cs @@ -178,7 +178,7 @@ public class FromIQS results.Add($" and pl.f_name = '{description.RDS}' "); results.Add($" and pr.f_name = '{description.Reactor}' "); results.Add($" and pd.f_name = '{description.PSN}' "); - results.Add(" and jd.f_name in ('SP101') "); + results.Add(" and jd.f_name in ('SP101', 'TBI01') "); results.Add($" and jd.f_name = '{logistics.MesEntity}' "); results.Add($" and dateadd(HH, -7, (dateadd(SS, convert(bigint, se.f_sgtm), '19700101'))) = '{dateTime}' "); results.Add(" ) as iq "); diff --git a/Adaptation/FileHandlers/TIBCO/Transport/Job.cs b/Adaptation/FileHandlers/TIBCO/Transport/Job.cs index a1a1b17..99acc33 100644 --- a/Adaptation/FileHandlers/TIBCO/Transport/Job.cs +++ b/Adaptation/FileHandlers/TIBCO/Transport/Job.cs @@ -707,7 +707,7 @@ public partial class Job { "MET08ANLYSDIFAAST230" => "'SPV01'", "MET08DDUPSFS6420" => "'TENCOR1','TENCOR2','TENCOR3'", - "MET08DDUPSP1TBI" => "'SP101'", + "MET08DDUPSP1TBI" => "'SP101','TBI01'", "MET08RESIHGCV" => "'HGCV1','HGCV2','HGCV3'", "MET08RESIMAPCDE" => "'CDE1','CDE2','CDE3','CDE4','CDE5','CDE6'", "MET08RESISRP2100" => "'SRP'", diff --git a/Adaptation/FileHandlers/txt/Description.cs b/Adaptation/FileHandlers/txt/Description.cs index 2c5e7f6..053164f 100644 --- a/Adaptation/FileHandlers/txt/Description.cs +++ b/Adaptation/FileHandlers/txt/Description.cs @@ -1110,7 +1110,7 @@ public class Description : IDescription, Shared.Properties.IDescription return result; } - private Description GetDefault(IFileRead fileRead, Logistics logistics) + private static Description GetDefault(IFileRead fileRead, Logistics logistics) { Description result = new() { @@ -1449,6 +1449,15 @@ public class Description : IDescription, Shared.Properties.IDescription return result; } + internal static JsonElement GetDefaultJsonElement(IFileRead fileRead, Logistics logistics) + { + JsonElement result; + Description description = GetDefault(fileRead, logistics); + string json = JsonSerializer.Serialize(description, DescriptionSourceGenerationContext.Default.Description); + result = JsonSerializer.Deserialize(json); + return result; + } + internal static string GetDateFormat() => "MM/dd/yyyy hh:mm:ss tt"; } diff --git a/Adaptation/FileHandlers/txt/FileRead.cs b/Adaptation/FileHandlers/txt/FileRead.cs index 345180c..a2e2f99 100644 --- a/Adaptation/FileHandlers/txt/FileRead.cs +++ b/Adaptation/FileHandlers/txt/FileRead.cs @@ -98,38 +98,37 @@ public class FileRead : Shared.FileRead, IFileRead private Tuple> GetExtractResult(string reportFullPath, DateTime dateTime) { - Tuple> results = new(string.Empty, Array.Empty(), Array.Empty(), new List()); + Tuple> results; + Test[] tests = Array.Empty(); + List jsonElements = new(); + List fileInfoCollection = new(); _TickOffset ??= 0; // new FileInfo(reportFullPath).LastWriteTime.Ticks - dateTime.Ticks; _Logistics = new Logistics(this, _TickOffset.Value, reportFullPath, useSplitForMID: true); + fileInfoCollection.Add(_Logistics.FileInfo); SetFileParameterLotIDToLogisticsMID(); if (_Logistics.FileInfo.Length < _MinFileLength) - results.Item4.Add(_Logistics.FileInfo); + results = new(string.Empty, tests, jsonElements.ToArray(), fileInfoCollection); else { - Run? run = Run.Get(_Logistics, results.Item4); + Run? run = Run.Get(_Logistics, fileInfoCollection); if (run is null) - throw new Exception(string.Concat("A) No Data - ", dateTime.Ticks)); - IProcessData iProcessData = new ProcessData(this, _Logistics, results.Item4); - if (iProcessData is not ProcessData processData) - results = new(string.Concat("B) No Data - ", dateTime.Ticks), Array.Empty(), Array.Empty(), results.Item4); + results = new(string.Concat("A) No Data - ", dateTime.Ticks), tests, jsonElements.ToArray(), fileInfoCollection); else { string mid; - if (!string.IsNullOrEmpty(processData.Lot) && string.IsNullOrEmpty(processData.Reactor) && string.IsNullOrEmpty(processData.RDS) && string.IsNullOrEmpty(processData.PSN)) - mid = processData.Lot; - else if (!string.IsNullOrEmpty(processData.Employee) && string.IsNullOrEmpty(processData.Reactor) && string.IsNullOrEmpty(processData.RDS) && string.IsNullOrEmpty(processData.PSN)) - mid = processData.Employee; + Descriptor descriptor = ProcessData.GetDescriptor(run.Header.Lot); + if (!string.IsNullOrEmpty(descriptor.Lot) && string.IsNullOrEmpty(descriptor.Reactor) && string.IsNullOrEmpty(descriptor.RDS) && string.IsNullOrEmpty(descriptor.PSN)) + mid = descriptor.Lot; + else if (!string.IsNullOrEmpty(descriptor.Employee) && string.IsNullOrEmpty(descriptor.Reactor) && string.IsNullOrEmpty(descriptor.RDS) && string.IsNullOrEmpty(descriptor.PSN)) + mid = descriptor.Employee; else - { - mid = string.Concat(processData.Reactor, "-", processData.RDS, "-", processData.PSN); - mid = Regex.Replace(mid, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0]; - } + mid = string.Concat(descriptor.Reactor, "-", descriptor.RDS, "-", descriptor.PSN); + mid = Regex.Replace(mid, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0]; SetFileParameterLotID(mid); - _Logistics.Update(mid, processData.Reactor); - if (iProcessData.Details.Count > 0) - results = iProcessData.GetResults(this, _Logistics, results.Item4); - else - results = new(string.Concat("C) No Data - ", dateTime.Ticks), Array.Empty(), Array.Empty(), results.Item4); + _Logistics.Update(mid, descriptor.Reactor); + JsonElement jsonElement = Description.GetDefaultJsonElement(this, _Logistics); + jsonElements.Add(jsonElement); + results = new(_Logistics.Logistics1[0], tests, jsonElements.ToArray(), fileInfoCollection); } } return results; diff --git a/Adaptation/FileHandlers/txt/ProcessData.cs b/Adaptation/FileHandlers/txt/ProcessData.cs index 8bbd270..08cde5a 100644 --- a/Adaptation/FileHandlers/txt/ProcessData.cs +++ b/Adaptation/FileHandlers/txt/ProcessData.cs @@ -1,13 +1,11 @@ using Adaptation.Shared; using Adaptation.Shared.Methods; -using log4net; using System; using System.Collections.Generic; using System.Data; using System.IO; using System.Linq; using System.Text.Json; -using System.Text.Json.Serialization; using System.Text.RegularExpressions; namespace Adaptation.FileHandlers.txt; @@ -15,12 +13,6 @@ namespace Adaptation.FileHandlers.txt; public class ProcessData : IProcessData { - private int _I; - private string _Data; - - private readonly ILog _Log; - private readonly List _Details; - public string JobID { get; set; } public string MesEntity { get; set; } public DateTime Date { get; set; } @@ -273,196 +265,17 @@ public class ProcessData : IProcessData public string Session { get; set; } public string UniqueID { get; set; } - List Shared.Properties.IProcessData.Details => _Details; + List Shared.Properties.IProcessData.Details { get; } - public ProcessData(IFileRead fileRead, Logistics logistics, List fileInfoCollection) - { - _Details = new List(); - _I = 0; - _Data = string.Empty; - JobID = logistics.JobID; - Date = GetDateTime(logistics); - MesEntity = logistics.MesEntity; - _Log = LogManager.GetLogger(typeof(ProcessData)); - Parse(fileRead, logistics, fileInfoCollection); - } + string IProcessData.GetCurrentReactor(IFileRead fileRead, Logistics logistics, Dictionary reactors) => + throw new Exception(string.Concat("See ", nameof(ProcessData))); + + Tuple> IProcessData.GetResults(IFileRead fileRead, Logistics logistics, List fileInfoCollection) => + throw new NotImplementedException(); private static DateTime GetDateTime(Logistics logistics) => logistics.DateTimeFromSequence; - string IProcessData.GetCurrentReactor(IFileRead fileRead, Logistics logistics, Dictionary reactors) => throw new Exception(string.Concat("See ", nameof(Parse))); - - Tuple> IProcessData.GetResults(IFileRead fileRead, Logistics logistics, List fileInfoCollection) - { - Tuple> results; - List tests = new(); - foreach (object item in _Details) - tests.Add(Test.SP1); - List descriptions = fileRead.GetDescriptions(fileRead, tests, this); - if (tests.Count != descriptions.Count) - throw new Exception(); - for (int i = 0; i < tests.Count; i++) - { - if (descriptions[i] is not Description description) - throw new Exception(); - if (description.Test != (int)tests[i]) - throw new Exception(); - } - FileInfo fileInfo = new($"{logistics.ReportFullPath}.descriptions.json"); - List fileReadDescriptions = (from l in descriptions select (Description)l).ToList(); - string json = JsonSerializer.Serialize(fileReadDescriptions, fileReadDescriptions.GetType()); - File.WriteAllText(fileInfo.FullName, json); - File.SetLastWriteTime(fileInfo.FullName, logistics.DateTimeFromSequence); - fileInfoCollection.Add(fileInfo); - JsonElement[] jsonElements = JsonSerializer.Deserialize(json) ?? throw new Exception(); - results = new Tuple>(logistics.Logistics1[0], tests.ToArray(), jsonElements, fileInfoCollection); - return results; - } - - private void ScanPast(string text) - { - int num = _Data.IndexOf(text, _I); - if (num > -1) - _I = num + text.Length; - else - _I = _Data.Length; - } - - private string GetBefore(string text) - { - int num = _Data.IndexOf(text, _I); - if (num > -1) - { - string str = _Data.Substring(_I, num - _I); - _I = num + text.Length; - return str.Trim(); - } - string str1 = _Data.Substring(_I); - _I = _Data.Length; - return str1.Trim(); - } - - private string GetBefore(string text, bool trim) - { - if (trim) - return GetBefore(text); - int num = _Data.IndexOf(text, _I); - if (num > -1) - { - string str = _Data.Substring(_I, num - _I); - _I = num + text.Length; - return str; - } - string str1 = _Data.Substring(_I); - _I = _Data.Length; - return str1; - } - - private static bool IsNullOrWhiteSpace(string text) - { - for (int index = 0; index < text.Length; ++index) - { - if (!char.IsWhiteSpace(text[index])) - return false; - } - return true; - } - - private bool IsBlankLine() - { - int num = _Data.IndexOf("\n", _I); - return IsNullOrWhiteSpace(num > -1 ? _Data.Substring(_I, num - _I) : _Data.Substring(_I)); - } - - private string GetToEOL() => GetBefore("\n"); - - private string GetToEOL(bool trim) - { - if (trim) - return GetToEOL(); - return GetBefore("\n", false); - } - - private string GetToText(string text) => _Data.Substring(_I, _Data.IndexOf(text, _I) - _I).Trim(); - - private string GetToken() - { - while (_I < _Data.Length && IsNullOrWhiteSpace(_Data.Substring(_I, 1))) - ++_I; - int j = _I; - while (j < _Data.Length && !IsNullOrWhiteSpace(_Data.Substring(j, 1))) - ++j; - string str = _Data.Substring(_I, j - _I); - _I = j; - return str.Trim(); - } - - private string PeekNextLine() - { - int j = _I; - string toEol = GetToEOL(); - _I = j; - return toEol; - } - - private void GetWaferSummaryInfo(List waferSummaryInfos, string whichInfo) - { - ScanPast(whichInfo); - _ = GetToEOL(); - _ = GetToEOL(); - _ = GetToEOL(); - _ = GetToEOL(); - string[] segments; - WaferSummaryInfo waferSummaryInfo; - const string grade = "F Grade"; - const string reject = "F Reject"; - const string overLoad = "F OverLoad"; - for (string line = PeekNextLine(); line[0] != '-'; line = PeekNextLine()) - { - line = GetToEOL(); - waferSummaryInfo = new WaferSummaryInfo(); - if (line.StartsWith(grade)) - line = line.Replace(grade, string.Concat("F -1", grade.Substring(4))); - else if (line.StartsWith(reject)) - line = line.Replace(reject, string.Concat("F -1", reject.Substring(4))); - else if (line.StartsWith(overLoad)) - line = line.Replace(overLoad, string.Concat("F -1", overLoad.Substring(4))); - segments = line.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - waferSummaryInfo.Side = segments[0]; - waferSummaryInfo.WaferID = segments[1]; - waferSummaryInfo.Grade = segments[2]; - waferSummaryInfo.SrcDest = segments[3]; - if (segments.Length > 4) - { - waferSummaryInfo.Lpd = segments[5]; - waferSummaryInfo.LpdN = segments[6]; - waferSummaryInfo.LpdES = segments[7]; - waferSummaryInfo.MicroScr = segments[8]; - waferSummaryInfo.Scr = segments[9]; - waferSummaryInfo.Slip = segments[10]; - waferSummaryInfo.AreaNum = segments[11]; - waferSummaryInfo.Area = segments[12]; - waferSummaryInfo.HazeAvg = segments[13]; - waferSummaryInfo.HazeMedian = segments[14]; - waferSummaryInfo.HazeStdDev = segments[15]; - waferSummaryInfo.Bin1 = segments[16]; - waferSummaryInfo.Bin2 = segments[17]; - waferSummaryInfo.Bin3 = segments[18]; - waferSummaryInfo.Bin4 = segments[19]; - waferSummaryInfo.Bin5 = segments[20]; - waferSummaryInfo.Bin6 = segments[21]; - waferSummaryInfo.Bin7 = segments[22]; - waferSummaryInfo.Bin8 = segments[23]; - } - if (waferSummaryInfo.WaferID == "-1") - { - segments = waferSummaryInfo.SrcDest.Split('-')[0].Split('/'); - waferSummaryInfo.WaferID = segments[segments.Length - 1]; - } - waferSummaryInfos.Add(waferSummaryInfo); - } - } - private static (string, string) GetReactorAndRDS(string defaultReactor, string defaultRDS, string text, string formattedText, string[] segments) { string rds; @@ -589,471 +402,6 @@ public class ProcessData : IProcessData return result; } - private void Set(ILogistics logistics, string summaryReportText) - { - _I = 0; - string lot; - string rds; - string psn; - string recipe; - string reactor; - string session; - string employee; - Descriptor descriptor; - _Data = summaryReportText; - _Log.Debug("HeaderFile() - Beginning"); - if (string.IsNullOrEmpty(summaryReportText)) - { - recipe = string.Empty; - session = string.Empty; - descriptor = GetDescriptor(summaryReportText); - lot = descriptor.Lot; - psn = descriptor.PSN; - rds = descriptor.RDS; - reactor = descriptor.Reactor; - employee = descriptor.Employee; - } - else - { - ScanPast("Long Wafer Summary"); - _ = GetToEOL(); - ScanPast("Session:"); - recipe = GetToEOL(true); - session = recipe; - ScanPast("Lot ID:"); - lot = GetToEOL(true); - descriptor = GetDescriptor(lot); - lot = descriptor.Lot; - psn = descriptor.PSN; - rds = descriptor.RDS; - reactor = descriptor.Reactor; - employee = descriptor.Employee; - } - Lot = lot; - PSN = psn; - RDS = rds; - Recipe = recipe; - Reactor = reactor; - Session = session; - Employee = employee; - UniqueID = string.Format("{0}_{1}_{2}", logistics.JobID, lot, Path.GetFileNameWithoutExtension(logistics.ReportFullPath)); - } - - private void ParseHeader(ILogistics logistics, List dcnTotals, List dwnTotals, List dnnTotals) - { - _I = 0; - _Data = string.Empty; - string summaryReportText = File.ReadAllText(logistics.ReportFullPath); - Set(logistics, summaryReportText); - if (!string.IsNullOrEmpty(summaryReportText)) - { - _Log.Debug("HeaderFile() - Debug B"); - _I = 0; - string[] segments; - _Data = summaryReportText; - GetWaferSummaryInfo(dcnTotals, "DCN Totals"); - ScanPast("Min"); - segments = GetToEOL().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - DcnAllMin = segments[0]; - DcnLpdMin = segments[1]; - DcnLpdNMin = segments[2]; - DcnLpdESMin = segments[3]; - DcnMicroScrMin = segments[4]; - DcnScrMin = segments[5]; - DcnSlipMin = segments[6]; - DcnAreaCountMin = segments[7]; - DcnAreaMin = segments[8]; - DcnHazeAvgMin = segments[9]; - DcnHazeMedianMin = segments[10]; - DcnHazeStdDevMin = segments[11]; - DcnBin1Min = segments[12]; - DcnBin2Min = segments[13]; - DcnBin3Min = segments[14]; - DcnBin4Min = segments[15]; - DcnBin5Min = segments[16]; - DcnBin6Min = segments[17]; - DcnBin7Min = segments[18]; - DcnBin8Min = segments[19]; - ScanPast("Max"); - segments = GetToEOL().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - DcnAllMax = segments[0]; - DcnLpdMax = segments[1]; - DcnLpdNMax = segments[2]; - DcnLpdESMax = segments[3]; - DcnMicroScrMax = segments[4]; - DcnScrMax = segments[5]; - DcnSlipMax = segments[6]; - DcnAreaCountMax = segments[7]; - DcnAreaMax = segments[8]; - DcnHazeAvgMax = segments[9]; - DcnHazeMedianMax = segments[10]; - DcnHazeStdDevMax = segments[11]; - DcnBin1Max = segments[12]; - DcnBin2Max = segments[13]; - DcnBin3Max = segments[14]; - DcnBin4Max = segments[15]; - DcnBin5Max = segments[16]; - DcnBin6Max = segments[17]; - DcnBin7Max = segments[18]; - DcnBin8Max = segments[19]; - ScanPast("Mean"); - segments = GetToEOL().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - DcnAllMean = segments[0]; - DcnLpdMean = segments[1]; - DcnLpdNMean = segments[2]; - DcnLpdESMean = segments[3]; - DcnMicroScrMean = segments[4]; - DcnScrMean = segments[5]; - DcnSlipMean = segments[6]; - DcnAreaCountMean = segments[7]; - DcnAreaMean = segments[8]; - DcnHazeAvgMean = segments[9]; - DcnHazeMedianMean = segments[10]; - DcnHazeStdDevMean = segments[11]; - DcnBin1Mean = segments[12]; - DcnBin2Mean = segments[13]; - DcnBin3Mean = segments[14]; - DcnBin4Mean = segments[15]; - DcnBin5Mean = segments[16]; - DcnBin6Mean = segments[17]; - DcnBin7Mean = segments[18]; - DcnBin8Mean = segments[19]; - ScanPast("Std. Dev."); - segments = GetToEOL().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - DcnAllStdDev = segments[0]; - DcnLpdStdDev = segments[1]; - DcnLpdNStdDev = segments[2]; - DcnLpdESStdDev = segments[3]; - DcnMicroScrStdDev = segments[4]; - DcnScrStdDev = segments[5]; - DcnSlipStdDev = segments[6]; - DcnAreaCountStdDev = segments[7]; - DcnAreaStdDev = segments[8]; - DcnHazeAvgStdDev = segments[9]; - DcnHazeMedianStdDev = segments[10]; - DcnHazeStdDevStdDev = segments[11]; - DcnBin1StdDev = segments[12]; - DcnBin2StdDev = segments[13]; - DcnBin3StdDev = segments[14]; - DcnBin4StdDev = segments[15]; - DcnBin5StdDev = segments[16]; - DcnBin6StdDev = segments[17]; - DcnBin7StdDev = segments[18]; - DcnBin8StdDev = segments[19]; - _I = 0; - _Data = summaryReportText; - _Log.Debug("HeaderFile() - Debug C"); - if (!_Data.Contains("DWN Totals")) - { - for (int i = 0; i < dcnTotals.Count; i++) - dwnTotals.Add(new WaferSummaryInfo()); - } - else - { - GetWaferSummaryInfo(dwnTotals, "DWN Totals"); - ScanPast("Min"); - segments = GetToEOL().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - DwnAllMin = segments[0]; - DwnLpdMin = segments[1]; - DwnLpdNMin = segments[2]; - DwnLpdESMin = segments[3]; - DwnMicroScrMin = segments[4]; - DwnScrMin = segments[5]; - DwnSlipMin = segments[6]; - DwnAreaCountMin = segments[7]; - DwnAreaMin = segments[8]; - DwnHazeAvgMin = segments[9]; - DwnHazeMedianMin = segments[10]; - DwnHazeStdDevMin = segments[11]; - DwnBin1Min = segments[12]; - DwnBin2Min = segments[13]; - DwnBin3Min = segments[14]; - DwnBin4Min = segments[15]; - DwnBin5Min = segments[16]; - DwnBin6Min = segments[17]; - DwnBin7Min = segments[18]; - DwnBin8Min = segments[19]; - ScanPast("Max"); - segments = GetToEOL().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - DwnAllMax = segments[0]; - DwnLpdMax = segments[1]; - DwnLpdNMax = segments[2]; - DwnLpdESMax = segments[3]; - DwnMicroScrMax = segments[4]; - DwnScrMax = segments[5]; - DwnSlipMax = segments[6]; - DwnAreaCountMax = segments[7]; - DwnAreaMax = segments[8]; - DwnHazeAvgMax = segments[9]; - DwnHazeMedianMax = segments[10]; - DwnHazeStdDevMax = segments[11]; - DwnBin1Max = segments[12]; - DwnBin2Max = segments[13]; - DwnBin3Max = segments[14]; - DwnBin4Max = segments[15]; - DwnBin5Max = segments[16]; - DwnBin6Max = segments[17]; - DwnBin7Max = segments[18]; - DwnBin8Max = segments[19]; - ScanPast("Mean"); - segments = GetToEOL().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - DwnAllMean = segments[0]; - DwnLpdMean = segments[1]; - DwnLpdNMean = segments[2]; - DwnLpdESMean = segments[3]; - DwnMicroScrMean = segments[4]; - DwnScrMean = segments[5]; - DwnSlipMean = segments[6]; - DwnAreaCountMean = segments[7]; - DwnAreaMean = segments[8]; - DwnHazeAvgMean = segments[9]; - DwnHazeMedianMean = segments[10]; - DwnHazeStdDevMean = segments[11]; - DwnBin1Mean = segments[12]; - DwnBin2Mean = segments[13]; - DwnBin3Mean = segments[14]; - DwnBin4Mean = segments[15]; - DwnBin5Mean = segments[16]; - DwnBin6Mean = segments[17]; - DwnBin7Mean = segments[18]; - DwnBin8Mean = segments[19]; - ScanPast("Std. Dev."); - segments = GetToEOL().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - DwnAllStdDev = segments[0]; - DwnLpdStdDev = segments[1]; - DwnLpdNStdDev = segments[2]; - DwnLpdESStdDev = segments[3]; - DwnMicroScrStdDev = segments[4]; - DwnScrStdDev = segments[5]; - DwnSlipStdDev = segments[6]; - DwnAreaCountStdDev = segments[7]; - DwnAreaStdDev = segments[8]; - DwnHazeAvgStdDev = segments[9]; - DwnHazeMedianStdDev = segments[10]; - DwnHazeStdDevStdDev = segments[11]; - DwnBin1StdDev = segments[12]; - DwnBin2StdDev = segments[13]; - DwnBin3StdDev = segments[14]; - DwnBin4StdDev = segments[15]; - DwnBin5StdDev = segments[16]; - DwnBin6StdDev = segments[17]; - DwnBin7StdDev = segments[18]; - DwnBin8StdDev = segments[19]; - } - _I = 0; - _Data = summaryReportText; - _Log.Debug("HeaderFile() - Debug D"); - if (!_Data.Contains("DNN Totals")) - { - for (int i = 0; i < dcnTotals.Count; i++) - dnnTotals.Add(new WaferSummaryInfo()); - } - else - { - GetWaferSummaryInfo(dnnTotals, "DNN Totals"); - ScanPast("Min"); - segments = GetToEOL().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - DnnAllMin = segments[0]; - DnnLpdMin = segments[1]; - DnnLpdNMin = segments[2]; - DnnLpdESMin = segments[3]; - DnnMicroScrMin = segments[4]; - DnnScrMin = segments[5]; - DnnSlipMin = segments[6]; - DnnAreaCountMin = segments[7]; - DnnAreaMin = segments[8]; - DnnHazeAvgMin = segments[9]; - DnnHazeMedianMin = segments[10]; - DnnHazeStdDevMin = segments[11]; - DnnBin1Min = segments[12]; - DnnBin2Min = segments[13]; - DnnBin3Min = segments[14]; - DnnBin4Min = segments[15]; - DnnBin5Min = segments[16]; - DnnBin6Min = segments[17]; - DnnBin7Min = segments[18]; - DnnBin8Min = segments[19]; - ScanPast("Max"); - segments = GetToEOL().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - DnnAllMax = segments[0]; - DnnLpdMax = segments[1]; - DnnLpdNMax = segments[2]; - DnnLpdESMax = segments[3]; - DnnMicroScrMax = segments[4]; - DnnScrMax = segments[5]; - DnnSlipMax = segments[6]; - DnnAreaCountMax = segments[7]; - DnnAreaMax = segments[8]; - DnnHazeAvgMax = segments[9]; - DnnHazeMedianMax = segments[10]; - DnnHazeStdDevMax = segments[11]; - DnnBin1Max = segments[12]; - DnnBin2Max = segments[13]; - DnnBin3Max = segments[14]; - DnnBin4Max = segments[15]; - DnnBin5Max = segments[16]; - DnnBin6Max = segments[17]; - DnnBin7Max = segments[18]; - DnnBin8Max = segments[19]; - ScanPast("Mean"); - segments = GetToEOL().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - DnnAllMean = segments[0]; - DnnLpdMean = segments[1]; - DnnLpdNMean = segments[2]; - DnnLpdESMean = segments[3]; - DnnMicroScrMean = segments[4]; - DnnScrMean = segments[5]; - DnnSlipMean = segments[6]; - DnnAreaCountMean = segments[7]; - DnnAreaMean = segments[8]; - DnnHazeAvgMean = segments[9]; - DnnHazeMedianMean = segments[10]; - DnnHazeStdDevMean = segments[11]; - DnnBin1Mean = segments[12]; - DnnBin2Mean = segments[13]; - DnnBin3Mean = segments[14]; - DnnBin4Mean = segments[15]; - DnnBin5Mean = segments[16]; - DnnBin6Mean = segments[17]; - DnnBin7Mean = segments[18]; - DnnBin8Mean = segments[19]; - ScanPast("Std. Dev."); - segments = GetToEOL().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - DnnAllStdDev = segments[0]; - DnnLpdStdDev = segments[1]; - DnnLpdNStdDev = segments[2]; - DnnLpdESStdDev = segments[3]; - DnnMicroScrStdDev = segments[4]; - DnnScrStdDev = segments[5]; - DnnSlipStdDev = segments[6]; - DnnAreaCountStdDev = segments[7]; - DnnAreaStdDev = segments[8]; - DnnHazeAvgStdDev = segments[9]; - DnnHazeMedianStdDev = segments[10]; - DnnHazeStdDevStdDev = segments[11]; - DnnBin1StdDev = segments[12]; - DnnBin2StdDev = segments[13]; - DnnBin3StdDev = segments[14]; - DnnBin4StdDev = segments[15]; - DnnBin5StdDev = segments[16]; - DnnBin6StdDev = segments[17]; - DnnBin7StdDev = segments[18]; - DnnBin8StdDev = segments[19]; - } - } - } - - /// - /// Parse the wafer summary data - /// - /// wafer data - /// wafer index - /// - private Detail ParseWaferSummary(int i, List dcnTotals, List dwnTotals, List dnnTotals) - { - Detail result = new() - { - // NOTE: get the UniqueID during DataCalculation in order to retrieve the SPCToolID from the cell component Tag field. - // id - - // General Wafer Info - Side = dcnTotals[i].Side, - WaferID = dcnTotals[i].WaferID, - Grade = dcnTotals[i].Grade, - SrcDest = dcnTotals[i].SrcDest, - - // Dcn Info - DcnAll = dcnTotals[i].All ?? string.Empty, - DcnLpd = dcnTotals[i].Lpd ?? string.Empty, - DcnLpdN = dcnTotals[i].LpdN ?? string.Empty, - DcnLpdES = dcnTotals[i].LpdES ?? string.Empty, - DcnMicroScr = dcnTotals[i].MicroScr ?? string.Empty, - DcnScr = dcnTotals[i].Scr ?? string.Empty, - DcnSlip = dcnTotals[i].Slip ?? string.Empty, - DcnAreaCount = dcnTotals[i].AreaNum ?? string.Empty, - DcnArea = dcnTotals[i].Area ?? string.Empty, - DcnHazeAvg = dcnTotals[i].HazeAvg ?? string.Empty, - DcnHazeMedian = dcnTotals[i].HazeMedian ?? string.Empty, - DcnHazeStdDev = dcnTotals[i].HazeStdDev ?? string.Empty, - DcnBin1 = dcnTotals[i].Bin1 ?? string.Empty, - DcnBin2 = dcnTotals[i].Bin2 ?? string.Empty, - DcnBin3 = dcnTotals[i].Bin3 ?? string.Empty, - DcnBin4 = dcnTotals[i].Bin4 ?? string.Empty, - DcnBin5 = dcnTotals[i].Bin5 ?? string.Empty, - DcnBin6 = dcnTotals[i].Bin6 ?? string.Empty, - DcnBin7 = dcnTotals[i].Bin7 ?? string.Empty, - DcnBin8 = dcnTotals[i].Bin8 ?? string.Empty, - - // Dwn Info - DwnAll = dwnTotals[i].All ?? string.Empty, - DwnLpd = dwnTotals[i].Lpd ?? string.Empty, - DwnLpdN = dwnTotals[i].LpdN ?? string.Empty, - DwnLpdES = dwnTotals[i].LpdES ?? string.Empty, - DwnMicroScr = dwnTotals[i].MicroScr ?? string.Empty, - DwnScr = dwnTotals[i].Scr ?? string.Empty, - DwnSlip = dwnTotals[i].Slip ?? string.Empty, - DwnAreaCount = dwnTotals[i].AreaNum ?? string.Empty, - DwnArea = dwnTotals[i].Area ?? string.Empty, - DwnHazeAvg = dwnTotals[i].HazeAvg ?? string.Empty, - DwnHazeMedian = dwnTotals[i].HazeMedian ?? string.Empty, - DwnHazeStdDev = dwnTotals[i].HazeStdDev ?? string.Empty, - DwnBin1 = dwnTotals[i].Bin1 ?? string.Empty, - DwnBin2 = dwnTotals[i].Bin2 ?? string.Empty, - DwnBin3 = dwnTotals[i].Bin3 ?? string.Empty, - DwnBin4 = dwnTotals[i].Bin4 ?? string.Empty, - DwnBin5 = dwnTotals[i].Bin5 ?? string.Empty, - DwnBin6 = dwnTotals[i].Bin6 ?? string.Empty, - DwnBin7 = dwnTotals[i].Bin7 ?? string.Empty, - DwnBin8 = dwnTotals[i].Bin8 ?? string.Empty, - - // Dnn Info - DnnAll = dnnTotals[i].All ?? string.Empty, - DnnLpd = dnnTotals[i].Lpd ?? string.Empty, - DnnLpdN = dnnTotals[i].LpdN ?? string.Empty, - DnnLpdES = dnnTotals[i].LpdES ?? string.Empty, - DnnMicroScr = dnnTotals[i].MicroScr ?? string.Empty, - DnnScr = dnnTotals[i].Scr ?? string.Empty, - DnnSlip = dnnTotals[i].Slip ?? string.Empty, - DnnAreaCount = dnnTotals[i].AreaNum ?? string.Empty, - DnnArea = dnnTotals[i].Area ?? string.Empty, - DnnHazeAvg = dnnTotals[i].HazeAvg ?? string.Empty, - DnnHazeMedian = dnnTotals[i].HazeMedian ?? string.Empty, - DnnHazeStdDev = dnnTotals[i].HazeStdDev ?? string.Empty, - DnnBin1 = dnnTotals[i].Bin1 ?? string.Empty, - DnnBin2 = dnnTotals[i].Bin2 ?? string.Empty, - DnnBin3 = dnnTotals[i].Bin3 ?? string.Empty, - DnnBin4 = dnnTotals[i].Bin4 ?? string.Empty, - DnnBin5 = dnnTotals[i].Bin5 ?? string.Empty, - DnnBin6 = dnnTotals[i].Bin6 ?? string.Empty, - DnnBin7 = dnnTotals[i].Bin7 ?? string.Empty, - DnnBin8 = dnnTotals[i].Bin8 ?? string.Empty, - HeaderUniqueID = UniqueID - }; - result.UniqueID = string.Concat(result.HeaderUniqueID, "_", result.WaferID.PadLeft(2, '0')); - return result; - } - - private void Parse(IFileRead fileRead, Logistics logistics, List fileInfoCollection) - { - if (fileRead is null) - throw new ArgumentNullException(nameof(fileRead)); - Detail dataFile; - foreach (string file in Directory.GetFiles(Path.GetDirectoryName(logistics.ReportFullPath), "WaferMap*.prn", SearchOption.TopDirectoryOnly)) - fileInfoCollection.Add(new FileInfo(file)); - List dcnTotals = new(); - List dwnTotals = new(); - List dnnTotals = new(); - ParseHeader(logistics, dcnTotals, dwnTotals, dnnTotals); - _Log.Debug($"Number of wafers: {dcnTotals.Count}"); - for (int i = 0; i < dcnTotals.Count; i++) - { - _Log.Debug($"****ParseData - Parsing wafer summary: {i}"); - dataFile = ParseWaferSummary(i, dcnTotals, dwnTotals, dnnTotals); - _Details.Add(dataFile); - } - fileInfoCollection.Add(logistics.FileInfo); - } - #nullable enable internal static List GetDescriptions(JsonElement[] jsonElements) diff --git a/Adaptation/FileHandlers/txt/Run.cs b/Adaptation/FileHandlers/txt/Run.cs index 5762d21..280c707 100644 --- a/Adaptation/FileHandlers/txt/Run.cs +++ b/Adaptation/FileHandlers/txt/Run.cs @@ -90,6 +90,14 @@ internal class Run File.WriteAllText($"{logistics.ReportFullPath}.csv", string.Join(Environment.NewLine, lines)); } + private static void AddPrintFiles(Logistics logistics, List fileInfoCollection) + { + string sourceDirectory = Path.GetDirectoryName(logistics.ReportFullPath) ?? throw new Exception(); + string[] files = Directory.GetFiles(sourceDirectory, "WaferMap*.prn", SearchOption.TopDirectoryOnly); + foreach (string file in files) + fileInfoCollection.Add(new FileInfo(file)); + } + internal static Run? Get(Logistics logistics, List fileInfoCollection) { Run? result; @@ -111,13 +119,13 @@ internal class Run else { result = new(header, summary, wafers); + AddPrintFiles(logistics, fileInfoCollection); WriteJson(logistics, fileInfoCollection, result); WriteCommaSeparatedValues(logistics, result); } } return result; } - } [JsonSourceGenerationOptions(WriteIndented = true)] diff --git a/Adaptation/_Tests/Shared/AdaptationTesting.cs b/Adaptation/_Tests/Shared/AdaptationTesting.cs index e49ae57..78b2dfe 100644 --- a/Adaptation/_Tests/Shared/AdaptationTesting.cs +++ b/Adaptation/_Tests/Shared/AdaptationTesting.cs @@ -1001,22 +1001,22 @@ public class AdaptationTesting : ISMTP { try { - if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.ErrorTargetFileLocation)) + if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.ErrorTargetFileLocation) && !fileConnectorConfigurationTuple.Item2.ErrorTargetFileLocation.Contains("10.")) { if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.ErrorTargetFileLocation)) _ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.ErrorTargetFileLocation); } - if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.SourceFileLocation)) + if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.SourceFileLocation) && !fileConnectorConfigurationTuple.Item2.SourceFileLocation.Contains("10.")) { if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.SourceFileLocation)) _ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.SourceFileLocation); } - if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.TargetFileLocation)) + if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.TargetFileLocation) && !fileConnectorConfigurationTuple.Item2.TargetFileLocation.Contains("10.")) { if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.TargetFileLocation)) _ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.TargetFileLocation); } - if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.AlternateTargetFolder)) + if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.AlternateTargetFolder) && !fileConnectorConfigurationTuple.Item2.AlternateTargetFolder.Contains("10.")) { if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.AlternateTargetFolder.Split('|')[0])) _ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.AlternateTargetFolder.Split('|')[0]); diff --git a/Adaptation/_Tests/Static/recipes-and-patterns.js b/Adaptation/_Tests/Static/recipes-and-patterns.js index bf7e398..625b4de 100644 --- a/Adaptation/_Tests/Static/recipes-and-patterns.js +++ b/Adaptation/_Tests/Static/recipes-and-patterns.js @@ -35,7 +35,7 @@ function getValue(tool, patternSize, recipe, pattern, json) { debug += 'patternSize: ' + toolMatches[index].patternSize + '; recipe: ' + toolMatches[index].recipe + '; pattern: ' + toolMatches[index].pattern + ';~'; - if (toolMatches[index].recipe.localeCompare(recipe, ['en-US'], { sensitivity: 'base' }) === 0) { + if (toolMatches[index].recipe.toLowerCase() == recipe.toLowerCase()) { matches++; } }