Thickness01-Thickness14
v2_52_0-Tests editorconfig net8.0
This commit is contained in:
@ -128,7 +128,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
string jobIdDirectory = Path.Combine(_JobIdParentDirectory, _Logistics.JobID);
|
||||
if (!Directory.Exists(jobIdDirectory))
|
||||
_ = Directory.CreateDirectory(jobIdDirectory);
|
||||
if (!Directory.GetDirectories(jobIdDirectory).Any())
|
||||
if (Directory.GetDirectories(jobIdDirectory).Length == 0)
|
||||
File.Copy(reportFullPath, Path.Combine(destinationArchiveDirectory, Path.GetFileName(reportFullPath)));
|
||||
else
|
||||
{
|
||||
|
@ -157,7 +157,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
if (!Directory.Exists(inProcessDirectory))
|
||||
_ = Directory.CreateDirectory(inProcessDirectory);
|
||||
files = Directory.GetFiles(inProcessDirectory, "*", SearchOption.AllDirectories);
|
||||
if (files.Any())
|
||||
if (files.Length != 0)
|
||||
{
|
||||
if (files.Length > 250)
|
||||
throw new Exception("Safety net!");
|
||||
|
@ -6,7 +6,6 @@ using Adaptation.Shared.Methods;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
@ -129,7 +128,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
for (int i = 0; i < int.MaxValue; i++)
|
||||
{
|
||||
found = Directory.GetFiles(searchDirectory, fileName, SearchOption.AllDirectories);
|
||||
if (found.Any())
|
||||
if (found.Length != 0)
|
||||
{
|
||||
results.AddRange(found);
|
||||
break;
|
||||
@ -205,7 +204,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
}
|
||||
if (postCollection.Any())
|
||||
if (postCollection.Count != 0)
|
||||
{
|
||||
Thread.Sleep(500);
|
||||
StringBuilder stringBuilder = new();
|
||||
|
@ -156,7 +156,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
_ = Directory.CreateDirectory(duplicateDirectory);
|
||||
}
|
||||
string duplicateFile = Path.Combine(duplicateDirectory, Path.GetFileName(reportFullPath));
|
||||
if (descriptions.Any() && tests.Any())
|
||||
if (descriptions.Count != 0 && tests.Length != 0)
|
||||
{
|
||||
string lines = GetLines(descriptions);
|
||||
if (!string.IsNullOrEmpty(lines))
|
||||
|
@ -135,17 +135,17 @@ public class FromIQS
|
||||
else
|
||||
{
|
||||
JsonElement[]? jsonElements = JsonSerializer.Deserialize<JsonElement[]>(stringBuilder.ToString());
|
||||
if (jsonElements is null || !jsonElements.Any() || jsonElements[0].ValueKind != JsonValueKind.Object)
|
||||
if (jsonElements is null || jsonElements.Length == 0 || jsonElements[0].ValueKind != JsonValueKind.Object)
|
||||
commandText = stringBuilder.ToString();
|
||||
else
|
||||
{
|
||||
JsonProperty[] jsonProperties = jsonElements[0].EnumerateObject().ToArray();
|
||||
if (!jsonProperties.Any() || jsonProperties[3].Name != "se_sgrp" || !long.TryParse(jsonProperties[3].Value.ToString(), out long subGroupId))
|
||||
if (jsonProperties.Length == 0 || jsonProperties[3].Name != "se_sgrp" || !long.TryParse(jsonProperties[3].Value.ToString(), out long subGroupId))
|
||||
commandText = stringBuilder.ToString();
|
||||
else
|
||||
{
|
||||
result = subGroupId;
|
||||
if (jsonProperties.Any() && jsonProperties[0].Name == "ev_count" && int.TryParse(jsonProperties[0].Value.ToString(), out int evCount))
|
||||
if (jsonProperties.Length != 0 && jsonProperties[0].Name == "ev_count" && int.TryParse(jsonProperties[0].Value.ToString(), out int evCount))
|
||||
count = evCount;
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,6 @@
|
||||
using Adaptation.Shared.Properties;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Adaptation.FileHandlers.OpenInsightMetrologyViewer;
|
||||
|
||||
@ -80,7 +79,7 @@ public class WSRequest
|
||||
Details.Add(detail);
|
||||
}
|
||||
Date ??= logistics.DateTimeFromSequence.ToString();
|
||||
if (UniqueId is null && Details.Any())
|
||||
if (UniqueId is null && Details.Count != 0)
|
||||
UniqueId = Details[0].HeaderUniqueId;
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,21 @@ public class Description : IDescription, Shared.Properties.IDescription
|
||||
public string ThicknessFourteenCriticalPointsAverage { get; set; }
|
||||
public string ThicknessFourteenCriticalPointsStdDev { get; set; }
|
||||
public string ThicknessFourteenMeanFrom { get; set; }
|
||||
public string ThicknessFourteenPoints { get; set; }
|
||||
//
|
||||
public string Thickness01 { get; set; }
|
||||
public string Thickness02 { get; set; }
|
||||
public string Thickness03 { get; set; }
|
||||
public string Thickness04 { get; set; }
|
||||
public string Thickness05 { get; set; }
|
||||
public string Thickness06 { get; set; }
|
||||
public string Thickness07 { get; set; }
|
||||
public string Thickness08 { get; set; }
|
||||
public string Thickness09 { get; set; }
|
||||
public string Thickness10 { get; set; }
|
||||
public string Thickness11 { get; set; }
|
||||
public string Thickness12 { get; set; }
|
||||
public string Thickness13 { get; set; }
|
||||
public string Thickness14 { get; set; }
|
||||
|
||||
string IDescription.GetEventDescription() => "File Has been read and parsed";
|
||||
|
||||
@ -127,7 +141,6 @@ public class Description : IDescription, Shared.Properties.IDescription
|
||||
nameof(ThicknessFourteenCriticalPointsAverage),
|
||||
nameof(ThicknessFourteenCriticalPointsStdDev),
|
||||
nameof(ThicknessFourteenMeanFrom),
|
||||
nameof(ThicknessFourteenPoints),
|
||||
};
|
||||
return results;
|
||||
}
|
||||
@ -179,7 +192,7 @@ public class Description : IDescription, Shared.Properties.IDescription
|
||||
List<IDescription> IDescription.GetDescriptions(IFileRead fileRead, Logistics logistics, List<Test> tests, IProcessData iProcessData)
|
||||
{
|
||||
List<IDescription> results = new();
|
||||
if (iProcessData is null || !iProcessData.Details.Any() || iProcessData is not ProcessData processData)
|
||||
if (iProcessData is null || iProcessData.Details.Count == 0 || iProcessData is not ProcessData processData)
|
||||
results.Add(GetDefault(fileRead, logistics));
|
||||
else
|
||||
{
|
||||
@ -241,7 +254,20 @@ public class Description : IDescription, Shared.Properties.IDescription
|
||||
ThicknessFourteenCriticalPointsAverage = processData.ThicknessFourteenCriticalPointsAverage,
|
||||
ThicknessFourteenCriticalPointsStdDev = processData.ThicknessFourteenCriticalPointsStdDev,
|
||||
ThicknessFourteenMeanFrom = processData.ThicknessFourteenMeanFrom,
|
||||
ThicknessFourteenPoints = processData.ThicknessFourteenPoints,
|
||||
Thickness01 = iProcessData.Details.Count < 1 || iProcessData.Details[0] is not Detail thickness01 ? string.Empty : thickness01.Thickness,
|
||||
Thickness02 = iProcessData.Details.Count < 2 || iProcessData.Details[1] is not Detail thickness02 ? string.Empty : thickness02.Thickness,
|
||||
Thickness03 = iProcessData.Details.Count < 3 || iProcessData.Details[2] is not Detail thickness03 ? string.Empty : thickness03.Thickness,
|
||||
Thickness04 = iProcessData.Details.Count < 4 || iProcessData.Details[3] is not Detail thickness04 ? string.Empty : thickness04.Thickness,
|
||||
Thickness05 = iProcessData.Details.Count < 5 || iProcessData.Details[4] is not Detail thickness05 ? string.Empty : thickness05.Thickness,
|
||||
Thickness06 = iProcessData.Details.Count < 6 || iProcessData.Details[5] is not Detail thickness06 ? string.Empty : thickness06.Thickness,
|
||||
Thickness07 = iProcessData.Details.Count < 7 || iProcessData.Details[6] is not Detail thickness07 ? string.Empty : thickness07.Thickness,
|
||||
Thickness08 = iProcessData.Details.Count < 8 || iProcessData.Details[7] is not Detail thickness08 ? string.Empty : thickness08.Thickness,
|
||||
Thickness09 = iProcessData.Details.Count < 9 || iProcessData.Details[8] is not Detail thickness09 ? string.Empty : thickness09.Thickness,
|
||||
Thickness10 = iProcessData.Details.Count < 10 || iProcessData.Details[9] is not Detail thickness10 ? string.Empty : thickness10.Thickness,
|
||||
Thickness11 = iProcessData.Details.Count < 11 || iProcessData.Details[10] is not Detail thickness11 ? string.Empty : thickness11.Thickness,
|
||||
Thickness12 = iProcessData.Details.Count < 12 || iProcessData.Details[11] is not Detail thickness12 ? string.Empty : thickness12.Thickness,
|
||||
Thickness13 = iProcessData.Details.Count < 13 || iProcessData.Details[12] is not Detail thickness13 ? string.Empty : thickness13.Thickness,
|
||||
Thickness14 = iProcessData.Details.Count < 14 || iProcessData.Details[13] is not Detail thickness14 ? string.Empty : thickness14.Thickness,
|
||||
};
|
||||
results.Add(description);
|
||||
}
|
||||
@ -304,7 +330,21 @@ public class Description : IDescription, Shared.Properties.IDescription
|
||||
ThicknessFourteenCriticalPointsAverage = nameof(ThicknessFourteenCriticalPointsAverage),
|
||||
ThicknessFourteenCriticalPointsStdDev = nameof(ThicknessFourteenCriticalPointsStdDev),
|
||||
ThicknessFourteenMeanFrom = nameof(ThicknessFourteenMeanFrom),
|
||||
ThicknessFourteenPoints = nameof(ThicknessFourteenPoints),
|
||||
//
|
||||
Thickness01 = nameof(Thickness01),
|
||||
Thickness02 = nameof(Thickness02),
|
||||
Thickness03 = nameof(Thickness03),
|
||||
Thickness04 = nameof(Thickness04),
|
||||
Thickness05 = nameof(Thickness05),
|
||||
Thickness06 = nameof(Thickness06),
|
||||
Thickness07 = nameof(Thickness07),
|
||||
Thickness08 = nameof(Thickness08),
|
||||
Thickness09 = nameof(Thickness09),
|
||||
Thickness10 = nameof(Thickness10),
|
||||
Thickness11 = nameof(Thickness11),
|
||||
Thickness12 = nameof(Thickness12),
|
||||
Thickness13 = nameof(Thickness13),
|
||||
Thickness14 = nameof(Thickness14),
|
||||
};
|
||||
return result;
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ using Adaptation.Shared.Methods;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
@ -124,7 +123,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
}
|
||||
SetFileParameterLotID(mid);
|
||||
_Logistics.Update(mid, processData.Reactor);
|
||||
if (!iProcessData.Details.Any())
|
||||
if (iProcessData.Details.Count == 0)
|
||||
throw new Exception(string.Concat("B) No Data - ", dateTime.Ticks));
|
||||
results = iProcessData.GetResults(this, _Logistics, results.Item4);
|
||||
}
|
||||
|
@ -48,7 +48,6 @@ public partial class ProcessData : IProcessData
|
||||
public string ThicknessFourteenCriticalPointsAverage { get; set; }
|
||||
public string ThicknessFourteenCriticalPointsStdDev { get; set; }
|
||||
public string ThicknessFourteenMeanFrom { get; set; }
|
||||
public string ThicknessFourteenPoints { get; set; }
|
||||
|
||||
List<object> Shared.Properties.IProcessData.Details => _Details;
|
||||
|
||||
@ -360,7 +359,6 @@ public partial class ProcessData : IProcessData
|
||||
}
|
||||
if (thicknessPoints.Count != 14)
|
||||
{
|
||||
ThicknessFourteenPoints = string.Empty;
|
||||
ThicknessFourteenMeanFrom = string.Empty;
|
||||
ThicknessFourteenCenterMean = string.Empty;
|
||||
ThicknessFourteen3mmEdgeMean = string.Empty;
|
||||
@ -372,7 +370,6 @@ public partial class ProcessData : IProcessData
|
||||
}
|
||||
else
|
||||
{
|
||||
ThicknessFourteenPoints = string.Join(",", thicknessPoints);
|
||||
ReadOnlyCollection<double> thicknessTenPoints = new(thicknessPoints.Take(10).ToArray());
|
||||
double thicknessFourteenCriticalPointsAverage = thicknessTenPoints.Average(); // 15
|
||||
double thicknessFourteenCriticalPointsStdDev = StandardDeviation(thicknessTenPoints); // 16
|
||||
|
Reference in New Issue
Block a user