Compare commits

...

4 Commits

Author SHA1 Message Date
3bb0f8a138 Infineon.EAF.Runtime v2.59.0 2025-02-21 13:08:43 -07:00
f8bc7841d0 New Reactors 2024-10-15 13:42:40 -07:00
ae35f7e6b8 Ready to test 2024-10-14 15:28:29 -07:00
4d5820d3d7 v2.57.0 2024-08-19 16:52:23 -07:00
21 changed files with 1370 additions and 84 deletions

View File

@ -49,6 +49,16 @@
],
"problemMatcher": "$msCompile"
},
{
"label": "Format-Whitespaces",
"command": "dotnet",
"type": "process",
"args": [
"format",
"whitespace"
],
"problemMatcher": "$msCompile"
},
{
"label": "Nuget Clear",
"command": "dotnet",
@ -68,7 +78,7 @@
"args": [
"/target:Build",
"/restore:True",
"/p:RestoreSources=https://artifactory.intra.infineon.com/artifactory/api/nuget/ngt-fi-package-main-vir/%3Bhttps://packagemanagement.eu.infineon.com:4430/api/v2/%3Bhttps://tfs.intra.infineon.com/tfs/ManufacturingIT/_packaging/eaf/nuget/v3/index.json%3Bhttps://tfs.intra.infineon.com/tfs/FactoryIntegration/_packaging/EAF%40Local/nuget/v3/index.json%3Bhttps://api.nuget.org/v3/index.json",
"/p:RestoreSources=https://artifactory.intra.infineon.com/artifactory/api/nuget/ngt-fi-package-main-vir/%3Bhttps://tfs.intra.infineon.com/tfs/FactoryIntegration/_packaging/EAF/nuget/v3/index.json%3Bhttps://tfs.intra.infineon.com/tfs/FactoryIntegration/_packaging/EAF%40Local/nuget/v3/index.json%3Bhttps://api.nuget.org/v3/index.json",
"/detailedsummary",
"/consoleloggerparameters:PerformanceSummary;ErrorsOnly;",
"/property:Configuration=Debug;TargetFrameworkVersion=v4.8",
@ -76,6 +86,18 @@
],
"problemMatcher": "$msCompile"
},
{
"label": "Project",
"type": "shell",
"command": "code ../DEP08CEPIEPSILON.csproj",
"problemMatcher": []
},
{
"label": "Git Config",
"type": "shell",
"command": "code ../.git/config",
"problemMatcher": []
},
{
"label": "Kanbn Console",
"type": "npm",

View File

@ -35,7 +35,7 @@
<RuntimeHostConfigurationOption Include="AssemblyName" Value="DEP08CEPIEPSILON" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.2" />
<PackageReference Include="coverlet.collector" Version="6.0.3" />
<PackageReference Include="FFMpegCore" Version="5.1.0" />
<PackageReference Include="IKVM.AWT.WinForms" Version="7.2.4630.5"><NoWarn>NU1701</NoWarn></PackageReference>
<PackageReference Include="IKVM.OpenJDK.Core" Version="7.2.4630.5"><NoWarn>NU1701</NoWarn></PackageReference>
@ -44,41 +44,39 @@
<PackageReference Include="IKVM.OpenJDK.Util" Version="7.2.4630.5"><NoWarn>NU1701</NoWarn></PackageReference>
<PackageReference Include="IKVM.OpenJDK.XML.API" Version="7.2.4630.5"><NoWarn>NU1701</NoWarn></PackageReference>
<PackageReference Include="IKVM.Runtime" Version="7.2.4630.5"><NoWarn>NU1701</NoWarn></PackageReference>
<PackageReference Include="Instances" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.json" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Microsoft.Win32.SystemEvents" Version="8.0.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.5.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.5.1" />
<PackageReference Include="Instances" Version="3.0.1" />
<PackageReference Include="log4net" Version="3.0.3"></PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.json" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="Microsoft.Win32.SystemEvents" Version="9.0.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.7.0" />
<PackageReference Include="MSTest.TestFramework" Version="3.7.0" />
<PackageReference Include="Pdfbox" Version="1.1.1"><NoWarn>NU1701</NoWarn></PackageReference>
<PackageReference Include="RoboSharp" Version="1.5.3" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
<PackageReference Include="System.Data.OleDb" Version="8.0.0" />
<PackageReference Include="RoboSharp" Version="1.6.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="9.0.0" />
<PackageReference Include="System.Data.OleDb" Version="9.0.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
<PackageReference Include="System.Drawing.Common" Version="8.0.7" />
<PackageReference Include="System.Text.Json" Version="8.0.4" />
<PackageReference Include="Tesseract" Version="5.2.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Tibco.Rendezvous.DotNetCore" Version="8.5.0" />
<PackageReference Include="Infineon.Yoda.DotNetCore" Version="5.4.1" />
<PackageReference Include="System.Drawing.Common" Version="9.0.0" />
<PackageReference Include="System.Text.Json" Version="9.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Infineon.Mesa.PDF.Text.Stripper" Version="4.8.0.1"><NoWarn>NU1701</NoWarn></PackageReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="External.Common.Logging.Core" Version="3.3.1"><NoWarn>NU1701</NoWarn></PackageReference>
<PackageReference Include="External.Common.Logging" Version="3.3.1"><NoWarn>NU1701</NoWarn></PackageReference>
<PackageReference Include="External.log4net" Version="2.0.8"><NoWarn>NU1701</NoWarn></PackageReference>
<PackageReference Include="Infineon.Yoda.DotNetCore" Version="5.4.3" />
<PackageReference Include="Tibco.Rendezvous.DotNetCore" Version="8.5.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Tesseract" Version="5.2.0" />
</ItemGroup>
<ItemGroup>
<None Include="appsettings.json">

View File

@ -15,6 +15,10 @@ public class CellInstanceConnectionName
{
nameof(R32) => new R32.FileRead(smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null),
nameof(R62) => new R62.FileRead(smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null),
nameof(R55) => new R55.FileRead(smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null),
nameof(R57) => new R57.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")
};

View File

@ -35,7 +35,6 @@ public class FileRead : Shared.FileRead, IFileRead
string[] segments;
Dictionary<string, string> systemStateToNames = new();
_KeyColumn = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "ProcessDataStandardFormat.KeyColumn");
_KeyColumn = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "ProcessDataStandardFormat.SystemState");
_TimestampFormat = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "ProcessDataStandardFormat.TimestampFormat");
ModelObjectParameterDefinition[] systemStates = GetProperties(cellInstanceConnectionName, modelObjectParameters, "ProcessDataStandardFormat.SystemState");
foreach (ModelObjectParameterDefinition modelObjectParameterDefinition in systemStates)
@ -139,7 +138,7 @@ public class FileRead : Shared.FileRead, IFileRead
private ReadOnlyCollection<string> GetSystemStateValues(List<string> lines, string[] columns, int keyColumnIndex)
{
List<string> results = [];
List<string> results = new();
string[] values;
string? systemState;
string keyColumnValue;
@ -170,9 +169,9 @@ public class FileRead : Shared.FileRead, IFileRead
string systemState;
int? keyColumnIndex;
string checkFileName;
List<string> headerLines = [];
List<string> headerLines = new();
ReadOnlyCollection<string> systemStateValues;
string missingKeyDirectory = Path.Combine(_FileConnectorConfiguration.SourceFileLocation, "Missing-Key");
string missingKeyDirectory = Path.Combine(_FileConnectorConfiguration.AlternateTargetFolder, "Missing-Key");
if (!Directory.Exists(missingKeyDirectory))
_ = Directory.CreateDirectory(missingKeyDirectory);
string fileName = Path.GetFileName(reportFullPath);
@ -202,18 +201,18 @@ public class FileRead : Shared.FileRead, IFileRead
keyColumnIndex = GetKeyColumnIndex(columns, _KeyColumn);
if (keyColumnIndex is null)
{
File.Move(reportFullPath, Path.Combine(_FileConnectorConfiguration.SourceFileLocation, missingKeyDirectory, fileName));
File.Move(reportFullPath, Path.Combine(_FileConnectorConfiguration.AlternateTargetFolder, missingKeyDirectory, fileName));
continue;
}
systemStateValues = GetSystemStateValues(lines, columns, keyColumnIndex.Value);
if (systemStateValues.Count == 0)
{
File.Move(reportFullPath, Path.Combine(_FileConnectorConfiguration.SourceFileLocation, missingKeyDirectory, fileName));
File.Move(reportFullPath, Path.Combine(_FileConnectorConfiguration.AlternateTargetFolder, missingKeyDirectory, fileName));
continue;
}
lines.AddRange(headerLines);
systemState = string.Join('-', systemStateValues);
checkFileName = Path.Combine(Path.GetDirectoryName(reportFullPath) ?? throw new Exception(), $"{equipment}-{timestamp}-{systemState}.pdsf");
systemState = string.Join("-", systemStateValues);
checkFileName = Path.Combine(_FileConnectorConfiguration.AlternateTargetFolder, $"{equipment}-{timestamp}-{systemState}.pdsf");
File.WriteAllLines(checkFileName, lines);
// File.Delete(reportFullPath);
if (DateTime.TryParseExact(timestamp, _TimestampFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out dateTime))

View File

@ -0,0 +1,238 @@
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.Globalization;
using System.IO;
using System.Linq;
using System.Text.Json;
namespace Adaptation.FileHandlers.R55;
public class FileRead : Shared.FileRead, IFileRead
{
private readonly string _KeyColumn;
private readonly string _TimestampFormat;
private readonly ReadOnlyDictionary<string, string> _SystemStateToNames;
public FileRead(ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, int? connectionCount, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, Dictionary<string, List<long>> dummyRuns, Dictionary<long, List<string>> 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<string, string> systemStateToNames = new();
_KeyColumn = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "ProcessDataStandardFormat.KeyColumn");
_TimestampFormat = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "ProcessDataStandardFormat.TimestampFormat");
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<string, Test[], JsonElement[], List<FileInfo>> 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<string> IFileRead.GetHeaderNames()
{
List<string> results = _Description.GetHeaderNames();
return results;
}
string[] IFileRead.Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> 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<string, string> IFileRead.GetDisplayNamesJsonElement()
{
Dictionary<string, string> results = _Description.GetDisplayNamesJsonElement(this);
return results;
}
List<IDescription> IFileRead.GetDescriptions(IFileRead fileRead, List<Test> tests, IProcessData processData)
{
List<IDescription> results = _Description.GetDescriptions(fileRead, _Logistics, tests, processData);
return results;
}
Tuple<string, Test[], JsonElement[], List<FileInfo>> IFileRead.GetExtractResult(string reportFullPath, string eventName)
{
Tuple<string, Test[], JsonElement[], List<FileInfo>> 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<string, Test[], JsonElement[], List<FileInfo>>(results.Item1, Array.Empty<Test>(), JsonSerializer.Deserialize<JsonElement[]>("[]"), results.Item4);
if (results.Item3.Length > 0 && _IsEAFHosted)
WritePDSF(this, results.Item3);
UpdateLastTicksDuration(DateTime.Now.Ticks - dateTime.Ticks);
return results;
}
Tuple<string, Test[], JsonElement[], List<FileInfo>> IFileRead.ReExtract()
{
Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
List<string> headerNames = _Description.GetHeaderNames();
Dictionary<string, string> 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<string> GetSystemStateValues(List<string> lines, string[] columns, int keyColumnIndex)
{
List<string> 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 MoveFile(string reportFullPath)
{
string equipment;
string timestamp;
string[] columns;
DateTime dateTime;
List<string> lines;
string systemState;
int? keyColumnIndex;
string checkFileName;
List<string> headerLines = new();
ReadOnlyCollection<string> systemStateValues;
string missingKeyDirectory = Path.Combine(_FileConnectorConfiguration.AlternateTargetFolder, "Missing-Key");
if (!Directory.Exists(missingKeyDirectory))
_ = Directory.CreateDirectory(missingKeyDirectory);
string fileName = Path.GetFileName(reportFullPath);
string[] segments = fileName.Split('_');
for (int z = 0; z < 1; z++)
{
if (segments.Length != 2)
continue;
equipment = segments[0];
timestamp = segments[1].Split('.')[0];
if (timestamp.Length != _TimestampFormat.Length)
continue;
headerLines.Clear();
lines = File.ReadAllLines(reportFullPath).ToList();
if (lines.Count < 8)
continue;
for (int i = 0; i < 6; i++)
{
headerLines.Add(lines[0]);
lines.RemoveAt(0);
}
if (lines[0].Length < 1 || lines[0][0] != '"' || !lines[0].StartsWith("\"Time\""))
continue;
columns = lines[0].Split('\t');
if (columns.Length < 3)
continue;
keyColumnIndex = GetKeyColumnIndex(columns, _KeyColumn);
if (keyColumnIndex is null)
{
File.Move(reportFullPath, Path.Combine(_FileConnectorConfiguration.AlternateTargetFolder, missingKeyDirectory, fileName));
continue;
}
systemStateValues = GetSystemStateValues(lines, columns, keyColumnIndex.Value);
if (systemStateValues.Count == 0)
{
File.Move(reportFullPath, Path.Combine(_FileConnectorConfiguration.AlternateTargetFolder, missingKeyDirectory, fileName));
continue;
}
lines.AddRange(headerLines);
systemState = string.Join("-", systemStateValues);
checkFileName = Path.Combine(_FileConnectorConfiguration.AlternateTargetFolder, $"{equipment}-{timestamp}-{systemState}.pdsf");
File.WriteAllLines(checkFileName, lines);
// File.Delete(reportFullPath);
if (DateTime.TryParseExact(timestamp, _TimestampFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out dateTime))
File.SetLastWriteTime(checkFileName, dateTime);
}
}
private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime _)
{
Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
Tuple<string, string[], string[]> pdsf = ProcessDataStandardFormat.GetLogisticsColumnsAndBody(reportFullPath);
_Logistics = new Logistics(reportFullPath, pdsf.Item1);
SetFileParameterLotIDToLogisticsMID();
JsonElement[] jsonElements = ProcessDataStandardFormat.GetArray(pdsf);
List<Shared.Properties.IDescription> descriptions = GetDuplicatorDescriptions(jsonElements);
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
MoveFile(reportFullPath);
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(pdsf.Item1, tests, jsonElements, new List<FileInfo>());
return results;
}
}

View File

@ -0,0 +1,238 @@
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.Globalization;
using System.IO;
using System.Linq;
using System.Text.Json;
namespace Adaptation.FileHandlers.R57;
public class FileRead : Shared.FileRead, IFileRead
{
private readonly string _KeyColumn;
private readonly string _TimestampFormat;
private readonly ReadOnlyDictionary<string, string> _SystemStateToNames;
public FileRead(ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, int? connectionCount, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, Dictionary<string, List<long>> dummyRuns, Dictionary<long, List<string>> 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<string, string> systemStateToNames = new();
_KeyColumn = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "ProcessDataStandardFormat.KeyColumn");
_TimestampFormat = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "ProcessDataStandardFormat.TimestampFormat");
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<string, Test[], JsonElement[], List<FileInfo>> 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<string> IFileRead.GetHeaderNames()
{
List<string> results = _Description.GetHeaderNames();
return results;
}
string[] IFileRead.Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> 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<string, string> IFileRead.GetDisplayNamesJsonElement()
{
Dictionary<string, string> results = _Description.GetDisplayNamesJsonElement(this);
return results;
}
List<IDescription> IFileRead.GetDescriptions(IFileRead fileRead, List<Test> tests, IProcessData processData)
{
List<IDescription> results = _Description.GetDescriptions(fileRead, _Logistics, tests, processData);
return results;
}
Tuple<string, Test[], JsonElement[], List<FileInfo>> IFileRead.GetExtractResult(string reportFullPath, string eventName)
{
Tuple<string, Test[], JsonElement[], List<FileInfo>> 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<string, Test[], JsonElement[], List<FileInfo>>(results.Item1, Array.Empty<Test>(), JsonSerializer.Deserialize<JsonElement[]>("[]"), results.Item4);
if (results.Item3.Length > 0 && _IsEAFHosted)
WritePDSF(this, results.Item3);
UpdateLastTicksDuration(DateTime.Now.Ticks - dateTime.Ticks);
return results;
}
Tuple<string, Test[], JsonElement[], List<FileInfo>> IFileRead.ReExtract()
{
Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
List<string> headerNames = _Description.GetHeaderNames();
Dictionary<string, string> 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<string> GetSystemStateValues(List<string> lines, string[] columns, int keyColumnIndex)
{
List<string> 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 MoveFile(string reportFullPath)
{
string equipment;
string timestamp;
string[] columns;
DateTime dateTime;
List<string> lines;
string systemState;
int? keyColumnIndex;
string checkFileName;
List<string> headerLines = new();
ReadOnlyCollection<string> systemStateValues;
string missingKeyDirectory = Path.Combine(_FileConnectorConfiguration.AlternateTargetFolder, "Missing-Key");
if (!Directory.Exists(missingKeyDirectory))
_ = Directory.CreateDirectory(missingKeyDirectory);
string fileName = Path.GetFileName(reportFullPath);
string[] segments = fileName.Split('_');
for (int z = 0; z < 1; z++)
{
if (segments.Length != 2)
continue;
equipment = segments[0];
timestamp = segments[1].Split('.')[0];
if (timestamp.Length != _TimestampFormat.Length)
continue;
headerLines.Clear();
lines = File.ReadAllLines(reportFullPath).ToList();
if (lines.Count < 8)
continue;
for (int i = 0; i < 6; i++)
{
headerLines.Add(lines[0]);
lines.RemoveAt(0);
}
if (lines[0].Length < 1 || lines[0][0] != '"' || !lines[0].StartsWith("\"Time\""))
continue;
columns = lines[0].Split('\t');
if (columns.Length < 3)
continue;
keyColumnIndex = GetKeyColumnIndex(columns, _KeyColumn);
if (keyColumnIndex is null)
{
File.Move(reportFullPath, Path.Combine(_FileConnectorConfiguration.AlternateTargetFolder, missingKeyDirectory, fileName));
continue;
}
systemStateValues = GetSystemStateValues(lines, columns, keyColumnIndex.Value);
if (systemStateValues.Count == 0)
{
File.Move(reportFullPath, Path.Combine(_FileConnectorConfiguration.AlternateTargetFolder, missingKeyDirectory, fileName));
continue;
}
lines.AddRange(headerLines);
systemState = string.Join("-", systemStateValues);
checkFileName = Path.Combine(_FileConnectorConfiguration.AlternateTargetFolder, $"{equipment}-{timestamp}-{systemState}.pdsf");
File.WriteAllLines(checkFileName, lines);
// File.Delete(reportFullPath);
if (DateTime.TryParseExact(timestamp, _TimestampFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out dateTime))
File.SetLastWriteTime(checkFileName, dateTime);
}
}
private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime _)
{
Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
Tuple<string, string[], string[]> pdsf = ProcessDataStandardFormat.GetLogisticsColumnsAndBody(reportFullPath);
_Logistics = new Logistics(reportFullPath, pdsf.Item1);
SetFileParameterLotIDToLogisticsMID();
JsonElement[] jsonElements = ProcessDataStandardFormat.GetArray(pdsf);
List<Shared.Properties.IDescription> descriptions = GetDuplicatorDescriptions(jsonElements);
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
MoveFile(reportFullPath);
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(pdsf.Item1, tests, jsonElements, new List<FileInfo>());
return results;
}
}

View File

@ -35,7 +35,6 @@ public class FileRead : Shared.FileRead, IFileRead
string[] segments;
Dictionary<string, string> systemStateToNames = new();
_KeyColumn = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "ProcessDataStandardFormat.KeyColumn");
_KeyColumn = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "ProcessDataStandardFormat.SystemState");
_TimestampFormat = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "ProcessDataStandardFormat.TimestampFormat");
ModelObjectParameterDefinition[] systemStates = GetProperties(cellInstanceConnectionName, modelObjectParameters, "ProcessDataStandardFormat.SystemState");
foreach (ModelObjectParameterDefinition modelObjectParameterDefinition in systemStates)
@ -139,7 +138,7 @@ public class FileRead : Shared.FileRead, IFileRead
private ReadOnlyCollection<string> GetSystemStateValues(List<string> lines, string[] columns, int keyColumnIndex)
{
List<string> results = [];
List<string> results = new();
string[] values;
string? systemState;
string keyColumnValue;
@ -170,9 +169,9 @@ public class FileRead : Shared.FileRead, IFileRead
string systemState;
int? keyColumnIndex;
string checkFileName;
List<string> headerLines = [];
List<string> headerLines = new();
ReadOnlyCollection<string> systemStateValues;
string missingKeyDirectory = Path.Combine(_FileConnectorConfiguration.SourceFileLocation, "Missing-Key");
string missingKeyDirectory = Path.Combine(_FileConnectorConfiguration.AlternateTargetFolder, "Missing-Key");
if (!Directory.Exists(missingKeyDirectory))
_ = Directory.CreateDirectory(missingKeyDirectory);
string fileName = Path.GetFileName(reportFullPath);
@ -202,18 +201,18 @@ public class FileRead : Shared.FileRead, IFileRead
keyColumnIndex = GetKeyColumnIndex(columns, _KeyColumn);
if (keyColumnIndex is null)
{
File.Move(reportFullPath, Path.Combine(_FileConnectorConfiguration.SourceFileLocation, missingKeyDirectory, fileName));
File.Move(reportFullPath, Path.Combine(_FileConnectorConfiguration.AlternateTargetFolder, missingKeyDirectory, fileName));
continue;
}
systemStateValues = GetSystemStateValues(lines, columns, keyColumnIndex.Value);
if (systemStateValues.Count == 0)
{
File.Move(reportFullPath, Path.Combine(_FileConnectorConfiguration.SourceFileLocation, missingKeyDirectory, fileName));
File.Move(reportFullPath, Path.Combine(_FileConnectorConfiguration.AlternateTargetFolder, missingKeyDirectory, fileName));
continue;
}
lines.AddRange(headerLines);
systemState = string.Join('-', systemStateValues);
checkFileName = Path.Combine(Path.GetDirectoryName(reportFullPath) ?? throw new Exception(), $"{equipment}-{timestamp}-{systemState}.pdsf");
systemState = string.Join("-", systemStateValues);
checkFileName = Path.Combine(_FileConnectorConfiguration.AlternateTargetFolder, $"{equipment}-{timestamp}-{systemState}.pdsf");
File.WriteAllLines(checkFileName, lines);
// File.Delete(reportFullPath);
if (DateTime.TryParseExact(timestamp, _TimestampFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out dateTime))

View File

@ -0,0 +1,238 @@
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.Globalization;
using System.IO;
using System.Linq;
using System.Text.Json;
namespace Adaptation.FileHandlers.R75;
public class FileRead : Shared.FileRead, IFileRead
{
private readonly string _KeyColumn;
private readonly string _TimestampFormat;
private readonly ReadOnlyDictionary<string, string> _SystemStateToNames;
public FileRead(ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, int? connectionCount, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, Dictionary<string, List<long>> dummyRuns, Dictionary<long, List<string>> 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<string, string> systemStateToNames = new();
_KeyColumn = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "ProcessDataStandardFormat.KeyColumn");
_TimestampFormat = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "ProcessDataStandardFormat.TimestampFormat");
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<string, Test[], JsonElement[], List<FileInfo>> 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<string> IFileRead.GetHeaderNames()
{
List<string> results = _Description.GetHeaderNames();
return results;
}
string[] IFileRead.Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> 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<string, string> IFileRead.GetDisplayNamesJsonElement()
{
Dictionary<string, string> results = _Description.GetDisplayNamesJsonElement(this);
return results;
}
List<IDescription> IFileRead.GetDescriptions(IFileRead fileRead, List<Test> tests, IProcessData processData)
{
List<IDescription> results = _Description.GetDescriptions(fileRead, _Logistics, tests, processData);
return results;
}
Tuple<string, Test[], JsonElement[], List<FileInfo>> IFileRead.GetExtractResult(string reportFullPath, string eventName)
{
Tuple<string, Test[], JsonElement[], List<FileInfo>> 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<string, Test[], JsonElement[], List<FileInfo>>(results.Item1, Array.Empty<Test>(), JsonSerializer.Deserialize<JsonElement[]>("[]"), results.Item4);
if (results.Item3.Length > 0 && _IsEAFHosted)
WritePDSF(this, results.Item3);
UpdateLastTicksDuration(DateTime.Now.Ticks - dateTime.Ticks);
return results;
}
Tuple<string, Test[], JsonElement[], List<FileInfo>> IFileRead.ReExtract()
{
Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
List<string> headerNames = _Description.GetHeaderNames();
Dictionary<string, string> 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<string> GetSystemStateValues(List<string> lines, string[] columns, int keyColumnIndex)
{
List<string> 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 MoveFile(string reportFullPath)
{
string equipment;
string timestamp;
string[] columns;
DateTime dateTime;
List<string> lines;
string systemState;
int? keyColumnIndex;
string checkFileName;
List<string> headerLines = new();
ReadOnlyCollection<string> systemStateValues;
string missingKeyDirectory = Path.Combine(_FileConnectorConfiguration.AlternateTargetFolder, "Missing-Key");
if (!Directory.Exists(missingKeyDirectory))
_ = Directory.CreateDirectory(missingKeyDirectory);
string fileName = Path.GetFileName(reportFullPath);
string[] segments = fileName.Split('_');
for (int z = 0; z < 1; z++)
{
if (segments.Length != 2)
continue;
equipment = segments[0];
timestamp = segments[1].Split('.')[0];
if (timestamp.Length != _TimestampFormat.Length)
continue;
headerLines.Clear();
lines = File.ReadAllLines(reportFullPath).ToList();
if (lines.Count < 8)
continue;
for (int i = 0; i < 6; i++)
{
headerLines.Add(lines[0]);
lines.RemoveAt(0);
}
if (lines[0].Length < 1 || lines[0][0] != '"' || !lines[0].StartsWith("\"Time\""))
continue;
columns = lines[0].Split('\t');
if (columns.Length < 3)
continue;
keyColumnIndex = GetKeyColumnIndex(columns, _KeyColumn);
if (keyColumnIndex is null)
{
File.Move(reportFullPath, Path.Combine(_FileConnectorConfiguration.AlternateTargetFolder, missingKeyDirectory, fileName));
continue;
}
systemStateValues = GetSystemStateValues(lines, columns, keyColumnIndex.Value);
if (systemStateValues.Count == 0)
{
File.Move(reportFullPath, Path.Combine(_FileConnectorConfiguration.AlternateTargetFolder, missingKeyDirectory, fileName));
continue;
}
lines.AddRange(headerLines);
systemState = string.Join("-", systemStateValues);
checkFileName = Path.Combine(_FileConnectorConfiguration.AlternateTargetFolder, $"{equipment}-{timestamp}-{systemState}.pdsf");
File.WriteAllLines(checkFileName, lines);
// File.Delete(reportFullPath);
if (DateTime.TryParseExact(timestamp, _TimestampFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out dateTime))
File.SetLastWriteTime(checkFileName, dateTime);
}
}
private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime _)
{
Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
Tuple<string, string[], string[]> pdsf = ProcessDataStandardFormat.GetLogisticsColumnsAndBody(reportFullPath);
_Logistics = new Logistics(reportFullPath, pdsf.Item1);
SetFileParameterLotIDToLogisticsMID();
JsonElement[] jsonElements = ProcessDataStandardFormat.GetArray(pdsf);
List<Shared.Properties.IDescription> descriptions = GetDuplicatorDescriptions(jsonElements);
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
MoveFile(reportFullPath);
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(pdsf.Item1, tests, jsonElements, new List<FileInfo>());
return results;
}
}

View File

@ -0,0 +1,238 @@
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.Globalization;
using System.IO;
using System.Linq;
using System.Text.Json;
namespace Adaptation.FileHandlers.R77;
public class FileRead : Shared.FileRead, IFileRead
{
private readonly string _KeyColumn;
private readonly string _TimestampFormat;
private readonly ReadOnlyDictionary<string, string> _SystemStateToNames;
public FileRead(ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, int? connectionCount, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, Dictionary<string, List<long>> dummyRuns, Dictionary<long, List<string>> 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<string, string> systemStateToNames = new();
_KeyColumn = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "ProcessDataStandardFormat.KeyColumn");
_TimestampFormat = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "ProcessDataStandardFormat.TimestampFormat");
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<string, Test[], JsonElement[], List<FileInfo>> 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<string> IFileRead.GetHeaderNames()
{
List<string> results = _Description.GetHeaderNames();
return results;
}
string[] IFileRead.Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> 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<string, string> IFileRead.GetDisplayNamesJsonElement()
{
Dictionary<string, string> results = _Description.GetDisplayNamesJsonElement(this);
return results;
}
List<IDescription> IFileRead.GetDescriptions(IFileRead fileRead, List<Test> tests, IProcessData processData)
{
List<IDescription> results = _Description.GetDescriptions(fileRead, _Logistics, tests, processData);
return results;
}
Tuple<string, Test[], JsonElement[], List<FileInfo>> IFileRead.GetExtractResult(string reportFullPath, string eventName)
{
Tuple<string, Test[], JsonElement[], List<FileInfo>> 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<string, Test[], JsonElement[], List<FileInfo>>(results.Item1, Array.Empty<Test>(), JsonSerializer.Deserialize<JsonElement[]>("[]"), results.Item4);
if (results.Item3.Length > 0 && _IsEAFHosted)
WritePDSF(this, results.Item3);
UpdateLastTicksDuration(DateTime.Now.Ticks - dateTime.Ticks);
return results;
}
Tuple<string, Test[], JsonElement[], List<FileInfo>> IFileRead.ReExtract()
{
Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
List<string> headerNames = _Description.GetHeaderNames();
Dictionary<string, string> 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<string> GetSystemStateValues(List<string> lines, string[] columns, int keyColumnIndex)
{
List<string> 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 MoveFile(string reportFullPath)
{
string equipment;
string timestamp;
string[] columns;
DateTime dateTime;
List<string> lines;
string systemState;
int? keyColumnIndex;
string checkFileName;
List<string> headerLines = new();
ReadOnlyCollection<string> systemStateValues;
string missingKeyDirectory = Path.Combine(_FileConnectorConfiguration.AlternateTargetFolder, "Missing-Key");
if (!Directory.Exists(missingKeyDirectory))
_ = Directory.CreateDirectory(missingKeyDirectory);
string fileName = Path.GetFileName(reportFullPath);
string[] segments = fileName.Split('_');
for (int z = 0; z < 1; z++)
{
if (segments.Length != 2)
continue;
equipment = segments[0];
timestamp = segments[1].Split('.')[0];
if (timestamp.Length != _TimestampFormat.Length)
continue;
headerLines.Clear();
lines = File.ReadAllLines(reportFullPath).ToList();
if (lines.Count < 8)
continue;
for (int i = 0; i < 6; i++)
{
headerLines.Add(lines[0]);
lines.RemoveAt(0);
}
if (lines[0].Length < 1 || lines[0][0] != '"' || !lines[0].StartsWith("\"Time\""))
continue;
columns = lines[0].Split('\t');
if (columns.Length < 3)
continue;
keyColumnIndex = GetKeyColumnIndex(columns, _KeyColumn);
if (keyColumnIndex is null)
{
File.Move(reportFullPath, Path.Combine(_FileConnectorConfiguration.AlternateTargetFolder, missingKeyDirectory, fileName));
continue;
}
systemStateValues = GetSystemStateValues(lines, columns, keyColumnIndex.Value);
if (systemStateValues.Count == 0)
{
File.Move(reportFullPath, Path.Combine(_FileConnectorConfiguration.AlternateTargetFolder, missingKeyDirectory, fileName));
continue;
}
lines.AddRange(headerLines);
systemState = string.Join("-", systemStateValues);
checkFileName = Path.Combine(_FileConnectorConfiguration.AlternateTargetFolder, $"{equipment}-{timestamp}-{systemState}.pdsf");
File.WriteAllLines(checkFileName, lines);
// File.Delete(reportFullPath);
if (DateTime.TryParseExact(timestamp, _TimestampFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out dateTime))
File.SetLastWriteTime(checkFileName, dateTime);
}
}
private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime _)
{
Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
Tuple<string, string[], string[]> pdsf = ProcessDataStandardFormat.GetLogisticsColumnsAndBody(reportFullPath);
_Logistics = new Logistics(reportFullPath, pdsf.Item1);
SetFileParameterLotIDToLogisticsMID();
JsonElement[] jsonElements = ProcessDataStandardFormat.GetArray(pdsf);
List<Shared.Properties.IDescription> descriptions = GetDuplicatorDescriptions(jsonElements);
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
MoveFile(reportFullPath);
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(pdsf.Item1, tests, jsonElements, new List<FileInfo>());
return results;
}
}

View File

@ -489,6 +489,43 @@ public class FileRead : Properties.IFileRead
}
}
protected static void NestExistingFiles(FileConnectorConfiguration fileConnectorConfiguration)
{
if (!fileConnectorConfiguration.IncludeSubDirectories.Value)
{
string[] matches = GetMatches(fileConnectorConfiguration);
if (matches is not null && matches.Length > 0)
{
string fileName;
string nestedDirectory = Path.Combine(fileConnectorConfiguration.SourceFileLocation, DateTime.Now.Ticks.ToString());
if (!Directory.Exists(nestedDirectory))
_ = Directory.CreateDirectory(nestedDirectory);
foreach (string match in matches)
{
fileName = Path.GetFileName(match);
File.Move(match, Path.Combine(nestedDirectory, fileName));
}
}
}
}
protected static string[] GetMatches(FileConnectorConfiguration fileConnectorConfiguration)
{
string[] segments;
string[] results = null;
foreach (string subSourceFileFilter in fileConnectorConfiguration.SourceFileFilters)
{
segments = subSourceFileFilter.Split('\\');
if (fileConnectorConfiguration.IncludeSubDirectories.Value)
results = Directory.GetFiles(fileConnectorConfiguration.SourceFileLocation, segments.Last(), SearchOption.AllDirectories);
else
results = Directory.GetFiles(fileConnectorConfiguration.SourceFileLocation, segments.Last(), SearchOption.TopDirectoryOnly);
if (results.Length != 0)
break;
}
return results;
}
protected Tuple<string, Test[], JsonElement[], List<FileInfo>> ReExtract(IFileRead fileRead, List<string> headerNames, Dictionary<string, string> keyValuePairs)
{
Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
@ -496,18 +533,7 @@ public class FileRead : Properties.IFileRead
results = null;
else
{
string[] segments;
string[] matches = null;
foreach (string subSourceFileFilter in _FileConnectorConfiguration.SourceFileFilters)
{
segments = subSourceFileFilter.Split('\\');
if (_FileConnectorConfiguration.IncludeSubDirectories.Value)
matches = Directory.GetFiles(_FileConnectorConfiguration.SourceFileLocation, segments.Last(), SearchOption.AllDirectories);
else
matches = Directory.GetFiles(_FileConnectorConfiguration.SourceFileLocation, segments.Last(), SearchOption.TopDirectoryOnly);
if (matches.Length != 0)
break;
}
string[] matches = GetMatches(_FileConnectorConfiguration);
if (matches is null || matches.Length == 0)
results = null;
else

View File

@ -152,9 +152,11 @@ public class ProcessDataStandardFormat
{
string value;
string[] segments;
List<string> lines = new();
StringBuilder stringBuilder = new();
foreach (string bodyLine in bodyLines)
{
_ = stringBuilder.Clear();
_ = stringBuilder.Append('{');
segments = bodyLine.Trim().Split('\t');
if (!lookForNumbers)
@ -179,10 +181,11 @@ public class ProcessDataStandardFormat
}
}
_ = stringBuilder.Remove(stringBuilder.Length - 1, 1);
_ = stringBuilder.AppendLine("},");
_ = stringBuilder.AppendLine("}");
lines.Add(stringBuilder.ToString());
}
_ = stringBuilder.Remove(stringBuilder.Length - 3, 3);
results = JsonSerializer.Deserialize<JsonElement[]>(string.Concat("[", stringBuilder, "]"));
string json = $"[{string.Join(",", lines)}]";
results = JsonSerializer.Deserialize<JsonElement[]>(json);
}
return results;
}

