Infineon.EAF.Runtime v2.59.0

With .gitignore *.traineddata
This commit is contained in:
2025-02-21 13:47:08 -07:00
parent 5368852e1b
commit 5cda494708
170 changed files with 17870 additions and 14 deletions

View File

@ -0,0 +1,104 @@
using Adaptation._Tests.Shared;
using Microsoft.Extensions.Logging;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
namespace Adaptation._Tests.Static;
[TestClass]
public class DEP08SIASM : LoggingUnitTesting, IDisposable
{
#pragma warning disable CA2254
#pragma warning disable IDE0060
internal static DEP08SIASM LoggingUnitTesting { get; private set; }
public DEP08SIASM() : base(testContext: null, declaringType: null)
{
if (LoggingUnitTesting is null)
throw new Exception();
}
public DEP08SIASM(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType)
{
}
[ClassInitialize]
public static void ClassInitialize(TestContext testContext) => LoggingUnitTesting ??= new DEP08SIASM(testContext);
[ClassCleanup()]
public static void ClassCleanup()
{
LoggingUnitTesting?.Logger?.LogInformation("Cleanup");
LoggingUnitTesting?.Dispose();
}
private static void NonThrowTryCatch()
{
try
{ throw new Exception(); }
catch (Exception) { }
}
[TestMethod]
public void TestDateTime()
{
DateTime dateTime = DateTime.Now;
Assert.IsTrue(dateTime.ToString("M/d/yyyy h:mm:ss tt") == dateTime.ToString());
}
#if DEBUG
[Ignore]
#endif
[TestMethod]
public void Production()
{
MethodBase methodBase = new StackFrame().GetMethod();
StringBuilder results = new();
(string cellInstanceName, string cellInstanceVersionName)[] collection = new (string, string)[]
{
new("DEP08SIASM", "v2.59.0"),
};
string production = "http://messa08ec.infineon.com:9003/CellInstanceServiceV2";
Shared.PasteSpecialXml.EAF.XML.API.CellInstance.CellInstanceVersion cellInstanceVersion;
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
foreach ((string cellInstanceName, string cellInstanceVersionName) in collection)
{
cellInstanceVersion = AdaptationTesting.GetCellInstanceVersion($"{production}/{cellInstanceName}/{cellInstanceVersionName}/configuration");
_ = results.AppendLine($"{cellInstanceName}\t{cellInstanceVersionName}\t{cellInstanceVersion.EdaConnection.PortNumber}");
}
string sourceDirectory = "D:/Tmp/cellInstanceVersion.EdaConnection.PortNumber";
if (!Directory.Exists(sourceDirectory))
_ = Directory.CreateDirectory(sourceDirectory);
File.WriteAllText(Path.Combine(sourceDirectory, $"{methodBase.Module.Name}-{methodBase.ReflectedType.Name}-{methodBase.Name}.tsv"), results.ToString());
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
}
[TestMethod]
public void CellInstanceVersionEdaConnectionPortNumber()
{
MethodBase methodBase = new StackFrame().GetMethod();
string sourceDirectory = "D:/Tmp/cellInstanceVersion.EdaConnection.PortNumber";
if (Directory.Exists(sourceDirectory))
{
string destinationDirectory = Path.Combine(sourceDirectory, "All");
if (!Directory.Exists(destinationDirectory))
_ = Directory.CreateDirectory(destinationDirectory);
List<string> lines = new();
string[] files = Directory.GetFiles(sourceDirectory, "*.tsv", SearchOption.TopDirectoryOnly);
foreach (string file in files)
lines.AddRange(File.ReadAllLines(file));
File.WriteAllLines(Path.Combine(destinationDirectory, $"{DateTime.Now.Ticks}.tsv"), lines.Distinct().OrderBy(l => l));
}
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
NonThrowTryCatch();
}
}

View File

