Compare commits
33 Commits
97d1a1c6a7
...
master
Author | SHA1 | Date | |
---|---|---|---|
552f0137df | |||
538bd194ae | |||
0ed6d17774 | |||
46844029b1 | |||
e81ae34f8f | |||
5a3469baa1 | |||
4d41e545b3 | |||
959bf66fa9 | |||
0788998e09 | |||
ba22cebdf2 | |||
750af1fae8 | |||
1cabd838a1 | |||
d2a14d03f5 | |||
29dd3c3559 | |||
0c786f1f31 | |||
d66314568c | |||
d40127bb44 | |||
8772b20a13 | |||
e45c71f358 | |||
adc995c67d | |||
250c83c10d | |||
9106e32967 | |||
075613bfa0 | |||
d92078a7d9 | |||
3355fb3318 | |||
ae47e7dbd5 | |||
c5e3acc3e4 | |||
2614782d58 | |||
c6782d1cb3 | |||
71753964ac | |||
9d2237a77b | |||
2346f0ba4d | |||
cae44abfee |
16
.gitignore
vendored
16
.gitignore
vendored
@ -331,11 +331,15 @@ ASALocalRun/
|
||||
##
|
||||
## Visual Studio Code
|
||||
##
|
||||
*/!.vscode/extensions.json
|
||||
*/!.vscode/launch.json
|
||||
*/!.vscode/settings.json
|
||||
*/!.vscode/tasks.json
|
||||
*/.vscode/*
|
||||
*/.vscode/ReportGenerator/*
|
||||
**/.vscode/*
|
||||
!**/.vscode/extensions.json
|
||||
!**/.vscode/format-report.json
|
||||
!**/.vscode/launch.json
|
||||
!**/.vscode/settings.json
|
||||
!**/.vscode/tasks.json
|
||||
!**/.vscode/mklink.md
|
||||
|
||||
*.lnk
|
||||
|
||||
.kanbn
|
||||
Adaptation/.kanbn
|
||||
|
55
.vscode/settings.json
vendored
Normal file
55
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
{
|
||||
"files.eol": "\n",
|
||||
"[markdown]": {
|
||||
"editor.wordWrap": "off"
|
||||
},
|
||||
"cSpell.words": [
|
||||
"PDSF",
|
||||
"Syncthing"
|
||||
],
|
||||
"files.exclude": {
|
||||
"**/node_modules": true
|
||||
},
|
||||
"files.watcherExclude": {
|
||||
"**/node_modules": true
|
||||
},
|
||||
"foam.files.ignore": [
|
||||
".foam/**/*",
|
||||
".stfolder/**/*",
|
||||
"**/_layouts/**/*",
|
||||
"**/_site/**/*",
|
||||
"**/.vscode/**/*",
|
||||
"**/node_modules/**/*"
|
||||
],
|
||||
"kanbn.showBurndownButton": false,
|
||||
"kanbn.showSprintButton": false,
|
||||
"foam.links.hover.enable": false,
|
||||
"foam.placeholders.exclude": [
|
||||
".kanbn/Archive/**/*"
|
||||
],
|
||||
"foam.orphans.exclude": [
|
||||
".journal/**/*"
|
||||
],
|
||||
"foam.graph.style": {
|
||||
"background": "#202020",
|
||||
"node": {
|
||||
"wired": "green",
|
||||
"wireless": "orange",
|
||||
"person": "white",
|
||||
"topic": "#bc2a3c",
|
||||
"kanbn": "#ff7b00",
|
||||
"basic-note": "#773b93",
|
||||
"daily-note": "#ff9d00",
|
||||
"note": "#f2cb1d",
|
||||
"placeholder": "#ff9d00",
|
||||
"tag": "#0494c1",
|
||||
"bug": "#bc2a3c",
|
||||
"epic": "#ff7b00",
|
||||
"feature": "#773b93",
|
||||
"issue": "#ff9d00",
|
||||
"task": "#f2cb1d",
|
||||
"test-case": "#ff9d00",
|
||||
"user-story": "#0494c1"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,3 +1,19 @@
|
||||
[*.md]
|
||||
end_of_line = crlf
|
||||
file_header_template = unset
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
insert_final_newline = false
|
||||
root = true
|
||||
tab_width = 2
|
||||
[*.csproj]
|
||||
end_of_line = crlf
|
||||
file_header_template = unset
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
insert_final_newline = false
|
||||
root = true
|
||||
tab_width = 2
|
||||
[*.cs]
|
||||
csharp_indent_block_contents = true
|
||||
csharp_indent_braces = false
|
||||
@ -76,19 +92,38 @@ csharp_using_directive_placement = outside_namespace
|
||||
dotnet_code_quality_unused_parameters = all
|
||||
dotnet_code_quality_unused_parameters = non_public # IDE0060: Remove unused parameter
|
||||
dotnet_code_quality.CAXXXX.api_surface = private, internal
|
||||
dotnet_diagnostic.CA1510.severity = none # CA1510: Use 'ArgumentNullException.ThrowIfNull' instead of explicitly throwing a new exception instance
|
||||
dotnet_diagnostic.CA1816.severity = none # CA1816: Call GC.SuppressFinalize correctly
|
||||
dotnet_diagnostic.CA1825.severity = warning # CA1823: Avoid zero-length array allocations
|
||||
dotnet_diagnostic.CA1825.severity = warning # CA1825: Avoid zero-length array allocations
|
||||
dotnet_diagnostic.CA1829.severity = warning # CA1829: Use Length/Count property instead of Count() when available
|
||||
dotnet_diagnostic.CA1834.severity = warning # CA1834: Consider using 'StringBuilder.Append(char)' when applicable
|
||||
dotnet_diagnostic.CA1846.severity = none # CA1846: Prefer AsSpan over Substring
|
||||
dotnet_diagnostic.CA1847.severity = none # CA1847: Use string.Contains(char) instead of string.Contains(string) with single characters
|
||||
dotnet_diagnostic.CA1854.severity = warning # CA1854: Prefer a 'TryGetValue' call over a Dictionary indexer access guarded by a 'ContainsKey' check to avoid double lookup
|
||||
dotnet_diagnostic.CA1860.severity = error # CA1860: Prefer comparing 'Count' to 0 rather than using 'Any()', both for clarity and for performance
|
||||
dotnet_diagnostic.CA1861.severity = none # CA1861: Prefer 'static readonly' fields over constant array arguments
|
||||
dotnet_diagnostic.CA1862.severity = none # CA1862: Prefer using 'string.Equals(string, StringComparison)' to perform a case-insensitive comparison, but keep in mind that this might cause subtle changes in behavior, so make sure to conduct thorough testing after applying the suggestion, or if culturally sensitive comparison is not required, consider using 'StringComparison.OrdinalIgnoreCase'
|
||||
dotnet_diagnostic.CA1864.severity = none # CA1864: To avoid double lookup, call 'TryAdd' instead of calling 'Add' with a 'ContainsKey' guard
|
||||
dotnet_diagnostic.CA1866.severity = none # CA1866: Use 'string.EndsWith(char)' instead of 'string.EndsWith(string)' when you have a string with a single char
|
||||
dotnet_diagnostic.CA1869.severity = none # CA1869: Avoid creating a new 'JsonSerializerOptions' instance for every serialization operation. Cache and reuse instances instead.
|
||||
dotnet_diagnostic.CA2254.severity = none # CA2254: The logging message template should not vary between calls to 'LoggerExtensions.LogInformation(ILogger, string?, params object?[])'
|
||||
dotnet_diagnostic.IDE0001.severity = warning # IDE0001: Simplify name
|
||||
dotnet_diagnostic.IDE0002.severity = warning # Simplify (member access) - System.Version.Equals("1", "2"); Version.Equals("1", "2");
|
||||
dotnet_diagnostic.IDE0004.severity = warning # IDE0004: Cast is redundant.
|
||||
dotnet_diagnostic.IDE0005.severity = warning # Using directive is unnecessary
|
||||
dotnet_diagnostic.IDE0028.severity = none # IDE0028: Collection initialization can be simplified
|
||||
dotnet_diagnostic.IDE0031.severity = warning # Use null propagation (IDE0031)
|
||||
dotnet_diagnostic.IDE0047.severity = warning # IDE0047: Parentheses can be removed
|
||||
dotnet_diagnostic.IDE0049.severity = warning # Use language keywords instead of framework type names for type references (IDE0049)
|
||||
dotnet_diagnostic.IDE0060.severity = warning # IDE0060: Remove unused parameter
|
||||
dotnet_diagnostic.IDE0200.severity = warning # IDE0200: Lambda expression can be removed
|
||||
dotnet_diagnostic.IDE0270.severity = none # IDE0270: Null check can be simplified
|
||||
dotnet_diagnostic.IDE0290.severity = none # Use primary constructor [Distance]csharp(IDE0290)
|
||||
dotnet_diagnostic.IDE0300.severity = none # IDE0300: Collection initialization can be simplified
|
||||
dotnet_diagnostic.IDE0301.severity = none #IDE0301: Collection initialization can be simplified
|
||||
dotnet_diagnostic.IDE0305.severity = none # IDE0305: Collection initialization can be simplified
|
||||
dotnet_diagnostic.MSTEST0037.severity = error # MSTEST0037: Use proper 'Assert' methods
|
||||
dotnet_diagnostic.SYSLIB1045.severity = none # SYSLIB1045: diagnostics for regex source generation
|
||||
dotnet_naming_rule.abstract_method_should_be_pascal_case.severity = warning
|
||||
dotnet_naming_rule.abstract_method_should_be_pascal_case.style = pascal_case
|
||||
dotnet_naming_rule.abstract_method_should_be_pascal_case.symbols = abstract_method
|
||||
|
7
Adaptation/.kanbn/board.css
Normal file
7
Adaptation/.kanbn/board.css
Normal file
@ -0,0 +1,7 @@
|
||||
.kanbn-task-data-workload {
|
||||
display: none;
|
||||
}
|
||||
.kanbn-task-data-relation {
|
||||
display: block;
|
||||
color: #198038;
|
||||
}
|
7
Adaptation/.kanbn/tasks/public-const-to-eaf.md
Normal file
7
Adaptation/.kanbn/tasks/public-const-to-eaf.md
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
assigned: ""
|
||||
progress: 0
|
||||
type: "note"
|
||||
---
|
||||
|
||||
# public const to EAF
|
2
Adaptation/.vscode/launch.json
vendored
2
Adaptation/.vscode/launch.json
vendored
@ -4,7 +4,7 @@
|
||||
"name": ".NET Core Attach",
|
||||
"type": "coreclr",
|
||||
"request": "attach",
|
||||
"processId": 21276
|
||||
"processId": 8912
|
||||
}
|
||||
]
|
||||
}
|
||||
|
9
Adaptation/.vscode/mklink.md
vendored
Normal file
9
Adaptation/.vscode/mklink.md
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
---
|
||||
type: "note"
|
||||
---
|
||||
|
||||
# mklink
|
||||
|
||||
```bash
|
||||
mklink /J "T:\MET08RESIHGCV\06_SourceCode\MET08RESIHGCV\Adaptation\.kanbn" "D:\5-Other-Small\Kanban\MET08RESIHGCV"
|
||||
```
|
6
Adaptation/.vscode/settings.json
vendored
6
Adaptation/.vscode/settings.json
vendored
@ -1,6 +1,11 @@
|
||||
{
|
||||
"[markdown]": {
|
||||
"editor.wordWrap": "off"
|
||||
},
|
||||
"cSpell.words": [
|
||||
"BIORAD",
|
||||
"CASS",
|
||||
"CEPIEPSILON",
|
||||
"CUST",
|
||||
"DDUPSP",
|
||||
"EQPT",
|
||||
@ -14,6 +19,7 @@
|
||||
"lsid",
|
||||
"messa",
|
||||
"messv",
|
||||
"NETFRAMEWORK",
|
||||
"NOPAUSE",
|
||||
"PDFC",
|
||||
"PDSF",
|
||||
|
140
Adaptation/.vscode/tasks.json
vendored
Normal file
140
Adaptation/.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,140 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "Build",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"build",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Test-Debug",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"test",
|
||||
"-c",
|
||||
"Debug"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Test-Release",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"test",
|
||||
"-c",
|
||||
"Release"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Format",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"format",
|
||||
"--report",
|
||||
".vscode",
|
||||
"--verbosity",
|
||||
"detailed",
|
||||
"--severity",
|
||||
"warn"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Format-Whitespaces",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"format",
|
||||
"whitespace"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Nuget Clear",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"nuget",
|
||||
"locals",
|
||||
"all",
|
||||
"--clear"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "MSBuild for EAF Deployment Packages",
|
||||
"command": "C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"/target:Build",
|
||||
"/restore:True",
|
||||
"/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",
|
||||
"../MET08DDUPSP1TBI.csproj"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Project",
|
||||
"type": "shell",
|
||||
"command": "code ../MET08DDUPSP1TBI.csproj",
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "Readme",
|
||||
"type": "shell",
|
||||
"command": "code ../README.md",
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "File-Folder-Helper AOT s X Day-Helper-2025-03-20",
|
||||
"type": "shell",
|
||||
"command": "L:/DevOps/Mesa_FI/File-Folder-Helper/bin/Release/net8.0/win-x64/publish/File-Folder-Helper.exe",
|
||||
"args": [
|
||||
"s",
|
||||
"X",
|
||||
"L:/DevOps/EAF-Mesa-Integration/met08ddupsp1tbi",
|
||||
"Day-Helper-2025-03-20",
|
||||
"false",
|
||||
"4"
|
||||
],
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "Git Config",
|
||||
"type": "shell",
|
||||
"command": "code ../.git/config",
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "Kanbn Console",
|
||||
"type": "npm",
|
||||
"script": "kanbn.board",
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "Kanbn Write Boad",
|
||||
"type": "shell",
|
||||
"command": "& kanbn board -j | L:/Git/kanbn2md/kanbn2md.exe >.kanbn/board.md",
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "Kanbn Write json",
|
||||
"type": "npm",
|
||||
"script": "kanbn.board.json",
|
||||
"problemMatcher": []
|
||||
}
|
||||
]
|
||||
}
|
@ -14,7 +14,7 @@ namespace Adaptation.FileHandlers.APC;
|
||||
public class FileRead : Shared.FileRead, IFileRead
|
||||
{
|
||||
|
||||
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) :
|
||||
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<Shared.Metrology.WS.Results>> 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;
|
||||
@ -120,15 +120,15 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime dateTime)
|
||||
{
|
||||
Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
|
||||
Tuple<string, string[], string[]> pdsf = ProcessDataStandardFormat.GetLogisticsColumnsAndBody(reportFullPath);
|
||||
_Logistics = new Logistics(reportFullPath, pdsf.Item1);
|
||||
ProcessDataStandardFormat processDataStandardFormat = ProcessDataStandardFormat.GetProcessDataStandardFormat(reportFullPath);
|
||||
_Logistics = new Logistics(reportFullPath, processDataStandardFormat);
|
||||
SetFileParameterLotIDToLogisticsMID();
|
||||
JsonElement[] jsonElements = ProcessDataStandardFormat.GetArray(pdsf);
|
||||
JsonElement[] jsonElements = ProcessDataStandardFormat.GetArray(processDataStandardFormat);
|
||||
List<Shared.Properties.IDescription> descriptions = GetDuplicatorDescriptions(jsonElements);
|
||||
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
|
||||
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
|
||||
FileCopy(reportFullPath, dateTime, descriptions);
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(pdsf.Item1, tests, jsonElements, new List<FileInfo>());
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics[0]), tests, jsonElements, new List<FileInfo>());
|
||||
return results;
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
private readonly string _JobIdParentDirectory;
|
||||
private readonly string _JobIdArchiveParentDirectory;
|
||||
|
||||
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) :
|
||||
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<Shared.Metrology.WS.Results>> 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;
|
||||
@ -115,20 +115,21 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
}
|
||||
}
|
||||
|
||||
#pragma warning disable IDE0060
|
||||
private void MoveArchive(string reportFullPath, DateTime dateTime)
|
||||
#pragma warning restore IDE0060
|
||||
{
|
||||
if (dateTime == DateTime.MinValue)
|
||||
throw new ArgumentNullException(nameof(dateTime));
|
||||
string logisticsSequence = _Logistics.Sequence.ToString();
|
||||
string day = $"{_Logistics.DateTimeFromSequence:yyyy-MM-dd}";
|
||||
string weekOfYear = _Calendar.GetWeekOfYear(_Logistics.DateTimeFromSequence, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00");
|
||||
string weekDirectory = $"{_Logistics.DateTimeFromSequence:yyyy}_Week_{weekOfYear}{@"\"}{_Logistics.DateTimeFromSequence:yyyy-MM-dd}";
|
||||
string destinationArchiveDirectory = Path.Combine(_JobIdArchiveParentDirectory, _Logistics.JobID, weekDirectory);
|
||||
string weekDirectory = $"{_Logistics.DateTimeFromSequence:yyyy}_Week_{weekOfYear}";
|
||||
string destinationArchiveDirectory = Path.Combine(_JobIdArchiveParentDirectory, _Logistics.JobID, weekDirectory, day);
|
||||
if (!Directory.Exists(destinationArchiveDirectory))
|
||||
_ = Directory.CreateDirectory(destinationArchiveDirectory);
|
||||
string jobIdDirectory = Path.Combine(_JobIdParentDirectory, _Logistics.JobID);
|
||||
if (!Directory.Exists(jobIdDirectory))
|
||||
_ = Directory.CreateDirectory(jobIdDirectory);
|
||||
if (!Directory.GetDirectories(jobIdDirectory).Any())
|
||||
if (Directory.GetDirectories(jobIdDirectory).Length == 0)
|
||||
File.Copy(reportFullPath, Path.Combine(destinationArchiveDirectory, Path.GetFileName(reportFullPath)));
|
||||
else
|
||||
{
|
||||
@ -144,15 +145,15 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime dateTime)
|
||||
{
|
||||
Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
|
||||
Tuple<string, string[], string[]> pdsf = ProcessDataStandardFormat.GetLogisticsColumnsAndBody(reportFullPath);
|
||||
_Logistics = new Logistics(reportFullPath, pdsf.Item1);
|
||||
ProcessDataStandardFormat processDataStandardFormat = ProcessDataStandardFormat.GetProcessDataStandardFormat(reportFullPath);
|
||||
_Logistics = new Logistics(reportFullPath, processDataStandardFormat);
|
||||
SetFileParameterLotIDToLogisticsMID();
|
||||
JsonElement[] jsonElements = ProcessDataStandardFormat.GetArray(pdsf);
|
||||
JsonElement[] jsonElements = ProcessDataStandardFormat.GetArray(processDataStandardFormat);
|
||||
List<Shared.Properties.IDescription> descriptions = GetDuplicatorDescriptions(jsonElements);
|
||||
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
|
||||
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
|
||||
MoveArchive(reportFullPath, dateTime);
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(pdsf.Item1, tests, jsonElements, new List<FileInfo>());
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics[0]), tests, jsonElements, new List<FileInfo>());
|
||||
return results;
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@ namespace Adaptation.FileHandlers;
|
||||
public class CellInstanceConnectionName
|
||||
{
|
||||
|
||||
internal static IFileRead Get(ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, 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, int? connectionCount)
|
||||
internal static IFileRead Get(ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, Dictionary<string, List<long>> dummyRuns, Dictionary<long, List<Shared.Metrology.WS.Results>> staticRuns, bool useCyclicalForDescription, int? connectionCount)
|
||||
{
|
||||
IFileRead result = cellInstanceConnectionName switch
|
||||
{
|
||||
|
@ -23,7 +23,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
private int _LastDummyRunIndex;
|
||||
private readonly string[] _CellNames;
|
||||
|
||||
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) :
|
||||
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<Shared.Metrology.WS.Results>> 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;
|
||||
@ -157,7 +157,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
if (!Directory.Exists(inProcessDirectory))
|
||||
_ = Directory.CreateDirectory(inProcessDirectory);
|
||||
files = Directory.GetFiles(inProcessDirectory, "*", SearchOption.AllDirectories);
|
||||
if (files.Any())
|
||||
if (files.Length != 0)
|
||||
{
|
||||
if (files.Length > 250)
|
||||
throw new Exception("Safety net!");
|
||||
|
@ -18,7 +18,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
private string _LastLines;
|
||||
private readonly string _IQSFile;
|
||||
|
||||
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) :
|
||||
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<WS.Results>> 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;
|
||||
@ -111,7 +111,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
|
||||
private void SaveIQSFile(string reportFullPath, DateTime dateTime, List<txt.Description> descriptions, Test[] tests)
|
||||
{
|
||||
if (!tests.Any())
|
||||
if (tests.Length == 0)
|
||||
_LastLines = string.Empty;
|
||||
else
|
||||
{
|
||||
@ -148,17 +148,17 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime dateTime)
|
||||
{
|
||||
Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
|
||||
Tuple<string, string[], string[]> pdsf = ProcessDataStandardFormat.GetLogisticsColumnsAndBody(reportFullPath);
|
||||
_Logistics = new Logistics(reportFullPath, pdsf.Item1);
|
||||
ProcessDataStandardFormat processDataStandardFormat = ProcessDataStandardFormat.GetProcessDataStandardFormat(reportFullPath);
|
||||
_Logistics = new Logistics(reportFullPath, processDataStandardFormat);
|
||||
SetFileParameterLotIDToLogisticsMID();
|
||||
JsonElement[] jsonElements = ProcessDataStandardFormat.GetArray(pdsf);
|
||||
JsonElement[] jsonElements = ProcessDataStandardFormat.GetArray(processDataStandardFormat);
|
||||
List<txt.Description> descriptions = txt.ProcessData.GetDescriptions(jsonElements);
|
||||
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
|
||||
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
|
||||
SaveIQSFile(reportFullPath, dateTime, descriptions, tests);
|
||||
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
|
||||
FileCopy(reportFullPath, dateTime, descriptions);
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(pdsf.Item1, tests, jsonElements, new List<FileInfo>());
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics[0]), tests, jsonElements, new List<FileInfo>());
|
||||
return results;
|
||||
}
|
||||
|
||||
|
@ -1,63 +0,0 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace Adaptation.FileHandlers.MoveAllFiles.ApiController;
|
||||
|
||||
[Route("api/[controller]")]
|
||||
public class BarcodeController : System.Web.Http.ApiController
|
||||
{
|
||||
|
||||
#nullable enable
|
||||
|
||||
#pragma warning disable CA1822
|
||||
public string Get()
|
||||
#pragma warning restore CA1822
|
||||
{
|
||||
string results = "record";
|
||||
return results;
|
||||
}
|
||||
|
||||
private static string? GetJson(System.Net.Http.HttpContent? httpContent)
|
||||
{
|
||||
string? result;
|
||||
if (httpContent is null)
|
||||
result = null;
|
||||
else
|
||||
{
|
||||
Task<string> task = httpContent.ReadAsStringAsync();
|
||||
task.Wait();
|
||||
result = task.Result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private static void Write(string barcodeHostFileShare, string cellInstanceConnectionName, Notification notification)
|
||||
{
|
||||
DateTime dateTime = DateTime.Now;
|
||||
Calendar calendar = new CultureInfo("en-US").Calendar;
|
||||
string weekOfYear = $"{dateTime:yyyy}_Week_{calendar.GetWeekOfYear(dateTime, CalendarWeekRule.FirstDay, DayOfWeek.Sunday):00}";
|
||||
string directory = Path.Combine(barcodeHostFileShare, weekOfYear, dateTime.ToString("yyyy-MM-dd_HH"));
|
||||
if (!Directory.Exists(directory))
|
||||
_ = Directory.CreateDirectory(directory);
|
||||
File.WriteAllText(Path.Combine(directory, $"{cellInstanceConnectionName}.csv"), notification.LastScanServiceResultValue);
|
||||
}
|
||||
|
||||
[Route("{id}")]
|
||||
#pragma warning disable CA1822
|
||||
public void Post(string id)
|
||||
#pragma warning restore CA1822
|
||||
{
|
||||
string? json = GetJson(Request.Content);
|
||||
if (json is not null)
|
||||
{
|
||||
Notification? notification = JsonSerializer.Deserialize<Notification>(json);
|
||||
if (notification is not null)
|
||||
Write(FileRead.BarcodeHostFileShare, id, notification.Value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,277 +0,0 @@
|
||||
namespace Adaptation.FileHandlers.MoveAllFiles.ApiController;
|
||||
|
||||
/// <summary>
|
||||
/// Mapping for this can be found here: https://github.com/torvalds/linux/blob/master/include/uapi/linux/input-event-codes.h
|
||||
/// </summary>
|
||||
public enum EventCode
|
||||
{
|
||||
Reserved = 0,
|
||||
Esc = 1,
|
||||
Num1 = 2,
|
||||
Num2 = 3,
|
||||
Num3 = 4,
|
||||
Num4 = 5,
|
||||
Num5 = 6,
|
||||
Num6 = 7,
|
||||
Num7 = 8,
|
||||
Num8 = 9,
|
||||
Num9 = 10,
|
||||
Num0 = 11,
|
||||
Minus = 12,
|
||||
Equal = 13,
|
||||
Backspace = 14,
|
||||
Tab = 15,
|
||||
Q = 16,
|
||||
W = 17,
|
||||
E = 18,
|
||||
R = 19,
|
||||
T = 20,
|
||||
Y = 21,
|
||||
U = 22,
|
||||
I = 23,
|
||||
O = 24,
|
||||
P = 25,
|
||||
LeftBrace = 26,
|
||||
RightBrace = 27,
|
||||
Enter = 28,
|
||||
LeftCtrl = 29,
|
||||
A = 30,
|
||||
S = 31,
|
||||
D = 32,
|
||||
F = 33,
|
||||
G = 34,
|
||||
H = 35,
|
||||
J = 36,
|
||||
K = 37,
|
||||
L = 38,
|
||||
Semicolon = 39,
|
||||
Apostrophe = 40,
|
||||
Grave = 41,
|
||||
LeftShift = 42,
|
||||
Backslash = 43,
|
||||
Z = 44,
|
||||
X = 45,
|
||||
C = 46,
|
||||
V = 47,
|
||||
B = 48,
|
||||
N = 49,
|
||||
M = 50,
|
||||
Comma = 51,
|
||||
Dot = 52,
|
||||
Slash = 53,
|
||||
RightShift = 54,
|
||||
KpAsterisk = 55,
|
||||
LeftAlt = 56,
|
||||
Space = 57,
|
||||
Capslock = 58,
|
||||
F1 = 59,
|
||||
Pf2 = 60,
|
||||
F3 = 61,
|
||||
F4 = 62,
|
||||
F5 = 63,
|
||||
F6 = 64,
|
||||
F7 = 65,
|
||||
F8 = 66,
|
||||
Pf9 = 67,
|
||||
F10 = 68,
|
||||
Numlock = 69,
|
||||
ScrollLock = 70,
|
||||
Kp7 = 71,
|
||||
Kp8 = 72,
|
||||
Kp9 = 73,
|
||||
PkpMinus = 74,
|
||||
Kp4 = 75,
|
||||
Kp5 = 76,
|
||||
Kp6 = 77,
|
||||
KpPlus = 78,
|
||||
Kp1 = 79,
|
||||
Kp2 = 80,
|
||||
Kp3 = 81,
|
||||
Kp0 = 82,
|
||||
KpDot = 83,
|
||||
|
||||
Zenkakuhankaku = 85,
|
||||
//102ND = 86,
|
||||
F11 = 87,
|
||||
F12 = 88,
|
||||
Ro = 89,
|
||||
Katakana = 90,
|
||||
Hiragana = 91,
|
||||
Henkan = 92,
|
||||
Katakanahiragana = 93,
|
||||
Muhenkan = 94,
|
||||
KpJpComma = 95,
|
||||
KpEnter = 96,
|
||||
RightCtrl = 97,
|
||||
KpSlash = 98,
|
||||
SysRq = 99,
|
||||
RightAlt = 100,
|
||||
LineFeed = 101,
|
||||
Home = 102,
|
||||
Up = 103,
|
||||
Pageup = 104,
|
||||
Left = 105,
|
||||
Right = 106,
|
||||
End = 107,
|
||||
Down = 108,
|
||||
Pagedown = 109,
|
||||
Insert = 110,
|
||||
Delete = 111,
|
||||
Macro = 112,
|
||||
Mute = 113,
|
||||
VolumeDown = 114,
|
||||
VolumeUp = 115,
|
||||
Power = 116, // SC System Power Down
|
||||
KpEqual = 117,
|
||||
KpPlusMinus = 118,
|
||||
Pause = 119,
|
||||
Scale = 120, // AL Compiz Scale (Expose)
|
||||
|
||||
KpComma = 121,
|
||||
Hangeul = 122,
|
||||
Hanja = 123,
|
||||
Yen = 124,
|
||||
LeftMeta = 125,
|
||||
RightMeta = 126,
|
||||
Compose = 127,
|
||||
|
||||
Stop = 128, // AC Stop
|
||||
Again = 129,
|
||||
Props = 130, // AC Properties
|
||||
Undo = 131, // AC Undo
|
||||
Front = 132,
|
||||
Copy = 133, // AC Copy
|
||||
Open = 134, // AC Open
|
||||
Paste = 135, // AC Paste
|
||||
Find = 136, // AC Search
|
||||
Cut = 137, // AC Cut
|
||||
Help = 138, // AL Integrated Help Center
|
||||
Menu = 139, // Menu (show menu)
|
||||
Calc = 140, // AL Calculator
|
||||
Setup = 141,
|
||||
Sleep = 142, // SC System Sleep
|
||||
Wakeup = 143, // System Wake Up
|
||||
File = 144, // AL Local Machine Browser
|
||||
Sendfile = 145,
|
||||
DeleteFile = 146,
|
||||
Xfer = 147,
|
||||
Prog1 = 148,
|
||||
Prog2 = 149,
|
||||
Www = 150, // AL Internet Browser
|
||||
MsDos = 151,
|
||||
Coffee = 152, // AL Terminal Lock/Screensaver
|
||||
RotateDisplay = 153, // Display orientation for e.g. tablets
|
||||
CycleWindows = 154,
|
||||
Mail = 155,
|
||||
Bookmarks = 156, // AC Bookmarks
|
||||
Computer = 157,
|
||||
Back = 158, // AC Back
|
||||
Forward = 159, // AC Forward
|
||||
CloseCd = 160,
|
||||
EjectCd = 161,
|
||||
EjectCloseCd = 162,
|
||||
NextSong = 163,
|
||||
PlayPause = 164,
|
||||
PreviousSong = 165,
|
||||
StopCd = 166,
|
||||
Record = 167,
|
||||
Rewind = 168,
|
||||
Phone = 169, // Media Select Telephone
|
||||
Iso = 170,
|
||||
Config = 171, // AL Consumer Control Configuration
|
||||
Homepage = 172, // AC Home
|
||||
Refresh = 173, // AC Refresh
|
||||
Exit = 174, // AC Exit
|
||||
Move = 175,
|
||||
Edit = 176,
|
||||
ScrollUp = 177,
|
||||
ScrollDown = 178,
|
||||
KpLeftParen = 179,
|
||||
KpRightParen = 180,
|
||||
New = 181, // AC New
|
||||
Redo = 182, // AC Redo/Repeat
|
||||
|
||||
F13 = 183,
|
||||
F14 = 184,
|
||||
F15 = 185,
|
||||
F16 = 186,
|
||||
F17 = 187,
|
||||
F18 = 188,
|
||||
F19 = 189,
|
||||
F20 = 190,
|
||||
F21 = 191,
|
||||
F22 = 192,
|
||||
F23 = 193,
|
||||
F24 = 194,
|
||||
|
||||
PlayCd = 200,
|
||||
PauseCd = 201,
|
||||
Prog3 = 202,
|
||||
Prog4 = 203,
|
||||
Dashboard = 204, // AL Dashboard
|
||||
Suspend = 205,
|
||||
Close = 206, // AC Close
|
||||
Play = 207,
|
||||
FastForward = 208,
|
||||
BassBoost = 209,
|
||||
Print = 210, // AC Print
|
||||
Hp = 211,
|
||||
Camera = 212,
|
||||
Sound = 213,
|
||||
Question = 214,
|
||||
Email = 215,
|
||||
Chat = 216,
|
||||
Search = 217,
|
||||
Connect = 218,
|
||||
Finance = 219, // AL Checkbook/Finance
|
||||
Sport = 220,
|
||||
Shop = 221,
|
||||
AltErase = 222,
|
||||
Cancel = 223, // AC Cancel
|
||||
BrightnessDown = 224,
|
||||
BrightnessUp = 225,
|
||||
Media = 226,
|
||||
|
||||
SwitchVideoMode = 227, // Cycle between available video outputs (Monitor/LCD/TV-out/etc)
|
||||
KbdIllumToggle = 228,
|
||||
KbdIllumDown = 229,
|
||||
KbdIllumUp = 230,
|
||||
|
||||
Send = 231, // AC Send
|
||||
Reply = 232, // AC Reply
|
||||
ForwardMail = 233, // AC Forward Msg
|
||||
Save = 234, // AC Save
|
||||
Documents = 235,
|
||||
|
||||
Battery = 236,
|
||||
|
||||
Bluetooth = 237,
|
||||
Wlan = 238,
|
||||
Uwb = 239,
|
||||
|
||||
Unknown = 240,
|
||||
|
||||
VideoNext = 241, // drive next video source
|
||||
VideoPrev = 242, // drive previous video source
|
||||
BrightnessCycle = 243, // brightness up, after max is min
|
||||
BrightnessAuto = 244, // Set Auto Brightness: manual brightness control is off, rely on ambient
|
||||
DisplayOff = 245, // display device to off state
|
||||
|
||||
Wwan = 246, // Wireless WAN (LTE, UMTS, GSM, etc.)
|
||||
RfKill = 247, // Key that controls all radios
|
||||
|
||||
MicMute = 248, // Mute / unmute the microphone
|
||||
LeftMouse = 272,
|
||||
RightMouse = 273,
|
||||
MiddleMouse = 274,
|
||||
MouseBack = 275,
|
||||
MouseForward = 276,
|
||||
|
||||
ToolFinger = 325,
|
||||
ToolQuintTap = 328,
|
||||
Touch = 330,
|
||||
ToolDoubleTap = 333,
|
||||
ToolTripleTap = 334,
|
||||
ToolQuadTap = 335,
|
||||
Mic = 582
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Adaptation.FileHandlers.MoveAllFiles.ApiController;
|
||||
|
||||
public readonly struct KeyPressEvent
|
||||
{
|
||||
public DateTime DateTime { get; }
|
||||
public EventCode EventCode { get; }
|
||||
public KeyState KeyState { get; }
|
||||
public TimeSpan TimeSpan { get; }
|
||||
|
||||
public KeyPressEvent(DateTime dateTime, EventCode eventCode, KeyState keyState, TimeSpan timeSpan)
|
||||
{
|
||||
DateTime = dateTime;
|
||||
EventCode = eventCode;
|
||||
KeyState = keyState;
|
||||
TimeSpan = timeSpan;
|
||||
}
|
||||
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
namespace Adaptation.FileHandlers.MoveAllFiles.ApiController;
|
||||
|
||||
public enum KeyState
|
||||
{
|
||||
KeyUp,
|
||||
KeyDown,
|
||||
KeyHold
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
namespace Adaptation.FileHandlers.MoveAllFiles.ApiController;
|
||||
|
||||
public readonly struct Notification
|
||||
{
|
||||
public KeyPressEvent KeyPressEvent { get; }
|
||||
public string LastScanServiceResultValue { get; }
|
||||
|
||||
[System.Text.Json.Serialization.JsonConstructor]
|
||||
public Notification(KeyPressEvent keyPressEvent, string lastScanServiceResultValue)
|
||||
{
|
||||
KeyPressEvent = keyPressEvent;
|
||||
LastScanServiceResultValue = lastScanServiceResultValue;
|
||||
}
|
||||
|
||||
}
|
@ -7,8 +7,6 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.SelfHost;
|
||||
|
||||
namespace Adaptation.FileHandlers.MoveAllFiles;
|
||||
|
||||
@ -18,11 +16,8 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
#nullable enable
|
||||
|
||||
private long? _TickOffset;
|
||||
private readonly HttpSelfHostServer? _HttpSelfHostServer;
|
||||
|
||||
public const string BarcodeHostFileShare = @"\\messv02ecc1.ec.local\EC_Metrology_Si\BarcodeHost\API"; // GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "BarcodeHost.FileShare");
|
||||
|
||||
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) :
|
||||
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<Shared.Metrology.WS.Results>> 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;
|
||||
@ -34,18 +29,6 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
throw new Exception(cellInstanceConnectionName);
|
||||
if (_IsDuplicator)
|
||||
throw new Exception(cellInstanceConnectionName);
|
||||
if (!_IsEAFHosted)
|
||||
_HttpSelfHostServer = null;
|
||||
else
|
||||
{
|
||||
// string propertyName = string.Concat("CellInstance.", cellInstanceName, ".HttpSelfHostConfiguration.BaseAddress");
|
||||
// string httpSelfHostConfigurationBaseAddress = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, propertyName);
|
||||
string httpSelfHostConfigurationBaseAddress = "http://localhost:8080/";
|
||||
HttpSelfHostConfiguration config = new(httpSelfHostConfigurationBaseAddress);
|
||||
_ = config.Routes.MapHttpRoute("API Default", "api/{controller}/{id}", new { id = RouteParameter.Optional });
|
||||
_HttpSelfHostServer = new(config);
|
||||
_HttpSelfHostServer.OpenAsync().Wait();
|
||||
}
|
||||
}
|
||||
|
||||
#nullable disable
|
||||
@ -117,11 +100,12 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
|
||||
private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime dateTime)
|
||||
{
|
||||
if (dateTime == DateTime.MinValue)
|
||||
throw new ArgumentNullException(nameof(dateTime));
|
||||
Tuple<string, Test[], JsonElement[], List<FileInfo>> results = new(string.Empty, null, null, new List<FileInfo>());
|
||||
_TickOffset ??= new FileInfo(reportFullPath).LastWriteTime.Ticks - dateTime.Ticks;
|
||||
_TickOffset ??= 0; // new FileInfo(reportFullPath).LastWriteTime.Ticks - dateTime.Ticks;
|
||||
_Logistics = new Logistics(this, _TickOffset.Value, reportFullPath, useSplitForMID: true);
|
||||
SetFileParameterLotIDToLogisticsMID();
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@ 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;
|
||||
@ -13,10 +14,66 @@ using System.Threading;
|
||||
|
||||
namespace Adaptation.FileHandlers.MoveMatchingFiles;
|
||||
|
||||
#nullable enable
|
||||
|
||||
public class FileRead : Shared.FileRead, IFileRead
|
||||
{
|
||||
|
||||
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) :
|
||||
internal class PreWith
|
||||
{
|
||||
|
||||
internal string ErrFile { get; private set; }
|
||||
internal string CheckFile { get; private set; }
|
||||
internal string MatchingFile { get; private set; }
|
||||
internal string CheckDirectory { get; private set; }
|
||||
internal string NoWaitDirectory { get; private set; }
|
||||
|
||||
internal PreWith(string checkDirectory,
|
||||
string checkFile,
|
||||
string errFile,
|
||||
string matchingFile,
|
||||
string noWaitDirectory)
|
||||
{
|
||||
ErrFile = errFile;
|
||||
CheckFile = checkFile;
|
||||
MatchingFile = matchingFile;
|
||||
CheckDirectory = checkDirectory;
|
||||
NoWaitDirectory = noWaitDirectory;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
internal class Pre
|
||||
{
|
||||
|
||||
internal string MatchingFile { get; private set; }
|
||||
internal string CheckFile { get; private set; }
|
||||
|
||||
internal Pre(string matchingFile, string checkFile)
|
||||
{
|
||||
MatchingFile = matchingFile;
|
||||
CheckFile = checkFile;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
internal class Post
|
||||
{
|
||||
|
||||
internal string ErrFile { get; private set; }
|
||||
internal string CheckFile { get; private set; }
|
||||
|
||||
internal Post(string checkFile, string errFile)
|
||||
{
|
||||
ErrFile = errFile;
|
||||
CheckFile = checkFile;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private readonly ProcessDataStandardFormatMapping _ProcessDataStandardFormatMapping;
|
||||
|
||||
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<Shared.Metrology.WS.Results>> 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;
|
||||
@ -28,6 +85,12 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
throw new Exception(cellInstanceConnectionName);
|
||||
if (!_IsDuplicator)
|
||||
throw new Exception(cellInstanceConnectionName);
|
||||
string processDataStandardFormatMappingOldColumnNames = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "Process.Data.Standard.Format.Mapping.Old.Column.Names");
|
||||
string processDataStandardFormatMappingNewColumnNames = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "Process.Data.Standard.Format.Mapping.New.Column.Names");
|
||||
string processDataStandardFormatMappingColumnIndices = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "Process.Data.Standard.Format.Mapping.Column.Indices");
|
||||
_ProcessDataStandardFormatMapping = GetProcessDataStandardFormatMapping(processDataStandardFormatMappingOldColumnNames,
|
||||
processDataStandardFormatMappingNewColumnNames,
|
||||
processDataStandardFormatMappingColumnIndices);
|
||||
}
|
||||
|
||||
void IFileRead.Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, Exception exception)
|
||||
@ -42,7 +105,8 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
Move(extractResults);
|
||||
}
|
||||
|
||||
void IFileRead.WaitForThread() => WaitForThread(thread: null, threadExceptions: null);
|
||||
void IFileRead.WaitForThread() =>
|
||||
WaitForThread(thread: null, threadExceptions: null);
|
||||
|
||||
string IFileRead.GetEventDescription()
|
||||
{
|
||||
@ -89,7 +153,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
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);
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(results.Item1, Array.Empty<Test>(), JsonSerializer.Deserialize<JsonElement[]>("[]") ?? throw new Exception(), results.Item4);
|
||||
if (results.Item3.Length > 0 && _IsEAFHosted)
|
||||
WritePDSF(this, results.Item3);
|
||||
UpdateLastTicksDuration(DateTime.Now.Ticks - dateTime.Ticks);
|
||||
@ -105,7 +169,73 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
return results;
|
||||
}
|
||||
|
||||
private static List<string> GetSearchDirectories(int numberLength, string parentDirectory)
|
||||
private static ProcessDataStandardFormatMapping GetProcessDataStandardFormatMapping(string processDataStandardFormatMappingOldColumnNames, string processDataStandardFormatMappingNewColumnNames, string processDataStandardFormatMappingColumnIndices)
|
||||
{
|
||||
ProcessDataStandardFormatMapping result;
|
||||
string[] segmentsB;
|
||||
List<string> distinct = new();
|
||||
Dictionary<string, string> keyValuePairs = new();
|
||||
string args4 = "Time,HeaderUniqueId,UniqueId,Date,SP101";
|
||||
string args5 = ",SP101";
|
||||
string args6 = ",SP101";
|
||||
string args7 = "Test|EventId,Recipe|Session,|SP101";
|
||||
// string args8 = "Time,A_LOGISTICS,B_LOGISTICS,Test,Count,Index,MesEntity,Date,Employee,Lot,PSN,Reactor,Recipe,Grade,HeaderUniqueId,RDS,Session,Side,SrcDest,UniqueId,WaferID,DcnAllMax,DcnAllMean,DcnAllMin,DcnAllStdDev,DcnAreaCountMax,DcnAreaCountMean,DcnAreaCountMin,DcnAreaCountStdDev,DcnAreaMax,DcnAreaMean,DcnAreaMin,DcnAreaStdDev,DcnBin1Max,DcnBin1Mean,DcnBin1Min,DcnBin1StdDev,DcnBin2Max,DcnBin2Mean,DcnBin2Min,DcnBin2StdDev,DcnBin3Max,DcnBin3Mean,DcnBin3Min,DcnBin3StdDev,DcnBin4Max,DcnBin4Mean,DcnBin4Min,DcnBin4StdDev,DcnBin5Max,DcnBin5Mean,DcnBin5Min,DcnBin5StdDev,DcnBin6Max,DcnBin6Mean,DcnBin6Min,DcnBin6StdDev,DcnBin7Max,DcnBin7Mean,DcnBin7Min,DcnBin7StdDev,DcnBin8Max,DcnBin8Mean,DcnBin8Min,DcnBin8StdDev,DcnHazeAvgMax,DcnHazeAvgMean,DcnHazeAvgMin,DcnHazeAvgStdDev,DcnHazeMedianMax,DcnHazeMedianMean,DcnHazeMedianMin,DcnHazeMedianStdDev,DcnHazeStdDevMax,DcnHazeStdDevMean,DcnHazeStdDevMin,DcnHazeStdDevStdDev,DcnLpdESMax,DcnLpdESMean,DcnLpdESMin,DcnLpdESStdDev,DcnLpdMax,DcnLpdMean,DcnLpdMin,DcnLpdNMax,DcnLpdNMean,DcnLpdNMin,DcnLpdNStdDev,DcnLpdStdDev,DcnMicroScrMax,DcnMicroScrMean,DcnMicroScrMin,DcnMicroScrStdDev,DcnScrMax,DcnScrMean,DcnScrMin,DcnScrStdDev,DcnSlipMax,DcnSlipMean,DcnSlipMin,DcnSlipStdDev,DnnAllMax,DnnAllMean,DnnAllMin,DnnAllStdDev,DnnAreaCountMax,DnnAreaCountMean,DnnAreaCountMin,DnnAreaCountStdDev,DnnAreaMax,DnnAreaMean,DnnAreaMin,DnnAreaStdDev,DnnBin1Max,DnnBin1Mean,DnnBin1Min,DnnBin1StdDev,DnnBin2Max,DnnBin2Mean,DnnBin2Min,DnnBin2StdDev,DnnBin3Max,DnnBin3Mean,DnnBin3Min,DnnBin3StdDev,DnnBin4Max,DnnBin4Mean,DnnBin4Min,DnnBin4StdDev,DnnBin5Max,DnnBin5Mean,DnnBin5Min,DnnBin5StdDev,DnnBin6Max,DnnBin6Mean,DnnBin6Min,DnnBin6StdDev,DnnBin7Max,DnnBin7Mean,DnnBin7Min,DnnBin7StdDev,DnnBin8Max,DnnBin8Mean,DnnBin8Min,DnnBin8StdDev,DnnHazeAvgMax,DnnHazeAvgMean,DnnHazeAvgMin,DnnHazeAvgStdDev,DnnHazeMedianMax,DnnHazeMedianMean,DnnHazeMedianMin,DnnHazeMedianStdDev,DnnHazeStdDevMax,DnnHazeStdDevMean,DnnHazeStdDevMin,DnnHazeStdDevStdDev,DnnLpdESMax,DnnLpdESMean,DnnLpdESMin,DnnLpdESStdDev,DnnLpdMax,DnnLpdMean,DnnLpdMin,DnnLpdNMax,DnnLpdNMean,DnnLpdNMin,DnnLpdNStdDev,DnnLpdStdDev,DnnMicroScrMax,DnnMicroScrMean,DnnMicroScrMin,DnnMicroScrStdDev,DnnScrMax,DnnScrMean,DnnScrMin,DnnScrStdDev,DnnSlipMax,DnnSlipMean,DnnSlipMin,DnnSlipStdDev,DwnAllMax,DwnAllMean,DwnAllMin,DwnAllStdDev,DwnAreaCountMax,DwnAreaCountMean,DwnAreaCountMin,DwnAreaCountStdDev,DwnAreaMax,DwnAreaMean,DwnAreaMin,DwnAreaStdDev,DwnBin1Max,DwnBin1Mean,DwnBin1Min,DwnBin1StdDev,DwnBin2Max,DwnBin2Mean,DwnBin2Min,DwnBin2StdDev,DwnBin3Max,DwnBin3Mean,DwnBin3Min,DwnBin3StdDev,DwnBin4Max,DwnBin4Mean,DwnBin4Min,DwnBin4StdDev,DwnBin5Max,DwnBin5Mean,DwnBin5Min,DwnBin5StdDev,DwnBin6Max,DwnBin6Mean,DwnBin6Min,DwnBin6StdDev,DwnBin7Max,DwnBin7Mean,DwnBin7Min,DwnBin7StdDev,DwnBin8Max,DwnBin8Mean,DwnBin8Min,DwnBin8StdDev,DwnHazeAvgMax,DwnHazeAvgMean,DwnHazeAvgMin,DwnHazeAvgStdDev,DwnHazeMedianMax,DwnHazeMedianMean,DwnHazeMedianMin,DwnHazeMedianStdDev,DwnHazeStdDevMax,DwnHazeStdDevMean,DwnHazeStdDevMin,DwnHazeStdDevStdDev,DwnLpdESMax,DwnLpdESMean,DwnLpdESMin,DwnLpdESStdDev,DwnLpdMax,DwnLpdMean,DwnLpdMin,DwnLpdNMax,DwnLpdNMean,DwnLpdNMin,DwnLpdNStdDev,DwnLpdStdDev,DwnMicroScrMax,DwnMicroScrMean,DwnMicroScrMin,DwnMicroScrStdDev,DwnScrMax,DwnScrMean,DwnScrMin,DwnScrStdDev,DwnSlipMax,DwnSlipMean,DwnSlipMin,DwnSlipStdDev,DcnAll,DcnArea,DcnAreaCount,DcnBin1,DcnBin2,DcnBin3,DcnBin4,DcnBin5,DcnBin6,DcnBin7,DcnBin8,DcnHazeAvg,DcnHazeMedian,DcnHazeStdDev,DcnLpd,DcnLpdES,DcnLpdN,DcnMicroScr,DcnScr,DcnSlip,DnnAll,DnnArea,DnnAreaCount,DnnBin1,DnnBin2,DnnBin3,DnnBin4,DnnBin5,DnnBin6,DnnBin7,DnnBin8,DnnHazeAvg,DnnHazeMedian,DnnHazeStdDev,DnnLpd,DnnLpdES,DnnLpdN,DnnMicroScr,DnnScr,DnnSlip,DwnAll,DwnArea,DwnAreaCount,DwnBin1,DwnBin2,DwnBin3,DwnBin4,DwnBin5,DwnBin6,DwnBin7,DwnBin8,DwnHazeAvg,DwnHazeMedian,DwnHazeStdDev,DwnLpd,DwnLpdES,DwnLpdN,DwnMicroScr,DwnScr,DwnSlip";
|
||||
// string args9 = "Time,A_LOGISTICS,B_LOGISTICS,Count,Sequence,MesEntity,Index,Lot,Session,DcnAllMin,DcnLpdMin,DcnLpdNMin,DcnLpdESMin,DcnMicroScrMin,DcnScrMin,DcnSlipMin,DcnAreaCountMin,DcnAreaMin,DcnHazeAvgMin,DcnHazeMedianMin,DcnHazeStdDevMin,DcnBin1Min,DcnBin2Min,DcnBin3Min,DcnBin4Min,DcnBin5Min,DcnBin6Min,DcnBin7Min,DcnBin8Min,DcnAllMax,DcnLpdMax,DcnLpdNMax,DcnLpdESMax,DcnMicroScrMax,DcnScrMax,DcnSlipMax,DcnAreaCountMax,DcnAreaMax,DcnHazeAvgMax,DcnHazeMedianMax,DcnHazeStdDevMax,DcnBin1Max,DcnBin2Max,DcnBin3Max,DcnBin4Max,DcnBin5Max,DcnBin6Max,DcnBin7Max,DcnBin8Max,DcnAllMean,DcnLpdMean,DcnLpdNMean,DcnLpdESMean,DcnMicroScrMean,DcnScrMean,DcnSlipMean,DcnAreaCountMean,DcnAreaMean,DcnHazeAvgMean,DcnHazeMedianMean,DcnHazeStdDevMean,DcnBin1Mean,DcnBin2Mean,DcnBin3Mean,DcnBin4Mean,DcnBin5Mean,DcnBin6Mean,DcnBin7Mean,DcnBin8Mean,DcnAllStdDev,DcnLpdStdDev,DcnLpdNStdDev,DcnLpdESStdDev,DcnMicroScrStdDev,DcnScrStdDev,DcnSlipStdDev,DcnAreaCountStdDev,DcnAreaStdDev,DcnHazeAvgStdDev,DcnHazeMedianStdDev,DcnHazeStdDevStdDev,DcnBin1StdDev,DcnBin2StdDev,DcnBin3StdDev,DcnBin4StdDev,DcnBin5StdDev,DcnBin6StdDev,DcnBin7StdDev,DcnBin8StdDev,DwnAllMin,DwnLpdMin,DwnLpdNMin,DwnLpdESMin,DwnMicroScrMin,DwnScrMin,DwnSlipMin,DwnAreaCountMin,DwnAreaMin,DwnHazeAvgMin,DwnHazeMedianMin,DwnHazeStdDevMin,DwnBin1Min,DwnBin2Min,DwnBin3Min,DwnBin4Min,DwnBin5Min,DwnBin6Min,DwnBin7Min,DwnBin8Min,DwnAllMax,DwnLpdMax,DwnLpdNMax,DwnLpdESMax,DwnMicroScrMax,DwnScrMax,DwnSlipMax,DwnAreaCountMax,DwnAreaMax,DwnHazeAvgMax,DwnHazeMedianMax,DwnHazeStdDevMax,DwnBin1Max,DwnBin2Max,DwnBin3Max,DwnBin4Max,DwnBin5Max,DwnBin6Max,DwnBin7Max,DwnBin8Max,DwnAllMean,DwnLpdMean,DwnLpdNMean,DwnLpdESMean,DwnMicroScrMean,DwnScrMean,DwnSlipMean,DwnAreaCountMean,DwnAreaMean,DwnHazeAvgMean,DwnHazeMedianMean,DwnHazeStdDevMean,DwnBin1Mean,DwnBin2Mean,DwnBin3Mean,DwnBin4Mean,DwnBin5Mean,DwnBin6Mean,DwnBin7Mean,DwnBin8Mean,DwnAllStdDev,DwnLpdStdDev,DwnLpdNStdDev,DwnLpdESStdDev,DwnMicroScrStdDev,DwnScrStdDev,DwnSlipStdDev,DwnAreaCountStdDev,DwnAreaStdDev,DwnHazeAvgStdDev,DwnHazeMedianStdDev,DwnHazeStdDevStdDev,DwnBin1StdDev,DwnBin2StdDev,DwnBin3StdDev,DwnBin4StdDev,DwnBin5StdDev,DwnBin6StdDev,DwnBin7StdDev,DwnBin8StdDev,DnnAllMin,DnnLpdMin,DnnLpdNMin,DnnLpdESMin,DnnMicroScrMin,DnnScrMin,DnnSlipMin,DnnAreaCountMin,DnnAreaMin,DnnHazeAvgMin,DnnHazeMedianMin,DnnHazeStdDevMin,DnnBin1Min,DnnBin2Min,DnnBin3Min,DnnBin4Min,DnnBin5Min,DnnBin6Min,DnnBin7Min,DnnBin8Min,DnnAllMax,DnnLpdMax,DnnLpdNMax,DnnLpdESMax,DnnMicroScrMax,DnnScrMax,DnnSlipMax,DnnAreaCountMax,DnnAreaMax,DnnHazeAvgMax,DnnHazeMedianMax,DnnHazeStdDevMax,DnnBin1Max,DnnBin2Max,DnnBin3Max,DnnBin4Max,DnnBin5Max,DnnBin6Max,DnnBin7Max,DnnBin8Max,DnnAllMean,DnnLpdMean,DnnLpdNMean,DnnLpdESMean,DnnMicroScrMean,DnnScrMean,DnnSlipMean,DnnAreaCountMean,DnnAreaMean,DnnHazeAvgMean,DnnHazeMedianMean,DnnHazeStdDevMean,DnnBin1Mean,DnnBin2Mean,DnnBin3Mean,DnnBin4Mean,DnnBin5Mean,DnnBin6Mean,DnnBin7Mean,DnnBin8Mean,DnnAllStdDev,DnnLpdStdDev,DnnLpdNStdDev,DnnLpdESStdDev,DnnMicroScrStdDev,DnnScrStdDev,DnnSlipStdDev,DnnAreaCountStdDev,DnnAreaStdDev,DnnHazeAvgStdDev,DnnHazeMedianStdDev,DnnHazeStdDevStdDev,DnnBin1StdDev,DnnBin2StdDev,DnnBin3StdDev,DnnBin4StdDev,DnnBin5StdDev,DnnBin6StdDev,DnnBin7StdDev,DnnBin8StdDev,Side,WaferID,Grade,SrcDest,DcnAll,DcnLpd,DcnLpdN,DcnLpdES,DcnMicroScr,DcnScr,DcnSlip,DcnAreaCount,DcnArea,DcnHazeAvg,DcnHazeMedian,DcnHazeStdDev,DcnBin1,DcnBin2,DcnBin3,DcnBin4,DcnBin5,DcnBin6,DcnBin7,DcnBin8,DwnAll,DwnLpd,DwnLpdN,DwnLpdES,DwnMicroScr,DwnScr,DwnSlip,DwnAreaCount,DwnArea,DwnHazeAvg,DwnHazeMedian,DwnHazeStdDev,DwnBin1,DwnBin2,DwnBin3,DwnBin4,DwnBin5,DwnBin6,DwnBin7,DwnBin8,DnnAll,DnnLpd,DnnLpdN,DnnLpdES,DnnMicroScr,DnnScr,DnnSlip,DnnAreaCount,DnnArea,DnnHazeAvg,DnnHazeMedian,DnnHazeStdDev,DnnBin1,DnnBin2,DnnBin3,DnnBin4,DnnBin5,DnnBin6,DnnBin7,DnnBin8,RDS,PSN,Reactor,Layer,Zone,Employee,InferredLot,Date,EventId";
|
||||
// string args10 = "0,1,2,319,3,6,5,320,318,7,314,315,8,251,-1,313,8,249,252,-1,250,29,49,9,69,36,56,16,76,37,57,17,77,41,61,21,81,42,62,22,82,43,63,23,83,44,64,24,84,45,65,25,85,46,66,26,86,47,67,27,87,48,68,28,88,38,58,18,78,39,59,19,79,40,60,20,80,32,52,12,72,30,50,10,31,51,11,71,70,33,53,13,73,34,54,14,74,35,55,15,75,189,209,169,229,196,216,176,236,197,217,177,237,201,221,181,241,202,222,182,242,203,223,183,243,204,224,184,244,205,225,185,245,206,226,186,246,207,227,187,247,208,228,188,248,198,218,178,238,199,219,179,239,200,220,180,240,192,212,172,232,190,210,170,191,211,171,231,230,193,213,173,233,194,214,174,234,195,215,175,235,109,129,89,149,116,136,96,156,117,137,97,157,121,141,101,161,122,142,102,162,123,143,103,163,124,144,104,164,125,145,105,165,126,146,106,166,127,147,107,167,128,148,108,168,118,138,98,158,119,139,99,159,120,140,100,160,112,132,92,152,110,130,90,111,131,91,151,150,113,133,93,153,114,134,94,154,115,135,95,155,253,261,260,265,266,267,268,269,270,271,272,262,263,264,254,256,255,257,258,259,293,301,300,305,306,307,308,309,310,311,312,302,303,304,294,296,295,297,298,299,273,281,280,285,286,287,288,289,290,291,292,282,283,284,274,276,275,277,278,279";
|
||||
string[] segments = args7.Split(',');
|
||||
ReadOnlyCollection<string> ignoreColumns = new(args4.Split(','));
|
||||
ReadOnlyCollection<string> backfillColumns = new(args5.Split(','));
|
||||
ReadOnlyCollection<string> indexOnlyColumns = new(args6.Split(','));
|
||||
ReadOnlyCollection<string> newColumnNames = new(processDataStandardFormatMappingNewColumnNames.Split(','));
|
||||
ReadOnlyCollection<string> oldColumnNames = new(processDataStandardFormatMappingOldColumnNames.Split(','));
|
||||
ReadOnlyCollection<int> columnIndices = new(processDataStandardFormatMappingColumnIndices.Split(',').Select(int.Parse).ToArray());
|
||||
foreach (string segment in segments)
|
||||
{
|
||||
segmentsB = segment.Split('|');
|
||||
if (segmentsB.Length != 2)
|
||||
continue;
|
||||
if (distinct.Contains(segmentsB[0]))
|
||||
continue;
|
||||
distinct.Add(segmentsB[0]);
|
||||
keyValuePairs.Add(segmentsB[0], segmentsB[1]);
|
||||
}
|
||||
result = new(backfillColumns: backfillColumns,
|
||||
columnIndices: columnIndices,
|
||||
newColumnNames: newColumnNames,
|
||||
ignoreColumns: ignoreColumns,
|
||||
indexOnlyColumns: indexOnlyColumns,
|
||||
keyValuePairs: new(keyValuePairs),
|
||||
oldColumnNames: oldColumnNames);
|
||||
return result;
|
||||
}
|
||||
|
||||
private static ReadOnlyCollection<PreWith> GetPreWithCollection(ReadOnlyCollection<Pre> preCollection)
|
||||
{
|
||||
List<PreWith> results = new();
|
||||
string errFile;
|
||||
PreWith preWith;
|
||||
string? checkDirectory;
|
||||
string noWaitDirectory;
|
||||
foreach (Pre pre in preCollection)
|
||||
{
|
||||
errFile = string.Concat(pre.CheckFile, ".err");
|
||||
checkDirectory = Path.GetDirectoryName(pre.CheckFile);
|
||||
if (string.IsNullOrEmpty(checkDirectory))
|
||||
continue;
|
||||
if (!Directory.Exists(checkDirectory))
|
||||
_ = Directory.CreateDirectory(checkDirectory);
|
||||
noWaitDirectory = Path.Combine(checkDirectory, "NoWaitDirectory");
|
||||
preWith = new(checkDirectory: checkDirectory,
|
||||
checkFile: pre.CheckFile,
|
||||
errFile: errFile,
|
||||
matchingFile: pre.MatchingFile,
|
||||
noWaitDirectory: noWaitDirectory);
|
||||
results.Add(preWith);
|
||||
}
|
||||
return results.AsReadOnly();
|
||||
}
|
||||
|
||||
private static ReadOnlyCollection<string> GetSearchDirectories(int numberLength, string parentDirectory)
|
||||
{
|
||||
List<string> results = new();
|
||||
string[] directories = Directory.GetDirectories(parentDirectory, "*", SearchOption.TopDirectoryOnly);
|
||||
@ -116,114 +246,11 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
results.Add(directory);
|
||||
}
|
||||
results.Sort();
|
||||
return results;
|
||||
return results.AsReadOnly();
|
||||
}
|
||||
|
||||
private List<string> GetMatchingFiles(long ticks, string reportFullPath, List<string> searchDirectories)
|
||||
private static void CreatePointerFile(int numberLength, string parentDirectory, ReadOnlyCollection<string> matchingFiles)
|
||||
{
|
||||
List<string> results = new();
|
||||
string[] found;
|
||||
string fileName = Path.GetFileName(reportFullPath);
|
||||
foreach (string searchDirectory in searchDirectories)
|
||||
{
|
||||
for (int i = 0; i < int.MaxValue; i++)
|
||||
{
|
||||
found = Directory.GetFiles(searchDirectory, fileName, SearchOption.AllDirectories);
|
||||
if (found.Any())
|
||||
{
|
||||
results.AddRange(found);
|
||||
break;
|
||||
}
|
||||
if (new TimeSpan(DateTime.Now.Ticks - ticks).TotalSeconds > _BreakAfterSeconds)
|
||||
break;
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
private static List<(string matchingFile, string checkFile)> GetCollection(int numberLength, string parentDirectory, List<string> matchingFiles)
|
||||
{
|
||||
List<(string matchingFile, string checkFile)> results = new();
|
||||
string checkFile;
|
||||
int parentDirectoryLength = parentDirectory.Length;
|
||||
foreach (string matchingFile in matchingFiles)
|
||||
{
|
||||
checkFile = $"{matchingFile[0]}{matchingFile.Substring(parentDirectoryLength + numberLength + 1)}";
|
||||
results.Add(new(matchingFile, checkFile));
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
private static List<(string, string, string, string, string)> GetCollection(List<(string matchingFile, string checkFile)> collection)
|
||||
{
|
||||
List<(string, string, string, string, string)> results = new();
|
||||
string errFile;
|
||||
string checkDirectory;
|
||||
string noWaitDirectory;
|
||||
foreach ((string matchingFile, string checkFile) in collection)
|
||||
{
|
||||
errFile = string.Concat(checkFile, ".err");
|
||||
checkDirectory = Path.GetDirectoryName(checkFile);
|
||||
if (!Directory.Exists(checkDirectory))
|
||||
_ = Directory.CreateDirectory(checkDirectory);
|
||||
noWaitDirectory = Path.Combine(checkDirectory, "NoWaitDirectory");
|
||||
results.Add(new(matchingFile, checkFile, errFile, checkDirectory, noWaitDirectory));
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
private void MoveCollection(DateTime dateTime, List<(string matchingFile, string checkFile)> collection)
|
||||
{
|
||||
long preWait;
|
||||
List<(string checkFile, string errFile)> postCollection = new();
|
||||
foreach ((string matchingFile, string checkFile, string errFile, string checkDirectory, string noWaitDirectory) in GetCollection(collection))
|
||||
{
|
||||
File.Move(matchingFile, checkFile);
|
||||
if (Directory.Exists(noWaitDirectory))
|
||||
{
|
||||
postCollection.Add(new(checkFile, errFile));
|
||||
continue;
|
||||
}
|
||||
if (_FileConnectorConfiguration?.FileHandleWaitTime is null)
|
||||
preWait = DateTime.Now.AddMilliseconds(1234).Ticks;
|
||||
else
|
||||
preWait = DateTime.Now.AddMilliseconds(_FileConnectorConfiguration.FileHandleWaitTime.Value).Ticks;
|
||||
for (short i = 0; i < short.MaxValue; i++)
|
||||
{
|
||||
if (DateTime.Now.Ticks > preWait)
|
||||
break;
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
for (int i = 0; i < int.MaxValue; i++)
|
||||
{
|
||||
if (File.Exists(errFile))
|
||||
throw new Exception(File.ReadAllText(errFile));
|
||||
if (!File.Exists(checkFile))
|
||||
break;
|
||||
if (new TimeSpan(DateTime.Now.Ticks - dateTime.Ticks).TotalSeconds > _BreakAfterSeconds)
|
||||
throw new Exception($"Not all files were consumed after {_BreakAfterSeconds} second(s)!");
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
}
|
||||
if (postCollection.Any())
|
||||
{
|
||||
Thread.Sleep(500);
|
||||
StringBuilder stringBuilder = new();
|
||||
foreach ((string checkFile, string errFile) in postCollection)
|
||||
{
|
||||
if (File.Exists(errFile))
|
||||
_ = stringBuilder.AppendLine(File.ReadAllText(errFile));
|
||||
if (File.Exists(checkFile))
|
||||
_ = stringBuilder.AppendLine($"<{checkFile}> was not consumed by the end!");
|
||||
}
|
||||
if (stringBuilder.Length > 0)
|
||||
throw new Exception(stringBuilder.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private static void CreatePointerFile(int numberLength, string parentDirectory, List<string> matchingFiles)
|
||||
{
|
||||
#nullable enable
|
||||
string checkFile;
|
||||
string writeFile;
|
||||
string? directoryName;
|
||||
@ -239,28 +266,135 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
continue;
|
||||
File.AppendAllLines(writeFile, new string[] { parentDirectory, matchingFile, directoryName, checkFile });
|
||||
}
|
||||
#nullable disable
|
||||
}
|
||||
|
||||
private static ReadOnlyCollection<Pre> GetPreCollection(int numberLength, string parentDirectory, ReadOnlyCollection<string> matchingFiles, bool _)
|
||||
{
|
||||
List<Pre> results = new();
|
||||
Pre pre;
|
||||
string checkFile;
|
||||
int parentDirectoryLength = parentDirectory.Length;
|
||||
foreach (string matchingFile in matchingFiles)
|
||||
{
|
||||
checkFile = $"{matchingFile[0]}{matchingFile.Substring(parentDirectoryLength + numberLength + 1)}";
|
||||
pre = new(matchingFile, checkFile);
|
||||
results.Add(pre);
|
||||
}
|
||||
return results.AsReadOnly();
|
||||
}
|
||||
|
||||
private void MoveCollection(DateTime dateTime, ProcessDataStandardFormat processDataStandardFormat, ReadOnlyCollection<PreWith> preWithCollection)
|
||||
{
|
||||
ReadOnlyCollection<Post> postCollection = GetPostCollection(dateTime, processDataStandardFormat, preWithCollection);
|
||||
if (postCollection.Count != 0)
|
||||
{
|
||||
Thread.Sleep(500);
|
||||
StringBuilder stringBuilder = new();
|
||||
foreach (Post post in postCollection)
|
||||
{
|
||||
if (File.Exists(post.ErrFile))
|
||||
_ = stringBuilder.AppendLine(File.ReadAllText(post.ErrFile));
|
||||
if (File.Exists(post.CheckFile))
|
||||
_ = stringBuilder.AppendLine($"<{post.CheckFile}> was not consumed by the end!");
|
||||
}
|
||||
if (stringBuilder.Length > 0)
|
||||
throw new Exception(stringBuilder.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private ReadOnlyCollection<Post> GetPostCollection(DateTime dateTime, ProcessDataStandardFormat processDataStandardFormat, ReadOnlyCollection<PreWith> preWithCollection)
|
||||
{
|
||||
List<Post> results = new();
|
||||
Post post;
|
||||
long preWait;
|
||||
foreach (PreWith preWith in preWithCollection)
|
||||
{
|
||||
if (!_IsEAFHosted)
|
||||
continue;
|
||||
if (!_StaticRuns.TryGetValue(_Logistics.Sequence, out List<Shared.Metrology.WS.Results>? wsResults))
|
||||
wsResults = null;
|
||||
ProcessDataStandardFormat.Write(preWith.CheckFile, processDataStandardFormat, wsResults);
|
||||
File.Delete(preWith.MatchingFile);
|
||||
if (Directory.Exists(preWith.NoWaitDirectory))
|
||||
{
|
||||
post = new(preWith.CheckFile, preWith.ErrFile);
|
||||
results.Add(post);
|
||||
continue;
|
||||
}
|
||||
if (_FileConnectorConfiguration?.FileHandleWaitTime is null)
|
||||
preWait = DateTime.Now.AddMilliseconds(1234).Ticks;
|
||||
else
|
||||
preWait = DateTime.Now.AddMilliseconds(_FileConnectorConfiguration.FileHandleWaitTime.Value).Ticks;
|
||||
for (short i = 0; i < short.MaxValue; i++)
|
||||
{
|
||||
if (DateTime.Now.Ticks > preWait)
|
||||
break;
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
for (int i = 0; i < int.MaxValue; i++)
|
||||
{
|
||||
if (File.Exists(preWith.ErrFile))
|
||||
throw new Exception(File.ReadAllText(preWith.ErrFile));
|
||||
if (!File.Exists(preWith.CheckFile))
|
||||
break;
|
||||
if (new TimeSpan(DateTime.Now.Ticks - dateTime.Ticks).TotalSeconds > _BreakAfterSeconds)
|
||||
throw new Exception($"Not all files were consumed after {_BreakAfterSeconds} second(s)!");
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
}
|
||||
return results.AsReadOnly();
|
||||
}
|
||||
|
||||
private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime dateTime)
|
||||
{
|
||||
Tuple<string, Test[], JsonElement[], List<FileInfo>> results = new(string.Empty, null, null, new List<FileInfo>());
|
||||
Tuple<string, string[], string[]> pdsf = ProcessDataStandardFormat.GetLogisticsColumnsAndBody(reportFullPath);
|
||||
_Logistics = new Logistics(reportFullPath, pdsf.Item1);
|
||||
Tuple<string, Test[], JsonElement[], List<FileInfo>> results = new(string.Empty, Array.Empty<Test>(), Array.Empty<JsonElement>(), new List<FileInfo>());
|
||||
ProcessDataStandardFormat processDataStandardFormat = ProcessDataStandardFormat.GetProcessDataStandardFormat(reportFullPath, _ProcessDataStandardFormatMapping);
|
||||
_Logistics = new Logistics(reportFullPath, processDataStandardFormat);
|
||||
if (!_IsEAFHosted)
|
||||
ProcessDataStandardFormat.Write("../../.pdsf", processDataStandardFormat, wsResults: null);
|
||||
SetFileParameterLotIDToLogisticsMID();
|
||||
int numberLength = 2;
|
||||
long ticks = dateTime.Ticks;
|
||||
string parentParentDirectory = GetParentParent(reportFullPath);
|
||||
List<string> searchDirectories = GetSearchDirectories(numberLength, parentParentDirectory);
|
||||
List<string> matchingFiles = GetMatchingFiles(ticks, reportFullPath, searchDirectories);
|
||||
ReadOnlyCollection<string> searchDirectories = GetSearchDirectories(numberLength, parentParentDirectory);
|
||||
ReadOnlyCollection<string> matchingFiles = GetMatchingFiles(ticks, reportFullPath, searchDirectories);
|
||||
if (matchingFiles.Count != searchDirectories.Count)
|
||||
throw new Exception($"Didn't find all files after {_BreakAfterSeconds} second(s)!");
|
||||
if (_IsEAFHosted)
|
||||
{
|
||||
try
|
||||
{ CreatePointerFile(numberLength, parentParentDirectory, matchingFiles); }
|
||||
catch (Exception) { }
|
||||
List<(string matchingFile, string checkFile)> collection = GetCollection(numberLength, parentParentDirectory, matchingFiles);
|
||||
MoveCollection(dateTime, collection);
|
||||
}
|
||||
JsonElement[] jsonElements = ProcessDataStandardFormat.GetArray(processDataStandardFormat);
|
||||
List<txt.Description> descriptions = txt.ProcessData.GetDescriptions(jsonElements);
|
||||
bool mesEntityMatchesProcess = descriptions.Count > 0 && descriptions[0].MesEntity == descriptions[0].Reactor;
|
||||
ReadOnlyCollection<Pre> preCollection = GetPreCollection(numberLength, parentParentDirectory, matchingFiles, mesEntityMatchesProcess);
|
||||
ReadOnlyCollection<PreWith> preWithCollection = GetPreWithCollection(preCollection);
|
||||
MoveCollection(dateTime, processDataStandardFormat, preWithCollection);
|
||||
return results;
|
||||
}
|
||||
|
||||
private ReadOnlyCollection<string> GetMatchingFiles(long ticks, string reportFullPath, ReadOnlyCollection<string> searchDirectories)
|
||||
{
|
||||
List<string> results = new();
|
||||
string[] found;
|
||||
string fileName = Path.GetFileName(reportFullPath);
|
||||
foreach (string searchDirectory in searchDirectories)
|
||||
{
|
||||
for (int i = 0; i < int.MaxValue; i++)
|
||||
{
|
||||
found = Directory.GetFiles(searchDirectory, fileName, SearchOption.AllDirectories);
|
||||
if (found.Length != 0)
|
||||
{
|
||||
results.AddRange(found);
|
||||
break;
|
||||
}
|
||||
if (new TimeSpan(DateTime.Now.Ticks - ticks).TotalSeconds > _BreakAfterSeconds)
|
||||
break;
|
||||
}
|
||||
}
|
||||
return results.AsReadOnly();
|
||||
}
|
||||
|
||||
}
|
@ -21,14 +21,13 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
private readonly string _IqsConnectionString;
|
||||
private readonly string _OpenInsightFilePattern;
|
||||
private readonly string _OpenInsightApiECDirectory;
|
||||
private readonly string _OpenInsightApiIFXDirectory;
|
||||
|
||||
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) :
|
||||
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<WS.Results>> 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);
|
||||
_NullData = string.Empty;
|
||||
if (_FileParameter is null)
|
||||
throw new Exception(cellInstanceConnectionName);
|
||||
if (_ModelObjectParameterDefinitions is null)
|
||||
@ -38,7 +37,6 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
_LastLines = string.Empty;
|
||||
_IqsConnectionString = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "IQS.ConnectionString");
|
||||
_OpenInsightApiECDirectory = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "API.EC.Directory");
|
||||
_OpenInsightApiIFXDirectory = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "API.IFX.Directory");
|
||||
_OpenInsightFilePattern = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "OpenInsight.FilePattern");
|
||||
}
|
||||
|
||||
@ -170,16 +168,25 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
return new Tuple<string, string>(result.ToString(), x.Date);
|
||||
}
|
||||
|
||||
private void SaveOpenInsightFile(string reportFullPath, DateTime dateTime, string logistics, List<txt.Description> descriptions, Test[] tests)
|
||||
private void SaveOpenInsightFile(string reportFullPath, DateTime dateTime, ProcessDataStandardFormat processDataStandardFormat, List<txt.Description> descriptions, Test[] tests)
|
||||
{
|
||||
bool isDummyRun = false;
|
||||
List<(Shared.Properties.IScopeInfo, string)> collection = new();
|
||||
string duplicateDirectory = Path.Combine(_FileConnectorConfiguration.SourceFileLocation, _CellInstanceName);
|
||||
if (!Directory.Exists(duplicateDirectory))
|
||||
_ = Directory.CreateDirectory(duplicateDirectory);
|
||||
string successDirectory = _FileConnectorConfiguration.AlternateTargetFolder;
|
||||
if (!Directory.Exists(Path.Combine(duplicateDirectory, "1")))
|
||||
{
|
||||
string parentParent = GetParentParent(_FileConnectorConfiguration.SourceFileLocation);
|
||||
if (parentParent.Contains(_CellInstanceName))
|
||||
parentParent = Path.GetDirectoryName(parentParent);
|
||||
string duplicateDirectory = Path.Combine(parentParent, "Data");
|
||||
if (!descriptions.Any() || !tests.Any())
|
||||
duplicateDirectory = Path.Combine(parentParent, "Data");
|
||||
if (!Directory.Exists(duplicateDirectory))
|
||||
_ = Directory.CreateDirectory(duplicateDirectory);
|
||||
}
|
||||
string duplicateFile = Path.Combine(duplicateDirectory, Path.GetFileName(reportFullPath));
|
||||
if (descriptions.Count == 0 || tests.Length == 0)
|
||||
_LastLines = string.Empty;
|
||||
else
|
||||
{
|
||||
@ -188,24 +195,23 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
bool save = string.IsNullOrEmpty(_LastLines) || check != _LastLines;
|
||||
if (save && !string.IsNullOrEmpty(check))
|
||||
{
|
||||
long? subgroupId;
|
||||
_LastLines = check;
|
||||
long? subGroupId;
|
||||
long breakAfter = dateTime.AddSeconds(_BreakAfterSeconds).Ticks;
|
||||
long preWait = _FileConnectorConfiguration?.FileHandleWaitTime is null ? dateTime.AddMilliseconds(1234).Ticks : dateTime.AddMilliseconds(_FileConnectorConfiguration.FileHandleWaitTime.Value).Ticks;
|
||||
if (string.IsNullOrEmpty(descriptions[0].Reactor) || string.IsNullOrEmpty(descriptions[0].PSN))
|
||||
subGroupId = null;
|
||||
subgroupId = null;
|
||||
else
|
||||
(subGroupId, int? _, string _) = FromIQS.GetCommandText(_IqsConnectionString, _Logistics, descriptions[0], breakAfter, preWait);
|
||||
if (subGroupId is null)
|
||||
(subgroupId, int? _, string _) = FromIQS.GetCommandText(_IqsConnectionString, _Logistics, descriptions[0], breakAfter, preWait);
|
||||
if (subgroupId is null)
|
||||
collection.Add(new(new ScopeInfo(tests[0], _OpenInsightFilePattern), lines.Item1));
|
||||
else
|
||||
collection.Add(new(new ScopeInfo(tests[0], $"{subGroupId.Value} {_OpenInsightFilePattern}"), lines.Item1));
|
||||
collection.Add(new(new ScopeInfo(tests[0], $"{subgroupId.Value} {_OpenInsightFilePattern}"), lines.Item1));
|
||||
string weekOfYear = _Calendar.GetWeekOfYear(_Logistics.DateTimeFromSequence, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00");
|
||||
FromIQS.Save(_OpenInsightApiECDirectory, _OpenInsightApiIFXDirectory, _Logistics, reportFullPath, logistics, descriptions.First(), lines.Item1, subGroupId, weekOfYear);
|
||||
FromIQS.Save(_OpenInsightApiECDirectory, _Logistics, reportFullPath, processDataStandardFormat, descriptions.First(), lines.Item1, subgroupId, weekOfYear);
|
||||
}
|
||||
if (!Directory.Exists(duplicateDirectory))
|
||||
_ = Directory.CreateDirectory(duplicateDirectory);
|
||||
string duplicateFile = Path.Combine(duplicateDirectory, Path.GetFileName(reportFullPath));
|
||||
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
|
||||
WaitForFileConsumption(dateTime, descriptions, isDummyRun, successDirectory, duplicateDirectory, collection, duplicateFile);
|
||||
}
|
||||
@ -214,15 +220,15 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime dateTime)
|
||||
{
|
||||
Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
|
||||
Tuple<string, string[], string[]> pdsf = ProcessDataStandardFormat.GetLogisticsColumnsAndBody(reportFullPath);
|
||||
_Logistics = new Logistics(reportFullPath, pdsf.Item1);
|
||||
ProcessDataStandardFormat processDataStandardFormat = ProcessDataStandardFormat.GetProcessDataStandardFormat(reportFullPath);
|
||||
_Logistics = new Logistics(reportFullPath, processDataStandardFormat);
|
||||
SetFileParameterLotIDToLogisticsMID();
|
||||
JsonElement[] jsonElements = ProcessDataStandardFormat.GetArray(pdsf);
|
||||
JsonElement[] jsonElements = ProcessDataStandardFormat.GetArray(processDataStandardFormat);
|
||||
List<txt.Description> descriptions = txt.ProcessData.GetDescriptions(jsonElements);
|
||||
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
|
||||
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
|
||||
SaveOpenInsightFile(reportFullPath, dateTime, pdsf.Item1, descriptions, tests);
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(pdsf.Item1, tests, jsonElements, new List<FileInfo>());
|
||||
SaveOpenInsightFile(reportFullPath, dateTime, processDataStandardFormat, descriptions, tests);
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics[0]), tests, jsonElements, new List<FileInfo>());
|
||||
return results;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
using Adaptation.Shared;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Globalization;
|
||||
@ -16,66 +17,175 @@ public class FromIQS
|
||||
|
||||
#nullable enable
|
||||
|
||||
private static string GetCommandText(DateTime dateTime)
|
||||
{ // cSpell:disable
|
||||
List<string> results = new();
|
||||
TimeSpan timeSpan = new(dateTime.ToUniversalTime().AddDays(-1).Ticks - new DateTime(1970, 01, 01).Ticks);
|
||||
long infinityQS = (long)Math.Floor(timeSpan.TotalSeconds);
|
||||
results.Add(" select count_se_sgtm CountSeSgtm, ");
|
||||
results.Add(" dateadd(HH, -7, (dateadd(SS, convert(bigint, max_se_sgtm), '19700101'))) DateTime, ");
|
||||
results.Add(" max_max_se_test MaxMaxSeTest, ");
|
||||
results.Add(" ( ");
|
||||
results.Add(" select td.f_name ");
|
||||
results.Add(" from [SPCEPIWORLD].[dbo].[TEST_DAT] td ");
|
||||
results.Add(" where td.f_test = max_max_se_test ");
|
||||
results.Add(" ) MaxMaxSeTestName, ");
|
||||
results.Add(" max_max_se_val MaxMaxSeVal, ");
|
||||
results.Add(" max_se_lot MaxSeLot, ");
|
||||
results.Add(" ( ");
|
||||
results.Add(" select pl.f_name ");
|
||||
results.Add(" from [SPCEPIWORLD].[dbo].[PART_LOT] pl ");
|
||||
results.Add(" where max_se_lot = pl.f_lot ");
|
||||
results.Add(" ) MaxSeLotName, ");
|
||||
results.Add(" max_se_part MaxSePart, ");
|
||||
results.Add(" ( ");
|
||||
results.Add(" select rd.f_name ");
|
||||
results.Add(" from [SPCEPIWORLD].[dbo].[PART_DAT] rd ");
|
||||
results.Add(" where max_se_part = rd.f_part ");
|
||||
results.Add(" ) MaxSePartName, ");
|
||||
results.Add(" max_se_prcs MaxSePrcs, ");
|
||||
results.Add(" ( ");
|
||||
results.Add(" select rd.f_name ");
|
||||
results.Add(" from [SPCEPIWORLD].[dbo].[PRCS_DAT] rd ");
|
||||
results.Add(" where max_se_prcs = rd.f_prcs ");
|
||||
results.Add(" ) MaxSePrcsName, ");
|
||||
results.Add(" max_se_sgrp MaxSeSgrp, ");
|
||||
results.Add(" min_min_se_test MinMinSeTest, ");
|
||||
results.Add(" ( ");
|
||||
results.Add(" select td.f_name ");
|
||||
results.Add(" from [SPCEPIWORLD].[dbo].[TEST_DAT] td ");
|
||||
results.Add(" where td.f_test = min_min_se_test ");
|
||||
results.Add(" ) MinMinSeTestName, ");
|
||||
results.Add(" min_min_se_val MinMinSeVal, ");
|
||||
results.Add(" min_se_sgrp MinSeSgrp ");
|
||||
results.Add(" from ( ");
|
||||
results.Add(" select count_se_sgtm, ");
|
||||
results.Add(" max_se_lot, ");
|
||||
results.Add(" max_se_part, ");
|
||||
results.Add(" max_se_prcs, ");
|
||||
results.Add(" max_se_sgrp, ");
|
||||
results.Add(" max_se_sgtm, ");
|
||||
results.Add(" min_se_sgrp, ");
|
||||
results.Add(" max(max_se_val) max_max_se_val, ");
|
||||
results.Add(" min(min_se_val) min_min_se_val, ");
|
||||
results.Add(" max(max_se_test) max_max_se_test, ");
|
||||
results.Add(" min(min_se_test) min_min_se_test ");
|
||||
results.Add(" from ( ");
|
||||
results.Add(" select count_se_sgtm, ");
|
||||
results.Add(" max_se_lot, ");
|
||||
results.Add(" max_se_val, ");
|
||||
results.Add(" min_se_val, ");
|
||||
results.Add(" max_se_part, ");
|
||||
results.Add(" max_se_prcs, ");
|
||||
results.Add(" max_se_sgrp, ");
|
||||
results.Add(" max_se_sgtm, ");
|
||||
results.Add(" max_se_test, ");
|
||||
results.Add(" min_se_sgrp, ");
|
||||
results.Add(" min_se_test ");
|
||||
results.Add(" from ( ");
|
||||
results.Add(" select ");
|
||||
results.Add(" max(se.f_lot) max_se_lot, ");
|
||||
results.Add(" max(se.f_val) max_se_val, ");
|
||||
results.Add(" min(se.f_lot) min_se_lot, ");
|
||||
results.Add(" min(se.f_val) min_se_val, ");
|
||||
results.Add(" max(se.f_part) max_se_part, ");
|
||||
results.Add(" max(se.f_prcs) max_se_prcs, ");
|
||||
results.Add(" max(se.f_sgrp) max_se_sgrp, ");
|
||||
results.Add(" max(se.f_sgtm) max_se_sgtm, ");
|
||||
results.Add(" max(se.f_test) max_se_test, ");
|
||||
results.Add(" min(se.f_part) min_se_part, ");
|
||||
results.Add(" min(se.f_prcs) min_se_prcs, ");
|
||||
results.Add(" min(se.f_sgrp) min_se_sgrp, ");
|
||||
results.Add(" min(se.f_sgtm) min_se_sgtm, ");
|
||||
results.Add(" min(se.f_test) min_se_test, ");
|
||||
results.Add(" count(se.f_sgtm) count_se_sgtm ");
|
||||
results.Add(" from [spcepiworld].[dbo].[sgrp_ext] se ");
|
||||
results.Add(" where se.f_tsno = 1 ");
|
||||
results.Add(" and se.f_flag = 0 ");
|
||||
results.Add($" and se.f_sgtm > {infinityQS} ");
|
||||
results.Add(" group by se.f_sgtm, se.f_prcs, se.f_lot, se.f_test, se.f_val ");
|
||||
results.Add(" ) qa ");
|
||||
results.Add(" where qa.count_se_sgtm > 1 ");
|
||||
results.Add(" and min_se_lot = max_se_lot ");
|
||||
results.Add(" and min_se_val = max_se_val ");
|
||||
results.Add(" and min_se_val = max_se_val ");
|
||||
results.Add(" and min_se_part = max_se_part ");
|
||||
results.Add(" and min_se_prcs = max_se_prcs ");
|
||||
results.Add(" and min_se_sgtm = max_se_sgtm ");
|
||||
results.Add(" and min_se_test = max_se_test ");
|
||||
results.Add(" ) qb ");
|
||||
results.Add(" group by count_se_sgtm, ");
|
||||
results.Add(" max_se_lot, ");
|
||||
results.Add(" max_se_part, ");
|
||||
results.Add(" max_se_prcs, ");
|
||||
results.Add(" max_se_sgrp, ");
|
||||
results.Add(" max_se_sgtm, ");
|
||||
results.Add(" min_se_sgrp ");
|
||||
results.Add(" ");
|
||||
results.Add(" ) qc ");
|
||||
results.Add(" order by max_se_sgrp desc ");
|
||||
results.Add(" for json path ");
|
||||
return string.Join(Environment.NewLine, results);
|
||||
} // cSpell:restore
|
||||
|
||||
private static string GetCommandText(Logistics logistics, txt.Description description, string dateTime, long? subGroupId)
|
||||
{
|
||||
StringBuilder result = new();
|
||||
_ = result
|
||||
.AppendLine(" select iq.ev_count, iq.cl_count, iq.sl_count, iq.se_sgrp, iq.se_sgtm, iq.se_tsno, iq.td_test, iq.pr_name, iq.jd_name, iq.pl_name, iq.pd_name, iq.td_name, iq.se_val ")
|
||||
.AppendLine(" from ( ")
|
||||
.AppendLine(" select ")
|
||||
.AppendLine(" se.f_sgrp se_sgrp, ")
|
||||
.AppendLine(" se.f_sgtm se_sgtm, ")
|
||||
.AppendLine(" se.f_tsno se_tsno, ")
|
||||
.AppendLine(" se.f_val se_val, ")
|
||||
.AppendLine(" pr.f_name pr_name, ")
|
||||
.AppendLine(" jd.f_name jd_name, ")
|
||||
.AppendLine(" pl.f_name pl_name, ")
|
||||
.AppendLine(" pd.f_name pd_name, ")
|
||||
.AppendLine(" td.f_test td_test, ")
|
||||
.AppendLine(" td.f_name td_name, ")
|
||||
.AppendLine(" (select count(cl.f_part) ")
|
||||
.AppendLine(" from [spcepiworld].[dbo].[ctrl_lim] cl ")
|
||||
.AppendLine(" where cl.f_part = pd.f_part ")
|
||||
.AppendLine(" and cl.f_test = td.f_test ")
|
||||
.AppendLine(" ) cl_count, ")
|
||||
.AppendLine(" (select count(sl.f_part) ")
|
||||
.AppendLine(" from [spcepiworld].[dbo].[spec_lim] sl ")
|
||||
.AppendLine(" where sl.f_part = pd.f_part ")
|
||||
.AppendLine(" and sl.f_test = td.f_test ")
|
||||
.AppendLine(" ) sl_count, ")
|
||||
.AppendLine(" (select count(ev.f_evnt) ")
|
||||
.AppendLine(" from [spcepiworld].[dbo].[evnt_inf] ev ")
|
||||
.AppendLine(" where ev.f_prcs = pr.f_prcs ")
|
||||
.AppendLine(" and ev.f_part = pd.f_part ")
|
||||
.AppendLine(" and ev.f_sgtm = se.f_sgtm ")
|
||||
.AppendLine(" ) ev_count ")
|
||||
.AppendLine(" from [spcepiworld].[dbo].[sgrp_ext] se ")
|
||||
.AppendLine(" join [spcepiworld].[dbo].[prcs_dat] pr ")
|
||||
.AppendLine(" on se.f_prcs = pr.f_prcs ")
|
||||
.AppendLine(" join [spcepiworld].[dbo].[job_dat] jd ")
|
||||
.AppendLine(" on se.f_job = jd.f_job ")
|
||||
.AppendLine(" join [spcepiworld].[dbo].[part_lot] pl ")
|
||||
.AppendLine(" on se.f_lot = pl.f_lot ")
|
||||
.AppendLine(" join [spcepiworld].[dbo].[part_dat] pd ")
|
||||
.AppendLine(" on se.f_part = pd.f_part ")
|
||||
.AppendLine(" join [spcepiworld].[dbo].[test_dat] td ")
|
||||
.AppendLine(" on se.f_test = td.f_test ")
|
||||
.AppendLine(" where se.f_flag = 0 ");
|
||||
{ // cSpell:disable
|
||||
List<string> results = new();
|
||||
results.Add(" select iq.ev_count, iq.cl_count, iq.sl_count, iq.se_sgrp, iq.se_sgtm, iq.se_tsno, iq.td_test, iq.pr_name, iq.jd_name, iq.pl_name, iq.pd_name, iq.td_name, iq.se_val ");
|
||||
results.Add(" from ( ");
|
||||
results.Add(" select ");
|
||||
results.Add(" se.f_sgrp se_sgrp, ");
|
||||
results.Add(" se.f_sgtm se_sgtm, ");
|
||||
results.Add(" se.f_tsno se_tsno, ");
|
||||
results.Add(" se.f_val se_val, ");
|
||||
results.Add(" pr.f_name pr_name, ");
|
||||
results.Add(" jd.f_name jd_name, ");
|
||||
results.Add(" pl.f_name pl_name, ");
|
||||
results.Add(" pd.f_name pd_name, ");
|
||||
results.Add(" td.f_test td_test, ");
|
||||
results.Add(" td.f_name td_name, ");
|
||||
results.Add(" (select count(cl.f_part) ");
|
||||
results.Add(" from [spcepiworld].[dbo].[ctrl_lim] cl ");
|
||||
results.Add(" where cl.f_part = pd.f_part ");
|
||||
results.Add(" and cl.f_test = td.f_test ");
|
||||
results.Add(" ) cl_count, ");
|
||||
results.Add(" (select count(sl.f_part) ");
|
||||
results.Add(" from [spcepiworld].[dbo].[spec_lim] sl ");
|
||||
results.Add(" where sl.f_part = pd.f_part ");
|
||||
results.Add(" and sl.f_test = td.f_test ");
|
||||
results.Add(" ) sl_count, ");
|
||||
results.Add(" (select count(ev.f_evnt) ");
|
||||
results.Add(" from [spcepiworld].[dbo].[evnt_inf] ev ");
|
||||
results.Add(" where ev.f_prcs = pr.f_prcs ");
|
||||
results.Add(" and ev.f_part = pd.f_part ");
|
||||
results.Add(" and ev.f_sgtm = se.f_sgtm ");
|
||||
results.Add(" ) ev_count ");
|
||||
results.Add(" from [spcepiworld].[dbo].[sgrp_ext] se ");
|
||||
results.Add(" join [spcepiworld].[dbo].[prcs_dat] pr ");
|
||||
results.Add(" on se.f_prcs = pr.f_prcs ");
|
||||
results.Add(" join [spcepiworld].[dbo].[job_dat] jd ");
|
||||
results.Add(" on se.f_job = jd.f_job ");
|
||||
results.Add(" join [spcepiworld].[dbo].[part_lot] pl ");
|
||||
results.Add(" on se.f_lot = pl.f_lot ");
|
||||
results.Add(" join [spcepiworld].[dbo].[part_dat] pd ");
|
||||
results.Add(" on se.f_part = pd.f_part ");
|
||||
results.Add(" join [spcepiworld].[dbo].[test_dat] td ");
|
||||
results.Add(" on se.f_test = td.f_test ");
|
||||
results.Add(" where se.f_flag = 0 ");
|
||||
if (subGroupId is not null)
|
||||
_ = result.Append(" and se.f_sgrp = ").Append(subGroupId).AppendLine(" ");
|
||||
results.Add($" and se.f_sgrp = {subGroupId} ");
|
||||
if (!string.IsNullOrEmpty(description.RDS))
|
||||
_ = result.Append(" and pl.f_name = '").Append(description.RDS).AppendLine("' ");
|
||||
_ = result
|
||||
.Append(" and pr.f_name = '").Append(description.Reactor).AppendLine("' ")
|
||||
.Append(" and pd.f_name = '").Append(description.PSN).AppendLine("' ")
|
||||
.AppendLine(" and jd.f_name in ('SP101') ")
|
||||
.Append(" and jd.f_name = '").Append(logistics.MesEntity).AppendLine("' ")
|
||||
.Append(" and dateadd(HH, -7, (dateadd(SS, convert(bigint, se.f_sgtm), '19700101'))) = '").Append(dateTime).AppendLine("' ")
|
||||
.AppendLine(" ) as iq ")
|
||||
.AppendLine(" order by iq.ev_count desc, iq.cl_count desc, iq.sl_count desc, iq.se_sgrp, iq.se_tsno, iq.td_test ")
|
||||
.AppendLine(" for json path ");
|
||||
return result.ToString();
|
||||
}
|
||||
results.Add($" and pl.f_name = '{description.RDS}' ");
|
||||
results.Add($" and pr.f_name = '{description.Reactor}' ");
|
||||
results.Add($" and pd.f_name = '{description.PSN}' ");
|
||||
results.Add(" and jd.f_name in ('SP101') ");
|
||||
results.Add($" and jd.f_name = '{logistics.MesEntity}' ");
|
||||
results.Add($" and dateadd(HH, -7, (dateadd(SS, convert(bigint, se.f_sgtm), '19700101'))) = '{dateTime}' ");
|
||||
results.Add(" ) as iq ");
|
||||
results.Add(" order by iq.ev_count desc, iq.cl_count desc, iq.sl_count desc, iq.se_sgrp, iq.se_tsno, iq.td_test ");
|
||||
results.Add(" for json path ");
|
||||
return string.Join(Environment.NewLine, results);
|
||||
} // cSpell:restore
|
||||
|
||||
private static StringBuilder GetForJsonPath(string connectionString, string commandText)
|
||||
{
|
||||
@ -89,27 +199,89 @@ public class FromIQS
|
||||
return stringBuilder;
|
||||
}
|
||||
|
||||
private static string GetCommandText(List<long> subGroups)
|
||||
{ // cSpell:disable
|
||||
List<string> results = new();
|
||||
results.Add(" update [spcepiworld].[dbo].[sgrp_ext] ");
|
||||
results.Add(" set f_flag = 1 ");
|
||||
results.Add(" where f_flag = 0 ");
|
||||
results.Add($" and f_sgrp in ({string.Join($",{Environment.NewLine} ", subGroups)}) ");
|
||||
return string.Join(Environment.NewLine, results);
|
||||
} // cSpell:enable
|
||||
|
||||
private static int? ExecuteNonQuery(string connectionString, string commandText)
|
||||
{
|
||||
int? result;
|
||||
if (string.IsNullOrEmpty(connectionString))
|
||||
result = null;
|
||||
else
|
||||
{
|
||||
using SqlConnection sqlConnection = new(connectionString);
|
||||
sqlConnection.Open();
|
||||
using SqlCommand sqlCommand = new(commandText, sqlConnection);
|
||||
result = sqlCommand.ExecuteNonQuery();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private static void FlagDuplicates(string connectionString, string json)
|
||||
{
|
||||
JsonElement[]? jsonElements = JsonSerializer.Deserialize<JsonElement[]>(json);
|
||||
JsonSerializerOptions jsonSerializerOptions = new() { PropertyNameCaseInsensitive = true };
|
||||
if (jsonElements is not null && jsonElements.Length != 0 && jsonElements[0].ValueKind == JsonValueKind.Object)
|
||||
{
|
||||
Root? root;
|
||||
List<long> collection = new();
|
||||
JsonElement[] array = jsonElements.ToArray();
|
||||
foreach (JsonElement jsonElement in array)
|
||||
{
|
||||
root = JsonSerializer.Deserialize<Root>(jsonElement.ToString(), jsonSerializerOptions);
|
||||
if (root is null || root.MaxSeSgrp < 1)
|
||||
continue;
|
||||
if (collection.Count > 99)
|
||||
break;
|
||||
collection.Add(root.MaxSeSgrp);
|
||||
}
|
||||
if (collection.Count > 0)
|
||||
{
|
||||
string commandText = GetCommandText(collection);
|
||||
File.WriteAllText("D:/.sql", commandText);
|
||||
_ = ExecuteNonQuery(connectionString, commandText);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal static (long?, int?, string) GetCommandText(string connectionString, Logistics logistics, txt.Description description, long breakAfter, long preWait)
|
||||
{
|
||||
string dateTime;
|
||||
DateTime dateTime;
|
||||
int? count = null;
|
||||
string commandText;
|
||||
long? result = null;
|
||||
StringBuilder stringBuilder;
|
||||
string dateFormat = txt.Description.GetDateFormat();
|
||||
if (DateTime.TryParseExact(description.Date, dateFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime dateTimeParsed))
|
||||
dateTime = dateTimeParsed.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
dateTime = dateTimeParsed;
|
||||
else if (DateTime.TryParse(description.Date, CultureInfo.InvariantCulture, DateTimeStyles.None, out dateTimeParsed))
|
||||
dateTime = dateTimeParsed.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
dateTime = dateTimeParsed;
|
||||
else
|
||||
dateTime = logistics.DateTimeFromSequence.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
commandText = GetCommandText(logistics, description, dateTime, subGroupId: null);
|
||||
dateTime = logistics.DateTimeFromSequence;
|
||||
commandText = GetCommandText(dateTime);
|
||||
try
|
||||
{
|
||||
stringBuilder = GetForJsonPath(connectionString, commandText);
|
||||
if (stringBuilder.Length > 0)
|
||||
FlagDuplicates(connectionString, stringBuilder.ToString());
|
||||
}
|
||||
catch (Exception)
|
||||
{ stringBuilder = new(); }
|
||||
_ = stringBuilder.Clear();
|
||||
commandText = GetCommandText(logistics, description, dateTime.ToString("yyyy-MM-dd HH:mm:ss"), subGroupId: null);
|
||||
for (short i = 0; i < short.MaxValue; i++)
|
||||
{
|
||||
if (DateTime.Now.Ticks > preWait)
|
||||
break;
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
StringBuilder stringBuilder = new();
|
||||
for (short z = 0; z < short.MaxValue; z++)
|
||||
{
|
||||
stringBuilder = GetForJsonPath(connectionString, commandText);
|
||||
@ -135,17 +307,17 @@ public class FromIQS
|
||||
else
|
||||
{
|
||||
JsonElement[]? jsonElements = JsonSerializer.Deserialize<JsonElement[]>(stringBuilder.ToString());
|
||||
if (jsonElements is null || !jsonElements.Any() || jsonElements[0].ValueKind != JsonValueKind.Object)
|
||||
if (jsonElements is null || jsonElements.Length == 0 || jsonElements[0].ValueKind != JsonValueKind.Object)
|
||||
commandText = stringBuilder.ToString();
|
||||
else
|
||||
{
|
||||
JsonProperty[] jsonProperties = jsonElements[0].EnumerateObject().ToArray();
|
||||
if (!jsonProperties.Any() || jsonProperties[3].Name != "se_sgrp" || !long.TryParse(jsonProperties[3].Value.ToString(), out long subGroupId))
|
||||
if (jsonProperties.Length == 0 || jsonProperties[3].Name != "se_sgrp" || !long.TryParse(jsonProperties[3].Value.ToString(), out long subGroupId))
|
||||
commandText = stringBuilder.ToString();
|
||||
else
|
||||
{
|
||||
result = subGroupId;
|
||||
if (jsonProperties.Any() && jsonProperties[0].Name == "ev_count" && int.TryParse(jsonProperties[0].Value.ToString(), out int evCount))
|
||||
if (jsonProperties.Length != 0 && jsonProperties[0].Name == "ev_count" && int.TryParse(jsonProperties[0].Value.ToString(), out int evCount))
|
||||
count = evCount;
|
||||
}
|
||||
}
|
||||
@ -153,7 +325,7 @@ public class FromIQS
|
||||
return new(result, count, commandText);
|
||||
}
|
||||
|
||||
private static string GetJson(Logistics logistics, string logisticLines, txt.Description description)
|
||||
private static string GetJson(Logistics logistics, ProcessDataStandardFormat processDataStandardFormat, txt.Description description)
|
||||
{
|
||||
string result;
|
||||
StringBuilder stringBuilder = new();
|
||||
@ -173,7 +345,7 @@ public class FromIQS
|
||||
string safeValue;
|
||||
string[] segments;
|
||||
string serializerValue;
|
||||
foreach (string line in logisticLines.Split(new string[] { Environment.NewLine }, StringSplitOptions.None))
|
||||
foreach (string line in processDataStandardFormat.Logistics)
|
||||
{
|
||||
segments = line.Split('\t');
|
||||
if (segments.Length < 2)
|
||||
@ -204,40 +376,121 @@ public class FromIQS
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static void Save(string openInsightApiECDirectory, string openInsightApiIFXDirectory, Logistics logistics, string reportFullPath, string logisticLines, txt.Description description, string lines, long? subGroupId, string weekOfYear)
|
||||
internal static void Save(string openInsightApiECDirectory, Logistics logistics, string reportFullPath, ProcessDataStandardFormat processDataStandardFormat, txt.Description description, string lines, long? subGroupId, string weekOfYear)
|
||||
{
|
||||
string checkFile;
|
||||
string fileName = Path.GetFileName(reportFullPath);
|
||||
string json = GetJson(logistics, logisticLines, description);
|
||||
string json = GetJson(logistics, processDataStandardFormat, description);
|
||||
string? ecPathRoot = Path.GetPathRoot(openInsightApiECDirectory);
|
||||
string? ifxPathRoot = Path.GetPathRoot(openInsightApiIFXDirectory);
|
||||
bool ecExists = ecPathRoot is not null && Directory.Exists(ecPathRoot);
|
||||
bool ifxExists = ifxPathRoot is not null && Directory.Exists(ifxPathRoot);
|
||||
string weekYear = $"{logistics.DateTimeFromSequence:yyyy}_Week_{weekOfYear}";
|
||||
string ecDirectory = Path.Combine(openInsightApiECDirectory, weekYear, $"-{description.PSN}", $"-{description.Reactor}", $"-{description.RDS}", $"-{subGroupId}");
|
||||
string ifxDirectory = Path.Combine(openInsightApiIFXDirectory, weekYear, $"-{description.PSN}", $"-{description.Reactor}", $"-{description.RDS}", $"-{subGroupId}");
|
||||
if (ecExists && !Directory.Exists(ecDirectory))
|
||||
_ = Directory.CreateDirectory(ecDirectory);
|
||||
if (ifxExists && !Directory.Exists(ifxDirectory))
|
||||
_ = Directory.CreateDirectory(ifxDirectory);
|
||||
checkFile = Path.Combine(ecDirectory, fileName);
|
||||
if (ecExists && !File.Exists(checkFile))
|
||||
File.Copy(reportFullPath, checkFile);
|
||||
checkFile = Path.Combine(ifxDirectory, fileName);
|
||||
if (ifxExists && !File.Exists(checkFile))
|
||||
File.Copy(reportFullPath, checkFile);
|
||||
checkFile = Path.Combine(ecDirectory, $"{logistics.DateTimeFromSequence.Ticks}.txt");
|
||||
if (ecExists && !File.Exists(checkFile))
|
||||
File.WriteAllText(checkFile, lines);
|
||||
checkFile = Path.Combine(ifxDirectory, $"{logistics.DateTimeFromSequence.Ticks}.txt");
|
||||
if (ifxExists && !File.Exists(checkFile))
|
||||
File.WriteAllText(checkFile, lines);
|
||||
checkFile = Path.Combine(ecDirectory, $"{logistics.DateTimeFromSequence.Ticks}.json");
|
||||
if (ecExists && !File.Exists(checkFile))
|
||||
File.WriteAllText(checkFile, json);
|
||||
checkFile = Path.Combine(ifxDirectory, $"{logistics.DateTimeFromSequence.Ticks}.json");
|
||||
if (ifxExists && !File.Exists(checkFile))
|
||||
File.WriteAllText(checkFile, json);
|
||||
checkFile = Path.Combine(ecDirectory, $"{logistics.DateTimeFromSequence.Ticks}.lbl");
|
||||
if (ecExists && !File.Exists(checkFile))
|
||||
File.WriteAllText(checkFile, processDataStandardFormat.Body[processDataStandardFormat.Body.Count - 1]);
|
||||
}
|
||||
|
||||
private static string GetCommandText(string[] iqsCopyValues)
|
||||
{ // cSpell:disable
|
||||
List<string> results = new();
|
||||
if (iqsCopyValues.Length != 4)
|
||||
throw new NotSupportedException();
|
||||
string find = iqsCopyValues[1];
|
||||
string replace = iqsCopyValues[3];
|
||||
results.Add(" select pd.f_name [Part Name], ");
|
||||
results.Add(" null [Part Revision], ");
|
||||
results.Add($" '{replace}' [Test Name], ");
|
||||
results.Add(" null [Description], ");
|
||||
results.Add(" null [Lot Number], ");
|
||||
results.Add(" null [Job Name], ");
|
||||
results.Add(" null [Process Name], ");
|
||||
results.Add(" case when sl.f_url = 0 then null else sl.f_url end [Reasonable Limit (Upper)], ");
|
||||
results.Add(" case when sl.f_url = 0 then 0 else 1 end [Alarm Reasonable Limit (Upper)], ");
|
||||
results.Add(" case when sl.f_usl = 0 then null else sl.f_usl end [Specification Limit (Upper)], ");
|
||||
results.Add(" case when sl.f_usl = 0 then 0 else 1 end [Alarm Specification Limit (Upper)], ");
|
||||
results.Add(" case when sl.f_ugb = 0 then null else sl.f_ugb end [Warning Limit (Upper)], ");
|
||||
results.Add(" case when sl.f_ugb = 0 then 0 else 1 end [Alarm Warning Limit (Upper)], ");
|
||||
results.Add(" case when sl.f_tar = 0 then null else sl.f_tar end [Specification Limit (Target)], ");
|
||||
results.Add(" case when sl.f_lgb = 0 then null else sl.f_lgb end [Warning Limit (Lower)], ");
|
||||
results.Add(" case when sl.f_lgb = 0 then 0 else 1 end [Alarm Warning Limit (Lower)], ");
|
||||
results.Add(" case when sl.f_lsl = 0 then null else sl.f_lsl end [Specification Limit (Lower)], ");
|
||||
results.Add(" case when sl.f_lsl = 0 then 0 else 1 end [Alarm Specification Limit (Lower)], ");
|
||||
results.Add(" case when sl.f_lrl = 0 then null else sl.f_lrl end [Reasonable Limit (Lower)], ");
|
||||
results.Add(" case when sl.f_lrl = 0 then 0 else 1 end [Alarm Reasonable Limit (Lower)], ");
|
||||
results.Add(" td.f_name [Original Test Name], ");
|
||||
results.Add(" td.f_test [Test Id], ");
|
||||
results.Add(" ( ");
|
||||
results.Add(" select count(sl_b.f_spec) ");
|
||||
results.Add(" from [spcepiworld].[dbo].[spec_lim] sl_b ");
|
||||
results.Add(" join [spcepiworld].[dbo].[part_dat] pd_b ");
|
||||
results.Add(" on sl_b.f_part = pd_b.f_part ");
|
||||
results.Add(" join [spcepiworld].[dbo].[test_dat] td_b ");
|
||||
results.Add(" on sl_b.f_test = td_b.f_test ");
|
||||
results.Add(" where sl_b.f_prcs = 0 ");
|
||||
results.Add($" and td_b.f_name = '{replace}' ");
|
||||
results.Add(" and pd_b.f_name = pd.f_name ");
|
||||
results.Add(" and sl_b.f_url = sl.f_url ");
|
||||
results.Add(" and sl_b.f_usl = sl.f_usl ");
|
||||
results.Add(" and sl_b.f_ugb = sl.f_ugb ");
|
||||
results.Add(" and sl_b.f_tar = sl.f_tar ");
|
||||
results.Add(" and sl_b.f_lgb = sl.f_lgb ");
|
||||
results.Add(" and sl_b.f_lsl = sl.f_lsl ");
|
||||
results.Add(" and sl_b.f_lrl = sl.f_lrl ");
|
||||
results.Add(" group by sl_b.f_spec ");
|
||||
results.Add(" ) count ");
|
||||
results.Add(" from [spcepiworld].[dbo].[spec_lim] sl ");
|
||||
results.Add(" join [spcepiworld].[dbo].[part_dat] pd ");
|
||||
results.Add(" on sl.f_part = pd.f_part ");
|
||||
results.Add(" join [spcepiworld].[dbo].[test_dat] td ");
|
||||
results.Add(" on sl.f_test = td.f_test ");
|
||||
results.Add(" where sl.f_prcs = 0 ");
|
||||
results.Add($" and td.f_name = '{find}' ");
|
||||
results.Add(" and isnull(( ");
|
||||
results.Add(" select count(sl_b.f_spec) ");
|
||||
results.Add(" from [spcepiworld].[dbo].[spec_lim] sl_b ");
|
||||
results.Add(" join [spcepiworld].[dbo].[part_dat] pd_b ");
|
||||
results.Add(" on sl_b.f_part = pd_b.f_part ");
|
||||
results.Add(" join [spcepiworld].[dbo].[test_dat] td_b ");
|
||||
results.Add(" on sl_b.f_test = td_b.f_test ");
|
||||
results.Add(" where sl_b.f_prcs = 0 ");
|
||||
results.Add($" and td_b.f_name = '{replace}' ");
|
||||
results.Add(" and pd_b.f_name = pd.f_name ");
|
||||
results.Add(" and sl_b.f_url = sl.f_url ");
|
||||
results.Add(" and sl_b.f_usl = sl.f_usl ");
|
||||
results.Add(" and sl_b.f_ugb = sl.f_ugb ");
|
||||
results.Add(" and sl_b.f_tar = sl.f_tar ");
|
||||
results.Add(" and sl_b.f_lgb = sl.f_lgb ");
|
||||
results.Add(" and sl_b.f_lsl = sl.f_lsl ");
|
||||
results.Add(" and sl_b.f_lrl = sl.f_lrl ");
|
||||
results.Add(" group by sl_b.f_spec ");
|
||||
results.Add(" ), 0) = 0 ");
|
||||
results.Add(" for json path ");
|
||||
return string.Join(Environment.NewLine, results);
|
||||
} // cSpell:restore
|
||||
|
||||
internal static void SaveCopy(string fileConnectorConfigurationSourceFileLocation, string connectionString, string name, string[] iqsCopyValues)
|
||||
{
|
||||
string checkFile = Path.Combine(fileConnectorConfigurationSourceFileLocation, $"{name}.json");
|
||||
if (!File.Exists(checkFile))
|
||||
{
|
||||
string commandText = GetCommandText(iqsCopyValues);
|
||||
StringBuilder stringBuilder = GetForJsonPath(connectionString, commandText);
|
||||
if (stringBuilder.Length != 0)
|
||||
File.WriteAllText(checkFile, stringBuilder.ToString());
|
||||
else
|
||||
File.WriteAllText(Path.Combine(fileConnectorConfigurationSourceFileLocation, $"{name}.sql"), commandText);
|
||||
}
|
||||
}
|
||||
|
||||
#nullable disable
|
||||
|
47
Adaptation/FileHandlers/OpenInsight/Root.cs
Normal file
47
Adaptation/FileHandlers/OpenInsight/Root.cs
Normal file
@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.OpenInsight;
|
||||
|
||||
public class Root
|
||||
{
|
||||
|
||||
public long CountSeSgtm { get; } // [JsonPropertyName("count_se_sgtm")]
|
||||
public DateTime DateTime { get; } // [JsonPropertyName("date_time")]
|
||||
public long MaxMaxSeTest { get; } // [JsonPropertyName("max_max_se_test")]
|
||||
public string MaxMaxSeTestName { get; } // [JsonPropertyName("max_max_se_test_name")]
|
||||
public double MaxMaxSeVal { get; } // [JsonPropertyName("max_max_se_val")]
|
||||
public long MaxSeLot { get; } // [JsonPropertyName("max_se_lot")]
|
||||
public string MaxSeLotName { get; } // [JsonPropertyName("max_se_lot_name")]
|
||||
public long MaxSePart { get; } // [JsonPropertyName("max_se_part")]
|
||||
public string MaxSePartName { get; } // [JsonPropertyName("max_se_part_name")]
|
||||
public long MaxSePrcs { get; } // [JsonPropertyName("max_se_prcs")]
|
||||
public string MaxSePrcsName { get; } // [JsonPropertyName("max_se_prcs_name")]
|
||||
public long MaxSeSgrp { get; } // [JsonPropertyName("max_se_sgrp")]
|
||||
public long MinMinSeTest { get; } // [JsonPropertyName("min_min_se_test")]
|
||||
public string MinMinSeTestName { get; } // [JsonPropertyName("min_min_se_test_name")]
|
||||
public double MinMinSeVal { get; } // [JsonPropertyName("min_min_se_val")]
|
||||
public long MinSeSgrp { get; } // [JsonPropertyName("min_se_sgrp")]
|
||||
|
||||
[JsonConstructor]
|
||||
public Root(long countSeSgtm, DateTime dateTime, long maxMaxSeTest, string maxMaxSeTestName, double maxMaxSeVal, long maxSeLot, string maxSeLotName, long maxSePart, string maxSePartName, long maxSePrcs, string maxSePrcsName, long maxSeSgrp, long minMinSeTest, string minMinSeTestName, double minMinSeVal, long minSeSgrp)
|
||||
{
|
||||
CountSeSgtm = countSeSgtm;
|
||||
DateTime = dateTime;
|
||||
MaxMaxSeTest = maxMaxSeTest;
|
||||
MaxMaxSeTestName = maxMaxSeTestName;
|
||||
MaxMaxSeVal = maxMaxSeVal;
|
||||
MaxSeLot = maxSeLot;
|
||||
MaxSeLotName = maxSeLotName;
|
||||
MaxSePart = maxSePart;
|
||||
MaxSePartName = maxSePartName;
|
||||
MaxSePrcs = maxSePrcs;
|
||||
MaxSePrcsName = maxSePrcsName;
|
||||
MaxSeSgrp = maxSeSgrp;
|
||||
MinMinSeTest = minMinSeTest;
|
||||
MinMinSeTestName = minMinSeTestName;
|
||||
MinMinSeVal = minMinSeVal;
|
||||
MinSeSgrp = minSeSgrp;
|
||||
}
|
||||
|
||||
}
|
@ -19,7 +19,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
private readonly string _OpenInsightMetrologyViewerAPI;
|
||||
private readonly string _OpenInsightMetrologyViewerFileShare;
|
||||
|
||||
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) :
|
||||
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<WS.Results>> 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;
|
||||
@ -31,8 +31,8 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
throw new Exception(cellInstanceConnectionName);
|
||||
if (!_IsDuplicator)
|
||||
throw new Exception(cellInstanceConnectionName);
|
||||
_OpenInsightMetrologyViewerFileShare = @"\\messv02ecc1.ec.local\EC_Metrology_Si\MetrologyAttachments\SP1RunHeader_";
|
||||
_OpenInsightMetrologyViewerAPI = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "OpenInsight.MetrologyViewerAPI");
|
||||
_OpenInsightMetrologyViewerFileShare = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "OpenInsight.MetrologyViewerFileShare");
|
||||
}
|
||||
|
||||
void IFileRead.Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, Exception exception)
|
||||
@ -112,37 +112,42 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
|
||||
private void SendData(string reportFullPath, DateTime dateTime, List<txt.Description> descriptions)
|
||||
{
|
||||
string checkDirectory;
|
||||
WSRequest wsRequest = new(this, _Logistics, descriptions);
|
||||
int weekOfYear = _Calendar.GetWeekOfYear(dateTime, CalendarWeekRule.FirstDay, DayOfWeek.Sunday);
|
||||
string directory = Path.Combine(_OpenInsightMetrologyViewerFileShare, dateTime.Year.ToString(), $"WW{weekOfYear:00}", _Logistics.Sequence.ToString());
|
||||
if (!Directory.Exists(directory))
|
||||
_ = Directory.CreateDirectory(directory);
|
||||
string fullPath = Path.Combine(directory, Path.GetFileName(reportFullPath));
|
||||
File.Copy(reportFullPath, fullPath);
|
||||
WSRequest wsRequest = new(this, _Logistics, descriptions, fullPath);
|
||||
(string json, WS.Results wsResults) = WS.SendData(_OpenInsightMetrologyViewerAPI, wsRequest);
|
||||
if (!wsResults.Success)
|
||||
throw new Exception(wsResults.ToString());
|
||||
_Log.Debug(wsResults.HeaderID);
|
||||
string directory = Path.Combine(_OpenInsightMetrologyViewerFileShare, dateTime.Year.ToString(), $"WW{weekOfYear:00}");
|
||||
checkDirectory = Path.Combine(directory, _Logistics.Sequence.ToString());
|
||||
if (!Directory.Exists(checkDirectory))
|
||||
_ = Directory.CreateDirectory(checkDirectory);
|
||||
File.Copy(reportFullPath, Path.Combine(checkDirectory, Path.GetFileName(reportFullPath)), overwrite: true);
|
||||
(string jsonResults, WS.Results wsResults) = WS.SendData(_OpenInsightMetrologyViewerAPI, _Logistics.Sequence, directory, wsRequest);
|
||||
if (wsResults.Success is null || !wsResults.Success.Value)
|
||||
throw new Exception(jsonResults);
|
||||
_Log.Debug(wsResults.HeaderId);
|
||||
lock (_StaticRuns)
|
||||
{
|
||||
if (!_StaticRuns.ContainsKey(_Logistics.Sequence))
|
||||
_StaticRuns.Add(_Logistics.Sequence, new());
|
||||
_StaticRuns[_Logistics.Sequence].Add(json);
|
||||
_StaticRuns[_Logistics.Sequence].Add(wsResults);
|
||||
}
|
||||
checkDirectory = Path.Combine(directory, $"-{wsResults.HeaderId}");
|
||||
if (!Directory.Exists(checkDirectory))
|
||||
_ = Directory.CreateDirectory(checkDirectory);
|
||||
File.Copy(reportFullPath, Path.Combine(checkDirectory, Path.GetFileName(reportFullPath)), overwrite: true);
|
||||
}
|
||||
|
||||
private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime dateTime)
|
||||
{
|
||||
Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
|
||||
Tuple<string, string[], string[]> pdsf = ProcessDataStandardFormat.GetLogisticsColumnsAndBody(reportFullPath);
|
||||
_Logistics = new Logistics(reportFullPath, pdsf.Item1);
|
||||
ProcessDataStandardFormat processDataStandardFormat = ProcessDataStandardFormat.GetProcessDataStandardFormat(reportFullPath);
|
||||
_Logistics = new Logistics(reportFullPath, processDataStandardFormat);
|
||||
SetFileParameterLotIDToLogisticsMID();
|
||||
JsonElement[] jsonElements = ProcessDataStandardFormat.GetArray(pdsf);
|
||||
JsonElement[] jsonElements = ProcessDataStandardFormat.GetArray(processDataStandardFormat);
|
||||
List<txt.Description> descriptions = txt.ProcessData.GetDescriptions(jsonElements);
|
||||
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
|
||||
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
|
||||
SendData(reportFullPath, dateTime, descriptions);
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(pdsf.Item1, tests, jsonElements, new List<FileInfo>());
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics[0]), tests, jsonElements, new List<FileInfo>());
|
||||
return results;
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,6 @@ using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace Adaptation.FileHandlers.OpenInsightMetrologyViewer;
|
||||
|
||||
@ -16,6 +15,7 @@ public class WSRequest
|
||||
public bool SentToSPC { get; set; }
|
||||
//
|
||||
|
||||
public int Id { get; set; }
|
||||
public string CellName { get; set; }
|
||||
public string Date { get; set; }
|
||||
public string LotID { get; set; }
|
||||
@ -267,7 +267,6 @@ public class WSRequest
|
||||
public string DwnSlipMin { get; set; }
|
||||
public string DwnSlipStDev { get; set; }
|
||||
public List<txt.Detail> Details { get; protected set; }
|
||||
public string ProcessDataStandardFormat { get; set; }
|
||||
|
||||
[Obsolete("For json")] public WSRequest() { }
|
||||
|
||||
@ -275,7 +274,7 @@ public class WSRequest
|
||||
internal WSRequest(IFileRead fileRead, Logistics logistics, List<txt.Description> descriptions, string processDataStandardFormat = null)
|
||||
#pragma warning restore IDE0060
|
||||
{
|
||||
ProcessDataStandardFormat = processDataStandardFormat;
|
||||
Id = -1;
|
||||
Details = new List<txt.Detail>();
|
||||
CellName = logistics.MesEntity;
|
||||
txt.Description x = descriptions[0];
|
||||
@ -607,8 +606,12 @@ public class WSRequest
|
||||
Details.Add(detail);
|
||||
}
|
||||
Date = logistics.DateTimeFromSequence.ToString();
|
||||
if (UniqueID is null && Details.Any())
|
||||
UniqueID = Details[0].HeaderUniqueID;
|
||||
UniqueID = $"{logistics.JobID}_{logistics.MID}_{logistics.DateTimeFromSequence:yyyyMMddHHmmssffff}";
|
||||
for (int i = 0; i < Details.Count; i++)
|
||||
{
|
||||
Details[i].HeaderUniqueID = UniqueID;
|
||||
Details[i].UniqueID = $"{logistics.JobID}_{logistics.MID}_{logistics.DateTimeFromSequence:yyyyMMddHHmmssffff}_Item-{i + 1}";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -632,25 +635,31 @@ public class WSRequest
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static long GetHeaderId(IFileRead fileRead, Logistics logistics, string openInsightMetrologyViewerAPI, string openInsightMetrologyViewerFileShare, int weekOfYear, WS.Results results, List<txt.Description> descriptions)
|
||||
{
|
||||
long result;
|
||||
if (results is not null && results.HeaderId is not null)
|
||||
result = results.HeaderId.Value;
|
||||
else
|
||||
{
|
||||
WSRequest wsRequest = new(fileRead, logistics, descriptions);
|
||||
string directory = Path.Combine(openInsightMetrologyViewerFileShare, logistics.DateTimeFromSequence.Year.ToString(), $"WW{weekOfYear:00}");
|
||||
(_, WS.Results wsResults) = WS.SendData(openInsightMetrologyViewerAPI, logistics.Sequence, directory, wsRequest);
|
||||
if (wsResults.Success is null || !wsResults.Success.Value)
|
||||
throw new Exception(wsResults.ToString());
|
||||
result = wsResults.HeaderId.Value;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#pragma warning disable IDE0060
|
||||
internal static void PostOpenInsightMetrologyViewerAttachments(IFileRead fileRead, Logistics logistics, string openInsightMetrologyViewerAPI, string ghostPCLFileName, DateTime dateTime, string json, List<txt.Description> descriptions, string matchDirectory)
|
||||
internal static void PostOpenInsightMetrologyViewerAttachments(IFileRead fileRead, Logistics logistics, string openInsightMetrologyViewerAPI, string ghostPCLFileName, List<txt.Description> descriptions, string matchDirectory, WS.Results results, string headerIdDirectory)
|
||||
#pragma warning restore IDE0060
|
||||
{
|
||||
if (string.IsNullOrEmpty(json))
|
||||
{
|
||||
WSRequest wsRequest = new(fileRead, logistics, descriptions, string.Empty);
|
||||
(json, WS.Results wsResults) = WS.SendData(openInsightMetrologyViewerAPI, wsRequest);
|
||||
if (!wsResults.Success)
|
||||
throw new Exception(wsResults.ToString());
|
||||
}
|
||||
WS.Results metrologyWSRequest = JsonSerializer.Deserialize<WS.Results>(json, new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
|
||||
long wsResultsHeaderID = metrologyWSRequest.HeaderID;
|
||||
string[] summaryFiles = Directory.GetFiles(matchDirectory, "*.txt", SearchOption.TopDirectoryOnly);
|
||||
if (summaryFiles.Length != 1)
|
||||
throw new Exception($"Invalid source file count for <{wsResultsHeaderID}>!{Environment.NewLine}{json}");
|
||||
throw new Exception($"Invalid source file count for <{results.HeaderId}>!");
|
||||
string[] prnFiles = Directory.GetFiles(matchDirectory, "WaferMap*.prn", SearchOption.TopDirectoryOnly);
|
||||
if (prnFiles.Length == 0 || prnFiles.Length != descriptions.Count)
|
||||
throw new Exception("Invalid WaferMap*.prn file count!");
|
||||
List<string> pdfFiles = new();
|
||||
foreach (string prnFile in prnFiles.OrderBy(l => l))
|
||||
pdfFiles.Add(ConvertSourceFileToPdf(ghostPCLFileName, prnFile));
|
||||
@ -658,7 +667,9 @@ public class WSRequest
|
||||
throw new Exception("Invalid *.pdf file count!");
|
||||
List<WS.Attachment> dataAttachments = new();
|
||||
List<WS.Attachment> headerAttachments = new()
|
||||
{ new WS.Attachment(descriptions[0].HeaderUniqueId, "Data.txt", summaryFiles[0]) };
|
||||
{
|
||||
new WS.Attachment(results, headerIdDirectory, $"{logistics.JobID}_{logistics.MID}_{logistics.DateTimeFromSequence:yyyyMMddHHmmssffff}", "Data.txt", summaryFiles[0])
|
||||
};
|
||||
int count;
|
||||
if (pdfFiles.Count < descriptions.Count)
|
||||
count = pdfFiles.Count;
|
||||
@ -667,11 +678,11 @@ public class WSRequest
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(pdfFiles[i]))
|
||||
dataAttachments.Add(new WS.Attachment(descriptions[i].UniqueId, "Image.pdf", pdfFiles[i]));
|
||||
dataAttachments.Add(new WS.Attachment(results, headerIdDirectory, $"{logistics.JobID}_{logistics.MID}_{logistics.DateTimeFromSequence:yyyyMMddHHmmssffff}_Item-{i + 1}", "Image.pdf", pdfFiles[i]));
|
||||
}
|
||||
if (dataAttachments.Count == 0 || dataAttachments.Count != descriptions.Count)
|
||||
throw new Exception($"Invalid attachment count! {dataAttachments.Count} != {descriptions.Count}");
|
||||
WS.AttachFiles(openInsightMetrologyViewerAPI, wsResultsHeaderID, headerAttachments, dataAttachments);
|
||||
WS.AttachFiles(openInsightMetrologyViewerAPI, headerAttachments, dataAttachments);
|
||||
}
|
||||
|
||||
}
|
@ -5,6 +5,7 @@ using Adaptation.Shared.Duplicator;
|
||||
using Adaptation.Shared.Methods;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
@ -14,11 +15,11 @@ namespace Adaptation.FileHandlers.OpenInsightMetrologyViewerAttachments;
|
||||
public class FileRead : Shared.FileRead, IFileRead
|
||||
{
|
||||
|
||||
private readonly string _JobIdParentDirectory;
|
||||
private readonly string _GhostPCLFileName;
|
||||
private readonly string _OpenInsightMetrologyViewerAPI;
|
||||
private readonly string _OpenInsightMetrologyViewerFileShare;
|
||||
|
||||
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) :
|
||||
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<Shared.Metrology.WS.Results>> 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;
|
||||
@ -30,8 +31,8 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
throw new Exception(cellInstanceConnectionName);
|
||||
if (!_IsDuplicator)
|
||||
throw new Exception(cellInstanceConnectionName);
|
||||
_JobIdParentDirectory = GetJobIdParentDirectory(_FileConnectorConfiguration.SourceFileLocation);
|
||||
_OpenInsightMetrologyViewerAPI = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "OpenInsight.MetrologyViewerAPI");
|
||||
_OpenInsightMetrologyViewerFileShare = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "OpenInsight.MetrologyViewerFileShare");
|
||||
_GhostPCLFileName = Path.Combine(AppContext.BaseDirectory, "gpcl6win64.exe");
|
||||
if (!File.Exists(_GhostPCLFileName))
|
||||
throw new Exception("Ghost PCL FileName doesn't Exist!");
|
||||
@ -112,40 +113,69 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
return results;
|
||||
}
|
||||
|
||||
#pragma warning disable IDE0060
|
||||
private void PostOpenInsightMetrologyViewerAttachments(string reportFullPath, DateTime dateTime, List<txt.Description> descriptions)
|
||||
#pragma warning restore IDE0060
|
||||
#nullable enable
|
||||
|
||||
private string? GetHeaderIdDirectory(long headerId)
|
||||
{
|
||||
string jobIdDirectory = Path.Combine(_JobIdParentDirectory, _Logistics.JobID);
|
||||
string? result = null;
|
||||
int weekNum;
|
||||
string year;
|
||||
string weekDirectory;
|
||||
string checkDirectory;
|
||||
DateTime[] dateTimes = new DateTime[] { _Logistics.DateTimeFromSequence, _Logistics.DateTimeFromSequence.AddDays(-6.66) };
|
||||
foreach (DateTime dateTime in dateTimes)
|
||||
{
|
||||
year = dateTime.Year.ToString();
|
||||
weekNum = _Calendar.GetWeekOfYear(dateTime, CalendarWeekRule.FirstDay, DayOfWeek.Sunday);
|
||||
weekDirectory = Path.Combine(_OpenInsightMetrologyViewerFileShare, dateTime.Year.ToString(), $"WW{weekNum:00}");
|
||||
if (!Directory.Exists(weekDirectory))
|
||||
_ = Directory.CreateDirectory(weekDirectory);
|
||||
checkDirectory = Path.Combine(weekDirectory, $"-{headerId}");
|
||||
if (!Directory.Exists(checkDirectory))
|
||||
continue;
|
||||
result = checkDirectory;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void PostOpenInsightMetrologyViewerAttachments(List<txt.Description> descriptions)
|
||||
{
|
||||
Shared.Metrology.WS.Results? results;
|
||||
string jobIdDirectory = Path.Combine(Path.GetDirectoryName(_FileConnectorConfiguration.AlternateTargetFolder) ?? throw new Exception(), _Logistics.JobID);
|
||||
if (!Directory.Exists(jobIdDirectory))
|
||||
_ = Directory.CreateDirectory(jobIdDirectory);
|
||||
string json;
|
||||
string[] matchDirectories = GetInProcessDirectory(jobIdDirectory);
|
||||
if (!_StaticRuns.ContainsKey(_Logistics.Sequence))
|
||||
json = string.Empty;
|
||||
if (!_StaticRuns.TryGetValue(_Logistics.Sequence, out List<Shared.Metrology.WS.Results>? wsResults))
|
||||
results = null;
|
||||
else
|
||||
{
|
||||
if (_StaticRuns[_Logistics.Sequence].Count != 1)
|
||||
throw new Exception($"{nameof(_StaticRuns)} has too many values for {_Logistics.Sequence}!");
|
||||
json = _StaticRuns[_Logistics.Sequence][0];
|
||||
lock (_StaticRuns)
|
||||
_ = _StaticRuns.Remove(_Logistics.Sequence);
|
||||
if (wsResults is null || wsResults.Count != 1)
|
||||
throw new NullReferenceException($"{nameof(wsResults)} {wsResults?.Count} != 1 {_Logistics.Sequence}!");
|
||||
results = wsResults[0];
|
||||
}
|
||||
OpenInsightMetrologyViewer.WSRequest.PostOpenInsightMetrologyViewerAttachments(this, _Logistics, _OpenInsightMetrologyViewerAPI, _GhostPCLFileName, dateTime, json, descriptions, matchDirectories[0]);
|
||||
int weekOfYear = _Calendar.GetWeekOfYear(_Logistics.DateTimeFromSequence, CalendarWeekRule.FirstDay, DayOfWeek.Sunday);
|
||||
long headerId = !_IsEAFHosted ? -1 : OpenInsightMetrologyViewer.WSRequest.GetHeaderId(this, _Logistics, _OpenInsightMetrologyViewerAPI, _OpenInsightMetrologyViewerFileShare, weekOfYear, results, descriptions);
|
||||
string? headerIdDirectory = GetHeaderIdDirectory(headerId);
|
||||
if (string.IsNullOrEmpty(headerIdDirectory))
|
||||
throw new Exception($"Didn't find header id directory <{headerId}>");
|
||||
OpenInsightMetrologyViewer.WSRequest.PostOpenInsightMetrologyViewerAttachments(this, _Logistics, _OpenInsightMetrologyViewerAPI, _GhostPCLFileName, descriptions, matchDirectories[0], results, headerIdDirectory);
|
||||
}
|
||||
|
||||
private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime dateTime)
|
||||
{
|
||||
if (dateTime == DateTime.MinValue)
|
||||
throw new ArgumentNullException(nameof(dateTime));
|
||||
Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
|
||||
Tuple<string, string[], string[]> pdsf = ProcessDataStandardFormat.GetLogisticsColumnsAndBody(reportFullPath);
|
||||
_Logistics = new Logistics(reportFullPath, pdsf.Item1);
|
||||
ProcessDataStandardFormat processDataStandardFormat = ProcessDataStandardFormat.GetProcessDataStandardFormat(reportFullPath);
|
||||
_Logistics = new Logistics(reportFullPath, processDataStandardFormat);
|
||||
SetFileParameterLotIDToLogisticsMID();
|
||||
JsonElement[] jsonElements = ProcessDataStandardFormat.GetArray(pdsf);
|
||||
JsonElement[] jsonElements = ProcessDataStandardFormat.GetArray(processDataStandardFormat);
|
||||
List<txt.Description> descriptions = txt.ProcessData.GetDescriptions(jsonElements);
|
||||
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
|
||||
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
|
||||
PostOpenInsightMetrologyViewerAttachments(reportFullPath, dateTime, descriptions);
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(pdsf.Item1, tests, jsonElements, new List<FileInfo>());
|
||||
PostOpenInsightMetrologyViewerAttachments(descriptions);
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics[0]), tests, jsonElements, new List<FileInfo>());
|
||||
return results;
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
private readonly string _JobIdParentDirectory;
|
||||
private readonly string _JobIdProcessParentDirectory;
|
||||
|
||||
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) :
|
||||
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<Shared.Metrology.WS.Results>> 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;
|
||||
@ -108,10 +108,10 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
return results;
|
||||
}
|
||||
|
||||
#pragma warning disable IDE0060
|
||||
private void DirectoryMove(string reportFullPath, DateTime dateTime, List<txt.Description> descriptions)
|
||||
#pragma warning restore IDE0060
|
||||
{
|
||||
if (dateTime == DateTime.MinValue)
|
||||
throw new ArgumentNullException(nameof(dateTime));
|
||||
FileInfo fileInfo = new(reportFullPath);
|
||||
string logisticsSequence = _Logistics.Sequence.ToString();
|
||||
string jobIdDirectory = Path.Combine(_JobIdParentDirectory, _Logistics.JobID);
|
||||
@ -129,23 +129,50 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
string destinationJobIdDirectory = Path.Combine(_JobIdProcessParentDirectory, _Logistics.JobID, directoryName);
|
||||
string sequenceDirectory = Path.Combine(destinationJobIdDirectory, logisticsSequence);
|
||||
string jsonFileName = Path.Combine(sequenceDirectory, $"{Path.GetFileNameWithoutExtension(reportFullPath)}.json");
|
||||
MoveMatchingFile(jobIdDirectory, matchDirectories[0]);
|
||||
Directory.Move(matchDirectories[0], destinationJobIdDirectory);
|
||||
if (!Directory.Exists(sequenceDirectory))
|
||||
_ = Directory.CreateDirectory(sequenceDirectory);
|
||||
File.Copy(reportFullPath, Path.Combine(sequenceDirectory, Path.GetFileName(reportFullPath)), overwrite: true);
|
||||
File.WriteAllText(jsonFileName, json);
|
||||
lock (_StaticRuns)
|
||||
_ = _StaticRuns.Remove(_Logistics.Sequence);
|
||||
}
|
||||
|
||||
private static void MoveMatchingFile(string jobIdDirectory, string matchDirectory)
|
||||
{
|
||||
string checkFile;
|
||||
string jobIdDirectoryFileName;
|
||||
string matchDirectoryFileName;
|
||||
string[] jobIdDirectoryFiles = Directory.GetFiles(jobIdDirectory, "*", SearchOption.TopDirectoryOnly);
|
||||
string[] matchDirectoryFiles = Directory.GetFiles(matchDirectory, "*", SearchOption.TopDirectoryOnly);
|
||||
foreach (string jobIdDirectoryFile in jobIdDirectoryFiles)
|
||||
{
|
||||
jobIdDirectoryFileName = Path.GetFileName(jobIdDirectoryFile);
|
||||
foreach (string matchDirectoryFile in matchDirectoryFiles)
|
||||
{
|
||||
matchDirectoryFileName = Path.GetFileName(matchDirectoryFile);
|
||||
if (jobIdDirectoryFileName.StartsWith(matchDirectoryFileName))
|
||||
{
|
||||
checkFile = Path.Combine(matchDirectory, jobIdDirectoryFileName);
|
||||
if (File.Exists(checkFile))
|
||||
continue;
|
||||
File.Move(jobIdDirectoryFile, checkFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime dateTime)
|
||||
{
|
||||
Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
|
||||
Tuple<string, string[], string[]> pdsf = ProcessDataStandardFormat.GetLogisticsColumnsAndBody(reportFullPath);
|
||||
_Logistics = new Logistics(reportFullPath, pdsf.Item1);
|
||||
ProcessDataStandardFormat processDataStandardFormat = ProcessDataStandardFormat.GetProcessDataStandardFormat(reportFullPath);
|
||||
_Logistics = new Logistics(reportFullPath, processDataStandardFormat);
|
||||
SetFileParameterLotIDToLogisticsMID();
|
||||
JsonElement[] jsonElements = ProcessDataStandardFormat.GetArray(pdsf);
|
||||
JsonElement[] jsonElements = ProcessDataStandardFormat.GetArray(processDataStandardFormat);
|
||||
List<txt.Description> descriptions = txt.ProcessData.GetDescriptions(jsonElements);
|
||||
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(pdsf.Item1, tests, jsonElements, new List<FileInfo>());
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics[0]), tests, jsonElements, new List<FileInfo>());
|
||||
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
|
||||
DirectoryMove(reportFullPath, dateTime, descriptions);
|
||||
else if (!_IsEAFHosted)
|
||||
|
@ -14,7 +14,7 @@ namespace Adaptation.FileHandlers.SPaCe;
|
||||
public class FileRead : Shared.FileRead, IFileRead
|
||||
{
|
||||
|
||||
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) :
|
||||
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<Shared.Metrology.WS.Results>> 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;
|
||||
@ -117,15 +117,15 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime dateTime)
|
||||
{
|
||||
Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
|
||||
Tuple<string, string[], string[]> pdsf = ProcessDataStandardFormat.GetLogisticsColumnsAndBody(reportFullPath);
|
||||
_Logistics = new Logistics(reportFullPath, pdsf.Item1);
|
||||
ProcessDataStandardFormat processDataStandardFormat = ProcessDataStandardFormat.GetProcessDataStandardFormat(reportFullPath);
|
||||
_Logistics = new Logistics(reportFullPath, processDataStandardFormat);
|
||||
SetFileParameterLotIDToLogisticsMID();
|
||||
JsonElement[] jsonElements = ProcessDataStandardFormat.GetArray(pdsf);
|
||||
JsonElement[] jsonElements = ProcessDataStandardFormat.GetArray(processDataStandardFormat);
|
||||
List<Shared.Properties.IDescription> descriptions = GetDuplicatorDescriptions(jsonElements);
|
||||
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
|
||||
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
|
||||
FileCopy(reportFullPath, dateTime, descriptions);
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(pdsf.Item1, tests, jsonElements, new List<FileInfo>());
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics[0]), tests, jsonElements, new List<FileInfo>());
|
||||
return results;
|
||||
}
|
||||
|
||||
|
@ -6,21 +6,26 @@ using Adaptation.Shared.Methods;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace Adaptation.FileHandlers.TIBCO;
|
||||
|
||||
public class FileRead : Shared.FileRead, IFileRead
|
||||
{
|
||||
{ // cSpell:disable
|
||||
|
||||
#nullable enable
|
||||
|
||||
private long? _TickOffset;
|
||||
private readonly string _BarcodeHostFileShare;
|
||||
public const string BarcodeHostFileShare = @"\\mesfs.infineon.com\EC_Metrology_Si\BarcodeHost\API";
|
||||
public const string MetrologyFileShare = @"\\mesfs.infineon.com\EC_Metrology_Si\WorkMaterialOut\API";
|
||||
public const string OpenInsightApplicationProgrammingInterface = @"http://oi-metrology-viewer-api.mes.infineon.com:8080/api/oiWizard";
|
||||
public const string LSL2SQLConnectionString = @"Data Source=messqlec1.infineon.com\PROD1,53959;Initial Catalog=LSL2SQL;Persist Security Info=True;User ID=srpadmin;Password=0okm9ijn;";
|
||||
|
||||
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) :
|
||||
private long? _TickOffset;
|
||||
|
||||
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<Shared.Metrology.WS.Results>> 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)
|
||||
{
|
||||
{ // cSpell:restore
|
||||
_MinFileLength = 10;
|
||||
_NullData = string.Empty;
|
||||
_Logistics = new(this);
|
||||
@ -30,22 +35,32 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
throw new Exception(cellInstanceConnectionName);
|
||||
if (!_IsDuplicator)
|
||||
throw new Exception(cellInstanceConnectionName);
|
||||
string metrologyFileShare = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "Metrology.FileShare");
|
||||
_BarcodeHostFileShare = @"\\messv02ecc1.ec.local\EC_Metrology_Si\BarcodeHost\API"; // GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "BarcodeHost.FileShare");
|
||||
string barcodeHostFileShare = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "Barcode.Host.FileShare");
|
||||
if (barcodeHostFileShare != BarcodeHostFileShare)
|
||||
throw new NotSupportedException($"Update configuration for [{nameof(BarcodeHostFileShare)}]");
|
||||
string lsl2SQLConnectionString = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "ConnectionString.LSL2SQL");
|
||||
if (lsl2SQLConnectionString != LSL2SQLConnectionString)
|
||||
throw new NotSupportedException($"Update configuration for [{nameof(LSL2SQLConnectionString)}]");
|
||||
string metrologyFileShare = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "Metrology.FileShare");
|
||||
if (metrologyFileShare != MetrologyFileShare)
|
||||
throw new NotSupportedException($"Update configuration for [{nameof(MetrologyFileShare)}]");
|
||||
string openInsightApplicationProgrammingInterface = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "OpenInsight.Application.Programming.Interface");
|
||||
if (openInsightApplicationProgrammingInterface != OpenInsightApplicationProgrammingInterface)
|
||||
throw new NotSupportedException($"Update configuration for [{nameof(OpenInsightApplicationProgrammingInterface)}]");
|
||||
ModelObjectParameterDefinition[] tibcoParameters = GetProperties(cellInstanceConnectionName, modelObjectParameters, "TIBCO.");
|
||||
string tibcoParameterChannel = GetPropertyValue(cellInstanceConnectionName, tibcoParameters, "TIBCO.IFX_CHANNEL");
|
||||
string tibcoParameterSubject = GetPropertyValue(cellInstanceConnectionName, tibcoParameters, "TIBCO.IFX_SUBJECT");
|
||||
string tibcoParameterSubjectPrefix = GetPropertyValue(cellInstanceConnectionName, tibcoParameters, "TIBCO.IFX_SUBJECT_PREFIX");
|
||||
string tibcoParameterConfigurationLocation = GetPropertyValue(cellInstanceConnectionName, tibcoParameters, "TIBCO.IFX_CONFIGURATION_LOCATION");
|
||||
string tibcoParameterConfigurationLocationCopy = GetPropertyValue(cellInstanceConnectionName, tibcoParameters, "TIBCO.IFX_CONFIGURATION_LOCATION_LOCAL_COPY");
|
||||
if (!Directory.Exists(metrologyFileShare))
|
||||
throw new Exception($"Unable to access file-share <{metrologyFileShare}>");
|
||||
if (!Directory.Exists(_BarcodeHostFileShare))
|
||||
throw new Exception($"Unable to access file-share <{_BarcodeHostFileShare}>");
|
||||
if (!Directory.Exists(MetrologyFileShare))
|
||||
throw new Exception($"Unable to access file-share <{MetrologyFileShare}>");
|
||||
if (!Directory.Exists(BarcodeHostFileShare))
|
||||
throw new Exception($"Unable to access file-share <{BarcodeHostFileShare}>");
|
||||
if (_IsEAFHosted)
|
||||
{
|
||||
Transport.Main.Initialize(smtp, cellInstanceName, fileConnectorConfiguration, lsl2SQLConnectionString, metrologyFileShare, _BarcodeHostFileShare);
|
||||
HttpClient httpClient = new() { BaseAddress = new(OpenInsightApplicationProgrammingInterface) };
|
||||
Transport.Main.Initialize(smtp, cellInstanceName, fileConnectorConfiguration, LSL2SQLConnectionString, MetrologyFileShare, BarcodeHostFileShare, httpClient);
|
||||
if (!string.IsNullOrEmpty(fileConnectorConfiguration.SourceFileLocation))
|
||||
_ = Transport.Main.Setup(useSleep: true, setIfxTransport: true, tibcoParameterChannel, tibcoParameterSubjectPrefix, tibcoParameterConfigurationLocation, tibcoParameterConfigurationLocationCopy, tibcoParameterSubject);
|
||||
else
|
||||
@ -130,8 +145,10 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
|
||||
private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime dateTime)
|
||||
{
|
||||
if (dateTime == DateTime.MinValue)
|
||||
throw new ArgumentNullException(nameof(dateTime));
|
||||
Tuple<string, Test[], JsonElement[], List<FileInfo>> results = new(string.Empty, Array.Empty<Test>(), Array.Empty<JsonElement>(), new List<FileInfo>());
|
||||
_TickOffset ??= new FileInfo(reportFullPath).LastWriteTime.Ticks - dateTime.Ticks;
|
||||
_TickOffset ??= 0; // new FileInfo(reportFullPath).LastWriteTime.Ticks - dateTime.Ticks;
|
||||
_Logistics = new Logistics(this, _TickOffset.Value, reportFullPath, useSplitForMID: true);
|
||||
SetFileParameterLotIDToLogisticsMID();
|
||||
return results;
|
||||
|
30
Adaptation/FileHandlers/TIBCO/Transport/Common.cs
Normal file
30
Adaptation/FileHandlers/TIBCO/Transport/Common.cs
Normal file
@ -0,0 +1,30 @@
|
||||
namespace Adaptation.FileHandlers.TIBCO.Transport;
|
||||
|
||||
#nullable enable
|
||||
|
||||
public class Common
|
||||
{
|
||||
|
||||
public string? Layer { get; }
|
||||
public string? PSN { get; }
|
||||
public int? RDSNumber { get; }
|
||||
public int? ReactorNumber { get; }
|
||||
public string? Zone { get; }
|
||||
public string? Employee { get; }
|
||||
|
||||
public Common(string? layer,
|
||||
string? psn,
|
||||
int? rdsNumber,
|
||||
int? reactor,
|
||||
string? zone,
|
||||
string? employee)
|
||||
{
|
||||
Layer = layer;
|
||||
PSN = psn;
|
||||
RDSNumber = rdsNumber;
|
||||
ReactorNumber = reactor;
|
||||
Zone = zone;
|
||||
Employee = employee;
|
||||
}
|
||||
|
||||
}
|
23
Adaptation/FileHandlers/TIBCO/Transport/CommonB.cs
Normal file
23
Adaptation/FileHandlers/TIBCO/Transport/CommonB.cs
Normal file
@ -0,0 +1,23 @@
|
||||
namespace Adaptation.FileHandlers.TIBCO.Transport;
|
||||
|
||||
public class CommonB
|
||||
{
|
||||
|
||||
public string Comment { get; }
|
||||
public string Layer { get; }
|
||||
public int? RDSNumber { get; }
|
||||
public string PSN { get; }
|
||||
public int? ReactorNumber { get; }
|
||||
public string Zone { get; }
|
||||
|
||||
public CommonB(string comment, string layer, int? rdsNumber, string psn, int? reactorNumber, string zone)
|
||||
{
|
||||
Comment = comment;
|
||||
Layer = layer;
|
||||
RDSNumber = rdsNumber;
|
||||
PSN = psn;
|
||||
ReactorNumber = reactorNumber;
|
||||
Zone = zone;
|
||||
}
|
||||
|
||||
}
|
@ -1,14 +1,46 @@
|
||||
namespace Adaptation.FileHandlers.TIBCO.Transport;
|
||||
|
||||
#nullable enable
|
||||
|
||||
public class Input
|
||||
{
|
||||
|
||||
public string Area { get; set; }
|
||||
public string EquipmentType { get; set; }
|
||||
public string MID { get; set; }
|
||||
public string Slot { get; set; }
|
||||
public string MesEntity { get; set; }
|
||||
public string Recipe { get; set; }
|
||||
public string Sequence { get; set; }
|
||||
public string? Area { get; }
|
||||
public string? EquipmentType { get; }
|
||||
public string? MID { get; }
|
||||
public string? Slot { get; }
|
||||
public string? MesEntity { get; }
|
||||
public string? Recipe { get; }
|
||||
public string? Sequence { get; }
|
||||
|
||||
[System.Text.Json.Serialization.JsonConstructor]
|
||||
public Input(string? area,
|
||||
string? equipmentType,
|
||||
string? mid,
|
||||
string? slot,
|
||||
string? mesEntity,
|
||||
string? recipe,
|
||||
string? sequence)
|
||||
{
|
||||
|
||||
Area = area;
|
||||
EquipmentType = equipmentType;
|
||||
MID = mid;
|
||||
Slot = slot;
|
||||
MesEntity = mesEntity;
|
||||
Recipe = recipe;
|
||||
Sequence = sequence;
|
||||
}
|
||||
|
||||
internal Input(Input input, string? mid)
|
||||
{
|
||||
Area = input.Area;
|
||||
EquipmentType = input.EquipmentType;
|
||||
MID = mid;
|
||||
Slot = input.Slot;
|
||||
MesEntity = input.MesEntity;
|
||||
Recipe = input.Recipe;
|
||||
Sequence = input.Sequence;
|
||||
}
|
||||
|
||||
}
|
@ -5,41 +5,43 @@ using System.Data.SqlClient;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Adaptation.FileHandlers.TIBCO.Transport;
|
||||
|
||||
public class Job
|
||||
#nullable enable
|
||||
|
||||
public partial class Job
|
||||
{
|
||||
|
||||
#nullable restore
|
||||
|
||||
public string AutomationMode { get; }
|
||||
public string BasicType { get; }
|
||||
public string CreationUser { get; }
|
||||
public string Equipment { get; }
|
||||
public string JobName { get; }
|
||||
public string LastUpdateUser { get; }
|
||||
public string LotName { get; }
|
||||
public string LotState { get; }
|
||||
public string PackageName { get; }
|
||||
public string ProcessSpecName { get; }
|
||||
public string ProcessType { get; }
|
||||
public string ProductName { get; }
|
||||
public string Qty { get; }
|
||||
public string Qty2 { get; }
|
||||
public string RecipeName { get; }
|
||||
public string SpecName { get; }
|
||||
public string StateModel { get; }
|
||||
public string Status { get; }
|
||||
public string? AutomationMode { get; }
|
||||
public string? BasicType { get; }
|
||||
public string? CreationUser { get; }
|
||||
public string? Equipment { get; }
|
||||
public string? JobName { get; }
|
||||
public string? LastUpdateUser { get; }
|
||||
public string? LotName { get; }
|
||||
public string? LotState { get; }
|
||||
public string? PackageName { get; }
|
||||
public string? ProcessSpecName { get; }
|
||||
public string? ProcessType { get; }
|
||||
public string? ProductName { get; }
|
||||
public string? Qty { get; }
|
||||
public string? Qty2 { get; }
|
||||
public string? RecipeName { get; }
|
||||
public string? SpecName { get; }
|
||||
public string? StateModel { get; }
|
||||
public string? Status { get; }
|
||||
//
|
||||
public bool IsAreaSi { get; }
|
||||
public DateTime DateTime { get; }
|
||||
public List<Item> Items { get; }
|
||||
|
||||
public Job(string lsl2SQLConnectionString, string metrologyFileShare, string barcodeHostFileShare, string mid)
|
||||
public Job(string lsl2SQLConnectionString, string metrologyFileShare, string barcodeHostFileShare, HttpClient httpClient, string mid)
|
||||
{
|
||||
const int zero = 0;
|
||||
Items = new List<Item>();
|
||||
@ -47,33 +49,53 @@ public class Job
|
||||
IsAreaSi = false;
|
||||
else
|
||||
{
|
||||
string psn;
|
||||
string zone;
|
||||
string layer;
|
||||
int? rdsNumber;
|
||||
string comment;
|
||||
Common common;
|
||||
CommonB commonB;
|
||||
int? reactorNumber;
|
||||
WorkOrder workOrder;
|
||||
const string hyphen = "-";
|
||||
Input input = JsonSerializer.Deserialize<Input>(mid);
|
||||
const string bioRad2 = "BIORAD2";
|
||||
const string bioRad3 = "BIORAD3";
|
||||
const string twoAlphaPattern = "^[a-zA-z]{2,3}";
|
||||
const string reactorNumberPattern = @"^[0-9]{2}--";
|
||||
Input input = JsonSerializer.Deserialize<Input>(mid) ?? throw new Exception();
|
||||
if (!long.TryParse(input.Sequence, out long sequence))
|
||||
DateTime = DateTime.Now;
|
||||
else
|
||||
DateTime = new DateTime(sequence);
|
||||
int? reactorNumber = GetReactorNumber(input);
|
||||
(int? workOrderNumber, int? _, int? workOrderCassette, int? slotNumber, bool isWorkOrder) = GetWorkOrder(input);
|
||||
if (isWorkOrder || reactorNumber.HasValue)
|
||||
(layer, psn, rdsNumber, zone) = (string.Empty, string.Empty, null, string.Empty);
|
||||
else if (!string.IsNullOrEmpty(input.MID) && input.MID.Length is 2 or 3 && Regex.IsMatch(input.MID, "^[a-zA-z]{2,3}"))
|
||||
(layer, psn, rdsNumber, reactorNumber, zone) = Get(metrologyFileShare, input);
|
||||
else if (!string.IsNullOrEmpty(input.MID) && !string.IsNullOrEmpty(input.MesEntity) && input.MesEntity is "BIORAD2" or "BIORAD3" && Regex.IsMatch(input.MID, @"^[0-9]{2}[.][0-9]{1}[.]?[0-9]{0,1}"))
|
||||
(layer, psn, rdsNumber, reactorNumber, zone) = Get(input, barcodeHostFileShare);
|
||||
const string dep08CEPIEPSILON = "DEP08CEPIEPSILON";
|
||||
if (input.EquipmentType == dep08CEPIEPSILON)
|
||||
(common, workOrder) = Get(input, httpClient);
|
||||
else if (!string.IsNullOrEmpty(input.MID) && !string.IsNullOrEmpty(input.MesEntity) && Regex.IsMatch(input.MID, reactorNumberPattern) && input.MesEntity is bioRad2 or bioRad3)
|
||||
(common, workOrder) = Get(input, barcodeHostFileShare);
|
||||
else
|
||||
(layer, psn, rdsNumber, reactorNumber, zone) = Get(input);
|
||||
if (IsValid(rdsNumber))
|
||||
(comment, layer, rdsNumber, psn, reactorNumber, zone) = GetWithValidRDS(lsl2SQLConnectionString, layer, psn, rdsNumber, reactorNumber, zone);
|
||||
else if (isWorkOrder || reactorNumber.HasValue)
|
||||
(comment, layer, rdsNumber, psn, reactorNumber, zone) = Get(lsl2SQLConnectionString, layer, psn, reactorNumber, slotNumber, workOrderNumber, workOrderCassette, zone);
|
||||
{
|
||||
workOrder = GetWorkOrder(input);
|
||||
reactorNumber = GetReactorNumber(input);
|
||||
if (workOrder.IsWorkOrder || reactorNumber.HasValue)
|
||||
common = new(layer: null,
|
||||
psn: null,
|
||||
rdsNumber: null,
|
||||
reactor: null,
|
||||
zone: null,
|
||||
employee: null);
|
||||
else if (!string.IsNullOrEmpty(input.MID) && input.MID.Length is 2 or 3 && Regex.IsMatch(input.MID, twoAlphaPattern))
|
||||
common = GetTwoAlphaPattern(metrologyFileShare, input);
|
||||
else
|
||||
(comment, layer, zone) = (hyphen, hyphen, hyphen);
|
||||
common = Get(input);
|
||||
}
|
||||
bool isValid = IsValid(common.RDSNumber);
|
||||
if (isValid)
|
||||
commonB = GetWithValidRDS(lsl2SQLConnectionString, common.Layer, common.PSN, common.RDSNumber, common.ReactorNumber, common.Zone);
|
||||
else if (workOrder.IsWorkOrder || common.RDSNumber.HasValue)
|
||||
commonB = Get(lsl2SQLConnectionString, common.Layer, common.PSN, common.ReactorNumber, workOrder.SlotNumber, workOrder.WorkOrderNumber, workOrder.WorkOrderCassette, common.Zone);
|
||||
else
|
||||
commonB = new(comment: hyphen,
|
||||
layer: hyphen,
|
||||
rdsNumber: common.RDSNumber,
|
||||
psn: common.PSN,
|
||||
reactorNumber: common.ReactorNumber,
|
||||
zone: hyphen);
|
||||
Qty = "1";
|
||||
Status = hyphen; // INFO
|
||||
CreationUser = hyphen; // ?
|
||||
@ -86,13 +108,13 @@ public class Job
|
||||
IsAreaSi = input.Area == "Si"; // N/A
|
||||
StateModel = input.EquipmentType; // ?
|
||||
JobName = DateTime.Ticks.ToString(); // ?
|
||||
SpecName = !string.IsNullOrEmpty(layer) ? layer : hyphen; // LAYER
|
||||
ProductName = !string.IsNullOrEmpty(psn) ? psn : hyphen; // PRODUCT
|
||||
AutomationMode = string.Concat(DateTime.Ticks, ".", input.MesEntity); // ?
|
||||
ProcessSpecName = !string.IsNullOrEmpty(zone) ? zone : hyphen; // WAFER_POS
|
||||
BasicType = !string.IsNullOrEmpty(comment) ? comment : hyphen; // BASIC_TYPE
|
||||
LotName = rdsNumber is not null ? rdsNumber.Value.ToString() : hyphen; // MID
|
||||
ProcessType = reactorNumber is not null ? reactorNumber.Value.ToString() : hyphen; // PROCESS_JOBID
|
||||
SpecName = !string.IsNullOrEmpty(commonB.Layer) ? commonB.Layer : hyphen; // LAYER
|
||||
ProductName = !string.IsNullOrEmpty(commonB.PSN) ? commonB.PSN : hyphen; // PRODUCT
|
||||
ProcessSpecName = !string.IsNullOrEmpty(commonB.Zone) ? commonB.Zone : hyphen; // WAFER_POS
|
||||
BasicType = !string.IsNullOrEmpty(commonB.Comment) ? commonB.Comment : hyphen; // BASIC_TYPE
|
||||
LotName = commonB.RDSNumber is not null ? commonB.RDSNumber.Value.ToString() : input.MID; // MID
|
||||
ProcessType = commonB.ReactorNumber is not null ? commonB.ReactorNumber.Value.ToString() : hyphen; // PROCESS_JOBID
|
||||
Items.Add(new Item { Name = "0", Type = "NA", Number = (0 + 1).ToString(), Qty = "1", CarrierName = hyphen });
|
||||
}
|
||||
}
|
||||
@ -110,8 +132,9 @@ public class Job
|
||||
return result;
|
||||
}
|
||||
|
||||
private static (int?, int?, int?, int?, bool) GetWorkOrder(Input input)
|
||||
private static WorkOrder GetWorkOrder(Input input)
|
||||
{
|
||||
WorkOrder result;
|
||||
int? slotNumber;
|
||||
int? workOrderStep = null;
|
||||
int? workOrderNumber = null;
|
||||
@ -145,48 +168,53 @@ public class Job
|
||||
slotNumber = null;
|
||||
else
|
||||
slotNumber = slot;
|
||||
return new(workOrderNumber, workOrderStep, workOrderCassette, slotNumber, workOrderStep is not null || workOrderNumber is not null || workOrderCassette is not null);
|
||||
result = new(workOrderNumber: workOrderNumber,
|
||||
workOrderStep: workOrderStep,
|
||||
workOrderCassette: workOrderCassette,
|
||||
slotNumber: slotNumber,
|
||||
isWorkOrder: workOrderStep is not null || workOrderNumber is not null || workOrderCassette is not null);
|
||||
return result;
|
||||
}
|
||||
|
||||
private static bool IsValid(int? rdsNumber) => !IsInvalid(rdsNumber);
|
||||
|
||||
private static bool IsInvalid(int? rdsNumber) => rdsNumber is null or < 100000 or > 100000000;
|
||||
|
||||
private static (string, string) GetReactorAndRDS(string defaultReactor, string defaultRDS, string text, string formattedText, string[] segments)
|
||||
private static (string?, string?) GetReactorAndRDS(string? text, string formattedText, string[] segments)
|
||||
{
|
||||
string rds;
|
||||
string reactor;
|
||||
if (string.IsNullOrEmpty(text) || segments.Length == 0 || string.IsNullOrEmpty(formattedText))
|
||||
reactor = defaultReactor;
|
||||
string? rds;
|
||||
string? reactor;
|
||||
if (string.IsNullOrEmpty(text) || segments.Length < 1 || string.IsNullOrEmpty(formattedText))
|
||||
reactor = null;
|
||||
else
|
||||
reactor = segments[0];
|
||||
if (segments.Length <= 1 || !int.TryParse(segments[1], out int rdsValue) || rdsValue < 99)
|
||||
rds = defaultRDS;
|
||||
if (segments.Length < 2 || !int.TryParse(segments[1], out int rdsValue) || rdsValue < 99)
|
||||
rds = null;
|
||||
else
|
||||
rds = segments[1];
|
||||
if (reactor.Length > 3)
|
||||
if (!string.IsNullOrEmpty(reactor) && reactor.Length > 3)
|
||||
{
|
||||
rds = reactor;
|
||||
reactor = defaultReactor;
|
||||
reactor = null;
|
||||
}
|
||||
return new(reactor, rds);
|
||||
}
|
||||
|
||||
private static (string, string) GetLayerAndPSN(string defaultLayer, string defaultPSN, string[] segments)
|
||||
private static (string?, string?) GetLayerAndPSN(string[] segments)
|
||||
{
|
||||
string psn;
|
||||
string layer;
|
||||
string? psn;
|
||||
string? layer;
|
||||
if (segments.Length <= 2)
|
||||
{
|
||||
psn = defaultPSN;
|
||||
layer = defaultLayer;
|
||||
psn = null;
|
||||
layer = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
string[] segmentsB = segments[2].Split('.');
|
||||
psn = segmentsB[0];
|
||||
if (segmentsB.Length <= 1)
|
||||
layer = defaultLayer;
|
||||
layer = null;
|
||||
else
|
||||
{
|
||||
layer = segmentsB[1];
|
||||
@ -197,11 +225,11 @@ public class Job
|
||||
return (layer, psn);
|
||||
}
|
||||
|
||||
private static string GetZone(string[] segments)
|
||||
private static string? GetZone(string[] segments)
|
||||
{
|
||||
string result;
|
||||
string? result;
|
||||
if (segments.Length <= 3)
|
||||
result = string.Empty;
|
||||
result = null;
|
||||
else
|
||||
{
|
||||
result = segments[3];
|
||||
@ -211,41 +239,47 @@ public class Job
|
||||
return result;
|
||||
}
|
||||
|
||||
private static (string, string, int, int?, string) Get(Input input)
|
||||
private static Common Get(Input input)
|
||||
{
|
||||
string psn;
|
||||
string rds;
|
||||
string zone;
|
||||
string layer;
|
||||
int rdsNumber;
|
||||
string reactor;
|
||||
string? psn;
|
||||
string? rds;
|
||||
int rdsCheck;
|
||||
string? zone;
|
||||
string? layer;
|
||||
int? rdsNumber;
|
||||
string? reactor;
|
||||
string? employee;
|
||||
int? reactorNumber;
|
||||
string defaultPSN = string.Empty;
|
||||
string defaultRDS = string.Empty;
|
||||
string defaultLayer = string.Empty;
|
||||
string defaultReactor = string.Empty;
|
||||
string[] segments = input.MID.Split(new char[] { '-' });
|
||||
// bool hasRDS = Regex.IsMatch(input.MID, "[-]?([QP][0-9]{4,}|[0-9]{5,})[-]?");
|
||||
string formattedText = Regex.Replace(input.MID, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0];
|
||||
(reactor, rds) = GetReactorAndRDS(defaultReactor, defaultRDS, input.MID, formattedText, segments);
|
||||
if (string.IsNullOrEmpty(rds) || segments.Length < 2)
|
||||
rdsNumber = 0;
|
||||
else
|
||||
_ = int.TryParse(segments[1], out rdsNumber);
|
||||
if (IsInvalid(rdsNumber) || !int.TryParse(reactor, out int reactorCheck))
|
||||
string mid = string.IsNullOrEmpty(input.MID) ? string.Empty : input.MID;
|
||||
if (mid.Length > 2 && mid[0] == '1' && (mid[1] == 'T' || mid[1] == 't'))
|
||||
mid = mid.Substring(2);
|
||||
mid = Regex.Replace(mid, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0];
|
||||
string[] segments = mid.Split(new char[] { '-' });
|
||||
// bool hasRDS = Regex.IsMatch(mid, "[-]?([QP][0-9]{4,}|[0-9]{5,})[-]?");
|
||||
(reactor, rds) = GetReactorAndRDS(input.MID, mid, segments);
|
||||
rdsNumber = string.IsNullOrEmpty(rds) || !int.TryParse(rds, out rdsCheck) ? null : rdsCheck;
|
||||
bool isInvalid = IsInvalid(rdsNumber);
|
||||
if (isInvalid || !int.TryParse(reactor, out int reactorCheck))
|
||||
{
|
||||
psn = string.Empty;
|
||||
zone = string.Empty;
|
||||
layer = string.Empty;
|
||||
psn = null;
|
||||
zone = null;
|
||||
layer = null;
|
||||
employee = null;
|
||||
reactorNumber = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
reactorNumber = reactorCheck;
|
||||
(layer, psn) = GetLayerAndPSN(defaultLayer, defaultPSN, segments);
|
||||
zone = GetZone(segments);
|
||||
reactorNumber = reactorCheck;
|
||||
(layer, psn) = GetLayerAndPSN(segments);
|
||||
employee = segments.Length <= 4 ? null : segments[4];
|
||||
}
|
||||
return new(layer, psn, rdsNumber, reactorNumber, zone);
|
||||
return new(layer: layer,
|
||||
psn: psn,
|
||||
rdsNumber: rdsNumber,
|
||||
reactor: reactorNumber,
|
||||
zone: zone,
|
||||
employee: employee);
|
||||
}
|
||||
|
||||
private static string[] GetDirectories(string fileShare)
|
||||
@ -262,18 +296,16 @@ public class Job
|
||||
};
|
||||
}
|
||||
|
||||
#nullable enable
|
||||
|
||||
private static (string, string, int?, int?, string) Get(string metrologyFileShare, Input input)
|
||||
private static Common GetTwoAlphaPattern(string metrologyFileShare, Input input)
|
||||
{
|
||||
string lines;
|
||||
const int zero = 0;
|
||||
string? psn = null;
|
||||
int? reactor = null;
|
||||
string? zone = null;
|
||||
string? layer = null;
|
||||
int? rdsNumber = null;
|
||||
string psn = string.Empty;
|
||||
List<string> files = new();
|
||||
string zone = string.Empty;
|
||||
string layer = string.Empty;
|
||||
WorkMaterialOut? workMaterialOut;
|
||||
if (string.IsNullOrEmpty(metrologyFileShare) || !Directory.Exists(metrologyFileShare))
|
||||
throw new Exception($"Unable to access file-share <{metrologyFileShare}>");
|
||||
@ -305,46 +337,166 @@ public class Job
|
||||
zone = workMaterialOut.Zone;
|
||||
break;
|
||||
}
|
||||
return new(layer, psn, rdsNumber, reactor, zone);
|
||||
return new(layer: layer,
|
||||
psn: psn,
|
||||
rdsNumber: rdsNumber,
|
||||
reactor: reactor,
|
||||
zone: zone,
|
||||
employee: null);
|
||||
}
|
||||
|
||||
private static (string, string, int?, int?, string) Get(Input input, string barcodeHostFileShare)
|
||||
{
|
||||
string text;
|
||||
int? rds = null;
|
||||
string psn = string.Empty;
|
||||
List<string> files = new();
|
||||
string[] segments = input.MID.Split('.');
|
||||
string layer = segments[1];
|
||||
string zone = segments.Length <= 2 ? string.Empty : segments[2];
|
||||
int? reactor = !int.TryParse(segments[0], out int reactorNumber) ? null : reactorNumber;
|
||||
if (string.IsNullOrEmpty(barcodeHostFileShare) || !Directory.Exists(barcodeHostFileShare))
|
||||
throw new Exception($"Unable to access file-share <{barcodeHostFileShare}>");
|
||||
if (!string.IsNullOrEmpty(input.MID))
|
||||
private static List<string> GetFiles(Input input, string barcodeHostFileShare)
|
||||
{
|
||||
List<string> results = new();
|
||||
string[] checkDirectories = GetDirectories(barcodeHostFileShare);
|
||||
foreach (string checkDirectory in checkDirectories)
|
||||
{
|
||||
if (!Directory.Exists(checkDirectory))
|
||||
_ = Directory.CreateDirectory(checkDirectory);
|
||||
files.AddRange(Directory.GetFiles(checkDirectory, $"{input.MesEntity}.csv", SearchOption.TopDirectoryOnly));
|
||||
results.AddRange(Directory.GetFiles(checkDirectory, $"{input.MesEntity}.csv", SearchOption.TopDirectoryOnly));
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
private static string? GetText(long sequence, List<string> files)
|
||||
{
|
||||
string? result = null;
|
||||
string text;
|
||||
string[] lines;
|
||||
FileInfo fileInfo;
|
||||
foreach (string file in files.OrderByDescending(l => new FileInfo(l).LastWriteTime))
|
||||
{
|
||||
text = File.ReadAllText(file);
|
||||
rds = !int.TryParse(segments[0], out int rdsNumber) ? null : rdsNumber;
|
||||
fileInfo = new FileInfo(file);
|
||||
if (fileInfo.LastWriteTime.Ticks > sequence)
|
||||
continue;
|
||||
lines = File.ReadAllLines(file);
|
||||
if (lines.Length == 0)
|
||||
continue;
|
||||
text = lines.First();
|
||||
if (string.IsNullOrEmpty(text) || text.Length < 3 || text[0] != '1' || (text[1] != 't' && text[1] != 'T'))
|
||||
continue;
|
||||
result = text;
|
||||
break;
|
||||
}
|
||||
return new(layer, psn, rds, reactor, zone);
|
||||
return result;
|
||||
}
|
||||
|
||||
private static (Common common, WorkOrder workOrder) Get(Input input, HttpClient httpClient)
|
||||
{
|
||||
int? rds;
|
||||
string psn;
|
||||
Common common;
|
||||
WorkOrder workOrder;
|
||||
Task<Stream> streamTask;
|
||||
Task<HttpResponseMessage> httpResponseMessageTask;
|
||||
string mid = string.IsNullOrEmpty(input.MID) ? string.Empty : input.MID;
|
||||
JsonSerializerOptions jsonSerializerOptions = new() { PropertyNameCaseInsensitive = true };
|
||||
int? reactor = mid.Length < 2 || !int.TryParse(mid.Substring(0, 2), out int reactorNumber) ? null : reactorNumber;
|
||||
httpResponseMessageTask = httpClient.GetAsync($"{httpClient.BaseAddress}/reactors/{reactor}");
|
||||
httpResponseMessageTask.Wait();
|
||||
if (httpResponseMessageTask.Result.StatusCode != System.Net.HttpStatusCode.OK)
|
||||
throw new Exception($"Unable to OI <{httpResponseMessageTask.Result.StatusCode}>");
|
||||
streamTask = httpResponseMessageTask.Result.Content.ReadAsStreamAsync();
|
||||
streamTask.Wait();
|
||||
if (!streamTask.Result.CanRead)
|
||||
throw new NullReferenceException(nameof(streamTask));
|
||||
ReactorRoot? reactorRoot = JsonSerializer.Deserialize<ReactorRoot>(streamTask.Result, jsonSerializerOptions);
|
||||
streamTask.Result.Dispose();
|
||||
if (reactorRoot is null || reactor != reactorRoot.Reactor.ReactorNo || reactorRoot.Reactor.LoadedRDS is null || reactorRoot.Reactor.LoadedRDS.Length < 1)
|
||||
{
|
||||
rds = null;
|
||||
psn = string.Empty;
|
||||
workOrder = new(null, null, null, null, false);
|
||||
common = new(layer: null,
|
||||
psn: psn,
|
||||
rdsNumber: rds,
|
||||
reactor: reactor,
|
||||
zone: null,
|
||||
employee: null);
|
||||
}
|
||||
else
|
||||
{
|
||||
rds = reactorRoot.Reactor.LoadedRDS[0];
|
||||
workOrder = new(null, null, null, null, false);
|
||||
httpResponseMessageTask = httpClient.GetAsync($"{httpClient.BaseAddress}/materials/rds/{rds}");
|
||||
httpResponseMessageTask.Wait();
|
||||
if (httpResponseMessageTask.Result.StatusCode != System.Net.HttpStatusCode.OK)
|
||||
throw new Exception($"Unable to OI <{httpResponseMessageTask.Result.StatusCode}>");
|
||||
streamTask = httpResponseMessageTask.Result.Content.ReadAsStreamAsync();
|
||||
streamTask.Wait();
|
||||
if (!streamTask.Result.CanRead)
|
||||
throw new NullReferenceException(nameof(streamTask));
|
||||
RunDataSheetRoot? runDataSheetRoot = JsonSerializer.Deserialize<RunDataSheetRoot>(streamTask.Result, jsonSerializerOptions);
|
||||
streamTask.Result.Dispose();
|
||||
if (runDataSheetRoot is null || reactor != runDataSheetRoot.RunDataSheet.Reactor)
|
||||
{
|
||||
psn = string.Empty;
|
||||
common = new(layer: null,
|
||||
psn: psn,
|
||||
rdsNumber: rds,
|
||||
reactor: reactor,
|
||||
zone: null,
|
||||
employee: null);
|
||||
}
|
||||
else
|
||||
{
|
||||
psn = runDataSheetRoot.RunDataSheet.PSN.ToString();
|
||||
common = new(layer: null,
|
||||
psn: psn,
|
||||
rdsNumber: rds,
|
||||
reactor: reactor,
|
||||
zone: null,
|
||||
employee: null);
|
||||
}
|
||||
}
|
||||
return new(common, workOrder);
|
||||
}
|
||||
|
||||
private static (Common common, WorkOrder workOrder) Get(Input input, string barcodeHostFileShare)
|
||||
{
|
||||
if (string.IsNullOrEmpty(barcodeHostFileShare) || !Directory.Exists(barcodeHostFileShare))
|
||||
throw new Exception($"Unable to access file-share <{barcodeHostFileShare}>");
|
||||
int? rds;
|
||||
long sequence = 0;
|
||||
WorkOrder workOrder;
|
||||
string mid = string.IsNullOrEmpty(input.MID) ? string.Empty : input.MID;
|
||||
int? reactor = mid.Length < 2 || !int.TryParse(mid.Substring(0, 2), out int reactorNumber) ? null : reactorNumber;
|
||||
bool parsed = !string.IsNullOrEmpty(input.Sequence) && long.TryParse(input.Sequence, out sequence);
|
||||
List<string> files;
|
||||
if (!parsed || string.IsNullOrEmpty(input.MID))
|
||||
files = new();
|
||||
else
|
||||
files = GetFiles(input, barcodeHostFileShare);
|
||||
string? text = GetText(sequence, files);
|
||||
if (text is null || text.Length < 3)
|
||||
{
|
||||
rds = null;
|
||||
workOrder = new(null, null, null, null, false);
|
||||
}
|
||||
else if (!text.Contains('.'))
|
||||
{
|
||||
rds = !int.TryParse(text.Substring(2), out int rdsNumber) ? null : rdsNumber;
|
||||
workOrder = new(null, null, null, null, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
rds = null;
|
||||
workOrder = GetWorkOrder(new(input, text.Substring(2)));
|
||||
}
|
||||
Common common = new(layer: null,
|
||||
psn: null,
|
||||
rdsNumber: rds,
|
||||
reactor: reactor,
|
||||
zone: null,
|
||||
employee: null);
|
||||
return new(common, workOrder);
|
||||
}
|
||||
|
||||
#nullable disable
|
||||
|
||||
private static string GetRunJson(string lsl2SQLConnectionString, int? rds, int? workOrderNumber, int? workOrderCassette, int? slot, int? reactor)
|
||||
private static string GetRunJson(string lsl2SQLConnectionString, string commandText)
|
||||
{
|
||||
StringBuilder result = new();
|
||||
string commandText = GetCommandText(rds, workOrderNumber, workOrderCassette, slot, reactor);
|
||||
try
|
||||
{
|
||||
using SqlConnection sqlConnection = new(lsl2SQLConnectionString);
|
||||
@ -362,90 +514,100 @@ public class Job
|
||||
}
|
||||
|
||||
private static string GetCommandText(int? rds, int? workOrderNumber, int? workOrderCassette, int? slot, int? reactor)
|
||||
{
|
||||
StringBuilder result = new();
|
||||
_ = result.Append(" select ").
|
||||
Append(" rr.rds_no ").
|
||||
Append(" , rr.reactor ").
|
||||
Append(" , rr.ps_no ").
|
||||
Append(" , rr.load_lock_side ").
|
||||
Append(" , rr.reactor_type ").
|
||||
Append(" , rr.recipe_name ").
|
||||
Append(" , rr.recipe_no ").
|
||||
Append(" , rr.spec_type ").
|
||||
Append(" , ( ").
|
||||
Append(" select max(wm.zone) ").
|
||||
Append(" from lsl2sql.dbo.wm_out_slot wm ").
|
||||
Append(" where wm.wo_no = rr.wo_no ").
|
||||
Append(" and wm.rds = rr.rds_no ").
|
||||
Append(" and wm.in_cass_no = ").Append(workOrderCassette is null ? -1 : workOrderCassette.Value).Append(' ').
|
||||
Append(" and wm.slot_no = ").Append(slot is null ? -1 : slot.Value).Append(' ').
|
||||
Append(" ) zone ").
|
||||
Append(" from lsl2sql.dbo.react_run rr ").
|
||||
Append(" where rr.rds_no = ").Append(rds is null ? -1 : rds.Value).Append(' ').
|
||||
Append(" union all ").
|
||||
Append(" select ").
|
||||
Append(" rr.rds_no ").
|
||||
Append(" , rr.reactor ").
|
||||
Append(" , rr.ps_no ").
|
||||
Append(" , rr.load_lock_side ").
|
||||
Append(" , rr.reactor_type ").
|
||||
Append(" , rr.recipe_name ").
|
||||
Append(" , rr.recipe_no ").
|
||||
Append(" , rr.spec_type ").
|
||||
Append(" , ( ").
|
||||
Append(" select max(wm.zone) ").
|
||||
Append(" from lsl2sql.dbo.wm_out_slot wm ").
|
||||
Append(" where wm.wo_no = rr.wo_no ").
|
||||
Append(" and wm.rds = rr.rds_no ").
|
||||
Append(" and wm.in_cass_no = ").Append(workOrderCassette is null ? -1 : workOrderCassette.Value).Append(' ').
|
||||
Append(" and wm.slot_no = ").Append(slot is null ? -1 : slot.Value).Append(' ').
|
||||
Append(" ) zone ").
|
||||
Append(" from lsl2sql.dbo.react_run rr ").
|
||||
Append(" where rr.rds_no = ( ").
|
||||
Append(" select max(wm.rds) ").
|
||||
Append(" from lsl2sql.dbo.wm_out_slot wm ").
|
||||
Append(" where wm.wo_no = ").Append(workOrderNumber is null ? -1 : workOrderNumber.Value).Append(' ').
|
||||
Append(" and wm.in_cass_no = ").Append(workOrderCassette is null ? -1 : workOrderCassette.Value).Append(' ').
|
||||
Append(" and wm.slot_no = ").Append(slot is null ? -1 : slot.Value).Append(' ').
|
||||
Append(" ) ").
|
||||
Append(" union all ").
|
||||
Append(" select ").
|
||||
Append(" rr.rds_no ").
|
||||
Append(" , rr.reactor ").
|
||||
Append(" , rr.ps_no ").
|
||||
Append(" , rr.load_lock_side ").
|
||||
Append(" , rr.reactor_type ").
|
||||
Append(" , rr.recipe_name ").
|
||||
Append(" , rr.recipe_no ").
|
||||
Append(" , rr.spec_type ").
|
||||
Append(" , ( ").
|
||||
Append(" select max(wm.zone) ").
|
||||
Append(" from lsl2sql.dbo.wm_out_slot wm ").
|
||||
Append(" where wm.wo_no = rr.wo_no ").
|
||||
Append(" and wm.rds = rr.rds_no ").
|
||||
Append(" and wm.in_cass_no = ").Append(workOrderCassette is null ? -1 : workOrderCassette.Value).Append(' ').
|
||||
Append(" and wm.slot_no = ").Append(slot is null ? -1 : slot.Value).Append(' ').
|
||||
Append(" ) zone ").
|
||||
Append(" from lsl2sql.dbo.react_run rr ").
|
||||
Append(" where rr.rds_no = ( ").
|
||||
Append(" select max(qa.rds_no) ").
|
||||
Append(" from lsl2sql.dbo.react_run qa ").
|
||||
Append(" where qa.load_sig != '' ").
|
||||
Append(" and qa.load_sig_dtm > '2022-07-01 00:00:00.000' ").
|
||||
Append(" and qa.reactor = ").Append(reactor is null ? -1 : reactor.Value).Append(' ').
|
||||
Append(" ) ").
|
||||
Append(" for json path ");
|
||||
return result.ToString();
|
||||
}
|
||||
{ // cSpell:disable
|
||||
List<string> results = new();
|
||||
int rdsValue = rds is null ? -1 : rds.Value;
|
||||
int slotValue = slot is null ? -1 : slot.Value;
|
||||
int reactorValue = reactor is null ? -1 : reactor.Value;
|
||||
int workOrderNumberValue = workOrderNumber is null ? -1 : workOrderNumber.Value;
|
||||
int workOrderCassetteValue = workOrderCassette is null ? -1 : workOrderCassette.Value;
|
||||
results.Add(" select ");
|
||||
results.Add(" rr.rds_no ");
|
||||
results.Add(" , rr.reactor ");
|
||||
results.Add(" , rr.ps_no ");
|
||||
results.Add(" , rr.load_lock_side ");
|
||||
results.Add(" , rr.reactor_type ");
|
||||
results.Add(" , rr.recipe_name ");
|
||||
results.Add(" , rr.recipe_no ");
|
||||
results.Add(" , rr.spec_type ");
|
||||
results.Add(" , ( ");
|
||||
results.Add(" select max(wm.zone) ");
|
||||
results.Add(" from lsl2sql.dbo.wm_out_slot wm ");
|
||||
results.Add(" where wm.wo_no = rr.wo_no ");
|
||||
results.Add(" and wm.rds = rr.rds_no ");
|
||||
results.Add($" and wm.in_cass_no = {workOrderCassetteValue}");
|
||||
results.Add($" and wm.slot_no = {slotValue}");
|
||||
results.Add(" ) zone ");
|
||||
results.Add(" from lsl2sql.dbo.react_run rr ");
|
||||
results.Add($" where rr.rds_no = {rdsValue}");
|
||||
results.Add(" union all ");
|
||||
results.Add(" select ");
|
||||
results.Add(" rr.rds_no ");
|
||||
results.Add(" , rr.reactor ");
|
||||
results.Add(" , rr.ps_no ");
|
||||
results.Add(" , rr.load_lock_side ");
|
||||
results.Add(" , rr.reactor_type ");
|
||||
results.Add(" , rr.recipe_name ");
|
||||
results.Add(" , rr.recipe_no ");
|
||||
results.Add(" , rr.spec_type ");
|
||||
results.Add(" , ( ");
|
||||
results.Add(" select max(wm.zone) ");
|
||||
results.Add(" from lsl2sql.dbo.wm_out_slot wm ");
|
||||
results.Add(" where wm.wo_no = rr.wo_no ");
|
||||
results.Add(" and wm.rds = rr.rds_no ");
|
||||
results.Add($" and wm.in_cass_no = {workOrderCassetteValue}");
|
||||
results.Add($" and wm.slot_no = {slotValue}");
|
||||
results.Add(" ) zone ");
|
||||
results.Add(" from lsl2sql.dbo.react_run rr ");
|
||||
results.Add(" where rr.rds_no = ( ");
|
||||
results.Add(" select max(wm.rds) ");
|
||||
results.Add(" from lsl2sql.dbo.wm_out_slot wm ");
|
||||
results.Add($" where wm.wo_no = {workOrderNumberValue}");
|
||||
results.Add($" and wm.in_cass_no = {workOrderCassetteValue}");
|
||||
results.Add($" and wm.slot_no = {slotValue}");
|
||||
results.Add(" ) ");
|
||||
results.Add(" union all ");
|
||||
results.Add(" select ");
|
||||
results.Add(" rr.rds_no ");
|
||||
results.Add(" , rr.reactor ");
|
||||
results.Add(" , rr.ps_no ");
|
||||
results.Add(" , rr.load_lock_side ");
|
||||
results.Add(" , rr.reactor_type ");
|
||||
results.Add(" , rr.recipe_name ");
|
||||
results.Add(" , rr.recipe_no ");
|
||||
results.Add(" , rr.spec_type ");
|
||||
results.Add(" , ( ");
|
||||
results.Add(" select max(wm.zone) ");
|
||||
results.Add(" from lsl2sql.dbo.wm_out_slot wm ");
|
||||
results.Add(" where wm.wo_no = rr.wo_no ");
|
||||
results.Add(" and wm.rds = rr.rds_no ");
|
||||
results.Add($" and wm.in_cass_no = {workOrderCassetteValue}");
|
||||
results.Add($" and wm.slot_no = {slotValue}");
|
||||
results.Add(" ) zone ");
|
||||
results.Add(" from lsl2sql.dbo.react_run rr ");
|
||||
results.Add(" where rr.rds_no = ( ");
|
||||
results.Add(" select max(qa.rds_no) ");
|
||||
results.Add(" from lsl2sql.dbo.react_run qa ");
|
||||
results.Add(" where qa.load_sig != '' ");
|
||||
results.Add(" and qa.load_sig_dtm > '2023-05-01 00:00:00.000' ");
|
||||
results.Add($" and qa.reactor = {reactorValue}");
|
||||
results.Add(" ) ");
|
||||
results.Add(" for json path ");
|
||||
return string.Join(Environment.NewLine, results);
|
||||
} // cSpell:restore
|
||||
|
||||
private static (string, string, int?, string, int?, string) Get(string lsl2SQLConnectionString, string layer, string psn, int? reactorNumber, int? slotNumber, int? workOrderNumber, int? workOrderCassette, string zone)
|
||||
private static CommonB Get(string lsl2SQLConnectionString, string layer, string psn, int? reactorNumber, int? slotNumber, int? workOrderNumber, int? workOrderCassette, string zone)
|
||||
{
|
||||
int? rdsNumber;
|
||||
string comment;
|
||||
const int zero = 0;
|
||||
const string hyphen = "-";
|
||||
string json = GetRunJson(lsl2SQLConnectionString, rds: null, workOrderNumber, workOrderCassette, slotNumber, reactorNumber);
|
||||
string commandText = GetCommandText(rds: null,
|
||||
workOrderNumber: workOrderNumber,
|
||||
workOrderCassette: workOrderCassette,
|
||||
slot: slotNumber,
|
||||
reactor: reactorNumber);
|
||||
string json = GetRunJson(lsl2SQLConnectionString, commandText);
|
||||
if (string.IsNullOrEmpty(json))
|
||||
{
|
||||
rdsNumber = null;
|
||||
@ -460,7 +622,7 @@ public class Job
|
||||
{ runs = JsonSerializer.Deserialize<Run[]>(json); }
|
||||
catch (Exception)
|
||||
{ runs = Array.Empty<Run>(); }
|
||||
if (!runs.Any())
|
||||
if (runs.Length == 0)
|
||||
{
|
||||
rdsNumber = null;
|
||||
comment = hyphen;
|
||||
@ -487,15 +649,25 @@ public class Job
|
||||
comment = $"{loadLockSideFull} - {runs[zero].ReactorType}";
|
||||
}
|
||||
}
|
||||
return new(comment, layer, rdsNumber, psn, reactorNumber, zone);
|
||||
return new(comment: comment,
|
||||
layer: layer,
|
||||
rdsNumber: rdsNumber,
|
||||
psn: psn,
|
||||
reactorNumber: reactorNumber,
|
||||
zone: zone);
|
||||
}
|
||||
|
||||
private static (string, string, int?, string, int?, string) GetWithValidRDS(string lsl2SQLConnectionString, string layer, string psn, int? rdsNumber, int? reactorNumber, string zone)
|
||||
private static CommonB GetWithValidRDS(string lsl2SQLConnectionString, string layer, string psn, int? rdsNumber, int? reactorNumber, string zone)
|
||||
{
|
||||
string comment;
|
||||
const int zero = 0;
|
||||
const string hyphen = "-";
|
||||
string json = GetRunJson(lsl2SQLConnectionString, rdsNumber, workOrderNumber: null, workOrderCassette: null, slot: null, reactor: null);
|
||||
string commandText = GetCommandText(rds: rdsNumber,
|
||||
workOrderNumber: null,
|
||||
workOrderCassette: null,
|
||||
slot: null,
|
||||
reactor: null);
|
||||
string json = GetRunJson(lsl2SQLConnectionString, commandText);
|
||||
if (string.IsNullOrEmpty(json))
|
||||
{
|
||||
comment = hyphen;
|
||||
@ -508,7 +680,7 @@ public class Job
|
||||
{ runs = JsonSerializer.Deserialize<Run[]>(json); }
|
||||
catch (Exception)
|
||||
{ runs = Array.Empty<Run>(); }
|
||||
if (!runs.Any())
|
||||
if (runs.Length == 0)
|
||||
{
|
||||
comment = hyphen;
|
||||
zone = string.Empty;
|
||||
@ -521,7 +693,7 @@ public class Job
|
||||
zone = runs[zero].Zone;
|
||||
if (string.IsNullOrEmpty(layer))
|
||||
layer = runs[zero].EpiLayer;
|
||||
reactorNumber = runs[zero].Reactor;
|
||||
reactorNumber = runs[zero].Reactor is null ? reactorNumber : runs[zero].Reactor.Value;
|
||||
string loadLockSide = runs[zero].LoadLockSide;
|
||||
string loadLockSideFull = loadLockSide switch
|
||||
{
|
||||
@ -532,7 +704,12 @@ public class Job
|
||||
comment = $"{loadLockSideFull} - {runs[zero].ReactorType}";
|
||||
}
|
||||
}
|
||||
return new(comment, layer, rdsNumber, psn, reactorNumber, zone);
|
||||
return new(comment: comment,
|
||||
layer: layer,
|
||||
rdsNumber: rdsNumber,
|
||||
psn: psn,
|
||||
reactorNumber: reactorNumber,
|
||||
zone: zone);
|
||||
}
|
||||
|
||||
}
|
@ -5,6 +5,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
|
||||
namespace Adaptation.FileHandlers.TIBCO.Transport;
|
||||
@ -19,12 +20,14 @@ internal partial class Main
|
||||
private static string _BarcodeHostFileShare;
|
||||
private static string _LSL2SQLConnectionString;
|
||||
private static string _TibcoParameterSubjectPrefix;
|
||||
private static HttpClient _HttpClient;
|
||||
private static FileConnectorConfiguration _FileConnectorConfiguration;
|
||||
|
||||
internal static void Initialize(ISMTP smtp, string cellInstanceName, FileConnectorConfiguration fileConnectorConfiguration, string lsl2SQLConnectionString, string metrologyFileShare, string barcodeHostFileShare)
|
||||
internal static void Initialize(ISMTP smtp, string cellInstanceName, FileConnectorConfiguration fileConnectorConfiguration, string lsl2SQLConnectionString, string metrologyFileShare, string barcodeHostFileShare, HttpClient httpClient)
|
||||
{
|
||||
_SMTP = smtp;
|
||||
_IfxTransport = null;
|
||||
_HttpClient = httpClient;
|
||||
_CellInstanceName = cellInstanceName;
|
||||
_MetrologyFileShare = metrologyFileShare;
|
||||
_TibcoParameterSubjectPrefix = string.Empty;
|
||||
@ -186,7 +189,7 @@ internal partial class Main
|
||||
if (!subject.Contains(_TibcoParameterSubjectPrefix))
|
||||
throw new Exception("Invalid Subject");
|
||||
mid = GetJobsMID(envelopeDocument);
|
||||
Job job = new(_LSL2SQLConnectionString, _MetrologyFileShare, _BarcodeHostFileShare, mid);
|
||||
Job job = new(_LSL2SQLConnectionString, _MetrologyFileShare, _BarcodeHostFileShare, _HttpClient, mid);
|
||||
if (job.IsAreaSi)
|
||||
{
|
||||
IfxDoc sendReply = GetJobsReply(job);
|
||||
|
18
Adaptation/FileHandlers/TIBCO/Transport/Reactor.cs
Normal file
18
Adaptation/FileHandlers/TIBCO/Transport/Reactor.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.TIBCO.Transport;
|
||||
|
||||
public class Reactor
|
||||
{
|
||||
|
||||
[JsonConstructor]
|
||||
public Reactor(int reactorNo, int[] loadedRDS)
|
||||
{
|
||||
ReactorNo = reactorNo;
|
||||
LoadedRDS = loadedRDS;
|
||||
}
|
||||
|
||||
[JsonPropertyName("reactorNo")] public int ReactorNo { get; } // { init; get; }
|
||||
[JsonPropertyName("loadedRDS")] public int[] LoadedRDS { get; } // { init; get; }
|
||||
|
||||
}
|
14
Adaptation/FileHandlers/TIBCO/Transport/ReactorRoot.cs
Normal file
14
Adaptation/FileHandlers/TIBCO/Transport/ReactorRoot.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.TIBCO.Transport;
|
||||
|
||||
public class ReactorRoot
|
||||
{
|
||||
|
||||
[JsonConstructor]
|
||||
public ReactorRoot(Reactor reactor) =>
|
||||
Reactor = reactor;
|
||||
|
||||
[JsonPropertyName("reactor")] public Reactor Reactor { get; } // { init; get; }
|
||||
|
||||
}
|
@ -24,7 +24,7 @@ public class Run
|
||||
public string PartNo { get; set; }
|
||||
|
||||
[JsonPropertyName("reactor")]
|
||||
public int Reactor { get; set; }
|
||||
public int? Reactor { get; set; }
|
||||
|
||||
[JsonPropertyName("ps_no")]
|
||||
public string PSN { get; set; }
|
||||
|
18
Adaptation/FileHandlers/TIBCO/Transport/RunDataSheet.cs
Normal file
18
Adaptation/FileHandlers/TIBCO/Transport/RunDataSheet.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.TIBCO.Transport;
|
||||
|
||||
public class RunDataSheet
|
||||
{
|
||||
|
||||
[JsonConstructor]
|
||||
public RunDataSheet(int psn, int reactor)
|
||||
{
|
||||
PSN = psn;
|
||||
Reactor = reactor;
|
||||
}
|
||||
|
||||
[JsonPropertyName("PSN")] public int PSN { get; } // { init; get; }
|
||||
[JsonPropertyName("reactor")] public int Reactor { get; } // { init; get; }
|
||||
|
||||
}
|
14
Adaptation/FileHandlers/TIBCO/Transport/RunDataSheetRoot.cs
Normal file
14
Adaptation/FileHandlers/TIBCO/Transport/RunDataSheetRoot.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.TIBCO.Transport;
|
||||
|
||||
public class RunDataSheetRoot
|
||||
{
|
||||
|
||||
[JsonConstructor]
|
||||
public RunDataSheetRoot(RunDataSheet runDataSheet) =>
|
||||
RunDataSheet = runDataSheet;
|
||||
|
||||
[JsonPropertyName("rds")] public RunDataSheet RunDataSheet { get; } // { init; get; }
|
||||
|
||||
}
|
25
Adaptation/FileHandlers/TIBCO/Transport/WorkOrder.cs
Normal file
25
Adaptation/FileHandlers/TIBCO/Transport/WorkOrder.cs
Normal file
@ -0,0 +1,25 @@
|
||||
namespace Adaptation.FileHandlers.TIBCO.Transport;
|
||||
|
||||
public class WorkOrder
|
||||
{
|
||||
|
||||
public int? WorkOrderNumber { get; }
|
||||
public int? WorkOrderStep { get; }
|
||||
public int? WorkOrderCassette { get; }
|
||||
public int? SlotNumber { get; }
|
||||
public bool IsWorkOrder { get; }
|
||||
|
||||
public WorkOrder(int? workOrderNumber,
|
||||
int? workOrderStep,
|
||||
int? workOrderCassette,
|
||||
int? slotNumber,
|
||||
bool isWorkOrder)
|
||||
{
|
||||
WorkOrderNumber = workOrderNumber;
|
||||
WorkOrderStep = workOrderStep;
|
||||
WorkOrderCassette = workOrderCassette;
|
||||
SlotNumber = slotNumber;
|
||||
IsWorkOrder = isWorkOrder;
|
||||
}
|
||||
|
||||
}
|
22
Adaptation/FileHandlers/txt/Constant.cs
Normal file
22
Adaptation/FileHandlers/txt/Constant.cs
Normal file
@ -0,0 +1,22 @@
|
||||
namespace Adaptation.FileHandlers.txt;
|
||||
|
||||
internal class Constant
|
||||
{
|
||||
|
||||
public string F1 { get; } = "F -1";
|
||||
public string Max { get; } = "Max";
|
||||
public string Min { get; } = "Min";
|
||||
public string Mean { get; } = "Mean";
|
||||
public string LotId { get; } = "Lot ID:";
|
||||
public string Session { get; } = "Session:";
|
||||
public string StdDev { get; } = "Std. Dev.";
|
||||
public string DCNTotals { get; } = "DCN Totals";
|
||||
public string DNNTotals { get; } = "DNN Totals";
|
||||
public string DWNTotals { get; } = "DWN Totals";
|
||||
public string Grade { get; } = "F Grade";
|
||||
public string Reject { get; } = "F Reject";
|
||||
public string LongWaferSummary { get; } = "Long Wafer Summary";
|
||||
public string OverLoad { get; } = "F OverLoad";
|
||||
public string Empty35Spaces { get; } = " ";
|
||||
|
||||
}
|
@ -746,7 +746,7 @@ public class Description : IDescription, Shared.Properties.IDescription
|
||||
List<IDescription> IDescription.GetDescriptions(IFileRead fileRead, Logistics logistics, List<Test> tests, IProcessData iProcessData)
|
||||
{
|
||||
List<IDescription> results = new();
|
||||
if (iProcessData is null || !iProcessData.Details.Any() || iProcessData is not ProcessData processData)
|
||||
if (iProcessData is null || iProcessData.Details.Count == 0 || iProcessData is not ProcessData processData)
|
||||
results.Add(GetDefault(fileRead, logistics));
|
||||
else
|
||||
{
|
||||
|
@ -5,7 +5,6 @@ using Adaptation.Shared.Methods;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
@ -16,7 +15,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
|
||||
private long? _TickOffset;
|
||||
|
||||
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) :
|
||||
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<Shared.Metrology.WS.Results>> staticRuns, bool useCyclicalForDescription, bool isEAFHosted) :
|
||||
base(new Description(), true, smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null)
|
||||
{
|
||||
_MinFileLength = 10;
|
||||
@ -95,19 +94,26 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
return results;
|
||||
}
|
||||
|
||||
#nullable enable
|
||||
|
||||
private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime dateTime)
|
||||
{
|
||||
Tuple<string, Test[], JsonElement[], List<FileInfo>> results = new(string.Empty, null, null, new List<FileInfo>());
|
||||
_TickOffset ??= new FileInfo(reportFullPath).LastWriteTime.Ticks - dateTime.Ticks;
|
||||
Tuple<string, Test[], JsonElement[], List<FileInfo>> results = new(string.Empty, Array.Empty<Test>(), Array.Empty<JsonElement>(), new List<FileInfo>());
|
||||
_TickOffset ??= 0; // new FileInfo(reportFullPath).LastWriteTime.Ticks - dateTime.Ticks;
|
||||
_Logistics = new Logistics(this, _TickOffset.Value, reportFullPath, useSplitForMID: true);
|
||||
SetFileParameterLotIDToLogisticsMID();
|
||||
if (_Logistics.FileInfo.Length < _MinFileLength)
|
||||
results.Item4.Add(_Logistics.FileInfo);
|
||||
else
|
||||
{
|
||||
Run? run = Run.Get(_Logistics, results.Item4);
|
||||
if (run is null)
|
||||
throw new Exception(string.Concat("A) No Data - ", dateTime.Ticks));
|
||||
IProcessData iProcessData = new ProcessData(this, _Logistics, results.Item4);
|
||||
if (iProcessData is not ProcessData processData)
|
||||
throw new Exception(string.Concat("A) No Data - ", dateTime.Ticks));
|
||||
results = new(string.Concat("B) No Data - ", dateTime.Ticks), Array.Empty<Test>(), Array.Empty<JsonElement>(), results.Item4);
|
||||
else
|
||||
{
|
||||
string mid;
|
||||
if (!string.IsNullOrEmpty(processData.Lot) && string.IsNullOrEmpty(processData.Reactor) && string.IsNullOrEmpty(processData.RDS) && string.IsNullOrEmpty(processData.PSN))
|
||||
mid = processData.Lot;
|
||||
@ -120,9 +126,11 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
}
|
||||
SetFileParameterLotID(mid);
|
||||
_Logistics.Update(mid, processData.Reactor);
|
||||
if (!iProcessData.Details.Any())
|
||||
throw new Exception(string.Concat("B) No Data - ", dateTime.Ticks));
|
||||
if (iProcessData.Details.Count > 0)
|
||||
results = iProcessData.GetResults(this, _Logistics, results.Item4);
|
||||
else
|
||||
results = new(string.Concat("C) No Data - ", dateTime.Ticks), Array.Empty<Test>(), Array.Empty<JsonElement>(), results.Item4);
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
88
Adaptation/FileHandlers/txt/Header.cs
Normal file
88
Adaptation/FileHandlers/txt/Header.cs
Normal file
@ -0,0 +1,88 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.txt;
|
||||
|
||||
public class Header
|
||||
{
|
||||
|
||||
public Header(string lot,
|
||||
string session)
|
||||
{
|
||||
Lot = lot;
|
||||
Session = session;
|
||||
}
|
||||
|
||||
public string Lot { get; }
|
||||
public string Session { get; }
|
||||
|
||||
internal static void ScanPast(string text, int[] i, string search)
|
||||
{
|
||||
int num = text.IndexOf(search, i[0]);
|
||||
if (num > -1)
|
||||
i[0] = num + search.Length;
|
||||
else
|
||||
i[0] = text.Length;
|
||||
}
|
||||
|
||||
internal static string GetBefore(string text, int[] i, string search)
|
||||
{
|
||||
int num = text.IndexOf(search, i[0]);
|
||||
if (num > -1)
|
||||
{
|
||||
string str = text.Substring(i[0], num - i[0]);
|
||||
i[0] = num + search.Length;
|
||||
return str.Trim();
|
||||
}
|
||||
string str1 = text.Substring(i[0]);
|
||||
i[0] = text.Length;
|
||||
return str1.Trim();
|
||||
}
|
||||
|
||||
internal static string GetBefore(string text, int[] i, string search, bool trim)
|
||||
{
|
||||
if (trim)
|
||||
return GetBefore(text, i, search);
|
||||
int num = text.IndexOf(search, i[0]);
|
||||
if (num > -1)
|
||||
{
|
||||
string str = text.Substring(i[0], num - i[0]);
|
||||
i[0] = num + search.Length;
|
||||
return str;
|
||||
}
|
||||
string str1 = text.Substring(i[0]);
|
||||
i[0] = text.Length;
|
||||
return str1;
|
||||
}
|
||||
|
||||
internal static string GetToEOL(string text, int[] i) =>
|
||||
GetBefore(text, i, "\n");
|
||||
|
||||
internal static string GetToEOL(string text, int[] i, bool trim)
|
||||
{
|
||||
if (trim)
|
||||
return GetToEOL(text, i);
|
||||
return GetBefore(text, i, "\n", false);
|
||||
}
|
||||
|
||||
internal static Header Get(Constant constant, int[] i, string text)
|
||||
{
|
||||
Header result;
|
||||
string lot;
|
||||
string session;
|
||||
ScanPast(text, i, constant.LongWaferSummary);
|
||||
_ = GetToEOL(text, i);
|
||||
ScanPast(text, i, constant.Session);
|
||||
session = GetToEOL(text, i, true);
|
||||
ScanPast(text, i, constant.LotId);
|
||||
lot = GetToEOL(text, i, true);
|
||||
result = new(lot, session);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Header))]
|
||||
internal partial class HeaderSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
@ -277,7 +277,6 @@ public class ProcessData : IProcessData
|
||||
|
||||
public ProcessData(IFileRead fileRead, Logistics logistics, List<FileInfo> fileInfoCollection)
|
||||
{
|
||||
fileInfoCollection.Clear();
|
||||
_Details = new List<object>();
|
||||
_I = 0;
|
||||
_Data = string.Empty;
|
||||
@ -309,9 +308,13 @@ public class ProcessData : IProcessData
|
||||
if (description.Test != (int)tests[i])
|
||||
throw new Exception();
|
||||
}
|
||||
FileInfo fileInfo = new($"{logistics.ReportFullPath}.descriptions.json");
|
||||
List<Description> fileReadDescriptions = (from l in descriptions select (Description)l).ToList();
|
||||
string json = JsonSerializer.Serialize(fileReadDescriptions, fileReadDescriptions.GetType());
|
||||
JsonElement[] jsonElements = JsonSerializer.Deserialize<JsonElement[]>(json);
|
||||
File.WriteAllText(fileInfo.FullName, json);
|
||||
File.SetLastWriteTime(fileInfo.FullName, logistics.DateTimeFromSequence);
|
||||
fileInfoCollection.Add(fileInfo);
|
||||
JsonElement[] jsonElements = JsonSerializer.Deserialize<JsonElement[]>(json) ?? throw new Exception();
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(logistics.Logistics1[0], tests.ToArray(), jsonElements, fileInfoCollection);
|
||||
return results;
|
||||
}
|
||||
@ -952,8 +955,6 @@ public class ProcessData : IProcessData
|
||||
{
|
||||
// NOTE: get the UniqueID during DataCalculation in order to retrieve the SPCToolID from the cell component Tag field.
|
||||
// id
|
||||
//runData.UniqueID = string.Format("{0}_{1}", sp1Header.UniqueId, i + 1);
|
||||
//runData.HeaderUniqueID = sp1Header.UniqueId;
|
||||
|
||||
// General Wafer Info
|
||||
Side = dcnTotals[i].Side,
|
||||
@ -1026,17 +1027,16 @@ public class ProcessData : IProcessData
|
||||
DnnBin6 = dnnTotals[i].Bin6 ?? string.Empty,
|
||||
DnnBin7 = dnnTotals[i].Bin7 ?? string.Empty,
|
||||
DnnBin8 = dnnTotals[i].Bin8 ?? string.Empty,
|
||||
//result.HeaderUniqueID = string.Concat(MesEntity, "_", Lot, "_Summary_", Date);
|
||||
HeaderUniqueID = UniqueID
|
||||
};
|
||||
result.UniqueID = string.Concat(result.HeaderUniqueID, "_", result.WaferID.PadLeft(2, '0'));
|
||||
return result;
|
||||
}
|
||||
|
||||
#pragma warning disable IDE0060
|
||||
private void Parse(IFileRead fileRead, Logistics logistics, List<FileInfo> fileInfoCollection)
|
||||
#pragma warning restore IDE0060
|
||||
{
|
||||
if (fileRead is null)
|
||||
throw new ArgumentNullException(nameof(fileRead));
|
||||
Detail dataFile;
|
||||
foreach (string file in Directory.GetFiles(Path.GetDirectoryName(logistics.ReportFullPath), "WaferMap*.prn", SearchOption.TopDirectoryOnly))
|
||||
fileInfoCollection.Add(new FileInfo(file));
|
||||
|
639
Adaptation/FileHandlers/txt/Row.cs
Normal file
639
Adaptation/FileHandlers/txt/Row.cs
Normal file
@ -0,0 +1,639 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.txt;
|
||||
|
||||
#nullable enable
|
||||
|
||||
internal class Row
|
||||
{
|
||||
|
||||
public Row(Run run, int i)
|
||||
{
|
||||
Index = i;
|
||||
//
|
||||
Lot = run.Header.Lot;
|
||||
Session = run.Header.Session;
|
||||
DcnAllMin = run.Summary.DcnAllMin;
|
||||
DcnLpdMin = run.Summary.DcnLpdMin;
|
||||
DcnLpdNMin = run.Summary.DcnLpdNMin;
|
||||
DcnLpdESMin = run.Summary.DcnLpdESMin;
|
||||
DcnMicroScrMin = run.Summary.DcnMicroScrMin;
|
||||
DcnScrMin = run.Summary.DcnScrMin;
|
||||
DcnSlipMin = run.Summary.DcnSlipMin;
|
||||
DcnAreaCountMin = run.Summary.DcnAreaCountMin;
|
||||
DcnAreaMin = run.Summary.DcnAreaMin;
|
||||
DcnHazeAvgMin = run.Summary.DcnHazeAvgMin;
|
||||
DcnHazeMedianMin = run.Summary.DcnHazeMedianMin;
|
||||
DcnHazeStdDevMin = run.Summary.DcnHazeStdDevMin;
|
||||
DcnBin1Min = run.Summary.DcnBin1Min;
|
||||
DcnBin2Min = run.Summary.DcnBin2Min;
|
||||
DcnBin3Min = run.Summary.DcnBin3Min;
|
||||
DcnBin4Min = run.Summary.DcnBin4Min;
|
||||
DcnBin5Min = run.Summary.DcnBin5Min;
|
||||
DcnBin6Min = run.Summary.DcnBin6Min;
|
||||
DcnBin7Min = run.Summary.DcnBin7Min;
|
||||
DcnBin8Min = run.Summary.DcnBin8Min;
|
||||
DcnAllMax = run.Summary.DcnAllMax;
|
||||
DcnLpdMax = run.Summary.DcnLpdMax;
|
||||
DcnLpdNMax = run.Summary.DcnLpdNMax;
|
||||
DcnLpdESMax = run.Summary.DcnLpdESMax;
|
||||
DcnMicroScrMax = run.Summary.DcnMicroScrMax;
|
||||
DcnScrMax = run.Summary.DcnScrMax;
|
||||
DcnSlipMax = run.Summary.DcnSlipMax;
|
||||
DcnAreaCountMax = run.Summary.DcnAreaCountMax;
|
||||
DcnAreaMax = run.Summary.DcnAreaMax;
|
||||
DcnHazeAvgMax = run.Summary.DcnHazeAvgMax;
|
||||
DcnHazeMedianMax = run.Summary.DcnHazeMedianMax;
|
||||
DcnHazeStdDevMax = run.Summary.DcnHazeStdDevMax;
|
||||
DcnBin1Max = run.Summary.DcnBin1Max;
|
||||
DcnBin2Max = run.Summary.DcnBin2Max;
|
||||
DcnBin3Max = run.Summary.DcnBin3Max;
|
||||
DcnBin4Max = run.Summary.DcnBin4Max;
|
||||
DcnBin5Max = run.Summary.DcnBin5Max;
|
||||
DcnBin6Max = run.Summary.DcnBin6Max;
|
||||
DcnBin7Max = run.Summary.DcnBin7Max;
|
||||
DcnBin8Max = run.Summary.DcnBin8Max;
|
||||
DcnAllMean = run.Summary.DcnAllMean;
|
||||
DcnLpdMean = run.Summary.DcnLpdMean;
|
||||
DcnLpdNMean = run.Summary.DcnLpdNMean;
|
||||
DcnLpdESMean = run.Summary.DcnLpdESMean;
|
||||
DcnMicroScrMean = run.Summary.DcnMicroScrMean;
|
||||
DcnScrMean = run.Summary.DcnScrMean;
|
||||
DcnSlipMean = run.Summary.DcnSlipMean;
|
||||
DcnAreaCountMean = run.Summary.DcnAreaCountMean;
|
||||
DcnAreaMean = run.Summary.DcnAreaMean;
|
||||
DcnHazeAvgMean = run.Summary.DcnHazeAvgMean;
|
||||
DcnHazeMedianMean = run.Summary.DcnHazeMedianMean;
|
||||
DcnHazeStdDevMean = run.Summary.DcnHazeStdDevMean;
|
||||
DcnBin1Mean = run.Summary.DcnBin1Mean;
|
||||
DcnBin2Mean = run.Summary.DcnBin2Mean;
|
||||
DcnBin3Mean = run.Summary.DcnBin3Mean;
|
||||
DcnBin4Mean = run.Summary.DcnBin4Mean;
|
||||
DcnBin5Mean = run.Summary.DcnBin5Mean;
|
||||
DcnBin6Mean = run.Summary.DcnBin6Mean;
|
||||
DcnBin7Mean = run.Summary.DcnBin7Mean;
|
||||
DcnBin8Mean = run.Summary.DcnBin8Mean;
|
||||
DcnAllStdDev = run.Summary.DcnAllStdDev;
|
||||
DcnLpdStdDev = run.Summary.DcnLpdStdDev;
|
||||
DcnLpdNStdDev = run.Summary.DcnLpdNStdDev;
|
||||
DcnLpdESStdDev = run.Summary.DcnLpdESStdDev;
|
||||
DcnMicroScrStdDev = run.Summary.DcnMicroScrStdDev;
|
||||
DcnScrStdDev = run.Summary.DcnScrStdDev;
|
||||
DcnSlipStdDev = run.Summary.DcnSlipStdDev;
|
||||
DcnAreaCountStdDev = run.Summary.DcnAreaCountStdDev;
|
||||
DcnAreaStdDev = run.Summary.DcnAreaStdDev;
|
||||
DcnHazeAvgStdDev = run.Summary.DcnHazeAvgStdDev;
|
||||
DcnHazeMedianStdDev = run.Summary.DcnHazeMedianStdDev;
|
||||
DcnHazeStdDevStdDev = run.Summary.DcnHazeStdDevStdDev;
|
||||
DcnBin1StdDev = run.Summary.DcnBin1StdDev;
|
||||
DcnBin2StdDev = run.Summary.DcnBin2StdDev;
|
||||
DcnBin3StdDev = run.Summary.DcnBin3StdDev;
|
||||
DcnBin4StdDev = run.Summary.DcnBin4StdDev;
|
||||
DcnBin5StdDev = run.Summary.DcnBin5StdDev;
|
||||
DcnBin6StdDev = run.Summary.DcnBin6StdDev;
|
||||
DcnBin7StdDev = run.Summary.DcnBin7StdDev;
|
||||
DcnBin8StdDev = run.Summary.DcnBin8StdDev;
|
||||
DwnAllMin = run.Summary.DwnAllMin;
|
||||
DwnLpdMin = run.Summary.DwnLpdMin;
|
||||
DwnLpdNMin = run.Summary.DwnLpdNMin;
|
||||
DwnLpdESMin = run.Summary.DwnLpdESMin;
|
||||
DwnMicroScrMin = run.Summary.DwnMicroScrMin;
|
||||
DwnScrMin = run.Summary.DwnScrMin;
|
||||
DwnSlipMin = run.Summary.DwnSlipMin;
|
||||
DwnAreaCountMin = run.Summary.DwnAreaCountMin;
|
||||
DwnAreaMin = run.Summary.DwnAreaMin;
|
||||
DwnHazeAvgMin = run.Summary.DwnHazeAvgMin;
|
||||
DwnHazeMedianMin = run.Summary.DwnHazeMedianMin;
|
||||
DwnHazeStdDevMin = run.Summary.DwnHazeStdDevMin;
|
||||
DwnBin1Min = run.Summary.DwnBin1Min;
|
||||
DwnBin2Min = run.Summary.DwnBin2Min;
|
||||
DwnBin3Min = run.Summary.DwnBin3Min;
|
||||
DwnBin4Min = run.Summary.DwnBin4Min;
|
||||
DwnBin5Min = run.Summary.DwnBin5Min;
|
||||
DwnBin6Min = run.Summary.DwnBin6Min;
|
||||
DwnBin7Min = run.Summary.DwnBin7Min;
|
||||
DwnBin8Min = run.Summary.DwnBin8Min;
|
||||
DwnAllMax = run.Summary.DwnAllMax;
|
||||
DwnLpdMax = run.Summary.DwnLpdMax;
|
||||
DwnLpdNMax = run.Summary.DwnLpdNMax;
|
||||
DwnLpdESMax = run.Summary.DwnLpdESMax;
|
||||
DwnMicroScrMax = run.Summary.DwnMicroScrMax;
|
||||
DwnScrMax = run.Summary.DwnScrMax;
|
||||
DwnSlipMax = run.Summary.DwnSlipMax;
|
||||
DwnAreaCountMax = run.Summary.DwnAreaCountMax;
|
||||
DwnAreaMax = run.Summary.DwnAreaMax;
|
||||
DwnHazeAvgMax = run.Summary.DwnHazeAvgMax;
|
||||
DwnHazeMedianMax = run.Summary.DwnHazeMedianMax;
|
||||
DwnHazeStdDevMax = run.Summary.DwnHazeStdDevMax;
|
||||
DwnBin1Max = run.Summary.DwnBin1Max;
|
||||
DwnBin2Max = run.Summary.DwnBin2Max;
|
||||
DwnBin3Max = run.Summary.DwnBin3Max;
|
||||
DwnBin4Max = run.Summary.DwnBin4Max;
|
||||
DwnBin5Max = run.Summary.DwnBin5Max;
|
||||
DwnBin6Max = run.Summary.DwnBin6Max;
|
||||
DwnBin7Max = run.Summary.DwnBin7Max;
|
||||
DwnBin8Max = run.Summary.DwnBin8Max;
|
||||
DwnAllMean = run.Summary.DwnAllMean;
|
||||
DwnLpdMean = run.Summary.DwnLpdMean;
|
||||
DwnLpdNMean = run.Summary.DwnLpdNMean;
|
||||
DwnLpdESMean = run.Summary.DwnLpdESMean;
|
||||
DwnMicroScrMean = run.Summary.DwnMicroScrMean;
|
||||
DwnScrMean = run.Summary.DwnScrMean;
|
||||
DwnSlipMean = run.Summary.DwnSlipMean;
|
||||
DwnAreaCountMean = run.Summary.DwnAreaCountMean;
|
||||
DwnAreaMean = run.Summary.DwnAreaMean;
|
||||
DwnHazeAvgMean = run.Summary.DwnHazeAvgMean;
|
||||
DwnHazeMedianMean = run.Summary.DwnHazeMedianMean;
|
||||
DwnHazeStdDevMean = run.Summary.DwnHazeStdDevMean;
|
||||
DwnBin1Mean = run.Summary.DwnBin1Mean;
|
||||
DwnBin2Mean = run.Summary.DwnBin2Mean;
|
||||
DwnBin3Mean = run.Summary.DwnBin3Mean;
|
||||
DwnBin4Mean = run.Summary.DwnBin4Mean;
|
||||
DwnBin5Mean = run.Summary.DwnBin5Mean;
|
||||
DwnBin6Mean = run.Summary.DwnBin6Mean;
|
||||
DwnBin7Mean = run.Summary.DwnBin7Mean;
|
||||
DwnBin8Mean = run.Summary.DwnBin8Mean;
|
||||
DwnAllStdDev = run.Summary.DwnAllStdDev;
|
||||
DwnLpdStdDev = run.Summary.DwnLpdStdDev;
|
||||
DwnLpdNStdDev = run.Summary.DwnLpdNStdDev;
|
||||
DwnLpdESStdDev = run.Summary.DwnLpdESStdDev;
|
||||
DwnMicroScrStdDev = run.Summary.DwnMicroScrStdDev;
|
||||
DwnScrStdDev = run.Summary.DwnScrStdDev;
|
||||
DwnSlipStdDev = run.Summary.DwnSlipStdDev;
|
||||
DwnAreaCountStdDev = run.Summary.DwnAreaCountStdDev;
|
||||
DwnAreaStdDev = run.Summary.DwnAreaStdDev;
|
||||
DwnHazeAvgStdDev = run.Summary.DwnHazeAvgStdDev;
|
||||
DwnHazeMedianStdDev = run.Summary.DwnHazeMedianStdDev;
|
||||
DwnHazeStdDevStdDev = run.Summary.DwnHazeStdDevStdDev;
|
||||
DwnBin1StdDev = run.Summary.DwnBin1StdDev;
|
||||
DwnBin2StdDev = run.Summary.DwnBin2StdDev;
|
||||
DwnBin3StdDev = run.Summary.DwnBin3StdDev;
|
||||
DwnBin4StdDev = run.Summary.DwnBin4StdDev;
|
||||
DwnBin5StdDev = run.Summary.DwnBin5StdDev;
|
||||
DwnBin6StdDev = run.Summary.DwnBin6StdDev;
|
||||
DwnBin7StdDev = run.Summary.DwnBin7StdDev;
|
||||
DwnBin8StdDev = run.Summary.DwnBin8StdDev;
|
||||
DnnAllMin = run.Summary.DnnAllMin;
|
||||
DnnLpdMin = run.Summary.DnnLpdMin;
|
||||
DnnLpdNMin = run.Summary.DnnLpdNMin;
|
||||
DnnLpdESMin = run.Summary.DnnLpdESMin;
|
||||
DnnMicroScrMin = run.Summary.DnnMicroScrMin;
|
||||
DnnScrMin = run.Summary.DnnScrMin;
|
||||
DnnSlipMin = run.Summary.DnnSlipMin;
|
||||
DnnAreaCountMin = run.Summary.DnnAreaCountMin;
|
||||
DnnAreaMin = run.Summary.DnnAreaMin;
|
||||
DnnHazeAvgMin = run.Summary.DnnHazeAvgMin;
|
||||
DnnHazeMedianMin = run.Summary.DnnHazeMedianMin;
|
||||
DnnHazeStdDevMin = run.Summary.DnnHazeStdDevMin;
|
||||
DnnBin1Min = run.Summary.DnnBin1Min;
|
||||
DnnBin2Min = run.Summary.DnnBin2Min;
|
||||
DnnBin3Min = run.Summary.DnnBin3Min;
|
||||
DnnBin4Min = run.Summary.DnnBin4Min;
|
||||
DnnBin5Min = run.Summary.DnnBin5Min;
|
||||
DnnBin6Min = run.Summary.DnnBin6Min;
|
||||
DnnBin7Min = run.Summary.DnnBin7Min;
|
||||
DnnBin8Min = run.Summary.DnnBin8Min;
|
||||
DnnAllMax = run.Summary.DnnAllMax;
|
||||
DnnLpdMax = run.Summary.DnnLpdMax;
|
||||
DnnLpdNMax = run.Summary.DnnLpdNMax;
|
||||
DnnLpdESMax = run.Summary.DnnLpdESMax;
|
||||
DnnMicroScrMax = run.Summary.DnnMicroScrMax;
|
||||
DnnScrMax = run.Summary.DnnScrMax;
|
||||
DnnSlipMax = run.Summary.DnnSlipMax;
|
||||
DnnAreaCountMax = run.Summary.DnnAreaCountMax;
|
||||
DnnAreaMax = run.Summary.DnnAreaMax;
|
||||
DnnHazeAvgMax = run.Summary.DnnHazeAvgMax;
|
||||
DnnHazeMedianMax = run.Summary.DnnHazeMedianMax;
|
||||
DnnHazeStdDevMax = run.Summary.DnnHazeStdDevMax;
|
||||
DnnBin1Max = run.Summary.DnnBin1Max;
|
||||
DnnBin2Max = run.Summary.DnnBin2Max;
|
||||
DnnBin3Max = run.Summary.DnnBin3Max;
|
||||
DnnBin4Max = run.Summary.DnnBin4Max;
|
||||
DnnBin5Max = run.Summary.DnnBin5Max;
|
||||
DnnBin6Max = run.Summary.DnnBin6Max;
|
||||
DnnBin7Max = run.Summary.DnnBin7Max;
|
||||
DnnBin8Max = run.Summary.DnnBin8Max;
|
||||
DnnAllMean = run.Summary.DnnAllMean;
|
||||
DnnLpdMean = run.Summary.DnnLpdMean;
|
||||
DnnLpdNMean = run.Summary.DnnLpdNMean;
|
||||
DnnLpdESMean = run.Summary.DnnLpdESMean;
|
||||
DnnMicroScrMean = run.Summary.DnnMicroScrMean;
|
||||
DnnScrMean = run.Summary.DnnScrMean;
|
||||
DnnSlipMean = run.Summary.DnnSlipMean;
|
||||
DnnAreaCountMean = run.Summary.DnnAreaCountMean;
|
||||
DnnAreaMean = run.Summary.DnnAreaMean;
|
||||
DnnHazeAvgMean = run.Summary.DnnHazeAvgMean;
|
||||
DnnHazeMedianMean = run.Summary.DnnHazeMedianMean;
|
||||
DnnHazeStdDevMean = run.Summary.DnnHazeStdDevMean;
|
||||
DnnBin1Mean = run.Summary.DnnBin1Mean;
|
||||
DnnBin2Mean = run.Summary.DnnBin2Mean;
|
||||
DnnBin3Mean = run.Summary.DnnBin3Mean;
|
||||
DnnBin4Mean = run.Summary.DnnBin4Mean;
|
||||
DnnBin5Mean = run.Summary.DnnBin5Mean;
|
||||
DnnBin6Mean = run.Summary.DnnBin6Mean;
|
||||
DnnBin7Mean = run.Summary.DnnBin7Mean;
|
||||
DnnBin8Mean = run.Summary.DnnBin8Mean;
|
||||
DnnAllStdDev = run.Summary.DnnAllStdDev;
|
||||
DnnLpdStdDev = run.Summary.DnnLpdStdDev;
|
||||
DnnLpdNStdDev = run.Summary.DnnLpdNStdDev;
|
||||
DnnLpdESStdDev = run.Summary.DnnLpdESStdDev;
|
||||
DnnMicroScrStdDev = run.Summary.DnnMicroScrStdDev;
|
||||
DnnScrStdDev = run.Summary.DnnScrStdDev;
|
||||
DnnSlipStdDev = run.Summary.DnnSlipStdDev;
|
||||
DnnAreaCountStdDev = run.Summary.DnnAreaCountStdDev;
|
||||
DnnAreaStdDev = run.Summary.DnnAreaStdDev;
|
||||
DnnHazeAvgStdDev = run.Summary.DnnHazeAvgStdDev;
|
||||
DnnHazeMedianStdDev = run.Summary.DnnHazeMedianStdDev;
|
||||
DnnHazeStdDevStdDev = run.Summary.DnnHazeStdDevStdDev;
|
||||
DnnBin1StdDev = run.Summary.DnnBin1StdDev;
|
||||
DnnBin2StdDev = run.Summary.DnnBin2StdDev;
|
||||
DnnBin3StdDev = run.Summary.DnnBin3StdDev;
|
||||
DnnBin4StdDev = run.Summary.DnnBin4StdDev;
|
||||
DnnBin5StdDev = run.Summary.DnnBin5StdDev;
|
||||
DnnBin6StdDev = run.Summary.DnnBin6StdDev;
|
||||
DnnBin7StdDev = run.Summary.DnnBin7StdDev;
|
||||
DnnBin8StdDev = run.Summary.DnnBin8StdDev;
|
||||
//
|
||||
Side = run.Wafers[i].Side;
|
||||
WaferID = run.Wafers[i].WaferID;
|
||||
Grade = run.Wafers[i].Grade;
|
||||
SrcDest = run.Wafers[i].SrcDest;
|
||||
DcnAll = run.Wafers[i].DcnAll;
|
||||
DcnLpd = run.Wafers[i].DcnLpd;
|
||||
DcnLpdN = run.Wafers[i].DcnLpdN;
|
||||
DcnLpdES = run.Wafers[i].DcnLpdES;
|
||||
DcnMicroScr = run.Wafers[i].DcnMicroScr;
|
||||
DcnScr = run.Wafers[i].DcnScr;
|
||||
DcnSlip = run.Wafers[i].DcnSlip;
|
||||
DcnAreaCount = run.Wafers[i].DcnAreaCount;
|
||||
DcnArea = run.Wafers[i].DcnArea;
|
||||
DcnHazeAvg = run.Wafers[i].DcnHazeAvg;
|
||||
DcnHazeMedian = run.Wafers[i].DcnHazeMedian;
|
||||
DcnHazeStdDev = run.Wafers[i].DcnHazeStdDev;
|
||||
DcnBin1 = run.Wafers[i].DcnBin1;
|
||||
DcnBin2 = run.Wafers[i].DcnBin2;
|
||||
DcnBin3 = run.Wafers[i].DcnBin3;
|
||||
DcnBin4 = run.Wafers[i].DcnBin4;
|
||||
DcnBin5 = run.Wafers[i].DcnBin5;
|
||||
DcnBin6 = run.Wafers[i].DcnBin6;
|
||||
DcnBin7 = run.Wafers[i].DcnBin7;
|
||||
DcnBin8 = run.Wafers[i].DcnBin8;
|
||||
DwnAll = run.Wafers[i].DwnAll;
|
||||
DwnLpd = run.Wafers[i].DwnLpd;
|
||||
DwnLpdN = run.Wafers[i].DwnLpdN;
|
||||
DwnLpdES = run.Wafers[i].DwnLpdES;
|
||||
DwnMicroScr = run.Wafers[i].DwnMicroScr;
|
||||
DwnScr = run.Wafers[i].DwnScr;
|
||||
DwnSlip = run.Wafers[i].DwnSlip;
|
||||
DwnAreaCount = run.Wafers[i].DwnAreaCount;
|
||||
DwnArea = run.Wafers[i].DwnArea;
|
||||
DwnHazeAvg = run.Wafers[i].DwnHazeAvg;
|
||||
DwnHazeMedian = run.Wafers[i].DwnHazeMedian;
|
||||
DwnHazeStdDev = run.Wafers[i].DwnHazeStdDev;
|
||||
DwnBin1 = run.Wafers[i].DwnBin1;
|
||||
DwnBin2 = run.Wafers[i].DwnBin2;
|
||||
DwnBin3 = run.Wafers[i].DwnBin3;
|
||||
DwnBin4 = run.Wafers[i].DwnBin4;
|
||||
DwnBin5 = run.Wafers[i].DwnBin5;
|
||||
DwnBin6 = run.Wafers[i].DwnBin6;
|
||||
DwnBin7 = run.Wafers[i].DwnBin7;
|
||||
DwnBin8 = run.Wafers[i].DwnBin8;
|
||||
DnnAll = run.Wafers[i].DnnAll;
|
||||
DnnLpd = run.Wafers[i].DnnLpd;
|
||||
DnnLpdN = run.Wafers[i].DnnLpdN;
|
||||
DnnLpdES = run.Wafers[i].DnnLpdES;
|
||||
DnnMicroScr = run.Wafers[i].DnnMicroScr;
|
||||
DnnScr = run.Wafers[i].DnnScr;
|
||||
DnnSlip = run.Wafers[i].DnnSlip;
|
||||
DnnAreaCount = run.Wafers[i].DnnAreaCount;
|
||||
DnnArea = run.Wafers[i].DnnArea;
|
||||
DnnHazeAvg = run.Wafers[i].DnnHazeAvg;
|
||||
DnnHazeMedian = run.Wafers[i].DnnHazeMedian;
|
||||
DnnHazeStdDev = run.Wafers[i].DnnHazeStdDev;
|
||||
DnnBin1 = run.Wafers[i].DnnBin1;
|
||||
DnnBin2 = run.Wafers[i].DnnBin2;
|
||||
DnnBin3 = run.Wafers[i].DnnBin3;
|
||||
DnnBin4 = run.Wafers[i].DnnBin4;
|
||||
DnnBin5 = run.Wafers[i].DnnBin5;
|
||||
DnnBin6 = run.Wafers[i].DnnBin6;
|
||||
DnnBin7 = run.Wafers[i].DnnBin7;
|
||||
DnnBin8 = run.Wafers[i].DnnBin8;
|
||||
}
|
||||
|
||||
public int Index { get; }
|
||||
//
|
||||
public string Lot { get; }
|
||||
public string Session { get; }
|
||||
public string DcnAllMin { get; }
|
||||
public string DcnLpdMin { get; }
|
||||
public string DcnLpdNMin { get; }
|
||||
public string DcnLpdESMin { get; }
|
||||
public string DcnMicroScrMin { get; }
|
||||
public string DcnScrMin { get; }
|
||||
public string DcnSlipMin { get; }
|
||||
public string DcnAreaCountMin { get; }
|
||||
public string DcnAreaMin { get; }
|
||||
public string DcnHazeAvgMin { get; }
|
||||
public string DcnHazeMedianMin { get; }
|
||||
public string DcnHazeStdDevMin { get; }
|
||||
public string DcnBin1Min { get; }
|
||||
public string DcnBin2Min { get; }
|
||||
public string DcnBin3Min { get; }
|
||||
public string DcnBin4Min { get; }
|
||||
public string DcnBin5Min { get; }
|
||||
public string DcnBin6Min { get; }
|
||||
public string DcnBin7Min { get; }
|
||||
public string DcnBin8Min { get; }
|
||||
public string DcnAllMax { get; }
|
||||
public string DcnLpdMax { get; }
|
||||
public string DcnLpdNMax { get; }
|
||||
public string DcnLpdESMax { get; }
|
||||
public string DcnMicroScrMax { get; }
|
||||
public string DcnScrMax { get; }
|
||||
public string DcnSlipMax { get; }
|
||||
public string DcnAreaCountMax { get; }
|
||||
public string DcnAreaMax { get; }
|
||||
public string DcnHazeAvgMax { get; }
|
||||
public string DcnHazeMedianMax { get; }
|
||||
public string DcnHazeStdDevMax { get; }
|
||||
public string DcnBin1Max { get; }
|
||||
public string DcnBin2Max { get; }
|
||||
public string DcnBin3Max { get; }
|
||||
public string DcnBin4Max { get; }
|
||||
public string DcnBin5Max { get; }
|
||||
public string DcnBin6Max { get; }
|
||||
public string DcnBin7Max { get; }
|
||||
public string DcnBin8Max { get; }
|
||||
public string DcnAllMean { get; }
|
||||
public string DcnLpdMean { get; }
|
||||
public string DcnLpdNMean { get; }
|
||||
public string DcnLpdESMean { get; }
|
||||
public string DcnMicroScrMean { get; }
|
||||
public string DcnScrMean { get; }
|
||||
public string DcnSlipMean { get; }
|
||||
public string DcnAreaCountMean { get; }
|
||||
public string DcnAreaMean { get; }
|
||||
public string DcnHazeAvgMean { get; }
|
||||
public string DcnHazeMedianMean { get; }
|
||||
public string DcnHazeStdDevMean { get; }
|
||||
public string DcnBin1Mean { get; }
|
||||
public string DcnBin2Mean { get; }
|
||||
public string DcnBin3Mean { get; }
|
||||
public string DcnBin4Mean { get; }
|
||||
public string DcnBin5Mean { get; }
|
||||
public string DcnBin6Mean { get; }
|
||||
public string DcnBin7Mean { get; }
|
||||
public string DcnBin8Mean { get; }
|
||||
public string DcnAllStdDev { get; }
|
||||
public string DcnLpdStdDev { get; }
|
||||
public string DcnLpdNStdDev { get; }
|
||||
public string DcnLpdESStdDev { get; }
|
||||
public string DcnMicroScrStdDev { get; }
|
||||
public string DcnScrStdDev { get; }
|
||||
public string DcnSlipStdDev { get; }
|
||||
public string DcnAreaCountStdDev { get; }
|
||||
public string DcnAreaStdDev { get; }
|
||||
public string DcnHazeAvgStdDev { get; }
|
||||
public string DcnHazeMedianStdDev { get; }
|
||||
public string DcnHazeStdDevStdDev { get; }
|
||||
public string DcnBin1StdDev { get; }
|
||||
public string DcnBin2StdDev { get; }
|
||||
public string DcnBin3StdDev { get; }
|
||||
public string DcnBin4StdDev { get; }
|
||||
public string DcnBin5StdDev { get; }
|
||||
public string DcnBin6StdDev { get; }
|
||||
public string DcnBin7StdDev { get; }
|
||||
public string DcnBin8StdDev { get; }
|
||||
public string DwnAllMin { get; }
|
||||
public string DwnLpdMin { get; }
|
||||
public string DwnLpdNMin { get; }
|
||||
public string DwnLpdESMin { get; }
|
||||
public string DwnMicroScrMin { get; }
|
||||
public string DwnScrMin { get; }
|
||||
public string DwnSlipMin { get; }
|
||||
public string DwnAreaCountMin { get; }
|
||||
public string DwnAreaMin { get; }
|
||||
public string DwnHazeAvgMin { get; }
|
||||
public string DwnHazeMedianMin { get; }
|
||||
public string DwnHazeStdDevMin { get; }
|
||||
public string DwnBin1Min { get; }
|
||||
public string DwnBin2Min { get; }
|
||||
public string DwnBin3Min { get; }
|
||||
public string DwnBin4Min { get; }
|
||||
public string DwnBin5Min { get; }
|
||||
public string DwnBin6Min { get; }
|
||||
public string DwnBin7Min { get; }
|
||||
public string DwnBin8Min { get; }
|
||||
public string DwnAllMax { get; }
|
||||
public string DwnLpdMax { get; }
|
||||
public string DwnLpdNMax { get; }
|
||||
public string DwnLpdESMax { get; }
|
||||
public string DwnMicroScrMax { get; }
|
||||
public string DwnScrMax { get; }
|
||||
public string DwnSlipMax { get; }
|
||||
public string DwnAreaCountMax { get; }
|
||||
public string DwnAreaMax { get; }
|
||||
public string DwnHazeAvgMax { get; }
|
||||
public string DwnHazeMedianMax { get; }
|
||||
public string DwnHazeStdDevMax { get; }
|
||||
public string DwnBin1Max { get; }
|
||||
public string DwnBin2Max { get; }
|
||||
public string DwnBin3Max { get; }
|
||||
public string DwnBin4Max { get; }
|
||||
public string DwnBin5Max { get; }
|
||||
public string DwnBin6Max { get; }
|
||||
public string DwnBin7Max { get; }
|
||||
public string DwnBin8Max { get; }
|
||||
public string DwnAllMean { get; }
|
||||
public string DwnLpdMean { get; }
|
||||
public string DwnLpdNMean { get; }
|
||||
public string DwnLpdESMean { get; }
|
||||
public string DwnMicroScrMean { get; }
|
||||
public string DwnScrMean { get; }
|
||||
public string DwnSlipMean { get; }
|
||||
public string DwnAreaCountMean { get; }
|
||||
public string DwnAreaMean { get; }
|
||||
public string DwnHazeAvgMean { get; }
|
||||
public string DwnHazeMedianMean { get; }
|
||||
public string DwnHazeStdDevMean { get; }
|
||||
public string DwnBin1Mean { get; }
|
||||
public string DwnBin2Mean { get; }
|
||||
public string DwnBin3Mean { get; }
|
||||
public string DwnBin4Mean { get; }
|
||||
public string DwnBin5Mean { get; }
|
||||
public string DwnBin6Mean { get; }
|
||||
public string DwnBin7Mean { get; }
|
||||
public string DwnBin8Mean { get; }
|
||||
public string DwnAllStdDev { get; }
|
||||
public string DwnLpdStdDev { get; }
|
||||
public string DwnLpdNStdDev { get; }
|
||||
public string DwnLpdESStdDev { get; }
|
||||
public string DwnMicroScrStdDev { get; }
|
||||
public string DwnScrStdDev { get; }
|
||||
public string DwnSlipStdDev { get; }
|
||||
public string DwnAreaCountStdDev { get; }
|
||||
public string DwnAreaStdDev { get; }
|
||||
public string DwnHazeAvgStdDev { get; }
|
||||
public string DwnHazeMedianStdDev { get; }
|
||||
public string DwnHazeStdDevStdDev { get; }
|
||||
public string DwnBin1StdDev { get; }
|
||||
public string DwnBin2StdDev { get; }
|
||||
public string DwnBin3StdDev { get; }
|
||||
public string DwnBin4StdDev { get; }
|
||||
public string DwnBin5StdDev { get; }
|
||||
public string DwnBin6StdDev { get; }
|
||||
public string DwnBin7StdDev { get; }
|
||||
public string DwnBin8StdDev { get; }
|
||||
public string DnnAllMin { get; }
|
||||
public string DnnLpdMin { get; }
|
||||
public string DnnLpdNMin { get; }
|
||||
public string DnnLpdESMin { get; }
|
||||
public string DnnMicroScrMin { get; }
|
||||
public string DnnScrMin { get; }
|
||||
public string DnnSlipMin { get; }
|
||||
public string DnnAreaCountMin { get; }
|
||||
public string DnnAreaMin { get; }
|
||||
public string DnnHazeAvgMin { get; }
|
||||
public string DnnHazeMedianMin { get; }
|
||||
public string DnnHazeStdDevMin { get; }
|
||||
public string DnnBin1Min { get; }
|
||||
public string DnnBin2Min { get; }
|
||||
public string DnnBin3Min { get; }
|
||||
public string DnnBin4Min { get; }
|
||||
public string DnnBin5Min { get; }
|
||||
public string DnnBin6Min { get; }
|
||||
public string DnnBin7Min { get; }
|
||||
public string DnnBin8Min { get; }
|
||||
public string DnnAllMax { get; }
|
||||
public string DnnLpdMax { get; }
|
||||
public string DnnLpdNMax { get; }
|
||||
public string DnnLpdESMax { get; }
|
||||
public string DnnMicroScrMax { get; }
|
||||
public string DnnScrMax { get; }
|
||||
public string DnnSlipMax { get; }
|
||||
public string DnnAreaCountMax { get; }
|
||||
public string DnnAreaMax { get; }
|
||||
public string DnnHazeAvgMax { get; }
|
||||
public string DnnHazeMedianMax { get; }
|
||||
public string DnnHazeStdDevMax { get; }
|
||||
public string DnnBin1Max { get; }
|
||||
public string DnnBin2Max { get; }
|
||||
public string DnnBin3Max { get; }
|
||||
public string DnnBin4Max { get; }
|
||||
public string DnnBin5Max { get; }
|
||||
public string DnnBin6Max { get; }
|
||||
public string DnnBin7Max { get; }
|
||||
public string DnnBin8Max { get; }
|
||||
public string DnnAllMean { get; }
|
||||
public string DnnLpdMean { get; }
|
||||
public string DnnLpdNMean { get; }
|
||||
public string DnnLpdESMean { get; }
|
||||
public string DnnMicroScrMean { get; }
|
||||
public string DnnScrMean { get; }
|
||||
public string DnnSlipMean { get; }
|
||||
public string DnnAreaCountMean { get; }
|
||||
public string DnnAreaMean { get; }
|
||||
public string DnnHazeAvgMean { get; }
|
||||
public string DnnHazeMedianMean { get; }
|
||||
public string DnnHazeStdDevMean { get; }
|
||||
public string DnnBin1Mean { get; }
|
||||
public string DnnBin2Mean { get; }
|
||||
public string DnnBin3Mean { get; }
|
||||
public string DnnBin4Mean { get; }
|
||||
public string DnnBin5Mean { get; }
|
||||
public string DnnBin6Mean { get; }
|
||||
public string DnnBin7Mean { get; }
|
||||
public string DnnBin8Mean { get; }
|
||||
public string DnnAllStdDev { get; }
|
||||
public string DnnLpdStdDev { get; }
|
||||
public string DnnLpdNStdDev { get; }
|
||||
public string DnnLpdESStdDev { get; }
|
||||
public string DnnMicroScrStdDev { get; }
|
||||
public string DnnScrStdDev { get; }
|
||||
public string DnnSlipStdDev { get; }
|
||||
public string DnnAreaCountStdDev { get; }
|
||||
public string DnnAreaStdDev { get; }
|
||||
public string DnnHazeAvgStdDev { get; }
|
||||
public string DnnHazeMedianStdDev { get; }
|
||||
public string DnnHazeStdDevStdDev { get; }
|
||||
public string DnnBin1StdDev { get; }
|
||||
public string DnnBin2StdDev { get; }
|
||||
public string DnnBin3StdDev { get; }
|
||||
public string DnnBin4StdDev { get; }
|
||||
public string DnnBin5StdDev { get; }
|
||||
public string DnnBin6StdDev { get; }
|
||||
public string DnnBin7StdDev { get; }
|
||||
public string DnnBin8StdDev { get; }
|
||||
//
|
||||
public string Side { get; }
|
||||
public string WaferID { get; }
|
||||
public string Grade { get; }
|
||||
public string SrcDest { get; }
|
||||
public string DcnAll { get; }
|
||||
public string DcnLpd { get; }
|
||||
public string DcnLpdN { get; }
|
||||
public string DcnLpdES { get; }
|
||||
public string DcnMicroScr { get; }
|
||||
public string DcnScr { get; }
|
||||
public string DcnSlip { get; }
|
||||
public string DcnAreaCount { get; }
|
||||
public string DcnArea { get; }
|
||||
public string DcnHazeAvg { get; }
|
||||
public string DcnHazeMedian { get; }
|
||||
public string DcnHazeStdDev { get; }
|
||||
public string DcnBin1 { get; }
|
||||
public string DcnBin2 { get; }
|
||||
public string DcnBin3 { get; }
|
||||
public string DcnBin4 { get; }
|
||||
public string DcnBin5 { get; }
|
||||
public string DcnBin6 { get; }
|
||||
public string DcnBin7 { get; }
|
||||
public string DcnBin8 { get; }
|
||||
public string DwnAll { get; }
|
||||
public string DwnLpd { get; }
|
||||
public string DwnLpdN { get; }
|
||||
public string DwnLpdES { get; }
|
||||
public string DwnMicroScr { get; }
|
||||
public string DwnScr { get; }
|
||||
public string DwnSlip { get; }
|
||||
public string DwnAreaCount { get; }
|
||||
public string DwnArea { get; }
|
||||
public string DwnHazeAvg { get; }
|
||||
public string DwnHazeMedian { get; }
|
||||
public string DwnHazeStdDev { get; }
|
||||
public string DwnBin1 { get; }
|
||||
public string DwnBin2 { get; }
|
||||
public string DwnBin3 { get; }
|
||||
public string DwnBin4 { get; }
|
||||
public string DwnBin5 { get; }
|
||||
public string DwnBin6 { get; }
|
||||
public string DwnBin7 { get; }
|
||||
public string DwnBin8 { get; }
|
||||
public string DnnAll { get; }
|
||||
public string DnnLpd { get; }
|
||||
public string DnnLpdN { get; }
|
||||
public string DnnLpdES { get; }
|
||||
public string DnnMicroScr { get; }
|
||||
public string DnnScr { get; }
|
||||
public string DnnSlip { get; }
|
||||
public string DnnAreaCount { get; }
|
||||
public string DnnArea { get; }
|
||||
public string DnnHazeAvg { get; }
|
||||
public string DnnHazeMedian { get; }
|
||||
public string DnnHazeStdDev { get; }
|
||||
public string DnnBin1 { get; }
|
||||
public string DnnBin2 { get; }
|
||||
public string DnnBin3 { get; }
|
||||
public string DnnBin4 { get; }
|
||||
public string DnnBin5 { get; }
|
||||
public string DnnBin6 { get; }
|
||||
public string DnnBin7 { get; }
|
||||
public string DnnBin8 { get; }
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Row))]
|
||||
internal partial class RowSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
127
Adaptation/FileHandlers/txt/Run.cs
Normal file
127
Adaptation/FileHandlers/txt/Run.cs
Normal file
@ -0,0 +1,127 @@
|
||||
using Adaptation.Shared;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.txt;
|
||||
|
||||
#nullable enable
|
||||
|
||||
internal class Run
|
||||
{
|
||||
|
||||
public Run(Header header, Summary summary, ReadOnlyCollection<Wafer> wafers)
|
||||
{
|
||||
Header = header;
|
||||
Summary = summary;
|
||||
Wafers = wafers;
|
||||
}
|
||||
|
||||
public Header Header { get; }
|
||||
public Summary Summary { get; }
|
||||
public ReadOnlyCollection<Wafer> Wafers { get; }
|
||||
|
||||
private static void WriteJson(Logistics logistics, List<FileInfo> fileInfoCollection, Run result)
|
||||
{
|
||||
FileInfo fileInfo = new($"{logistics.ReportFullPath}.run.json");
|
||||
string json = JsonSerializer.Serialize(result, RunSourceGenerationContext.Default.Run);
|
||||
File.WriteAllText(fileInfo.FullName, json);
|
||||
File.SetLastWriteTime(fileInfo.FullName, logistics.DateTimeFromSequence);
|
||||
fileInfoCollection.Add(fileInfo);
|
||||
}
|
||||
|
||||
private static ReadOnlyCollection<string> GetLines(Logistics logistics, JsonElement[]? jsonElements)
|
||||
{
|
||||
List<string> results = new();
|
||||
int columns = 0;
|
||||
StringBuilder stringBuilder = new();
|
||||
results.Add($"\"Count\",{jsonElements?.Length}");
|
||||
results.Add($"\"{nameof(logistics.Sequence)}\",\"{logistics.Sequence}\"");
|
||||
results.Add($"\"{nameof(logistics.MesEntity)}\",\"{logistics.MesEntity}\"");
|
||||
string dateTimeFromSequence = logistics.DateTimeFromSequence.ToString("MM/dd/yyyy hh:mm:ss tt");
|
||||
for (int i = 0; i < jsonElements?.Length;)
|
||||
{
|
||||
_ = stringBuilder.Append('"').Append(nameof(logistics.DateTimeFromSequence)).Append('"').Append(',');
|
||||
foreach (JsonProperty jsonProperty in jsonElements[0].EnumerateObject())
|
||||
{
|
||||
columns += 1;
|
||||
_ = stringBuilder.Append('"').Append(jsonProperty.Name).Append('"').Append(',');
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (jsonElements?.Length != 0)
|
||||
_ = stringBuilder.Remove(stringBuilder.Length - 1, 1);
|
||||
results.Add(stringBuilder.ToString());
|
||||
for (int i = 0; i < jsonElements?.Length; i++)
|
||||
{
|
||||
_ = stringBuilder.Clear();
|
||||
_ = stringBuilder.Append('"').Append(dateTimeFromSequence).Append('"').Append(',');
|
||||
foreach (JsonProperty jsonProperty in jsonElements[i].EnumerateObject())
|
||||
{
|
||||
if (jsonProperty.Value.ValueKind == JsonValueKind.Object)
|
||||
_ = stringBuilder.Append(',');
|
||||
else if (jsonProperty.Value.ValueKind != JsonValueKind.String)
|
||||
_ = stringBuilder.Append(jsonProperty.Value).Append(',');
|
||||
else
|
||||
_ = stringBuilder.Append('"').Append(jsonProperty.Value).Append('"').Append(',');
|
||||
}
|
||||
_ = stringBuilder.Remove(stringBuilder.Length - 1, 1);
|
||||
results.Add(stringBuilder.ToString());
|
||||
}
|
||||
return results.AsReadOnly();
|
||||
}
|
||||
|
||||
private static void WriteCommaSeparatedValues(Logistics logistics, Run run)
|
||||
{
|
||||
List<Row> results = new();
|
||||
Row row;
|
||||
for (int i = 0; i < run.Wafers.Count; i++)
|
||||
{
|
||||
row = new(run, i);
|
||||
results.Add(row);
|
||||
}
|
||||
string json = JsonSerializer.Serialize(results);
|
||||
JsonElement[]? jsonElements = JsonSerializer.Deserialize<JsonElement[]>(json);
|
||||
ReadOnlyCollection<string> lines = GetLines(logistics, jsonElements);
|
||||
File.WriteAllText($"{logistics.ReportFullPath}.csv", string.Join(Environment.NewLine, lines));
|
||||
}
|
||||
|
||||
internal static Run? Get(Logistics logistics, List<FileInfo> fileInfoCollection)
|
||||
{
|
||||
Run? result;
|
||||
string text = File.ReadAllText(logistics.ReportFullPath);
|
||||
if (string.IsNullOrEmpty(text))
|
||||
result = null;
|
||||
else
|
||||
{
|
||||
Constant constant = new();
|
||||
int[] i = new int[] { 0 };
|
||||
List<WaferSummaryInfo> dcnTotals = new();
|
||||
List<WaferSummaryInfo> dwnTotals = new();
|
||||
List<WaferSummaryInfo> dnnTotals = new();
|
||||
Header header = Header.Get(constant, i, text);
|
||||
Summary summary = Summary.Get(constant, i, text, dcnTotals, dwnTotals, dnnTotals);
|
||||
ReadOnlyCollection<Wafer> wafers = Wafer.Get(dcnTotals, dwnTotals, dnnTotals);
|
||||
if (wafers.Count == 0)
|
||||
result = null;
|
||||
else
|
||||
{
|
||||
result = new(header, summary, wafers);
|
||||
WriteJson(logistics, fileInfoCollection, result);
|
||||
WriteCommaSeparatedValues(logistics, result);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Run))]
|
||||
internal partial class RunSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
1110
Adaptation/FileHandlers/txt/Summary.cs
Normal file
1110
Adaptation/FileHandlers/txt/Summary.cs
Normal file
File diff suppressed because it is too large
Load Diff
287
Adaptation/FileHandlers/txt/Wafer.cs
Normal file
287
Adaptation/FileHandlers/txt/Wafer.cs
Normal file
@ -0,0 +1,287 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.txt;
|
||||
|
||||
public class Wafer
|
||||
{
|
||||
|
||||
public Wafer(string side,
|
||||
string waferID,
|
||||
string grade,
|
||||
string srcDest,
|
||||
string dcnAll,
|
||||
string dcnLpd,
|
||||
string dcnLpdN,
|
||||
string dcnLpdES,
|
||||
string dcnMicroScr,
|
||||
string dcnScr,
|
||||
string dcnSlip,
|
||||
string dcnAreaCount,
|
||||
string dcnArea,
|
||||
string dcnHazeAvg,
|
||||
string dcnHazeMedian,
|
||||
string dcnHazeStdDev,
|
||||
string dcnBin1,
|
||||
string dcnBin2,
|
||||
string dcnBin3,
|
||||
string dcnBin4,
|
||||
string dcnBin5,
|
||||
string dcnBin6,
|
||||
string dcnBin7,
|
||||
string dcnBin8,
|
||||
string dwnAll,
|
||||
string dwnLpd,
|
||||
string dwnLpdN,
|
||||
string dwnLpdES,
|
||||
string dwnMicroScr,
|
||||
string dwnScr,
|
||||
string dwnSlip,
|
||||
string dwnAreaCount,
|
||||
string dwnArea,
|
||||
string dwnHazeAvg,
|
||||
string dwnHazeMedian,
|
||||
string dwnHazeStdDev,
|
||||
string dwnBin1,
|
||||
string dwnBin2,
|
||||
string dwnBin3,
|
||||
string dwnBin4,
|
||||
string dwnBin5,
|
||||
string dwnBin6,
|
||||
string dwnBin7,
|
||||
string dwnBin8,
|
||||
string dnnAll,
|
||||
string dnnLpd,
|
||||
string dnnLpdN,
|
||||
string dnnLpdES,
|
||||
string dnnMicroScr,
|
||||
string dnnScr,
|
||||
string dnnSlip,
|
||||
string dnnAreaCount,
|
||||
string dnnArea,
|
||||
string dnnHazeAvg,
|
||||
string dnnHazeMedian,
|
||||
string dnnHazeStdDev,
|
||||
string dnnBin1,
|
||||
string dnnBin2,
|
||||
string dnnBin3,
|
||||
string dnnBin4,
|
||||
string dnnBin5,
|
||||
string dnnBin6,
|
||||
string dnnBin7,
|
||||
string dnnBin8)
|
||||
{
|
||||
Side = side;
|
||||
WaferID = waferID;
|
||||
Grade = grade;
|
||||
SrcDest = srcDest;
|
||||
DcnAll = dcnAll;
|
||||
DcnLpd = dcnLpd;
|
||||
DcnLpdN = dcnLpdN;
|
||||
DcnLpdES = dcnLpdES;
|
||||
DcnMicroScr = dcnMicroScr;
|
||||
DcnScr = dcnScr;
|
||||
DcnSlip = dcnSlip;
|
||||
DcnAreaCount = dcnAreaCount;
|
||||
DcnArea = dcnArea;
|
||||
DcnHazeAvg = dcnHazeAvg;
|
||||
DcnHazeMedian = dcnHazeMedian;
|
||||
DcnHazeStdDev = dcnHazeStdDev;
|
||||
DcnBin1 = dcnBin1;
|
||||
DcnBin2 = dcnBin2;
|
||||
DcnBin3 = dcnBin3;
|
||||
DcnBin4 = dcnBin4;
|
||||
DcnBin5 = dcnBin5;
|
||||
DcnBin6 = dcnBin6;
|
||||
DcnBin7 = dcnBin7;
|
||||
DcnBin8 = dcnBin8;
|
||||
DwnAll = dwnAll;
|
||||
DwnLpd = dwnLpd;
|
||||
DwnLpdN = dwnLpdN;
|
||||
DwnLpdES = dwnLpdES;
|
||||
DwnMicroScr = dwnMicroScr;
|
||||
DwnScr = dwnScr;
|
||||
DwnSlip = dwnSlip;
|
||||
DwnAreaCount = dwnAreaCount;
|
||||
DwnArea = dwnArea;
|
||||
DwnHazeAvg = dwnHazeAvg;
|
||||
DwnHazeMedian = dwnHazeMedian;
|
||||
DwnHazeStdDev = dwnHazeStdDev;
|
||||
DwnBin1 = dwnBin1;
|
||||
DwnBin2 = dwnBin2;
|
||||
DwnBin3 = dwnBin3;
|
||||
DwnBin4 = dwnBin4;
|
||||
DwnBin5 = dwnBin5;
|
||||
DwnBin6 = dwnBin6;
|
||||
DwnBin7 = dwnBin7;
|
||||
DwnBin8 = dwnBin8;
|
||||
DnnAll = dnnAll;
|
||||
DnnLpd = dnnLpd;
|
||||
DnnLpdN = dnnLpdN;
|
||||
DnnLpdES = dnnLpdES;
|
||||
DnnMicroScr = dnnMicroScr;
|
||||
DnnScr = dnnScr;
|
||||
DnnSlip = dnnSlip;
|
||||
DnnAreaCount = dnnAreaCount;
|
||||
DnnArea = dnnArea;
|
||||
DnnHazeAvg = dnnHazeAvg;
|
||||
DnnHazeMedian = dnnHazeMedian;
|
||||
DnnHazeStdDev = dnnHazeStdDev;
|
||||
DnnBin1 = dnnBin1;
|
||||
DnnBin2 = dnnBin2;
|
||||
DnnBin3 = dnnBin3;
|
||||
DnnBin4 = dnnBin4;
|
||||
DnnBin5 = dnnBin5;
|
||||
DnnBin6 = dnnBin6;
|
||||
DnnBin7 = dnnBin7;
|
||||
DnnBin8 = dnnBin8;
|
||||
}
|
||||
|
||||
public string Side { get; }
|
||||
public string WaferID { get; }
|
||||
public string Grade { get; }
|
||||
public string SrcDest { get; }
|
||||
public string DcnAll { get; }
|
||||
public string DcnLpd { get; }
|
||||
public string DcnLpdN { get; }
|
||||
public string DcnLpdES { get; }
|
||||
public string DcnMicroScr { get; }
|
||||
public string DcnScr { get; }
|
||||
public string DcnSlip { get; }
|
||||
public string DcnAreaCount { get; }
|
||||
public string DcnArea { get; }
|
||||
public string DcnHazeAvg { get; }
|
||||
public string DcnHazeMedian { get; }
|
||||
public string DcnHazeStdDev { get; }
|
||||
public string DcnBin1 { get; }
|
||||
public string DcnBin2 { get; }
|
||||
public string DcnBin3 { get; }
|
||||
public string DcnBin4 { get; }
|
||||
public string DcnBin5 { get; }
|
||||
public string DcnBin6 { get; }
|
||||
public string DcnBin7 { get; }
|
||||
public string DcnBin8 { get; }
|
||||
public string DwnAll { get; }
|
||||
public string DwnLpd { get; }
|
||||
public string DwnLpdN { get; }
|
||||
public string DwnLpdES { get; }
|
||||
public string DwnMicroScr { get; }
|
||||
public string DwnScr { get; }
|
||||
public string DwnSlip { get; }
|
||||
public string DwnAreaCount { get; }
|
||||
public string DwnArea { get; }
|
||||
public string DwnHazeAvg { get; }
|
||||
public string DwnHazeMedian { get; }
|
||||
public string DwnHazeStdDev { get; }
|
||||
public string DwnBin1 { get; }
|
||||
public string DwnBin2 { get; }
|
||||
public string DwnBin3 { get; }
|
||||
public string DwnBin4 { get; }
|
||||
public string DwnBin5 { get; }
|
||||
public string DwnBin6 { get; }
|
||||
public string DwnBin7 { get; }
|
||||
public string DwnBin8 { get; }
|
||||
public string DnnAll { get; }
|
||||
public string DnnLpd { get; }
|
||||
public string DnnLpdN { get; }
|
||||
public string DnnLpdES { get; }
|
||||
public string DnnMicroScr { get; }
|
||||
public string DnnScr { get; }
|
||||
public string DnnSlip { get; }
|
||||
public string DnnAreaCount { get; }
|
||||
public string DnnArea { get; }
|
||||
public string DnnHazeAvg { get; }
|
||||
public string DnnHazeMedian { get; }
|
||||
public string DnnHazeStdDev { get; }
|
||||
public string DnnBin1 { get; }
|
||||
public string DnnBin2 { get; }
|
||||
public string DnnBin3 { get; }
|
||||
public string DnnBin4 { get; }
|
||||
public string DnnBin5 { get; }
|
||||
public string DnnBin6 { get; }
|
||||
public string DnnBin7 { get; }
|
||||
public string DnnBin8 { get; }
|
||||
|
||||
internal static ReadOnlyCollection<Wafer> Get(List<WaferSummaryInfo> dcnTotals, List<WaferSummaryInfo> dwnTotals, List<WaferSummaryInfo> dnnTotals)
|
||||
{
|
||||
List<Wafer> results = new();
|
||||
Wafer wafer;
|
||||
for (int i = 0; i < dcnTotals.Count; i++)
|
||||
{
|
||||
wafer = new(side: dcnTotals[i].Side,
|
||||
waferID: dcnTotals[i].WaferID,
|
||||
grade: dcnTotals[i].Grade,
|
||||
srcDest: dcnTotals[i].SrcDest,
|
||||
dcnAll: dcnTotals[i].All ?? string.Empty,
|
||||
dcnLpd: dcnTotals[i].Lpd ?? string.Empty,
|
||||
dcnLpdN: dcnTotals[i].LpdN ?? string.Empty,
|
||||
dcnLpdES: dcnTotals[i].LpdES ?? string.Empty,
|
||||
dcnMicroScr: dcnTotals[i].MicroScr ?? string.Empty,
|
||||
dcnScr: dcnTotals[i].Scr ?? string.Empty,
|
||||
dcnSlip: dcnTotals[i].Slip ?? string.Empty,
|
||||
dcnAreaCount: dcnTotals[i].AreaNum ?? string.Empty,
|
||||
dcnArea: dcnTotals[i].Area ?? string.Empty,
|
||||
dcnHazeAvg: dcnTotals[i].HazeAvg ?? string.Empty,
|
||||
dcnHazeMedian: dcnTotals[i].HazeMedian ?? string.Empty,
|
||||
dcnHazeStdDev: dcnTotals[i].HazeStdDev ?? string.Empty,
|
||||
dcnBin1: dcnTotals[i].Bin1 ?? string.Empty,
|
||||
dcnBin2: dcnTotals[i].Bin2 ?? string.Empty,
|
||||
dcnBin3: dcnTotals[i].Bin3 ?? string.Empty,
|
||||
dcnBin4: dcnTotals[i].Bin4 ?? string.Empty,
|
||||
dcnBin5: dcnTotals[i].Bin5 ?? string.Empty,
|
||||
dcnBin6: dcnTotals[i].Bin6 ?? string.Empty,
|
||||
dcnBin7: dcnTotals[i].Bin7 ?? string.Empty,
|
||||
dcnBin8: dcnTotals[i].Bin8 ?? string.Empty,
|
||||
dwnAll: dwnTotals[i].All ?? string.Empty,
|
||||
dwnLpd: dwnTotals[i].Lpd ?? string.Empty,
|
||||
dwnLpdN: dwnTotals[i].LpdN ?? string.Empty,
|
||||
dwnLpdES: dwnTotals[i].LpdES ?? string.Empty,
|
||||
dwnMicroScr: dwnTotals[i].MicroScr ?? string.Empty,
|
||||
dwnScr: dwnTotals[i].Scr ?? string.Empty,
|
||||
dwnSlip: dwnTotals[i].Slip ?? string.Empty,
|
||||
dwnAreaCount: dwnTotals[i].AreaNum ?? string.Empty,
|
||||
dwnArea: dwnTotals[i].Area ?? string.Empty,
|
||||
dwnHazeAvg: dwnTotals[i].HazeAvg ?? string.Empty,
|
||||
dwnHazeMedian: dwnTotals[i].HazeMedian ?? string.Empty,
|
||||
dwnHazeStdDev: dwnTotals[i].HazeStdDev ?? string.Empty,
|
||||
dwnBin1: dwnTotals[i].Bin1 ?? string.Empty,
|
||||
dwnBin2: dwnTotals[i].Bin2 ?? string.Empty,
|
||||
dwnBin3: dwnTotals[i].Bin3 ?? string.Empty,
|
||||
dwnBin4: dwnTotals[i].Bin4 ?? string.Empty,
|
||||
dwnBin5: dwnTotals[i].Bin5 ?? string.Empty,
|
||||
dwnBin6: dwnTotals[i].Bin6 ?? string.Empty,
|
||||
dwnBin7: dwnTotals[i].Bin7 ?? string.Empty,
|
||||
dwnBin8: dwnTotals[i].Bin8 ?? string.Empty,
|
||||
dnnAll: dnnTotals[i].All ?? string.Empty,
|
||||
dnnLpd: dnnTotals[i].Lpd ?? string.Empty,
|
||||
dnnLpdN: dnnTotals[i].LpdN ?? string.Empty,
|
||||
dnnLpdES: dnnTotals[i].LpdES ?? string.Empty,
|
||||
dnnMicroScr: dnnTotals[i].MicroScr ?? string.Empty,
|
||||
dnnScr: dnnTotals[i].Scr ?? string.Empty,
|
||||
dnnSlip: dnnTotals[i].Slip ?? string.Empty,
|
||||
dnnAreaCount: dnnTotals[i].AreaNum ?? string.Empty,
|
||||
dnnArea: dnnTotals[i].Area ?? string.Empty,
|
||||
dnnHazeAvg: dnnTotals[i].HazeAvg ?? string.Empty,
|
||||
dnnHazeMedian: dnnTotals[i].HazeMedian ?? string.Empty,
|
||||
dnnHazeStdDev: dnnTotals[i].HazeStdDev ?? string.Empty,
|
||||
dnnBin1: dnnTotals[i].Bin1 ?? string.Empty,
|
||||
dnnBin2: dnnTotals[i].Bin2 ?? string.Empty,
|
||||
dnnBin3: dnnTotals[i].Bin3 ?? string.Empty,
|
||||
dnnBin4: dnnTotals[i].Bin4 ?? string.Empty,
|
||||
dnnBin5: dnnTotals[i].Bin5 ?? string.Empty,
|
||||
dnnBin6: dnnTotals[i].Bin6 ?? string.Empty,
|
||||
dnnBin7: dnnTotals[i].Bin7 ?? string.Empty,
|
||||
dnnBin8: dnnTotals[i].Bin8 ?? string.Empty);
|
||||
results.Add(wafer);
|
||||
}
|
||||
return results.AsReadOnly();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Wafer))]
|
||||
internal partial class WaferSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
@ -18,22 +18,13 @@ public class MonIn : IMonIn, IDisposable
|
||||
public static MonIn GetInstance(string url = "http://moninhttp.{0}.infineon.com/input/text")
|
||||
{
|
||||
MonIn instance;
|
||||
if (_Instances.ContainsKey(url))
|
||||
{
|
||||
instance = _Instances[url];
|
||||
}
|
||||
else
|
||||
{
|
||||
lock (_Instances)
|
||||
{
|
||||
if (!_Instances.ContainsKey(url))
|
||||
if (_Instances.TryGetValue(url, out instance))
|
||||
{
|
||||
instance = new MonIn(url);
|
||||
_Instances.Add(url, instance);
|
||||
}
|
||||
else
|
||||
instance = _Instances[url];
|
||||
}
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
@ -1,187 +1 @@
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- development
|
||||
paths:
|
||||
include:
|
||||
- "Adaptation/*"
|
||||
|
||||
pool:
|
||||
name: Mesa-Windows-Service
|
||||
demands: MET08DDUPSP1TBI-Development
|
||||
|
||||
steps:
|
||||
- script: |
|
||||
set coreVersion=net7.0
|
||||
echo %coreVersion%
|
||||
echo ##vso[task.setvariable variable=CoreVersion;]%coreVersion%
|
||||
echo $(CoreVersion)
|
||||
displayName: CoreVersion
|
||||
|
||||
- script: |
|
||||
set configuration=Debug
|
||||
echo %configuration%
|
||||
echo ##vso[task.setvariable variable=Configuration;]%configuration%
|
||||
echo $(Configuration)
|
||||
displayName: Configuration
|
||||
|
||||
- script: |
|
||||
set nugetSource=https://eaf-dev-reporting.mes.infineon.com/v3/index.json
|
||||
echo %nugetSource%
|
||||
echo ##vso[task.setvariable variable=NugetSource;]%nugetSource%
|
||||
echo $(NugetSource)
|
||||
displayName: NugetSource
|
||||
|
||||
- script: |
|
||||
set gitCommit=$(Build.SourceVersion)
|
||||
set gitCommitSeven=%gitCommit:~0,7%
|
||||
echo %gitCommitSeven%
|
||||
echo ##vso[task.setvariable variable=GitCommitSeven;]%gitCommitSeven%
|
||||
echo $(GitCommitSeven)
|
||||
displayName: GitCommitSeven
|
||||
|
||||
- script: |
|
||||
echo $(Build.BuildId)
|
||||
echo $(Build.Reason)
|
||||
echo $(Build.Repository.Id)
|
||||
echo $(Build.Repository.Name)
|
||||
echo $(Build.SourceVersion)
|
||||
echo $(CoreVersion)
|
||||
echo $(Configuration)
|
||||
echo $(NugetSource)
|
||||
echo $(GitCommitSeven)
|
||||
REM echo $(pipelinePassword)
|
||||
displayName: "Echo Check"
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" nuget locals all --clear'
|
||||
displayName: "Nuget Clear"
|
||||
# enabled: false
|
||||
|
||||
- script: |
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets init
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "BuildNumber" "$(Build.BuildId)"
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "GitCommitSeven" "$(GitCommitSeven)"
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets list
|
||||
workingDirectory: Adaptation
|
||||
displayName: "Safe storage of app secrets - Adaptation"
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: "Copy Files to: - GhostPCL"
|
||||
inputs:
|
||||
SourceFolder: '\\messv02ecc1.ec.local\EC_EAFRepository\Staging\DeploymentStorage\GhostPCL\gpcl6win64'
|
||||
TargetFolder: 'Adaptation\bin\$(Configuration)\net6.0\win-x64'
|
||||
OverWrite: true
|
||||
enabled: false
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: "Copy Files to: - LincPDFC"
|
||||
inputs:
|
||||
SourceFolder: '\\messv02ecc1.ec.local\EC_EAFRepository\Staging\DeploymentStorage\LincPDFC\v2.6.6.21'
|
||||
TargetFolder: 'Adaptation\bin\$(Configuration)\net6.0\win-x64'
|
||||
OverWrite: true
|
||||
enabled: false
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: "Copy Files to: - PDF-Text-Stripper"
|
||||
inputs:
|
||||
SourceFolder: '\\messv02ecc1.ec.local\EC_EAFRepository\Staging\DeploymentStorage\PDF-Text-Stripper\v4.8.0.1'
|
||||
TargetFolder: 'Adaptation\bin\$(Configuration)\net6.0\win-x64'
|
||||
OverWrite: true
|
||||
enabled: false
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" build --configuration $(Configuration) --source $(NugetSource)'
|
||||
workingDirectory: Adaptation
|
||||
displayName: "Core Build - Adaptation"
|
||||
|
||||
- powershell: Get-ChildItem .\ -include TestResults -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }
|
||||
workingDirectory: "$(System.DefaultWorkingDirectory)/../../../$(Build.Repository.Name)"
|
||||
displayName: "PowerShell Script"
|
||||
continueOnError: true
|
||||
|
||||
- script: "dotnet test --configuration $(Configuration)"
|
||||
workingDirectory: Adaptation
|
||||
displayName: "Core Test"
|
||||
|
||||
- script: 'move /y "$(System.DefaultWorkingDirectory)/../../../$(Build.Repository.Name)/05_TestResults/TestResults" $(System.DefaultWorkingDirectory)'
|
||||
displayName: "Move Results"
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" tool restore'
|
||||
workingDirectory: Adaptation
|
||||
displayName: "Tool Restore"
|
||||
enabled: false
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" ReportGenerator -reports:$(System.DefaultWorkingDirectory)/TestResults/**/coverage.cobertura.xml -targetDir:$(Build.ArtifactStagingDirectory)\Coverage -reportTypes:Html_Dark'
|
||||
workingDirectory: Adaptation
|
||||
displayName: "Report Generator"
|
||||
enabled: false
|
||||
|
||||
- task: PublishTestResults@2
|
||||
displayName: "Publish Test Results **/*.trx"
|
||||
inputs:
|
||||
testResultsFormat: VSTest
|
||||
testResultsFiles: "**/*.trx"
|
||||
testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
|
||||
searchFolder: "$(System.DefaultWorkingDirectory)/TestResults"
|
||||
|
||||
- task: PublishTestResults@2
|
||||
displayName: "Publish Test Results */coverage.cobertura.xml"
|
||||
inputs:
|
||||
testResultsFormat: VSTest
|
||||
testResultsFiles: "*/coverage.cobertura.xml"
|
||||
testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
|
||||
searchFolder: "$(System.DefaultWorkingDirectory)/TestResults"
|
||||
|
||||
- task: mspremier.CreateWorkItem.CreateWorkItem-task.CreateWorkItem@1
|
||||
displayName: "Create work item"
|
||||
inputs:
|
||||
teamProject: "Mesa_FI"
|
||||
workItemType: Bug
|
||||
title: $(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)
|
||||
assignedTo: "$(Build.RequestedForId)"
|
||||
enabled: false
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" publish --configuration $(Configuration) --runtime win-x64 --self-contained -o $(Build.ArtifactStagingDirectory)\Adaptation --source $(NugetSource)'
|
||||
workingDirectory: Adaptation
|
||||
displayName: "Core Publish"
|
||||
enabled: false
|
||||
|
||||
- script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /target:Restore /detailedsummary /consoleloggerparameters:PerformanceSummary;ErrorsOnly; /property:Configuration=$(Configuration);TargetFrameworkVersion=v4.8 /p:RestoreSources=$(NugetSource)'
|
||||
displayName: "MSBuild Restore"
|
||||
|
||||
- script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /target:Build /detailedsummary /consoleloggerparameters:PerformanceSummary;ErrorsOnly; /property:Configuration=$(Configuration);TargetFrameworkVersion=v4.8'
|
||||
displayName: MSBuild
|
||||
|
||||
- script: 'echo $(Build.SourceVersion)-$(Build.BuildId)-$(Build.Repository.Name)>bin\$(Configuration)\$(Build.Repository.Name).txt'
|
||||
displayName: "Commit Id"
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy Files to: D:\Framework4.8'
|
||||
inputs:
|
||||
SourceFolder: 'bin\$(Configuration)'
|
||||
Contents: "*$(Build.Repository.Name)*"
|
||||
TargetFolder: 'D:\Framework4.8\$(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)'
|
||||
OverWrite: true
|
||||
enabled: false
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy Files to: \\messv02ecc1.ec.local\EC_EAFRepository'
|
||||
inputs:
|
||||
SourceFolder: 'bin\$(Configuration)'
|
||||
Contents: "*$(Build.Repository.Name)*"
|
||||
TargetFolder: '\\messv02ecc1.ec.local\EC_EAFRepository\Staging\DeploymentStorage\Adaptation_$(Build.Repository.Name)'
|
||||
OverWrite: true
|
||||
enabled: false
|
||||
|
||||
- script: |
|
||||
"C:\program files\dotnet\dotnet.exe" clean --configuration $(Configuration)
|
||||
workingDirectory: Adaptation
|
||||
displayName: "Core Clean - Tests"
|
||||
|
||||
- script: |
|
||||
"C:\program files\dotnet\dotnet.exe" clean --configuration $(Configuration)
|
||||
workingDirectory: Adaptation
|
||||
displayName: "Core Clean - Adaptation"
|
||||
|
||||
- script: 'echo $(Build.SourceVersion)-$(Build.BuildId)>bin_x_x_\$(Configuration)\$(CoreVersion)\win-x64\$(Build.Repository.Name).txt'
|
||||
displayName: "Force Fail"
|
||||
enabled: false
|
||||
# dotnet nuget push --source https://tfs.intra.infineon.com/tfs/FactoryIntegration/fccf8303-9cf7-4788-a9e0-4042541503fa/_packaging/EAF-Mesa-Integration/nuget/v3/index.json --api-key az D:\vsts-agent-win-x64-2.210.1-eaf\nuget\infineon.mesa.pdf.text.stripper.4.8.0.1.nupkg
|
@ -8,10 +8,9 @@
|
||||
<PropertyGroup>
|
||||
<ImplicitUsings>disable</ImplicitUsings>
|
||||
<IsPackable>false</IsPackable>
|
||||
<LangVersion>10.0</LangVersion>
|
||||
<Nullable>disable</Nullable>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<VSTestLogger>trx</VSTestLogger>
|
||||
@ -33,7 +32,10 @@
|
||||
<DefineConstants>Linux</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.0" />
|
||||
<RuntimeHostConfigurationOption Include="AssemblyName" Value="MET08DDUPSP1TBI" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<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>
|
||||
@ -42,42 +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.AspNet.WebApi.SelfHost" Version="5.2.9" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.json" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.1" />
|
||||
<PackageReference Include="Microsoft.Win32.SystemEvents" Version="7.0.0" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="3.0.4" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="3.0.4" />
|
||||
<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.2.8" />
|
||||
<PackageReference Include="System.Configuration.ConfigurationManager" Version="7.0.0" />
|
||||
<PackageReference Include="System.Data.OleDb" Version="7.0.0" />
|
||||
<PackageReference Include="System.Data.SqlClient" Version="4.8.5" />
|
||||
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
|
||||
<PackageReference Include="System.Text.Json" Version="7.0.2" />
|
||||
<PackageReference Include="Tesseract" Version="5.2.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="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.2"><NoWarn>NU1701</NoWarn></PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Infineon.Yoda.DotNetCore" Version="5.4.3" />
|
||||
<PackageReference Include="Tibco.Rendezvous.DotNetCore" Version="8.5.0" />
|
||||
<PackageReference Include="Infineon.Yoda.DotNetCore" Version="5.4.1" />
|
||||
</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="Tesseract" Version="5.2.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="appsettings.json">
|
||||
@ -94,10 +93,10 @@
|
||||
<None Condition="'$(Configuration)' == 'Debug'" Include="\\mestsa003.infineon.com\EC_EAFRepository\Staging\DeploymentStorage\GhostPCL\gpcl6win64\gpcl6win64.exe">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Condition="'$(Configuration)' == 'Release'" Include="\\messv02ecc1.ec.local\EC_EAFRepository\Staging\DeploymentStorage\GhostPCL\gpcl6win64\gpcl6dll64.dll">
|
||||
<None Condition="'$(Configuration)' == 'Release'" Include="\\mesfs.infineon.com\EC_EAFRepository\Staging\DeploymentStorage\GhostPCL\gpcl6win64\gpcl6dll64.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Condition="'$(Configuration)' == 'Release'" Include="\\messv02ecc1.ec.local\EC_EAFRepository\Staging\DeploymentStorage\GhostPCL\gpcl6win64\gpcl6win64.exe">
|
||||
<None Condition="'$(Configuration)' == 'Release'" Include="\\mesfs.infineon.com\EC_EAFRepository\Staging\DeploymentStorage\GhostPCL\gpcl6win64\gpcl6win64.exe">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
@ -1,3 +1,9 @@
|
||||
# D:
|
||||
# cd D:\EAF-Mesa-Integration
|
||||
# config --url https://tfs.intra.infineon.com/tfs/FactoryIntegration --pool "EAF Mesa Integration" --agent mestsa003-meseafsvc --work _work --runAsService --auth negotiate --userName infineon\phares
|
||||
# D:
|
||||
# cd D:\EAF-Mesa-Integration
|
||||
# config --url https://tfs.intra.infineon.com/tfs/FactoryIntegration --pool "EAF Mesa Integration" --agent mestsa07ec-ecmeseaf --work _work --runAsService --auth negotiate --userName infineon\phares
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
@ -6,40 +12,21 @@ trigger:
|
||||
include:
|
||||
- "Adaptation/*"
|
||||
|
||||
stages:
|
||||
- stage: DevServer
|
||||
displayName: DevServer
|
||||
|
||||
pool:
|
||||
name: Mesa-Windows-Service
|
||||
demands: MET08DDUPSP1TBI
|
||||
name: EAF Mesa Integration
|
||||
demands: MET08DDUPSP1TBI-Development
|
||||
|
||||
variables:
|
||||
coreVersion: "net8.0"
|
||||
nugetSource: "https://artifactory.intra.infineon.com/artifactory/api/nuget/ngt-fi-package-main-vir/"
|
||||
|
||||
jobs:
|
||||
- job: SetupEnvironment
|
||||
steps:
|
||||
- script: |
|
||||
set coreVersion=net7.0
|
||||
echo %coreVersion%
|
||||
echo ##vso[task.setvariable variable=CoreVersion;]%coreVersion%
|
||||
echo $(CoreVersion)
|
||||
displayName: CoreVersion
|
||||
|
||||
- script: |
|
||||
set configuration=Release
|
||||
echo %configuration%
|
||||
echo ##vso[task.setvariable variable=Configuration;]%configuration%
|
||||
echo $(Configuration)
|
||||
displayName: Configuration
|
||||
|
||||
- script: |
|
||||
set nugetSource=https://eaf-prod.mes.infineon.com/v3/index.json
|
||||
echo %nugetSource%
|
||||
echo ##vso[task.setvariable variable=NugetSource;]%nugetSource%
|
||||
echo $(NugetSource)
|
||||
displayName: NugetSource
|
||||
|
||||
- script: |
|
||||
set gitCommit=$(Build.SourceVersion)
|
||||
set gitCommitSeven=%gitCommit:~0,7%
|
||||
echo %gitCommitSeven%
|
||||
echo ##vso[task.setvariable variable=GitCommitSeven;]%gitCommitSeven%
|
||||
echo $(GitCommitSeven)
|
||||
displayName: GitCommitSeven
|
||||
|
||||
- script: |
|
||||
echo $(Build.BuildId)
|
||||
echo $(Build.Reason)
|
||||
@ -47,10 +34,7 @@ steps:
|
||||
echo $(Build.Repository.Name)
|
||||
echo $(Build.SourceVersion)
|
||||
echo $(CoreVersion)
|
||||
echo $(Configuration)
|
||||
echo $(NugetSource)
|
||||
echo $(GitCommitSeven)
|
||||
REM echo $(pipelinePassword)
|
||||
displayName: "Echo Check"
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" nuget locals all --clear'
|
||||
@ -60,36 +44,71 @@ steps:
|
||||
- script: |
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets init
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "BuildNumber" "$(Build.BuildId)"
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "GitCommitSeven" "$(GitCommitSeven)"
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "GitCommit" "$(Build.SourceVersion)"
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets list
|
||||
workingDirectory: Adaptation
|
||||
displayName: "Safe storage of app secrets - Adaptation"
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: "Copy Files to: - GhostPCL"
|
||||
inputs:
|
||||
SourceFolder: '\\messv02ecc1.ec.local\EC_EAFRepository\Staging\DeploymentStorage\GhostPCL\gpcl6win64'
|
||||
TargetFolder: 'Adaptation\bin\$(Configuration)\net6.0\win-x64'
|
||||
OverWrite: true
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: "Copy Files to: - LincPDFC"
|
||||
inputs:
|
||||
SourceFolder: '\\messv02ecc1.ec.local\EC_EAFRepository\Staging\DeploymentStorage\LincPDFC\v2.6.6.21'
|
||||
TargetFolder: 'Adaptation\bin\$(Configuration)\net6.0\win-x64'
|
||||
OverWrite: true
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: "Copy Files to: - PDF-Text-Stripper"
|
||||
inputs:
|
||||
SourceFolder: '\\messv02ecc1.ec.local\EC_EAFRepository\Staging\DeploymentStorage\PDF-Text-Stripper\v4.8.0.1'
|
||||
TargetFolder: 'Adaptation\bin\$(Configuration)\net6.0\win-x64'
|
||||
OverWrite: true
|
||||
- job: BuildDebug
|
||||
dependsOn:
|
||||
- SetupEnvironment
|
||||
steps:
|
||||
- script: |
|
||||
set configuration=Debug
|
||||
echo %configuration%
|
||||
echo ##vso[task.setvariable variable=Configuration;]%configuration%
|
||||
echo $(Configuration)
|
||||
displayName: Configuration
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" build --configuration $(Configuration) --source $(NugetSource)'
|
||||
workingDirectory: Adaptation
|
||||
displayName: "Core Build - Adaptation"
|
||||
|
||||
- job: BuildRelease
|
||||
dependsOn:
|
||||
- SetupEnvironment
|
||||
steps:
|
||||
- script: |
|
||||
set configuration=Release
|
||||
echo %configuration%
|
||||
echo ##vso[task.setvariable variable=Configuration;]%configuration%
|
||||
echo $(Configuration)
|
||||
displayName: Configuration
|
||||
|
||||
- script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /target:Restore /detailedsummary /consoleloggerparameters:PerformanceSummary;ErrorsOnly; /property:Configuration=$(Configuration);TargetFrameworkVersion=v4.8 /p:RestoreSources=$(NugetSource)'
|
||||
displayName: "MSBuild Restore"
|
||||
|
||||
- script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /target:Build /detailedsummary /consoleloggerparameters:PerformanceSummary;ErrorsOnly; /property:Configuration=$(Configuration);TargetFrameworkVersion=v4.8'
|
||||
displayName: MSBuild
|
||||
|
||||
- script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /target:Build /detailedsummary /consoleloggerparameters:PerformanceSummary;ErrorsOnly; /property:Configuration=$(Configuration);TargetFrameworkVersion=v4.8'
|
||||
displayName: MSBuild
|
||||
|
||||
- script: 'echo $(Build.Repository.Name)-$(Build.BuildId)-$(Build.SourceVersion)>bin\$(Configuration)\$(Build.Repository.Name).txt'
|
||||
displayName: "Commit Id"
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy Files to: D:\EAF'
|
||||
inputs:
|
||||
Contents: "*$(Build.Repository.Name)*"
|
||||
SourceFolder: 'bin\$(Configuration)'
|
||||
TargetFolder: 'D:\EAF\EAF Deployment Storage\Adaptation_$(Build.Repository.Name)'
|
||||
OverWrite: true
|
||||
enabled: true
|
||||
|
||||
- job: TestDebug
|
||||
dependsOn:
|
||||
- SetupEnvironment
|
||||
- BuildDebug
|
||||
- BuildRelease
|
||||
steps:
|
||||
- script: |
|
||||
set configuration=Debug
|
||||
echo %configuration%
|
||||
echo ##vso[task.setvariable variable=Configuration;]%configuration%
|
||||
echo $(Configuration)
|
||||
displayName: Configuration
|
||||
|
||||
- powershell: Get-ChildItem .\ -include TestResults -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }
|
||||
workingDirectory: "$(System.DefaultWorkingDirectory)/../../../$(Build.Repository.Name)"
|
||||
displayName: "PowerShell Script"
|
||||
@ -117,7 +136,7 @@ steps:
|
||||
inputs:
|
||||
testResultsFormat: VSTest
|
||||
testResultsFiles: "**/*.trx"
|
||||
testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
|
||||
testRunTitle: "$(Build.BuildId)-$(Build.SourceVersion)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
|
||||
searchFolder: "$(System.DefaultWorkingDirectory)/TestResults"
|
||||
|
||||
- task: PublishTestResults@2
|
||||
@ -125,58 +144,141 @@ steps:
|
||||
inputs:
|
||||
testResultsFormat: VSTest
|
||||
testResultsFiles: "*/coverage.cobertura.xml"
|
||||
testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
|
||||
testRunTitle: "$(Build.BuildId)-$(Build.SourceVersion)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
|
||||
searchFolder: "$(System.DefaultWorkingDirectory)/TestResults"
|
||||
|
||||
- task: mspremier.CreateWorkItem.CreateWorkItem-task.CreateWorkItem@1
|
||||
displayName: "Create work item"
|
||||
inputs:
|
||||
teamProject: "Mesa_FI"
|
||||
workItemType: Bug
|
||||
title: $(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)
|
||||
assignedTo: "$(Build.RequestedForId)"
|
||||
- script: |
|
||||
"C:\program files\dotnet\dotnet.exe" clean --configuration $(Configuration)
|
||||
workingDirectory: Adaptation
|
||||
displayName: "Core Clean - Adaptation"
|
||||
|
||||
- script: 'echo $(Build.BuildId)-$(Build.SourceVersion)-bin_x_x_\$(Configuration)\$(CoreVersion)\win-x64\$(Build.Repository.Name).txt'
|
||||
displayName: "Force Fail"
|
||||
enabled: false
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" publish --configuration $(Configuration) --runtime win-x64 --self-contained -o $(Build.ArtifactStagingDirectory)\Adaptation --source $(NugetSource)'
|
||||
workingDirectory: Adaptation
|
||||
displayName: "Core Publish"
|
||||
- stage: ProductionServer
|
||||
displayName: ProductionServer
|
||||
|
||||
pool:
|
||||
name: EAF Mesa Integration
|
||||
demands: MET08DDUPSP1TBI
|
||||
|
||||
variables:
|
||||
coreVersion: "net8.0"
|
||||
nugetSource: "https://artifactory.intra.infineon.com/artifactory/api/nuget/ngt-fi-package-main-vir/"
|
||||
|
||||
jobs:
|
||||
- job: SetupEnvironment
|
||||
steps:
|
||||
- script: |
|
||||
echo $(Build.BuildId)
|
||||
echo $(Build.Reason)
|
||||
echo $(Build.Repository.Id)
|
||||
echo $(Build.Repository.Name)
|
||||
echo $(Build.SourceVersion)
|
||||
echo $(CoreVersion)
|
||||
echo $(NugetSource)
|
||||
displayName: "Echo Check"
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" nuget locals all --clear'
|
||||
displayName: "Nuget Clear"
|
||||
enabled: false
|
||||
|
||||
- script: |
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets init
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "BuildNumber" "$(Build.BuildId)"
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "GitCommit" "$(Build.SourceVersion)"
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets list
|
||||
workingDirectory: Adaptation
|
||||
displayName: "Safe storage of app secrets - Adaptation"
|
||||
|
||||
- job: BuildRelease
|
||||
dependsOn:
|
||||
- SetupEnvironment
|
||||
steps:
|
||||
- script: |
|
||||
set configuration=Release
|
||||
echo %configuration%
|
||||
echo ##vso[task.setvariable variable=Configuration;]%configuration%
|
||||
echo $(Configuration)
|
||||
displayName: Configuration
|
||||
|
||||
- script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /target:Restore /detailedsummary /consoleloggerparameters:PerformanceSummary;ErrorsOnly; /property:Configuration=$(Configuration);TargetFrameworkVersion=v4.8 /p:RestoreSources=$(NugetSource)'
|
||||
displayName: "MSBuild Restore"
|
||||
|
||||
- script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /target:Build /detailedsummary /consoleloggerparameters:PerformanceSummary;ErrorsOnly; /property:Configuration=$(Configuration);TargetFrameworkVersion=v4.8'
|
||||
displayName: MSBuild
|
||||
|
||||
- script: 'echo $(Build.SourceVersion)-$(Build.BuildId)-$(Build.Repository.Name)>bin\$(Configuration)\$(Build.Repository.Name).txt'
|
||||
- script: 'echo $(Build.Repository.Name)-$(Build.BuildId)-$(Build.SourceVersion)>bin\$(Configuration)\$(Build.Repository.Name).txt'
|
||||
displayName: "Commit Id"
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy Files to: D:\Framework4.8'
|
||||
displayName: 'Copy Files to: D:\EAF'
|
||||
inputs:
|
||||
SourceFolder: 'bin\$(Configuration)'
|
||||
Contents: "*$(Build.Repository.Name)*"
|
||||
TargetFolder: 'D:\Framework4.8\$(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)'
|
||||
SourceFolder: 'bin\$(Configuration)'
|
||||
TargetFolder: 'D:\EAF\EAF Deployment Storage\Adaptation_$(Build.Repository.Name)'
|
||||
OverWrite: true
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy Files to: \\messv02ecc1.ec.local\EC_EAFRepository'
|
||||
inputs:
|
||||
SourceFolder: 'bin\$(Configuration)'
|
||||
Contents: "*$(Build.Repository.Name)*"
|
||||
TargetFolder: '\\messv02ecc1.ec.local\EC_EAFRepository\Staging\DeploymentStorage\Adaptation_$(Build.Repository.Name)'
|
||||
OverWrite: true
|
||||
|
||||
- script: |
|
||||
"C:\program files\dotnet\dotnet.exe" clean --configuration $(Configuration)
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" build --configuration $(Configuration) --source $(NugetSource)'
|
||||
workingDirectory: Adaptation
|
||||
displayName: "Core Clean - Tests"
|
||||
displayName: "Core Build - Adaptation"
|
||||
|
||||
- job: TestRelease
|
||||
dependsOn:
|
||||
- SetupEnvironment
|
||||
- BuildRelease
|
||||
steps:
|
||||
- script: |
|
||||
set configuration=Release
|
||||
echo %configuration%
|
||||
echo ##vso[task.setvariable variable=Configuration;]%configuration%
|
||||
echo $(Configuration)
|
||||
displayName: Configuration
|
||||
|
||||
- powershell: Get-ChildItem .\ -include TestResults -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }
|
||||
workingDirectory: "$(System.DefaultWorkingDirectory)/../../../$(Build.Repository.Name)"
|
||||
displayName: "PowerShell Script"
|
||||
continueOnError: true
|
||||
|
||||
- script: "dotnet test --configuration $(Configuration)"
|
||||
workingDirectory: Adaptation
|
||||
displayName: "Core Test"
|
||||
|
||||
- script: 'move /y "$(System.DefaultWorkingDirectory)/../../../$(Build.Repository.Name)/05_TestResults/TestResults" $(System.DefaultWorkingDirectory)'
|
||||
displayName: "Move Results"
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" tool restore'
|
||||
workingDirectory: Adaptation
|
||||
displayName: "Tool Restore"
|
||||
enabled: false
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" ReportGenerator -reports:$(System.DefaultWorkingDirectory)/TestResults/**/coverage.cobertura.xml -targetDir:$(Build.ArtifactStagingDirectory)\Coverage -reportTypes:Html_Dark'
|
||||
workingDirectory: Adaptation
|
||||
displayName: "Report Generator"
|
||||
enabled: false
|
||||
|
||||
- task: PublishTestResults@2
|
||||
displayName: "Publish Test Results **/*.trx"
|
||||
inputs:
|
||||
testResultsFormat: VSTest
|
||||
testResultsFiles: "**/*.trx"
|
||||
testRunTitle: "$(Build.BuildId)-$(Build.SourceVersion)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
|
||||
searchFolder: "$(System.DefaultWorkingDirectory)/TestResults"
|
||||
|
||||
- task: PublishTestResults@2
|
||||
displayName: "Publish Test Results */coverage.cobertura.xml"
|
||||
inputs:
|
||||
testResultsFormat: VSTest
|
||||
testResultsFiles: "*/coverage.cobertura.xml"
|
||||
testRunTitle: "$(Build.BuildId)-$(Build.SourceVersion)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
|
||||
searchFolder: "$(System.DefaultWorkingDirectory)/TestResults"
|
||||
|
||||
- script: |
|
||||
"C:\program files\dotnet\dotnet.exe" clean --configuration $(Configuration)
|
||||
workingDirectory: Adaptation
|
||||
displayName: "Core Clean - Adaptation"
|
||||
|
||||
- script: 'echo $(Build.SourceVersion)-$(Build.BuildId)>bin_x_x_\$(Configuration)\$(CoreVersion)\win-x64\$(Build.Repository.Name).txt'
|
||||
- script: 'echo $(Build.BuildId)-$(Build.SourceVersion)-bin_x_x_\$(Configuration)\$(CoreVersion)\win-x64\$(Build.Repository.Name).txt'
|
||||
displayName: "Force Fail"
|
||||
enabled: false
|
||||
enabled: true
|
||||
|
@ -110,7 +110,7 @@ public class Description : IDescription, Properties.IDescription
|
||||
List<IDescription> IDescription.GetDescriptions(IFileRead fileRead, Logistics logistics, List<Test> tests, IProcessData iProcessData)
|
||||
{
|
||||
List<IDescription> results = new();
|
||||
if (iProcessData is null || !iProcessData.Details.Any())
|
||||
if (iProcessData is null || iProcessData.Details.Count == 0)
|
||||
results.Add(GetDefault(fileRead, logistics));
|
||||
else
|
||||
{
|
||||
|
@ -44,9 +44,9 @@ public class FileRead : Properties.IFileRead
|
||||
protected readonly string _CellInstanceConnectionNameBase;
|
||||
protected readonly Dictionary<string, List<long>> _DummyRuns;
|
||||
protected readonly Dictionary<string, string> _FileParameter;
|
||||
protected readonly Dictionary<long, List<string>> _StaticRuns;
|
||||
protected readonly string _ParameterizedModelObjectDefinitionType;
|
||||
protected readonly FileConnectorConfiguration _FileConnectorConfiguration;
|
||||
protected readonly Dictionary<long, List<Metrology.WS.Results>> _StaticRuns;
|
||||
protected readonly IList<ModelObjectParameterDefinition> _ModelObjectParameterDefinitions;
|
||||
|
||||
bool Properties.IFileRead.IsEvent => _IsEvent;
|
||||
@ -63,7 +63,147 @@ public class FileRead : Properties.IFileRead
|
||||
string Properties.IFileRead.CellInstanceConnectionName => _CellInstanceConnectionName;
|
||||
string Properties.IFileRead.ParameterizedModelObjectDefinitionType => _ParameterizedModelObjectDefinitionType;
|
||||
|
||||
public FileRead(IDescription description, bool isEvent, 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)
|
||||
protected static string GetTupleFile<T>(Logistics logistics, List<T> descriptions, Properties.IScopeInfo scopeInfo, string duplicateDirectory, string duplicateFile) where T : Properties.IDescription
|
||||
{
|
||||
string result;
|
||||
string rds;
|
||||
string fileName;
|
||||
string dateValue;
|
||||
string rdsPlaceholder = "%RDS%";
|
||||
string mesEntityPlaceholder = "%MesEntity%";
|
||||
if (descriptions.Count == 0 || string.IsNullOrEmpty(descriptions[0].RDS))
|
||||
rds = logistics.MID;
|
||||
else
|
||||
rds = descriptions[0].RDS;
|
||||
string[] segments = scopeInfo.FileName.Split(new string[] { "DateTime:" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
if (segments.Length == 0)
|
||||
result = string.Concat(duplicateDirectory, @"\", scopeInfo.FileNameWithoutExtension.Replace(rdsPlaceholder, rds).Replace(mesEntityPlaceholder, logistics.MesEntity));
|
||||
else
|
||||
{
|
||||
segments = segments[1].Split('%');
|
||||
string datePlaceholder = "%DateTime%";
|
||||
dateValue = logistics.DateTimeFromSequence.ToString(segments[0]);
|
||||
foreach (string segment in scopeInfo.FileName.Split('%'))
|
||||
{
|
||||
if (!segment.Contains(segments[0]))
|
||||
continue;
|
||||
datePlaceholder = string.Concat('%', segment, '%');
|
||||
}
|
||||
fileName = scopeInfo.FileName.Replace(rdsPlaceholder, rds).Replace(mesEntityPlaceholder, logistics.MesEntity).Replace(datePlaceholder, dateValue);
|
||||
if (!duplicateFile.Contains("Viewer"))
|
||||
result = Path.Combine(duplicateDirectory, fileName);
|
||||
else
|
||||
result = Path.Combine(duplicateDirectory, $"Viewer_{fileName}");
|
||||
}
|
||||
if (result.Contains('%'))
|
||||
throw new Exception("Placeholder exists!");
|
||||
return result;
|
||||
}
|
||||
|
||||
protected void WaitForFileConsumption<T>(string sourceDirectoryCloaking, Logistics logistics, DateTime dateTime, List<T> descriptions, string successDirectory, string duplicateDirectory, string duplicateFile, List<(Properties.IScopeInfo, string)> collection) where T : Properties.IDescription
|
||||
{
|
||||
bool check;
|
||||
long preWait;
|
||||
string tupleFile;
|
||||
string tupleFileName = string.Empty;
|
||||
List<string> duplicateFiles = new();
|
||||
StringBuilder stringBuilder = new();
|
||||
List<int> consumedFileIndices = new();
|
||||
bool moreThanAnHour = _BreakAfterSeconds > 3600;
|
||||
long breakAfter = dateTime.AddSeconds(_BreakAfterSeconds).Ticks;
|
||||
if (_FileConnectorConfiguration?.FileHandleWaitTime is null)
|
||||
preWait = dateTime.AddMilliseconds(1234).Ticks;
|
||||
else
|
||||
preWait = dateTime.AddMilliseconds(_FileConnectorConfiguration.FileHandleWaitTime.Value).Ticks;
|
||||
if (collection.Count == 0)
|
||||
duplicateFiles.Add(duplicateFile);
|
||||
string fileName = Path.GetFileNameWithoutExtension(logistics.ReportFullPath);
|
||||
string successFile = string.Concat(successDirectory, @"\", Path.GetFileName(logistics.ReportFullPath));
|
||||
foreach ((Properties.IScopeInfo scopeInfo, string text) in collection)
|
||||
{
|
||||
if (scopeInfo.FileName.StartsWith(@"\"))
|
||||
tupleFile = scopeInfo.FileName;
|
||||
else if (!scopeInfo.FileName.Contains('%'))
|
||||
tupleFile = string.Concat(duplicateDirectory, @"\", fileName, "_", scopeInfo.FileNameWithoutExtension, ".pdsfc");
|
||||
else
|
||||
tupleFile = GetTupleFile(logistics, descriptions, scopeInfo, duplicateDirectory, duplicateFile);
|
||||
tupleFileName = Path.GetFileNameWithoutExtension(tupleFile).Split('.')[0];
|
||||
duplicateFiles.Add(tupleFile);
|
||||
if (_IsEAFHosted)
|
||||
File.WriteAllText(tupleFile, text);
|
||||
}
|
||||
for (short i = 0; i < short.MaxValue; i++)
|
||||
{
|
||||
if (DateTime.Now.Ticks > preWait)
|
||||
break;
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
if (!moreThanAnHour)
|
||||
{
|
||||
for (short z = 0; z < short.MaxValue; z++)
|
||||
{
|
||||
try
|
||||
{
|
||||
check = string.IsNullOrEmpty(successDirectory) || File.Exists(successFile);
|
||||
if (check)
|
||||
{
|
||||
consumedFileIndices.Clear();
|
||||
for (int i = 0; i < duplicateFiles.Count; i++)
|
||||
{
|
||||
if (!File.Exists(duplicateFiles[i]))
|
||||
{
|
||||
if (string.IsNullOrEmpty(tupleFileName))
|
||||
consumedFileIndices.Add(i);
|
||||
else if (duplicateFiles.All(l => Path.GetFileNameWithoutExtension(l).Split('.')[0] == tupleFileName))
|
||||
{
|
||||
for (int j = 0; j < duplicateFiles.Count; j++)
|
||||
consumedFileIndices.Add(j);
|
||||
}
|
||||
else
|
||||
consumedFileIndices.Add(i);
|
||||
}
|
||||
}
|
||||
if (consumedFileIndices.Count == duplicateFiles.Count)
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Exception) { }
|
||||
if (DateTime.Now.Ticks > breakAfter)
|
||||
{
|
||||
for (int i = 0; i < duplicateFiles.Count; i++)
|
||||
{
|
||||
if (File.Exists(duplicateFiles[i]))
|
||||
{
|
||||
try
|
||||
{ File.Delete(duplicateFiles[i]); }
|
||||
catch (Exception) { }
|
||||
_ = stringBuilder.Append('<').Append(duplicateFiles[i]).Append("> ");
|
||||
}
|
||||
}
|
||||
throw new Exception(string.Concat("After {", _BreakAfterSeconds, "} seconds, right side of {", sourceDirectoryCloaking, "} didn't consume file(s) ", stringBuilder));
|
||||
}
|
||||
Thread.Sleep(250);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void WaitForFileConsumption<T>(DateTime dateTime, List<T> descriptions, bool isDummyRun, string successDirectory, string duplicateDirectory, List<(Properties.IScopeInfo, string)> collection, string duplicateFile) where T : Properties.IDescription
|
||||
{
|
||||
if (!isDummyRun && _IsEAFHosted)
|
||||
WaitForFileConsumption(_FileConnectorConfiguration.SourceDirectoryCloaking, _Logistics, dateTime, descriptions, successDirectory, duplicateDirectory, duplicateFile, collection);
|
||||
else
|
||||
{
|
||||
long breakAfter = DateTime.Now.AddSeconds(_FileConnectorConfiguration.FileHandleWaitTime.Value).Ticks;
|
||||
for (short i = 0; i < short.MaxValue; i++)
|
||||
{
|
||||
if (!_IsEAFHosted || DateTime.Now.Ticks > breakAfter)
|
||||
break;
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public FileRead(IDescription description, bool isEvent, 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<Metrology.WS.Results>> staticRuns, bool useCyclicalForDescription, bool isEAFHosted)
|
||||
{
|
||||
_SMTP = smtp;
|
||||
_IsEvent = isEvent;
|
||||
@ -160,10 +300,161 @@ public class FileRead : Properties.IFileRead
|
||||
return result;
|
||||
}
|
||||
|
||||
protected void UpdateLastTicksDuration(long ticksDuration)
|
||||
{
|
||||
if (ticksDuration < 50000000)
|
||||
ticksDuration = 50000000;
|
||||
_LastTicksDuration = (long)Math.Ceiling(ticksDuration * .667);
|
||||
_Log.Info($"{new TimeSpan(ticksDuration).TotalMilliseconds} TotalMillisecond(s) to process{Environment.NewLine}{_CellInstanceConnectionName}{Environment.NewLine}<{_ReportFullPath}>");
|
||||
}
|
||||
|
||||
internal static string GetParentParent(string value)
|
||||
{
|
||||
string result = Path.GetDirectoryName(Path.GetDirectoryName(value));
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static List<string> GetDirectoryNames(string directory)
|
||||
{
|
||||
#nullable enable
|
||||
List<string> results = new();
|
||||
string? fileName;
|
||||
string? checkDirectory = directory;
|
||||
string? pathRoot = Path.GetPathRoot(directory);
|
||||
string extension = Path.GetExtension(directory);
|
||||
if (string.IsNullOrEmpty(pathRoot))
|
||||
throw new NullReferenceException(nameof(pathRoot));
|
||||
if (Directory.Exists(directory))
|
||||
{
|
||||
fileName = Path.GetFileName(directory);
|
||||
if (!string.IsNullOrEmpty(fileName))
|
||||
results.Add(fileName);
|
||||
}
|
||||
else if ((string.IsNullOrEmpty(extension) || extension.Length > 3) && !File.Exists(directory))
|
||||
{
|
||||
fileName = Path.GetFileName(directory);
|
||||
if (!string.IsNullOrEmpty(fileName))
|
||||
results.Add(fileName);
|
||||
}
|
||||
for (int i = 0; i < int.MaxValue; i++)
|
||||
{
|
||||
checkDirectory = Path.GetDirectoryName(checkDirectory);
|
||||
if (string.IsNullOrEmpty(checkDirectory) || checkDirectory == pathRoot)
|
||||
break;
|
||||
fileName = Path.GetFileName(checkDirectory);
|
||||
if (string.IsNullOrEmpty(fileName))
|
||||
continue;
|
||||
results.Add(fileName);
|
||||
}
|
||||
results.Add(pathRoot);
|
||||
results.Reverse();
|
||||
return results;
|
||||
#nullable disable
|
||||
}
|
||||
|
||||
internal static string GetJobIdParentDirectory(string directory)
|
||||
{
|
||||
string result;
|
||||
if (!string.IsNullOrEmpty(Path.GetFileName(directory)))
|
||||
result = Path.GetFullPath(GetParentParent(directory));
|
||||
else
|
||||
result = Path.GetFullPath(GetParentParent(Path.GetDirectoryName(directory)));
|
||||
if (!Directory.Exists(result))
|
||||
_ = Directory.CreateDirectory(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static string GetFileNameAfterUnderscoreSplit(string reportFullPath)
|
||||
{
|
||||
string result;
|
||||
string[] segments = Path.GetFileNameWithoutExtension(reportFullPath).Split('_');
|
||||
if (segments.Length <= 2)
|
||||
result = segments[0];
|
||||
else
|
||||
result = string.Concat(segments[0], segments[2]);
|
||||
return result;
|
||||
}
|
||||
|
||||
internal string[] GetInProcessDirectory(string jobIdDirectory)
|
||||
{
|
||||
List<string> results = new();
|
||||
if (!_IsEAFHosted)
|
||||
results = new string[] { jobIdDirectory }.ToList();
|
||||
else
|
||||
{
|
||||
string[] files;
|
||||
string logisticsSequence = _Logistics.Sequence.ToString();
|
||||
string[] directories = Directory.GetDirectories(jobIdDirectory, $"*{logisticsSequence}*", SearchOption.TopDirectoryOnly);
|
||||
foreach (string directory in directories)
|
||||
{
|
||||
files = Directory.GetFiles(directory, "*", SearchOption.TopDirectoryOnly);
|
||||
if (files.Length == 0)
|
||||
continue;
|
||||
results.Add(directory);
|
||||
}
|
||||
}
|
||||
if ((results is null) || results.Count != 1)
|
||||
throw new Exception("Didn't find directory by logistics sequence");
|
||||
return results.ToArray();
|
||||
}
|
||||
|
||||
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 static void NestExistingFiles(FileConnectorConfiguration fileConnectorConfiguration)
|
||||
{
|
||||
// if (!fileConnectorConfiguration.IncludeSubDirectories.Value && fileConnectorConfiguration.TriggerOnCreated is not null && fileConnectorConfiguration.TriggerOnCreated.Value)
|
||||
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 List<Properties.IDescription> GetDuplicatorDescriptions(JsonElement[] jsonElements)
|
||||
{
|
||||
List<Properties.IDescription> results = new();
|
||||
Duplicator.Description description;
|
||||
JsonSerializerOptions jsonSerializerOptions = new() { NumberHandling = JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString };
|
||||
foreach (JsonElement jsonElement in jsonElements)
|
||||
{
|
||||
if (jsonElement.ValueKind != JsonValueKind.Object)
|
||||
throw new Exception();
|
||||
description = JsonSerializer.Deserialize<Duplicator.Description>(jsonElement.ToString(), jsonSerializerOptions);
|
||||
results.Add(description);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
protected static ModelObjectParameterDefinition[] GetProperties(string cellInstanceConnectionName, IList<ModelObjectParameterDefinition> modelObjectParameters, string propertyNamePrefix)
|
||||
{
|
||||
ModelObjectParameterDefinition[] results = (from l in modelObjectParameters where l.Name.StartsWith(propertyNamePrefix) select l).ToArray();
|
||||
if (!results.Any())
|
||||
if (results.Length == 0)
|
||||
throw new Exception(cellInstanceConnectionName);
|
||||
return results;
|
||||
}
|
||||
@ -171,17 +462,43 @@ public class FileRead : Properties.IFileRead
|
||||
protected static ModelObjectParameterDefinition[] GetProperties(string cellInstanceConnectionName, IList<ModelObjectParameterDefinition> modelObjectParameters, string propertyNamePrefix, string propertyNameSuffix)
|
||||
{
|
||||
ModelObjectParameterDefinition[] results = (from l in modelObjectParameters where l.Name.StartsWith(propertyNamePrefix) && l.Name.EndsWith(propertyNameSuffix) select l).ToArray();
|
||||
if (!results.Any())
|
||||
if (results.Length == 0)
|
||||
throw new Exception(cellInstanceConnectionName);
|
||||
return results;
|
||||
}
|
||||
|
||||
protected void UpdateLastTicksDuration(long ticksDuration)
|
||||
protected void SetFileParameter(string key, string value)
|
||||
{
|
||||
if (ticksDuration < 50000000)
|
||||
ticksDuration = 50000000;
|
||||
_LastTicksDuration = (long)Math.Ceiling(ticksDuration * .667);
|
||||
_Log.Info($"{new TimeSpan(ticksDuration).TotalMilliseconds} TotalMillisecond(s) to process{Environment.NewLine}{_CellInstanceConnectionName}{Environment.NewLine}<{_ReportFullPath}>");
|
||||
if (_FileConnectorConfiguration is null || _FileConnectorConfiguration.TargetFileLocation.Contains(string.Concat("%", key, "%")) || _FileConnectorConfiguration.ErrorTargetFileLocation.Contains(string.Concat("%", key, "%")) || _FileConnectorConfiguration.TargetFileName.Contains(string.Concat("%", key, "%")) || _FileConnectorConfiguration.ErrorTargetFileName.Contains(string.Concat("%", key, "%")))
|
||||
{
|
||||
if (_FileParameter.ContainsKey(key))
|
||||
_FileParameter[key] = value;
|
||||
else
|
||||
_FileParameter.Add(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
protected void WritePDSF(IFileRead fileRead, JsonElement[] jsonElements)
|
||||
{
|
||||
string directory;
|
||||
string day = $"{_Logistics.DateTimeFromSequence:yyyy-MM-dd}";
|
||||
string weekOfYear = _Calendar.GetWeekOfYear(_Logistics.DateTimeFromSequence, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00");
|
||||
string weekDirectory = $"{_Logistics.DateTimeFromSequence:yyyy}_Week_{weekOfYear}";
|
||||
if (!_CellInstanceConnectionName.StartsWith(_CellInstanceName) && _CellInstanceConnectionNameBase == _EquipmentType)
|
||||
directory = Path.Combine(_TracePath, _EquipmentType, "Target", weekDirectory, day, _CellInstanceName, _CellInstanceConnectionName);
|
||||
else
|
||||
directory = Path.Combine(_TracePath, _EquipmentType, "Source", weekDirectory, day, _CellInstanceName, _CellInstanceConnectionName);
|
||||
if (!Directory.Exists(directory))
|
||||
_ = Directory.CreateDirectory(directory);
|
||||
string file = Path.Combine(directory, string.Concat(_Logistics.MesEntity, "_", _Logistics.Sequence, ".ipdsf"));
|
||||
string lines = ProcessDataStandardFormat.GetPDSFText(fileRead, _Logistics, jsonElements, logisticsText: string.Empty);
|
||||
File.WriteAllText(file, lines);
|
||||
if (_Logistics.TotalSecondsSinceLastWriteTimeFromSequence > 600)
|
||||
{
|
||||
try
|
||||
{ File.SetLastWriteTime(file, _Logistics.DateTimeFromSequence); }
|
||||
catch (Exception) { }
|
||||
}
|
||||
}
|
||||
|
||||
protected void WaitForThread(Thread thread, List<Exception> threadExceptions)
|
||||
@ -203,7 +520,7 @@ public class FileRead : Properties.IFileRead
|
||||
}
|
||||
lock (threadExceptions)
|
||||
{
|
||||
if (threadExceptions.Any())
|
||||
if (threadExceptions.Count != 0)
|
||||
{
|
||||
foreach (Exception item in threadExceptions)
|
||||
_Log.Error(string.Concat(item.Message, Environment.NewLine, Environment.NewLine, item.StackTrace));
|
||||
@ -215,225 +532,6 @@ public class FileRead : Properties.IFileRead
|
||||
}
|
||||
}
|
||||
|
||||
private void WriteAllLines(string to, string[] exceptionLines)
|
||||
{
|
||||
string fileName = string.Concat(to, @"\readme.txt");
|
||||
try
|
||||
{
|
||||
if (!Directory.Exists(to))
|
||||
_ = Directory.CreateDirectory(to);
|
||||
File.WriteAllLines(fileName, exceptionLines);
|
||||
}
|
||||
catch (Exception ex) { _Log.Error(ex.Message); }
|
||||
}
|
||||
|
||||
protected string[] Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, string to, string from, string resolvedFileLocation, Exception exception)
|
||||
{
|
||||
string[] results;
|
||||
bool isErrorFile = exception is not null;
|
||||
if (!to.EndsWith(@"\"))
|
||||
_ = string.Concat(to, @"\");
|
||||
if (!isErrorFile)
|
||||
results = Array.Empty<string>();
|
||||
else
|
||||
{
|
||||
results = new string[] { _Logistics.Sequence.ToString(), _Logistics.ReportFullPath, from, resolvedFileLocation, to, string.Empty, string.Empty, exception.Message, string.Empty, string.Empty, exception.StackTrace };
|
||||
if (!_IsDuplicator)
|
||||
WriteAllLines(to, results);
|
||||
}
|
||||
if (extractResults is not null && extractResults.Item4 is not null && extractResults.Item4.Any())
|
||||
{
|
||||
string itemFile;
|
||||
List<string> directories = new();
|
||||
foreach (FileInfo sourceFile in extractResults.Item4)
|
||||
{
|
||||
if (sourceFile.FullName != _Logistics.ReportFullPath)
|
||||
{
|
||||
itemFile = sourceFile.FullName.Replace(from, to);
|
||||
Shared1880(itemFile, directories, sourceFile, isErrorFile);
|
||||
}
|
||||
else if (!isErrorFile && _Logistics is not null)
|
||||
Shared1811(to, sourceFile);
|
||||
}
|
||||
Shared0231(directories);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
protected static string GetTupleFile<T>(Logistics logistics, List<T> descriptions, Properties.IScopeInfo scopeInfo, string duplicateDirectory) where T : Properties.IDescription
|
||||
{
|
||||
string result;
|
||||
string rds;
|
||||
string dateValue;
|
||||
string rdsPlaceholder = "%RDS%";
|
||||
string mesEntityPlaceholder = "%MesEntity%";
|
||||
if (!descriptions.Any() || string.IsNullOrEmpty(descriptions[0].RDS))
|
||||
rds = logistics.MID;
|
||||
else
|
||||
rds = descriptions[0].RDS;
|
||||
string[] segments = scopeInfo.FileName.Split(new string[] { "DateTime:" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
if (segments.Length == 0)
|
||||
result = string.Concat(duplicateDirectory, @"\", scopeInfo.FileNameWithoutExtension.Replace(rdsPlaceholder, rds).Replace(mesEntityPlaceholder, logistics.MesEntity));
|
||||
else
|
||||
{
|
||||
segments = segments[1].Split('%');
|
||||
string datePlaceholder = "%DateTime%";
|
||||
dateValue = logistics.DateTimeFromSequence.ToString(segments[0]);
|
||||
foreach (string segment in scopeInfo.FileName.Split('%'))
|
||||
{
|
||||
if (!segment.Contains(segments[0]))
|
||||
continue;
|
||||
datePlaceholder = string.Concat('%', segment, '%');
|
||||
}
|
||||
result = string.Concat(duplicateDirectory, @"\", scopeInfo.FileName.Replace(rdsPlaceholder, rds).Replace(mesEntityPlaceholder, logistics.MesEntity).Replace(datePlaceholder, dateValue));
|
||||
}
|
||||
if (result.Contains('%'))
|
||||
throw new Exception("Placeholder exists!");
|
||||
return result;
|
||||
}
|
||||
|
||||
protected void WaitForFileConsumption<T>(string sourceDirectoryCloaking, Logistics logistics, DateTime dateTime, List<T> descriptions, string successDirectory, string duplicateDirectory, string duplicateFile, List<(Properties.IScopeInfo, string)> collection) where T : Properties.IDescription
|
||||
{
|
||||
bool check;
|
||||
long preWait;
|
||||
string tupleFile;
|
||||
string tupleFileName = string.Empty;
|
||||
List<string> duplicateFiles = new();
|
||||
StringBuilder stringBuilder = new();
|
||||
List<int> consumedFileIndices = new();
|
||||
bool moreThanAnHour = _BreakAfterSeconds > 3600;
|
||||
long breakAfter = dateTime.AddSeconds(_BreakAfterSeconds).Ticks;
|
||||
if (_FileConnectorConfiguration?.FileHandleWaitTime is null)
|
||||
preWait = dateTime.AddMilliseconds(1234).Ticks;
|
||||
else
|
||||
preWait = dateTime.AddMilliseconds(_FileConnectorConfiguration.FileHandleWaitTime.Value).Ticks;
|
||||
if (!collection.Any())
|
||||
duplicateFiles.Add(duplicateFile);
|
||||
string fileName = Path.GetFileNameWithoutExtension(logistics.ReportFullPath);
|
||||
string successFile = string.Concat(successDirectory, @"\", Path.GetFileName(logistics.ReportFullPath));
|
||||
foreach ((Properties.IScopeInfo scopeInfo, string text) in collection)
|
||||
{
|
||||
if (scopeInfo.FileName.StartsWith(@"\"))
|
||||
tupleFile = scopeInfo.FileName;
|
||||
else if (!scopeInfo.FileName.Contains('%'))
|
||||
tupleFile = string.Concat(duplicateDirectory, @"\", fileName, "_", scopeInfo.FileNameWithoutExtension, ".pdsfc");
|
||||
else
|
||||
tupleFile = GetTupleFile(logistics, descriptions, scopeInfo, duplicateDirectory);
|
||||
tupleFileName = Path.GetFileNameWithoutExtension(tupleFile).Split('.')[0];
|
||||
duplicateFiles.Add(tupleFile);
|
||||
if (_IsEAFHosted)
|
||||
File.WriteAllText(tupleFile, text);
|
||||
}
|
||||
for (short i = 0; i < short.MaxValue; i++)
|
||||
{
|
||||
if (DateTime.Now.Ticks > preWait)
|
||||
break;
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
if (!moreThanAnHour)
|
||||
{
|
||||
for (short z = 0; z < short.MaxValue; z++)
|
||||
{
|
||||
try
|
||||
{
|
||||
check = string.IsNullOrEmpty(successDirectory) || File.Exists(successFile);
|
||||
if (check)
|
||||
{
|
||||
consumedFileIndices.Clear();
|
||||
for (int i = 0; i < duplicateFiles.Count; i++)
|
||||
{
|
||||
if (!File.Exists(duplicateFiles[i]))
|
||||
{
|
||||
if (string.IsNullOrEmpty(tupleFileName))
|
||||
consumedFileIndices.Add(i);
|
||||
else if (duplicateFiles.All(l => Path.GetFileNameWithoutExtension(l).Split('.')[0] == tupleFileName))
|
||||
{
|
||||
for (int j = 0; j < duplicateFiles.Count; j++)
|
||||
consumedFileIndices.Add(j);
|
||||
}
|
||||
else
|
||||
consumedFileIndices.Add(i);
|
||||
}
|
||||
}
|
||||
if (consumedFileIndices.Count == duplicateFiles.Count)
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Exception) { }
|
||||
if (DateTime.Now.Ticks > breakAfter)
|
||||
{
|
||||
for (int i = 0; i < duplicateFiles.Count; i++)
|
||||
{
|
||||
if (File.Exists(duplicateFiles[i]))
|
||||
{
|
||||
try
|
||||
{ File.Delete(duplicateFiles[i]); }
|
||||
catch (Exception) { }
|
||||
_ = stringBuilder.Append('<').Append(duplicateFiles[i]).Append("> ");
|
||||
}
|
||||
}
|
||||
throw new Exception(string.Concat("After {", _BreakAfterSeconds, "} seconds, right side of {", sourceDirectoryCloaking, "} didn't consume file(s) ", stringBuilder));
|
||||
}
|
||||
Thread.Sleep(250);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void SetFileParameter(string key, string value)
|
||||
{
|
||||
if (_FileConnectorConfiguration is null || _FileConnectorConfiguration.TargetFileLocation.Contains(string.Concat("%", key, "%")) || _FileConnectorConfiguration.ErrorTargetFileLocation.Contains(string.Concat("%", key, "%")) || _FileConnectorConfiguration.TargetFileName.Contains(string.Concat("%", key, "%")) || _FileConnectorConfiguration.ErrorTargetFileName.Contains(string.Concat("%", key, "%")))
|
||||
{
|
||||
if (_FileParameter.ContainsKey(key))
|
||||
_FileParameter[key] = value;
|
||||
else
|
||||
_FileParameter.Add(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
protected void SetFileParameterLotIDToLogisticsMID(bool includeLogisticsSequence = true)
|
||||
{
|
||||
string key;
|
||||
if (!includeLogisticsSequence)
|
||||
key = "LotID";
|
||||
else
|
||||
key = "LotIDWithLogisticsSequence";
|
||||
string value = string.Concat(_Logistics.MID, "_", _Logistics.Sequence, "_", DateTime.Now.Ticks - _Logistics.Sequence);
|
||||
SetFileParameter(key, value);
|
||||
}
|
||||
|
||||
protected void SetFileParameterLotID(string value, bool includeLogisticsSequence = true)
|
||||
{
|
||||
string key;
|
||||
if (!includeLogisticsSequence)
|
||||
key = "LotID";
|
||||
else
|
||||
{
|
||||
key = "LotIDWithLogisticsSequence";
|
||||
value = string.Concat(value, "_", _Logistics.Sequence, "_", DateTime.Now.Ticks - _Logistics.Sequence);
|
||||
}
|
||||
SetFileParameter(key, value);
|
||||
}
|
||||
|
||||
protected void WritePDSF(IFileRead fileRead, JsonElement[] jsonElements)
|
||||
{
|
||||
string directory;
|
||||
if (!_CellInstanceConnectionName.StartsWith(_CellInstanceName) && _CellInstanceConnectionNameBase == _EquipmentType)
|
||||
directory = Path.Combine(_TracePath, _EquipmentType, "Target", _CellInstanceName, _CellInstanceConnectionName);
|
||||
else
|
||||
directory = Path.Combine(_TracePath, _EquipmentType, "Source", _CellInstanceName, _CellInstanceConnectionName);
|
||||
if (!Directory.Exists(directory))
|
||||
_ = Directory.CreateDirectory(directory);
|
||||
string file = Path.Combine(directory, string.Concat(_Logistics.MesEntity, "_", _Logistics.Sequence, ".ipdsf"));
|
||||
string lines = ProcessDataStandardFormat.GetPDSFText(fileRead, _Logistics, jsonElements, logisticsText: string.Empty);
|
||||
File.WriteAllText(file, lines);
|
||||
if (_Logistics.TotalSecondsSinceLastWriteTimeFromSequence > 600)
|
||||
{
|
||||
try
|
||||
{ File.SetLastWriteTime(file, _Logistics.DateTimeFromSequence); }
|
||||
catch (Exception) { }
|
||||
}
|
||||
}
|
||||
|
||||
protected void Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults)
|
||||
{
|
||||
if (!_IsEAFHosted)
|
||||
@ -452,80 +550,49 @@ public class FileRead : Properties.IFileRead
|
||||
}
|
||||
}
|
||||
|
||||
protected void TriggerEvents(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, List<string> headerNames, Dictionary<string, string> keyValuePairs)
|
||||
protected string[] Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, string to, string from, string resolvedFileLocation, Exception exception)
|
||||
{
|
||||
object value;
|
||||
string description;
|
||||
List<object[]> list;
|
||||
for (int i = 0; i < extractResults.Item3.Length; i++)
|
||||
{
|
||||
_Log.Debug(string.Concat("TriggerEvent - {", _Logistics.ReportFullPath, "} ", i, " of ", extractResults.Item3.Length));
|
||||
foreach (JsonProperty jsonProperty in extractResults.Item3[i].EnumerateObject())
|
||||
{
|
||||
if (jsonProperty.Value.ValueKind != JsonValueKind.String || !keyValuePairs.ContainsKey(jsonProperty.Name))
|
||||
description = string.Empty;
|
||||
else
|
||||
description = keyValuePairs[jsonProperty.Name].Split('|')[0];
|
||||
if (!_UseCyclicalForDescription || headerNames.Contains(jsonProperty.Name))
|
||||
value = jsonProperty.Value.ToString();
|
||||
string[] results;
|
||||
bool isErrorFile = exception is not null;
|
||||
if (!to.EndsWith(@"\"))
|
||||
_ = string.Concat(to, @"\");
|
||||
if (!isErrorFile)
|
||||
results = Array.Empty<string>();
|
||||
else
|
||||
{
|
||||
list = new List<object[]>();
|
||||
for (int z = 0; z < extractResults.Item3.Length; z++)
|
||||
list.Add(new object[] { z, extractResults.Item3[z].GetProperty(jsonProperty.Name).ToString() });
|
||||
value = list;
|
||||
results = new string[] { _Logistics.Sequence.ToString(), _Logistics.ReportFullPath, from, resolvedFileLocation, to, string.Empty, string.Empty, exception.Message, string.Empty, string.Empty, exception.StackTrace };
|
||||
if (!_IsDuplicator)
|
||||
WriteAllLines(to, results);
|
||||
}
|
||||
}
|
||||
if (_UseCyclicalForDescription)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
protected Tuple<string, Test[], JsonElement[], List<FileInfo>> ReExtract(IFileRead fileRead, List<string> headerNames, Dictionary<string, string> keyValuePairs)
|
||||
if (extractResults is not null && extractResults.Item4 is not null && extractResults.Item4.Count != 0)
|
||||
{
|
||||
Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
|
||||
if (!Directory.Exists(_FileConnectorConfiguration.SourceFileLocation))
|
||||
results = null;
|
||||
else
|
||||
string itemFile;
|
||||
List<string> directories = new();
|
||||
foreach (FileInfo sourceFile in extractResults.Item4)
|
||||
{
|
||||
string[] segments;
|
||||
string[] matches = null;
|
||||
foreach (string subSourceFileFilter in _FileConnectorConfiguration.SourceFileFilters)
|
||||
if (sourceFile.FullName != _Logistics.ReportFullPath)
|
||||
{
|
||||
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.Any())
|
||||
break;
|
||||
itemFile = sourceFile.FullName.Replace(from, to);
|
||||
Shared1880(itemFile, directories, sourceFile, isErrorFile);
|
||||
}
|
||||
if (matches is null || !matches.Any())
|
||||
results = null;
|
||||
else
|
||||
{
|
||||
_ReportFullPath = matches[0];
|
||||
results = fileRead.GetExtractResult(_ReportFullPath, _EventName);
|
||||
if (!_IsEAFHosted)
|
||||
TriggerEvents(results, headerNames, keyValuePairs);
|
||||
else if (!isErrorFile && _Logistics is not null)
|
||||
Shared1811(to, sourceFile);
|
||||
}
|
||||
Shared0231(directories);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
protected static List<Properties.IDescription> GetDuplicatorDescriptions(JsonElement[] jsonElements)
|
||||
private void WriteAllLines(string to, string[] exceptionLines)
|
||||
{
|
||||
List<Properties.IDescription> results = new();
|
||||
Duplicator.Description description;
|
||||
JsonSerializerOptions jsonSerializerOptions = new() { NumberHandling = JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString };
|
||||
foreach (JsonElement jsonElement in jsonElements)
|
||||
string fileName = string.Concat(to, @"\readme.txt");
|
||||
try
|
||||
{
|
||||
if (jsonElement.ValueKind != JsonValueKind.Object)
|
||||
throw new Exception();
|
||||
description = JsonSerializer.Deserialize<Duplicator.Description>(jsonElement.ToString(), jsonSerializerOptions);
|
||||
results.Add(description);
|
||||
if (!Directory.Exists(to))
|
||||
_ = Directory.CreateDirectory(to);
|
||||
File.WriteAllLines(fileName, exceptionLines);
|
||||
}
|
||||
return results;
|
||||
catch (Exception ex) { _Log.Error(ex.Message); }
|
||||
}
|
||||
|
||||
private void Shared1880(string itemFile, List<string> directories, FileInfo sourceFile, bool isErrorFile)
|
||||
@ -557,6 +624,9 @@ public class FileRead : Properties.IFileRead
|
||||
case FileConnectorConfiguration.PostProcessingModeEnum.Delete:
|
||||
File.Delete(sourceFile.FullName);
|
||||
break;
|
||||
case FileConnectorConfiguration.PostProcessingModeEnum.None:
|
||||
File.Move(sourceFile.FullName, itemFile);
|
||||
break;
|
||||
default:
|
||||
throw new Exception();
|
||||
}
|
||||
@ -568,11 +638,12 @@ public class FileRead : Properties.IFileRead
|
||||
if (!_IsDuplicator && _FileConnectorConfiguration.SourceFileFilter != "*" && sourceFile.Exists && sourceFile.Length < _MinFileLength)
|
||||
{
|
||||
string directoryName = Path.GetFileName(to);
|
||||
string jobIdDirectory = Path.GetDirectoryName(to);
|
||||
string jobIdDirectory = GetJobIdDirectory(to);
|
||||
DateTime dateTime = DateTime.Now.AddMinutes(-15);
|
||||
string day = $"{_Logistics.DateTimeFromSequence:yyyy-MM-dd}";
|
||||
string weekOfYear = _Calendar.GetWeekOfYear(_Logistics.DateTimeFromSequence, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00");
|
||||
string weekDirectory = $"{_Logistics.DateTimeFromSequence:yyyy}_Week_{weekOfYear}{@"\"}{_Logistics.DateTimeFromSequence:yyyy-MM-dd}";
|
||||
string destinationDirectory = string.Concat(jobIdDirectory, @"\_ Ignore 100 bytes\", weekDirectory, @"\", directoryName);
|
||||
string weekDirectory = $"{_Logistics.DateTimeFromSequence:yyyy}_Week_{weekOfYear}";
|
||||
string destinationDirectory = Path.Combine(jobIdDirectory, "_ Ignore 100 bytes", weekDirectory, day, directoryName);
|
||||
if (!Directory.Exists(destinationDirectory))
|
||||
_ = Directory.CreateDirectory(destinationDirectory);
|
||||
File.Move(sourceFile.FullName, string.Concat(destinationDirectory, @"\", sourceFile.Name));
|
||||
@ -583,13 +654,13 @@ public class FileRead : Properties.IFileRead
|
||||
{
|
||||
if (!checkDirectory.Contains('_'))
|
||||
continue;
|
||||
if (Directory.GetDirectories(checkDirectory, "*", SearchOption.TopDirectoryOnly).Any())
|
||||
if (Directory.GetDirectories(checkDirectory, "*", SearchOption.TopDirectoryOnly).Length != 0)
|
||||
continue;
|
||||
if (Directory.GetFiles(checkDirectory, "*", SearchOption.TopDirectoryOnly).Any())
|
||||
if (Directory.GetFiles(checkDirectory, "*", SearchOption.TopDirectoryOnly).Length != 0)
|
||||
continue;
|
||||
if (Directory.GetDirectories(checkDirectory, "*", SearchOption.AllDirectories).Any())
|
||||
if (Directory.GetDirectories(checkDirectory, "*", SearchOption.AllDirectories).Length != 0)
|
||||
continue;
|
||||
if (Directory.GetFiles(checkDirectory, "*", SearchOption.AllDirectories).Any())
|
||||
if (Directory.GetFiles(checkDirectory, "*", SearchOption.AllDirectories).Length != 0)
|
||||
continue;
|
||||
if (new DirectoryInfo(checkDirectory).CreationTime > dateTime)
|
||||
continue;
|
||||
@ -597,6 +668,52 @@ public class FileRead : Properties.IFileRead
|
||||
}
|
||||
}
|
||||
catch (Exception) { throw; }
|
||||
DeleteEmptyTopDirectories(jobIdDirectory);
|
||||
}
|
||||
}
|
||||
|
||||
private string GetJobIdDirectory(string path)
|
||||
{
|
||||
string result;
|
||||
List<string> directoryNames = GetDirectoryNames(path);
|
||||
if (!directoryNames.Contains(_Logistics.JobID))
|
||||
result = Path.GetDirectoryName(path);
|
||||
else
|
||||
{
|
||||
result = string.Empty;
|
||||
foreach (string directoryName in directoryNames)
|
||||
{
|
||||
result = Path.Combine(result, directoryName);
|
||||
if (directoryName == _Logistics.JobID)
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private static void DeleteEmptyTopDirectories(string rootDirectory)
|
||||
{
|
||||
if (Directory.Exists(rootDirectory))
|
||||
{
|
||||
string[] files;
|
||||
string[] directories;
|
||||
string[] subDirectories = Directory.GetDirectories(rootDirectory, "*", SearchOption.TopDirectoryOnly);
|
||||
foreach (string subDirectory in subDirectories)
|
||||
{
|
||||
files = Directory.GetFiles(subDirectory, "*", SearchOption.AllDirectories);
|
||||
if (files.Length > 0)
|
||||
continue;
|
||||
directories = Directory.GetDirectories(subDirectory, "*", SearchOption.TopDirectoryOnly);
|
||||
if (directories.Length > 0)
|
||||
continue;
|
||||
try
|
||||
{ Directory.Delete(subDirectory); }
|
||||
catch (UnauthorizedAccessException)
|
||||
{
|
||||
new DirectoryInfo(subDirectory).Attributes = FileAttributes.Normal;
|
||||
Directory.Delete(subDirectory);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -606,72 +723,87 @@ public class FileRead : Properties.IFileRead
|
||||
{
|
||||
foreach (string directory in (from l in directories orderby l.Split('\\').Length descending select l).Distinct())
|
||||
{
|
||||
if (Directory.Exists(directory) && !Directory.GetFiles(directory).Any())
|
||||
if (Directory.Exists(directory) && Directory.GetFiles(directory).Length == 0)
|
||||
Directory.Delete(directory);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void WaitForFileConsumption<T>(DateTime dateTime, List<T> descriptions, bool isDummyRun, string successDirectory, string duplicateDirectory, List<(Properties.IScopeInfo, string)> collection, string duplicateFile) where T : Properties.IDescription
|
||||
protected void SetFileParameterLotID(string value, bool includeLogisticsSequence = true)
|
||||
{
|
||||
if (!isDummyRun && _IsEAFHosted)
|
||||
WaitForFileConsumption(_FileConnectorConfiguration.SourceDirectoryCloaking, _Logistics, dateTime, descriptions, successDirectory, duplicateDirectory, duplicateFile, collection);
|
||||
string key;
|
||||
if (!includeLogisticsSequence)
|
||||
key = "LotID";
|
||||
else
|
||||
{
|
||||
long breakAfter = DateTime.Now.AddSeconds(_FileConnectorConfiguration.FileHandleWaitTime.Value).Ticks;
|
||||
for (short i = 0; i < short.MaxValue; i++)
|
||||
{
|
||||
if (!_IsEAFHosted || DateTime.Now.Ticks > breakAfter)
|
||||
break;
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
key = "LotIDWithLogisticsSequence";
|
||||
value = string.Concat(value, "_", _Logistics.Sequence, "_", DateTime.Now.Ticks - _Logistics.Sequence);
|
||||
}
|
||||
SetFileParameter(key, value);
|
||||
}
|
||||
|
||||
internal static string GetJobIdParentDirectory(string directory)
|
||||
protected void SetFileParameterLotIDToLogisticsMID(bool includeLogisticsSequence = true)
|
||||
{
|
||||
string result;
|
||||
if (!string.IsNullOrEmpty(Path.GetFileName(directory)))
|
||||
result = Path.GetFullPath(GetParentParent(directory));
|
||||
string key;
|
||||
if (!includeLogisticsSequence)
|
||||
key = "LotID";
|
||||
else
|
||||
result = Path.GetFullPath(GetParentParent(Path.GetDirectoryName(directory)));
|
||||
if (!Directory.Exists(result))
|
||||
_ = Directory.CreateDirectory(result);
|
||||
return result;
|
||||
key = "LotIDWithLogisticsSequence";
|
||||
string value = string.Concat(_Logistics.MID, "_", _Logistics.Sequence, "_", DateTime.Now.Ticks - _Logistics.Sequence);
|
||||
SetFileParameter(key, value);
|
||||
}
|
||||
|
||||
internal string[] GetInProcessDirectory(string jobIdDirectory)
|
||||
protected Tuple<string, Test[], JsonElement[], List<FileInfo>> ReExtract(IFileRead fileRead, List<string> headerNames, Dictionary<string, string> keyValuePairs)
|
||||
{
|
||||
string[] results;
|
||||
Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
|
||||
if (!Directory.Exists(_FileConnectorConfiguration.SourceFileLocation))
|
||||
results = null;
|
||||
else
|
||||
{
|
||||
string[] matches = GetMatches(_FileConnectorConfiguration);
|
||||
if (matches is null || matches.Length == 0)
|
||||
results = null;
|
||||
else
|
||||
{
|
||||
_ReportFullPath = matches[0];
|
||||
results = fileRead.GetExtractResult(_ReportFullPath, _EventName);
|
||||
if (!_IsEAFHosted)
|
||||
results = new string[] { jobIdDirectory };
|
||||
else
|
||||
{
|
||||
string logisticsSequence = _Logistics.Sequence.ToString();
|
||||
results = Directory.GetDirectories(jobIdDirectory, string.Concat(_Logistics.MID, '*', logisticsSequence, '*'), SearchOption.TopDirectoryOnly);
|
||||
TriggerEvents(results, headerNames, keyValuePairs);
|
||||
}
|
||||
}
|
||||
if ((results is null) || results.Length != 1)
|
||||
throw new Exception("Didn't find directory by logistics sequence");
|
||||
return results;
|
||||
}
|
||||
|
||||
internal static string GetFileNameAfterUnderscoreSplit(string reportFullPath)
|
||||
protected void TriggerEvents(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, List<string> headerNames, Dictionary<string, string> keyValuePairs)
|
||||
{
|
||||
string result;
|
||||
string[] segments = Path.GetFileNameWithoutExtension(reportFullPath).Split('_');
|
||||
if (segments.Length <= 2)
|
||||
result = segments[0];
|
||||
object value;
|
||||
string segments;
|
||||
string description;
|
||||
List<object[]> list;
|
||||
for (int i = 0; i < extractResults.Item3.Length; i++)
|
||||
{
|
||||
_Log.Debug(string.Concat("TriggerEvent - {", _Logistics.ReportFullPath, "} ", i, " of ", extractResults.Item3.Length));
|
||||
foreach (JsonProperty jsonProperty in extractResults.Item3[i].EnumerateObject())
|
||||
{
|
||||
if (jsonProperty.Value.ValueKind != JsonValueKind.String || !keyValuePairs.TryGetValue(jsonProperty.Name, out segments))
|
||||
description = string.Empty;
|
||||
else
|
||||
description = segments.Split('|')[0];
|
||||
if (!_UseCyclicalForDescription || headerNames.Contains(jsonProperty.Name))
|
||||
value = jsonProperty.Value.ToString();
|
||||
else
|
||||
result = string.Concat(segments[0], segments[2]);
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static string GetParentParent(string value)
|
||||
{
|
||||
string result = Path.GetDirectoryName(Path.GetDirectoryName(value));
|
||||
return result;
|
||||
list = new List<object[]>();
|
||||
for (int z = 0; z < extractResults.Item3.Length; z++)
|
||||
list.Add(new object[] { z, extractResults.Item3[z].GetProperty(jsonProperty.Name).ToString() });
|
||||
value = list;
|
||||
}
|
||||
}
|
||||
if (_UseCyclicalForDescription)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 2022-06-08 -> Shared - FileRead
|
||||
// 2025-03-25 -> Shared - FileRead
|
@ -35,6 +35,9 @@ public class Logistics : ILogistics
|
||||
public long Sequence => _Sequence;
|
||||
public double TotalSecondsSinceLastWriteTimeFromSequence => _TotalSecondsSinceLastWriteTimeFromSequence;
|
||||
|
||||
private static string DefaultMesEntity(DateTime dateTime) =>
|
||||
string.Concat(dateTime.Ticks, "_MES_ENTITY");
|
||||
|
||||
public Logistics(IFileRead fileRead)
|
||||
{
|
||||
DateTime dateTime = DateTime.Now;
|
||||
@ -84,14 +87,14 @@ public class Logistics : ILogistics
|
||||
_Logistics2 = new List<Logistics2>();
|
||||
}
|
||||
|
||||
public Logistics(string reportFullPath, string logistics)
|
||||
internal Logistics(string reportFullPath, ProcessDataStandardFormat processDataStandardFormat)
|
||||
{
|
||||
string key;
|
||||
DateTime dateTime;
|
||||
string[] segments;
|
||||
_FileInfo = new(reportFullPath);
|
||||
_Logistics1 = logistics.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries).ToList();
|
||||
if (!Logistics1.Any() || !Logistics1[0].StartsWith("LOGISTICS_1"))
|
||||
_Logistics1 = processDataStandardFormat.Logistics.ToList();
|
||||
if (Logistics1.Count == 0 || !Logistics1[0].StartsWith("LOGISTICS_1"))
|
||||
{
|
||||
_NullData = null;
|
||||
_JobID = "null";
|
||||
@ -190,8 +193,6 @@ public class Logistics : ILogistics
|
||||
}
|
||||
}
|
||||
|
||||
private static string DefaultMesEntity(DateTime dateTime) => string.Concat(dateTime.Ticks, "_MES_ENTITY");
|
||||
|
||||
internal void Update(string mid, string processJobID)
|
||||
{
|
||||
_MID = mid;
|
||||
|
@ -2,18 +2,29 @@
|
||||
|
||||
public partial class WS
|
||||
{
|
||||
|
||||
public class Attachment
|
||||
{
|
||||
|
||||
public string UniqueId { get; set; }
|
||||
public string DestinationFileName { get; set; }
|
||||
public string SourceFileName { get; set; }
|
||||
#nullable enable
|
||||
|
||||
public Attachment(string uniqueId, string destinationFileName, string sourceFileName)
|
||||
public long HeaderId { get; set; }
|
||||
public string UniqueId { get; set; }
|
||||
public string SubGroupId { get; set; }
|
||||
public string AttachmentId { get; set; }
|
||||
public string SourceFileName { get; set; }
|
||||
public string HeaderIdDirectory { get; set; }
|
||||
public string DestinationFileName { get; set; }
|
||||
|
||||
public Attachment(Results? results, string headerIdDirectory, string uniqueId, string destinationFileName, string sourceFileName)
|
||||
{
|
||||
UniqueId = uniqueId;
|
||||
DestinationFileName = destinationFileName;
|
||||
SourceFileName = sourceFileName;
|
||||
HeaderIdDirectory = headerIdDirectory;
|
||||
DestinationFileName = destinationFileName;
|
||||
AttachmentId = System.Guid.NewGuid().ToString();
|
||||
HeaderId = results?.HeaderId is null ? -1 : results.HeaderId.Value;
|
||||
SubGroupId = results?.SubgroupId is null ? string.Empty : results.SubgroupId.Value.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,27 +1,75 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.Shared.Metrology;
|
||||
|
||||
public partial class WS
|
||||
{
|
||||
// this class represents the response from the Inbound API endpoint
|
||||
|
||||
public class Results
|
||||
{
|
||||
// true or false if data was written to the database
|
||||
public bool Success { get; set; }
|
||||
|
||||
// if true, contains ID of the Header record in the database
|
||||
public long HeaderID { get; set; }
|
||||
#nullable enable
|
||||
|
||||
// if false, this collection will contain a list of errors
|
||||
public List<string> Errors { get; set; }
|
||||
[JsonConstructor]
|
||||
public Results(List<string>? errors,
|
||||
long? headerId,
|
||||
long? subgroupId,
|
||||
bool? success,
|
||||
List<string>? warnings)
|
||||
{
|
||||
Errors = errors;
|
||||
Success = success;
|
||||
HeaderId = headerId;
|
||||
Warnings = warnings;
|
||||
SubgroupId = subgroupId;
|
||||
}
|
||||
|
||||
// this collection will contain a list of warnings, they will not prevent data from being saved
|
||||
public List<string> Warnings { get; set; }
|
||||
[JsonPropertyName("errors")] public List<string>? Errors { get; set; }
|
||||
[JsonPropertyName("headerID")] public long? HeaderId { get; set; }
|
||||
[JsonPropertyName("subgroupId")] public long? SubgroupId { get; set; }
|
||||
[JsonPropertyName("success")] public bool? Success { get; set; }
|
||||
[JsonPropertyName("warnings")] public List<string>? Warnings { get; set; }
|
||||
|
||||
// this is just a helper function to make displaying the results easier
|
||||
public override string ToString() => JsonSerializer.Serialize(this, GetType());
|
||||
public override string ToString()
|
||||
{
|
||||
string result = JsonSerializer.Serialize(this, ResultsSourceGenerationContext.Default.Results);
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static Results Get(Results results, long? subgroupId) =>
|
||||
new(results.Errors, results.HeaderId, subgroupId, results.Success, results.Warnings);
|
||||
|
||||
internal static Results Get(string resultsJson, Exception e)
|
||||
{
|
||||
Results results;
|
||||
Exception? exception = e;
|
||||
List<string> errors = new();
|
||||
StringBuilder stringBuilder = new();
|
||||
while (exception is not null)
|
||||
{
|
||||
_ = stringBuilder.AppendLine(exception.Message);
|
||||
exception = exception.InnerException;
|
||||
}
|
||||
errors.Add(resultsJson);
|
||||
errors.Add(stringBuilder.ToString());
|
||||
results = new(errors: errors,
|
||||
headerId: null,
|
||||
subgroupId: null,
|
||||
success: false,
|
||||
warnings: new());
|
||||
return results;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(WS.Results))]
|
||||
internal partial class ResultsSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
@ -10,9 +10,11 @@ namespace Adaptation.Shared.Metrology;
|
||||
public partial class WS
|
||||
{
|
||||
|
||||
public static (string, Results) SendData(string url, object payload, int timeoutSeconds = 120)
|
||||
#nullable enable
|
||||
|
||||
public static (string, Results) SendData(string url, long sequence, string directory, object payload, int timeoutSeconds = 120)
|
||||
{
|
||||
Results results = new();
|
||||
Results? wsResults = null;
|
||||
string resultsJson = string.Empty;
|
||||
try
|
||||
{
|
||||
@ -30,85 +32,83 @@ public partial class WS
|
||||
};
|
||||
HttpResponseMessage httpResponseMessage = httpClient.SendAsync(httpRequestMessage, HttpCompletionOption.ResponseContentRead).Result;
|
||||
resultsJson = httpResponseMessage.Content.ReadAsStringAsync().Result;
|
||||
results = JsonSerializer.Deserialize<Results>(resultsJson, new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
|
||||
wsResults = JsonSerializer.Deserialize(resultsJson, ResultsSourceGenerationContext.Default.Results);
|
||||
if (wsResults is null)
|
||||
throw new NullReferenceException(nameof(wsResults));
|
||||
string checkDirectory = Path.Combine(directory, $"-{wsResults.HeaderId}");
|
||||
if (!Directory.Exists(checkDirectory))
|
||||
_ = Directory.CreateDirectory(checkDirectory);
|
||||
File.WriteAllText(Path.Combine(checkDirectory, $"{sequence}.json"), json);
|
||||
}
|
||||
if (!results.Success)
|
||||
results.Errors.Add(results.ToString());
|
||||
if (wsResults.Success is null || !wsResults.Success.Value)
|
||||
wsResults.Errors?.Add(wsResults.ToString());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Exception exception = e;
|
||||
StringBuilder stringBuilder = new();
|
||||
while (exception is not null)
|
||||
{
|
||||
_ = stringBuilder.AppendLine(exception.Message);
|
||||
exception = exception.InnerException;
|
||||
}
|
||||
results.Errors ??= new List<string>();
|
||||
results.Errors.Add(resultsJson);
|
||||
results.Errors.Add(stringBuilder.ToString());
|
||||
}
|
||||
return new(resultsJson, results);
|
||||
{ wsResults ??= Results.Get(resultsJson, e); }
|
||||
return new(resultsJson, wsResults);
|
||||
}
|
||||
|
||||
// this method is a wrapper for attaching a file to either a header or data record
|
||||
// URL is the same URL used for SendData, ex: http://localhost/api/inbound/CDE
|
||||
// attachToHeaderId is the ID returned by SendData
|
||||
// attachToDataUniqueId is the string unique ID for the data record, aka the Title of the Sharepoint list entry
|
||||
// fileContents is a byte array with the contents of the file
|
||||
// fileName is which attachment this is, image.pdf, data.pdf, data.txt, header.pdf, etc
|
||||
// timeoutSeconds is configured as the request timeout
|
||||
// this method will either succeed or throw an exception
|
||||
// also, this has been made synchronous
|
||||
public static void AttachFile(string url, long attachToHeaderId, string attachToDataUniqueId, byte[] fileContents, string fileName, int timeoutSeconds = 60)
|
||||
public static void AttachFile(string url, Attachment attachment, int timeoutSeconds = 60)
|
||||
{
|
||||
using HttpClient httpClient = new();
|
||||
string requestUrl = url + "/attachment?headerid=" + attachToHeaderId.ToString();
|
||||
if (!string.IsNullOrWhiteSpace(attachToDataUniqueId))
|
||||
{
|
||||
requestUrl += "&datauniqueid=";
|
||||
requestUrl += System.Net.WebUtility.UrlEncode(attachToDataUniqueId);
|
||||
}
|
||||
requestUrl += "&filename="; // this is just so the web server log shows the filename
|
||||
requestUrl += System.Net.WebUtility.UrlEncode(fileName);
|
||||
|
||||
string json = JsonSerializer.Serialize(attachment);
|
||||
httpClient.Timeout = new TimeSpan(0, 0, 0, timeoutSeconds, 0);
|
||||
|
||||
MultipartFormDataContent multipartFormDataContent = new();
|
||||
ByteArrayContent byteArrayContent = new(fileContents);
|
||||
byteArrayContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream");
|
||||
|
||||
multipartFormDataContent.Add(byteArrayContent, "attachment", fileName);
|
||||
|
||||
HttpResponseMessage httpResponseMessage = httpClient.PostAsync(requestUrl, multipartFormDataContent).Result;
|
||||
|
||||
if (httpResponseMessage.IsSuccessStatusCode)
|
||||
return;
|
||||
|
||||
StringContent httpContent = new(json, Encoding.UTF8, "application/json");
|
||||
HttpResponseMessage httpResponseMessage = httpClient.PostAsync($"{url}/attachment", httpContent).Result;
|
||||
if (!httpResponseMessage.IsSuccessStatusCode)
|
||||
{
|
||||
string resultBody = httpResponseMessage.Content.ReadAsStringAsync().Result;
|
||||
|
||||
throw new Exception("Attachment failed: " + resultBody);
|
||||
throw new Exception($"Attachment failed: {resultBody}");
|
||||
}
|
||||
}
|
||||
|
||||
public static void AttachFiles(string url, long headerID, List<Attachment> headerAttachments = null, List<Attachment> dataAttachments = null)
|
||||
public static void AttachFiles(string url, List<Attachment>? headerAttachments = null, List<Attachment>? dataAttachments = null)
|
||||
{
|
||||
string directory;
|
||||
try
|
||||
{
|
||||
string? directoryName;
|
||||
if (headerAttachments is not null)
|
||||
{
|
||||
foreach (Attachment attachment in headerAttachments)
|
||||
AttachFile(url, headerID, "", File.ReadAllBytes(attachment.SourceFileName), attachment.DestinationFileName);
|
||||
{
|
||||
directoryName = Path.GetDirectoryName(attachment.HeaderIdDirectory);
|
||||
if (string.IsNullOrEmpty(directoryName))
|
||||
continue;
|
||||
directory = Path.Combine(directoryName, attachment.AttachmentId) ?? throw new Exception();
|
||||
if (!Directory.Exists(directory))
|
||||
_ = Directory.CreateDirectory(directory);
|
||||
File.Copy(attachment.SourceFileName, Path.Combine(directory, attachment.DestinationFileName), overwrite: true);
|
||||
}
|
||||
}
|
||||
if (dataAttachments is not null)
|
||||
{
|
||||
foreach (Attachment attachment in dataAttachments)
|
||||
AttachFile(url, headerID, attachment.UniqueId, File.ReadAllBytes(attachment.SourceFileName), attachment.DestinationFileName);
|
||||
{
|
||||
directoryName = Path.GetDirectoryName(attachment.HeaderIdDirectory.Replace("Header", "Data"));
|
||||
if (string.IsNullOrEmpty(directoryName))
|
||||
continue;
|
||||
directory = Path.Combine(directoryName, attachment.AttachmentId) ?? throw new Exception();
|
||||
if (!Directory.Exists(directory))
|
||||
_ = Directory.CreateDirectory(directory);
|
||||
File.Copy(attachment.SourceFileName, Path.Combine(directory, attachment.DestinationFileName), overwrite: true);
|
||||
}
|
||||
}
|
||||
if (headerAttachments is not null)
|
||||
{
|
||||
foreach (Attachment attachment in headerAttachments)
|
||||
AttachFile(url, attachment);
|
||||
}
|
||||
if (dataAttachments is not null)
|
||||
{
|
||||
foreach (Attachment attachment in dataAttachments)
|
||||
AttachFile(url, attachment);
|
||||
}
|
||||
//MessageBox.Show(r.ToString());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Exception exception = e;
|
||||
Exception? exception = e;
|
||||
StringBuilder stringBuilder = new();
|
||||
while (exception is not null)
|
||||
{
|
||||
|
File diff suppressed because it is too large
Load Diff
33
Adaptation/Shared/ProcessDataStandardFormatMapping.cs
Normal file
33
Adaptation/Shared/ProcessDataStandardFormatMapping.cs
Normal file
@ -0,0 +1,33 @@
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace Adaptation.Shared;
|
||||
|
||||
public class ProcessDataStandardFormatMapping
|
||||
{
|
||||
|
||||
public ReadOnlyCollection<string> BackfillColumns { get; private set; }
|
||||
public ReadOnlyCollection<int> ColumnIndices { get; private set; }
|
||||
public ReadOnlyCollection<string> IgnoreColumns { get; private set; }
|
||||
public ReadOnlyCollection<string> IndexOnlyColumns { get; private set; }
|
||||
public ReadOnlyDictionary<string, string> KeyValuePairs { get; private set; }
|
||||
public ReadOnlyCollection<string> NewColumnNames { get; private set; }
|
||||
public ReadOnlyCollection<string> OldColumnNames { get; private set; }
|
||||
|
||||
public ProcessDataStandardFormatMapping(ReadOnlyCollection<string> backfillColumns,
|
||||
ReadOnlyCollection<int> columnIndices,
|
||||
ReadOnlyCollection<string> ignoreColumns,
|
||||
ReadOnlyCollection<string> indexOnlyColumns,
|
||||
ReadOnlyDictionary<string, string> keyValuePairs,
|
||||
ReadOnlyCollection<string> newColumnNames,
|
||||
ReadOnlyCollection<string> oldColumnNames)
|
||||
{
|
||||
BackfillColumns = backfillColumns;
|
||||
ColumnIndices = columnIndices;
|
||||
IgnoreColumns = ignoreColumns;
|
||||
IndexOnlyColumns = indexOnlyColumns;
|
||||
KeyValuePairs = keyValuePairs;
|
||||
NewColumnNames = newColumnNames;
|
||||
OldColumnNames = oldColumnNames;
|
||||
}
|
||||
|
||||
}
|
@ -14,6 +14,7 @@ public enum Test
|
||||
CandelaPSL = 38,
|
||||
CandelaVerify = 37,
|
||||
CDE = 24,
|
||||
Climatec = 54, //Largest
|
||||
CV = 3,
|
||||
DailyRPMAverage = 19,
|
||||
DailyRPMPLRatio = 20,
|
||||
@ -38,7 +39,7 @@ public enum Test
|
||||
RPMPLRatio = 17,
|
||||
RPMXY = 15,
|
||||
SP1 = 8,
|
||||
SRP2100 = 53, //Largest
|
||||
SRP2100 = 53,
|
||||
Tencor = 7,
|
||||
UV = 35,
|
||||
VerificationLehighton = 14,
|
||||
|
@ -0,0 +1,195 @@
|
||||
#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 MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
internal static string DummyRoot { get; private set; }
|
||||
internal static MET08DDUPSP1TBI EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
static MET08DDUPSP1TBI() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
|
||||
|
||||
public MET08DDUPSP1TBI() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public MET08DDUPSP1TBI(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
EAFLoggingUnitTesting ??= new MET08DDUPSP1TBI(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();
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__MET08DDUPSP1TBI__MoveMatchingFiles()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__MET08DDUPSP1TBI__OpenInsightMetrologyViewer()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__MET08DDUPSP1TBI__IQSSi()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__MET08DDUPSP1TBI__OpenInsight()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__MET08DDUPSP1TBI__OpenInsightMetrologyViewerAttachments()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__MET08DDUPSP1TBI__APC()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__MET08DDUPSP1TBI__SPaCe()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__MET08DDUPSP1TBI__Processed()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__MET08DDUPSP1TBI__Archive()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__MET08DDUPSP1TBI__Dummy()
|
||||
{
|
||||
string check = "637400748000000000.zip";
|
||||
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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__MET08DDUPSP1TBI__TIBCO()
|
||||
{
|
||||
string check = "*.idc";
|
||||
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
|
@ -0,0 +1,70 @@
|
||||
#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 SP101_EQPT : EAFLoggingUnitTesting
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
internal static string DummyRoot { get; private set; }
|
||||
internal static SP101_EQPT EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
static SP101_EQPT() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
|
||||
|
||||
public SP101_EQPT() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public SP101_EQPT(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
EAFLoggingUnitTesting ??= new SP101_EQPT(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();
|
||||
}
|
||||
|
||||
private static void NonThrowTryCatch()
|
||||
{
|
||||
try
|
||||
{ throw new Exception(); }
|
||||
catch (Exception) { }
|
||||
}
|
||||
|
||||
[Ignore]
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__SP101_EQPT__MoveAllFiles()
|
||||
{
|
||||
string check = "*";
|
||||
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"));
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
@ -0,0 +1,65 @@
|
||||
#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 SP101 : EAFLoggingUnitTesting
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
internal static string DummyRoot { get; private set; }
|
||||
internal static SP101 EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
static SP101() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
|
||||
|
||||
public SP101() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public SP101(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
EAFLoggingUnitTesting ??= new SP101(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();
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__SP101__txt()
|
||||
{
|
||||
string check = "*.txt";
|
||||
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
|
@ -0,0 +1,195 @@
|
||||
#if v2_58_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_58_0;
|
||||
|
||||
[TestClass]
|
||||
public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
internal static string DummyRoot { get; private set; }
|
||||
internal static MET08DDUPSP1TBI EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
static MET08DDUPSP1TBI() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
|
||||
|
||||
public MET08DDUPSP1TBI() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public MET08DDUPSP1TBI(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
EAFLoggingUnitTesting ??= new MET08DDUPSP1TBI(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();
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_58_0__MET08DDUPSP1TBI__MoveMatchingFiles()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_58_0__MET08DDUPSP1TBI__OpenInsightMetrologyViewer()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_58_0__MET08DDUPSP1TBI__IQSSi()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_58_0__MET08DDUPSP1TBI__OpenInsight()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_58_0__MET08DDUPSP1TBI__OpenInsightMetrologyViewerAttachments()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_58_0__MET08DDUPSP1TBI__APC()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_58_0__MET08DDUPSP1TBI__SPaCe()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_58_0__MET08DDUPSP1TBI__Processed()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_58_0__MET08DDUPSP1TBI__Archive()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_58_0__MET08DDUPSP1TBI__Dummy()
|
||||
{
|
||||
string check = "637400748000000000.zip";
|
||||
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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_58_0__MET08DDUPSP1TBI__TIBCO()
|
||||
{
|
||||
string check = "*.idc";
|
||||
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
|
@ -0,0 +1,70 @@
|
||||
#if v2_58_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_58_0;
|
||||
|
||||
[TestClass]
|
||||
public class SP101_EQPT : EAFLoggingUnitTesting
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
internal static string DummyRoot { get; private set; }
|
||||
internal static SP101_EQPT EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
static SP101_EQPT() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
|
||||
|
||||
public SP101_EQPT() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public SP101_EQPT(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
EAFLoggingUnitTesting ??= new SP101_EQPT(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();
|
||||
}
|
||||
|
||||
private static void NonThrowTryCatch()
|
||||
{
|
||||
try
|
||||
{ throw new Exception(); }
|
||||
catch (Exception) { }
|
||||
}
|
||||
|
||||
[Ignore]
|
||||
[TestMethod]
|
||||
public void Production__v2_58_0__SP101_EQPT__MoveAllFiles()
|
||||
{
|
||||
string check = "*";
|
||||
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"));
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
@ -0,0 +1,65 @@
|
||||
#if v2_58_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_58_0;
|
||||
|
||||
[TestClass]
|
||||
public class SP101 : EAFLoggingUnitTesting
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
internal static string DummyRoot { get; private set; }
|
||||
internal static SP101 EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
static SP101() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
|
||||
|
||||
public SP101() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public SP101(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
EAFLoggingUnitTesting ??= new SP101(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();
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_58_0__SP101__txt()
|
||||
{
|
||||
string check = "*.txt";
|
||||
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
|
@ -0,0 +1,195 @@
|
||||
#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 MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
internal static string DummyRoot { get; private set; }
|
||||
internal static MET08DDUPSP1TBI EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
static MET08DDUPSP1TBI() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
|
||||
|
||||
public MET08DDUPSP1TBI() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public MET08DDUPSP1TBI(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
EAFLoggingUnitTesting ??= new MET08DDUPSP1TBI(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();
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_59_0__MET08DDUPSP1TBI__MoveMatchingFiles()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_59_0__MET08DDUPSP1TBI__OpenInsightMetrologyViewer()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_59_0__MET08DDUPSP1TBI__IQSSi()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_59_0__MET08DDUPSP1TBI__OpenInsight()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_59_0__MET08DDUPSP1TBI__OpenInsightMetrologyViewerAttachments()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_59_0__MET08DDUPSP1TBI__APC()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_59_0__MET08DDUPSP1TBI__SPaCe()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_59_0__MET08DDUPSP1TBI__Processed()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_59_0__MET08DDUPSP1TBI__Archive()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_59_0__MET08DDUPSP1TBI__Dummy()
|
||||
{
|
||||
string check = "637400748000000000.zip";
|
||||
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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_59_0__MET08DDUPSP1TBI__TIBCO()
|
||||
{
|
||||
string check = "*.idc";
|
||||
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
|
@ -0,0 +1,70 @@
|
||||
#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 SP101_EQPT : EAFLoggingUnitTesting
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
internal static string DummyRoot { get; private set; }
|
||||
internal static SP101_EQPT EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
static SP101_EQPT() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
|
||||
|
||||
public SP101_EQPT() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public SP101_EQPT(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
EAFLoggingUnitTesting ??= new SP101_EQPT(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();
|
||||
}
|
||||
|
||||
private static void NonThrowTryCatch()
|
||||
{
|
||||
try
|
||||
{ throw new Exception(); }
|
||||
catch (Exception) { }
|
||||
}
|
||||
|
||||
[Ignore]
|
||||
[TestMethod]
|
||||
public void Production__v2_59_0__SP101_EQPT__MoveAllFiles()
|
||||
{
|
||||
string check = "*";
|
||||
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"));
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
@ -0,0 +1,65 @@
|
||||
#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 SP101 : EAFLoggingUnitTesting
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
internal static string DummyRoot { get; private set; }
|
||||
internal static SP101 EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
static SP101() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
|
||||
|
||||
public SP101() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public SP101(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
EAFLoggingUnitTesting ??= new SP101(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();
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_59_0__SP101__txt()
|
||||
{
|
||||
string check = "*.txt";
|
||||
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
|
@ -1,3 +1,4 @@
|
||||
#if v2_39_0
|
||||
using Adaptation._Tests.Shared;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@ -45,7 +46,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting?.Dispose();
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -58,7 +59,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -71,7 +72,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -84,7 +85,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -97,7 +98,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -110,7 +111,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -123,7 +124,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -136,7 +137,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -149,7 +150,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -162,7 +163,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -176,3 +177,4 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
@ -1,3 +1,4 @@
|
||||
#if v2_39_0
|
||||
using Adaptation._Tests.Shared;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@ -44,7 +45,7 @@ public class SP101_EQPT : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting?.Dispose();
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -58,3 +59,4 @@ public class SP101_EQPT : EAFLoggingUnitTesting
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
@ -1,3 +1,4 @@
|
||||
#if v2_39_0
|
||||
using Adaptation._Tests.Shared;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@ -45,7 +46,7 @@ public class SP101 : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting?.Dispose();
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -59,3 +60,4 @@ public class SP101 : EAFLoggingUnitTesting
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
@ -1,3 +1,4 @@
|
||||
#if v2_43_0
|
||||
using Adaptation._Tests.Shared;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@ -45,7 +46,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting?.Dispose();
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -58,7 +59,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -71,7 +72,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -84,7 +85,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -97,7 +98,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -110,7 +111,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -123,7 +124,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -136,7 +137,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -149,7 +150,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -162,7 +163,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -176,3 +177,4 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
@ -1,3 +1,4 @@
|
||||
#if v2_43_0
|
||||
using Adaptation._Tests.Shared;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@ -44,7 +45,7 @@ public class SP101_EQPT : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting?.Dispose();
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -58,3 +59,4 @@ public class SP101_EQPT : EAFLoggingUnitTesting
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
@ -1,3 +1,4 @@
|
||||
#if v2_43_0
|
||||
using Adaptation._Tests.Shared;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@ -45,7 +46,7 @@ public class SP101 : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting?.Dispose();
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -59,3 +60,4 @@ public class SP101 : EAFLoggingUnitTesting
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
@ -1,3 +1,4 @@
|
||||
#if v2_43_3
|
||||
using Adaptation._Tests.Shared;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@ -45,7 +46,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting?.Dispose();
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -58,7 +59,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -71,7 +72,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -84,7 +85,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -97,7 +98,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -110,7 +111,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -123,7 +124,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -136,7 +137,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -149,7 +150,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -162,7 +163,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -175,7 +176,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -189,3 +190,4 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
@ -1,3 +1,4 @@
|
||||
#if v2_43_4
|
||||
using Adaptation._Tests.Shared;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@ -18,7 +19,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
internal static string DummyRoot { get; private set; }
|
||||
internal static MET08DDUPSP1TBI EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
static MET08DDUPSP1TBI() => DummyRoot = @"\\messv02ecc1.ec.local\EC_Characterization_Si\Dummy";
|
||||
static MET08DDUPSP1TBI() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
|
||||
|
||||
public MET08DDUPSP1TBI() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
@ -47,7 +48,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting?.Dispose();
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -60,7 +61,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -73,7 +74,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -86,7 +87,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -99,7 +100,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -112,7 +113,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -125,7 +126,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -138,7 +139,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -151,7 +152,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -164,7 +165,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -178,3 +179,4 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
@ -1,3 +1,4 @@
|
||||
#if v2_43_4
|
||||
using Adaptation._Tests.Shared;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@ -17,7 +18,7 @@ public class SP101_EQPT : EAFLoggingUnitTesting
|
||||
internal static string DummyRoot { get; private set; }
|
||||
internal static SP101_EQPT EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
static SP101_EQPT() => DummyRoot = @"\\messv02ecc1.ec.local\EC_Characterization_Si\Dummy";
|
||||
static SP101_EQPT() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
|
||||
|
||||
public SP101_EQPT() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
@ -46,7 +47,7 @@ public class SP101_EQPT : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting?.Dispose();
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -60,3 +61,4 @@ public class SP101_EQPT : EAFLoggingUnitTesting
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
@ -1,3 +1,4 @@
|
||||
#if v2_43_4
|
||||
using Adaptation._Tests.Shared;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@ -18,7 +19,7 @@ public class SP101 : EAFLoggingUnitTesting
|
||||
internal static string DummyRoot { get; private set; }
|
||||
internal static SP101 EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
static SP101() => DummyRoot = @"\\messv02ecc1.ec.local\EC_Characterization_Si\Dummy";
|
||||
static SP101() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
|
||||
|
||||
public SP101() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
@ -47,7 +48,7 @@ public class SP101 : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting?.Dispose();
|
||||
}
|
||||
|
||||
#if true
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -61,3 +62,4 @@ public class SP101 : EAFLoggingUnitTesting
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
@ -1,3 +1,4 @@
|
||||
#if v2_47_0
|
||||
using Adaptation._Tests.Shared;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@ -17,7 +18,7 @@ public class SP101_EQPT : EAFLoggingUnitTesting
|
||||
internal static string DummyRoot { get; private set; }
|
||||
internal static SP101_EQPT EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
static SP101_EQPT() => DummyRoot = @"\\messv02ecc1.ec.local\EC_Characterization_Si\Dummy";
|
||||
static SP101_EQPT() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
|
||||
|
||||
public SP101_EQPT() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
@ -46,7 +47,9 @@ public class SP101_EQPT : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting?.Dispose();
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_47_0__SP101_EQPT__MoveAllFiles()
|
||||
{
|
||||
@ -58,3 +61,4 @@ public class SP101_EQPT : EAFLoggingUnitTesting
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
@ -1,3 +1,4 @@
|
||||
#if v2_47_0
|
||||
using Adaptation._Tests.Shared;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@ -18,7 +19,7 @@ public class SP101 : EAFLoggingUnitTesting
|
||||
internal static string DummyRoot { get; private set; }
|
||||
internal static SP101 EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
static SP101() => DummyRoot = @"\\messv02ecc1.ec.local\EC_Characterization_Si\Dummy";
|
||||
static SP101() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
|
||||
|
||||
public SP101() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
@ -47,7 +48,9 @@ public class SP101 : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting?.Dispose();
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_47_0__SP101__txt()
|
||||
{
|
||||
@ -59,3 +62,4 @@ public class SP101 : EAFLoggingUnitTesting
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
@ -1,3 +1,4 @@
|
||||
#if v2_49_0
|
||||
using Adaptation._Tests.Shared;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@ -18,7 +19,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
internal static string DummyRoot { get; private set; }
|
||||
internal static MET08DDUPSP1TBI EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
static MET08DDUPSP1TBI() => DummyRoot = @"\\messv02ecc1.ec.local\EC_Characterization_Si\Dummy";
|
||||
static MET08DDUPSP1TBI() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
|
||||
|
||||
public MET08DDUPSP1TBI() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
@ -47,7 +48,9 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting?.Dispose();
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_49_0__MET08DDUPSP1TBI__MoveMatchingFiles()
|
||||
{
|
||||
@ -58,7 +61,9 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_49_0__MET08DDUPSP1TBI__OpenInsightMetrologyViewer()
|
||||
{
|
||||
@ -69,7 +74,9 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_49_0__MET08DDUPSP1TBI__IQSSi()
|
||||
{
|
||||
@ -80,7 +87,9 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_49_0__MET08DDUPSP1TBI__OpenInsight()
|
||||
{
|
||||
@ -91,7 +100,9 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_49_0__MET08DDUPSP1TBI__OpenInsightMetrologyViewerAttachments()
|
||||
{
|
||||
@ -102,7 +113,9 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_49_0__MET08DDUPSP1TBI__APC()
|
||||
{
|
||||
@ -113,7 +126,9 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_49_0__MET08DDUPSP1TBI__SPaCe()
|
||||
{
|
||||
@ -124,7 +139,9 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_49_0__MET08DDUPSP1TBI__Processed()
|
||||
{
|
||||
@ -135,7 +152,9 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_49_0__MET08DDUPSP1TBI__Archive()
|
||||
{
|
||||
@ -146,7 +165,9 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_49_0__MET08DDUPSP1TBI__Dummy()
|
||||
{
|
||||
@ -158,3 +179,4 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
@ -1,3 +1,4 @@
|
||||
#if v2_49_0
|
||||
using Adaptation._Tests.Shared;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@ -18,7 +19,7 @@ public class SP101 : EAFLoggingUnitTesting
|
||||
internal static string DummyRoot { get; private set; }
|
||||
internal static SP101 EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
static SP101() => DummyRoot = @"\\messv02ecc1.ec.local\EC_Characterization_Si\Dummy";
|
||||
static SP101() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
|
||||
|
||||
public SP101() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
@ -47,7 +48,9 @@ public class SP101 : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting?.Dispose();
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_49_0__SP101__txt()
|
||||
{
|
||||
@ -59,3 +62,4 @@ public class SP101 : EAFLoggingUnitTesting
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
@ -1,3 +1,4 @@
|
||||
#if v2_49_2
|
||||
using Adaptation._Tests.Shared;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@ -18,7 +19,7 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
internal static string DummyRoot { get; private set; }
|
||||
internal static MET08DDUPSP1TBI EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
static MET08DDUPSP1TBI() => DummyRoot = @"\\messv02ecc1.ec.local\EC_Characterization_Si\Dummy";
|
||||
static MET08DDUPSP1TBI() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
|
||||
|
||||
public MET08DDUPSP1TBI() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
@ -177,7 +178,9 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_49_2__MET08DDUPSP1TBI__TIBCO()
|
||||
{
|
||||
@ -189,3 +192,4 @@ public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
@ -1,3 +1,4 @@
|
||||
#if v2_49_2
|
||||
using Adaptation._Tests.Shared;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@ -18,7 +19,7 @@ public class SP101 : EAFLoggingUnitTesting
|
||||
internal static string DummyRoot { get; private set; }
|
||||
internal static SP101 EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
static SP101() => DummyRoot = @"\\messv02ecc1.ec.local\EC_Characterization_Si\Dummy";
|
||||
static SP101() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
|
||||
|
||||
public SP101() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
@ -61,3 +62,4 @@ public class SP101 : EAFLoggingUnitTesting
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
@ -0,0 +1,195 @@
|
||||
#if v2_49_3
|
||||
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.Staging.v2_49_3;
|
||||
|
||||
[TestClass]
|
||||
public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
internal static string DummyRoot { get; private set; }
|
||||
internal static MET08DDUPSP1TBI EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
static MET08DDUPSP1TBI() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
|
||||
|
||||
public MET08DDUPSP1TBI() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public MET08DDUPSP1TBI(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
EAFLoggingUnitTesting ??= new MET08DDUPSP1TBI(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();
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_49_3__MET08DDUPSP1TBI__MoveMatchingFiles()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_49_3__MET08DDUPSP1TBI__OpenInsightMetrologyViewer()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_49_3__MET08DDUPSP1TBI__IQSSi()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_49_3__MET08DDUPSP1TBI__OpenInsight()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_49_3__MET08DDUPSP1TBI__OpenInsightMetrologyViewerAttachments()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_49_3__MET08DDUPSP1TBI__APC()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_49_3__MET08DDUPSP1TBI__SPaCe()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_49_3__MET08DDUPSP1TBI__Processed()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_49_3__MET08DDUPSP1TBI__Archive()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_49_3__MET08DDUPSP1TBI__Dummy()
|
||||
{
|
||||
string check = "637400748000000000.zip";
|
||||
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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_49_3__MET08DDUPSP1TBI__TIBCO()
|
||||
{
|
||||
string check = "*.idc";
|
||||
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
|
@ -0,0 +1,70 @@
|
||||
#if v2_49_3
|
||||
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.Staging.v2_49_3;
|
||||
|
||||
[TestClass]
|
||||
public class SP101_EQPT : EAFLoggingUnitTesting
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
internal static string DummyRoot { get; private set; }
|
||||
internal static SP101_EQPT EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
static SP101_EQPT() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
|
||||
|
||||
public SP101_EQPT() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public SP101_EQPT(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
EAFLoggingUnitTesting ??= new SP101_EQPT(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();
|
||||
}
|
||||
|
||||
private static void NonThrowTryCatch()
|
||||
{
|
||||
try
|
||||
{ throw new Exception(); }
|
||||
catch (Exception) { }
|
||||
}
|
||||
|
||||
[Ignore]
|
||||
[TestMethod]
|
||||
public void Staging__v2_49_3__SP101_EQPT__MoveAllFiles()
|
||||
{
|
||||
string check = "*";
|
||||
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"));
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
@ -0,0 +1,65 @@
|
||||
#if v2_49_3
|
||||
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.Staging.v2_49_3;
|
||||
|
||||
[TestClass]
|
||||
public class SP101 : EAFLoggingUnitTesting
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
internal static string DummyRoot { get; private set; }
|
||||
internal static SP101 EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
static SP101() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
|
||||
|
||||
public SP101() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public SP101(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
EAFLoggingUnitTesting ??= new SP101(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();
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_49_3__SP101__txt()
|
||||
{
|
||||
string check = "*.txt";
|
||||
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
|
@ -0,0 +1,195 @@
|
||||
#if v2_52_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.Staging.v2_52_0;
|
||||
|
||||
[TestClass]
|
||||
public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
internal static string DummyRoot { get; private set; }
|
||||
internal static MET08DDUPSP1TBI EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
static MET08DDUPSP1TBI() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
|
||||
|
||||
public MET08DDUPSP1TBI() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public MET08DDUPSP1TBI(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
EAFLoggingUnitTesting ??= new MET08DDUPSP1TBI(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();
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_52_0__MET08DDUPSP1TBI__MoveMatchingFiles()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_52_0__MET08DDUPSP1TBI__OpenInsightMetrologyViewer()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_52_0__MET08DDUPSP1TBI__IQSSi()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_52_0__MET08DDUPSP1TBI__OpenInsight()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_52_0__MET08DDUPSP1TBI__OpenInsightMetrologyViewerAttachments()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_52_0__MET08DDUPSP1TBI__APC()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_52_0__MET08DDUPSP1TBI__SPaCe()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_52_0__MET08DDUPSP1TBI__Processed()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_52_0__MET08DDUPSP1TBI__Archive()
|
||||
{
|
||||
string check = "*.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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_52_0__MET08DDUPSP1TBI__Dummy()
|
||||
{
|
||||
string check = "637400748000000000.zip";
|
||||
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"));
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_52_0__MET08DDUPSP1TBI__TIBCO()
|
||||
{
|
||||
string check = "*.idc";
|
||||
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
|
@ -0,0 +1,70 @@
|
||||
#if v2_52_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.Staging.v2_52_0;
|
||||
|
||||
[TestClass]
|
||||
public class SP101_EQPT : EAFLoggingUnitTesting
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
internal static string DummyRoot { get; private set; }
|
||||
internal static SP101_EQPT EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
static SP101_EQPT() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
|
||||
|
||||
public SP101_EQPT() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public SP101_EQPT(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
EAFLoggingUnitTesting ??= new SP101_EQPT(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();
|
||||
}
|
||||
|
||||
private static void NonThrowTryCatch()
|
||||
{
|
||||
try
|
||||
{ throw new Exception(); }
|
||||
catch (Exception) { }
|
||||
}
|
||||
|
||||
[Ignore]
|
||||
[TestMethod]
|
||||
public void Staging__v2_52_0__SP101_EQPT__MoveAllFiles()
|
||||
{
|
||||
string check = "*";
|
||||
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"));
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
@ -0,0 +1,65 @@
|
||||
#if v2_52_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.Staging.v2_52_0;
|
||||
|
||||
[TestClass]
|
||||
public class SP101 : EAFLoggingUnitTesting
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
internal static string DummyRoot { get; private set; }
|
||||
internal static SP101 EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
static SP101() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
|
||||
|
||||
public SP101() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public SP101(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
EAFLoggingUnitTesting ??= new SP101(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();
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Staging__v2_52_0__SP101__txt()
|
||||
{
|
||||
string check = "*.txt";
|
||||
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
|
@ -0,0 +1,173 @@
|
||||
#if v2_56_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.Staging.v2_56_0;
|
||||
|
||||
[TestClass]
|
||||
public class MET08DDUPSP1TBI : EAFLoggingUnitTesting
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
internal static string DummyRoot { get; private set; }
|
||||
internal static MET08DDUPSP1TBI EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
static MET08DDUPSP1TBI() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
|
||||
|
||||
public MET08DDUPSP1TBI() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public MET08DDUPSP1TBI(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
EAFLoggingUnitTesting ??= new MET08DDUPSP1TBI(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 Staging__v2_56_0__MET08DDUPSP1TBI__MoveMatchingFiles()
|
||||
{
|
||||
string check = "*.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 Staging__v2_56_0__MET08DDUPSP1TBI__OpenInsightMetrologyViewer()
|
||||
{
|
||||
string check = "*.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 Staging__v2_56_0__MET08DDUPSP1TBI__IQSSi()
|
||||
{
|
||||
string check = "*.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 Staging__v2_56_0__MET08DDUPSP1TBI__OpenInsight()
|
||||
{
|
||||
string check = "*.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 Staging__v2_56_0__MET08DDUPSP1TBI__OpenInsightMetrologyViewerAttachments()
|
||||
{
|
||||
string check = "*.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 Staging__v2_56_0__MET08DDUPSP1TBI__APC()
|
||||
{
|
||||
string check = "*.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 Staging__v2_56_0__MET08DDUPSP1TBI__SPaCe()
|
||||
{
|
||||
string check = "*.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 Staging__v2_56_0__MET08DDUPSP1TBI__Processed()
|
||||
{
|
||||
string check = "*.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 Staging__v2_56_0__MET08DDUPSP1TBI__Archive()
|
||||
{
|
||||
string check = "*.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 Staging__v2_56_0__MET08DDUPSP1TBI__Dummy()
|
||||
{
|
||||
string check = "637400748000000000.zip";
|
||||
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 Staging__v2_56_0__MET08DDUPSP1TBI__TIBCO()
|
||||
{
|
||||
string check = "*.idc";
|
||||
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
|
@ -0,0 +1,70 @@
|
||||
#if v2_56_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.Staging.v2_56_0;
|
||||
|
||||
[TestClass]
|
||||
public class SP101_EQPT : EAFLoggingUnitTesting
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
internal static string DummyRoot { get; private set; }
|
||||
internal static SP101_EQPT EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
static SP101_EQPT() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
|
||||
|
||||
public SP101_EQPT() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public SP101_EQPT(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
EAFLoggingUnitTesting ??= new SP101_EQPT(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();
|
||||
}
|
||||
|
||||
private static void NonThrowTryCatch()
|
||||
{
|
||||
try
|
||||
{ throw new Exception(); }
|
||||
catch (Exception) { }
|
||||
}
|
||||
|
||||
[Ignore]
|
||||
[TestMethod]
|
||||
public void Staging__v2_56_0__SP101_EQPT__MoveAllFiles()
|
||||
{
|
||||
string check = "*";
|
||||
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"));
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
@ -0,0 +1,63 @@
|
||||
#if v2_56_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.Staging.v2_56_0;
|
||||
|
||||
[TestClass]
|
||||
public class SP101 : EAFLoggingUnitTesting
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
internal static string DummyRoot { get; private set; }
|
||||
internal static SP101 EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
static SP101() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy";
|
||||
|
||||
public SP101() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public SP101(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
EAFLoggingUnitTesting ??= new SP101(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 Staging__v2_56_0__SP101__txt()
|
||||
{
|
||||
string check = "*.txt";
|
||||
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
|
148
Adaptation/_Tests/Extract/Production/v2.57.0/MET08DDUPSP1TBI.cs
Normal file
148
Adaptation/_Tests/Extract/Production/v2.57.0/MET08DDUPSP1TBI.cs
Normal file
@ -0,0 +1,148 @@
|
||||
#if v2_57_0
|
||||
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 MET08DDUPSP1TBI
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
private static CreateSelfDescription.Production.v2_57_0.MET08DDUPSP1TBI _MET08DDUPSP1TBI;
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
CreateSelfDescription.Production.v2_57_0.MET08DDUPSP1TBI.ClassInitialize(testContext);
|
||||
_MET08DDUPSP1TBI = CreateSelfDescription.Production.v2_57_0.MET08DDUPSP1TBI.EAFLoggingUnitTesting;
|
||||
}
|
||||
|
||||
private static void NonThrowTryCatch()
|
||||
{
|
||||
try
|
||||
{ throw new Exception(); }
|
||||
catch (Exception) { }
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__MET08DDUPSP1TBI__MoveMatchingFiles() => _MET08DDUPSP1TBI.Production__v2_57_0__MET08DDUPSP1TBI__MoveMatchingFiles();
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__MET08DDUPSP1TBI__MoveMatchingFiles637955319879801344__Normal()
|
||||
{
|
||||
string check = "*.pdsf";
|
||||
bool validatePDSF = false;
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
_MET08DDUPSP1TBI.Production__v2_57_0__MET08DDUPSP1TBI__MoveMatchingFiles();
|
||||
string[] variables = _MET08DDUPSP1TBI.AdaptationTesting.GetVariables(methodBase, check, validatePDSF);
|
||||
IFileRead fileRead = _MET08DDUPSP1TBI.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
|
||||
Logistics logistics = new(fileRead);
|
||||
_ = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics, validatePDSF);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__MET08DDUPSP1TBI__OpenInsightMetrologyViewer() => _MET08DDUPSP1TBI.Production__v2_57_0__MET08DDUPSP1TBI__OpenInsightMetrologyViewer();
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__MET08DDUPSP1TBI__IQSSi() => _MET08DDUPSP1TBI.Production__v2_57_0__MET08DDUPSP1TBI__IQSSi();
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__MET08DDUPSP1TBI__OpenInsight() => _MET08DDUPSP1TBI.Production__v2_57_0__MET08DDUPSP1TBI__OpenInsight();
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__MET08DDUPSP1TBI__OpenInsight638052814829645888__IqsSql()
|
||||
{
|
||||
string check = "*.pdsf";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
_MET08DDUPSP1TBI.Production__v2_57_0__MET08DDUPSP1TBI__OpenInsight();
|
||||
string[] variables = _MET08DDUPSP1TBI.AdaptationTesting.GetVariables(methodBase, check, validatePDSF: false);
|
||||
IFileRead fileRead = _MET08DDUPSP1TBI.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
|
||||
Logistics logistics = new(fileRead);
|
||||
_ = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__MET08DDUPSP1TBI__OpenInsightMetrologyViewerAttachments() => _MET08DDUPSP1TBI.Production__v2_57_0__MET08DDUPSP1TBI__OpenInsightMetrologyViewerAttachments();
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__MET08DDUPSP1TBI__APC() => _MET08DDUPSP1TBI.Production__v2_57_0__MET08DDUPSP1TBI__APC();
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__MET08DDUPSP1TBI__SPaCe() => _MET08DDUPSP1TBI.Production__v2_57_0__MET08DDUPSP1TBI__SPaCe();
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__MET08DDUPSP1TBI__Processed() => _MET08DDUPSP1TBI.Production__v2_57_0__MET08DDUPSP1TBI__Processed();
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__MET08DDUPSP1TBI__Archive() => _MET08DDUPSP1TBI.Production__v2_57_0__MET08DDUPSP1TBI__Archive();
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__MET08DDUPSP1TBI__Dummy() => _MET08DDUPSP1TBI.Production__v2_57_0__MET08DDUPSP1TBI__Dummy();
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__MET08DDUPSP1TBI__TIBCO() => _MET08DDUPSP1TBI.Production__v2_57_0__MET08DDUPSP1TBI__TIBCO();
|
||||
|
||||
[Ignore]
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__MET08DDUPSP1TBI__TIBCO638217888620242702__Normal()
|
||||
{
|
||||
string check = "*.idc";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
_MET08DDUPSP1TBI.Production__v2_57_0__MET08DDUPSP1TBI__TIBCO();
|
||||
string[] variables = _MET08DDUPSP1TBI.AdaptationTesting.GetVariables(methodBase, check, validatePDSF: false);
|
||||
_ = _MET08DDUPSP1TBI.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
|
||||
for (int i = 0; i < int.MaxValue; i++)
|
||||
System.Threading.Thread.Sleep(500);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
27
Adaptation/_Tests/Extract/Production/v2.57.0/SP101-EQPT.cs
Normal file
27
Adaptation/_Tests/Extract/Production/v2.57.0/SP101-EQPT.cs
Normal file
@ -0,0 +1,27 @@
|
||||
#if v2_57_0
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace Adaptation._Tests.Extract.Production.v2_57_0;
|
||||
|
||||
[TestClass]
|
||||
public class SP101_EQPT
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
private static CreateSelfDescription.Production.v2_57_0.SP101_EQPT _SP101_EQPT;
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
CreateSelfDescription.Production.v2_57_0.SP101_EQPT.ClassInitialize(testContext);
|
||||
_SP101_EQPT = CreateSelfDescription.Production.v2_57_0.SP101_EQPT.EAFLoggingUnitTesting;
|
||||
}
|
||||
|
||||
[Ignore]
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__SP101_EQPT__MoveAllFiles() => _SP101_EQPT.Production__v2_57_0__SP101_EQPT__MoveAllFiles();
|
||||
|
||||
}
|
||||
#endif
|
58
Adaptation/_Tests/Extract/Production/v2.57.0/SP101.cs
Normal file
58
Adaptation/_Tests/Extract/Production/v2.57.0/SP101.cs
Normal file
@ -0,0 +1,58 @@
|
||||
#if v2_57_0
|
||||
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 SP101
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
private static CreateSelfDescription.Production.v2_57_0.SP101 _SP101;
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
CreateSelfDescription.Production.v2_57_0.SP101.ClassInitialize(testContext);
|
||||
_SP101 = CreateSelfDescription.Production.v2_57_0.SP101.EAFLoggingUnitTesting;
|
||||
}
|
||||
|
||||
private static void NonThrowTryCatch()
|
||||
{
|
||||
try
|
||||
{ throw new Exception(); }
|
||||
catch (Exception) { }
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__SP101__txt() => _SP101.Production__v2_57_0__SP101__txt();
|
||||
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
public void Production__v2_57_0__SP101__txt637955319879801344__Normal()
|
||||
{
|
||||
string check = "*.txt";
|
||||
bool validatePDSF = false;
|
||||
_SP101.Production__v2_57_0__SP101__txt();
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
string[] variables = _SP101.AdaptationTesting.GetVariables(methodBase, check, validatePDSF);
|
||||
IFileRead fileRead = _SP101.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
|
||||
Logistics logistics = new(fileRead);
|
||||
_ = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics, validatePDSF);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user