View File

@ -1,4 +1,4 @@
#if true
#if v2_56_0
using Adaptation._Tests.Shared;
using Microsoft.Extensions.Logging;
using Microsoft.VisualStudio.TestTools.UnitTesting;
@ -19,7 +19,7 @@ public class DEP08CEPIEPSILON : EAFLoggingUnitTesting
internal static string DummyRoot { get; private set; }
internal static DEP08CEPIEPSILON EAFLoggingUnitTesting { get; private set; }
static DEP08CEPIEPSILON() => DummyRoot = @"\\mestsa003.infineon.com\EC_Characterization_Si\Dummy";
static DEP08CEPIEPSILON() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
public DEP08CEPIEPSILON() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
{
@ -48,9 +48,7 @@ public class DEP08CEPIEPSILON : EAFLoggingUnitTesting
EAFLoggingUnitTesting?.Dispose();
}
#if DEBUG
[Ignore]
#endif
[TestMethod]
public void Production__v2_56_0__DEP08CEPIEPSILON__R32()
{
@ -61,9 +59,7 @@ public class DEP08CEPIEPSILON : EAFLoggingUnitTesting
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
}
#if DEBUG
[Ignore]
#endif
[TestMethod]
public void Production__v2_56_0__DEP08CEPIEPSILON__R62()
{

View File

@ -0,0 +1,74 @@
#if v2_57_0
using Adaptation._Tests.Shared;
using Microsoft.Extensions.Logging;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
namespace Adaptation._Tests.CreateSelfDescription.Production.v2_57_0;
[TestClass]
public class DEP08CEPIEPSILON : EAFLoggingUnitTesting
{
#pragma warning disable CA2254
#pragma warning disable IDE0060
internal static string DummyRoot { get; private set; }
internal static DEP08CEPIEPSILON EAFLoggingUnitTesting { get; private set; }
static DEP08CEPIEPSILON() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
public DEP08CEPIEPSILON() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
{
if (EAFLoggingUnitTesting is null)
throw new Exception();
}
public DEP08CEPIEPSILON(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
{
}
[ClassInitialize]
public static void ClassInitialize(TestContext testContext)
{
EAFLoggingUnitTesting ??= new DEP08CEPIEPSILON(testContext);
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize"));
string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName);
File.WriteAllText(fileNameAndText[0], fileNameAndText[1]);
File.WriteAllText(fileNameAndText[2], fileNameAndText[3]);
}
[ClassCleanup()]
public static void ClassCleanup()
{
EAFLoggingUnitTesting.Logger?.LogInformation("Cleanup");
EAFLoggingUnitTesting?.Dispose();
}
[Ignore]
[TestMethod]
public void Production__v2_57_0__DEP08CEPIEPSILON__R32()
{
string check = "T27*.pdsf";
MethodBase methodBase = new StackFrame().GetMethod();
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
_ = AdaptationTesting.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting);
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
}
[Ignore]
[TestMethod]
public void Production__v2_57_0__DEP08CEPIEPSILON__R62()
{
string check = "T41*.pdsf";
MethodBase methodBase = new StackFrame().GetMethod();
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
_ = AdaptationTesting.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting);
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
}
}
#endif

