From 67bde58b179c3ba2aacbe39bccc4f90334ed9e64 Mon Sep 17 00:00:00 2001 From: Mike Phares Date: Thu, 17 Jul 2025 12:12:30 -0700 Subject: [PATCH] InfinityQS Aggregation EDA javascript --- Adaptation/.vscode/launch.json | 33 ++++ Adaptation/DEP08CEPIEPSILON.yml | 4 +- .../FileHandlers/Aggregation/FileRead.cs | 170 +++++++++++++++++ .../CellInstanceConnectionName.cs | 4 +- .../FileHandlers/InfinityQS/FileRead.cs | 180 ++++++++++++++++++ .../Shared/ProcessDataStandardFormat.cs | 73 ++++++- .../Production/v2.60.0/DEP08CEPIEPSILON.cs | 1 + Adaptation/_Tests/Static/eda.js | 94 +++++++++ DEP08CEPIEPSILON.csproj | 2 + 9 files changed, 555 insertions(+), 6 deletions(-) create mode 100644 Adaptation/FileHandlers/Aggregation/FileRead.cs create mode 100644 Adaptation/FileHandlers/InfinityQS/FileRead.cs create mode 100644 Adaptation/_Tests/Static/eda.js diff --git a/Adaptation/.vscode/launch.json b/Adaptation/.vscode/launch.json index ff69fd7..fd2548d 100644 --- a/Adaptation/.vscode/launch.json +++ b/Adaptation/.vscode/launch.json @@ -1,10 +1,43 @@ { "configurations": [ + { + "name": "Go launch file", + "type": "go", + "request": "launch", + "mode": "debug", + "program": "${file}" + }, { "name": ".NET Core Attach", "type": "coreclr", "request": "attach", "processId": 32760 + }, + { + "type": "node", + "request": "launch", + "name": "node Launch Current Opened File", + "program": "${file}" + }, + { + "type": "bun", + "internalConsoleOptions": "neverOpen", + "request": "launch", + "name": "Debug File", + "program": "${file}", + "cwd": "${workspaceFolder}", + "stopOnEntry": false, + "watchMode": false + }, + { + "type": "bun", + "internalConsoleOptions": "neverOpen", + "request": "launch", + "name": "Run File", + "program": "${file}", + "cwd": "${workspaceFolder}", + "noDebug": true, + "watchMode": false } ] } diff --git a/Adaptation/DEP08CEPIEPSILON.yml b/Adaptation/DEP08CEPIEPSILON.yml index ebcd484..5962376 100644 --- a/Adaptation/DEP08CEPIEPSILON.yml +++ b/Adaptation/DEP08CEPIEPSILON.yml @@ -38,7 +38,7 @@ stages: displayName: "Echo Check" - script: '"C:\program files\dotnet\dotnet.exe" nuget locals all --clear' - displayName: "Nuget Nuget Clear" + displayName: "Nuget Clear" enabled: false - task: CopyFiles@2 @@ -199,7 +199,7 @@ stages: displayName: "Echo Check" - script: '"C:\program files\dotnet\dotnet.exe" nuget locals all --clear' - displayName: "Nuget Nuget Clear" + displayName: "Nuget Clear" enabled: false - task: CopyFiles@2 diff --git a/Adaptation/FileHandlers/Aggregation/FileRead.cs b/Adaptation/FileHandlers/Aggregation/FileRead.cs new file mode 100644 index 0000000..6031283 --- /dev/null +++ b/Adaptation/FileHandlers/Aggregation/FileRead.cs @@ -0,0 +1,170 @@ +using Adaptation.Eaf.Management.ConfigurationData.CellAutomation; +using Adaptation.Ifx.Eaf.EquipmentConnector.File.Configuration; +using Adaptation.Shared; +using Adaptation.Shared.Duplicator; +using Adaptation.Shared.Methods; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.IO; +using System.Linq; +using System.Text.Json; + +namespace Adaptation.FileHandlers.Aggregation; + +public class FileRead : Shared.FileRead, IFileRead +{ + + private readonly ReadOnlyDictionary _SystemStateToNames; + + public FileRead(ISMTP smtp, Dictionary fileParameter, string cellInstanceName, int? connectionCount, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList modelObjectParameters, string equipmentDictionaryName, Dictionary> dummyRuns, Dictionary> staticRuns, bool useCyclicalForDescription, bool isEAFHosted) : + base(new Description(), false, smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null) + { + _MinFileLength = 10; + _NullData = string.Empty; + _Logistics = new(this); + if (_FileParameter is null) + throw new Exception(cellInstanceConnectionName); + if (_ModelObjectParameterDefinitions is null) + throw new Exception(cellInstanceConnectionName); + if (!_IsDuplicator) + throw new Exception(cellInstanceConnectionName); + string[] segments; + Dictionary systemStateToNames = new(); + ModelObjectParameterDefinition[] systemStates = GetProperties(cellInstanceConnectionName, modelObjectParameters, "ProcessDataStandardFormat.SystemState"); + foreach (ModelObjectParameterDefinition modelObjectParameterDefinition in systemStates) + { + segments = modelObjectParameterDefinition.Value.Split('|'); + if (segments.Length != 2) + continue; + systemStateToNames.Add(segments[0], segments[1]); + } + _SystemStateToNames = new(systemStateToNames); + } + + void IFileRead.Move(Tuple> extractResults, Exception exception) + { + bool isErrorFile = exception is not null; + if (!isErrorFile && !string.IsNullOrEmpty(_Logistics.ReportFullPath)) + { + FileInfo fileInfo = new(_Logistics.ReportFullPath); + if (fileInfo.Exists && fileInfo.LastWriteTime < fileInfo.CreationTime) + File.SetLastWriteTime(_Logistics.ReportFullPath, fileInfo.CreationTime); + } + Move(extractResults); + } + + void IFileRead.WaitForThread() => WaitForThread(thread: null, threadExceptions: null); + + string IFileRead.GetEventDescription() + { + string result = _Description.GetEventDescription(); + return result; + } + + List IFileRead.GetHeaderNames() + { + List results = _Description.GetHeaderNames(); + return results; + } + + string[] IFileRead.Move(Tuple> extractResults, string to, string from, string resolvedFileLocation, Exception exception) + { + string[] results = Move(extractResults, to, from, resolvedFileLocation, exception); + return results; + } + + JsonProperty[] IFileRead.GetDefault() + { + JsonProperty[] results = _Description.GetDefault(this, _Logistics); + return results; + } + + Dictionary IFileRead.GetDisplayNamesJsonElement() + { + Dictionary results = _Description.GetDisplayNamesJsonElement(this); + return results; + } + + List IFileRead.GetDescriptions(IFileRead fileRead, List tests, IProcessData processData) + { + List results = _Description.GetDescriptions(fileRead, _Logistics, tests, processData); + return results; + } + + Tuple> IFileRead.GetExtractResult(string reportFullPath, string eventName) + { + Tuple> results; + if (string.IsNullOrEmpty(eventName)) + throw new Exception(); + _ReportFullPath = reportFullPath; + DateTime dateTime = DateTime.Now; + results = GetExtractResult(reportFullPath, dateTime); + if (results.Item3 is null) + results = new Tuple>(results.Item1, Array.Empty(), JsonSerializer.Deserialize("[]"), results.Item4); + if (results.Item3.Length > 0 && _IsEAFHosted) + WritePDSF(this, results.Item3); + UpdateLastTicksDuration(DateTime.Now.Ticks - dateTime.Ticks); + return results; + } + + Tuple> IFileRead.ReExtract() + { + Tuple> results; + List headerNames = _Description.GetHeaderNames(); + Dictionary keyValuePairs = _Description.GetDisplayNamesJsonElement(this); + results = ReExtract(this, headerNames, keyValuePairs); + return results; + } + + private static int? GetKeyColumnIndex(string[] columns, string keyColumn) + { +#nullable enable + int? result = null; + for (int i = 0; i < columns.Length; i++) + { + if (columns[i] != keyColumn) + continue; + result = i; + break; + } + return result; + } + + private ReadOnlyCollection GetSystemStateValues(List lines, string[] columns, int keyColumnIndex) + { + List results = new(); + string[] values; + string? systemState; + string keyColumnValue; + for (int i = 7; i < lines.Count; i++) + { + values = lines[i].Split('\t'); + if (values.Length != columns.Length) + continue; + keyColumnValue = values[keyColumnIndex]; + if (string.IsNullOrEmpty(keyColumnValue)) + continue; + if (!_SystemStateToNames.TryGetValue(keyColumnValue, out systemState)) + continue; + if (results.Contains(systemState)) + continue; + results.Add(systemState); + } + return new(results); + } + + private Tuple> GetExtractResult(string reportFullPath, DateTime _) + { + Tuple> results; + ProcessDataStandardFormat processDataStandardFormat = ProcessDataStandardFormat.GetProcessDataStandardFormat(reportFullPath); + _Logistics = new Logistics(reportFullPath, processDataStandardFormat); + SetFileParameterLotIDToLogisticsMID(); + JsonElement[] jsonElements = ProcessDataStandardFormat.GetArray(processDataStandardFormat); + List descriptions = GetDuplicatorDescriptions(jsonElements); + Test[] tests = (from l in descriptions select (Test)l.Test).ToArray(); + results = new Tuple>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics), tests, jsonElements, new List()); + return results; + } + +} \ No newline at end of file diff --git a/Adaptation/FileHandlers/CellInstanceConnectionName.cs b/Adaptation/FileHandlers/CellInstanceConnectionName.cs index af2c6d1..65ca49a 100644 --- a/Adaptation/FileHandlers/CellInstanceConnectionName.cs +++ b/Adaptation/FileHandlers/CellInstanceConnectionName.cs @@ -13,6 +13,9 @@ public class CellInstanceConnectionName { IFileRead result = cellInstanceConnectionName switch { + nameof(Aggregation) => new Aggregation.FileRead(smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null), + nameof(Dummy) => new Dummy.FileRead(smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null), + nameof(InfinityQS) => new InfinityQS.FileRead(smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null), nameof(R29) => new R29.FileRead(smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null), nameof(R30) => new R30.FileRead(smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null), nameof(R32) => new R32.FileRead(smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null), @@ -24,7 +27,6 @@ public class CellInstanceConnectionName nameof(R65) => new R65.FileRead(smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null), nameof(R75) => new R75.FileRead(smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null), nameof(R77) => new R77.FileRead(smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null), - nameof(Dummy) => new Dummy.FileRead(smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null), _ => throw new Exception($"\"{cellInstanceConnectionName}\" not mapped") }; return result; diff --git a/Adaptation/FileHandlers/InfinityQS/FileRead.cs b/Adaptation/FileHandlers/InfinityQS/FileRead.cs new file mode 100644 index 0000000..3a06292 --- /dev/null +++ b/Adaptation/FileHandlers/InfinityQS/FileRead.cs @@ -0,0 +1,180 @@ +using Adaptation.Eaf.Management.ConfigurationData.CellAutomation; +using Adaptation.Ifx.Eaf.EquipmentConnector.File.Configuration; +using Adaptation.Shared; +using Adaptation.Shared.Duplicator; +using Adaptation.Shared.Methods; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.IO; +using System.Linq; +using System.Text.Json; + +namespace Adaptation.FileHandlers.InfinityQS; + +public class FileRead : Shared.FileRead, IFileRead +{ + + private readonly ReadOnlyDictionary _SystemStateToNames; + + public FileRead(ISMTP smtp, Dictionary fileParameter, string cellInstanceName, int? connectionCount, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList modelObjectParameters, string equipmentDictionaryName, Dictionary> dummyRuns, Dictionary> staticRuns, bool useCyclicalForDescription, bool isEAFHosted) : + base(new Description(), false, smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null) + { + _MinFileLength = 10; + _NullData = string.Empty; + _Logistics = new(this); + if (_FileParameter is null) + throw new Exception(cellInstanceConnectionName); + if (_ModelObjectParameterDefinitions is null) + throw new Exception(cellInstanceConnectionName); + if (!_IsDuplicator) + throw new Exception(cellInstanceConnectionName); + string[] segments; + Dictionary systemStateToNames = new(); + ModelObjectParameterDefinition[] systemStates = GetProperties(cellInstanceConnectionName, modelObjectParameters, "ProcessDataStandardFormat.SystemState"); + foreach (ModelObjectParameterDefinition modelObjectParameterDefinition in systemStates) + { + segments = modelObjectParameterDefinition.Value.Split('|'); + if (segments.Length != 2) + continue; + systemStateToNames.Add(segments[0], segments[1]); + } + _SystemStateToNames = new(systemStateToNames); + } + + void IFileRead.Move(Tuple> extractResults, Exception exception) + { + bool isErrorFile = exception is not null; + if (!isErrorFile && !string.IsNullOrEmpty(_Logistics.ReportFullPath)) + { + FileInfo fileInfo = new(_Logistics.ReportFullPath); + if (fileInfo.Exists && fileInfo.LastWriteTime < fileInfo.CreationTime) + File.SetLastWriteTime(_Logistics.ReportFullPath, fileInfo.CreationTime); + } + Move(extractResults); + } + + void IFileRead.WaitForThread() => WaitForThread(thread: null, threadExceptions: null); + + string IFileRead.GetEventDescription() + { + string result = _Description.GetEventDescription(); + return result; + } + + List IFileRead.GetHeaderNames() + { + List results = _Description.GetHeaderNames(); + return results; + } + + string[] IFileRead.Move(Tuple> extractResults, string to, string from, string resolvedFileLocation, Exception exception) + { + string[] results = Move(extractResults, to, from, resolvedFileLocation, exception); + return results; + } + + JsonProperty[] IFileRead.GetDefault() + { + JsonProperty[] results = _Description.GetDefault(this, _Logistics); + return results; + } + + Dictionary IFileRead.GetDisplayNamesJsonElement() + { + Dictionary results = _Description.GetDisplayNamesJsonElement(this); + return results; + } + + List IFileRead.GetDescriptions(IFileRead fileRead, List tests, IProcessData processData) + { + List results = _Description.GetDescriptions(fileRead, _Logistics, tests, processData); + return results; + } + + Tuple> IFileRead.GetExtractResult(string reportFullPath, string eventName) + { + Tuple> results; + if (string.IsNullOrEmpty(eventName)) + throw new Exception(); + _ReportFullPath = reportFullPath; + DateTime dateTime = DateTime.Now; + results = GetExtractResult(reportFullPath, dateTime); + if (results.Item3 is null) + results = new Tuple>(results.Item1, Array.Empty(), JsonSerializer.Deserialize("[]"), results.Item4); + if (results.Item3.Length > 0 && _IsEAFHosted) + WritePDSF(this, results.Item3); + UpdateLastTicksDuration(DateTime.Now.Ticks - dateTime.Ticks); + return results; + } + + Tuple> IFileRead.ReExtract() + { + Tuple> results; + List headerNames = _Description.GetHeaderNames(); + Dictionary keyValuePairs = _Description.GetDisplayNamesJsonElement(this); + results = ReExtract(this, headerNames, keyValuePairs); + return results; + } + + private static int? GetKeyColumnIndex(string[] columns, string keyColumn) + { +#nullable enable + int? result = null; + for (int i = 0; i < columns.Length; i++) + { + if (columns[i] != keyColumn) + continue; + result = i; + break; + } + return result; + } + + private ReadOnlyCollection GetSystemStateValues(List lines, string[] columns, int keyColumnIndex) + { + List results = new(); + string[] values; + string? systemState; + string keyColumnValue; + for (int i = 7; i < lines.Count; i++) + { + values = lines[i].Split('\t'); + if (values.Length != columns.Length) + continue; + keyColumnValue = values[keyColumnIndex]; + if (string.IsNullOrEmpty(keyColumnValue)) + continue; + if (!_SystemStateToNames.TryGetValue(keyColumnValue, out systemState)) + continue; + if (results.Contains(systemState)) + continue; + results.Add(systemState); + } + return new(results); + } + + private void CopyFile(string reportFullPath) + { + string duplicateDirectory = Path.Combine(_FileConnectorConfiguration.SourceFileLocation, _CellInstanceName); + if (!Directory.Exists(duplicateDirectory)) + _ = Directory.CreateDirectory(duplicateDirectory); + string duplicateFile = Path.Combine(duplicateDirectory, Path.GetFileName(reportFullPath)); + File.Copy(reportFullPath, duplicateFile, overwrite: true); + } + + private Tuple> GetExtractResult(string reportFullPath, DateTime _) + { + Tuple> results; + ProcessDataStandardFormat processDataStandardFormat = ProcessDataStandardFormat.GetProcessDataStandardFormat(reportFullPath); + _Logistics = new Logistics(reportFullPath, processDataStandardFormat); + SetFileParameterLotIDToLogisticsMID(); + JsonElement[] jsonElements = ProcessDataStandardFormat.GetArray(processDataStandardFormat); + List descriptions = GetDuplicatorDescriptions(jsonElements); + Test[] tests = (from l in descriptions select (Test)l.Test).ToArray(); + if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0) + CopyFile(reportFullPath); + results = new Tuple>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics), tests, jsonElements, new List()); + return results; + } +} \ No newline at end of file diff --git a/Adaptation/Shared/ProcessDataStandardFormat.cs b/Adaptation/Shared/ProcessDataStandardFormat.cs index 35e281a..3737852 100644 --- a/Adaptation/Shared/ProcessDataStandardFormat.cs +++ b/Adaptation/Shared/ProcessDataStandardFormat.cs @@ -398,13 +398,20 @@ internal class ProcessDataStandardFormat line = string.Concat(line.Substring(0, line.Length - 1), '}'); lines.Add(line); } + string? json = null; + if (processDataStandardFormat.Footer is not null && processDataStandardFormat.Footer.Count > 0) { + Dictionary footerKeyValuePairs = GetFooterKeyValuePairs(processDataStandardFormat.Footer); + Dictionary> logisticKeyValuePairs = GetLogisticKeyValuePairs(processDataStandardFormat.Footer, footerKeyValuePairs); + json = JsonSerializer.Serialize(logisticKeyValuePairs, DictionaryStringDictionaryStringStringSourceGenerationContext.Default.DictionaryStringDictionaryStringString); + } + string footerText = string.IsNullOrEmpty(json) || json == "{}" ? string.Empty : $",{Environment.NewLine}\"PDSF\":{Environment.NewLine}{json}"; result = string.Concat( '{', Environment.NewLine, '"', "Count", '"', - ": ", + ": ", processDataStandardFormat.Body.Count, ',', Environment.NewLine, @@ -423,12 +430,67 @@ internal class ProcessDataStandardFormat '"', "Sequence", '"', - ": ", + ": ", processDataStandardFormat.Sequence, Environment.NewLine, + footerText, + Environment.NewLine, '}'); return result; -#pragma warning restore CA1845, IDE0057 + } + + private static Dictionary GetFooterKeyValuePairs(ReadOnlyCollection footerLines) { + Dictionary results = new(); + string[] segments; + foreach (string footerLine in footerLines) { + segments = footerLine.Split('\t'); + if (segments.Length != 2 || string.IsNullOrEmpty(segments[1].Trim())) { + continue; + } + if (segments[1].Contains(';')) { + continue; + } else { + results.Add(segments[0], segments[1]); + } + } + return results; + } + + private static Dictionary> GetLogisticKeyValuePairs(ReadOnlyCollection footerLines, Dictionary footerKeyValuePairs) { + Dictionary> results = new(); + string[] segments; + string[] subSegments; + string[] subSubSegments; + Dictionary? keyValue; + results.Add("Footer", footerKeyValuePairs); + foreach (string footerLine in footerLines) { + segments = footerLine.Split('\t'); + if (segments.Length != 2 || string.IsNullOrEmpty(segments[1].Trim())) { + continue; + } + if (!segments[1].Contains(';') || !segments[1].Contains('=')) { + continue; + } else { + subSegments = segments[1].Split(';'); + if (subSegments.Length < 1) { + continue; + } + if (!results.TryGetValue(segments[0], out keyValue)) { + results.Add(segments[0], new()); + if (!results.TryGetValue(segments[0], out keyValue)) { + throw new Exception(); + } + } + foreach (string segment in subSegments) { + subSubSegments = segment.Split('='); + if (subSubSegments.Length != 2) { + continue; + } + keyValue.Add(subSubSegments[0], subSubSegments[1]); + } + } + } + return results; } internal static void Write(string path, ProcessDataStandardFormat processDataStandardFormat, List? wsResults) @@ -776,4 +838,9 @@ internal class ProcessDataStandardFormat [JsonSerializable(typeof(JsonElement[]))] internal partial class JsonElementCollectionSourceGenerationContext : JsonSerializerContext { +} + +[JsonSourceGenerationOptions(WriteIndented = true, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)] +[JsonSerializable(typeof(Dictionary>))] +internal partial class DictionaryStringDictionaryStringStringSourceGenerationContext : JsonSerializerContext { } \ No newline at end of file diff --git a/Adaptation/_Tests/CreateSelfDescription/Production/v2.60.0/DEP08CEPIEPSILON.cs b/Adaptation/_Tests/CreateSelfDescription/Production/v2.60.0/DEP08CEPIEPSILON.cs index db1eb9d..6996c3d 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Production/v2.60.0/DEP08CEPIEPSILON.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Production/v2.60.0/DEP08CEPIEPSILON.cs @@ -20,6 +20,7 @@ public class DEP08CEPIEPSILON : EAFLoggingUnitTesting internal static DEP08CEPIEPSILON EAFLoggingUnitTesting { get; private set; } static DEP08CEPIEPSILON() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy"; + // static DEP08CEPIEPSILON() => DummyRoot = @"D:\ProgramData\EC_Characterization_Si\Dummy"; public DEP08CEPIEPSILON() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false) { diff --git a/Adaptation/_Tests/Static/eda.js b/Adaptation/_Tests/Static/eda.js new file mode 100644 index 0000000..97c34bc --- /dev/null +++ b/Adaptation/_Tests/Static/eda.js @@ -0,0 +1,94 @@ +getValue($('gv.vp12', '')); + +function getValue(values) { + let result = null; + if (values != undefined && values.length > 1) { + let collection = values[0] === '|' ? values.substring(1).split('|') : values.split('|'); + let collectionParseFloat = getCollectionParseFloat(collection); + let raw = getMin(collectionParseFloat); + result = roundNumber(raw, 7); + } + return result; +} + +function getCollectionParseFloat(collection) { + let result = []; + let value; + for (let i = 0; i < collection.length; i++) { + value = parseFloat(collection[i]); + result.push(value); + } + return result; +} + +function getMin(collection) { + let result = 2147483647; + if (collection && collection.length > 0) { + for (let i = 0; i < collection.length; i++) { + if (collection[i] < result) { + result = collection[i]; + } + } + } + return result; +} + +function getMax(collection) { + let result = -2147483648; + if (collection && collection.length > 0) { + for (let i = 0; i < collection.length; i++) { + if (collection[i] > result) { + result = collection[i]; + } + } + } + return result; +} + +function getSum(collection) { + let result = 0; + if (!collection || collection.length === 0) { + result = 0; + } + else { + for (let i = 0; i < collection.length; i++) { + result += collection[i]; + } + } + return result; +} + +function getAverage(collection) { + let result = null; + if (collection == null || collection.length === 0) { + result = 0; + } + else { + let sum = getSum(collection); + result = sum / collection.length; + } + return result; +} + +function roundNumber(number, digits) { + let result; + const multiple = Math.pow(10, digits); + result = Math.round(number * multiple) / multiple; + return result; +} + +Reactor +getContextData('1', 'cds.PROCESS_JOBID', '') + +PSN +getContextData('1', 'cds.PRODUCT', '') + +RDS +getContextData('1', 'cds.MID', '') + +getValue($('dcp.R61/DEP08CEPIEPSILON_Semi/LL1State', ''), $('dcp.R61/DEP08CEPIEPSILON_Semi/LL2State', '')); + +function getValue(id78, id83) { + let result = id78 === '6' ? 'Left' : id83 === '6' ? 'Right' : id78 + '-' + id83; + return result; +} \ No newline at end of file diff --git a/DEP08CEPIEPSILON.csproj b/DEP08CEPIEPSILON.csproj index d18ddbc..f5b15d8 100644 --- a/DEP08CEPIEPSILON.csproj +++ b/DEP08CEPIEPSILON.csproj @@ -103,8 +103,10 @@ + +