From 8e5c8a24a13499991e0a60a36ec5ca3fc33303d5 Mon Sep 17 00:00:00 2001 From: Mike Phares Date: Tue, 9 May 2023 16:39:52 -0700 Subject: [PATCH] Slot from Stratus --- Adaptation/FileHandlers/QS408M/Footer.cs | 18 ++---------------- Adaptation/FileHandlers/QS408M/ProcessData.cs | 17 ++++++++++------- Adaptation/FileHandlers/QS408M/TXT.cs | 4 ++++ FileHandlers/FileRead.cs | 2 +- 4 files changed, 17 insertions(+), 24 deletions(-) diff --git a/Adaptation/FileHandlers/QS408M/Footer.cs b/Adaptation/FileHandlers/QS408M/Footer.cs index 69434f4..db1e6a2 100644 --- a/Adaptation/FileHandlers/QS408M/Footer.cs +++ b/Adaptation/FileHandlers/QS408M/Footer.cs @@ -5,20 +5,6 @@ public class Footer public string Line { get; set; } public string RadialVariationThickness { get; set; } + public string Slot { get; set; } -} - -// Bio-Rad QS400MEPI Recipe: EP_8IN9PT Thu Apr 30 11:29:10 1970 -// operator: J batch: BIORAD#2 -// cassette: wafer: 52-589368-4445 -// -------------------------------------------------------------------------------- -// position thickness position thickness position thickness -// 1 45.735 2 46.536 3 46.742 -// 4 46.015 5 46.648 6 45.366 -// 7 46.263 8 46.512 9 46.373 -// wafer mean thickness = 46.2433, std. dev = 0.4564 PASS -// ================================================================================ - -// Radial variation (computation B) PASS: - -// thickness -2.7474 \ No newline at end of file +} \ No newline at end of file diff --git a/Adaptation/FileHandlers/QS408M/ProcessData.cs b/Adaptation/FileHandlers/QS408M/ProcessData.cs index 555f636..b433145 100644 --- a/Adaptation/FileHandlers/QS408M/ProcessData.cs +++ b/Adaptation/FileHandlers/QS408M/ProcessData.cs @@ -250,9 +250,13 @@ public partial class ProcessData : IProcessData #pragma warning restore IDE0060 { TXT result; - string[] files = Directory.GetFiles(Path.GetDirectoryName(logistics.ReportFullPath), string.Concat(originalDataBioRad, logistics.Sequence, "*"), SearchOption.TopDirectoryOnly); - foreach (string file in files) - fileInfoCollection.Add(new FileInfo(file)); + List moveFiles = new(); + string directoryName = Path.GetDirectoryName(logistics.ReportFullPath); + string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(logistics.ReportFullPath); + moveFiles.AddRange(Directory.GetFiles(directoryName, string.Concat(originalDataBioRad, "*", logistics.Sequence, "*"), SearchOption.TopDirectoryOnly)); + moveFiles.AddRange(Directory.GetFiles(directoryName, string.Concat(originalDataBioRad, "*", fileNameWithoutExtension.Split('_').Last(), "*"), SearchOption.TopDirectoryOnly)); + foreach (string moveFile in moveFiles.Distinct()) + fileInfoCollection.Add(new FileInfo(moveFile)); string receivedData = File.ReadAllText(logistics.ReportFullPath); // occasionally there are multiple blocks of details, get the last one as earlier ones may be aborted runs. int index = receivedData.LastIndexOf("Bio-Rad"); @@ -263,8 +267,7 @@ public partial class ProcessData : IProcessData else { result = new TXT(receivedData); - string directory = Path.GetDirectoryName(logistics.ReportFullPath); - string fileName = Path.Combine(directory, $"{Path.GetFileNameWithoutExtension(logistics.ReportFullPath)}.json"); + string fileName = Path.Combine(directoryName, $"{Path.GetFileNameWithoutExtension(logistics.ReportFullPath)}.json"); string json = JsonSerializer.Serialize(result, new JsonSerializerOptions { WriteIndented = true }); File.WriteAllText(fileName, json); fileInfoCollection.Add(new(fileName)); @@ -359,11 +362,11 @@ public partial class ProcessData : IProcessData UniqueId = uniqueId; JobID = logistics.JobID; StdDev = txt.Body.StdDev; - Slot = slot.ToString("00"); PassFail = txt.Body.PassFail; Title = titleFixed.ToString(); Wafer = waferFixed.ToString(); - MeanThickness = txt.Body.WaferMeanThickness; + Slot = string.IsNullOrEmpty(txt.Footer.Slot) ? slot.ToString("00") : txt.Footer.Slot; + MeanThickness = string.IsNullOrEmpty(txt.Body.WaferMeanThickness) && txt.Body.Sites.Count == 1 ? txt.Body.Sites.First().Thickness : txt.Body.WaferMeanThickness; RVThickness = txt.Footer.RadialVariationThickness; foreach (Site site in txt.Body.Sites) { diff --git a/Adaptation/FileHandlers/QS408M/TXT.cs b/Adaptation/FileHandlers/QS408M/TXT.cs index 37cba76..c47c290 100644 --- a/Adaptation/FileHandlers/QS408M/TXT.cs +++ b/Adaptation/FileHandlers/QS408M/TXT.cs @@ -64,6 +64,9 @@ public class TXT string line = GetToEOL(); ScanPast("thickness"); string radialVariationThickness = GetToEOL(); + _ = GetToEOL(); + ScanPast("Slot:"); + string slot = GetBefore(";"); Header = new() { Title = title, @@ -85,6 +88,7 @@ public class TXT { Line = line, RadialVariationThickness = radialVariationThickness, + Slot = slot, }; } diff --git a/FileHandlers/FileRead.cs b/FileHandlers/FileRead.cs index f895128..44db97f 100644 --- a/FileHandlers/FileRead.cs +++ b/FileHandlers/FileRead.cs @@ -165,7 +165,7 @@ public partial class FileRead : FileReaderHandler, ISMTP Equipment.SelfDescriptionBuilder.AddParameterTypeDefinition(structuredType); } if (!parameterTypeDefinitions.ContainsKey(jsonProperty.Value.ValueKind)) - throw new Exception(string.Concat('{', jsonProperty.Value.ValueKind, "} is not mapped!")); + throw new Exception(string.Concat('<', jsonProperty.Name, "> {", jsonProperty.Value.ValueKind, "} is not mapped!")); } foreach (JsonProperty jsonProperty in jsonProperties) {