View File

@ -0,0 +1,74 @@
#if true
using Adaptation._Tests.Shared;
using Microsoft.Extensions.Logging;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
namespace Adaptation._Tests.CreateSelfDescription.Production.v2_59_0;
[TestClass]
public class DEP08CEPIEPSILON : EAFLoggingUnitTesting
{
#pragma warning disable CA2254
#pragma warning disable IDE0060
internal static string DummyRoot { get; private set; }
internal static DEP08CEPIEPSILON EAFLoggingUnitTesting { get; private set; }
static DEP08CEPIEPSILON() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
public DEP08CEPIEPSILON() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
{
if (EAFLoggingUnitTesting is null)
throw new Exception();
}
public DEP08CEPIEPSILON(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
{
}
[ClassInitialize]
public static void ClassInitialize(TestContext testContext)
{
EAFLoggingUnitTesting ??= new DEP08CEPIEPSILON(testContext);
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize"));
string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName);
File.WriteAllText(fileNameAndText[0], fileNameAndText[1]);
File.WriteAllText(fileNameAndText[2], fileNameAndText[3]);
}
[ClassCleanup()]
public static void ClassCleanup()
{
EAFLoggingUnitTesting.Logger?.LogInformation("Cleanup");
EAFLoggingUnitTesting?.Dispose();
}
[Ignore]
[TestMethod]
public void Production__v2_59_0__DEP08CEPIEPSILON__R32()
{
string check = "T27*.pdsf";
MethodBase methodBase = new StackFrame().GetMethod();
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
_ = AdaptationTesting.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting);
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
}
[Ignore]
[TestMethod]
public void Production__v2_59_0__DEP08CEPIEPSILON__R62()
{
string check = "T41*.pdsf";
MethodBase methodBase = new StackFrame().GetMethod();
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
_ = AdaptationTesting.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting);
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
}
}
#endif

