Refactor navigation links in Metrology static pages to update "FI Backlog" to "Reporting Services" with new URL.
- Updated links in the following files: - Static/Metrology/AwaitingDispo/index.html - Static/Metrology/Export/index.html - Static/Metrology/RunHeaders/index.html - Static/Metrology/RunInfo/index.html - Static/Metrology/index.html - Static/RunHeaders/index.html - Static/RunInfo/index.html - Static/awaiting-disposition.html - Static/export.html - Static/files.html - Static/index.html - Static/run-headers.html Removed obsolete HTTP request files from Tests/.vscode directory. - Deleted files: - tc_col_metrology-viewer-dev.http - tc_col_metrology-viewer-v1.http - tc_col_metrology-viewer-v2.http - tc_col_metrology-viewer-v3.http - tc_col_metrology-viewer-v4.http - tc_col_metrology-viewer.http - wafer-counter.http Added new HTTP request files for development and production environments. - Added files: - api-metrology-viewer-dev.http - api-metrology-viewer.http - api-v1-InfinityQS.http - api-v1-wafer-counter.http - api-v2-InfinityQS.http - api-v3-InfinityQS.http - api-v4-InfinityQS.http Updated Unit Tests for Inbound and WaferCounter controllers to reflect changes in repository methods and test scenarios. - Modified UnitTestWaferCounterController.cs to change area and wafer size parameters. - Removed UnitInboundController.cs and added new tests for InboundController functionality. Refactored FileShareRepository and WaferCounterRepository to improve file handling and data retrieval logic. - Updated methods to handle multiple file extensions and improve error handling. - Adjusted logic for retrieving last quantity and slot map based on file type. Added static pipeline configuration for deployment. - Created static-pipeline.yml for automated deployment process.
This commit is contained in:
@ -155,11 +155,12 @@ public class WaferCounterRepository : IWaferCounterRepository
|
||||
{
|
||||
List<NginxFileSystemSortable> results = new();
|
||||
DateTime dateTime = DateTime.Now;
|
||||
string[] endsWithCollection = [".wc", ".pdsf"];
|
||||
ReadOnlyCollection<NginxFileSystemSortable> collection;
|
||||
long ticks = dateTime.AddSeconds(_AppSettings.WaferCounterTwoFileSecondsWait).Ticks;
|
||||
for (int i = 0; i < int.MaxValue; i++)
|
||||
{
|
||||
collection = _FileShareRepository.GetNginxFileSystemSortableCollection(httpClient, waferSizeUri, ".wc");
|
||||
collection = _FileShareRepository.GetNginxFileSystemSortableCollection(httpClient, waferSizeUri, endsWithCollection);
|
||||
results.AddRange(collection);
|
||||
if (results.Count > 0 || DateTime.Now.Ticks > ticks)
|
||||
break;
|
||||
@ -168,20 +169,35 @@ public class WaferCounterRepository : IWaferCounterRepository
|
||||
return results;
|
||||
}
|
||||
|
||||
private static WaferCounter? GetLastQuantityAndSlotMap(string waferSize, HttpClient httpClient, NginxFileSystemSortable nginxFileSystemSortable)
|
||||
private static WaferCounter? GetLastQuantityAndSlotMap(string area, string waferSize, HttpClient httpClient, NginxFileSystemSortable nginxFileSystemSortable)
|
||||
{
|
||||
WaferCounter? result;
|
||||
Task<string> value = httpClient.GetStringAsync(nginxFileSystemSortable.Uri);
|
||||
value.Wait();
|
||||
string? line1;
|
||||
string? line2;
|
||||
string[] lines = value.Result.Split("\r\n");
|
||||
if (lines.Length < 3)
|
||||
if (nginxFileSystemSortable.Name.EndsWith(".wc") && lines.Length > 2)
|
||||
{
|
||||
line1 = lines[^3];
|
||||
line2 = lines[^2];
|
||||
}
|
||||
else if (nginxFileSystemSortable.Name.EndsWith(".pdsf") && lines.Length > 14)
|
||||
{
|
||||
line1 = lines[7].Split('\t')[^1];
|
||||
line2 = lines[8].Split('\t')[^1];
|
||||
}
|
||||
else
|
||||
{
|
||||
line1 = null;
|
||||
line2 = null;
|
||||
}
|
||||
if (string.IsNullOrEmpty(line1) || string.IsNullOrEmpty(line2))
|
||||
result = WaferCounter.GetWaferCounter("Incomplete file length!");
|
||||
else
|
||||
{
|
||||
string text = string.Empty;
|
||||
string[] segments = nginxFileSystemSortable.Name.Split('-');
|
||||
Record record = GetRecord(lines[^3], lines[^2]);
|
||||
string equipmentId = segments.Length <= 1 ? nginxFileSystemSortable.Name : segments[1].Split('.')[0];
|
||||
Record record = GetRecord(line1, line2);
|
||||
if (string.IsNullOrEmpty(record.SlotMap) || record.SlotMap.Length != 25)
|
||||
result = WaferCounter.GetWaferCounter("Wrong length for slot-map!");
|
||||
else
|
||||
@ -189,7 +205,13 @@ public class WaferCounterRepository : IWaferCounterRepository
|
||||
if (record.Total != record.Check)
|
||||
result = WaferCounter.GetWaferCounter($"Checksum has failed. {record.Total} != {record.Check}");
|
||||
else
|
||||
result = new(nginxFileSystemSortable.DateTime, nginxFileSystemSortable.DateTime.ToString("yyyy-MM-dd hh:mm tt"), $"WC{waferSize}{equipmentId}", string.Empty, text, record.Total, record.SlotMap);
|
||||
result = new(DateTime: nginxFileSystemSortable.DateTime,
|
||||
DateTimeFormatted: nginxFileSystemSortable.DateTime.ToString("yyyy-MM-dd hh:mm tt"),
|
||||
EquipmentId: $"{area}-{waferSize}",
|
||||
Message: string.Empty,
|
||||
Text: text,
|
||||
Total: record.Total,
|
||||
SlotMap: record.SlotMap);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@ -207,7 +229,7 @@ public class WaferCounterRepository : IWaferCounterRepository
|
||||
else
|
||||
{
|
||||
string windowsFileSystemSafeText = _Regex.Replace(text, ".");
|
||||
result = GetLastQuantityAndSlotMap(waferSize, httpClient, nginxFileSystemSortableCollection[0]);
|
||||
result = GetLastQuantityAndSlotMap(area, waferSize, httpClient, nginxFileSystemSortableCollection[0]);
|
||||
for (int i = 0; i < nginxFileSystemSortableCollection.Count; i++)
|
||||
MoveFile(area, waferSize, result, windowsFileSystemSafeText, waferSizeDirectory, nginxFileSystemSortableCollection[i]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user