diff --git a/Adaptation/.editorconfig b/Adaptation/.editorconfig
index 69ecc38..d117dc5 100644
--- a/Adaptation/.editorconfig
+++ b/Adaptation/.editorconfig
@@ -121,6 +121,7 @@ dotnet_diagnostic.IDE0290.severity = none # Use primary constructor [Distance]cs
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
diff --git a/Adaptation/.vscode/format-report.json b/Adaptation/.vscode/format-report.json
index 0637a08..ea0222f 100644
--- a/Adaptation/.vscode/format-report.json
+++ b/Adaptation/.vscode/format-report.json
@@ -1 +1,92 @@
-[]
\ No newline at end of file
+[
+ {
+ "DocumentId": {
+ "ProjectId": {
+ "Id": "09d3713c-65ba-4edc-825c-25bdd8365c7b"
+ },
+ "Id": "6581d230-abcd-4361-be56-35654f1f73d9"
+ },
+ "FileName": "DEP08CEPIEPSILON.cs",
+ "FilePath": "L:\\DevOps\\EAF-Mesa-Integration\\dep08cepiepsilon\\Adaptation\\_Tests\\Static\\DEP08CEPIEPSILON.cs",
+ "FileChanges": [
+ {
+ "LineNumber": 54,
+ "CharNumber": 9,
+ "DiagnosticId": "MSTEST0037",
+ "FormatDescription": "error MSTEST0037: Use \u0027Assert.AreEqual\u0027 instead of \u0027Assert.IsTrue\u0027"
+ }
+ ]
+ },
+ {
+ "DocumentId": {
+ "ProjectId": {
+ "Id": "09d3713c-65ba-4edc-825c-25bdd8365c7b"
+ },
+ "Id": "63aef27c-c033-4bfc-86bc-3b9c034490c1"
+ },
+ "FileName": "AdaptationTesting.cs",
+ "FilePath": "L:\\DevOps\\EAF-Mesa-Integration\\dep08cepiepsilon\\Adaptation\\_Tests\\Shared\\AdaptationTesting.cs",
+ "FileChanges": [
+ {
+ "LineNumber": 1114,
+ "CharNumber": 13,
+ "DiagnosticId": "MSTEST0037",
+ "FormatDescription": "error MSTEST0037: Use \u0027Assert.AreNotEqual\u0027 instead of \u0027Assert.IsTrue\u0027"
+ }
+ ]
+ },
+ {
+ "DocumentId": {
+ "ProjectId": {
+ "Id": "09d3713c-65ba-4edc-825c-25bdd8365c7b"
+ },
+ "Id": "63aef27c-c033-4bfc-86bc-3b9c034490c1"
+ },
+ "FileName": "AdaptationTesting.cs",
+ "FilePath": "L:\\DevOps\\EAF-Mesa-Integration\\dep08cepiepsilon\\Adaptation\\_Tests\\Shared\\AdaptationTesting.cs",
+ "FileChanges": [
+ {
+ "LineNumber": 1262,
+ "CharNumber": 17,
+ "DiagnosticId": "MSTEST0037",
+ "FormatDescription": "error MSTEST0037: Use \u0027Assert.AreEqual\u0027 instead of \u0027Assert.IsTrue\u0027"
+ }
+ ]
+ },
+ {
+ "DocumentId": {
+ "ProjectId": {
+ "Id": "09d3713c-65ba-4edc-825c-25bdd8365c7b"
+ },
+ "Id": "63aef27c-c033-4bfc-86bc-3b9c034490c1"
+ },
+ "FileName": "AdaptationTesting.cs",
+ "FilePath": "L:\\DevOps\\EAF-Mesa-Integration\\dep08cepiepsilon\\Adaptation\\_Tests\\Shared\\AdaptationTesting.cs",
+ "FileChanges": [
+ {
+ "LineNumber": 1265,
+ "CharNumber": 17,
+ "DiagnosticId": "MSTEST0037",
+ "FormatDescription": "error MSTEST0037: Use \u0027Assert.AreEqual\u0027 instead of \u0027Assert.IsTrue\u0027"
+ }
+ ]
+ },
+ {
+ "DocumentId": {
+ "ProjectId": {
+ "Id": "09d3713c-65ba-4edc-825c-25bdd8365c7b"
+ },
+ "Id": "63aef27c-c033-4bfc-86bc-3b9c034490c1"
+ },
+ "FileName": "AdaptationTesting.cs",
+ "FilePath": "L:\\DevOps\\EAF-Mesa-Integration\\dep08cepiepsilon\\Adaptation\\_Tests\\Shared\\AdaptationTesting.cs",
+ "FileChanges": [
+ {
+ "LineNumber": 1268,
+ "CharNumber": 17,
+ "DiagnosticId": "MSTEST0037",
+ "FormatDescription": "error MSTEST0037: Use \u0027Assert.AreEqual\u0027 instead of \u0027Assert.IsTrue\u0027"
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/Adaptation/.vscode/tasks.json b/Adaptation/.vscode/tasks.json
index 0a0e079..11ce68d 100644
--- a/Adaptation/.vscode/tasks.json
+++ b/Adaptation/.vscode/tasks.json
@@ -92,6 +92,26 @@
"command": "code ../DEP08CEPIEPSILON.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/DEP08CEPIEPSILON",
+ "Day-Helper-2025-03-20",
+ "false",
+ "4"
+ ],
+ "problemMatcher": []
+ },
{
"label": "Git Config",
"type": "shell",
diff --git a/Adaptation/DEP08CEPIEPSILON.Tests.csproj b/Adaptation/DEP08CEPIEPSILON.Tests.csproj
index 5c5b13b..9e4ed5a 100644
--- a/Adaptation/DEP08CEPIEPSILON.Tests.csproj
+++ b/Adaptation/DEP08CEPIEPSILON.Tests.csproj
@@ -69,7 +69,7 @@
- NU1701
+ NU1701
diff --git a/Adaptation/FileHandlers/R32/FileRead.cs b/Adaptation/FileHandlers/R32/FileRead.cs
index 648e516..3b184c9 100644
--- a/Adaptation/FileHandlers/R32/FileRead.cs
+++ b/Adaptation/FileHandlers/R32/FileRead.cs
@@ -223,15 +223,15 @@ public class FileRead : Shared.FileRead, IFileRead
private Tuple> GetExtractResult(string reportFullPath, DateTime _)
{
Tuple> results;
- Tuple 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 descriptions = GetDuplicatorDescriptions(jsonElements);
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
MoveFile(reportFullPath);
- results = new Tuple>(pdsf.Item1, tests, jsonElements, new List());
+ results = new Tuple>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics[0]), tests, jsonElements, new List());
return results;
}
diff --git a/Adaptation/FileHandlers/R55/FileRead.cs b/Adaptation/FileHandlers/R55/FileRead.cs
index 5e064eb..54ecee0 100644
--- a/Adaptation/FileHandlers/R55/FileRead.cs
+++ b/Adaptation/FileHandlers/R55/FileRead.cs
@@ -223,15 +223,15 @@ public class FileRead : Shared.FileRead, IFileRead
private Tuple> GetExtractResult(string reportFullPath, DateTime _)
{
Tuple> results;
- Tuple 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 descriptions = GetDuplicatorDescriptions(jsonElements);
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
MoveFile(reportFullPath);
- results = new Tuple>(pdsf.Item1, tests, jsonElements, new List());
+ results = new Tuple>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics[0]), tests, jsonElements, new List());
return results;
}
diff --git a/Adaptation/FileHandlers/R57/FileRead.cs b/Adaptation/FileHandlers/R57/FileRead.cs
index a0d1262..4a87ee5 100644
--- a/Adaptation/FileHandlers/R57/FileRead.cs
+++ b/Adaptation/FileHandlers/R57/FileRead.cs
@@ -223,15 +223,15 @@ public class FileRead : Shared.FileRead, IFileRead
private Tuple> GetExtractResult(string reportFullPath, DateTime _)
{
Tuple> results;
- Tuple 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 descriptions = GetDuplicatorDescriptions(jsonElements);
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
MoveFile(reportFullPath);
- results = new Tuple>(pdsf.Item1, tests, jsonElements, new List());
+ results = new Tuple>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics[0]), tests, jsonElements, new List());
return results;
}
diff --git a/Adaptation/FileHandlers/R62/FileRead.cs b/Adaptation/FileHandlers/R62/FileRead.cs
index 34a1be6..700b99e 100644
--- a/Adaptation/FileHandlers/R62/FileRead.cs
+++ b/Adaptation/FileHandlers/R62/FileRead.cs
@@ -223,15 +223,15 @@ public class FileRead : Shared.FileRead, IFileRead
private Tuple> GetExtractResult(string reportFullPath, DateTime _)
{
Tuple> results;
- Tuple 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 descriptions = GetDuplicatorDescriptions(jsonElements);
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
MoveFile(reportFullPath);
- results = new Tuple>(pdsf.Item1, tests, jsonElements, new List());
+ results = new Tuple>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics[0]), tests, jsonElements, new List());
return results;
}
diff --git a/Adaptation/FileHandlers/R75/FileRead.cs b/Adaptation/FileHandlers/R75/FileRead.cs
index 3ca5c28..367593f 100644
--- a/Adaptation/FileHandlers/R75/FileRead.cs
+++ b/Adaptation/FileHandlers/R75/FileRead.cs
@@ -223,15 +223,15 @@ public class FileRead : Shared.FileRead, IFileRead
private Tuple> GetExtractResult(string reportFullPath, DateTime _)
{
Tuple> results;
- Tuple 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 descriptions = GetDuplicatorDescriptions(jsonElements);
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
MoveFile(reportFullPath);
- results = new Tuple>(pdsf.Item1, tests, jsonElements, new List());
+ results = new Tuple>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics[0]), tests, jsonElements, new List());
return results;
}
diff --git a/Adaptation/FileHandlers/R77/FileRead.cs b/Adaptation/FileHandlers/R77/FileRead.cs
index b0400ff..73cf25b 100644
--- a/Adaptation/FileHandlers/R77/FileRead.cs
+++ b/Adaptation/FileHandlers/R77/FileRead.cs
@@ -223,15 +223,15 @@ public class FileRead : Shared.FileRead, IFileRead
private Tuple> GetExtractResult(string reportFullPath, DateTime _)
{
Tuple> results;
- Tuple 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 descriptions = GetDuplicatorDescriptions(jsonElements);
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
MoveFile(reportFullPath);
- results = new Tuple>(pdsf.Item1, tests, jsonElements, new List());
+ results = new Tuple>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics[0]), tests, jsonElements, new List());
return results;
}
diff --git a/Adaptation/Shared/Duplicator/Description.cs b/Adaptation/Shared/Duplicator/Description.cs
index f725b29..964612e 100644
--- a/Adaptation/Shared/Duplicator/Description.cs
+++ b/Adaptation/Shared/Duplicator/Description.cs
@@ -12,7 +12,7 @@ public class Description : IDescription, Properties.IDescription
public int Test { get; set; }
public int Count { get; set; }
public int Index { get; set; }
- public string Lot { get; set; }
+ public string RDS { get; set; }
//
public string EventName { get; set; }
public string NullData { get; set; }
@@ -141,7 +141,7 @@ public class Description : IDescription, Properties.IDescription
MID = logistics.MID,
//
Date = DateTime.Now.ToString(GetDateFormat()),
- Lot = string.Empty,
+ RDS = string.Empty,
};
results.Add(description);
}
diff --git a/Adaptation/Shared/FileRead.cs b/Adaptation/Shared/FileRead.cs
index 4b6f3fc..7c2fe14 100644
--- a/Adaptation/Shared/FileRead.cs
+++ b/Adaptation/Shared/FileRead.cs
@@ -63,203 +63,6 @@ public class FileRead : Properties.IFileRead
string Properties.IFileRead.CellInstanceConnectionName => _CellInstanceConnectionName;
string Properties.IFileRead.ParameterizedModelObjectDefinitionType => _ParameterizedModelObjectDefinitionType;
- public FileRead(IDescription description, bool isEvent, ISMTP smtp, Dictionary fileParameter, string cellInstanceName, int? connectionCount, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList modelObjectParameters, string equipmentDictionaryName, Dictionary> dummyRuns, Dictionary> staticRuns, bool useCyclicalForDescription, bool isEAFHosted)
- {
- _SMTP = smtp;
- _IsEvent = isEvent;
- _DummyRuns = dummyRuns;
- _LastTicksDuration = 0;
- _StaticRuns = staticRuns;
- _IsEAFHosted = isEAFHosted;
- _Description = description;
- _FileParameter = fileParameter;
- _ReportFullPath = string.Empty;
- _CellInstanceName = cellInstanceName;
- _Calendar = new CultureInfo("en-US").Calendar;
- _Log = LogManager.GetLogger(typeof(FileRead));
- _UseCyclicalForDescription = useCyclicalForDescription;
- _CellInstanceConnectionName = cellInstanceConnectionName;
- _ModelObjectParameterDefinitions = modelObjectParameters;
- _FileConnectorConfiguration = fileConnectorConfiguration;
- _ParameterizedModelObjectDefinitionType = parameterizedModelObjectDefinitionType;
- _IsSourceTimer = fileConnectorConfiguration.SourceFileFilter.StartsWith("*Timer.txt");
- string cellInstanceConnectionNameBase = cellInstanceConnectionName.Replace("-", string.Empty);
- _Hyphens = cellInstanceConnectionName.Length - cellInstanceConnectionNameBase.Length;
- _TracePath = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "Path.Trace");
- _ExceptionSubject = string.Concat("Exception:", _CellInstanceConnectionName, _FileConnectorConfiguration?.SourceDirectoryCloaking);
- string suffix;
- string[] segments = _ParameterizedModelObjectDefinitionType.Split('.');
- string @namespace = segments[0];
- string eventNameFileRead = "FileRead";
- string eventName = segments[segments.Length - 1];
- bool isDuplicator = segments[0] == cellInstanceName;
- _IsDuplicator = isDuplicator;
- _CellInstanceConnectionNameBase = cellInstanceConnectionNameBase;
- if (eventName == eventNameFileRead)
- suffix = string.Empty;
- else
- suffix = string.Concat('_', eventName.Split(new string[] { eventNameFileRead }, StringSplitOptions.RemoveEmptyEntries)[1]);
- string parameterizedModelObjectDefinitionTypeAppended = string.Concat(@namespace, suffix);
- if (!isEAFHosted)
- {
- if (string.IsNullOrEmpty(equipmentTypeName) || equipmentTypeName != parameterizedModelObjectDefinitionTypeAppended)
- throw new Exception(cellInstanceConnectionName);
- if (string.IsNullOrEmpty(equipmentDictionaryName) && isEvent)
- throw new Exception(cellInstanceConnectionName);
- if (!string.IsNullOrEmpty(equipmentDictionaryName) && !isEvent && connectionCount > 1)
- throw new Exception(cellInstanceConnectionName);
- // if (string.IsNullOrEmpty(equipmentDictionaryName) && !isEvent)
- // throw new Exception(cellInstanceConnectionName);
- // if (!string.IsNullOrEmpty(equipmentDictionaryName) && isEvent)
- // throw new Exception(cellInstanceConnectionName);
- }
- if (isDuplicator)
- _MesEntity = string.Empty;
- else
- _MesEntity = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, string.Concat("CellInstance.", cellInstanceName, ".Alias"));
- _EventName = eventName;
- _EventNameFileRead = eventNameFileRead;
- _EquipmentType = parameterizedModelObjectDefinitionTypeAppended;
- long breakAfterSeconds;
- if (_FileConnectorConfiguration is null)
- breakAfterSeconds = 360;
- else
- {
- if (_FileConnectorConfiguration.FileScanningOption == FileConnectorConfiguration.FileScanningOptionEnum.TimeBased)
- breakAfterSeconds = Math.Abs(_FileConnectorConfiguration.FileHandleTimeout.Value);
- else if (_FileConnectorConfiguration.FileScanningOption == FileConnectorConfiguration.FileScanningOptionEnum.FileWatcher)
- breakAfterSeconds = Math.Abs(_FileConnectorConfiguration.FileScanningIntervalInSeconds.Value);
- else
- throw new Exception();
- }
- _BreakAfterSeconds = breakAfterSeconds;
- UpdateLastTicksDuration(breakAfterSeconds * 10000000);
- if (_IsDuplicator)
- {
- if (string.IsNullOrEmpty(_FileConnectorConfiguration.TargetFileLocation) || string.IsNullOrEmpty(_FileConnectorConfiguration.ErrorTargetFileLocation))
- throw new Exception("_Configuration is empty?");
- if (_FileConnectorConfiguration.TargetFileLocation.Contains('%') || _FileConnectorConfiguration.ErrorTargetFileLocation.Contains('%'))
- throw new Exception("_Configuration is incorrect for a duplicator!");
- // if (_FileConnectorConfiguration is not null)
- // {
- // if (string.IsNullOrEmpty(_FileConnectorConfiguration.SourceDirectoryCloaking))
- // throw new Exception("SourceDirectoryCloaking is empty?");
- // if (!_FileConnectorConfiguration.SourceDirectoryCloaking.StartsWith("~"))
- // throw new Exception("SourceDirectoryCloaking is incorrect for a duplicator!");
- // }
- }
- }
-
- protected static string GetPropertyValue(string cellInstanceConnectionName, IList modelObjectParameters, string propertyName)
- {
- string result;
- List results = (from l in modelObjectParameters where l.Name == propertyName select l.Value).ToList();
- if (results.Count != 1)
- throw new Exception(cellInstanceConnectionName);
- result = results[0];
- return result;
- }
-
- protected static ModelObjectParameterDefinition[] GetProperties(string cellInstanceConnectionName, IList modelObjectParameters, string propertyNamePrefix)
- {
- ModelObjectParameterDefinition[] results = (from l in modelObjectParameters where l.Name.StartsWith(propertyNamePrefix) select l).ToArray();
- if (results.Length == 0)
- throw new Exception(cellInstanceConnectionName);
- return results;
- }
-
- protected static ModelObjectParameterDefinition[] GetProperties(string cellInstanceConnectionName, IList 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.Length == 0)
- throw new Exception(cellInstanceConnectionName);
- return results;
- }
-
- 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}>");
- }
-
- protected void WaitForThread(Thread thread, List threadExceptions)
- {
- if (thread is not null)
- {
- ThreadState threadState;
- for (short i = 0; i < short.MaxValue; i++)
- {
- if (thread is null)
- break;
- else
- {
- threadState = thread.ThreadState;
- if (threadState is not ThreadState.Running and not ThreadState.WaitSleepJoin)
- break;
- }
- Thread.Sleep(500);
- }
- lock (threadExceptions)
- {
- if (threadExceptions.Count != 0)
- {
- foreach (Exception item in threadExceptions)
- _Log.Error(string.Concat(item.Message, Environment.NewLine, Environment.NewLine, item.StackTrace));
- Exception exception = threadExceptions[0];
- threadExceptions.Clear();
- throw exception;
- }
- }
- }
- }
-
- 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> 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();
- 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.Count != 0)
- {
- string itemFile;
- List 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(Logistics logistics, List descriptions, Properties.IScopeInfo scopeInfo, string duplicateDirectory, string duplicateFile) where T : Properties.IDescription
{
string result;
@@ -268,10 +71,10 @@ public class FileRead : Properties.IFileRead
string dateValue;
string rdsPlaceholder = "%RDS%";
string mesEntityPlaceholder = "%MesEntity%";
- if (descriptions.Count == 0 || string.IsNullOrEmpty(descriptions[0].Lot))
+ if (descriptions.Count == 0 || string.IsNullOrEmpty(descriptions[0].RDS))
rds = logistics.MID;
else
- rds = descriptions[0].Lot;
+ 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));
@@ -384,217 +187,131 @@ public class FileRead : Properties.IFileRead
}
}
- protected void SetFileParameter(string key, string value)
+ protected void WaitForFileConsumption(DateTime dateTime, List descriptions, bool isDummyRun, string successDirectory, string duplicateDirectory, List<(Properties.IScopeInfo, string)> collection, string duplicateFile) where T : Properties.IDescription
{
- 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";
+ if (!isDummyRun && _IsEAFHosted)
+ WaitForFileConsumption(_FileConnectorConfiguration.SourceDirectoryCloaking, _Logistics, dateTime, descriptions, successDirectory, duplicateDirectory, duplicateFile, collection);
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;
- string weekOfYear = _Calendar.GetWeekOfYear(_Logistics.DateTimeFromSequence, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00");
- string weekDirectory = $"{_Logistics.DateTimeFromSequence:yyyy}_Week_{weekOfYear}{@"\"}{_Logistics.DateTimeFromSequence:yyyy-MM-dd}";
- if (!_CellInstanceConnectionName.StartsWith(_CellInstanceName) && _CellInstanceConnectionNameBase == _EquipmentType)
- directory = Path.Combine(_TracePath, _EquipmentType, "Target", weekDirectory, _CellInstanceName, _CellInstanceConnectionName);
- else
- directory = Path.Combine(_TracePath, _EquipmentType, "Source", weekDirectory, _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> extractResults)
- {
- if (!_IsEAFHosted)
- {
- string to;
- if (!_FileConnectorConfiguration.TargetFileLocation.EndsWith(Path.DirectorySeparatorChar.ToString()))
- to = _FileConnectorConfiguration.TargetFileLocation;
- else
- to = Path.GetDirectoryName(_FileConnectorConfiguration.TargetFileLocation);
- foreach (KeyValuePair keyValuePair in _FileParameter)
- to = to.Replace(string.Concat('%', keyValuePair.Key, '%'), keyValuePair.Value);
- if (to.Contains('%'))
- _Log.Debug("Can't debug without EAF Hosting");
- else
- _ = Move(extractResults, to, _FileConnectorConfiguration.SourceFileLocation, resolvedFileLocation: string.Empty, exception: null);
- }
- }
-
- protected void TriggerEvents(Tuple> extractResults, List headerNames, Dictionary keyValuePairs)
- {
- object value;
- string segments;
- string description;
- List