Add IndexOf and AttemptCounter properties to WSRequest and Description classes; implement getValue function in recipes-and-patterns.js
This commit is contained in:
@ -13,11 +13,13 @@ public class WSRequest
|
|||||||
{
|
{
|
||||||
|
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
public string AttemptCounter { get; set; }
|
||||||
public string Batch { get; set; }
|
public string Batch { get; set; }
|
||||||
public string Cassette { get; set; }
|
public string Cassette { get; set; }
|
||||||
public string CellName { get; set; }
|
public string CellName { get; set; }
|
||||||
public string Date { get; set; }
|
public string Date { get; set; }
|
||||||
public string FilePath { get; set; }
|
public string FilePath { get; set; }
|
||||||
|
public string IndexOf { get; set; }
|
||||||
public string MeanThickness { get; set; }
|
public string MeanThickness { get; set; }
|
||||||
public string Operator { get; set; }
|
public string Operator { get; set; }
|
||||||
public string PSN { get; set; }
|
public string PSN { get; set; }
|
||||||
@ -43,9 +45,11 @@ public class WSRequest
|
|||||||
Details = new List<Stratus.Detail>();
|
Details = new List<Stratus.Detail>();
|
||||||
//Header
|
//Header
|
||||||
{
|
{
|
||||||
|
AttemptCounter = x.AttemptCounter;
|
||||||
Batch = x.Lot; // different name
|
Batch = x.Lot; // different name
|
||||||
Cassette = x.Cassette;
|
Cassette = x.Cassette;
|
||||||
Date = x.Date;
|
Date = x.Date;
|
||||||
|
IndexOf = x.IndexOf;
|
||||||
MeanThickness = x.MeanThickness;
|
MeanThickness = x.MeanThickness;
|
||||||
Operator = x.Employee; // different name
|
Operator = x.Employee; // different name
|
||||||
PSN = x.PSN;
|
PSN = x.PSN;
|
||||||
|
|||||||
@ -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("Recipe")] public string Recipe { get; set; }
|
[JsonPropertyName("Recipe")] public string Recipe { get; set; }
|
||||||
|
[JsonPropertyName("IndexOf")] public string IndexOf { get; set; }
|
||||||
|
[JsonPropertyName("AttemptCounter")] public string AttemptCounter { get; set; }
|
||||||
//
|
//
|
||||||
[JsonPropertyName("Cassette")] public string Cassette { get; set; }
|
[JsonPropertyName("Cassette")] public string Cassette { get; set; }
|
||||||
[JsonPropertyName("GradeStdDev")] public string GradeStdDev { get; set; }
|
[JsonPropertyName("GradeStdDev")] public string GradeStdDev { get; set; }
|
||||||
@ -203,6 +205,8 @@ public class Description : IDescription, Shared.Properties.IDescription
|
|||||||
PSN = processData.PSN,
|
PSN = processData.PSN,
|
||||||
Reactor = processData.Reactor,
|
Reactor = processData.Reactor,
|
||||||
Recipe = detail.Recipe,
|
Recipe = detail.Recipe,
|
||||||
|
IndexOf = nameof(IndexOf),
|
||||||
|
AttemptCounter = nameof(AttemptCounter),
|
||||||
//
|
//
|
||||||
Cassette = processData.Cassette,
|
Cassette = processData.Cassette,
|
||||||
GradeStdDev = processData.StdDev,
|
GradeStdDev = processData.StdDev,
|
||||||
@ -262,6 +266,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),
|
||||||
//
|
//
|
||||||
Cassette = nameof(Cassette),
|
Cassette = nameof(Cassette),
|
||||||
GradeStdDev = nameof(GradeStdDev),
|
GradeStdDev = nameof(GradeStdDev),
|
||||||
|
|||||||
@ -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