Preparation to switch to xml for InfinityQS export
This commit is contained in:
@ -204,6 +204,30 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
WaitForFileConsumption(dateTime, descriptions, isDummyRun, successDirectory, duplicateDirectory, collection, duplicateFile);
|
||||
}
|
||||
|
||||
private void WriteFile<T>(string reportFullPath, DateTime dateTime, List<T> descriptions) where T : Shared.Properties.IDescription
|
||||
{
|
||||
bool isDummyRun = false;
|
||||
string successDirectory = string.Empty;
|
||||
List<(Shared.Properties.IScopeInfo, string)> collection = new();
|
||||
string duplicateDirectory = Path.Combine(_FileConnectorConfiguration.SourceFileLocation, _CellInstanceName);
|
||||
if (!Directory.Exists(duplicateDirectory))
|
||||
_ = Directory.CreateDirectory(duplicateDirectory);
|
||||
string duplicateFile = Path.Combine(duplicateDirectory, $"{Path.GetFileName(reportFullPath)}.xml");
|
||||
string xml = ProcessDataStandardFormat.GetXml(reportFullPath)
|
||||
.Replace("ppm</", "</")
|
||||
.Replace("mm2</", "</")
|
||||
.Replace("um</", "</")
|
||||
.Replace("mm</", "</")
|
||||
.Replace("nm</", "</")
|
||||
.Replace(">[ ", ">")
|
||||
.Replace(">*0", ">")
|
||||
.Replace(">*", ">")
|
||||
.Replace("%</", "</")
|
||||
.Replace("]</", "</");
|
||||
File.WriteAllText(duplicateFile, xml);
|
||||
WaitForFileConsumption(dateTime, descriptions, isDummyRun, successDirectory, duplicateDirectory, collection, duplicateFile);
|
||||
}
|
||||
|
||||
private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime dateTime)
|
||||
{
|
||||
Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
|
||||
@ -213,11 +237,13 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
JsonElement[] jsonElements = ProcessDataStandardFormat.GetArray(processDataStandardFormat);
|
||||
List<pcl.Description> descriptions = pcl.ProcessData.GetDescriptions(jsonElements);
|
||||
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics[0]), tests, jsonElements, new List<FileInfo>());
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(string.Join(Environment.NewLine, processDataStandardFormat.Logistics), tests, jsonElements, new List<FileInfo>());
|
||||
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
|
||||
SaveIQSFile(reportFullPath, dateTime, descriptions, tests);
|
||||
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
|
||||
FileCopy(reportFullPath, dateTime, descriptions);
|
||||
if (string.IsNullOrEmpty(reportFullPath) && _IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
|
||||
WriteFile(reportFullPath, dateTime, descriptions);
|
||||
return results;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user