results = new();
+ foreach (int reactor in night)
+ results.Add(reactor.ToString());
+ return results;
+ }
+
+ private static void Append(StringBuilder result, int loadedCount, Reactor reactor, string loadedRDS, TimeSpan timeSpan, InfinityQS1090FullLoad infinityQS1090FullLoad)
+ {
+ _ = result.
+ Append("").Append(reactor.ReactorNo).Append(" | ").
+ Append("").Append(reactor.E10State).Append(" | ").
+ Append("").Append(loadedRDS).Append(" | ").
+ Append("").Append(infinityQS1090FullLoad.Value).Append(" | ").
+ Append("").Append(infinityQS1090FullLoad.TemperatureOffsetPercentage).Append(" | ").
+ Append("").Append(infinityQS1090FullLoad.SubGroupIdFormated).Append(" | ").
+ Append("").Append(Math.Floor(timeSpan.TotalHours)).Append(" | ");
+ }
+
+ private static void Append(StringBuilder result)
+ {
+ _ = result.
+ Append(" | ").
+ Append(" | ").
+ Append(" | ").
+ Append(" | ").
+ Append(" | ").
+ Append(" | ").
+ Append(" | ").
+ Append(" | ");
+ }
+
+ string IInfinityQSV3Repository.GetEpiProTempVerification(int[] night)
+ {
+ StringBuilder result;
+ List eppReactorNumbers = new();
+ List nightSiftReactors = Convert(night);
+ ReadOnlyDictionary eppReactors = GetReactorsMatchingType("EPP");
+ foreach (KeyValuePair keyValuePair in eppReactors)
+ eppReactorNumbers.Add($"'{keyValuePair.Key}'");
+ if (!string.IsNullOrEmpty(_MockRoot))
+ {
+ string html = File.ReadAllText(Path.Combine(string.Concat(AppContext.BaseDirectory, _MockRoot), $"{_RepositoryName}-{nameof(IInfinityQSV3Repository.GetEpiProTempVerification)}.html"));
+ result = new(html);
+ }
+ else
+ {
+ bool found;
+ result = new();
+ int loadedCount;
+ Reactor? reactor;
+ string loadedRDS;
+ int reactorNumber;
+ TimeSpan timeSpan;
+ List used = new();
+ List dayShiftOrder = new();
+ long ticks = DateTime.Now.Ticks;
+ List nightShiftOrder = new();
+ InfinityQS1090FullLoad infinityQS1090FullLoad;
+ IInfinityQSV3Repository infinityQSV3Repository = this;
+ string commandText = infinityQSV3Repository.GetCommandText(eppReactorNumbers);
+ StringBuilder stringBuilder = GetForJsonPath(_DBConnectionFactory, commandText);
+ InfinityQS1090FullLoad[]? results = stringBuilder.Length == 0 ? Array.Empty() : JsonSerializer.Deserialize(stringBuilder.ToString(), InfinityQS1090FullLoadArraySourceGenerationContext.Default.InfinityQS1090FullLoadArray);
+ if (results is null)
+ throw new NullReferenceException(nameof(results));
+ for (int i = 0; i < results.Length; i++)
+ {
+ infinityQS1090FullLoad = results[i];
+ if (infinityQS1090FullLoad.Reactor is null)
+ continue;
+ if (!int.TryParse(infinityQS1090FullLoad.Reactor, out reactorNumber))
+ continue;
+ if (!eppReactors.TryGetValue(reactorNumber, out reactor))
+ continue;
+ if (!nightSiftReactors.Contains(infinityQS1090FullLoad.Reactor))
+ dayShiftOrder.Add(i);
+ else
+ nightShiftOrder.Add(i);
+ }
+ for (int i = 0; i < results.Length; i++)
+ {
+ if (used.Contains(i) || !dayShiftOrder.Contains(i))
+ continue;
+ infinityQS1090FullLoad = results[i];
+ if (infinityQS1090FullLoad.Reactor is null)
+ continue;
+ if (!int.TryParse(infinityQS1090FullLoad.Reactor, out reactorNumber))
+ continue;
+ if (!eppReactors.TryGetValue(reactorNumber, out reactor))
+ continue;
+ used.Add(i);
+ found = false;
+ timeSpan = new(ticks - infinityQS1090FullLoad.SubGroupIdFormated.Ticks);
+ loadedCount = reactor.LoadedRDS is null ? 0 : reactor.LoadedRDS.Count;
+ loadedRDS = reactor.LoadedRDS is null ? "" : reactor.LoadedRDS[0].ToString();
+ _ = result.Append("");
+ Append(result, loadedCount, reactor, loadedRDS, timeSpan, infinityQS1090FullLoad);
+ for (int j = i + 1; j < results.Length; j++)
+ {
+ if (used.Contains(j) || !nightShiftOrder.Contains(j))
+ continue;
+ infinityQS1090FullLoad = results[j];
+ if (infinityQS1090FullLoad.Reactor is null)
+ continue;
+ if (!int.TryParse(infinityQS1090FullLoad.Reactor, out reactorNumber))
+ continue;
+ if (!eppReactors.TryGetValue(reactorNumber, out reactor))
+ continue;
+ used.Add(j);
+ found = true;
+ _ = result.Append(" | ");
+ timeSpan = new(ticks - infinityQS1090FullLoad.SubGroupIdFormated.Ticks);
+ loadedCount = reactor.LoadedRDS is null ? 0 : reactor.LoadedRDS.Count;
+ loadedRDS = reactor.LoadedRDS is null ? "" : reactor.LoadedRDS[0].ToString();
+ Append(result, loadedCount, reactor, loadedRDS, timeSpan, infinityQS1090FullLoad);
+ break;
+ }
+ if (!found)
+ Append(result);
+ _ = result.Append("
");
+ }
+ }
+ return result.ToString();
+ }
+
}
\ No newline at end of file
diff --git a/Server/Repositories/PinRepository.cs b/Server/Repositories/PinRepository.cs
index 2478d4d..a3892f2 100644
--- a/Server/Repositories/PinRepository.cs
+++ b/Server/Repositories/PinRepository.cs
@@ -1,3 +1,4 @@
+using OI.Metrology.Server.Models;
using OI.Metrology.Shared.DataModels;
using OI.Metrology.Shared.Models.Stateless;
using System.Text.Json;
@@ -11,9 +12,9 @@ public class PinRepository : IPinRepository
private readonly string _RepositoryName;
private readonly Dictionary> _RdsToHeaderCommonCollection;
- public PinRepository(string mockRoot)
+ public PinRepository(AppSettings appSettings)
{
- _MockRoot = mockRoot;
+ _MockRoot = appSettings.MockRoot;
_RdsToHeaderCommonCollection = new();
_RepositoryName = nameof(PinRepository)[..^10];
}
diff --git a/Server/Repositories/ServiceShopOrderRepository.cs b/Server/Repositories/ServiceShopOrderRepository.cs
index e2e3ce2..928b669 100644
--- a/Server/Repositories/ServiceShopOrderRepository.cs
+++ b/Server/Repositories/ServiceShopOrderRepository.cs
@@ -7,11 +7,6 @@ namespace OI.Metrology.Server.Repository;
public class ServiceShopOrderRepository : IServiceShopOrderRepository
{
- private readonly ILogger _Logger;
-
- public ServiceShopOrderRepository(ILogger logger) =>
- _Logger = logger;
-
private static ServiceShopOrder[] GetServiceShopOrders(Shared.Models.ServiceShop? serviceShop)
{
ServiceShopOrder[] result = IServiceShopOrder.GetServiceShopOrders(serviceShop);
diff --git a/Server/Repositories/ToolTypesRepository.cs b/Server/Repositories/ToolTypesRepository.cs
index 52d00bb..f8dbc09 100644
--- a/Server/Repositories/ToolTypesRepository.cs
+++ b/Server/Repositories/ToolTypesRepository.cs
@@ -1,3 +1,4 @@
+using OI.Metrology.Server.Models;
using OI.Metrology.Shared.DataModels;
using OI.Metrology.Shared.Models.Stateless;
using OI.Metrology.Shared.Services;
@@ -13,9 +14,9 @@ public class ToolTypesRepository : IToolTypesRepository
private readonly string _MockRoot;
private readonly string _RepositoryName;
- public ToolTypesRepository(string mockRoot)
+ public ToolTypesRepository(AppSettings appSettings)
{
- _MockRoot = mockRoot;
+ _MockRoot = appSettings.MockRoot;
_RepositoryName = nameof(ToolTypesRepository)[..^10];
}
diff --git a/Server/Repositories/WorkMaterialRepository.cs b/Server/Repositories/WorkMaterialRepository.cs
deleted file mode 100644
index abaa6ce..0000000
--- a/Server/Repositories/WorkMaterialRepository.cs
+++ /dev/null
@@ -1,164 +0,0 @@
-using OI.Metrology.Shared.DataModels;
-using OI.Metrology.Shared.Models.Stateless;
-using OI.Metrology.Shared.Repositories;
-using System.Data;
-using System.Data.Common;
-using System.Text;
-using System.Text.Json;
-using System.Text.RegularExpressions;
-
-namespace OI.Metrology.Server.Repository;
-
-public class WorkMaterialRepository : IWorkMaterialRepository
-{
-
- private readonly string _MockRoot;
- private readonly string _RepositoryName;
- private readonly IDbConnectionFactory _DBConnectionFactory;
-
- public WorkMaterialRepository(string mockRoot, IDbConnectionFactory dbConnectionFactory)
- {
- _MockRoot = mockRoot;
- _DBConnectionFactory = dbConnectionFactory;
- _RepositoryName = nameof(WorkMaterialRepository)[..^10];
- }
-
- string IWorkMaterialRepository.GetCommandText(int? workOrderNumber, int? workOrderStep, int? workOrderCassette)
- {
- StringBuilder result = new();
- _ = result.Append("select ( ").
- Append(" select wi.rds_no, ").
- Append(" rr.reactor, ").
- Append(" wi.pocket_no, ").
- Append(" wi.zone, ").
- Append(" wi.in_cass_no, ").
- Append(" wi.slot_no [in_slot_no], ").
- Append(" isnull(wo.out_cass_no, -1) [out_cass_no], ").
- Append(" isnull(wo.slot_no, -1) [out_slot_no], ").
- Append(" rr.ps_no, ").
- Append(" rr.recipe_name, ").
- Append(" rr.recipe_no, ").
- Append(" rr.spec_type ").
- Append(" from lsl2sql.dbo.wm_in_slot_no wi ").
- Append(" inner join lsl2sql.dbo.react_run rr ").
- Append(" on wi.wo_no = rr.wo_no ").
- Append(" and wi.rds_no = rr.rds_no ").
- Append(" left join lsl2sql.dbo.wm_out_slot wo ").
- Append(" on wo.wo_no = wi.wo_no ").
- Append(" and wo.rds = wi.rds_no ").
- Append(" and wo.in_cass_no = wi.in_cass_no ").
- Append(" and wo.in_slot_no = wi.slot_no ").
- Append(" where wi.wo_no = ").Append(workOrderNumber is null ? -1 : workOrderNumber.Value).Append(' ').
- Append(" and wi.rds_no = wm.rds ").
- Append(" order by wi.in_cass_no, wi.slot_no ").
- Append(" for json path ").
- Append(" ) [group] ").
- Append("from lsl2sql.dbo.wm_out_slot wm ").
- Append("where wm.wo_no = ").Append(workOrderNumber is null ? -1 : workOrderNumber.Value).Append(' ').
- Append(" and wm.proc_step_no = ").Append(workOrderStep is null ? -1 : workOrderStep.Value).Append(' ').
- Append(" and wm.out_cass_no = ").Append(workOrderCassette is null ? -1 : workOrderCassette.Value).Append(' ').
- Append("group by wm.rds ").
- Append("order by wm.rds ").
- Append("for json path ");
- return result.ToString();
- }
-
- private static (int?, int?, int?, bool) GetWorkOrder(string mid)
- {
- int? workOrderStep = null;
- int? workOrderNumber = null;
- MatchCollection[] collection;
- int? workOrderCassette = null;
- if (string.IsNullOrEmpty(mid))
- collection = Array.Empty();
- else
- {
- string pattern = @"^([oiOI])?([0-9]{6,7})\.([0-5]{1})\.([0-9]{1,2})$"; // o171308.1.51
- collection = (from l in mid.Split('-') select Regex.Matches(l, pattern)).ToArray();
- }
- foreach (MatchCollection matchCollection in collection)
- {
- if (matchCollection.Count == 0)
- continue;
- if (!matchCollection[0].Success || matchCollection[0].Groups.Count != 5)
- continue;
- if (!int.TryParse(matchCollection[0].Groups[3].Value, out int workOrderStepValue))
- continue;
- if (!int.TryParse(matchCollection[0].Groups[2].Value, out int workOrderNumberValue))
- continue;
- if (!int.TryParse(matchCollection[0].Groups[4].Value, out int workOrderCassetteValue))
- continue;
- workOrderStep = workOrderStepValue;
- workOrderNumber = workOrderNumberValue;
- workOrderCassette = workOrderCassetteValue;
- break;
- }
- return new(workOrderNumber, workOrderStep, workOrderCassette, workOrderStep is not null || workOrderNumber is not null || workOrderCassette is not null);
- }
-
- private static StringBuilder GetForJsonPath(IDbConnectionFactory dbConnectionFactory, string commandText)
- {
- StringBuilder stringBuilder = new();
- using DbConnection dbConnection = dbConnectionFactory.GetDbConnection(useOI2Sql: true);
- DbCommand dbCommand = dbConnection.CreateCommand();
- dbCommand.CommandText = commandText;
- DbDataReader dbDataReader = dbCommand.ExecuteReader(CommandBehavior.SequentialAccess);
- while (dbDataReader.Read())
- _ = stringBuilder.Append(dbDataReader.GetString(0));
- return stringBuilder;
- }
-
- Result IWorkMaterialRepository.GetCassette(string mid)
- {
- Result? result;
- if (!string.IsNullOrEmpty(_MockRoot))
- {
- string json = File.ReadAllText(Path.Combine(string.Concat(AppContext.BaseDirectory, _MockRoot), $"{_RepositoryName}-{nameof(IWorkMaterialRepository.GetCassette)}.json"));
- result = JsonSerializer.Deserialize>(json);
- if (result is null)
- throw new NullReferenceException(nameof(result));
- }
- else
- {
- WorkMaterialV2[] results;
- (int? workOrderNumber, int? workOrderStep, int? workOrderCassette, bool isWorkOrder) = GetWorkOrder(mid);
- if (!isWorkOrder)
- results = Array.Empty();
- else
- {
- WorkMaterial[]? group;
- JsonProperty[] jsonProperties;
- List collection = new();
- IWorkMaterialRepository workMaterialRepository = this;
- string commandText = workMaterialRepository.GetCommandText(workOrderNumber, workOrderStep, workOrderCassette);
- StringBuilder stringBuilder = GetForJsonPath(_DBConnectionFactory, commandText);
- JsonElement[]? jsonElements = stringBuilder.Length == 0 ? Array.Empty() : JsonSerializer.Deserialize(stringBuilder.ToString());
- if (jsonElements is null)
- throw new NullReferenceException(nameof(jsonElements));
- foreach (JsonElement jsonElement in jsonElements)
- {
- if (jsonElement.ValueKind != JsonValueKind.Object)
- continue;
- jsonProperties = jsonElement.EnumerateObject().ToArray();
- if (jsonProperties.Length == 0)
- continue;
- group = JsonSerializer.Deserialize(jsonProperties.First().Value.ToString(), new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
- if (group is null)
- continue;
- foreach (WorkMaterial workMaterial in group)
- collection.Add(workMaterial);
- }
- if (collection is null)
- throw new NullReferenceException(nameof(collection));
- results = WorkMaterial.Convert(collection);
- }
- result = new()
- {
- Results = results,
- TotalRows = results.Length,
- };
- }
- return result;
- }
-
-}
\ No newline at end of file
diff --git a/Server/Views/Shared/_Layout.cshtml b/Server/Views/Shared/_Layout.cshtml
index 8d598cf..9580bc4 100644
--- a/Server/Views/Shared/_Layout.cshtml
+++ b/Server/Views/Shared/_Layout.cshtml
@@ -73,7 +73,6 @@
@Html.ActionLink("Run Information", "RunInfo", "Pages", new { area = "" }, null)
@Html.ActionLink("Run Headers", "RunHeaders", "Pages", new { area = "" }, null)
@Html.ActionLink("Export", "Index", "Export", new { area = "" }, null)
- @Html.ActionLink("Work Material", "WorkMaterial", "Reactors", new { area = "" }, null)
Archive
diff --git a/Server/wwwroot/js/site.js b/Server/wwwroot/js/site.js
index b229bd1..c1dbafd 100644
--- a/Server/wwwroot/js/site.js
+++ b/Server/wwwroot/js/site.js
@@ -379,6 +379,51 @@ function GetMinMax(profilePoints, index) {
return { decades, maxDepth, concentrationMin, concentrationMax, resistanceEditedMin, resistanceEditedMax, resistivityMin, resistivityMax };
}
+function appendDiv() {
+ const div = document.createElement("div");
+ div.innerHTML = `
+
+
+
+ Day Shift |
+ State |
+ Loaded RDS |
+ Average Temperature |
+ Offset % |
+ Time Collected |
+ Hours |
+ |
+ Night Shift |
+ State |
+ Loaded RDS |
+ Average Temperature |
+ Offset % |
+ Time Collected |
+ Hours |
+
+
+
+
+ `;
+ const element = document.getElementById("DataAttachmentDiv");
+ element.appendChild(div);
+ const tbody = document.getElementById("EpiProTempVerification");
+ $.ajax({
+ type: "GET",
+ url: _apiUrl + '/InfinityQSV3/epi-pro-temp-verification/?night=44&night=46&night=52&night=54',
+ success: function (r) {
+ if (r == null)
+ ShowErrorMessage("Invalid data");
+ else {
+ tbody.innerHTML = r;
+ }
+ },
+ error: function (e, _ajaxOptions, ex) {
+ DisplayWSMessage("error", "There was an error getting data.", e, ex);
+ }
+ });
+}
+
function setChart(index, ctx, data) {
var cd;
var depth;
@@ -557,10 +602,14 @@ function detailSelectionChangedRunInfo(evt, ui) {
}
}
else {
- var ctx = document.getElementById('DataAttachmentCanvas');
- $.getJSON(attachmentUrlBase + "/header/files/" + headerAttachmentId + "/" + _toolType.DisplayHeaderAttachment, function (data) {
- setChart(ui.row.index, ctx, data);
- });
+ if (ui.row.index == 4)
+ appendDiv();
+ else {
+ var ctx = document.getElementById('DataAttachmentCanvas');
+ $.getJSON(attachmentUrlBase + "/header/files/" + headerAttachmentId + "/" + _toolType.DisplayHeaderAttachment, function (data) {
+ setChart(ui.row.index, ctx, data);
+ });
+ }
}
}
@@ -1028,8 +1077,7 @@ function oiExportButtonRunInfo() {
}
function setInitialDateTimesRunInfo(milliseconds) {
- if (!milliseconds)
- {
+ if (!milliseconds) {
var startDate = $("#StartDate").igDatePicker("value");
var startTime = $("#StartTime").igTimePicker("value");
var endDate = $("#EndDate").igDatePicker("value");
diff --git a/Shared/DataModels/InfinityQS1090FullLoad.cs b/Shared/DataModels/InfinityQS1090FullLoad.cs
new file mode 100644
index 0000000..f0a715f
--- /dev/null
+++ b/Shared/DataModels/InfinityQS1090FullLoad.cs
@@ -0,0 +1,22 @@
+using System.Text.Json.Serialization;
+
+namespace OI.Metrology.Shared.DataModels;
+
+public record InfinityQS1090FullLoad([property: JsonPropertyName("f_sgrp")] int SubGroupId,
+ [property: JsonPropertyName("date_time")] DateTime SubGroupIdFormated,
+ [property: JsonPropertyName("pr_name")] string Reactor,
+ [property: JsonPropertyName("pd_name")] string Part,
+ [property: JsonPropertyName("iq_value")] float Value,
+ [property: JsonPropertyName("iq_temp_offset_percent")] float TemperatureOffsetPercentage);
+
+[JsonSourceGenerationOptions(WriteIndented = true, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)]
+[JsonSerializable(typeof(InfinityQS1090FullLoad))]
+public partial class InfinityQS1090FullLoadSourceGenerationContext : JsonSerializerContext
+{
+}
+
+[JsonSourceGenerationOptions(WriteIndented = true, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)]
+[JsonSerializable(typeof(Result))]
+public partial class InfinityQS1090FullLoadArraySourceGenerationContext : JsonSerializerContext
+{
+}
\ No newline at end of file
diff --git a/Shared/DataModels/WorkMaterial.cs b/Shared/DataModels/WorkMaterial.cs
deleted file mode 100644
index a8c66ba..0000000
--- a/Shared/DataModels/WorkMaterial.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-namespace OI.Metrology.Shared.DataModels;
-
-public record WorkMaterial(string RDS_NO,
- int REACTOR,
- string POCKET_NO,
- string ZONE,
- int IN_CASS_NO,
- int IN_SLOT_NO,
- int OUT_CASS_NO,
- int OUT_SLOT_NO,
- string PS_NO,
- string RECIPE_NAME,
- int RECIPE_NO,
- string SPEC_TYPE)
-{
-
- public static WorkMaterialV2[] Convert(List collection)
- {
- List results = new();
- foreach (WorkMaterial item in collection)
- results.Add(Map(item));
- return results.ToArray();
- }
-
- public static WorkMaterialV2 Map(WorkMaterial item)
- {
- WorkMaterialV2 result = new(item.RDS_NO,
- item.REACTOR,
- item.POCKET_NO,
- item.ZONE,
- item.IN_CASS_NO,
- item.IN_SLOT_NO,
- item.OUT_CASS_NO,
- item.OUT_SLOT_NO,
- item.PS_NO);
- return result;
- }
-
-}
-
-public record WorkMaterialV2(string RunDataSheet,
- int Reactor,
- string Pocket,
- string Zone,
- int InCassetteNumber,
- int InSlotNumber,
- int OutCassetteNumber,
- int OutSlotNumber,
- string PSN)
-{ }
\ No newline at end of file
diff --git a/Shared/Models/Reactor.cs b/Shared/Models/Reactor.cs
new file mode 100644
index 0000000..d95f65e
--- /dev/null
+++ b/Shared/Models/Reactor.cs
@@ -0,0 +1,43 @@
+using System.Text.Json;
+using System.Text.Json.Serialization;
+
+namespace OI.Metrology.Shared.Models;
+
+public record Reactor(
+ [property: JsonPropertyName("reactorNo")] int ReactorNo,
+ [property: JsonPropertyName("reactType")] string ReactType,
+ [property: JsonPropertyName("reactAssignment")] string ReactAssignment,
+ [property: JsonPropertyName("pickPlace")] bool PickPlace,
+ [property: JsonPropertyName("loadLockDown")] string LoadLockDown,
+ [property: JsonPropertyName("0311Active")] bool _0311Active,
+ [property: JsonPropertyName("loadedRDS")] IReadOnlyList LoadedRDS,
+ [property: JsonPropertyName("isRunning")] bool IsRunning,
+ [property: JsonPropertyName("outOfProdDTM")] string OutOfProdDTM,
+ [property: JsonPropertyName("workOrder")] int? WorkOrder,
+ [property: JsonPropertyName("workOrderCustomer")] string WorkOrderCustomer,
+ [property: JsonPropertyName("currMode")] string CurrMode,
+ [property: JsonPropertyName("serviceDesc")] string ServiceDesc,
+ [property: JsonPropertyName("e10State")] string E10State
+ )
+{
+
+ public override string ToString()
+ {
+ string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
+ return result;
+ }
+
+}
+
+[JsonSourceGenerationOptions(WriteIndented = true)]
+[JsonSerializable(typeof(Reactor))]
+public partial class ReactorSourceGenerationContext : JsonSerializerContext
+{
+}
+
+[JsonSourceGenerationOptions(WriteIndented = true)]
+[JsonSerializable(typeof(Reactor[]))]
+public partial class ReactorCollectionSourceGenerationContext : JsonSerializerContext
+{
+}
+
diff --git a/Shared/Models/Stateless/IInfinityQSV3Controller.cs b/Shared/Models/Stateless/IInfinityQSV3Controller.cs
index 998ab92..281db18 100644
--- a/Shared/Models/Stateless/IInfinityQSV3Controller.cs
+++ b/Shared/Models/Stateless/IInfinityQSV3Controller.cs
@@ -10,8 +10,11 @@ public interface IInfinityQSV3Controller
}
static string GetRouteName() => nameof(IInfinityQSV3Controller)[1..^10];
- T GetCommandText(string sub_group_id, string process, string job, string part, string lot, string date_time);
T GetData(string sub_group_id);
T GetHeader(string sub_group_id);
+ T GetDescriptors(string sub_group_id);
+ T GetEpiProTempVerification(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);
}
\ No newline at end of file
diff --git a/Shared/Models/Stateless/IInfinityQSV3Repository.cs b/Shared/Models/Stateless/IInfinityQSV3Repository.cs
index e6c95d8..1e5baf6 100644
--- a/Shared/Models/Stateless/IInfinityQSV3Repository.cs
+++ b/Shared/Models/Stateless/IInfinityQSV3Repository.cs
@@ -6,12 +6,14 @@ public interface IInfinityQSV3Repository
{
string GetCommandText(string subGroupId);
- string GetCommandText(string process, string? part);
+ string GetEpiProTempVerification(int[] night);
string GetCommandText(InfinityQSV3 infinityQSV2);
+ Result GetData(string subGroupId);
+ Result GetHeader(string subGroupId);
+ string GetCommandText(string process, string? part);
+ string GetCommandText(List eppReactorNumbers);
+ Result GetDescriptors(string subGroupId);
string GetProductDataAverageSumOfDefectsProcessMeanProcessSigma(string process, string? recipe);
string GetCommandText(string? subGroupId, string? process, string? job, string? part, string? lot, string? dateTime);
- Result GetData(string subGroupId);
- Result GetDescriptors(string subGroupId);
- Result GetHeader(string subGroupId);
}
\ No newline at end of file
diff --git a/Shared/Models/Stateless/IWorkMaterialController.cs b/Shared/Models/Stateless/IWorkMaterialController.cs
deleted file mode 100644
index 9b8d218..0000000
--- a/Shared/Models/Stateless/IWorkMaterialController.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-namespace OI.Metrology.Shared.Models.Stateless;
-
-public interface IWorkMaterialController
-{
-
- enum Action : int
- {
- Get = 0
- }
-
- static string GetRouteName() => nameof(IWorkMaterialController)[1..^10];
- T GetCassette(string mid);
-
-}
\ No newline at end of file
diff --git a/Shared/Models/Stateless/IWorkMaterialRepository.cs b/Shared/Models/Stateless/IWorkMaterialRepository.cs
deleted file mode 100644
index 5ab6086..0000000
--- a/Shared/Models/Stateless/IWorkMaterialRepository.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-
-using OI.Metrology.Shared.DataModels;
-
-namespace OI.Metrology.Shared.Models.Stateless;
-
-public interface IWorkMaterialRepository
-{
-
- string GetCommandText(int? workOrderNumber, int? workOrderStep, int? workOrderCassette);
- Result GetCassette(string mid);
-
-}
\ No newline at end of file
diff --git a/Tests/UnitTestInfinityQSV3Controller.cs b/Tests/UnitTestInfinityQSV3Controller.cs
index 1793f88..13b7960 100644
--- a/Tests/UnitTestInfinityQSV3Controller.cs
+++ b/Tests/UnitTestInfinityQSV3Controller.cs
@@ -57,9 +57,6 @@ public class UnitTestInfinityQSV3Controller
NonThrowTryCatch();
}
-#if DEBUG
- [Ignore]
-#endif
[TestMethod]
public async Task GetCommandTextApi()
{
@@ -73,9 +70,6 @@ public class UnitTestInfinityQSV3Controller
NonThrowTryCatch();
}
-#if DEBUG
- [Ignore]
-#endif
[TestMethod]
public void GetData()
{
@@ -94,9 +88,6 @@ public class UnitTestInfinityQSV3Controller
NonThrowTryCatch();
}
-#if DEBUG
- [Ignore]
-#endif
[TestMethod]
public async Task GetDataApi()
{
@@ -112,9 +103,6 @@ public class UnitTestInfinityQSV3Controller
NonThrowTryCatch();
}
-#if DEBUG
- [Ignore]
-#endif
[TestMethod]
public void GetDescriptors()
{
@@ -130,9 +118,6 @@ public class UnitTestInfinityQSV3Controller
NonThrowTryCatch();
}
-#if DEBUG
- [Ignore]
-#endif
[TestMethod]
public async Task GetDescriptorsApi()
{
@@ -148,9 +133,6 @@ public class UnitTestInfinityQSV3Controller
NonThrowTryCatch();
}
-#if DEBUG
- [Ignore]
-#endif
[TestMethod]
public void GetHeader()
{
@@ -164,9 +146,6 @@ public class UnitTestInfinityQSV3Controller
NonThrowTryCatch();
}
-#if DEBUG
- [Ignore]
-#endif
[TestMethod]
public async Task GetHeaderApi()
{
@@ -182,9 +161,6 @@ public class UnitTestInfinityQSV3Controller
NonThrowTryCatch();
}
-#if DEBUG
- [Ignore]
-#endif
[TestMethod]
public void GetProductDataAverageSumOfDefectsProcessMeanProcessSigma()
{
@@ -197,9 +173,6 @@ public class UnitTestInfinityQSV3Controller
NonThrowTryCatch();
}
-#if DEBUG
- [Ignore]
-#endif
[TestMethod]
public async Task GetProductDataAverageSumOfDefectsProcessMeanProcessSigmaApi()
{
@@ -213,4 +186,30 @@ public class UnitTestInfinityQSV3Controller
NonThrowTryCatch();
}
+ [TestMethod]
+ public void GetEpiProTempVerification()
+ {
+ _Logger?.LogInformation("Starting Web Application");
+ int[] night = new int[] { 44, 46, 52, 54 };
+ IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider;
+ IInfinityQSV3Repository? infinityQSV3Repository = serviceProvider?.GetRequiredService();
+ string? result = infinityQSV3Repository?.GetEpiProTempVerification(night);
+ Assert.IsNotNull(result);
+ _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
+ NonThrowTryCatch();
+ }
+
+ [TestMethod]
+ public async Task GetEpiProTempVerificationApi()
+ {
+ HttpClient? httpClient = _WebApplicationFactory?.CreateClient();
+ _Logger?.LogInformation("Starting Web Application");
+ Assert.IsTrue(httpClient is not null);
+ string? result = await httpClient.GetStringAsync($"api/{_ControllerName}/epi-pro-temp-verification/?night=44&night=46&night=52&night=54");
+ File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetEpiProTempVerification)}.html"), result);
+ Assert.IsNotNull(result);
+ _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
+ NonThrowTryCatch();
+ }
+
}
\ No newline at end of file
diff --git a/Tests/UnitTestWorkMaterialController.cs b/Tests/UnitTestWorkMaterialController.cs
deleted file mode 100644
index 7ed60d8..0000000
--- a/Tests/UnitTestWorkMaterialController.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-using Microsoft.AspNetCore.Mvc.Testing;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Logging;
-using OI.Metrology.Shared.DataModels;
-using OI.Metrology.Shared.Models.Stateless;
-
-namespace OI.Metrology.Tests;
-
-[TestClass]
-public class UnitTestWorkMaterialController
-{
-
-#pragma warning disable CS8618
-
- private static ILogger? _Logger;
- private static string _ControllerName;
- private static TestContext _TestContext;
- private static WebApplicationFactory? _WebApplicationFactory;
-
-#pragma warning restore
-
- [ClassInitialize]
- public static void ClassInitAsync(TestContext testContext)
- {
- _TestContext = testContext;
- _WebApplicationFactory = new WebApplicationFactory();
- IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider;
- _Logger = serviceProvider.GetRequiredService>();
- _ControllerName = nameof(Server.ApiControllers.WorkMaterialController)[..^10];
- }
-
- private static void NonThrowTryCatch()
- {
- try
- { throw new Exception(); }
- catch (Exception) { }
- }
-
- [TestMethod]
- public void TestControllerName()
- {
- _Logger?.LogInformation("Starting Web Application");
- Assert.AreEqual(IWorkMaterialController.GetRouteName(), _ControllerName);
- _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
- NonThrowTryCatch();
- }
-
-#if DEBUG
- [Ignore]
-#endif
- [TestMethod]
- public void GetCassette()
- {
- _Logger?.LogInformation("Starting Web Application");
- IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider;
- IWorkMaterialRepository? workMaterialRepository = serviceProvider?.GetRequiredService();
- Result? result = workMaterialRepository?.GetCassette("O171927.1.37");
- Assert.IsNotNull(result?.Results);
- _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
- NonThrowTryCatch();
- }
-
-#if DEBUG
- [Ignore]
-#endif
- [TestMethod]
- public async Task GetCassetteApi()
- {
- HttpClient? httpClient = _WebApplicationFactory?.CreateClient();
- _Logger?.LogInformation("Starting Web Application");
- Assert.IsTrue(httpClient is not null);
- string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/O171927.1.37/");
- File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetCassette)}.json"), json);
- Result? result = System.Text.Json.JsonSerializer.Deserialize>(json);
- Assert.IsNotNull(result?.Results);
- _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName);
- NonThrowTryCatch();
- }
-
-}
\ No newline at end of file