Added 1-14 columns back

Removed WriteFirstLineTabSeparatedValuesFile
Removed Open Insight API IFX Directory
This commit is contained in:
Mike Phares 2024-01-10 10:53:04 -07:00
parent 426bb3ede9
commit ad3f5ff20d
3 changed files with 46 additions and 37 deletions

View File

@ -103,36 +103,6 @@ public class FileRead : Shared.FileRead, IFileRead
return results;
}
private void WriteFirstLineTabSeparatedValuesFile<T>(string reportFullPath, DateTime dateTime, List<T> descriptions, string[] pdsfColumns, string[] pdsfBodyLines) where T : Shared.Properties.IDescription
{
string[] segments;
bool isDummyRun = false;
string successDirectory = string.Empty;
string[] firstLine = pdsfBodyLines[0].Split('\t');
List<(Shared.Properties.IScopeInfo, string)> collection = new();
foreach (string line in pdsfBodyLines)
{
segments = line.Split('\t');
if (segments.Length != firstLine.Length)
continue;
for (int i = 0; i < segments.Length; i++)
{
if (string.IsNullOrEmpty(segments[i]))
continue;
if (segments[i] == firstLine[i])
continue;
firstLine[i] = string.Empty;
}
}
string duplicateDirectory = Path.Combine(_FileConnectorConfiguration.SourceFileLocation, _CellInstanceName);
if (!Directory.Exists(duplicateDirectory))
_ = Directory.CreateDirectory(duplicateDirectory);
string duplicateFile = Path.Combine(duplicateDirectory, $"{Path.GetFileName(reportFullPath)}.tsv");
string[] lines = new string[] { string.Join("\t", pdsfColumns), string.Join("\t", firstLine) };
File.WriteAllLines(duplicateFile, lines);
WaitForFileConsumption(dateTime, descriptions, isDummyRun, successDirectory, duplicateDirectory, collection, duplicateFile);
}
private void FileCopy<T>(string reportFullPath, DateTime dateTime, List<T> descriptions) where T : Shared.Properties.IDescription
{
bool isDummyRun = false;
@ -156,11 +126,7 @@ public class FileRead : Shared.FileRead, IFileRead
List<Shared.Properties.IDescription> descriptions = GetDuplicatorDescriptions(jsonElements);
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
{
if (tests.Length > 0)
WriteFirstLineTabSeparatedValuesFile(reportFullPath, dateTime, descriptions, pdsf.Item2, pdsf.Item3);
FileCopy(reportFullPath, dateTime, descriptions);
}
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(pdsf.Item1, tests, jsonElements, new List<FileInfo>());
return results;
}

View File

@ -20,7 +20,6 @@ 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) :
base(new Description(), false, smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null)
@ -34,7 +33,6 @@ public class FileRead : Shared.FileRead, IFileRead
throw new Exception(cellInstanceConnectionName);
if (!_IsDuplicator)
throw new Exception(cellInstanceConnectionName);
_OpenInsightApiIFXDirectory = @"\\messdv002.na.infineon.com\Candela\Archive\API";
_OpenInsightApiECDirectory = @"\\mesfs.infineon.com\EC_Metrology_Si\Archive\API";
_IqsConnectionString = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "IQS.ConnectionString");
_OpenInsightFilePattern = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "OpenInsight.FilePattern");
@ -162,6 +160,7 @@ public class FileRead : Shared.FileRead, IFileRead
if (!string.IsNullOrEmpty(lines))
{
long? subGroupId;
string openInsightApiIFXDirectory = string.Empty;
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))
@ -173,7 +172,7 @@ public class FileRead : Shared.FileRead, IFileRead
else
collection.Add(new(new ScopeInfo(tests[0], $"{subGroupId.Value} {_OpenInsightFilePattern}"), lines));
string weekOfYear = _Calendar.GetWeekOfYear(_Logistics.DateTimeFromSequence, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00");
FromIQS.Save(_OpenInsightApiECDirectory, _OpenInsightApiIFXDirectory, _Logistics, reportFullPath, logistics, descriptions.First(), lines, subGroupId, weekOfYear);
FromIQS.Save(_OpenInsightApiECDirectory, openInsightApiIFXDirectory, _Logistics, reportFullPath, logistics, descriptions.First(), lines, subGroupId, weekOfYear);
}
}
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)

View File

