FlagDuplicates
CA1510 Complete
This commit is contained in:
parent
49fddcf319
commit
a95f783733
@ -92,8 +92,9 @@ csharp_using_directive_placement = outside_namespace
|
||||
dotnet_code_quality_unused_parameters = all
|
||||
dotnet_code_quality_unused_parameters = non_public # IDE0060: Remove unused parameter
|
||||
dotnet_code_quality.CAXXXX.api_surface = private, internal
|
||||
dotnet_diagnostic.CA1510.severity = none # CA1510: Use 'ArgumentNullException.ThrowIfNull' instead of explicitly throwing a new exception instance
|
||||
dotnet_diagnostic.CA1816.severity = none # CA1816: Call GC.SuppressFinalize correctly
|
||||
dotnet_diagnostic.CA1825.severity = warning # CA1823: Avoid zero-length array allocations
|
||||
dotnet_diagnostic.CA1825.severity = warning # CA1825: Avoid zero-length array allocations
|
||||
dotnet_diagnostic.CA1829.severity = warning # CA1829: Use Length/Count property instead of Count() when available
|
||||
dotnet_diagnostic.CA1834.severity = warning # CA1834: Consider using 'StringBuilder.Append(char)' when applicable
|
||||
dotnet_diagnostic.CA1846.severity = none # CA1846: Prefer AsSpan over Substring
|
||||
|
12
Adaptation/.vscode/tasks.json
vendored
12
Adaptation/.vscode/tasks.json
vendored
@ -49,6 +49,16 @@
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Format-Whitespaces",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"format",
|
||||
"whitespace"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Nuget Clear",
|
||||
"command": "dotnet",
|
||||
@ -68,7 +78,7 @@
|
||||
"args": [
|
||||
"/target:Build",
|
||||
"/restore:True",
|
||||
"/p:RestoreSources=https://artifactory.intra.infineon.com/artifactory/api/nuget/ngt-fi-package-main-vir/%3Bhttps://packagemanagement.eu.infineon.com:4430/api/v2/%3Bhttps://tfs.intra.infineon.com/tfs/ManufacturingIT/_packaging/eaf/nuget/v3/index.json%3Bhttps://tfs.intra.infineon.com/tfs/FactoryIntegration/_packaging/EAF%40Local/nuget/v3/index.json%3Bhttps://api.nuget.org/v3/index.json",
|
||||
"/p:RestoreSources=https://artifactory.intra.infineon.com/artifactory/api/nuget/ngt-fi-package-main-vir/%3Bhttps://packagemanagement.eu.infineon.com:4430/api/v2/%3Bhttps://tfs.intra.infineon.com/tfs/FactoryIntegration/_packaging/EAF/nuget/v3/index.json%3Bhttps://tfs.intra.infineon.com/tfs/FactoryIntegration/_packaging/EAF%40Local/nuget/v3/index.json%3Bhttps://api.nuget.org/v3/index.json",
|
||||
"/detailedsummary",
|
||||
"/consoleloggerparameters:PerformanceSummary;ErrorsOnly;",
|
||||
"/property:Configuration=Debug;TargetFrameworkVersion=v4.8",
|
||||
|
@ -227,7 +227,7 @@ public class FromIQS
|
||||
private static void FlagDuplicates(string connectionString, string json)
|
||||
{
|
||||
JsonElement[]? jsonElements = JsonSerializer.Deserialize<JsonElement[]>(json);
|
||||
JsonSerializerOptions jsonSerializerOptions = new() { PropertyNameCaseInsensitive = true};
|
||||
JsonSerializerOptions jsonSerializerOptions = new() { PropertyNameCaseInsensitive = true };
|
||||
if (jsonElements is not null && jsonElements.Length != 0 && jsonElements[0].ValueKind == JsonValueKind.Object)
|
||||
{
|
||||
Root? root;
|
||||
@ -244,14 +244,9 @@ public class FromIQS
|
||||
}
|
||||
if (collection.Count > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
string commandText = GetCommandText(collection);
|
||||
File.WriteAllText("D:/.sql", commandText);
|
||||
_ = ExecuteNonQuery(connectionString, commandText);
|
||||
}
|
||||
catch (Exception)
|
||||
{ }
|
||||
string commandText = GetCommandText(collection);
|
||||
File.WriteAllText("D:/.sql", commandText);
|
||||
_ = ExecuteNonQuery(connectionString, commandText);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -271,9 +266,15 @@ public class FromIQS
|
||||
else
|
||||
dateTime = logistics.DateTimeFromSequence;
|
||||
commandText = GetCommandText(dateTime);
|
||||
stringBuilder = GetForJsonPath(connectionString, commandText);
|
||||
if (stringBuilder.Length > 0)
|
||||
FlagDuplicates(connectionString, stringBuilder.ToString());
|
||||
try
|
||||
{
|
||||
stringBuilder = GetForJsonPath(connectionString, commandText);
|
||||
if (stringBuilder.Length > 0)
|
||||
FlagDuplicates(connectionString, stringBuilder.ToString());
|
||||
}
|
||||
catch (Exception)
|
||||
{ stringBuilder = new(); }
|
||||
_ = stringBuilder.Clear();
|
||||
commandText = GetCommandText(logistics, description, dateTime.ToString("yyyy-MM-dd HH:mm:ss"), subGroupId: null);
|
||||
for (short i = 0; i < short.MaxValue; i++)
|
||||
{
|
||||
|
@ -6,22 +6,22 @@ namespace Adaptation.FileHandlers.OpenInsight;
|
||||
public class Root
|
||||
{
|
||||
|
||||
[JsonPropertyName("count_se_sgtm")] public long CountSeSgtm { get; }
|
||||
[JsonPropertyName("date_time")] public DateTime DateTime { get; }
|
||||
[JsonPropertyName("max_max_se_test")] public long MaxMaxSeTest { get; }
|
||||
[JsonPropertyName("max_max_se_test_name")] public string MaxMaxSeTestName { get; }
|
||||
[JsonPropertyName("max_max_se_val")] public double MaxMaxSeVal { get; }
|
||||
[JsonPropertyName("max_se_lot")] public long MaxSeLot { get; }
|
||||
[JsonPropertyName("max_se_lot_name")] public string MaxSeLotName { get; }
|
||||
[JsonPropertyName("max_se_part")] public long MaxSePart { get; }
|
||||
[JsonPropertyName("max_se_part_name")] public string MaxSePartName { get; }
|
||||
[JsonPropertyName("max_se_prcs")] public long MaxSePrcs { get; }
|
||||
[JsonPropertyName("max_se_prcs_name")] public string MaxSePrcsName { get; }
|
||||
[JsonPropertyName("max_se_sgrp")] public long MaxSeSgrp { get; }
|
||||
[JsonPropertyName("min_min_se_test")] public long MinMinSeTest { get; }
|
||||
[JsonPropertyName("min_min_se_test_name")] public string MinMinSeTestName { get; }
|
||||
[JsonPropertyName("min_min_se_val")] public double MinMinSeVal { get; }
|
||||
[JsonPropertyName("min_se_sgrp")] public long MinSeSgrp { get; }
|
||||
public long CountSeSgtm { get; } // [JsonPropertyName("count_se_sgtm")]
|
||||
public DateTime DateTime { get; } // [JsonPropertyName("date_time")]
|
||||
public long MaxMaxSeTest { get; } // [JsonPropertyName("max_max_se_test")]
|
||||
public string MaxMaxSeTestName { get; } // [JsonPropertyName("max_max_se_test_name")]
|
||||
public double MaxMaxSeVal { get; } // [JsonPropertyName("max_max_se_val")]
|
||||
public long MaxSeLot { get; } // [JsonPropertyName("max_se_lot")]
|
||||
public string MaxSeLotName { get; } // [JsonPropertyName("max_se_lot_name")]
|
||||
public long MaxSePart { get; } // [JsonPropertyName("max_se_part")]
|
||||
public string MaxSePartName { get; } // [JsonPropertyName("max_se_part_name")]
|
||||
public long MaxSePrcs { get; } // [JsonPropertyName("max_se_prcs")]
|
||||
public string MaxSePrcsName { get; } // [JsonPropertyName("max_se_prcs_name")]
|
||||
public long MaxSeSgrp { get; } // [JsonPropertyName("max_se_sgrp")]
|
||||
public long MinMinSeTest { get; } // [JsonPropertyName("min_min_se_test")]
|
||||
public string MinMinSeTestName { get; } // [JsonPropertyName("min_min_se_test_name")]
|
||||
public double MinMinSeVal { get; } // [JsonPropertyName("min_min_se_val")]
|
||||
public long MinSeSgrp { get; } // [JsonPropertyName("min_se_sgrp")]
|
||||
|
||||
[JsonConstructor]
|
||||
public Root(long countSeSgtm, DateTime dateTime, long maxMaxSeTest, string maxMaxSeTestName, double maxMaxSeVal, long maxSeLot, string maxSeLotName, long maxSePart, string maxSePartName, long maxSePrcs, string maxSePrcsName, long maxSeSgrp, long minMinSeTest, string minMinSeTestName, double minMinSeVal, long minSeSgrp)
|
||||
|
59
Adaptation/FileHandlers/Stratus/Complete.cs
Normal file
59
Adaptation/FileHandlers/Stratus/Complete.cs
Normal file
@ -0,0 +1,59 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.Stratus;
|
||||
|
||||
#nullable enable
|
||||
|
||||
internal class Complete
|
||||
{
|
||||
|
||||
public Complete(Header header, Wafer[] wafers, Footer footer)
|
||||
{
|
||||
Header = header;
|
||||
Wafers = wafers;
|
||||
Footer = footer;
|
||||
}
|
||||
|
||||
public Header Header { get; }
|
||||
public Wafer[] Wafers { get; }
|
||||
public Footer Footer { get; }
|
||||
|
||||
internal static Complete? Get(string text, Constant constant)
|
||||
{
|
||||
Complete? result;
|
||||
int[] i = new int[] { 0 };
|
||||
Header? header = Header.Get(text, constant, i);
|
||||
if (header is null)
|
||||
result = null;
|
||||
else
|
||||
{
|
||||
ReadOnlyCollection<string> groups = Wafer.GetGroups(text, constant, i);
|
||||
if (groups.Count == 0)
|
||||
result = null;
|
||||
else
|
||||
{
|
||||
ReadOnlyCollection<Wafer> wafers = Wafer.Get(constant, groups);
|
||||
if (wafers.Count == 0)
|
||||
result = null;
|
||||
else
|
||||
{
|
||||
Footer? footer = Footer.Get(constant, groups);
|
||||
if (footer is null)
|
||||
result = null;
|
||||
else
|
||||
result = new(header, wafers.ToArray(), footer);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Complete))]
|
||||
internal partial class CompleteSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
22
Adaptation/FileHandlers/Stratus/Constant.cs
Normal file
22
Adaptation/FileHandlers/Stratus/Constant.cs
Normal file
@ -0,0 +1,22 @@
|
||||
namespace Adaptation.FileHandlers.Stratus;
|
||||
|
||||
internal class Constant
|
||||
{
|
||||
|
||||
public string Mean { get; } = "Mean";
|
||||
public string Slot { get; } = "Slot";
|
||||
public string STDD { get; } = "STDD";
|
||||
public string Batch { get; } = "Batch";
|
||||
public string Wafer { get; } = "Wafer";
|
||||
public string OneHypen { get; } = "1 - ";
|
||||
public string Recipe { get; } = "Recipe";
|
||||
public string Source { get; } = "Source:";
|
||||
public string Started { get; } = "started";
|
||||
public string Cassette { get; } = "Cassette";
|
||||
public string Reference { get; } = "Reference";
|
||||
public string StartedAt { get; } = "started at";
|
||||
public string Thickness { get; } = "Thickness,";
|
||||
public string Destination { get; } = "Destination:";
|
||||
public string ProcessFailed { get; } = "------------- Process failed -------------";
|
||||
|
||||
}
|
94
Adaptation/FileHandlers/Stratus/Footer.cs
Normal file
94
Adaptation/FileHandlers/Stratus/Footer.cs
Normal file
@ -0,0 +1,94 @@
|
||||
using log4net;
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace Adaptation.FileHandlers.Stratus;
|
||||
|
||||
#nullable enable
|
||||
|
||||
public class Footer
|
||||
{
|
||||
|
||||
public Footer(string meanThickness, string stdDev)
|
||||
{
|
||||
MeanThickness = meanThickness;
|
||||
StdDev = stdDev;
|
||||
}
|
||||
|
||||
public string MeanThickness { get; }
|
||||
public string StdDev { get; }
|
||||
|
||||
private static string GetBefore(string text, int[] i, string search, bool trim)
|
||||
{
|
||||
string str;
|
||||
string before;
|
||||
if (trim)
|
||||
before = Header.GetBefore(text, i, search);
|
||||
else
|
||||
{
|
||||
int num = text.IndexOf(search, i[0]);
|
||||
if (num <= -1)
|
||||
{
|
||||
str = text.Substring(i[0]);
|
||||
i[0] = text.Length;
|
||||
before = str;
|
||||
}
|
||||
else
|
||||
{
|
||||
str = text.Substring(i[0], num - i[0]);
|
||||
i[0] = num + search.Length;
|
||||
before = str;
|
||||
}
|
||||
}
|
||||
return before;
|
||||
}
|
||||
|
||||
private static string GetToEOL(string text, int[] i, bool trim)
|
||||
{
|
||||
string str;
|
||||
if (text.IndexOf("\n", i[0]) > -1)
|
||||
str = !trim ? GetBefore(text, i, "\n", false) : Header.GetToEOL(text, i);
|
||||
else
|
||||
str = !trim ? GetBefore(text, i, Environment.NewLine, false) : Header.GetToEOL(text, i);
|
||||
return str;
|
||||
}
|
||||
|
||||
private static bool IsBlankLine(string text, int[] i)
|
||||
{
|
||||
int num = text.IndexOf("\n", i[0]);
|
||||
return Wafer.IsNullOrWhiteSpace(num > -1 ? text.Substring(i[0], num - i[0]) : text.Substring(i[0]));
|
||||
}
|
||||
|
||||
internal static Footer? Get(Constant constant, ReadOnlyCollection<string> groups)
|
||||
{
|
||||
Footer? result;
|
||||
int[] j = new int[] { 0 };
|
||||
string stdDev = string.Empty;
|
||||
string meanThickness = string.Empty;
|
||||
foreach (string groupText in groups)
|
||||
{
|
||||
if (groupText.Contains(constant.Destination))
|
||||
continue;
|
||||
stdDev = string.Empty;
|
||||
meanThickness = string.Empty;
|
||||
Header.ScanPast(groupText, j, constant.Mean);
|
||||
meanThickness = Wafer.GetToken(groupText, j);
|
||||
if (meanThickness.EndsWith(","))
|
||||
meanThickness = meanThickness.Remove(meanThickness.Length - 1, 1);
|
||||
Header.ScanPast(groupText, j, constant.STDD);
|
||||
stdDev = Wafer.GetToken(groupText, j);
|
||||
if (stdDev.EndsWith(","))
|
||||
stdDev = stdDev.Remove(stdDev.Length - 1, 1);
|
||||
}
|
||||
// if (PeekNextLine(groupText, j).Contains(constant.Cassette))
|
||||
// _ = Header.GetToEOL(groupText, j);
|
||||
// if (PeekNextLine(groupText, j).Contains(constant.Cassette))
|
||||
// _ = Header.GetToEOL(groupText, j);
|
||||
// if (PeekNextLine(groupText, j).Contains("Process failed"))
|
||||
// _ = Header.GetToEOL(groupText, j);
|
||||
result = new(meanThickness: meanThickness,
|
||||
stdDev: stdDev);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
96
Adaptation/FileHandlers/Stratus/Header.cs
Normal file
96
Adaptation/FileHandlers/Stratus/Header.cs
Normal file
@ -0,0 +1,96 @@
|
||||
using System;
|
||||
|
||||
namespace Adaptation.FileHandlers.Stratus;
|
||||
|
||||
#nullable enable
|
||||
|
||||
public class Header
|
||||
{
|
||||
|
||||
public Header(string batch, string cassette, string dateTime)
|
||||
{
|
||||
Batch = batch;
|
||||
Cassette = cassette;
|
||||
DateTime = dateTime;
|
||||
}
|
||||
|
||||
public string Batch { get; }
|
||||
public string Cassette { get; }
|
||||
public string DateTime { 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;
|
||||
}
|
||||
|
||||
private static string GetToText(string text, int[] i, string search) =>
|
||||
text.Substring(i[0], text.IndexOf(search, i[0]) - i[0]).Trim();
|
||||
|
||||
internal static void ScanPast(string text, int[] i, string search)
|
||||
{
|
||||
int num = text.IndexOf(search, i[0]);
|
||||
if (num <= -1)
|
||||
i[0] = text.Length;
|
||||
else
|
||||
i[0] = num + search.Length;
|
||||
}
|
||||
|
||||
internal static Header Get(string text, Constant constant, int[] i)
|
||||
{
|
||||
Header? result;
|
||||
string batch;
|
||||
if (!text.Contains(constant.Batch) || !text.Contains(constant.Started))
|
||||
batch = string.Empty;
|
||||
else
|
||||
{
|
||||
for (int z = 0; z < int.MaxValue; z++)
|
||||
{
|
||||
ScanPast(text, i, constant.Batch);
|
||||
if (!text.Substring(i[0]).Contains(constant.Batch))
|
||||
break;
|
||||
}
|
||||
batch = GetToText(text, i, constant.Started);
|
||||
ScanPast(text, i, constant.StartedAt);
|
||||
}
|
||||
ScanPast(text, i, constant.Cassette);
|
||||
string cassette;
|
||||
if (!text.Substring(i[0]).Contains(constant.Started))
|
||||
cassette = string.Empty;
|
||||
else
|
||||
cassette = GetToText(text, i, constant.Started);
|
||||
ScanPast(text, i, constant.StartedAt);
|
||||
string dateTime = GetToEOL(text, i);
|
||||
if (dateTime.EndsWith("."))
|
||||
dateTime = dateTime.Remove(dateTime.Length - 1, 1);
|
||||
result = new(batch: batch,
|
||||
cassette: cassette,
|
||||
dateTime: dateTime);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
@ -445,6 +445,16 @@ public partial class ProcessData : IProcessData
|
||||
UniqueId = string.Concat("StratusBioRad_", reactor, "_", rds, "_", psn, "_", logistics.DateTimeFromSequence.ToString("yyyyMMddHHmmssffff"));
|
||||
}
|
||||
|
||||
#nullable enable
|
||||
|
||||
private static Complete? GetComplete(string text)
|
||||
{
|
||||
Complete? result;
|
||||
Constant constant = new();
|
||||
result = Complete.Get(text, constant);
|
||||
return result;
|
||||
}
|
||||
|
||||
#pragma warning disable IDE0060
|
||||
private void Parse(IFileRead fileRead, Logistics logistics, List<FileInfo> fileInfoCollection, string originalDataBioRad, string receivedData)
|
||||
#pragma warning restore IDE0060
|
||||
@ -452,13 +462,32 @@ public partial class ProcessData : IProcessData
|
||||
_I = 0;
|
||||
_Data = string.Empty;
|
||||
List<Detail> details = new();
|
||||
string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(logistics.ReportFullPath);
|
||||
if (string.IsNullOrEmpty(receivedData))
|
||||
{
|
||||
receivedData = File.ReadAllText(logistics.ReportFullPath);
|
||||
try
|
||||
{
|
||||
Complete? complete = GetComplete(receivedData);
|
||||
if (complete is null)
|
||||
_Log.Warn($"Could not get Complete from {fileNameWithoutExtension}");
|
||||
else
|
||||
{
|
||||
FileInfo fileInfo = new($"{fileNameWithoutExtension}.json");
|
||||
string json = JsonSerializer.Serialize(complete, CompleteSourceGenerationContext.Default.Complete);
|
||||
File.WriteAllText(fileInfo.FullName, json);
|
||||
fileInfoCollection.Add(fileInfo);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_Log.Error($"Error in {nameof(GetComplete)}", ex);
|
||||
}
|
||||
}
|
||||
_Log.Debug($"****ParseData - Source file contents:");
|
||||
_Log.Debug(receivedData);
|
||||
List<string> moveFiles = new();
|
||||
string directoryName = Path.GetDirectoryName(logistics.ReportFullPath);
|
||||
string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(logistics.ReportFullPath);
|
||||
string directoryName = Path.GetDirectoryName(logistics.ReportFullPath) ?? throw new Exception();
|
||||
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())
|
||||
@ -472,11 +501,13 @@ public partial class ProcessData : IProcessData
|
||||
int num1 = 0;
|
||||
Detail detail;
|
||||
string recipe;
|
||||
string nextLine;
|
||||
_I = 0;
|
||||
_Data = receivedData;
|
||||
Set(logistics);
|
||||
nextLine = PeekNextLine();
|
||||
string cassette = "Cassette";
|
||||
if (PeekNextLine().Contains("Wafer"))
|
||||
if (nextLine.Contains("Wafer"))
|
||||
{
|
||||
_Log.Debug("****ProcessData Contains Wafer");
|
||||
while (!PeekNextLine().Contains(cassette))
|
||||
@ -507,7 +538,8 @@ public partial class ProcessData : IProcessData
|
||||
}
|
||||
detail.Recipe = recipe;
|
||||
_ = GetToEOL();
|
||||
if (PeekNextLine().Contains("Thickness"))
|
||||
nextLine = PeekNextLine();
|
||||
if (nextLine.Contains("Thickness"))
|
||||
{
|
||||
ScanPast("1 - ");
|
||||
num = Convert.ToInt32(GetToken());
|
||||
@ -526,7 +558,8 @@ public partial class ProcessData : IProcessData
|
||||
}
|
||||
}
|
||||
_ = GetToEOL();
|
||||
if (PeekNextLine().Contains("Thickness"))
|
||||
nextLine = PeekNextLine();
|
||||
if (nextLine.Contains("Thickness"))
|
||||
{
|
||||
ScanPast("11 - ");
|
||||
num = Convert.ToInt32(GetToken());
|
||||
@ -561,11 +594,18 @@ public partial class ProcessData : IProcessData
|
||||
}
|
||||
detail.UniqueId = string.Concat("_Wafer-", detail.Wafer, "_Slot-", detail.Slot, "_Point-", detail.Position);
|
||||
details.Add(detail);
|
||||
if (PeekNextLine().Contains(cassette))
|
||||
nextLine = PeekNextLine();
|
||||
if (nextLine.Contains(cassette))
|
||||
{
|
||||
_ = GetToEOL();
|
||||
if (PeekNextLine().Contains(cassette))
|
||||
nextLine = PeekNextLine();
|
||||
}
|
||||
if (nextLine.Contains(cassette))
|
||||
{
|
||||
_ = GetToEOL();
|
||||
if (PeekNextLine().Contains("Process failed"))
|
||||
nextLine = PeekNextLine();
|
||||
}
|
||||
if (nextLine.Contains("Process failed"))
|
||||
_ = GetToEOL();
|
||||
}
|
||||
}
|
||||
|
230
Adaptation/FileHandlers/Stratus/Wafer.cs
Normal file
230
Adaptation/FileHandlers/Stratus/Wafer.cs
Normal file
@ -0,0 +1,230 @@
|
||||
using log4net;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace Adaptation.FileHandlers.Stratus;
|
||||
|
||||
#nullable enable
|
||||
|
||||
public class Wafer
|
||||
{
|
||||
|
||||
public Wafer(string destination, string mean, string passFail, string recipe, string reference, List<string> sites, string slot, string source, string stdDev, string waferText)
|
||||
{
|
||||
Destination = destination;
|
||||
Mean = mean;
|
||||
PassFail = passFail;
|
||||
Recipe = recipe;
|
||||
Reference = reference;
|
||||
Sites = sites;
|
||||
Slot = slot;
|
||||
Source = source;
|
||||
StdDev = stdDev;
|
||||
Text = waferText;
|
||||
}
|
||||
|
||||
public string Destination { get; }
|
||||
public string Mean { get; }
|
||||
public string PassFail { get; }
|
||||
public string Recipe { get; }
|
||||
public string Reference { get; }
|
||||
public List<string> Sites { get; }
|
||||
public string Slot { get; }
|
||||
public string Source { get; }
|
||||
public string StdDev { get; }
|
||||
public string Text { get; }
|
||||
|
||||
internal static string GetToken(string text, int[] i)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
if (i[0] >= text.Length || !IsNullOrWhiteSpace(text.Substring(i[0], 1)))
|
||||
break;
|
||||
i[0]++;
|
||||
}
|
||||
int num = i[0];
|
||||
while (true)
|
||||
{
|
||||
if (num >= text.Length || IsNullOrWhiteSpace(text.Substring(num, 1)))
|
||||
break;
|
||||
num++;
|
||||
}
|
||||
string str = text.Substring(i[0], num - i[0]);
|
||||
i[0] = num;
|
||||
return str.Trim();
|
||||
}
|
||||
|
||||
internal static bool IsNullOrWhiteSpace(string search)
|
||||
{
|
||||
bool flag;
|
||||
int num = 0;
|
||||
while (true)
|
||||
{
|
||||
if (num >= search.Length)
|
||||
{
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
else if (char.IsWhiteSpace(search[num]))
|
||||
num++;
|
||||
else
|
||||
{
|
||||
flag = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
internal static string PeekNextLine(string text, int[] i)
|
||||
{
|
||||
int num = i[0];
|
||||
string toEOL = Header.GetToEOL(text, i);
|
||||
i[0] = num;
|
||||
return toEOL;
|
||||
}
|
||||
|
||||
internal static ReadOnlyCollection<string> GetGroups(string text, Constant constant, int[] i)
|
||||
{
|
||||
List<string> results = new();
|
||||
string[] lines = text.Substring(i[0]).Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
|
||||
if (lines.Length > 0)
|
||||
{
|
||||
List<string> group = new();
|
||||
foreach (string line in lines)
|
||||
{
|
||||
group.Add(line);
|
||||
if (!line.StartsWith(constant.Destination))
|
||||
continue;
|
||||
results.Add(string.Join(Environment.NewLine, group));
|
||||
group.Clear();
|
||||
}
|
||||
results.Add(string.Join(Environment.NewLine, group));
|
||||
}
|
||||
return results.AsReadOnly();
|
||||
}
|
||||
|
||||
internal static ReadOnlyCollection<Wafer> Get(Constant constant, ReadOnlyCollection<string> groups)
|
||||
{
|
||||
List<Wafer> results = new();
|
||||
string mean;
|
||||
string slot;
|
||||
Wafer wafer;
|
||||
string recipe;
|
||||
string source;
|
||||
string stdDev;
|
||||
string nextLine;
|
||||
string passFail;
|
||||
string reference;
|
||||
string thickness;
|
||||
string waferText;
|
||||
string destination;
|
||||
List<string> sites;
|
||||
int[] j = new int[] { 0 };
|
||||
foreach (string groupText in groups)
|
||||
{
|
||||
j[0] = 0;
|
||||
sites = new();
|
||||
if (groupText.Contains(constant.ProcessFailed))
|
||||
{
|
||||
mean = string.Empty;
|
||||
slot = string.Empty;
|
||||
recipe = string.Empty;
|
||||
source = string.Empty;
|
||||
stdDev = string.Empty;
|
||||
passFail = string.Empty;
|
||||
reference = string.Empty;
|
||||
waferText = string.Empty;
|
||||
destination = string.Empty;
|
||||
}
|
||||
else if (groupText.Contains(constant.Reference))
|
||||
{
|
||||
mean = string.Empty;
|
||||
slot = string.Empty;
|
||||
recipe = string.Empty;
|
||||
stdDev = string.Empty;
|
||||
passFail = string.Empty;
|
||||
waferText = string.Empty;
|
||||
Header.ScanPast(groupText, j, constant.Reference);
|
||||
reference = Header.GetToEOL(groupText, j);
|
||||
Header.ScanPast(groupText, j, constant.Source);
|
||||
source = Header.GetToEOL(groupText, j).Trim();
|
||||
Header.ScanPast(groupText, j, constant.Destination);
|
||||
destination = Header.GetToEOL(groupText, j).Trim();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!groupText.Contains(constant.Wafer))
|
||||
continue;
|
||||
Header.ScanPast(groupText, j, constant.Wafer);
|
||||
waferText = Header.GetToEOL(groupText, j);
|
||||
if (waferText.EndsWith("."))
|
||||
waferText = waferText.Remove(waferText.Length - 1, 1);
|
||||
Header.ScanPast(groupText, j, constant.Slot);
|
||||
slot = Header.GetToEOL(groupText, j);
|
||||
Header.ScanPast(groupText, j, constant.Recipe);
|
||||
recipe = Header.GetToEOL(groupText, j);
|
||||
if (recipe.EndsWith("."))
|
||||
recipe = recipe.Remove(recipe.Length - 1, 1);
|
||||
Header.ScanPast(groupText, j, constant.Thickness);
|
||||
_ = GetToken(groupText, j);
|
||||
nextLine = PeekNextLine(groupText, j);
|
||||
if (nextLine.Contains(constant.OneHypen))
|
||||
{
|
||||
Header.ScanPast(groupText, j, constant.OneHypen);
|
||||
_ = GetToken(groupText, j);
|
||||
}
|
||||
for (int k = 0; k < 100; k++)
|
||||
{
|
||||
nextLine = PeekNextLine(groupText, j);
|
||||
if (nextLine.Contains("Slot"))
|
||||
break;
|
||||
if (string.IsNullOrEmpty(nextLine))
|
||||
{
|
||||
_ = Header.GetToEOL(groupText, j);
|
||||
continue;
|
||||
}
|
||||
thickness = GetToken(groupText, j);
|
||||
if (thickness == constant.Thickness)
|
||||
{
|
||||
_ = GetToken(groupText, j);
|
||||
continue;
|
||||
}
|
||||
sites.Add(thickness);
|
||||
}
|
||||
Header.ScanPast(groupText, j, constant.Slot);
|
||||
_ = GetToken(groupText, j);
|
||||
passFail = GetToken(groupText, j);
|
||||
if (passFail.EndsWith("."))
|
||||
passFail = passFail.Remove(passFail.Length - 1, 1);
|
||||
Header.ScanPast(groupText, j, constant.Mean);
|
||||
mean = GetToken(groupText, j);
|
||||
if (mean.EndsWith(","))
|
||||
mean = mean.Remove(mean.Length - 1, 1);
|
||||
Header.ScanPast(groupText, j, constant.STDD);
|
||||
stdDev = Header.GetToEOL(groupText, j);
|
||||
if (stdDev.EndsWith("."))
|
||||
stdDev = stdDev.Remove(stdDev.Length - 1, 1);
|
||||
reference = string.Empty;
|
||||
Header.ScanPast(groupText, j, constant.Source);
|
||||
source = Header.GetToEOL(groupText, j).Trim();
|
||||
Header.ScanPast(groupText, j, constant.Destination);
|
||||
destination = Header.GetToEOL(groupText, j).Trim();
|
||||
}
|
||||
wafer = new(destination: destination,
|
||||
mean: mean,
|
||||
passFail: passFail,
|
||||
recipe: recipe,
|
||||
reference: reference,
|
||||
sites: sites,
|
||||
slot: slot,
|
||||
source: source,
|
||||
stdDev: stdDev,
|
||||
waferText: waferText);
|
||||
results.Add(wafer);
|
||||
}
|
||||
return results.AsReadOnly();
|
||||
}
|
||||
|
||||
}
|
@ -191,5 +191,37 @@ public class BIORAD4
|
||||
Shared.AdaptationTesting.UpdatePassDirectory(variables[2]);
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__BIORAD4__Stratus638613924531133783__14()
|
||||
{
|
||||
bool validatePDSF = false;
|
||||
string check = "CassetteDataBioRad_*.txt";
|
||||
_BIORAD4.Production__v2_57_0__BIORAD4__Stratus();
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
string[] variables = _BIORAD4.AdaptationTesting.GetVariables(methodBase, check, validatePDSF);
|
||||
IFileRead fileRead = _BIORAD4.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
|
||||
_ = fileRead.ReExtract();
|
||||
Shared.AdaptationTesting.UpdatePassDirectory(variables[2]);
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__BIORAD4__Stratus638675062726795419__T()
|
||||
{
|
||||
bool validatePDSF = false;
|
||||
string check = "CassetteDataBioRad_*.txt";
|
||||
_BIORAD4.Production__v2_57_0__BIORAD4__Stratus();
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
string[] variables = _BIORAD4.AdaptationTesting.GetVariables(methodBase, check, validatePDSF);
|
||||
IFileRead fileRead = _BIORAD4.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
|
||||
_ = fileRead.ReExtract();
|
||||
Shared.AdaptationTesting.UpdatePassDirectory(variables[2]);
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
@ -58,7 +58,7 @@ public class MET08THFTIRSTRATUS : LoggingUnitTesting, IDisposable
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging()
|
||||
public void Production()
|
||||
{
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
StringBuilder results = new();
|
||||
@ -66,12 +66,12 @@ public class MET08THFTIRSTRATUS : LoggingUnitTesting, IDisposable
|
||||
{
|
||||
new("MET08THFTIRSTRATUS", "v2.57.0"),
|
||||
};
|
||||
string staging = "http://mestsa07ec.infineon.com:9003/CellInstanceServiceV2";
|
||||
string production = "http://messa08ec.infineon.com:9003/CellInstanceServiceV2";
|
||||
Shared.PasteSpecialXml.EAF.XML.API.CellInstance.CellInstanceVersion cellInstanceVersion;
|
||||
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
foreach ((string cellInstanceName, string cellInstanceVersionName) in collection)
|
||||
{
|
||||
cellInstanceVersion = AdaptationTesting.GetCellInstanceVersion($"{staging}/{cellInstanceName}/{cellInstanceVersionName}/configuration");
|
||||
cellInstanceVersion = AdaptationTesting.GetCellInstanceVersion($"{production}/{cellInstanceName}/{cellInstanceVersionName}/configuration");
|
||||
_ = results.AppendLine($"{cellInstanceName}\t{cellInstanceVersionName}\t{cellInstanceVersion.EdaConnection.PortNumber}");
|
||||
}
|
||||
string sourceDirectory = "D:/Tmp/cellInstanceVersion.EdaConnection.PortNumber";
|
||||
|
@ -198,7 +198,7 @@ public class Stratus : LoggingUnitTesting, IDisposable
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging()
|
||||
public void Production()
|
||||
{
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
StringBuilder results = new();
|
||||
@ -207,12 +207,12 @@ public class Stratus : LoggingUnitTesting, IDisposable
|
||||
new("BIORAD4", "v2.57.0"),
|
||||
new("BIORAD5", "v2.57.0"),
|
||||
};
|
||||
string staging = "http://mestsa07ec.infineon.com:9003/CellInstanceServiceV2";
|
||||
string production = "http://messa08ec.infineon.com:9003/CellInstanceServiceV2";
|
||||
Shared.PasteSpecialXml.EAF.XML.API.CellInstance.CellInstanceVersion cellInstanceVersion;
|
||||
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
foreach ((string cellInstanceName, string cellInstanceVersionName) in collection)
|
||||
{
|
||||
cellInstanceVersion = AdaptationTesting.GetCellInstanceVersion($"{staging}/{cellInstanceName}/{cellInstanceVersionName}/configuration");
|
||||
cellInstanceVersion = AdaptationTesting.GetCellInstanceVersion($"{production}/{cellInstanceName}/{cellInstanceVersionName}/configuration");
|
||||
_ = results.AppendLine($"{cellInstanceName}\t{cellInstanceVersionName}\t{cellInstanceVersion.EdaConnection.PortNumber}");
|
||||
}
|
||||
string sourceDirectory = "D:/Tmp/cellInstanceVersion.EdaConnection.PortNumber";
|
||||
|
@ -119,12 +119,17 @@
|
||||
<Compile Include="Adaptation\FileHandlers\OpenInsightMetrologyViewerAttachments\FileRead.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\Processed\FileRead.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\SPaCe\FileRead.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\Stratus\Complete.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\Stratus\Constant.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\Stratus\Description.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\Stratus\Descriptor.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\Stratus\Detail.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\Stratus\FileRead.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\Stratus\Footer.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\Stratus\Header.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\Stratus\Point.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\Stratus\ProcessData.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\Stratus\Wafer.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\txt\FileRead.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\txt\ProcessData.cs" />
|
||||
<Compile Include="Adaptation\Ifx\Eaf\Common\Configuration\ConnectionSetting.cs" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user