View File

@ -1,4 +1,4 @@
#if true
#if v2_56_0
using Adaptation._Tests.Shared;
using Adaptation.Shared;
using Adaptation.Shared.Methods;
@ -32,15 +32,11 @@ public class DEP08CEPIEPSILON
catch (Exception) { }
}
#if DEBUG
[Ignore]
#endif
[TestMethod]
public void Production__v2_56_0__DEP08CEPIEPSILON__R32() => _DEP08CEPIEPSILON.Production__v2_56_0__DEP08CEPIEPSILON__R32();
#if (!DEBUG)
[Ignore]
#endif
[TestMethod]
public void Production__v2_56_0__DEP08CEPIEPSILON__R32638594189939758135__First()
{
@ -54,15 +50,11 @@ public class DEP08CEPIEPSILON
NonThrowTryCatch();
}
#if DEBUG
[Ignore]
#endif
[TestMethod]
public void Production__v2_56_0__DEP08CEPIEPSILON__R62() => _DEP08CEPIEPSILON.Production__v2_56_0__DEP08CEPIEPSILON__R62();
#if (!DEBUG)
[Ignore]
#endif
[TestMethod]
public void Production__v2_56_0__DEP08CEPIEPSILON__R62638594189939758135__First()
{

View File

@ -0,0 +1,72 @@
#if v2_57_0
using Adaptation._Tests.Shared;
using Adaptation.Shared;
using Adaptation.Shared.Methods;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Diagnostics;
using System.Reflection;
namespace Adaptation._Tests.Extract.Production.v2_57_0;
[TestClass]
public class DEP08CEPIEPSILON
{
#pragma warning disable CA2254
#pragma warning disable IDE0060
private static CreateSelfDescription.Production.v2_57_0.DEP08CEPIEPSILON _DEP08CEPIEPSILON;
[ClassInitialize]
public static void ClassInitialize(TestContext testContext)
{
CreateSelfDescription.Production.v2_57_0.DEP08CEPIEPSILON.ClassInitialize(testContext);
_DEP08CEPIEPSILON = CreateSelfDescription.Production.v2_57_0.DEP08CEPIEPSILON.EAFLoggingUnitTesting;
}
private static void NonThrowTryCatch()
{
try
{ throw new Exception(); }
catch (Exception) { }
}
[Ignore]
[TestMethod]
public void Production__v2_57_0__DEP08CEPIEPSILON__R32() => _DEP08CEPIEPSILON.Production__v2_57_0__DEP08CEPIEPSILON__R32();
[Ignore]
[TestMethod]
public void Production__v2_57_0__DEP08CEPIEPSILON__R32638594189939758135__First()
{
string check = "T27*.pdsf";
MethodBase methodBase = new StackFrame().GetMethod();
_DEP08CEPIEPSILON.Production__v2_57_0__DEP08CEPIEPSILON__R32();
string[] variables = _DEP08CEPIEPSILON.AdaptationTesting.GetVariables(methodBase, check, validatePDSF: false);
IFileRead fileRead = _DEP08CEPIEPSILON.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
Logistics logistics = new(fileRead);
_ = AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics);
NonThrowTryCatch();
}
[Ignore]
[TestMethod]
public void Production__v2_57_0__DEP08CEPIEPSILON__R62() => _DEP08CEPIEPSILON.Production__v2_57_0__DEP08CEPIEPSILON__R62();
[Ignore]
[TestMethod]
public void Production__v2_57_0__DEP08CEPIEPSILON__R62638594189939758135__First()
{
string check = "T41*.pdsf";
MethodBase methodBase = new StackFrame().GetMethod();
_DEP08CEPIEPSILON.Production__v2_57_0__DEP08CEPIEPSILON__R62();
string[] variables = _DEP08CEPIEPSILON.AdaptationTesting.GetVariables(methodBase, check, validatePDSF: false);
IFileRead fileRead = _DEP08CEPIEPSILON.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
Logistics logistics = new(fileRead);
_ = AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics);
NonThrowTryCatch();
}
}
#endif

