Update GetEngineeringSpcReview to work without FS access.

IqsFileSegments and WaferCounterTwoFileSecondsWait
This commit is contained in:
2024-03-19 15:18:15 -07:00
parent 811f45a7df
commit 85fe0a7823
6 changed files with 120 additions and 95 deletions

View File

@ -6,7 +6,6 @@ namespace OI.Metrology.Server.Models.Binder;
public class AppSettings
{
public string? ApiExportPath { get; set; }
public string? ApiFileShare { get; set; }
public string? ApiLoggingContentTypes { get; set; }
public string? ApiLoggingPathPrefixes { get; set; }
@ -21,7 +20,7 @@ public class AppSettings
public string? GitCommitSeven { get; set; }
public string? InboundApiAllowedIPList { get; set; }
public string? IqsColumns { get; set; }
public string? IqsFile { get; set; }
public string[]? IqsFileSegments { get; set; }
public string? IqsKey { get; set; }
public string? IqsRed { get; set; }
public string? IqsYellow { get; set; }
@ -34,6 +33,7 @@ public class AppSettings
public Dictionary<string, string>? TableToPath { get; set; }
public string? URLs { get; set; }
public string? WaferCounterDestinationDirectory { get; set; }
public int? WaferCounterTwoFileSecondsWait { get; set; }
public string? WorkingDirectoryName { get; set; }
public override string ToString()
@ -44,7 +44,7 @@ public class AppSettings
private static void PreVerify(IConfigurationRoot configurationRoot, AppSettings? appSettings)
{
if (appSettings?.ApiExportPath is null)
if (appSettings?.ApiFileShare is null)
{
List<string> paths = new();
foreach (IConfigurationProvider configurationProvider in configurationRoot.Providers)
@ -63,7 +63,6 @@ public class AppSettings
{
Models.AppSettings result;
if (appSettings is null) throw new NullReferenceException(nameof(appSettings));
if (appSettings.ApiExportPath is null) throw new NullReferenceException(nameof(ApiExportPath));
if (appSettings.ApiFileShare is null) throw new NullReferenceException(nameof(ApiFileShare));
if (appSettings.ApiLoggingContentTypes is null) throw new NullReferenceException(nameof(ApiLoggingContentTypes));
if (appSettings.ApiLoggingPathPrefixes is null) throw new NullReferenceException(nameof(ApiLoggingPathPrefixes));
@ -78,7 +77,7 @@ public class AppSettings
if (appSettings.GitCommitSeven is null) throw new NullReferenceException(nameof(GitCommitSeven));
if (appSettings.InboundApiAllowedIPList is null) throw new NullReferenceException(nameof(InboundApiAllowedIPList));
if (appSettings.IqsColumns is null) throw new NullReferenceException(nameof(IqsColumns));
if (appSettings.IqsFile is null) throw new NullReferenceException(nameof(IqsFile));
if (appSettings.IqsFileSegments is null) throw new NullReferenceException(nameof(IqsFileSegments));
if (appSettings.IqsKey is null) throw new NullReferenceException(nameof(IqsKey));
if (appSettings.IqsRed is null) throw new NullReferenceException(nameof(IqsRed));
if (appSettings.IqsYellow is null) throw new NullReferenceException(nameof(IqsYellow));
@ -91,9 +90,9 @@ public class AppSettings
if (appSettings.URLs is null) throw new NullReferenceException(nameof(URLs));
if (appSettings.TableToPath is null) throw new NullReferenceException(nameof(TableToPath));
if (appSettings.WaferCounterDestinationDirectory is null) throw new NullReferenceException(nameof(WaferCounterDestinationDirectory));
if (appSettings.WaferCounterTwoFileSecondsWait is null) throw new NullReferenceException(nameof(WaferCounterTwoFileSecondsWait));
if (appSettings.WorkingDirectoryName is null) throw new NullReferenceException(nameof(WorkingDirectoryName));
result = new(
appSettings.ApiExportPath,
appSettings.ApiFileShare,
appSettings.ApiLoggingContentTypes,
appSettings.ApiLoggingPathPrefixes,
@ -108,7 +107,7 @@ public class AppSettings
appSettings.GitCommitSeven,
appSettings.InboundApiAllowedIPList,
appSettings.IqsColumns,
appSettings.IqsFile,
appSettings.IqsFileSegments,
appSettings.IqsKey,
appSettings.IqsRed,
appSettings.IqsYellow,
@ -121,6 +120,7 @@ public class AppSettings
appSettings.TableToPath,
appSettings.URLs,
appSettings.WaferCounterDestinationDirectory,
appSettings.WaferCounterTwoFileSecondsWait.Value,
appSettings.WorkingDirectoryName);
return result;
}