MET08RESIHGCV - v2.43.0 - Using
EDA Multiple Storage Paths and delete old way
This commit is contained in:
parent
f5554c7088
commit
87a2a31942
@ -118,7 +118,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
if (!Directory.Exists(successDirectory))
|
||||
_ = Directory.CreateDirectory(successDirectory);
|
||||
File.Copy(reportFullPath, duplicateFile, overwrite: true);
|
||||
Shared0413(dateTime, isDummyRun, successDirectory, duplicateDirectory, tuples, duplicateFile);
|
||||
WaitForFileConsumption(dateTime, isDummyRun, successDirectory, duplicateDirectory, tuples, duplicateFile);
|
||||
}
|
||||
|
||||
private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime dateTime)
|
||||
|
@ -1,282 +0,0 @@
|
||||
// using Adaptation.Eaf.Management.ConfigurationData.CellAutomation;
|
||||
// using Adaptation.Ifx.Eaf.EquipmentConnector.File.Configuration;
|
||||
// using Adaptation.Shared;
|
||||
// using Adaptation.Shared.Duplicator;
|
||||
// using Adaptation.Shared.Methods;
|
||||
// using Adaptation.Shared.Metrology;
|
||||
// using System;
|
||||
// using System.Collections.Generic;
|
||||
// using System.Globalization;
|
||||
// using System.IO;
|
||||
// using System.Linq;
|
||||
// using System.Text.Json;
|
||||
// using System.Text.Json.Serialization;
|
||||
|
||||
// namespace Adaptation.FileHandlers.MET08RESIHGCV;
|
||||
|
||||
// public class FileRead : Shared.FileRead, IFileRead
|
||||
// {
|
||||
|
||||
// private readonly bool _IsNaEDA;
|
||||
// private readonly bool _IsXToAPC;
|
||||
// private readonly string _IqsFile;
|
||||
// private readonly bool _IsXToIQSSi;
|
||||
// private readonly bool _IsXToSPaCe;
|
||||
// private readonly string _MemoryPath;
|
||||
// private readonly bool _IsXToOpenInsight;
|
||||
// private readonly string _LincPDFCFileName;
|
||||
// private readonly string _OpenInsightFilePattern;
|
||||
// private readonly bool _IsXToOpenInsightMetrologyViewer;
|
||||
// private readonly Dictionary<string, string> _CellNames;
|
||||
// private readonly string _OpenInsightMetrologyViewerAPI;
|
||||
// private readonly bool _IsXToOpenInsightMetrologyViewerAttachments;
|
||||
|
||||
// public FileRead(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, bool isEAFHosted) :
|
||||
// base(new Description(), false, smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted)
|
||||
// {
|
||||
// _MinFileLength = 10;
|
||||
// _NullData = string.Empty;
|
||||
// _Logistics = new Logistics(this);
|
||||
// if (_FileParameter is null)
|
||||
// throw new Exception(cellInstanceConnectionName);
|
||||
// if (_ModelObjectParameterDefinitions is null)
|
||||
// throw new Exception(cellInstanceConnectionName);
|
||||
// if (!_IsDuplicator)
|
||||
// throw new Exception(cellInstanceConnectionName);
|
||||
// _IsNaEDA = _Hyphens == (int)Hyphen.IsNaEDA;
|
||||
// _IsXToAPC = _Hyphens == (int)Hyphen.IsXToAPC;
|
||||
// _CellNames = new Dictionary<string, string>();
|
||||
// _IsXToIQSSi = _Hyphens == (int)Hyphen.IsXToIQSSi;
|
||||
// _IsXToSPaCe = _Hyphens == (int)Hyphen.IsXToSPaCe;
|
||||
// _IsXToOpenInsight = _Hyphens == (int)Hyphen.IsXToOpenInsight;
|
||||
// _IsXToOpenInsightMetrologyViewer = _Hyphens == (int)Hyphen.IsXToOpenInsightMetrologyViewer;
|
||||
// _IqsFile = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "IQS.File");
|
||||
// _MemoryPath = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "Path.Memory");
|
||||
// _IsXToOpenInsightMetrologyViewerAttachments = _Hyphens == (int)Hyphen.IsXToOpenInsightMetrologyViewerAttachments;
|
||||
// _OpenInsightFilePattern = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "OpenInsight.FilePattern");
|
||||
// _OpenInsightMetrologyViewerAPI = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "OpenInsight.MetrologyViewerAPI");
|
||||
// ModelObjectParameterDefinition[] cellInstanceCollection = GetProperties(cellInstanceConnectionName, modelObjectParameters, "CellInstance.", ".Path");
|
||||
// foreach (ModelObjectParameterDefinition modelObjectParameterDefinition in cellInstanceCollection)
|
||||
// _CellNames.Add(modelObjectParameterDefinition.Name.Split('.')[1], modelObjectParameterDefinition.Value);
|
||||
// _LincPDFCFileName = Path.Combine(AppContext.BaseDirectory, "LincPDFC.exe");
|
||||
// if (_IsXToOpenInsightMetrologyViewerAttachments && !File.Exists(_LincPDFCFileName))
|
||||
// throw new Exception("LincPDFC FileName doesn't Exist!");
|
||||
// }
|
||||
|
||||
// void IFileRead.Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, Exception exception) => Move(extractResults);
|
||||
|
||||
// void IFileRead.WaitForThread() => WaitForThread(thread: null, threadExceptions: null);
|
||||
|
||||
// string IFileRead.GetEventDescription()
|
||||
// {
|
||||
// string result = _Description.GetEventDescription();
|
||||
// return result;
|
||||
// }
|
||||
|
||||
// List<string> IFileRead.GetHeaderNames()
|
||||
// {
|
||||
// List<string> results = _Description.GetHeaderNames();
|
||||
// return results;
|
||||
// }
|
||||
|
||||
// string[] IFileRead.Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, string to, string from, string resolvedFileLocation, Exception exception)
|
||||
// {
|
||||
// string[] results = Move(extractResults, to, from, resolvedFileLocation, exception);
|
||||
// return results;
|
||||
// }
|
||||
|
||||
// JsonProperty[] IFileRead.GetDefault()
|
||||
// {
|
||||
// JsonProperty[] results = _Description.GetDefault(this, _Logistics);
|
||||
// return results;
|
||||
// }
|
||||
|
||||
// Dictionary<string, string> IFileRead.GetDisplayNamesJsonElement()
|
||||
// {
|
||||
// Dictionary<string, string> results = _Description.GetDisplayNamesJsonElement(this);
|
||||
// return results;
|
||||
// }
|
||||
|
||||
// List<IDescription> IFileRead.GetDescriptions(IFileRead fileRead, List<Test> tests, IProcessData processData)
|
||||
// {
|
||||
// List<IDescription> results = _Description.GetDescriptions(fileRead, _Logistics, tests, processData);
|
||||
// return results;
|
||||
// }
|
||||
|
||||
// Tuple<string, Test[], JsonElement[], List<FileInfo>> IFileRead.GetExtractResult(string reportFullPath, string eventName)
|
||||
// {
|
||||
// Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
|
||||
// if (string.IsNullOrEmpty(eventName))
|
||||
// throw new Exception();
|
||||
// _ReportFullPath = reportFullPath;
|
||||
// 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);
|
||||
// if (results.Item3.Length > 0 && _IsEAFHosted)
|
||||
// WritePDSF(this, results.Item3);
|
||||
// UpdateLastTicksDuration(DateTime.Now.Ticks - dateTime.Ticks);
|
||||
// return results;
|
||||
// }
|
||||
|
||||
// Tuple<string, Test[], JsonElement[], List<FileInfo>> IFileRead.ReExtract()
|
||||
// {
|
||||
// Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
|
||||
// List<string> headerNames = _Description.GetHeaderNames();
|
||||
// Dictionary<string, string> keyValuePairs = _Description.GetDisplayNamesJsonElement(this);
|
||||
// results = ReExtract(this, headerNames, keyValuePairs);
|
||||
// return results;
|
||||
// }
|
||||
|
||||
// protected static List<pcl.Description> GetDescriptions(JsonElement[] jsonElements)
|
||||
// {
|
||||
// List<pcl.Description> results = new();
|
||||
// pcl.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<pcl.Description>(jsonElement.ToString(), jsonSerializerOptions);
|
||||
// results.Add(description);
|
||||
// }
|
||||
// return results;
|
||||
// }
|
||||
|
||||
// private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime dateTime)
|
||||
// {
|
||||
// Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
|
||||
// string duplicateDirectory;
|
||||
// Tuple<string, string[], string[]> pdsf = ProcessDataStandardFormat.GetLogisticsColumnsAndBody(reportFullPath);
|
||||
// _Logistics = new Logistics(reportFullPath, pdsf.Item1);
|
||||
// SetFileParameterLotIDToLogisticsMID();
|
||||
// JsonElement[] jsonElements = ProcessDataStandardFormat.GetArray(pdsf);
|
||||
// List<pcl.Description> descriptions = GetDescriptions(jsonElements);
|
||||
// (Test[] tests, Dictionary<Test, List<Shared.Properties.IDescription>> keyValuePairs) = Get(this, from l in descriptions select (Shared.Properties.IDescription)l, extra: false);
|
||||
// results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(pdsf.Item1, tests, jsonElements, new List<FileInfo>());
|
||||
// bool isNotUsedInsightMetrologyViewerAttachments = !(_FileConnectorConfiguration.FileScanningIntervalInSeconds > 0) && _IsXToOpenInsightMetrologyViewerAttachments;
|
||||
// bool isDummyRun = _DummyRuns.Any() && _DummyRuns.ContainsKey(_Logistics.JobID) && _DummyRuns[_Logistics.JobID].Any() && (from l in _DummyRuns[_Logistics.JobID] where l == _Logistics.Sequence select 1).Any();
|
||||
// if (isDummyRun)
|
||||
// {
|
||||
// try
|
||||
// { File.SetLastWriteTime(reportFullPath, dateTime); }
|
||||
// catch (Exception) { }
|
||||
// }
|
||||
// string[] segments = Path.GetFileNameWithoutExtension(reportFullPath).Split('_');
|
||||
// if (_IsXToIQSSi)
|
||||
// duplicateDirectory = string.Concat(_FileConnectorConfiguration.TargetFileLocation, @"\All");
|
||||
// else if (!_IsXToOpenInsight)
|
||||
// duplicateDirectory = string.Concat(_FileConnectorConfiguration.TargetFileLocation, @"\", segments[0]);
|
||||
// else
|
||||
// duplicateDirectory = string.Concat(Path.GetDirectoryName(Path.GetDirectoryName(_FileConnectorConfiguration.TargetFileLocation)), @"\Data");
|
||||
// if (segments.Length > 2)
|
||||
// duplicateDirectory = string.Concat(duplicateDirectory, @"-", segments[2]);
|
||||
// if (!Directory.Exists(duplicateDirectory))
|
||||
// _ = Directory.CreateDirectory(duplicateDirectory);
|
||||
// if (isDummyRun || isNotUsedInsightMetrologyViewerAttachments || _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
|
||||
// {
|
||||
// if (!Directory.Exists(duplicateDirectory))
|
||||
// _ = Directory.CreateDirectory(duplicateDirectory);
|
||||
// string successDirectory;
|
||||
// if (!_IsXToAPC)
|
||||
// successDirectory = string.Empty;
|
||||
// else
|
||||
// {
|
||||
// successDirectory = string.Concat(Path.GetDirectoryName(_FileConnectorConfiguration.TargetFileLocation), @"\ViewerPath");
|
||||
// if (!Directory.Exists(successDirectory))
|
||||
// _ = Directory.CreateDirectory(successDirectory);
|
||||
// }
|
||||
// List<(Shared.Properties.IScopeInfo, string)> tuples = new();
|
||||
// string duplicateFile = string.Concat(duplicateDirectory, @"\", Path.GetFileName(reportFullPath));
|
||||
// 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 logisticsSequenceMemoryDirectory = string.Concat(_MemoryPath, @"\", _EquipmentType, @"\Source\", weekDirectory, @"\", _Logistics.Sequence);
|
||||
// if (!Directory.Exists(logisticsSequenceMemoryDirectory))
|
||||
// _ = Directory.CreateDirectory(logisticsSequenceMemoryDirectory);
|
||||
// if (_IsXToAPC)
|
||||
// {
|
||||
// if (!isDummyRun && _IsEAFHosted)
|
||||
// File.Copy(reportFullPath, duplicateFile, overwrite: true);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (_IsXToOpenInsightMetrologyViewer)
|
||||
// {
|
||||
// WSRequest wsRequest = new(this, _Logistics, descriptions);
|
||||
// if (!isDummyRun && _IsEAFHosted)
|
||||
// {
|
||||
// (string json, WS.Results wsResults) = WS.SendData(_OpenInsightMetrologyViewerAPI, wsRequest);
|
||||
// if (!wsResults.Success)
|
||||
// throw new Exception(wsResults.ToString());
|
||||
// _Log.Debug(wsResults.HeaderID);
|
||||
// File.WriteAllText(string.Concat(logisticsSequenceMemoryDirectory, @"\", nameof(WS.Results), ".json"), json);
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Test test;
|
||||
// string lines;
|
||||
// Shared.Properties.IScopeInfo scopeInfo;
|
||||
// foreach (KeyValuePair<Test, List<Shared.Properties.IDescription>> keyValuePair in keyValuePairs)
|
||||
// {
|
||||
// test = keyValuePair.Key;
|
||||
// //scopeInfo = new ScopeInfo(test);
|
||||
// if (!_IsXToOpenInsight)
|
||||
// scopeInfo = new ScopeInfo(tests[0], _IqsFile);
|
||||
// else
|
||||
// scopeInfo = new ScopeInfo(tests[0], _OpenInsightFilePattern);
|
||||
// lines = ProcessData.GetLines(this, _Logistics, descriptions);
|
||||
// tuples.Add(new(scopeInfo, lines));
|
||||
// }
|
||||
// }
|
||||
// if (_IsXToOpenInsightMetrologyViewerAttachments)
|
||||
// {
|
||||
// string[] matchDirectories = Shared1567(reportFullPath, tuples);
|
||||
// if (!isDummyRun && _IsEAFHosted && !isNotUsedInsightMetrologyViewerAttachments)
|
||||
// ProcessData.PostOpenInsightMetrologyViewerAttachments(this, _Logistics, _OpenInsightMetrologyViewerAPI, _LincPDFCFileName, dateTime, logisticsSequenceMemoryDirectory, descriptions, matchDirectories[0]);
|
||||
// }
|
||||
// }
|
||||
// if (!_IsXToOpenInsightMetrologyViewer && !_IsXToOpenInsightMetrologyViewerAttachments)
|
||||
// Shared0413(dateTime, isDummyRun, successDirectory, duplicateDirectory, tuples, duplicateFile);
|
||||
// }
|
||||
// if (_IsXToOpenInsightMetrologyViewerAttachments)
|
||||
// {
|
||||
// string destinationDirectory;
|
||||
// //string destinationDirectory = WriteScopeInfo(_ProgressPath, _Logistics, dateTime, duplicateDirectory, tuples);
|
||||
// FileInfo fileInfo = new(reportFullPath);
|
||||
// string logisticsSequence = _Logistics.Sequence.ToString();
|
||||
// if (fileInfo.Exists && fileInfo.LastWriteTime < fileInfo.CreationTime)
|
||||
// File.SetLastWriteTime(reportFullPath, fileInfo.CreationTime);
|
||||
// string jobIdDirectory = string.Concat(Path.GetDirectoryName(Path.GetDirectoryName(_FileConnectorConfiguration.TargetFileLocation)), @"\", _Logistics.JobID);
|
||||
// if (!Directory.Exists(jobIdDirectory))
|
||||
// _ = Directory.CreateDirectory(jobIdDirectory);
|
||||
// string[] matchDirectories;
|
||||
// if (!_IsEAFHosted)
|
||||
// matchDirectories = new string[] { Path.GetDirectoryName(Path.GetDirectoryName(reportFullPath)) };
|
||||
// else
|
||||
// matchDirectories = Directory.GetDirectories(jobIdDirectory, string.Concat(_Logistics.MID, '*', logisticsSequence, '*'), SearchOption.TopDirectoryOnly);
|
||||
// if ((matchDirectories is null) || matchDirectories.Length != 1)
|
||||
// throw new Exception("Didn't find directory by logistics sequence");
|
||||
// destinationDirectory = matchDirectories[0];
|
||||
// if (isDummyRun)
|
||||
// Shared0607(reportFullPath, duplicateDirectory, logisticsSequence, destinationDirectory);
|
||||
// else
|
||||
// {
|
||||
// WSRequest wsRequest = new(this, _Logistics, descriptions);
|
||||
// JsonSerializerOptions jsonSerializerOptions = new() { WriteIndented = true };
|
||||
// string json = JsonSerializer.Serialize(wsRequest, wsRequest.GetType(), jsonSerializerOptions);
|
||||
// if (_IsEAFHosted)
|
||||
// Shared1277(reportFullPath, destinationDirectory, logisticsSequence, jobIdDirectory, json);
|
||||
// else
|
||||
// {
|
||||
// string jsonFileName = Path.ChangeExtension(reportFullPath, ".json");
|
||||
// string historicalText = File.ReadAllText(jsonFileName);
|
||||
// if (json != historicalText)
|
||||
// throw new Exception("File doesn't match historical!");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return results;
|
||||
// }
|
||||
|
||||
// }
|
@ -1,15 +0,0 @@
|
||||
// namespace Adaptation.FileHandlers.MET08RESIHGCV;
|
||||
|
||||
// public enum Hyphen
|
||||
// {
|
||||
// IsXToOpenInsightMetrologyViewer, //MetrologyWS.SendData(file, string.Concat("http://", serverName, "/api/inbound/MercuryProbe"), headerAttachments);
|
||||
// IsXToIQSSi, //NA <d7p1:FileScanningIntervalInSeconds>-361</d7p1:FileScanningIntervalInSeconds>
|
||||
// IsXToOpenInsight, //NA <d7p1:FileScanningIntervalInSeconds>-363</d7p1:FileScanningIntervalInSeconds>
|
||||
// IsXToOpenInsightMetrologyViewerAttachments, //Site-One
|
||||
// IsXToAPC,
|
||||
// IsXToSPaCe,
|
||||
// IsXToArchive,
|
||||
// IsArchive,
|
||||
// IsDummy,
|
||||
// IsNaEDA
|
||||
// }
|
@ -1,103 +0,0 @@
|
||||
// using Adaptation.Shared;
|
||||
// using Adaptation.Shared.Metrology;
|
||||
// using Adaptation.Shared.Properties;
|
||||
// using System;
|
||||
// using System.Collections.Generic;
|
||||
// using System.Diagnostics;
|
||||
// using System.IO;
|
||||
// using System.Linq;
|
||||
// using System.Text;
|
||||
// using System.Text.Json;
|
||||
|
||||
// namespace Adaptation.FileHandlers.MET08RESIHGCV;
|
||||
|
||||
// public class ProcessData
|
||||
// {
|
||||
|
||||
// internal static List<Tuple<int, Enum, string>> HyphenTuples => new()
|
||||
// {
|
||||
// new Tuple<int, Enum, string>(0, Hyphen.IsNaEDA, @"\EC_EDA\Staging\Traces\~\Source"),
|
||||
// new Tuple<int, Enum, string>(15, Hyphen.IsXToOpenInsightMetrologyViewer, @"\EC_EAFLog\TracesMES\~\Source"),
|
||||
// new Tuple<int, Enum, string>(-36, Hyphen.IsXToIQSSi, @"\EC_SPC_Si\Traces\~\PollPath"),
|
||||
// new Tuple<int, Enum, string>(-36, Hyphen.IsXToOpenInsight, @"\\messa01ec.ec.local\APPS\Metrology\~\Source"),
|
||||
// new Tuple<int, Enum, string>(36, Hyphen.IsXToOpenInsightMetrologyViewerAttachments, @"\EC_Characterization_Si\In Process\~\Source"),
|
||||
// new Tuple<int, Enum, string>(360, Hyphen.IsXToAPC, @"\EC_APC\Staging\Traces\~\PollPath"),
|
||||
// new Tuple<int, Enum, string>(-36, Hyphen.IsXToSPaCe, @"\EC_SPC_Si\Traces\~\Source"),
|
||||
// new Tuple<int, Enum, string>(180, Hyphen.IsXToArchive, @"\EC_EAFLog\TracesArchive\~\Source"),
|
||||
// new Tuple<int, Enum, string>(36, Hyphen.IsArchive, @"\EC_Characterization_Si\Processed")
|
||||
// //new Tuple<int, Enum, string>("IsDummy"
|
||||
// };
|
||||
|
||||
// internal static string GetLines(IFileRead fileRead, Logistics logistics, List<pcl.Description> descriptions)
|
||||
// {
|
||||
// StringBuilder result = new();
|
||||
// if (fileRead is null)
|
||||
// { }
|
||||
// if (logistics is null)
|
||||
// { }
|
||||
// if (descriptions is null)
|
||||
// { }
|
||||
// return result.ToString();
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Convert the raw data file to parsable file format - in this case from PCL to PDF
|
||||
// /// </summary>
|
||||
// /// <param name="sourceFile">source file to be converted to PDF</param>
|
||||
// /// <returns></returns>
|
||||
// private static string ConvertSourceFileToPdfWithChartData(string lincPDFCFileName, string sourceFile)
|
||||
// {
|
||||
// string result = Path.ChangeExtension(sourceFile, ".pdf");
|
||||
// if (!File.Exists(result))
|
||||
// {
|
||||
// string arguments = string.Concat("-i \"", sourceFile, "\" -o \"", result, "\"");
|
||||
// //string arguments = string.Concat("-dSAFER -dBATCH -dNOPAUSE -dFIXEDMEDIA -dFitPage -dAutoRotatePages=/All -dDEVICEWIDTHPOINTS=792 -dDEVICEHEIGHTPOINTS=612 -sOutputFile=\"", result, "\" -sDEVICE=pdfwrite \"", sourceFile, "\"");
|
||||
// Process process = Process.Start(lincPDFCFileName, arguments);
|
||||
// //Process process = Process.Start(ghostPCLFileName, arguments);
|
||||
// _ = process.WaitForExit(30000);
|
||||
// if (!File.Exists(result))
|
||||
// throw new Exception("PDF file wasn't created");
|
||||
// }
|
||||
// return result;
|
||||
// }
|
||||
|
||||
// internal static void PostOpenInsightMetrologyViewerAttachments(IFileRead fileRead, Logistics logistics, string openInsightMetrologyViewerAPI, string lincPDFCFileName, DateTime dateTime, string logisticsSequenceMemoryDirectory, List<pcl.Description> descriptions, string matchDirectory)
|
||||
// {
|
||||
// if (fileRead is null)
|
||||
// { }
|
||||
// if (dateTime == DateTime.MinValue)
|
||||
// { }
|
||||
// if (logisticsSequenceMemoryDirectory is null)
|
||||
// { }
|
||||
// if (descriptions is null)
|
||||
// { }
|
||||
// if (matchDirectory is null)
|
||||
// { }
|
||||
// string[] pclFiles = Directory.GetFiles(matchDirectory, "*.pcl", SearchOption.TopDirectoryOnly);
|
||||
// if (pclFiles.Length != 1)
|
||||
// throw new Exception("Invalid source file count!");
|
||||
// string wsResultsMemoryFile = string.Concat(logisticsSequenceMemoryDirectory, @"\", nameof(WS.Results), ".json");
|
||||
// if (!File.Exists(wsResultsMemoryFile))
|
||||
// throw new Exception(string.Concat("Memory file <", wsResultsMemoryFile, "> doesn't exist!"));
|
||||
// string json = File.ReadAllText(wsResultsMemoryFile);
|
||||
// WS.Results metrologyWSRequest = JsonSerializer.Deserialize<WS.Results>(json);
|
||||
// long wsResultsHeaderID = metrologyWSRequest.HeaderID;
|
||||
// List<string> pdfFiles = new();
|
||||
// pdfFiles.AddRange(Directory.GetFiles(matchDirectory, "*.pdf_old", SearchOption.TopDirectoryOnly));
|
||||
// foreach (string pdfFile in pdfFiles)
|
||||
// File.Delete(pdfFile);
|
||||
// pdfFiles.Clear();
|
||||
// pdfFiles.AddRange(Directory.GetFiles(matchDirectory, "*.pdf", SearchOption.TopDirectoryOnly));
|
||||
// foreach (string pdfFile in pdfFiles)
|
||||
// File.Move(pdfFile, Path.ChangeExtension(pdfFile, ".pdf_old"));
|
||||
// pdfFiles.Clear();
|
||||
// foreach (string pclFile in pclFiles.OrderBy(l => l))
|
||||
// pdfFiles.Add(ConvertSourceFileToPdfWithChartData(lincPDFCFileName, pclFile));
|
||||
// if (pdfFiles.Count == 0)
|
||||
// throw new Exception("Invalid *.pdf file count!");
|
||||
// List<WS.Attachment> headerAttachments = new()
|
||||
// { new WS.Attachment(descriptions[0].HeaderUniqueId, "Data.pdf", pdfFiles[0]) };
|
||||
// WS.AttachFiles(openInsightMetrologyViewerAPI, wsResultsHeaderID, headerAttachments, dataAttachments: null);
|
||||
// }
|
||||
|
||||
// }
|
@ -1,158 +0,0 @@
|
||||
// using Adaptation.Shared;
|
||||
// using Adaptation.Shared.Properties;
|
||||
// using System;
|
||||
// using System.Collections.Generic;
|
||||
// using System.Linq;
|
||||
|
||||
// namespace Adaptation.FileHandlers.MET08RESIHGCV;
|
||||
|
||||
// public class WSRequest
|
||||
// {
|
||||
// public bool SentToMetrology { get; set; }
|
||||
// public bool SentToSPC { get; set; }
|
||||
// //
|
||||
|
||||
// public string Area { get; set; }
|
||||
// public string Ccomp { get; set; }
|
||||
// public string CellName { get; set; }
|
||||
// public string CondType { get; set; }
|
||||
// public string Date { get; set; }
|
||||
// public string FlatZMean { get; set; }
|
||||
// public string FlatZRadialGradient { get; set; }
|
||||
// public string FlatZStdDev { get; set; }
|
||||
// public string Folder { get; set; }
|
||||
// public string GLimit { get; set; }
|
||||
// public string GradeMean { get; set; }
|
||||
// public string GradeRadialGradient { get; set; }
|
||||
// public string GradeStdDev { get; set; }
|
||||
// public string Id { get; set; }
|
||||
// public string Layer { get; set; }
|
||||
// public string Lot { get; set; }
|
||||
// public string Model { get; set; }
|
||||
// public string NAvgMean { get; set; }
|
||||
// public string NAvgRadialGradient { get; set; }
|
||||
// public string NAvgStdDev { get; set; }
|
||||
// public string NslMean { get; set; }
|
||||
// public string NslRadialGradient { get; set; }
|
||||
// public string NslStdDev { get; set; }
|
||||
// public string Operator { get; set; }
|
||||
// public string PSN { get; set; }
|
||||
// public string Pattern { get; set; }
|
||||
// public string PhaseMean { get; set; }
|
||||
// public string PhaseRadialGradient { get; set; }
|
||||
// public string PhaseStdDev { get; set; }
|
||||
// public string Plan { get; set; }
|
||||
// public string RDS { get; set; }
|
||||
// public string RampRate { get; set; }
|
||||
// public string Reactor { get; set; }
|
||||
// public string RhoAvgMean { get; set; }
|
||||
// public string RhoAvgRadialGradient { get; set; }
|
||||
// public string RhoAvgStdDev { get; set; }
|
||||
// public string RhoMethod { get; set; }
|
||||
// public string RhoslMean { get; set; }
|
||||
// public string RhoslRadialGradient { get; set; }
|
||||
// public string RhoslStdDev { get; set; }
|
||||
// public string RsMean { get; set; }
|
||||
// public string RsRadialGradient { get; set; }
|
||||
// public string RsStdDev { get; set; }
|
||||
// public string SetupFile { get; set; }
|
||||
// public string StartVoltage { get; set; }
|
||||
// public string StopVoltage { get; set; }
|
||||
// public string UniqueId { get; set; }
|
||||
// public string VdMean { get; set; }
|
||||
// public string VdRadialGradient { get; set; }
|
||||
// public string VdStdDev { get; set; }
|
||||
// public string Wafer { get; set; }
|
||||
// public string WaferSize { get; set; }
|
||||
// public string Zone { get; set; }
|
||||
// public List<pcl.Detail> Details { get; protected set; }
|
||||
|
||||
// [Obsolete("For json")] public WSRequest() { }
|
||||
|
||||
// internal WSRequest(IFileRead fileRead, Logistics logistics, List<pcl.Description> descriptions)
|
||||
// {
|
||||
// if (fileRead is null)
|
||||
// { }
|
||||
// Id = string.Empty;
|
||||
// Details = new List<pcl.Detail>();
|
||||
// CellName = logistics.MesEntity;
|
||||
// pcl.Description x = descriptions[0];
|
||||
// //Header
|
||||
// {
|
||||
// Area = x.Area;
|
||||
// Ccomp = x.Ccomp;
|
||||
// CondType = x.CondType;
|
||||
// Date = x.Date;
|
||||
// FlatZMean = x.FlatZMean;
|
||||
// FlatZRadialGradient = x.FlatZRadialGradient;
|
||||
// FlatZStdDev = x.FlatZStdDev;
|
||||
// Folder = x.Folder;
|
||||
// GLimit = x.GLimit;
|
||||
// GradeMean = x.GradeMean;
|
||||
// GradeRadialGradient = x.GradeRadialGradient;
|
||||
// GradeStdDev = x.GradeStdDev;
|
||||
// Operator = x.Employee;
|
||||
// Layer = x.Layer;
|
||||
// Lot = x.Lot;
|
||||
// Model = x.Model;
|
||||
// NAvgMean = x.NAvgMean;
|
||||
// NAvgRadialGradient = x.NAvgRadialGradient;
|
||||
// NAvgStdDev = x.NAvgStdDev;
|
||||
// NslMean = x.NslMean;
|
||||
// NslRadialGradient = x.NslRadialGradient;
|
||||
// NslStdDev = x.NslStdDev;
|
||||
// PSN = x.PSN;
|
||||
// Pattern = x.Pattern;
|
||||
// PhaseMean = x.PhaseMean;
|
||||
// PhaseRadialGradient = x.PhaseRadialGradient;
|
||||
// PhaseStdDev = x.PhaseStdDev;
|
||||
// Plan = x.Plan;
|
||||
// RDS = x.RDS;
|
||||
// RampRate = x.RampRate;
|
||||
// Reactor = x.Reactor;
|
||||
// RhoAvgMean = x.RhoAvgMean;
|
||||
// RhoAvgRadialGradient = x.RhoAvgRadialGradient;
|
||||
// RhoAvgStdDev = x.RhoAvgStdDev;
|
||||
// RhoMethod = x.RhoMethod;
|
||||
// RhoslMean = x.RhoslMean;
|
||||
// RhoslRadialGradient = x.RhoslRadialGradient;
|
||||
// RhoslStdDev = x.RhoslStdDev;
|
||||
// RsMean = x.RsMean;
|
||||
// RsRadialGradient = x.RsRadialGradient;
|
||||
// RsStdDev = x.RsStdDev;
|
||||
// SetupFile = x.SetupFile;
|
||||
// StartVoltage = x.StartVoltage;
|
||||
// StopVoltage = x.StopVoltage;
|
||||
// UniqueId = x.UniqueId;
|
||||
// VdMean = x.VdMean;
|
||||
// VdRadialGradient = x.VdRadialGradient;
|
||||
// VdStdDev = x.VdStdDev;
|
||||
// Wafer = x.Wafer;
|
||||
// WaferSize = x.WaferSize;
|
||||
// Zone = x.Zone;
|
||||
// }
|
||||
// pcl.Detail detail;
|
||||
// foreach (pcl.Description description in descriptions)
|
||||
// {
|
||||
// detail = new pcl.Detail
|
||||
// {
|
||||
// FlatZ = description.FlatZ,
|
||||
// Grade = description.Grade,
|
||||
// HeaderUniqueId = description.HeaderUniqueId,
|
||||
// NAvg = description.NAvg,
|
||||
// Nsl = description.Nsl,
|
||||
// Phase = description.Phase,
|
||||
// RhoAvg = description.RhoAvg,
|
||||
// Rhosl = description.Rhosl,
|
||||
// UniqueId = description.UniqueId,
|
||||
// Vd = description.Vd
|
||||
// };
|
||||
// Details.Add(detail);
|
||||
// }
|
||||
// if (Date is null)
|
||||
// Date = logistics.DateTimeFromSequence.ToString();
|
||||
// if (UniqueId is null && Details.Any())
|
||||
// UniqueId = Details[0].HeaderUniqueId;
|
||||
// }
|
||||
|
||||
// }
|
@ -188,11 +188,18 @@ public class WSRequest
|
||||
{ }
|
||||
if (dateTime == DateTime.MinValue)
|
||||
{ }
|
||||
string[] pclFiles = Directory.GetFiles(matchDirectory, "*.pcl", SearchOption.TopDirectoryOnly);
|
||||
if (pclFiles.Length != 1)
|
||||
throw new Exception("Invalid source file count!");
|
||||
if (string.IsNullOrEmpty(json))
|
||||
{
|
||||
WSRequest wsRequest = new(fileRead, logistics, descriptions);
|
||||
(json, WS.Results wsResults) = WS.SendData(openInsightMetrologyViewerAPI, wsRequest);
|
||||
if (!wsResults.Success)
|
||||
throw new Exception(wsResults.ToString());
|
||||
}
|
||||
WS.Results metrologyWSRequest = JsonSerializer.Deserialize<WS.Results>(json);
|
||||
long wsResultsHeaderID = metrologyWSRequest.HeaderID;
|
||||
string[] pclFiles = Directory.GetFiles(matchDirectory, "*.pcl", SearchOption.TopDirectoryOnly);
|
||||
if (pclFiles.Length != 1)
|
||||
throw new Exception($"Invalid source file count for <{wsResultsHeaderID}>!{Environment.NewLine}{json}");
|
||||
List<string> pdfFiles = new();
|
||||
pdfFiles.AddRange(Directory.GetFiles(matchDirectory, "*.pdf_old", SearchOption.TopDirectoryOnly));
|
||||
foreach (string pdfFile in pdfFiles)
|
||||
|
@ -121,14 +121,18 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
string jobIdDirectory = Path.Combine(_JobIdParentDirectory, _Logistics.JobID);
|
||||
if (!Directory.Exists(jobIdDirectory))
|
||||
_ = Directory.CreateDirectory(jobIdDirectory);
|
||||
string json;
|
||||
string[] matchDirectories = GetInProcessDirectory(jobIdDirectory);
|
||||
if (!_StaticRuns.ContainsKey(_Logistics.Sequence))
|
||||
throw new Exception($"{nameof(_StaticRuns)} doesn't contain {_Logistics.Sequence}!");
|
||||
if (_StaticRuns[_Logistics.Sequence].Count != 1)
|
||||
throw new Exception($"{nameof(_StaticRuns)} has too many values for {_Logistics.Sequence}!");
|
||||
string json = _StaticRuns[_Logistics.Sequence][0];
|
||||
lock (_StaticRuns)
|
||||
_ = _StaticRuns.Remove(_Logistics.Sequence);
|
||||
json = string.Empty;
|
||||
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);
|
||||
}
|
||||
OpenInsightMetrologyViewer.WSRequest.PostOpenInsightMetrologyViewerAttachments(this, _Logistics, _OpenInsightMetrologyViewerAPI, _LincPDFCFileName, dateTime, json, descriptions, matchDirectories[0]);
|
||||
}
|
||||
|
||||
|
@ -180,6 +180,7 @@ public class FileRead : Properties.IFileRead
|
||||
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<Exception> threadExceptions)
|
||||
@ -300,10 +301,10 @@ public class FileRead : Properties.IFileRead
|
||||
List<int> consumedFileIndices = new();
|
||||
bool moreThanAnHour = _BreakAfterSeconds > 3600;
|
||||
long breakAfter = dateTime.AddSeconds(_BreakAfterSeconds).Ticks;
|
||||
if (moreThanAnHour)
|
||||
preWait = dateTime.AddSeconds(30).Ticks;
|
||||
if (_FileConnectorConfiguration?.FileHandleWaitTime is null)
|
||||
preWait = dateTime.AddMilliseconds(1234).Ticks;
|
||||
else
|
||||
preWait = dateTime.AddTicks(_LastTicksDuration).Ticks;
|
||||
preWait = dateTime.AddMilliseconds(_FileConnectorConfiguration.FileHandleWaitTime.Value).Ticks;
|
||||
if (!tuples.Any())
|
||||
duplicateFiles.Add(duplicateFile);
|
||||
string fileName = Path.GetFileNameWithoutExtension(logistics.ReportFullPath);
|
||||
@ -597,13 +598,13 @@ public class FileRead : Properties.IFileRead
|
||||
}
|
||||
}
|
||||
|
||||
protected void Shared0413(DateTime dateTime, bool isDummyRun, string successDirectory, string duplicateDirectory, List<(Properties.IScopeInfo, string)> tuples, string duplicateFile)
|
||||
protected void WaitForFileConsumption(DateTime dateTime, bool isDummyRun, string successDirectory, string duplicateDirectory, List<(Properties.IScopeInfo, string)> tuples, string duplicateFile)
|
||||
{
|
||||
if (!isDummyRun && _IsEAFHosted)
|
||||
WaitForFileConsumption(_FileConnectorConfiguration.SourceDirectoryCloaking, _Logistics, dateTime, successDirectory, duplicateDirectory, duplicateFile, tuples);
|
||||
else
|
||||
{
|
||||
long breakAfter = DateTime.Now.AddSeconds(_FileConnectorConfiguration.ConnectionRetryInterval.Value).Ticks;
|
||||
long breakAfter = DateTime.Now.AddSeconds(_FileConnectorConfiguration.FileHandleWaitTime.Value).Ticks;
|
||||
for (short i = 0; i < short.MaxValue; i++)
|
||||
{
|
||||
if (!_IsEAFHosted || DateTime.Now.Ticks > breakAfter)
|
||||
|
@ -895,6 +895,7 @@ public class AdaptationTesting : ISMTP
|
||||
{
|
||||
string[] results;
|
||||
string[] segments = GetSegments(methodBase.Name);
|
||||
string ticks = GetTicks(segments);
|
||||
FileInfo fileInfo = GetFileName(segments);
|
||||
string cellInstanceName = GetCellInstanceName(segments);
|
||||
string cellInstanceVersionName = GetCellInstanceVersionName(segments);
|
||||
@ -903,6 +904,16 @@ public class AdaptationTesting : ISMTP
|
||||
_ = Directory.CreateDirectory(fileInfo.Directory.FullName);
|
||||
Tuple<string, CellInstanceVersion> cellInstanceVersionTuple = GetCellInstanceVersionTuple(cellInstanceName, cellInstanceVersionName);
|
||||
Tuple<string, FileConnectorConfiguration> fileConnectorConfigurationTuple = GetFileConnectorConfigurationTuple(cellInstanceVersionTuple, cellInstanceConnectionName);
|
||||
if (string.IsNullOrEmpty(ticks) && fileConnectorConfigurationTuple.Item2?.FileScanningIntervalInSeconds is not null)
|
||||
{
|
||||
string fileScanningIntervalInSecondsLine;
|
||||
string versionDirectory = Path.GetDirectoryName(fileInfo.DirectoryName);
|
||||
if (fileConnectorConfigurationTuple.Item2.FileScanningIntervalInSeconds.Value < 0)
|
||||
fileScanningIntervalInSecondsLine = $"-\t{fileConnectorConfigurationTuple.Item2.FileScanningIntervalInSeconds.Value:0000}\t{Path.GetFileName(fileInfo.DirectoryName)}";
|
||||
else
|
||||
fileScanningIntervalInSecondsLine = $"+\t{fileConnectorConfigurationTuple.Item2.FileScanningIntervalInSeconds.Value:+0000}\t{Path.GetFileName(fileInfo.DirectoryName)}";
|
||||
File.AppendAllLines(Path.Combine(versionDirectory, "FileScanningIntervalInSeconds.txt"), new string[] { fileScanningIntervalInSecondsLine });
|
||||
}
|
||||
Tuple<string, string, string, EquipmentTypeVersion> equipmentTypeVersionTuple = GetEquipmentTypeVersionTuple(cellInstanceVersionTuple.Item2, cellInstanceConnectionName);
|
||||
Tuple<string, string> parameterizedModelObjectDefinitionTypeTuple = GetParameterizedModelObjectDefinitionTypeTuple(equipmentTypeVersionTuple);
|
||||
Tuple<string, IList<ModelObjectParameterDefinition>> modelObjectParametersTuple = GetModelObjectParameters(equipmentTypeVersionTuple);
|
||||
|
@ -101,10 +101,6 @@
|
||||
<Compile Include="Adaptation\FileHandlers\CellInstanceConnectionName.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\Dummy\FileRead.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\IQSSi\FileRead.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\MET08RESIHGCV\FileRead.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\MET08RESIHGCV\Hyphen.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\MET08RESIHGCV\ProcessData.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\MET08RESIHGCV\WSRequest.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\MoveMatchingFiles\FileRead.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\OpenInsightMetrologyViewerAttachments\FileRead.cs" />
|
||||
<Compile Include="Adaptation\FileHandlers\OpenInsightMetrologyViewer\FileRead.cs" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user