Changes to support barcode scanner and
new CDE5 Windows 7 machine
This commit is contained in:
parent
044b0e2bcd
commit
94b06b7de5
2
Adaptation/.vscode/launch.json
vendored
2
Adaptation/.vscode/launch.json
vendored
@ -4,7 +4,7 @@
|
|||||||
"name": ".NET Core Attach",
|
"name": ".NET Core Attach",
|
||||||
"type": "coreclr",
|
"type": "coreclr",
|
||||||
"request": "attach",
|
"request": "attach",
|
||||||
"processId": 1796
|
"processId": 21428
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,6 @@ using System.Linq;
|
|||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Adaptation.FileHandlers.DownloadRsMFile;
|
namespace Adaptation.FileHandlers.DownloadRsMFile;
|
||||||
|
|
||||||
@ -120,12 +119,13 @@ public class FileRead : Shared.FileRead, IFileRead
|
|||||||
throw new Exception(string.Concat("See ", nameof(Callback)));
|
throw new Exception(string.Concat("See ", nameof(Callback)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task DownloadRsMFileAsync()
|
private void DownloadRsMFileAsync()
|
||||||
{
|
{
|
||||||
if (_HttpClient is null)
|
if (_HttpClient is null)
|
||||||
throw new Exception();
|
throw new Exception();
|
||||||
if (string.IsNullOrEmpty(_StaticFileServer))
|
if (string.IsNullOrEmpty(_StaticFileServer))
|
||||||
throw new Exception();
|
throw new Exception();
|
||||||
|
string logUrl;
|
||||||
string logText;
|
string logText;
|
||||||
string runJson;
|
string runJson;
|
||||||
string rootJson;
|
string rootJson;
|
||||||
@ -141,6 +141,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
|||||||
string dateTimeFormat = "yy/MM/dd HH:mm:ss";
|
string dateTimeFormat = "yy/MM/dd HH:mm:ss";
|
||||||
NginxFileSystem[] runNginxFileSystemCollection;
|
NginxFileSystem[] runNginxFileSystemCollection;
|
||||||
NginxFileSystem[] rootNginxFileSystemCollection;
|
NginxFileSystem[] rootNginxFileSystemCollection;
|
||||||
|
NginxFileSystem[] innerNginxFileSystemCollection;
|
||||||
DateTime fileAgeThresholdDateTime = DateTime.Now;
|
DateTime fileAgeThresholdDateTime = DateTime.Now;
|
||||||
string nginxFormat = "ddd, dd MMM yyyy HH:mm:ss zzz";
|
string nginxFormat = "ddd, dd MMM yyyy HH:mm:ss zzz";
|
||||||
List<Tuple<DateTime, FileInfo, FileInfo, string>> possibleDownload = new();
|
List<Tuple<DateTime, FileInfo, FileInfo, string>> possibleDownload = new();
|
||||||
@ -157,13 +158,30 @@ public class FileRead : Shared.FileRead, IFileRead
|
|||||||
_ => throw new Exception(),
|
_ => throw new Exception(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
rootJson = await _HttpClient.GetStringAsync(string.Concat("http://", _StaticFileServer));
|
rootJson = _HttpClient.GetStringAsync(string.Concat("http://", _StaticFileServer)).Result;
|
||||||
rootNginxFileSystemCollection = JsonSerializer.Deserialize<NginxFileSystem[]>(rootJson, propertyNameCaseInsensitiveJsonSerializerOptions);
|
rootNginxFileSystemCollection = JsonSerializer.Deserialize<NginxFileSystem[]>(rootJson, propertyNameCaseInsensitiveJsonSerializerOptions);
|
||||||
foreach (NginxFileSystem rootNginxFileSystem in rootNginxFileSystemCollection)
|
foreach (NginxFileSystem rootNginxFileSystem in rootNginxFileSystemCollection)
|
||||||
{
|
{
|
||||||
if (!(from l in _FileConnectorConfiguration.SourceFileFilters where rootNginxFileSystem.Name == l select false).Any())
|
if (!(from l in _FileConnectorConfiguration.SourceFileFilters where rootNginxFileSystem.Name == l select false).Any())
|
||||||
continue;
|
continue;
|
||||||
logText = await _HttpClient.GetStringAsync(string.Concat("http://", _StaticFileServer, '/', rootNginxFileSystem.Name));
|
logUrl = string.Empty;
|
||||||
|
if (rootNginxFileSystem.Name.Contains("."))
|
||||||
|
logUrl = string.Concat("http://", _StaticFileServer, '/', rootNginxFileSystem.Name);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rootJson = _HttpClient.GetStringAsync(string.Concat("http://", _StaticFileServer, '/', rootNginxFileSystem.Name)).Result;
|
||||||
|
innerNginxFileSystemCollection = JsonSerializer.Deserialize<NginxFileSystem[]>(rootJson, propertyNameCaseInsensitiveJsonSerializerOptions);
|
||||||
|
foreach (NginxFileSystem innerNginxFileSystem in innerNginxFileSystemCollection)
|
||||||
|
{
|
||||||
|
if (!(from l in _FileConnectorConfiguration.SourceFileFilters where innerNginxFileSystem.Name == l select false).Any())
|
||||||
|
continue;
|
||||||
|
logUrl = string.Concat("http://", _StaticFileServer, '/', rootNginxFileSystem.Name, '/', innerNginxFileSystem.Name);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (string.IsNullOrEmpty(logUrl))
|
||||||
|
continue;
|
||||||
|
logText = _HttpClient.GetStringAsync(logUrl).Result;
|
||||||
logLines = logText.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
|
logLines = logText.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
|
||||||
foreach (string logLine in logLines)
|
foreach (string logLine in logLines)
|
||||||
{
|
{
|
||||||
@ -182,7 +200,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
|||||||
runFullFileNameSegments = runFullFileName.Split('\\').ToList();
|
runFullFileNameSegments = runFullFileName.Split('\\').ToList();
|
||||||
runFileName = runFullFileNameSegments[runFullFileNameSegments.Count - 1];
|
runFileName = runFullFileNameSegments[runFullFileNameSegments.Count - 1];
|
||||||
runFullFileNameSegments.RemoveAt(runFullFileNameSegments.Count - 1);
|
runFullFileNameSegments.RemoveAt(runFullFileNameSegments.Count - 1);
|
||||||
runJson = await _HttpClient.GetStringAsync(string.Concat("http://", _StaticFileServer, '/', string.Join("/", runFullFileNameSegments)));
|
runJson = _HttpClient.GetStringAsync(string.Concat("http://", _StaticFileServer, '/', string.Join("/", runFullFileNameSegments))).Result;
|
||||||
runFullFileNameSegments.Add(runFileName);
|
runFullFileNameSegments.Add(runFileName);
|
||||||
runNginxFileSystemCollection = JsonSerializer.Deserialize<NginxFileSystem[]>(runJson, propertyNameCaseInsensitiveJsonSerializerOptions);
|
runNginxFileSystemCollection = JsonSerializer.Deserialize<NginxFileSystem[]>(runJson, propertyNameCaseInsensitiveJsonSerializerOptions);
|
||||||
foreach (NginxFileSystem matchNginxFileSystem in runNginxFileSystemCollection)
|
foreach (NginxFileSystem matchNginxFileSystem in runNginxFileSystemCollection)
|
||||||
@ -222,7 +240,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
|||||||
File.Delete(alternateFileInfo.FullName);
|
File.Delete(alternateFileInfo.FullName);
|
||||||
if (targetFileInfo.Exists)
|
if (targetFileInfo.Exists)
|
||||||
File.Delete(targetFileInfo.FullName);
|
File.Delete(targetFileInfo.FullName);
|
||||||
targetJson = await _HttpClient.GetStringAsync(targetFileName);
|
targetJson = _HttpClient.GetStringAsync(targetFileName).Result;
|
||||||
File.WriteAllText(targetFileInfo.FullName, targetJson);
|
File.WriteAllText(targetFileInfo.FullName, targetJson);
|
||||||
targetFileInfo.LastWriteTime = matchNginxFileSystemDateTime;
|
targetFileInfo.LastWriteTime = matchNginxFileSystemDateTime;
|
||||||
File.Copy(targetFileInfo.FullName, alternateFileInfo.FullName);
|
File.Copy(targetFileInfo.FullName, alternateFileInfo.FullName);
|
||||||
@ -234,7 +252,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (_IsEAFHosted)
|
if (_IsEAFHosted)
|
||||||
_ = DownloadRsMFileAsync();
|
DownloadRsMFileAsync();
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
|
@ -98,8 +98,8 @@ public class FileRead : Shared.FileRead, IFileRead
|
|||||||
Tuple<string, Test[], JsonElement[], List<FileInfo>> results = new(string.Empty, null, null, new List<FileInfo>());
|
Tuple<string, Test[], JsonElement[], List<FileInfo>> results = new(string.Empty, null, null, new List<FileInfo>());
|
||||||
_Logistics = new Logistics(this, reportFullPath, useSplitForMID: true);
|
_Logistics = new Logistics(this, reportFullPath, useSplitForMID: true);
|
||||||
SetFileParameterLotIDToLogisticsMID();
|
SetFileParameterLotIDToLogisticsMID();
|
||||||
if (reportFullPath.Length < _MinFileLength)
|
if (_Logistics.FileInfo.Length < _MinFileLength)
|
||||||
results.Item4.Add(new FileInfo(reportFullPath));
|
results.Item4.Add(_Logistics.FileInfo);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
IProcessData iProcessData = new ProcessData(this, _Logistics, results.Item4);
|
IProcessData iProcessData = new ProcessData(this, _Logistics, results.Item4);
|
||||||
@ -107,9 +107,8 @@ public class FileRead : Shared.FileRead, IFileRead
|
|||||||
throw new Exception(string.Concat("A) No Data - ", dateTime.Ticks));
|
throw new Exception(string.Concat("A) No Data - ", dateTime.Ticks));
|
||||||
string mid = string.Concat(processData.Reactor, "-", processData.RDS, "-", processData.PSN);
|
string mid = string.Concat(processData.Reactor, "-", processData.RDS, "-", processData.PSN);
|
||||||
mid = Regex.Replace(mid, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0];
|
mid = Regex.Replace(mid, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0];
|
||||||
_Logistics.MID = mid;
|
|
||||||
SetFileParameterLotID(mid);
|
SetFileParameterLotID(mid);
|
||||||
_Logistics.ProcessJobID = processData.Reactor;
|
_Logistics.Update(mid, processData.Reactor);
|
||||||
string logBody = processData.LogBody;
|
string logBody = processData.LogBody;
|
||||||
if (!iProcessData.Details.Any())
|
if (!iProcessData.Details.Any())
|
||||||
throw new Exception(string.Concat("B) No Data - ", dateTime.Ticks));
|
throw new Exception(string.Concat("B) No Data - ", dateTime.Ticks));
|
||||||
|
@ -90,24 +90,32 @@ public class ProcessData : IProcessData
|
|||||||
{
|
{
|
||||||
if (segments.Length > 0)
|
if (segments.Length > 0)
|
||||||
{
|
{
|
||||||
Title = segments[0];
|
// Remove illegal characters \/:*?"<>| found in the title.
|
||||||
// Remove illegal characters \/:*?"<>| found in the Run.
|
string title = Regex.Replace(segments[0], @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0];
|
||||||
Run = Regex.Replace(segments[0], @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0];
|
if (title.StartsWith("1T") || title.StartsWith("1t"))
|
||||||
string[] parsedBatch = segments[0].Split('-');
|
title = title.Substring(2);
|
||||||
if (parsedBatch.Length > 0)
|
Title = title;
|
||||||
Reactor = parsedBatch[0];
|
Run = title;
|
||||||
if (parsedBatch.Length > 1)
|
string[] parsedBatch = title.Split('-');
|
||||||
RDS = parsedBatch[1];
|
if (parsedBatch.Length == 1)
|
||||||
if (parsedBatch.Length > 2)
|
RDS = title;
|
||||||
|
else
|
||||||
{
|
{
|
||||||
string[] parsedPSN = parsedBatch[2].Split('.');
|
if (parsedBatch.Length > 0)
|
||||||
if (parsedPSN.Length > 0)
|
Reactor = parsedBatch[0];
|
||||||
PSN = parsedPSN[0];
|
if (parsedBatch.Length > 1)
|
||||||
if (parsedPSN.Length > 1)
|
RDS = parsedBatch[1];
|
||||||
Layer = parsedPSN[1];
|
if (parsedBatch.Length > 2)
|
||||||
|
{
|
||||||
|
string[] parsedPSN = parsedBatch[2].Split('.');
|
||||||
|
if (parsedPSN.Length > 0)
|
||||||
|
PSN = parsedPSN[0];
|
||||||
|
if (parsedPSN.Length > 1)
|
||||||
|
Layer = parsedPSN[1];
|
||||||
|
}
|
||||||
|
if (parsedBatch.Length > 3)
|
||||||
|
Zone = parsedBatch[3];
|
||||||
}
|
}
|
||||||
if (parsedBatch.Length > 3)
|
|
||||||
Zone = parsedBatch[3];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,19 +225,19 @@ public class ProcessData : IProcessData
|
|||||||
for (int i = 0; i < lines.Length; i++)
|
for (int i = 0; i < lines.Length; i++)
|
||||||
{
|
{
|
||||||
segments = lines[i].Split(separator, StringSplitOptions.RemoveEmptyEntries);
|
segments = lines[i].Split(separator, StringSplitOptions.RemoveEmptyEntries);
|
||||||
if (lines[i].Contains(",<Title>"))
|
if (lines[i].Contains("<Title>"))
|
||||||
SetTitleData(segments);
|
SetTitleData(segments);
|
||||||
else if (lines[i].Contains(",<FileName, Proj,Rcpe, LotID,WfrID>"))
|
else if (lines[i].Contains("<FileName, Proj,Rcpe, LotID,WfrID"))
|
||||||
SetFileNameData(segments);
|
SetFileNameData(segments);
|
||||||
else if (lines[i].Contains(",<DateTime,Temp,TCR%,N|P>"))
|
else if (lines[i].Contains("<DateTime,Temp,TCR%,N|P>"))
|
||||||
SetDateTimeData(logistics, segments);
|
SetDateTimeData(logistics, segments);
|
||||||
else if (lines[i].Contains(",<Operator, Epuipment>"))
|
else if (lines[i].Contains("<Operator, Epuipment>"))
|
||||||
SetOperatorData(segments);
|
SetOperatorData(segments);
|
||||||
else if (lines[i].Contains(",<Engineer>"))
|
else if (lines[i].Contains("<Engineer>"))
|
||||||
SetEngineerData(segments);
|
SetEngineerData(segments);
|
||||||
else if (lines[i].Contains(",<NumProbePoints, SingleOrDualProbeConfig, #ActPrbPts, Rsens,IdrvMx,VinGain, DataRejectSigma, MeritThreshold>"))
|
else if (lines[i].Contains("<NumProbePoints, SingleOrDualProbeConfig, #ActPrbPts, Rsens,IdrvMx,VinGain, DataRejectSigma, MeritThreshold"))
|
||||||
SetNumProbePointsData(segments);
|
SetNumProbePointsData(segments);
|
||||||
else if (lines[i].Contains(",<R,Th,Data, Rs,RsA,RsB, #Smpl, x,y, Irng,Vrng,ChiSq,merit,DataIntegrity>"))
|
else if (lines[i].Contains("<R,Th,Data, Rs,RsA,RsB, #Smpl, x,y, Irng,Vrng"))
|
||||||
{
|
{
|
||||||
for (int z = i; z < lines.Length; z++)
|
for (int z = i; z < lines.Length; z++)
|
||||||
{
|
{
|
||||||
@ -250,8 +258,6 @@ public class ProcessData : IProcessData
|
|||||||
item.Pt = (i + 1).ToString();
|
item.Pt = (i + 1).ToString();
|
||||||
item.UniqueId = string.Concat(item, "_Point-", item.Pt);
|
item.UniqueId = string.Concat(item, "_Point-", item.Pt);
|
||||||
}
|
}
|
||||||
// Remove illegal characters \/:*?"<>| found in the Lot.
|
|
||||||
Lot = Regex.Replace(Lot, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0];
|
|
||||||
StringBuilder stringBuilder = new();
|
StringBuilder stringBuilder = new();
|
||||||
string reportFileName = Path.GetFileName(logistics.ReportFullPath);
|
string reportFileName = Path.GetFileName(logistics.ReportFullPath);
|
||||||
_ = stringBuilder.AppendLine($"RUN [{Title}]");
|
_ = stringBuilder.AppendLine($"RUN [{Title}]");
|
||||||
|
@ -98,8 +98,8 @@ public class FileRead : Shared.FileRead, IFileRead
|
|||||||
Tuple<string, Test[], JsonElement[], List<FileInfo>> results = new(string.Empty, null, null, new List<FileInfo>());
|
Tuple<string, Test[], JsonElement[], List<FileInfo>> results = new(string.Empty, null, null, new List<FileInfo>());
|
||||||
_Logistics = new Logistics(this, reportFullPath, useSplitForMID: true);
|
_Logistics = new Logistics(this, reportFullPath, useSplitForMID: true);
|
||||||
SetFileParameterLotIDToLogisticsMID();
|
SetFileParameterLotIDToLogisticsMID();
|
||||||
if (reportFullPath.Length < _MinFileLength)
|
if (_Logistics.FileInfo.Length < _MinFileLength)
|
||||||
results.Item4.Add(new FileInfo(reportFullPath));
|
results.Item4.Add(_Logistics.FileInfo);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
IProcessData iProcessData = new ProcessData(this, _Logistics, results.Item4);
|
IProcessData iProcessData = new ProcessData(this, _Logistics, results.Item4);
|
||||||
@ -107,9 +107,8 @@ public class FileRead : Shared.FileRead, IFileRead
|
|||||||
throw new Exception(string.Concat("A) No Data - ", dateTime.Ticks));
|
throw new Exception(string.Concat("A) No Data - ", dateTime.Ticks));
|
||||||
string mid = string.Concat(processData.Reactor, "-", processData.RDS, "-", processData.PSN);
|
string mid = string.Concat(processData.Reactor, "-", processData.RDS, "-", processData.PSN);
|
||||||
mid = Regex.Replace(mid, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0];
|
mid = Regex.Replace(mid, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0];
|
||||||
_Logistics.MID = mid;
|
|
||||||
SetFileParameterLotID(mid);
|
SetFileParameterLotID(mid);
|
||||||
_Logistics.ProcessJobID = processData.Reactor;
|
_Logistics.Update(mid, processData.Reactor);
|
||||||
if (!iProcessData.Details.Any())
|
if (!iProcessData.Details.Any())
|
||||||
throw new Exception(string.Concat("B) No Data - ", dateTime.Ticks));
|
throw new Exception(string.Concat("B) No Data - ", dateTime.Ticks));
|
||||||
results = iProcessData.GetResults(this, _Logistics, results.Item4);
|
results = iProcessData.GetResults(this, _Logistics, results.Item4);
|
||||||
|
@ -278,7 +278,7 @@ public class ProcessData : IProcessData
|
|||||||
_I = 0;
|
_I = 0;
|
||||||
_Data = receivedData;
|
_Data = receivedData;
|
||||||
ScanPast("RUN:");
|
ScanPast("RUN:");
|
||||||
Run = GetToEOL();
|
string title = GetToEOL();
|
||||||
ScanPast("Recipe:");
|
ScanPast("Recipe:");
|
||||||
Recipe = GetBefore("RESISTIVITY SPEC:");
|
Recipe = GetBefore("RESISTIVITY SPEC:");
|
||||||
if (string.IsNullOrEmpty(Recipe))
|
if (string.IsNullOrEmpty(Recipe))
|
||||||
@ -286,18 +286,44 @@ public class ProcessData : IProcessData
|
|||||||
_I = 0;
|
_I = 0;
|
||||||
_Data = receivedData;
|
_Data = receivedData;
|
||||||
ScanPast("RUN:");
|
ScanPast("RUN:");
|
||||||
Run = GetToEOL();
|
title = GetToEOL();
|
||||||
ScanPast("DEVICE:");
|
ScanPast("DEVICE:");
|
||||||
Recipe = GetBefore("RESISTIVITY SPEC:");
|
Recipe = GetBefore("RESISTIVITY SPEC:");
|
||||||
}
|
}
|
||||||
|
// Remove illegal characters \/:*?"<>| found in the run.
|
||||||
|
title = Regex.Replace(title.Trim(), @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0];
|
||||||
|
if (title.StartsWith("1T") || title.StartsWith("1t"))
|
||||||
|
title = title.Substring(2);
|
||||||
|
Run = title;
|
||||||
|
string[] parsedBatch = title.Split('-');
|
||||||
|
if (parsedBatch.Length == 1)
|
||||||
|
RDS = title;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (parsedBatch.Length > 0)
|
||||||
|
Reactor = parsedBatch[0];
|
||||||
|
if (parsedBatch.Length > 1)
|
||||||
|
RDS = parsedBatch[1];
|
||||||
|
if (parsedBatch.Length > 2)
|
||||||
|
{
|
||||||
|
string[] parsedPSN = parsedBatch[2].Split('.');
|
||||||
|
if (parsedPSN.Length >= 1)
|
||||||
|
PSN = parsedPSN[0];
|
||||||
|
if (parsedPSN.Length >= 2)
|
||||||
|
Layer = parsedPSN[1];
|
||||||
|
}
|
||||||
|
if (parsedBatch.Length > 3)
|
||||||
|
Zone = parsedBatch[3];
|
||||||
|
}
|
||||||
ResistivitySpec = GetToEOL();
|
ResistivitySpec = GetToEOL();
|
||||||
ScanPast("EQUIP#:");
|
ScanPast("EQUIP#:");
|
||||||
EquipId = GetBefore("Engineer:");
|
string equipId = GetBefore("Engineer:");
|
||||||
|
// Remove illegal characters \/:*?"<>| found in the equipId.
|
||||||
|
equipId = Regex.Replace(equipId, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0];
|
||||||
|
EquipId = equipId;
|
||||||
Engineer = GetToEOL();
|
Engineer = GetToEOL();
|
||||||
ScanPast("LotID:");
|
ScanPast("LotID:");
|
||||||
Lot = GetBefore("D.L.RATIO:");
|
Lot = GetBefore("D.L.RATIO:");
|
||||||
// Remove illegal characters \/:*?"<>| found in the Lot.
|
|
||||||
Lot = Regex.Replace(Lot, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0];
|
|
||||||
DLRatio = GetToEOL();
|
DLRatio = GetToEOL();
|
||||||
ScanPast("OPERATOR:");
|
ScanPast("OPERATOR:");
|
||||||
Employee = GetBefore("TEMP:");
|
Employee = GetBefore("TEMP:");
|
||||||
@ -374,64 +400,18 @@ public class ProcessData : IProcessData
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Id = -1;
|
|
||||||
Run = Run.Trim();
|
|
||||||
if (!Run.StartsWith("[") && !Run.EndsWith("]"))
|
|
||||||
throw new Exception("Lot summary data is invalid or missing.");
|
|
||||||
Run = Run.Replace("[", "");
|
|
||||||
Run = Run.Replace("]", "");
|
|
||||||
Run = Regex.Replace(Run, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0];
|
|
||||||
_Log.Debug($"****ParseData - cde.Run:'{Run}'");
|
|
||||||
if (string.IsNullOrEmpty(Run))
|
|
||||||
throw new Exception("Batch (Run) information does not exist");
|
|
||||||
//parse out batch and validate
|
|
||||||
string[] parsedBatch = Run.Split('-');
|
|
||||||
if (parsedBatch.Length >= 1)
|
|
||||||
Reactor = parsedBatch[0];
|
|
||||||
if (parsedBatch.Length >= 2)
|
|
||||||
RDS = parsedBatch[1];
|
|
||||||
if (parsedBatch.Length >= 3)
|
|
||||||
{
|
|
||||||
string[] parsedPSN = parsedBatch[2].Split('.');
|
|
||||||
if (parsedPSN.Length >= 1)
|
|
||||||
PSN = parsedPSN[0];
|
|
||||||
if (parsedPSN.Length >= 2)
|
|
||||||
Layer = parsedPSN[1];
|
|
||||||
}
|
|
||||||
if (parsedBatch.Length >= 4)
|
|
||||||
Zone = parsedBatch[3];
|
|
||||||
//create filename / unique id
|
//create filename / unique id
|
||||||
string timeFormat = "yyyyMMddHHmmss";
|
string timeFormat = "yyyyMMddHHmmss";
|
||||||
//fix equip
|
_Log.Debug($"****ParseData - Title:{title}; EquipId:{equipId};");
|
||||||
StringBuilder equipFixed = new();
|
if (string.IsNullOrEmpty(title))
|
||||||
foreach (char c in EquipId)
|
throw new Exception("Batch (title) information does not exist");
|
||||||
{
|
UniqueId = string.Concat(equipId, "_", title, "_", logistics.DateTimeFromSequence.ToString(timeFormat));
|
||||||
if (char.IsLetterOrDigit(c) || c == '-' || c == '.')
|
|
||||||
{
|
|
||||||
_ = equipFixed.Append(c);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
EquipId = equipFixed.ToString();
|
|
||||||
_Log.Debug($"****ParseData - cde.EquipId:'{EquipId}'");
|
|
||||||
// The "cde.Run" string is used as part of the SharePoint header unique ID. The "cde.Run" ID is typed
|
|
||||||
// at the tool by the users. The characters are not controlled and the user can type any characters like
|
|
||||||
// "\", "*", ".", " ", etc. Some of these characters are not valid and thus can't be used for the
|
|
||||||
// SharePoint header unique ID. Therefore, we need to filter out invalid characters and only keep the
|
|
||||||
// important ones.
|
|
||||||
StringBuilder runFixed = new();
|
|
||||||
foreach (char c in Run)
|
|
||||||
{
|
|
||||||
if (char.IsLetterOrDigit(c) || c == '-' || c == '.')
|
|
||||||
_ = runFixed.Append(c);
|
|
||||||
}
|
|
||||||
Run = runFixed.ToString();
|
|
||||||
UniqueId = string.Concat(EquipId, "_", Run, "_", logistics.DateTimeFromSequence.ToString(timeFormat));
|
|
||||||
foreach (Detail item in _Details.Cast<Detail>())
|
foreach (Detail item in _Details.Cast<Detail>())
|
||||||
{
|
{
|
||||||
item.HeaderUniqueId = UniqueId;
|
item.HeaderUniqueId = UniqueId;
|
||||||
item.UniqueId = string.Concat(item, item.UniqueId);
|
item.UniqueId = string.Concat(item, item.UniqueId);
|
||||||
}
|
}
|
||||||
fileInfoCollection.Add(new FileInfo(logistics.ReportFullPath));
|
fileInfoCollection.Add(logistics.FileInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
#nullable enable
|
#nullable enable
|
||||||
|
@ -9,34 +9,46 @@ namespace Adaptation.Shared;
|
|||||||
public class Logistics : ILogistics
|
public class Logistics : ILogistics
|
||||||
{
|
{
|
||||||
|
|
||||||
public object NullData { get; private set; }
|
protected readonly DateTime _DateTimeFromSequence;
|
||||||
public string JobID { get; private set; } //CellName
|
protected readonly FileInfo _FileInfo;
|
||||||
public long Sequence { get; private set; } //Ticks
|
protected readonly string _JobID;
|
||||||
public DateTime DateTimeFromSequence { get; private set; }
|
protected readonly List<string> _Logistics1;
|
||||||
public double TotalSecondsSinceLastWriteTimeFromSequence { get; private set; }
|
protected readonly List<Logistics2> _Logistics2;
|
||||||
public string MesEntity { get; private set; } //SPC
|
protected string _MID;
|
||||||
public string ReportFullPath { get; private set; } //Extract file
|
protected readonly string _MesEntity;
|
||||||
public string ProcessJobID { get; set; } //Reactor (duplicate but I want it in the logistics)
|
protected readonly object _NullData;
|
||||||
public string MID { get; set; } //Lot & Pocket || Lot
|
protected string _ProcessJobID;
|
||||||
public List<string> Tags { get; set; }
|
protected readonly string _ReportFullPath;
|
||||||
public List<string> Logistics1 { get; set; }
|
protected readonly long _Sequence;
|
||||||
public List<Logistics2> Logistics2 { get; set; }
|
protected readonly double _TotalSecondsSinceLastWriteTimeFromSequence;
|
||||||
|
|
||||||
|
public DateTime DateTimeFromSequence => _DateTimeFromSequence;
|
||||||
|
public FileInfo FileInfo => _FileInfo;
|
||||||
|
public string JobID => _JobID;
|
||||||
|
public List<string> Logistics1 => _Logistics1;
|
||||||
|
public List<Logistics2> Logistics2 => _Logistics2;
|
||||||
|
public string MID => _MID;
|
||||||
|
public string MesEntity => _MesEntity;
|
||||||
|
public object NullData => _NullData;
|
||||||
|
public string ProcessJobID => _ProcessJobID;
|
||||||
|
public string ReportFullPath => _ReportFullPath;
|
||||||
|
public long Sequence => _Sequence;
|
||||||
|
public double TotalSecondsSinceLastWriteTimeFromSequence => _TotalSecondsSinceLastWriteTimeFromSequence;
|
||||||
|
|
||||||
public Logistics(IFileRead fileRead)
|
public Logistics(IFileRead fileRead)
|
||||||
{
|
{
|
||||||
DateTime dateTime = DateTime.Now;
|
DateTime dateTime = DateTime.Now;
|
||||||
NullData = null;
|
_NullData = null;
|
||||||
Sequence = dateTime.Ticks;
|
_Sequence = dateTime.Ticks;
|
||||||
DateTimeFromSequence = dateTime;
|
_DateTimeFromSequence = dateTime;
|
||||||
JobID = fileRead.CellInstanceName;
|
_JobID = fileRead.CellInstanceName;
|
||||||
TotalSecondsSinceLastWriteTimeFromSequence = (DateTime.Now - dateTime).TotalSeconds;
|
_TotalSecondsSinceLastWriteTimeFromSequence = (DateTime.Now - dateTime).TotalSeconds;
|
||||||
MesEntity = DefaultMesEntity(dateTime);
|
_MesEntity = DefaultMesEntity(dateTime);
|
||||||
ReportFullPath = string.Empty;
|
_ReportFullPath = string.Empty;
|
||||||
ProcessJobID = nameof(ProcessJobID);
|
_ProcessJobID = nameof(ProcessJobID);
|
||||||
MID = nameof(MID);
|
_MID = nameof(MID);
|
||||||
Tags = new List<string>();
|
_Logistics1 = new string[] { string.Concat("LOGISTICS_1", '\t', "A_JOBID=", JobID, ";A_MES_ENTITY=", MesEntity, ";") }.ToList();
|
||||||
Logistics1 = new string[] { string.Concat("LOGISTICS_1", '\t', "A_JOBID=", JobID, ";A_MES_ENTITY=", MesEntity, ";") }.ToList();
|
_Logistics2 = new List<Logistics2>();
|
||||||
Logistics2 = new List<Logistics2>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Logistics(IFileRead fileRead, string reportFullPath, bool useSplitForMID, int? fileInfoLength = null)
|
public Logistics(IFileRead fileRead, string reportFullPath, bool useSplitForMID, int? fileInfoLength = null)
|
||||||
@ -45,19 +57,19 @@ public class Logistics : ILogistics
|
|||||||
throw new Exception();
|
throw new Exception();
|
||||||
if (string.IsNullOrEmpty(fileRead.MesEntity))
|
if (string.IsNullOrEmpty(fileRead.MesEntity))
|
||||||
throw new Exception();
|
throw new Exception();
|
||||||
NullData = fileRead.NullData;
|
_NullData = fileRead.NullData;
|
||||||
FileInfo fileInfo = new(reportFullPath);
|
_FileInfo = new(reportFullPath);
|
||||||
DateTime dateTime = fileInfo.LastWriteTime;
|
DateTime dateTime = _FileInfo.LastWriteTime;
|
||||||
if (fileInfoLength.HasValue && fileInfo.Length < fileInfoLength.Value)
|
if (fileInfoLength.HasValue && _FileInfo.Length < fileInfoLength.Value)
|
||||||
dateTime = dateTime.AddTicks(-1);
|
dateTime = dateTime.AddTicks(-1);
|
||||||
JobID = fileRead.CellInstanceName;
|
_JobID = fileRead.CellInstanceName;
|
||||||
Sequence = dateTime.Ticks;
|
_Sequence = dateTime.Ticks;
|
||||||
DateTimeFromSequence = dateTime;
|
_DateTimeFromSequence = dateTime;
|
||||||
TotalSecondsSinceLastWriteTimeFromSequence = (DateTime.Now - dateTime).TotalSeconds;
|
_TotalSecondsSinceLastWriteTimeFromSequence = (DateTime.Now - dateTime).TotalSeconds;
|
||||||
MesEntity = fileRead.MesEntity;
|
_MesEntity = fileRead.MesEntity;
|
||||||
ReportFullPath = fileInfo.FullName;
|
_ReportFullPath = _FileInfo.FullName;
|
||||||
ProcessJobID = nameof(ProcessJobID);
|
_ProcessJobID = nameof(ProcessJobID);
|
||||||
string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileInfo.FullName);
|
string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(_FileInfo.FullName);
|
||||||
if (useSplitForMID)
|
if (useSplitForMID)
|
||||||
{
|
{
|
||||||
if (fileNameWithoutExtension.IndexOf(".") > -1)
|
if (fileNameWithoutExtension.IndexOf(".") > -1)
|
||||||
@ -67,10 +79,9 @@ public class Logistics : ILogistics
|
|||||||
if (fileNameWithoutExtension.IndexOf("-") > -1)
|
if (fileNameWithoutExtension.IndexOf("-") > -1)
|
||||||
fileNameWithoutExtension = fileNameWithoutExtension.Split('-')[0].Trim();
|
fileNameWithoutExtension = fileNameWithoutExtension.Split('-')[0].Trim();
|
||||||
}
|
}
|
||||||
MID = string.Concat(fileNameWithoutExtension.Substring(0, 1).ToUpper(), fileNameWithoutExtension.Substring(1).ToLower());
|
_MID = string.Concat(fileNameWithoutExtension.Substring(0, 1).ToUpper(), fileNameWithoutExtension.Substring(1).ToLower());
|
||||||
Tags = new List<string>();
|
_Logistics1 = new string[] { string.Concat("LOGISTICS_1", '\t', "A_JOBID=", JobID, ";A_MES_ENTITY=", MesEntity, ";") }.ToList();
|
||||||
Logistics1 = new string[] { string.Concat("LOGISTICS_1", '\t', "A_JOBID=", JobID, ";A_MES_ENTITY=", MesEntity, ";") }.ToList();
|
_Logistics2 = new List<Logistics2>();
|
||||||
Logistics2 = new List<Logistics2>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Logistics(string reportFullPath, string logistics)
|
public Logistics(string reportFullPath, string logistics)
|
||||||
@ -78,57 +89,57 @@ public class Logistics : ILogistics
|
|||||||
string key;
|
string key;
|
||||||
DateTime dateTime;
|
DateTime dateTime;
|
||||||
string[] segments;
|
string[] segments;
|
||||||
Logistics1 = logistics.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries).ToList();
|
_FileInfo = new(reportFullPath);
|
||||||
|
_Logistics1 = logistics.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries).ToList();
|
||||||
if (!Logistics1.Any() || !Logistics1[0].StartsWith("LOGISTICS_1"))
|
if (!Logistics1.Any() || !Logistics1[0].StartsWith("LOGISTICS_1"))
|
||||||
{
|
{
|
||||||
NullData = null;
|
_NullData = null;
|
||||||
JobID = "null";
|
_JobID = "null";
|
||||||
dateTime = new FileInfo(reportFullPath).LastWriteTime;
|
dateTime = _FileInfo.LastWriteTime;
|
||||||
Sequence = dateTime.Ticks;
|
_Sequence = dateTime.Ticks;
|
||||||
DateTimeFromSequence = dateTime;
|
_DateTimeFromSequence = dateTime;
|
||||||
TotalSecondsSinceLastWriteTimeFromSequence = (DateTime.Now - dateTime).TotalSeconds;
|
_TotalSecondsSinceLastWriteTimeFromSequence = (DateTime.Now - dateTime).TotalSeconds;
|
||||||
MesEntity = DefaultMesEntity(dateTime);
|
_MesEntity = DefaultMesEntity(dateTime);
|
||||||
ReportFullPath = reportFullPath;
|
_ReportFullPath = reportFullPath;
|
||||||
ProcessJobID = "R##";
|
_ProcessJobID = "R##";
|
||||||
MID = "null";
|
_MID = "null";
|
||||||
Tags = new List<string>();
|
_Logistics1 = new string[] { string.Concat("LOGISTICS_1", '\t', "A_JOBID=", JobID, ";A_MES_ENTITY=", MesEntity, ";") }.ToList();
|
||||||
Logistics1 = new string[] { string.Concat("LOGISTICS_1", '\t', "A_JOBID=", JobID, ";A_MES_ENTITY=", MesEntity, ";") }.ToList();
|
_Logistics2 = new List<Logistics2>();
|
||||||
Logistics2 = new List<Logistics2>();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string logistics1Line1 = Logistics1[0];
|
string logistics1Line1 = Logistics1[0];
|
||||||
key = "NULL_DATA=";
|
key = "NULL_DATA=";
|
||||||
if (!logistics1Line1.Contains(key))
|
if (!logistics1Line1.Contains(key))
|
||||||
NullData = null;
|
_NullData = null;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
segments = logistics1Line1.Split(new string[] { key }, StringSplitOptions.RemoveEmptyEntries);
|
segments = logistics1Line1.Split(new string[] { key }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
NullData = segments[1].Split(';')[0];
|
_NullData = segments[1].Split(';')[0];
|
||||||
}
|
}
|
||||||
key = "JOBID=";
|
key = "JOBID=";
|
||||||
if (!logistics1Line1.Contains(key))
|
if (!logistics1Line1.Contains(key))
|
||||||
JobID = "null";
|
_JobID = "null";
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
segments = logistics1Line1.Split(new string[] { key }, StringSplitOptions.RemoveEmptyEntries);
|
segments = logistics1Line1.Split(new string[] { key }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
JobID = segments[1].Split(';')[0];
|
_JobID = segments[1].Split(';')[0];
|
||||||
}
|
}
|
||||||
key = "SEQUENCE=";
|
key = "SEQUENCE=";
|
||||||
if (!logistics1Line1.Contains(key))
|
if (!logistics1Line1.Contains(key))
|
||||||
dateTime = new FileInfo(reportFullPath).LastWriteTime;
|
dateTime = _FileInfo.LastWriteTime;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
segments = logistics1Line1.Split(new string[] { key }, StringSplitOptions.RemoveEmptyEntries);
|
segments = logistics1Line1.Split(new string[] { key }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
if (!long.TryParse(segments[1].Split(';')[0].Split('.')[0], out long sequence) || sequence < new DateTime(1999, 1, 1).Ticks)
|
if (!long.TryParse(segments[1].Split(';')[0].Split('.')[0], out long sequence) || sequence < new DateTime(1999, 1, 1).Ticks)
|
||||||
dateTime = new FileInfo(reportFullPath).LastWriteTime;
|
dateTime = _FileInfo.LastWriteTime;
|
||||||
else
|
else
|
||||||
dateTime = new DateTime(sequence);
|
dateTime = new DateTime(sequence);
|
||||||
}
|
}
|
||||||
Sequence = dateTime.Ticks;
|
_Sequence = dateTime.Ticks;
|
||||||
DateTimeFromSequence = dateTime;
|
_DateTimeFromSequence = dateTime;
|
||||||
TotalSecondsSinceLastWriteTimeFromSequence = (DateTime.Now - dateTime).TotalSeconds;
|
_TotalSecondsSinceLastWriteTimeFromSequence = (DateTime.Now - dateTime).TotalSeconds;
|
||||||
DateTime lastWriteTime = new FileInfo(reportFullPath).LastWriteTime;
|
DateTime lastWriteTime = _FileInfo.LastWriteTime;
|
||||||
if (TotalSecondsSinceLastWriteTimeFromSequence > 600)
|
if (TotalSecondsSinceLastWriteTimeFromSequence > 600)
|
||||||
{
|
{
|
||||||
if (lastWriteTime != dateTime)
|
if (lastWriteTime != dateTime)
|
||||||
@ -138,33 +149,32 @@ public class Logistics : ILogistics
|
|||||||
}
|
}
|
||||||
key = "MES_ENTITY=";
|
key = "MES_ENTITY=";
|
||||||
if (!logistics1Line1.Contains(key))
|
if (!logistics1Line1.Contains(key))
|
||||||
MesEntity = DefaultMesEntity(dateTime);
|
_MesEntity = DefaultMesEntity(dateTime);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
segments = logistics1Line1.Split(new string[] { key }, StringSplitOptions.RemoveEmptyEntries);
|
segments = logistics1Line1.Split(new string[] { key }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
MesEntity = segments[1].Split(';')[0];
|
_MesEntity = segments[1].Split(';')[0];
|
||||||
}
|
}
|
||||||
ReportFullPath = reportFullPath;
|
_ReportFullPath = reportFullPath;
|
||||||
key = "PROCESS_JOBID=";
|
key = "PROCESS_JOBID=";
|
||||||
if (!logistics1Line1.Contains(key))
|
if (!logistics1Line1.Contains(key))
|
||||||
ProcessJobID = "R##";
|
_ProcessJobID = "R##";
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
segments = logistics1Line1.Split(new string[] { key }, StringSplitOptions.RemoveEmptyEntries);
|
segments = logistics1Line1.Split(new string[] { key }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
ProcessJobID = segments[1].Split(';')[0];
|
_ProcessJobID = segments[1].Split(';')[0];
|
||||||
}
|
}
|
||||||
key = "MID=";
|
key = "MID=";
|
||||||
if (!logistics1Line1.Contains(key))
|
if (!logistics1Line1.Contains(key))
|
||||||
MID = "null";
|
_MID = "null";
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
segments = logistics1Line1.Split(new string[] { key }, StringSplitOptions.RemoveEmptyEntries);
|
segments = logistics1Line1.Split(new string[] { key }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
MID = segments[1].Split(';')[0];
|
_MID = segments[1].Split(';')[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Logistics2 logistics2;
|
Logistics2 logistics2;
|
||||||
Tags = new List<string>();
|
_Logistics2 = new List<Logistics2>();
|
||||||
Logistics2 = new List<Logistics2>();
|
|
||||||
for (int i = 1; i < Logistics1.Count; i++)
|
for (int i = 1; i < Logistics1.Count; i++)
|
||||||
{
|
{
|
||||||
if (Logistics1[i].StartsWith("LOGISTICS_2"))
|
if (Logistics1[i].StartsWith("LOGISTICS_2"))
|
||||||
@ -180,29 +190,12 @@ public class Logistics : ILogistics
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Logistics ShallowCopy() => (Logistics)MemberwiseClone();
|
|
||||||
|
|
||||||
private static string DefaultMesEntity(DateTime dateTime) => string.Concat(dateTime.Ticks, "_MES_ENTITY");
|
private static string DefaultMesEntity(DateTime dateTime) => string.Concat(dateTime.Ticks, "_MES_ENTITY");
|
||||||
|
|
||||||
internal string GetLotViaMostCommonMethod() => MID.Substring(0, MID.Length - 2);
|
internal void Update(string mid, string processJobID)
|
||||||
|
|
||||||
internal string GetPocketNumberViaMostCommonMethod() => MID.Substring(MID.Length - 2);
|
|
||||||
|
|
||||||
internal void Update(string dateTime, string processJobID, string mid)
|
|
||||||
{
|
{
|
||||||
if (!DateTime.TryParse(dateTime, out DateTime dateTimeCasted))
|
_MID = mid;
|
||||||
dateTimeCasted = DateTime.Now;
|
_ProcessJobID = processJobID;
|
||||||
NullData = null;
|
|
||||||
//JobID = Description.GetCellName();
|
|
||||||
Sequence = dateTimeCasted.Ticks;
|
|
||||||
DateTimeFromSequence = dateTimeCasted;
|
|
||||||
TotalSecondsSinceLastWriteTimeFromSequence = (DateTime.Now - dateTimeCasted).TotalSeconds;
|
|
||||||
//MesEntity = DefaultMesEntity(dateTime);
|
|
||||||
//ReportFullPath = string.Empty;
|
|
||||||
ProcessJobID = processJobID;
|
|
||||||
MID = mid;
|
|
||||||
Tags = new List<string>();
|
|
||||||
Logistics1 = new string[] { string.Concat("LOGISTICS_1", '\t', "A_JOBID=", JobID, ";A_MES_ENTITY=", MesEntity, ";") }.ToList();
|
|
||||||
Logistics2 = new List<Logistics2>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -12,8 +12,6 @@ namespace Adaptation.Shared;
|
|||||||
public class ProcessDataStandardFormat
|
public class ProcessDataStandardFormat
|
||||||
{
|
{
|
||||||
|
|
||||||
public const string RecordStart = "RECORD_START";
|
|
||||||
|
|
||||||
public enum SearchFor
|
public enum SearchFor
|
||||||
{
|
{
|
||||||
EquipmentIntegration = 1,
|
EquipmentIntegration = 1,
|
||||||
|
@ -1,22 +1,23 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace Adaptation.Shared.Properties;
|
namespace Adaptation.Shared.Properties;
|
||||||
|
|
||||||
public interface ILogistics
|
public interface ILogistics
|
||||||
{
|
{
|
||||||
|
|
||||||
public object NullData { get; }
|
|
||||||
public string JobID { get; } //CellName
|
|
||||||
public long Sequence { get; } //Ticks
|
|
||||||
public DateTime DateTimeFromSequence { get; }
|
public DateTime DateTimeFromSequence { get; }
|
||||||
|
public FileInfo FileInfo { get; }
|
||||||
|
public string JobID { get; }
|
||||||
|
public List<string> Logistics1 { get; }
|
||||||
|
public List<Logistics2> Logistics2 { get; }
|
||||||
|
public string MID { get; }
|
||||||
|
public string MesEntity { get; }
|
||||||
|
public object NullData { get; }
|
||||||
|
public string ProcessJobID { get; }
|
||||||
|
public string ReportFullPath { get; }
|
||||||
|
public long Sequence { get; }
|
||||||
public double TotalSecondsSinceLastWriteTimeFromSequence { get; }
|
public double TotalSecondsSinceLastWriteTimeFromSequence { get; }
|
||||||
public string MesEntity { get; } //SPC
|
|
||||||
public string ReportFullPath { get; } //Extract file
|
|
||||||
public string ProcessJobID { get; set; } //Reactor (duplicate but I want it in the logistics)
|
|
||||||
public string MID { get; set; } //Lot & Pocket || Lot
|
|
||||||
public List<string> Tags { get; set; }
|
|
||||||
public List<string> Logistics1 { get; set; }
|
|
||||||
public List<Logistics2> Logistics2 { get; set; }
|
|
||||||
|
|
||||||
}
|
}
|
@ -0,0 +1,60 @@
|
|||||||
|
using Adaptation._Tests.Shared;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
namespace Adaptation._Tests.CreateSelfDescription.Staging.v2_43_3;
|
||||||
|
|
||||||
|
[TestClass]
|
||||||
|
public class CDE5_EQPT : EAFLoggingUnitTesting
|
||||||
|
{
|
||||||
|
|
||||||
|
#pragma warning disable CA2254
|
||||||
|
#pragma warning disable IDE0060
|
||||||
|
|
||||||
|
internal static CDE5_EQPT EAFLoggingUnitTesting { get; private set; }
|
||||||
|
|
||||||
|
public CDE5_EQPT() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||||
|
{
|
||||||
|
if (EAFLoggingUnitTesting is null)
|
||||||
|
throw new Exception();
|
||||||
|
}
|
||||||
|
|
||||||
|
public CDE5_EQPT(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
[ClassInitialize]
|
||||||
|
public static void ClassInitialize(TestContext testContext)
|
||||||
|
{
|
||||||
|
if (EAFLoggingUnitTesting is null)
|
||||||
|
EAFLoggingUnitTesting = new CDE5_EQPT(testContext);
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize"));
|
||||||
|
string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName);
|
||||||
|
File.WriteAllText(fileNameAndText[0], fileNameAndText[1]);
|
||||||
|
File.WriteAllText(fileNameAndText[2], fileNameAndText[3]);
|
||||||
|
}
|
||||||
|
|
||||||
|
[ClassCleanup()]
|
||||||
|
public static void ClassCleanup()
|
||||||
|
{
|
||||||
|
if (EAFLoggingUnitTesting.Logger is not null)
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation("Cleanup");
|
||||||
|
if (EAFLoggingUnitTesting is not null)
|
||||||
|
EAFLoggingUnitTesting.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_43_3__CDE5_EQPT__DownloadRsMFile()
|
||||||
|
{
|
||||||
|
string check = "CDE_Logs|WaferMeasurementData.log|.RsM";
|
||||||
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||||
|
_ = AdaptationTesting.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting);
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,60 @@
|
|||||||
|
using Adaptation._Tests.Shared;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
namespace Adaptation._Tests.CreateSelfDescription.Staging.v2_43_3;
|
||||||
|
|
||||||
|
[TestClass]
|
||||||
|
public class CDE5 : EAFLoggingUnitTesting
|
||||||
|
{
|
||||||
|
|
||||||
|
#pragma warning disable CA2254
|
||||||
|
#pragma warning disable IDE0060
|
||||||
|
|
||||||
|
internal static CDE5 EAFLoggingUnitTesting { get; private set; }
|
||||||
|
|
||||||
|
public CDE5() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||||
|
{
|
||||||
|
if (EAFLoggingUnitTesting is null)
|
||||||
|
throw new Exception();
|
||||||
|
}
|
||||||
|
|
||||||
|
public CDE5(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
[ClassInitialize]
|
||||||
|
public static void ClassInitialize(TestContext testContext)
|
||||||
|
{
|
||||||
|
if (EAFLoggingUnitTesting is null)
|
||||||
|
EAFLoggingUnitTesting = new CDE5(testContext);
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize"));
|
||||||
|
string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName);
|
||||||
|
File.WriteAllText(fileNameAndText[0], fileNameAndText[1]);
|
||||||
|
File.WriteAllText(fileNameAndText[2], fileNameAndText[3]);
|
||||||
|
}
|
||||||
|
|
||||||
|
[ClassCleanup()]
|
||||||
|
public static void ClassCleanup()
|
||||||
|
{
|
||||||
|
if (EAFLoggingUnitTesting.Logger is not null)
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation("Cleanup");
|
||||||
|
if (EAFLoggingUnitTesting is not null)
|
||||||
|
EAFLoggingUnitTesting.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_43_3__CDE5__RsM()
|
||||||
|
{
|
||||||
|
string check = "*.RsM";
|
||||||
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||||
|
_ = AdaptationTesting.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting);
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
41
Adaptation/_Tests/Extract/Staging/v2.43.3/CDE5-EQPT.cs
Normal file
41
Adaptation/_Tests/Extract/Staging/v2.43.3/CDE5-EQPT.cs
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
using Adaptation.Shared;
|
||||||
|
using Adaptation.Shared.Methods;
|
||||||
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
|
namespace Adaptation._Tests.Extract.Staging.v2_43_3;
|
||||||
|
|
||||||
|
[TestClass]
|
||||||
|
public class CDE5_EQPT
|
||||||
|
{
|
||||||
|
|
||||||
|
#pragma warning disable CA2254
|
||||||
|
#pragma warning disable IDE0060
|
||||||
|
|
||||||
|
private static CreateSelfDescription.Staging.v2_43_3.CDE5_EQPT _CDE5_EQPT;
|
||||||
|
|
||||||
|
[ClassInitialize]
|
||||||
|
public static void ClassInitialize(TestContext testContext)
|
||||||
|
{
|
||||||
|
CreateSelfDescription.Staging.v2_43_3.CDE5_EQPT.ClassInitialize(testContext);
|
||||||
|
_CDE5_EQPT = CreateSelfDescription.Staging.v2_43_3.CDE5_EQPT.EAFLoggingUnitTesting;
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_43_3__CDE5_EQPT__DownloadRsMFile() => _CDE5_EQPT.Staging__v2_43_3__CDE5_EQPT__DownloadRsMFile();
|
||||||
|
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_43_3__CDE5_EQPT__DownloadRsMFile6420637710931421087642__Normal()
|
||||||
|
{
|
||||||
|
string check = "CDE_Logs|WaferMeasurementData.log|.RsM";
|
||||||
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
|
_CDE5_EQPT.Staging__v2_43_3__CDE5_EQPT__DownloadRsMFile();
|
||||||
|
_ = _CDE5_EQPT.AdaptationTesting.GetVariables(methodBase, check);
|
||||||
|
for (int i = 0; i < int.MinValue; i++)
|
||||||
|
Thread.Sleep(500);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
72
Adaptation/_Tests/Extract/Staging/v2.43.3/CDE5.cs
Normal file
72
Adaptation/_Tests/Extract/Staging/v2.43.3/CDE5.cs
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
using Adaptation.Shared;
|
||||||
|
using Adaptation.Shared.Methods;
|
||||||
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
namespace Adaptation._Tests.Extract.Staging.v2_43_3;
|
||||||
|
|
||||||
|
[TestClass]
|
||||||
|
public class CDE5
|
||||||
|
{
|
||||||
|
|
||||||
|
#pragma warning disable CA2254
|
||||||
|
#pragma warning disable IDE0060
|
||||||
|
|
||||||
|
private static CreateSelfDescription.Staging.v2_43_3.CDE5 _CDE5;
|
||||||
|
|
||||||
|
[ClassInitialize]
|
||||||
|
public static void ClassInitialize(TestContext testContext)
|
||||||
|
{
|
||||||
|
CreateSelfDescription.Staging.v2_43_3.CDE5.ClassInitialize(testContext);
|
||||||
|
_CDE5 = CreateSelfDescription.Staging.v2_43_3.CDE5.EAFLoggingUnitTesting;
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_43_3__CDE5__RsM() => _CDE5.Staging__v2_43_3__CDE5__RsM();
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_43_3__CDE5__RsM637919422210000000__Normal()
|
||||||
|
{
|
||||||
|
DateTime dateTime;
|
||||||
|
string check = "*.RsM";
|
||||||
|
_CDE5.Staging__v2_43_3__CDE5__RsM();
|
||||||
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
|
string[] variables = _CDE5.AdaptationTesting.GetVariables(methodBase, check);
|
||||||
|
IFileRead fileRead = _CDE5.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
|
||||||
|
Logistics logistics = new(fileRead);
|
||||||
|
string extractResultItem1 = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics, validatePDSF: false);
|
||||||
|
dateTime = FileHandlers.RsM.ProcessData.GetDateTime(logistics, string.Empty);
|
||||||
|
Assert.IsTrue(dateTime == logistics.DateTimeFromSequence);
|
||||||
|
dateTime = FileHandlers.RsM.ProcessData.GetDateTime(logistics, "00:13 09/27/38");
|
||||||
|
Assert.IsTrue(dateTime == logistics.DateTimeFromSequence);
|
||||||
|
string logBody = @"
|
||||||
|
RUN [59-478796-3978.1]
|
||||||
|
Recipe LSL_6in \ WACKER2 RESISTIVITY ####
|
||||||
|
EQUIP# CDE5 Engineer Engineer
|
||||||
|
LotID LotID D.L.RATIO #.####
|
||||||
|
OPERATOR Operator TEMP 19.4 00:13 09/27/38
|
||||||
|
AutoOptimizeGain = ### AutoProbeHeightSet = ##
|
||||||
|
DataReject > #.#Sigma
|
||||||
|
0 ..\LSL_6in.prj\WACKER2.rcp\8927A117.RsM 00:13 09/27/38
|
||||||
|
pt# R Th Rs[Ohm/sq@T] Merit
|
||||||
|
1 65.0 -44.5 577.7672 77.80
|
||||||
|
2 32.5 -44.5 572.4527 103.00
|
||||||
|
3 0.0 0.5 581.8071 108.00
|
||||||
|
4 -32.5 -44.5 576.9838 93.00
|
||||||
|
5 -65.0 -44.5 577.0866 69.80
|
||||||
|
Avg = 577.219 0.58% SEMI Radial= #.##%
|
||||||
|
";
|
||||||
|
bool logBodyCheck = logBody.Trim() == extractResultItem1.Trim();
|
||||||
|
if (!logBodyCheck)
|
||||||
|
{
|
||||||
|
_ = Process.Start("explorer.exe", variables[5]);
|
||||||
|
File.WriteAllText(Path.Combine(variables[5], "0.log"), logBody.Trim());
|
||||||
|
File.WriteAllText(Path.Combine(variables[5], "1.log"), extractResultItem1.Trim());
|
||||||
|
}
|
||||||
|
Assert.IsTrue(logBodyCheck, "Log Body doesn't match!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -23,6 +23,8 @@
|
|||||||
"BW-Extract.Staging.v2_43_2-CDE2": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_2 & ClassName~CDE2\" -- TestRunParameters.Parameter(name=\\\"Debug\\\", value=\\\"Debugger.IsAttached\\\")",
|
"BW-Extract.Staging.v2_43_2-CDE2": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_2 & ClassName~CDE2\" -- TestRunParameters.Parameter(name=\\\"Debug\\\", value=\\\"Debugger.IsAttached\\\")",
|
||||||
"BX-Extract.Staging.v2_43_2-CDE3_EQPT": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_2 & ClassName~CDE3_EQPT\" -- TestRunParameters.Parameter(name=\\\"Debug\\\", value=\\\"Debugger.IsAttached\\\")",
|
"BX-Extract.Staging.v2_43_2-CDE3_EQPT": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_2 & ClassName~CDE3_EQPT\" -- TestRunParameters.Parameter(name=\\\"Debug\\\", value=\\\"Debugger.IsAttached\\\")",
|
||||||
"BY-Extract.Staging.v2_43_2-CDE3": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_2 & ClassName~CDE3\" -- TestRunParameters.Parameter(name=\\\"Debug\\\", value=\\\"Debugger.IsAttached\\\")",
|
"BY-Extract.Staging.v2_43_2-CDE3": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_2 & ClassName~CDE3\" -- TestRunParameters.Parameter(name=\\\"Debug\\\", value=\\\"Debugger.IsAttached\\\")",
|
||||||
"BZ-Extract.Staging.v2_43_2": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_2\" -- TestRunParameters.Parameter(name=\\\"Debug\\\", value=\\\"Debugger.IsAttached\\\")"
|
"BZ-Extract.Staging.v2_43_2": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_2\" -- TestRunParameters.Parameter(name=\\\"Debug\\\", value=\\\"Debugger.IsAttached\\\")",
|
||||||
|
"CA-Extract.Staging.v2_43_3-CDE5-Staging__v2_43_3__CDE5_EQPT__DownloadRsMFile6420637710931421087642__Normal": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_3 & ClassName~CDE5 & Name~Staging__v2_43_3__CDE5_EQPT__DownloadRsMFile6420637710931421087642__Normal\" -- TestRunParameters.Parameter(name=\\\"Debug\\\", value=\\\"Debugger.IsAttached\\\")",
|
||||||
|
"CB-Extract.Staging.v2_43_3-CDE5-Staging__v2_43_3__CDE5__RsM637919422210000000__Normal": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_3 & ClassName~CDE5 & Name~Staging__v2_43_3__CDE5__RsM637919422210000000__Normal\" -- TestRunParameters.Parameter(name=\\\"Debug\\\", value=\\\"Debugger.IsAttached\\\")"
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user