From 61f1c7dc3bbf55d428ad5384e85f8c6b63b5799e Mon Sep 17 00:00:00 2001 From: "phares@iscn5cg20977xq" Date: Mon, 13 Oct 2025 17:17:11 -0700 Subject: [PATCH] Add IndexOf and AttemptCounter properties to WSRequest and Description classes; implement getValue function in recipes-and-patterns.js --- .../OpenInsightMetrologyViewer/WSRequest.cs | 8 ++++++-- Adaptation/FileHandlers/RsM/Description.cs | 6 ++++++ Adaptation/Infineon/Monitoring/MonA/MonIn.cs | 12 ++++++------ Adaptation/Shared/FileRead.cs | 1 - Adaptation/Shared/ProcessDataStandardFormat.cs | 4 ++-- 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/Adaptation/FileHandlers/OpenInsightMetrologyViewer/WSRequest.cs b/Adaptation/FileHandlers/OpenInsightMetrologyViewer/WSRequest.cs index 6396377..e15a89e 100644 --- a/Adaptation/FileHandlers/OpenInsightMetrologyViewer/WSRequest.cs +++ b/Adaptation/FileHandlers/OpenInsightMetrologyViewer/WSRequest.cs @@ -15,6 +15,7 @@ public class WSRequest public bool SentToSPC { get; set; } // + public string AttemptCounter { get; set; } public string AutoOptimizeGain { get; set; } public string AutoProbeHeightSet { get; set; } public string Avg { get; set; } @@ -27,6 +28,7 @@ public class WSRequest public string FileName { get; set; } public string FilePath { get; set; } public int Id { get; set; } + public string IndexOf { get; set; } public string Layer { get; set; } public string LotId { get; set; } public string Op { get; set; } @@ -56,18 +58,20 @@ public class WSRequest throw new Exception(); //Header { + AttemptCounter = x.AttemptCounter; AutoOptimizeGain = x.AutoOptimizeGain; AutoProbeHeightSet = x.AutoProbeHeightSet; Avg = x.Avg; - DLRatio = x.DLRatio; DataReject = x.DataReject; Date = x.Date; - Op = x.Employee; // different name + DLRatio = x.DLRatio; Engineer = x.Engineer; EquipId = logistics.MesEntity; // different name FileName = x.FileName; + IndexOf = x.IndexOf; Layer = x.Layer; LotId = x.Lot; // different name + Op = x.Employee; // different name PSN = x.PSN; RDS = x.RDS; Reactor = x.Reactor; diff --git a/Adaptation/FileHandlers/RsM/Description.cs b/Adaptation/FileHandlers/RsM/Description.cs index e789b55..1419a5a 100644 --- a/Adaptation/FileHandlers/RsM/Description.cs +++ b/Adaptation/FileHandlers/RsM/Description.cs @@ -30,6 +30,8 @@ public class Description : IDescription, Shared.Properties.IDescription [JsonPropertyName("PSN")] public string PSN { get; set; } [JsonPropertyName("Reactor")] public string Reactor { get; set; } [JsonPropertyName("RecipeName")] public string Recipe { get; set; } + [JsonPropertyName("IndexOf")] public string IndexOf { get; set; } + [JsonPropertyName("AttemptCounter")] public string AttemptCounter { get; set; } // [JsonPropertyName("AutoOptimizeGain")] public string AutoOptimizeGain { get; set; } [JsonPropertyName("AutoProbeHeightSet")] public string AutoProbeHeightSet { get; set; } @@ -218,6 +220,8 @@ public class Description : IDescription, Shared.Properties.IDescription PSN = processData.PSN, Reactor = processData.Reactor, Recipe = processData.Recipe, + IndexOf = nameof(IndexOf), + AttemptCounter = nameof(AttemptCounter), // AutoOptimizeGain = processData.AutoOptimizeGain, AutoProbeHeightSet = processData.AutoProbeHeightSet, @@ -282,6 +286,8 @@ public class Description : IDescription, Shared.Properties.IDescription PSN = nameof(PSN), Reactor = nameof(Reactor), Recipe = nameof(Recipe), + IndexOf = nameof(IndexOf), + AttemptCounter = nameof(AttemptCounter), // AutoOptimizeGain = nameof(AutoOptimizeGain), AutoProbeHeightSet = nameof(AutoProbeHeightSet), diff --git a/Adaptation/Infineon/Monitoring/MonA/MonIn.cs b/Adaptation/Infineon/Monitoring/MonA/MonIn.cs index 7a8a711..fcd16ca 100644 --- a/Adaptation/Infineon/Monitoring/MonA/MonIn.cs +++ b/Adaptation/Infineon/Monitoring/MonA/MonIn.cs @@ -226,9 +226,9 @@ public class MonIn : IMonIn, IDisposable { StringBuilder stringBuilder = new(); if (string.IsNullOrEmpty(subresource)) - _ = stringBuilder.AppendFormat(_CultureInfo, "> {0} {1} \"{2}\" \"{3}\" {4} \n{5}", site.Trim(), timeStamp.HasValue ? GetDateTimeNowAsPosix(timeStamp.Value) : (object)"now", resource.Trim(), stateName.Trim(), state.Trim(), description.Trim()); + _ = stringBuilder.AppendFormat(_CultureInfo, "> {0} {1} \"{2}\" \"{3}\" {4} \n{5}", site.Trim(), timeStamp.HasValue ? GetDateTimeNowAsPosix(timeStamp.Value) : "now", resource.Trim(), stateName.Trim(), state.Trim(), description.Trim()); else - _ = stringBuilder.AppendFormat(_CultureInfo, "> {0} {1} \"{2}\" \"{3}\" \"{4}\" {5} \n{6}", site.Trim(), timeStamp.HasValue ? GetDateTimeNowAsPosix(timeStamp.Value) : (object)"now", resource.Trim(), subresource.Trim(), stateName.Trim(), state.Trim(), description.Trim()); + _ = stringBuilder.AppendFormat(_CultureInfo, "> {0} {1} \"{2}\" \"{3}\" \"{4}\" {5} \n{6}", site.Trim(), timeStamp.HasValue ? GetDateTimeNowAsPosix(timeStamp.Value) : "now", resource.Trim(), subresource.Trim(), stateName.Trim(), state.Trim(), description.Trim()); return stringBuilder.ToString(); } @@ -247,14 +247,14 @@ public class MonIn : IMonIn, IDisposable if (string.IsNullOrEmpty(subresource)) { if (unit.Equals(string.Empty) && !interval.HasValue) - _ = stringBuilder.AppendFormat(_CultureInfo, "> {0} {1} \"{2}\" \"{3}\" {4} \n{5}", site.Trim(), timeStamp.HasValue ? GetDateTimeNowAsPosix(timeStamp.Value) : (object)"now", resource.Trim(), performanceName.Trim(), value, description.Trim()); + _ = stringBuilder.AppendFormat(_CultureInfo, "> {0} {1} \"{2}\" \"{3}\" {4} \n{5}", site.Trim(), timeStamp.HasValue ? GetDateTimeNowAsPosix(timeStamp.Value) : "now", resource.Trim(), performanceName.Trim(), value, description.Trim()); else - _ = stringBuilder.AppendFormat(_CultureInfo, "> {0} {1} \"{2}\" \"{3}\" {4} {5} {{interval={6}, unit={7}}}\n", site.Trim(), timeStamp.HasValue ? GetDateTimeNowAsPosix(timeStamp.Value) : (object)"now", resource.Trim(), performanceName.Trim(), value, description.Trim(), interval.HasValue ? interval.Value.ToString() : (object)string.Empty, unit.Trim()); + _ = stringBuilder.AppendFormat(_CultureInfo, "> {0} {1} \"{2}\" \"{3}\" {4} {5} {{interval={6}, unit={7}}}\n", site.Trim(), timeStamp.HasValue ? GetDateTimeNowAsPosix(timeStamp.Value) : "now", resource.Trim(), performanceName.Trim(), value, description.Trim(), interval.HasValue ? interval.Value.ToString() : string.Empty, unit.Trim()); } else if (unit.Equals(string.Empty) && !interval.HasValue) - _ = stringBuilder.AppendFormat(_CultureInfo, "> {0} {1} \"{2}\" \"{3}\" \"{4}\" {5} \n{6}", site.Trim(), timeStamp.HasValue ? GetDateTimeNowAsPosix(timeStamp.Value) : (object)"now", resource.Trim(), subresource.Trim(), performanceName.Trim(), value, description.Trim()); + _ = stringBuilder.AppendFormat(_CultureInfo, "> {0} {1} \"{2}\" \"{3}\" \"{4}\" {5} \n{6}", site.Trim(), timeStamp.HasValue ? GetDateTimeNowAsPosix(timeStamp.Value) : "now", resource.Trim(), subresource.Trim(), performanceName.Trim(), value, description.Trim()); else - _ = stringBuilder.AppendFormat(_CultureInfo, "> {0} {1} \"{2}\" \"{3}\" \"{4}\" {5} {6} {{interval={7}, unit={8}}}\n", site.Trim(), timeStamp.HasValue ? GetDateTimeNowAsPosix(timeStamp.Value) : (object)"now", resource.Trim(), subresource.Trim(), performanceName.Trim(), value, description.Trim(), interval.HasValue ? interval.Value.ToString() : (object)string.Empty, unit.Trim()); + _ = stringBuilder.AppendFormat(_CultureInfo, "> {0} {1} \"{2}\" \"{3}\" \"{4}\" {5} {6} {{interval={7}, unit={8}}}\n", site.Trim(), timeStamp.HasValue ? GetDateTimeNowAsPosix(timeStamp.Value) : "now", resource.Trim(), subresource.Trim(), performanceName.Trim(), value, description.Trim(), interval.HasValue ? interval.Value.ToString() : string.Empty, unit.Trim()); return stringBuilder.ToString(); } diff --git a/Adaptation/Shared/FileRead.cs b/Adaptation/Shared/FileRead.cs index 773eeae..aaa6958 100644 --- a/Adaptation/Shared/FileRead.cs +++ b/Adaptation/Shared/FileRead.cs @@ -9,7 +9,6 @@ using System.IO; using System.Linq; using System.Text; using System.Text.Json; -using System.Text.Json.Serialization; using System.Threading; namespace Adaptation.Shared; diff --git a/Adaptation/Shared/ProcessDataStandardFormat.cs b/Adaptation/Shared/ProcessDataStandardFormat.cs index 9d48a31..bc3c424 100644 --- a/Adaptation/Shared/ProcessDataStandardFormat.cs +++ b/Adaptation/Shared/ProcessDataStandardFormat.cs @@ -187,7 +187,7 @@ internal class ProcessDataStandardFormat break; } } - string? linesOne = lines.Length > 0 && body.Count == 0 && columns.Count == 0 ? lines[1] : null; + string? linesOne = lines.Length > 1 && body.Count == 0 && columns.Count == 0 ? lines[1] : null; logistics = GetLogistics(footer, linesOne: linesOne); if (logistics.Count == 0) sequence = null; @@ -235,7 +235,7 @@ internal class ProcessDataStandardFormat const int columnsLine = 6; FileInfo fileInfo = new(reportFullPath); ProcessDataStandardFormat processDataStandardFormat = GetProcessDataStandardFormat(fileInfo.LastWriteTime, columnsLine, fileInfo.FullName, lines: null); - JsonElement[]? jsonElements = processDataStandardFormatMapping.OldColumnNames.Count != processDataStandardFormatMapping.ColumnIndices.Count ? null : GetFullArray(processDataStandardFormat); + JsonElement[]? jsonElements = processDataStandardFormatMapping.OldColumnNames.Count == 0 ? null : GetFullArray(processDataStandardFormat); JsonProperty[]? jsonProperties = jsonElements is null || jsonElements.Length == 0 ? null : jsonElements[0].EnumerateObject().ToArray(); if (jsonElements is null || jsonProperties is null || jsonProperties.Length != processDataStandardFormatMapping.NewColumnNames.Count) result = processDataStandardFormat;