Remove with Text
Remove GetEngineeringSpcReview Better error message EnforceCodeStyleInBuild NginxFileSystem Remove Reactors and Working Directory AppSettings Delete self contained Thunder Tests Back to .net8.0 api/v4/InfinityQS ApiExplorerSettings Wafer Counter
This commit is contained in:
15
Shared/Models/Cleans.cs
Normal file
15
Shared/Models/Cleans.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace OI.Metrology.Shared.Models;
|
||||
|
||||
public record Cleans(
|
||||
[property: JsonPropertyName("cleanRecipe")] string CleanRecipe,
|
||||
[property: JsonPropertyName("cleanSigReq")] bool CleanSigReq
|
||||
// [property: JsonPropertyName("cleanTools")] object[] cleanTools
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Cleans))]
|
||||
public partial class CleansSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
@ -12,8 +12,8 @@ public class DataResponse
|
||||
{
|
||||
HeaderID = -1;
|
||||
Success = false;
|
||||
Errors = new List<string>();
|
||||
Warnings = new List<string>();
|
||||
Errors = new();
|
||||
Warnings = new();
|
||||
}
|
||||
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
namespace OI.Metrology.Shared.Models;
|
||||
|
||||
public interface IWorkingDirectory
|
||||
{
|
||||
|
||||
static string GetWorkingDirectory(string? executingAssemblyName, string subDirectoryName) =>
|
||||
WorkingDirectory.GetWorkingDirectory(executingAssemblyName, subDirectoryName);
|
||||
|
||||
}
|
18
Shared/Models/Inspection.cs
Normal file
18
Shared/Models/Inspection.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace OI.Metrology.Shared.Models;
|
||||
|
||||
public record Inspection(
|
||||
[property: JsonPropertyName("microscope")] bool Microscope,
|
||||
[property: JsonPropertyName("brightlight")] bool Brightlight,
|
||||
[property: JsonPropertyName("inspSigReq")] bool InspSigReq,
|
||||
[property: JsonPropertyName("inspInterval")] int? InspInterval
|
||||
// [property: JsonPropertyName("frontSide")] FrontSide FrontSide,
|
||||
// [property: JsonPropertyName("backSide")] BackSide BackSide
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Inspection))]
|
||||
public partial class InspectionSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
21
Shared/Models/NginxFileSystem.cs
Normal file
21
Shared/Models/NginxFileSystem.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace OI.Metrology.Shared.Models;
|
||||
|
||||
public record NginxFileSystem(
|
||||
[property: JsonPropertyName("name")] string Name,
|
||||
[property: JsonPropertyName("type")] string Type,
|
||||
[property: JsonPropertyName("mtime")] string MTime,
|
||||
[property: JsonPropertyName("size")] float Size);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(NginxFileSystem))]
|
||||
public partial class NginxFileSystemSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(NginxFileSystem[]))]
|
||||
public partial class NginxFileSystemCollectionSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
29
Shared/Models/NginxFileSystemSortable.cs
Normal file
29
Shared/Models/NginxFileSystemSortable.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using OI.Metrology.Shared.Models.Stateless;
|
||||
using System.Globalization;
|
||||
|
||||
namespace OI.Metrology.Shared.Models;
|
||||
|
||||
public record NginxFileSystemSortable(DateTime DateTime,
|
||||
Uri Uri,
|
||||
string Name,
|
||||
float Size,
|
||||
string Type)
|
||||
{
|
||||
|
||||
public static List<NginxFileSystemSortable> Convert(IFileShareRepository fileShareRepository, Uri waferSizeUri, NginxFileSystem[]? collection)
|
||||
{
|
||||
List<NginxFileSystemSortable> results = new();
|
||||
NginxFileSystemSortable nginxFileSystemSortable;
|
||||
string nginxFormat = "ddd, dd MMM yyyy HH:mm:ss zzz";
|
||||
foreach (NginxFileSystem nginxFileSystem in collection ?? Array.Empty<NginxFileSystem>())
|
||||
{
|
||||
if (DateTime.TryParseExact(nginxFileSystem.MTime.Replace("GMT", "+00:00"), nginxFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime dateTime))
|
||||
nginxFileSystemSortable = new(dateTime, fileShareRepository.Append(waferSizeUri, nginxFileSystem.Name), nginxFileSystem.Name, nginxFileSystem.Size, nginxFileSystem.Type);
|
||||
else
|
||||
nginxFileSystemSortable = new(DateTime.MinValue, fileShareRepository.Append(waferSizeUri, nginxFileSystem.Name), nginxFileSystem.Name, nginxFileSystem.Size, nginxFileSystem.Type);
|
||||
results.Add(nginxFileSystemSortable);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
}
|
26
Shared/Models/ProdSpec.cs
Normal file
26
Shared/Models/ProdSpec.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace OI.Metrology.Shared.Models;
|
||||
|
||||
public record ProdSpec(
|
||||
// [property: JsonPropertyName("keyId")] int KeyId,
|
||||
// [property: JsonPropertyName("specType")] string SpecType,
|
||||
// [property: JsonPropertyName("status")] string Status,
|
||||
// [property: JsonPropertyName("minutesPerWafer")] double MinutesPerWafer,
|
||||
// [property: JsonPropertyName("proveInTime")] int ProveInTime,
|
||||
// [property: JsonPropertyName("layerType")] string LayerType,
|
||||
// [property: JsonPropertyName("reactorType")] string ReactorType,
|
||||
// [property: JsonPropertyName("susceptorType")] string SusceptorType,
|
||||
// [property: JsonPropertyName("tubePressureType")] string TubePressureType,
|
||||
// [property: JsonPropertyName("recipeLayers")] RecipeLayer[] RecipeLayers,
|
||||
// [property: JsonPropertyName("prodVers")] ProdVer[] ProdVers,
|
||||
// [property: JsonPropertyName("epiPart")] EpiPart EpiPart,
|
||||
// [property: JsonPropertyName("custEpiParts")] CustEpiPart[] CustEpiParts,
|
||||
[property: JsonPropertyName("prsStages")] PrsStage[] PrsStages
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(ProdSpec))]
|
||||
public partial class ProdSpecSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
15
Shared/Models/ProdSpecRoot.cs
Normal file
15
Shared/Models/ProdSpecRoot.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace OI.Metrology.Shared.Models;
|
||||
|
||||
public record ProdSpecRoot(
|
||||
[property: JsonPropertyName("prodSpec")] ProdSpec ProdSpec
|
||||
// [property: JsonPropertyName("_links")] Links Links,
|
||||
// [property: JsonPropertyName("_class")] string Class
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(ProdSpecRoot))]
|
||||
public partial class ProdSpecRootSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
19
Shared/Models/PrsStage.cs
Normal file
19
Shared/Models/PrsStage.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace OI.Metrology.Shared.Models;
|
||||
|
||||
public record PrsStage(
|
||||
[property: JsonPropertyName("keyId")] string KeyId,
|
||||
[property: JsonPropertyName("psn")] int Psn,
|
||||
[property: JsonPropertyName("stage")] string Stage,
|
||||
[property: JsonPropertyName("cleans")] Cleans Cleans,
|
||||
[property: JsonPropertyName("inspection")] Inspection Inspection,
|
||||
[property: JsonPropertyName("surfscan")] Surfscan Surfscan,
|
||||
[property: JsonPropertyName("qaMetTests")] QaMetTest[] QaMetTests
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(PrsStage))]
|
||||
public partial class PrsStageSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
27
Shared/Models/QaMetTest.cs
Normal file
27
Shared/Models/QaMetTest.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace OI.Metrology.Shared.Models;
|
||||
|
||||
public record QaMetTest(
|
||||
[property: JsonPropertyName("test")] string Test,
|
||||
[property: JsonPropertyName("property")] string Property,
|
||||
[property: JsonPropertyName("propertyDesc")] string PropertyDesc,
|
||||
[property: JsonPropertyName("toolClass")] string ToolClass,
|
||||
[property: JsonPropertyName("recipe")] string Recipe,
|
||||
[property: JsonPropertyName("recipePattern")] string RecipePattern,
|
||||
[property: JsonPropertyName("min")] double Min,
|
||||
[property: JsonPropertyName("max")] double Max,
|
||||
// [property: JsonPropertyName("phaseMin")] object PhaseMin,
|
||||
// [property: JsonPropertyName("slots")] object Slots,
|
||||
[property: JsonPropertyName("wfrQty")] int WfrQty,
|
||||
[property: JsonPropertyName("reactSched")] bool ReactSched,
|
||||
[property: JsonPropertyName("interval")] int Interval,
|
||||
[property: JsonPropertyName("start")] int Start,
|
||||
[property: JsonPropertyName("sequence")] string Sequence
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(QaMetTest))]
|
||||
public partial class QaMetTestSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
@ -39,5 +39,4 @@ public partial class ReactorSourceGenerationContext : JsonSerializerContext
|
||||
[JsonSerializable(typeof(Reactor[]))]
|
||||
public partial class ReactorCollectionSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
||||
|
||||
}
|
13
Shared/Models/RunDataSheet.cs
Normal file
13
Shared/Models/RunDataSheet.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace OI.Metrology.Shared.Models;
|
||||
|
||||
public record RunDataSheet(
|
||||
[property: JsonPropertyName("PSN")] string PSN
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(RunDataSheet))]
|
||||
public partial class RunDataSheetSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
16
Shared/Models/RunDataSheetRoot.cs
Normal file
16
Shared/Models/RunDataSheetRoot.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace OI.Metrology.Shared.Models;
|
||||
|
||||
public record RunDataSheetRoot(
|
||||
[property: JsonPropertyName("rds")] RunDataSheet RunDataSheet,
|
||||
[property: JsonPropertyName("prodSpec")] ProdSpec ProdSpec
|
||||
// [property: JsonPropertyName("_links")] Links Links,
|
||||
// [property: JsonPropertyName("_class")] string Class
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(RunDataSheetRoot))]
|
||||
public partial class RunDataSheetRootSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
18
Shared/Models/Stateless/IFileShareController.cs
Normal file
18
Shared/Models/Stateless/IFileShareController.cs
Normal file
@ -0,0 +1,18 @@
|
||||
namespace OI.Metrology.Shared.Models.Stateless;
|
||||
|
||||
public interface IFileShareController<T>
|
||||
{
|
||||
|
||||
enum Action : int
|
||||
{
|
||||
Index = 0,
|
||||
MarkAsPinned = 1
|
||||
}
|
||||
|
||||
static string GetRouteName() => nameof(IFileShareController<T>)[1..^10];
|
||||
|
||||
T CopyFile(string from, string to);
|
||||
T MoveFile(string from, string to);
|
||||
T FileWrite(string path, string contents);
|
||||
|
||||
}
|
16
Shared/Models/Stateless/IFileShareRepository.cs
Normal file
16
Shared/Models/Stateless/IFileShareRepository.cs
Normal file
@ -0,0 +1,16 @@
|
||||
namespace OI.Metrology.Shared.Models.Stateless;
|
||||
|
||||
public interface IFileShareRepository
|
||||
{
|
||||
|
||||
void CopyFile(string from, string to);
|
||||
void MoveFile(string from, string to);
|
||||
Uri Append(Uri uri, params string[] paths);
|
||||
void FileWrite(string path, string contents);
|
||||
HttpResponseMessage ReadFile(HttpClient httpClient, Uri uri);
|
||||
void CopyFile(HttpClient httpClient, string from, string to);
|
||||
void MoveFile(HttpClient httpClient, string from, string to);
|
||||
void FileWrite(HttpClient httpClient, string path, string contents);
|
||||
List<NginxFileSystemSortable> GetNginxFileSystemSortableCollection(HttpClient httpClient, Uri uri, string? endsWith);
|
||||
|
||||
}
|
21
Shared/Models/Stateless/IInfinityQSV4Controller.cs
Normal file
21
Shared/Models/Stateless/IInfinityQSV4Controller.cs
Normal file
@ -0,0 +1,21 @@
|
||||
namespace OI.Metrology.Shared.Models.Stateless;
|
||||
|
||||
public interface IInfinityQSV4Controller<T>
|
||||
{
|
||||
|
||||
enum Action : int
|
||||
{
|
||||
Index = 0,
|
||||
MarkAsPinned = 1
|
||||
}
|
||||
|
||||
static string GetRouteName() => nameof(IInfinityQSV4Controller<T>)[1..^10];
|
||||
T GetData(string sub_group_id);
|
||||
T GetHeader(string sub_group_id);
|
||||
T GetDescriptors(string sub_group_id);
|
||||
T GetEpiProTempVerification(int[] night);
|
||||
T GetEpiProTempVerificationRows(int[] night);
|
||||
T GetProductDataAverageSumOfDefectsProcessMeanProcessSigma(string process, string? recipe);
|
||||
T GetCommandText(string sub_group_id, string process, string job, string part, string lot, string date_time);
|
||||
|
||||
}
|
23
Shared/Models/Stateless/IInfinityQSV4Repository.cs
Normal file
23
Shared/Models/Stateless/IInfinityQSV4Repository.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using OI.Metrology.Shared.DataModels;
|
||||
|
||||
namespace OI.Metrology.Shared.Models.Stateless;
|
||||
|
||||
public interface IInfinityQSV4Repository
|
||||
{
|
||||
|
||||
List<Reactor> GetReactors();
|
||||
string GetRunDataSheet(string rds);
|
||||
string GetCommandText(string subGroupId);
|
||||
string GetEpiProTempVerification(int[] night);
|
||||
string GetProductionSpecification(string part);
|
||||
string GetCommandText(InfinityQSV4 infinityQSV2);
|
||||
Result<InfinityQSV4[]> GetData(string subGroupId);
|
||||
Result<InfinityQSV4[]> GetHeader(string subGroupId);
|
||||
string GetCommandText(string process, string? part);
|
||||
string GetCommandText(List<string> eppReactorNumbers);
|
||||
List<string[]> GetEpiProTempVerificationRows(int[] night);
|
||||
Result<InfinityQSDescriptorV4[]> GetDescriptors(string subGroupId);
|
||||
string GetProductDataAverageSumOfDefectsProcessMeanProcessSigma(string process, string? recipe);
|
||||
string GetCommandText(string? subGroupId, string? process, string? job, string? part, string? lot, string? dateTime);
|
||||
|
||||
}
|
@ -21,7 +21,7 @@ public interface IMetrologyRepository
|
||||
|
||||
DataTable ExportData(string spName, DateTime startTime, DateTime endTime);
|
||||
|
||||
DataTable GetHeaders(int toolTypeId, DateTime? startTime, DateTime? endTime, int? pageNo, int? pageSize, long? headerid, out long totalRecords);
|
||||
DataTable GetHeaders(int toolTypeId, string? startTime, string? endTime, int? pageNo, int? pageSize, long? headerid, out long totalRecords);
|
||||
DataTable GetData(int toolTypeId, long headerId);
|
||||
DataTable GetDataSharePoint(int toolTypeId, string headerId);
|
||||
|
||||
|
@ -1,13 +0,0 @@
|
||||
|
||||
using OI.Metrology.Shared.DataModels;
|
||||
|
||||
namespace OI.Metrology.Shared.Models.Stateless;
|
||||
|
||||
public interface IReactorsRepository
|
||||
{
|
||||
|
||||
Result<int[]> EvenReactors();
|
||||
Result<int[]> OddReactors();
|
||||
string? GetKey(WorkMaterialOut workMaterialOut, bool save);
|
||||
|
||||
}
|
@ -11,7 +11,7 @@ public interface IToolTypesController<T>
|
||||
static string GetRouteName() => nameof(IToolTypesController<T>)[1..^10];
|
||||
T Index();
|
||||
T GetToolTypeMetadata(int id, string sortby = "");
|
||||
T GetHeaders(int id, DateTime? datebegin, DateTime? dateend, int? page, int? pagesize, long? headerid);
|
||||
T GetHeaders(int id, string? datebegin, string? dateend, int? page, int? pagesize, long? headerid);
|
||||
T GetHeaderTitles(int id, int? page, int? pagesize);
|
||||
T GetHeaderFields(int id, long headerid);
|
||||
T GetData(int id, long headerid);
|
||||
|
@ -8,13 +8,14 @@ public interface IToolTypesRepository
|
||||
{
|
||||
|
||||
Result<ToolTypeNameId[]> Index(IMetrologyRepository metrologyRepository);
|
||||
Result<ToolTypeMetadataResult> GetToolTypeMetadata(IMetrologyRepository metrologyRepository, int id, string sortby = "");
|
||||
Result<DataTable> GetHeaders(IMetrologyRepository metrologyRepository, int id, DateTime? datebegin, DateTime? dateend, int? page, int? pagesize, long? headerid);
|
||||
Result<HeaderCommon[]> GetHeaderTitles(IMetrologyRepository metrologyRepository, int id, int? page, int? pagesize);
|
||||
Result<ColumnValue[]> GetHeaderFields(IMetrologyRepository metrologyRepository, int id, long headerid);
|
||||
Result<DataTable> GetData(IMetrologyRepository metrologyRepository, int id, long headerid);
|
||||
Result<ColumnValue[]> GetHeaderFields(IMetrologyRepository metrologyRepository, int id, long headerid);
|
||||
byte[] GetCSVExport(IMetrologyRepository metrologyRepository, int toolTypeId, string? datebegin, string? dateend);
|
||||
Result<HeaderCommon[]> GetHeaderTitles(IMetrologyRepository metrologyRepository, int id, int? page, int? pagesize);
|
||||
Result<ToolTypeMetadataResult> GetToolTypeMetadata(IMetrologyRepository metrologyRepository, int id, string sortby = "");
|
||||
Result<DataTable> GetExportData(IMetrologyRepository metrologyRepository, int toolTypeId, string? datebegin, string? dateend);
|
||||
string? OIExport(IMetrologyRepository metrologyRepository, IAttachmentsService attachmentsService, int toolTypeId, long headerid);
|
||||
Result<DataTable> GetHeaders(IMetrologyRepository metrologyRepository, int id, string? datebegin, string? dateend, int? page, int? pagesize, long? headerid);
|
||||
(string?, string?, Stream?) GetAttachment(IMetrologyRepository metrologyRepository, IAttachmentsService attachmentsService, int toolTypeId, string tabletype, string attachmentId, string filename);
|
||||
string? OIExport(IMetrologyRepository metrologyRepository, IAttachmentsService attachmentsService, string attachmentPath, Dictionary<string, string> tableToPath, int toolTypeId, long headerid);
|
||||
Result<DataTable> GetExportData(IMetrologyRepository metrologyRepository, int toolTypeId, DateTime? datebegin, DateTime? dateend);
|
||||
byte[] GetCSVExport(IMetrologyRepository metrologyRepository, int toolTypeId, DateTime? datebegin, DateTime? dateend);
|
||||
|
||||
}
|
16
Shared/Models/Stateless/IWaferCounterController.cs
Normal file
16
Shared/Models/Stateless/IWaferCounterController.cs
Normal file
@ -0,0 +1,16 @@
|
||||
namespace OI.Metrology.Shared.Models.Stateless;
|
||||
|
||||
public interface IWaferCounterController<T>
|
||||
{
|
||||
|
||||
enum Action : int
|
||||
{
|
||||
Index = 0,
|
||||
MarkAsPinned = 1
|
||||
}
|
||||
|
||||
static string GetRouteName() => nameof(IWaferCounterController<T>)[1..^10];
|
||||
|
||||
T GetLastQuantityAndSlotMap(string area, string waferSize);
|
||||
|
||||
}
|
9
Shared/Models/Stateless/IWaferCounterRepository.cs
Normal file
9
Shared/Models/Stateless/IWaferCounterRepository.cs
Normal file
@ -0,0 +1,9 @@
|
||||
namespace OI.Metrology.Shared.Models.Stateless;
|
||||
|
||||
public interface IWaferCounterRepository
|
||||
{
|
||||
|
||||
string? GetSlotMap(string line1, string line2);
|
||||
DataModels.WaferCounter GetLastQuantityAndSlotMap(string area, string waferSize);
|
||||
|
||||
}
|
14
Shared/Models/Surfscan.cs
Normal file
14
Shared/Models/Surfscan.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace OI.Metrology.Shared.Models;
|
||||
|
||||
public record Surfscan(
|
||||
[property: JsonPropertyName("surfscanSigReq")] bool SurfscanSigReq,
|
||||
[property: JsonPropertyName("surfscanRecipes")] SurfscanRecipe[] SurfscanRecipes
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Surfscan))]
|
||||
public partial class SurfscanSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
16
Shared/Models/SurfscanRecipe.cs
Normal file
16
Shared/Models/SurfscanRecipe.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace OI.Metrology.Shared.Models;
|
||||
|
||||
public record SurfscanRecipe(
|
||||
[property: JsonPropertyName("recipe")] string Recipe,
|
||||
[property: JsonPropertyName("defects")] int Defects,
|
||||
[property: JsonPropertyName("haze")] int Haze,
|
||||
[property: JsonPropertyName("sampleSize")] int? SampleSize
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(SurfscanRecipe))]
|
||||
public partial class SurfscanRecipeSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
namespace OI.Metrology.Shared.Models;
|
||||
|
||||
internal abstract class WorkingDirectory
|
||||
{
|
||||
|
||||
internal static string GetWorkingDirectory(string? executingAssemblyName, string subDirectoryName)
|
||||
{
|
||||
string result = string.Empty;
|
||||
if (executingAssemblyName is null)
|
||||
throw new Exception();
|
||||
string traceFile;
|
||||
List<string> directories = new();
|
||||
Environment.SpecialFolder[] specialFolders = new Environment.SpecialFolder[]
|
||||
{
|
||||
Environment.SpecialFolder.LocalApplicationData,
|
||||
Environment.SpecialFolder.ApplicationData,
|
||||
Environment.SpecialFolder.History,
|
||||
Environment.SpecialFolder.CommonApplicationData,
|
||||
Environment.SpecialFolder.InternetCache
|
||||
};
|
||||
foreach (Environment.SpecialFolder specialFolder in specialFolders)
|
||||
directories.Add(Path.Combine(Environment.GetFolderPath(specialFolder), subDirectoryName, executingAssemblyName));
|
||||
foreach (string directory in directories)
|
||||
{
|
||||
for (int i = 1; i < 3; i++)
|
||||
{
|
||||
if (i == 1)
|
||||
result = directory;
|
||||
else
|
||||
result = string.Concat("D", directory[1..]);
|
||||
try
|
||||
{
|
||||
if (!Directory.Exists(result))
|
||||
_ = Directory.CreateDirectory(result);
|
||||
traceFile = string.Concat(result, @"\", DateTime.Now.Ticks, ".txt");
|
||||
File.WriteAllText(traceFile, traceFile);
|
||||
File.Delete(traceFile);
|
||||
break;
|
||||
}
|
||||
catch (Exception) { result = string.Empty; }
|
||||
}
|
||||
if (!string.IsNullOrEmpty(result))
|
||||
break;
|
||||
}
|
||||
if (string.IsNullOrEmpty(result))
|
||||
throw new Exception("Unable to set working directory!");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user