View File

@ -0,0 +1,72 @@
#if true
using Adaptation._Tests.Shared;
using Adaptation.Shared;
using Adaptation.Shared.Methods;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Diagnostics;
using System.Reflection;
namespace Adaptation._Tests.Extract.Production.v2_59_0;
[TestClass]
public class DEP08CEPIEPSILON
{
#pragma warning disable CA2254
#pragma warning disable IDE0060
private static CreateSelfDescription.Production.v2_59_0.DEP08CEPIEPSILON _DEP08CEPIEPSILON;
[ClassInitialize]
public static void ClassInitialize(TestContext testContext)
{
CreateSelfDescription.Production.v2_59_0.DEP08CEPIEPSILON.ClassInitialize(testContext);
_DEP08CEPIEPSILON = CreateSelfDescription.Production.v2_59_0.DEP08CEPIEPSILON.EAFLoggingUnitTesting;
}
private static void NonThrowTryCatch()
{
try
{ throw new Exception(); }
catch (Exception) { }
}
[Ignore]
[TestMethod]
public void Production__v2_59_0__DEP08CEPIEPSILON__R32() => _DEP08CEPIEPSILON.Production__v2_59_0__DEP08CEPIEPSILON__R32();
[Ignore]
[TestMethod]
public void Production__v2_59_0__DEP08CEPIEPSILON__R32638594189939758135__First()
{
string check = "T27*.pdsf";
MethodBase methodBase = new StackFrame().GetMethod();
_DEP08CEPIEPSILON.Production__v2_59_0__DEP08CEPIEPSILON__R32();
string[] variables = _DEP08CEPIEPSILON.AdaptationTesting.GetVariables(methodBase, check, validatePDSF: false);
IFileRead fileRead = _DEP08CEPIEPSILON.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
Logistics logistics = new(fileRead);
_ = AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics);
NonThrowTryCatch();
}
[Ignore]
[TestMethod]
public void Production__v2_59_0__DEP08CEPIEPSILON__R62() => _DEP08CEPIEPSILON.Production__v2_59_0__DEP08CEPIEPSILON__R62();
[Ignore]
[TestMethod]
public void Production__v2_59_0__DEP08CEPIEPSILON__R62638594189939758135__First()
{
string check = "T41*.pdsf";
MethodBase methodBase = new StackFrame().GetMethod();
_DEP08CEPIEPSILON.Production__v2_59_0__DEP08CEPIEPSILON__R62();
string[] variables = _DEP08CEPIEPSILON.AdaptationTesting.GetVariables(methodBase, check, validatePDSF: false);
IFileRead fileRead = _DEP08CEPIEPSILON.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
Logistics logistics = new(fileRead);
_ = AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics);
NonThrowTryCatch();
}
}
#endif

