MET08THFTIRSTRATUS - v2.39.0 - DevOps Dummy Update references

This commit is contained in:
2022-03-02 09:10:44 -07:00
parent ccdd157450
commit 524afe5639
11 changed files with 30 additions and 192 deletions

View File

@ -220,61 +220,47 @@ public class FileRead : Shared.FileRead, IFileRead
{ {
try try
{ {
string pathSegment; string sourceParentDirectory;
string monARessource; string targetParentDirectory;
DateTime dateTime = DateTime.Now; DateTime dateTime = DateTime.Now;
if (!_FileConnectorConfiguration.TargetFileLocation.Contains(_FileConnectorConfiguration.SourceFileLocation)) if (!string.IsNullOrEmpty(Path.GetFileName(_FileConnectorConfiguration.SourceFileLocation)))
throw new Exception("Target must start with source"); sourceParentDirectory = Path.GetDirectoryName(_FileConnectorConfiguration.SourceFileLocation);
else
sourceParentDirectory = Path.GetDirectoryName(Path.GetDirectoryName(_FileConnectorConfiguration.SourceFileLocation));
if (!string.IsNullOrEmpty(Path.GetFileName(_FileConnectorConfiguration.TargetFileLocation)))
targetParentDirectory = Path.GetDirectoryName(_FileConnectorConfiguration.TargetFileLocation);
else
targetParentDirectory = Path.GetDirectoryName(Path.GetDirectoryName(_FileConnectorConfiguration.TargetFileLocation));
if (sourceParentDirectory != targetParentDirectory)
throw new Exception("Target and source must have the same parent for Si Dummy FileConnectorConfiguration!");
bool check = dateTime.Hour > 7 && dateTime.Hour < 18 && dateTime.DayOfWeek != DayOfWeek.Sunday && dateTime.DayOfWeek != DayOfWeek.Saturday; bool check = dateTime.Hour > 7 && dateTime.Hour < 18 && dateTime.DayOfWeek != DayOfWeek.Sunday && dateTime.DayOfWeek != DayOfWeek.Saturday;
if (!_IsEAFHosted || check) if (!_IsEAFHosted || check)
{ {
string checkSegment; string monARessource;
string checkDirectory;
string sourceFileFilter; string sourceFileFilter;
string sourceArchiveFile; string sourceArchiveFile;
string sourceFileLocation;
string weekOfYear = _Calendar.GetWeekOfYear(dateTime, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00"); string weekOfYear = _Calendar.GetWeekOfYear(dateTime, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00");
string traceDummyDirectory = Path.Combine(Path.GetPathRoot(_TracePath), "TracesDummy", _CellInstanceName, "Source", $"{dateTime:yyyy}___Week_{weekOfYear}"); string traceDummyDirectory = Path.Combine(Path.GetPathRoot(_TracePath), "TracesDummy", _CellInstanceName, "Source", $"{dateTime:yyyy}___Week_{weekOfYear}");
if (!Directory.Exists(traceDummyDirectory)) if (!Directory.Exists(traceDummyDirectory))
_ = Directory.CreateDirectory(traceDummyDirectory); _ = Directory.CreateDirectory(traceDummyDirectory);
string traceDummyFile = Path.Combine(traceDummyDirectory, $"{dateTime.Ticks} - {_CellInstanceName}.txt"); string traceDummyFile = Path.Combine(traceDummyDirectory, $"{dateTime.Ticks} - {_CellInstanceName}.txt");
File.AppendAllText(traceDummyFile, string.Empty); File.AppendAllText(traceDummyFile, string.Empty);
if (_FileConnectorConfiguration.SourceFileLocation.EndsWith("\\"))
sourceFileLocation = _FileConnectorConfiguration.SourceFileLocation;
else
sourceFileLocation = string.Concat(_FileConnectorConfiguration.SourceFileLocation, '\\');
for (int i = 0; i < _FileConnectorConfiguration.SourceFileFilters.Count; i++) for (int i = 0; i < _FileConnectorConfiguration.SourceFileFilters.Count; i++)
{ {
_LastDummyRunIndex += 1; _LastDummyRunIndex += 1;
if (_LastDummyRunIndex >= _FileConnectorConfiguration.SourceFileFilters.Count) if (_LastDummyRunIndex >= _FileConnectorConfiguration.SourceFileFilters.Count)
_LastDummyRunIndex = 0; _LastDummyRunIndex = 0;
sourceFileFilter = _FileConnectorConfiguration.SourceFileFilters[_LastDummyRunIndex]; sourceFileFilter = _FileConnectorConfiguration.SourceFileFilters[_LastDummyRunIndex];
sourceArchiveFile = Path.GetFullPath(string.Concat(sourceFileLocation, sourceFileFilter)); sourceArchiveFile = Path.Combine(_FileConnectorConfiguration.SourceFileLocation, sourceFileFilter);
if (File.Exists(sourceArchiveFile)) if (File.Exists(sourceArchiveFile))
{ {
checkSegment = _FileConnectorConfiguration.TargetFileLocation.Substring(sourceFileLocation.Length);
checkDirectory = Path.GetDirectoryName(sourceArchiveFile);
for (int z = 0; z < int.MaxValue; z++)
{
if (checkDirectory.Length < sourceFileLocation.Length || !checkDirectory.StartsWith(sourceFileLocation))
break;
checkDirectory = Path.GetDirectoryName(checkDirectory);
if (Directory.Exists(Path.Combine(checkDirectory, checkSegment)))
{
checkDirectory = Path.Combine(checkDirectory, checkSegment);
break;
}
}
if (!checkDirectory.EndsWith(checkSegment))
throw new Exception("Could not determine dummy target directory for extract!");
if (!long.TryParse(Path.GetFileNameWithoutExtension(sourceArchiveFile).Replace("x", string.Empty), out long sequence)) if (!long.TryParse(Path.GetFileNameWithoutExtension(sourceArchiveFile).Replace("x", string.Empty), out long sequence))
throw new Exception("Invalid file name for source archive file!"); throw new Exception("Invalid file name for source archive file!");
pathSegment = checkDirectory.Substring(sourceFileLocation.Length); monARessource = GetCellName(sourceArchiveFile);
monARessource = GetCellName(pathSegment);
if (string.IsNullOrEmpty(monARessource)) if (string.IsNullOrEmpty(monARessource))
throw new Exception("Could not determine which cell archive file is associated with!"); throw new Exception("Could not determine which cell archive file is associated with!");
if (_IsEAFHosted) if (_IsEAFHosted)
CallbackFileExists(sourceArchiveFile, traceDummyFile, checkDirectory, monARessource, sequence); CallbackFileExists(sourceArchiveFile, traceDummyFile, _FileConnectorConfiguration.TargetFileLocation, monARessource, sequence);
break; break;
} }
} }

View File

@ -289,123 +289,4 @@ public class FileRead : Shared.FileRead, IFileRead
return results; return results;
} }
private void CallbackIsDummy(string traceDummyFile, List<Tuple<string, string, string, string, int>> tuples, bool fileConnectorConfigurationIncludeSubDirectories, bool includeSubDirectoriesExtra)
{}
private void Callback(object state)
{
if (!_IsDummy)
throw new Exception();
try
{
DateTime dateTime = DateTime.Now;
bool check = dateTime.Hour > 7 && dateTime.Hour < 18 && dateTime.DayOfWeek != DayOfWeek.Sunday && dateTime.DayOfWeek != DayOfWeek.Saturday;
if (check)
{
int fileCount;
string[] files;
string monARessource;
string checkDirectory;
string sourceArchiveFile;
string sourceFileLocation;
string inProcessDirectory;
string weekOfYear = _Calendar.GetWeekOfYear(dateTime, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00");
string traceDummyDirectory = string.Concat(Path.GetPathRoot(_TracePath), @"\TracesDummy\", _CellInstanceName, @"\Source\", dateTime.ToString("yyyy"), "___Week_", weekOfYear);
if (!Directory.Exists(traceDummyDirectory))
_ = Directory.CreateDirectory(traceDummyDirectory);
string traceDummyFile = string.Concat(traceDummyDirectory, @"\", dateTime.Ticks, " - ", _CellInstanceName, ".txt");
File.AppendAllText(traceDummyFile, string.Empty);
List<Tuple<string, string, string, string, int>> tuples = new();
string progressDirectory = Path.GetFullPath(string.Concat(_FileConnectorConfiguration.SourceFileLocation, @"\_ Progress"));
if (progressDirectory != _ProgressPath || !Directory.Exists(progressDirectory))
throw new Exception("Invalid progress path");
foreach (KeyValuePair<string, string> keyValuePair in _CellNames)
{
monARessource = keyValuePair.Key;
if (!keyValuePair.Value.Contains(@"\"))
continue;
foreach (string sourceFileFilter in _FileConnectorConfiguration.SourceFileFilter.Split('|'))
{
if (sourceFileFilter.ToLower().StartsWith(keyValuePair.Value.Replace(@"\", string.Empty)))
sourceFileLocation = Path.GetFullPath(_FileConnectorConfiguration.SourceFileLocation);
else if (_FileConnectorConfiguration.SourceFileLocation.ToLower().EndsWith(keyValuePair.Value))
sourceFileLocation = Path.GetFullPath(_FileConnectorConfiguration.SourceFileLocation);
else
sourceFileLocation = Path.GetFullPath(string.Concat(_FileConnectorConfiguration.SourceFileLocation, @"\", keyValuePair.Value));
sourceArchiveFile = Path.GetFullPath(string.Concat(sourceFileLocation, @"\", sourceFileFilter));
if (!File.Exists(sourceArchiveFile))
continue;
if (!_DummyRuns.ContainsKey(monARessource))
_DummyRuns.Add(monARessource, new List<long>());
tuples.Add(new Tuple<string, string, string, string, int>(monARessource, sourceFileFilter, sourceFileLocation, sourceArchiveFile, 0));
}
}
File.AppendAllLines(traceDummyFile, from l in tuples select l.Item4);
if (tuples.Any())
{
_LastDummyRunIndex += 1;
if (_LastDummyRunIndex >= tuples.Count)
_LastDummyRunIndex = 0;
monARessource = tuples[_LastDummyRunIndex].Item1;
string sourceFileFilter = tuples[_LastDummyRunIndex].Item2;
sourceFileLocation = tuples[_LastDummyRunIndex].Item3;
sourceArchiveFile = tuples[_LastDummyRunIndex].Item4;
//fileCount = tuples[_LastDummyRunIndex].Item5;
tuples.Clear();
if (long.TryParse(Path.GetFileNameWithoutExtension(sourceArchiveFile).Replace("x", string.Empty), out long sequence))
{
if (!_DummyRuns[monARessource].Contains(sequence))
_DummyRuns[monARessource].Add(sequence);
inProcessDirectory = string.Concat(progressDirectory, @"\Dummy_in process\", sequence);
checkDirectory = inProcessDirectory;
if (!Directory.Exists(checkDirectory))
_ = Directory.CreateDirectory(checkDirectory);
files = Directory.GetFiles(checkDirectory, "*", SearchOption.AllDirectories);
fileCount = files.Length;
if (files.Any())
{
if (files.Length > 250)
throw new Exception("Safety net!");
try
{
foreach (string file in files)
File.Delete(file);
}
catch (Exception) { }
}
tuples.Add(new Tuple<string, string, string, string, int>(monARessource, sourceArchiveFile, inProcessDirectory, checkDirectory, fileCount));
checkDirectory = sourceFileLocation;
files = Directory.GetFiles(checkDirectory, string.Concat("*", sequence, "*"), SearchOption.TopDirectoryOnly);
fileCount = files.Length;
tuples.Add(new Tuple<string, string, string, string, int>(monARessource, sourceArchiveFile, inProcessDirectory, checkDirectory, fileCount));
}
}
if (tuples.Any())
//CallbackIsDummy(traceDummyFile, tuples, FileConnectorConfiguration.IncludeSubDirectories.Value, includeSubDirectoriesExtra: false);
CallbackIsDummy(traceDummyFile, tuples, fileConnectorConfigurationIncludeSubDirectories: true, includeSubDirectoriesExtra: true);
}
}
catch (Exception exception)
{
string subject = string.Concat("Exception:", _CellInstanceConnectionName);
string body = string.Concat(exception.Message, Environment.NewLine, Environment.NewLine, exception.StackTrace);
try
{ _SMTP.SendHighPriorityEmailMessage(subject, body); }
catch (Exception) { }
}
try
{
TimeSpan timeSpan = new(DateTime.Now.AddSeconds(_FileConnectorConfiguration.FileScanningIntervalInSeconds.Value).Ticks - DateTime.Now.Ticks);
_ = _Timer.Change((long)timeSpan.TotalMilliseconds, Timeout.Infinite);
}
catch (Exception exception)
{
string subject = string.Concat("Exception:", _CellInstanceConnectionName);
string body = string.Concat(exception.Message, Environment.NewLine, Environment.NewLine, exception.StackTrace);
try
{ _SMTP.SendHighPriorityEmailMessage(subject, body); }
catch (Exception) { }
}
}
} }

View File

@ -113,9 +113,9 @@ public class FileRead : Shared.FileRead, IFileRead
{ {
if (dateTime == DateTime.MinValue) if (dateTime == DateTime.MinValue)
{ } { }
Tuple<string, Test[], JsonElement[], List<FileInfo>> results = new(string.Empty, null, null, new List<FileInfo>()); Tuple<string, Test[], JsonElement[], List<FileInfo>> results = new(string.Empty, null, null, new List<FileInfo>());
Tuple<string, string[], string[]> pdsf = ProcessDataStandardFormat.GetLogisticsColumnsAndBody(reportFullPath); Tuple<string, string[], string[]> pdsf = ProcessDataStandardFormat.GetLogisticsColumnsAndBody(reportFullPath);
_Logistics = new Logistics(reportFullPath, pdsf.Item1); _Logistics = new Logistics(reportFullPath, pdsf.Item1);
SetFileParameterLotIDToLogisticsMID(); SetFileParameterLotIDToLogisticsMID();
return results; return results;
} }

View File

@ -6,6 +6,10 @@
<SccLocalPath>SAK</SccLocalPath> <SccLocalPath>SAK</SccLocalPath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>10.0</LangVersion>
<Nullable>disable</Nullable>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
</PropertyGroup> </PropertyGroup>

View File

@ -80,9 +80,4 @@ public class BIORAD4 : EAFLoggingUnitTesting
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
} }
} }
// dotnet build --runtime win-x64
// dotnet test --runtime win-x64 --no-build --filter "FullyQualifiedName~_Tests.CreateSelfDescription.Staging.v2_36_3" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\")
// dotnet test --runtime win-x64 --no-build --filter "FullyQualifiedName~_Tests.CreateSelfDescription.Staging.v2_36_3 & ClassName~BIORAD4" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\")
// dotnet test --runtime win-x64 --no-build --filter "FullyQualifiedName~_Tests.CreateSelfDescription.Staging.v2_36_3 & ClassName~BIORAD4 & Staging__v2_36_3__BIORAD4__QS408M" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\")

View File

@ -80,9 +80,4 @@ public class BIORAD5 : EAFLoggingUnitTesting
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
} }
} }
// dotnet build --runtime win-x64
// dotnet test --runtime win-x64 --no-build --filter "FullyQualifiedName~_Tests.CreateSelfDescription.Staging.v2_36_3" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\")
// dotnet test --runtime win-x64 --no-build --filter "FullyQualifiedName~_Tests.CreateSelfDescription.Staging.v2_36_3 & ClassName~BIORAD5" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\")
// dotnet test --runtime win-x64 --no-build --filter "FullyQualifiedName~_Tests.CreateSelfDescription.Staging.v2_36_3 & ClassName~BIORAD5 & Staging__v2_36_3__BIORAD5__QS408M" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\")

View File

@ -138,9 +138,4 @@ public class MET08THFTIRSTRATUS : EAFLoggingUnitTesting
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
} }
} }
// dotnet build --runtime win-x64
// dotnet test --runtime win-x64 --no-build --filter "FullyQualifiedName~_Tests.CreateSelfDescription.Staging.v2_36_3" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\")
// dotnet test --runtime win-x64 --no-build --filter "FullyQualifiedName~_Tests.CreateSelfDescription.Staging.v2_36_3 & ClassName~MET08THFTIRSTRATUS" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\")
// dotnet test --runtime win-x64 --no-build --filter "FullyQualifiedName~_Tests.CreateSelfDescription.Staging.v2_36_3 & ClassName~MET08THFTIRSTRATUS & Staging__v2_36_3__MET08THFTIRSTRATUS__MET08THFTIRSTRATUS________" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\")

View File

@ -106,12 +106,4 @@ public class BIORAD4
[TestMethod] [TestMethod]
public void Staging__v2_36_3__BIORAD4__QS408M() => _BIORAD4.Staging__v2_36_3__BIORAD4__QS408M(); public void Staging__v2_36_3__BIORAD4__QS408M() => _BIORAD4.Staging__v2_36_3__BIORAD4__QS408M();
} }
// dotnet build --runtime win-x64
// dotnet test --runtime win-x64 --no-build --filter "FullyQualifiedName~_Tests.Extract.Staging.v2_36_3" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\")
// dotnet test --runtime win-x64 --no-build --filter "FullyQualifiedName~_Tests.Extract.Staging.v2_36_3 & ClassName~BIORAD4" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\")
// dotnet test --runtime win-x64 --no-build --filter "FullyQualifiedName~_Tests.Extract.Staging.v2_36_3 & ClassName~BIORAD4 & Staging__v2_36_3__BIORAD4__QS408M" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\")
// dotnet test --runtime win-x64 --no-build --filter "FullyQualifiedName~_Tests.Extract.Staging.v2_36_3 & ClassName~BIORAD4 & Staging__v2_36_3__BIORAD4__txt637730081979221342__Normal" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\")
// dotnet test --runtime win-x64 --no-build --filter "FullyQualifiedName~_Tests.Extract.Staging.v2_36_3 & ClassName~BIORAD4 & Staging__v2_36_3__BIORAD4__Stratus637733400573863329__ReactorAndRDS" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\")
//

View File

@ -52,9 +52,4 @@ public class BIORAD5
[TestMethod] [TestMethod]
public void Staging__v2_36_3__BIORAD5__QS408M() => _BIORAD5.Staging__v2_36_3__BIORAD5__QS408M(); public void Staging__v2_36_3__BIORAD5__QS408M() => _BIORAD5.Staging__v2_36_3__BIORAD5__QS408M();
} }
// dotnet build --runtime win-x64
// dotnet test --runtime win-x64 --no-build --filter "FullyQualifiedName~_Tests.Extract.Staging.v2_36_3" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\")
// dotnet test --runtime win-x64 --no-build --filter "FullyQualifiedName~_Tests.Extract.Staging.v2_36_3 & ClassName~BIORAD5" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\")
// dotnet test --runtime win-x64 --no-build --filter "FullyQualifiedName~_Tests.Extract.Staging.v2_36_3 & ClassName~BIORAD5 & Staging__v2_36_3__BIORAD5__Stratus637738592809956919__ReactorAndRDS" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\")

