FlagDuplicates
CA1510 Complete
This commit is contained in:
parent
dcaaba3614
commit
8ae8386b30
@ -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
|
||||
|
2
Adaptation/.vscode/tasks.json
vendored
2
Adaptation/.vscode/tasks.json
vendored
@ -78,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",
|
||||
|
@ -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++)
|
||||
{
|
||||
|
@ -20,20 +20,20 @@ internal class Complete
|
||||
public Summary Summary { get; }
|
||||
public ReadOnlyCollection<Point> Points { get; }
|
||||
|
||||
public static Complete? Get(int take, string site, string multiple, string summaryLine, string lastUnits, string lastUnitsB, ReadOnlyCollection<string> lines)
|
||||
public static Complete? Get(Constant constant, ReadOnlyCollection<string> lines)
|
||||
{
|
||||
Complete? result;
|
||||
Header? header = Header.Get(lines, site, summaryLine);
|
||||
Header? header = Header.Get(constant, lines);
|
||||
if (header is null)
|
||||
result = null;
|
||||
else
|
||||
{
|
||||
Summary? summary = SummarySegment.Get(lines, site, summaryLine, lastUnits);
|
||||
Summary? summary = SummarySegment.Get(constant, lines);
|
||||
if (summary is null)
|
||||
result = null;
|
||||
else
|
||||
{
|
||||
ReadOnlyCollection<Point> points = Point.GetCollection(lines, take, site, multiple, summaryLine, lastUnitsB) ?? throw new NullReferenceException(nameof(summary));
|
||||
ReadOnlyCollection<Point> points = Point.GetCollection(constant, lines) ?? throw new NullReferenceException(nameof(summary));
|
||||
if (points.Count == 0)
|
||||
result = null;
|
||||
else
|
||||
|
13
Adaptation/FileHandlers/pcl/Constant.cs
Normal file
13
Adaptation/FileHandlers/pcl/Constant.cs
Normal file
@ -0,0 +1,13 @@
|
||||
namespace Adaptation.FileHandlers.pcl;
|
||||
|
||||
internal class Constant
|
||||
{
|
||||
|
||||
public int Take { get; } = 12;
|
||||
public string Site { get; } = "Site: ";
|
||||
public string Multiple { get; } = "MULTIPLE";
|
||||
public string SummaryLine { get; } = "SUMMARY A A";
|
||||
public string LastUnits { get; } = "Flat Z: Grade : % Flat Z: Grade : % Flat Z: Grade : %";
|
||||
public string LastUnitsB { get; } = "Flat Z: Grade : % Flat Z: Grade : % Flat Z: Grade : %";
|
||||
|
||||
}
|
@ -10,25 +10,6 @@ namespace Adaptation.FileHandlers.pcl;
|
||||
#nullable enable
|
||||
|
||||
internal class Header
|
||||
// internal record Header([property: JsonPropertyName("Operator")] string Operator,
|
||||
// [property: JsonPropertyName("Start Voltage")] string StartVoltage,
|
||||
// [property: JsonPropertyName("Wafer")] string Wafer,
|
||||
// [property: JsonPropertyName("Stop Voltage")] string StopVoltage,
|
||||
// [property: JsonPropertyName("Lot")] string Lot,
|
||||
// [property: JsonPropertyName("Ramp Rate")] string RampRate,
|
||||
// [property: JsonPropertyName("Plan")] string Plan,
|
||||
// [property: JsonPropertyName("G limit")] string GLimit,
|
||||
// [property: JsonPropertyName("Date")] string Date,
|
||||
// [property: JsonPropertyName("Time")] string Time,
|
||||
// [property: JsonPropertyName("Setup File")] string SetupFile,
|
||||
// [property: JsonPropertyName("Wafer size")] string WaferSize,
|
||||
// [property: JsonPropertyName("Folder")] string Folder,
|
||||
// [property: JsonPropertyName("Ccomp")] string Ccomp,
|
||||
// [property: JsonPropertyName("Pattern")] string Pattern,
|
||||
// [property: JsonPropertyName("Area")] string Area,
|
||||
// [property: JsonPropertyName("Cond Type")] string CondType,
|
||||
// [property: JsonPropertyName("Rho Method")] string RhoMethod,
|
||||
// [property: JsonPropertyName("Model")] string Model)
|
||||
{
|
||||
|
||||
[JsonConstructor]
|
||||
@ -128,7 +109,7 @@ internal class Header
|
||||
return new(results);
|
||||
}
|
||||
|
||||
public static Header? Get(ReadOnlyCollection<string> lines, string site, string summaryLine)
|
||||
public static Header? Get(Constant constant, ReadOnlyCollection<string> lines)
|
||||
{
|
||||
Header? result;
|
||||
string json;
|
||||
@ -142,11 +123,11 @@ internal class Header
|
||||
ReadOnlyCollection<JsonProperty> jsonProperties = GetJsonProperties();
|
||||
foreach (string line in lines)
|
||||
{
|
||||
if (line.Contains(site))
|
||||
if (line.Contains(constant.Site))
|
||||
found = true;
|
||||
if (!found)
|
||||
continue;
|
||||
if (line == summaryLine)
|
||||
if (line == constant.SummaryLine)
|
||||
break;
|
||||
foreach (JsonProperty jsonProperty in jsonProperties)
|
||||
{
|
||||
|
@ -8,21 +8,6 @@ namespace Adaptation.FileHandlers.pcl;
|
||||
#nullable enable
|
||||
|
||||
internal class Point
|
||||
// internal record Point([property: JsonPropertyName("Site")] string Site,
|
||||
// [property: JsonPropertyName("X")] string X,
|
||||
// [property: JsonPropertyName("Y")] string Y,
|
||||
// [property: JsonPropertyName("Navg")] string NAvg,
|
||||
// [property: JsonPropertyName("Rhoavg")] string RhoAvg,
|
||||
// [property: JsonPropertyName("Nsl")] string Nsl,
|
||||
// [property: JsonPropertyName("Rhosl")] string Rhosl,
|
||||
// [property: JsonPropertyName("Vd")] string Vd,
|
||||
// [property: JsonPropertyName("Phase")] string Phase,
|
||||
// [property: JsonPropertyName("Flat Z")] string FlatZ,
|
||||
// [property: JsonPropertyName("Grade")] string Grade,
|
||||
// [property: JsonPropertyName("X Left")] string XLeft,
|
||||
// [property: JsonPropertyName("X Right")] string XRight,
|
||||
// [property: JsonPropertyName("Bottom Y")] string BottomY,
|
||||
// [property: JsonPropertyName("Top Y")] string TopY)
|
||||
{
|
||||
|
||||
public Point(string site, string x, string y, string nAvg, string rhoAvg, string nsl, string rhosl, string vd, string phase, string flatZ, string grade, string xLeft, string xRight, string bottomY, string topY)
|
||||
@ -77,7 +62,7 @@ internal class Point
|
||||
string.Empty,
|
||||
string.Empty);
|
||||
|
||||
public static ReadOnlyCollection<Point> GetCollection(ReadOnlyCollection<string> lines, int take, string site, string multiple, string summaryLine, string lastUnitsB)
|
||||
public static ReadOnlyCollection<Point> GetCollection(Constant constant, ReadOnlyCollection<string> lines)
|
||||
{
|
||||
List<Point> results = new();
|
||||
string s;
|
||||
@ -92,22 +77,22 @@ internal class Point
|
||||
for (int i = 0; i < lines.Count; i++)
|
||||
{
|
||||
line = lines[i];
|
||||
segmentsC = line.Split(new string[] { site }, StringSplitOptions.RemoveEmptyEntries);
|
||||
segmentsC = line.Split(new string[] { constant.Site }, StringSplitOptions.RemoveEmptyEntries);
|
||||
if (segmentsC.Length > 1)
|
||||
{
|
||||
foreach (string segment in segmentsC)
|
||||
sites.Add(segment.Trim());
|
||||
}
|
||||
if (line == summaryLine)
|
||||
if (line == constant.SummaryLine)
|
||||
{
|
||||
sites.RemoveAt(0);
|
||||
found = true;
|
||||
}
|
||||
if (!found)
|
||||
continue;
|
||||
if (!foundB && line.Contains(multiple))
|
||||
if (!foundB && line.Contains(constant.Multiple))
|
||||
foundB = true;
|
||||
if (line != lastUnitsB)
|
||||
if (line != constant.LastUnitsB)
|
||||
continue;
|
||||
if (foundB)
|
||||
{
|
||||
@ -117,7 +102,7 @@ internal class Point
|
||||
for (int j = 0; j < sites.Count; j++)
|
||||
{
|
||||
s = sites[j];
|
||||
if (i + take > lines.Count)
|
||||
if (i + constant.Take > lines.Count)
|
||||
break;
|
||||
segments = s.Split(new string[] { "(", ",", ")" }, StringSplitOptions.None);
|
||||
if (segments.Length < 2)
|
||||
@ -141,7 +126,7 @@ internal class Point
|
||||
bottomY: lines[i + 11].Trim(),
|
||||
topY: lines[i + 12].Trim());
|
||||
results.Add(point);
|
||||
i += take;
|
||||
i += constant.Take;
|
||||
}
|
||||
sites.Clear();
|
||||
}
|
||||
|
@ -536,20 +536,15 @@ public class ProcessData : IProcessData
|
||||
private Complete? GetComplete(string altHeaderFileName)
|
||||
{
|
||||
Complete? result;
|
||||
const int take = 12;
|
||||
const string site = "Site: ";
|
||||
const string multiple = "MULTIPLE";
|
||||
const string summaryLine = "SUMMARY A A";
|
||||
const string lastUnits = "Flat Z: Grade : % Flat Z: Grade : % Flat Z: Grade : %";
|
||||
const string lastUnitsB = "Flat Z: Grade : % Flat Z: Grade : % Flat Z: Grade : %";
|
||||
Constant constant = new();
|
||||
string[] lines = File.ReadAllLines(altHeaderFileName);
|
||||
ReadOnlyCollection<string> collection = new(lines);
|
||||
if (collection.Count > take)
|
||||
result = Complete.Get(take, site, multiple, summaryLine, lastUnits, lastUnitsB, collection);
|
||||
if (collection.Count > constant.Take)
|
||||
result = Complete.Get(constant, collection);
|
||||
else
|
||||
{
|
||||
result = null;
|
||||
_Log.Warn($"File {altHeaderFileName} has less than {take} collection");
|
||||
_Log.Warn($"File {altHeaderFileName} has less than {constant.Take} collection");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -10,15 +10,6 @@ namespace Adaptation.FileHandlers.pcl;
|
||||
#nullable enable
|
||||
|
||||
internal class SummarySegment
|
||||
// internal record SummarySegment([property: JsonPropertyName("Navg")] string NAvg,
|
||||
// [property: JsonPropertyName("Nsl")] string Nsl,
|
||||
// [property: JsonPropertyName("Vd")] string Vd,
|
||||
// [property: JsonPropertyName("@ Flat Z")] string FlatZ,
|
||||
// [property: JsonPropertyName("Rhoavg")] string RhoAvg,
|
||||
// [property: JsonPropertyName("Rhosl")] string Rhosl,
|
||||
// [property: JsonPropertyName("Phase")] string Phase,
|
||||
// [property: JsonPropertyName("Grade")] string Grade,
|
||||
// [property: JsonPropertyName("@ Rs")] string Rs)
|
||||
{
|
||||
|
||||
public SummarySegment(string nAvg, string nsl, string vd, string flatZ, string rhoAvg, string rhosl, string phase, string grade, string rs)
|
||||
@ -66,7 +57,7 @@ internal class SummarySegment
|
||||
return new(results);
|
||||
}
|
||||
|
||||
public static Summary? Get(ReadOnlyCollection<string> lines, string site, string summaryLine, string lastUnits)
|
||||
public static Summary? Get(Constant constant, ReadOnlyCollection<string> lines)
|
||||
{
|
||||
Summary? result;
|
||||
string json;
|
||||
@ -79,13 +70,13 @@ internal class SummarySegment
|
||||
ReadOnlyCollection<JsonProperty> jsonProperties = GetJsonProperties();
|
||||
foreach (string line in lines)
|
||||
{
|
||||
if (line == summaryLine)
|
||||
if (line == constant.SummaryLine)
|
||||
found = true;
|
||||
if (!found)
|
||||
continue;
|
||||
if (line.Contains(site))
|
||||
if (line.Contains(constant.Site))
|
||||
break;
|
||||
if (line.Contains(lastUnits))
|
||||
if (line.Contains(constant.LastUnits))
|
||||
break;
|
||||
foreach (JsonProperty jsonProperty in jsonProperties)
|
||||
{
|
||||
|
@ -117,6 +117,7 @@
|
||||
<Compile Include="Adaptation\FileHandlers\OpenInsightMetrologyViewer\WSRequest.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\OpenInsightMetrologyViewerAttachments\FileRead.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\pcl\Complete.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\pcl\Constant.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\pcl\Description.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\pcl\Descriptor.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\pcl\Detail.cs" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user