View File

@ -974,8 +974,8 @@ public class AdaptationTesting : ISMTP
}
if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.AlternateTargetFolder))
{
if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.AlternateTargetFolder))
_ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.AlternateTargetFolder);
if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.AlternateTargetFolder.Split('|')[0]))
_ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.AlternateTargetFolder.Split('|')[0]);
}
}
catch (IOException ex)

View File

@ -64,7 +64,7 @@ public class DEP08CEPIEPSILON : LoggingUnitTesting, IDisposable
StringBuilder results = new();
(string cellInstanceName, string cellInstanceVersionName)[] collection = new (string, string)[]
{
new("DEP08CEPIEPSILON", "v2.56.0"),
new("DEP08CEPIEPSILON", "v2.59.0"),
};
string production = "http://messa08ec.infineon.com:9003/CellInstanceServiceV2";
Shared.PasteSpecialXml.EAF.XML.API.CellInstance.CellInstanceVersion cellInstanceVersion;

View File

@ -103,11 +103,14 @@
<Compile Include="Adaptation\Eaf\Management\ConfigurationData\CellAutomation\ModelObjectParameterDefinition.cs" />
<Compile Include="Adaptation\Eaf\Management\ConfigurationData\CellAutomation\ModelObjectParameterType.cs" />
<Compile Include="Adaptation\Eaf\Management\ConfigurationData\Semiconductor\CellInstances\SecsConnectionConfiguration.cs" />
<Compile Include="Adaptation\FileHandlers\Archive\FileRead.cs" />
<Compile Include="Adaptation\FileHandlers\CellInstanceConnectionName.cs" />
<Compile Include="Adaptation\FileHandlers\Dummy\FileRead.cs" />
<Compile Include="Adaptation\FileHandlers\R32\FileRead.cs" />
<Compile Include="Adaptation\FileHandlers\R62\FileRead.cs" />
<Compile Include="Adaptation\FileHandlers\R55\FileRead.cs" />
<Compile Include="Adaptation\FileHandlers\R57\FileRead.cs" />
<Compile Include="Adaptation\FileHandlers\R75\FileRead.cs" />
<Compile Include="Adaptation\FileHandlers\R77\FileRead.cs" />
<Compile Include="Adaptation\Ifx\Eaf\Common\Configuration\ConnectionSetting.cs" />
<Compile Include="Adaptation\Ifx\Eaf\EquipmentConnector\File\Component\File.cs" />
<Compile Include="Adaptation\Ifx\Eaf\EquipmentConnector\File\Component\FilePathGenerator.cs" />
@ -159,13 +162,13 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Infineon.EAF.Runtime">
<Version>2.56.0</Version>
<Version>2.59.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.AspNet.WebApi.Core">
<Version>5.2.7</Version>
</PackageReference>
<PackageReference Include="System.Text.Json">
<Version>6.0.3</Version>
<Version>8.0.3</Version>
</PackageReference>
<PackageReference Include="System.Net.WebSockets">
<Version>4.3.0</Version>

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.56.0.0")]
[assembly: AssemblyFileVersion("2.56.0.0")]
[assembly: AssemblyVersion("2.59.0.0")]
[assembly: AssemblyFileVersion("2.59.0.0")]