@ -0,0 +1,210 @@
using Adaptation._Tests.Shared;
using Microsoft.Extensions.Logging;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Diagnostics;
using System.Linq;
using System.Net.Http;
using System.Reflection;
using System.Threading.Tasks;
namespace Adaptation._Tests.Static;
[TestClass]
public class EAF : LoggingUnitTesting, IDisposable
{
#pragma warning disable CA2254
#pragma warning disable IDE0060
internal static EAF LoggingUnitTesting { get; private set; }
internal static AdaptationTesting AdaptationTesting { get; private set; }
public EAF() : base(testContext: null, declaringType: null)
{
if (LoggingUnitTesting is null)
throw new Exception();
}
public EAF(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType)
{ }
[ClassInitialize]
public static void ClassInitialize(TestContext testContext)
{
LoggingUnitTesting ??= new EAF(testContext);
string dummyRoot = string.Empty;
bool skipEquipmentDictionary = true;
AdaptationTesting = new(dummyRoot, testContext, skipEquipmentDictionary, LoggingUnitTesting.TestContextPropertiesAsJson, LoggingUnitTesting.HasWaitForProperty);
}
[ClassCleanup()]
public static void ClassCleanup()
{
LoggingUnitTesting?.Logger?.LogInformation("Cleanup");
LoggingUnitTesting?.Dispose();
}
[TestMethod]
public void Production()
{
string testName;
Task<string> task;
string[] segments;
HttpClient httpClient = new();
MethodBase methodBase = new StackFrame().GetMethod();
string currentActiveVersionTag = "CurrentActiveVersion>";
string managementSite = "http://messa08ec.infineon.com:9003/CellInstances/entity/";
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
string[] cellInstances = new string[]
{
"BACKLOG-EQPT",
"BACKLOG",
"BIORAD2-EDA",
"BIORAD2",
"BIORAD3-EDA",
"BIORAD3",
"BIORAD4-EDA",
"BIORAD4",
"BIORAD5-EDA",
"BIORAD5",
"CDE2-EDA",
"CDE2",
"CDE3-EDA",
"CDE3-EQPT",
"CDE3",
"CDE4-EDA",
"CDE4-EQPT",
"CDE4",
"CDE5-EDA",
"CDE5-EQPT",
"CDE5",
"CDE6-EDA",
"CDE6-EQPT",
"CDE6",
"DEP08SIASM",
"DEP08SIHTRPLC",
"EC",
"HGCV1-EDA",
"HGCV1-EQPT",
"HGCV1",
"HGCV2-EDA",
"HGCV2-EQPT",
"HGCV2",
"HGCV3-EDA",
"HGCV3-EQPT",
"HGCV3",
"MET08ANLYSDIFAAST230",
"MET08DDUPSFS6420",
"MET08DDUPSP1TBI",
"MET08RESIHGCV",
"MET08RESIMAPCDE",
"MET08RESISRP2100",
"MET08THFTIRQS408M",
"MET08THFTIRSTRATUS",
"R34-EDA",
"R34-EQPT",
"R34",
"R47-PLC-EDA",
"R47-PLC",
"R53-EDA",
"R53-EQPT",
"R53",
"R55-EDA",
"R55-EQPT",
"R55",
"R70-PLC-EDA",
"R70-PLC",
"R72-PLC-EDA",
"R72-PLC",
"R73-PLC-EDA",
"R73-PLC",
"R74-PLC-EDA",
"R74-PLC",
"SP101-EDA",
"SP101-EQPT",
"SP101",
"SPV01-EDA",
"SPV01",
"SRP-EDA",
"SRP-EQPT",
"SRP",
"T21",
"T27-EDA",
"T27",
"TENCOR1-EDA",
"TENCOR1",
"TENCOR2-EDA",
"TENCOR2",
"TENCOR3-EDA",
"TENCOR3",
};
foreach (string cellInstance in cellInstances.OrderBy(l => l))
{
if (!cellInstance.Contains('-'))
continue;
task = httpClient.GetStringAsync($"{managementSite}{cellInstance}");
task.Wait();
if (task.Result is not string response)
continue;
segments = response.Split(currentActiveVersionTag);
if (segments.Length < 2)
continue;
testName = string.Concat("Production__v", segments[1].Split('<')[0].Replace('.', '_'), "__", cellInstance.Replace('-', '_'), "__");
(string i, string v, string c, string n, int p, string f) = AdaptationTesting.GetCellInstanceVersionCore(testName);
LoggingUnitTesting.Logger.LogInformation($"{p},{v},{i},{c},{n},{f}");
}
Assert.IsTrue(true);
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
}
}
// Production - Getting configuration
// 8500,v4.16.0,BIORAD2-EDA,,,messa010ec
// 8501,v4.16.0,BIORAD3-EDA,,,messa010ec
// 8510,v4.16.0,BIORAD4-EDA,,,messa010ec
// 8511,v4.16.0,BIORAD5-EDA,,,messa010ec
// 8520,v4.16.0,CDE2-EDA,,,messa010ec
// 8524,v4.16.0,CDE3-EDA,,,messa010ec
// 8526,v2.49.2,CDE3-EQPT,DownloadRsMFile.Communicating,DownloadRsMFile.NotCommunicating,mestsa06ec
// 8524,v4.16.0,CDE4-EDA,,,messa010ec
// 8526,v2.49.2,CDE4-EQPT,DownloadRsMFile.Communicating,DownloadRsMFile.NotCommunicating,mestsa06ec
// 8521,v4.16.0,CDE5-EDA,,,messa010ec
// 7589,v2.49.2,CDE5-EQPT,DownloadRsMFile.Communicating,DownloadRsMFile.NotCommunicating,mestsa06ec
// 8522,v4.16.0,CDE6-EDA,,,messa010ec
// 7590,v2.49.2,CDE6-EQPT,DownloadRsMFile.Communicating,DownloadRsMFile.NotCommunicating,mestsa06ec
// 8530,v4.16.0,HGCV1-EDA,,,messa010ec
// 8536,v2.12.3,HGCV1-EQPT,,,messa010ec
// 8531,v4.16.0,HGCV2-EDA,,,messa010ec
// 8537,v2.12.3,HGCV2-EQPT,,,messa010ec
// 8532,v4.16.0,HGCV3-EDA,,,messa010ec
// 8538,v2.12.3,HGCV3-EQPT,,,messa010ec
// 8134,v4.16.0,R34-EDA,,,messa010ec
// 8034,v2.43.4,R34-EQPT,DownloadJpegFile.Communicating,DownloadJpegFile.NotCommunicating,messa010ec
// 553,v2.19.0,R47-PLC,,,messtec102
// 553,v2.19.0,R47-PLC-EDA,,,messtec102
// 8153,v4.16.0,R53-EDA,,,messa010ec
// 8653,v2.43.4,R53-EQPT,DownloadJpegFile.Communicating,DownloadJpegFile.NotCommunicating,messa010ec
// 8155,v4.16.0,R55-EDA,,,messa010ec
// 8655,v2.43.4,R55-EQPT,DownloadJpegFile.Communicating,DownloadJpegFile.NotCommunicating,messa010ec
// 8770,v2.19.0,R70-PLC,,,messtec102
// 8770,v1.0.1,R70-PLC-EDA,,,messtec102
// 8772,v2.19.0,R72-PLC,,,messtec102
// 8772,v1.0.1,R72-PLC-EDA,,,messtec102
// 8773,v2.19.0,R73-PLC,,,messtec102
// 8773,v1.0.1,R73-PLC-EDA,,,messtec102
// 8774,v2.19.0,R74-PLC,,,messtec102
// 8774,v1.0.1,R74-PLC-EDA,,,messtec102
// 8550,v4.16.0,SP101-EDA,,,messa010ec
// 8555,v2.49.3,SP101-EQPT,MoveAllFiles.Communicating,MoveAllFiles.NotCommunicating,
// 8569,v4.16.0,SPV01-EDA,,,messa010ec
// 8574,v4.16.0,SRP-EDA,,,messa010ec
// 8572,v2.49.2,SRP-EQPT,csv.Communicating,csv.NotCommunicating,mestsa06ec
// 7627,v4.16.0,T27-EDA,,,messa010ec
// 8540,v4.16.0,TENCOR1-EDA,,,messa010ec
// 8541,v4.16.0,TENCOR2-EDA,,,messa010ec
// 8542,v4.16.0,TENCOR3-EDA,,,messa010ec
// Production - Exit
// Cleanup

