diff --git a/Static/AwaitingDispo/index.html b/Static/AwaitingDispo/index.html
index 65b9e88..d654c4f 100644
--- a/Static/AwaitingDispo/index.html
+++ b/Static/AwaitingDispo/index.html
@@ -147,7 +147,7 @@
diff --git a/Static/Export/index.html b/Static/Export/index.html
index 65b9e88..d654c4f 100644
--- a/Static/Export/index.html
+++ b/Static/Export/index.html
@@ -147,7 +147,7 @@
diff --git a/Static/Metrology/AwaitingDispo/index.html b/Static/Metrology/AwaitingDispo/index.html
index 65b9e88..d654c4f 100644
--- a/Static/Metrology/AwaitingDispo/index.html
+++ b/Static/Metrology/AwaitingDispo/index.html
@@ -147,7 +147,7 @@
diff --git a/Static/Metrology/Export/index.html b/Static/Metrology/Export/index.html
index 65b9e88..d654c4f 100644
--- a/Static/Metrology/Export/index.html
+++ b/Static/Metrology/Export/index.html
@@ -147,7 +147,7 @@
diff --git a/Static/Metrology/RunHeaders/index.html b/Static/Metrology/RunHeaders/index.html
index 65b9e88..d654c4f 100644
--- a/Static/Metrology/RunHeaders/index.html
+++ b/Static/Metrology/RunHeaders/index.html
@@ -147,7 +147,7 @@
diff --git a/Static/Metrology/RunInfo/index.html b/Static/Metrology/RunInfo/index.html
index 65b9e88..d654c4f 100644
--- a/Static/Metrology/RunInfo/index.html
+++ b/Static/Metrology/RunInfo/index.html
@@ -147,7 +147,7 @@
diff --git a/Static/Metrology/index.html b/Static/Metrology/index.html
index 65b9e88..d654c4f 100644
--- a/Static/Metrology/index.html
+++ b/Static/Metrology/index.html
@@ -147,7 +147,7 @@
diff --git a/Static/RunHeaders/index.html b/Static/RunHeaders/index.html
index 65b9e88..d654c4f 100644
--- a/Static/RunHeaders/index.html
+++ b/Static/RunHeaders/index.html
@@ -147,7 +147,7 @@
diff --git a/Static/RunInfo/index.html b/Static/RunInfo/index.html
index 65b9e88..d654c4f 100644
--- a/Static/RunInfo/index.html
+++ b/Static/RunInfo/index.html
@@ -147,7 +147,7 @@
diff --git a/Static/awaiting-disposition.html b/Static/awaiting-disposition.html
index 1ff9e0b..d962f80 100644
--- a/Static/awaiting-disposition.html
+++ b/Static/awaiting-disposition.html
@@ -74,7 +74,7 @@
diff --git a/Static/files.html b/Static/files.html
index 47a5d5d..c6b2a4e 100644
--- a/Static/files.html
+++ b/Static/files.html
@@ -115,7 +115,7 @@
diff --git a/Static/index.html b/Static/index.html
index 65b9e88..d654c4f 100644
--- a/Static/index.html
+++ b/Static/index.html
@@ -147,7 +147,7 @@
diff --git a/Static/js/site-server.js b/Static/js/site-server.js
index 4b01557..1632c72 100644
--- a/Static/js/site-server.js
+++ b/Static/js/site-server.js
@@ -919,17 +919,18 @@ function requestHeaderDataFiles() {
var startTime = $("#StartTime").igTimePicker("value");
var endDate = $("#EndDate").igDatePicker("value");
var endTime = $("#EndTime").igTimePicker("value");
+ var segments = toolTypeName.split('-');
var params = {
- area: null,
+ area: segments.length === 2 ? segments[0] : null,
'end-time': new Date(
endDate.getFullYear(), endDate.getMonth(), endDate.getDate(),
endTime.getHours(), endTime.getMinutes(), endTime.getSeconds()).toISOString(),
'equipment-id': toolTypeName,
- 'search-pattern': '*.wc',
+ 'search-pattern': segments.length === 2 ? '*.pdsf' : '*.json',
'start-time': new Date(
startDate.getFullYear(), startDate.getMonth(), startDate.getDate(),
startTime.getHours(), startTime.getMinutes(), startTime.getSeconds()).toISOString(),
- 'wafer-size': null,
+ 'wafer-size': segments.length === 2 ? segments[1] : null,
}
var headerURL = _apiUrl + "/v1/file-share/archive-data/?" + $.param(params);
var gridColumns = [
diff --git a/Static/run-headers.html b/Static/run-headers.html
index f149f0f..c16c028 100644
--- a/Static/run-headers.html
+++ b/Static/run-headers.html
@@ -84,7 +84,7 @@
diff --git a/Wafer-Counter/Repositories/FileShareRepository.cs b/Wafer-Counter/Repositories/FileShareRepository.cs
index d086da0..ffd57e5 100644
--- a/Wafer-Counter/Repositories/FileShareRepository.cs
+++ b/Wafer-Counter/Repositories/FileShareRepository.cs
@@ -122,36 +122,30 @@ public class FileShareRepository : IFileShareRepository
return new(results);
}
- private static ReadOnlyCollection GetFiles(CharacterizationParameters characterizationParameters, string equipmentDirectory, string searchPattern, DateTime startDateTime, DateTime endDateTime, ReadOnlyCollection validDirectories)
+ private static ReadOnlyCollection GetFiles(CharacterizationParameters characterizationParameters, string equipmentDirectory, DateTime startDateTime, DateTime endDateTime, ReadOnlyCollection validDirectories)
{
List results = [];
string[] directories;
+ SearchOption searchOption;
string startDateTimeTicks = startDateTime.Ticks.ToString();
string delta = (endDateTime.Ticks - startDateTime.Ticks).ToString();
string ticksSearchPattern = $"{startDateTime.Ticks.ToString()[..(startDateTimeTicks.Length - delta.Length - 1)]}*";
- bool check = characterizationParameters.SearchPattern is null || searchPattern == characterizationParameters.SearchPattern;
- if (check)
- results.AddRange(Directory.GetFiles(equipmentDirectory, searchPattern, SearchOption.AllDirectories));
foreach (string validDirectory in validDirectories)
{
- if (string.IsNullOrEmpty(validDirectory) || !Directory.Exists(validDirectory))
+ if (string.IsNullOrEmpty(characterizationParameters.SearchPattern) || string.IsNullOrEmpty(validDirectory) || !Directory.Exists(validDirectory))
continue;
- if (check)
- results.AddRange(Directory.GetFiles(validDirectory, searchPattern, SearchOption.AllDirectories));
- else
- {
- directories = Directory.GetDirectories(validDirectory, ticksSearchPattern, SearchOption.AllDirectories);
- foreach (string directory in directories)
- results.AddRange(Directory.GetFiles(directory, searchPattern, SearchOption.TopDirectoryOnly));
- }
+ searchOption = validDirectory == equipmentDirectory ? SearchOption.TopDirectoryOnly : SearchOption.AllDirectories;
+ directories = Directory.GetDirectories(validDirectory, ticksSearchPattern, searchOption);
+ foreach (string directory in directories)
+ results.AddRange(Directory.GetFiles(directory, characterizationParameters.SearchPattern, SearchOption.TopDirectoryOnly));
}
return new(results);
}
- private static ReadOnlyCollection GetCollection(CharacterizationParameters characterizationParameters, string equipmentDirectory, string searchPattern, DateTime startDateTime, DateTime endDateTime, ReadOnlyCollection validDirectories)
+ private static ReadOnlyCollection GetCollection(CharacterizationParameters characterizationParameters, string equipmentDirectory, DateTime startDateTime, DateTime endDateTime, ReadOnlyCollection validDirectories)
{
FileInfo[] results;
- ReadOnlyCollection files = GetFiles(characterizationParameters, equipmentDirectory, searchPattern, startDateTime, endDateTime, validDirectories);
+ ReadOnlyCollection files = GetFiles(characterizationParameters, equipmentDirectory, startDateTime, endDateTime, validDirectories);
FileInfo[] collection = files.Select(l => new FileInfo(l)).ToArray();
results = (from l in collection where l.LastWriteTime >= startDateTime && l.LastWriteTime <= endDateTime orderby l.LastWriteTime descending select l).ToArray();
return new(results);
@@ -193,7 +187,7 @@ public class FileShareRepository : IFileShareRepository
return new(results);
}
- private static ReadOnlyCollection GetCharacterizationData(CharacterizationParameters characterizationParameters, string equipmentDirectory, string searchPattern)
+ private static ReadOnlyCollection GetCharacterizationData(CharacterizationParameters characterizationParameters, string equipmentDirectory)
{
List results = [];
string[] lines;
@@ -204,7 +198,7 @@ public class FileShareRepository : IFileShareRepository
DateTime endDateTime = characterizationParameters.EndTime is null ? DateTime.Now : DateTime.Parse(characterizationParameters.EndTime).ToLocalTime();
DateTime startDateTime = characterizationParameters.StartTime is null ? DateTime.Now.AddHours(-6) : DateTime.Parse(characterizationParameters.StartTime).ToLocalTime();
ReadOnlyCollection validDirectories = GetValidDirectories(equipmentDirectory, startDateTime, endDateTime);
- ReadOnlyCollection collection = GetCollection(characterizationParameters, equipmentDirectory, searchPattern, startDateTime, endDateTime, validDirectories);
+ ReadOnlyCollection collection = GetCollection(characterizationParameters, equipmentDirectory, startDateTime, endDateTime, validDirectories);
foreach (FileInfo fileInfo in collection)
{
if (string.IsNullOrEmpty(fileInfo.DirectoryName))
@@ -232,21 +226,18 @@ public class FileShareRepository : IFileShareRepository
ReadOnlyCollection IFileShareRepository.GetArchiveData(CharacterizationParameters characterizationParameters)
{
List results = [];
- string searchPattern;
string equipmentDirectory;
if (!string.IsNullOrEmpty(characterizationParameters.Area) && !string.IsNullOrEmpty(characterizationParameters.WaferSize))
{
- searchPattern = characterizationParameters.SearchPattern is null ? "*" : characterizationParameters.SearchPattern;
equipmentDirectory = Path.Combine(_AppSettings.EcCharacterizationSi, "WaferCounter", characterizationParameters.Area, characterizationParameters.WaferSize);
if (Directory.Exists(equipmentDirectory))
- results.AddRange(GetCharacterizationData(characterizationParameters, equipmentDirectory, searchPattern));
+ results.AddRange(GetCharacterizationData(characterizationParameters, equipmentDirectory));
}
if (!string.IsNullOrEmpty(characterizationParameters.EquipmentId))
{
- searchPattern = "*.json";
equipmentDirectory = Path.Combine(_AppSettings.EcCharacterizationSi, "Archive", characterizationParameters.EquipmentId);
if (Directory.Exists(equipmentDirectory))
- results.AddRange(GetCharacterizationData(characterizationParameters, equipmentDirectory, searchPattern));
+ results.AddRange(GetCharacterizationData(characterizationParameters, equipmentDirectory));
}
return new(results);
}