AzureDevOpsRepository

Switch to DataGrid
Markdown links
Add css for files, leo and mes
copySelectedB
Logic for other collections
monospace
Ticks bug fix, default to *.wc files and formatting
This commit is contained in:
2024-10-14 12:24:43 -07:00
parent 018382e218
commit 141f9c084a
58 changed files with 3203 additions and 126 deletions

View File

@ -0,0 +1,25 @@
using OI.Metrology.Shared.Models;
using OI.Metrology.Shared.Models.Stateless;
using OI.Metrology.Wafer.Counter.Models;
namespace OI.Metrology.Wafer.Counter.Repository;
public class AzureDevOpsRepository : IAzureDevOpsRepository
{
private readonly AppSettings _AppSettings;
public AzureDevOpsRepository(AppSettings appSettings) =>
_AppSettings = appSettings;
void IAzureDevOpsRepository.Save(PollValue pollValue)
{
ArgumentNullException.ThrowIfNull(pollValue.Id);
ArgumentNullException.ThrowIfNull(pollValue.Page);
string directory = Path.Combine(_AppSettings.AzureDevOpsDestinationDirectory, pollValue.Page, pollValue.Id.Value.ToString());
if (!Directory.Exists(directory))
_ = Directory.CreateDirectory(directory);
File.WriteAllText(Path.Combine(directory, $"{pollValue.Time}.json"), pollValue.Json is null ? string.Empty : pollValue.Json);
}
}

View File

@ -128,7 +128,7 @@ public class FileShareRepository : IFileShareRepository
string[] directories;
string startDateTimeTicks = startDateTime.Ticks.ToString();
string delta = (endDateTime.Ticks - startDateTime.Ticks).ToString();
string ticksSearchPattern = $"{startDateTime.Ticks.ToString()[..(startDateTimeTicks.Length - delta.Length + 1)]}*";
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));

View File

@ -1,11 +0,0 @@
using System.Text.RegularExpressions;
namespace OI.Metrology.Wafer.Counter.Repository;
public partial class RegexHelper
{
[GeneratedRegex(@"[\\,\/,\:,\*,\?,\"",\<,\>,\|]")]
internal static partial Regex WindowsFileSystem();
}

View File

@ -1,6 +1,7 @@
using OI.Metrology.Shared.DataModels;
using OI.Metrology.Shared.Models;
using OI.Metrology.Shared.Models.Stateless;
using OI.Metrology.Wafer.Counter.Helper;
using OI.Metrology.Wafer.Counter.Models;
using System.Collections.ObjectModel;
using System.Globalization;
@ -51,7 +52,7 @@ public class WaferCounterRepository : IWaferCounterRepository
string weekOfYear = $"{nginxFileSystemSortable.DateTime:yyyy}_Week_{calendar.GetWeekOfYear(nginxFileSystemSortable.DateTime, CalendarWeekRule.FirstDay, DayOfWeek.Sunday):00}";
string directory = Path.Combine(archive, weekOfYear, nginxFileSystemSortable.DateTime.ToString("yyyy-MM-dd"), windowsFileSystemSafeText);
string file = Path.Combine(directory, nginxFileSystemSortable.DateTime.Ticks.ToString(), $"{nginxFileSystemSortable.Name}.json");
string json = JsonSerializer.Serialize(waferCounterArchive, new JsonSerializerOptions() { WriteIndented = true });
string json = JsonSerializer.Serialize(waferCounterArchive, WaferCounterArchiveSourceGenerationContext.Default.WaferCounterArchive);
_FileShareRepository.FileWrite(file, json);
string to = Path.Combine(directory, nginxFileSystemSortable.Name);
_FileShareRepository.MoveFile(from, to);