View File

@ -0,0 +1,131 @@
using Adaptation._Tests.Shared;
using Microsoft.Extensions.Logging;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
namespace Adaptation._Tests.Static;
[TestClass]
public class JPEG : LoggingUnitTesting, IDisposable
{
#pragma warning disable CA2254
#pragma warning disable IDE0060
internal static JPEG LoggingUnitTesting { get; private set; }
public JPEG() : base(testContext: null, declaringType: null)
{
if (LoggingUnitTesting is null)
throw new Exception();
}
public JPEG(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType)
{
}
[ClassInitialize]
public static void ClassInitialize(TestContext testContext) => LoggingUnitTesting ??= new JPEG(testContext);
[ClassCleanup()]
public static void ClassCleanup()
{
LoggingUnitTesting?.Logger?.LogInformation("Cleanup");
LoggingUnitTesting?.Dispose();
}
private static void NonThrowTryCatch()
{
try
{ throw new Exception(); }
catch (Exception) { }
}
#if DEBUG
[Ignore]
#endif
[TestMethod]
public void TestDescriptor()
{
MethodBase methodBase = new StackFrame().GetMethod();
string fileName = "D:/Tmp/phares/R53-EQPT_638005905604624544 - Run Wafer.jpeg";
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
// (float pageMeanConfidence, string text, List<string> blocks) = FileHandlers.jpeg.ProcessData.Parse(fileName, new(), 0, 0, 0, 0, 0, 0);
List<(float pageMeanConfidence, string text, List<string> blocks)> collection = FileHandlers.jpeg.ProcessData.Parse(fileName);
Assert.IsTrue(collection.Count != 0);
foreach ((float pageMeanConfidence, string text, List<string> blocks) in collection)
{
Assert.IsTrue(pageMeanConfidence > 0);
Assert.IsTrue(!string.IsNullOrEmpty(text));
Assert.IsTrue(blocks.Count != 0);
// Normal images
// "RECIPE:\nte end\nte a ee)\nAcne\n"
// Grayscale
// "RECIPE:\nEee en\nRECIPE e943\n\ncera ke\n"
// Grayscale Inverted
// "RECIPE:\nOT6_10PH. 60.3.0\nRECIPE e943\nASgMe\n"
// BW
// "RECIPE\nCTG.}0PH. 60.3.0\nRECIPE #943\nAGM e\n"
}
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
}
#if DEBUG
[Ignore]
#endif
[TestMethod]
public void Production()
{
MethodBase methodBase = new StackFrame().GetMethod();
StringBuilder results = new();
(string cellInstanceName, string cellInstanceVersionName)[] collection = new (string, string)[]
{
new("R34", "v2.59.0"),
new("R53", "v2.59.0"),
new("R55", "v2.59.0"),
new("R34-EQPT", "v2.59.0"),
new("R53-EQPT", "v2.59.0"),
new("R55-EQPT", "v2.59.0"),
};
string production = "http://messa08ec.infineon.com:9003/CellInstanceServiceV2";
Shared.PasteSpecialXml.EAF.XML.API.CellInstance.CellInstanceVersion cellInstanceVersion;
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
foreach ((string cellInstanceName, string cellInstanceVersionName) in collection)
{
cellInstanceVersion = AdaptationTesting.GetCellInstanceVersion($"{production}/{cellInstanceName}/{cellInstanceVersionName}/configuration");
_ = results.AppendLine($"{cellInstanceName}\t{cellInstanceVersionName}\t{cellInstanceVersion.EdaConnection.PortNumber}");
}
string sourceDirectory = "D:/Tmp/cellInstanceVersion.EdaConnection.PortNumber";
if (!Directory.Exists(sourceDirectory))
_ = Directory.CreateDirectory(sourceDirectory);
File.WriteAllText(Path.Combine(sourceDirectory, $"{methodBase.Module.Name}-{methodBase.ReflectedType.Name}-{methodBase.Name}.tsv"), results.ToString());
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
}
[TestMethod]
public void CellInstanceVersionEdaConnectionPortNumber()
{
MethodBase methodBase = new StackFrame().GetMethod();
string sourceDirectory = "D:/Tmp/cellInstanceVersion.EdaConnection.PortNumber";
if (Directory.Exists(sourceDirectory))
{
string destinationDirectory = Path.Combine(sourceDirectory, "All");
if (!Directory.Exists(destinationDirectory))
_ = Directory.CreateDirectory(destinationDirectory);
List<string> lines = new();
string[] files = Directory.GetFiles(sourceDirectory, "*.tsv", SearchOption.TopDirectoryOnly);
foreach (string file in files)
lines.AddRange(File.ReadAllLines(file));
File.WriteAllLines(Path.Combine(destinationDirectory, $"{DateTime.Now.Ticks}.tsv"), lines.Distinct().OrderBy(l => l));
}
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
NonThrowTryCatch();
}
}

