Descriptor time format

This commit is contained in:
2023-05-09 16:25:04 -07:00
parent 0bcc3c4210
commit 62fd87d50e
9 changed files with 480 additions and 447 deletions

View File

@ -111,7 +111,9 @@ public class FileRead : Shared.FileRead, IFileRead
if (iProcessData is not ProcessData processData)
throw new Exception(string.Concat("A) No Data - ", dateTime.Ticks));
string mid;
if (!string.IsNullOrEmpty(processData.Employee) && string.IsNullOrEmpty(processData.Reactor) && string.IsNullOrEmpty(processData.RDS) && string.IsNullOrEmpty(processData.PSN))
if (!string.IsNullOrEmpty(processData.Cassette) && string.IsNullOrEmpty(processData.Reactor) && string.IsNullOrEmpty(processData.RDS) && string.IsNullOrEmpty(processData.PSN))
mid = processData.Cassette;
else if (!string.IsNullOrEmpty(processData.Employee) && string.IsNullOrEmpty(processData.Reactor) && string.IsNullOrEmpty(processData.RDS) && string.IsNullOrEmpty(processData.PSN))
mid = processData.Employee;
else
{

View File

@ -321,7 +321,7 @@ public partial class ProcessData : IProcessData
string defaultLayer = string.Empty;
string defaultReactor = string.Empty;
string defaultEmployee = string.Empty;
if (Regex.IsMatch(text, @"^[a-zA-z][0-9]{4}$"))
if (Regex.IsMatch(text, @"^[a-zA-z][0-9]{2,4}$"))
{
cassette = text.ToUpper();
psn = defaultPSN;
@ -423,7 +423,6 @@ public partial class ProcessData : IProcessData
if (dateTimeText.EndsWith("."))
dateTimeText = dateTimeText.Remove(dateTimeText.Length - 1, 1);
date = GetDateTime(logistics, dateTimeText);
;
Descriptor descriptor = GetDescriptor(text);
cassette = descriptor.Cassette;
psn = descriptor.PSN;
@ -457,9 +456,13 @@ public partial class ProcessData : IProcessData
receivedData = File.ReadAllText(logistics.ReportFullPath);
_Log.Debug($"****ParseData - Source file contents:");
_Log.Debug(receivedData);
string[] files = Directory.GetFiles(Path.GetDirectoryName(logistics.ReportFullPath), string.Concat(originalDataBioRad, logistics.Sequence, "*"), SearchOption.TopDirectoryOnly);
foreach (string file in files)
fileInfoCollection.Add(new FileInfo(file));
List<string> moveFiles = new();
string directoryName = Path.GetDirectoryName(logistics.ReportFullPath);
string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(logistics.ReportFullPath);
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())
fileInfoCollection.Add(new FileInfo(moveFile));
if (!string.IsNullOrEmpty(receivedData))
{
int i;