View File

@ -83,9 +83,4 @@ public class MET08THFTIRSTRATUS
[TestMethod] [TestMethod]
public void Staging__v2_36_3__MET08THFTIRSTRATUS__MET08THFTIRSTRATUS________() => _MET08THFTIRSTRATUS.Staging__v2_36_3__MET08THFTIRSTRATUS__MET08THFTIRSTRATUS________(); public void Staging__v2_36_3__MET08THFTIRSTRATUS__MET08THFTIRSTRATUS________() => _MET08THFTIRSTRATUS.Staging__v2_36_3__MET08THFTIRSTRATUS__MET08THFTIRSTRATUS________();
} }
// dotnet build --runtime win-x64
// dotnet test --runtime win-x64 --no-build --filter "FullyQualifiedName~_Tests.Extract.Staging.v2_36_3" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\")
// dotnet test --runtime win-x64 --no-build --filter "FullyQualifiedName~_Tests.Extract.Staging.v2_36_3 & ClassName~MET08THFTIRSTRATUS" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\")
// dotnet test --runtime win-x64 --no-build --filter "FullyQualifiedName~_Tests.Extract.Staging.v2_36_3 & ClassName~MET08THFTIRSTRATUS & Staging__v2_36_3__MET08THFTIRSTRATUS__MET08THFTIRSTRATUS___637745411457972777__First" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\")

View File

@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MET08THFTIRSTRATUS</RootNamespace> <RootNamespace>MET08THFTIRSTRATUS</RootNamespace>
<AssemblyName>MET08THFTIRSTRATUS</AssemblyName> <AssemblyName>MET08THFTIRSTRATUS</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<SccProjectName>SAK</SccProjectName> <SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath> <SccLocalPath>SAK</SccLocalPath>
@ -152,7 +152,7 @@
<Version>7.2.4630.5</Version> <Version>7.2.4630.5</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Infineon.EAF.Runtime"> <PackageReference Include="Infineon.EAF.Runtime">
<Version>2.36.0</Version> <Version>2.39.0</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Pdfbox"> <PackageReference Include="Pdfbox">
<Version>1.1.1</Version> <Version>1.1.1</Version>