MET08DDUPSP1TBI - v2.43.0 - Using EDA
Multiple Storage Paths and delete old way
This commit is contained in:
142
Adaptation/FileHandlers/OpenInsightMetrologyViewer/FileRead.cs
Normal file
142
Adaptation/FileHandlers/OpenInsightMetrologyViewer/FileRead.cs
Normal file
@ -0,0 +1,142 @@
|
||||
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.IO;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace Adaptation.FileHandlers.OpenInsightMetrologyViewer;
|
||||
|
||||
public class FileRead : Shared.FileRead, IFileRead
|
||||
{
|
||||
|
||||
private readonly string _OpenInsightMetrologyViewerAPI;
|
||||
|
||||
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(this);
|
||||
if (_FileParameter is null)
|
||||
throw new Exception(cellInstanceConnectionName);
|
||||
if (_ModelObjectParameterDefinitions is null)
|
||||
throw new Exception(cellInstanceConnectionName);
|
||||
if (!_IsDuplicator)
|
||||
throw new Exception(cellInstanceConnectionName);
|
||||
_OpenInsightMetrologyViewerAPI = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "OpenInsight.MetrologyViewerAPI");
|
||||
}
|
||||
|
||||
void IFileRead.Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, Exception exception)
|
||||
{
|
||||
bool isErrorFile = exception is not null;
|
||||
if (!isErrorFile && !string.IsNullOrEmpty(_Logistics.ReportFullPath))
|
||||
{
|
||||
FileInfo fileInfo = new(_Logistics.ReportFullPath);
|
||||
if (fileInfo.Exists && fileInfo.LastWriteTime < fileInfo.CreationTime)
|
||||
File.SetLastWriteTime(_Logistics.ReportFullPath, fileInfo.CreationTime);
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
private void SendData(DateTime dateTime, List<txt.Description> descriptions)
|
||||
{
|
||||
if (dateTime == DateTime.MinValue)
|
||||
{ }
|
||||
WSRequest wsRequest = new(this, _Logistics, descriptions);
|
||||
(string json, WS.Results wsResults) = WS.SendData(_OpenInsightMetrologyViewerAPI, wsRequest);
|
||||
if (!wsResults.Success)
|
||||
throw new Exception(wsResults.ToString());
|
||||
_Log.Debug(wsResults.HeaderID);
|
||||
lock (_StaticRuns)
|
||||
{
|
||||
if (!_StaticRuns.ContainsKey(_Logistics.Sequence))
|
||||
_StaticRuns.Add(_Logistics.Sequence, new());
|
||||
_StaticRuns[_Logistics.Sequence].Add(json);
|
||||
}
|
||||
}
|
||||
|
||||
private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime dateTime)
|
||||
{
|
||||
Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
|
||||
Tuple<string, string[], string[]> pdsf = ProcessDataStandardFormat.GetLogisticsColumnsAndBody(reportFullPath);
|
||||
_Logistics = new Logistics(reportFullPath, pdsf.Item1);
|
||||
SetFileParameterLotIDToLogisticsMID();
|
||||
JsonElement[] jsonElements = ProcessDataStandardFormat.GetArray(pdsf);
|
||||
List<txt.Description> descriptions = txt.ProcessData.GetDescriptions(jsonElements);
|
||||
Test[] tests = (from l in descriptions select (Test)l.Test).ToArray();
|
||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(pdsf.Item1, tests, jsonElements, new List<FileInfo>());
|
||||
if (_IsEAFHosted && _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0)
|
||||
SendData(dateTime, descriptions);
|
||||
return results;
|
||||
}
|
||||
|
||||
}
|
681
Adaptation/FileHandlers/OpenInsightMetrologyViewer/WSRequest.cs
Normal file
681
Adaptation/FileHandlers/OpenInsightMetrologyViewer/WSRequest.cs
Normal file
@ -0,0 +1,681 @@
|
||||
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.Json;
|
||||
|
||||
namespace Adaptation.FileHandlers.OpenInsightMetrologyViewer;
|
||||
|
||||
public class WSRequest
|
||||
{
|
||||
public bool SentToMetrology { get; set; }
|
||||
public bool SentToSPC { get; set; }
|
||||
//
|
||||
|
||||
public string CellName { get; set; }
|
||||
public string Date { get; set; }
|
||||
public string LotID { get; set; }
|
||||
public string Operator { get; set; }
|
||||
public string PSN { get; set; }
|
||||
public string RDS { get; set; }
|
||||
public string Reactor { get; set; }
|
||||
public string Recipe { get; set; }
|
||||
public string Session { get; set; }
|
||||
public string UniqueID { get; set; }
|
||||
public string DcnAllMax { get; set; }
|
||||
public string DcnAllMean { get; set; }
|
||||
public string DcnAllMin { get; set; }
|
||||
public string DcnAllStDev { get; set; }
|
||||
public string DcnAreaCntMax { get; set; }
|
||||
public string DcnAreaCntMean { get; set; }
|
||||
public string DcnAreaCntMin { get; set; }
|
||||
public string DcnAreaCntStDev { get; set; }
|
||||
public string DcnAreaMax { get; set; }
|
||||
public string DcnAreaMean { get; set; }
|
||||
public string DcnAreaMin { get; set; }
|
||||
public string DcnAreaStDev { get; set; }
|
||||
public string DcnBin1Max { get; set; }
|
||||
public string DcnBin1Mean { get; set; }
|
||||
public string DcnBin1Min { get; set; }
|
||||
public string DcnBin1StDev { get; set; }
|
||||
public string DcnBin2Max { get; set; }
|
||||
public string DcnBin2Mean { get; set; }
|
||||
public string DcnBin2Min { get; set; }
|
||||
public string DcnBin2StDev { get; set; }
|
||||
public string DcnBin3Max { get; set; }
|
||||
public string DcnBin3Mean { get; set; }
|
||||
public string DcnBin3Min { get; set; }
|
||||
public string DcnBin3StDev { get; set; }
|
||||
public string DcnBin4Max { get; set; }
|
||||
public string DcnBin4Mean { get; set; }
|
||||
public string DcnBin4Min { get; set; }
|
||||
public string DcnBin4StDev { get; set; }
|
||||
public string DcnBin5Max { get; set; }
|
||||
public string DcnBin5Mean { get; set; }
|
||||
public string DcnBin5Min { get; set; }
|
||||
public string DcnBin5StDev { get; set; }
|
||||
public string DcnBin6Max { get; set; }
|
||||
public string DcnBin6Mean { get; set; }
|
||||
public string DcnBin6Min { get; set; }
|
||||
public string DcnBin6StDev { get; set; }
|
||||
public string DcnBin7Max { get; set; }
|
||||
public string DcnBin7Mean { get; set; }
|
||||
public string DcnBin7Min { get; set; }
|
||||
public string DcnBin7StDev { get; set; }
|
||||
public string DcnBin8Max { get; set; }
|
||||
public string DcnBin8Mean { get; set; }
|
||||
public string DcnBin8Min { get; set; }
|
||||
public string DcnBin8StDev { get; set; }
|
||||
public string DcnHazeAvgMax { get; set; }
|
||||
public string DcnHazeAvgMean { get; set; }
|
||||
public string DcnHazeAvgMin { get; set; }
|
||||
public string DcnHazeAvgStDev { get; set; }
|
||||
public string DcnHazeMedMax { get; set; }
|
||||
public string DcnHazeMedMean { get; set; }
|
||||
public string DcnHazeMedMin { get; set; }
|
||||
public string DcnHazeMedStDev { get; set; }
|
||||
public string DcnHazeStDevMax { get; set; }
|
||||
public string DcnHazeStDevMean { get; set; }
|
||||
public string DcnHazeStDevMin { get; set; }
|
||||
public string DcnHazeStDevStDev { get; set; }
|
||||
public string DcnLpdESMax { get; set; }
|
||||
public string DcnLpdESMean { get; set; }
|
||||
public string DcnLpdESMin { get; set; }
|
||||
public string DcnLpdESStDev { get; set; }
|
||||
public string DcnLpdMax { get; set; }
|
||||
public string DcnLpdMean { get; set; }
|
||||
public string DcnLpdMin { get; set; }
|
||||
public string DcnLpdNMax { get; set; }
|
||||
public string DcnLpdNMean { get; set; }
|
||||
public string DcnLpdNMin { get; set; }
|
||||
public string DcnLpdNStDev { get; set; }
|
||||
public string DcnLpdStDev { get; set; }
|
||||
public string DcnMicroScrMax { get; set; }
|
||||
public string DcnMicroScrMean { get; set; }
|
||||
public string DcnMicroScrMin { get; set; }
|
||||
public string DcnMicroScrStDev { get; set; }
|
||||
public string DcnScrMax { get; set; }
|
||||
public string DcnScrMean { get; set; }
|
||||
public string DcnScrMin { get; set; }
|
||||
public string DcnScrStDev { get; set; }
|
||||
public string DcnSlipMax { get; set; }
|
||||
public string DcnSlipMean { get; set; }
|
||||
public string DcnSlipMin { get; set; }
|
||||
public string DcnSlipStDev { get; set; }
|
||||
public string DnnAllMax { get; set; }
|
||||
public string DnnAllMean { get; set; }
|
||||
public string DnnAllMin { get; set; }
|
||||
public string DnnAllStDev { get; set; }
|
||||
public string DnnAreaCntMax { get; set; }
|
||||
public string DnnAreaCntMean { get; set; }
|
||||
public string DnnAreaCntMin { get; set; }
|
||||
public string DnnAreaCntStDev { get; set; }
|
||||
public string DnnAreaMax { get; set; }
|
||||
public string DnnAreaMean { get; set; }
|
||||
public string DnnAreaMin { get; set; }
|
||||
public string DnnAreaStDev { get; set; }
|
||||
public string DnnBin1Max { get; set; }
|
||||
public string DnnBin1Mean { get; set; }
|
||||
public string DnnBin1Min { get; set; }
|
||||
public string DnnBin1StDev { get; set; }
|
||||
public string DnnBin2Max { get; set; }
|
||||
public string DnnBin2Mean { get; set; }
|
||||
public string DnnBin2Min { get; set; }
|
||||
public string DnnBin2StDev { get; set; }
|
||||
public string DnnBin3Max { get; set; }
|
||||
public string DnnBin3Mean { get; set; }
|
||||
public string DnnBin3Min { get; set; }
|
||||
public string DnnBin3StDev { get; set; }
|
||||
public string DnnBin4Max { get; set; }
|
||||
public string DnnBin4Mean { get; set; }
|
||||
public string DnnBin4Min { get; set; }
|
||||
public string DnnBin4StDev { get; set; }
|
||||
public string DnnBin5Max { get; set; }
|
||||
public string DnnBin5Mean { get; set; }
|
||||
public string DnnBin5Min { get; set; }
|
||||
public string DnnBin5StDev { get; set; }
|
||||
public string DnnBin6Max { get; set; }
|
||||
public string DnnBin6Mean { get; set; }
|
||||
public string DnnBin6Min { get; set; }
|
||||
public string DnnBin6StDev { get; set; }
|
||||
public string DnnBin7Max { get; set; }
|
||||
public string DnnBin7Mean { get; set; }
|
||||
public string DnnBin7Min { get; set; }
|
||||
public string DnnBin7StDev { get; set; }
|
||||
public string DnnBin8Max { get; set; }
|
||||
public string DnnBin8Mean { get; set; }
|
||||
public string DnnBin8Min { get; set; }
|
||||
public string DnnBin8StDev { get; set; }
|
||||
public string DnnHazeAvgMax { get; set; }
|
||||
public string DnnHazeAvgMean { get; set; }
|
||||
public string DnnHazeAvgMin { get; set; }
|
||||
public string DnnHazeAvgStDev { get; set; }
|
||||
public string DnnHazeMedMax { get; set; }
|
||||
public string DnnHazeMedMean { get; set; }
|
||||
public string DnnHazeMedMin { get; set; }
|
||||
public string DnnHazeMedStDev { get; set; }
|
||||
public string DnnHazeStDevMax { get; set; }
|
||||
public string DnnHazeStDevMean { get; set; }
|
||||
public string DnnHazeStDevMin { get; set; }
|
||||
public string DnnHazeStDevStDev { get; set; }
|
||||
public string DnnLpdESMax { get; set; }
|
||||
public string DnnLpdESMean { get; set; }
|
||||
public string DnnLpdESMin { get; set; }
|
||||
public string DnnLpdESStDev { get; set; }
|
||||
public string DnnLpdMax { get; set; }
|
||||
public string DnnLpdMean { get; set; }
|
||||
public string DnnLpdMin { get; set; }
|
||||
public string DnnLpdNMax { get; set; }
|
||||
public string DnnLpdNMean { get; set; }
|
||||
public string DnnLpdNMin { get; set; }
|
||||
public string DnnLpdNStDev { get; set; }
|
||||
public string DnnLpdStDev { get; set; }
|
||||
public string DnnMicroScrMax { get; set; }
|
||||
public string DnnMicroScrMean { get; set; }
|
||||
public string DnnMicroScrMin { get; set; }
|
||||
public string DnnMicroScrStDev { get; set; }
|
||||
public string DnnScrMax { get; set; }
|
||||
public string DnnScrMean { get; set; }
|
||||
public string DnnScrMin { get; set; }
|
||||
public string DnnScrStDev { get; set; }
|
||||
public string DnnSlipMax { get; set; }
|
||||
public string DnnSlipMean { get; set; }
|
||||
public string DnnSlipMin { get; set; }
|
||||
public string DnnSlipStDev { get; set; }
|
||||
public string DwnAllMax { get; set; }
|
||||
public string DwnAllMean { get; set; }
|
||||
public string DwnAllMin { get; set; }
|
||||
public string DwnAllStDev { get; set; }
|
||||
public string DwnAreaCntMax { get; set; }
|
||||
public string DwnAreaCntMean { get; set; }
|
||||
public string DwnAreaCntMin { get; set; }
|
||||
public string DwnAreaCntStDev { get; set; }
|
||||
public string DwnAreaMax { get; set; }
|
||||
public string DwnAreaMean { get; set; }
|
||||
public string DwnAreaMin { get; set; }
|
||||
public string DwnAreaStDev { get; set; }
|
||||
public string DwnBin1Max { get; set; }
|
||||
public string DwnBin1Mean { get; set; }
|
||||
public string DwnBin1Min { get; set; }
|
||||
public string DwnBin1StDev { get; set; }
|
||||
public string DwnBin2Max { get; set; }
|
||||
public string DwnBin2Mean { get; set; }
|
||||
public string DwnBin2Min { get; set; }
|
||||
public string DwnBin2StDev { get; set; }
|
||||
public string DwnBin3Max { get; set; }
|
||||
public string DwnBin3Mean { get; set; }
|
||||
public string DwnBin3Min { get; set; }
|
||||
public string DwnBin3StDev { get; set; }
|
||||
public string DwnBin4Max { get; set; }
|
||||
public string DwnBin4Mean { get; set; }
|
||||
public string DwnBin4Min { get; set; }
|
||||
public string DwnBin4StDev { get; set; }
|
||||
public string DwnBin5Max { get; set; }
|
||||
public string DwnBin5Mean { get; set; }
|
||||
public string DwnBin5Min { get; set; }
|
||||
public string DwnBin5StDev { get; set; }
|
||||
public string DwnBin6Max { get; set; }
|
||||
public string DwnBin6Mean { get; set; }
|
||||
public string DwnBin6Min { get; set; }
|
||||
public string DwnBin6StDev { get; set; }
|
||||
public string DwnBin7Max { get; set; }
|
||||
public string DwnBin7Mean { get; set; }
|
||||
public string DwnBin7Min { get; set; }
|
||||
public string DwnBin7StDev { get; set; }
|
||||
public string DwnBin8Max { get; set; }
|
||||
public string DwnBin8Mean { get; set; }
|
||||
public string DwnBin8Min { get; set; }
|
||||
public string DwnBin8StDev { get; set; }
|
||||
public string DwnHazeAvgMax { get; set; }
|
||||
public string DwnHazeAvgMean { get; set; }
|
||||
public string DwnHazeAvgMin { get; set; }
|
||||
public string DwnHazeAvgStDev { get; set; }
|
||||
public string DwnHazeMedMax { get; set; }
|
||||
public string DwnHazeMedMean { get; set; }
|
||||
public string DwnHazeMedMin { get; set; }
|
||||
public string DwnHazeMedStDev { get; set; }
|
||||
public string DwnHazeStDevMax { get; set; }
|
||||
public string DwnHazeStDevMean { get; set; }
|
||||
public string DwnHazeStDevMin { get; set; }
|
||||
public string DwnHazeStDevStDev { get; set; }
|
||||
public string DwnLpdESMax { get; set; }
|
||||
public string DwnLpdESMean { get; set; }
|
||||
public string DwnLpdESMin { get; set; }
|
||||
public string DwnLpdESStDev { get; set; }
|
||||
public string DwnLpdMax { get; set; }
|
||||
public string DwnLpdMean { get; set; }
|
||||
public string DwnLpdMin { get; set; }
|
||||
public string DwnLpdNMax { get; set; }
|
||||
public string DwnLpdNMean { get; set; }
|
||||
public string DwnLpdNMin { get; set; }
|
||||
public string DwnLpdNStDev { get; set; }
|
||||
public string DwnLpdStDev { get; set; }
|
||||
public string DwnMicroScrMax { get; set; }
|
||||
public string DwnMicroScrMean { get; set; }
|
||||
public string DwnMicroScrMin { get; set; }
|
||||
public string DwnMicroScrStDev { get; set; }
|
||||
public string DwnScrMax { get; set; }
|
||||
public string DwnScrMean { get; set; }
|
||||
public string DwnScrMin { get; set; }
|
||||
public string DwnScrStDev { get; set; }
|
||||
public string DwnSlipMax { get; set; }
|
||||
public string DwnSlipMean { get; set; }
|
||||
public string DwnSlipMin { get; set; }
|
||||
public string DwnSlipStDev { get; set; }
|
||||
public List<txt.Detail> Details { get; protected set; }
|
||||
|
||||
[Obsolete("For json")] public WSRequest() { }
|
||||
|
||||
internal WSRequest(IFileRead fileRead, Logistics logistics, List<txt.Description> descriptions)
|
||||
{
|
||||
if (fileRead is null)
|
||||
{ }
|
||||
Details = new List<txt.Detail>();
|
||||
CellName = logistics.MesEntity;
|
||||
txt.Description x = descriptions[0];
|
||||
//Header
|
||||
{
|
||||
UniqueID = x.UniqueId;
|
||||
Date = x.Date;
|
||||
Reactor = x.Reactor;
|
||||
LotID = x.Lot;
|
||||
Session = x.Session;
|
||||
DcnAllMin = x.DcnAllMin;
|
||||
DcnAllMax = x.DcnAllMax;
|
||||
DcnAllMean = x.DcnAllMean;
|
||||
DcnAllStDev = x.DcnAllStdDev;
|
||||
DcnLpdMin = x.DcnLpdMin;
|
||||
DcnLpdMax = x.DcnLpdMax;
|
||||
DcnLpdMean = x.DcnLpdMean;
|
||||
DcnLpdStDev = x.DcnLpdStdDev;
|
||||
DcnLpdNMin = x.DcnLpdNMin;
|
||||
DcnLpdNMax = x.DcnLpdNMax;
|
||||
DcnLpdNMean = x.DcnLpdNMean;
|
||||
DcnLpdNStDev = x.DcnLpdNStdDev;
|
||||
DcnLpdESMin = x.DcnLpdESMin;
|
||||
DcnLpdESMax = x.DcnLpdESMax;
|
||||
DcnLpdESMean = x.DcnLpdESMean;
|
||||
DcnLpdESStDev = x.DcnLpdESStdDev;
|
||||
DcnMicroScrMin = x.DcnMicroScrMin;
|
||||
DcnMicroScrMax = x.DcnMicroScrMax;
|
||||
DcnMicroScrMean = x.DcnMicroScrMean;
|
||||
DcnMicroScrStDev = x.DcnMicroScrStdDev;
|
||||
DcnScrMin = x.DcnScrMin;
|
||||
DcnScrMax = x.DcnScrMax;
|
||||
DcnScrMean = x.DcnScrMean;
|
||||
DcnScrStDev = x.DcnScrStdDev;
|
||||
DcnSlipMin = x.DcnSlipMin;
|
||||
DcnSlipMax = x.DcnSlipMax;
|
||||
DcnSlipMean = x.DcnSlipMean;
|
||||
DcnSlipStDev = x.DcnSlipStdDev;
|
||||
DcnAreaCntMin = x.DcnAreaCountMin;
|
||||
DcnAreaCntMax = x.DcnAreaCountMax;
|
||||
DcnAreaCntMean = x.DcnAreaCountMean;
|
||||
DcnAreaCntStDev = x.DcnAreaCountStdDev;
|
||||
DcnAreaMin = x.DcnAreaMin;
|
||||
DcnAreaMax = x.DcnAreaMax;
|
||||
DcnAreaMean = x.DcnAreaMean;
|
||||
DcnAreaStDev = x.DcnAreaStdDev;
|
||||
DcnHazeAvgMin = x.DcnHazeAvgMin;
|
||||
DcnHazeAvgMax = x.DcnHazeAvgMax;
|
||||
DcnHazeAvgMean = x.DcnHazeAvgMean;
|
||||
DcnHazeAvgStDev = x.DcnHazeAvgStdDev;
|
||||
DcnHazeMedMin = x.DcnHazeMedianMin;
|
||||
DcnHazeMedMax = x.DcnHazeMedianMax;
|
||||
DcnHazeMedMean = x.DcnHazeMedianMean;
|
||||
DcnHazeMedStDev = x.DcnHazeMedianStdDev;
|
||||
DcnHazeStDevMin = x.DcnHazeStdDevMin;
|
||||
DcnHazeStDevMax = x.DcnHazeStdDevMax;
|
||||
DcnHazeStDevMean = x.DcnHazeStdDevMean;
|
||||
DcnHazeStDevStDev = x.DcnHazeStdDevStdDev;
|
||||
DcnBin1Min = x.DcnBin1Min;
|
||||
DcnBin1Max = x.DcnBin1Max;
|
||||
DcnBin1Mean = x.DcnBin1Mean;
|
||||
DcnBin1StDev = x.DcnBin1StdDev;
|
||||
DcnBin2Min = x.DcnBin2Min;
|
||||
DcnBin2Max = x.DcnBin2Max;
|
||||
DcnBin2Mean = x.DcnBin2Mean;
|
||||
DcnBin2StDev = x.DcnBin2StdDev;
|
||||
DcnBin3Min = x.DcnBin3Min;
|
||||
DcnBin3Max = x.DcnBin3Max;
|
||||
DcnBin3Mean = x.DcnBin3Mean;
|
||||
DcnBin3StDev = x.DcnBin3StdDev;
|
||||
DcnBin4Min = x.DcnBin4Min;
|
||||
DcnBin4Max = x.DcnBin4Max;
|
||||
DcnBin4Mean = x.DcnBin4Mean;
|
||||
DcnBin4StDev = x.DcnBin4StdDev;
|
||||
DcnBin5Min = x.DcnBin5Min;
|
||||
DcnBin5Max = x.DcnBin5Max;
|
||||
DcnBin5Mean = x.DcnBin5Mean;
|
||||
DcnBin5StDev = x.DcnBin5StdDev;
|
||||
DcnBin6Min = x.DcnBin6Min;
|
||||
DcnBin6Max = x.DcnBin6Max;
|
||||
DcnBin6Mean = x.DcnBin6Mean;
|
||||
DcnBin6StDev = x.DcnBin6StdDev;
|
||||
DcnBin7Min = x.DcnBin7Min;
|
||||
DcnBin7Max = x.DcnBin7Max;
|
||||
DcnBin7Mean = x.DcnBin7Mean;
|
||||
DcnBin7StDev = x.DcnBin7StdDev;
|
||||
DcnBin8Min = x.DcnBin8Min;
|
||||
DcnBin8Max = x.DcnBin8Max;
|
||||
DcnBin8Mean = x.DcnBin8Mean;
|
||||
DcnBin8StDev = x.DcnBin8StdDev;
|
||||
DwnAllMin = x.DwnAllMin;
|
||||
DwnAllMax = x.DwnAllMax;
|
||||
DwnAllMean = x.DwnAllMean;
|
||||
DwnAllStDev = x.DwnAllStdDev;
|
||||
DwnLpdMin = x.DwnLpdMin;
|
||||
DwnLpdMax = x.DwnLpdMax;
|
||||
DwnLpdMean = x.DwnLpdMean;
|
||||
DwnLpdStDev = x.DwnLpdStdDev;
|
||||
DwnLpdNMin = x.DwnLpdNMin;
|
||||
DwnLpdNMax = x.DwnLpdNMax;
|
||||
DwnLpdNMean = x.DwnLpdNMean;
|
||||
DwnLpdNStDev = x.DwnLpdNStdDev;
|
||||
DwnLpdESMin = x.DwnLpdESMin;
|
||||
DwnLpdESMax = x.DwnLpdESMax;
|
||||
DwnLpdESMean = x.DwnLpdESMean;
|
||||
DwnLpdESStDev = x.DwnLpdESStdDev;
|
||||
DwnMicroScrMin = x.DwnMicroScrMin;
|
||||
DwnMicroScrMax = x.DwnMicroScrMax;
|
||||
DwnMicroScrMean = x.DwnMicroScrMean;
|
||||
DwnMicroScrStDev = x.DwnMicroScrStdDev;
|
||||
DwnScrMin = x.DwnScrMin;
|
||||
DwnScrMax = x.DwnScrMax;
|
||||
DwnScrMean = x.DwnScrMean;
|
||||
DwnScrStDev = x.DwnScrStdDev;
|
||||
DwnSlipMin = x.DwnSlipMin;
|
||||
DwnSlipMax = x.DwnSlipMax;
|
||||
DwnSlipMean = x.DwnSlipMean;
|
||||
DwnSlipStDev = x.DwnSlipStdDev;
|
||||
DwnAreaCntMin = x.DwnAreaCountMin;
|
||||
DwnAreaCntMax = x.DwnAreaCountMax;
|
||||
DwnAreaCntMean = x.DwnAreaCountMean;
|
||||
DwnAreaCntStDev = x.DwnAreaCountStdDev;
|
||||
DwnAreaMin = x.DwnAreaMin;
|
||||
DwnAreaMax = x.DwnAreaMax;
|
||||
DwnAreaMean = x.DwnAreaMean;
|
||||
DwnAreaStDev = x.DwnAreaStdDev;
|
||||
DwnHazeAvgMin = x.DwnHazeAvgMin;
|
||||
DwnHazeAvgMax = x.DwnHazeAvgMax;
|
||||
DwnHazeAvgMean = x.DwnHazeAvgMean;
|
||||
DwnHazeAvgStDev = x.DwnHazeAvgStdDev;
|
||||
DwnHazeMedMin = x.DwnHazeMedianMin;
|
||||
DwnHazeMedMax = x.DwnHazeMedianMax;
|
||||
DwnHazeMedMean = x.DwnHazeMedianMean;
|
||||
DwnHazeMedStDev = x.DwnHazeMedianStdDev;
|
||||
DwnHazeStDevMin = x.DwnHazeStdDevMin;
|
||||
DwnHazeStDevMax = x.DwnHazeStdDevMax;
|
||||
DwnHazeStDevMean = x.DwnHazeStdDevMean;
|
||||
DwnHazeStDevStDev = x.DwnHazeStdDevStdDev;
|
||||
DwnBin1Min = x.DwnBin1Min;
|
||||
DwnBin1Max = x.DwnBin1Max;
|
||||
DwnBin1Mean = x.DwnBin1Mean;
|
||||
DwnBin1StDev = x.DwnBin1StdDev;
|
||||
DwnBin2Min = x.DwnBin2Min;
|
||||
DwnBin2Max = x.DwnBin2Max;
|
||||
DwnBin2Mean = x.DwnBin2Mean;
|
||||
DwnBin2StDev = x.DwnBin2StdDev;
|
||||
DwnBin3Min = x.DwnBin3Min;
|
||||
DwnBin3Max = x.DwnBin3Max;
|
||||
DwnBin3Mean = x.DwnBin3Mean;
|
||||
DwnBin3StDev = x.DwnBin3StdDev;
|
||||
DwnBin4Min = x.DwnBin4Min;
|
||||
DwnBin4Max = x.DwnBin4Max;
|
||||
DwnBin4Mean = x.DwnBin4Mean;
|
||||
DwnBin4StDev = x.DwnBin4StdDev;
|
||||
DwnBin5Min = x.DwnBin5Min;
|
||||
DwnBin5Max = x.DwnBin5Max;
|
||||
DwnBin5Mean = x.DwnBin5Mean;
|
||||
DwnBin5StDev = x.DwnBin5StdDev;
|
||||
DwnBin6Min = x.DwnBin6Min;
|
||||
DwnBin6Max = x.DwnBin6Max;
|
||||
DwnBin6Mean = x.DwnBin6Mean;
|
||||
DwnBin6StDev = x.DwnBin6StdDev;
|
||||
DwnBin7Min = x.DwnBin7Min;
|
||||
DwnBin7Max = x.DwnBin7Max;
|
||||
DwnBin7Mean = x.DwnBin7Mean;
|
||||
DwnBin7StDev = x.DwnBin7StdDev;
|
||||
DwnBin8Min = x.DwnBin8Min;
|
||||
DwnBin8Max = x.DwnBin8Max;
|
||||
DwnBin8Mean = x.DwnBin8Mean;
|
||||
DwnBin8StDev = x.DwnBin8StdDev;
|
||||
DnnAllMin = x.DnnAllMin;
|
||||
DnnAllMax = x.DnnAllMax;
|
||||
DnnAllMean = x.DnnAllMean;
|
||||
DnnAllStDev = x.DnnAllStdDev;
|
||||
DnnLpdMin = x.DnnLpdMin;
|
||||
DnnLpdMax = x.DnnLpdMax;
|
||||
DnnLpdMean = x.DnnLpdMean;
|
||||
DnnLpdStDev = x.DnnLpdStdDev;
|
||||
DnnLpdNMin = x.DnnLpdNMin;
|
||||
DnnLpdNMax = x.DnnLpdNMax;
|
||||
DnnLpdNMean = x.DnnLpdNMean;
|
||||
DnnLpdNStDev = x.DnnLpdNStdDev;
|
||||
DnnLpdESMin = x.DnnLpdESMin;
|
||||
DnnLpdESMax = x.DnnLpdESMax;
|
||||
DnnLpdESMean = x.DnnLpdESMean;
|
||||
DnnLpdESStDev = x.DnnLpdESStdDev;
|
||||
DnnMicroScrMin = x.DnnMicroScrMin;
|
||||
DnnMicroScrMax = x.DnnMicroScrMax;
|
||||
DnnMicroScrMean = x.DnnMicroScrMean;
|
||||
DnnMicroScrStDev = x.DnnMicroScrStdDev;
|
||||
DnnScrMin = x.DnnScrMin;
|
||||
DnnScrMax = x.DnnScrMax;
|
||||
DnnScrMean = x.DnnScrMean;
|
||||
DnnScrStDev = x.DnnScrStdDev;
|
||||
DnnSlipMin = x.DnnSlipMin;
|
||||
DnnSlipMax = x.DnnSlipMax;
|
||||
DnnSlipMean = x.DnnSlipMean;
|
||||
DnnSlipStDev = x.DnnSlipStdDev;
|
||||
DnnAreaCntMin = x.DnnAreaCountMin;
|
||||
DnnAreaCntMax = x.DnnAreaCountMax;
|
||||
DnnAreaCntMean = x.DnnAreaCountMean;
|
||||
DnnAreaCntStDev = x.DnnAreaCountStdDev;
|
||||
DnnAreaMin = x.DnnAreaMin;
|
||||
DnnAreaMax = x.DnnAreaMax;
|
||||
DnnAreaMean = x.DnnAreaMean;
|
||||
DnnAreaStDev = x.DnnAreaStdDev;
|
||||
DnnHazeAvgMin = x.DnnHazeAvgMin;
|
||||
DnnHazeAvgMax = x.DnnHazeAvgMax;
|
||||
DnnHazeAvgMean = x.DnnHazeAvgMean;
|
||||
DnnHazeAvgStDev = x.DnnHazeAvgStdDev;
|
||||
DnnHazeMedMin = x.DnnHazeMedianMin;
|
||||
DnnHazeMedMax = x.DnnHazeMedianMax;
|
||||
DnnHazeMedMean = x.DnnHazeMedianMean;
|
||||
DnnHazeMedStDev = x.DnnHazeMedianStdDev;
|
||||
DnnHazeStDevMin = x.DnnHazeStdDevMin;
|
||||
DnnHazeStDevMax = x.DnnHazeStdDevMax;
|
||||
DnnHazeStDevMean = x.DnnHazeStdDevMean;
|
||||
DnnHazeStDevStDev = x.DnnHazeStdDevStdDev;
|
||||
DnnBin1Min = x.DnnBin1Min;
|
||||
DnnBin1Max = x.DnnBin1Max;
|
||||
DnnBin1Mean = x.DnnBin1Mean;
|
||||
DnnBin1StDev = x.DnnBin1StdDev;
|
||||
DnnBin2Min = x.DnnBin2Min;
|
||||
DnnBin2Max = x.DnnBin2Max;
|
||||
DnnBin2Mean = x.DnnBin2Mean;
|
||||
DnnBin2StDev = x.DnnBin2StdDev;
|
||||
DnnBin3Min = x.DnnBin3Min;
|
||||
DnnBin3Max = x.DnnBin3Max;
|
||||
DnnBin3Mean = x.DnnBin3Mean;
|
||||
DnnBin3StDev = x.DnnBin3StdDev;
|
||||
DnnBin4Min = x.DnnBin4Min;
|
||||
DnnBin4Max = x.DnnBin4Max;
|
||||
DnnBin4Mean = x.DnnBin4Mean;
|
||||
DnnBin4StDev = x.DnnBin4StdDev;
|
||||
DnnBin5Min = x.DnnBin5Min;
|
||||
DnnBin5Max = x.DnnBin5Max;
|
||||
DnnBin5Mean = x.DnnBin5Mean;
|
||||
DnnBin5StDev = x.DnnBin5StdDev;
|
||||
DnnBin6Min = x.DnnBin6Min;
|
||||
DnnBin6Max = x.DnnBin6Max;
|
||||
DnnBin6Mean = x.DnnBin6Mean;
|
||||
DnnBin6StDev = x.DnnBin6StdDev;
|
||||
DnnBin7Min = x.DnnBin7Min;
|
||||
DnnBin7Max = x.DnnBin7Max;
|
||||
DnnBin7Mean = x.DnnBin7Mean;
|
||||
DnnBin7StDev = x.DnnBin7StdDev;
|
||||
DnnBin8Min = x.DnnBin8Min;
|
||||
DnnBin8Max = x.DnnBin8Max;
|
||||
DnnBin8Mean = x.DnnBin8Mean;
|
||||
DnnBin8StDev = x.DnnBin8StdDev;
|
||||
RDS = x.RDS;
|
||||
PSN = x.PSN;
|
||||
Recipe = x.Recipe;
|
||||
Operator = x.Employee;
|
||||
}
|
||||
txt.Detail detail;
|
||||
foreach (txt.Description description in descriptions)
|
||||
{
|
||||
detail = new txt.Detail
|
||||
{
|
||||
Grade = description.Grade,
|
||||
HeaderUniqueID = description.HeaderUniqueId,
|
||||
Side = description.Side,
|
||||
SrcDest = description.SrcDest,
|
||||
UniqueID = description.UniqueId,
|
||||
WaferID = description.WaferID,
|
||||
Data = "*Data*",
|
||||
DcnAll = description.DcnAll,
|
||||
DcnArea = description.DcnArea,
|
||||
DcnAreaCount = description.DcnAreaCount,
|
||||
DcnBin1 = description.DcnBin1,
|
||||
DcnBin2 = description.DcnBin2,
|
||||
DcnBin3 = description.DcnBin3,
|
||||
DcnBin4 = description.DcnBin4,
|
||||
DcnBin5 = description.DcnBin5,
|
||||
DcnBin6 = description.DcnBin6,
|
||||
DcnBin7 = description.DcnBin7,
|
||||
DcnBin8 = description.DcnBin8,
|
||||
DcnHazeAvg = description.DcnHazeAvg,
|
||||
DcnHazeMedian = description.DcnHazeMedian,
|
||||
DcnHazeStdDev = description.DcnHazeStdDev,
|
||||
DcnLpd = description.DcnLpd,
|
||||
DcnLpdES = description.DcnLpdES,
|
||||
DcnLpdN = description.DcnLpdN,
|
||||
DcnMicroScr = description.DcnMicroScr,
|
||||
DcnScr = description.DcnScr,
|
||||
DcnSlip = description.DcnSlip,
|
||||
DnnAll = description.DnnAll,
|
||||
DnnArea = description.DnnArea,
|
||||
DnnAreaCount = description.DnnAreaCount,
|
||||
DnnBin1 = description.DnnBin1,
|
||||
DnnBin2 = description.DnnBin2,
|
||||
DnnBin3 = description.DnnBin3,
|
||||
DnnBin4 = description.DnnBin4,
|
||||
DnnBin5 = description.DnnBin5,
|
||||
DnnBin6 = description.DnnBin6,
|
||||
DnnBin7 = description.DnnBin7,
|
||||
DnnBin8 = description.DnnBin8,
|
||||
DnnHazeAvg = description.DnnHazeAvg,
|
||||
DnnHazeMedian = description.DnnHazeMedian,
|
||||
DnnHazeStdDev = description.DnnHazeStdDev,
|
||||
DnnLpd = description.DnnLpd,
|
||||
DnnLpdES = description.DnnLpdES,
|
||||
DnnLpdN = description.DnnLpdN,
|
||||
DnnMicroScr = description.DnnMicroScr,
|
||||
DnnScr = description.DnnScr,
|
||||
DnnSlip = description.DnnSlip,
|
||||
DwnAll = description.DwnAll,
|
||||
DwnArea = description.DwnArea,
|
||||
DwnAreaCount = description.DwnAreaCount,
|
||||
DwnBin1 = description.DwnBin1,
|
||||
DwnBin2 = description.DwnBin2,
|
||||
DwnBin3 = description.DwnBin3,
|
||||
DwnBin4 = description.DwnBin4,
|
||||
DwnBin5 = description.DwnBin5,
|
||||
DwnBin6 = description.DwnBin6,
|
||||
DwnBin7 = description.DwnBin7,
|
||||
DwnBin8 = description.DwnBin8,
|
||||
DwnHazeAvg = description.DwnHazeAvg,
|
||||
DwnHazeMedian = description.DwnHazeMedian,
|
||||
DwnHazeStdDev = description.DwnHazeStdDev,
|
||||
DwnLpd = description.DwnLpd,
|
||||
DwnLpdES = description.DwnLpdES,
|
||||
DwnLpdN = description.DwnLpdN,
|
||||
DwnMicroScr = description.DwnMicroScr,
|
||||
DwnScr = description.DwnScr,
|
||||
DwnSlip = description.DwnSlip
|
||||
};
|
||||
Details.Add(detail);
|
||||
}
|
||||
Date = logistics.DateTimeFromSequence.ToString();
|
||||
if (UniqueID is null && Details.Any())
|
||||
UniqueID = Details[0].HeaderUniqueID;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert the raw data file to parsable file format - in this case from PRN to PDF
|
||||
/// </summary>
|
||||
/// <param name="sourceFile">source file to be converted to PDF</param>
|
||||
/// <returns></returns>
|
||||
private static string ConvertSourceFileToPdf(string ghostPCLFileName, 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 -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 ghostPCLFileName, DateTime dateTime, string json, List<txt.Description> descriptions, string matchDirectory)
|
||||
{
|
||||
if (fileRead is null)
|
||||
{ }
|
||||
if (logistics is null)
|
||||
{ }
|
||||
if (dateTime == DateTime.MinValue)
|
||||
{ }
|
||||
if (descriptions is null)
|
||||
{ }
|
||||
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[] summaryFiles = Directory.GetFiles(matchDirectory, "*.txt", SearchOption.TopDirectoryOnly);
|
||||
if (summaryFiles.Length != 1)
|
||||
throw new Exception($"Invalid source file count for <{wsResultsHeaderID}>!{Environment.NewLine}{json}");
|
||||
string[] prnFiles = Directory.GetFiles(matchDirectory, "WaferMap*.prn", SearchOption.TopDirectoryOnly);
|
||||
if (prnFiles.Length == 0 || prnFiles.Length != descriptions.Count)
|
||||
throw new Exception("Invalid WaferMap*.prn file count!");
|
||||
List<string> pdfFiles = new();
|
||||
foreach (string prnFile in prnFiles.OrderBy(l => l))
|
||||
pdfFiles.Add(ConvertSourceFileToPdf(ghostPCLFileName, prnFile));
|
||||
if (pdfFiles.Count == 0 || pdfFiles.Count != descriptions.Count)
|
||||
throw new Exception("Invalid *.pdf file count!");
|
||||
List<WS.Attachment> dataAttachments = new();
|
||||
List<WS.Attachment> headerAttachments = new()
|
||||
{ new WS.Attachment(descriptions[0].HeaderUniqueId, "Data.txt", summaryFiles[0]) };
|
||||
int count;
|
||||
if (pdfFiles.Count < descriptions.Count)
|
||||
count = pdfFiles.Count;
|
||||
else
|
||||
count = descriptions.Count;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(pdfFiles[i]))
|
||||
dataAttachments.Add(new WS.Attachment(descriptions[i].UniqueId, "Image.pdf", pdfFiles[i]));
|
||||
}
|
||||
if (dataAttachments.Count == 0 || dataAttachments.Count != descriptions.Count)
|
||||
throw new Exception($"Invalid attachment count! {dataAttachments.Count} != {descriptions.Count}");
|
||||
WS.AttachFiles(openInsightMetrologyViewerAPI, wsResultsHeaderID, headerAttachments, dataAttachments);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user