diff --git a/Adaptation/.vscode/launch.json b/Adaptation/.vscode/launch.json index 151344f..30dd337 100644 --- a/Adaptation/.vscode/launch.json +++ b/Adaptation/.vscode/launch.json @@ -4,7 +4,7 @@ "name": ".NET Core Attach", "type": "coreclr", "request": "attach", - "processId": 12204 + "processId": 16660 } ] } diff --git a/Adaptation/.vscode/tasks.json b/Adaptation/.vscode/tasks.json index d64119b..1fed7de 100644 --- a/Adaptation/.vscode/tasks.json +++ b/Adaptation/.vscode/tasks.json @@ -86,6 +86,18 @@ ], "problemMatcher": "$msCompile" }, + { + "label": "Project", + "type": "shell", + "command": "code ../MET08THFTIRQS408M.csproj", + "problemMatcher": [] + }, + { + "label": "Git Config", + "type": "shell", + "command": "code ../.git/config", + "problemMatcher": [] + }, { "label": "Kanbn Console", "type": "npm", diff --git a/Adaptation/FileHandlers/QS408M/Body.cs b/Adaptation/FileHandlers/QS408M/Body.cs index 8db8748..7c168fd 100644 --- a/Adaptation/FileHandlers/QS408M/Body.cs +++ b/Adaptation/FileHandlers/QS408M/Body.cs @@ -1,5 +1,3 @@ -using System.Collections.Generic; - namespace Adaptation.FileHandlers.QS408M; #nullable enable @@ -7,15 +5,13 @@ namespace Adaptation.FileHandlers.QS408M; public class Body { - public Body(List sites, string waferMeanThickness, string stdDev, string passFail) + public Body(string waferMeanThickness, string stdDev, string passFail) { - Sites = sites; WaferMeanThickness = waferMeanThickness; StdDev = stdDev; PassFail = passFail; } - public List Sites { get; } public string WaferMeanThickness { get; } public string StdDev { get; } public string PassFail { get; } @@ -44,7 +40,7 @@ public class Body return flag; } - private static string GetToken(string text, int[] i) + internal static string GetToken(string text, int[] i) { while (true) { @@ -71,25 +67,11 @@ public class Body internal static Body? Get(string text, int[] i) { Body? result; - Site site; - string thickness; - List sites = new(); - string position = GetToken(text, i); - while (true) - { - if (string.IsNullOrEmpty(position) || !char.IsDigit(position[0])) - break; - thickness = GetToken(text, i); - site = new(position, thickness); - sites.Add(site); - position = GetToken(text, i); - } - i[0] = Complete.ScanPast(text, i, "mean thickness ="); - string meanThickness = Complete.GetBefore(text, i, ", std. dev ="); + i[0] = Run.ScanPast(text, i, "mean thickness ="); + string meanThickness = Run.GetBefore(text, i, ", std. dev ="); string stdDev = GetToken(text, i); - string passFail = Complete.GetToEOL(text, i); - result = new(sites, - meanThickness, + string passFail = Run.GetToEOL(text, i); + result = new(meanThickness, stdDev, passFail); return result; diff --git a/Adaptation/FileHandlers/QS408M/Complete.cs b/Adaptation/FileHandlers/QS408M/Complete.cs deleted file mode 100644 index 1a4cf0f..0000000 --- a/Adaptation/FileHandlers/QS408M/Complete.cs +++ /dev/null @@ -1,120 +0,0 @@ -using Adaptation.Shared; -using System; -using System.Collections.Generic; -using System.IO; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace Adaptation.FileHandlers.QS408M; - -#nullable enable - -internal class Complete -{ - - public Complete(Header header, Body body, Footer footer) - { - Header = header; - Body = body; - Footer = footer; - } - - public Header Header { get; } - public Body Body { get; } - public Footer Footer { get; } - - internal static string GetBefore(string text, int[] i, string search) - { - string str; - string str1; - int num = text.IndexOf(search, i[0]); - if (num <= -1) - { - str = text.Substring(i[0]); - i[0] = text.Length; - str1 = str.Trim(); - } - else - { - str = text.Substring(i[0], num - i[0]); - i[0] = num + search.Length; - str1 = str.Trim(); - } - return str1; - } - - internal static string GetToEOL(string text, int[] i) - { - string result; - if (text.IndexOf("\n", i[0]) > -1) - result = GetBefore(text, i, "\n"); - else - result = GetBefore(text, i, Environment.NewLine); - return result; - } - - internal static int ScanPast(string text, int[] i, string search) - { - int result; - int num = text.IndexOf(search, i[0]); - if (num <= -1) - result = text.Length; - else - result = num + search.Length; - return result; - } - - internal static Complete? Get(Logistics logistics, List fileInfoCollection, Header[] lastHeader) - { - Complete? result; - int[] i = new int[] { 0 }; - string text = File.ReadAllText(logistics.ReportFullPath); - Header? header = Header.Get(lastHeader, text, i); - if (header is null) - result = null; - else - { - Body? body = Body.Get(text, i); - if (body is null) - result = null; - else - { - Footer? footer = Footer.Get(text, i); - if (footer is null) - result = null; - else - { - result = new(header, body, footer); - FileInfo fileInfo = new($"{logistics.ReportFullPath}.json"); - string json = JsonSerializer.Serialize(result, CompleteSourceGenerationContext.Default.Complete); - File.WriteAllText(fileInfo.FullName, json); - File.SetLastWriteTime(fileInfo.FullName, logistics.DateTimeFromSequence); - fileInfoCollection.Add(fileInfo); - } - } - } - return result; - } - -} - -// 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 - -[JsonSourceGenerationOptions(WriteIndented = true)] -[JsonSerializable(typeof(Complete))] -internal partial class CompleteSourceGenerationContext : JsonSerializerContext -{ -} \ No newline at end of file diff --git a/Adaptation/FileHandlers/QS408M/FileRead.cs b/Adaptation/FileHandlers/QS408M/FileRead.cs index 62e3983..e90c45b 100644 --- a/Adaptation/FileHandlers/QS408M/FileRead.cs +++ b/Adaptation/FileHandlers/QS408M/FileRead.cs @@ -112,9 +112,9 @@ public class FileRead : Shared.FileRead, IFileRead results.Item4.Add(_Logistics.FileInfo); else { - Complete? complete = Complete.Get(_Logistics, results.Item4, lastHeader: _LastHeader); - IProcessData iProcessData = new ProcessData(this, _Logistics, results.Item4, _OriginalDataBioRad, _TickOffset.Value, complete); - if (complete is null) + Run? run = Run.Get(_Logistics, results.Item4, lastHeader: _LastHeader); + IProcessData iProcessData = new ProcessData(this, _Logistics, results.Item4, _OriginalDataBioRad, _TickOffset.Value, run); + if (run is null) throw new Exception(string.Concat("A) No Data - ", dateTime.Ticks)); if (iProcessData is not ProcessData processData) throw new Exception(string.Concat("B) No Data - ", dateTime.Ticks)); @@ -133,7 +133,7 @@ public class FileRead : Shared.FileRead, IFileRead if (iProcessData.Details.Count == 0) throw new Exception(string.Concat("C) No Data - ", dateTime.Ticks)); results = iProcessData.GetResults(this, _Logistics, results.Item4); - _LastHeader[0] = complete.Header; + _LastHeader[0] = run.Header; } return results; } diff --git a/Adaptation/FileHandlers/QS408M/Footer.cs b/Adaptation/FileHandlers/QS408M/Footer.cs index 082fda1..4e7bf68 100644 --- a/Adaptation/FileHandlers/QS408M/Footer.cs +++ b/Adaptation/FileHandlers/QS408M/Footer.cs @@ -19,14 +19,14 @@ public class Footer internal static Footer? Get(string text, int[] i) { Footer? result; - _ = Complete.GetToEOL(text, i); - _ = Complete.GetToEOL(text, i); - string line = Complete.GetToEOL(text, i); - i[0] = Complete.ScanPast(text, i, "thickness"); - string radialVariationThickness = Complete.GetToEOL(text, i); - _ = Complete.GetToEOL(text, i); - i[0] = Complete.ScanPast(text, i, "Slot:"); - string slot = Complete.GetBefore(text, i, ";"); + _ = Run.GetToEOL(text, i); + _ = Run.GetToEOL(text, i); + string line = Run.GetToEOL(text, i); + i[0] = Run.ScanPast(text, i, "thickness"); + string radialVariationThickness = Run.GetToEOL(text, i); + _ = Run.GetToEOL(text, i); + i[0] = Run.ScanPast(text, i, "Slot:"); + string slot = Run.GetBefore(text, i, ";"); result = new(line, radialVariationThickness, slot); diff --git a/Adaptation/FileHandlers/QS408M/Header.cs b/Adaptation/FileHandlers/QS408M/Header.cs index 441555d..f4eea06 100644 --- a/Adaptation/FileHandlers/QS408M/Header.cs +++ b/Adaptation/FileHandlers/QS408M/Header.cs @@ -51,27 +51,27 @@ public class Header { bool usedLast; const string twoSpaces = " "; - string title = Complete.GetBefore(text, i, "Recipe:"); - string recipeAndDateTime = Complete.GetToEOL(text, i); + string title = Run.GetBefore(text, i, "Recipe:"); + string recipeAndDateTime = Run.GetToEOL(text, i); string recipe = recipeAndDateTime.Length < twoSpaces.Length ? recipeAndDateTime.Trim() : !recipeAndDateTime.Contains(twoSpaces) ? recipeAndDateTime.Substring(0, 25).Trim() : recipeAndDateTime.Split(new string[] { twoSpaces }, StringSplitOptions.None)[0].Trim(); string dateTime = recipeAndDateTime.Substring(recipe.Length).Trim(); if (dateTime.EndsWith(".")) dateTime = dateTime.Remove(dateTime.Length - 1, 1); - i[0] = Complete.ScanPast(text, i, "operator:"); - string @operator = Complete.GetBefore(text, i, "batch:"); - string batch = Complete.GetToEOL(text, i); - i[0] = Complete.ScanPast(text, i, "cassette:"); + i[0] = Run.ScanPast(text, i, "operator:"); + string @operator = Run.GetBefore(text, i, "batch:"); + string batch = Run.GetToEOL(text, i); + i[0] = Run.ScanPast(text, i, "cassette:"); if (!text.Contains("cassette:")) title = string.Empty; - string cassette = Complete.GetBefore(text, i, "wafer:"); + string cassette = Run.GetBefore(text, i, "wafer:"); if (string.IsNullOrEmpty(batch)) { i[0] = 0; - i[0] = Complete.ScanPast(text, i, "wafer:"); + i[0] = Run.ScanPast(text, i, "wafer:"); } - string wafer = Complete.GetToEOL(text, i); - _ = Complete.GetToEOL(text, i); - _ = Complete.GetToEOL(text, i); + string wafer = Run.GetToEOL(text, i); + _ = Run.GetToEOL(text, i); + _ = Run.GetToEOL(text, i); if (string.IsNullOrEmpty(wafer)) throw new Exception("Wafer field is missing."); if (!string.IsNullOrEmpty(title)) diff --git a/Adaptation/FileHandlers/QS408M/ProcessData.cs b/Adaptation/FileHandlers/QS408M/ProcessData.cs index b0fe179..b85dc12 100644 --- a/Adaptation/FileHandlers/QS408M/ProcessData.cs +++ b/Adaptation/FileHandlers/QS408M/ProcessData.cs @@ -57,7 +57,7 @@ public partial class ProcessData : IProcessData #nullable enable - internal ProcessData(IFileRead fileRead, Logistics logistics, List fileInfoCollection, string originalDataBioRad, long tickOffset, Complete? complete) + internal ProcessData(IFileRead fileRead, Logistics logistics, List fileInfoCollection, string originalDataBioRad, long tickOffset, Run? run) { if (fileRead is null) throw new ArgumentNullException(nameof(fileRead)); @@ -72,8 +72,8 @@ public partial class ProcessData : IProcessData foreach (string moveFile in moveFiles.Distinct()) fileInfoCollection.Add(new FileInfo(moveFile)); fileInfoCollection.Add(logistics.FileInfo); - if (complete is not null) - SetValues(logistics, tickOffset, complete); + if (run is not null) + SetValues(logistics, tickOffset, run); } string IProcessData.GetCurrentReactor(IFileRead fileRead, Logistics logistics, Dictionary reactors) => throw new Exception(string.Concat("See ", nameof(ProcessData))); @@ -251,18 +251,18 @@ public partial class ProcessData : IProcessData return result; } - private void SetValues(Logistics logistics, long tickOffset, Complete complete) + private void SetValues(Logistics logistics, long tickOffset, Run run) { int slot = 0; Detail detail; int counter = 1; List details = new(); - DateTime dateTime = GetDateTime(logistics, tickOffset, complete.Header.DateTime); - bool isWaferSlot = !string.IsNullOrEmpty(complete.Header.Wafer) && complete.Header.Wafer.Length is 1 or 2 && int.TryParse(complete.Header.Wafer, out slot) && slot < 27; - string batch = !isWaferSlot ? logistics.JobID : Regex.Replace(complete.Header.Batch, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0]; - Descriptor descriptor = isWaferSlot ? GetDescriptor(complete.Header.Batch) : GetDescriptor(complete.Header.Wafer); + DateTime dateTime = GetDateTime(logistics, tickOffset, run.Header.DateTime); + bool isWaferSlot = !string.IsNullOrEmpty(run.Header.Wafer) && run.Header.Wafer.Length is 1 or 2 && int.TryParse(run.Header.Wafer, out slot) && slot < 27; + string batch = !isWaferSlot ? logistics.JobID : Regex.Replace(run.Header.Batch, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0]; + Descriptor descriptor = isWaferSlot ? GetDescriptor(run.Header.Batch) : GetDescriptor(run.Header.Wafer); string wafer = isWaferSlot ? slot.ToString("00") : descriptor.Wafer; - string uniqueId = string.Concat(complete.Header.Title, '_', wafer, '_', logistics.DateTimeFromSequence.ToString("yyyyMMddHHmmssffff"), '_', logistics.TotalSecondsSinceLastWriteTimeFromSequence); + string uniqueId = string.Concat(run.Header.Title, '_', wafer, '_', logistics.DateTimeFromSequence.ToString("yyyyMMddHHmmssffff"), '_', logistics.TotalSecondsSinceLastWriteTimeFromSequence); Batch = batch; Wafer = wafer; Date = dateTime; @@ -273,16 +273,16 @@ public partial class ProcessData : IProcessData JobID = logistics.JobID; Layer = descriptor.Layer; Reactor = descriptor.Reactor; - StdDev = complete.Body.StdDev; - Title = complete.Header.Title; - Recipe = complete.Header.Recipe; - PassFail = complete.Body.PassFail; - Cassette = complete.Header.Cassette; - RVThickness = complete.Footer.RadialVariationThickness; - Slot = string.IsNullOrEmpty(complete.Footer.Slot) ? slot.ToString("00") : complete.Footer.Slot; - Employee = string.IsNullOrEmpty(complete.Header.Operator) ? Employee : complete.Header.Operator; - MeanThickness = string.IsNullOrEmpty(complete.Body.WaferMeanThickness) && complete.Body.Sites.Count == 1 ? complete.Body.Sites.First().Thickness : complete.Body.WaferMeanThickness; - foreach (Site site in complete.Body.Sites) + StdDev = run.Body.StdDev; + Title = run.Header.Title; + Recipe = run.Header.Recipe; + PassFail = run.Body.PassFail; + Cassette = run.Header.Cassette; + RVThickness = run.Footer.RadialVariationThickness; + Slot = string.IsNullOrEmpty(run.Footer.Slot) ? slot.ToString("00") : run.Footer.Slot; + Employee = string.IsNullOrEmpty(run.Header.Operator) ? Employee : run.Header.Operator; + MeanThickness = string.IsNullOrEmpty(run.Body.WaferMeanThickness) && run.Sites.Count == 1 ? run.Sites[0].Thickness : run.Body.WaferMeanThickness; + foreach (Site site in run.Sites) { detail = new() { diff --git a/Adaptation/FileHandlers/QS408M/Row.cs b/Adaptation/FileHandlers/QS408M/Row.cs new file mode 100644 index 0000000..b26e6df --- /dev/null +++ b/Adaptation/FileHandlers/QS408M/Row.cs @@ -0,0 +1,59 @@ +using System.Text.Json.Serialization; + +namespace Adaptation.FileHandlers.QS408M; + +#nullable enable + +internal class Row +{ + + public Row(Run run, int i) + { + Title = run.Header.Title; + Recipe = run.Header.Recipe; + DateTime = run.Header.DateTime; + Operator = run.Header.Operator; + Batch = run.Header.Batch; + Cassette = run.Header.Cassette; + UsedLast = run.Header.UsedLast; + Wafer = run.Header.Wafer; + // + Position = run.Sites[i].Position; + Thickness = run.Sites[i].Thickness; + // + WaferMeanThickness = run.Body.WaferMeanThickness; + StdDev = run.Body.StdDev; + PassFail = run.Body.PassFail; + // + Line = run.Footer.Line; + RadialVariationThickness = run.Footer.RadialVariationThickness; + Slot = run.Footer.Slot; + } + + public string Title { get; } + public string Recipe { get; } + public string DateTime { get; } + public string Operator { get; } + public string Batch { get; } + public string Cassette { get; } + public bool UsedLast { get; } + public string Wafer { get; } + // + public string Position { get; } + public string Thickness { get; } + // + public string WaferMeanThickness { get; } + public string StdDev { get; } + public string PassFail { get; } + // + public string Line { get; } + public string RadialVariationThickness { get; } + public string Slot { get; } + +} + +[JsonSourceGenerationOptions(WriteIndented = true)] +[JsonSerializable(typeof(Row))] +internal partial class RowSourceGenerationContext : JsonSerializerContext +{ +} \ No newline at end of file diff --git a/Adaptation/FileHandlers/QS408M/Run.cs b/Adaptation/FileHandlers/QS408M/Run.cs new file mode 100644 index 0000000..29e576d --- /dev/null +++ b/Adaptation/FileHandlers/QS408M/Run.cs @@ -0,0 +1,205 @@ +using Adaptation.Shared; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.IO; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Adaptation.FileHandlers.QS408M; + +#nullable enable + +internal class Run +{ + + public Run(Header header, ReadOnlyCollection sites, Body body, Footer footer) + { + Header = header; + Sites = sites; + Body = body; + Footer = footer; + } + + public Header Header { get; } + public ReadOnlyCollection Sites { get; } + public Body Body { get; } + public Footer Footer { get; } + + internal static string GetBefore(string text, int[] i, string search) + { + string str; + string str1; + int num = text.IndexOf(search, i[0]); + if (num <= -1) + { + str = text.Substring(i[0]); + i[0] = text.Length; + str1 = str.Trim(); + } + else + { + str = text.Substring(i[0], num - i[0]); + i[0] = num + search.Length; + str1 = str.Trim(); + } + return str1; + } + + internal static string GetToEOL(string text, int[] i) + { + string result; + if (text.IndexOf("\n", i[0]) > -1) + result = GetBefore(text, i, "\n"); + else + result = GetBefore(text, i, Environment.NewLine); + return result; + } + + internal static int ScanPast(string text, int[] i, string search) + { + int result; + int num = text.IndexOf(search, i[0]); + if (num <= -1) + result = text.Length; + else + result = num + search.Length; + return result; + } + + private static void WriteJson(Logistics logistics, List fileInfoCollection, Run? result) + { + FileInfo fileInfo = new($"{logistics.ReportFullPath}.json"); + string json = JsonSerializer.Serialize(result, RunSourceGenerationContext.Default.Run); + File.WriteAllText(fileInfo.FullName, json); + File.SetLastWriteTime(fileInfo.FullName, logistics.DateTimeFromSequence); + fileInfoCollection.Add(fileInfo); + } + + private static ReadOnlyCollection GetLines(JsonElement[]? jsonElements) + { + List results = new(); + int columns = 0; + StringBuilder stringBuilder = new(); + for (int i = 0; i < jsonElements?.Length;) + { + foreach (JsonProperty jsonProperty in jsonElements[0].EnumerateObject()) + { + columns += 1; + _ = stringBuilder.Append('"').Append(jsonProperty.Name).Append('"').Append('\t'); + } + break; + } + if (jsonElements?.Length != 0) + _ = stringBuilder.Remove(stringBuilder.Length - 1, 1); + results.Add(stringBuilder.ToString()); + for (int i = 0; i < jsonElements?.Length; i++) + { + _ = stringBuilder.Clear(); + foreach (JsonProperty jsonProperty in jsonElements[i].EnumerateObject()) + { + if (jsonProperty.Value.ValueKind == JsonValueKind.Object) + _ = stringBuilder.Append('\t'); + else if (jsonProperty.Value.ValueKind != JsonValueKind.String) + _ = stringBuilder.Append(jsonProperty.Value).Append('\t'); + else + _ = stringBuilder.Append('"').Append(jsonProperty.Value).Append('"').Append('\t'); + } + _ = stringBuilder.Remove(stringBuilder.Length - 1, 1); + results.Add(stringBuilder.ToString()); + } + return results.AsReadOnly(); + } + + private static ReadOnlyCollection GetLines(JsonElement? jsonElement) => + jsonElement is null ? new(Array.Empty()) : GetLines(new JsonElement[] { jsonElement.Value }); + + private static void WriteTabSeparatedValues(Logistics logistics, List fileInfoCollection, Run run) + { + List results = new(); + Row row; + FileInfo fileInfo = new($"{logistics.ReportFullPath}.tsv"); + for (int i = 0; i < run.Sites.Count; i++) + { + row = new(run, i); + results.Add(row); + } + string json = JsonSerializer.Serialize(results); + JsonElement[]? jsonElements = JsonSerializer.Deserialize(json); + ReadOnlyCollection lines = GetLines(jsonElements); + File.WriteAllText(fileInfo.FullName, string.Join(Environment.NewLine, lines)); + File.SetLastWriteTime(fileInfo.FullName, logistics.DateTimeFromSequence); + fileInfoCollection.Add(fileInfo); + } + + private static void WriteException(Logistics logistics, Exception ex) + { + FileInfo fileInfo = new($"{logistics.ReportFullPath}.{nameof(Exception)}.txt"); + File.WriteAllText(fileInfo.FullName, $"{ex.Message}{Environment.NewLine}{ex.StackTrace}"); + } + + internal static Run? Get(Logistics logistics, List fileInfoCollection, Header[] lastHeader) + { + Run? result; + int[] i = new int[] { 0 }; + string text = File.ReadAllText(logistics.ReportFullPath); + Header? header = Header.Get(lastHeader, text, i); + if (header is null) + result = null; + else + { + ReadOnlyCollection sites = Site.Get(text, i); + if (sites.Count == 0) + result = null; + else + { + Body? body = Body.Get(text, i); + if (body is null) + result = null; + else + { + Footer? footer = Footer.Get(text, i); + if (footer is null) + result = null; + else + { + result = new(header, sites, body, footer); + WriteJson(logistics, fileInfoCollection, result); + try + { + WriteTabSeparatedValues(logistics, fileInfoCollection, result); + } + catch (Exception ex) + { + WriteException(logistics, ex); + } + } + } + } + } + return result; + } + +} + +// 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 + +[JsonSourceGenerationOptions(WriteIndented = true)] +[JsonSerializable(typeof(Run))] +internal partial class RunSourceGenerationContext : JsonSerializerContext +{ +} \ No newline at end of file diff --git a/Adaptation/FileHandlers/QS408M/Site.cs b/Adaptation/FileHandlers/QS408M/Site.cs index 8f447a5..e97d09b 100644 --- a/Adaptation/FileHandlers/QS408M/Site.cs +++ b/Adaptation/FileHandlers/QS408M/Site.cs @@ -1,3 +1,6 @@ +using System.Collections.Generic; +using System.Collections.ObjectModel; + namespace Adaptation.FileHandlers.QS408M; public class Site @@ -12,4 +15,22 @@ public class Site public string Position { get; } public string Thickness { get; } + internal static ReadOnlyCollection Get(string text, int[] i) + { + List results = new(); + Site site; + string thickness; + string position = Body.GetToken(text, i); + while (true) + { + if (string.IsNullOrEmpty(position) || !char.IsDigit(position[0])) + break; + thickness = Body.GetToken(text, i); + site = new(position, thickness); + results.Add(site); + position = Body.GetToken(text, i); + } + return results.AsReadOnly(); + } + } \ No newline at end of file diff --git a/Adaptation/MET08THFTIRQS408M.Tests.csproj b/Adaptation/MET08THFTIRQS408M.Tests.csproj index 4bba09c..09dab5f 100644 --- a/Adaptation/MET08THFTIRQS408M.Tests.csproj +++ b/Adaptation/MET08THFTIRQS408M.Tests.csproj @@ -35,7 +35,7 @@ - + NU1701 NU1701 @@ -44,41 +44,39 @@ NU1701 NU1701 NU1701 - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + NU1701 - - - + + + - - - - - - - + + NU1701 - NU1701 - NU1701 - NU1701 + + + + + diff --git a/Adaptation/_Tests/Extract/Production/v2.57.0/MET08THFTIRQS408M.cs b/Adaptation/_Tests/Extract/Production/v2.57.0/MET08THFTIRQS408M.cs index 1450295..9de9f94 100644 --- a/Adaptation/_Tests/Extract/Production/v2.57.0/MET08THFTIRQS408M.cs +++ b/Adaptation/_Tests/Extract/Production/v2.57.0/MET08THFTIRQS408M.cs @@ -96,7 +96,7 @@ public class MET08THFTIRQS408M _ = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics); NonThrowTryCatch(); } - + #if DEBUG [Ignore] #endif diff --git a/Adaptation/_Tests/Static/QS408M.cs b/Adaptation/_Tests/Static/QS408M.cs index ed2088c..f139fdf 100644 --- a/Adaptation/_Tests/Static/QS408M.cs +++ b/Adaptation/_Tests/Static/QS408M.cs @@ -54,16 +54,6 @@ public class QS408M : LoggingUnitTesting, IDisposable Assert.IsTrue(dateTime.ToString("M/d/yyyy h:mm:ss tt") == dateTime.ToString()); } - [TestMethod] - public void TestDateTimeB() - { - DateTime dateTimeA = new(1970, 01, 01); - DateTime dateTimeB = new(2024, 09, 19, 10, 41, 16); - TimeSpan timeSpan = new(dateTimeB.Ticks - dateTimeA.Ticks); - long infinityQS = (long)Math.Floor(timeSpan.TotalSeconds); - Assert.IsTrue(infinityQS == 1726767676); - } - [TestMethod] public void TestDescriptor() { diff --git a/MET08THFTIRQS408M.csproj b/MET08THFTIRQS408M.csproj index 7eba3c4..9dc34e2 100644 --- a/MET08THFTIRQS408M.csproj +++ b/MET08THFTIRQS408M.csproj @@ -109,15 +109,14 @@ - - - + + + - @@ -125,6 +124,8 @@ + +