Add IndexOf and AttemptCounter properties to WSRequest and Description classes; implement getValue function in recipes-and-patterns.js
This commit is contained in:
@ -15,6 +15,7 @@ public class WSRequest
|
|||||||
public bool SentToSPC { get; set; }
|
public bool SentToSPC { get; set; }
|
||||||
//
|
//
|
||||||
|
|
||||||
|
public string AttemptCounter { get; set; }
|
||||||
public string AutoOptimizeGain { get; set; }
|
public string AutoOptimizeGain { get; set; }
|
||||||
public string AutoProbeHeightSet { get; set; }
|
public string AutoProbeHeightSet { get; set; }
|
||||||
public string Avg { get; set; }
|
public string Avg { get; set; }
|
||||||
@ -27,6 +28,7 @@ public class WSRequest
|
|||||||
public string FileName { get; set; }
|
public string FileName { get; set; }
|
||||||
public string FilePath { get; set; }
|
public string FilePath { get; set; }
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
public string IndexOf { get; set; }
|
||||||
public string Layer { get; set; }
|
public string Layer { get; set; }
|
||||||
public string LotId { get; set; }
|
public string LotId { get; set; }
|
||||||
public string Op { get; set; }
|
public string Op { get; set; }
|
||||||
@ -56,18 +58,20 @@ public class WSRequest
|
|||||||
throw new Exception();
|
throw new Exception();
|
||||||
//Header
|
//Header
|
||||||
{
|
{
|
||||||
|
AttemptCounter = x.AttemptCounter;
|
||||||
AutoOptimizeGain = x.AutoOptimizeGain;
|
AutoOptimizeGain = x.AutoOptimizeGain;
|
||||||
AutoProbeHeightSet = x.AutoProbeHeightSet;
|
AutoProbeHeightSet = x.AutoProbeHeightSet;
|
||||||
Avg = x.Avg;
|
Avg = x.Avg;
|
||||||
DLRatio = x.DLRatio;
|
|
||||||
DataReject = x.DataReject;
|
DataReject = x.DataReject;
|
||||||
Date = x.Date;
|
Date = x.Date;
|
||||||
Op = x.Employee; // different name
|
DLRatio = x.DLRatio;
|
||||||
Engineer = x.Engineer;
|
Engineer = x.Engineer;
|
||||||
EquipId = logistics.MesEntity; // different name
|
EquipId = logistics.MesEntity; // different name
|
||||||
FileName = x.FileName;
|
FileName = x.FileName;
|
||||||
|
IndexOf = x.IndexOf;
|
||||||
Layer = x.Layer;
|
Layer = x.Layer;
|
||||||
LotId = x.Lot; // different name
|
LotId = x.Lot; // different name
|
||||||
|
Op = x.Employee; // different name
|
||||||
PSN = x.PSN;
|
PSN = x.PSN;
|
||||||
RDS = x.RDS;
|
RDS = x.RDS;
|
||||||
Reactor = x.Reactor;
|
Reactor = x.Reactor;
|
||||||
|
@ -30,6 +30,8 @@ public class Description : IDescription, Shared.Properties.IDescription
|
|||||||
[JsonPropertyName("PSN")] public string PSN { get; set; }
|
[JsonPropertyName("PSN")] public string PSN { get; set; }
|
||||||
[JsonPropertyName("Reactor")] public string Reactor { get; set; }
|
[JsonPropertyName("Reactor")] public string Reactor { get; set; }
|
||||||
[JsonPropertyName("RecipeName")] public string Recipe { get; set; }
|
[JsonPropertyName("RecipeName")] public string Recipe { get; set; }
|
||||||
|
[JsonPropertyName("IndexOf")] public string IndexOf { get; set; }
|
||||||
|
[JsonPropertyName("AttemptCounter")] public string AttemptCounter { get; set; }
|
||||||
//
|
//
|
||||||
[JsonPropertyName("AutoOptimizeGain")] public string AutoOptimizeGain { get; set; }
|
[JsonPropertyName("AutoOptimizeGain")] public string AutoOptimizeGain { get; set; }
|
||||||
[JsonPropertyName("AutoProbeHeightSet")] public string AutoProbeHeightSet { get; set; }
|
[JsonPropertyName("AutoProbeHeightSet")] public string AutoProbeHeightSet { get; set; }
|
||||||
@ -218,6 +220,8 @@ public class Description : IDescription, Shared.Properties.IDescription
|
|||||||
PSN = processData.PSN,
|
PSN = processData.PSN,
|
||||||
Reactor = processData.Reactor,
|
Reactor = processData.Reactor,
|
||||||
Recipe = processData.Recipe,
|
Recipe = processData.Recipe,
|
||||||
|
IndexOf = nameof(IndexOf),
|
||||||
|
AttemptCounter = nameof(AttemptCounter),
|
||||||
//
|
//
|
||||||
AutoOptimizeGain = processData.AutoOptimizeGain,
|
AutoOptimizeGain = processData.AutoOptimizeGain,
|
||||||
AutoProbeHeightSet = processData.AutoProbeHeightSet,
|
AutoProbeHeightSet = processData.AutoProbeHeightSet,
|
||||||
@ -282,6 +286,8 @@ public class Description : IDescription, Shared.Properties.IDescription
|
|||||||
PSN = nameof(PSN),
|
PSN = nameof(PSN),
|
||||||
Reactor = nameof(Reactor),
|
Reactor = nameof(Reactor),
|
||||||
Recipe = nameof(Recipe),
|
Recipe = nameof(Recipe),
|
||||||
|
IndexOf = nameof(IndexOf),
|
||||||
|
AttemptCounter = nameof(AttemptCounter),
|
||||||
//
|
//
|
||||||
AutoOptimizeGain = nameof(AutoOptimizeGain),
|
AutoOptimizeGain = nameof(AutoOptimizeGain),
|
||||||
AutoProbeHeightSet = nameof(AutoProbeHeightSet),
|
AutoProbeHeightSet = nameof(AutoProbeHeightSet),
|
||||||
|
@ -226,9 +226,9 @@ public class MonIn : IMonIn, IDisposable
|
|||||||
{
|
{
|
||||||
StringBuilder stringBuilder = new();
|
StringBuilder stringBuilder = new();
|
||||||
if (string.IsNullOrEmpty(subresource))
|
if (string.IsNullOrEmpty(subresource))
|
||||||
_ = stringBuilder.AppendFormat(_CultureInfo, "> {0} {1} \"{2}\" \"{3}\" {4} \n{5}", site.Trim(), timeStamp.HasValue ? GetDateTimeNowAsPosix(timeStamp.Value) : (object)"now", resource.Trim(), stateName.Trim(), state.Trim(), description.Trim());
|
_ = stringBuilder.AppendFormat(_CultureInfo, "> {0} {1} \"{2}\" \"{3}\" {4} \n{5}", site.Trim(), timeStamp.HasValue ? GetDateTimeNowAsPosix(timeStamp.Value) : "now", resource.Trim(), stateName.Trim(), state.Trim(), description.Trim());
|
||||||
else
|
else
|
||||||
_ = stringBuilder.AppendFormat(_CultureInfo, "> {0} {1} \"{2}\" \"{3}\" \"{4}\" {5} \n{6}", site.Trim(), timeStamp.HasValue ? GetDateTimeNowAsPosix(timeStamp.Value) : (object)"now", resource.Trim(), subresource.Trim(), stateName.Trim(), state.Trim(), description.Trim());
|
_ = stringBuilder.AppendFormat(_CultureInfo, "> {0} {1} \"{2}\" \"{3}\" \"{4}\" {5} \n{6}", site.Trim(), timeStamp.HasValue ? GetDateTimeNowAsPosix(timeStamp.Value) : "now", resource.Trim(), subresource.Trim(), stateName.Trim(), state.Trim(), description.Trim());
|
||||||
return stringBuilder.ToString();
|
return stringBuilder.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,14 +247,14 @@ public class MonIn : IMonIn, IDisposable
|
|||||||
if (string.IsNullOrEmpty(subresource))
|
if (string.IsNullOrEmpty(subresource))
|
||||||
{
|
{
|
||||||
if (unit.Equals(string.Empty) && !interval.HasValue)
|
if (unit.Equals(string.Empty) && !interval.HasValue)
|
||||||
_ = stringBuilder.AppendFormat(_CultureInfo, "> {0} {1} \"{2}\" \"{3}\" {4} \n{5}", site.Trim(), timeStamp.HasValue ? GetDateTimeNowAsPosix(timeStamp.Value) : (object)"now", resource.Trim(), performanceName.Trim(), value, description.Trim());
|
_ = stringBuilder.AppendFormat(_CultureInfo, "> {0} {1} \"{2}\" \"{3}\" {4} \n{5}", site.Trim(), timeStamp.HasValue ? GetDateTimeNowAsPosix(timeStamp.Value) : "now", resource.Trim(), performanceName.Trim(), value, description.Trim());
|
||||||
else
|
else
|
||||||
_ = stringBuilder.AppendFormat(_CultureInfo, "> {0} {1} \"{2}\" \"{3}\" {4} {5} {{interval={6}, unit={7}}}\n", site.Trim(), timeStamp.HasValue ? GetDateTimeNowAsPosix(timeStamp.Value) : (object)"now", resource.Trim(), performanceName.Trim(), value, description.Trim(), interval.HasValue ? interval.Value.ToString() : (object)string.Empty, unit.Trim());
|
_ = stringBuilder.AppendFormat(_CultureInfo, "> {0} {1} \"{2}\" \"{3}\" {4} {5} {{interval={6}, unit={7}}}\n", site.Trim(), timeStamp.HasValue ? GetDateTimeNowAsPosix(timeStamp.Value) : "now", resource.Trim(), performanceName.Trim(), value, description.Trim(), interval.HasValue ? interval.Value.ToString() : string.Empty, unit.Trim());
|
||||||
}
|
}
|
||||||
else if (unit.Equals(string.Empty) && !interval.HasValue)
|
else if (unit.Equals(string.Empty) && !interval.HasValue)
|
||||||
_ = stringBuilder.AppendFormat(_CultureInfo, "> {0} {1} \"{2}\" \"{3}\" \"{4}\" {5} \n{6}", site.Trim(), timeStamp.HasValue ? GetDateTimeNowAsPosix(timeStamp.Value) : (object)"now", resource.Trim(), subresource.Trim(), performanceName.Trim(), value, description.Trim());
|
_ = stringBuilder.AppendFormat(_CultureInfo, "> {0} {1} \"{2}\" \"{3}\" \"{4}\" {5} \n{6}", site.Trim(), timeStamp.HasValue ? GetDateTimeNowAsPosix(timeStamp.Value) : "now", resource.Trim(), subresource.Trim(), performanceName.Trim(), value, description.Trim());
|
||||||
else
|
else
|
||||||
_ = stringBuilder.AppendFormat(_CultureInfo, "> {0} {1} \"{2}\" \"{3}\" \"{4}\" {5} {6} {{interval={7}, unit={8}}}\n", site.Trim(), timeStamp.HasValue ? GetDateTimeNowAsPosix(timeStamp.Value) : (object)"now", resource.Trim(), subresource.Trim(), performanceName.Trim(), value, description.Trim(), interval.HasValue ? interval.Value.ToString() : (object)string.Empty, unit.Trim());
|
_ = stringBuilder.AppendFormat(_CultureInfo, "> {0} {1} \"{2}\" \"{3}\" \"{4}\" {5} {6} {{interval={7}, unit={8}}}\n", site.Trim(), timeStamp.HasValue ? GetDateTimeNowAsPosix(timeStamp.Value) : "now", resource.Trim(), subresource.Trim(), performanceName.Trim(), value, description.Trim(), interval.HasValue ? interval.Value.ToString() : string.Empty, unit.Trim());
|
||||||
return stringBuilder.ToString();
|
return stringBuilder.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text.Json.Serialization;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
namespace Adaptation.Shared;
|
namespace Adaptation.Shared;
|
||||||
|
@ -187,7 +187,7 @@ internal class ProcessDataStandardFormat
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
string? linesOne = lines.Length > 0 && body.Count == 0 && columns.Count == 0 ? lines[1] : null;
|
string? linesOne = lines.Length > 1 && body.Count == 0 && columns.Count == 0 ? lines[1] : null;
|
||||||
logistics = GetLogistics(footer, linesOne: linesOne);
|
logistics = GetLogistics(footer, linesOne: linesOne);
|
||||||
if (logistics.Count == 0)
|
if (logistics.Count == 0)
|
||||||
sequence = null;
|
sequence = null;
|
||||||
@ -235,7 +235,7 @@ internal class ProcessDataStandardFormat
|
|||||||
const int columnsLine = 6;
|
const int columnsLine = 6;
|
||||||
FileInfo fileInfo = new(reportFullPath);
|
FileInfo fileInfo = new(reportFullPath);
|
||||||
ProcessDataStandardFormat processDataStandardFormat = GetProcessDataStandardFormat(fileInfo.LastWriteTime, columnsLine, fileInfo.FullName, lines: null);
|
ProcessDataStandardFormat processDataStandardFormat = GetProcessDataStandardFormat(fileInfo.LastWriteTime, columnsLine, fileInfo.FullName, lines: null);
|
||||||
JsonElement[]? jsonElements = processDataStandardFormatMapping.OldColumnNames.Count != processDataStandardFormatMapping.ColumnIndices.Count ? null : GetFullArray(processDataStandardFormat);
|
JsonElement[]? jsonElements = processDataStandardFormatMapping.OldColumnNames.Count == 0 ? null : GetFullArray(processDataStandardFormat);
|
||||||
JsonProperty[]? jsonProperties = jsonElements is null || jsonElements.Length == 0 ? null : jsonElements[0].EnumerateObject().ToArray();
|
JsonProperty[]? jsonProperties = jsonElements is null || jsonElements.Length == 0 ? null : jsonElements[0].EnumerateObject().ToArray();
|
||||||
if (jsonElements is null || jsonProperties is null || jsonProperties.Length != processDataStandardFormatMapping.NewColumnNames.Count)
|
if (jsonElements is null || jsonProperties is null || jsonProperties.Length != processDataStandardFormatMapping.NewColumnNames.Count)
|
||||||
result = processDataStandardFormat;
|
result = processDataStandardFormat;
|
||||||
|
Reference in New Issue
Block a user