View File

@ -0,0 +1,68 @@
using Adaptation._Tests.Shared;
using Microsoft.Extensions.Logging;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Diagnostics;
using System.Reflection;
using System.Text;
namespace Adaptation._Tests.Static;
[TestClass]
public class XML : LoggingUnitTesting, IDisposable
{
#pragma warning disable CA2254
#pragma warning disable IDE0060
internal static XML LoggingUnitTesting { get; private set; }
public XML() : base(testContext: null, declaringType: null)
{
if (LoggingUnitTesting is null)
throw new Exception();
}
public XML(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType)
{ }
[ClassInitialize]
public static void ClassInitialize(TestContext testContext) => LoggingUnitTesting ??= new XML(testContext);
[ClassCleanup()]
public static void ClassCleanup()
{
LoggingUnitTesting?.Logger?.LogInformation("Cleanup");
LoggingUnitTesting?.Dispose();
}
[TestMethod]
public void TestXmlBuild()
{
MethodBase methodBase = new StackFrame().GetMethod();
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
string key;
string value;
int counter = 500;
StringBuilder stringBuilder = new();
string a = "<d2p1:ModelObjectParameterDefinition z:Id=\"i";
string c = "\"><d2p1:EnumType></d2p1:EnumType><d2p1:Id>0</d2p1:Id><d2p1:Name>CellInstance.R";
string f = "</d2p1:Name><d2p1:Value>";
string h = "</d2p1:Value><d2p1:ValueType>String</d2p1:ValueType></d2p1:ModelObjectParameterDefinition>";
int[] reactors = new int[] { 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 68, 70, 72, 73, 74, 75, 77, 79 };
foreach (int reactor in reactors)
{
for (int i = 1; i < 4; i++)
{
counter += 1;
key = i switch { 1 => ".Alias", 2 => "-EQPT.Alias", 3 => "-EQPT.StaticFileServer", _ => throw new Exception() };
value = i switch { 1 or 2 => $"R{reactor}", 3 => "10.95.154.##", _ => throw new Exception() };
_ = stringBuilder.Append(a).Append(counter).Append(c).Append(reactor).Append(key).Append(f).Append(value).AppendLine(h);
}
}
System.IO.File.WriteAllText(@"D:\Tmp\Phares\a.xml", stringBuilder.ToString());
Assert.IsTrue(true);
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
}
}