@ -55,6 +55,21 @@ public class Description : IDescription, Shared.Properties.IDescription
public string ThicknessFourteenCriticalPointsAverage { get; set; }
public string ThicknessFourteenCriticalPointsStdDev { get; set; }
public string ThicknessFourteenMeanFrom { get; set; }
//
public string Thickness01 { get; set; }
public string Thickness02 { get; set; }
public string Thickness03 { get; set; }
public string Thickness04 { get; set; }
public string Thickness05 { get; set; }
public string Thickness06 { get; set; }
public string Thickness07 { get; set; }
public string Thickness08 { get; set; }
public string Thickness09 { get; set; }
public string Thickness10 { get; set; }
public string Thickness11 { get; set; }
public string Thickness12 { get; set; }
public string Thickness13 { get; set; }
public string Thickness14 { get; set; }
string IDescription.GetEventDescription() => "File Has been read and parsed";
@ -239,6 +254,20 @@ public class Description : IDescription, Shared.Properties.IDescription
ThicknessFourteenCriticalPointsAverage = processData.ThicknessFourteenCriticalPointsAverage,
ThicknessFourteenCriticalPointsStdDev = processData.ThicknessFourteenCriticalPointsStdDev,
ThicknessFourteenMeanFrom = processData.ThicknessFourteenMeanFrom,
Thickness01 = iProcessData.Details.Count < 1 || iProcessData.Details[0] is not Detail thickness01 ? string.Empty : thickness01.Thickness,
Thickness02 = iProcessData.Details.Count < 2 || iProcessData.Details[1] is not Detail thickness02 ? string.Empty : thickness02.Thickness,
Thickness03 = iProcessData.Details.Count < 3 || iProcessData.Details[2] is not Detail thickness03 ? string.Empty : thickness03.Thickness,
Thickness04 = iProcessData.Details.Count < 4 || iProcessData.Details[3] is not Detail thickness04 ? string.Empty : thickness04.Thickness,
Thickness05 = iProcessData.Details.Count < 5 || iProcessData.Details[4] is not Detail thickness05 ? string.Empty : thickness05.Thickness,
Thickness06 = iProcessData.Details.Count < 6 || iProcessData.Details[5] is not Detail thickness06 ? string.Empty : thickness06.Thickness,
Thickness07 = iProcessData.Details.Count < 7 || iProcessData.Details[6] is not Detail thickness07 ? string.Empty : thickness07.Thickness,
Thickness08 = iProcessData.Details.Count < 8 || iProcessData.Details[7] is not Detail thickness08 ? string.Empty : thickness08.Thickness,
Thickness09 = iProcessData.Details.Count < 9 || iProcessData.Details[8] is not Detail thickness09 ? string.Empty : thickness09.Thickness,
Thickness10 = iProcessData.Details.Count < 10 || iProcessData.Details[9] is not Detail thickness10 ? string.Empty : thickness10.Thickness,
Thickness11 = iProcessData.Details.Count < 11 || iProcessData.Details[10] is not Detail thickness11 ? string.Empty : thickness11.Thickness,
Thickness12 = iProcessData.Details.Count < 12 || iProcessData.Details[11] is not Detail thickness12 ? string.Empty : thickness12.Thickness,
Thickness13 = iProcessData.Details.Count < 13 || iProcessData.Details[12] is not Detail thickness13 ? string.Empty : thickness13.Thickness,
Thickness14 = iProcessData.Details.Count < 14 || iProcessData.Details[13] is not Detail thickness14 ? string.Empty : thickness14.Thickness,
};
results.Add(description);
}
@ -301,6 +330,21 @@ public class Description : IDescription, Shared.Properties.IDescription
ThicknessFourteenCriticalPointsAverage = nameof(ThicknessFourteenCriticalPointsAverage),
ThicknessFourteenCriticalPointsStdDev = nameof(ThicknessFourteenCriticalPointsStdDev),
ThicknessFourteenMeanFrom = nameof(ThicknessFourteenMeanFrom),
//
Thickness01 = nameof(Thickness01),
Thickness02 = nameof(Thickness02),
Thickness03 = nameof(Thickness03),
Thickness04 = nameof(Thickness04),
Thickness05 = nameof(Thickness05),
Thickness06 = nameof(Thickness06),
Thickness07 = nameof(Thickness07),
Thickness08 = nameof(Thickness08),
Thickness09 = nameof(Thickness09),
Thickness10 = nameof(Thickness10),
Thickness11 = nameof(Thickness11),
Thickness12 = nameof(Thickness12),
Thickness13 = nameof(Thickness13),
Thickness14 = nameof(Thickness14),
};
return result;
}