FlagDuplicates
CA1510 Complete
This commit is contained in:
@ -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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user