TSV like PDSF ready to test

This commit is contained in:
2025-01-14 11:22:47 -07:00
parent 334929a025
commit d4d935d2f1
23 changed files with 269 additions and 1675 deletions

View File

@ -44,14 +44,15 @@ public partial class ProcessData : IProcessData
#nullable enable
internal ProcessData(IFileRead fileRead, Logistics logistics, List<FileInfo> fileInfoCollection, string originalDataBioRad, Complete? complete, string dataText)
internal ProcessData(IFileRead fileRead, Logistics logistics, List<FileInfo> fileInfoCollection, string originalDataBioRad, Run? run, string dataText)
{
JobID = logistics.JobID;
fileInfoCollection.Clear();
if (!string.IsNullOrEmpty(dataText))
fileInfoCollection.Clear();
_Details = new List<object>();
MesEntity = logistics.MesEntity;
_Log = LogManager.GetLogger(typeof(ProcessData));
Parse(fileRead, logistics, fileInfoCollection, originalDataBioRad, complete, dataText);
Parse(fileRead, logistics, fileInfoCollection, originalDataBioRad, run, dataText);
}
string IProcessData.GetCurrentReactor(IFileRead fileRead, Logistics logistics, Dictionary<string, string> reactors) => throw new Exception(string.Concat("See ", nameof(Parse)));
@ -385,7 +386,7 @@ public partial class ProcessData : IProcessData
return result;
}
private void Set(Logistics logistics, Complete? complete)
private void Set(Logistics logistics, Run? run)
{
string psn;
string rds;
@ -415,7 +416,7 @@ public partial class ProcessData : IProcessData
batch = GetToText(startedKey);
ScanPast(startedAtKey);
}
if (complete is not null)
if (run is not null)
{ }
ScanPast(cassetteKey);
if (!_Data.Substring(_I).Contains(startedKey))
@ -449,15 +450,17 @@ public partial class ProcessData : IProcessData
UniqueId = string.Concat("StratusBioRad_", reactor, "_", rds, "_", psn, "_", logistics.DateTimeFromSequence.ToString("yyyyMMddHHmmssffff"));
}
private void Parse(IFileRead fileRead, Logistics logistics, List<FileInfo> fileInfoCollection, string originalDataBioRad, Complete? complete, string receivedData)
private void Parse(IFileRead fileRead, Logistics logistics, List<FileInfo> fileInfoCollection, string originalDataBioRad, Run? run, string dataText)
{
if (fileRead is null)
throw new ArgumentNullException(nameof(fileRead));
_I = 0;
_Data = string.Empty;
List<Detail> details = new();
if (string.IsNullOrEmpty(dataText))
dataText = File.ReadAllText(logistics.ReportFullPath);
_Log.Debug($"****ParseData - Source file contents:");
_Log.Debug(receivedData);
_Log.Debug(dataText);
List<string> moveFiles = new();
string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(logistics.ReportFullPath);
string directoryName = Path.GetDirectoryName(logistics.ReportFullPath) ?? throw new Exception();
@ -465,7 +468,7 @@ public partial class ProcessData : IProcessData
moveFiles.AddRange(Directory.GetFiles(directoryName, string.Concat(originalDataBioRad, "*", fileNameWithoutExtension.Split('_').Last(), "*"), SearchOption.TopDirectoryOnly));
foreach (string moveFile in moveFiles.Distinct())
fileInfoCollection.Add(new FileInfo(moveFile));
if (!string.IsNullOrEmpty(receivedData))
if (!string.IsNullOrEmpty(dataText))
{
int i;
int num;
@ -476,8 +479,8 @@ public partial class ProcessData : IProcessData
string recipe;
string nextLine;
_I = 0;
_Data = receivedData;
Set(logistics, complete);
_Data = dataText;
Set(logistics, run);
nextLine = PeekNextLine();
string cassette = "Cassette";
if (nextLine.Contains("Wafer"))
@ -597,7 +600,7 @@ public partial class ProcessData : IProcessData
StdDev = StdDev.Remove(StdDev.Length - 1, 1);
}
}
if (receivedData.Contains("------------- Process failed -------------"))
if (dataText.Contains("------------- Process failed -------------"))
details.Add(new());
}
StringBuilder stringBuilder = new();