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:
25
Wafer-Counter/Repositories/AzureDevOpsRepository.cs
Normal file
25
Wafer-Counter/Repositories/AzureDevOpsRepository.cs
Normal 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);
|
||||
}
|
||||
|
||||
}
|
@ -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));
|
||||
|
@ -1,11 +0,0 @@
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace OI.Metrology.Wafer.Counter.Repository;
|
||||
|
||||
public partial class RegexHelper
|
||||
{
|
||||
|
||||
[GeneratedRegex(@"[\\,\/,\:,\*,\?,\"",\<,\>,\|]")]
|
||||
internal static partial Regex WindowsFileSystem();
|
||||
|
||||
}
|
@ -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);
|
||||
|
Reference in New Issue
Block a user