FlagDuplicates
CA1510 Complete
This commit is contained in:
@ -1,30 +1,100 @@
|
||||
using System;
|
||||
|
||||
namespace Adaptation.FileHandlers.QS408M;
|
||||
|
||||
#nullable enable
|
||||
|
||||
public class Header
|
||||
{
|
||||
|
||||
public string Title { get; set; }
|
||||
public string Recipe { get; set; }
|
||||
public string DateTime { get; set; }
|
||||
public string Operator { get; set; }
|
||||
public string Batch { get; set; }
|
||||
public string Cassette { get; set; }
|
||||
public bool UsedLast { get; set; }
|
||||
public string Wafer { get; set; }
|
||||
public Header(string title, string recipe, string dateTime, string @operator, string batch, string cassette, bool usedLast, string wafer)
|
||||
{
|
||||
Title = title;
|
||||
Recipe = recipe;
|
||||
DateTime = dateTime;
|
||||
Operator = @operator;
|
||||
Batch = batch;
|
||||
Cassette = cassette;
|
||||
UsedLast = usedLast;
|
||||
Wafer = wafer;
|
||||
}
|
||||
|
||||
}
|
||||
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; }
|
||||
|
||||
// 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
|
||||
// ================================================================================
|
||||
internal static Header Get() =>
|
||||
new(string.Empty,
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
false,
|
||||
string.Empty);
|
||||
|
||||
// Radial variation (computation B) PASS:
|
||||
internal static Header? Get(Header lastHeader, string text, int[] i)
|
||||
{
|
||||
Header? result;
|
||||
// occasionally there are multiple blocks of details, get the last one as earlier ones may be aborted runs.
|
||||
int index = text.LastIndexOf("Bio-Rad");
|
||||
if (index > -1)
|
||||
text = text.Substring(index);
|
||||
if (string.IsNullOrEmpty(text))
|
||||
result = null;
|
||||
else
|
||||
{
|
||||
bool usedLast;
|
||||
const string twoSpaces = " ";
|
||||
string title = Complete.GetBefore(text, i, "Recipe:");
|
||||
string recipeAndDateTime = Complete.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:");
|
||||
if (!text.Contains("cassette:"))
|
||||
title = string.Empty;
|
||||
string cassette = Complete.GetBefore(text, i, "wafer:");
|
||||
if (string.IsNullOrEmpty(batch))
|
||||
{
|
||||
i[0] = 0;
|
||||
i[0] = Complete.ScanPast(text, i, "wafer:");
|
||||
}
|
||||
string wafer = Complete.GetToEOL(text, i);
|
||||
_ = Complete.GetToEOL(text, i);
|
||||
_ = Complete.GetToEOL(text, i);
|
||||
if (string.IsNullOrEmpty(wafer))
|
||||
throw new Exception("Wafer field is missing.");
|
||||
if (!string.IsNullOrEmpty(title))
|
||||
usedLast = false;
|
||||
else
|
||||
{
|
||||
title = lastHeader.Title;
|
||||
recipe = lastHeader.Recipe;
|
||||
@operator = lastHeader.Operator;
|
||||
batch = lastHeader.Batch;
|
||||
cassette = lastHeader.Cassette;
|
||||
usedLast = true;
|
||||
}
|
||||
result = new(title: title,
|
||||
recipe: recipe,
|
||||
dateTime: dateTime,
|
||||
@operator: @operator,
|
||||
batch: batch,
|
||||
cassette: cassette,
|
||||
usedLast: usedLast,
|
||||
wafer: wafer);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// thickness -2.7474
|
||||
}
|
Reference in New Issue
Block a user